   h2
 d2
 ^2
 {"files":{"dist":{"files":{"assets":{"files":{"logo-mac.png":{"size":144713,"offset":"0","integrity":{"algorithm":"SHA256","hash":"acd78cdef336c50d138bd1ec47f49e150220fd0485cc301c7280f70b900a510c","blockSize":4194304,"blocks":["acd78cdef336c50d138bd1ec47f49e150220fd0485cc301c7280f70b900a510c"]}},"logo.icns":{"size":122924,"offset":"144713","integrity":{"algorithm":"SHA256","hash":"fcf2d211b33261de7092ad7854ae21e02cd1c9e768149ebb6cc988ad501aa6cd","blockSize":4194304,"blocks":["fcf2d211b33261de7092ad7854ae21e02cd1c9e768149ebb6cc988ad501aa6cd"]}},"logo.ico":{"size":46331,"offset":"267637","integrity":{"algorithm":"SHA256","hash":"dd2bae7d9f1f1685cf5108abba2b7469cef097b17a7aa029ceb5d4f7c6c68a0a","blockSize":4194304,"blocks":["dd2bae7d9f1f1685cf5108abba2b7469cef097b17a7aa029ceb5d4f7c6c68a0a"]}},"logo.png":{"size":181573,"offset":"313968","integrity":{"algorithm":"SHA256","hash":"b7b656e603e1fe2e4bf4d93c7ac82c3d593992da7627fa840d50415789fcaa6c","blockSize":4194304,"blocks":["b7b656e603e1fe2e4bf4d93c7ac82c3d593992da7627fa840d50415789fcaa6c"]}},"logo@2x.icns":{"size":426504,"offset":"495541","integrity":{"algorithm":"SHA256","hash":"dc590e38559ff5ae2a9e6771b25db1aa4c48de846eea4006041eba89661f6f46","blockSize":4194304,"blocks":["dc590e38559ff5ae2a9e6771b25db1aa4c48de846eea4006041eba89661f6f46"]}},"logo@2x.png":{"size":137599,"offset":"922045","integrity":{"algorithm":"SHA256","hash":"2a1769445740e669f607edc40cf5b91f87d41cbf61fc4e0bef7cdae3e58d8752","blockSize":4194304,"blocks":["2a1769445740e669f607edc40cf5b91f87d41cbf61fc4e0bef7cdae3e58d8752"]}}}},"main.js":{"size":13357,"offset":"1059644","integrity":{"algorithm":"SHA256","hash":"99dd328f1deadd5fe96125fc5d46b35cb619374cbcbe743f6e4f59453468042a","blockSize":4194304,"blocks":["99dd328f1deadd5fe96125fc5d46b35cb619374cbcbe743f6e4f59453468042a"]}},"preload.js":{"size":1823,"offset":"1073001","integrity":{"algorithm":"SHA256","hash":"9106d10dad9f93e6c01928e4dfb95e346aa5f9b52b567ae765c55329f0e315e7","blockSize":4194304,"blocks":["9106d10dad9f93e6c01928e4dfb95e346aa5f9b52b567ae765c55329f0e315e7"]}}}},"node_modules":{"files":{".modules.yaml":{"size":41948,"offset":"1074824","integrity":{"algorithm":"SHA256","hash":"a90b182e71fdcfa70b3be395f272c3dbe49633f7c8300dd3b346fdb028c87ff7","blockSize":4194304,"blocks":["a90b182e71fdcfa70b3be395f272c3dbe49633f7c8300dd3b346fdb028c87ff7"]}},".pnpm":{"files":{"lock.yaml":{"size":180537,"offset":"1116772","integrity":{"algorithm":"SHA256","hash":"206023f905277dec3942a1489d53f8e4dad74fc3b3a4bc2f7d2e91842531f195","blockSize":4194304,"blocks":["206023f905277dec3942a1489d53f8e4dad74fc3b3a4bc2f7d2e91842531f195"]}}}},"@electron":{"files":{}},"@electron-forge":{"files":{}},"@esbuild":{"files":{}},"@eslint":{"files":{}},"@eslint-community":{"files":{}},"@gar":{"files":{}},"@humanwhocodes":{"files":{}},"@isaacs":{"files":{}},"@malept":{"files":{}},"@nodelib":{"files":{}},"@npmcli":{"files":{}},"@octokit":{"files":{}},"@pkgjs":{"files":{}},"@pkgr":{"files":{}},"@sentry":{"files":{"browser":{"files":{"cjs":{"files":{"client.js":{"size":4436,"offset":"2129528","integrity":{"algorithm":"SHA256","hash":"f7572be9c563627b9484a8e1a4aedc174b7f69fb989cfb4aaea982c560c3efa3","blockSize":4194304,"blocks":["f7572be9c563627b9484a8e1a4aedc174b7f69fb989cfb4aaea982c560c3efa3"]}},"client.js.map":{"size":8497,"offset":"2133964","integrity":{"algorithm":"SHA256","hash":"082f10189330d526bc0b9633361812003864474c59d8264458c2f263ceac2e9d","blockSize":4194304,"blocks":["082f10189330d526bc0b9633361812003864474c59d8264458c2f263ceac2e9d"]}},"eventbuilder.js":{"size":8184,"offset":"2142461","integrity":{"algorithm":"SHA256","hash":"c3e52edbe5c88a15271456eb63aaa1db9bc99c1e09d74dec2b7df55e923fa85a","blockSize":4194304,"blocks":["c3e52edbe5c88a15271456eb63aaa1db9bc99c1e09d74dec2b7df55e923fa85a"]}},"eventbuilder.js.map":{"size":15494,"offset":"2150645","integrity":{"algorithm":"SHA256","hash":"5d5612e0c8cd9e7c9b8dd82cd8581d4b4df950a7b1edcca7c3d20a80a408b60d","blockSize":4194304,"blocks":["5d5612e0c8cd9e7c9b8dd82cd8581d4b4df950a7b1edcca7c3d20a80a408b60d"]}},"helpers.js":{"size":4427,"offset":"2166139","integrity":{"algorithm":"SHA256","hash":"cc9b00de2acfbb96377dce4d3fd3567f1907adf8164205f0c4e7d749ee1ac3a4","blockSize":4194304,"blocks":["cc9b00de2acfbb96377dce4d3fd3567f1907adf8164205f0c4e7d749ee1ac3a4"]}},"helpers.js.map":{"size":8345,"offset":"2170566","integrity":{"algorithm":"SHA256","hash":"9dad0d0854b8a61b6cfd7ca0f8a507ac7f2e4367f67d382ffedd8a62c6819938","blockSize":4194304,"blocks":["9dad0d0854b8a61b6cfd7ca0f8a507ac7f2e4367f67d382ffedd8a62c6819938"]}},"index.js":{"size":4757,"offset":"2178911","integrity":{"algorithm":"SHA256","hash":"5432b2353eb1c59998ec08532e5b0c6e4cfd39fed9709694d06a487a9ba949b2","blockSize":4194304,"blocks":["5432b2353eb1c59998ec08532e5b0c6e4cfd39fed9709694d06a487a9ba949b2"]}},"index.js.map":{"size":1821,"offset":"2183668","integrity":{"algorithm":"SHA256","hash":"d6ebc9040ddcabc94f2e151ede8cac6ece5aab221f733b7b6fd8c4e9a962dd2e","blockSize":4194304,"blocks":["d6ebc9040ddcabc94f2e151ede8cac6ece5aab221f733b7b6fd8c4e9a962dd2e"]}},"integrations":{"files":{"breadcrumbs.js":{"size":8554,"offset":"2185489","integrity":{"algorithm":"SHA256","hash":"344736c814a0f8d0f0e29c0821b7f9bb4e4605fff9994150434faa8086a1cda5","blockSize":4194304,"blocks":["344736c814a0f8d0f0e29c0821b7f9bb4e4605fff9994150434faa8086a1cda5"]}},"breadcrumbs.js.map":{"size":17339,"offset":"2194043","integrity":{"algorithm":"SHA256","hash":"58b35fbc00cb5848e13365be0997732d65afb10ce392764d53a43dc353e4718f","blockSize":4194304,"blocks":["58b35fbc00cb5848e13365be0997732d65afb10ce392764d53a43dc353e4718f"]}},"dedupe.js":{"size":5510,"offset":"2211382","integrity":{"algorithm":"SHA256","hash":"ca058442e2b36d6b053bf8aa7ff3cb2c392ac907c91b3b3a93ca46ee77cd8fe7","blockSize":4194304,"blocks":["ca058442e2b36d6b053bf8aa7ff3cb2c392ac907c91b3b3a93ca46ee77cd8fe7"]}},"dedupe.js.map":{"size":10881,"offset":"2216892","integrity":{"algorithm":"SHA256","hash":"66cc0bca8f052d04265825ff312c9c08ae1dc399bf705cd1805bc79da7e74beb","blockSize":4194304,"blocks":["66cc0bca8f052d04265825ff312c9c08ae1dc399bf705cd1805bc79da7e74beb"]}},"globalhandlers.js":{"size":7473,"offset":"2227773","integrity":{"algorithm":"SHA256","hash":"81420ce6ed6dedff42db51cb156be2b18bb5d2a2044ce8df6d26ba0ec8a2c5ce","blockSize":4194304,"blocks":["81420ce6ed6dedff42db51cb156be2b18bb5d2a2044ce8df6d26ba0ec8a2c5ce"]}},"globalhandlers.js.map":{"size":14505,"offset":"2235246","integrity":{"algorithm":"SHA256","hash":"9391396945b37d79bfdfef812597c5b3a167b9cf1645743eaea3cd2b35bcdfec","blockSize":4194304,"blocks":["9391396945b37d79bfdfef812597c5b3a167b9cf1645743eaea3cd2b35bcdfec"]}},"httpcontext.js":{"size":1575,"offset":"2249751","integrity":{"algorithm":"SHA256","hash":"4be4103a986ac358402fa69a6868deb17e1c41d65d58c233956379d086347b70","blockSize":4194304,"blocks":["4be4103a986ac358402fa69a6868deb17e1c41d65d58c233956379d086347b70"]}},"httpcontext.js.map":{"size":2949,"offset":"2251326","integrity":{"algorithm":"SHA256","hash":"fdac7f5a4ec25736b917c4426ef7fb97c1a2c468fcc0c9cda08d47b17ceee91f","blockSize":4194304,"blocks":["fdac7f5a4ec25736b917c4426ef7fb97c1a2c468fcc0c9cda08d47b17ceee91f"]}},"index.js":{"size":657,"offset":"2254275","integrity":{"algorithm":"SHA256","hash":"bbe29af6468996ba12ffb242e551bda8b245a9639091ceb26429e6100cb53bcf","blockSize":4194304,"blocks":["bbe29af6468996ba12ffb242e551bda8b245a9639091ceb26429e6100cb53bcf"]}},"index.js.map":{"size":105,"offset":"2254932","integrity":{"algorithm":"SHA256","hash":"316300a36acfd65ce9b837a58307f0107f92938c51e53bd14db57b11e86df8d5","blockSize":4194304,"blocks":["316300a36acfd65ce9b837a58307f0107f92938c51e53bd14db57b11e86df8d5"]}},"linkederrors.js":{"size":2036,"offset":"2255037","integrity":{"algorithm":"SHA256","hash":"f510c06c84c456939b26e8077559cbbcaef74578507fe7d9b503f0d19163edb2","blockSize":4194304,"blocks":["f510c06c84c456939b26e8077559cbbcaef74578507fe7d9b503f0d19163edb2"]}},"linkederrors.js.map":{"size":4696,"offset":"2257073","integrity":{"algorithm":"SHA256","hash":"22ef828542d1eb484b479c39b8622a1dbfc31a2b122111b78228631f14cfa029","blockSize":4194304,"blocks":["22ef828542d1eb484b479c39b8622a1dbfc31a2b122111b78228631f14cfa029"]}},"trycatch.js":{"size":8896,"offset":"2261769","integrity":{"algorithm":"SHA256","hash":"bf9741810068e641946f329ac8b799e0b742933999bb085255e549b76acde64e","blockSize":4194304,"blocks":["bf9741810068e641946f329ac8b799e0b742933999bb085255e549b76acde64e"]}},"trycatch.js.map":{"size":15885,"offset":"2270665","integrity":{"algorithm":"SHA256","hash":"0739a1cecc4e877f915b191fd42ec82858a3cafe995561bfd2d1113ab4cff2d6","blockSize":4194304,"blocks":["0739a1cecc4e877f915b191fd42ec82858a3cafe995561bfd2d1113ab4cff2d6"]}}}},"profiling":{"files":{"cache.js":{"size":1766,"offset":"2286550","integrity":{"algorithm":"SHA256","hash":"8dd22f576c57e2712fbad70223e6095bfdbdcacb4cf283a75abe50e8fc4e56f3","blockSize":4194304,"blocks":["8dd22f576c57e2712fbad70223e6095bfdbdcacb4cf283a75abe50e8fc4e56f3"]}},"cache.js.map":{"size":3490,"offset":"2288316","integrity":{"algorithm":"SHA256","hash":"b3bb002b1399e11a833a0dbe1c93e00d3c1a597847ceb2466b3442c4e290cede","blockSize":4194304,"blocks":["b3bb002b1399e11a833a0dbe1c93e00d3c1a597847ceb2466b3442c4e290cede"]}},"hubextensions.js":{"size":11930,"offset":"2291806","integrity":{"algorithm":"SHA256","hash":"3f8a101d87151fcd6e595eca13798192855d94aed155d39b6fdab30b5197ccea","blockSize":4194304,"blocks":["3f8a101d87151fcd6e595eca13798192855d94aed155d39b6fdab30b5197ccea"]}},"hubextensions.js.map":{"size":18242,"offset":"2303736","integrity":{"algorithm":"SHA256","hash":"24e1aa21c4fa051b5b8d068e6fcd811a38958ed2783ef11eec8f5e2151c13289","blockSize":4194304,"blocks":["24e1aa21c4fa051b5b8d068e6fcd811a38958ed2783ef11eec8f5e2151c13289"]}},"integration.js":{"size":2073,"offset":"2321978","integrity":{"algorithm":"SHA256","hash":"a915ba2bfbb5c09dea142a6f4ab3b9ba9cfde044cde9a596270632125ceac3f2","blockSize":4194304,"blocks":["a915ba2bfbb5c09dea142a6f4ab3b9ba9cfde044cde9a596270632125ceac3f2"]}},"integration.js.map":{"size":3068,"offset":"2324051","integrity":{"algorithm":"SHA256","hash":"cbc8e37f26b0c654c7931a6e0195854741b922df2613b5bfe007a8e756834622","blockSize":4194304,"blocks":["cbc8e37f26b0c654c7931a6e0195854741b922df2613b5bfe007a8e756834622"]}},"sendProfile.js":{"size":3548,"offset":"2327119","integrity":{"algorithm":"SHA256","hash":"81f6ba7ccb8e4445493b3548a07f7b94ba5e25935b5eb47dfb156cc80eba0cd5","blockSize":4194304,"blocks":["81f6ba7ccb8e4445493b3548a07f7b94ba5e25935b5eb47dfb156cc80eba0cd5"]}},"sendProfile.js.map":{"size":5490,"offset":"2330667","integrity":{"algorithm":"SHA256","hash":"cdbc65ad696354dffc1761fa08099ca2dc6e32526de13dd953a5a6603d8722e7","blockSize":4194304,"blocks":["cdbc65ad696354dffc1761fa08099ca2dc6e32526de13dd953a5a6603d8722e7"]}},"utils.js":{"size":10121,"offset":"2336157","integrity":{"algorithm":"SHA256","hash":"de4e79076b115d9313b76cb75a80d9134303dc8dc07c46a5975572e55fede93a","blockSize":4194304,"blocks":["de4e79076b115d9313b76cb75a80d9134303dc8dc07c46a5975572e55fede93a"]}},"utils.js.map":{"size":20963,"offset":"2346278","integrity":{"algorithm":"SHA256","hash":"55faf1d5599b801d8d82904b468163a2d0a3cc2d3cd4e28e386e63416fad1352","blockSize":4194304,"blocks":["55faf1d5599b801d8d82904b468163a2d0a3cc2d3cd4e28e386e63416fad1352"]}}}},"sdk.js":{"size":9439,"offset":"2367241","integrity":{"algorithm":"SHA256","hash":"726bc1882652430ace27cfc5dd82ae6651237fc41a86a131bd8750c8427fa53b","blockSize":4194304,"blocks":["726bc1882652430ace27cfc5dd82ae6651237fc41a86a131bd8750c8427fa53b"]}},"sdk.js.map":{"size":14937,"offset":"2376680","integrity":{"algorithm":"SHA256","hash":"6f9820ac9a45ed9ccceebbebab9a5f89eaf0c90558352e4e032790dc6ba221e8","blockSize":4194304,"blocks":["6f9820ac9a45ed9ccceebbebab9a5f89eaf0c90558352e4e032790dc6ba221e8"]}},"stack-parsers.js":{"size":6249,"offset":"2391617","integrity":{"algorithm":"SHA256","hash":"2eb6a55b35cf98622c45b32caf4be2b6f7dc2bae797067766d0cbcb3124c5be7","blockSize":4194304,"blocks":["2eb6a55b35cf98622c45b32caf4be2b6f7dc2bae797067766d0cbcb3124c5be7"]}},"stack-parsers.js.map":{"size":12728,"offset":"2397866","integrity":{"algorithm":"SHA256","hash":"df7c9e0adf22d030638cf47741c778170b31ec6b945fbddc090b7a4d36fb1305","blockSize":4194304,"blocks":["df7c9e0adf22d030638cf47741c778170b31ec6b945fbddc090b7a4d36fb1305"]}},"transports":{"files":{"fetch.js":{"size":2535,"offset":"2410594","integrity":{"algorithm":"SHA256","hash":"b9ae8da13b1650c48d520b744a2e7bfbdb0d0d2428a6ebef0af6002bf9aa9cfd","blockSize":4194304,"blocks":["b9ae8da13b1650c48d520b744a2e7bfbdb0d0d2428a6ebef0af6002bf9aa9cfd"]}},"fetch.js.map":{"size":4310,"offset":"2413129","integrity":{"algorithm":"SHA256","hash":"469c4602116a0d67b857ef6aa924f6b0ffccbec1f44c4aa2d7f20f006a23e23b","blockSize":4194304,"blocks":["469c4602116a0d67b857ef6aa924f6b0ffccbec1f44c4aa2d7f20f006a23e23b"]}},"offline.js":{"size":4028,"offset":"2417439","integrity":{"algorithm":"SHA256","hash":"9d62d469f3f8c21ab6d8dde7d4e255dcf230a2bf6d94b7bcad9bc084fa6e144c","blockSize":4194304,"blocks":["9d62d469f3f8c21ab6d8dde7d4e255dcf230a2bf6d94b7bcad9bc084fa6e144c"]}},"offline.js.map":{"size":8659,"offset":"2421467","integrity":{"algorithm":"SHA256","hash":"67ba4be08e68ef3f0f5f4629c93b9ccaa9743c46ddf302cf8f109120fbff9a88","blockSize":4194304,"blocks":["67ba4be08e68ef3f0f5f4629c93b9ccaa9743c46ddf302cf8f109120fbff9a88"]}},"utils.js":{"size":3189,"offset":"2430126","integrity":{"algorithm":"SHA256","hash":"ebfacc4c645c082f8e4193f2adcb0c097759b4f282a129923f930f5d626757a0","blockSize":4194304,"blocks":["ebfacc4c645c082f8e4193f2adcb0c097759b4f282a129923f930f5d626757a0"]}},"utils.js.map":{"size":4486,"offset":"2433315","integrity":{"algorithm":"SHA256","hash":"959fb5b336b24e0adacd967c8e46d0629f2d9d7fbda2133469379fefd7f9b956","blockSize":4194304,"blocks":["959fb5b336b24e0adacd967c8e46d0629f2d9d7fbda2133469379fefd7f9b956"]}},"xhr.js":{"size":1528,"offset":"2437801","integrity":{"algorithm":"SHA256","hash":"4e0e4bfab55d173f7a32f9b0bceb575488e941347911d064e2c6d8b80f3cf100","blockSize":4194304,"blocks":["4e0e4bfab55d173f7a32f9b0bceb575488e941347911d064e2c6d8b80f3cf100"]}},"xhr.js.map":{"size":2961,"offset":"2439329","integrity":{"algorithm":"SHA256","hash":"588e438b03134cb01751ed04b60afbde37794186dc460bc20b84a2a48ec0fe00","blockSize":4194304,"blocks":["588e438b03134cb01751ed04b60afbde37794186dc460bc20b84a2a48ec0fe00"]}}}},"userfeedback.js":{"size":939,"offset":"2442290","integrity":{"algorithm":"SHA256","hash":"83aa36388b9eda2855fb80842c7210a68563d978238d31a1e0f32c77308f329a","blockSize":4194304,"blocks":["83aa36388b9eda2855fb80842c7210a68563d978238d31a1e0f32c77308f329a"]}},"userfeedback.js.map":{"size":2132,"offset":"2443229","integrity":{"algorithm":"SHA256","hash":"6da3520b2504f467446c9be20542f431a85fc2e51559e547c4069eca16b8402c","blockSize":4194304,"blocks":["6da3520b2504f467446c9be20542f431a85fc2e51559e547c4069eca16b8402c"]}}}},"esm":{"files":{"client.js":{"size":4339,"offset":"2445361","integrity":{"algorithm":"SHA256","hash":"e9e61bdeb0e914761bee6da0cdd54d32fc0a22220fb89a826ddfacb290cb043e","blockSize":4194304,"blocks":["e9e61bdeb0e914761bee6da0cdd54d32fc0a22220fb89a826ddfacb290cb043e"]}},"client.js.map":{"size":8274,"offset":"2449700","integrity":{"algorithm":"SHA256","hash":"75c7897b8d0a09d1f51b0a5c060194c3a4a88f2f4d543098cd229b2977b5e122","blockSize":4194304,"blocks":["75c7897b8d0a09d1f51b0a5c060194c3a4a88f2f4d543098cd229b2977b5e122"]}},"eventbuilder.js":{"size":7989,"offset":"2457974","integrity":{"algorithm":"SHA256","hash":"4452af16a4f3a8776a969bf9b15471c0cbcc65a70216c826cd884175987ae59f","blockSize":4194304,"blocks":["4452af16a4f3a8776a969bf9b15471c0cbcc65a70216c826cd884175987ae59f"]}},"eventbuilder.js.map":{"size":15243,"offset":"2465963","integrity":{"algorithm":"SHA256","hash":"98e811998b6c021eeaf6450a9f3002bcc18f0a85fbeafc0200fef49dbf2fd530","blockSize":4194304,"blocks":["98e811998b6c021eeaf6450a9f3002bcc18f0a85fbeafc0200fef49dbf2fd530"]}},"helpers.js":{"size":4378,"offset":"2481206","integrity":{"algorithm":"SHA256","hash":"c2f9bdab3f306693f783dee846aa615b7c4bb73fa9c09aa5b555185e56994169","blockSize":4194304,"blocks":["c2f9bdab3f306693f783dee846aa615b7c4bb73fa9c09aa5b555185e56994169"]}},"helpers.js.map":{"size":8169,"offset":"2485584","integrity":{"algorithm":"SHA256","hash":"23027b894e9ef04b9f9f0dc28a077b53c0343cd909186ea0576e843b2fa2d298","blockSize":4194304,"blocks":["23027b894e9ef04b9f9f0dc28a077b53c0343cd909186ea0576e843b2fa2d298"]}},"index.js":{"size":2397,"offset":"2493753","integrity":{"algorithm":"SHA256","hash":"d6134944bb66826faa00fd36035cde68f59ae97067cde128577daab96c93d109","blockSize":4194304,"blocks":["d6134944bb66826faa00fd36035cde68f59ae97067cde128577daab96c93d109"]}},"index.js.map":{"size":1743,"offset":"2496150","integrity":{"algorithm":"SHA256","hash":"6a6d6b4056c99807c76db10221971da34b92a40f0525b352e2c6f85bc5924b5d","blockSize":4194304,"blocks":["6a6d6b4056c99807c76db10221971da34b92a40f0525b352e2c6f85bc5924b5d"]}},"integrations":{"files":{"breadcrumbs.js":{"size":8442,"offset":"2497893","integrity":{"algorithm":"SHA256","hash":"50e5ff2048a6a45501e43312bae26eb90a0b2820ebd809eb093a0096d8a183c2","blockSize":4194304,"blocks":["50e5ff2048a6a45501e43312bae26eb90a0b2820ebd809eb093a0096d8a183c2"]}},"breadcrumbs.js.map":{"size":17133,"offset":"2506335","integrity":{"algorithm":"SHA256","hash":"2b52da8dec8f2e084fb5714557604aed6f4b755c42aaa46bb221cd61400786b1","blockSize":4194304,"blocks":["2b52da8dec8f2e084fb5714557604aed6f4b755c42aaa46bb221cd61400786b1"]}},"dedupe.js":{"size":5434,"offset":"2523468","integrity":{"algorithm":"SHA256","hash":"8e8d87e9c85a533e8727b8f8dab9fbd9098f0d11dd88db4ce4e21d8ab97a0b41","blockSize":4194304,"blocks":["8e8d87e9c85a533e8727b8f8dab9fbd9098f0d11dd88db4ce4e21d8ab97a0b41"]}},"dedupe.js.map":{"size":10870,"offset":"2528902","integrity":{"algorithm":"SHA256","hash":"2e7a9443349d14e34dd2e0bbf16fd412bbd4cf45feb3195f066633b6deae73db","blockSize":4194304,"blocks":["2e7a9443349d14e34dd2e0bbf16fd412bbd4cf45feb3195f066633b6deae73db"]}},"globalhandlers.js":{"size":7425,"offset":"2539772","integrity":{"algorithm":"SHA256","hash":"2ef6ea76f04175df5c29437d59f3023b34aa82bf1b7d5c85157a43dc5ca407b3","blockSize":4194304,"blocks":["2ef6ea76f04175df5c29437d59f3023b34aa82bf1b7d5c85157a43dc5ca407b3"]}},"globalhandlers.js.map":{"size":14305,"offset":"2547197","integrity":{"algorithm":"SHA256","hash":"065bed8d2e36a233635c69d8965f966701896d42390db1a67be3a20ad027e816","blockSize":4194304,"blocks":["065bed8d2e36a233635c69d8965f966701896d42390db1a67be3a20ad027e816"]}},"httpcontext.js":{"size":1465,"offset":"2561502","integrity":{"algorithm":"SHA256","hash":"30b703e0008c4e8a3887c90647c870a5fa52b680365bb87f6a1cd573d2b23a65","blockSize":4194304,"blocks":["30b703e0008c4e8a3887c90647c870a5fa52b680365bb87f6a1cd573d2b23a65"]}},"httpcontext.js.map":{"size":2887,"offset":"2562967","integrity":{"algorithm":"SHA256","hash":"365647b620c242eba334abc530035ba316c96eb9e716d1f7d2b0b06f7203ed59","blockSize":4194304,"blocks":["365647b620c242eba334abc530035ba316c96eb9e716d1f7d2b0b06f7203ed59"]}},"index.js":{"size":314,"offset":"2565854","integrity":{"algorithm":"SHA256","hash":"8faa4d3a3fa98bb7def7fc4264b3ac997c645a9ae6c11712d1e5b66e4af390ce","blockSize":4194304,"blocks":["8faa4d3a3fa98bb7def7fc4264b3ac997c645a9ae6c11712d1e5b66e4af390ce"]}},"index.js.map":{"size":94,"offset":"2566168","integrity":{"algorithm":"SHA256","hash":"557c672d0f96505164dd7f26ac8392a5844e7ed5ecd76cebdbf039cf19c5e969","blockSize":4194304,"blocks":["557c672d0f96505164dd7f26ac8392a5844e7ed5ecd76cebdbf039cf19c5e969"]}},"linkederrors.js":{"size":1920,"offset":"2566262","integrity":{"algorithm":"SHA256","hash":"dec5ebf0e9cbf8e61e4658092eaebdc7968434702848f634ba81fbe6e3df9b75","blockSize":4194304,"blocks":["dec5ebf0e9cbf8e61e4658092eaebdc7968434702848f634ba81fbe6e3df9b75"]}},"linkederrors.js.map":{"size":4605,"offset":"2568182","integrity":{"algorithm":"SHA256","hash":"2f0f375e83a905bab809f890cd471d6d8d93724cbdf7352217c1e971b949476f","blockSize":4194304,"blocks":["2f0f375e83a905bab809f890cd471d6d8d93724cbdf7352217c1e971b949476f"]}},"trycatch.js":{"size":8700,"offset":"2572787","integrity":{"algorithm":"SHA256","hash":"a6752f5d753b0e42fa9c8f91cecd66621ed48c26b3d7f09fffb3ab0cd63d4dde","blockSize":4194304,"blocks":["a6752f5d753b0e42fa9c8f91cecd66621ed48c26b3d7f09fffb3ab0cd63d4dde"]}},"trycatch.js.map":{"size":15791,"offset":"2581487","integrity":{"algorithm":"SHA256","hash":"2d32756558beace4620dfbb1413ce4d5a513fb540d1242c2a9c1cc67f616353b","blockSize":4194304,"blocks":["2d32756558beace4620dfbb1413ce4d5a513fb540d1242c2a9c1cc67f616353b"]}}}},"profiling":{"files":{"cache.js":{"size":1652,"offset":"2597278","integrity":{"algorithm":"SHA256","hash":"a131e58c3ef59cd5afc4ad07bb8fe9c72bc0fe3033c562a8ef51bfc80f335696","blockSize":4194304,"blocks":["a131e58c3ef59cd5afc4ad07bb8fe9c72bc0fe3033c562a8ef51bfc80f335696"]}},"cache.js.map":{"size":3487,"offset":"2598930","integrity":{"algorithm":"SHA256","hash":"2854ee4ebc84aba85e12394b4a6a89373ca92979f8b9154104c527fc750e6f2d","blockSize":4194304,"blocks":["2854ee4ebc84aba85e12394b4a6a89373ca92979f8b9154104c527fc750e6f2d"]}},"hubextensions.js":{"size":11663,"offset":"2602417","integrity":{"algorithm":"SHA256","hash":"94ec7d1e9e47764bcfc8089860dff47991645f7cc8ea210130eb8a6c79b67673","blockSize":4194304,"blocks":["94ec7d1e9e47764bcfc8089860dff47991645f7cc8ea210130eb8a6c79b67673"]}},"hubextensions.js.map":{"size":18139,"offset":"2614080","integrity":{"algorithm":"SHA256","hash":"9ef048cc897e91499e2efea1ca144ec23d71f50eb381a44b4b9fb046f4fe4ba1","blockSize":4194304,"blocks":["9ef048cc897e91499e2efea1ca144ec23d71f50eb381a44b4b9fb046f4fe4ba1"]}},"integration.js":{"size":1985,"offset":"2632219","integrity":{"algorithm":"SHA256","hash":"2a4f7d2afb0f160dbe11d48ddba6448cc332ce1e75ade88b0a38ce9cfbc0fabb","blockSize":4194304,"blocks":["2a4f7d2afb0f160dbe11d48ddba6448cc332ce1e75ade88b0a38ce9cfbc0fabb"]}},"integration.js.map":{"size":3000,"offset":"2634204","integrity":{"algorithm":"SHA256","hash":"c968d64408e518ea538fdd6af05f04d0d8be629aa3568e363487e0ca44f772ff","blockSize":4194304,"blocks":["c968d64408e518ea538fdd6af05f04d0d8be629aa3568e363487e0ca44f772ff"]}},"sendProfile.js":{"size":3443,"offset":"2637204","integrity":{"algorithm":"SHA256","hash":"522351eb436fac56d101b4f47d9269814d40f1d053492137f0efac60643cd0d0","blockSize":4194304,"blocks":["522351eb436fac56d101b4f47d9269814d40f1d053492137f0efac60643cd0d0"]}},"sendProfile.js.map":{"size":5396,"offset":"2640647","integrity":{"algorithm":"SHA256","hash":"16262c8b2364e9af6b6812c56c6fdfb934a0624d8a4521bfa6faeea9f2b2bb0e","blockSize":4194304,"blocks":["16262c8b2364e9af6b6812c56c6fdfb934a0624d8a4521bfa6faeea9f2b2bb0e"]}},"utils.js":{"size":9891,"offset":"2646043","integrity":{"algorithm":"SHA256","hash":"200b28e68207ec4be39b13ce348638d606a6f6a173f3712be8d73a1724dc0168","blockSize":4194304,"blocks":["200b28e68207ec4be39b13ce348638d606a6f6a173f3712be8d73a1724dc0168"]}},"utils.js.map":{"size":20842,"offset":"2655934","integrity":{"algorithm":"SHA256","hash":"34f649d1bb126600ef7dfa22a4a21b5724cb39fc3414fca1e62916b22f4aa97f","blockSize":4194304,"blocks":["34f649d1bb126600ef7dfa22a4a21b5724cb39fc3414fca1e62916b22f4aa97f"]}}}},"sdk.js":{"size":9109,"offset":"2676776","integrity":{"algorithm":"SHA256","hash":"73cf5069757bf16ae4e4ea2be0a28634bbdd0af5147ca7d8d58def06ed918e6a","blockSize":4194304,"blocks":["73cf5069757bf16ae4e4ea2be0a28634bbdd0af5147ca7d8d58def06ed918e6a"]}},"sdk.js.map":{"size":14512,"offset":"2685885","integrity":{"algorithm":"SHA256","hash":"5853ff00bb61c474224448351cf4cd5aea540c02918e0fc06657da8c31c48ed4","blockSize":4194304,"blocks":["5853ff00bb61c474224448351cf4cd5aea540c02918e0fc06657da8c31c48ed4"]}},"stack-parsers.js":{"size":5978,"offset":"2700397","integrity":{"algorithm":"SHA256","hash":"286ecfac4a42e9c08cc54d443955f8eb50cb3713ce81c9dff61a35382d8b15a6","blockSize":4194304,"blocks":["286ecfac4a42e9c08cc54d443955f8eb50cb3713ce81c9dff61a35382d8b15a6"]}},"stack-parsers.js.map":{"size":12700,"offset":"2706375","integrity":{"algorithm":"SHA256","hash":"84fb54c8448fda47f161064cfd2f094ae09752a32345374fd2007bc4a8d644cf","blockSize":4194304,"blocks":["84fb54c8448fda47f161064cfd2f094ae09752a32345374fd2007bc4a8d644cf"]}},"transports":{"files":{"fetch.js":{"size":2503,"offset":"2719075","integrity":{"algorithm":"SHA256","hash":"54baff6673b124273f6799c918ac0cb197c4f2b59249787040a0ef16b8d428c2","blockSize":4194304,"blocks":["54baff6673b124273f6799c918ac0cb197c4f2b59249787040a0ef16b8d428c2"]}},"fetch.js.map":{"size":4200,"offset":"2721578","integrity":{"algorithm":"SHA256","hash":"c31f2f0ebc391f7771571124fb4b783af7be239b68d599a835c25a78b40a7ef6","blockSize":4194304,"blocks":["c31f2f0ebc391f7771571124fb4b783af7be239b68d599a835c25a78b40a7ef6"]}},"offline.js":{"size":3908,"offset":"2725778","integrity":{"algorithm":"SHA256","hash":"c7aa5a3904f90e931c7b1cfae12cac91499700e4786164d98bb30bf486adfc55","blockSize":4194304,"blocks":["c7aa5a3904f90e931c7b1cfae12cac91499700e4786164d98bb30bf486adfc55"]}},"offline.js.map":{"size":8592,"offset":"2729686","integrity":{"algorithm":"SHA256","hash":"bd8661dcc005253f89f506bae0f8a72c955617225f1829a6ca9d9a2066cb7222","blockSize":4194304,"blocks":["bd8661dcc005253f89f506bae0f8a72c955617225f1829a6ca9d9a2066cb7222"]}},"utils.js":{"size":3009,"offset":"2738278","integrity":{"algorithm":"SHA256","hash":"bfacc595c3ef3b460e51cd842820af10f9ca8bbf510de9dec0e7219e8ab514ee","blockSize":4194304,"blocks":["bfacc595c3ef3b460e51cd842820af10f9ca8bbf510de9dec0e7219e8ab514ee"]}},"utils.js.map":{"size":4441,"offset":"2741287","integrity":{"algorithm":"SHA256","hash":"ac717de9959f6b3871a8cc3e623b05681c207ea61cf23f82a1dc2d3d04224b3f","blockSize":4194304,"blocks":["ac717de9959f6b3871a8cc3e623b05681c207ea61cf23f82a1dc2d3d04224b3f"]}},"xhr.js":{"size":1452,"offset":"2745728","integrity":{"algorithm":"SHA256","hash":"91feda7df180fb6f855261a62a70945fb13f1103459a386cc037c8d9c344509c","blockSize":4194304,"blocks":["91feda7df180fb6f855261a62a70945fb13f1103459a386cc037c8d9c344509c"]}},"xhr.js.map":{"size":2924,"offset":"2747180","integrity":{"algorithm":"SHA256","hash":"986d69355ddb99a28c222c6600cd0c95dca74b5b8e61890904804fc81730feba","blockSize":4194304,"blocks":["986d69355ddb99a28c222c6600cd0c95dca74b5b8e61890904804fc81730feba"]}}}},"userfeedback.js":{"size":858,"offset":"2750104","integrity":{"algorithm":"SHA256","hash":"90a46dc6262ed68d75eb18a2078521451995e8cbcf5549edd7e1c54ca776e01a","blockSize":4194304,"blocks":["90a46dc6262ed68d75eb18a2078521451995e8cbcf5549edd7e1c54ca776e01a"]}},"userfeedback.js.map":{"size":2096,"offset":"2750962","integrity":{"algorithm":"SHA256","hash":"074ab14f6b7527b5e88699478a587e12bc4e07282ad81bbe4c5bb41fb9fc13d6","blockSize":4194304,"blocks":["074ab14f6b7527b5e88699478a587e12bc4e07282ad81bbe4c5bb41fb9fc13d6"]}}}},"LICENSE":{"size":1120,"offset":"2753058","integrity":{"algorithm":"SHA256","hash":"5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7","blockSize":4194304,"blocks":["5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7"]}},"package.json":{"size":1425,"offset":"2754178","integrity":{"algorithm":"SHA256","hash":"bc0d7846d64da123c5b392b8f12ece54c29131a25b40f16b7a6cd8170515b75e","blockSize":4194304,"blocks":["bc0d7846d64da123c5b392b8f12ece54c29131a25b40f16b7a6cd8170515b75e"]}},"README.md":{"size":1991,"offset":"2755603","integrity":{"algorithm":"SHA256","hash":"7fed28b9d282b7ed708f8b7249dc0367ea87e16f88ca6e3a3c4b15f1604653dd","blockSize":4194304,"blocks":["7fed28b9d282b7ed708f8b7249dc0367ea87e16f88ca6e3a3c4b15f1604653dd"]}},"types":{"files":{"client.d.ts":{"size":1843,"offset":"2757594","integrity":{"algorithm":"SHA256","hash":"5dae6b993e7a84941d8af494c66293106a9b0a260d7c260d939736d34e852e11","blockSize":4194304,"blocks":["5dae6b993e7a84941d8af494c66293106a9b0a260d7c260d939736d34e852e11"]}},"client.d.ts.map":{"size":1123,"offset":"2759437","integrity":{"algorithm":"SHA256","hash":"97d882a6635d07b56567eb3b52bd33f7a05f448f47b8a3f2fc5add687c4c1631","blockSize":4194304,"blocks":["97d882a6635d07b56567eb3b52bd33f7a05f448f47b8a3f2fc5add687c4c1631"]}},"eventbuilder.d.ts":{"size":1705,"offset":"2760560","integrity":{"algorithm":"SHA256","hash":"7820d4a16952b0e5b49446a0130d5daab69f83b6dea63cb966ab7c05d70ddf05","blockSize":4194304,"blocks":["7820d4a16952b0e5b49446a0130d5daab69f83b6dea63cb966ab7c05d70ddf05"]}},"eventbuilder.d.ts.map":{"size":1399,"offset":"2762265","integrity":{"algorithm":"SHA256","hash":"ca7e181124069f7ab16ce64b528ae5221072619313fe0ea0d1923bd9ebfbc30e","blockSize":4194304,"blocks":["ca7e181124069f7ab16ce64b528ae5221072619313fe0ea0d1923bd9ebfbc30e"]}},"exports.d.ts":{"size":1405,"offset":"2763664","integrity":{"algorithm":"SHA256","hash":"31b21799d74468882641be776fcb765afddf370d5ad2df17c5d9d0a6eb4798a2","blockSize":4194304,"blocks":["31b21799d74468882641be776fcb765afddf370d5ad2df17c5d9d0a6eb4798a2"]}},"exports.d.ts.map":{"size":1248,"offset":"2765069","integrity":{"algorithm":"SHA256","hash":"0999ca633be483d1505eb21eccd50da67f08c8d63e7344d98be0da2dad4c2346","blockSize":4194304,"blocks":["0999ca633be483d1505eb21eccd50da67f08c8d63e7344d98be0da2dad4c2346"]}},"helpers.d.ts":{"size":1382,"offset":"2766317","integrity":{"algorithm":"SHA256","hash":"e62b9c44b74160689df1f516e4d7e39d3590ef60b4414a716838cde3b2cbb2ef","blockSize":4194304,"blocks":["e62b9c44b74160689df1f516e4d7e39d3590ef60b4414a716838cde3b2cbb2ef"]}},"helpers.d.ts.map":{"size":1119,"offset":"2767699","integrity":{"algorithm":"SHA256","hash":"35efdee49599b20b374f6a9ea97ae7e46d994b4ba0a25d0fadb50c65cd05c366","blockSize":4194304,"blocks":["35efdee49599b20b374f6a9ea97ae7e46d994b4ba0a25d0fadb50c65cd05c366"]}},"index.bundle.base.d.ts":{"size":246,"offset":"2768818","integrity":{"algorithm":"SHA256","hash":"e9c3e005c5154ba6d1ff131377b2ae268ad9876e8db6c09286007a4db773a88c","blockSize":4194304,"blocks":["e9c3e005c5154ba6d1ff131377b2ae268ad9876e8db6c09286007a4db773a88c"]}},"index.bundle.base.d.ts.map":{"size":336,"offset":"2769064","integrity":{"algorithm":"SHA256","hash":"506d4bec5e914793ad001786cc78b3f0433d492d5428dfe969028385221d15aa","blockSize":4194304,"blocks":["506d4bec5e914793ad001786cc78b3f0433d492d5428dfe969028385221d15aa"]}},"index.bundle.d.ts":{"size":235,"offset":"2769400","integrity":{"algorithm":"SHA256","hash":"f7420a6b8f1264fe353e93ad4f15d4368f2ce14e0ff30b0480bab53bfec7542f","blockSize":4194304,"blocks":["f7420a6b8f1264fe353e93ad4f15d4368f2ce14e0ff30b0480bab53bfec7542f"]}},"index.bundle.d.ts.map":{"size":263,"offset":"2769635","integrity":{"algorithm":"SHA256","hash":"d4fb0f71e4cc94b74906c024a4e25972e5eddc0ee78196e5fe7b2d057fa5d1ab","blockSize":4194304,"blocks":["d4fb0f71e4cc94b74906c024a4e25972e5eddc0ee78196e5fe7b2d057fa5d1ab"]}},"index.bundle.replay.d.ts":{"size":275,"offset":"2769898","integrity":{"algorithm":"SHA256","hash":"1d3d8685f9daecb52f17e588cd8428f96aba0a60a1ab37c8752a4a19c337fb06","blockSize":4194304,"blocks":["1d3d8685f9daecb52f17e588cd8428f96aba0a60a1ab37c8752a4a19c337fb06"]}},"index.bundle.replay.d.ts.map":{"size":310,"offset":"2770173","integrity":{"algorithm":"SHA256","hash":"4856e3433d56c7262684d17b0e10e911b565490d90398a8c17164eafee4f97c4","blockSize":4194304,"blocks":["4856e3433d56c7262684d17b0e10e911b565490d90398a8c17164eafee4f97c4"]}},"index.bundle.tracing.d.ts":{"size":296,"offset":"2770483","integrity":{"algorithm":"SHA256","hash":"26f2d45c89f77fb72b72a43edfbc9f838b63a09c2c5a771794a131f40930ffc2","blockSize":4194304,"blocks":["26f2d45c89f77fb72b72a43edfbc9f838b63a09c2c5a771794a131f40930ffc2"]}},"index.bundle.tracing.d.ts.map":{"size":332,"offset":"2770779","integrity":{"algorithm":"SHA256","hash":"6cf21e102a9da81991cd947bd1e377e50225e9b51d593086dcc3afc8283fa23e","blockSize":4194304,"blocks":["6cf21e102a9da81991cd947bd1e377e50225e9b51d593086dcc3afc8283fa23e"]}},"index.bundle.tracing.replay.d.ts":{"size":283,"offset":"2771111","integrity":{"algorithm":"SHA256","hash":"b1116331249b7c6ff409e78c97806e62fd4d9b4d3c066948f08a98247bdc0dea","blockSize":4194304,"blocks":["b1116331249b7c6ff409e78c97806e62fd4d9b4d3c066948f08a98247bdc0dea"]}},"index.bundle.tracing.replay.d.ts.map":{"size":346,"offset":"2771394","integrity":{"algorithm":"SHA256","hash":"352d784f50ace392d1b04c05742f731a6e39de4b8a0d5ad6a447133b6c576ce2","blockSize":4194304,"blocks":["352d784f50ace392d1b04c05742f731a6e39de4b8a0d5ad6a447133b6c576ce2"]}},"index.d.ts":{"size":1403,"offset":"2771740","integrity":{"algorithm":"SHA256","hash":"05d1809a1d15bccb1b741d102d4b21a87c762beec850f03f28d46d6261dc5ec2","blockSize":4194304,"blocks":["05d1809a1d15bccb1b741d102d4b21a87c762beec850f03f28d46d6261dc5ec2"]}},"index.d.ts.map":{"size":769,"offset":"2773143","integrity":{"algorithm":"SHA256","hash":"cfb9a634826f2f1d1019584302dba3911c83a51f1ad8d8c8285260bcb68d90ef","blockSize":4194304,"blocks":["cfb9a634826f2f1d1019584302dba3911c83a51f1ad8d8c8285260bcb68d90ef"]}},"integrations":{"files":{"breadcrumbs.d.ts":{"size":1318,"offset":"2773912","integrity":{"algorithm":"SHA256","hash":"e15ee4add600e5abaa075865622c09f676f10a0389a5d5b2605f489313aca364","blockSize":4194304,"blocks":["e15ee4add600e5abaa075865622c09f676f10a0389a5d5b2605f489313aca364"]}},"breadcrumbs.d.ts.map":{"size":848,"offset":"2775230","integrity":{"algorithm":"SHA256","hash":"8a8dab0f825f6fc2fa288d61e6199bab059487bf37108a61603a838160d5490f","blockSize":4194304,"blocks":["8a8dab0f825f6fc2fa288d61e6199bab059487bf37108a61603a838160d5490f"]}},"dedupe.d.ts":{"size":508,"offset":"2776078","integrity":{"algorithm":"SHA256","hash":"2b9fcf69d1e47634512ce87b8ee3629eb4d329be0499dd0fe20320f6c92dae21","blockSize":4194304,"blocks":["2b9fcf69d1e47634512ce87b8ee3629eb4d329be0499dd0fe20320f6c92dae21"]}},"dedupe.d.ts.map":{"size":464,"offset":"2776586","integrity":{"algorithm":"SHA256","hash":"bea7138786369bc27a9490b03a321d510efaed475abc5fcecd737e42ec8826bb","blockSize":4194304,"blocks":["bea7138786369bc27a9490b03a321d510efaed475abc5fcecd737e42ec8826bb"]}},"globalhandlers.d.ts":{"size":866,"offset":"2777050","integrity":{"algorithm":"SHA256","hash":"6f02257996a73f4cefaaea0567ec78c5e8fe46389707098817b788613099d477","blockSize":4194304,"blocks":["6f02257996a73f4cefaaea0567ec78c5e8fe46389707098817b788613099d477"]}},"globalhandlers.d.ts.map":{"size":589,"offset":"2777916","integrity":{"algorithm":"SHA256","hash":"57eab56e293d232737070fb4e6594028ee4ea86ab0da81103cc362c903270f20","blockSize":4194304,"blocks":["57eab56e293d232737070fb4e6594028ee4ea86ab0da81103cc362c903270f20"]}},"httpcontext.d.ts":{"size":399,"offset":"2778505","integrity":{"algorithm":"SHA256","hash":"463a1d04f4eed02269f63e13050e718254c673e952e267e08b9d5950c599fe5c","blockSize":4194304,"blocks":["463a1d04f4eed02269f63e13050e718254c673e952e267e08b9d5950c599fe5c"]}},"httpcontext.d.ts.map":{"size":342,"offset":"2778904","integrity":{"algorithm":"SHA256","hash":"e7bd239e103cef1ad5e6314c3bfd2ce75df89b666f67a63420259eac1f61ffc6","blockSize":4194304,"blocks":["e7bd239e103cef1ad5e6314c3bfd2ce75df89b666f67a63420259eac1f61ffc6"]}},"index.d.ts":{"size":297,"offset":"2779246","integrity":{"algorithm":"SHA256","hash":"27a1acd7574b916ee7627103e06051f5e3123c7113d9bc421159eb00f15befa2","blockSize":4194304,"blocks":["27a1acd7574b916ee7627103e06051f5e3123c7113d9bc421159eb00f15befa2"]}},"index.d.ts.map":{"size":374,"offset":"2779543","integrity":{"algorithm":"SHA256","hash":"2e9db389dcaf8f9076de8c88b4371c3b105ae5cb6a575ce4b24f5d88a63fc63e","blockSize":4194304,"blocks":["2e9db389dcaf8f9076de8c88b4371c3b105ae5cb6a575ce4b24f5d88a63fc63e"]}},"linkederrors.d.ts":{"size":1035,"offset":"2779917","integrity":{"algorithm":"SHA256","hash":"d44d99df92b22b3bc934906471506beaa2cd57cc37c420ec73df3a210396e151","blockSize":4194304,"blocks":["d44d99df92b22b3bc934906471506beaa2cd57cc37c420ec73df3a210396e151"]}},"linkederrors.d.ts.map":{"size":936,"offset":"2780952","integrity":{"algorithm":"SHA256","hash":"7a417b2c2294ea632437505b8a9b7063fd3e65f464d54ec86b350f98b53f0603","blockSize":4194304,"blocks":["7a417b2c2294ea632437505b8a9b7063fd3e65f464d54ec86b350f98b53f0603"]}},"trycatch.d.ts":{"size":827,"offset":"2781888","integrity":{"algorithm":"SHA256","hash":"48a45f5c520fcbedfc83be0cec866b1f27ed5dd740e35a53fe5bc1f9249a42c5","blockSize":4194304,"blocks":["48a45f5c520fcbedfc83be0cec866b1f27ed5dd740e35a53fe5bc1f9249a42c5"]}},"trycatch.d.ts.map":{"size":616,"offset":"2782715","integrity":{"algorithm":"SHA256","hash":"66a1f333b90291bb81103613190a6262925faaaf93690588ea1475b53f8a3564","blockSize":4194304,"blocks":["66a1f333b90291bb81103613190a6262925faaaf93690588ea1475b53f8a3564"]}}}},"profiling":{"files":{"cache.d.ts":{"size":657,"offset":"2783331","integrity":{"algorithm":"SHA256","hash":"35b37445ad80ff40e63505bdc6c9c5bb3c0d03cce15ef281449a9b170755dab8","blockSize":4194304,"blocks":["35b37445ad80ff40e63505bdc6c9c5bb3c0d03cce15ef281449a9b170755dab8"]}},"cache.d.ts.map":{"size":559,"offset":"2783988","integrity":{"algorithm":"SHA256","hash":"215930b1e27e7df3a8b5c92f528c27456db696398a6f9d1aeccd0e6723696e06","blockSize":4194304,"blocks":["215930b1e27e7df3a8b5c92f528c27456db696398a6f9d1aeccd0e6723696e06"]}},"hubextensions.d.ts":{"size":638,"offset":"2784547","integrity":{"algorithm":"SHA256","hash":"fd3a0d7b703dcc3e40081b58558dea80f05352dcbd010e7bdf32835c935ea45b","blockSize":4194304,"blocks":["fd3a0d7b703dcc3e40081b58558dea80f05352dcbd010e7bdf32835c935ea45b"]}},"hubextensions.d.ts.map":{"size":325,"offset":"2785185","integrity":{"algorithm":"SHA256","hash":"2276291ddefa3d81c5d4208af5ab2056bae2c7d38cd18a495496520b21ef7eb2","blockSize":4194304,"blocks":["2276291ddefa3d81c5d4208af5ab2056bae2c7d38cd18a495496520b21ef7eb2"]}},"integration.d.ts":{"size":940,"offset":"2785510","integrity":{"algorithm":"SHA256","hash":"5e84181bb1ec6f1d9abcef36fb475263363e6ae638f53d41eec2a023bd716b56","blockSize":4194304,"blocks":["5e84181bb1ec6f1d9abcef36fb475263363e6ae638f53d41eec2a023bd716b56"]}},"integration.d.ts.map":{"size":417,"offset":"2786450","integrity":{"algorithm":"SHA256","hash":"f2f40c92c8b8b4f3ddadccc81e77f33bb82ee2a8ce36b4035272982deb6c59b5","blockSize":4194304,"blocks":["f2f40c92c8b8b4f3ddadccc81e77f33bb82ee2a8ce36b4035272982deb6c59b5"]}},"jsSelfProfiling.d.ts":{"size":2861,"offset":"2786867","integrity":{"algorithm":"SHA256","hash":"59442e5d52c8e8c8e1938c327f8f246b5a8659ecfba073b43521c71f98ea60fb","blockSize":4194304,"blocks":["59442e5d52c8e8c8e1938c327f8f246b5a8659ecfba073b43521c71f98ea60fb"]}},"jsSelfProfiling.d.ts.map":{"size":2846,"offset":"2789728","integrity":{"algorithm":"SHA256","hash":"5bcab690663c334c93d0a69ecfa7535dacb5e1057e12eb83351aa4653a2fb9ec","blockSize":4194304,"blocks":["5bcab690663c334c93d0a69ecfa7535dacb5e1057e12eb83351aa4653a2fb9ec"]}},"sendProfile.d.ts":{"size":440,"offset":"2792574","integrity":{"algorithm":"SHA256","hash":"55255768cbe768e457fb4958a51173957ad209d704a532c10884591ab2c81110","blockSize":4194304,"blocks":["55255768cbe768e457fb4958a51173957ad209d704a532c10884591ab2c81110"]}},"sendProfile.d.ts.map":{"size":273,"offset":"2793014","integrity":{"algorithm":"SHA256","hash":"04c544a17f8eebf4f7c0ab00b548f3dd40f504458d71c846283bc4d0b593f94b","blockSize":4194304,"blocks":["04c544a17f8eebf4f7c0ab00b548f3dd40f504458d71c846283bc4d0b593f94b"]}},"utils.d.ts":{"size":1336,"offset":"2793287","integrity":{"algorithm":"SHA256","hash":"3f4e7b19a98306e6fd0504dfbb1c391b3a8190c4b991b6b815938419a114776a","blockSize":4194304,"blocks":["3f4e7b19a98306e6fd0504dfbb1c391b3a8190c4b991b6b815938419a114776a"]}},"utils.d.ts.map":{"size":843,"offset":"2794623","integrity":{"algorithm":"SHA256","hash":"e0a253db01d14b242d4a0e1ff24e37c453c64ca26b11d52f7a4207e96c835355","blockSize":4194304,"blocks":["e0a253db01d14b242d4a0e1ff24e37c453c64ca26b11d52f7a4207e96c835355"]}}}},"sdk.d.ts":{"size":3868,"offset":"2795466","integrity":{"algorithm":"SHA256","hash":"1ad59adc1924a1e2478dc64c33a8f9f336dfc4b042e3becb3d1907786fcfdf84","blockSize":4194304,"blocks":["1ad59adc1924a1e2478dc64c33a8f9f336dfc4b042e3becb3d1907786fcfdf84"]}},"sdk.d.ts.map":{"size":1200,"offset":"2799334","integrity":{"algorithm":"SHA256","hash":"e9ea36e00ae6a7c2bd56ae0b33aec65695e911fc9da52c7322f6c0fe52032cc7","blockSize":4194304,"blocks":["e9ea36e00ae6a7c2bd56ae0b33aec65695e911fc9da52c7322f6c0fe52032cc7"]}},"stack-parsers.d.ts":{"size":545,"offset":"2800534","integrity":{"algorithm":"SHA256","hash":"ed203d7ced6b23842749585aa3ed8329b72fbd9566ab78da665be871ad400e1e","blockSize":4194304,"blocks":["ed203d7ced6b23842749585aa3ed8329b72fbd9566ab78da665be871ad400e1e"]}},"stack-parsers.d.ts.map":{"size":439,"offset":"2801079","integrity":{"algorithm":"SHA256","hash":"57d3201d32dd7af434ac6c9d71dbce6b3bcfab3189d366adf39b09186d7c756d","blockSize":4194304,"blocks":["57d3201d32dd7af434ac6c9d71dbce6b3bcfab3189d366adf39b09186d7c756d"]}},"transports":{"files":{"fetch.d.ts":{"size":376,"offset":"2801518","integrity":{"algorithm":"SHA256","hash":"a69bb6dd5c0e3f5c6bbacbdc5ed56c782f465ff30e5d7abbe1e627e93a069acc","blockSize":4194304,"blocks":["a69bb6dd5c0e3f5c6bbacbdc5ed56c782f465ff30e5d7abbe1e627e93a069acc"]}},"fetch.d.ts.map":{"size":356,"offset":"2801894","integrity":{"algorithm":"SHA256","hash":"7745250431a15f4709d3a3270781d05ede37d580e8f04bc5f55c00eac33d732e","blockSize":4194304,"blocks":["7745250431a15f4709d3a3270781d05ede37d580e8f04bc5f55c00eac33d732e"]}},"index.d.ts":{"size":123,"offset":"2802250","integrity":{"algorithm":"SHA256","hash":"05a5934f5d02f69af41f90327033b9146a93a169e2cc6910891e22191c576093","blockSize":4194304,"blocks":["05a5934f5d02f69af41f90327033b9146a93a169e2cc6910891e22191c576093"]}},"index.d.ts.map":{"size":208,"offset":"2802373","integrity":{"algorithm":"SHA256","hash":"da92f2778e952ceeeef48b10a81333ccef8991cc5205c43cfc893c2e02c3e83a","blockSize":4194304,"blocks":["da92f2778e952ceeeef48b10a81333ccef8991cc5205c43cfc893c2e02c3e83a"]}},"offline.d.ts":{"size":1562,"offset":"2802581","integrity":{"algorithm":"SHA256","hash":"7fce169ac393f4a04d9bb0d661fcff127577c7afa720b8fa9fd088c693cb805a","blockSize":4194304,"blocks":["7fce169ac393f4a04d9bb0d661fcff127577c7afa720b8fa9fd088c693cb805a"]}},"offline.d.ts.map":{"size":1099,"offset":"2804143","integrity":{"algorithm":"SHA256","hash":"e593e2f7adccd06f92f9edf26a74c1681f6b721f79bedec4316038d3c3b29172","blockSize":4194304,"blocks":["e593e2f7adccd06f92f9edf26a74c1681f6b721f79bedec4316038d3c3b29172"]}},"types.d.ts":{"size":613,"offset":"2805242","integrity":{"algorithm":"SHA256","hash":"4dac5d9a1bb07423a57183f9c3f00b4ea55fbb8e1bde4dbdf9b1e28fec784028","blockSize":4194304,"blocks":["4dac5d9a1bb07423a57183f9c3f00b4ea55fbb8e1bde4dbdf9b1e28fec784028"]}},"types.d.ts.map":{"size":434,"offset":"2805855","integrity":{"algorithm":"SHA256","hash":"7991caff66f0482a9003a9666094fe517f3d79a7514f0d560e09e07153a7c9db","blockSize":4194304,"blocks":["7991caff66f0482a9003a9666094fe517f3d79a7514f0d560e09e07153a7c9db"]}},"utils.d.ts":{"size":1780,"offset":"2806289","integrity":{"algorithm":"SHA256","hash":"7800c70b4c9c08458459a03ba0695cf2a70824d2b09aad1363a1850e1ddc00dd","blockSize":4194304,"blocks":["7800c70b4c9c08458459a03ba0695cf2a70824d2b09aad1363a1850e1ddc00dd"]}},"utils.d.ts.map":{"size":291,"offset":"2808069","integrity":{"algorithm":"SHA256","hash":"0bf894f311d5b462ea61c29cb8089e7754041bb9c0bbf99bb02f437834eb6928","blockSize":4194304,"blocks":["0bf894f311d5b462ea61c29cb8089e7754041bb9c0bbf99bb02f437834eb6928"]}},"xhr.d.ts":{"size":314,"offset":"2808360","integrity":{"algorithm":"SHA256","hash":"c750b56a1f3ac79b449bb417323ef78cb525f0a408adb8ddb022fddbd25804e9","blockSize":4194304,"blocks":["c750b56a1f3ac79b449bb417323ef78cb525f0a408adb8ddb022fddbd25804e9"]}},"xhr.d.ts.map":{"size":283,"offset":"2808674","integrity":{"algorithm":"SHA256","hash":"02873dafccc34d5974b93c1846ea3678fe1adbf8fcca4f840e3c758e467ddccf","blockSize":4194304,"blocks":["02873dafccc34d5974b93c1846ea3678fe1adbf8fcca4f840e3c758e467ddccf"]}}}},"userfeedback.d.ts":{"size":420,"offset":"2808957","integrity":{"algorithm":"SHA256","hash":"59714632ec298efc2020c57f81090b70eb389c0560d53f667963bf246524045e","blockSize":4194304,"blocks":["59714632ec298efc2020c57f81090b70eb389c0560d53f667963bf246524045e"]}},"userfeedback.d.ts.map":{"size":426,"offset":"2809377","integrity":{"algorithm":"SHA256","hash":"e7d7fb6c405e7fc6e996113eda5b06dba4343e067f4cddd81bdb6a39f28bf472","blockSize":4194304,"blocks":["e7d7fb6c405e7fc6e996113eda5b06dba4343e067f4cddd81bdb6a39f28bf472"]}}}}}},"core":{"files":{"cjs":{"files":{"api.js":{"size":2973,"offset":"2809803","integrity":{"algorithm":"SHA256","hash":"c0b51018addb9d9717b0cb2df9796a3cccdd050fdecae84a27a38cf26a3b7739","blockSize":4194304,"blocks":["c0b51018addb9d9717b0cb2df9796a3cccdd050fdecae84a27a38cf26a3b7739"]}},"api.js.map":{"size":5757,"offset":"2812776","integrity":{"algorithm":"SHA256","hash":"615a3afed8567c5d1eba2e41f4a0d6c82dfba5e9f581296108213290fe361b2a","blockSize":4194304,"blocks":["615a3afed8567c5d1eba2e41f4a0d6c82dfba5e9f581296108213290fe361b2a"]}},"baseclient.js":{"size":20649,"offset":"2818533","integrity":{"algorithm":"SHA256","hash":"c649eae7a07b08f22480efb72c59c0b0b279eeb5a0c6be97bd0533affdeea8da","blockSize":4194304,"blocks":["c649eae7a07b08f22480efb72c59c0b0b279eeb5a0c6be97bd0533affdeea8da"]}},"baseclient.js.map":{"size":40258,"offset":"2839182","integrity":{"algorithm":"SHA256","hash":"948d2632b79bb5e434572231c4160c9d3068e59429a930ad91631b0961b58c88","blockSize":4194304,"blocks":["948d2632b79bb5e434572231c4160c9d3068e59429a930ad91631b0961b58c88"]}},"constants.js":{"size":196,"offset":"2879440","integrity":{"algorithm":"SHA256","hash":"b6f9f1a08e0bb08072f2b8f3ab6fccfd4f64f4dbb8d4fa8fd7f034962f03c234","blockSize":4194304,"blocks":["b6f9f1a08e0bb08072f2b8f3ab6fccfd4f64f4dbb8d4fa8fd7f034962f03c234"]}},"constants.js.map":{"size":195,"offset":"2879636","integrity":{"algorithm":"SHA256","hash":"3de7b8084c0d9a9538c5022b52a5fac52c5852e7ccdeb268456f7e4a789f7018","blockSize":4194304,"blocks":["3de7b8084c0d9a9538c5022b52a5fac52c5852e7ccdeb268456f7e4a789f7018"]}},"envelope.js":{"size":2792,"offset":"2879831","integrity":{"algorithm":"SHA256","hash":"974ad7639fa8209ecefe539cdbdfd493a70d9394f5d832374bf7f73a109181f0","blockSize":4194304,"blocks":["974ad7639fa8209ecefe539cdbdfd493a70d9394f5d832374bf7f73a109181f0"]}},"envelope.js.map":{"size":5327,"offset":"2882623","integrity":{"algorithm":"SHA256","hash":"d4598364226d4d09eb2f2e0b363a346b12fccd2cbdc9b58fe6bdb216ebc13df8","blockSize":4194304,"blocks":["d4598364226d4d09eb2f2e0b363a346b12fccd2cbdc9b58fe6bdb216ebc13df8"]}},"exports.js":{"size":6114,"offset":"2887950","integrity":{"algorithm":"SHA256","hash":"2359c837c571f9f6eb8dbda1dda46589090d084220a57d928f1a5139c9c8006e","blockSize":4194304,"blocks":["2359c837c571f9f6eb8dbda1dda46589090d084220a57d928f1a5139c9c8006e"]}},"exports.js.map":{"size":9131,"offset":"2894064","integrity":{"algorithm":"SHA256","hash":"cad4629cd4ba19d46591e1350772b448bde660dc83a1a2548d36f5c80e85d042","blockSize":4194304,"blocks":["cad4629cd4ba19d46591e1350772b448bde660dc83a1a2548d36f5c80e85d042"]}},"hub.js":{"size":14525,"offset":"2903195","integrity":{"algorithm":"SHA256","hash":"44b6c925c202f038ac628d99155cb964ca8893feb69de34eadceaf847ebd4cb7","blockSize":4194304,"blocks":["44b6c925c202f038ac628d99155cb964ca8893feb69de34eadceaf847ebd4cb7"]}},"hub.js.map":{"size":29384,"offset":"2917720","integrity":{"algorithm":"SHA256","hash":"e314fc5c6b6661b0fe6851a7d88fe8f6fbd378175c699be9a37d86d6a3e0e33f","blockSize":4194304,"blocks":["e314fc5c6b6661b0fe6851a7d88fe8f6fbd378175c699be9a37d86d6a3e0e33f"]}},"index.js":{"size":4092,"offset":"2947104","integrity":{"algorithm":"SHA256","hash":"5477d3d2161f62170f59f4268fca7f16ebdfc161389d62d4ac1be230a9ac175a","blockSize":4194304,"blocks":["5477d3d2161f62170f59f4268fca7f16ebdfc161389d62d4ac1be230a9ac175a"]}},"index.js.map":{"size":175,"offset":"2951196","integrity":{"algorithm":"SHA256","hash":"a66d76d72a27427346f4b9d8f7e47b07f9ed583405b242328176e7aaceb179de","blockSize":4194304,"blocks":["a66d76d72a27427346f4b9d8f7e47b07f9ed583405b242328176e7aaceb179de"]}},"integration.js":{"size":4142,"offset":"2951371","integrity":{"algorithm":"SHA256","hash":"a8c4c84d8a86ada8d93b7a3117f36f1dfa07c487f5b344c1c43fb8d05b1839c5","blockSize":4194304,"blocks":["a8c4c84d8a86ada8d93b7a3117f36f1dfa07c487f5b344c1c43fb8d05b1839c5"]}},"integration.js.map":{"size":7172,"offset":"2955513","integrity":{"algorithm":"SHA256","hash":"562d26ace25672128475b9a1736722219273e3ceeb9c3d355ef7fd736a6df409","blockSize":4194304,"blocks":["562d26ace25672128475b9a1736722219273e3ceeb9c3d355ef7fd736a6df409"]}},"integrations":{"files":{"functiontostring.js":{"size":1017,"offset":"2962685","integrity":{"algorithm":"SHA256","hash":"83cd27b899423bea93e2845696b3de414fcadb7906a0b74ecbfea7cc1aea3fb9","blockSize":4194304,"blocks":["83cd27b899423bea93e2845696b3de414fcadb7906a0b74ecbfea7cc1aea3fb9"]}},"functiontostring.js.map":{"size":1773,"offset":"2963702","integrity":{"algorithm":"SHA256","hash":"fc703222169c857e7470c736465422a98d6336e825fe3f8b9b09383188b2fc42","blockSize":4194304,"blocks":["fc703222169c857e7470c736465422a98d6336e825fe3f8b9b09383188b2fc42"]}},"inboundfilters.js":{"size":6540,"offset":"2965475","integrity":{"algorithm":"SHA256","hash":"87300b0b58c961a1a0d8360e73b1e1fbd101f64c7e48fd1ad38c47d514c14abf","blockSize":4194304,"blocks":["87300b0b58c961a1a0d8360e73b1e1fbd101f64c7e48fd1ad38c47d514c14abf"]}},"inboundfilters.js.map":{"size":13197,"offset":"2972015","integrity":{"algorithm":"SHA256","hash":"bfdb77a3ef31afa82c8ddd5e474399f093da81d7f3f0ecabb2d2e5197e740298","blockSize":4194304,"blocks":["bfdb77a3ef31afa82c8ddd5e474399f093da81d7f3f0ecabb2d2e5197e740298"]}},"index.js":{"size":333,"offset":"2985212","integrity":{"algorithm":"SHA256","hash":"65dc7579bcb1d2723025a34cc1e28503be3f511949451fd39979081569ce66d9","blockSize":4194304,"blocks":["65dc7579bcb1d2723025a34cc1e28503be3f511949451fd39979081569ce66d9"]}},"index.js.map":{"size":97,"offset":"2985545","integrity":{"algorithm":"SHA256","hash":"c329a20847e069f1a1ab8002d29b0479a59111388c072f34a51db52fc0198300","blockSize":4194304,"blocks":["c329a20847e069f1a1ab8002d29b0479a59111388c072f34a51db52fc0198300"]}}}},"scope.js":{"size":13782,"offset":"2985642","integrity":{"algorithm":"SHA256","hash":"c2ef2deec1dbc9e810346dc315d346aa236d340cc45fea7e63cb8524d41ee6b6","blockSize":4194304,"blocks":["c2ef2deec1dbc9e810346dc315d346aa236d340cc45fea7e63cb8524d41ee6b6"]}},"scope.js.map":{"size":29271,"offset":"2999424","integrity":{"algorithm":"SHA256","hash":"029d826b8e5c68e74bf84d83802fc3ba3ea4b4e4401cf062e0d2b9ca28328be6","blockSize":4194304,"blocks":["029d826b8e5c68e74bf84d83802fc3ba3ea4b4e4401cf062e0d2b9ca28328be6"]}},"sdk.js":{"size":1161,"offset":"3028695","integrity":{"algorithm":"SHA256","hash":"3d20fbc234b036e7d1ad925149eb27b945c44158203c3578425334b1458913a6","blockSize":4194304,"blocks":["3d20fbc234b036e7d1ad925149eb27b945c44158203c3578425334b1458913a6"]}},"sdk.js.map":{"size":1964,"offset":"3029856","integrity":{"algorithm":"SHA256","hash":"d7ca3a89bb2338760c968e35a1cd70e55ebc5f14b222f77a28a6504f92c8a5c2","blockSize":4194304,"blocks":["d7ca3a89bb2338760c968e35a1cd70e55ebc5f14b222f77a28a6504f92c8a5c2"]}},"session.js":{"size":5052,"offset":"3031820","integrity":{"algorithm":"SHA256","hash":"c814077ae9c4d53ece90d3b44dc40e822536442dcaef584f16106cfafc658f74","blockSize":4194304,"blocks":["c814077ae9c4d53ece90d3b44dc40e822536442dcaef584f16106cfafc658f74"]}},"session.js.map":{"size":9331,"offset":"3036872","integrity":{"algorithm":"SHA256","hash":"1ea02280eb119a83a21c82c863a71a3664352ab9cb76a268e11bf31517d7f452","blockSize":4194304,"blocks":["1ea02280eb119a83a21c82c863a71a3664352ab9cb76a268e11bf31517d7f452"]}},"sessionflusher.js":{"size":3819,"offset":"3046203","integrity":{"algorithm":"SHA256","hash":"b8e0ffb953d5ffdc5ca7b4f1a4548da46c16a04d718ed94141e91d4be3a1f905","blockSize":4194304,"blocks":["b8e0ffb953d5ffdc5ca7b4f1a4548da46c16a04d718ed94141e91d4be3a1f905"]}},"sessionflusher.js.map":{"size":7202,"offset":"3050022","integrity":{"algorithm":"SHA256","hash":"f291642d301b4cf704f04145e607b765ab4ac0f27fb9cdc480a25eafac03a02c","blockSize":4194304,"blocks":["f291642d301b4cf704f04145e607b765ab4ac0f27fb9cdc480a25eafac03a02c"]}},"tracing":{"files":{"errors.js":{"size":1220,"offset":"3057224","integrity":{"algorithm":"SHA256","hash":"61ec41b14e166d339e07fd8f499d44df67dfb049d6601424a0afd33e5f988b49","blockSize":4194304,"blocks":["61ec41b14e166d339e07fd8f499d44df67dfb049d6601424a0afd33e5f988b49"]}},"errors.js.map":{"size":1964,"offset":"3058444","integrity":{"algorithm":"SHA256","hash":"eca1d1d247ff8d225c6816631f19c807a474d2bea970f7d30f6295ceed151a7e","blockSize":4194304,"blocks":["eca1d1d247ff8d225c6816631f19c807a474d2bea970f7d30f6295ceed151a7e"]}},"hubextensions.js":{"size":8922,"offset":"3060408","integrity":{"algorithm":"SHA256","hash":"339d1ddf80fb96e13f0dcd7b4d88dd097b1c6b1dde14c5e3aea264975eb1f040","blockSize":4194304,"blocks":["339d1ddf80fb96e13f0dcd7b4d88dd097b1c6b1dde14c5e3aea264975eb1f040"]}},"hubextensions.js.map":{"size":14962,"offset":"3069330","integrity":{"algorithm":"SHA256","hash":"e085e0a687af8c4748c4c517c991e021275e639388bae08a4c6c51eb75e31f01","blockSize":4194304,"blocks":["e085e0a687af8c4748c4c517c991e021275e639388bae08a4c6c51eb75e31f01"]}},"idletransaction.js":{"size":12245,"offset":"3084292","integrity":{"algorithm":"SHA256","hash":"26b1b10fc9778354f44f841c672ad3ff4732fcb096e63300b2140c8d89f0206f","blockSize":4194304,"blocks":["26b1b10fc9778354f44f841c672ad3ff4732fcb096e63300b2140c8d89f0206f"]}},"idletransaction.js.map":{"size":21309,"offset":"3096537","integrity":{"algorithm":"SHA256","hash":"4ef56340451c892b8702d684a114a7fe55079dc474d212ac4883c0867d9c282c","blockSize":4194304,"blocks":["4ef56340451c892b8702d684a114a7fe55079dc474d212ac4883c0867d9c282c"]}},"span.js":{"size":8967,"offset":"3117846","integrity":{"algorithm":"SHA256","hash":"e1797e8c57465dce37250eb28b0032bf4d6fcfd401247bea1f53a19f8222aa9f","blockSize":4194304,"blocks":["e1797e8c57465dce37250eb28b0032bf4d6fcfd401247bea1f53a19f8222aa9f"]}},"span.js.map":{"size":20344,"offset":"3126813","integrity":{"algorithm":"SHA256","hash":"1c54d47c4f26dd16e0976616d9cf3d06ba5e23d8c7b00a9beade56b625f23494","blockSize":4194304,"blocks":["1c54d47c4f26dd16e0976616d9cf3d06ba5e23d8c7b00a9beade56b625f23494"]}},"spanstatus.js":{"size":2669,"offset":"3147157","integrity":{"algorithm":"SHA256","hash":"2307cc8a54d2f6bd0d01a477f7c671cbf3e8060a2ef215baf615e13bd95e0ac0","blockSize":4194304,"blocks":["2307cc8a54d2f6bd0d01a477f7c671cbf3e8060a2ef215baf615e13bd95e0ac0"]}},"spanstatus.js.map":{"size":3341,"offset":"3149826","integrity":{"algorithm":"SHA256","hash":"01357c5d5ea2fe2009af828f2d7a3e634d4b25feb7ee50b7986df799ad5c3ec3","blockSize":4194304,"blocks":["01357c5d5ea2fe2009af828f2d7a3e634d4b25feb7ee50b7986df799ad5c3ec3"]}},"trace.js":{"size":1877,"offset":"3153167","integrity":{"algorithm":"SHA256","hash":"8eb5c450f40f69d4e22eac1d8c18eef32bf2e800efd8088b0934f311d53b8b3d","blockSize":4194304,"blocks":["8eb5c450f40f69d4e22eac1d8c18eef32bf2e800efd8088b0934f311d53b8b3d"]}},"trace.js.map":{"size":3622,"offset":"3155044","integrity":{"algorithm":"SHA256","hash":"cb39279f98befaa34351fecb5099e62edad49419aa69099b6c6f9d7e99f27753","blockSize":4194304,"blocks":["cb39279f98befaa34351fecb5099e62edad49419aa69099b6c6f9d7e99f27753"]}},"transaction.js":{"size":7741,"offset":"3158666","integrity":{"algorithm":"SHA256","hash":"12434c5ce07219bbeb6f264db36ca1b306823869f0002fff1c5a34f2b22a38f9","blockSize":4194304,"blocks":["12434c5ce07219bbeb6f264db36ca1b306823869f0002fff1c5a34f2b22a38f9"]}},"transaction.js.map":{"size":15282,"offset":"3166407","integrity":{"algorithm":"SHA256","hash":"6f9cf45a60b1a9069053f4b0e8f8c1e0772c9b6bc574e32df91c1d4541f95f90","blockSize":4194304,"blocks":["6f9cf45a60b1a9069053f4b0e8f8c1e0772c9b6bc574e32df91c1d4541f95f90"]}},"utils.js":{"size":623,"offset":"3181689","integrity":{"algorithm":"SHA256","hash":"5fa45b987a20c70afa0bbcc6554a68b24bce7edde4e4f2763b26dbdd69b356ee","blockSize":4194304,"blocks":["5fa45b987a20c70afa0bbcc6554a68b24bce7edde4e4f2763b26dbdd69b356ee"]}},"utils.js.map":{"size":1528,"offset":"3182312","integrity":{"algorithm":"SHA256","hash":"9cd5ef5d28cfc20f6d6eecd11193fbbdf2e6d9243d62803c97460e29d8cea6cf","blockSize":4194304,"blocks":["9cd5ef5d28cfc20f6d6eecd11193fbbdf2e6d9243d62803c97460e29d8cea6cf"]}}}},"transports":{"files":{"base.js":{"size":3433,"offset":"3183840","integrity":{"algorithm":"SHA256","hash":"1f8d2e32c457405f89e126d93430a20e2fdc2249798522d1a62078ca45d82367","blockSize":4194304,"blocks":["1f8d2e32c457405f89e126d93430a20e2fdc2249798522d1a62078ca45d82367"]}},"base.js.map":{"size":6958,"offset":"3187273","integrity":{"algorithm":"SHA256","hash":"0a0a92cf688101bd3bd172c65e5e63317f2bfec277b8cc753cf46e71986fc50e","blockSize":4194304,"blocks":["0a0a92cf688101bd3bd172c65e5e63317f2bfec277b8cc753cf46e71986fc50e"]}},"offline.js":{"size":3513,"offset":"3194231","integrity":{"algorithm":"SHA256","hash":"ece59f423f6060a76f714e5b869449961512409b84292248c545eebfcdb61c25","blockSize":4194304,"blocks":["ece59f423f6060a76f714e5b869449961512409b84292248c545eebfcdb61c25"]}},"offline.js.map":{"size":7828,"offset":"3197744","integrity":{"algorithm":"SHA256","hash":"55a10952f89c342261a3902fa7123ab90b8f21323a2af836d2af77ff69b900cf","blockSize":4194304,"blocks":["55a10952f89c342261a3902fa7123ab90b8f21323a2af836d2af77ff69b900cf"]}}}},"utils":{"files":{"hasTracingEnabled.js":{"size":796,"offset":"3205572","integrity":{"algorithm":"SHA256","hash":"48ce2173734046e90db1d96adc72fbfab72096bc36f63d9976e8b3f87fc50d43","blockSize":4194304,"blocks":["48ce2173734046e90db1d96adc72fbfab72096bc36f63d9976e8b3f87fc50d43"]}},"hasTracingEnabled.js.map":{"size":1438,"offset":"3206368","integrity":{"algorithm":"SHA256","hash":"348353b542aa5b09516b16ab11a7f731284c8aced25b570b3ad8338164412773","blockSize":4194304,"blocks":["348353b542aa5b09516b16ab11a7f731284c8aced25b570b3ad8338164412773"]}},"prepareEvent.js":{"size":8963,"offset":"3207806","integrity":{"algorithm":"SHA256","hash":"770e073e42cbe83a557731afdd4a50083502abb6b0599f832eccf3730ae0a851","blockSize":4194304,"blocks":["770e073e42cbe83a557731afdd4a50083502abb6b0599f832eccf3730ae0a851"]}},"prepareEvent.js.map":{"size":16498,"offset":"3216769","integrity":{"algorithm":"SHA256","hash":"bb94edba085e0e1da811e8408d7ae595de651010902104ebaba4f17d90e3aeb8","blockSize":4194304,"blocks":["bb94edba085e0e1da811e8408d7ae595de651010902104ebaba4f17d90e3aeb8"]}}}},"version.js":{"size":166,"offset":"3233267","integrity":{"algorithm":"SHA256","hash":"11c2bbd54a96add6e62737e10414f6d9993cd6e380ca1101334d2ca376a8642e","blockSize":4194304,"blocks":["11c2bbd54a96add6e62737e10414f6d9993cd6e380ca1101334d2ca376a8642e"]}},"version.js.map":{"size":178,"offset":"3233433","integrity":{"algorithm":"SHA256","hash":"d01357b61785ddfda7b6108681468bf68929632e4ef4221dde14252d1f4168b8","blockSize":4194304,"blocks":["d01357b61785ddfda7b6108681468bf68929632e4ef4221dde14252d1f4168b8"]}}}},"esm":{"files":{"api.js":{"size":2845,"offset":"3233611","integrity":{"algorithm":"SHA256","hash":"ee3b6c3143a8406f22e9c32c946f12f16594707e4f50de44fd9f972686026642","blockSize":4194304,"blocks":["ee3b6c3143a8406f22e9c32c946f12f16594707e4f50de44fd9f972686026642"]}},"api.js.map":{"size":5715,"offset":"3236456","integrity":{"algorithm":"SHA256","hash":"115ea529000cbc487cdee59fc6f7806d79ce783e0570fbcf3bf843935c6acacb","blockSize":4194304,"blocks":["115ea529000cbc487cdee59fc6f7806d79ce783e0570fbcf3bf843935c6acacb"]}},"baseclient.js":{"size":20562,"offset":"3242171","integrity":{"algorithm":"SHA256","hash":"8a4a24e75ccdcaadbadb02c7891fe72b894f34297aca0ccaa28e5fdaa49f3520","blockSize":4194304,"blocks":["8a4a24e75ccdcaadbadb02c7891fe72b894f34297aca0ccaa28e5fdaa49f3520"]}},"baseclient.js.map":{"size":39794,"offset":"3262733","integrity":{"algorithm":"SHA256","hash":"2add2619ade94cd16783194e082e9503b1e230477d9713d414f545fee67dd01a","blockSize":4194304,"blocks":["2add2619ade94cd16783194e082e9503b1e230477d9713d414f545fee67dd01a"]}},"constants.js":{"size":113,"offset":"3302527","integrity":{"algorithm":"SHA256","hash":"c82d1fe6db78d7e153af0f9a21a93b6ea9d3f17b86dc2646f30b6eba22a084fc","blockSize":4194304,"blocks":["c82d1fe6db78d7e153af0f9a21a93b6ea9d3f17b86dc2646f30b6eba22a084fc"]}},"constants.js.map":{"size":193,"offset":"3302640","integrity":{"algorithm":"SHA256","hash":"d716a9aad16fea4a25b05a7fd7d0e5869d5112fc347fad6522cf516f6aeadc08","blockSize":4194304,"blocks":["d716a9aad16fea4a25b05a7fd7d0e5869d5112fc347fad6522cf516f6aeadc08"]}},"envelope.js":{"size":2723,"offset":"3302833","integrity":{"algorithm":"SHA256","hash":"8837a64a0f092f3c61d8ef60b1d20c429852c5f4a39c184d9493c5efa0a86638","blockSize":4194304,"blocks":["8837a64a0f092f3c61d8ef60b1d20c429852c5f4a39c184d9493c5efa0a86638"]}},"envelope.js.map":{"size":5222,"offset":"3305556","integrity":{"algorithm":"SHA256","hash":"70443f594a0b59bcf2728983dbd50bf0334287606be1c09c9230543cb1dd2a4b","blockSize":4194304,"blocks":["70443f594a0b59bcf2728983dbd50bf0334287606be1c09c9230543cb1dd2a4b"]}},"exports.js":{"size":5734,"offset":"3310778","integrity":{"algorithm":"SHA256","hash":"a0f00056d3203a176490efb0f85929883828d88588bbfd5119109812e0ccb5b7","blockSize":4194304,"blocks":["a0f00056d3203a176490efb0f85929883828d88588bbfd5119109812e0ccb5b7"]}},"exports.js.map":{"size":9076,"offset":"3316512","integrity":{"algorithm":"SHA256","hash":"e42f10a9d5f1339040fd33f8b26fce1e53f09e68e9a02f8ff6ebfeed7c27ccd0","blockSize":4194304,"blocks":["e42f10a9d5f1339040fd33f8b26fce1e53f09e68e9a02f8ff6ebfeed7c27ccd0"]}},"hub.js":{"size":14180,"offset":"3325588","integrity":{"algorithm":"SHA256","hash":"6405f64ade83a05f41590402cdec71889ef06042b336fad056666f0c626cddfe","blockSize":4194304,"blocks":["6405f64ade83a05f41590402cdec71889ef06042b336fad056666f0c626cddfe"]}},"hub.js.map":{"size":29150,"offset":"3339768","integrity":{"algorithm":"SHA256","hash":"7e012c40552f66e419139b3c596a1d295cc5169063cc454625f3df10c4242edc","blockSize":4194304,"blocks":["7e012c40552f66e419139b3c596a1d295cc5169063cc454625f3df10c4242edc"]}},"index.js":{"size":1899,"offset":"3368918","integrity":{"algorithm":"SHA256","hash":"c1e4f5a6089fee4680c169aff40e3f81527da7a976f0fa03db44447e3394bc6f","blockSize":4194304,"blocks":["c1e4f5a6089fee4680c169aff40e3f81527da7a976f0fa03db44447e3394bc6f"]}},"index.js.map":{"size":115,"offset":"3370817","integrity":{"algorithm":"SHA256","hash":"078b00dc2bd9d5e87379219889117aea148ae9d419124383cd40925bcc35c6d4","blockSize":4194304,"blocks":["078b00dc2bd9d5e87379219889117aea148ae9d419124383cd40925bcc35c6d4"]}},"integration.js":{"size":3983,"offset":"3370932","integrity":{"algorithm":"SHA256","hash":"74a74217eb9137d56d2cfcace2f784986bd520f234d1ba5218dee0a37c8478b8","blockSize":4194304,"blocks":["74a74217eb9137d56d2cfcace2f784986bd520f234d1ba5218dee0a37c8478b8"]}},"integration.js.map":{"size":7101,"offset":"3374915","integrity":{"algorithm":"SHA256","hash":"4f755e07ff88dd1baa361beda7abf67ad59f8fac0f0a7ed9cfb7667da7d49458","blockSize":4194304,"blocks":["4f755e07ff88dd1baa361beda7abf67ad59f8fac0f0a7ed9cfb7667da7d49458"]}},"integrations":{"files":{"functiontostring.js":{"size":944,"offset":"3382016","integrity":{"algorithm":"SHA256","hash":"8d8dc46f6dda922c982e85099edb830af989003b47bd213baf0c9a3150b04749","blockSize":4194304,"blocks":["8d8dc46f6dda922c982e85099edb830af989003b47bd213baf0c9a3150b04749"]}},"functiontostring.js.map":{"size":1749,"offset":"3382960","integrity":{"algorithm":"SHA256","hash":"6c047d1e933a6bf52f60b9f034aa1dfe67d8bcadf473fd3f0d65ac7d4c8426bd","blockSize":4194304,"blocks":["6c047d1e933a6bf52f60b9f034aa1dfe67d8bcadf473fd3f0d65ac7d4c8426bd"]}},"inboundfilters.js":{"size":6350,"offset":"3384709","integrity":{"algorithm":"SHA256","hash":"79909797143256bcd7ae17e4123dd865b5d789cbef0569a2faa2ab3e944e052f","blockSize":4194304,"blocks":["79909797143256bcd7ae17e4123dd865b5d789cbef0569a2faa2ab3e944e052f"]}},"inboundfilters.js.map":{"size":13118,"offset":"3391059","integrity":{"algorithm":"SHA256","hash":"105e8e8c9a900060ef4c7e929ea758c8cecfb1c621e3ae3cbc04d47603a9d21a","blockSize":4194304,"blocks":["105e8e8c9a900060ef4c7e929ea758c8cecfb1c621e3ae3cbc04d47603a9d21a"]}},"index.js":{"size":146,"offset":"3404177","integrity":{"algorithm":"SHA256","hash":"29929af1e4a154058fe1b1c4e3e991156ee4526eec318306589d68330a3aee7b","blockSize":4194304,"blocks":["29929af1e4a154058fe1b1c4e3e991156ee4526eec318306589d68330a3aee7b"]}},"index.js.map":{"size":90,"offset":"3404323","integrity":{"algorithm":"SHA256","hash":"99cd3ce46e0cbbb15e6b575758d9ccff35ea1af64cca4bd1fe7160e4ac543595","blockSize":4194304,"blocks":["99cd3ce46e0cbbb15e6b575758d9ccff35ea1af64cca4bd1fe7160e4ac543595"]}}}},"scope.js":{"size":13728,"offset":"3404413","integrity":{"algorithm":"SHA256","hash":"7f900a0fcb90fccc227cc388fd3c19c5913f7a099fbf415b7f8bd93d88d94eb7","blockSize":4194304,"blocks":["7f900a0fcb90fccc227cc388fd3c19c5913f7a099fbf415b7f8bd93d88d94eb7"]}},"scope.js.map":{"size":29132,"offset":"3418141","integrity":{"algorithm":"SHA256","hash":"25147bf8f5016339d45fe700effc6505eb1ed0f5a5832c11915f76c0751bd5c8","blockSize":4194304,"blocks":["25147bf8f5016339d45fe700effc6505eb1ed0f5a5832c11915f76c0751bd5c8"]}},"sdk.js":{"size":1079,"offset":"3447273","integrity":{"algorithm":"SHA256","hash":"57f20b5b8c7207a0e0abe84b513c123c0e76f43252805ed0476497081482d679","blockSize":4194304,"blocks":["57f20b5b8c7207a0e0abe84b513c123c0e76f43252805ed0476497081482d679"]}},"sdk.js.map":{"size":1926,"offset":"3448352","integrity":{"algorithm":"SHA256","hash":"86b1e0e39aae066b1878af9816959418ce4a7ee0efd153e509cb2ddaf946eccc","blockSize":4194304,"blocks":["86b1e0e39aae066b1878af9816959418ce4a7ee0efd153e509cb2ddaf946eccc"]}},"session.js":{"size":4938,"offset":"3450278","integrity":{"algorithm":"SHA256","hash":"a63ec2c28d651da4315125226d1ec002e9f19d856486b67ad7ff428de995ea4b","blockSize":4194304,"blocks":["a63ec2c28d651da4315125226d1ec002e9f19d856486b67ad7ff428de995ea4b"]}},"session.js.map":{"size":9274,"offset":"3455216","integrity":{"algorithm":"SHA256","hash":"5c511c0376296f2092a0ba1a09dd73536095cbe23210db082aea95cc3fcb2c75","blockSize":4194304,"blocks":["5c511c0376296f2092a0ba1a09dd73536095cbe23210db082aea95cc3fcb2c75"]}},"sessionflusher.js":{"size":3751,"offset":"3464490","integrity":{"algorithm":"SHA256","hash":"9152444ee4fb18527b6f05d287bf5797e04a7c298debee5879195ea0150c9922","blockSize":4194304,"blocks":["9152444ee4fb18527b6f05d287bf5797e04a7c298debee5879195ea0150c9922"]}},"sessionflusher.js.map":{"size":7162,"offset":"3468241","integrity":{"algorithm":"SHA256","hash":"415548b5cf92bc079358f07308425f928f70cec2b31699f87856ca768490fd3a","blockSize":4194304,"blocks":["415548b5cf92bc079358f07308425f928f70cec2b31699f87856ca768490fd3a"]}},"tracing":{"files":{"errors.js":{"size":1141,"offset":"3475403","integrity":{"algorithm":"SHA256","hash":"433d1ee3fa8dcd93807e2fc5ccf4036dcdb103f9b348f9064a1c856dca36d63f","blockSize":4194304,"blocks":["433d1ee3fa8dcd93807e2fc5ccf4036dcdb103f9b348f9064a1c856dca36d63f"]}},"errors.js.map":{"size":1899,"offset":"3476544","integrity":{"algorithm":"SHA256","hash":"a1d4a140d8e3303eebdec9467dfb15cdf2d179072b81b06a0c4050b27a4d4a9a","blockSize":4194304,"blocks":["a1d4a140d8e3303eebdec9467dfb15cdf2d179072b81b06a0c4050b27a4d4a9a"]}},"hubextensions.js":{"size":8723,"offset":"3478443","integrity":{"algorithm":"SHA256","hash":"17d8c56f28056dbb89841e3eac698ac3fedbf98e349e6dc8dff1542d245ab609","blockSize":4194304,"blocks":["17d8c56f28056dbb89841e3eac698ac3fedbf98e349e6dc8dff1542d245ab609"]}},"hubextensions.js.map":{"size":14806,"offset":"3487166","integrity":{"algorithm":"SHA256","hash":"d6bc7c47b59f08dc41b47221731d50d348e479ef7f3e02d4bf73c19b4e0e5145","blockSize":4194304,"blocks":["d6bc7c47b59f08dc41b47221731d50d348e479ef7f3e02d4bf73c19b4e0e5145"]}},"idletransaction.js":{"size":12011,"offset":"3501972","integrity":{"algorithm":"SHA256","hash":"66fe9939eaaf7ddfab43bd02796ee00df1aae8b4291989ffdb04130f7f8ab52b","blockSize":4194304,"blocks":["66fe9939eaaf7ddfab43bd02796ee00df1aae8b4291989ffdb04130f7f8ab52b"]}},"idletransaction.js.map":{"size":21227,"offset":"3513983","integrity":{"algorithm":"SHA256","hash":"b4275844d7e099495574b9fb048db1dd9860afe19df092ba0b6155c74d91d61b","blockSize":4194304,"blocks":["b4275844d7e099495574b9fb048db1dd9860afe19df092ba0b6155c74d91d61b"]}},"span.js":{"size":8832,"offset":"3535210","integrity":{"algorithm":"SHA256","hash":"1b766d1f4b06d0caf249672cfac57ed7d15e2c1983a85892c58842c7c63ce918","blockSize":4194304,"blocks":["1b766d1f4b06d0caf249672cfac57ed7d15e2c1983a85892c58842c7c63ce918"]}},"span.js.map":{"size":20275,"offset":"3544042","integrity":{"algorithm":"SHA256","hash":"e4573b707573f5eba9290ac2f47dd2bd63a097aaae6f97e0b467b192d86bc83a","blockSize":4194304,"blocks":["e4573b707573f5eba9290ac2f47dd2bd63a097aaae6f97e0b467b192d86bc83a"]}},"spanstatus.js":{"size":2600,"offset":"3564317","integrity":{"algorithm":"SHA256","hash":"723ca98202fa481bc8c9cab05223a13e24ee3278c3db5b5297512c954fc8f4a5","blockSize":4194304,"blocks":["723ca98202fa481bc8c9cab05223a13e24ee3278c3db5b5297512c954fc8f4a5"]}},"spanstatus.js.map":{"size":3328,"offset":"3566917","integrity":{"algorithm":"SHA256","hash":"1f301856e5fa1e4e905eb3c69075b7f77117edfec01834d40d8c27b8c76c9c34","blockSize":4194304,"blocks":["1f301856e5fa1e4e905eb3c69075b7f77117edfec01834d40d8c27b8c76c9c34"]}},"trace.js":{"size":1803,"offset":"3570245","integrity":{"algorithm":"SHA256","hash":"28907f132dd08e90eb7911976c0004cc7ff49a314da44d46908b110a844035fa","blockSize":4194304,"blocks":["28907f132dd08e90eb7911976c0004cc7ff49a314da44d46908b110a844035fa"]}},"trace.js.map":{"size":3578,"offset":"3572048","integrity":{"algorithm":"SHA256","hash":"e6efe8090dded79c2b887d2cbc2dc2772b4bf0e3c80c672d794638b89ca17356","blockSize":4194304,"blocks":["e6efe8090dded79c2b887d2cbc2dc2772b4bf0e3c80c672d794638b89ca17356"]}},"transaction.js":{"size":7640,"offset":"3575626","integrity":{"algorithm":"SHA256","hash":"88557aaac8e525633ec8f0f7037726246c85996088f2c312866036d5253cc491","blockSize":4194304,"blocks":["88557aaac8e525633ec8f0f7037726246c85996088f2c312866036d5253cc491"]}},"transaction.js.map":{"size":15173,"offset":"3583266","integrity":{"algorithm":"SHA256","hash":"422405ae0c51529988e3928ad4850e192a7f162233b31430fc44a42baec68682","blockSize":4194304,"blocks":["422405ae0c51529988e3928ad4850e192a7f162233b31430fc44a42baec68682"]}},"utils.js":{"size":417,"offset":"3598439","integrity":{"algorithm":"SHA256","hash":"9c2e46e82b5a41c71188d54104e912952a5b20754d9a28851567684fa24bfd86","blockSize":4194304,"blocks":["9c2e46e82b5a41c71188d54104e912952a5b20754d9a28851567684fa24bfd86"]}},"utils.js.map":{"size":1498,"offset":"3598856","integrity":{"algorithm":"SHA256","hash":"2372169125eace4a30dcd15cc7840c89fe1f034964508c58f0c368c1706ecf11","blockSize":4194304,"blocks":["2372169125eace4a30dcd15cc7840c89fe1f034964508c58f0c368c1706ecf11"]}}}},"transports":{"files":{"base.js":{"size":3404,"offset":"3600354","integrity":{"algorithm":"SHA256","hash":"88277fe02ff8858befebd4ca6f6de92b5bb9d7eb7c7cd5c594dea9693914415d","blockSize":4194304,"blocks":["88277fe02ff8858befebd4ca6f6de92b5bb9d7eb7c7cd5c594dea9693914415d"]}},"base.js.map":{"size":6747,"offset":"3603758","integrity":{"algorithm":"SHA256","hash":"fd1f3b52cc7d8467dac6606d1cfe761f9a7925720642bbb7c2a1164f40123f14","blockSize":4194304,"blocks":["fd1f3b52cc7d8467dac6606d1cfe761f9a7925720642bbb7c2a1164f40123f14"]}},"offline.js":{"size":3418,"offset":"3610505","integrity":{"algorithm":"SHA256","hash":"a6274c5e7ae168d62198184618d6b13c7fd73c0937cdc7c57a51410fd08a548f","blockSize":4194304,"blocks":["a6274c5e7ae168d62198184618d6b13c7fd73c0937cdc7c57a51410fd08a548f"]}},"offline.js.map":{"size":7762,"offset":"3613923","integrity":{"algorithm":"SHA256","hash":"459b9b3c7b8cb788d46c63f2afdd99cc21da5a1775c5709352a62a3ca3685279","blockSize":4194304,"blocks":["459b9b3c7b8cb788d46c63f2afdd99cc21da5a1775c5709352a62a3ca3685279"]}}}},"utils":{"files":{"hasTracingEnabled.js":{"size":720,"offset":"3621685","integrity":{"algorithm":"SHA256","hash":"cd829b3d07a0e9f5fce86ee7cb85b74f659bcc6692d85a1ca37f3f1861aa724f","blockSize":4194304,"blocks":["cd829b3d07a0e9f5fce86ee7cb85b74f659bcc6692d85a1ca37f3f1861aa724f"]}},"hasTracingEnabled.js.map":{"size":1419,"offset":"3622405","integrity":{"algorithm":"SHA256","hash":"28f68955764306f42834a882de21dc27db1ebf2998cc261197eb4fd42de625ae","blockSize":4194304,"blocks":["28f68955764306f42834a882de21dc27db1ebf2998cc261197eb4fd42de625ae"]}},"prepareEvent.js":{"size":8845,"offset":"3623824","integrity":{"algorithm":"SHA256","hash":"7af91df1885d44eafea2bbe6f6d676571b8924487d102a5b0a3f53c916d2d77a","blockSize":4194304,"blocks":["7af91df1885d44eafea2bbe6f6d676571b8924487d102a5b0a3f53c916d2d77a"]}},"prepareEvent.js.map":{"size":16349,"offset":"3632669","integrity":{"algorithm":"SHA256","hash":"9a120dfdc54f4cee9fed85c8b71d2d7badf24006b77bde8a336d7089bb7bc326","blockSize":4194304,"blocks":["9a120dfdc54f4cee9fed85c8b71d2d7badf24006b77bde8a336d7089bb7bc326"]}}}},"version.js":{"size":91,"offset":"3649018","integrity":{"algorithm":"SHA256","hash":"2b97b3cfcd1cdb081f210d990417ede7d77e3b209f1e9d2df982c3330c2b9328","blockSize":4194304,"blocks":["2b97b3cfcd1cdb081f210d990417ede7d77e3b209f1e9d2df982c3330c2b9328"]}},"version.js.map":{"size":176,"offset":"3649109","integrity":{"algorithm":"SHA256","hash":"97b9e472a0c53dda4e34f50256bee5dbe67995716d9356e5655471ebd15bedbf","blockSize":4194304,"blocks":["97b9e472a0c53dda4e34f50256bee5dbe67995716d9356e5655471ebd15bedbf"]}}}},"LICENSE":{"size":1120,"offset":"3649285","integrity":{"algorithm":"SHA256","hash":"5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7","blockSize":4194304,"blocks":["5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7"]}},"package.json":{"size":627,"offset":"3650405","integrity":{"algorithm":"SHA256","hash":"4d6f3b76c4c9172f0405ceb5d2be897be9f61eeda469b0c18920b8e50b9347fd","blockSize":4194304,"blocks":["4d6f3b76c4c9172f0405ceb5d2be897be9f61eeda469b0c18920b8e50b9347fd"]}},"README.md":{"size":960,"offset":"3651032","integrity":{"algorithm":"SHA256","hash":"ec8a10b95d5f4b2b8b5338f90d9fa36b788259c4db73a6faac1fec9a3a9113c3","blockSize":4194304,"blocks":["ec8a10b95d5f4b2b8b5338f90d9fa36b788259c4db73a6faac1fec9a3a9113c3"]}},"types":{"files":{"api.d.ts":{"size":668,"offset":"3651992","integrity":{"algorithm":"SHA256","hash":"801dbc06ccaa88a9617cfa5e6e1350a004c30a52d0a46afc03745b6f47565991","blockSize":4194304,"blocks":["801dbc06ccaa88a9617cfa5e6e1350a004c30a52d0a46afc03745b6f47565991"]}},"api.d.ts.map":{"size":492,"offset":"3652660","integrity":{"algorithm":"SHA256","hash":"38d11bd03f1c8bf86070976fb03da3756f58c13c0cad158b2d97091479088229","blockSize":4194304,"blocks":["38d11bd03f1c8bf86070976fb03da3756f58c13c0cad158b2d97091479088229"]}},"baseclient.d.ts":{"size":8828,"offset":"3653152","integrity":{"algorithm":"SHA256","hash":"01463ab191d9742e1dd3a9c3ddf19b45dfa5046782bbad14893e9ead1f147958","blockSize":4194304,"blocks":["01463ab191d9742e1dd3a9c3ddf19b45dfa5046782bbad14893e9ead1f147958"]}},"baseclient.d.ts.map":{"size":4360,"offset":"3661980","integrity":{"algorithm":"SHA256","hash":"adb69365a667b7d0acc198ac20793cce0b9b3aefdc1949bc59d215dec7769171","blockSize":4194304,"blocks":["adb69365a667b7d0acc198ac20793cce0b9b3aefdc1949bc59d215dec7769171"]}},"constants.d.ts":{"size":96,"offset":"3666340","integrity":{"algorithm":"SHA256","hash":"ed3f8846db1055010ed9fc62329190b10ae7afa0ab8f61717656834e0c84fc7e","blockSize":4194304,"blocks":["ed3f8846db1055010ed9fc62329190b10ae7afa0ab8f61717656834e0c84fc7e"]}},"constants.d.ts.map":{"size":146,"offset":"3666436","integrity":{"algorithm":"SHA256","hash":"a3503924466f6ea3830bc03b1c65fb23d7301418798dd4eaf5fe272c9e0f00bf","blockSize":4194304,"blocks":["a3503924466f6ea3830bc03b1c65fb23d7301418798dd4eaf5fe272c9e0f00bf"]}},"envelope.d.ts":{"size":555,"offset":"3666582","integrity":{"algorithm":"SHA256","hash":"84de12f36017b8d81e9dd5cb36cc854c7c9b1d788118f02c1ae7c7556fce0e04","blockSize":4194304,"blocks":["84de12f36017b8d81e9dd5cb36cc854c7c9b1d788118f02c1ae7c7556fce0e04"]}},"envelope.d.ts.map":{"size":516,"offset":"3667137","integrity":{"algorithm":"SHA256","hash":"2d30056938ac8b48ad011827635a6d478f95c5c5d342d9c7e00c5cdc378e42ff","blockSize":4194304,"blocks":["2d30056938ac8b48ad011827635a6d478f95c5c5d342d9c7e00c5cdc378e42ff"]}},"exports.d.ts":{"size":5013,"offset":"3667653","integrity":{"algorithm":"SHA256","hash":"bebad71d793d1c4f7d740ad87c53e9553f4699bf8c0ab71239697ce8771d6fb9","blockSize":4194304,"blocks":["bebad71d793d1c4f7d740ad87c53e9553f4699bf8c0ab71239697ce8771d6fb9"]}},"exports.d.ts.map":{"size":1997,"offset":"3672666","integrity":{"algorithm":"SHA256","hash":"a104e97a456ba145da155222fd012548c67a1457055c2d4c3f387da4acf9b823","blockSize":4194304,"blocks":["a104e97a456ba145da155222fd012548c67a1457055c2d4c3f387da4acf9b823"]}},"hub.d.ts":{"size":7792,"offset":"3674663","integrity":{"algorithm":"SHA256","hash":"fd044ffc4d115eff072970663bc37f78323f1f2544f8efcf69723669a44660e7","blockSize":4194304,"blocks":["fd044ffc4d115eff072970663bc37f78323f1f2544f8efcf69723669a44660e7"]}},"hub.d.ts.map":{"size":3873,"offset":"3682455","integrity":{"algorithm":"SHA256","hash":"11db2e9baa6d2366b4aaf52472e580e75aaadb8c0ecc992149d83c0f7d74284e","blockSize":4194304,"blocks":["11db2e9baa6d2366b4aaf52472e580e75aaadb8c0ecc992149d83c0f7d74284e"]}},"index.d.ts":{"size":1516,"offset":"3686328","integrity":{"algorithm":"SHA256","hash":"14670169d3378ce68de0c78c8887f0f7de42ef9a2fe6ccbb43c42e43fe08118a","blockSize":4194304,"blocks":["14670169d3378ce68de0c78c8887f0f7de42ef9a2fe6ccbb43c42e43fe08118a"]}},"index.d.ts.map":{"size":1317,"offset":"3687844","integrity":{"algorithm":"SHA256","hash":"2ffa00902157e6e7442e16bfceb568ad240499a425d5610e2ade455956625c62","blockSize":4194304,"blocks":["2ffa00902157e6e7442e16bfceb568ad240499a425d5610e2ade455956625c62"]}},"integration.d.ts":{"size":1043,"offset":"3689161","integrity":{"algorithm":"SHA256","hash":"272fbf0663745df1af3b09b08ba72e094085a4eb70c00a5808cecd3bc6a23073","blockSize":4194304,"blocks":["272fbf0663745df1af3b09b08ba72e094085a4eb70c00a5808cecd3bc6a23073"]}},"integration.d.ts.map":{"size":633,"offset":"3690204","integrity":{"algorithm":"SHA256","hash":"eab3230e17a5751c128a363b035642f1d34c643aea7f5b65f6639a1b532d2f6d","blockSize":4194304,"blocks":["eab3230e17a5751c128a363b035642f1d34c643aea7f5b65f6639a1b532d2f6d"]}},"integrations":{"files":{"functiontostring.d.ts":{"size":402,"offset":"3690837","integrity":{"algorithm":"SHA256","hash":"4f6f4cb277cc52497a508d1c8d2fc526eb6d4c59d61f81108b7f90c4833e4a39","blockSize":4194304,"blocks":["4f6f4cb277cc52497a508d1c8d2fc526eb6d4c59d61f81108b7f90c4833e4a39"]}},"functiontostring.d.ts.map":{"size":351,"offset":"3691239","integrity":{"algorithm":"SHA256","hash":"35407654c4ebcc83a02504b605231182620f839cc497bb159e933c708c786e0a","blockSize":4194304,"blocks":["35407654c4ebcc83a02504b605231182620f839cc497bb159e933c708c786e0a"]}},"inboundfilters.d.ts":{"size":1169,"offset":"3691590","integrity":{"algorithm":"SHA256","hash":"6498fcf56563ee096ca068af2cd4157a2038256963bd6b937d171c513f8a3ffd","blockSize":4194304,"blocks":["6498fcf56563ee096ca068af2cd4157a2038256963bd6b937d171c513f8a3ffd"]}},"inboundfilters.d.ts.map":{"size":1029,"offset":"3692759","integrity":{"algorithm":"SHA256","hash":"1dffaa377567f04cac048e24215d014782b72998805f53dddfbad82bf731fc81","blockSize":4194304,"blocks":["1dffaa377567f04cac048e24215d014782b72998805f53dddfbad82bf731fc81"]}},"index.d.ts":{"size":141,"offset":"3693788","integrity":{"algorithm":"SHA256","hash":"13377fde1643e43ea7983aa2dd11b9a429ad4af354d1f9ca2fafbb761ee86813","blockSize":4194304,"blocks":["13377fde1643e43ea7983aa2dd11b9a429ad4af354d1f9ca2fafbb761ee86813"]}},"index.d.ts.map":{"size":209,"offset":"3693929","integrity":{"algorithm":"SHA256","hash":"21aee2f4ae85d77c9340208014cdb87cb1b2f45f159bd0d101f1ec70d347100e","blockSize":4194304,"blocks":["21aee2f4ae85d77c9340208014cdb87cb1b2f45f159bd0d101f1ec70d347100e"]}}}},"scope.d.ts":{"size":5473,"offset":"3694138","integrity":{"algorithm":"SHA256","hash":"7f7003c023572f2eaf7f9fbd4bd78b9788a1e451c5d6336e90fc966ba8329718","blockSize":4194304,"blocks":["7f7003c023572f2eaf7f9fbd4bd78b9788a1e451c5d6336e90fc966ba8329718"]}},"scope.d.ts.map":{"size":3409,"offset":"3699611","integrity":{"algorithm":"SHA256","hash":"d7ddda21a7ca5bd36487f08bc6fae9e3cff81f930065a8e07ca9df029bc478d8","blockSize":4194304,"blocks":["d7ddda21a7ca5bd36487f08bc6fae9e3cff81f930065a8e07ca9df029bc478d8"]}},"sdk.d.ts":{"size":619,"offset":"3703020","integrity":{"algorithm":"SHA256","hash":"7d448fad721e617274f2c59c20985bae9b869d7514f92725aa0b18179d805471","blockSize":4194304,"blocks":["7d448fad721e617274f2c59c20985bae9b869d7514f92725aa0b18179d805471"]}},"sdk.d.ts.map":{"size":423,"offset":"3703639","integrity":{"algorithm":"SHA256","hash":"01fb483e716a0b6d187b92367af1d426224531d7b41a6f270090ce50de60e849","blockSize":4194304,"blocks":["01fb483e716a0b6d187b92367af1d426224531d7b41a6f270090ce50de60e849"]}},"session.d.ts":{"size":1800,"offset":"3704062","integrity":{"algorithm":"SHA256","hash":"6256ef13b849b6c7fe759798d7eb2af33a3337550312d14721666a1d07d2ec5c","blockSize":4194304,"blocks":["6256ef13b849b6c7fe759798d7eb2af33a3337550312d14721666a1d07d2ec5c"]}},"session.d.ts.map":{"size":503,"offset":"3705862","integrity":{"algorithm":"SHA256","hash":"bd9256688c711342136ff4fcda1e96de9e90ae7a3b19e713e0e0907a655b5320","blockSize":4194304,"blocks":["bd9256688c711342136ff4fcda1e96de9e90ae7a3b19e713e0e0907a655b5320"]}},"sessionflusher.d.ts":{"size":1399,"offset":"3706365","integrity":{"algorithm":"SHA256","hash":"6b2a05d449868f596ebd93b2abe696bd89738ad1c8818e6a00f76c85b8e42d95","blockSize":4194304,"blocks":["6b2a05d449868f596ebd93b2abe696bd89738ad1c8818e6a00f76c85b8e42d95"]}},"sessionflusher.d.ts.map":{"size":718,"offset":"3707764","integrity":{"algorithm":"SHA256","hash":"f91c9b91a0c559b7b47a481dde65bd1b9066dc3c9eb9cdd044d83fbf379293b2","blockSize":4194304,"blocks":["f91c9b91a0c559b7b47a481dde65bd1b9066dc3c9eb9cdd044d83fbf379293b2"]}},"tracing":{"files":{"errors.d.ts":{"size":143,"offset":"3708482","integrity":{"algorithm":"SHA256","hash":"79ff72b6431952f945bc5550c19c3c2a87c1a40c8c540571e5bc4232121d81a2","blockSize":4194304,"blocks":["79ff72b6431952f945bc5550c19c3c2a87c1a40c8c540571e5bc4232121d81a2"]}},"errors.d.ts.map":{"size":165,"offset":"3708625","integrity":{"algorithm":"SHA256","hash":"f17fcde6eef4412ac17bc3fccbf901468441f888bd200493deafa94f1120792d","blockSize":4194304,"blocks":["f17fcde6eef4412ac17bc3fccbf901468441f888bd200493deafa94f1120792d"]}},"hubextensions.d.ts":{"size":609,"offset":"3708790","integrity":{"algorithm":"SHA256","hash":"08d4d0782730f357b631d363e1e8c5b41fb7baebc7d3bee19f646cd1dfd34a61","blockSize":4194304,"blocks":["08d4d0782730f357b631d363e1e8c5b41fb7baebc7d3bee19f646cd1dfd34a61"]}},"hubextensions.d.ts.map":{"size":550,"offset":"3709399","integrity":{"algorithm":"SHA256","hash":"d5ac90087e806021f1aff458bbbddd0fadd2779dedd5608dd49a27dd408aea0e","blockSize":4194304,"blocks":["d5ac90087e806021f1aff458bbbddd0fadd2779dedd5608dd49a27dd408aea0e"]}},"idletransaction.d.ts":{"size":4401,"offset":"3709949","integrity":{"algorithm":"SHA256","hash":"6a7fee8a799ca3969efea14620993860b440fcf323ecbd98799df7742f51776f","blockSize":4194304,"blocks":["6a7fee8a799ca3969efea14620993860b440fcf323ecbd98799df7742f51776f"]}},"idletransaction.d.ts.map":{"size":2037,"offset":"3714350","integrity":{"algorithm":"SHA256","hash":"f1b8c046077556c8ea78b19d068b117838898c1e713494200eedc72e947d19f6","blockSize":4194304,"blocks":["f1b8c046077556c8ea78b19d068b117838898c1e713494200eedc72e947d19f6"]}},"index.d.ts":{"size":478,"offset":"3716387","integrity":{"algorithm":"SHA256","hash":"a5e0de6bcd0979f1b1aa89558775a0ce16323447ff8413dd50cfeaa50e2e9b5b","blockSize":4194304,"blocks":["a5e0de6bcd0979f1b1aa89558775a0ce16323447ff8413dd50cfeaa50e2e9b5b"]}},"index.d.ts.map":{"size":500,"offset":"3716865","integrity":{"algorithm":"SHA256","hash":"04318e8e7e7d08ee52e2f17cbceb0b5e5f2c54edcaf66f00c63379be76ae89a6","blockSize":4194304,"blocks":["04318e8e7e7d08ee52e2f17cbceb0b5e5f2c54edcaf66f00c63379be76ae89a6"]}},"span.d.ts":{"size":4853,"offset":"3717365","integrity":{"algorithm":"SHA256","hash":"e8f29c0d2bdce9d4d8afbff0bb186db5a5f9e78666aaa0fd53a0b40d42872a80","blockSize":4194304,"blocks":["e8f29c0d2bdce9d4d8afbff0bb186db5a5f9e78666aaa0fd53a0b40d42872a80"]}},"span.d.ts.map":{"size":2677,"offset":"3722218","integrity":{"algorithm":"SHA256","hash":"d4fc4397bad927adbeed2f0f108d6695bc9b5eca375e70abc5b92a54e4e187fd","blockSize":4194304,"blocks":["d4fc4397bad927adbeed2f0f108d6695bc9b5eca375e70abc5b92a54e4e187fd"]}},"spanstatus.d.ts":{"size":1728,"offset":"3724895","integrity":{"algorithm":"SHA256","hash":"742fe616c1ab81aae2559693bda7fa11afb1351f2d279b9c785d236cb7842967","blockSize":4194304,"blocks":["742fe616c1ab81aae2559693bda7fa11afb1351f2d279b9c785d236cb7842967"]}},"spanstatus.d.ts.map":{"size":685,"offset":"3726623","integrity":{"algorithm":"SHA256","hash":"19f4eb8b7de5eafde7118022f7c748e4204f5cd0f201a56d2396c1d99dc8a8b2","blockSize":4194304,"blocks":["19f4eb8b7de5eafde7118022f7c748e4204f5cd0f201a56d2396c1d99dc8a8b2"]}},"trace.d.ts":{"size":679,"offset":"3727308","integrity":{"algorithm":"SHA256","hash":"e96d04c51373e619bfb3d2ebf90acc9168c05f35b925bac1ec5ada5a5171c363","blockSize":4194304,"blocks":["e96d04c51373e619bfb3d2ebf90acc9168c05f35b925bac1ec5ada5a5171c363"]}},"trace.d.ts.map":{"size":394,"offset":"3727987","integrity":{"algorithm":"SHA256","hash":"a5488b829b6447fde318de86b0db324225882f16c5e3f3a6f7b6e47671be89ec","blockSize":4194304,"blocks":["a5488b829b6447fde318de86b0db324225882f16c5e3f3a6f7b6e47671be89ec"]}},"transaction.d.ts":{"size":2295,"offset":"3728381","integrity":{"algorithm":"SHA256","hash":"e111fbedaa11c1ff781f2ec8f3d281428d58a312a2917e598a2c3c72c8dca483","blockSize":4194304,"blocks":["e111fbedaa11c1ff781f2ec8f3d281428d58a312a2917e598a2c3c72c8dca483"]}},"transaction.d.ts.map":{"size":1442,"offset":"3730676","integrity":{"algorithm":"SHA256","hash":"b9f80039cf2fe7b80121243299ba1f1b085dcd58e9262aba98ae3bc189a0219b","blockSize":4194304,"blocks":["b9f80039cf2fe7b80121243299ba1f1b085dcd58e9262aba98ae3bc189a0219b"]}},"utils.d.ts":{"size":927,"offset":"3732118","integrity":{"algorithm":"SHA256","hash":"b160c17392510f2c223661e3202e99e725c8905ffe028971da822d6e1d843101","blockSize":4194304,"blocks":["b160c17392510f2c223661e3202e99e725c8905ffe028971da822d6e1d843101"]}},"utils.d.ts.map":{"size":429,"offset":"3733045","integrity":{"algorithm":"SHA256","hash":"ebbc32acbb80f233389c95e67db8d7e0e222bf94e6ee5c505f81c7ff50a1d423","blockSize":4194304,"blocks":["ebbc32acbb80f233389c95e67db8d7e0e222bf94e6ee5c505f81c7ff50a1d423"]}}}},"transports":{"files":{"base.d.ts":{"size":566,"offset":"3733474","integrity":{"algorithm":"SHA256","hash":"26dd32ab4165b3f48943064ad0ea95399602f29d636c3378dddce2ae6c4ac0f1","blockSize":4194304,"blocks":["26dd32ab4165b3f48943064ad0ea95399602f29d636c3378dddce2ae6c4ac0f1"]}},"base.d.ts.map":{"size":424,"offset":"3734040","integrity":{"algorithm":"SHA256","hash":"2f832775acbd78d1a4663dff64f2a8d76d7a72427d118d2060a4f2b3bde21396","blockSize":4194304,"blocks":["2f832775acbd78d1a4663dff64f2a8d76d7a72427d118d2060a4f2b3bde21396"]}},"offline.d.ts":{"size":1430,"offset":"3734464","integrity":{"algorithm":"SHA256","hash":"281d78d2f8635cc5f2d55a689297e2580272c59d968439a15150d5cfc9799a71","blockSize":4194304,"blocks":["281d78d2f8635cc5f2d55a689297e2580272c59d968439a15150d5cfc9799a71"]}},"offline.d.ts.map":{"size":863,"offset":"3735894","integrity":{"algorithm":"SHA256","hash":"5e82eac6c1e561dfb7dcb8ea909a2563bdc10367c9a7c3b6e47b55c93115a137","blockSize":4194304,"blocks":["5e82eac6c1e561dfb7dcb8ea909a2563bdc10367c9a7c3b6e47b55c93115a137"]}}}},"utils":{"files":{"hasTracingEnabled.d.ts":{"size":413,"offset":"3736757","integrity":{"algorithm":"SHA256","hash":"810ba26833cc96cec2e505bea56bd0e43bbec7742d072508b7eb8a550a0845c6","blockSize":4194304,"blocks":["810ba26833cc96cec2e505bea56bd0e43bbec7742d072508b7eb8a550a0845c6"]}},"hasTracingEnabled.d.ts.map":{"size":316,"offset":"3737170","integrity":{"algorithm":"SHA256","hash":"4be4e5d03056b695b721281584dfb139b691c9d9a0422f61baa2486ae8359c5e","blockSize":4194304,"blocks":["4be4e5d03056b695b721281584dfb139b691c9d9a0422f61baa2486ae8359c5e"]}},"prepareEvent.d.ts":{"size":1141,"offset":"3737486","integrity":{"algorithm":"SHA256","hash":"55940eabcbeb21804ef9b1ade1262804ccefde7c940aa25d8efefe60c478507e","blockSize":4194304,"blocks":["55940eabcbeb21804ef9b1ade1262804ccefde7c940aa25d8efefe60c478507e"]}},"prepareEvent.d.ts.map":{"size":506,"offset":"3738627","integrity":{"algorithm":"SHA256","hash":"1bc1d9f590a88f4a0807499cc129eceadf4245c0159bfb6e5bd50950fcd07774","blockSize":4194304,"blocks":["1bc1d9f590a88f4a0807499cc129eceadf4245c0159bfb6e5bd50950fcd07774"]}}}},"version.d.ts":{"size":82,"offset":"3739133","integrity":{"algorithm":"SHA256","hash":"4df102aa8ce18a8e6dde57d79b8e7a3f8b88c66008e92ab77fd01e9adbd69d8b","blockSize":4194304,"blocks":["4df102aa8ce18a8e6dde57d79b8e7a3f8b88c66008e92ab77fd01e9adbd69d8b"]}},"version.d.ts.map":{"size":140,"offset":"3739215","integrity":{"algorithm":"SHA256","hash":"f9fb0b28511c50264c80873f101c9958eeb7f2852002ac711b6ecee6f65ac1b0","blockSize":4194304,"blocks":["f9fb0b28511c50264c80873f101c9958eeb7f2852002ac711b6ecee6f65ac1b0"]}}}}}},"electron":{"files":{"CHANGELOG.md":{"size":16201,"offset":"3739355","integrity":{"algorithm":"SHA256","hash":"cb2e61812e9103991eba17382449d553a7c507d46b712b0df7cb8bbc4704785f","blockSize":4194304,"blocks":["cb2e61812e9103991eba17382449d553a7c507d46b712b0df7cb8bbc4704785f"]}},"common":{"files":{"index.d.ts":{"size":163,"offset":"3755556","integrity":{"algorithm":"SHA256","hash":"77595bef643b4df0f5a0d22f5966018f919024f8f62b0e9b5ba24b313188c7fd","blockSize":4194304,"blocks":["77595bef643b4df0f5a0d22f5966018f919024f8f62b0e9b5ba24b313188c7fd"]}},"index.d.ts.map":{"size":214,"offset":"3755719","integrity":{"algorithm":"SHA256","hash":"83cb349ef02de55e02148d41e80a21875212cf0a251c44655076354dd5c2d02d","blockSize":4194304,"blocks":["83cb349ef02de55e02148d41e80a21875212cf0a251c44655076354dd5c2d02d"]}},"index.js":{"size":388,"offset":"3755933","integrity":{"algorithm":"SHA256","hash":"54a56bee669a7a54f1cdb034f7a2ef6900bf491c95d4c74d612b3b74b72e80e8","blockSize":4194304,"blocks":["54a56bee669a7a54f1cdb034f7a2ef6900bf491c95d4c74d612b3b74b72e80e8"]}},"index.js.map":{"size":329,"offset":"3756321","integrity":{"algorithm":"SHA256","hash":"580d1bf646ca614d7280264da6ce3ecc3dbb7754d9091ce8fc02b22353353db8","blockSize":4194304,"blocks":["580d1bf646ca614d7280264da6ce3ecc3dbb7754d9091ce8fc02b22353353db8"]}},"ipc.d.ts":{"size":885,"offset":"3756650","integrity":{"algorithm":"SHA256","hash":"dccd46f874d1268070ce7af69529b1a55dbce1ce5e9c7031e1e8aa377db2206e","blockSize":4194304,"blocks":["dccd46f874d1268070ce7af69529b1a55dbce1ce5e9c7031e1e8aa377db2206e"]}},"ipc.d.ts.map":{"size":597,"offset":"3757535","integrity":{"algorithm":"SHA256","hash":"886479cf3a9ebebb26ab36ce62d19749c47cd616c07a84f2ebc7024af72ff5b1","blockSize":4194304,"blocks":["886479cf3a9ebebb26ab36ce62d19749c47cd616c07a84f2ebc7024af72ff5b1"]}},"ipc.js":{"size":713,"offset":"3758132","integrity":{"algorithm":"SHA256","hash":"990c1f6d2156449a20f1cabac8e63bee7393e444be27d77d1e72c2f59612ed68","blockSize":4194304,"blocks":["990c1f6d2156449a20f1cabac8e63bee7393e444be27d77d1e72c2f59612ed68"]}},"ipc.js.map":{"size":1196,"offset":"3758845","integrity":{"algorithm":"SHA256","hash":"930e8d30f81a2d23ca4f5f0c91e1f43d729bbf3a87464e8058a4603bb6b7f888","blockSize":4194304,"blocks":["930e8d30f81a2d23ca4f5f0c91e1f43d729bbf3a87464e8058a4603bb6b7f888"]}},"merge.d.ts":{"size":184,"offset":"3760041","integrity":{"algorithm":"SHA256","hash":"8dba0a0f7622ad1e0098e5e7d7072d679504e77e68a9245c39d8d0aa8cbb6ecd","blockSize":4194304,"blocks":["8dba0a0f7622ad1e0098e5e7d7072d679504e77e68a9245c39d8d0aa8cbb6ecd"]}},"merge.d.ts.map":{"size":238,"offset":"3760225","integrity":{"algorithm":"SHA256","hash":"c643bf5e5bbf0f502f64422e9f6788dadfa23eb3b77e9bd8d3929653b556575d","blockSize":4194304,"blocks":["c643bf5e5bbf0f502f64422e9f6788dadfa23eb3b77e9bd8d3929653b556575d"]}},"merge.js":{"size":1286,"offset":"3760463","integrity":{"algorithm":"SHA256","hash":"be7f9717bbc8d105909d7fb2ca6e0ab0d34422ea0af0547c343006f25d12bbf0","blockSize":4194304,"blocks":["be7f9717bbc8d105909d7fb2ca6e0ab0d34422ea0af0547c343006f25d12bbf0"]}},"merge.js.map":{"size":1882,"offset":"3761749","integrity":{"algorithm":"SHA256","hash":"7cb21996706f8260d124f03dd42b3c84f191f66a1949fd410e630782d13e8cd0","blockSize":4194304,"blocks":["7cb21996706f8260d124f03dd42b3c84f191f66a1949fd410e630782d13e8cd0"]}},"mode.d.ts":{"size":522,"offset":"3763631","integrity":{"algorithm":"SHA256","hash":"562ce97070554a091778da09c586892dc2553a0638a254580d6fb813dcc5f8a1","blockSize":4194304,"blocks":["562ce97070554a091778da09c586892dc2553a0638a254580d6fb813dcc5f8a1"]}},"mode.d.ts.map":{"size":228,"offset":"3764153","integrity":{"algorithm":"SHA256","hash":"a327c02d967f58ec1e5ff1b5effb7a4324e56e6fcc23a2b7acde77ab69692d2b","blockSize":4194304,"blocks":["a327c02d967f58ec1e5ff1b5effb7a4324e56e6fcc23a2b7acde77ab69692d2b"]}},"mode.js":{"size":764,"offset":"3764381","integrity":{"algorithm":"SHA256","hash":"2364264d205d59325297836cd32317130eb3fbc22f188bcf60fa86165fb19116","blockSize":4194304,"blocks":["2364264d205d59325297836cd32317130eb3fbc22f188bcf60fa86165fb19116"]}},"mode.js.map":{"size":781,"offset":"3765145","integrity":{"algorithm":"SHA256","hash":"2bcaa51caaeb71afe50ff4a5b3261e0728307d5862d35d5864bd77412136a28d","blockSize":4194304,"blocks":["2bcaa51caaeb71afe50ff4a5b3261e0728307d5862d35d5864bd77412136a28d"]}},"mutex.d.ts":{"size":663,"offset":"3765926","integrity":{"algorithm":"SHA256","hash":"2d24d3810a027d3754c4985a23fa3f84f775e2eee9fcc81777e6277069d99c45","blockSize":4194304,"blocks":["2d24d3810a027d3754c4985a23fa3f84f775e2eee9fcc81777e6277069d99c45"]}},"mutex.d.ts.map":{"size":507,"offset":"3766589","integrity":{"algorithm":"SHA256","hash":"e6d42430397a7cc55496c557a60e9e2dc60ef1a13429f68085fe82b4ac451a64","blockSize":4194304,"blocks":["e6d42430397a7cc55496c557a60e9e2dc60ef1a13429f68085fe82b4ac451a64"]}},"mutex.js":{"size":2299,"offset":"3767096","integrity":{"algorithm":"SHA256","hash":"a07ce02dc31137234bcb0f8b18455df252483607a6c321987b27b44429518439","blockSize":4194304,"blocks":["a07ce02dc31137234bcb0f8b18455df252483607a6c321987b27b44429518439"]}},"mutex.js.map":{"size":4979,"offset":"3769395","integrity":{"algorithm":"SHA256","hash":"dc00cf830d8f827aeccbfb8bce53bd7c9ff4798f728f49feca88dce1e6e6bf3b","blockSize":4194304,"blocks":["dc00cf830d8f827aeccbfb8bce53bd7c9ff4798f728f49feca88dce1e6e6bf3b"]}},"normalize.d.ts":{"size":808,"offset":"3774374","integrity":{"algorithm":"SHA256","hash":"47e26fe1e3951580367d3ba4a244f1c331a96ee0be980cd987b92f31e348ebd5","blockSize":4194304,"blocks":["47e26fe1e3951580367d3ba4a244f1c331a96ee0be980cd987b92f31e348ebd5"]}},"normalize.d.ts.map":{"size":436,"offset":"3775182","integrity":{"algorithm":"SHA256","hash":"387f93df4658dd31beedace767c22f055ce6fef1913608136deaa6f0962314a6","blockSize":4194304,"blocks":["387f93df4658dd31beedace767c22f055ce6fef1913608136deaa6f0962314a6"]}},"normalize.js":{"size":3929,"offset":"3775618","integrity":{"algorithm":"SHA256","hash":"f8f322ecef8859845e16ccd8c5a0b3638b376af6e79ab098d89b8939d5194962","blockSize":4194304,"blocks":["f8f322ecef8859845e16ccd8c5a0b3638b376af6e79ab098d89b8939d5194962"]}},"normalize.js.map":{"size":6112,"offset":"3779547","integrity":{"algorithm":"SHA256","hash":"c4a4f7e5afd7dc2c3741da084b9959f3d9630ffda0bfbea136c0d48c74793c1b","blockSize":4194304,"blocks":["c4a4f7e5afd7dc2c3741da084b9959f3d9630ffda0bfbea136c0d48c74793c1b"]}},"process.d.ts":{"size":171,"offset":"3785659","integrity":{"algorithm":"SHA256","hash":"17a33b167431614dfb799d7a7af395ac22b040a3645ca436f5cfad61db19ccd9","blockSize":4194304,"blocks":["17a33b167431614dfb799d7a7af395ac22b040a3645ca436f5cfad61db19ccd9"]}},"process.d.ts.map":{"size":190,"offset":"3785830","integrity":{"algorithm":"SHA256","hash":"b2ab802f5f83f3efbe66c93af82f9772c41246d7d64c222768d46b3cfafc90a0","blockSize":4194304,"blocks":["b2ab802f5f83f3efbe66c93af82f9772c41246d7d64c222768d46b3cfafc90a0"]}},"process.js":{"size":740,"offset":"3786020","integrity":{"algorithm":"SHA256","hash":"3049ea842ba56f9bc3a12a9e003758c24bcecad3a3b6ee8f3cdf79b7711ee09d","blockSize":4194304,"blocks":["3049ea842ba56f9bc3a12a9e003758c24bcecad3a3b6ee8f3cdf79b7711ee09d"]}},"process.js.map":{"size":1020,"offset":"3786760","integrity":{"algorithm":"SHA256","hash":"b026e76112b3007b8c7962a2a7052d8397909394fc777c3775b4d41e90e3fabd","blockSize":4194304,"blocks":["b026e76112b3007b8c7962a2a7052d8397909394fc777c3775b4d41e90e3fabd"]}},"types.d.ts":{"size":243,"offset":"3787780","integrity":{"algorithm":"SHA256","hash":"7156826cbbc3a473913814062a6511ba708a51b588dc0a86ce090545f49c5c9a","blockSize":4194304,"blocks":["7156826cbbc3a473913814062a6511ba708a51b588dc0a86ce090545f49c5c9a"]}},"types.d.ts.map":{"size":470,"offset":"3788023","integrity":{"algorithm":"SHA256","hash":"d3922451fe9aa318efa36916d37e93165e7f61c58ac8c299cf9a7322d4b9a6da","blockSize":4194304,"blocks":["d3922451fe9aa318efa36916d37e93165e7f61c58ac8c299cf9a7322d4b9a6da"]}},"types.js":{"size":96,"offset":"3788493","integrity":{"algorithm":"SHA256","hash":"6690e99c2421684b3115c3d5005146a33c775921f4884e4fa5784f1fda28e8a4","blockSize":4194304,"blocks":["6690e99c2421684b3115c3d5005146a33c775921f4884e4fa5784f1fda28e8a4"]}},"types.js.map":{"size":346,"offset":"3788589","integrity":{"algorithm":"SHA256","hash":"a75f9981c5e958c345506f625bda56dbacfe62510891f88232e326741a44a55a","blockSize":4194304,"blocks":["a75f9981c5e958c345506f625bda56dbacfe62510891f88232e326741a44a55a"]}}}},"esm":{"files":{"common":{"files":{"index.d.ts":{"size":163,"offset":"3788935","integrity":{"algorithm":"SHA256","hash":"77595bef643b4df0f5a0d22f5966018f919024f8f62b0e9b5ba24b313188c7fd","blockSize":4194304,"blocks":["77595bef643b4df0f5a0d22f5966018f919024f8f62b0e9b5ba24b313188c7fd"]}},"index.d.ts.map":{"size":217,"offset":"3789098","integrity":{"algorithm":"SHA256","hash":"5c9f3d81d81c8c4c3a961a3ced588349b3192d5428abd0997245167f3c5d7378","blockSize":4194304,"blocks":["5c9f3d81d81c8c4c3a961a3ced588349b3192d5428abd0997245167f3c5d7378"]}},"index.js":{"size":161,"offset":"3789315","integrity":{"algorithm":"SHA256","hash":"4cd5014804ba334b9bf184e6b3b85689fe37fdead12b0213901e23e8a377238c","blockSize":4194304,"blocks":["4cd5014804ba334b9bf184e6b3b85689fe37fdead12b0213901e23e8a377238c"]}},"index.js.map":{"size":370,"offset":"3789476","integrity":{"algorithm":"SHA256","hash":"91ec34c0ff9ba94366c77dd57bce7a4a5db525caf4af3af1984b14fd3230bb36","blockSize":4194304,"blocks":["91ec34c0ff9ba94366c77dd57bce7a4a5db525caf4af3af1984b14fd3230bb36"]}},"ipc.d.ts":{"size":885,"offset":"3789846","integrity":{"algorithm":"SHA256","hash":"dccd46f874d1268070ce7af69529b1a55dbce1ce5e9c7031e1e8aa377db2206e","blockSize":4194304,"blocks":["dccd46f874d1268070ce7af69529b1a55dbce1ce5e9c7031e1e8aa377db2206e"]}},"ipc.d.ts.map":{"size":600,"offset":"3790731","integrity":{"algorithm":"SHA256","hash":"599b4cece2ee60164d039a0354dba10d9560f664c1649774fb0949e00d53b0e2","blockSize":4194304,"blocks":["599b4cece2ee60164d039a0354dba10d9560f664c1649774fb0949e00d53b0e2"]}},"ipc.js":{"size":578,"offset":"3791331","integrity":{"algorithm":"SHA256","hash":"52e843160117bf518906562e0462aa323573a2ede3300364f78ac2c457c741f5","blockSize":4194304,"blocks":["52e843160117bf518906562e0462aa323573a2ede3300364f78ac2c457c741f5"]}},"ipc.js.map":{"size":1205,"offset":"3791909","integrity":{"algorithm":"SHA256","hash":"e4a3704ca587e039708c795d6ae7e922cc85dd8c2e2f83b7cb50a803ceb99ed8","blockSize":4194304,"blocks":["e4a3704ca587e039708c795d6ae7e922cc85dd8c2e2f83b7cb50a803ceb99ed8"]}},"merge.d.ts":{"size":184,"offset":"3793114","integrity":{"algorithm":"SHA256","hash":"8dba0a0f7622ad1e0098e5e7d7072d679504e77e68a9245c39d8d0aa8cbb6ecd","blockSize":4194304,"blocks":["8dba0a0f7622ad1e0098e5e7d7072d679504e77e68a9245c39d8d0aa8cbb6ecd"]}},"merge.d.ts.map":{"size":241,"offset":"3793298","integrity":{"algorithm":"SHA256","hash":"5d2ddf093dbabae57b955053b8b65c3785fec9eb1e917207aaccf9d1b00b325d","blockSize":4194304,"blocks":["5d2ddf093dbabae57b955053b8b65c3785fec9eb1e917207aaccf9d1b00b325d"]}},"merge.js":{"size":1084,"offset":"3793539","integrity":{"algorithm":"SHA256","hash":"0016f66ac0c8dadda9f48887596a0761e57451fdb2c130e214cf9ee44b64843b","blockSize":4194304,"blocks":["0016f66ac0c8dadda9f48887596a0761e57451fdb2c130e214cf9ee44b64843b"]}},"merge.js.map":{"size":1885,"offset":"3794623","integrity":{"algorithm":"SHA256","hash":"ac99f888c1b34d9b788ee5561a26c497dfa653bca1108c38f428e7c384982673","blockSize":4194304,"blocks":["ac99f888c1b34d9b788ee5561a26c497dfa653bca1108c38f428e7c384982673"]}},"mode.d.ts":{"size":522,"offset":"3796508","integrity":{"algorithm":"SHA256","hash":"562ce97070554a091778da09c586892dc2553a0638a254580d6fb813dcc5f8a1","blockSize":4194304,"blocks":["562ce97070554a091778da09c586892dc2553a0638a254580d6fb813dcc5f8a1"]}},"mode.d.ts.map":{"size":231,"offset":"3797030","integrity":{"algorithm":"SHA256","hash":"1252df6fefca99f712463487ab5dcfa7df61be29266969528737eb7467dd8085","blockSize":4194304,"blocks":["1252df6fefca99f712463487ab5dcfa7df61be29266969528737eb7467dd8085"]}},"mode.js":{"size":656,"offset":"3797261","integrity":{"algorithm":"SHA256","hash":"3fbf899edbefa678e6ef3590df0af418d5823ef9ebeaed96a880ff8816ca77f7","blockSize":4194304,"blocks":["3fbf899edbefa678e6ef3590df0af418d5823ef9ebeaed96a880ff8816ca77f7"]}},"mode.js.map":{"size":782,"offset":"3797917","integrity":{"algorithm":"SHA256","hash":"13addad2ca9ddb0b45fa55d9e3ca5057a769da06bfbd71bb97abd2e7ffc6f7ca","blockSize":4194304,"blocks":["13addad2ca9ddb0b45fa55d9e3ca5057a769da06bfbd71bb97abd2e7ffc6f7ca"]}},"mutex.d.ts":{"size":663,"offset":"3798699","integrity":{"algorithm":"SHA256","hash":"2d24d3810a027d3754c4985a23fa3f84f775e2eee9fcc81777e6277069d99c45","blockSize":4194304,"blocks":["2d24d3810a027d3754c4985a23fa3f84f775e2eee9fcc81777e6277069d99c45"]}},"mutex.d.ts.map":{"size":510,"offset":"3799362","integrity":{"algorithm":"SHA256","hash":"5e80bc64890ba9e1605a14348bb9bd04d6b67b2a91a7a446b4d80b2d3785d650","blockSize":4194304,"blocks":["5e80bc64890ba9e1605a14348bb9bd04d6b67b2a91a7a446b4d80b2d3785d650"]}},"mutex.js":{"size":2189,"offset":"3799872","integrity":{"algorithm":"SHA256","hash":"09c4e71614955395374a48f499f31b71ce4f388b540d0696356776af639acab5","blockSize":4194304,"blocks":["09c4e71614955395374a48f499f31b71ce4f388b540d0696356776af639acab5"]}},"mutex.js.map":{"size":4972,"offset":"3802061","integrity":{"algorithm":"SHA256","hash":"d41e858fd33840555f3ce21f8ccd7f02d3ef65555652e4ba75abd83110e09191","blockSize":4194304,"blocks":["d41e858fd33840555f3ce21f8ccd7f02d3ef65555652e4ba75abd83110e09191"]}},"normalize.d.ts":{"size":808,"offset":"3807033","integrity":{"algorithm":"SHA256","hash":"47e26fe1e3951580367d3ba4a244f1c331a96ee0be980cd987b92f31e348ebd5","blockSize":4194304,"blocks":["47e26fe1e3951580367d3ba4a244f1c331a96ee0be980cd987b92f31e348ebd5"]}},"normalize.d.ts.map":{"size":439,"offset":"3807841","integrity":{"algorithm":"SHA256","hash":"86d5e89cbbb3f0cdb575aff8b161549c3300df0c63f157c28a6b5f1951313319","blockSize":4194304,"blocks":["86d5e89cbbb3f0cdb575aff8b161549c3300df0c63f157c28a6b5f1951313319"]}},"normalize.js":{"size":3636,"offset":"3808280","integrity":{"algorithm":"SHA256","hash":"c6aac9f7634840a42e823176e79b5bdd5fc02eb3cfcadf736489a70d0961f810","blockSize":4194304,"blocks":["c6aac9f7634840a42e823176e79b5bdd5fc02eb3cfcadf736489a70d0961f810"]}},"normalize.js.map":{"size":6117,"offset":"3811916","integrity":{"algorithm":"SHA256","hash":"77ebc354336448bb23647658f9011d93140d6e57c28dc20c9f575944803afb41","blockSize":4194304,"blocks":["77ebc354336448bb23647658f9011d93140d6e57c28dc20c9f575944803afb41"]}},"process.d.ts":{"size":171,"offset":"3818033","integrity":{"algorithm":"SHA256","hash":"17a33b167431614dfb799d7a7af395ac22b040a3645ca436f5cfad61db19ccd9","blockSize":4194304,"blocks":["17a33b167431614dfb799d7a7af395ac22b040a3645ca436f5cfad61db19ccd9"]}},"process.d.ts.map":{"size":193,"offset":"3818204","integrity":{"algorithm":"SHA256","hash":"710193cdd8081a5ca9e10c98c406ded3de8d7ca21a56cf693f0af5f7b2ae2be9","blockSize":4194304,"blocks":["710193cdd8081a5ca9e10c98c406ded3de8d7ca21a56cf693f0af5f7b2ae2be9"]}},"process.js":{"size":613,"offset":"3818397","integrity":{"algorithm":"SHA256","hash":"2bf9f2c39766dcf2095db909a725c52f92531b7c6b2b0566e34c1c829817b82a","blockSize":4194304,"blocks":["2bf9f2c39766dcf2095db909a725c52f92531b7c6b2b0566e34c1c829817b82a"]}},"process.js.map":{"size":1014,"offset":"3819010","integrity":{"algorithm":"SHA256","hash":"766e825f4981e41c424c8f6508131736274e6ae7452e92e03c53776463ac9a37","blockSize":4194304,"blocks":["766e825f4981e41c424c8f6508131736274e6ae7452e92e03c53776463ac9a37"]}},"types.d.ts":{"size":243,"offset":"3820024","integrity":{"algorithm":"SHA256","hash":"7156826cbbc3a473913814062a6511ba708a51b588dc0a86ce090545f49c5c9a","blockSize":4194304,"blocks":["7156826cbbc3a473913814062a6511ba708a51b588dc0a86ce090545f49c5c9a"]}},"types.d.ts.map":{"size":473,"offset":"3820267","integrity":{"algorithm":"SHA256","hash":"b1e2b574143400392e56c656293f6f9fd96626c54c2d671fad8c1c9563c6220b","blockSize":4194304,"blocks":["b1e2b574143400392e56c656293f6f9fd96626c54c2d671fad8c1c9563c6220b"]}},"types.js":{"size":44,"offset":"3820740","integrity":{"algorithm":"SHA256","hash":"01ae2a5b120382f9a648ced7ee8507493a134f216d100fc61600c6c9738235d2","blockSize":4194304,"blocks":["01ae2a5b120382f9a648ced7ee8507493a134f216d100fc61600c6c9738235d2"]}},"types.js.map":{"size":349,"offset":"3820784","integrity":{"algorithm":"SHA256","hash":"e2d6cbd58b65be61d1e457b050576d19c4d89711c68cd93fd5a39c2f13c82e45","blockSize":4194304,"blocks":["e2d6cbd58b65be61d1e457b050576d19c4d89711c68cd93fd5a39c2f13c82e45"]}}}},"index.d.ts":{"size":3176,"offset":"3821133","integrity":{"algorithm":"SHA256","hash":"aff8925df18486203e27acb28d88ee0b80cea2f90537f7c57cbf2cadda309db8","blockSize":4194304,"blocks":["aff8925df18486203e27acb28d88ee0b80cea2f90537f7c57cbf2cadda309db8"]}},"index.d.ts.map":{"size":1107,"offset":"3824309","integrity":{"algorithm":"SHA256","hash":"69952159ead6d1e7850bf8a28c729e4bd3e16aba13001a8a9467b87d6758df54","blockSize":4194304,"blocks":["69952159ead6d1e7850bf8a28c729e4bd3e16aba13001a8a9467b87d6758df54"]}},"index.js":{"size":4009,"offset":"3825416","integrity":{"algorithm":"SHA256","hash":"acf6dbdd821a0cf78df3e6b55ec5d9d9e197538337767e2021e8d2d33625c3f0","blockSize":4194304,"blocks":["acf6dbdd821a0cf78df3e6b55ec5d9d9e197538337767e2021e8d2d33625c3f0"]}},"index.js.map":{"size":6288,"offset":"3829425","integrity":{"algorithm":"SHA256","hash":"ada72128bcf42ff973f16574ab6d1b49a9081f1df14ac8eaf48e844ac893e994","blockSize":4194304,"blocks":["ada72128bcf42ff973f16574ab6d1b49a9081f1df14ac8eaf48e844ac893e994"]}},"integrations.d.ts":{"size":1204,"offset":"3835713","integrity":{"algorithm":"SHA256","hash":"d87b7cebbb11516be7cd3a72d212244673289ef1fcf4379333621c61a671dd80","blockSize":4194304,"blocks":["d87b7cebbb11516be7cd3a72d212244673289ef1fcf4379333621c61a671dd80"]}},"integrations.d.ts.map":{"size":868,"offset":"3836917","integrity":{"algorithm":"SHA256","hash":"2c5fffd6730a83603264afa579789eb1cb8619e43373fc83137cb9ccc071e005","blockSize":4194304,"blocks":["2c5fffd6730a83603264afa579789eb1cb8619e43373fc83137cb9ccc071e005"]}},"integrations.js":{"size":2126,"offset":"3837785","integrity":{"algorithm":"SHA256","hash":"bd4dea0bdd8c98d961fb6f5a5656df126dafb6a699f8563191bd8b32e4e667d5","blockSize":4194304,"blocks":["bd4dea0bdd8c98d961fb6f5a5656df126dafb6a699f8563191bd8b32e4e667d5"]}},"integrations.js.map":{"size":4783,"offset":"3839911","integrity":{"algorithm":"SHA256","hash":"9da55a7a20732c9c0b505847b7b6fef20f75d5c75767916a496efa8dd2469abf","blockSize":4194304,"blocks":["9da55a7a20732c9c0b505847b7b6fef20f75d5c75767916a496efa8dd2469abf"]}},"main":{"files":{"context.d.ts":{"size":767,"offset":"3844694","integrity":{"algorithm":"SHA256","hash":"24f20dae0e229a0fb5da2c725dccf4800a3b3f8fcb2a249c5b6ac6ff40e82870","blockSize":4194304,"blocks":["24f20dae0e229a0fb5da2c725dccf4800a3b3f8fcb2a249c5b6ac6ff40e82870"]}},"context.d.ts.map":{"size":459,"offset":"3845461","integrity":{"algorithm":"SHA256","hash":"08cced12fa92bb637895ecc46b11caf502e83f2f2f4c154ba0f0b75b018d8807","blockSize":4194304,"blocks":["08cced12fa92bb637895ecc46b11caf502e83f2f2f4c154ba0f0b75b018d8807"]}},"context.js":{"size":11415,"offset":"3845920","integrity":{"algorithm":"SHA256","hash":"8639c050a586baeba2a6ac4d1a60740ad80b32d81d51d40fa37030c2c3e358b4","blockSize":4194304,"blocks":["8639c050a586baeba2a6ac4d1a60740ad80b32d81d51d40fa37030c2c3e358b4"]}},"context.js.map":{"size":18367,"offset":"3857335","integrity":{"algorithm":"SHA256","hash":"ad027a8b06412d35782f425a41251d7dc0b2d92d7ea4c08ba9154364879fa7ba","blockSize":4194304,"blocks":["ad027a8b06412d35782f425a41251d7dc0b2d92d7ea4c08ba9154364879fa7ba"]}},"electron-normalize.d.ts":{"size":2246,"offset":"3875702","integrity":{"algorithm":"SHA256","hash":"89608fb7783eb6e90ef9a29991bb24c8fbbc5a099e39f1182a14eb5cbde4bccb","blockSize":4194304,"blocks":["89608fb7783eb6e90ef9a29991bb24c8fbbc5a099e39f1182a14eb5cbde4bccb"]}},"electron-normalize.d.ts.map":{"size":1396,"offset":"3877948","integrity":{"algorithm":"SHA256","hash":"8212e0c6db49ac70c0013aba378706f8d59816574d306d2175f88db6e75461b8","blockSize":4194304,"blocks":["8212e0c6db49ac70c0013aba378706f8d59816574d306d2175f88db6e75461b8"]}},"electron-normalize.js":{"size":5609,"offset":"3879344","integrity":{"algorithm":"SHA256","hash":"6ae723ab87b2f6780a7dae0da990338a2bc9a8d67e9c242d1be2f1e4e17ae029","blockSize":4194304,"blocks":["6ae723ab87b2f6780a7dae0da990338a2bc9a8d67e9c242d1be2f1e4e17ae029"]}},"electron-normalize.js.map":{"size":10926,"offset":"3884953","integrity":{"algorithm":"SHA256","hash":"a815d221321b039e101afd7c0051f65990f72475b61640c8c3aab0e59fa31a02","blockSize":4194304,"blocks":["a815d221321b039e101afd7c0051f65990f72475b61640c8c3aab0e59fa31a02"]}},"fs.d.ts":{"size":869,"offset":"3895879","integrity":{"algorithm":"SHA256","hash":"83525e871e376db83c260b17ae556e19beddd6bd2dc5090a5753f512a150e836","blockSize":4194304,"blocks":["83525e871e376db83c260b17ae556e19beddd6bd2dc5090a5753f512a150e836"]}},"fs.d.ts.map":{"size":553,"offset":"3896748","integrity":{"algorithm":"SHA256","hash":"ee8a4e8de665bd8506597681206a02fafb73b72fedfb2eae5356f3db8316f14b","blockSize":4194304,"blocks":["ee8a4e8de665bd8506597681206a02fafb73b72fedfb2eae5356f3db8316f14b"]}},"fs.js":{"size":1580,"offset":"3897301","integrity":{"algorithm":"SHA256","hash":"a3848d9176edbc3ce005a53577bc8f8139716b026bae22d6767f3316ec3f5ed2","blockSize":4194304,"blocks":["a3848d9176edbc3ce005a53577bc8f8139716b026bae22d6767f3316ec3f5ed2"]}},"fs.js.map":{"size":2796,"offset":"3898881","integrity":{"algorithm":"SHA256","hash":"aba8205993b04b8614c3f589641d7b97a58cc82f3595f84ae6b5dbb2c7d733b2","blockSize":4194304,"blocks":["aba8205993b04b8614c3f589641d7b97a58cc82f3595f84ae6b5dbb2c7d733b2"]}},"index.d.ts":{"size":3170,"offset":"3901677","integrity":{"algorithm":"SHA256","hash":"7b2427f6e5a175dad26e6ab9cec4af5164a3938c355dc1e0f5f70c79c9707bf5","blockSize":4194304,"blocks":["7b2427f6e5a175dad26e6ab9cec4af5164a3938c355dc1e0f5f70c79c9707bf5"]}},"index.d.ts.map":{"size":988,"offset":"3904847","integrity":{"algorithm":"SHA256","hash":"c7d0c2d5f7ce868aead35d51c50433a81983c6897a7a551d33a4c61e53eecf5b","blockSize":4194304,"blocks":["c7d0c2d5f7ce868aead35d51c50433a81983c6897a7a551d33a4c61e53eecf5b"]}},"index.js":{"size":968,"offset":"3905835","integrity":{"algorithm":"SHA256","hash":"c01e5f05fdb22260d06a9bb13c2a98f74ff8bf85b744324fb89ce79f44166b8d","blockSize":4194304,"blocks":["c01e5f05fdb22260d06a9bb13c2a98f74ff8bf85b744324fb89ce79f44166b8d"]}},"index.js.map":{"size":2266,"offset":"3906803","integrity":{"algorithm":"SHA256","hash":"02aa2ed99555bec240f524c1bdabb215d7105a65442e55b8d4fcd95a27131981","blockSize":4194304,"blocks":["02aa2ed99555bec240f524c1bdabb215d7105a65442e55b8d4fcd95a27131981"]}},"integrations":{"files":{"additional-context.d.ts":{"size":830,"offset":"3909069","integrity":{"algorithm":"SHA256","hash":"3e4eb6da3aeffb72d1a7e4ae45a908a65b44198ac197d6a94b23264a74cd475c","blockSize":4194304,"blocks":["3e4eb6da3aeffb72d1a7e4ae45a908a65b44198ac197d6a94b23264a74cd475c"]}},"additional-context.d.ts.map":{"size":726,"offset":"3909899","integrity":{"algorithm":"SHA256","hash":"79708f9d69194798caedbe64e2ff4df63754e3f831b046a0f8ab094f15feb3d6","blockSize":4194304,"blocks":["79708f9d69194798caedbe64e2ff4df63754e3f831b046a0f8ab094f15feb3d6"]}},"additional-context.js":{"size":2815,"offset":"3910625","integrity":{"algorithm":"SHA256","hash":"456469d7bc679b069215244bd485d70120021d112b0e4616cf67d90949298da5","blockSize":4194304,"blocks":["456469d7bc679b069215244bd485d70120021d112b0e4616cf67d90949298da5"]}},"additional-context.js.map":{"size":5475,"offset":"3913440","integrity":{"algorithm":"SHA256","hash":"27540606f70876a184e991f8b19e316b2b8de80f61baf6a4efb80224da0990d2","blockSize":4194304,"blocks":["27540606f70876a184e991f8b19e316b2b8de80f61baf6a4efb80224da0990d2"]}},"child-process.d.ts":{"size":819,"offset":"3918915","integrity":{"algorithm":"SHA256","hash":"7dc040efd08b11eb9ca4e961a86019304eb2590ecac10123a4cda7400be96b64","blockSize":4194304,"blocks":["7dc040efd08b11eb9ca4e961a86019304eb2590ecac10123a4cda7400be96b64"]}},"child-process.d.ts.map":{"size":681,"offset":"3919734","integrity":{"algorithm":"SHA256","hash":"45553d7bf0ecf3696798c7944c82e1c87c877ee70489ffbe105508eb5bb15171","blockSize":4194304,"blocks":["45553d7bf0ecf3696798c7944c82e1c87c877ee70489ffbe105508eb5bb15171"]}},"child-process.js":{"size":3540,"offset":"3920415","integrity":{"algorithm":"SHA256","hash":"b17571821b628701cf7051e72be22db8feac861c819e8bdeb40cff5348cbd2c6","blockSize":4194304,"blocks":["b17571821b628701cf7051e72be22db8feac861c819e8bdeb40cff5348cbd2c6"]}},"child-process.js.map":{"size":6749,"offset":"3923955","integrity":{"algorithm":"SHA256","hash":"ad41bbbb5cfd3ee9664dd601a761088ffe15aec1fb67e156aac09da8ac1f58e1","blockSize":4194304,"blocks":["ad41bbbb5cfd3ee9664dd601a761088ffe15aec1fb67e156aac09da8ac1f58e1"]}},"electron-breadcrumbs.d.ts":{"size":2049,"offset":"3930704","integrity":{"algorithm":"SHA256","hash":"992b2491eb01668957ed4a6c4f1dadeb9cd56b4aec3773a820f7467367507d8e","blockSize":4194304,"blocks":["992b2491eb01668957ed4a6c4f1dadeb9cd56b4aec3773a820f7467367507d8e"]}},"electron-breadcrumbs.d.ts.map":{"size":1085,"offset":"3932753","integrity":{"algorithm":"SHA256","hash":"c7936b9080e45dc5405efa1fc7fe774e150a1fc70dda5a514a502717d2156fd8","blockSize":4194304,"blocks":["c7936b9080e45dc5405efa1fc7fe774e150a1fc70dda5a514a502717d2156fd8"]}},"electron-breadcrumbs.js":{"size":4978,"offset":"3933838","integrity":{"algorithm":"SHA256","hash":"f802fcfbc933ad8e0f911776238061cf27eb5e241b27805aacac1b5dc8de2192","blockSize":4194304,"blocks":["f802fcfbc933ad8e0f911776238061cf27eb5e241b27805aacac1b5dc8de2192"]}},"electron-breadcrumbs.js.map":{"size":10182,"offset":"3938816","integrity":{"algorithm":"SHA256","hash":"e4ba77752138ed9b060929f8268f3c33315b5bada7f14691182ad11b84bb8905","blockSize":4194304,"blocks":["e4ba77752138ed9b060929f8268f3c33315b5bada7f14691182ad11b84bb8905"]}},"electron-minidump.d.ts":{"size":1325,"offset":"3948998","integrity":{"algorithm":"SHA256","hash":"adc9f723e969bf0b4b4be66931a2a90679f31d85fe063d4c9f56ff042bce6a2b","blockSize":4194304,"blocks":["adc9f723e969bf0b4b4be66931a2a90679f31d85fe063d4c9f56ff042bce6a2b"]}},"electron-minidump.d.ts.map":{"size":665,"offset":"3950323","integrity":{"algorithm":"SHA256","hash":"ff3448e16fe86f56b0876c26a993f0e55af916dbf78a4b1f1697ed68687a1034","blockSize":4194304,"blocks":["ff3448e16fe86f56b0876c26a993f0e55af916dbf78a4b1f1697ed68687a1034"]}},"electron-minidump.js":{"size":7874,"offset":"3950988","integrity":{"algorithm":"SHA256","hash":"583a82f8c65edd59c38bbb9ccfdd5d58b9eb30f3ade4f29bc861aa10d1103357","blockSize":4194304,"blocks":["583a82f8c65edd59c38bbb9ccfdd5d58b9eb30f3ade4f29bc861aa10d1103357"]}},"electron-minidump.js.map":{"size":13265,"offset":"3958862","integrity":{"algorithm":"SHA256","hash":"af6022c34782c885333094ef50f3fa7b2b851d14b997c3a37d9d564de1292d5f","blockSize":4194304,"blocks":["af6022c34782c885333094ef50f3fa7b2b851d14b997c3a37d9d564de1292d5f"]}},"index.d.ts":{"size":621,"offset":"3972127","integrity":{"algorithm":"SHA256","hash":"eb6ed35ad34c0ac9c25435c03b6d8f7134818bd466ea884b8d2cbb9859c72a78","blockSize":4194304,"blocks":["eb6ed35ad34c0ac9c25435c03b6d8f7134818bd466ea884b8d2cbb9859c72a78"]}},"index.d.ts.map":{"size":609,"offset":"3972748","integrity":{"algorithm":"SHA256","hash":"2b4272faaaff69455be9372412c92cb85ff1f9f0819dc4b184dcf1a81ec1f480","blockSize":4194304,"blocks":["2b4272faaaff69455be9372412c92cb85ff1f9f0819dc4b184dcf1a81ec1f480"]}},"index.js":{"size":619,"offset":"3973357","integrity":{"algorithm":"SHA256","hash":"52cf9022aed9514b11037086cacd87bc043214d52bf6e21a7ca59c985206a04f","blockSize":4194304,"blocks":["52cf9022aed9514b11037086cacd87bc043214d52bf6e21a7ca59c985206a04f"]}},"index.js.map":{"size":1226,"offset":"3973976","integrity":{"algorithm":"SHA256","hash":"b19929badb4b0cad9b2ccc2387f8eca0e3a52a1c15e1cd507ddab106de81a1b1","blockSize":4194304,"blocks":["b19929badb4b0cad9b2ccc2387f8eca0e3a52a1c15e1cd507ddab106de81a1b1"]}},"main-context.d.ts":{"size":416,"offset":"3975202","integrity":{"algorithm":"SHA256","hash":"a7eaeb0cc1743d0f9f505bf1b63ee1e67336b71d056801239efde5386f6f2aa0","blockSize":4194304,"blocks":["a7eaeb0cc1743d0f9f505bf1b63ee1e67336b71d056801239efde5386f6f2aa0"]}},"main-context.d.ts.map":{"size":401,"offset":"3975618","integrity":{"algorithm":"SHA256","hash":"fa52b93458f91c823237a48568e3f25f4d447dc52f37e8c7b7c0f6e0de26fbb5","blockSize":4194304,"blocks":["fa52b93458f91c823237a48568e3f25f4d447dc52f37e8c7b7c0f6e0de26fbb5"]}},"main-context.js":{"size":1109,"offset":"3976019","integrity":{"algorithm":"SHA256","hash":"529889d920c18431d2b809aa181aedf227770cb65ee9374e27da2eedf8cb8749","blockSize":4194304,"blocks":["529889d920c18431d2b809aa181aedf227770cb65ee9374e27da2eedf8cb8749"]}},"main-context.js.map":{"size":1914,"offset":"3977128","integrity":{"algorithm":"SHA256","hash":"5f098bebefcb34452b69fe2c136025e8ea1dc82010bbf9b6bcfade268c3d8fd2","blockSize":4194304,"blocks":["5f098bebefcb34452b69fe2c136025e8ea1dc82010bbf9b6bcfade268c3d8fd2"]}},"main-process-session.d.ts":{"size":518,"offset":"3979042","integrity":{"algorithm":"SHA256","hash":"e6cbf44a67433c6ce0d29d5827d18286577266ebfce64916a034316ecd85ae9a","blockSize":4194304,"blocks":["e6cbf44a67433c6ce0d29d5827d18286577266ebfce64916a034316ecd85ae9a"]}},"main-process-session.d.ts.map":{"size":437,"offset":"3979560","integrity":{"algorithm":"SHA256","hash":"6e15e7da5df70d007505f80dc5f14d018746504299806e4e41aded1384abe7a4","blockSize":4194304,"blocks":["6e15e7da5df70d007505f80dc5f14d018746504299806e4e41aded1384abe7a4"]}},"main-process-session.js":{"size":2010,"offset":"3979997","integrity":{"algorithm":"SHA256","hash":"eee3ea610f4f0078fa128836aec7702d7c0a2968c037756b75021bdd309b5b2c","blockSize":4194304,"blocks":["eee3ea610f4f0078fa128836aec7702d7c0a2968c037756b75021bdd309b5b2c"]}},"main-process-session.js.map":{"size":3136,"offset":"3982007","integrity":{"algorithm":"SHA256","hash":"ea2824b351b3dc238394e4b43e6eef7bd63d438b338853450636c62867e67197","blockSize":4194304,"blocks":["ea2824b351b3dc238394e4b43e6eef7bd63d438b338853450636c62867e67197"]}},"net-breadcrumbs.d.ts":{"size":1283,"offset":"3985143","integrity":{"algorithm":"SHA256","hash":"a8af1d9342faecf471b3a6a73de57327d10f51c9c5e1233c9911816b86554a56","blockSize":4194304,"blocks":["a8af1d9342faecf471b3a6a73de57327d10f51c9c5e1233c9911816b86554a56"]}},"net-breadcrumbs.d.ts.map":{"size":846,"offset":"3986426","integrity":{"algorithm":"SHA256","hash":"f7c7da5451bb39e4e4f3b0cdfb8dcb1adde6d35aadd319b1475c47b50ee6b3d4","blockSize":4194304,"blocks":["f7c7da5451bb39e4e4f3b0cdfb8dcb1adde6d35aadd319b1475c47b50ee6b3d4"]}},"net-breadcrumbs.js":{"size":5177,"offset":"3987272","integrity":{"algorithm":"SHA256","hash":"bc394dc0e26b4f5b9d35c3bc657ed54dcf11af9c0c95e0ae4962e8b35926d516","blockSize":4194304,"blocks":["bc394dc0e26b4f5b9d35c3bc657ed54dcf11af9c0c95e0ae4962e8b35926d516"]}},"net-breadcrumbs.js.map":{"size":10884,"offset":"3992449","integrity":{"algorithm":"SHA256","hash":"02408beb45b1892fb1b2ea34db3604794584deae3f962c20246916dfb8ce0527","blockSize":4194304,"blocks":["02408beb45b1892fb1b2ea34db3604794584deae3f962c20246916dfb8ce0527"]}},"onuncaughtexception.d.ts":{"size":340,"offset":"4003333","integrity":{"algorithm":"SHA256","hash":"71cb08cba72048f4d9b7f5e207b9b1368093d8dc4ddb21746b3c6921a01c9859","blockSize":4194304,"blocks":["71cb08cba72048f4d9b7f5e207b9b1368093d8dc4ddb21746b3c6921a01c9859"]}},"onuncaughtexception.d.ts.map":{"size":360,"offset":"4003673","integrity":{"algorithm":"SHA256","hash":"c446c2800fc207e5055faeb8499bb1915555fca9d80cf528daf25cd85f9ab081","blockSize":4194304,"blocks":["c446c2800fc207e5055faeb8499bb1915555fca9d80cf528daf25cd85f9ab081"]}},"onuncaughtexception.js":{"size":2402,"offset":"4004033","integrity":{"algorithm":"SHA256","hash":"6d7e71bbc3731cde94b9f20e3dff47756d69e622c7d9f76d9c7a61d51af36e06","blockSize":4194304,"blocks":["6d7e71bbc3731cde94b9f20e3dff47756d69e622c7d9f76d9c7a61d51af36e06"]}},"onuncaughtexception.js.map":{"size":3705,"offset":"4006435","integrity":{"algorithm":"SHA256","hash":"5b24afa92642f408a148399979242b43a310c6c2cd18a7b5fedda4a80d26d721","blockSize":4194304,"blocks":["5b24afa92642f408a148399979242b43a310c6c2cd18a7b5fedda4a80d26d721"]}},"preload-injection.d.ts":{"size":527,"offset":"4010140","integrity":{"algorithm":"SHA256","hash":"2af91c2c61b48c30aa5f3d7c20b98ccc089fa1dfb51266cf3c42dec94fd23c38","blockSize":4194304,"blocks":["2af91c2c61b48c30aa5f3d7c20b98ccc089fa1dfb51266cf3c42dec94fd23c38"]}},"preload-injection.d.ts.map":{"size":391,"offset":"4010667","integrity":{"algorithm":"SHA256","hash":"1d0c362006818d577eed07b6b48fd3b0971051ca935d81957cb37590fe9eecdd","blockSize":4194304,"blocks":["1d0c362006818d577eed07b6b48fd3b0971051ca935d81957cb37590fe9eecdd"]}},"preload-injection.js":{"size":2070,"offset":"4011058","integrity":{"algorithm":"SHA256","hash":"e1f3915800095a648bfdb3f407e147b38928992776d48c94413b36565662f31a","blockSize":4194304,"blocks":["e1f3915800095a648bfdb3f407e147b38928992776d48c94413b36565662f31a"]}},"preload-injection.js.map":{"size":3657,"offset":"4013128","integrity":{"algorithm":"SHA256","hash":"d0aac51564d79fed4432f304bdb52a5e2aa48372fa77045cb9f218efefaf1a5d","blockSize":4194304,"blocks":["d0aac51564d79fed4432f304bdb52a5e2aa48372fa77045cb9f218efefaf1a5d"]}},"screenshots.d.ts":{"size":388,"offset":"4016785","integrity":{"algorithm":"SHA256","hash":"deb2e74f6238794036083a77fc3335ebed00d7ec4073413202d02d765f05d9b5","blockSize":4194304,"blocks":["deb2e74f6238794036083a77fc3335ebed00d7ec4073413202d02d765f05d9b5"]}},"screenshots.d.ts.map":{"size":401,"offset":"4017173","integrity":{"algorithm":"SHA256","hash":"e6fcad6bb631ec7650e8c35460ac178492e54407f2a09c583afe40abd444c2fa","blockSize":4194304,"blocks":["e6fcad6bb631ec7650e8c35460ac178492e54407f2a09c583afe40abd444c2fa"]}},"screenshots.js":{"size":2058,"offset":"4017574","integrity":{"algorithm":"SHA256","hash":"1ffce97cc2b4b16ed07862cac0abe109eb4a7332e6fe1c6e34f9d4f1e3289417","blockSize":4194304,"blocks":["1ffce97cc2b4b16ed07862cac0abe109eb4a7332e6fe1c6e34f9d4f1e3289417"]}},"screenshots.js.map":{"size":3327,"offset":"4019632","integrity":{"algorithm":"SHA256","hash":"a720b211089c350fbc04e352854b706e8a40d30a1183b82f0f785bd6067f7cb5","blockSize":4194304,"blocks":["a720b211089c350fbc04e352854b706e8a40d30a1183b82f0f785bd6067f7cb5"]}},"sentry-minidump":{"files":{"index.d.ts":{"size":1102,"offset":"4022959","integrity":{"algorithm":"SHA256","hash":"e3491e550803c94eaf449529def05af923b48537fbf0f004b4d461a3e7f4e0cb","blockSize":4194304,"blocks":["e3491e550803c94eaf449529def05af923b48537fbf0f004b4d461a3e7f4e0cb"]}},"index.d.ts.map":{"size":620,"offset":"4024061","integrity":{"algorithm":"SHA256","hash":"deb5071c9aa489ee20b07b01aebe9e82118da287b6e86b7483b9f204bfc62c6f","blockSize":4194304,"blocks":["deb5071c9aa489ee20b07b01aebe9e82118da287b6e86b7483b9f204bfc62c6f"]}},"index.js":{"size":10124,"offset":"4024681","integrity":{"algorithm":"SHA256","hash":"115d7ad5308c8ee4da26f4b767457adaa85f59deb9ba8cb1e6223797b90b4573","blockSize":4194304,"blocks":["115d7ad5308c8ee4da26f4b767457adaa85f59deb9ba8cb1e6223797b90b4573"]}},"index.js.map":{"size":14979,"offset":"4034805","integrity":{"algorithm":"SHA256","hash":"c894334cda5ea136a120879ab4b41e03feffa3b902e982289bbc4f9e88248ba4","blockSize":4194304,"blocks":["c894334cda5ea136a120879ab4b41e03feffa3b902e982289bbc4f9e88248ba4"]}},"minidump-loader.d.ts":{"size":400,"offset":"4049784","integrity":{"algorithm":"SHA256","hash":"1ed872db999c8919d24cdb05417a299f38d5c1bd0b02ab2e2e3143763d8e4bdd","blockSize":4194304,"blocks":["1ed872db999c8919d24cdb05417a299f38d5c1bd0b02ab2e2e3143763d8e4bdd"]}},"minidump-loader.d.ts.map":{"size":457,"offset":"4050184","integrity":{"algorithm":"SHA256","hash":"54704c711d8c51f62adf3d1d16d92e236094af9bda7a47c8e33aaaf4f6dba811","blockSize":4194304,"blocks":["54704c711d8c51f62adf3d1d16d92e236094af9bda7a47c8e33aaaf4f6dba811"]}},"minidump-loader.js":{"size":6543,"offset":"4050641","integrity":{"algorithm":"SHA256","hash":"8a6ab3c814a2c56e098506f904de76a9916c44660e10cf1977849ef4072366ef","blockSize":4194304,"blocks":["8a6ab3c814a2c56e098506f904de76a9916c44660e10cf1977849ef4072366ef"]}},"minidump-loader.js.map":{"size":11218,"offset":"4057184","integrity":{"algorithm":"SHA256","hash":"a5182423f778c2d0a97135e573b91061826808eeb78c9d5d357cf93ad0c87313","blockSize":4194304,"blocks":["a5182423f778c2d0a97135e573b91061826808eeb78c9d5d357cf93ad0c87313"]}}}}}},"ipc.d.ts":{"size":224,"offset":"4068402","integrity":{"algorithm":"SHA256","hash":"bfc198d44d88604b7f2a736711c8d312dedb0d7c605d42809d232916f90a7264","blockSize":4194304,"blocks":["bfc198d44d88604b7f2a736711c8d312dedb0d7c605d42809d232916f90a7264"]}},"ipc.d.ts.map":{"size":219,"offset":"4068626","integrity":{"algorithm":"SHA256","hash":"f7ce0259126ebc5188afc2db3225917d9c2c3e5f0db8d07514772a723c00d953","blockSize":4194304,"blocks":["f7ce0259126ebc5188afc2db3225917d9c2c3e5f0db8d07514772a723c00d953"]}},"ipc.js":{"size":6794,"offset":"4068845","integrity":{"algorithm":"SHA256","hash":"2ef323a147e466e6627ee13e18c2966a2ae55d2bcc11f298b1af222716cc3b6f","blockSize":4194304,"blocks":["2ef323a147e466e6627ee13e18c2966a2ae55d2bcc11f298b1af222716cc3b6f"]}},"ipc.js.map":{"size":12388,"offset":"4075639","integrity":{"algorithm":"SHA256","hash":"90a8deead10fe1af803747ba6d9e70aea3935a957b5dd6073e42095608d98c4a","blockSize":4194304,"blocks":["90a8deead10fe1af803747ba6d9e70aea3935a957b5dd6073e42095608d98c4a"]}},"renderers.d.ts":{"size":460,"offset":"4088027","integrity":{"algorithm":"SHA256","hash":"26c82cc8d480501665a2db9737c2c116b6beb0e89b420515fcb13d10d7a0f188","blockSize":4194304,"blocks":["26c82cc8d480501665a2db9737c2c116b6beb0e89b420515fcb13d10d7a0f188"]}},"renderers.d.ts.map":{"size":353,"offset":"4088487","integrity":{"algorithm":"SHA256","hash":"1925be3bd710bfa3e00033e54b164773141bd83d472abd7ab490710bd35735c9","blockSize":4194304,"blocks":["1925be3bd710bfa3e00033e54b164773141bd83d472abd7ab490710bd35735c9"]}},"renderers.js":{"size":1588,"offset":"4088840","integrity":{"algorithm":"SHA256","hash":"c1252c96e74500862224e117c91f76b0030e0dc9178481528e0195119d4dc04d","blockSize":4194304,"blocks":["c1252c96e74500862224e117c91f76b0030e0dc9178481528e0195119d4dc04d"]}},"renderers.js.map":{"size":3304,"offset":"4090428","integrity":{"algorithm":"SHA256","hash":"15c9858a8e25c1eb3f8893743d2f86840af0330dca2bf3402748006ef87ad148","blockSize":4194304,"blocks":["15c9858a8e25c1eb3f8893743d2f86840af0330dca2bf3402748006ef87ad148"]}},"sdk.d.ts":{"size":2023,"offset":"4093732","integrity":{"algorithm":"SHA256","hash":"a53f47c0efbce89c4aa1305f615b78d81e3c21eaff6c94db911877b1fcc49234","blockSize":4194304,"blocks":["a53f47c0efbce89c4aa1305f615b78d81e3c21eaff6c94db911877b1fcc49234"]}},"sdk.d.ts.map":{"size":876,"offset":"4095755","integrity":{"algorithm":"SHA256","hash":"5e56ee70941f999f8bc793058895435bffd11f3dc3fdb5a734137e28ff2defd5","blockSize":4194304,"blocks":["5e56ee70941f999f8bc793058895435bffd11f3dc3fdb5a734137e28ff2defd5"]}},"sdk.js":{"size":3492,"offset":"4096631","integrity":{"algorithm":"SHA256","hash":"ae111d57721c1c2ff600c91e2cc8962bfc5d85f2240307e954813964b6694642","blockSize":4194304,"blocks":["ae111d57721c1c2ff600c91e2cc8962bfc5d85f2240307e954813964b6694642"]}},"sdk.js.map":{"size":8104,"offset":"4100123","integrity":{"algorithm":"SHA256","hash":"037c125f70a340cb11b9b77f8e56fe96bacec749857849789e016a52af5ebf4e","blockSize":4194304,"blocks":["037c125f70a340cb11b9b77f8e56fe96bacec749857849789e016a52af5ebf4e"]}},"sessions.d.ts":{"size":637,"offset":"4108227","integrity":{"algorithm":"SHA256","hash":"19b645618b052593b65c13a0a4d410d52fb7d079c6515d56ad036327a505ed54","blockSize":4194304,"blocks":["19b645618b052593b65c13a0a4d410d52fb7d079c6515d56ad036327a505ed54"]}},"sessions.d.ts.map":{"size":466,"offset":"4108864","integrity":{"algorithm":"SHA256","hash":"a842944f82fbf3ab200ad4a7378bec6eb738e43f2f281b90089c361c3f560152","blockSize":4194304,"blocks":["a842944f82fbf3ab200ad4a7378bec6eb738e43f2f281b90089c361c3f560152"]}},"sessions.js":{"size":5055,"offset":"4109330","integrity":{"algorithm":"SHA256","hash":"fefb668c9b9e5a1685690f64496ce184837d231d361e5553d4bd270315449cf0","blockSize":4194304,"blocks":["fefb668c9b9e5a1685690f64496ce184837d231d361e5553d4bd270315449cf0"]}},"sessions.js.map":{"size":7845,"offset":"4114385","integrity":{"algorithm":"SHA256","hash":"d1000d57a9d44fa3c5b137460637ea82c8cde4055fb26fda247e5ea0d15d4ffc","blockSize":4194304,"blocks":["d1000d57a9d44fa3c5b137460637ea82c8cde4055fb26fda247e5ea0d15d4ffc"]}},"store.d.ts":{"size":2321,"offset":"4122230","integrity":{"algorithm":"SHA256","hash":"37269d0cd6ba8fe2b8f42c617d7e0e3ad7df4d230873392b602b2eadd3154feb","blockSize":4194304,"blocks":["37269d0cd6ba8fe2b8f42c617d7e0e3ad7df4d230873392b602b2eadd3154feb"]}},"store.d.ts.map":{"size":1116,"offset":"4124551","integrity":{"algorithm":"SHA256","hash":"9bcc8073ac3e11c78254e9f5c19b13a6dca3961d3e334afa85b2d2a67c7091d7","blockSize":4194304,"blocks":["9bcc8073ac3e11c78254e9f5c19b13a6dca3961d3e334afa85b2d2a67c7091d7"]}},"store.js":{"size":5562,"offset":"4125667","integrity":{"algorithm":"SHA256","hash":"08116cee2c03cc548b3826ac46ba2f43d60caf755e99cc2835f01d228bdfb357","blockSize":4194304,"blocks":["08116cee2c03cc548b3826ac46ba2f43d60caf755e99cc2835f01d228bdfb357"]}},"store.js.map":{"size":7995,"offset":"4131229","integrity":{"algorithm":"SHA256","hash":"abb4b63ffbf6ecd281ccb2374a45ffcb991cdbb84eed8bcfc22e34c78a2d6d07","blockSize":4194304,"blocks":["abb4b63ffbf6ecd281ccb2374a45ffcb991cdbb84eed8bcfc22e34c78a2d6d07"]}},"transports":{"files":{"electron-net.d.ts":{"size":672,"offset":"4139224","integrity":{"algorithm":"SHA256","hash":"d5bdb1ce5827a88ec8dd148f87ff3ba6b29232422f821143df532336051d762a","blockSize":4194304,"blocks":["d5bdb1ce5827a88ec8dd148f87ff3ba6b29232422f821143df532336051d762a"]}},"electron-net.d.ts.map":{"size":500,"offset":"4139896","integrity":{"algorithm":"SHA256","hash":"32a5e6fd96243d05aae0c7ff99cae0eb3ef2d889f192c3045575cb08e12fde87","blockSize":4194304,"blocks":["32a5e6fd96243d05aae0c7ff99cae0eb3ef2d889f192c3045575cb08e12fde87"]}},"electron-net.js":{"size":3270,"offset":"4140396","integrity":{"algorithm":"SHA256","hash":"14520c3ed685585cd2af797ceb502e1b4f796ce543980a95c786da510f2b8309","blockSize":4194304,"blocks":["14520c3ed685585cd2af797ceb502e1b4f796ce543980a95c786da510f2b8309"]}},"electron-net.js.map":{"size":6398,"offset":"4143666","integrity":{"algorithm":"SHA256","hash":"b4cd99d622399e4e788ed3c213ac2399a7e846a75a9de658387520235dffafad","blockSize":4194304,"blocks":["b4cd99d622399e4e788ed3c213ac2399a7e846a75a9de658387520235dffafad"]}},"electron-offline-net.d.ts":{"size":1284,"offset":"4150064","integrity":{"algorithm":"SHA256","hash":"f931335bb1da68184b376c7eb6e6a20b8e47ed40967012fb76b10c2c93d6497d","blockSize":4194304,"blocks":["f931335bb1da68184b376c7eb6e6a20b8e47ed40967012fb76b10c2c93d6497d"]}},"electron-offline-net.d.ts.map":{"size":674,"offset":"4151348","integrity":{"algorithm":"SHA256","hash":"a8855b330d5ca296687c9f05b87cce3ee21df9f5ac4b33e41983133e6a686d32","blockSize":4194304,"blocks":["a8855b330d5ca296687c9f05b87cce3ee21df9f5ac4b33e41983133e6a686d32"]}},"electron-offline-net.js":{"size":4007,"offset":"4152022","integrity":{"algorithm":"SHA256","hash":"bf20a1db81491f8116df25bee55722ee3d1c42665c6d365ab663395238448f33","blockSize":4194304,"blocks":["bf20a1db81491f8116df25bee55722ee3d1c42665c6d365ab663395238448f33"]}},"electron-offline-net.js.map":{"size":7749,"offset":"4156029","integrity":{"algorithm":"SHA256","hash":"5c1d305f044d031c717a3e244ca113e70f69e171349a6abea9e117cd2d62132e","blockSize":4194304,"blocks":["5c1d305f044d031c717a3e244ca113e70f69e171349a6abea9e117cd2d62132e"]}},"queue.d.ts":{"size":853,"offset":"4163778","integrity":{"algorithm":"SHA256","hash":"c7cca7f47128cb5dde25947c254357665e2e1b6e241a7531b12de25ec67e936a","blockSize":4194304,"blocks":["c7cca7f47128cb5dde25947c254357665e2e1b6e241a7531b12de25ec67e936a"]}},"queue.d.ts.map":{"size":701,"offset":"4164631","integrity":{"algorithm":"SHA256","hash":"3c041881039978bf1c0886cf9419d74792c2b5ac64270321ac3d2bc54b15bbe7","blockSize":4194304,"blocks":["3c041881039978bf1c0886cf9419d74792c2b5ac64270321ac3d2bc54b15bbe7"]}},"queue.js":{"size":3478,"offset":"4165332","integrity":{"algorithm":"SHA256","hash":"cbec51fa509679a3cf6b47b26df64d0cb1925fd162593882214f5e02986b2ae8","blockSize":4194304,"blocks":["cbec51fa509679a3cf6b47b26df64d0cb1925fd162593882214f5e02986b2ae8"]}},"queue.js.map":{"size":5763,"offset":"4168810","integrity":{"algorithm":"SHA256","hash":"94af6140a6e74998ae11b9d1d4f92a563bea825374296f1fc0c05f396c4d90ea","blockSize":4194304,"blocks":["94af6140a6e74998ae11b9d1d4f92a563bea825374296f1fc0c05f396c4d90ea"]}}}},"version.d.ts":{"size":81,"offset":"4174573","integrity":{"algorithm":"SHA256","hash":"fbbb67f1b06db11a8c451c19329670202c59e460fdd5f5218018df23cadddeb1","blockSize":4194304,"blocks":["fbbb67f1b06db11a8c451c19329670202c59e460fdd5f5218018df23cadddeb1"]}},"version.d.ts.map":{"size":145,"offset":"4174654","integrity":{"algorithm":"SHA256","hash":"1dd3b9da98cd117aa867f75db6c50fba4b221b76d99ad0b1d58864e56f33e14d","blockSize":4194304,"blocks":["1dd3b9da98cd117aa867f75db6c50fba4b221b76d99ad0b1d58864e56f33e14d"]}},"version.js":{"size":71,"offset":"4174799","integrity":{"algorithm":"SHA256","hash":"d047e89021e49851ca2d6c429cab542a01db0b37799acc129032952d1f8c68f4","blockSize":4194304,"blocks":["d047e89021e49851ca2d6c429cab542a01db0b37799acc129032952d1f8c68f4"]}},"version.js.map":{"size":212,"offset":"4174870","integrity":{"algorithm":"SHA256","hash":"9d0e5db265ad5334ea46d8aaf65f6964f4cad6c16fede071f9de68e8e65b6ffe","blockSize":4194304,"blocks":["9d0e5db265ad5334ea46d8aaf65f6964f4cad6c16fede071f9de68e8e65b6ffe"]}}}},"preload":{"files":{"index.js":{"size":1012,"offset":"4175082","integrity":{"algorithm":"SHA256","hash":"af22302da9bee357595d630910a21b6a44afd97fd7b1d7fde1b2c0b548c56c76","blockSize":4194304,"blocks":["af22302da9bee357595d630910a21b6a44afd97fd7b1d7fde1b2c0b548c56c76"]}},"legacy.js":{"size":1298,"offset":"4176094","integrity":{"algorithm":"SHA256","hash":"22511c52f72cd176e708a17e0362ecabdb5c883ad8cf77d7f0716f33d51ef694","blockSize":4194304,"blocks":["22511c52f72cd176e708a17e0362ecabdb5c883ad8cf77d7f0716f33d51ef694"]}}}},"renderer":{"files":{"index.d.ts":{"size":1530,"offset":"4177392","integrity":{"algorithm":"SHA256","hash":"3e99267005e7d25ba87424de5af34e3098ef7b79ef1de42b8c648a9e3e4bc546","blockSize":4194304,"blocks":["3e99267005e7d25ba87424de5af34e3098ef7b79ef1de42b8c648a9e3e4bc546"]}},"index.d.ts.map":{"size":826,"offset":"4178922","integrity":{"algorithm":"SHA256","hash":"9a8545fb86a4e9a388325a5da97832d70b91c0eeeff83c8032442398bd025469","blockSize":4194304,"blocks":["9a8545fb86a4e9a388325a5da97832d70b91c0eeeff83c8032442398bd025469"]}},"index.js":{"size":767,"offset":"4179748","integrity":{"algorithm":"SHA256","hash":"e43b588e2b42c492bfc45a8f042f5abb993d8b1efd45cc83898689d99d9aad3c","blockSize":4194304,"blocks":["e43b588e2b42c492bfc45a8f042f5abb993d8b1efd45cc83898689d99d9aad3c"]}},"index.js.map":{"size":1849,"offset":"4180515","integrity":{"algorithm":"SHA256","hash":"6b425677f8aa353eb38a16808b7627facb52be6ed9626ce78e62bf80e2f9eb67","blockSize":4194304,"blocks":["6b425677f8aa353eb38a16808b7627facb52be6ed9626ce78e62bf80e2f9eb67"]}},"integrations":{"files":{"event-to-main.d.ts":{"size":402,"offset":"4182364","integrity":{"algorithm":"SHA256","hash":"78b0269e913210cf98f3235bf28770d309ca1bc4ca26158eb2c8a60489014736","blockSize":4194304,"blocks":["78b0269e913210cf98f3235bf28770d309ca1bc4ca26158eb2c8a60489014736"]}},"event-to-main.d.ts.map":{"size":405,"offset":"4182766","integrity":{"algorithm":"SHA256","hash":"c304c19a4d8f26c54d1416c4c93f1b9899c06818424cccad7ca2403d3d53fed8","blockSize":4194304,"blocks":["c304c19a4d8f26c54d1416c4c93f1b9899c06818424cccad7ca2403d3d53fed8"]}},"event-to-main.js":{"size":1009,"offset":"4183171","integrity":{"algorithm":"SHA256","hash":"d1fba540b3fe6cb94a7bea772471c9d6361aa4a761e137ec235496a91b027f04","blockSize":4194304,"blocks":["d1fba540b3fe6cb94a7bea772471c9d6361aa4a761e137ec235496a91b027f04"]}},"event-to-main.js.map":{"size":1852,"offset":"4184180","integrity":{"algorithm":"SHA256","hash":"ffc63670c087397c5fe0775c9894038d463d1b2b75e45135fffc02d3cd65c74c","blockSize":4194304,"blocks":["ffc63670c087397c5fe0775c9894038d463d1b2b75e45135fffc02d3cd65c74c"]}},"index.d.ts":{"size":129,"offset":"4186032","integrity":{"algorithm":"SHA256","hash":"a1af9ee0cbfc914131ad06e966dfdbe1ee18f8bbe7efe2a25b988b96967ba37c","blockSize":4194304,"blocks":["a1af9ee0cbfc914131ad06e966dfdbe1ee18f8bbe7efe2a25b988b96967ba37c"]}},"index.d.ts.map":{"size":216,"offset":"4186161","integrity":{"algorithm":"SHA256","hash":"f7f9ac43c45d4c295c59461083630aac26314b12ef747a94d84640bee6a657aa","blockSize":4194304,"blocks":["f7f9ac43c45d4c295c59461083630aac26314b12ef747a94d84640bee6a657aa"]}},"index.js":{"size":127,"offset":"4186377","integrity":{"algorithm":"SHA256","hash":"a48a5589bd9d05b631960fb4ab43d7617de563cdcd1d530bf0db3504f2b3e310","blockSize":4194304,"blocks":["a48a5589bd9d05b631960fb4ab43d7617de563cdcd1d530bf0db3504f2b3e310"]}},"index.js.map":{"size":332,"offset":"4186504","integrity":{"algorithm":"SHA256","hash":"0a1bcbf13afdd5105f6a21cb590c040da7f4c479b9abd5e8cef3f40801f91d3f","blockSize":4194304,"blocks":["0a1bcbf13afdd5105f6a21cb590c040da7f4c479b9abd5e8cef3f40801f91d3f"]}},"scope-to-main.d.ts":{"size":443,"offset":"4186836","integrity":{"algorithm":"SHA256","hash":"4bd71a283b47deb9ab12fe95040da2966e54d4125a41bc13f75ed75bb5199105","blockSize":4194304,"blocks":["4bd71a283b47deb9ab12fe95040da2966e54d4125a41bc13f75ed75bb5199105"]}},"scope-to-main.d.ts.map":{"size":382,"offset":"4187279","integrity":{"algorithm":"SHA256","hash":"6646c2041d53d71e622b9611a36d6a918d6779c83d0b76cebb684e7338ab6214","blockSize":4194304,"blocks":["6646c2041d53d71e622b9611a36d6a918d6779c83d0b76cebb684e7338ab6214"]}},"scope-to-main.js":{"size":930,"offset":"4187661","integrity":{"algorithm":"SHA256","hash":"cfdc81cdf94a32bce56eb024412b33b1fd2d38d6be652d09bb2e60600384d525","blockSize":4194304,"blocks":["cfdc81cdf94a32bce56eb024412b33b1fd2d38d6be652d09bb2e60600384d525"]}},"scope-to-main.js.map":{"size":1815,"offset":"4188591","integrity":{"algorithm":"SHA256","hash":"d028eb83acc4a8b5623f96454e10209632a010e1dbe084cb7b50fab1ed59990b","blockSize":4194304,"blocks":["d028eb83acc4a8b5623f96454e10209632a010e1dbe084cb7b50fab1ed59990b"]}}}},"ipc.d.ts":{"size":290,"offset":"4190406","integrity":{"algorithm":"SHA256","hash":"097c63a9411ee4382b40dc710ddaa7425e202642ae02014a13a64d0a8bb0be35","blockSize":4194304,"blocks":["097c63a9411ee4382b40dc710ddaa7425e202642ae02014a13a64d0a8bb0be35"]}},"ipc.d.ts.map":{"size":201,"offset":"4190696","integrity":{"algorithm":"SHA256","hash":"5a3369f287fcd14c48f3b51127a156dfe07c3f799c5576573f60bae43e3e6e4f","blockSize":4194304,"blocks":["5a3369f287fcd14c48f3b51127a156dfe07c3f799c5576573f60bae43e3e6e4f"]}},"ipc.js":{"size":2178,"offset":"4190897","integrity":{"algorithm":"SHA256","hash":"2d929ac59a0950130b77e7d45410e97e9784ca4d57b6e86a5a8aed5888da41f5","blockSize":4194304,"blocks":["2d929ac59a0950130b77e7d45410e97e9784ca4d57b6e86a5a8aed5888da41f5"]}},"ipc.js.map":{"size":3560,"offset":"4193075","integrity":{"algorithm":"SHA256","hash":"bdbc68bbeed5b5a808e9fe7f15fe50c273b8999aca48dc2c2f6fa4a85a75e2d8","blockSize":4194304,"blocks":["bdbc68bbeed5b5a808e9fe7f15fe50c273b8999aca48dc2c2f6fa4a85a75e2d8"]}},"sdk.d.ts":{"size":874,"offset":"4196635","integrity":{"algorithm":"SHA256","hash":"50207452fbfd349da34eae5f490bca038f2ff0c0bfc2cbe9754ef556672047eb","blockSize":4194304,"blocks":["50207452fbfd349da34eae5f490bca038f2ff0c0bfc2cbe9754ef556672047eb"]}},"sdk.d.ts.map":{"size":381,"offset":"4197509","integrity":{"algorithm":"SHA256","hash":"bfc29ee2d05e2e8e573fd26d64ab46dc8f84f20dab236077feab0a9e8fed7acf","blockSize":4194304,"blocks":["bfc29ee2d05e2e8e573fd26d64ab46dc8f84f20dab236077feab0a9e8fed7acf"]}},"sdk.js":{"size":2358,"offset":"4197890","integrity":{"algorithm":"SHA256","hash":"f3a9bfc45e03d01bc14406d5a4a4e3dea493b95e4c73408d287a3406f66e8a8c","blockSize":4194304,"blocks":["f3a9bfc45e03d01bc14406d5a4a4e3dea493b95e4c73408d287a3406f66e8a8c"]}},"sdk.js.map":{"size":3869,"offset":"4200248","integrity":{"algorithm":"SHA256","hash":"f41bbb33714ce03cfcc8f2dd7d84704942e9efeb427ffc3430ad64d851706669","blockSize":4194304,"blocks":["f41bbb33714ce03cfcc8f2dd7d84704942e9efeb427ffc3430ad64d851706669"]}},"stack-parse.d.ts":{"size":274,"offset":"4204117","integrity":{"algorithm":"SHA256","hash":"1c1249e7b110a4b2a950385279d8f3f919d5ea274ba5fe8020b2f753da617964","blockSize":4194304,"blocks":["1c1249e7b110a4b2a950385279d8f3f919d5ea274ba5fe8020b2f753da617964"]}},"stack-parse.d.ts.map":{"size":218,"offset":"4204391","integrity":{"algorithm":"SHA256","hash":"3e213c866576ba5c42a066f54661c0e1abd2bb35bc4ce0841bc5d486903cd303","blockSize":4194304,"blocks":["3e213c866576ba5c42a066f54661c0e1abd2bb35bc4ce0841bc5d486903cd303"]}},"stack-parse.js":{"size":1133,"offset":"4204609","integrity":{"algorithm":"SHA256","hash":"20b29ae95b635017f39312693c7d50f49cb3bfb3580aa2f262f2fb7bf90203b0","blockSize":4194304,"blocks":["20b29ae95b635017f39312693c7d50f49cb3bfb3580aa2f262f2fb7bf90203b0"]}},"stack-parse.js.map":{"size":2149,"offset":"4205742","integrity":{"algorithm":"SHA256","hash":"5523eefad86fea5e0db6ba253e8a2db39a63359da1e4d95e8bb50c8f3b316b40","blockSize":4194304,"blocks":["5523eefad86fea5e0db6ba253e8a2db39a63359da1e4d95e8bb50c8f3b316b40"]}},"transport.d.ts":{"size":276,"offset":"4207891","integrity":{"algorithm":"SHA256","hash":"97859b6add87f50a111f3b49a6aa32c3e2deda7b8d44d9dffa7b3933e183ba2c","blockSize":4194304,"blocks":["97859b6add87f50a111f3b49a6aa32c3e2deda7b8d44d9dffa7b3933e183ba2c"]}},"transport.d.ts.map":{"size":245,"offset":"4208167","integrity":{"algorithm":"SHA256","hash":"d814cbb9a6d6be9dd3165f9479cf1655f582e837969f51aabd2ae009bc944157","blockSize":4194304,"blocks":["d814cbb9a6d6be9dd3165f9479cf1655f582e837969f51aabd2ae009bc944157"]}},"transport.js":{"size":617,"offset":"4208412","integrity":{"algorithm":"SHA256","hash":"115da5444f154aa2481e6720fae02df9a13367f2bf451017d7ae866d41efa01a","blockSize":4194304,"blocks":["115da5444f154aa2481e6720fae02df9a13367f2bf451017d7ae866d41efa01a"]}},"transport.js.map":{"size":1210,"offset":"4209029","integrity":{"algorithm":"SHA256","hash":"65b55e302977df8799b8b836aac1466ac9fc6fe819799d33fe369fa76ba717f4","blockSize":4194304,"blocks":["65b55e302977df8799b8b836aac1466ac9fc6fe819799d33fe369fa76ba717f4"]}}}}}},"index.d.ts":{"size":3176,"offset":"4210239","integrity":{"algorithm":"SHA256","hash":"aff8925df18486203e27acb28d88ee0b80cea2f90537f7c57cbf2cadda309db8","blockSize":4194304,"blocks":["aff8925df18486203e27acb28d88ee0b80cea2f90537f7c57cbf2cadda309db8"]}},"index.d.ts.map":{"size":1104,"offset":"4213415","integrity":{"algorithm":"SHA256","hash":"565e6f3cb281ebb7704e29aaeb947911e2f3663f006918202888b748dcd8560c","blockSize":4194304,"blocks":["565e6f3cb281ebb7704e29aaeb947911e2f3663f006918202888b748dcd8560c"]}},"index.js":{"size":7444,"offset":"4214519","integrity":{"algorithm":"SHA256","hash":"bc5a22ea378bfd0d6e8f265a5eee731354b0e929b48a0dccd3df1bf915b5d487","blockSize":4194304,"blocks":["bc5a22ea378bfd0d6e8f265a5eee731354b0e929b48a0dccd3df1bf915b5d487"]}},"index.js.map":{"size":6485,"offset":"4221963","integrity":{"algorithm":"SHA256","hash":"e2a210fa025de9ba95f1ecd12c774ca72a13fe5bed4069b5bcb56e1f1c12be0b","blockSize":4194304,"blocks":["e2a210fa025de9ba95f1ecd12c774ca72a13fe5bed4069b5bcb56e1f1c12be0b"]}},"integrations.d.ts":{"size":1204,"offset":"4228448","integrity":{"algorithm":"SHA256","hash":"d87b7cebbb11516be7cd3a72d212244673289ef1fcf4379333621c61a671dd80","blockSize":4194304,"blocks":["d87b7cebbb11516be7cd3a72d212244673289ef1fcf4379333621c61a671dd80"]}},"integrations.d.ts.map":{"size":865,"offset":"4229652","integrity":{"algorithm":"SHA256","hash":"1c6d1aaa3a5b407ed3de7869bb9afb5278f38c940283eb9ceacc7e464cfed7f9","blockSize":4194304,"blocks":["1c6d1aaa3a5b407ed3de7869bb9afb5278f38c940283eb9ceacc7e464cfed7f9"]}},"integrations.js":{"size":2365,"offset":"4230517","integrity":{"algorithm":"SHA256","hash":"5d2d5db37080289926df11467acc4b90fb01ff11735ff11124146d03e838b72e","blockSize":4194304,"blocks":["5d2d5db37080289926df11467acc4b90fb01ff11735ff11124146d03e838b72e"]}},"integrations.js.map":{"size":4782,"offset":"4232882","integrity":{"algorithm":"SHA256","hash":"aeffea449cc2ad8ae260a8e46ad8f9a2cf72b42485fd6bc693fec90076b4f47f","blockSize":4194304,"blocks":["aeffea449cc2ad8ae260a8e46ad8f9a2cf72b42485fd6bc693fec90076b4f47f"]}},"LICENSE":{"size":1141,"offset":"4237664","integrity":{"algorithm":"SHA256","hash":"c927433efc6a6e62839aced7b4f8731a5088e0e0af03e5f8ae796c13555a0451","blockSize":4194304,"blocks":["c927433efc6a6e62839aced7b4f8731a5088e0e0af03e5f8ae796c13555a0451"]}},"main":{"files":{"context.d.ts":{"size":767,"offset":"4238805","integrity":{"algorithm":"SHA256","hash":"24f20dae0e229a0fb5da2c725dccf4800a3b3f8fcb2a249c5b6ac6ff40e82870","blockSize":4194304,"blocks":["24f20dae0e229a0fb5da2c725dccf4800a3b3f8fcb2a249c5b6ac6ff40e82870"]}},"context.d.ts.map":{"size":456,"offset":"4239572","integrity":{"algorithm":"SHA256","hash":"b27006a598b3d08bab78c778d4c0e4d08b4180495eb41c6c1606cc771bcf5be4","blockSize":4194304,"blocks":["b27006a598b3d08bab78c778d4c0e4d08b4180495eb41c6c1606cc771bcf5be4"]}},"context.js":{"size":12025,"offset":"4240028","integrity":{"algorithm":"SHA256","hash":"6a02f03b48738a1a74970a309f39138d920e772889c34ba889449683113975e9","blockSize":4194304,"blocks":["6a02f03b48738a1a74970a309f39138d920e772889c34ba889449683113975e9"]}},"context.js.map":{"size":18216,"offset":"4252053","integrity":{"algorithm":"SHA256","hash":"1a841fee52de8e222d9ea156aece317817064c72976b3ad788873a0c12dcdda8","blockSize":4194304,"blocks":["1a841fee52de8e222d9ea156aece317817064c72976b3ad788873a0c12dcdda8"]}},"electron-normalize.d.ts":{"size":2246,"offset":"4270269","integrity":{"algorithm":"SHA256","hash":"89608fb7783eb6e90ef9a29991bb24c8fbbc5a099e39f1182a14eb5cbde4bccb","blockSize":4194304,"blocks":["89608fb7783eb6e90ef9a29991bb24c8fbbc5a099e39f1182a14eb5cbde4bccb"]}},"electron-normalize.d.ts.map":{"size":1393,"offset":"4272515","integrity":{"algorithm":"SHA256","hash":"17f4c2f72d03432acac1d84487ffadb8092ac9419c7c8fe3172de36a6bcfa5f2","blockSize":4194304,"blocks":["17f4c2f72d03432acac1d84487ffadb8092ac9419c7c8fe3172de36a6bcfa5f2"]}},"electron-normalize.js":{"size":6559,"offset":"4273908","integrity":{"algorithm":"SHA256","hash":"3fff2d4d749fe7244dee94e991307f062feaf439b2e64f201aac26576dadc90b","blockSize":4194304,"blocks":["3fff2d4d749fe7244dee94e991307f062feaf439b2e64f201aac26576dadc90b"]}},"electron-normalize.js.map":{"size":10872,"offset":"4280467","integrity":{"algorithm":"SHA256","hash":"02a65892bf3d1deeace79e636ae3952b886919b8782876c8d60ea065c4b84e34","blockSize":4194304,"blocks":["02a65892bf3d1deeace79e636ae3952b886919b8782876c8d60ea065c4b84e34"]}},"fs.d.ts":{"size":869,"offset":"4291339","integrity":{"algorithm":"SHA256","hash":"83525e871e376db83c260b17ae556e19beddd6bd2dc5090a5753f512a150e836","blockSize":4194304,"blocks":["83525e871e376db83c260b17ae556e19beddd6bd2dc5090a5753f512a150e836"]}},"fs.d.ts.map":{"size":550,"offset":"4292208","integrity":{"algorithm":"SHA256","hash":"5bcd24e33f40cecbca11d3efe273235c5ef375a1d88ec5192f9a3f3f449244df","blockSize":4194304,"blocks":["5bcd24e33f40cecbca11d3efe273235c5ef375a1d88ec5192f9a3f3f449244df"]}},"fs.js":{"size":1967,"offset":"4292758","integrity":{"algorithm":"SHA256","hash":"3fcd960a662d479e9d748a4d1999df38f93cce5fb27489ffe844c13b497e1de4","blockSize":4194304,"blocks":["3fcd960a662d479e9d748a4d1999df38f93cce5fb27489ffe844c13b497e1de4"]}},"fs.js.map":{"size":2595,"offset":"4294725","integrity":{"algorithm":"SHA256","hash":"e22efe2e8dbfadf87acb2cbbc31b5d92d57963c5291d5007c613e91ce5827be6","blockSize":4194304,"blocks":["e22efe2e8dbfadf87acb2cbbc31b5d92d57963c5291d5007c613e91ce5827be6"]}},"index.d.ts":{"size":3170,"offset":"4297320","integrity":{"algorithm":"SHA256","hash":"7b2427f6e5a175dad26e6ab9cec4af5164a3938c355dc1e0f5f70c79c9707bf5","blockSize":4194304,"blocks":["7b2427f6e5a175dad26e6ab9cec4af5164a3938c355dc1e0f5f70c79c9707bf5"]}},"index.d.ts.map":{"size":985,"offset":"4300490","integrity":{"algorithm":"SHA256","hash":"13b2d0ecfe0f7eeca7e61be04dd857fb5277203257333bf4c7cecfee89ee2c5c","blockSize":4194304,"blocks":["13b2d0ecfe0f7eeca7e61be04dd857fb5277203257333bf4c7cecfee89ee2c5c"]}},"index.js":{"size":5176,"offset":"4301475","integrity":{"algorithm":"SHA256","hash":"3ecfd5f0b74abd201a6449346f3cb158abc699df265855f2a60b6eccc19d6d7a","blockSize":4194304,"blocks":["3ecfd5f0b74abd201a6449346f3cb158abc699df265855f2a60b6eccc19d6d7a"]}},"index.js.map":{"size":2399,"offset":"4306651","integrity":{"algorithm":"SHA256","hash":"ca9d8ee0a37012b18d8c8cfe2c4f577fe26fc558997e636460dd92a11eb1c331","blockSize":4194304,"blocks":["ca9d8ee0a37012b18d8c8cfe2c4f577fe26fc558997e636460dd92a11eb1c331"]}},"integrations":{"files":{"additional-context.d.ts":{"size":830,"offset":"4309050","integrity":{"algorithm":"SHA256","hash":"3e4eb6da3aeffb72d1a7e4ae45a908a65b44198ac197d6a94b23264a74cd475c","blockSize":4194304,"blocks":["3e4eb6da3aeffb72d1a7e4ae45a908a65b44198ac197d6a94b23264a74cd475c"]}},"additional-context.d.ts.map":{"size":723,"offset":"4309880","integrity":{"algorithm":"SHA256","hash":"f22f3a310b62044eb7ec666aa2fff74bde7c688a53c62161933b09e2bd7433ce","blockSize":4194304,"blocks":["f22f3a310b62044eb7ec666aa2fff74bde7c688a53c62161933b09e2bd7433ce"]}},"additional-context.js":{"size":3024,"offset":"4310603","integrity":{"algorithm":"SHA256","hash":"58b856c60611c89828d6d8947ca31a90586c26a81bb8a162e9f00f86235440a6","blockSize":4194304,"blocks":["58b856c60611c89828d6d8947ca31a90586c26a81bb8a162e9f00f86235440a6"]}},"additional-context.js.map":{"size":5362,"offset":"4313627","integrity":{"algorithm":"SHA256","hash":"db16fb2971eb82fee9c7b270281862a8d6697a65d6887616fce51ac144617dbd","blockSize":4194304,"blocks":["db16fb2971eb82fee9c7b270281862a8d6697a65d6887616fce51ac144617dbd"]}},"child-process.d.ts":{"size":819,"offset":"4318989","integrity":{"algorithm":"SHA256","hash":"7dc040efd08b11eb9ca4e961a86019304eb2590ecac10123a4cda7400be96b64","blockSize":4194304,"blocks":["7dc040efd08b11eb9ca4e961a86019304eb2590ecac10123a4cda7400be96b64"]}},"child-process.d.ts.map":{"size":678,"offset":"4319808","integrity":{"algorithm":"SHA256","hash":"76f82b1357f77a9caa2137ee9cd086bfbb76658d4dfbc010a3df0ea29ba6452b","blockSize":4194304,"blocks":["76f82b1357f77a9caa2137ee9cd086bfbb76658d4dfbc010a3df0ea29ba6452b"]}},"child-process.js":{"size":3726,"offset":"4320486","integrity":{"algorithm":"SHA256","hash":"c25b91c6c7fbee395836cc86e379f9fa689ccd8e42e8bcd847e9c86e8bf570ba","blockSize":4194304,"blocks":["c25b91c6c7fbee395836cc86e379f9fa689ccd8e42e8bcd847e9c86e8bf570ba"]}},"child-process.js.map":{"size":6695,"offset":"4324212","integrity":{"algorithm":"SHA256","hash":"9ddca8b20a8d9047fefcc6ec3a9d7d584cc83d1d273b1d8f6ee0773e37500a57","blockSize":4194304,"blocks":["9ddca8b20a8d9047fefcc6ec3a9d7d584cc83d1d273b1d8f6ee0773e37500a57"]}},"electron-breadcrumbs.d.ts":{"size":2049,"offset":"4330907","integrity":{"algorithm":"SHA256","hash":"992b2491eb01668957ed4a6c4f1dadeb9cd56b4aec3773a820f7467367507d8e","blockSize":4194304,"blocks":["992b2491eb01668957ed4a6c4f1dadeb9cd56b4aec3773a820f7467367507d8e"]}},"electron-breadcrumbs.d.ts.map":{"size":1082,"offset":"4332956","integrity":{"algorithm":"SHA256","hash":"e023d1fe42530418455def32b2552ed472bf5bee4b638f1ef4ecfc3fe465cf03","blockSize":4194304,"blocks":["e023d1fe42530418455def32b2552ed472bf5bee4b638f1ef4ecfc3fe465cf03"]}},"electron-breadcrumbs.js":{"size":5244,"offset":"4334038","integrity":{"algorithm":"SHA256","hash":"0be8071f3e4f293e60e33a107be49fedb319f7c56796053ff7b860e067e4bb46","blockSize":4194304,"blocks":["0be8071f3e4f293e60e33a107be49fedb319f7c56796053ff7b860e067e4bb46"]}},"electron-breadcrumbs.js.map":{"size":10041,"offset":"4339282","integrity":{"algorithm":"SHA256","hash":"66c7244a00ce039d0ce8b870f326579cb522d1fb8013238928c4ca1ffb04eb6a","blockSize":4194304,"blocks":["66c7244a00ce039d0ce8b870f326579cb522d1fb8013238928c4ca1ffb04eb6a"]}},"electron-minidump.d.ts":{"size":1325,"offset":"4349323","integrity":{"algorithm":"SHA256","hash":"adc9f723e969bf0b4b4be66931a2a90679f31d85fe063d4c9f56ff042bce6a2b","blockSize":4194304,"blocks":["adc9f723e969bf0b4b4be66931a2a90679f31d85fe063d4c9f56ff042bce6a2b"]}},"electron-minidump.d.ts.map":{"size":662,"offset":"4350648","integrity":{"algorithm":"SHA256","hash":"b81f84cb7813f109459be1f68b7d43b3507e8c34c6510e0b81e4f6b4ccc252cb","blockSize":4194304,"blocks":["b81f84cb7813f109459be1f68b7d43b3507e8c34c6510e0b81e4f6b4ccc252cb"]}},"electron-minidump.js":{"size":8282,"offset":"4351310","integrity":{"algorithm":"SHA256","hash":"eaf6bc8b5c35adbc17d331eb4494fb1eae6a78b5f6cf9d2a3f194d36e39e3bcf","blockSize":4194304,"blocks":["eaf6bc8b5c35adbc17d331eb4494fb1eae6a78b5f6cf9d2a3f194d36e39e3bcf"]}},"electron-minidump.js.map":{"size":13053,"offset":"4359592","integrity":{"algorithm":"SHA256","hash":"e97f331750e1baf877d039c59d5e46031d462239fe8301a22ecceb2aaaba0ad7","blockSize":4194304,"blocks":["e97f331750e1baf877d039c59d5e46031d462239fe8301a22ecceb2aaaba0ad7"]}},"index.d.ts":{"size":621,"offset":"4372645","integrity":{"algorithm":"SHA256","hash":"eb6ed35ad34c0ac9c25435c03b6d8f7134818bd466ea884b8d2cbb9859c72a78","blockSize":4194304,"blocks":["eb6ed35ad34c0ac9c25435c03b6d8f7134818bd466ea884b8d2cbb9859c72a78"]}},"index.d.ts.map":{"size":606,"offset":"4373266","integrity":{"algorithm":"SHA256","hash":"39e536fddec3577a9fd6fe994ff1875afbfec5271575f14d1dfef03647f4997b","blockSize":4194304,"blocks":["39e536fddec3577a9fd6fe994ff1875afbfec5271575f14d1dfef03647f4997b"]}},"index.js":{"size":2500,"offset":"4373872","integrity":{"algorithm":"SHA256","hash":"315131ac67c2f3fda05b89d15e6c35ad38959bd5de78aba7c258c841edcc8bfc","blockSize":4194304,"blocks":["315131ac67c2f3fda05b89d15e6c35ad38959bd5de78aba7c258c841edcc8bfc"]}},"index.js.map":{"size":1138,"offset":"4376372","integrity":{"algorithm":"SHA256","hash":"600c0bd69212e5cea527d89c250aa2fb5a71b19a6e2f8990b7511859ce3f232a","blockSize":4194304,"blocks":["600c0bd69212e5cea527d89c250aa2fb5a71b19a6e2f8990b7511859ce3f232a"]}},"main-context.d.ts":{"size":416,"offset":"4377510","integrity":{"algorithm":"SHA256","hash":"a7eaeb0cc1743d0f9f505bf1b63ee1e67336b71d056801239efde5386f6f2aa0","blockSize":4194304,"blocks":["a7eaeb0cc1743d0f9f505bf1b63ee1e67336b71d056801239efde5386f6f2aa0"]}},"main-context.d.ts.map":{"size":398,"offset":"4377926","integrity":{"algorithm":"SHA256","hash":"3896b31220eddd42a3d18b24124cca9f424c662de5bca6c45263ba32d27c4648","blockSize":4194304,"blocks":["3896b31220eddd42a3d18b24124cca9f424c662de5bca6c45263ba32d27c4648"]}},"main-context.js":{"size":1281,"offset":"4378324","integrity":{"algorithm":"SHA256","hash":"3f08082eb5a47767672ca36f92369fbaf2b6169f661fce4a84b1b76c9e41f2e0","blockSize":4194304,"blocks":["3f08082eb5a47767672ca36f92369fbaf2b6169f661fce4a84b1b76c9e41f2e0"]}},"main-context.js.map":{"size":1821,"offset":"4379605","integrity":{"algorithm":"SHA256","hash":"95306443a43979b11cb3241402f7fd5221d834365ba79bddf743be7488a0a67b","blockSize":4194304,"blocks":["95306443a43979b11cb3241402f7fd5221d834365ba79bddf743be7488a0a67b"]}},"main-process-session.d.ts":{"size":518,"offset":"4381426","integrity":{"algorithm":"SHA256","hash":"e6cbf44a67433c6ce0d29d5827d18286577266ebfce64916a034316ecd85ae9a","blockSize":4194304,"blocks":["e6cbf44a67433c6ce0d29d5827d18286577266ebfce64916a034316ecd85ae9a"]}},"main-process-session.d.ts.map":{"size":434,"offset":"4381944","integrity":{"algorithm":"SHA256","hash":"ed70cfdda10521c53aa94653f28846956cd5c20745bb678c78cb941b6c8528c2","blockSize":4194304,"blocks":["ed70cfdda10521c53aa94653f28846956cd5c20745bb678c78cb941b6c8528c2"]}},"main-process-session.js":{"size":2248,"offset":"4382378","integrity":{"algorithm":"SHA256","hash":"d71759f554b06d208e4d93fd9b1c511288808e6bb2fd69d9344a0c2df332af23","blockSize":4194304,"blocks":["d71759f554b06d208e4d93fd9b1c511288808e6bb2fd69d9344a0c2df332af23"]}},"main-process-session.js.map":{"size":3061,"offset":"4384626","integrity":{"algorithm":"SHA256","hash":"a830f4b61c2f1bbc2550f6f19328dfc94e6924189cf62995925a9507937c96a1","blockSize":4194304,"blocks":["a830f4b61c2f1bbc2550f6f19328dfc94e6924189cf62995925a9507937c96a1"]}},"net-breadcrumbs.d.ts":{"size":1283,"offset":"4387687","integrity":{"algorithm":"SHA256","hash":"a8af1d9342faecf471b3a6a73de57327d10f51c9c5e1233c9911816b86554a56","blockSize":4194304,"blocks":["a8af1d9342faecf471b3a6a73de57327d10f51c9c5e1233c9911816b86554a56"]}},"net-breadcrumbs.d.ts.map":{"size":843,"offset":"4388970","integrity":{"algorithm":"SHA256","hash":"3319ae775e2ea35cba3121e3182aa03f34108bac4f70daae3a8f5b4749cf7972","blockSize":4194304,"blocks":["3319ae775e2ea35cba3121e3182aa03f34108bac4f70daae3a8f5b4749cf7972"]}},"net-breadcrumbs.js":{"size":5449,"offset":"4389813","integrity":{"algorithm":"SHA256","hash":"46cbbc03c58fce667f29cff3fa953c300cbf677c21587feedbf3a908567de240","blockSize":4194304,"blocks":["46cbbc03c58fce667f29cff3fa953c300cbf677c21587feedbf3a908567de240"]}},"net-breadcrumbs.js.map":{"size":10808,"offset":"4395262","integrity":{"algorithm":"SHA256","hash":"91da623edc97148c83721ad10baef87b8921df90f90b43a88b4eac7777d70bfc","blockSize":4194304,"blocks":["91da623edc97148c83721ad10baef87b8921df90f90b43a88b4eac7777d70bfc"]}},"onuncaughtexception.d.ts":{"size":340,"offset":"4406070","integrity":{"algorithm":"SHA256","hash":"71cb08cba72048f4d9b7f5e207b9b1368093d8dc4ddb21746b3c6921a01c9859","blockSize":4194304,"blocks":["71cb08cba72048f4d9b7f5e207b9b1368093d8dc4ddb21746b3c6921a01c9859"]}},"onuncaughtexception.d.ts.map":{"size":357,"offset":"4406410","integrity":{"algorithm":"SHA256","hash":"4852af983f0404f7e5ff73f286689d45a61a430fd3c55efaace79a5a20022017","blockSize":4194304,"blocks":["4852af983f0404f7e5ff73f286689d45a61a430fd3c55efaace79a5a20022017"]}},"onuncaughtexception.js":{"size":2632,"offset":"4406767","integrity":{"algorithm":"SHA256","hash":"060b779389c1006ccf41aecd020ef0b2167214c042fd0c09f6b16dc9f03efc28","blockSize":4194304,"blocks":["060b779389c1006ccf41aecd020ef0b2167214c042fd0c09f6b16dc9f03efc28"]}},"onuncaughtexception.js.map":{"size":3687,"offset":"4409399","integrity":{"algorithm":"SHA256","hash":"4ffd369ce53578518c710d6a90c453d7e8a95d743a8a95837dda74cd1e8a71c4","blockSize":4194304,"blocks":["4ffd369ce53578518c710d6a90c453d7e8a95d743a8a95837dda74cd1e8a71c4"]}},"preload-injection.d.ts":{"size":527,"offset":"4413086","integrity":{"algorithm":"SHA256","hash":"2af91c2c61b48c30aa5f3d7c20b98ccc089fa1dfb51266cf3c42dec94fd23c38","blockSize":4194304,"blocks":["2af91c2c61b48c30aa5f3d7c20b98ccc089fa1dfb51266cf3c42dec94fd23c38"]}},"preload-injection.d.ts.map":{"size":388,"offset":"4413613","integrity":{"algorithm":"SHA256","hash":"183b209ffa6e2c837fafad0c064b2641f939d94dc7cb8725e5baa5ad76b19b6b","blockSize":4194304,"blocks":["183b209ffa6e2c837fafad0c064b2641f939d94dc7cb8725e5baa5ad76b19b6b"]}},"preload-injection.js":{"size":2279,"offset":"4414001","integrity":{"algorithm":"SHA256","hash":"0f54abb6a64474f5704b093552c5efd7e4c834b6a339fe01d846382cc80e4b96","blockSize":4194304,"blocks":["0f54abb6a64474f5704b093552c5efd7e4c834b6a339fe01d846382cc80e4b96"]}},"preload-injection.js.map":{"size":3487,"offset":"4416280","integrity":{"algorithm":"SHA256","hash":"dcc39746d7f11060c63c17620ed125ad42ea30c000c573267aa4c2d812d3b60e","blockSize":4194304,"blocks":["dcc39746d7f11060c63c17620ed125ad42ea30c000c573267aa4c2d812d3b60e"]}},"screenshots.d.ts":{"size":388,"offset":"4419767","integrity":{"algorithm":"SHA256","hash":"deb2e74f6238794036083a77fc3335ebed00d7ec4073413202d02d765f05d9b5","blockSize":4194304,"blocks":["deb2e74f6238794036083a77fc3335ebed00d7ec4073413202d02d765f05d9b5"]}},"screenshots.d.ts.map":{"size":398,"offset":"4420155","integrity":{"algorithm":"SHA256","hash":"774d1c58460623db606e8e5f33b6a4801d2f721b3cc9e13c832324b5b018d7a5","blockSize":4194304,"blocks":["774d1c58460623db606e8e5f33b6a4801d2f721b3cc9e13c832324b5b018d7a5"]}},"screenshots.js":{"size":2247,"offset":"4420553","integrity":{"algorithm":"SHA256","hash":"c13225cc9130fcbca8eea9f04d1b4dff56962915431d32cd61e24e0eec15077c","blockSize":4194304,"blocks":["c13225cc9130fcbca8eea9f04d1b4dff56962915431d32cd61e24e0eec15077c"]}},"screenshots.js.map":{"size":3233,"offset":"4422800","integrity":{"algorithm":"SHA256","hash":"6366dde591b728b8f1ec1c8b0a6823e5ae512649a255d12ed0ef8cf0a73092ea","blockSize":4194304,"blocks":["6366dde591b728b8f1ec1c8b0a6823e5ae512649a255d12ed0ef8cf0a73092ea"]}},"sentry-minidump":{"files":{"index.d.ts":{"size":1102,"offset":"4426033","integrity":{"algorithm":"SHA256","hash":"e3491e550803c94eaf449529def05af923b48537fbf0f004b4d461a3e7f4e0cb","blockSize":4194304,"blocks":["e3491e550803c94eaf449529def05af923b48537fbf0f004b4d461a3e7f4e0cb"]}},"index.d.ts.map":{"size":617,"offset":"4427135","integrity":{"algorithm":"SHA256","hash":"152ded05a4aa5ba726a4f273ab8da5a281b6cbe253c6cf86a2ab2289cac786e2","blockSize":4194304,"blocks":["152ded05a4aa5ba726a4f273ab8da5a281b6cbe253c6cf86a2ab2289cac786e2"]}},"index.js":{"size":10568,"offset":"4427752","integrity":{"algorithm":"SHA256","hash":"67f709434fefb4491dbf304f1916187aa98c34380a8d0db3663622082751db69","blockSize":4194304,"blocks":["67f709434fefb4491dbf304f1916187aa98c34380a8d0db3663622082751db69"]}},"index.js.map":{"size":14658,"offset":"4438320","integrity":{"algorithm":"SHA256","hash":"cb817a516e4c9a34db60560d0944c2bc0a92b3951558769c3f55c494b2fb3985","blockSize":4194304,"blocks":["cb817a516e4c9a34db60560d0944c2bc0a92b3951558769c3f55c494b2fb3985"]}},"minidump-loader.d.ts":{"size":400,"offset":"4452978","integrity":{"algorithm":"SHA256","hash":"1ed872db999c8919d24cdb05417a299f38d5c1bd0b02ab2e2e3143763d8e4bdd","blockSize":4194304,"blocks":["1ed872db999c8919d24cdb05417a299f38d5c1bd0b02ab2e2e3143763d8e4bdd"]}},"minidump-loader.d.ts.map":{"size":454,"offset":"4453378","integrity":{"algorithm":"SHA256","hash":"8bd35a321ebddfca2df182fdaaa850b3504a995e2fb74a2c0343188d177d27cb","blockSize":4194304,"blocks":["8bd35a321ebddfca2df182fdaaa850b3504a995e2fb74a2c0343188d177d27cb"]}},"minidump-loader.js":{"size":7045,"offset":"4453832","integrity":{"algorithm":"SHA256","hash":"012e1b8061af6d161a604228c461f0ae010b39d16b22997939ecb2ced92ee8db","blockSize":4194304,"blocks":["012e1b8061af6d161a604228c461f0ae010b39d16b22997939ecb2ced92ee8db"]}},"minidump-loader.js.map":{"size":11167,"offset":"4460877","integrity":{"algorithm":"SHA256","hash":"f8399d3c88b02d3b38479bdf82d6bdd0b2c422ac121746fa331ed14aaa2d8630","blockSize":4194304,"blocks":["f8399d3c88b02d3b38479bdf82d6bdd0b2c422ac121746fa331ed14aaa2d8630"]}}}}}},"ipc.d.ts":{"size":224,"offset":"4472044","integrity":{"algorithm":"SHA256","hash":"bfc198d44d88604b7f2a736711c8d312dedb0d7c605d42809d232916f90a7264","blockSize":4194304,"blocks":["bfc198d44d88604b7f2a736711c8d312dedb0d7c605d42809d232916f90a7264"]}},"ipc.d.ts.map":{"size":216,"offset":"4472268","integrity":{"algorithm":"SHA256","hash":"91b0e54684554ba487d1dde31c91bc485eff8542b083a282d36532b47ee719f4","blockSize":4194304,"blocks":["91b0e54684554ba487d1dde31c91bc485eff8542b083a282d36532b47ee719f4"]}},"ipc.js":{"size":7132,"offset":"4472484","integrity":{"algorithm":"SHA256","hash":"124df70cfe9ff498a088a9aef8bd435f16341ac6cebf3454f6b702585e8285a6","blockSize":4194304,"blocks":["124df70cfe9ff498a088a9aef8bd435f16341ac6cebf3454f6b702585e8285a6"]}},"ipc.js.map":{"size":12151,"offset":"4479616","integrity":{"algorithm":"SHA256","hash":"342ea495fa66303859e2bce016d747084a889a622ac7b52cfe55315e7fa96c3e","blockSize":4194304,"blocks":["342ea495fa66303859e2bce016d747084a889a622ac7b52cfe55315e7fa96c3e"]}},"renderers.d.ts":{"size":460,"offset":"4491767","integrity":{"algorithm":"SHA256","hash":"26c82cc8d480501665a2db9737c2c116b6beb0e89b420515fcb13d10d7a0f188","blockSize":4194304,"blocks":["26c82cc8d480501665a2db9737c2c116b6beb0e89b420515fcb13d10d7a0f188"]}},"renderers.d.ts.map":{"size":350,"offset":"4492227","integrity":{"algorithm":"SHA256","hash":"31c391ab70f40b1f5916b98bf8f75ae4eea9103a5f267b66b07e4de3e0a3a252","blockSize":4194304,"blocks":["31c391ab70f40b1f5916b98bf8f75ae4eea9103a5f267b66b07e4de3e0a3a252"]}},"renderers.js":{"size":1882,"offset":"4492577","integrity":{"algorithm":"SHA256","hash":"d50bbb5b83ef3dc91ffc81bb6889b220df3e1b9b4a7b3e360fc60922b610c0b8","blockSize":4194304,"blocks":["d50bbb5b83ef3dc91ffc81bb6889b220df3e1b9b4a7b3e360fc60922b610c0b8"]}},"renderers.js.map":{"size":3242,"offset":"4494459","integrity":{"algorithm":"SHA256","hash":"ca03223ef2b5351255e4a5feb6d6a422916e46e537cf2193589e7fde9bfc57ee","blockSize":4194304,"blocks":["ca03223ef2b5351255e4a5feb6d6a422916e46e537cf2193589e7fde9bfc57ee"]}},"sdk.d.ts":{"size":2023,"offset":"4497701","integrity":{"algorithm":"SHA256","hash":"a53f47c0efbce89c4aa1305f615b78d81e3c21eaff6c94db911877b1fcc49234","blockSize":4194304,"blocks":["a53f47c0efbce89c4aa1305f615b78d81e3c21eaff6c94db911877b1fcc49234"]}},"sdk.d.ts.map":{"size":873,"offset":"4499724","integrity":{"algorithm":"SHA256","hash":"08f3e30b8819d824094e09fc9d83de832dd379fe37bd11e6e8c000290b2b9532","blockSize":4194304,"blocks":["08f3e30b8819d824094e09fc9d83de832dd379fe37bd11e6e8c000290b2b9532"]}},"sdk.js":{"size":3638,"offset":"4500597","integrity":{"algorithm":"SHA256","hash":"5ef0225afdb0c924c7471a1a56527c5a5b851d11ac52eef3111084ef70c67746","blockSize":4194304,"blocks":["5ef0225afdb0c924c7471a1a56527c5a5b851d11ac52eef3111084ef70c67746"]}},"sdk.js.map":{"size":7743,"offset":"4504235","integrity":{"algorithm":"SHA256","hash":"db57ef0d38ed2b4abf6296559c4e4a823ee85b859983df667c9b75dff2a10332","blockSize":4194304,"blocks":["db57ef0d38ed2b4abf6296559c4e4a823ee85b859983df667c9b75dff2a10332"]}},"sessions.d.ts":{"size":637,"offset":"4511978","integrity":{"algorithm":"SHA256","hash":"19b645618b052593b65c13a0a4d410d52fb7d079c6515d56ad036327a505ed54","blockSize":4194304,"blocks":["19b645618b052593b65c13a0a4d410d52fb7d079c6515d56ad036327a505ed54"]}},"sessions.d.ts.map":{"size":463,"offset":"4512615","integrity":{"algorithm":"SHA256","hash":"790d2145e956456d06de34a9887a74f68919203a45e8511bb0038b46dd3cc2ae","blockSize":4194304,"blocks":["790d2145e956456d06de34a9887a74f68919203a45e8511bb0038b46dd3cc2ae"]}},"sessions.js":{"size":5635,"offset":"4513078","integrity":{"algorithm":"SHA256","hash":"e3eb81739176a4d95bf1bc13b57b42d861b9da242b359751b7f19198ee9939d5","blockSize":4194304,"blocks":["e3eb81739176a4d95bf1bc13b57b42d861b9da242b359751b7f19198ee9939d5"]}},"sessions.js.map":{"size":7771,"offset":"4518713","integrity":{"algorithm":"SHA256","hash":"178667ebea015597cd9ec6bc937dd418997af96778c28fd3f81119d8a9c7ff71","blockSize":4194304,"blocks":["178667ebea015597cd9ec6bc937dd418997af96778c28fd3f81119d8a9c7ff71"]}},"store.d.ts":{"size":2321,"offset":"4526484","integrity":{"algorithm":"SHA256","hash":"37269d0cd6ba8fe2b8f42c617d7e0e3ad7df4d230873392b602b2eadd3154feb","blockSize":4194304,"blocks":["37269d0cd6ba8fe2b8f42c617d7e0e3ad7df4d230873392b602b2eadd3154feb"]}},"store.d.ts.map":{"size":1113,"offset":"4528805","integrity":{"algorithm":"SHA256","hash":"46db2b70f95dbac0c2f78930292ffc1f27437f48b9f11d7cd74c4cfbc1d764f5","blockSize":4194304,"blocks":["46db2b70f95dbac0c2f78930292ffc1f27437f48b9f11d7cd74c4cfbc1d764f5"]}},"store.js":{"size":5832,"offset":"4529918","integrity":{"algorithm":"SHA256","hash":"28e7f4971cadb38198ead9a8953fcbabe97d032496089edeb318d27c647174ca","blockSize":4194304,"blocks":["28e7f4971cadb38198ead9a8953fcbabe97d032496089edeb318d27c647174ca"]}},"store.js.map":{"size":7884,"offset":"4535750","integrity":{"algorithm":"SHA256","hash":"77fa2b3ef38a1c1c3e61927857382385f7913226a8069f18ea573f9e13801121","blockSize":4194304,"blocks":["77fa2b3ef38a1c1c3e61927857382385f7913226a8069f18ea573f9e13801121"]}},"transports":{"files":{"electron-net.d.ts":{"size":672,"offset":"4543634","integrity":{"algorithm":"SHA256","hash":"d5bdb1ce5827a88ec8dd148f87ff3ba6b29232422f821143df532336051d762a","blockSize":4194304,"blocks":["d5bdb1ce5827a88ec8dd148f87ff3ba6b29232422f821143df532336051d762a"]}},"electron-net.d.ts.map":{"size":497,"offset":"4544306","integrity":{"algorithm":"SHA256","hash":"32f0046ed02561d33229eac788c2f2a7f32821561c242e6993599026cd3e2572","blockSize":4194304,"blocks":["32f0046ed02561d33229eac788c2f2a7f32821561c242e6993599026cd3e2572"]}},"electron-net.js":{"size":3619,"offset":"4544803","integrity":{"algorithm":"SHA256","hash":"0e846426d2f79d10e6338c6a31d8b8d57433bc95ad788762232cd1bfe69f91aa","blockSize":4194304,"blocks":["0e846426d2f79d10e6338c6a31d8b8d57433bc95ad788762232cd1bfe69f91aa"]}},"electron-net.js.map":{"size":6232,"offset":"4548422","integrity":{"algorithm":"SHA256","hash":"78e48ee63a9068a86054f6b700891f32562e48cdb67d7a92c1f5c0955645dcc7","blockSize":4194304,"blocks":["78e48ee63a9068a86054f6b700891f32562e48cdb67d7a92c1f5c0955645dcc7"]}},"electron-offline-net.d.ts":{"size":1284,"offset":"4554654","integrity":{"algorithm":"SHA256","hash":"f931335bb1da68184b376c7eb6e6a20b8e47ed40967012fb76b10c2c93d6497d","blockSize":4194304,"blocks":["f931335bb1da68184b376c7eb6e6a20b8e47ed40967012fb76b10c2c93d6497d"]}},"electron-offline-net.d.ts.map":{"size":671,"offset":"4555938","integrity":{"algorithm":"SHA256","hash":"09e1c1758f7f92a2563d4e6769c04c08ce7be824f797fae4b3cca1a35f27335a","blockSize":4194304,"blocks":["09e1c1758f7f92a2563d4e6769c04c08ce7be824f797fae4b3cca1a35f27335a"]}},"electron-offline-net.js":{"size":4302,"offset":"4556609","integrity":{"algorithm":"SHA256","hash":"14b9b433f03ab6a90eecd44ee6fdf1f8d2de2db0ec5abe3630805f6fbecf6061","blockSize":4194304,"blocks":["14b9b433f03ab6a90eecd44ee6fdf1f8d2de2db0ec5abe3630805f6fbecf6061"]}},"electron-offline-net.js.map":{"size":7571,"offset":"4560911","integrity":{"algorithm":"SHA256","hash":"15f1c3a945ac5c570ae9f802ac6e373688ed445921c9733ccc1503a8a3b89f3c","blockSize":4194304,"blocks":["15f1c3a945ac5c570ae9f802ac6e373688ed445921c9733ccc1503a8a3b89f3c"]}},"queue.d.ts":{"size":853,"offset":"4568482","integrity":{"algorithm":"SHA256","hash":"c7cca7f47128cb5dde25947c254357665e2e1b6e241a7531b12de25ec67e936a","blockSize":4194304,"blocks":["c7cca7f47128cb5dde25947c254357665e2e1b6e241a7531b12de25ec67e936a"]}},"queue.d.ts.map":{"size":698,"offset":"4569335","integrity":{"algorithm":"SHA256","hash":"374fa6839f2d064358b39780e908c33e8b326a334ecea9838c22ac3659388b34","blockSize":4194304,"blocks":["374fa6839f2d064358b39780e908c33e8b326a334ecea9838c22ac3659388b34"]}},"queue.js":{"size":3698,"offset":"4570033","integrity":{"algorithm":"SHA256","hash":"7ed6e9db6b6cd8ef4a5a168ab855f7c264b7595187619f2de55bcbc488124dc3","blockSize":4194304,"blocks":["7ed6e9db6b6cd8ef4a5a168ab855f7c264b7595187619f2de55bcbc488124dc3"]}},"queue.js.map":{"size":5664,"offset":"4573731","integrity":{"algorithm":"SHA256","hash":"5168a4a664b448610e33ec7cb5a88f0619a754178b509e15b2558430445ff11d","blockSize":4194304,"blocks":["5168a4a664b448610e33ec7cb5a88f0619a754178b509e15b2558430445ff11d"]}}}},"version.d.ts":{"size":81,"offset":"4579395","integrity":{"algorithm":"SHA256","hash":"fbbb67f1b06db11a8c451c19329670202c59e460fdd5f5218018df23cadddeb1","blockSize":4194304,"blocks":["fbbb67f1b06db11a8c451c19329670202c59e460fdd5f5218018df23cadddeb1"]}},"version.d.ts.map":{"size":142,"offset":"4579476","integrity":{"algorithm":"SHA256","hash":"b10790eac718b5f30f49f85b7d644992de38dcc85fec68044c5c22b195f7b55c","blockSize":4194304,"blocks":["b10790eac718b5f30f49f85b7d644992de38dcc85fec68044c5c22b195f7b55c"]}},"version.js":{"size":159,"offset":"4579618","integrity":{"algorithm":"SHA256","hash":"464349241bda5eba2f6f312242e7dae547decc926b38116be86e69ce73b46d19","blockSize":4194304,"blocks":["464349241bda5eba2f6f312242e7dae547decc926b38116be86e69ce73b46d19"]}},"version.js.map":{"size":201,"offset":"4579777","integrity":{"algorithm":"SHA256","hash":"b1e9fe8f677cb63b35904d82e26ed423ee3c697cda386bee48c2985f99280f16","blockSize":4194304,"blocks":["b1e9fe8f677cb63b35904d82e26ed423ee3c697cda386bee48c2985f99280f16"]}}}},"node_modules":{"files":{"tslib":{"files":{"CopyrightNotice.txt":{"size":822,"offset":"4579978","integrity":{"algorithm":"SHA256","hash":"da16ddb65f8ca390998fb99223d0112498b56b45784d00afd77ff8ce1ac4de8b","blockSize":4194304,"blocks":["da16ddb65f8ca390998fb99223d0112498b56b45784d00afd77ff8ce1ac4de8b"]}},"LICENSE.txt":{"size":655,"offset":"4580800","integrity":{"algorithm":"SHA256","hash":"210b19e543130388c68654b7497e967119ce17145f66ab7d85688fbd70f08751","blockSize":4194304,"blocks":["210b19e543130388c68654b7497e967119ce17145f66ab7d85688fbd70f08751"]}},"modules":{"files":{"index.d.ts":{"size":801,"offset":"4581455","integrity":{"algorithm":"SHA256","hash":"b8f34dd1757f68e03262b1ca3ddfa668a855b872f8bdd5224d6f993a7b37dc2c","blockSize":4194304,"blocks":["b8f34dd1757f68e03262b1ca3ddfa668a855b872f8bdd5224d6f993a7b37dc2c"]}},"index.js":{"size":1416,"offset":"4582256","integrity":{"algorithm":"SHA256","hash":"b3a4765da2bc019c79f2c2c12b36f860e946119d976897f1ce945caf227d0468","blockSize":4194304,"blocks":["b3a4765da2bc019c79f2c2c12b36f860e946119d976897f1ce945caf227d0468"]}},"package.json":{"size":26,"offset":"4583672","integrity":{"algorithm":"SHA256","hash":"f2a77d1fa2e7ee710b2835b2933d75d9c7f5dad4f1bab69e1679876e32b5e9eb","blockSize":4194304,"blocks":["f2a77d1fa2e7ee710b2835b2933d75d9c7f5dad4f1bab69e1679876e32b5e9eb"]}}}},"package.json":{"size":1219,"offset":"4583698","integrity":{"algorithm":"SHA256","hash":"f02b4851df316f29bdfcd404aa1eb41e4e216b5859015f81fcd3e91caf8be931","blockSize":4194304,"blocks":["f02b4851df316f29bdfcd404aa1eb41e4e216b5859015f81fcd3e91caf8be931"]}},"README.md":{"size":4033,"offset":"4584917","integrity":{"algorithm":"SHA256","hash":"d2e199aa7eafd807ba6c3c31edaf06cc06712f30ef965687e22d315b9e8f0543","blockSize":4194304,"blocks":["d2e199aa7eafd807ba6c3c31edaf06cc06712f30ef965687e22d315b9e8f0543"]}},"SECURITY.md":{"size":2757,"offset":"4588950","integrity":{"algorithm":"SHA256","hash":"89c4e4b9ba7ec705482e2de05135d0626d33bf8c2c66119c65d7a306dd83459c","blockSize":4194304,"blocks":["89c4e4b9ba7ec705482e2de05135d0626d33bf8c2c66119c65d7a306dd83459c"]}},"tslib.d.ts":{"size":18317,"offset":"4591707","integrity":{"algorithm":"SHA256","hash":"a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec","blockSize":4194304,"blocks":["a6a5253138c5432c68a1510c70fe78a644fe2e632111ba778e1978010d6edfec"]}},"tslib.es6.html":{"size":36,"offset":"4610024","integrity":{"algorithm":"SHA256","hash":"759c26504a9ccbbfcd730269c9c5ef15512cf16ba617e61a92212365e57c9f5d","blockSize":4194304,"blocks":["759c26504a9ccbbfcd730269c9c5ef15512cf16ba617e61a92212365e57c9f5d"]}},"tslib.es6.js":{"size":19215,"offset":"4610060","integrity":{"algorithm":"SHA256","hash":"480042d65f5abdacdcf9d9ade38f9d484455be82aa34bd472bf6ab87ea0e3620","blockSize":4194304,"blocks":["480042d65f5abdacdcf9d9ade38f9d484455be82aa34bd472bf6ab87ea0e3620"]}},"tslib.es6.mjs":{"size":17648,"offset":"4629275","integrity":{"algorithm":"SHA256","hash":"0929993220938091ede542d688b0fdb87dad99a7e77678e1983c32d18a503339","blockSize":4194304,"blocks":["0929993220938091ede542d688b0fdb87dad99a7e77678e1983c32d18a503339"]}},"tslib.html":{"size":32,"offset":"4646923","integrity":{"algorithm":"SHA256","hash":"e14179f388a9690437165289d45ff7747f0f839538b5abec63d2dcfe21c2a5f4","blockSize":4194304,"blocks":["e14179f388a9690437165289d45ff7747f0f839538b5abec63d2dcfe21c2a5f4"]}},"tslib.js":{"size":23382,"offset":"4646955","integrity":{"algorithm":"SHA256","hash":"8855865a058bc0a6df8f5db45347be041a2d6bbe1654216c51a805648c1b6e8a","blockSize":4194304,"blocks":["8855865a058bc0a6df8f5db45347be041a2d6bbe1654216c51a805648c1b6e8a"]}}}}}},"package.json":{"size":3835,"offset":"4670337","integrity":{"algorithm":"SHA256","hash":"1c94fd1d56e45fe52fff30ed6571cce8c4d007cfe28eb5077348e033a9c2bf43","blockSize":4194304,"blocks":["1c94fd1d56e45fe52fff30ed6571cce8c4d007cfe28eb5077348e033a9c2bf43"]}},"preload":{"files":{"index.js":{"size":1127,"offset":"4674172","integrity":{"algorithm":"SHA256","hash":"c278d4745157357b562055f1b16e00b8c356e9cf888d87a08b4a03530217794a","blockSize":4194304,"blocks":["c278d4745157357b562055f1b16e00b8c356e9cf888d87a08b4a03530217794a"]}},"legacy.js":{"size":1407,"offset":"4675299","integrity":{"algorithm":"SHA256","hash":"a3088ac0a7df64690304789af38bdf721cbdfb666fa373fbb749bdf4ccbac9d5","blockSize":4194304,"blocks":["a3088ac0a7df64690304789af38bdf721cbdfb666fa373fbb749bdf4ccbac9d5"]}}}},"README.md":{"size":3297,"offset":"4676706","integrity":{"algorithm":"SHA256","hash":"15333c494f975d8f41b1ac591fd13c3b5fe5d2c9750c23837ef0a968546a43fc","blockSize":4194304,"blocks":["15333c494f975d8f41b1ac591fd13c3b5fe5d2c9750c23837ef0a968546a43fc"]}},"renderer":{"files":{"index.d.ts":{"size":1530,"offset":"4680003","integrity":{"algorithm":"SHA256","hash":"3e99267005e7d25ba87424de5af34e3098ef7b79ef1de42b8c648a9e3e4bc546","blockSize":4194304,"blocks":["3e99267005e7d25ba87424de5af34e3098ef7b79ef1de42b8c648a9e3e4bc546"]}},"index.d.ts.map":{"size":823,"offset":"4681533","integrity":{"algorithm":"SHA256","hash":"f977a1bb2e0d39b592e00e1050b096b7f8fe55de2513646c3a5073d488bb3f55","blockSize":4194304,"blocks":["f977a1bb2e0d39b592e00e1050b096b7f8fe55de2513646c3a5073d488bb3f55"]}},"index.js":{"size":4646,"offset":"4682356","integrity":{"algorithm":"SHA256","hash":"eea2fe68867a5aadf46e3ebcb8f54c09504da18fdd966dbac0b46071081cdbd7","blockSize":4194304,"blocks":["eea2fe68867a5aadf46e3ebcb8f54c09504da18fdd966dbac0b46071081cdbd7"]}},"index.js.map":{"size":2033,"offset":"4687002","integrity":{"algorithm":"SHA256","hash":"6d2f0121c8e80ef8a93f53eaed9028a0202b978805dd4f81b1b25fe629f7ccb7","blockSize":4194304,"blocks":["6d2f0121c8e80ef8a93f53eaed9028a0202b978805dd4f81b1b25fe629f7ccb7"]}},"integrations":{"files":{"event-to-main.d.ts":{"size":402,"offset":"4689035","integrity":{"algorithm":"SHA256","hash":"78b0269e913210cf98f3235bf28770d309ca1bc4ca26158eb2c8a60489014736","blockSize":4194304,"blocks":["78b0269e913210cf98f3235bf28770d309ca1bc4ca26158eb2c8a60489014736"]}},"event-to-main.d.ts.map":{"size":402,"offset":"4689437","integrity":{"algorithm":"SHA256","hash":"80db23df4c7d08165fd5c893449c29b6ecf7d7a2fe532593d2c5b0b1edff708a","blockSize":4194304,"blocks":["80db23df4c7d08165fd5c893449c29b6ecf7d7a2fe532593d2c5b0b1edff708a"]}},"event-to-main.js":{"size":1153,"offset":"4689839","integrity":{"algorithm":"SHA256","hash":"0eb7bf1a38e7ee98ef6af013a50136a70c7bfe1bd754773e8df8b95ae0359fd4","blockSize":4194304,"blocks":["0eb7bf1a38e7ee98ef6af013a50136a70c7bfe1bd754773e8df8b95ae0359fd4"]}},"event-to-main.js.map":{"size":1814,"offset":"4690992","integrity":{"algorithm":"SHA256","hash":"96e123055139c30c1270827bdfc705ddc38b08b62bdc78a577be7eed927c0981","blockSize":4194304,"blocks":["96e123055139c30c1270827bdfc705ddc38b08b62bdc78a577be7eed927c0981"]}},"index.d.ts":{"size":129,"offset":"4692806","integrity":{"algorithm":"SHA256","hash":"a1af9ee0cbfc914131ad06e966dfdbe1ee18f8bbe7efe2a25b988b96967ba37c","blockSize":4194304,"blocks":["a1af9ee0cbfc914131ad06e966dfdbe1ee18f8bbe7efe2a25b988b96967ba37c"]}},"index.d.ts.map":{"size":213,"offset":"4692935","integrity":{"algorithm":"SHA256","hash":"358d32e177c3da66d35eb53e27b85937c16cbea32464f717c42c0c7e6cec089a","blockSize":4194304,"blocks":["358d32e177c3da66d35eb53e27b85937c16cbea32464f717c42c0c7e6cec089a"]}},"index.js":{"size":502,"offset":"4693148","integrity":{"algorithm":"SHA256","hash":"e287a2465167b8bc7b01b7b33d72f12953b65eed77b01f88db4780839ce7610f","blockSize":4194304,"blocks":["e287a2465167b8bc7b01b7b33d72f12953b65eed77b01f88db4780839ce7610f"]}},"index.js.map":{"size":315,"offset":"4693650","integrity":{"algorithm":"SHA256","hash":"3139062f567301f8fe5b3e82ddc4914828f2965372a5d9e9f07e3c7533e68846","blockSize":4194304,"blocks":["3139062f567301f8fe5b3e82ddc4914828f2965372a5d9e9f07e3c7533e68846"]}},"scope-to-main.d.ts":{"size":443,"offset":"4693965","integrity":{"algorithm":"SHA256","hash":"4bd71a283b47deb9ab12fe95040da2966e54d4125a41bc13f75ed75bb5199105","blockSize":4194304,"blocks":["4bd71a283b47deb9ab12fe95040da2966e54d4125a41bc13f75ed75bb5199105"]}},"scope-to-main.d.ts.map":{"size":379,"offset":"4694408","integrity":{"algorithm":"SHA256","hash":"e0ab1d2da2cf1cce551b941cad0f685cae8d9e070162aafc4495a6dac01d68e8","blockSize":4194304,"blocks":["e0ab1d2da2cf1cce551b941cad0f685cae8d9e070162aafc4495a6dac01d68e8"]}},"scope-to-main.js":{"size":1080,"offset":"4694787","integrity":{"algorithm":"SHA256","hash":"7d7ee58eede0b4023f2f905885d07af7bf18ed4c631f74cb27b723981ffe64ac","blockSize":4194304,"blocks":["7d7ee58eede0b4023f2f905885d07af7bf18ed4c631f74cb27b723981ffe64ac"]}},"scope-to-main.js.map":{"size":1755,"offset":"4695867","integrity":{"algorithm":"SHA256","hash":"8aa863b1f58789f0aac07661db7a7577d0088563a033a716a817d51af9b1482e","blockSize":4194304,"blocks":["8aa863b1f58789f0aac07661db7a7577d0088563a033a716a817d51af9b1482e"]}}}},"ipc.d.ts":{"size":290,"offset":"4697622","integrity":{"algorithm":"SHA256","hash":"097c63a9411ee4382b40dc710ddaa7425e202642ae02014a13a64d0a8bb0be35","blockSize":4194304,"blocks":["097c63a9411ee4382b40dc710ddaa7425e202642ae02014a13a64d0a8bb0be35"]}},"ipc.d.ts.map":{"size":198,"offset":"4697912","integrity":{"algorithm":"SHA256","hash":"06aef57d6f8e46148d841d1c2b694717f6dc7d53fbc21647f2370e5fccba6392","blockSize":4194304,"blocks":["06aef57d6f8e46148d841d1c2b694717f6dc7d53fbc21647f2370e5fccba6392"]}},"ipc.js":{"size":2348,"offset":"4698110","integrity":{"algorithm":"SHA256","hash":"8b57cbf5f6b6229d3ef7100c9cdbf2b6296dd2d9ed25af3dba55f9e1355aa968","blockSize":4194304,"blocks":["8b57cbf5f6b6229d3ef7100c9cdbf2b6296dd2d9ed25af3dba55f9e1355aa968"]}},"ipc.js.map":{"size":3507,"offset":"4700458","integrity":{"algorithm":"SHA256","hash":"38c04001e3a708cada6bbde06ca9920986f1b90766842eef19cfb7edfdb6a265","blockSize":4194304,"blocks":["38c04001e3a708cada6bbde06ca9920986f1b90766842eef19cfb7edfdb6a265"]}},"sdk.d.ts":{"size":874,"offset":"4703965","integrity":{"algorithm":"SHA256","hash":"50207452fbfd349da34eae5f490bca038f2ff0c0bfc2cbe9754ef556672047eb","blockSize":4194304,"blocks":["50207452fbfd349da34eae5f490bca038f2ff0c0bfc2cbe9754ef556672047eb"]}},"sdk.d.ts.map":{"size":378,"offset":"4704839","integrity":{"algorithm":"SHA256","hash":"d221aac1677b502c2fb88c9c66cce433b6f49ea3b461b5416d0644174cdf46e0","blockSize":4194304,"blocks":["d221aac1677b502c2fb88c9c66cce433b6f49ea3b461b5416d0644174cdf46e0"]}},"sdk.js":{"size":2479,"offset":"4705217","integrity":{"algorithm":"SHA256","hash":"0f2a7f632cc1e21179f1b5253947774b7732facc8bde13a0936067b8d4a9b7be","blockSize":4194304,"blocks":["0f2a7f632cc1e21179f1b5253947774b7732facc8bde13a0936067b8d4a9b7be"]}},"sdk.js.map":{"size":3662,"offset":"4707696","integrity":{"algorithm":"SHA256","hash":"64ffbb15205cfb529838a9a9656f44427418c02ec56f86a465a91457f936c1f3","blockSize":4194304,"blocks":["64ffbb15205cfb529838a9a9656f44427418c02ec56f86a465a91457f936c1f3"]}},"stack-parse.d.ts":{"size":274,"offset":"4711358","integrity":{"algorithm":"SHA256","hash":"1c1249e7b110a4b2a950385279d8f3f919d5ea274ba5fe8020b2f753da617964","blockSize":4194304,"blocks":["1c1249e7b110a4b2a950385279d8f3f919d5ea274ba5fe8020b2f753da617964"]}},"stack-parse.d.ts.map":{"size":215,"offset":"4711632","integrity":{"algorithm":"SHA256","hash":"f74328aab19f6e15af4f212c52f9b1634cd925b184a5719e85e19110fe259abe","blockSize":4194304,"blocks":["f74328aab19f6e15af4f212c52f9b1634cd925b184a5719e85e19110fe259abe"]}},"stack-parse.js":{"size":1281,"offset":"4711847","integrity":{"algorithm":"SHA256","hash":"0a12809a4fb05f74bb2a02e0988e39b2858838ece447f1b2af1b80155f8e3256","blockSize":4194304,"blocks":["0a12809a4fb05f74bb2a02e0988e39b2858838ece447f1b2af1b80155f8e3256"]}},"stack-parse.js.map":{"size":2093,"offset":"4713128","integrity":{"algorithm":"SHA256","hash":"b88326e345ce4b547f523eb2f825e16f567e80eea7b31d4a4234fce034dcd62e","blockSize":4194304,"blocks":["b88326e345ce4b547f523eb2f825e16f567e80eea7b31d4a4234fce034dcd62e"]}},"transport.d.ts":{"size":276,"offset":"4715221","integrity":{"algorithm":"SHA256","hash":"97859b6add87f50a111f3b49a6aa32c3e2deda7b8d44d9dffa7b3933e183ba2c","blockSize":4194304,"blocks":["97859b6add87f50a111f3b49a6aa32c3e2deda7b8d44d9dffa7b3933e183ba2c"]}},"transport.d.ts.map":{"size":242,"offset":"4715497","integrity":{"algorithm":"SHA256","hash":"a2a72c14bcc22b2e7719b050eeb5e955a86bbd526632c54b4ee3278f4edfef86","blockSize":4194304,"blocks":["a2a72c14bcc22b2e7719b050eeb5e955a86bbd526632c54b4ee3278f4edfef86"]}},"transport.js":{"size":790,"offset":"4715739","integrity":{"algorithm":"SHA256","hash":"d207727edf39d4b6fc72f2db958eae6699a49fbe4ac4b372af53f4e43fb7c3c7","blockSize":4194304,"blocks":["d207727edf39d4b6fc72f2db958eae6699a49fbe4ac4b372af53f4e43fb7c3c7"]}},"transport.js.map":{"size":1171,"offset":"4716529","integrity":{"algorithm":"SHA256","hash":"6e24c63436118e01c545d9b1fe55afd6d7ec29fcdadfe930968ff88e88714a71","blockSize":4194304,"blocks":["6e24c63436118e01c545d9b1fe55afd6d7ec29fcdadfe930968ff88e88714a71"]}}}}}},"node":{"files":{"cjs":{"files":{"async":{"files":{"domain.js":{"size":1705,"offset":"4717700","integrity":{"algorithm":"SHA256","hash":"c6a4a28aac858a43fae1f914e382bed9de01408a79b5917e1470121d519f0bbc","blockSize":4194304,"blocks":["c6a4a28aac858a43fae1f914e382bed9de01408a79b5917e1470121d519f0bbc"]}},"domain.js.map":{"size":7238,"offset":"4719405","integrity":{"algorithm":"SHA256","hash":"0b4e821f75a69842e97ca9f723394c3ec9bdda79b6ca9c1bdf0b7f32761073a4","blockSize":4194304,"blocks":["0b4e821f75a69842e97ca9f723394c3ec9bdda79b6ca9c1bdf0b7f32761073a4"]}},"hooks.js":{"size":1318,"offset":"4726643","integrity":{"algorithm":"SHA256","hash":"2c6ef73dc7996ab216d7cf4b5f7a3a91c9f0bcc7e4e41d17e5a8ada6af884c83","blockSize":4194304,"blocks":["2c6ef73dc7996ab216d7cf4b5f7a3a91c9f0bcc7e4e41d17e5a8ada6af884c83"]}},"hooks.js.map":{"size":5498,"offset":"4727961","integrity":{"algorithm":"SHA256","hash":"319e88bc57c90d220c1a12cbb6647908abeba37b91092ac8d75b3cdb77841270","blockSize":4194304,"blocks":["319e88bc57c90d220c1a12cbb6647908abeba37b91092ac8d75b3cdb77841270"]}},"index.js":{"size":652,"offset":"4733459","integrity":{"algorithm":"SHA256","hash":"4811d13451d5438a4948071016f20f59f0ac62441c3d3a2783801e4a6d6c0864","blockSize":4194304,"blocks":["4811d13451d5438a4948071016f20f59f0ac62441c3d3a2783801e4a6d6c0864"]}},"index.js.map":{"size":924,"offset":"4734111","integrity":{"algorithm":"SHA256","hash":"12854fa488181b6becba8ca55747c16479f5dc98aa09adedde92c8e6a1121ce2","blockSize":4194304,"blocks":["12854fa488181b6becba8ca55747c16479f5dc98aa09adedde92c8e6a1121ce2"]}}}},"client.js":{"size":5887,"offset":"4735035","integrity":{"algorithm":"SHA256","hash":"6fb21f0b464e75630190ff05527b2451b07e25e6d2494262b53580370ed71053","blockSize":4194304,"blocks":["6fb21f0b464e75630190ff05527b2451b07e25e6d2494262b53580370ed71053"]}},"client.js.map":{"size":26387,"offset":"4740922","integrity":{"algorithm":"SHA256","hash":"0bfd1e95f6dead3dced579bc2c8d61bf2661ab75020f2043998c5570eaa558fc","blockSize":4194304,"blocks":["0bfd1e95f6dead3dced579bc2c8d61bf2661ab75020f2043998c5570eaa558fc"]}},"eventbuilder.js":{"size":3247,"offset":"4767309","integrity":{"algorithm":"SHA256","hash":"382912637178383cf57c7ab2cc7d41b00427e3b1d19922774d13b40c921ec49a","blockSize":4194304,"blocks":["382912637178383cf57c7ab2cc7d41b00427e3b1d19922774d13b40c921ec49a"]}},"eventbuilder.js.map":{"size":6617,"offset":"4770556","integrity":{"algorithm":"SHA256","hash":"5f8b2ad0acf232e0b9af4ddc239b9e34677f929c3d21d857c39c2ddd61ed67ae","blockSize":4194304,"blocks":["5f8b2ad0acf232e0b9af4ddc239b9e34677f929c3d21d857c39c2ddd61ed67ae"]}},"handlers.js":{"size":11931,"offset":"4777173","integrity":{"algorithm":"SHA256","hash":"f9f60ac7e683685f709d8fdeb1b8a184730928fe78a706ef1487b31651e2e4af","blockSize":4194304,"blocks":["f9f60ac7e683685f709d8fdeb1b8a184730928fe78a706ef1487b31651e2e4af"]}},"handlers.js.map":{"size":53451,"offset":"4789104","integrity":{"algorithm":"SHA256","hash":"434e59715326c9ecc0407e01ee41984a8bf1dc88def693336f5eb05d06215877","blockSize":4194304,"blocks":["434e59715326c9ecc0407e01ee41984a8bf1dc88def693336f5eb05d06215877"]}},"index.js":{"size":2534,"offset":"4842555","integrity":{"algorithm":"SHA256","hash":"f0cadbc3c13e4fefb4baa75294568226c0e882da52348cdc8bc472a78307ef89","blockSize":4194304,"blocks":["f0cadbc3c13e4fefb4baa75294568226c0e882da52348cdc8bc472a78307ef89"]}},"index.js.map":{"size":2190,"offset":"4845089","integrity":{"algorithm":"SHA256","hash":"cb390708a85056059b49660762b01d3689d5f89ee33f21619d4f2b08f67b9eaa","blockSize":4194304,"blocks":["cb390708a85056059b49660762b01d3689d5f89ee33f21619d4f2b08f67b9eaa"]}},"integrations":{"files":{"console.js":{"size":1462,"offset":"4847279","integrity":{"algorithm":"SHA256","hash":"8d71f07cf254736993237cf6be54a29fb4077eba94a68716c50e6cfc9a33d5a0","blockSize":4194304,"blocks":["8d71f07cf254736993237cf6be54a29fb4077eba94a68716c50e6cfc9a33d5a0"]}},"console.js.map":{"size":2823,"offset":"4848741","integrity":{"algorithm":"SHA256","hash":"ea2c48902d71990f554b4da210e6163d197db3ee4b186220db7e1931a0e8306c","blockSize":4194304,"blocks":["ea2c48902d71990f554b4da210e6163d197db3ee4b186220db7e1931a0e8306c"]}},"context.js":{"size":11763,"offset":"4851564","integrity":{"algorithm":"SHA256","hash":"1a13835bd9b42d87d356dd23a9557920fa0a32555d6eeb18d358485c1e32cf1c","blockSize":4194304,"blocks":["1a13835bd9b42d87d356dd23a9557920fa0a32555d6eeb18d358485c1e32cf1c"]}},"context.js.map":{"size":53611,"offset":"4863327","integrity":{"algorithm":"SHA256","hash":"60b7d7b7f811211aa7915419bcce92aac5885176100f62c593570946ca028826","blockSize":4194304,"blocks":["60b7d7b7f811211aa7915419bcce92aac5885176100f62c593570946ca028826"]}},"contextlines.js":{"size":5626,"offset":"4916938","integrity":{"algorithm":"SHA256","hash":"7488d216722fdf52be12fada264535c07b64a3d65bbac4de257679d07202cae1","blockSize":4194304,"blocks":["7488d216722fdf52be12fada264535c07b64a3d65bbac4de257679d07202cae1"]}},"contextlines.js.map":{"size":24868,"offset":"4922564","integrity":{"algorithm":"SHA256","hash":"cd2d31f597c5e283bf05fb7cc728edca91d70bb1b6198cf559c3f177160aebb3","blockSize":4194304,"blocks":["cd2d31f597c5e283bf05fb7cc728edca91d70bb1b6198cf559c3f177160aebb3"]}},"http.js":{"size":10377,"offset":"4947432","integrity":{"algorithm":"SHA256","hash":"d293ba5ab787bf223cc136fd26fa0b3a7715e53a27a8dd9557f4fc6469a89552","blockSize":4194304,"blocks":["d293ba5ab787bf223cc136fd26fa0b3a7715e53a27a8dd9557f4fc6469a89552"]}},"http.js.map":{"size":45955,"offset":"4957809","integrity":{"algorithm":"SHA256","hash":"1c99788a6ca65dada1e5b0245c0d4f70ef8a61d2236c04c2cbbe536d1cc2efa5","blockSize":4194304,"blocks":["1c99788a6ca65dada1e5b0245c0d4f70ef8a61d2236c04c2cbbe536d1cc2efa5"]}},"index.js":{"size":1151,"offset":"5003764","integrity":{"algorithm":"SHA256","hash":"369203ffe9d05f79a2f7963ef21a61a463e4df1ecf594702d716f836eca8c1ec","blockSize":4194304,"blocks":["369203ffe9d05f79a2f7963ef21a61a463e4df1ecf594702d716f836eca8c1ec"]}},"index.js.map":{"size":115,"offset":"5004915","integrity":{"algorithm":"SHA256","hash":"078b00dc2bd9d5e87379219889117aea148ae9d419124383cd40925bcc35c6d4","blockSize":4194304,"blocks":["078b00dc2bd9d5e87379219889117aea148ae9d419124383cd40925bcc35c6d4"]}},"linkederrors.js":{"size":3071,"offset":"5005030","integrity":{"algorithm":"SHA256","hash":"db7248ad5f6113327e5d08546eb84c75505191da845912fdf40e58203782d7a3","blockSize":4194304,"blocks":["db7248ad5f6113327e5d08546eb84c75505191da845912fdf40e58203782d7a3"]}},"linkederrors.js.map":{"size":12657,"offset":"5008101","integrity":{"algorithm":"SHA256","hash":"bda372fae1c18dd91f864c6228e5af4747c9432c25f22350bbea6a97e0cfc269","blockSize":4194304,"blocks":["bda372fae1c18dd91f864c6228e5af4747c9432c25f22350bbea6a97e0cfc269"]}},"localvariables.js":{"size":12718,"offset":"5020758","integrity":{"algorithm":"SHA256","hash":"f192e824fe935b4abd4e44865f94770b5ee16695c3ab50c02ae3362158183de9","blockSize":4194304,"blocks":["f192e824fe935b4abd4e44865f94770b5ee16695c3ab50c02ae3362158183de9"]}},"localvariables.js.map":{"size":57133,"offset":"5033476","integrity":{"algorithm":"SHA256","hash":"dff466d4c231207bb7a7698c8302621a09159365cfdb963e10dafecdd8e0c5cb","blockSize":4194304,"blocks":["dff466d4c231207bb7a7698c8302621a09159365cfdb963e10dafecdd8e0c5cb"]}},"modules.js":{"size":2184,"offset":"5090609","integrity":{"algorithm":"SHA256","hash":"e9fdbcfba57880d1eafc8d49c48d7a96b6beb881d53bc3c191456a10674f4a8b","blockSize":4194304,"blocks":["e9fdbcfba57880d1eafc8d49c48d7a96b6beb881d53bc3c191456a10674f4a8b"]}},"modules.js.map":{"size":4953,"offset":"5092793","integrity":{"algorithm":"SHA256","hash":"8d2b3b630d314b92e57080e1bcb8ea8397630e0199ae6636a9a5fa6039608c45","blockSize":4194304,"blocks":["8d2b3b630d314b92e57080e1bcb8ea8397630e0199ae6636a9a5fa6039608c45"]}},"onuncaughtexception.js":{"size":6512,"offset":"5097746","integrity":{"algorithm":"SHA256","hash":"14bed47f013cb8439f786f046c5f34418a6691e5c2b08dcf3c9fb0cfb61aef89","blockSize":4194304,"blocks":["14bed47f013cb8439f786f046c5f34418a6691e5c2b08dcf3c9fb0cfb61aef89"]}},"onuncaughtexception.js.map":{"size":11725,"offset":"5104258","integrity":{"algorithm":"SHA256","hash":"f10596b315c407655b551df2151b2772003ba95d3aa9ae1cd42892df6f4dcc96","blockSize":4194304,"blocks":["f10596b315c407655b551df2151b2772003ba95d3aa9ae1cd42892df6f4dcc96"]}},"onunhandledrejection.js":{"size":2505,"offset":"5115983","integrity":{"algorithm":"SHA256","hash":"0af99fbfaf0d751671c50400f243fa435627709ba0cc955dc23c4105f430b19f","blockSize":4194304,"blocks":["0af99fbfaf0d751671c50400f243fa435627709ba0cc955dc23c4105f430b19f"]}},"onunhandledrejection.js.map":{"size":4698,"offset":"5118488","integrity":{"algorithm":"SHA256","hash":"8b3060baf62f9ee3cf1a897f6e4f2825f17158b476ef96a780a807cf66489733","blockSize":4194304,"blocks":["8b3060baf62f9ee3cf1a897f6e4f2825f17158b476ef96a780a807cf66489733"]}},"requestdata.js":{"size":6635,"offset":"5123186","integrity":{"algorithm":"SHA256","hash":"dba82ecf57a8346fb0f851bbd4206c09ec7c07770a782cd468816edc5e8ee803","blockSize":4194304,"blocks":["dba82ecf57a8346fb0f851bbd4206c09ec7c07770a782cd468816edc5e8ee803"]}},"requestdata.js.map":{"size":12223,"offset":"5129821","integrity":{"algorithm":"SHA256","hash":"c1da7ec0118c227d582ae83aa0833e084187810ab412f0aab87d5b495f188c30","blockSize":4194304,"blocks":["c1da7ec0118c227d582ae83aa0833e084187810ab412f0aab87d5b495f188c30"]}},"undici":{"files":{"index.js":{"size":6064,"offset":"5142044","integrity":{"algorithm":"SHA256","hash":"14e0b62d89f1b39e82604c65936149566515a86d83644357e5761be17978dd2d","blockSize":4194304,"blocks":["14e0b62d89f1b39e82604c65936149566515a86d83644357e5761be17978dd2d"]}},"index.js.map":{"size":12401,"offset":"5148108","integrity":{"algorithm":"SHA256","hash":"b13bb09ffa5495d33ec15031d3541b9f6cd5848a7539ae4efda01195bcee718d","blockSize":4194304,"blocks":["b13bb09ffa5495d33ec15031d3541b9f6cd5848a7539ae4efda01195bcee718d"]}}}},"utils":{"files":{"errorhandling.js":{"size":1296,"offset":"5160509","integrity":{"algorithm":"SHA256","hash":"e49dbb8ba9cc2317b8689fdee526aee2db67f5d24ef385923db0e41d96404ddb","blockSize":4194304,"blocks":["e49dbb8ba9cc2317b8689fdee526aee2db67f5d24ef385923db0e41d96404ddb"]}},"errorhandling.js.map":{"size":2331,"offset":"5161805","integrity":{"algorithm":"SHA256","hash":"ec86b465fdd685c75c644e95acf60b046c3e33cf5cb03d93d236758da0f16cd5","blockSize":4194304,"blocks":["ec86b465fdd685c75c644e95acf60b046c3e33cf5cb03d93d236758da0f16cd5"]}},"http.js":{"size":8752,"offset":"5164136","integrity":{"algorithm":"SHA256","hash":"19b24a82811bb114fcee23fa3828864db0319b6a50e5c2967e5e02d2e1643b58","blockSize":4194304,"blocks":["19b24a82811bb114fcee23fa3828864db0319b6a50e5c2967e5e02d2e1643b58"]}},"http.js.map":{"size":41211,"offset":"5172888","integrity":{"algorithm":"SHA256","hash":"4556b27f291ba009dbb66229be55816992e1995d24a809629db5ed874b5dbe94","blockSize":4194304,"blocks":["4556b27f291ba009dbb66229be55816992e1995d24a809629db5ed874b5dbe94"]}}}}}},"module.js":{"size":1696,"offset":"5214099","integrity":{"algorithm":"SHA256","hash":"48f4376a00589a111a1c43e94b8653c1c46867984799a62086f34346c238f4d6","blockSize":4194304,"blocks":["48f4376a00589a111a1c43e94b8653c1c46867984799a62086f34346c238f4d6"]}},"module.js.map":{"size":3513,"offset":"5215795","integrity":{"algorithm":"SHA256","hash":"09843619294b164751a2c4c13d4e70de21524cab9b6753e8dd61eec24029b08e","blockSize":4194304,"blocks":["09843619294b164751a2c4c13d4e70de21524cab9b6753e8dd61eec24029b08e"]}},"nodeVersion.js":{"size":246,"offset":"5219308","integrity":{"algorithm":"SHA256","hash":"afcb4885ae14087a1fe9fc63ea53fc92f7f2af31b10178072c16756e7ea281fc","blockSize":4194304,"blocks":["afcb4885ae14087a1fe9fc63ea53fc92f7f2af31b10178072c16756e7ea281fc"]}},"nodeVersion.js.map":{"size":345,"offset":"5219554","integrity":{"algorithm":"SHA256","hash":"4ec7985280ec008fc783cee6c2082561f4c914a70156851a6fdbcec9d8377724","blockSize":4194304,"blocks":["4ec7985280ec008fc783cee6c2082561f4c914a70156851a6fdbcec9d8377724"]}},"requestdata.js":{"size":8798,"offset":"5219899","integrity":{"algorithm":"SHA256","hash":"1994482317b67c4251d408df8324a73aebf6b2eede6381a11e5e243d07db2ec1","blockSize":4194304,"blocks":["1994482317b67c4251d408df8324a73aebf6b2eede6381a11e5e243d07db2ec1"]}},"requestdata.js.map":{"size":39913,"offset":"5228697","integrity":{"algorithm":"SHA256","hash":"0e3f3d4197f13077f43475923961595f412ce65942e36519b5a41615815b8092","blockSize":4194304,"blocks":["0e3f3d4197f13077f43475923961595f412ce65942e36519b5a41615815b8092"]}},"requestDataDeprecated.js":{"size":1606,"offset":"5268610","integrity":{"algorithm":"SHA256","hash":"6394ed59c7eae3f59c3456b487b9ee558a491a5629ff62baabb64698c24430cd","blockSize":4194304,"blocks":["6394ed59c7eae3f59c3456b487b9ee558a491a5629ff62baabb64698c24430cd"]}},"requestDataDeprecated.js.map":{"size":2850,"offset":"5270216","integrity":{"algorithm":"SHA256","hash":"a85192aa34b2bab73fef5bedf7fbfebe895f2d6f3cf363012df352d01f82a4c1","blockSize":4194304,"blocks":["a85192aa34b2bab73fef5bedf7fbfebe895f2d6f3cf363012df352d01f82a4c1"]}},"sdk.js":{"size":9635,"offset":"5273066","integrity":{"algorithm":"SHA256","hash":"b7a494f5acc8246d0ac46d11a4451b685aa3d09ae13664ec73817f5a27f03479","blockSize":4194304,"blocks":["b7a494f5acc8246d0ac46d11a4451b685aa3d09ae13664ec73817f5a27f03479"]}},"sdk.js.map":{"size":40448,"offset":"5282701","integrity":{"algorithm":"SHA256","hash":"66fc896cfd2dae9089c8597087f8ebf3d1d4d90f34bb98ed9194c4c3a3f3151d","blockSize":4194304,"blocks":["66fc896cfd2dae9089c8597087f8ebf3d1d4d90f34bb98ed9194c4c3a3f3151d"]}},"tracing":{"files":{"index.js":{"size":1019,"offset":"5323149","integrity":{"algorithm":"SHA256","hash":"4d35b332f7505d3c569e36f45f3f478bc0e6d61480ad8d501630935dc3eb938e","blockSize":4194304,"blocks":["4d35b332f7505d3c569e36f45f3f478bc0e6d61480ad8d501630935dc3eb938e"]}},"index.js.map":{"size":1705,"offset":"5324168","integrity":{"algorithm":"SHA256","hash":"d88f8c77621dd411d307cd143e4b572959f132754cebb9a30d2d9541154cb172","blockSize":4194304,"blocks":["d88f8c77621dd411d307cd143e4b572959f132754cebb9a30d2d9541154cb172"]}},"integrations.js":{"size":396,"offset":"5325873","integrity":{"algorithm":"SHA256","hash":"09a0b1b2375242f095c48a41aac9f357ba28ba326060f5f174596a216c575743","blockSize":4194304,"blocks":["09a0b1b2375242f095c48a41aac9f357ba28ba326060f5f174596a216c575743"]}},"integrations.js.map":{"size":108,"offset":"5326269","integrity":{"algorithm":"SHA256","hash":"a5e22631fce731c224105264e3fc0e91eebbb088583e150885ac1cbf953b88fc","blockSize":4194304,"blocks":["a5e22631fce731c224105264e3fc0e91eebbb088583e150885ac1cbf953b88fc"]}}}},"transports":{"files":{"http.js":{"size":4786,"offset":"5326377","integrity":{"algorithm":"SHA256","hash":"e3d5e099d683dc0d93fb056424b62c88b092f2a17474850e3ba3a6204877e3bb","blockSize":4194304,"blocks":["e3d5e099d683dc0d93fb056424b62c88b092f2a17474850e3ba3a6204877e3bb"]}},"http.js.map":{"size":20557,"offset":"5331163","integrity":{"algorithm":"SHA256","hash":"73a4ead1edde861bb5e2447e5768fbb1946d58b2fbaae6ec0f00f90a6254a724","blockSize":4194304,"blocks":["73a4ead1edde861bb5e2447e5768fbb1946d58b2fbaae6ec0f00f90a6254a724"]}}}},"utils.js":{"size":1629,"offset":"5351720","integrity":{"algorithm":"SHA256","hash":"0f3c3fe5c39bdb0a1f004415150992aa122a131bfedc017c0646d7c22b4785dd","blockSize":4194304,"blocks":["0f3c3fe5c39bdb0a1f004415150992aa122a131bfedc017c0646d7c22b4785dd"]}},"utils.js.map":{"size":2737,"offset":"5353349","integrity":{"algorithm":"SHA256","hash":"37cc47eadb40c52fb918a18c41595539e819a65b8801fc08ee77cc4276b83735","blockSize":4194304,"blocks":["37cc47eadb40c52fb918a18c41595539e819a65b8801fc08ee77cc4276b83735"]}}}},"esm":{"files":{"async":{"files":{"domain.js":{"size":1645,"offset":"5356086","integrity":{"algorithm":"SHA256","hash":"300ff1264d9d2dc7b2014cf0a722cb877b66541d59613ac0e01bef3c40d437e7","blockSize":4194304,"blocks":["300ff1264d9d2dc7b2014cf0a722cb877b66541d59613ac0e01bef3c40d437e7"]}},"domain.js.map":{"size":6937,"offset":"5357731","integrity":{"algorithm":"SHA256","hash":"7270ea1d98e53d4bd388002f37be8f267392176915031bbec15317cb64775fb7","blockSize":4194304,"blocks":["7270ea1d98e53d4bd388002f37be8f267392176915031bbec15317cb64775fb7"]}},"hooks.js":{"size":1262,"offset":"5364668","integrity":{"algorithm":"SHA256","hash":"69a244f195b4cb5900f8eb9541b83c40884d0a29fa712cf1a155d23209439f74","blockSize":4194304,"blocks":["69a244f195b4cb5900f8eb9541b83c40884d0a29fa712cf1a155d23209439f74"]}},"hooks.js.map":{"size":5321,"offset":"5365930","integrity":{"algorithm":"SHA256","hash":"90883763f13bdf21932988b8a6190c11a36b144fae3c8e998a1f2d87af7c9ef4","blockSize":4194304,"blocks":["90883763f13bdf21932988b8a6190c11a36b144fae3c8e998a1f2d87af7c9ef4"]}},"index.js":{"size":568,"offset":"5371251","integrity":{"algorithm":"SHA256","hash":"d00389cfb90acb71236488384da1eed41d887a59095dbfa82b178b4371c234e3","blockSize":4194304,"blocks":["d00389cfb90acb71236488384da1eed41d887a59095dbfa82b178b4371c234e3"]}},"index.js.map":{"size":839,"offset":"5371819","integrity":{"algorithm":"SHA256","hash":"800e873f3d6105fb94f8d960e538354db7b2ab37d3e1b00442ff8024950d0cfc","blockSize":4194304,"blocks":["800e873f3d6105fb94f8d960e538354db7b2ab37d3e1b00442ff8024950d0cfc"]}}}},"client.js":{"size":5836,"offset":"5372658","integrity":{"algorithm":"SHA256","hash":"15c640f2c02b1029ecddb4b3b1d0f33ee6a465d6481b3d5ef5ca552ff3e3d057","blockSize":4194304,"blocks":["15c640f2c02b1029ecddb4b3b1d0f33ee6a465d6481b3d5ef5ca552ff3e3d057"]}},"client.js.map":{"size":25793,"offset":"5378494","integrity":{"algorithm":"SHA256","hash":"d2d632e39cefb08b3a90135024cba7628b4d51819749874f43cb82ceb8bff865","blockSize":4194304,"blocks":["d2d632e39cefb08b3a90135024cba7628b4d51819749874f43cb82ceb8bff865"]}},"eventbuilder.js":{"size":3157,"offset":"5404287","integrity":{"algorithm":"SHA256","hash":"d183a8c48d4692caa7b71d12270a2d73fe71e3e1e5c90de73221d998d259acbe","blockSize":4194304,"blocks":["d183a8c48d4692caa7b71d12270a2d73fe71e3e1e5c90de73221d998d259acbe"]}},"eventbuilder.js.map":{"size":6462,"offset":"5407444","integrity":{"algorithm":"SHA256","hash":"e4d1f5aaa18d5d866b99c0db548f85451099094adf7346dd155d187bd76cc1b2","blockSize":4194304,"blocks":["e4d1f5aaa18d5d866b99c0db548f85451099094adf7346dd155d187bd76cc1b2"]}},"handlers.js":{"size":11809,"offset":"5413906","integrity":{"algorithm":"SHA256","hash":"f69ba527cd7a4f846c786110a4352c6ec34f13da3e88ca0911c8a8b9b62c7b3e","blockSize":4194304,"blocks":["f69ba527cd7a4f846c786110a4352c6ec34f13da3e88ca0911c8a8b9b62c7b3e"]}},"handlers.js.map":{"size":52409,"offset":"5425715","integrity":{"algorithm":"SHA256","hash":"41427c0c3497bb0581ed3476d5ca6c68819746189fdc08b67a1966ffb189822b","blockSize":4194304,"blocks":["41427c0c3497bb0581ed3476d5ca6c68819746189fdc08b67a1966ffb189822b"]}},"index.js":{"size":1244,"offset":"5478124","integrity":{"algorithm":"SHA256","hash":"36f586c62e55466a8c41a9929a2cc80f42d83dd839fcb28570b42053850639f9","blockSize":4194304,"blocks":["36f586c62e55466a8c41a9929a2cc80f42d83dd839fcb28570b42053850639f9"]}},"index.js.map":{"size":2148,"offset":"5479368","integrity":{"algorithm":"SHA256","hash":"e611ad459f154a8adb460d9f1b29fa0bdb7f0e243bc9b8bfbb65428e0b5a9392","blockSize":4194304,"blocks":["e611ad459f154a8adb460d9f1b29fa0bdb7f0e243bc9b8bfbb65428e0b5a9392"]}},"integrations":{"files":{"console.js":{"size":1400,"offset":"5481516","integrity":{"algorithm":"SHA256","hash":"f1382c7d348ecd16ac5130848a1ef212154d8bd8c36a3a1e759de362478b8f0d","blockSize":4194304,"blocks":["f1382c7d348ecd16ac5130848a1ef212154d8bd8c36a3a1e759de362478b8f0d"]}},"console.js.map":{"size":2767,"offset":"5482916","integrity":{"algorithm":"SHA256","hash":"b92f5faa9d0ad6cdf04eee1e7f0ec555e2a4ff0bd46fe3010e069d2abea30e0c","blockSize":4194304,"blocks":["b92f5faa9d0ad6cdf04eee1e7f0ec555e2a4ff0bd46fe3010e069d2abea30e0c"]}},"context.js":{"size":11588,"offset":"5485683","integrity":{"algorithm":"SHA256","hash":"b1ad10e1acf6752206eb2459649894e5b5313f2c782d93439d73d5d582a65401","blockSize":4194304,"blocks":["b1ad10e1acf6752206eb2459649894e5b5313f2c782d93439d73d5d582a65401"]}},"context.js.map":{"size":53381,"offset":"5497271","integrity":{"algorithm":"SHA256","hash":"cef13eb6cd3e0510bd1a88f73c2739b200fa1aafaebb4b983079652b607ccde6","blockSize":4194304,"blocks":["cef13eb6cd3e0510bd1a88f73c2739b200fa1aafaebb4b983079652b607ccde6"]}},"contextlines.js":{"size":5541,"offset":"5550652","integrity":{"algorithm":"SHA256","hash":"7af3bc7c51663569a0509c5d76e19702c8f2cae77eb224700576eaac39988eb0","blockSize":4194304,"blocks":["7af3bc7c51663569a0509c5d76e19702c8f2cae77eb224700576eaac39988eb0"]}},"contextlines.js.map":{"size":24744,"offset":"5556193","integrity":{"algorithm":"SHA256","hash":"e5d24665919cd81f22ac2fb453f2477b12a5edd7919755db579f03f0a5874b81","blockSize":4194304,"blocks":["e5d24665919cd81f22ac2fb453f2477b12a5edd7919755db579f03f0a5874b81"]}},"http.js":{"size":10336,"offset":"5580937","integrity":{"algorithm":"SHA256","hash":"037b778bcc1f8956c1596a527665bec696ea574d10435c8920f57a0ea8e6cbbf","blockSize":4194304,"blocks":["037b778bcc1f8956c1596a527665bec696ea574d10435c8920f57a0ea8e6cbbf"]}},"http.js.map":{"size":45099,"offset":"5591273","integrity":{"algorithm":"SHA256","hash":"c382fbcba89787720f337b4f36d9596408d2233e42f6b09eac473d39ba771791","blockSize":4194304,"blocks":["c382fbcba89787720f337b4f36d9596408d2233e42f6b09eac473d39ba771791"]}},"index.js":{"size":564,"offset":"5636372","integrity":{"algorithm":"SHA256","hash":"b1158e525bf02362e84385bb26d46d7cb243a0774694060b58e1f5be34e6c65f","blockSize":4194304,"blocks":["b1158e525bf02362e84385bb26d46d7cb243a0774694060b58e1f5be34e6c65f"]}},"index.js.map":{"size":99,"offset":"5636936","integrity":{"algorithm":"SHA256","hash":"50a91b5e6e5fa3ceba59911245d3fb63228a5bcfc4df081e39bf9e4dc6e86e04","blockSize":4194304,"blocks":["50a91b5e6e5fa3ceba59911245d3fb63228a5bcfc4df081e39bf9e4dc6e86e04"]}},"linkederrors.js":{"size":3001,"offset":"5637035","integrity":{"algorithm":"SHA256","hash":"7e95a27fffc8359e71d5cedb8b051d80efed9768fa64c0289d3a9aa9f63660b2","blockSize":4194304,"blocks":["7e95a27fffc8359e71d5cedb8b051d80efed9768fa64c0289d3a9aa9f63660b2"]}},"linkederrors.js.map":{"size":12166,"offset":"5640036","integrity":{"algorithm":"SHA256","hash":"b4c5db21f58ee437f151c1c8eabca0422da2a44464deecb28432f7349847c024","blockSize":4194304,"blocks":["b4c5db21f58ee437f151c1c8eabca0422da2a44464deecb28432f7349847c024"]}},"localvariables.js":{"size":12577,"offset":"5652202","integrity":{"algorithm":"SHA256","hash":"3c76e4f9a28b3546b00b1787915bddb5ad3119edd99eaa1d43ded14fa9c1caea","blockSize":4194304,"blocks":["3c76e4f9a28b3546b00b1787915bddb5ad3119edd99eaa1d43ded14fa9c1caea"]}},"localvariables.js.map":{"size":56969,"offset":"5664779","integrity":{"algorithm":"SHA256","hash":"795216165f0da408197817e3c64b548becccdbed2bfeed87afc06d1be32c9187","blockSize":4194304,"blocks":["795216165f0da408197817e3c64b548becccdbed2bfeed87afc06d1be32c9187"]}},"modules.js":{"size":2122,"offset":"5721748","integrity":{"algorithm":"SHA256","hash":"c5cc47f70491902ba358b29dd3fb01f5d4da42b816fbf1b68ce84a5889e6e2c0","blockSize":4194304,"blocks":["c5cc47f70491902ba358b29dd3fb01f5d4da42b816fbf1b68ce84a5889e6e2c0"]}},"modules.js.map":{"size":4894,"offset":"5723870","integrity":{"algorithm":"SHA256","hash":"4cd8eb648546b277ace17ee38805c23a8c00e243d848ecaac8f89f305bcf54a2","blockSize":4194304,"blocks":["4cd8eb648546b277ace17ee38805c23a8c00e243d848ecaac8f89f305bcf54a2"]}},"onuncaughtexception.js":{"size":6396,"offset":"5728764","integrity":{"algorithm":"SHA256","hash":"47e590062707a0b8c9827efccc516046311b4f3618c67ba202bf40b972501e80","blockSize":4194304,"blocks":["47e590062707a0b8c9827efccc516046311b4f3618c67ba202bf40b972501e80"]}},"onuncaughtexception.js.map":{"size":11672,"offset":"5735160","integrity":{"algorithm":"SHA256","hash":"64aafa49c639b076f2f2bc0bf879ca6010d5223b3b843a0dfebaf42fd2a8da83","blockSize":4194304,"blocks":["64aafa49c639b076f2f2bc0bf879ca6010d5223b3b843a0dfebaf42fd2a8da83"]}},"onunhandledrejection.js":{"size":2409,"offset":"5746832","integrity":{"algorithm":"SHA256","hash":"42e4c684425f4f37bcb783b0ce9f0d031aae317c3d061c417923a06754488016","blockSize":4194304,"blocks":["42e4c684425f4f37bcb783b0ce9f0d031aae317c3d061c417923a06754488016"]}},"onunhandledrejection.js.map":{"size":4637,"offset":"5749241","integrity":{"algorithm":"SHA256","hash":"ab7c75b9036c7347537b6c04bf4a39a72d8da270f3f89be5a92dd3688b2ffbdd","blockSize":4194304,"blocks":["ab7c75b9036c7347537b6c04bf4a39a72d8da270f3f89be5a92dd3688b2ffbdd"]}},"requestdata.js":{"size":6570,"offset":"5753878","integrity":{"algorithm":"SHA256","hash":"c9075cdb6c8c2e41e7f83bcf67c944fb3539b7dd96048f16815397c5422144fc","blockSize":4194304,"blocks":["c9075cdb6c8c2e41e7f83bcf67c944fb3539b7dd96048f16815397c5422144fc"]}},"requestdata.js.map":{"size":12168,"offset":"5760448","integrity":{"algorithm":"SHA256","hash":"6c39e7680f7cbcdd4f249305c216615dc3249d29e59077bb78a6484e6203d638","blockSize":4194304,"blocks":["6c39e7680f7cbcdd4f249305c216615dc3249d29e59077bb78a6484e6203d638"]}},"undici":{"files":{"index.js":{"size":6006,"offset":"5772616","integrity":{"algorithm":"SHA256","hash":"87b94b8b58f3c378e886f0d6b52d4fb68867c5ee804d010690b312582b8e56c5","blockSize":4194304,"blocks":["87b94b8b58f3c378e886f0d6b52d4fb68867c5ee804d010690b312582b8e56c5"]}},"index.js.map":{"size":12214,"offset":"5778622","integrity":{"algorithm":"SHA256","hash":"5b8e91a3521ce5c2d55053ad462ac0c45a9c27b3ca1e4b0ec78928e220309fc4","blockSize":4194304,"blocks":["5b8e91a3521ce5c2d55053ad462ac0c45a9c27b3ca1e4b0ec78928e220309fc4"]}}}},"utils":{"files":{"errorhandling.js":{"size":1200,"offset":"5790836","integrity":{"algorithm":"SHA256","hash":"e675cba3e11f3324705ac31bcfc6e4d6c62f99c910dc151feb09ece57ade8144","blockSize":4194304,"blocks":["e675cba3e11f3324705ac31bcfc6e4d6c62f99c910dc151feb09ece57ade8144"]}},"errorhandling.js.map":{"size":2300,"offset":"5792036","integrity":{"algorithm":"SHA256","hash":"9ae810797e4c969c48667742ed3d17428cfe93be96f44392e91f1431c6c09568","blockSize":4194304,"blocks":["9ae810797e4c969c48667742ed3d17428cfe93be96f44392e91f1431c6c09568"]}},"http.js":{"size":8507,"offset":"5794336","integrity":{"algorithm":"SHA256","hash":"180b1f0947e0713a605e01b26756fc53607206fb670cd7f53394281c06a0edb2","blockSize":4194304,"blocks":["180b1f0947e0713a605e01b26756fc53607206fb670cd7f53394281c06a0edb2"]}},"http.js.map":{"size":41029,"offset":"5802843","integrity":{"algorithm":"SHA256","hash":"b577f3f9c46c763edb95b6db374af49c466d7af9929482869e56945c85c5dd44","blockSize":4194304,"blocks":["b577f3f9c46c763edb95b6db374af49c466d7af9929482869e56945c85c5dd44"]}}}}}},"module.js":{"size":1618,"offset":"5843872","integrity":{"algorithm":"SHA256","hash":"87a1e4ad103e099227ef75fbcf50458e7e9174e304d03d61948ba509885d8955","blockSize":4194304,"blocks":["87a1e4ad103e099227ef75fbcf50458e7e9174e304d03d61948ba509885d8955"]}},"module.js.map":{"size":3496,"offset":"5845490","integrity":{"algorithm":"SHA256","hash":"85a4da89c649c668840b8af966df1d1207972c2171cc978cc5fd7a7921995541","blockSize":4194304,"blocks":["85a4da89c649c668840b8af966df1d1207972c2171cc978cc5fd7a7921995541"]}},"nodeVersion.js":{"size":169,"offset":"5848986","integrity":{"algorithm":"SHA256","hash":"aef3e0e1d3d90f370c439b51b92d110b4809345e170553ccdaa880ff19f66c45","blockSize":4194304,"blocks":["aef3e0e1d3d90f370c439b51b92d110b4809345e170553ccdaa880ff19f66c45"]}},"nodeVersion.js.map":{"size":328,"offset":"5849155","integrity":{"algorithm":"SHA256","hash":"6f546810697cbf173b3d3cead1283bd853a37b9d1969cc482b1e13046cb24b4a","blockSize":4194304,"blocks":["6f546810697cbf173b3d3cead1283bd853a37b9d1969cc482b1e13046cb24b4a"]}},"requestdata.js":{"size":8640,"offset":"5849483","integrity":{"algorithm":"SHA256","hash":"a12c1734c50038f700eff113493a8b6d8a03a289cd69ed21cdf750938633d117","blockSize":4194304,"blocks":["a12c1734c50038f700eff113493a8b6d8a03a289cd69ed21cdf750938633d117"]}},"requestdata.js.map":{"size":39688,"offset":"5858123","integrity":{"algorithm":"SHA256","hash":"d7ca05568c8fd068986b2dcfd2fb3c410c164f3e546300060255af64107c7fa5","blockSize":4194304,"blocks":["d7ca05568c8fd068986b2dcfd2fb3c410c164f3e546300060255af64107c7fa5"]}},"requestDataDeprecated.js":{"size":1532,"offset":"5897811","integrity":{"algorithm":"SHA256","hash":"2c9b34db778cbd0df1566f38a93a728437ac965b851cf056392d38defe7ddff7","blockSize":4194304,"blocks":["2c9b34db778cbd0df1566f38a93a728437ac965b851cf056392d38defe7ddff7"]}},"requestDataDeprecated.js.map":{"size":2822,"offset":"5899343","integrity":{"algorithm":"SHA256","hash":"27b6598c4f1f0053918c7a6f44bd1699e87ba6f043437c9e595cc15234fdbfe5","blockSize":4194304,"blocks":["27b6598c4f1f0053918c7a6f44bd1699e87ba6f043437c9e595cc15234fdbfe5"]}},"sdk.js":{"size":9321,"offset":"5902165","integrity":{"algorithm":"SHA256","hash":"02ba7f244d9dad7887fb8494cc393926d4adaea48320be1b4523fcdb7b4250fd","blockSize":4194304,"blocks":["02ba7f244d9dad7887fb8494cc393926d4adaea48320be1b4523fcdb7b4250fd"]}},"sdk.js.map":{"size":39312,"offset":"5911486","integrity":{"algorithm":"SHA256","hash":"61a4969b3e2b03243c312d6c53b30886cee29dd12f3534c349eb10e96ec3ecdc","blockSize":4194304,"blocks":["61a4969b3e2b03243c312d6c53b30886cee29dd12f3534c349eb10e96ec3ecdc"]}},"tracing":{"files":{"index.js":{"size":931,"offset":"5950798","integrity":{"algorithm":"SHA256","hash":"65162fc071478458b7808bcdf10c0f56e7e2efeead67b66369c1b53a4cdf5dec","blockSize":4194304,"blocks":["65162fc071478458b7808bcdf10c0f56e7e2efeead67b66369c1b53a4cdf5dec"]}},"index.js.map":{"size":1643,"offset":"5951729","integrity":{"algorithm":"SHA256","hash":"4501a2a112db747fa561c1ce82145439da7a776c5894773c2904106d8a0eb01e","blockSize":4194304,"blocks":["4501a2a112db747fa561c1ce82145439da7a776c5894773c2904106d8a0eb01e"]}},"integrations.js":{"size":142,"offset":"5953372","integrity":{"algorithm":"SHA256","hash":"365b729d65ec71cd3535962ddb2540b6871e09fafe0e898de3b6122e94e939ae","blockSize":4194304,"blocks":["365b729d65ec71cd3535962ddb2540b6871e09fafe0e898de3b6122e94e939ae"]}},"integrations.js.map":{"size":96,"offset":"5953514","integrity":{"algorithm":"SHA256","hash":"504122e0666c46f67b4db7baa8a40dee0761529903d1b822ca3ede27136c1a91","blockSize":4194304,"blocks":["504122e0666c46f67b4db7baa8a40dee0761529903d1b822ca3ede27136c1a91"]}}}},"transports":{"files":{"http.js":{"size":4667,"offset":"5953610","integrity":{"algorithm":"SHA256","hash":"3ce461a3aa9f537441471815e530e275ff6ef0da701b34944acd0e2cb4a40d47","blockSize":4194304,"blocks":["3ce461a3aa9f537441471815e530e275ff6ef0da701b34944acd0e2cb4a40d47"]}},"http.js.map":{"size":20156,"offset":"5958277","integrity":{"algorithm":"SHA256","hash":"388a89f02ba84ae370be2669477463bc4c5845804671ab00ae704a9230649889","blockSize":4194304,"blocks":["388a89f02ba84ae370be2669477463bc4c5845804671ab00ae704a9230649889"]}}}},"utils.js":{"size":1550,"offset":"5978433","integrity":{"algorithm":"SHA256","hash":"e6e258b57280ee60cc54c854af567a64840eab7d59b45d1d1a25b760a2812a28","blockSize":4194304,"blocks":["e6e258b57280ee60cc54c854af567a64840eab7d59b45d1d1a25b760a2812a28"]}},"utils.js.map":{"size":2735,"offset":"5979983","integrity":{"algorithm":"SHA256","hash":"4d5f086467c301abc1310bc485c72aba2ae78a8c92d30f557d51d0611360c3f9","blockSize":4194304,"blocks":["4d5f086467c301abc1310bc485c72aba2ae78a8c92d30f557d51d0611360c3f9"]}}}},"LICENSE":{"size":1120,"offset":"5982718","integrity":{"algorithm":"SHA256","hash":"5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7","blockSize":4194304,"blocks":["5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7"]}},"package.json":{"size":994,"offset":"5983838","integrity":{"algorithm":"SHA256","hash":"735eb454d5b37675f4459f090afff314186e3f1c910830ef59bd8d32848ebe17","blockSize":4194304,"blocks":["735eb454d5b37675f4459f090afff314186e3f1c910830ef59bd8d32848ebe17"]}},"README.md":{"size":1876,"offset":"5984832","integrity":{"algorithm":"SHA256","hash":"3990f8994754ac3d11d09504bccbb34a869acc9403b006c9b0624a41ed309711","blockSize":4194304,"blocks":["3990f8994754ac3d11d09504bccbb34a869acc9403b006c9b0624a41ed309711"]}},"types":{"files":{"async":{"files":{"domain.d.ts":{"size":166,"offset":"5986708","integrity":{"algorithm":"SHA256","hash":"622bc854796c2b71c6f73fc0ec7ffce110cc8ab608d0b4b198313d21dcf8006b","blockSize":4194304,"blocks":["622bc854796c2b71c6f73fc0ec7ffce110cc8ab608d0b4b198313d21dcf8006b"]}},"domain.d.ts.map":{"size":164,"offset":"5986874","integrity":{"algorithm":"SHA256","hash":"abb8d94e077ff1d36669d2e71874f69b67df34099bd78055573fbdf8bc463a0c","blockSize":4194304,"blocks":["abb8d94e077ff1d36669d2e71874f69b67df34099bd78055573fbdf8bc463a0c"]}},"hooks.d.ts":{"size":207,"offset":"5987038","integrity":{"algorithm":"SHA256","hash":"401f36436991796f11a88faf14ad70efa92a134f7e12cd7b6092525e445e7e27","blockSize":4194304,"blocks":["401f36436991796f11a88faf14ad70efa92a134f7e12cd7b6092525e445e7e27"]}},"hooks.d.ts.map":{"size":162,"offset":"5987245","integrity":{"algorithm":"SHA256","hash":"4a876a0cc0d424a0f337d696fada489ee39e81125776e84d9c3756462ec645ed","blockSize":4194304,"blocks":["4a876a0cc0d424a0f337d696fada489ee39e81125776e84d9c3756462ec645ed"]}},"index.d.ts":{"size":231,"offset":"5987407","integrity":{"algorithm":"SHA256","hash":"95278617fde2c29c19d628419fbb7e8bed8e8c2e67f7a75d19e5ccf1085472e1","blockSize":4194304,"blocks":["95278617fde2c29c19d628419fbb7e8bed8e8c2e67f7a75d19e5ccf1085472e1"]}},"index.d.ts.map":{"size":164,"offset":"5987638","integrity":{"algorithm":"SHA256","hash":"7d9f40b8219187ec73de044ab484ccce9089bf7ba5c931097aeb30537df5519a","blockSize":4194304,"blocks":["7d9f40b8219187ec73de044ab484ccce9089bf7ba5c931097aeb30537df5519a"]}}}},"checkin.d.ts":{"size":317,"offset":"5987802","integrity":{"algorithm":"SHA256","hash":"4d9a6c22d2d3f7df26b33c5120c147c5067cbad7ab1ab2238427828092095bac","blockSize":4194304,"blocks":["4d9a6c22d2d3f7df26b33c5120c147c5067cbad7ab1ab2238427828092095bac"]}},"checkin.d.ts.map":{"size":331,"offset":"5988119","integrity":{"algorithm":"SHA256","hash":"7e380ad7c6c61612bdefc20c79cee1bdd2198b2579bac43bd6aad7270632f80b","blockSize":4194304,"blocks":["7e380ad7c6c61612bdefc20c79cee1bdd2198b2579bac43bd6aad7270632f80b"]}},"client.d.ts":{"size":1786,"offset":"5988450","integrity":{"algorithm":"SHA256","hash":"7f9ccfdfcba42cf07ec2cefe863c02b4648819c7b85d3888662b4042045e18c6","blockSize":4194304,"blocks":["7f9ccfdfcba42cf07ec2cefe863c02b4648819c7b85d3888662b4042045e18c6"]}},"client.d.ts.map":{"size":1212,"offset":"5990236","integrity":{"algorithm":"SHA256","hash":"23196cf7c32ef0661932062c53ae2a80d1131c4b7264e9c633d208a26e8db3b1","blockSize":4194304,"blocks":["23196cf7c32ef0661932062c53ae2a80d1131c4b7264e9c633d208a26e8db3b1"]}},"eventbuilder.d.ts":{"size":888,"offset":"5991448","integrity":{"algorithm":"SHA256","hash":"7847af6d59040ca2765c5c46e2047dc2a6d2efbef03fa32b88ed27dfb5230519","blockSize":4194304,"blocks":["7847af6d59040ca2765c5c46e2047dc2a6d2efbef03fa32b88ed27dfb5230519"]}},"eventbuilder.d.ts.map":{"size":691,"offset":"5992336","integrity":{"algorithm":"SHA256","hash":"14c50c730dfa3b14dba232130a2b95cfb8f3d8cb603998a4c73c952bb436d246","blockSize":4194304,"blocks":["14c50c730dfa3b14dba232130a2b95cfb8f3d8cb603998a4c73c952bb436d246"]}},"handlers.d.ts":{"size":2406,"offset":"5993027","integrity":{"algorithm":"SHA256","hash":"56c247db99626280e41dce9887325c92cfc5e8db1ff4bd9cf805161ab4b1df19","blockSize":4194304,"blocks":["56c247db99626280e41dce9887325c92cfc5e8db1ff4bd9cf805161ab4b1df19"]}},"handlers.d.ts.map":{"size":1630,"offset":"5995433","integrity":{"algorithm":"SHA256","hash":"172b7266e6369b47eb91f66453a37a9429436def576c6540b3e43374e166c28f","blockSize":4194304,"blocks":["172b7266e6369b47eb91f66453a37a9429436def576c6540b3e43374e166c28f"]}},"index.d.ts":{"size":2668,"offset":"5997063","integrity":{"algorithm":"SHA256","hash":"9d5cc773faf7b5c6b213bb528531926484097dee64f395434d0201073f5c5f9b","blockSize":4194304,"blocks":["9d5cc773faf7b5c6b213bb528531926484097dee64f395434d0201073f5c5f9b"]}},"index.d.ts.map":{"size":1405,"offset":"5999731","integrity":{"algorithm":"SHA256","hash":"6f1673f79baa99929a0f4ca8d314a37d6b75d1a8ba447761ab71a6f8bb4234fb","blockSize":4194304,"blocks":["6f1673f79baa99929a0f4ca8d314a37d6b75d1a8ba447761ab71a6f8bb4234fb"]}},"integrations":{"files":{"console.d.ts":{"size":346,"offset":"6001136","integrity":{"algorithm":"SHA256","hash":"05ac51d0771404a4eb1b72126ebe6b812864b7d06a75448c4403a01b54bf01ac","blockSize":4194304,"blocks":["05ac51d0771404a4eb1b72126ebe6b812864b7d06a75448c4403a01b54bf01ac"]}},"console.d.ts.map":{"size":328,"offset":"6001482","integrity":{"algorithm":"SHA256","hash":"e895c11d63f666e32da3cbad6c3260582123a364b76e161230c8ab8bc2e5a0f6","blockSize":4194304,"blocks":["e895c11d63f666e32da3cbad6c3260582123a364b76e161230c8ab8bc2e5a0f6"]}},"context.d.ts":{"size":1485,"offset":"6001810","integrity":{"algorithm":"SHA256","hash":"fd901a1daef59fdddaa8eb7ea43ec324a4d832fccbb5d303dd0e3c3f6c21517f","blockSize":4194304,"blocks":["fd901a1daef59fdddaa8eb7ea43ec324a4d832fccbb5d303dd0e3c3f6c21517f"]}},"context.d.ts.map":{"size":1060,"offset":"6003295","integrity":{"algorithm":"SHA256","hash":"371fdb7d83184fac12207fb17fc1666f26543288d098fa218436cd29fac9ea00","blockSize":4194304,"blocks":["371fdb7d83184fac12207fb17fc1666f26543288d098fa218436cd29fac9ea00"]}},"contextlines.d.ts":{"size":1226,"offset":"6004355","integrity":{"algorithm":"SHA256","hash":"0646b8b0c12bff6dbc0246ea107e8a3d5d69c5129b01dc5d3b3a650780d7d88e","blockSize":4194304,"blocks":["0646b8b0c12bff6dbc0246ea107e8a3d5d69c5129b01dc5d3b3a650780d7d88e"]}},"contextlines.d.ts.map":{"size":762,"offset":"6005581","integrity":{"algorithm":"SHA256","hash":"1058945d9a41870cf7a4ccbc2bd8d85fab4e734a44357d0c9326ef50bf31fc8b","blockSize":4194304,"blocks":["1058945d9a41870cf7a4ccbc2bd8d85fab4e734a44357d0c9326ef50bf31fc8b"]}},"http.d.ts":{"size":1885,"offset":"6006343","integrity":{"algorithm":"SHA256","hash":"e01d2aac90a9baac44b5c94eee164bb83cce2b90a9c934d693d2b929d7fe0674","blockSize":4194304,"blocks":["e01d2aac90a9baac44b5c94eee164bb83cce2b90a9c934d693d2b929d7fe0674"]}},"http.d.ts.map":{"size":834,"offset":"6008228","integrity":{"algorithm":"SHA256","hash":"cde8bd3163c8258ac76f2c9c03221286bbdf721d3b59e8fbec37379a1168984b","blockSize":4194304,"blocks":["cde8bd3163c8258ac76f2c9c03221286bbdf721d3b59e8fbec37379a1168984b"]}},"index.d.ts":{"size":526,"offset":"6009062","integrity":{"algorithm":"SHA256","hash":"036748a0e173ddbe6d54ad1cd7ad6ba50f28265bd916486359da873cb149b9e8","blockSize":4194304,"blocks":["036748a0e173ddbe6d54ad1cd7ad6ba50f28265bd916486359da873cb149b9e8"]}},"index.d.ts.map":{"size":586,"offset":"6009588","integrity":{"algorithm":"SHA256","hash":"a9da86ae7f6996e9f9f4c22792df2819ca660f8b846d725fc6c0dcfc8b919ccc","blockSize":4194304,"blocks":["a9da86ae7f6996e9f9f4c22792df2819ca660f8b846d725fc6c0dcfc8b919ccc"]}},"linkederrors.d.ts":{"size":728,"offset":"6010174","integrity":{"algorithm":"SHA256","hash":"ba7836be0ba71edcc31771598b2844241a7463ac0a8a95b762946ee520ea681b","blockSize":4194304,"blocks":["ba7836be0ba71edcc31771598b2844241a7463ac0a8a95b762946ee520ea681b"]}},"linkederrors.d.ts.map":{"size":591,"offset":"6010902","integrity":{"algorithm":"SHA256","hash":"c941e0b15e6ba1d5e7eed12cbfd6088f02c8a62db9ba137a99f58da5e76ae15d","blockSize":4194304,"blocks":["c941e0b15e6ba1d5e7eed12cbfd6088f02c8a62db9ba137a99f58da5e76ae15d"]}},"localvariables.d.ts":{"size":2229,"offset":"6011493","integrity":{"algorithm":"SHA256","hash":"df41d6e8d2e366714bc3376ac7409fd91ee8e1e77b7550acc56a39ce5e57c51b","blockSize":4194304,"blocks":["df41d6e8d2e366714bc3376ac7409fd91ee8e1e77b7550acc56a39ce5e57c51b"]}},"localvariables.d.ts.map":{"size":1686,"offset":"6013722","integrity":{"algorithm":"SHA256","hash":"a48b394e3f627db7e71e072568af4b9048f675e6a11e7def893472e0750475a5","blockSize":4194304,"blocks":["a48b394e3f627db7e71e072568af4b9048f675e6a11e7def893472e0750475a5"]}},"modules.d.ts":{"size":594,"offset":"6015408","integrity":{"algorithm":"SHA256","hash":"e73cfb8e35960c055b5fb07c900c9da49afc38c03a2e5901176f29759c279a67","blockSize":4194304,"blocks":["e73cfb8e35960c055b5fb07c900c9da49afc38c03a2e5901176f29759c279a67"]}},"modules.d.ts.map":{"size":455,"offset":"6016002","integrity":{"algorithm":"SHA256","hash":"8075712d4f10ccb14067f8f5122e4a1426658dbaaefbc84e14ddc40d815e7f95","blockSize":4194304,"blocks":["8075712d4f10ccb14067f8f5122e4a1426658dbaaefbc84e14ddc40d815e7f95"]}},"onuncaughtexception.d.ts":{"size":1560,"offset":"6016457","integrity":{"algorithm":"SHA256","hash":"4ed032693352d60b9cca72d55b291009dd02eca5576c25a3096273998582291c","blockSize":4194304,"blocks":["4ed032693352d60b9cca72d55b291009dd02eca5576c25a3096273998582291c"]}},"onuncaughtexception.d.ts.map":{"size":726,"offset":"6018017","integrity":{"algorithm":"SHA256","hash":"9de272fa17f5cf160555a6585ee8b6acd648f2a983ec443afafcc1002b1b136a","blockSize":4194304,"blocks":["9de272fa17f5cf160555a6585ee8b6acd648f2a983ec443afafcc1002b1b136a"]}},"onunhandledrejection.d.ts":{"size":1022,"offset":"6018743","integrity":{"algorithm":"SHA256","hash":"daca399b20527e0820b46098d7b03790ab03829c3d81a5893bdc0f454e680407","blockSize":4194304,"blocks":["daca399b20527e0820b46098d7b03790ab03829c3d81a5893bdc0f454e680407"]}},"onunhandledrejection.d.ts.map":{"size":627,"offset":"6019765","integrity":{"algorithm":"SHA256","hash":"c177bb5f715cb7cfe7f56092aaa30ba50907bc8caf32a3e18fa97c46de54e08a","blockSize":4194304,"blocks":["c177bb5f715cb7cfe7f56092aaa30ba50907bc8caf32a3e18fa97c46de54e08a"]}},"requestdata.d.ts":{"size":1895,"offset":"6020392","integrity":{"algorithm":"SHA256","hash":"800aa796dd0672e2b3c1d9ab7f21a12227e39531f6bf90214989e101f1cbedf3","blockSize":4194304,"blocks":["800aa796dd0672e2b3c1d9ab7f21a12227e39531f6bf90214989e101f1cbedf3"]}},"requestdata.d.ts.map":{"size":1168,"offset":"6022287","integrity":{"algorithm":"SHA256","hash":"ac4749bc6793f54837e6bef2fc9145b1ac9869aab86dbf7aa16b63545f8cf8bc","blockSize":4194304,"blocks":["ac4749bc6793f54837e6bef2fc9145b1ac9869aab86dbf7aa16b63545f8cf8bc"]}},"undici":{"files":{"index.d.ts":{"size":1303,"offset":"6023455","integrity":{"algorithm":"SHA256","hash":"b5af5d520888aae00045776762164a31a418ede53f33d1c62611e4de3a1a17ca","blockSize":4194304,"blocks":["b5af5d520888aae00045776762164a31a418ede53f33d1c62611e4de3a1a17ca"]}},"index.d.ts.map":{"size":745,"offset":"6024758","integrity":{"algorithm":"SHA256","hash":"31055ab841e39c3a876f724628e7a1606a6d5d640e7b2281881f712c2d01c6af","blockSize":4194304,"blocks":["31055ab841e39c3a876f724628e7a1606a6d5d640e7b2281881f712c2d01c6af"]}},"types.d.ts":{"size":7852,"offset":"6025503","integrity":{"algorithm":"SHA256","hash":"056b62620a0f314aaac369f492b3599b7cb985010285cd802c9bfa43feaa87b0","blockSize":4194304,"blocks":["056b62620a0f314aaac369f492b3599b7cb985010285cd802c9bfa43feaa87b0"]}},"types.d.ts.map":{"size":1797,"offset":"6033355","integrity":{"algorithm":"SHA256","hash":"a3c8d697863ab207f439885a1681360955d65c294bcf8bd7fbbe96ac7745e7c9","blockSize":4194304,"blocks":["a3c8d697863ab207f439885a1681360955d65c294bcf8bd7fbbe96ac7745e7c9"]}}}},"utils":{"files":{"errorhandling.d.ts":{"size":125,"offset":"6035152","integrity":{"algorithm":"SHA256","hash":"efa93559f4a2a844a54a542709cb5d4f970d3b139398c789e7a1833d92ef013d","blockSize":4194304,"blocks":["efa93559f4a2a844a54a542709cb5d4f970d3b139398c789e7a1833d92ef013d"]}},"errorhandling.d.ts.map":{"size":214,"offset":"6035277","integrity":{"algorithm":"SHA256","hash":"50737429ebda6880ac98a0ac439001962f64ee4f5f0daf97c154a2b53a36eb1d","blockSize":4194304,"blocks":["50737429ebda6880ac98a0ac439001962f64ee4f5f0daf97c154a2b53a36eb1d"]}},"http.d.ts":{"size":3295,"offset":"6035491","integrity":{"algorithm":"SHA256","hash":"cd666bc4fe58c7619544e8170a1e9c47741fd98fe566655feeafa4a080ea453a","blockSize":4194304,"blocks":["cd666bc4fe58c7619544e8170a1e9c47741fd98fe566655feeafa4a080ea453a"]}},"http.d.ts.map":{"size":1286,"offset":"6038786","integrity":{"algorithm":"SHA256","hash":"701f552269d8da973e95960a2aa39f91b8fc6311fcb863b924b3e5e4ed114122","blockSize":4194304,"blocks":["701f552269d8da973e95960a2aa39f91b8fc6311fcb863b924b3e5e4ed114122"]}}}}}},"module.d.ts":{"size":201,"offset":"6040072","integrity":{"algorithm":"SHA256","hash":"41a387aa190accc6a6a6cb6c525d0e8edfae079ac8d9e04b6cffaa2a3977fa06","blockSize":4194304,"blocks":["41a387aa190accc6a6a6cb6c525d0e8edfae079ac8d9e04b6cffaa2a3977fa06"]}},"module.d.ts.map":{"size":221,"offset":"6040273","integrity":{"algorithm":"SHA256","hash":"9e2f2cfaa48876925bc03bb7f0a9664b052bf0093979763b8defc35b173a8190","blockSize":4194304,"blocks":["9e2f2cfaa48876925bc03bb7f0a9664b052bf0093979763b8defc35b173a8190"]}},"nodeVersion.d.ts":{"size":153,"offset":"6040494","integrity":{"algorithm":"SHA256","hash":"e7b746c85e8e85b5db421f64f30def20565746bb0c665397e86ae9d7b789dd2f","blockSize":4194304,"blocks":["e7b746c85e8e85b5db421f64f30def20565746bb0c665397e86ae9d7b789dd2f"]}},"nodeVersion.d.ts.map":{"size":215,"offset":"6040647","integrity":{"algorithm":"SHA256","hash":"299a2dc30c19e33f9a6e81133edd0ac9994bc9ba18c0b7b8cba005c46735447f","blockSize":4194304,"blocks":["299a2dc30c19e33f9a6e81133edd0ac9994bc9ba18c0b7b8cba005c46735447f"]}},"requestdata.d.ts":{"size":2851,"offset":"6040862","integrity":{"algorithm":"SHA256","hash":"d9907fd631dfb5dc500670d12c9b4b66dc903b4d20a34c27f9663952786685dd","blockSize":4194304,"blocks":["d9907fd631dfb5dc500670d12c9b4b66dc903b4d20a34c27f9663952786685dd"]}},"requestdata.d.ts.map":{"size":1252,"offset":"6043713","integrity":{"algorithm":"SHA256","hash":"2e061ee6b66c78ca45acf684cb099eb22c33ec4312af3b3d8756780eee661076","blockSize":4194304,"blocks":["2e061ee6b66c78ca45acf684cb099eb22c33ec4312af3b3d8756780eee661076"]}},"requestDataDeprecated.d.ts":{"size":1939,"offset":"6044965","integrity":{"algorithm":"SHA256","hash":"23c5c984821e4710bbb41742ea570b2d5d8c9420b652aaaf7084c6089db575dd","blockSize":4194304,"blocks":["23c5c984821e4710bbb41742ea570b2d5d8c9420b652aaaf7084c6089db575dd"]}},"requestDataDeprecated.d.ts.map":{"size":708,"offset":"6046904","integrity":{"algorithm":"SHA256","hash":"3871f8e7e95f127d7f28ba47abe394504b3779adc4cdeb1b5804d93b3a90e869","blockSize":4194304,"blocks":["3871f8e7e95f127d7f28ba47abe394504b3779adc4cdeb1b5804d93b3a90e869"]}},"sdk.d.ts":{"size":3477,"offset":"6047612","integrity":{"algorithm":"SHA256","hash":"2fa39f34c4f3c0b9bbda53e4b013b850b76b1e1b4a3411b36c699cb040d304b6","blockSize":4194304,"blocks":["2fa39f34c4f3c0b9bbda53e4b013b850b76b1e1b4a3411b36c699cb040d304b6"]}},"sdk.d.ts.map":{"size":1022,"offset":"6051089","integrity":{"algorithm":"SHA256","hash":"58bbe9aae31b92420f916624093dfd8a407756981391e295b6734964b0be37eb","blockSize":4194304,"blocks":["58bbe9aae31b92420f916624093dfd8a407756981391e295b6734964b0be37eb"]}},"tracing":{"files":{"index.d.ts":{"size":274,"offset":"6052111","integrity":{"algorithm":"SHA256","hash":"54be00341294331f760cd743d632d70745a4c4fe5d8688eaf826d73411ff18f0","blockSize":4194304,"blocks":["54be00341294331f760cd743d632d70745a4c4fe5d8688eaf826d73411ff18f0"]}},"index.d.ts.map":{"size":215,"offset":"6052385","integrity":{"algorithm":"SHA256","hash":"00b79958f49504d8aa76d15eef0bcade9f903ee9bfe6710e2e00b2ffd83ec34a","blockSize":4194304,"blocks":["00b79958f49504d8aa76d15eef0bcade9f903ee9bfe6710e2e00b2ffd83ec34a"]}},"integrations.d.ts":{"size":143,"offset":"6052600","integrity":{"algorithm":"SHA256","hash":"eaccd042ca1aa5e13396e5672dc6e50f970e913c3ad0149e2589567f2e08b85b","blockSize":4194304,"blocks":["eaccd042ca1aa5e13396e5672dc6e50f970e913c3ad0149e2589567f2e08b85b"]}},"integrations.d.ts.map":{"size":233,"offset":"6052743","integrity":{"algorithm":"SHA256","hash":"059b1b66e18fb30d5329fad9ab62529524260af46bce4640a4cc810d0c8028c8","blockSize":4194304,"blocks":["059b1b66e18fb30d5329fad9ab62529524260af46bce4640a4cc810d0c8028c8"]}}}},"transports":{"files":{"http-module.d.ts":{"size":1133,"offset":"6052976","integrity":{"algorithm":"SHA256","hash":"f22a043b069ca63caa475a91432a158b4139d9e7ff2ece9729170b6fd270eeff","blockSize":4194304,"blocks":["f22a043b069ca63caa475a91432a158b4139d9e7ff2ece9729170b6fd270eeff"]}},"http-module.d.ts.map":{"size":798,"offset":"6054109","integrity":{"algorithm":"SHA256","hash":"32983e6e01da275a8f226452931a23ef341122593805f7526e75fba665917969","blockSize":4194304,"blocks":["32983e6e01da275a8f226452931a23ef341122593805f7526e75fba665917969"]}},"http.d.ts":{"size":908,"offset":"6054907","integrity":{"algorithm":"SHA256","hash":"9b8fbdad2046a96a6fc1ffa7965d4a1683ef41a911a3e9726a8b93cf6ff96c5a","blockSize":4194304,"blocks":["9b8fbdad2046a96a6fc1ffa7965d4a1683ef41a911a3e9726a8b93cf6ff96c5a"]}},"http.d.ts.map":{"size":623,"offset":"6055815","integrity":{"algorithm":"SHA256","hash":"dfc9cbd3ff22bc58748fc897445c0306366a2d3e282947db7305f12da10fb8bb","blockSize":4194304,"blocks":["dfc9cbd3ff22bc58748fc897445c0306366a2d3e282947db7305f12da10fb8bb"]}},"index.d.ts":{"size":131,"offset":"6056438","integrity":{"algorithm":"SHA256","hash":"35a7f26aecd70e63de8f0fb73c987948528f219efe77f86a4809835624cb985e","blockSize":4194304,"blocks":["35a7f26aecd70e63de8f0fb73c987948528f219efe77f86a4809835624cb985e"]}},"index.d.ts.map":{"size":205,"offset":"6056569","integrity":{"algorithm":"SHA256","hash":"507023cbce1f766e276253998c4223fd57b0ba22a52a59d00a15795798c53920","blockSize":4194304,"blocks":["507023cbce1f766e276253998c4223fd57b0ba22a52a59d00a15795798c53920"]}}}},"types.d.ts":{"size":2881,"offset":"6056774","integrity":{"algorithm":"SHA256","hash":"4a035d98c15e1449ea8a4143ff64ffb829422cb9d6ad59340bd089ae2e817807","blockSize":4194304,"blocks":["4a035d98c15e1449ea8a4143ff64ffb829422cb9d6ad59340bd089ae2e817807"]}},"types.d.ts.map":{"size":868,"offset":"6059655","integrity":{"algorithm":"SHA256","hash":"f86dd28bb50add3bd4230532ed2b99bb03356b1b18e7545f43a1a350067e9c54","blockSize":4194304,"blocks":["f86dd28bb50add3bd4230532ed2b99bb03356b1b18e7545f43a1a350067e9c54"]}},"utils.d.ts":{"size":340,"offset":"6060523","integrity":{"algorithm":"SHA256","hash":"3ca17eee6a8cd027a16749f9d7c16de98ce822a8449050b37457a20d33633636","blockSize":4194304,"blocks":["3ca17eee6a8cd027a16749f9d7c16de98ce822a8449050b37457a20d33633636"]}},"utils.d.ts.map":{"size":180,"offset":"6060863","integrity":{"algorithm":"SHA256","hash":"6be0a57ed2d16fd806ed2e6478562f9bb84d855e7d4a7c2aafd0c5b4a50e8394","blockSize":4194304,"blocks":["6be0a57ed2d16fd806ed2e6478562f9bb84d855e7d4a7c2aafd0c5b4a50e8394"]}}}}}},"replay":{"files":{"cjs":{"files":{"index.js":{"size":271220,"offset":"6061043","integrity":{"algorithm":"SHA256","hash":"3f47086bfd69def3b22df3220cc0c514df492a005661f627c2c42e9338c0c6d6","blockSize":4194304,"blocks":["3f47086bfd69def3b22df3220cc0c514df492a005661f627c2c42e9338c0c6d6"]}},"index.js.map":{"size":599229,"offset":"6332263","integrity":{"algorithm":"SHA256","hash":"6be6d23b4f3962aada8cc79a28d76263b69ab10ea90b581a224b1158bf151ee2","blockSize":4194304,"blocks":["6be6d23b4f3962aada8cc79a28d76263b69ab10ea90b581a224b1158bf151ee2"]}}}},"esm":{"files":{"index.js":{"size":271154,"offset":"6931492","integrity":{"algorithm":"SHA256","hash":"5d22991dfdc880d52c5094345fab1d287271e4b9e23745725fdb438759e1bdbc","blockSize":4194304,"blocks":["5d22991dfdc880d52c5094345fab1d287271e4b9e23745725fdb438759e1bdbc"]}},"index.js.map":{"size":598794,"offset":"7202646","integrity":{"algorithm":"SHA256","hash":"135a8988152994e8e3e738420a15bc8cc2c1935f5fd0fd6ef86a83c8cd1cfbe5","blockSize":4194304,"blocks":["135a8988152994e8e3e738420a15bc8cc2c1935f5fd0fd6ef86a83c8cd1cfbe5"]}}}},"LICENSE":{"size":1120,"offset":"7801440","integrity":{"algorithm":"SHA256","hash":"b166344c68a262ca29ea33a284a7881ae20383ce4ed171731fd01cee8cb408cb","blockSize":4194304,"blocks":["b166344c68a262ca29ea33a284a7881ae20383ce4ed171731fd01cee8cb408cb"]}},"package.json":{"size":923,"offset":"7802560","integrity":{"algorithm":"SHA256","hash":"34cb399ccc01192639d41db60392a71dbdc2a616a428761188cd8b399450f989","blockSize":4194304,"blocks":["34cb399ccc01192639d41db60392a71dbdc2a616a428761188cd8b399450f989"]}},"README.md":{"size":15744,"offset":"7803483","integrity":{"algorithm":"SHA256","hash":"d30452d864382c8b2d27fac6422b6d2e74be0edfdae79ca64b2cfc95cb0efd00","blockSize":4194304,"blocks":["d30452d864382c8b2d27fac6422b6d2e74be0edfdae79ca64b2cfc95cb0efd00"]}},"types":{"files":{"constants.d.ts":{"size":803,"offset":"7819227","integrity":{"algorithm":"SHA256","hash":"18a81ee07af946c61bd0d0bdc56a7f8c2199212c2198265e298c169c3a7e8494","blockSize":4194304,"blocks":["18a81ee07af946c61bd0d0bdc56a7f8c2199212c2198265e298c169c3a7e8494"]}},"constants.d.ts.map":{"size":564,"offset":"7820030","integrity":{"algorithm":"SHA256","hash":"9b989a7c57891146a33c0dd33b1cab89f1286eb73780309b4737f475605441f3","blockSize":4194304,"blocks":["9b989a7c57891146a33c0dd33b1cab89f1286eb73780309b4737f475605441f3"]}},"coreHandlers":{"files":{"handleAfterSendEvent.d.ts":{"size":482,"offset":"7820594","integrity":{"algorithm":"SHA256","hash":"6af6b2ad47f05d84e3891e9f3814b6b92304c069e411c24a702e091b61ed8eae","blockSize":4194304,"blocks":["6af6b2ad47f05d84e3891e9f3814b6b92304c069e411c24a702e091b61ed8eae"]}},"handleAfterSendEvent.d.ts.map":{"size":418,"offset":"7821076","integrity":{"algorithm":"SHA256","hash":"b7dc84a246722b8e89a7bfa65d08d0327a9a7e3636d34126515480c026143191","blockSize":4194304,"blocks":["b7dc84a246722b8e89a7bfa65d08d0327a9a7e3636d34126515480c026143191"]}},"handleDom.d.ts":{"size":303,"offset":"7821494","integrity":{"algorithm":"SHA256","hash":"79f7f8d1813c0bf815e4bb340244dd6357a52850e0ad817ff69bf5c8beb96e37","blockSize":4194304,"blocks":["79f7f8d1813c0bf815e4bb340244dd6357a52850e0ad817ff69bf5c8beb96e37"]}},"handleDom.d.ts.map":{"size":374,"offset":"7821797","integrity":{"algorithm":"SHA256","hash":"343a472056ed760e3875f9c70810d04f449c8fca07308bf457099fd993093255","blockSize":4194304,"blocks":["343a472056ed760e3875f9c70810d04f449c8fca07308bf457099fd993093255"]}},"handleFetch.d.ts":{"size":547,"offset":"7822171","integrity":{"algorithm":"SHA256","hash":"6182d6222eda0012c73a2b48d4c34dd1f7c813a8bf65241485936e206ac0d37c","blockSize":4194304,"blocks":["6182d6222eda0012c73a2b48d4c34dd1f7c813a8bf65241485936e206ac0d37c"]}},"handleFetch.d.ts.map":{"size":446,"offset":"7822718","integrity":{"algorithm":"SHA256","hash":"7327cd362b0e77cee3c081b3132b4b6821b90e7f0a182a22223dd8542b544920","blockSize":4194304,"blocks":["7327cd362b0e77cee3c081b3132b4b6821b90e7f0a182a22223dd8542b544920"]}},"handleGlobalEvent.d.ts":{"size":399,"offset":"7823164","integrity":{"algorithm":"SHA256","hash":"f61196fd365bf9ec1a226878b9091856c5a969fd33bfbe7361ee0893319e17e3","blockSize":4194304,"blocks":["f61196fd365bf9ec1a226878b9091856c5a969fd33bfbe7361ee0893319e17e3"]}},"handleGlobalEvent.d.ts.map":{"size":393,"offset":"7823563","integrity":{"algorithm":"SHA256","hash":"e6e73bd64fc2aef5a3d832d8d8678a9e72945a83946a2e04899b898b6c4205e2","blockSize":4194304,"blocks":["e6e73bd64fc2aef5a3d832d8d8678a9e72945a83946a2e04899b898b6c4205e2"]}},"handleHistory.d.ts":{"size":384,"offset":"7823956","integrity":{"algorithm":"SHA256","hash":"a4e6605639d7af38c8e1b485c3bcdd3d0b248188a2104badcb9ef365bfe4885c","blockSize":4194304,"blocks":["a4e6605639d7af38c8e1b485c3bcdd3d0b248188a2104badcb9ef365bfe4885c"]}},"handleHistory.d.ts.map":{"size":356,"offset":"7824340","integrity":{"algorithm":"SHA256","hash":"66686b397b3d66b3f98e15533e8bd7108636593759cc65a424fd2b0b8efc0895","blockSize":4194304,"blocks":["66686b397b3d66b3f98e15533e8bd7108636593759cc65a424fd2b0b8efc0895"]}},"handleNetworkBreadcrumbs.d.ts":{"size":892,"offset":"7824696","integrity":{"algorithm":"SHA256","hash":"7ccef38f6f652dcf6a99f3cc8c41f1a770eb906858c11546026587a30311634b","blockSize":4194304,"blocks":["7ccef38f6f652dcf6a99f3cc8c41f1a770eb906858c11546026587a30311634b"]}},"handleNetworkBreadcrumbs.d.ts.map":{"size":568,"offset":"7825588","integrity":{"algorithm":"SHA256","hash":"c6a61cb855081962693e9ea4b647409625775547bca29452e388a43eb9130418","blockSize":4194304,"blocks":["c6a61cb855081962693e9ea4b647409625775547bca29452e388a43eb9130418"]}},"handleScope.d.ts":{"size":364,"offset":"7826156","integrity":{"algorithm":"SHA256","hash":"08977865bae06f7c1b42a130fea9d0ef10340a7cc71268bc8d1901435b88f934","blockSize":4194304,"blocks":["08977865bae06f7c1b42a130fea9d0ef10340a7cc71268bc8d1901435b88f934"]}},"handleScope.d.ts.map":{"size":402,"offset":"7826520","integrity":{"algorithm":"SHA256","hash":"6385bd2cfa2a94bbf95f38115c018bbcd26186adf517752aaeb510a65ccc5b64","blockSize":4194304,"blocks":["6385bd2cfa2a94bbf95f38115c018bbcd26186adf517752aaeb510a65ccc5b64"]}},"handleXhr.d.ts":{"size":533,"offset":"7826922","integrity":{"algorithm":"SHA256","hash":"bea87a4f6e7aed0a7f829804ee9b5abf859ea2a34ae912b656e291ba3fe4f6ae","blockSize":4194304,"blocks":["bea87a4f6e7aed0a7f829804ee9b5abf859ea2a34ae912b656e291ba3fe4f6ae"]}},"handleXhr.d.ts.map":{"size":436,"offset":"7827455","integrity":{"algorithm":"SHA256","hash":"00d9c4cd85c89b7c2c73dc1f5fb5a86fbb2271d5a964dcce1d8e0b056f723dbe","blockSize":4194304,"blocks":["00d9c4cd85c89b7c2c73dc1f5fb5a86fbb2271d5a964dcce1d8e0b056f723dbe"]}},"performanceObserver.d.ts":{"size":277,"offset":"7827891","integrity":{"algorithm":"SHA256","hash":"b1cfd0e4b8603db72471c37d911c00e49c8140cd14a9a019e92e16fe5d099e85","blockSize":4194304,"blocks":["b1cfd0e4b8603db72471c37d911c00e49c8140cd14a9a019e92e16fe5d099e85"]}},"performanceObserver.d.ts.map":{"size":269,"offset":"7828168","integrity":{"algorithm":"SHA256","hash":"cae6fc0bee355aa4fb817500b0b4e371dacfa00abe21d7cd077adc06dae8b734","blockSize":4194304,"blocks":["cae6fc0bee355aa4fb817500b0b4e371dacfa00abe21d7cd077adc06dae8b734"]}},"util":{"files":{"addBreadcrumbEvent.d.ts":{"size":293,"offset":"7828437","integrity":{"algorithm":"SHA256","hash":"60de2996909a7d9c1255d604255fa0c7b55321280d14c6fe9a01150214e5580f","blockSize":4194304,"blocks":["60de2996909a7d9c1255d604255fa0c7b55321280d14c6fe9a01150214e5580f"]}},"addBreadcrumbEvent.d.ts.map":{"size":338,"offset":"7828730","integrity":{"algorithm":"SHA256","hash":"902389fca330d2f5226042c19596e53bbd91aabf5ad92e9323640308930a1885","blockSize":4194304,"blocks":["902389fca330d2f5226042c19596e53bbd91aabf5ad92e9323640308930a1885"]}},"addNetworkBreadcrumb.d.ts":{"size":324,"offset":"7829068","integrity":{"algorithm":"SHA256","hash":"7ca9d33274e9144e1934001524af989aefad87657320b93ea9c2526fb836e78e","blockSize":4194304,"blocks":["7ca9d33274e9144e1934001524af989aefad87657320b93ea9c2526fb836e78e"]}},"addNetworkBreadcrumb.d.ts.map":{"size":353,"offset":"7829392","integrity":{"algorithm":"SHA256","hash":"7072b1e5fc388c572d278fa758ab3e84a8f3d52a13c96e3269098bdf57db9072","blockSize":4194304,"blocks":["7072b1e5fc388c572d278fa758ab3e84a8f3d52a13c96e3269098bdf57db9072"]}},"fetchUtils.d.ts":{"size":922,"offset":"7829745","integrity":{"algorithm":"SHA256","hash":"bcb2fb00cf5c3bd3ded1caec76fe989331794280fbc8d688d2ff7978c21bd043","blockSize":4194304,"blocks":["bcb2fb00cf5c3bd3ded1caec76fe989331794280fbc8d688d2ff7978c21bd043"]}},"fetchUtils.d.ts.map":{"size":683,"offset":"7830667","integrity":{"algorithm":"SHA256","hash":"f3ae5a3725dfe23751c6631078e84a5656121d9b6cee07044cc12aae2dc39876","blockSize":4194304,"blocks":["f3ae5a3725dfe23751c6631078e84a5656121d9b6cee07044cc12aae2dc39876"]}},"getAttributesToRecord.d.ts":{"size":244,"offset":"7831350","integrity":{"algorithm":"SHA256","hash":"6fdfe47e84e29d62a9ad250e3fda7a74b2cb6ce887b62265f9d409704f3ab83c","blockSize":4194304,"blocks":["6fdfe47e84e29d62a9ad250e3fda7a74b2cb6ce887b62265f9d409704f3ab83c"]}},"getAttributesToRecord.d.ts.map":{"size":281,"offset":"7831594","integrity":{"algorithm":"SHA256","hash":"2633004bcc73bcfb5e17edcbdfa1d364e2eff6b5697dbd089692ac578b4138d9","blockSize":4194304,"blocks":["2633004bcc73bcfb5e17edcbdfa1d364e2eff6b5697dbd089692ac578b4138d9"]}},"networkUtils.d.ts":{"size":1505,"offset":"7831875","integrity":{"algorithm":"SHA256","hash":"fd641b10b61e668c72a624318176f964f47724f6b489d82655c326ad9d808629","blockSize":4194304,"blocks":["fd641b10b61e668c72a624318176f964f47724f6b489d82655c326ad9d808629"]}},"networkUtils.d.ts.map":{"size":1125,"offset":"7833380","integrity":{"algorithm":"SHA256","hash":"19602cda7c67b909935646674274a04d6d0b0e5ea7a48c9ff6237bf0610868ba","blockSize":4194304,"blocks":["19602cda7c67b909935646674274a04d6d0b0e5ea7a48c9ff6237bf0610868ba"]}},"xhrUtils.d.ts":{"size":865,"offset":"7834505","integrity":{"algorithm":"SHA256","hash":"803d1ad1da3ff6ac7e60968fdec5b716e8e83538cd02075a7a6a63efe6f752c0","blockSize":4194304,"blocks":["803d1ad1da3ff6ac7e60968fdec5b716e8e83538cd02075a7a6a63efe6f752c0"]}},"xhrUtils.d.ts.map":{"size":650,"offset":"7835370","integrity":{"algorithm":"SHA256","hash":"293d632bb76bc384ddb0f8f9c975afd78d7031184e2eccefbe70c010f31c725c","blockSize":4194304,"blocks":["293d632bb76bc384ddb0f8f9c975afd78d7031184e2eccefbe70c010f31c725c"]}}}}}},"eventBuffer":{"files":{"EventBufferArray.d.ts":{"size":696,"offset":"7836020","integrity":{"algorithm":"SHA256","hash":"a8d776e1340b1e3f2be90cc7296af78075ef063a23c515a3119c3c674809b170","blockSize":4194304,"blocks":["a8d776e1340b1e3f2be90cc7296af78075ef063a23c515a3119c3c674809b170"]}},"EventBufferArray.d.ts.map":{"size":521,"offset":"7836716","integrity":{"algorithm":"SHA256","hash":"bc7c2720380a414e94321d04158f756be39d1c5e3c94ca5b78fce79e2af72590","blockSize":4194304,"blocks":["bc7c2720380a414e94321d04158f756be39d1c5e3c94ca5b78fce79e2af72590"]}},"EventBufferCompressionWorker.d.ts":{"size":1347,"offset":"7837237","integrity":{"algorithm":"SHA256","hash":"8403ad469bc402679a6518638c9abf0a21b6a84161b236e477ed65a9b91422ea","blockSize":4194304,"blocks":["8403ad469bc402679a6518638c9abf0a21b6a84161b236e477ed65a9b91422ea"]}},"EventBufferCompressionWorker.d.ts.map":{"size":728,"offset":"7838584","integrity":{"algorithm":"SHA256","hash":"b37740f5f776fb4d4bd853efcd0ebda257f503e633bcacfb6d6d7caf34e8023f","blockSize":4194304,"blocks":["b37740f5f776fb4d4bd853efcd0ebda257f503e633bcacfb6d6d7caf34e8023f"]}},"EventBufferProxy.d.ts":{"size":1244,"offset":"7839312","integrity":{"algorithm":"SHA256","hash":"409cb94beb38467a1f165df339a7ce6d33e64a3db418f04324f80b8ed0b0d839","blockSize":4194304,"blocks":["409cb94beb38467a1f165df339a7ce6d33e64a3db418f04324f80b8ed0b0d839"]}},"EventBufferProxy.d.ts.map":{"size":763,"offset":"7840556","integrity":{"algorithm":"SHA256","hash":"5d3b27cfbd6a6afc547ed884dad346e05a3c1a60338c83351bddae650855d58e","blockSize":4194304,"blocks":["5d3b27cfbd6a6afc547ed884dad346e05a3c1a60338c83351bddae650855d58e"]}},"index.d.ts":{"size":306,"offset":"7841319","integrity":{"algorithm":"SHA256","hash":"322d69ebc191dac17d920d5070b47f21bc02cf397602c35395937514f893580d","blockSize":4194304,"blocks":["322d69ebc191dac17d920d5070b47f21bc02cf397602c35395937514f893580d"]}},"index.d.ts.map":{"size":298,"offset":"7841625","integrity":{"algorithm":"SHA256","hash":"c6db42f4fe790da5f7cc1150837c3db571dd83363aade9ed7ea41b5c4044188a","blockSize":4194304,"blocks":["c6db42f4fe790da5f7cc1150837c3db571dd83363aade9ed7ea41b5c4044188a"]}},"WorkerHandler.d.ts":{"size":863,"offset":"7841923","integrity":{"algorithm":"SHA256","hash":"56423c8d2575a53809e57c254d7e0daeeab2104efee57510816e0e4449d13110","blockSize":4194304,"blocks":["56423c8d2575a53809e57c254d7e0daeeab2104efee57510816e0e4449d13110"]}},"WorkerHandler.d.ts.map":{"size":579,"offset":"7842786","integrity":{"algorithm":"SHA256","hash":"0cf5d20b47a34475c653e074b746ea75eb4be8d69b0bfdba5207d3138df43a4f","blockSize":4194304,"blocks":["0cf5d20b47a34475c653e074b746ea75eb4be8d69b0bfdba5207d3138df43a4f"]}}}},"index.d.ts":{"size":75,"offset":"7843365","integrity":{"algorithm":"SHA256","hash":"7c1e9c9d632e9490145c15966f188e38a33a59a927e4a84f3c5518094df59c37","blockSize":4194304,"blocks":["7c1e9c9d632e9490145c15966f188e38a33a59a927e4a84f3c5518094df59c37"]}},"index.d.ts.map":{"size":149,"offset":"7843440","integrity":{"algorithm":"SHA256","hash":"9a99d87c78f9b1d0ead59cdc56551b7e304eb3ab90731b480a73ebf498a17407","blockSize":4194304,"blocks":["9a99d87c78f9b1d0ead59cdc56551b7e304eb3ab90731b480a73ebf498a17407"]}},"integration.d.ts":{"size":2571,"offset":"7843589","integrity":{"algorithm":"SHA256","hash":"ca932e73a6fe029cd2ac4c2e5609ff6bb53991f950e46ebbc2b6d809dc6a3980","blockSize":4194304,"blocks":["ca932e73a6fe029cd2ac4c2e5609ff6bb53991f950e46ebbc2b6d809dc6a3980"]}},"integration.d.ts.map":{"size":1091,"offset":"7846160","integrity":{"algorithm":"SHA256","hash":"96a911fb77b5d6a16b46027c192858d0ee5d4fae97a5f7b274652c6b553a00f1","blockSize":4194304,"blocks":["96a911fb77b5d6a16b46027c192858d0ee5d4fae97a5f7b274652c6b553a00f1"]}},"replay.d.ts":{"size":8181,"offset":"7847251","integrity":{"algorithm":"SHA256","hash":"5f64b776960e60f0257e3767c6786aae35fe8568ee34ca399c74e9e7f65735d1","blockSize":4194304,"blocks":["5f64b776960e60f0257e3767c6786aae35fe8568ee34ca399c74e9e7f65735d1"]}},"replay.d.ts.map":{"size":2540,"offset":"7855432","integrity":{"algorithm":"SHA256","hash":"b7a1f001498600b86d3428d0a8fdec1f0d280d1cae9d3b25354a4456ad2136c5","blockSize":4194304,"blocks":["b7a1f001498600b86d3428d0a8fdec1f0d280d1cae9d3b25354a4456ad2136c5"]}},"session":{"files":{"createSession.d.ts":{"size":437,"offset":"7857972","integrity":{"algorithm":"SHA256","hash":"e66bbce0c77db32767d5e838431fdc05a693c10aba91f75fbb6836716eb2a8e5","blockSize":4194304,"blocks":["e66bbce0c77db32767d5e838431fdc05a693c10aba91f75fbb6836716eb2a8e5"]}},"createSession.d.ts.map":{"size":291,"offset":"7858409","integrity":{"algorithm":"SHA256","hash":"64828c64476fa452e5aa76985173795913a11876637ebb3864d2f2ec194e4552","blockSize":4194304,"blocks":["64828c64476fa452e5aa76985173795913a11876637ebb3864d2f2ec194e4552"]}},"fetchSession.d.ts":{"size":181,"offset":"7858700","integrity":{"algorithm":"SHA256","hash":"9d92da7298f6785ff38d3db6b7bbb0f3e993f806885f0fffc1122fed8bf72457","blockSize":4194304,"blocks":["9d92da7298f6785ff38d3db6b7bbb0f3e993f806885f0fffc1122fed8bf72457"]}},"fetchSession.d.ts.map":{"size":235,"offset":"7858881","integrity":{"algorithm":"SHA256","hash":"45c93aade86f7ed68a65587759e91ab75b0e3331554a9eedb826eeb851777125","blockSize":4194304,"blocks":["45c93aade86f7ed68a65587759e91ab75b0e3331554a9eedb826eeb851777125"]}},"getSession.d.ts":{"size":525,"offset":"7859116","integrity":{"algorithm":"SHA256","hash":"34eb87d5d8bd599cb23b5c9ac8a53589c912cda036bb5af4a8e9571c481f272e","blockSize":4194304,"blocks":["34eb87d5d8bd599cb23b5c9ac8a53589c912cda036bb5af4a8e9571c481f272e"]}},"getSession.d.ts.map":{"size":479,"offset":"7859641","integrity":{"algorithm":"SHA256","hash":"caeed7601edb14b5d2a1ff88d745dc067bf26797d202c8292cd298a9a0d85b39","blockSize":4194304,"blocks":["caeed7601edb14b5d2a1ff88d745dc067bf26797d202c8292cd298a9a0d85b39"]}},"index.d.ts":{"size":68,"offset":"7860120","integrity":{"algorithm":"SHA256","hash":"aa8a75b96eb6ca63754614eae68cfce90b32aea91aaf0a225386e93e3739f9d9","blockSize":4194304,"blocks":["aa8a75b96eb6ca63754614eae68cfce90b32aea91aaf0a225386e93e3739f9d9"]}},"index.d.ts.map":{"size":142,"offset":"7860188","integrity":{"algorithm":"SHA256","hash":"03df57c713da689a6c092a5c0a8cbffa8e924d043e29c9584d1c33f1ed862194","blockSize":4194304,"blocks":["03df57c713da689a6c092a5c0a8cbffa8e924d043e29c9584d1c33f1ed862194"]}},"saveSession.d.ts":{"size":189,"offset":"7860330","integrity":{"algorithm":"SHA256","hash":"990b56641817e8a804b7c0762f1ad5ac1cbbb77dbec0713ebb8530b3e49158ba","blockSize":4194304,"blocks":["990b56641817e8a804b7c0762f1ad5ac1cbbb77dbec0713ebb8530b3e49158ba"]}},"saveSession.d.ts.map":{"size":242,"offset":"7860519","integrity":{"algorithm":"SHA256","hash":"a24a913013fe3182adf2af1180419811c566dbe7ed3402061f0ba40f01141535","blockSize":4194304,"blocks":["a24a913013fe3182adf2af1180419811c566dbe7ed3402061f0ba40f01141535"]}},"Session.d.ts":{"size":450,"offset":"7860761","integrity":{"algorithm":"SHA256","hash":"b67befc42158ae4487929bcbd8ddf527b94504b699d97ce66acfcde471627a90","blockSize":4194304,"blocks":["b67befc42158ae4487929bcbd8ddf527b94504b699d97ce66acfcde471627a90"]}},"Session.d.ts.map":{"size":383,"offset":"7861211","integrity":{"algorithm":"SHA256","hash":"643be102352664f8ad042932480288942e5f8b199f5719ccbd2d4e073ce12981","blockSize":4194304,"blocks":["643be102352664f8ad042932480288942e5f8b199f5719ccbd2d4e073ce12981"]}}}},"types":{"files":{"rrweb.d.ts":{"size":1105,"offset":"7882438","integrity":{"algorithm":"SHA256","hash":"a69881bdd65cde5d4464b7baeeb55ed55934bca2aba36a7e6dbda06503445ac2","blockSize":4194304,"blocks":["a69881bdd65cde5d4464b7baeeb55ed55934bca2aba36a7e6dbda06503445ac2"]}},"rrweb.d.ts.map":{"size":841,"offset":"7883543","integrity":{"algorithm":"SHA256","hash":"66689c7b0d8916330d9afb5dbe7727a29be50dd077679456e99437d8bc046034","blockSize":4194304,"blocks":["66689c7b0d8916330d9afb5dbe7727a29be50dd077679456e99437d8bc046034"]}}}},"types.d.ts":{"size":13629,"offset":"7861594","integrity":{"algorithm":"SHA256","hash":"01721d1c7231ebc433bbc6522ca0a808349967166ac3e8b3f36b6e72db236a69","blockSize":4194304,"blocks":["01721d1c7231ebc433bbc6522ca0a808349967166ac3e8b3f36b6e72db236a69"]}},"types.d.ts.map":{"size":7215,"offset":"7875223","integrity":{"algorithm":"SHA256","hash":"b26f847d3b092f28fee9041a1c1f56c535f7d9816030f7b8dc801acaef1c1b63","blockSize":4194304,"blocks":["b26f847d3b092f28fee9041a1c1f56c535f7d9816030f7b8dc801acaef1c1b63"]}},"util":{"files":{"addEvent.d.ts":{"size":409,"offset":"7884384","integrity":{"algorithm":"SHA256","hash":"9c14760a8c53563f73026a07ac697696a4711ddcc91419cc297ee19b386d1b5f","blockSize":4194304,"blocks":["9c14760a8c53563f73026a07ac697696a4711ddcc91419cc297ee19b386d1b5f"]}},"addEvent.d.ts.map":{"size":329,"offset":"7884793","integrity":{"algorithm":"SHA256","hash":"d053252f47e7a96005835866462082a99add9488d0927637a484bf3cdac12934","blockSize":4194304,"blocks":["d053252f47e7a96005835866462082a99add9488d0927637a484bf3cdac12934"]}},"addGlobalListeners.d.ts":{"size":228,"offset":"7885122","integrity":{"algorithm":"SHA256","hash":"fe65d3c6c4bc086b0aa5961d4ae1925d930aba544dd0182e6c072a05a345fd25","blockSize":4194304,"blocks":["fe65d3c6c4bc086b0aa5961d4ae1925d930aba544dd0182e6c072a05a345fd25"]}},"addGlobalListeners.d.ts.map":{"size":256,"offset":"7885350","integrity":{"algorithm":"SHA256","hash":"88c10ad7c954d7fb8ff14d683aa336708acb700dde080b9612cd60e568265f6f","blockSize":4194304,"blocks":["88c10ad7c954d7fb8ff14d683aa336708acb700dde080b9612cd60e568265f6f"]}},"addMemoryEntry.d.ts":{"size":332,"offset":"7885606","integrity":{"algorithm":"SHA256","hash":"30c26ccc749823e0152d789be670e5a35d5b774ac7fe8dcd9f4694d2c7e5c879","blockSize":4194304,"blocks":["30c26ccc749823e0152d789be670e5a35d5b774ac7fe8dcd9f4694d2c7e5c879"]}},"addMemoryEntry.d.ts.map":{"size":297,"offset":"7885938","integrity":{"algorithm":"SHA256","hash":"507aea47479c5e4c2d53e48cf24dc956575ad33ab84e29ed50f73b8600e6d5b4","blockSize":4194304,"blocks":["507aea47479c5e4c2d53e48cf24dc956575ad33ab84e29ed50f73b8600e6d5b4"]}},"createBreadcrumb.d.ts":{"size":361,"offset":"7886235","integrity":{"algorithm":"SHA256","hash":"68e2ae4c41b4e0a6ecfebde193643cafa5e55aada10152daa47828382aeef280","blockSize":4194304,"blocks":["68e2ae4c41b4e0a6ecfebde193643cafa5e55aada10152daa47828382aeef280"]}},"createBreadcrumb.d.ts.map":{"size":374,"offset":"7886596","integrity":{"algorithm":"SHA256","hash":"1b0f3e97879f6cf124a030384597af4e414e3375b1487ba8f38401a8cefa7127","blockSize":4194304,"blocks":["1b0f3e97879f6cf124a030384597af4e414e3375b1487ba8f38401a8cefa7127"]}},"createPerformanceEntries.d.ts":{"size":372,"offset":"7886970","integrity":{"algorithm":"SHA256","hash":"0948b40473b169268cf891f959ba3294893d72ad35bda00478ec09f508d55d32","blockSize":4194304,"blocks":["0948b40473b169268cf891f959ba3294893d72ad35bda00478ec09f508d55d32"]}},"createPerformanceEntries.d.ts.map":{"size":330,"offset":"7887342","integrity":{"algorithm":"SHA256","hash":"575a0709f2117e0dec7a94e738f6d5a82f0c19a41ad964587e44ef47d1d5da66","blockSize":4194304,"blocks":["575a0709f2117e0dec7a94e738f6d5a82f0c19a41ad964587e44ef47d1d5da66"]}},"createPerformanceSpans.d.ts":{"size":412,"offset":"7887672","integrity":{"algorithm":"SHA256","hash":"6db3a7804cacdc8e88e239384bbaf68fdc9d3471849d819b3943717cc953f42b","blockSize":4194304,"blocks":["6db3a7804cacdc8e88e239384bbaf68fdc9d3471849d819b3943717cc953f42b"]}},"createPerformanceSpans.d.ts.map":{"size":371,"offset":"7888084","integrity":{"algorithm":"SHA256","hash":"e2a4cd7427b7f1dfd652f4c1a907fd88c8a91596913d7015ff372332aeb94baf","blockSize":4194304,"blocks":["e2a4cd7427b7f1dfd652f4c1a907fd88c8a91596913d7015ff372332aeb94baf"]}},"createReplayEnvelope.d.ts":{"size":438,"offset":"7888455","integrity":{"algorithm":"SHA256","hash":"c96359aba0fb089d41fe236cb6e58937e028484f37b4c39a2f694a770c153953","blockSize":4194304,"blocks":["c96359aba0fb089d41fe236cb6e58937e028484f37b4c39a2f694a770c153953"]}},"createReplayEnvelope.d.ts.map":{"size":364,"offset":"7888893","integrity":{"algorithm":"SHA256","hash":"7da1ba471de5f0b7bb036b05722d5050ae1ebf8366d3fa19ce9fa10a17d12f1b","blockSize":4194304,"blocks":["7da1ba471de5f0b7bb036b05722d5050ae1ebf8366d3fa19ce9fa10a17d12f1b"]}},"debounce.d.ts":{"size":1512,"offset":"7889257","integrity":{"algorithm":"SHA256","hash":"725353c0d723e3c0a95d7638f848fade5678e63177146ec60b4d51a92fe94970","blockSize":4194304,"blocks":["725353c0d723e3c0a95d7638f848fade5678e63177146ec60b4d51a92fe94970"]}},"debounce.d.ts.map":{"size":488,"offset":"7890769","integrity":{"algorithm":"SHA256","hash":"02978f0bde27dc54433b0752391d6e986ca9ce142e2c93ae8adb248831f63ba6","blockSize":4194304,"blocks":["02978f0bde27dc54433b0752391d6e986ca9ce142e2c93ae8adb248831f63ba6"]}},"dedupePerformanceEntries.d.ts":{"size":544,"offset":"7891257","integrity":{"algorithm":"SHA256","hash":"4ac273aaee37802b83ba6be616c3780943ee3b447fe2d371c19b7d483a09864d","blockSize":4194304,"blocks":["4ac273aaee37802b83ba6be616c3780943ee3b447fe2d371c19b7d483a09864d"]}},"dedupePerformanceEntries.d.ts.map":{"size":258,"offset":"7891801","integrity":{"algorithm":"SHA256","hash":"ddb509cb5fec36acaff25c7cbff9e41aacaeded462a63ba61850db3346ade121","blockSize":4194304,"blocks":["ddb509cb5fec36acaff25c7cbff9e41aacaeded462a63ba61850db3346ade121"]}},"eventUtils.d.ts":{"size":480,"offset":"7892059","integrity":{"algorithm":"SHA256","hash":"9392ac29e129a9d8112723f17d4b883394682af054ffa3a6e2695d4bd2647eaf","blockSize":4194304,"blocks":["9392ac29e129a9d8112723f17d4b883394682af054ffa3a6e2695d4bd2647eaf"]}},"eventUtils.d.ts.map":{"size":437,"offset":"7892539","integrity":{"algorithm":"SHA256","hash":"4891db7c525bef0b183b7a702939cfba472db80caefa73b357e057bc0c210acb","blockSize":4194304,"blocks":["4891db7c525bef0b183b7a702939cfba472db80caefa73b357e057bc0c210acb"]}},"getPrivacyOptions.d.ts":{"size":850,"offset":"7892976","integrity":{"algorithm":"SHA256","hash":"35196e1d0b9f6b2fb10b192949b47348b2e72257256c9375e7e61eab21ef6b76","blockSize":4194304,"blocks":["35196e1d0b9f6b2fb10b192949b47348b2e72257256c9375e7e61eab21ef6b76"]}},"getPrivacyOptions.d.ts.map":{"size":767,"offset":"7893826","integrity":{"algorithm":"SHA256","hash":"9d5e53a7617fb63923c60c91e0478138491cbf5bc4de21726447836a47c36fbc","blockSize":4194304,"blocks":["9d5e53a7617fb63923c60c91e0478138491cbf5bc4de21726447836a47c36fbc"]}},"handleRecordingEmit.d.ts":{"size":446,"offset":"7894593","integrity":{"algorithm":"SHA256","hash":"2d9044d66ef842a2e4c3a73d369a0980a4cc7b10445c4fbf00183fe952e52ead","blockSize":4194304,"blocks":["2d9044d66ef842a2e4c3a73d369a0980a4cc7b10445c4fbf00183fe952e52ead"]}},"handleRecordingEmit.d.ts.map":{"size":355,"offset":"7895039","integrity":{"algorithm":"SHA256","hash":"a9d8e1a8fcf12f28481f5bfc670e33838e6516a3cd1aa23dc5a004e3dc95b95b","blockSize":4194304,"blocks":["a9d8e1a8fcf12f28481f5bfc670e33838e6516a3cd1aa23dc5a004e3dc95b95b"]}},"isBrowser.d.ts":{"size":135,"offset":"7895394","integrity":{"algorithm":"SHA256","hash":"9f4f476b519b5ae4a3e4bdb63626c110e08fb92bc237824c3f60194b5d9efb90","blockSize":4194304,"blocks":["9f4f476b519b5ae4a3e4bdb63626c110e08fb92bc237824c3f60194b5d9efb90"]}},"isBrowser.d.ts.map":{"size":169,"offset":"7895529","integrity":{"algorithm":"SHA256","hash":"48fa17e89980a7f8ce315e82730d3141918b95edfaad107d4f87faebbee6b886","blockSize":4194304,"blocks":["48fa17e89980a7f8ce315e82730d3141918b95edfaad107d4f87faebbee6b886"]}},"isExpired.d.ts":{"size":288,"offset":"7895698","integrity":{"algorithm":"SHA256","hash":"cb555c3742aa6b4bdaee6d51995f3b255bc2a2143d384811938206a7a1779a46","blockSize":4194304,"blocks":["cb555c3742aa6b4bdaee6d51995f3b255bc2a2143d384811938206a7a1779a46"]}},"isExpired.d.ts.map":{"size":254,"offset":"7895986","integrity":{"algorithm":"SHA256","hash":"4b691f756c3e3797bb2c7e05f266a3e9bd6b7b3a7b5db0efde7b6b93c62d5ada","blockSize":4194304,"blocks":["4b691f756c3e3797bb2c7e05f266a3e9bd6b7b3a7b5db0efde7b6b93c62d5ada"]}},"isRrwebError.d.ts":{"size":268,"offset":"7896240","integrity":{"algorithm":"SHA256","hash":"a1f614c9b0aa9b77de0f3395cc23a5fc309bd04e528b3f3b75a22ce186f027b5","blockSize":4194304,"blocks":["a1f614c9b0aa9b77de0f3395cc23a5fc309bd04e528b3f3b75a22ce186f027b5"]}},"isRrwebError.d.ts.map":{"size":272,"offset":"7896508","integrity":{"algorithm":"SHA256","hash":"4d0cbf2a811781f2be71a4f1bf48947db5de8c04f460247892ff8028e6094958","blockSize":4194304,"blocks":["4d0cbf2a811781f2be71a4f1bf48947db5de8c04f460247892ff8028e6094958"]}},"isSampled.d.ts":{"size":225,"offset":"7896780","integrity":{"algorithm":"SHA256","hash":"bc5ae691c1e181fcbef7eecb559828453bf9ae0204c45cea78c5170190a6a2b8","blockSize":4194304,"blocks":["bc5ae691c1e181fcbef7eecb559828453bf9ae0204c45cea78c5170190a6a2b8"]}},"isSampled.d.ts.map":{"size":197,"offset":"7897005","integrity":{"algorithm":"SHA256","hash":"d224aa89f1872f31046e797d3ebf22011021e5bf1b68d40ba5d65777bc713b46","blockSize":4194304,"blocks":["d224aa89f1872f31046e797d3ebf22011021e5bf1b68d40ba5d65777bc713b46"]}},"isSessionExpired.d.ts":{"size":254,"offset":"7897202","integrity":{"algorithm":"SHA256","hash":"8bdc83147f20d448b6fa449af8ec72d50e83e24541d8469daec685da6e126255","blockSize":4194304,"blocks":["8bdc83147f20d448b6fa449af8ec72d50e83e24541d8469daec685da6e126255"]}},"isSessionExpired.d.ts.map":{"size":302,"offset":"7897456","integrity":{"algorithm":"SHA256","hash":"542b38155ef6f3c43f0a78963596e3f9a4841aa9531511499b5a80907430686b","blockSize":4194304,"blocks":["542b38155ef6f3c43f0a78963596e3f9a4841aa9531511499b5a80907430686b"]}},"prepareRecordingData.d.ts":{"size":343,"offset":"7897758","integrity":{"algorithm":"SHA256","hash":"33bbc493ab6f25108bce886fe88d1c7624dc14bd2a76cf1e43557c30e79ee346","blockSize":4194304,"blocks":["33bbc493ab6f25108bce886fe88d1c7624dc14bd2a76cf1e43557c30e79ee346"]}},"prepareRecordingData.d.ts.map":{"size":364,"offset":"7898101","integrity":{"algorithm":"SHA256","hash":"2710e9540be44b5e113a361b64a1fbbf2cce811dda98d7e2b7ffce24f17cbb8e","blockSize":4194304,"blocks":["2710e9540be44b5e113a361b64a1fbbf2cce811dda98d7e2b7ffce24f17cbb8e"]}},"prepareReplayEvent.d.ts":{"size":557,"offset":"7898465","integrity":{"algorithm":"SHA256","hash":"8530520012cbaf7af8f2372ae22b34a4daa601373872616e6a4fefdf272261e8","blockSize":4194304,"blocks":["8530520012cbaf7af8f2372ae22b34a4daa601373872616e6a4fefdf272261e8"]}},"prepareReplayEvent.d.ts.map":{"size":584,"offset":"7899022","integrity":{"algorithm":"SHA256","hash":"dbdbf084ba91c777bea0a8519b9b4e75426b83a4277666213c2bb7eefaec858f","blockSize":4194304,"blocks":["dbdbf084ba91c777bea0a8519b9b4e75426b83a4277666213c2bb7eefaec858f"]}},"sendReplay.d.ts":{"size":294,"offset":"7899606","integrity":{"algorithm":"SHA256","hash":"cf8e5de63c3863a74a1e5ffc31085a214c81c28dcfeeca27b7e7f9ef71459200","blockSize":4194304,"blocks":["cf8e5de63c3863a74a1e5ffc31085a214c81c28dcfeeca27b7e7f9ef71459200"]}},"sendReplay.d.ts.map":{"size":272,"offset":"7899900","integrity":{"algorithm":"SHA256","hash":"2a2006a8666037a415715f315765842286e34e821f3d2f2acfaffe89948ac754","blockSize":4194304,"blocks":["2a2006a8666037a415715f315765842286e34e821f3d2f2acfaffe89948ac754"]}},"sendReplayRequest.d.ts":{"size":598,"offset":"7900172","integrity":{"algorithm":"SHA256","hash":"115e38aff913ad1f9ab9f2dfbd5060bfde8bc2124fe11908037423b1eaabe0ec","blockSize":4194304,"blocks":["115e38aff913ad1f9ab9f2dfbd5060bfde8bc2124fe11908037423b1eaabe0ec"]}},"sendReplayRequest.d.ts.map":{"size":478,"offset":"7900770","integrity":{"algorithm":"SHA256","hash":"db9cde1ede52887a9c5dde6c4cf51a41bd7ecd052f35f71c6f4816f2ef0b6f0b","blockSize":4194304,"blocks":["db9cde1ede52887a9c5dde6c4cf51a41bd7ecd052f35f71c6f4816f2ef0b6f0b"]}},"shouldFilterRequest.d.ts":{"size":310,"offset":"7901248","integrity":{"algorithm":"SHA256","hash":"a524dd66dde38f6a101dc20cbeff4948ee0f0b6bbab27914b5214fcc49321cd3","blockSize":4194304,"blocks":["a524dd66dde38f6a101dc20cbeff4948ee0f0b6bbab27914b5214fcc49321cd3"]}},"shouldFilterRequest.d.ts.map":{"size":278,"offset":"7901558","integrity":{"algorithm":"SHA256","hash":"608cd5a0cefefd03ed85b37aac67337359e193e13d068c67e8b96bbf966cc147","blockSize":4194304,"blocks":["608cd5a0cefefd03ed85b37aac67337359e193e13d068c67e8b96bbf966cc147"]}}}}}}}},"types":{"files":{"cjs":{"files":{"index.js":{"size":35,"offset":"7901836","integrity":{"algorithm":"SHA256","hash":"f2b0003e273c6051ef59930cc8c1cb4a53e729fcd436863340402ab7e8b945b5","blockSize":4194304,"blocks":["f2b0003e273c6051ef59930cc8c1cb4a53e729fcd436863340402ab7e8b945b5"]}},"index.js.map":{"size":89,"offset":"7901871","integrity":{"algorithm":"SHA256","hash":"c2be3c8ab27ed9fadac74b9b0fa157bc58b0d202b0b1b560360720885c3574e8","blockSize":4194304,"blocks":["c2be3c8ab27ed9fadac74b9b0fa157bc58b0d202b0b1b560360720885c3574e8"]}}}},"esm":{"files":{"index.js":{"size":35,"offset":"7901960","integrity":{"algorithm":"SHA256","hash":"f2b0003e273c6051ef59930cc8c1cb4a53e729fcd436863340402ab7e8b945b5","blockSize":4194304,"blocks":["f2b0003e273c6051ef59930cc8c1cb4a53e729fcd436863340402ab7e8b945b5"]}},"index.js.map":{"size":89,"offset":"7901995","integrity":{"algorithm":"SHA256","hash":"c2be3c8ab27ed9fadac74b9b0fa157bc58b0d202b0b1b560360720885c3574e8","blockSize":4194304,"blocks":["c2be3c8ab27ed9fadac74b9b0fa157bc58b0d202b0b1b560360720885c3574e8"]}}}},"LICENSE":{"size":1120,"offset":"7902084","integrity":{"algorithm":"SHA256","hash":"5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7","blockSize":4194304,"blocks":["5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7"]}},"package.json":{"size":506,"offset":"7903204","integrity":{"algorithm":"SHA256","hash":"62d3919d34158399de2ecff8a7503657341ec7f7dd449906684fc50064d630dc","blockSize":4194304,"blocks":["62d3919d34158399de2ecff8a7503657341ec7f7dd449906684fc50064d630dc"]}},"README.md":{"size":786,"offset":"7903710","integrity":{"algorithm":"SHA256","hash":"251eb5c2f004da339ac879f73ae02a76e44fd3b95d72fa2cd8efcab46b5549e4","blockSize":4194304,"blocks":["251eb5c2f004da339ac879f73ae02a76e44fd3b95d72fa2cd8efcab46b5549e4"]}},"types":{"files":{"attachment.d.ts":{"size":180,"offset":"7904496","integrity":{"algorithm":"SHA256","hash":"8ce1e6f89ae9e5087406fd51d0725e52b832683077b21264c2c4cf27468718e2","blockSize":4194304,"blocks":["8ce1e6f89ae9e5087406fd51d0725e52b832683077b21264c2c4cf27468718e2"]}},"attachment.d.ts.map":{"size":266,"offset":"7904676","integrity":{"algorithm":"SHA256","hash":"5c8aa8b496ed0049d9796de1bf75fdf1a770ff7f76a31afe6576942be707bc9e","blockSize":4194304,"blocks":["5c8aa8b496ed0049d9796de1bf75fdf1a770ff7f76a31afe6576942be707bc9e"]}},"breadcrumb.d.ts":{"size":1040,"offset":"7904942","integrity":{"algorithm":"SHA256","hash":"4a76d18b071c6a45f2b36493ee9ef1e4f000cafe15da02f35c5bf01916cf2828","blockSize":4194304,"blocks":["4a76d18b071c6a45f2b36493ee9ef1e4f000cafe15da02f35c5bf01916cf2828"]}},"breadcrumb.d.ts.map":{"size":1213,"offset":"7905982","integrity":{"algorithm":"SHA256","hash":"ea59c4ac960a323fc595c4ebf83a5d6afa8a3d2ab8a32ce48f636ecd12a51ae3","blockSize":4194304,"blocks":["ea59c4ac960a323fc595c4ebf83a5d6afa8a3d2ab8a32ce48f636ecd12a51ae3"]}},"browseroptions.d.ts":{"size":687,"offset":"7907195","integrity":{"algorithm":"SHA256","hash":"9b466c1ca7a7781ed44fe3c1bcfe2d4daf23f1fdcda606694e5c208f713495c3","blockSize":4194304,"blocks":["9b466c1ca7a7781ed44fe3c1bcfe2d4daf23f1fdcda606694e5c208f713495c3"]}},"browseroptions.d.ts.map":{"size":261,"offset":"7907882","integrity":{"algorithm":"SHA256","hash":"c445f511f829701a7d74f4ce31afc2981e5a8eb0988c08e203ccf70a98443782","blockSize":4194304,"blocks":["c445f511f829701a7d74f4ce31afc2981e5a8eb0988c08e203ccf70a98443782"]}},"checkin.d.ts":{"size":232,"offset":"7908143","integrity":{"algorithm":"SHA256","hash":"dbf0cf7266f62ff3f3ec5353b18f78523a0ecfc040186710a0857ed0ab968dbc","blockSize":4194304,"blocks":["dbf0cf7266f62ff3f3ec5353b18f78523a0ecfc040186710a0857ed0ab968dbc"]}},"checkin.d.ts.map":{"size":327,"offset":"7908375","integrity":{"algorithm":"SHA256","hash":"ab376063f8ac54df8e2b63ca17eb95dff24a5177a41ea8fa1980448f6a592b0e","blockSize":4194304,"blocks":["ab376063f8ac54df8e2b63ca17eb95dff24a5177a41ea8fa1980448f6a592b0e"]}},"client.d.ts":{"size":7712,"offset":"7908702","integrity":{"algorithm":"SHA256","hash":"7d1f48f5aad5752c3058db8b1592a16d38ab2709a6a07502472f9864bae387f3","blockSize":4194304,"blocks":["7d1f48f5aad5752c3058db8b1592a16d38ab2709a6a07502472f9864bae387f3"]}},"client.d.ts.map":{"size":3531,"offset":"7916414","integrity":{"algorithm":"SHA256","hash":"d3f5533ca4094e86e99c9a4e5e515729ce9ff8cb5f8e393ba6b031aadec5908f","blockSize":4194304,"blocks":["d3f5533ca4094e86e99c9a4e5e515729ce9ff8cb5f8e393ba6b031aadec5908f"]}},"clientreport.d.ts":{"size":490,"offset":"7919945","integrity":{"algorithm":"SHA256","hash":"26d4d2383641b444a0d35cf7f2d468c9671a11e329006ab9363732d89f6f10ef","blockSize":4194304,"blocks":["26d4d2383641b444a0d35cf7f2d468c9671a11e329006ab9363732d89f6f10ef"]}},"clientreport.d.ts.map":{"size":483,"offset":"7920435","integrity":{"algorithm":"SHA256","hash":"42105e6b88ce51cc2c26a4f8fd025d4c9b4d7fac2db59fccf2209bcb2939717d","blockSize":4194304,"blocks":["42105e6b88ce51cc2c26a4f8fd025d4c9b4d7fac2db59fccf2209bcb2939717d"]}},"context.d.ts":{"size":2574,"offset":"7920918","integrity":{"algorithm":"SHA256","hash":"7336a643d148089fcd1955cbe189863cd07bceaa2c9f2f0f4125837e64816440","blockSize":4194304,"blocks":["7336a643d148089fcd1955cbe189863cd07bceaa2c9f2f0f4125837e64816440"]}},"context.d.ts.map":{"size":2986,"offset":"7923492","integrity":{"algorithm":"SHA256","hash":"3fffdfeaa7f6bee2dac13ef68bd1fb1699fb0ffd355491605a37f61d18c37fa2","blockSize":4194304,"blocks":["3fffdfeaa7f6bee2dac13ef68bd1fb1699fb0ffd355491605a37f61d18c37fa2"]}},"datacategory.d.ts":{"size":202,"offset":"7926478","integrity":{"algorithm":"SHA256","hash":"a8851f1e2dc746b4bab39a59327ed30f1bfb363a97c4b6c611c24915a9e087ee","blockSize":4194304,"blocks":["a8851f1e2dc746b4bab39a59327ed30f1bfb363a97c4b6c611c24915a9e087ee"]}},"datacategory.d.ts.map":{"size":242,"offset":"7926680","integrity":{"algorithm":"SHA256","hash":"1dc56eb6a9f17f8ad1f6780d6c4f02ab598d5a66f76af8443fd10b11707e5d48","blockSize":4194304,"blocks":["1dc56eb6a9f17f8ad1f6780d6c4f02ab598d5a66f76af8443fd10b11707e5d48"]}},"debugMeta.d.ts":{"size":542,"offset":"7926922","integrity":{"algorithm":"SHA256","hash":"dce40654eb13bb4e8523ffd65090615331b74d3280d1c802e0daf5cc85c3ad6b","blockSize":4194304,"blocks":["dce40654eb13bb4e8523ffd65090615331b74d3280d1c802e0daf5cc85c3ad6b"]}},"debugMeta.d.ts.map":{"size":522,"offset":"7927464","integrity":{"algorithm":"SHA256","hash":"123845ca798e54d01f5ac3bae3f0db9387c5449c61c1519d1da3d5c411791509","blockSize":4194304,"blocks":["123845ca798e54d01f5ac3bae3f0db9387c5449c61c1519d1da3d5c411791509"]}},"dsn.d.ts":{"size":734,"offset":"7927986","integrity":{"algorithm":"SHA256","hash":"6c1b6a8889ab09917e23f037fe239078735120c7cde01ddcb73c0581deb01f64","blockSize":4194304,"blocks":["6c1b6a8889ab09917e23f037fe239078735120c7cde01ddcb73c0581deb01f64"]}},"dsn.d.ts.map":{"size":539,"offset":"7928720","integrity":{"algorithm":"SHA256","hash":"90a9bb8376d893f5d0031ea3e35f8f3d3b65fb35a4a97f36068ed56630207930","blockSize":4194304,"blocks":["90a9bb8376d893f5d0031ea3e35f8f3d3b65fb35a4a97f36068ed56630207930"]}},"envelope.d.ts":{"size":4040,"offset":"7929259","integrity":{"algorithm":"SHA256","hash":"966da18d834ba05b20d08c88c0ae1d93e4db29abcba4fd2358f8cd217acbfcf6","blockSize":4194304,"blocks":["966da18d834ba05b20d08c88c0ae1d93e4db29abcba4fd2358f8cd217acbfcf6"]}},"envelope.d.ts.map":{"size":3467,"offset":"7933299","integrity":{"algorithm":"SHA256","hash":"cc68adb6bb4922b6361d5c745582d34f6f7933fd8385e5e62bf1268e610c1b44","blockSize":4194304,"blocks":["cc68adb6bb4922b6361d5c745582d34f6f7933fd8385e5e62bf1268e610c1b44"]}},"error.d.ts":{"size":182,"offset":"7936766","integrity":{"algorithm":"SHA256","hash":"a5e77da482bdf0bfdf89787aaa109f99e8b4be7d09caa40ce54da5148abbccfd","blockSize":4194304,"blocks":["a5e77da482bdf0bfdf89787aaa109f99e8b4be7d09caa40ce54da5148abbccfd"]}},"error.d.ts.map":{"size":194,"offset":"7936948","integrity":{"algorithm":"SHA256","hash":"e3a9f7cc22f796f2a3efdbf0a1f5c6edf95b28bc327781d69772ff4bec6d2f49","blockSize":4194304,"blocks":["e3a9f7cc22f796f2a3efdbf0a1f5c6edf95b28bc327781d69772ff4bec6d2f49"]}},"event.d.ts":{"size":2347,"offset":"7937142","integrity":{"algorithm":"SHA256","hash":"ccee0dbabe6e6640116af6814a7acfeaeedea5b4711e21ee61fb22590a09be6c","blockSize":4194304,"blocks":["ccee0dbabe6e6640116af6814a7acfeaeedea5b4711e21ee61fb22590a09be6c"]}},"event.d.ts.map":{"size":2503,"offset":"7939489","integrity":{"algorithm":"SHA256","hash":"34ab19d32314d5aa8041ed067cfa5df365d7fd1b5433c8e403fcc98a2fdd73d1","blockSize":4194304,"blocks":["34ab19d32314d5aa8041ed067cfa5df365d7fd1b5433c8e403fcc98a2fdd73d1"]}},"eventprocessor.d.ts":{"size":540,"offset":"7941992","integrity":{"algorithm":"SHA256","hash":"9de20884f23886e577d71fe9919bd5fcc71469ca2b28de62162212bed950dbdd","blockSize":4194304,"blocks":["9de20884f23886e577d71fe9919bd5fcc71469ca2b28de62162212bed950dbdd"]}},"eventprocessor.d.ts.map":{"size":356,"offset":"7942532","integrity":{"algorithm":"SHA256","hash":"d88ba2eecaa0f5bad168f4db11e6a681bf264ce48b1d0029300a606482908314","blockSize":4194304,"blocks":["d88ba2eecaa0f5bad168f4db11e6a681bf264ce48b1d0029300a606482908314"]}},"exception.d.ts":{"size":317,"offset":"7942888","integrity":{"algorithm":"SHA256","hash":"01a60549043a188ea023b72600072e412c000bc4a960d881ef9603b3ea566088","blockSize":4194304,"blocks":["01a60549043a188ea023b72600072e412c000bc4a960d881ef9603b3ea566088"]}},"exception.d.ts.map":{"size":426,"offset":"7943205","integrity":{"algorithm":"SHA256","hash":"9d739f84f9a28a4a80a47fd1c2098bb325dec050c49f0e04f161dee8acb74780","blockSize":4194304,"blocks":["9d739f84f9a28a4a80a47fd1c2098bb325dec050c49f0e04f161dee8acb74780"]}},"extra.d.ts":{"size":124,"offset":"7943631","integrity":{"algorithm":"SHA256","hash":"7ffc7b4e7fe731d786caa126f20f451c0d86419486bf03faca2c91adebe89bfd","blockSize":4194304,"blocks":["7ffc7b4e7fe731d786caa126f20f451c0d86419486bf03faca2c91adebe89bfd"]}},"extra.d.ts.map":{"size":194,"offset":"7943755","integrity":{"algorithm":"SHA256","hash":"a5a4eb80937babda26b290908f2c63c036c5cb1cef9c0c0ab7e4f809852868f5","blockSize":4194304,"blocks":["a5a4eb80937babda26b290908f2c63c036c5cb1cef9c0c0ab7e4f809852868f5"]}},"globals.d.ts":{"size":108,"offset":"7943949","integrity":{"algorithm":"SHA256","hash":"26ef9a3e012d296fe3089a8bd74f425a59317b36efd2bdd68d681de539c231cc","blockSize":4194304,"blocks":["26ef9a3e012d296fe3089a8bd74f425a59317b36efd2bdd68d681de539c231cc"]}},"globals.d.ts.map":{"size":191,"offset":"7944057","integrity":{"algorithm":"SHA256","hash":"d50bda34ce43d99dbb99e0e0178761bfa27d6a219192ea942acbce53c98b88d8","blockSize":4194304,"blocks":["d50bda34ce43d99dbb99e0e0178761bfa27d6a219192ea942acbce53c98b88d8"]}},"hub.d.ts":{"size":8553,"offset":"7944248","integrity":{"algorithm":"SHA256","hash":"a9772880b7476fc7897d755090e1bb0d6cc59c8a2dfec760b5a73e7fe2319ffb","blockSize":4194304,"blocks":["a9772880b7476fc7897d755090e1bb0d6cc59c8a2dfec760b5a73e7fe2319ffb"]}},"hub.d.ts.map":{"size":2690,"offset":"7952801","integrity":{"algorithm":"SHA256","hash":"d37b61b3f95bed1f01d72ae4aa200b3bbc3010c65df4f17a6df8827aca24d9d6","blockSize":4194304,"blocks":["d37b61b3f95bed1f01d72ae4aa200b3bbc3010c65df4f17a6df8827aca24d9d6"]}},"index.d.ts":{"size":3539,"offset":"7955491","integrity":{"algorithm":"SHA256","hash":"7fe57a8a5cbb61ddaa5ae98590b1340cac1f765479993b6b7f6a79a8d5a5ede8","blockSize":4194304,"blocks":["7fe57a8a5cbb61ddaa5ae98590b1340cac1f765479993b6b7f6a79a8d5a5ede8"]}},"index.d.ts.map":{"size":2890,"offset":"7959030","integrity":{"algorithm":"SHA256","hash":"b86a9f4082b33269e61029bb5b16f6787db5d8ea2c7c90e51622a9c8bc3f9371","blockSize":4194304,"blocks":["b86a9f4082b33269e61029bb5b16f6787db5d8ea2c7c90e51622a9c8bc3f9371"]}},"instrument.d.ts":{"size":905,"offset":"7961920","integrity":{"algorithm":"SHA256","hash":"e6835ab37f2efa096e21ec4a107b4081e79c0ed342473df58e023608bb3d0f11","blockSize":4194304,"blocks":["e6835ab37f2efa096e21ec4a107b4081e79c0ed342473df58e023608bb3d0f11"]}},"instrument.d.ts.map":{"size":978,"offset":"7962825","integrity":{"algorithm":"SHA256","hash":"19ce6e8c7e83be5d1acc6836a30a9dc0e8a156c8b5c316dc21602366493f1166","blockSize":4194304,"blocks":["19ce6e8c7e83be5d1acc6836a30a9dc0e8a156c8b5c316dc21602366493f1166"]}},"instrumenter.d.ts":{"size":96,"offset":"7963803","integrity":{"algorithm":"SHA256","hash":"ca9377a5b012474e55238f2dc2cbc8a27505304cab4ba897f3695f70e5b141c4","blockSize":4194304,"blocks":["ca9377a5b012474e55238f2dc2cbc8a27505304cab4ba897f3695f70e5b141c4"]}},"instrumenter.d.ts.map":{"size":161,"offset":"7963899","integrity":{"algorithm":"SHA256","hash":"a3364003fe3eb555d8d78bd14b87052c42258021ccedfd7cfce0a0934362cd42","blockSize":4194304,"blocks":["a3364003fe3eb555d8d78bd14b87052c42258021ccedfd7cfce0a0934362cd42"]}},"integration.d.ts":{"size":706,"offset":"7964060","integrity":{"algorithm":"SHA256","hash":"d5dd2caaef40c4847fc50e78706e72c6d3565ce28509926d231c6cef3052fc55","blockSize":4194304,"blocks":["d5dd2caaef40c4847fc50e78706e72c6d3565ce28509926d231c6cef3052fc55"]}},"integration.d.ts.map":{"size":535,"offset":"7964766","integrity":{"algorithm":"SHA256","hash":"147694ca627ef7d5f89ca879fba5b9141ecef74b061bf8e33dd5b5cbf341f8b6","blockSize":4194304,"blocks":["147694ca627ef7d5f89ca879fba5b9141ecef74b061bf8e33dd5b5cbf341f8b6"]}},"measurement.d.ts":{"size":900,"offset":"7965301","integrity":{"algorithm":"SHA256","hash":"12550b681c2d6e569d852126ef6f4938d416b8e18cedb29c2d3708ffe47de17f","blockSize":4194304,"blocks":["12550b681c2d6e569d852126ef6f4938d416b8e18cedb29c2d3708ffe47de17f"]}},"measurement.d.ts.map":{"size":759,"offset":"7966201","integrity":{"algorithm":"SHA256","hash":"9ee547b735c101459a480166b08abc7f824290f3ffe1169c460bafcd4329b7b9","blockSize":4194304,"blocks":["9ee547b735c101459a480166b08abc7f824290f3ffe1169c460bafcd4329b7b9"]}},"mechanism.d.ts":{"size":1388,"offset":"7966960","integrity":{"algorithm":"SHA256","hash":"4a9a415589638d1a6f3c5269eecec91e20f0554b391c5b182d85a313042383eb","blockSize":4194304,"blocks":["4a9a415589638d1a6f3c5269eecec91e20f0554b391c5b182d85a313042383eb"]}},"mechanism.d.ts.map":{"size":364,"offset":"7968348","integrity":{"algorithm":"SHA256","hash":"5083deebf624ff7d4667fa56185d4e3d585572a47b67e2c7cb089d5f0bc5edbb","blockSize":4194304,"blocks":["5083deebf624ff7d4667fa56185d4e3d585572a47b67e2c7cb089d5f0bc5edbb"]}},"misc.d.ts":{"size":2219,"offset":"7968712","integrity":{"algorithm":"SHA256","hash":"0964a9bcc8dd33e2587496261f7e6c6011fbfe263632ff7cfb5cdc35d3cd4992","blockSize":4194304,"blocks":["0964a9bcc8dd33e2587496261f7e6c6011fbfe263632ff7cfb5cdc35d3cd4992"]}},"misc.d.ts.map":{"size":1249,"offset":"7970931","integrity":{"algorithm":"SHA256","hash":"71cbc7930087304d1df7e18b85f78c066e667e3234414eff4d91e6d3a1e133f2","blockSize":4194304,"blocks":["71cbc7930087304d1df7e18b85f78c066e667e3234414eff4d91e6d3a1e133f2"]}},"options.d.ts":{"size":11634,"offset":"7972180","integrity":{"algorithm":"SHA256","hash":"7f7613eddecd41e65d561cb4f3d23789c048df74c69d5884253f740ecf600120","blockSize":4194304,"blocks":["7f7613eddecd41e65d561cb4f3d23789c048df74c69d5884253f740ecf600120"]}},"options.d.ts.map":{"size":3146,"offset":"7983814","integrity":{"algorithm":"SHA256","hash":"2475fa597e320342be47bc8769f77c32d26812e20cfe00ed0a8f34d64097f765","blockSize":4194304,"blocks":["2475fa597e320342be47bc8769f77c32d26812e20cfe00ed0a8f34d64097f765"]}},"package.d.ts":{"size":118,"offset":"7986960","integrity":{"algorithm":"SHA256","hash":"051710cbb4924bc139b8a3cd675a2ad7f3c407ca241e00c5919c285ae71eb31a","blockSize":4194304,"blocks":["051710cbb4924bc139b8a3cd675a2ad7f3c407ca241e00c5919c285ae71eb31a"]}},"package.d.ts.map":{"size":197,"offset":"7987078","integrity":{"algorithm":"SHA256","hash":"1d52854ece8ee8b5baa33baeeb0f3082e89d919e5d308f8357dd6310989372a3","blockSize":4194304,"blocks":["1d52854ece8ee8b5baa33baeeb0f3082e89d919e5d308f8357dd6310989372a3"]}},"polymorphics.d.ts":{"size":1757,"offset":"7987275","integrity":{"algorithm":"SHA256","hash":"e7700046b1c3373a89784edd6befae454435efd7db708d23a7a3e9caf9743381","blockSize":4194304,"blocks":["e7700046b1c3373a89784edd6befae454435efd7db708d23a7a3e9caf9743381"]}},"polymorphics.d.ts.map":{"size":1681,"offset":"7989032","integrity":{"algorithm":"SHA256","hash":"f76ea8b85c148aba97af038763998537d2db0dbac0c6b865ee58d86f4603a63a","blockSize":4194304,"blocks":["f76ea8b85c148aba97af038763998537d2db0dbac0c6b865ee58d86f4603a63a"]}},"replay.d.ts":{"size":706,"offset":"7990713","integrity":{"algorithm":"SHA256","hash":"bc3001d308f3cc6d1ad36684b1fb47c32f18a05d1f54e693401dcc65eb2a938f","blockSize":4194304,"blocks":["bc3001d308f3cc6d1ad36684b1fb47c32f18a05d1f54e693401dcc65eb2a938f"]}},"replay.d.ts.map":{"size":518,"offset":"7991419","integrity":{"algorithm":"SHA256","hash":"2f4219d53d65c922754b42a82aa4b8650e05938ee94547fcbf2a6e201a95a9e7","blockSize":4194304,"blocks":["2f4219d53d65c922754b42a82aa4b8650e05938ee94547fcbf2a6e201a95a9e7"]}},"request.d.ts":{"size":800,"offset":"7991937","integrity":{"algorithm":"SHA256","hash":"76a61b654abc1967780835e3e8b090ecdc5473e3d7b60c39d5132ac4f4a68aac","blockSize":4194304,"blocks":["76a61b654abc1967780835e3e8b090ecdc5473e3d7b60c39d5132ac4f4a68aac"]}},"request.d.ts.map":{"size":770,"offset":"7992737","integrity":{"algorithm":"SHA256","hash":"280993879ccb1a3e06716312b4ba2fce0821a8d301cd4de93105470a9e25b9c9","blockSize":4194304,"blocks":["280993879ccb1a3e06716312b4ba2fce0821a8d301cd4de93105470a9e25b9c9"]}},"runtime.d.ts":{"size":131,"offset":"7993507","integrity":{"algorithm":"SHA256","hash":"4321a253772df67751278fbb89d6ef8248206e279b82c75cabd7f1a33f6ae156","blockSize":4194304,"blocks":["4321a253772df67751278fbb89d6ef8248206e279b82c75cabd7f1a33f6ae156"]}},"runtime.d.ts.map":{"size":210,"offset":"7993638","integrity":{"algorithm":"SHA256","hash":"fa8e370c6faac63269040821014d2ad6d284392f67040957d2607fc56a4db525","blockSize":4194304,"blocks":["fa8e370c6faac63269040821014d2ad6d284392f67040957d2607fc56a4db525"]}},"scope.d.ts":{"size":5489,"offset":"7993848","integrity":{"algorithm":"SHA256","hash":"9d2e97cf880f0aae07adb8681dd3b0723a8127a58efb660757f5109261a18512","blockSize":4194304,"blocks":["9d2e97cf880f0aae07adb8681dd3b0723a8127a58efb660757f5109261a18512"]}},"scope.d.ts.map":{"size":2745,"offset":"7999337","integrity":{"algorithm":"SHA256","hash":"3debe910d4ef5b8c24a6ce9e5bff29330350d0ec26930283ad88a528d4247b6b","blockSize":4194304,"blocks":["3debe910d4ef5b8c24a6ce9e5bff29330350d0ec26930283ad88a528d4247b6b"]}},"sdkinfo.d.ts":{"size":204,"offset":"8002082","integrity":{"algorithm":"SHA256","hash":"b91e2a80671d91f1d573d5270320f1060f11b5105b94472fe230aff8446bb5a7","blockSize":4194304,"blocks":["b91e2a80671d91f1d573d5270320f1060f11b5105b94472fe230aff8446bb5a7"]}},"sdkinfo.d.ts.map":{"size":315,"offset":"8002286","integrity":{"algorithm":"SHA256","hash":"3897aa38bce47c7377be1b1f06d8beec8c7d669c66263333eed15e4a097da1fa","blockSize":4194304,"blocks":["3897aa38bce47c7377be1b1f06d8beec8c7d669c66263333eed15e4a097da1fa"]}},"sdkmetadata.d.ts":{"size":135,"offset":"8002601","integrity":{"algorithm":"SHA256","hash":"1007144ddd1166bdb165e1d6f701213061800af7c4d438c2d6accd22e6f03e7e","blockSize":4194304,"blocks":["1007144ddd1166bdb165e1d6f701213061800af7c4d438c2d6accd22e6f03e7e"]}},"sdkmetadata.d.ts.map":{"size":220,"offset":"8002736","integrity":{"algorithm":"SHA256","hash":"792a057fd53793867de85507be0f688ad7423eb18c08369f0484ad4319ac2997","blockSize":4194304,"blocks":["792a057fd53793867de85507be0f688ad7423eb18c08369f0484ad4319ac2997"]}},"session.d.ts":{"size":2065,"offset":"8002956","integrity":{"algorithm":"SHA256","hash":"627e7bb6f5fce91a9273d39534a0b217997f4d5d286a369ab3375be999bfbdfd","blockSize":4194304,"blocks":["627e7bb6f5fce91a9273d39534a0b217997f4d5d286a369ab3375be999bfbdfd"]}},"session.d.ts.map":{"size":1712,"offset":"8005021","integrity":{"algorithm":"SHA256","hash":"1e24014a9f3486c415fd02f7a15fe33ea1b81723b73ef5fec772805e68fe3f29","blockSize":4194304,"blocks":["1e24014a9f3486c415fd02f7a15fe33ea1b81723b73ef5fec772805e68fe3f29"]}},"severity.d.ts":{"size":563,"offset":"8006733","integrity":{"algorithm":"SHA256","hash":"d9de3d489c1c538ca404fe3cbca900872b22b31fee5d4b3c89154be94b5c4c0b","blockSize":4194304,"blocks":["d9de3d489c1c538ca404fe3cbca900872b22b31fee5d4b3c89154be94b5c4c0b"]}},"severity.d.ts.map":{"size":379,"offset":"8007296","integrity":{"algorithm":"SHA256","hash":"7dbe154d56b87937b6dee6f2b5ec669ecfa780a52340bfa2185ca1c61ba81817","blockSize":4194304,"blocks":["7dbe154d56b87937b6dee6f2b5ec669ecfa780a52340bfa2185ca1c61ba81817"]}},"span.d.ts":{"size":4489,"offset":"8007675","integrity":{"algorithm":"SHA256","hash":"52a8b52bffe68e169cd279de895681abe9e56722d4b9c6394b88e085fec19c49","blockSize":4194304,"blocks":["52a8b52bffe68e169cd279de895681abe9e56722d4b9c6394b88e085fec19c49"]}},"span.d.ts.map":{"size":2682,"offset":"8012164","integrity":{"algorithm":"SHA256","hash":"f8fb6e10958f2cb3b2a4a9f1aedb514dfdd067809d9f931b8ed65c5bfdbec3fa","blockSize":4194304,"blocks":["f8fb6e10958f2cb3b2a4a9f1aedb514dfdd067809d9f931b8ed65c5bfdbec3fa"]}},"stackframe.d.ts":{"size":471,"offset":"8014846","integrity":{"algorithm":"SHA256","hash":"41f7aae5a2a5cc91f52e1e7a13e01dc2bb8c81494b1ec19fafaf9eda745bb246","blockSize":4194304,"blocks":["41f7aae5a2a5cc91f52e1e7a13e01dc2bb8c81494b1ec19fafaf9eda745bb246"]}},"stackframe.d.ts.map":{"size":668,"offset":"8015317","integrity":{"algorithm":"SHA256","hash":"c572a1ceab955a15fa53b12a354abbbae30e8c5ddce8f21fb5965bc848e3d891","blockSize":4194304,"blocks":["c572a1ceab955a15fa53b12a354abbbae30e8c5ddce8f21fb5965bc848e3d891"]}},"stacktrace.d.ts":{"size":435,"offset":"8015985","integrity":{"algorithm":"SHA256","hash":"a8920ed5f8ee0b9abb7d387549486bc82f6683e1b1e7063e93460df16b650382","blockSize":4194304,"blocks":["a8920ed5f8ee0b9abb7d387549486bc82f6683e1b1e7063e93460df16b650382"]}},"stacktrace.d.ts.map":{"size":494,"offset":"8016420","integrity":{"algorithm":"SHA256","hash":"61bfd8b45b8f9a4b1454c7cc63fe356ec7a41c59534e9c1eaa377d69ce48a2f5","blockSize":4194304,"blocks":["61bfd8b45b8f9a4b1454c7cc63fe356ec7a41c59534e9c1eaa377d69ce48a2f5"]}},"textencoder.d.ts":{"size":401,"offset":"8016914","integrity":{"algorithm":"SHA256","hash":"bfcf14ed17d21ea3235d2c771ce806a9b1da7434aabcd1df9cb4157b287d7312","blockSize":4194304,"blocks":["bfcf14ed17d21ea3235d2c771ce806a9b1da7434aabcd1df9cb4157b287d7312"]}},"textencoder.d.ts.map":{"size":297,"offset":"8017315","integrity":{"algorithm":"SHA256","hash":"6313f91fd3494922432ccb3883d4db5d94c13a596a952f8593505c7aa4358d10","blockSize":4194304,"blocks":["6313f91fd3494922432ccb3883d4db5d94c13a596a952f8593505c7aa4358d10"]}},"thread.d.ts":{"size":236,"offset":"8017612","integrity":{"algorithm":"SHA256","hash":"8824ac8feb756a37abc429a4d0e39b01ff5c6358f750f137c0c1829b1ee4b37a","blockSize":4194304,"blocks":["8824ac8feb756a37abc429a4d0e39b01ff5c6358f750f137c0c1829b1ee4b37a"]}},"thread.d.ts.map":{"size":343,"offset":"8017848","integrity":{"algorithm":"SHA256","hash":"bd1b3ec1d64cbe53ab658beb95672cadc6e0a78421e87fa7989d730af0557bbd","blockSize":4194304,"blocks":["bd1b3ec1d64cbe53ab658beb95672cadc6e0a78421e87fa7989d730af0557bbd"]}},"tracing.d.ts":{"size":104,"offset":"8018191","integrity":{"algorithm":"SHA256","hash":"413cd238f7fc468a84ce64b28296499e6c82d6ec3396dd4e491be9bd37642b3d","blockSize":4194304,"blocks":["413cd238f7fc468a84ce64b28296499e6c82d6ec3396dd4e491be9bd37642b3d"]}},"tracing.d.ts.map":{"size":168,"offset":"8018295","integrity":{"algorithm":"SHA256","hash":"5be6afb90dba23947b222c6fccc87730a676b077a5d726b800cb813fa1423b41","blockSize":4194304,"blocks":["5be6afb90dba23947b222c6fccc87730a676b077a5d726b800cb813fa1423b41"]}},"transaction.d.ts":{"size":6244,"offset":"8018463","integrity":{"algorithm":"SHA256","hash":"c37391b00a7518676e40411a83d032064e3abe9075d8e34e0e3fb058bc98b66b","blockSize":4194304,"blocks":["c37391b00a7518676e40411a83d032064e3abe9075d8e34e0e3fb058bc98b66b"]}},"transaction.d.ts.map":{"size":2674,"offset":"8024707","integrity":{"algorithm":"SHA256","hash":"f5be454fa7e6c8894426fa1558b4d974e2f171dad284631b112127fd721786ad","blockSize":4194304,"blocks":["f5be454fa7e6c8894426fa1558b4d974e2f171dad284631b112127fd721786ad"]}},"transport.d.ts":{"size":1029,"offset":"8027381","integrity":{"algorithm":"SHA256","hash":"1d771f631479c5df2d1f761dac5c4d365ffda59f9c835453e48c8a3b68f7df8d","blockSize":4194304,"blocks":["1d771f631479c5df2d1f761dac5c4d365ffda59f9c835453e48c8a3b68f7df8d"]}},"transport.d.ts.map":{"size":988,"offset":"8028410","integrity":{"algorithm":"SHA256","hash":"08b07c077caf7495f9be620cb0fdc631116d03c07557960740376732cdb2bca6","blockSize":4194304,"blocks":["08b07c077caf7495f9be620cb0fdc631116d03c07557960740376732cdb2bca6"]}},"user.d.ts":{"size":326,"offset":"8029398","integrity":{"algorithm":"SHA256","hash":"29de8afa770d2b59ebcaa3f7c56d1f373e41b8c37f35b9db4bdc10f1e1a88bd0","blockSize":4194304,"blocks":["29de8afa770d2b59ebcaa3f7c56d1f373e41b8c37f35b9db4bdc10f1e1a88bd0"]}},"user.d.ts.map":{"size":478,"offset":"8029724","integrity":{"algorithm":"SHA256","hash":"c92dbef0dc4b98fa6b2b24ec073efeb4d352bbd1500d2ce92772b607c346df72","blockSize":4194304,"blocks":["c92dbef0dc4b98fa6b2b24ec073efeb4d352bbd1500d2ce92772b607c346df72"]}},"wrappedfunction.d.ts":{"size":221,"offset":"8030202","integrity":{"algorithm":"SHA256","hash":"c01e6bc9de9a0f0b4a6be035d26fe3a2e0f385f989d9ad772e52a3d06145af19","blockSize":4194304,"blocks":["c01e6bc9de9a0f0b4a6be035d26fe3a2e0f385f989d9ad772e52a3d06145af19"]}},"wrappedfunction.d.ts.map":{"size":280,"offset":"8030423","integrity":{"algorithm":"SHA256","hash":"ca6d284d2156ce9b1b2c3540101cf49395b35e8093ee9312e00e1c90bdc67465","blockSize":4194304,"blocks":["ca6d284d2156ce9b1b2c3540101cf49395b35e8093ee9312e00e1c90bdc67465"]}}}}}},"utils":{"files":{"cjs":{"files":{"baggage.js":{"size":5903,"offset":"8030703","integrity":{"algorithm":"SHA256","hash":"c68f86edf4fb6e93c3ac4e5247d408e3120e4eb3d3d0bef69de3105cfbba8751","blockSize":4194304,"blocks":["c68f86edf4fb6e93c3ac4e5247d408e3120e4eb3d3d0bef69de3105cfbba8751"]}},"baggage.js.map":{"size":9175,"offset":"8036606","integrity":{"algorithm":"SHA256","hash":"8481c95644a6b88c92e9275bfdd668baad77b3dffd2999b91ac035c01a462272","blockSize":4194304,"blocks":["8481c95644a6b88c92e9275bfdd668baad77b3dffd2999b91ac035c01a462272"]}},"browser.js":{"size":4527,"offset":"8045781","integrity":{"algorithm":"SHA256","hash":"af290cf771eee9c15c51356496ec911b5376f01a0ee3399fa4015b3713873ae8","blockSize":4194304,"blocks":["af290cf771eee9c15c51356496ec911b5376f01a0ee3399fa4015b3713873ae8"]}},"browser.js.map":{"size":8585,"offset":"8050308","integrity":{"algorithm":"SHA256","hash":"35ebbf9ff457f7159b4e5bfbb4cda24e15f2cbe18c48b01743cff32900e78c82","blockSize":4194304,"blocks":["35ebbf9ff457f7159b4e5bfbb4cda24e15f2cbe18c48b01743cff32900e78c82"]}},"buildPolyfills":{"files":{"_asyncNullishCoalesce.js":{"size":1291,"offset":"8058893","integrity":{"algorithm":"SHA256","hash":"0ed2d3c8096aabbae1d850321efa7fb1c7cd7cfe513b9dda00e7534067ec38b9","blockSize":4194304,"blocks":["0ed2d3c8096aabbae1d850321efa7fb1c7cd7cfe513b9dda00e7534067ec38b9"]}},"_asyncNullishCoalesce.js.map":{"size":2782,"offset":"8060184","integrity":{"algorithm":"SHA256","hash":"e54389fdfb541f66dd25ff17ece2c43b4c69be9f44619ef3216b4abead958fb0","blockSize":4194304,"blocks":["e54389fdfb541f66dd25ff17ece2c43b4c69be9f44619ef3216b4abead958fb0"]}},"_asyncOptionalChain.js":{"size":2210,"offset":"8062966","integrity":{"algorithm":"SHA256","hash":"b1d7829c720ae1ded1bb49cdc11a491d0521e1d0f14f5e3b4a05c8527be7512c","blockSize":4194304,"blocks":["b1d7829c720ae1ded1bb49cdc11a491d0521e1d0f14f5e3b4a05c8527be7512c"]}},"_asyncOptionalChain.js.map":{"size":4748,"offset":"8065176","integrity":{"algorithm":"SHA256","hash":"5a6dacecb31b24560a299c92538d2cf2879d10443531a3f33069aac09998e65c","blockSize":4194304,"blocks":["5a6dacecb31b24560a299c92538d2cf2879d10443531a3f33069aac09998e65c"]}},"_asyncOptionalChainDelete.js":{"size":1749,"offset":"8069924","integrity":{"algorithm":"SHA256","hash":"88a7a9c9262505cfcef410041764cf53bec70af05dd5412c18120104984dda31","blockSize":4194304,"blocks":["88a7a9c9262505cfcef410041764cf53bec70af05dd5412c18120104984dda31"]}},"_asyncOptionalChainDelete.js.map":{"size":3323,"offset":"8071673","integrity":{"algorithm":"SHA256","hash":"fa15ad9374011e2d7e6f8a88d8e69f812fa42b4a829016c75c03162d120caa49","blockSize":4194304,"blocks":["fa15ad9374011e2d7e6f8a88d8e69f812fa42b4a829016c75c03162d120caa49"]}},"_createNamedExportFrom.js":{"size":824,"offset":"8074996","integrity":{"algorithm":"SHA256","hash":"34d3f608a3ac8c058bdc81ecd83d257c298d81003edeb715791f598e28c469b1","blockSize":4194304,"blocks":["34d3f608a3ac8c058bdc81ecd83d257c298d81003edeb715791f598e28c469b1"]}},"_createNamedExportFrom.js.map":{"size":2447,"offset":"8075820","integrity":{"algorithm":"SHA256","hash":"02e3c1817e64f1739826cac7acd525eb2c2c6a3f69647331d81a4c6aae256dcf","blockSize":4194304,"blocks":["02e3c1817e64f1739826cac7acd525eb2c2c6a3f69647331d81a4c6aae256dcf"]}},"_createStarExport.js":{"size":882,"offset":"8078267","integrity":{"algorithm":"SHA256","hash":"a307b032a90854974c69038202b1fc1b15acc1a6c41b15269899f3a608dd29de","blockSize":4194304,"blocks":["a307b032a90854974c69038202b1fc1b15acc1a6c41b15269899f3a608dd29de"]}},"_createStarExport.js.map":{"size":2676,"offset":"8079149","integrity":{"algorithm":"SHA256","hash":"4b6c2de251dec8ba6b3ff7112a90d0a0483642df779840883ba5e39a68af0490","blockSize":4194304,"blocks":["4b6c2de251dec8ba6b3ff7112a90d0a0483642df779840883ba5e39a68af0490"]}},"_interopDefault.js":{"size":660,"offset":"8081825","integrity":{"algorithm":"SHA256","hash":"94505b807b440df7c35ccabf61ccac73d8ad3a59aa3982f0976ed5e6f280e951","blockSize":4194304,"blocks":["94505b807b440df7c35ccabf61ccac73d8ad3a59aa3982f0976ed5e6f280e951"]}},"_interopDefault.js.map":{"size":2256,"offset":"8082485","integrity":{"algorithm":"SHA256","hash":"e0b77308c38be636a6c68650d65e5aa71f857c28276764a51f630b1ade9f1996","blockSize":4194304,"blocks":["e0b77308c38be636a6c68650d65e5aa71f857c28276764a51f630b1ade9f1996"]}},"_interopNamespace.js":{"size":1002,"offset":"8084741","integrity":{"algorithm":"SHA256","hash":"64f7463b1a00301df851a9dde9dcef70aaa406e3332fdd04dbd8d6956b82f2c6","blockSize":4194304,"blocks":["64f7463b1a00301df851a9dde9dcef70aaa406e3332fdd04dbd8d6956b82f2c6"]}},"_interopNamespace.js.map":{"size":2657,"offset":"8085743","integrity":{"algorithm":"SHA256","hash":"0510ae8169b6ea9bb63e9ebb2529ef41ab89e0a8351dc89e3b20095cf65693e1","blockSize":4194304,"blocks":["0510ae8169b6ea9bb63e9ebb2529ef41ab89e0a8351dc89e3b20095cf65693e1"]}},"_interopNamespaceDefaultOnly.js":{"size":743,"offset":"8088400","integrity":{"algorithm":"SHA256","hash":"17dbacf592e089363bb59b345afed6fd6f25cd525d9bb8b7b8e3f39b538070d9","blockSize":4194304,"blocks":["17dbacf592e089363bb59b345afed6fd6f25cd525d9bb8b7b8e3f39b538070d9"]}},"_interopNamespaceDefaultOnly.js.map":{"size":2359,"offset":"8089143","integrity":{"algorithm":"SHA256","hash":"afc8cee85200d7f21d9ee768cde18c7b9e87a2364ac5374093190082bb62d5e6","blockSize":4194304,"blocks":["afc8cee85200d7f21d9ee768cde18c7b9e87a2364ac5374093190082bb62d5e6"]}},"_interopRequireDefault.js":{"size":773,"offset":"8091502","integrity":{"algorithm":"SHA256","hash":"5e019c6f756b788d30d43d5437042e263c92bec3618ace15a70f69762a5292fa","blockSize":4194304,"blocks":["5e019c6f756b788d30d43d5437042e263c92bec3618ace15a70f69762a5292fa"]}},"_interopRequireDefault.js.map":{"size":2337,"offset":"8092275","integrity":{"algorithm":"SHA256","hash":"4593db648ab8f757c302c6db4b0f90af0ee4b8922e38bdcb58a76a57e62ce123","blockSize":4194304,"blocks":["4593db648ab8f757c302c6db4b0f90af0ee4b8922e38bdcb58a76a57e62ce123"]}},"_interopRequireWildcard.js":{"size":1100,"offset":"8094612","integrity":{"algorithm":"SHA256","hash":"aa8efabe00fb1d055e3b5850bddc5cb8bcbef288d7c02845e242dcd73e05e697","blockSize":4194304,"blocks":["aa8efabe00fb1d055e3b5850bddc5cb8bcbef288d7c02845e242dcd73e05e697"]}},"_interopRequireWildcard.js.map":{"size":2756,"offset":"8095712","integrity":{"algorithm":"SHA256","hash":"cd018ee19f97da4a2b623d81733020a60898b72949d18d66890f1b95e6fde63b","blockSize":4194304,"blocks":["cd018ee19f97da4a2b623d81733020a60898b72949d18d66890f1b95e6fde63b"]}},"_nullishCoalesce.js":{"size":2325,"offset":"8098468","integrity":{"algorithm":"SHA256","hash":"88c2c8ef8d6f120e1dd77023c359aa1aa794d8d9499329b49304b52b9e036401","blockSize":4194304,"blocks":["88c2c8ef8d6f120e1dd77023c359aa1aa794d8d9499329b49304b52b9e036401"]}},"_nullishCoalesce.js.map":{"size":2760,"offset":"8100793","integrity":{"algorithm":"SHA256","hash":"5b130c39e2eafdb40b6f6afdd1020e6aedcbd419e43ff8cbb3b23653540e9f5f","blockSize":4194304,"blocks":["5b130c39e2eafdb40b6f6afdd1020e6aedcbd419e43ff8cbb3b23653540e9f5f"]}},"_optionalChain.js":{"size":2078,"offset":"8103553","integrity":{"algorithm":"SHA256","hash":"1ee843ca2bfea7098922260d3635eff2870dc54665e1506349ffd0630d0889d5","blockSize":4194304,"blocks":["1ee843ca2bfea7098922260d3635eff2870dc54665e1506349ffd0630d0889d5"]}},"_optionalChain.js.map":{"size":4592,"offset":"8105631","integrity":{"algorithm":"SHA256","hash":"093ae378778f2a2db7a6149a200197a14f26b275bbb49a2ecf2737a09f8e286e","blockSize":4194304,"blocks":["093ae378778f2a2db7a6149a200197a14f26b275bbb49a2ecf2737a09f8e286e"]}},"_optionalChainDelete.js":{"size":1752,"offset":"8110223","integrity":{"algorithm":"SHA256","hash":"8f188ac106b32bfe3aee2327b41cfa90d4cf9544aa87e5aaedcfb851eda9d725","blockSize":4194304,"blocks":["8f188ac106b32bfe3aee2327b41cfa90d4cf9544aa87e5aaedcfb851eda9d725"]}},"_optionalChainDelete.js.map":{"size":3285,"offset":"8111975","integrity":{"algorithm":"SHA256","hash":"39d0fdce2a18a202a99c6767143057afae59f767383e9072fb4b61dd0b738a46","blockSize":4194304,"blocks":["39d0fdce2a18a202a99c6767143057afae59f767383e9072fb4b61dd0b738a46"]}},"index.js":{"size":1941,"offset":"8115260","integrity":{"algorithm":"SHA256","hash":"d9f5d62ef7202f95d383d30e7565f00e4b162fee8824d5d76b59d62f8498bc7d","blockSize":4194304,"blocks":["d9f5d62ef7202f95d383d30e7565f00e4b162fee8824d5d76b59d62f8498bc7d"]}},"index.js.map":{"size":119,"offset":"8117201","integrity":{"algorithm":"SHA256","hash":"0c5dc15172281e234b174c93608c0784d0666401fab1e23d1ae693946ad9263a","blockSize":4194304,"blocks":["0c5dc15172281e234b174c93608c0784d0666401fab1e23d1ae693946ad9263a"]}},"README.md":{"size":2576,"offset":"8117320","integrity":{"algorithm":"SHA256","hash":"b4eae9051a5b27044c779f8d6faa8d37197ea16132c7ed51f833600a719ebb46","blockSize":4194304,"blocks":["b4eae9051a5b27044c779f8d6faa8d37197ea16132c7ed51f833600a719ebb46"]}}}},"clientreport.js":{"size":727,"offset":"8119896","integrity":{"algorithm":"SHA256","hash":"1424c28a7d725a1c43a2b84795a9b940ee7c85a539a9248246d52982de5d9767","blockSize":4194304,"blocks":["1424c28a7d725a1c43a2b84795a9b940ee7c85a539a9248246d52982de5d9767"]}},"clientreport.js.map":{"size":1318,"offset":"8120623","integrity":{"algorithm":"SHA256","hash":"573a6a7e0ddb50ed34b74bf30cc1a7cc0c9b506733526cb8e05d43bb792a7daa","blockSize":4194304,"blocks":["573a6a7e0ddb50ed34b74bf30cc1a7cc0c9b506733526cb8e05d43bb792a7daa"]}},"dsn.js":{"size":3180,"offset":"8121941","integrity":{"algorithm":"SHA256","hash":"777ce346f128ce02db6908f8308085faa55ea9b6ce41f2afc466db60e733f394","blockSize":4194304,"blocks":["777ce346f128ce02db6908f8308085faa55ea9b6ce41f2afc466db60e733f394"]}},"dsn.js.map":{"size":6707,"offset":"8125121","integrity":{"algorithm":"SHA256","hash":"3cdef0bee05f18bc491226718d8a429ca9abdf191a2b1c771abf7bab55129000","blockSize":4194304,"blocks":["3cdef0bee05f18bc491226718d8a429ca9abdf191a2b1c771abf7bab55129000"]}},"env.js":{"size":1613,"offset":"8131828","integrity":{"algorithm":"SHA256","hash":"a49d0e3baa162954256b8ef669a44685692e2f660fa5ab92e640ad124e668dda","blockSize":4194304,"blocks":["a49d0e3baa162954256b8ef669a44685692e2f660fa5ab92e640ad124e668dda"]}},"env.js.map":{"size":2027,"offset":"8133441","integrity":{"algorithm":"SHA256","hash":"adf8b029ea6feeef5c1a5277a6c7eeb9e29920d94320e38b3b19533cff367079","blockSize":4194304,"blocks":["adf8b029ea6feeef5c1a5277a6c7eeb9e29920d94320e38b3b19533cff367079"]}},"envelope.js":{"size":6925,"offset":"8135468","integrity":{"algorithm":"SHA256","hash":"cc479fddb769c8bd3b121bb98280520d9d6f57bf9aa7a19a4909cebc6af60015","blockSize":4194304,"blocks":["cc479fddb769c8bd3b121bb98280520d9d6f57bf9aa7a19a4909cebc6af60015"]}},"envelope.js.map":{"size":13468,"offset":"8142393","integrity":{"algorithm":"SHA256","hash":"b3f6f891cfcbfed1323f6836b514a44407c8f7427b531163febed7558b9d8628","blockSize":4194304,"blocks":["b3f6f891cfcbfed1323f6836b514a44407c8f7427b531163febed7558b9d8628"]}},"error.js":{"size":819,"offset":"8155861","integrity":{"algorithm":"SHA256","hash":"7280e3429324d5cdbad6b0dbcd180b299100ab9d924bb8bfe133065281fe23fd","blockSize":4194304,"blocks":["7280e3429324d5cdbad6b0dbcd180b299100ab9d924bb8bfe133065281fe23fd"]}},"error.js.map":{"size":1325,"offset":"8156680","integrity":{"algorithm":"SHA256","hash":"bf4384e47f2b80511e254987ce9310ce9938f99d28b7c89e878ea67948dc552a","blockSize":4194304,"blocks":["bf4384e47f2b80511e254987ce9310ce9938f99d28b7c89e878ea67948dc552a"]}},"index.js":{"size":8501,"offset":"8158005","integrity":{"algorithm":"SHA256","hash":"581647e2d57928eb953c04c3113d9d403df54adf666ef2c39ec111ab9ce0d68f","blockSize":4194304,"blocks":["581647e2d57928eb953c04c3113d9d403df54adf666ef2c39ec111ab9ce0d68f"]}},"index.js.map":{"size":259,"offset":"8166506","integrity":{"algorithm":"SHA256","hash":"6f468bce18b32f24809a0c56633706b5606a7007ef59ab3f091a35b91190a8d2","blockSize":4194304,"blocks":["6f468bce18b32f24809a0c56633706b5606a7007ef59ab3f091a35b91190a8d2"]}},"instrument.js":{"size":19360,"offset":"8166765","integrity":{"algorithm":"SHA256","hash":"0125960102f9766291fdbc8c04f4c8a4f2c71ab3ae4c844fde4cc3468017e985","blockSize":4194304,"blocks":["0125960102f9766291fdbc8c04f4c8a4f2c71ab3ae4c844fde4cc3468017e985"]}},"instrument.js.map":{"size":36880,"offset":"8186125","integrity":{"algorithm":"SHA256","hash":"8ad18353206ffb95b8ff323810d7ef80dff8eb7c09632ebca769973064ce3e62","blockSize":4194304,"blocks":["8ad18353206ffb95b8ff323810d7ef80dff8eb7c09632ebca769973064ce3e62"]}},"is.js":{"size":4878,"offset":"8223005","integrity":{"algorithm":"SHA256","hash":"6635ef44a9107f598295946aaf9ff6960df0d855a37ec0d79c3c85e0f84effc9","blockSize":4194304,"blocks":["6635ef44a9107f598295946aaf9ff6960df0d855a37ec0d79c3c85e0f84effc9"]}},"is.js.map":{"size":7745,"offset":"8227883","integrity":{"algorithm":"SHA256","hash":"7bc32370d4bf406c50f57541dc93b89456c193c7907bce6ae1c356e2281086b4","blockSize":4194304,"blocks":["7bc32370d4bf406c50f57541dc93b89456c193c7907bce6ae1c356e2281086b4"]}},"logger.js":{"size":2403,"offset":"8235628","integrity":{"algorithm":"SHA256","hash":"fd483ce020f77bf87b75f36c3b80f07b2787932671d8ec93e9be0a9e5a5fa99c","blockSize":4194304,"blocks":["fd483ce020f77bf87b75f36c3b80f07b2787932671d8ec93e9be0a9e5a5fa99c"]}},"logger.js.map":{"size":4897,"offset":"8238031","integrity":{"algorithm":"SHA256","hash":"9d4a69df26124471abad2ea2f1f13396f223293efbd210e7e47ee698d72a44b6","blockSize":4194304,"blocks":["9d4a69df26124471abad2ea2f1f13396f223293efbd210e7e47ee698d72a44b6"]}},"memo.js":{"size":1096,"offset":"8242928","integrity":{"algorithm":"SHA256","hash":"a8f46f1354c5033ede3a7cba23497e9fcca4b371ba2d52c49f42ce88faf9e2ca","blockSize":4194304,"blocks":["a8f46f1354c5033ede3a7cba23497e9fcca4b371ba2d52c49f42ce88faf9e2ca"]}},"memo.js.map":{"size":2383,"offset":"8244024","integrity":{"algorithm":"SHA256","hash":"a275f22ae0db7b4747fea6bcc38e2c99f92e0036ca64719370c36fad098b40eb","blockSize":4194304,"blocks":["a275f22ae0db7b4747fea6bcc38e2c99f92e0036ca64719370c36fad098b40eb"]}},"misc.js":{"size":7809,"offset":"8246407","integrity":{"algorithm":"SHA256","hash":"e92f45fd41b39f8e0518e2e2d2c8bc5c6798f5f07763c345d9cd86c84797090a","blockSize":4194304,"blocks":["e92f45fd41b39f8e0518e2e2d2c8bc5c6798f5f07763c345d9cd86c84797090a"]}},"misc.js.map":{"size":13463,"offset":"8254216","integrity":{"algorithm":"SHA256","hash":"65a6864b980c54d6564ab5cc77621b796cdf6611a4e8210c72f061beb55d43a0","blockSize":4194304,"blocks":["65a6864b980c54d6564ab5cc77621b796cdf6611a4e8210c72f061beb55d43a0"]}},"node-stack-trace.js":{"size":2703,"offset":"8267679","integrity":{"algorithm":"SHA256","hash":"23d68b12be26838879cea6098007724108761982a0b4e7d52a568d426a4eef34","blockSize":4194304,"blocks":["23d68b12be26838879cea6098007724108761982a0b4e7d52a568d426a4eef34"]}},"node-stack-trace.js.map":{"size":7046,"offset":"8270382","integrity":{"algorithm":"SHA256","hash":"3665e26c536b19b32fa0a133f6f3910b6813ebd8262048cdfc2bad29e26bb023","blockSize":4194304,"blocks":["3665e26c536b19b32fa0a133f6f3910b6813ebd8262048cdfc2bad29e26bb023"]}},"node.js":{"size":2267,"offset":"8277428","integrity":{"algorithm":"SHA256","hash":"6a7ba4c06dec06587391ab6cc0871d37f46f4ff2be89129af81c9160bdbdbee8","blockSize":4194304,"blocks":["6a7ba4c06dec06587391ab6cc0871d37f46f4ff2be89129af81c9160bdbdbee8"]}},"node.js.map":{"size":3257,"offset":"8279695","integrity":{"algorithm":"SHA256","hash":"50bdc950b3e0526e3d61b223f0f24dcffed6d28614cebf5df15f5bd59ffc4b73","blockSize":4194304,"blocks":["50bdc950b3e0526e3d61b223f0f24dcffed6d28614cebf5df15f5bd59ffc4b73"]}},"normalize.js":{"size":9477,"offset":"8282952","integrity":{"algorithm":"SHA256","hash":"c9138480c67d52cfd16fb237a463de9af8b6514d3f08c9d64cd2650303e7bd50","blockSize":4194304,"blocks":["c9138480c67d52cfd16fb237a463de9af8b6514d3f08c9d64cd2650303e7bd50"]}},"normalize.js.map":{"size":15907,"offset":"8292429","integrity":{"algorithm":"SHA256","hash":"51131534355224fff3e7dc10ea026b8c70d259e33727fc84fcef8bd02836ac47","blockSize":4194304,"blocks":["51131534355224fff3e7dc10ea026b8c70d259e33727fc84fcef8bd02836ac47"]}},"object.js":{"size":9449,"offset":"8308336","integrity":{"algorithm":"SHA256","hash":"c7a434722a91ac9496709dd22e563724f558ae13a58383f747283cafe6e389d3","blockSize":4194304,"blocks":["c7a434722a91ac9496709dd22e563724f558ae13a58383f747283cafe6e389d3"]}},"object.js.map":{"size":16337,"offset":"8317785","integrity":{"algorithm":"SHA256","hash":"e00a744a019e54d53228ac9f7311f1d8165cb1f62f84451bf42f21cf851e5249","blockSize":4194304,"blocks":["e00a744a019e54d53228ac9f7311f1d8165cb1f62f84451bf42f21cf851e5249"]}},"path.js":{"size":5629,"offset":"8334122","integrity":{"algorithm":"SHA256","hash":"c57499d46356b7d57dc27352cdc0e6f9dd0225874e61cedef17368a9f12ccef3","blockSize":4194304,"blocks":["c57499d46356b7d57dc27352cdc0e6f9dd0225874e61cedef17368a9f12ccef3"]}},"path.js.map":{"size":11083,"offset":"8339751","integrity":{"algorithm":"SHA256","hash":"391591273e2343464490efcda6cae699a99d6342a98e4a52fee8387b83f77a68","blockSize":4194304,"blocks":["391591273e2343464490efcda6cae699a99d6342a98e4a52fee8387b83f77a68"]}},"promisebuffer.js":{"size":3592,"offset":"8350834","integrity":{"algorithm":"SHA256","hash":"d499b3060c91b0d429058e64455647ab49c84a1e91f8c9351c4342a61aa41c0f","blockSize":4194304,"blocks":["d499b3060c91b0d429058e64455647ab49c84a1e91f8c9351c4342a61aa41c0f"]}},"promisebuffer.js.map":{"size":6050,"offset":"8354426","integrity":{"algorithm":"SHA256","hash":"5844b22040268cc91ec996e37f0406fbb0f9f0d6b3c8c0c8f756a47d2277b68e","blockSize":4194304,"blocks":["5844b22040268cc91ec996e37f0406fbb0f9f0d6b3c8c0c8f756a47d2277b68e"]}},"ratelimit.js":{"size":3349,"offset":"8360476","integrity":{"algorithm":"SHA256","hash":"7d6ac99f80161c61e002bdb553055bf569618346caae4f608b887aad49379892","blockSize":4194304,"blocks":["7d6ac99f80161c61e002bdb553055bf569618346caae4f608b887aad49379892"]}},"ratelimit.js.map":{"size":5672,"offset":"8363825","integrity":{"algorithm":"SHA256","hash":"d975b7b3b67779bae51da39d0798c10371d68cbfc2a0a26c635da178e63a329c","blockSize":4194304,"blocks":["d975b7b3b67779bae51da39d0798c10371d68cbfc2a0a26c635da178e63a329c"]}},"requestdata.js":{"size":9445,"offset":"8369497","integrity":{"algorithm":"SHA256","hash":"6da5d4189f326912d2c5276e30a32dabc0fafd7cee8004294d2a82bf5321071f","blockSize":4194304,"blocks":["6da5d4189f326912d2c5276e30a32dabc0fafd7cee8004294d2a82bf5321071f"]}},"requestdata.js.map":{"size":19396,"offset":"8378942","integrity":{"algorithm":"SHA256","hash":"280d0c5823a6e1d57a932ef88cab5f35441122169f22b3e176c061589785176d","blockSize":4194304,"blocks":["280d0c5823a6e1d57a932ef88cab5f35441122169f22b3e176c061589785176d"]}},"severity.js":{"size":1725,"offset":"8398338","integrity":{"algorithm":"SHA256","hash":"73be4159dfbe71cf2cbcdb944320be6eb894cc6273d8789926110ccea5c9f558","blockSize":4194304,"blocks":["73be4159dfbe71cf2cbcdb944320be6eb894cc6273d8789926110ccea5c9f558"]}},"severity.js.map":{"size":2299,"offset":"8400063","integrity":{"algorithm":"SHA256","hash":"f87913645d63e68d2787c8360c035f7e7ddcdf805eac6aba303226caa38ba72d","blockSize":4194304,"blocks":["f87913645d63e68d2787c8360c035f7e7ddcdf805eac6aba303226caa38ba72d"]}},"stacktrace.js":{"size":4725,"offset":"8402362","integrity":{"algorithm":"SHA256","hash":"009fd3333749d0ef1baf704dcf19ada9b85b479645c032fbc102320218d43903","blockSize":4194304,"blocks":["009fd3333749d0ef1baf704dcf19ada9b85b479645c032fbc102320218d43903"]}},"stacktrace.js.map":{"size":7812,"offset":"8407087","integrity":{"algorithm":"SHA256","hash":"ee35fa2bca156e24ca3c59640019d922c70b30933512131afa5115a865f16394","blockSize":4194304,"blocks":["ee35fa2bca156e24ca3c59640019d922c70b30933512131afa5115a865f16394"]}},"string.js":{"size":3764,"offset":"8414899","integrity":{"algorithm":"SHA256","hash":"f59a4b5fa5fb0718bfa2f77a5db2172bbcfd376bbba434c633b4ff6b0aa3d3f0","blockSize":4194304,"blocks":["f59a4b5fa5fb0718bfa2f77a5db2172bbcfd376bbba434c633b4ff6b0aa3d3f0"]}},"string.js.map":{"size":6705,"offset":"8418663","integrity":{"algorithm":"SHA256","hash":"5dfd3fe2ce97cca84c6ebea90837819459109f32773f63cb9c61551906939a7c","blockSize":4194304,"blocks":["5dfd3fe2ce97cca84c6ebea90837819459109f32773f63cb9c61551906939a7c"]}},"supports.js":{"size":4591,"offset":"8425368","integrity":{"algorithm":"SHA256","hash":"cc94ccc47ddc8f6f88db0f2999ea79326a436f9c8dd3b9fffda82df6c01568fe","blockSize":4194304,"blocks":["cc94ccc47ddc8f6f88db0f2999ea79326a436f9c8dd3b9fffda82df6c01568fe"]}},"supports.js.map":{"size":7176,"offset":"8429959","integrity":{"algorithm":"SHA256","hash":"ec7f63d4e1fd88ffd92caceccb1e7edd889e35b4dbe1a7f4fb7411ae08694226","blockSize":4194304,"blocks":["ec7f63d4e1fd88ffd92caceccb1e7edd889e35b4dbe1a7f4fb7411ae08694226"]}},"syncpromise.js":{"size":4495,"offset":"8437135","integrity":{"algorithm":"SHA256","hash":"4e878784cfaae64ee1dc8853ca910b6a0f9729f7a7aa8d85fa0723d7221ace26","blockSize":4194304,"blocks":["4e878784cfaae64ee1dc8853ca910b6a0f9729f7a7aa8d85fa0723d7221ace26"]}},"syncpromise.js.map":{"size":9860,"offset":"8441630","integrity":{"algorithm":"SHA256","hash":"f5ad161940753b26bc15688b0ed26431c3d70803fcf9bda56f849d8bdd4516dc","blockSize":4194304,"blocks":["f5ad161940753b26bc15688b0ed26431c3d70803fcf9bda56f849d8bdd4516dc"]}},"time.js":{"size":7759,"offset":"8451490","integrity":{"algorithm":"SHA256","hash":"36ab2a72c4c7f681520a8f82f06b4d6039fd4234c0c85b5379091aefdd83f0b7","blockSize":4194304,"blocks":["36ab2a72c4c7f681520a8f82f06b4d6039fd4234c0c85b5379091aefdd83f0b7"]}},"time.js.map":{"size":11030,"offset":"8459249","integrity":{"algorithm":"SHA256","hash":"fa611e5382fb3dc2d891d407bb13619786ba4e997b32b1374ec1310016ff3c97","blockSize":4194304,"blocks":["fa611e5382fb3dc2d891d407bb13619786ba4e997b32b1374ec1310016ff3c97"]}},"tracing.js":{"size":1094,"offset":"8470279","integrity":{"algorithm":"SHA256","hash":"9526adf0cd529631b0e328ce892128308b79e3b0ea3f96376d2c8a07103c5c18","blockSize":4194304,"blocks":["9526adf0cd529631b0e328ce892128308b79e3b0ea3f96376d2c8a07103c5c18"]}},"tracing.js.map":{"size":1857,"offset":"8471373","integrity":{"algorithm":"SHA256","hash":"b5c915205408edc1885cf0dedc372fe5a22a4153ab34d84ee69f56deb3cd0b12","blockSize":4194304,"blocks":["b5c915205408edc1885cf0dedc372fe5a22a4153ab34d84ee69f56deb3cd0b12"]}},"url.js":{"size":2341,"offset":"8473230","integrity":{"algorithm":"SHA256","hash":"6c280a28c17ce48703ee284399c28d6d90641e14bbb7bfabb58bc26942c4029a","blockSize":4194304,"blocks":["6c280a28c17ce48703ee284399c28d6d90641e14bbb7bfabb58bc26942c4029a"]}},"url.js.map":{"size":3964,"offset":"8475571","integrity":{"algorithm":"SHA256","hash":"bb8fd61475a16716ce98d95acae241cc46e6576fe67eeedf2aab75077de8a2da","blockSize":4194304,"blocks":["bb8fd61475a16716ce98d95acae241cc46e6576fe67eeedf2aab75077de8a2da"]}},"userIntegrations.js":{"size":3919,"offset":"8479535","integrity":{"algorithm":"SHA256","hash":"24c6c795c95e8f7f7181ee71cf96290cb4f05e2800ae97596909b57287593f5b","blockSize":4194304,"blocks":["24c6c795c95e8f7f7181ee71cf96290cb4f05e2800ae97596909b57287593f5b"]}},"userIntegrations.js.map":{"size":6857,"offset":"8483454","integrity":{"algorithm":"SHA256","hash":"d2a8dd027b2f06be608890a5a9ef18ff7558a0b1a20375445f3e42e2ed388c58","blockSize":4194304,"blocks":["d2a8dd027b2f06be608890a5a9ef18ff7558a0b1a20375445f3e42e2ed388c58"]}},"vendor":{"files":{"escapeStringForRegex.js":{"size":2198,"offset":"8490311","integrity":{"algorithm":"SHA256","hash":"7d4fdc8f7a22734f7a520f19e646465b411a34a4fd892d6022c4aa27d0f5163c","blockSize":4194304,"blocks":["7d4fdc8f7a22734f7a520f19e646465b411a34a4fd892d6022c4aa27d0f5163c"]}},"escapeStringForRegex.js.map":{"size":2542,"offset":"8492509","integrity":{"algorithm":"SHA256","hash":"56d1cd6681240115fe1bad85e68cb48ed870c76cb5dad37b3c95c2af10377b54","blockSize":4194304,"blocks":["56d1cd6681240115fe1bad85e68cb48ed870c76cb5dad37b3c95c2af10377b54"]}},"supportsHistory.js":{"size":1235,"offset":"8495051","integrity":{"algorithm":"SHA256","hash":"455d0608781cc33d7ea3fd5bb64ec4319b176822146acd378c19b78c76d0c991","blockSize":4194304,"blocks":["455d0608781cc33d7ea3fd5bb64ec4319b176822146acd378c19b78c76d0c991"]}},"supportsHistory.js.map":{"size":2921,"offset":"8496286","integrity":{"algorithm":"SHA256","hash":"45ada04da0e1f2e53fbef0a1364a6c17b407de07c91d69bbe9730257ad8049de","blockSize":4194304,"blocks":["45ada04da0e1f2e53fbef0a1364a6c17b407de07c91d69bbe9730257ad8049de"]}}}},"worldwide.js":{"size":3202,"offset":"8499207","integrity":{"algorithm":"SHA256","hash":"11d6ae7c2f07c21a889a072548baa29f129ab9daa9e1eb0c76417edb5047c4a6","blockSize":4194304,"blocks":["11d6ae7c2f07c21a889a072548baa29f129ab9daa9e1eb0c76417edb5047c4a6"]}},"worldwide.js.map":{"size":6287,"offset":"8502409","integrity":{"algorithm":"SHA256","hash":"635d95b37dd66a83cccd0bba40fc50bbd2821b04b91cc9f4719593b26b65e641","blockSize":4194304,"blocks":["635d95b37dd66a83cccd0bba40fc50bbd2821b04b91cc9f4719593b26b65e641"]}}}},"esm":{"files":{"baggage.js":{"size":5598,"offset":"8508696","integrity":{"algorithm":"SHA256","hash":"e256cbd02c140e7b53faa2f88a38456a65f6b8813abb5a1832349785a581599e","blockSize":4194304,"blocks":["e256cbd02c140e7b53faa2f88a38456a65f6b8813abb5a1832349785a581599e"]}},"baggage.js.map":{"size":9147,"offset":"8514294","integrity":{"algorithm":"SHA256","hash":"1e319781070f564bb7d4432d3d8a69d4807e6c7214e76578b78e21bd0afb8b19","blockSize":4194304,"blocks":["1e319781070f564bb7d4432d3d8a69d4807e6c7214e76578b78e21bd0afb8b19"]}},"browser.js":{"size":4394,"offset":"8523441","integrity":{"algorithm":"SHA256","hash":"faa166811ea4598ce49a6ed00c52f4cb07ac449d79120e68186d31edb7e2738a","blockSize":4194304,"blocks":["faa166811ea4598ce49a6ed00c52f4cb07ac449d79120e68186d31edb7e2738a"]}},"browser.js.map":{"size":8550,"offset":"8527835","integrity":{"algorithm":"SHA256","hash":"7462e345ca9f9d738691902ee5e4edae85304070374da2959f6f4275c31798c6","blockSize":4194304,"blocks":["7462e345ca9f9d738691902ee5e4edae85304070374da2959f6f4275c31798c6"]}},"buildPolyfills":{"files":{"_asyncNullishCoalesce.js":{"size":1188,"offset":"8536385","integrity":{"algorithm":"SHA256","hash":"f9ca34056ea8c54e34fabc24f8c5926abced13efc4e5f5d0e1bd5d28cc78e394","blockSize":4194304,"blocks":["f9ca34056ea8c54e34fabc24f8c5926abced13efc4e5f5d0e1bd5d28cc78e394"]}},"_asyncNullishCoalesce.js.map":{"size":2761,"offset":"8537573","integrity":{"algorithm":"SHA256","hash":"663454b0509ea0e239b81162a46459678275621ae11e9c4468bed912ef149ba4","blockSize":4194304,"blocks":["663454b0509ea0e239b81162a46459678275621ae11e9c4468bed912ef149ba4"]}},"_asyncOptionalChain.js":{"size":2127,"offset":"8540334","integrity":{"algorithm":"SHA256","hash":"36bb0a63e9d572d7462a16abeec03f2557e1dc1406cc34c4775d9f6dfafa00b9","blockSize":4194304,"blocks":["36bb0a63e9d572d7462a16abeec03f2557e1dc1406cc34c4775d9f6dfafa00b9"]}},"_asyncOptionalChain.js.map":{"size":4746,"offset":"8542461","integrity":{"algorithm":"SHA256","hash":"3cc1d8a77c1a8f4fe2ff47064fdabda1378e79cea1bc0a5b2bc9ca3fb6145830","blockSize":4194304,"blocks":["3cc1d8a77c1a8f4fe2ff47064fdabda1378e79cea1bc0a5b2bc9ca3fb6145830"]}},"_asyncOptionalChainDelete.js":{"size":1639,"offset":"8547207","integrity":{"algorithm":"SHA256","hash":"df31db3a8ec5b7fb48d1d5e6ef78186a99c26ffbf16330f852a1775861b9fb8a","blockSize":4194304,"blocks":["df31db3a8ec5b7fb48d1d5e6ef78186a99c26ffbf16330f852a1775861b9fb8a"]}},"_asyncOptionalChainDelete.js.map":{"size":3299,"offset":"8548846","integrity":{"algorithm":"SHA256","hash":"97c43485972c45596591e67f2bbb015d5d3abf9fca716cc8db93987b343656cc","blockSize":4194304,"blocks":["97c43485972c45596591e67f2bbb015d5d3abf9fca716cc8db93987b343656cc"]}},"_createNamedExportFrom.js":{"size":738,"offset":"8552145","integrity":{"algorithm":"SHA256","hash":"4c01937b8272276b20d2dfa9edd560570e808c64fde6722d3d7480c1c874237f","blockSize":4194304,"blocks":["4c01937b8272276b20d2dfa9edd560570e808c64fde6722d3d7480c1c874237f"]}},"_createNamedExportFrom.js.map":{"size":2445,"offset":"8552883","integrity":{"algorithm":"SHA256","hash":"748ff2b775d4fea506f3a1a9d3feb3e7d46cd88e358118703c0cceb430544f16","blockSize":4194304,"blocks":["748ff2b775d4fea506f3a1a9d3feb3e7d46cd88e358118703c0cceb430544f16"]}},"_createStarExport.js":{"size":801,"offset":"8555328","integrity":{"algorithm":"SHA256","hash":"4a77a6f3ea70e6a02a089019bd7cb3fadb75befde6a69347fd5c86138cd58c31","blockSize":4194304,"blocks":["4a77a6f3ea70e6a02a089019bd7cb3fadb75befde6a69347fd5c86138cd58c31"]}},"_createStarExport.js.map":{"size":2674,"offset":"8556129","integrity":{"algorithm":"SHA256","hash":"bd867898141285e5b4d34a600fc9b24b42201c4bbfc64fc2ea835a79b55a50e8","blockSize":4194304,"blocks":["bd867898141285e5b4d34a600fc9b24b42201c4bbfc64fc2ea835a79b55a50e8"]}},"_interopDefault.js":{"size":577,"offset":"8558803","integrity":{"algorithm":"SHA256","hash":"1231481356015bf2be38f44c62f9ca035300aeca0c2b357da416d6871aba77be","blockSize":4194304,"blocks":["1231481356015bf2be38f44c62f9ca035300aeca0c2b357da416d6871aba77be"]}},"_interopDefault.js.map":{"size":2235,"offset":"8559380","integrity":{"algorithm":"SHA256","hash":"11a4a0a56decd2952aaa7cf19a0b38b2eb508fc105a8f5195fb0df9f1ae96ba2","blockSize":4194304,"blocks":["11a4a0a56decd2952aaa7cf19a0b38b2eb508fc105a8f5195fb0df9f1ae96ba2"]}},"_interopNamespace.js":{"size":917,"offset":"8561615","integrity":{"algorithm":"SHA256","hash":"da7dbebe60a430026965f4e4d8035e0c34758268bdcfc73c20a086bb13ee2479","blockSize":4194304,"blocks":["da7dbebe60a430026965f4e4d8035e0c34758268bdcfc73c20a086bb13ee2479"]}},"_interopNamespace.js.map":{"size":2635,"offset":"8562532","integrity":{"algorithm":"SHA256","hash":"b71f54d3a78676f795df9cc3e9e8aaf3a00d0e16f4afb15f3b41ce576ece0541","blockSize":4194304,"blocks":["b71f54d3a78676f795df9cc3e9e8aaf3a00d0e16f4afb15f3b41ce576ece0541"]}},"_interopNamespaceDefaultOnly.js":{"size":647,"offset":"8565167","integrity":{"algorithm":"SHA256","hash":"dc99873285be36a8e97a0eb0621526232bbc279dc7d1962609cf6f2bbd2ab137","blockSize":4194304,"blocks":["dc99873285be36a8e97a0eb0621526232bbc279dc7d1962609cf6f2bbd2ab137"]}},"_interopNamespaceDefaultOnly.js.map":{"size":2326,"offset":"8565814","integrity":{"algorithm":"SHA256","hash":"57e3a6053c0e1710ae024450bc37dc90a3ba3f56c102dac6157f82a48bd42bea","blockSize":4194304,"blocks":["57e3a6053c0e1710ae024450bc37dc90a3ba3f56c102dac6157f82a48bd42bea"]}},"_interopRequireDefault.js":{"size":687,"offset":"8568140","integrity":{"algorithm":"SHA256","hash":"09e5c0cf2bc95f0d835e7d8c84c032dc287c4966faa005eea368d64e4d868398","blockSize":4194304,"blocks":["09e5c0cf2bc95f0d835e7d8c84c032dc287c4966faa005eea368d64e4d868398"]}},"_interopRequireDefault.js.map":{"size":2335,"offset":"8568827","integrity":{"algorithm":"SHA256","hash":"046474b4c1fd9fe59fa4a73befdeed26881169b7646ee8d34efcde503824f096","blockSize":4194304,"blocks":["046474b4c1fd9fe59fa4a73befdeed26881169b7646ee8d34efcde503824f096"]}},"_interopRequireWildcard.js":{"size":1013,"offset":"8571162","integrity":{"algorithm":"SHA256","hash":"c5989f1bde0688719a25411d35455190fc0159236096878f98cf403f985ab646","blockSize":4194304,"blocks":["c5989f1bde0688719a25411d35455190fc0159236096878f98cf403f985ab646"]}},"_interopRequireWildcard.js.map":{"size":2754,"offset":"8572175","integrity":{"algorithm":"SHA256","hash":"201d1b429b881e9c5f2269ed29c3cdf2dc332d50de56daccb90758b6dc481d76","blockSize":4194304,"blocks":["201d1b429b881e9c5f2269ed29c3cdf2dc332d50de56daccb90758b6dc481d76"]}},"_nullishCoalesce.js":{"size":2245,"offset":"8574929","integrity":{"algorithm":"SHA256","hash":"bc4c3391c50a36ceb2c93751a99869816e8b03d04dc933a53d83cd98deddf217","blockSize":4194304,"blocks":["bc4c3391c50a36ceb2c93751a99869816e8b03d04dc933a53d83cd98deddf217"]}},"_nullishCoalesce.js.map":{"size":2758,"offset":"8577174","integrity":{"algorithm":"SHA256","hash":"ad87ea8ec9c1076b17290b40a58ab3c5d7fccee2d87cf7736e8bc46f704eb1a8","blockSize":4194304,"blocks":["ad87ea8ec9c1076b17290b40a58ab3c5d7fccee2d87cf7736e8bc46f704eb1a8"]}},"_optionalChain.js":{"size":2000,"offset":"8579932","integrity":{"algorithm":"SHA256","hash":"e4d23791dedb43c76c54312c9965897af1004a18ecedbb159c19d3fc6f013489","blockSize":4194304,"blocks":["e4d23791dedb43c76c54312c9965897af1004a18ecedbb159c19d3fc6f013489"]}},"_optionalChain.js.map":{"size":4590,"offset":"8581932","integrity":{"algorithm":"SHA256","hash":"8ce8f11e5d17cb14302c38369a66057c9be2fb611f587d287c79726227b71372","blockSize":4194304,"blocks":["8ce8f11e5d17cb14302c38369a66057c9be2fb611f587d287c79726227b71372"]}},"_optionalChainDelete.js":{"size":1652,"offset":"8586522","integrity":{"algorithm":"SHA256","hash":"592977e04a8dbc3bcf71b9a2b6325c9ca8da7d6af9da4e8f829496362a8c6513","blockSize":4194304,"blocks":["592977e04a8dbc3bcf71b9a2b6325c9ca8da7d6af9da4e8f829496362a8c6513"]}},"_optionalChainDelete.js.map":{"size":3265,"offset":"8588174","integrity":{"algorithm":"SHA256","hash":"6969935df27174bfcb04b45ff2be5fb67c5fd56ba7f981e0b1b9176f92d97a49","blockSize":4194304,"blocks":["6969935df27174bfcb04b45ff2be5fb67c5fd56ba7f981e0b1b9176f92d97a49"]}},"index.js":{"size":890,"offset":"8591439","integrity":{"algorithm":"SHA256","hash":"8dc90cb4755d7e3e4c750c20ca10a6edc3195e754c94b67bb6acf24ba726947b","blockSize":4194304,"blocks":["8dc90cb4755d7e3e4c750c20ca10a6edc3195e754c94b67bb6acf24ba726947b"]}},"index.js.map":{"size":101,"offset":"8592329","integrity":{"algorithm":"SHA256","hash":"561e74fb2560d99fd22eee52fea816d5583e6c4b94d9815f5dfbf9fb802a3c9e","blockSize":4194304,"blocks":["561e74fb2560d99fd22eee52fea816d5583e6c4b94d9815f5dfbf9fb802a3c9e"]}},"README.md":{"size":2576,"offset":"8592430","integrity":{"algorithm":"SHA256","hash":"b4eae9051a5b27044c779f8d6faa8d37197ea16132c7ed51f833600a719ebb46","blockSize":4194304,"blocks":["b4eae9051a5b27044c779f8d6faa8d37197ea16132c7ed51f833600a719ebb46"]}}}},"clientreport.js":{"size":645,"offset":"8595006","integrity":{"algorithm":"SHA256","hash":"c2f2e75203b050197dd5b824335c43e666fa688ffba2f1bea8abf8dea0fa1a21","blockSize":4194304,"blocks":["c2f2e75203b050197dd5b824335c43e666fa688ffba2f1bea8abf8dea0fa1a21"]}},"clientreport.js.map":{"size":1272,"offset":"8595651","integrity":{"algorithm":"SHA256","hash":"ddfa8def6170d5060ffd9b1d74e513cac3d5f012b5383d01072aa8f7b5e72300","blockSize":4194304,"blocks":["ddfa8def6170d5060ffd9b1d74e513cac3d5f012b5383d01072aa8f7b5e72300"]}},"dsn.js":{"size":3038,"offset":"8596923","integrity":{"algorithm":"SHA256","hash":"a3ace39f9a10c26c028a00a1ce4bf7ea24f9448c4d66f45f136f2fb133160d6a","blockSize":4194304,"blocks":["a3ace39f9a10c26c028a00a1ce4bf7ea24f9448c4d66f45f136f2fb133160d6a"]}},"dsn.js.map":{"size":6680,"offset":"8599961","integrity":{"algorithm":"SHA256","hash":"eafcddd2ec9b8650fc9b4d51ef2a539631c03a4800b5c0379ea95d806540f5ad","blockSize":4194304,"blocks":["eafcddd2ec9b8650fc9b4d51ef2a539631c03a4800b5c0379ea95d806540f5ad"]}},"env.js":{"size":1511,"offset":"8606641","integrity":{"algorithm":"SHA256","hash":"42915bd63735b55a0bd808e1e1f872122996175582e83ab6f0135d66e1d5b998","blockSize":4194304,"blocks":["42915bd63735b55a0bd808e1e1f872122996175582e83ab6f0135d66e1d5b998"]}},"env.js.map":{"size":2024,"offset":"8608152","integrity":{"algorithm":"SHA256","hash":"9300252e6896ebf541fd68d9842f2100aaab9aceef31d99dfe14e99af10d5d7c","blockSize":4194304,"blocks":["9300252e6896ebf541fd68d9842f2100aaab9aceef31d99dfe14e99af10d5d7c"]}},"envelope.js":{"size":6527,"offset":"8610176","integrity":{"algorithm":"SHA256","hash":"443493963e3f8f2b95fd1e282219e6b6b5d337af34cdabb69d5fd4fc5dfda6aa","blockSize":4194304,"blocks":["443493963e3f8f2b95fd1e282219e6b6b5d337af34cdabb69d5fd4fc5dfda6aa"]}},"envelope.js.map":{"size":13399,"offset":"8616703","integrity":{"algorithm":"SHA256","hash":"075df9988e3c467455c717e9e2b2e20605994b47feeb8e82361762e47408dcaa","blockSize":4194304,"blocks":["075df9988e3c467455c717e9e2b2e20605994b47feeb8e82361762e47408dcaa"]}},"error.js":{"size":744,"offset":"8630102","integrity":{"algorithm":"SHA256","hash":"76c32af8dd3376e4dd4628757a90ceba7db824ebe00567485c19f9acbb6ea388","blockSize":4194304,"blocks":["76c32af8dd3376e4dd4628757a90ceba7db824ebe00567485c19f9acbb6ea388"]}},"error.js.map":{"size":1323,"offset":"8630846","integrity":{"algorithm":"SHA256","hash":"ca05b5308673dd83d843f7ccdc53301ffc41aef900ca50f83546530fcdfa9bee","blockSize":4194304,"blocks":["ca05b5308673dd83d843f7ccdc53301ffc41aef900ca50f83546530fcdfa9bee"]}},"index.js":{"size":3442,"offset":"8632169","integrity":{"algorithm":"SHA256","hash":"4a9e09005fb0a574d1c5fd274d9a6666d28f3e38855730c9e865380934691c5d","blockSize":4194304,"blocks":["4a9e09005fb0a574d1c5fd274d9a6666d28f3e38855730c9e865380934691c5d"]}},"index.js.map":{"size":119,"offset":"8635611","integrity":{"algorithm":"SHA256","hash":"0c5dc15172281e234b174c93608c0784d0666401fab1e23d1ae693946ad9263a","blockSize":4194304,"blocks":["0c5dc15172281e234b174c93608c0784d0666401fab1e23d1ae693946ad9263a"]}},"instrument.js":{"size":19108,"offset":"8635730","integrity":{"algorithm":"SHA256","hash":"b70c65043cbd9005546211a0cba490023cb1e8b1c3caaf54cc5499730712f749","blockSize":4194304,"blocks":["b70c65043cbd9005546211a0cba490023cb1e8b1c3caaf54cc5499730712f749"]}},"instrument.js.map":{"size":36734,"offset":"8654838","integrity":{"algorithm":"SHA256","hash":"f45c5936f6ec38422a036b7574247fe2eb6862107307fd378ba2a9519db74da3","blockSize":4194304,"blocks":["f45c5936f6ec38422a036b7574247fe2eb6862107307fd378ba2a9519db74da3"]}},"is.js":{"size":4529,"offset":"8691572","integrity":{"algorithm":"SHA256","hash":"65a29745386a139b2700e86e18bdd02582394fd18d2ce1b7089fe5374a7558da","blockSize":4194304,"blocks":["65a29745386a139b2700e86e18bdd02582394fd18d2ce1b7089fe5374a7558da"]}},"is.js.map":{"size":7730,"offset":"8696101","integrity":{"algorithm":"SHA256","hash":"bd6e4ce7471b9ca1926ce8c3d6782108d25d89a63527e6739465016cc04af211","blockSize":4194304,"blocks":["bd6e4ce7471b9ca1926ce8c3d6782108d25d89a63527e6739465016cc04af211"]}},"logger.js":{"size":2259,"offset":"8703831","integrity":{"algorithm":"SHA256","hash":"7266f17341d35b7641b1b96451c1ffd4cb8a2b50606d693f905bd78a717a3d28","blockSize":4194304,"blocks":["7266f17341d35b7641b1b96451c1ffd4cb8a2b50606d693f905bd78a717a3d28"]}},"logger.js.map":{"size":4846,"offset":"8706090","integrity":{"algorithm":"SHA256","hash":"52693eea82078ec67b4980d2b40b54e3a0d1d6ba268abe5a0a55108b7d1bd7c9","blockSize":4194304,"blocks":["52693eea82078ec67b4980d2b40b54e3a0d1d6ba268abe5a0a55108b7d1bd7c9"]}},"memo.js":{"size":1021,"offset":"8710936","integrity":{"algorithm":"SHA256","hash":"435fb4477fa8c857f942d7682ca7c462b445fea51280eb3830e4cb2350b01a8a","blockSize":4194304,"blocks":["435fb4477fa8c857f942d7682ca7c462b445fea51280eb3830e4cb2350b01a8a"]}},"memo.js.map":{"size":2381,"offset":"8711957","integrity":{"algorithm":"SHA256","hash":"10df8bd2f7ba4ea51199a5e6e83fc58aaf4b0a40ef02b493e5ba61e1f5c0cbcb","blockSize":4194304,"blocks":["10df8bd2f7ba4ea51199a5e6e83fc58aaf4b0a40ef02b493e5ba61e1f5c0cbcb"]}},"misc.js":{"size":7523,"offset":"8714338","integrity":{"algorithm":"SHA256","hash":"e137a729a0b4035869c1e0c018fb196972de9a5da172f5ed071a37d79d72d5a0","blockSize":4194304,"blocks":["e137a729a0b4035869c1e0c018fb196972de9a5da172f5ed071a37d79d72d5a0"]}},"misc.js.map":{"size":13398,"offset":"8721861","integrity":{"algorithm":"SHA256","hash":"f6421770faee1f95e52e8208092e1cc7a7061ff6543a1a6578184aba916797fd","blockSize":4194304,"blocks":["f6421770faee1f95e52e8208092e1cc7a7061ff6543a1a6578184aba916797fd"]}},"node-stack-trace.js":{"size":2635,"offset":"8735259","integrity":{"algorithm":"SHA256","hash":"762640f799a0d43748474b3d94ea7dee648d6d72d83361cd702a9d0051c2c433","blockSize":4194304,"blocks":["762640f799a0d43748474b3d94ea7dee648d6d72d83361cd702a9d0051c2c433"]}},"node-stack-trace.js.map":{"size":7044,"offset":"8737894","integrity":{"algorithm":"SHA256","hash":"e714756785ced3ee781639b9fb9623546cfcdc5f36dd6043d96f756dee1370be","blockSize":4194304,"blocks":["e714756785ced3ee781639b9fb9623546cfcdc5f36dd6043d96f756dee1370be"]}},"node.js":{"size":2155,"offset":"8744938","integrity":{"algorithm":"SHA256","hash":"0fa19e1b20eae0f83e888757ef239a603a63d052972966297b34316aa196923b","blockSize":4194304,"blocks":["0fa19e1b20eae0f83e888757ef239a603a63d052972966297b34316aa196923b"]}},"node.js.map":{"size":3234,"offset":"8747093","integrity":{"algorithm":"SHA256","hash":"ffd09e5a106ae2319f0991738c4d9151413ecc47555224b70bb1aa6f8dc2c57f","blockSize":4194304,"blocks":["ffd09e5a106ae2319f0991738c4d9151413ecc47555224b70bb1aa6f8dc2c57f"]}},"normalize.js":{"size":9377,"offset":"8750327","integrity":{"algorithm":"SHA256","hash":"a83e4771dec04553a93681102bac5aa7acab5992cccc0778580529975d350eda","blockSize":4194304,"blocks":["a83e4771dec04553a93681102bac5aa7acab5992cccc0778580529975d350eda"]}},"normalize.js.map":{"size":15804,"offset":"8759704","integrity":{"algorithm":"SHA256","hash":"e6c2100bce74ef73bcd84c0c02743d3abc3753663dd6fdc169fdfa1c56170bb5","blockSize":4194304,"blocks":["e6c2100bce74ef73bcd84c0c02743d3abc3753663dd6fdc169fdfa1c56170bb5"]}},"object.js":{"size":9181,"offset":"8775508","integrity":{"algorithm":"SHA256","hash":"212fe62645ffd4adb0c0f238d28a23d48e79d0f7bff905144bfc7df54bf5bebd","blockSize":4194304,"blocks":["212fe62645ffd4adb0c0f238d28a23d48e79d0f7bff905144bfc7df54bf5bebd"]}},"object.js.map":{"size":16211,"offset":"8784689","integrity":{"algorithm":"SHA256","hash":"e94e9fb16b1ae9d9f55d4563e1d36fedd7c967772d6ba0b7676ce78f55882d69","blockSize":4194304,"blocks":["e94e9fb16b1ae9d9f55d4563e1d36fedd7c967772d6ba0b7676ce78f55882d69"]}},"path.js":{"size":5442,"offset":"8800900","integrity":{"algorithm":"SHA256","hash":"47a29aef35a056439811891aca50376508ebcc925c8a30465be47fd889398999","blockSize":4194304,"blocks":["47a29aef35a056439811891aca50376508ebcc925c8a30465be47fd889398999"]}},"path.js.map":{"size":11075,"offset":"8806342","integrity":{"algorithm":"SHA256","hash":"0564005ed737bc0ff304667eac74e14f924dafc331202f7760dbb8f55ee38dbc","blockSize":4194304,"blocks":["0564005ed737bc0ff304667eac74e14f924dafc331202f7760dbb8f55ee38dbc"]}},"promisebuffer.js":{"size":3515,"offset":"8817417","integrity":{"algorithm":"SHA256","hash":"5f56ae00274c85e52a50408b2d0e61d1b900a2bf5eca011cad3a3ec3e1222e7b","blockSize":4194304,"blocks":["5f56ae00274c85e52a50408b2d0e61d1b900a2bf5eca011cad3a3ec3e1222e7b"]}},"promisebuffer.js.map":{"size":5971,"offset":"8820932","integrity":{"algorithm":"SHA256","hash":"6d9ead8fb013b5de970948176df99839d233197184511e4f53223051e8479d7f","blockSize":4194304,"blocks":["6d9ead8fb013b5de970948176df99839d233197184511e4f53223051e8479d7f"]}},"ratelimit.js":{"size":3159,"offset":"8826903","integrity":{"algorithm":"SHA256","hash":"68c7c4a5576ab4e778723c4b288ec45a1e6105b235ea028c6dfac9009ef527ef","blockSize":4194304,"blocks":["68c7c4a5576ab4e778723c4b288ec45a1e6105b235ea028c6dfac9009ef527ef"]}},"ratelimit.js.map":{"size":5666,"offset":"8830062","integrity":{"algorithm":"SHA256","hash":"516105735b0236cc271ada139413bca1b9217cc6a4af21055e685e3ddb9419e2","blockSize":4194304,"blocks":["516105735b0236cc271ada139413bca1b9217cc6a4af21055e685e3ddb9419e2"]}},"requestdata.js":{"size":9276,"offset":"8835728","integrity":{"algorithm":"SHA256","hash":"97c4a14e16542f36637dce4f2e7727dfcf7779a6688a74580eaa82209f7105a0","blockSize":4194304,"blocks":["97c4a14e16542f36637dce4f2e7727dfcf7779a6688a74580eaa82209f7105a0"]}},"requestdata.js.map":{"size":19320,"offset":"8845004","integrity":{"algorithm":"SHA256","hash":"cda1d0b3551cf84b79f923bcca9400c4656c30b80e6e245ce768a00f505d45ce","blockSize":4194304,"blocks":["cda1d0b3551cf84b79f923bcca9400c4656c30b80e6e245ce768a00f505d45ce"]}},"severity.js":{"size":1579,"offset":"8864324","integrity":{"algorithm":"SHA256","hash":"63573228d1991b96c87c903515cdd0467f7776f0e90c19fe37f54673d4141d07","blockSize":4194304,"blocks":["63573228d1991b96c87c903515cdd0467f7776f0e90c19fe37f54673d4141d07"]}},"severity.js.map":{"size":2295,"offset":"8865903","integrity":{"algorithm":"SHA256","hash":"303e19d3efd164b7c0a3fde923115862bc443fae7bcbee4bb5163fb272353f85","blockSize":4194304,"blocks":["303e19d3efd164b7c0a3fde923115862bc443fae7bcbee4bb5163fb272353f85"]}},"stacktrace.js":{"size":4480,"offset":"8868198","integrity":{"algorithm":"SHA256","hash":"90aad1c3ed4b12fcc69d8b4c58cf2318869469382d4cf70b85376ba41a876a82","blockSize":4194304,"blocks":["90aad1c3ed4b12fcc69d8b4c58cf2318869469382d4cf70b85376ba41a876a82"]}},"stacktrace.js.map":{"size":7798,"offset":"8872678","integrity":{"algorithm":"SHA256","hash":"5a7be9d1cddd920221dc6325712d5c806db1788e78a31efd5e85e45ec0bf5a5c","blockSize":4194304,"blocks":["5a7be9d1cddd920221dc6325712d5c806db1788e78a31efd5e85e45ec0bf5a5c"]}},"string.js":{"size":3597,"offset":"8880476","integrity":{"algorithm":"SHA256","hash":"bbfe3bb5de059f97c100e0b8abe0311ed26ec674030283b3d0dd12fdcf07a62c","blockSize":4194304,"blocks":["bbfe3bb5de059f97c100e0b8abe0311ed26ec674030283b3d0dd12fdcf07a62c"]}},"string.js.map":{"size":6675,"offset":"8884073","integrity":{"algorithm":"SHA256","hash":"d2ca2efbb5f32f3192c0d45f5b580f1446c23201d9936365a790d3a0312577bb","blockSize":4194304,"blocks":["d2ca2efbb5f32f3192c0d45f5b580f1446c23201d9936365a790d3a0312577bb"]}},"supports.js":{"size":4291,"offset":"8890748","integrity":{"algorithm":"SHA256","hash":"a2e120fc47a5438f84a476f1c110de6ee813fab8840d2cc0c2ea7af6953dda65","blockSize":4194304,"blocks":["a2e120fc47a5438f84a476f1c110de6ee813fab8840d2cc0c2ea7af6953dda65"]}},"supports.js.map":{"size":7138,"offset":"8895039","integrity":{"algorithm":"SHA256","hash":"d013afbeb054363b9e5c01e01ffcfc289b153854b9e077127162e3fce3c44228","blockSize":4194304,"blocks":["d013afbeb054363b9e5c01e01ffcfc289b153854b9e077127162e3fce3c44228"]}},"syncpromise.js":{"size":4364,"offset":"8902177","integrity":{"algorithm":"SHA256","hash":"1fd5f7ecdad76a3f0d54c59212ffb4448bc62c178dca2528f5c6f634a8c060a2","blockSize":4194304,"blocks":["1fd5f7ecdad76a3f0d54c59212ffb4448bc62c178dca2528f5c6f634a8c060a2"]}},"syncpromise.js.map":{"size":9843,"offset":"8906541","integrity":{"algorithm":"SHA256","hash":"46c7d8645b9cf8701488a4e635606cbe18e8c7a5197bfe4ed8c965d52e21dc46","blockSize":4194304,"blocks":["46c7d8645b9cf8701488a4e635606cbe18e8c7a5197bfe4ed8c965d52e21dc46"]}},"time.js":{"size":7544,"offset":"8916384","integrity":{"algorithm":"SHA256","hash":"ba7354dbe051285cd28b6537cc212ff8ccd846c1c0942c3cebc81e04f7e9cf2b","blockSize":4194304,"blocks":["ba7354dbe051285cd28b6537cc212ff8ccd846c1c0942c3cebc81e04f7e9cf2b"]}},"time.js.map":{"size":10937,"offset":"8923928","integrity":{"algorithm":"SHA256","hash":"56810c49472f45dea83666a0991a8d5b8fc7209f10670455a9a93c66ae4717e8","blockSize":4194304,"blocks":["56810c49472f45dea83666a0991a8d5b8fc7209f10670455a9a93c66ae4717e8"]}},"tracing.js":{"size":979,"offset":"8934865","integrity":{"algorithm":"SHA256","hash":"6c7318a9211424b3d5ca95c643da1f172c7c258074f5000227c8b0531c9b91e4","blockSize":4194304,"blocks":["6c7318a9211424b3d5ca95c643da1f172c7c258074f5000227c8b0531c9b91e4"]}},"tracing.js.map":{"size":1854,"offset":"8935844","integrity":{"algorithm":"SHA256","hash":"1d4552e2d70ee9cf24ebef13b8098e25738eb9ab2a0a8d12ff6f1f954d1100c1","blockSize":4194304,"blocks":["1d4552e2d70ee9cf24ebef13b8098e25738eb9ab2a0a8d12ff6f1f954d1100c1"]}},"url.js":{"size":2169,"offset":"8937698","integrity":{"algorithm":"SHA256","hash":"fa1b732e138b34a0656d2cf10bd0427e54b66b2784ae833c044206e2ac2191ec","blockSize":4194304,"blocks":["fa1b732e138b34a0656d2cf10bd0427e54b66b2784ae833c044206e2ac2191ec"]}},"url.js.map":{"size":3959,"offset":"8939867","integrity":{"algorithm":"SHA256","hash":"f01e1b921b6830550086651042cfd29e99545308958b0525ed8d83a109e73ca0","blockSize":4194304,"blocks":["f01e1b921b6830550086651042cfd29e99545308958b0525ed8d83a109e73ca0"]}},"userIntegrations.js":{"size":3833,"offset":"8943826","integrity":{"algorithm":"SHA256","hash":"50d4080f9c6b4ab853e3ae025065bdb7f2012c090c3e628434423d1c24730287","blockSize":4194304,"blocks":["50d4080f9c6b4ab853e3ae025065bdb7f2012c090c3e628434423d1c24730287"]}},"userIntegrations.js.map":{"size":6855,"offset":"8947659","integrity":{"algorithm":"SHA256","hash":"486e29dd1219ab32124be7547a75fbf9fed31307ee245b248d10eac0b5f0f39a","blockSize":4194304,"blocks":["486e29dd1219ab32124be7547a75fbf9fed31307ee245b248d10eac0b5f0f39a"]}},"vendor":{"files":{"escapeStringForRegex.js":{"size":2114,"offset":"8954514","integrity":{"algorithm":"SHA256","hash":"a79653675f3eedbc8d2fc462689ebe61f08dd4606f72cf537c1e88d9f26a81ad","blockSize":4194304,"blocks":["a79653675f3eedbc8d2fc462689ebe61f08dd4606f72cf537c1e88d9f26a81ad"]}},"escapeStringForRegex.js.map":{"size":2540,"offset":"8956628","integrity":{"algorithm":"SHA256","hash":"e1a2391423573b5785a03b42a37ce51177130eb22cf966fa92c0497bd8da1e28","blockSize":4194304,"blocks":["e1a2391423573b5785a03b42a37ce51177130eb22cf966fa92c0497bd8da1e28"]}},"supportsHistory.js":{"size":1151,"offset":"8959168","integrity":{"algorithm":"SHA256","hash":"0742975b951479b569a2363e34f7a7770e65962060f8676eda82b044d171dca7","blockSize":4194304,"blocks":["0742975b951479b569a2363e34f7a7770e65962060f8676eda82b044d171dca7"]}},"supportsHistory.js.map":{"size":2900,"offset":"8960319","integrity":{"algorithm":"SHA256","hash":"3e2c78f6b17195e9a1c299761ed4dcac1e0713153cfdb320383d8edb3792db1a","blockSize":4194304,"blocks":["3e2c78f6b17195e9a1c299761ed4dcac1e0713153cfdb320383d8edb3792db1a"]}}}},"worldwide.js":{"size":3073,"offset":"8963219","integrity":{"algorithm":"SHA256","hash":"5984ba6ec1febf3c426738b36d1b0049a32f500900d869bf81c607c34ef338b4","blockSize":4194304,"blocks":["5984ba6ec1febf3c426738b36d1b0049a32f500900d869bf81c607c34ef338b4"]}},"worldwide.js.map":{"size":6283,"offset":"8966292","integrity":{"algorithm":"SHA256","hash":"52a9aaa35c14870f5d78de404003e0919458381d7924e0d48885886f98773ac9","blockSize":4194304,"blocks":["52a9aaa35c14870f5d78de404003e0919458381d7924e0d48885886f98773ac9"]}}}},"LICENSE":{"size":1120,"offset":"8972575","integrity":{"algorithm":"SHA256","hash":"5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7","blockSize":4194304,"blocks":["5923d68bab743f88511b2f1efe7087ac8d748f36e6d5aea8ab5265e8e6a6c7c7"]}},"package.json":{"size":720,"offset":"8973695","integrity":{"algorithm":"SHA256","hash":"c7561a370f91e117b171ea4b8e275f05fb6dd0fadc57cd5eb8161ae276a36c07","blockSize":4194304,"blocks":["c7561a370f91e117b171ea4b8e275f05fb6dd0fadc57cd5eb8161ae276a36c07"]}},"README.md":{"size":930,"offset":"8974415","integrity":{"algorithm":"SHA256","hash":"9f5bd37da7de31214213d0d62146870ef7b9a4f1776a423e0dbcc9a1bbe06c11","blockSize":4194304,"blocks":["9f5bd37da7de31214213d0d62146870ef7b9a4f1776a423e0dbcc9a1bbe06c11"]}},"types":{"files":{"baggage.d.ts":{"size":1734,"offset":"8975345","integrity":{"algorithm":"SHA256","hash":"c3aaee8143d302cafcc59d02ffd2da7c603ed2e875601c989c3a8f6b98b70ec5","blockSize":4194304,"blocks":["c3aaee8143d302cafcc59d02ffd2da7c603ed2e875601c989c3a8f6b98b70ec5"]}},"baggage.d.ts.map":{"size":561,"offset":"8977079","integrity":{"algorithm":"SHA256","hash":"08f4dbfb82613e1ddadf946141b94c80283cb869ec314cfa63712480538cf80a","blockSize":4194304,"blocks":["08f4dbfb82613e1ddadf946141b94c80283cb869ec314cfa63712480538cf80a"]}},"browser.d.ts":{"size":1268,"offset":"8977640","integrity":{"algorithm":"SHA256","hash":"f9fc19a621a51568416f77f5bdbb2aa9d3e4cc7bc56f5daf6369144417e12917","blockSize":4194304,"blocks":["f9fc19a621a51568416f77f5bdbb2aa9d3e4cc7bc56f5daf6369144417e12917"]}},"browser.d.ts.map":{"size":433,"offset":"8978908","integrity":{"algorithm":"SHA256","hash":"dfa4d0f9973e6fa4fb20e69fd2e53075998b8c45c38fb4ee79998517331fe932","blockSize":4194304,"blocks":["dfa4d0f9973e6fa4fb20e69fd2e53075998b8c45c38fb4ee79998517331fe932"]}},"buildPolyfills":{"files":{"_asyncNullishCoalesce.d.ts":{"size":842,"offset":"8979341","integrity":{"algorithm":"SHA256","hash":"14a3e6ed3f1603812779f61a8bd3dcea445771f4851611cbedb9e3f757cb4f9a","blockSize":4194304,"blocks":["14a3e6ed3f1603812779f61a8bd3dcea445771f4851611cbedb9e3f757cb4f9a"]}},"_asyncNullishCoalesce.d.ts.map":{"size":273,"offset":"8980183","integrity":{"algorithm":"SHA256","hash":"09c238af7d394a69d8cb4ba442ff2f0a99cd3363a7cc721881e79b61e3931909","blockSize":4194304,"blocks":["09c238af7d394a69d8cb4ba442ff2f0a99cd3363a7cc721881e79b61e3931909"]}},"_asyncOptionalChain.d.ts":{"size":671,"offset":"8980456","integrity":{"algorithm":"SHA256","hash":"157974cef1111f6e2783786234385c150e1db66527a69e88ce1c55e433deebd7","blockSize":4194304,"blocks":["157974cef1111f6e2783786234385c150e1db66527a69e88ce1c55e433deebd7"]}},"_asyncOptionalChain.d.ts.map":{"size":247,"offset":"8981127","integrity":{"algorithm":"SHA256","hash":"a44a4aa4147ae0c897df4a3a7464bf0e17ac009fa295bdb45a2387632820abdc","blockSize":4194304,"blocks":["a44a4aa4147ae0c897df4a3a7464bf0e17ac009fa295bdb45a2387632820abdc"]}},"_asyncOptionalChainDelete.d.ts":{"size":889,"offset":"8981374","integrity":{"algorithm":"SHA256","hash":"5c397bd3db1f8cf6fc828ab7707ca4f22128bbcfc7f9d39ddbc2a6cc93f6d35f","blockSize":4194304,"blocks":["5c397bd3db1f8cf6fc828ab7707ca4f22128bbcfc7f9d39ddbc2a6cc93f6d35f"]}},"_asyncOptionalChainDelete.d.ts.map":{"size":260,"offset":"8982263","integrity":{"algorithm":"SHA256","hash":"043aafb06de6fb06f6996163e351b480cc5d7f8db76ad0a8eb858c889b2c13d0","blockSize":4194304,"blocks":["043aafb06de6fb06f6996163e351b480cc5d7f8db76ad0a8eb858c889b2c13d0"]}},"_createNamedExportFrom.d.ts":{"size":565,"offset":"8982523","integrity":{"algorithm":"SHA256","hash":"55aa84e0eb64bb6a51001f1cbfbcd5f28c87d13c6449b5d3bccd44a0fc1d24c6","blockSize":4194304,"blocks":["55aa84e0eb64bb6a51001f1cbfbcd5f28c87d13c6449b5d3bccd44a0fc1d24c6"]}},"_createNamedExportFrom.d.ts.map":{"size":317,"offset":"8983088","integrity":{"algorithm":"SHA256","hash":"5e347e77e2b28a10dedbfb9e375a2533c0a5947ecdd55a42451ad55a90ef87e5","blockSize":4194304,"blocks":["5e347e77e2b28a10dedbfb9e375a2533c0a5947ecdd55a42451ad55a90ef87e5"]}},"_createStarExport.d.ts":{"size":351,"offset":"8983405","integrity":{"algorithm":"SHA256","hash":"2131269a73c5ebda6a1cba32a4ad317f78230c94fe9a8f9d45a28f5fcbd0a652","blockSize":4194304,"blocks":["2131269a73c5ebda6a1cba32a4ad317f78230c94fe9a8f9d45a28f5fcbd0a652"]}},"_createStarExport.d.ts.map":{"size":265,"offset":"8983756","integrity":{"algorithm":"SHA256","hash":"fae635ff65bde02311ea3b444c4cf4fb3c19075885839d062bf5f0334ad6d748","blockSize":4194304,"blocks":["fae635ff65bde02311ea3b444c4cf4fb3c19075885839d062bf5f0334ad6d748"]}},"_interopDefault.d.ts":{"size":451,"offset":"8984021","integrity":{"algorithm":"SHA256","hash":"9db7929cb7c009e0fb12883ad850d4c8a2bdbde7efefad861f60f99d522c843d","blockSize":4194304,"blocks":["9db7929cb7c009e0fb12883ad850d4c8a2bdbde7efefad861f60f99d522c843d"]}},"_interopDefault.d.ts.map":{"size":260,"offset":"8984472","integrity":{"algorithm":"SHA256","hash":"53b359e06a75c5ea31e68b7db326d53c229f708616e10d97d434024eb4f9123d","blockSize":4194304,"blocks":["53b359e06a75c5ea31e68b7db326d53c229f708616e10d97d434024eb4f9123d"]}},"_interopNamespace.d.ts":{"size":555,"offset":"8984732","integrity":{"algorithm":"SHA256","hash":"de8be6481afc4076eeb6bf6d329958e72d657d84f6e2ba6d287064c2122a98e3","blockSize":4194304,"blocks":["de8be6481afc4076eeb6bf6d329958e72d657d84f6e2ba6d287064c2122a98e3"]}},"_interopNamespace.d.ts.map":{"size":266,"offset":"8985287","integrity":{"algorithm":"SHA256","hash":"81de081e7e5c0fb32cd09ee59169f12ab638b4d7f2a53ce21f0075056fca9738","blockSize":4194304,"blocks":["81de081e7e5c0fb32cd09ee59169f12ab638b4d7f2a53ce21f0075056fca9738"]}},"_interopNamespaceDefaultOnly.d.ts":{"size":493,"offset":"8985553","integrity":{"algorithm":"SHA256","hash":"15b644f2fdb09a415cc57cb3858eabc7b3d06383e16b9cbbe25c0ad36475882a","blockSize":4194304,"blocks":["15b644f2fdb09a415cc57cb3858eabc7b3d06383e16b9cbbe25c0ad36475882a"]}},"_interopNamespaceDefaultOnly.d.ts.map":{"size":288,"offset":"8986046","integrity":{"algorithm":"SHA256","hash":"3994d4140bc563e378f436b761bd32c7de49c176acccf639bec99f1cdfa81d1d","blockSize":4194304,"blocks":["3994d4140bc563e378f436b761bd32c7de49c176acccf639bec99f1cdfa81d1d"]}},"_interopRequireDefault.d.ts":{"size":533,"offset":"8986334","integrity":{"algorithm":"SHA256","hash":"b3ff100535141c8f3798941e1e4938525064cd29ed22796444cb01e9041aed91","blockSize":4194304,"blocks":["b3ff100535141c8f3798941e1e4938525064cd29ed22796444cb01e9041aed91"]}},"_interopRequireDefault.d.ts.map":{"size":276,"offset":"8986867","integrity":{"algorithm":"SHA256","hash":"9148518fc1e00c17cef4a6b28806f76aba172fde97fafb2fb73e27321d39e5e8","blockSize":4194304,"blocks":["9148518fc1e00c17cef4a6b28806f76aba172fde97fafb2fb73e27321d39e5e8"]}},"_interopRequireWildcard.d.ts":{"size":557,"offset":"8987143","integrity":{"algorithm":"SHA256","hash":"3a138bd8964ae47a0c1f41d95f92ee777b77a04c9626e1079f615bdc1ad36436","blockSize":4194304,"blocks":["3a138bd8964ae47a0c1f41d95f92ee777b77a04c9626e1079f615bdc1ad36436"]}},"_interopRequireWildcard.d.ts.map":{"size":278,"offset":"8987700","integrity":{"algorithm":"SHA256","hash":"beeafc26ad463a4e584073e34cfa3a7246ddf8b275472e0e665a8ab2d71b92ca","blockSize":4194304,"blocks":["beeafc26ad463a4e584073e34cfa3a7246ddf8b275472e0e665a8ab2d71b92ca"]}},"_nullishCoalesce.d.ts":{"size":726,"offset":"8987978","integrity":{"algorithm":"SHA256","hash":"39e1297cb8df277d75eb815b4a82428fad351b809202334cbdc203fb46ed557e","blockSize":4194304,"blocks":["39e1297cb8df277d75eb815b4a82428fad351b809202334cbdc203fb46ed557e"]}},"_nullishCoalesce.d.ts.map":{"size":247,"offset":"8988704","integrity":{"algorithm":"SHA256","hash":"1e3eb6fd571ab22192c0b19ae7ddc05090cd071360fa3dc757b42edcac8818ec","blockSize":4194304,"blocks":["1e3eb6fd571ab22192c0b19ae7ddc05090cd071360fa3dc757b42edcac8818ec"]}},"_optionalChain.d.ts":{"size":582,"offset":"8988951","integrity":{"algorithm":"SHA256","hash":"8f8f9c638311d34708788677c0528128808598e5caaea5926326af313cf4b333","blockSize":4194304,"blocks":["8f8f9c638311d34708788677c0528128808598e5caaea5926326af313cf4b333"]}},"_optionalChain.d.ts.map":{"size":220,"offset":"8989533","integrity":{"algorithm":"SHA256","hash":"77fdd96457c52c42365ed83654675f1a1274fc33979e0444b28c867ca3a3dcf9","blockSize":4194304,"blocks":["77fdd96457c52c42365ed83654675f1a1274fc33979e0444b28c867ca3a3dcf9"]}},"_optionalChainDelete.d.ts":{"size":870,"offset":"8989753","integrity":{"algorithm":"SHA256","hash":"57fbbed60c3d911ee1c93252afc8f9ce8b93b3fb9f46f247d90657d3c6ea793c","blockSize":4194304,"blocks":["57fbbed60c3d911ee1c93252afc8f9ce8b93b3fb9f46f247d90657d3c6ea793c"]}},"_optionalChainDelete.d.ts.map":{"size":235,"offset":"8990623","integrity":{"algorithm":"SHA256","hash":"554fd02e40b1ca824270e344e9791d8249f64e1ae1fc05f74e1eee198979e7d7","blockSize":4194304,"blocks":["554fd02e40b1ca824270e344e9791d8249f64e1ae1fc05f74e1eee198979e7d7"]}},"index.d.ts":{"size":852,"offset":"8990858","integrity":{"algorithm":"SHA256","hash":"f73d00058201c2d9d30c0df8fd2a2a1facb4c8c5c33a07132cf0067b88590d82","blockSize":4194304,"blocks":["f73d00058201c2d9d30c0df8fd2a2a1facb4c8c5c33a07132cf0067b88590d82"]}},"index.d.ts.map":{"size":704,"offset":"8991710","integrity":{"algorithm":"SHA256","hash":"d8e32a8f44bd8c7317d3998198e2d8fb3876fd8bb501fdb0bfe16b184d2a09b1","blockSize":4194304,"blocks":["d8e32a8f44bd8c7317d3998198e2d8fb3876fd8bb501fdb0bfe16b184d2a09b1"]}},"types.d.ts":{"size":379,"offset":"8992414","integrity":{"algorithm":"SHA256","hash":"9a0de70e6c23229ce50e3703d86514295bf779a00b40cf936d1e26b7ed61b0e2","blockSize":4194304,"blocks":["9a0de70e6c23229ce50e3703d86514295bf779a00b40cf936d1e26b7ed61b0e2"]}},"types.d.ts.map":{"size":422,"offset":"8992793","integrity":{"algorithm":"SHA256","hash":"b4fd011917022815f572e66f450bccf10dec9fd1d23f038cbf0c207959b3c771","blockSize":4194304,"blocks":["b4fd011917022815f572e66f450bccf10dec9fd1d23f038cbf0c207959b3c771"]}}}},"clientreport.d.ts":{"size":432,"offset":"8993215","integrity":{"algorithm":"SHA256","hash":"972a2f8e05abe0674b772d340c6103956fcdf6edfc9ce73af41723ecc8de17fc","blockSize":4194304,"blocks":["972a2f8e05abe0674b772d340c6103956fcdf6edfc9ce73af41723ecc8de17fc"]}},"clientreport.d.ts.map":{"size":321,"offset":"8993647","integrity":{"algorithm":"SHA256","hash":"1ff996973a96594c9de8dffb1d7ec355bfc2087ecf9a356713b94aa2a39446b3","blockSize":4194304,"blocks":["1ff996973a96594c9de8dffb1d7ec355bfc2087ecf9a356713b94aa2a39446b3"]}},"dsn.d.ts":{"size":796,"offset":"8993968","integrity":{"algorithm":"SHA256","hash":"4e5fd62deaff6f54eb6ebdf70d09153ded15b33eeb2fdb20ac709a641420ada8","blockSize":4194304,"blocks":["4e5fd62deaff6f54eb6ebdf70d09153ded15b33eeb2fdb20ac709a641420ada8"]}},"dsn.d.ts.map":{"size":383,"offset":"8994764","integrity":{"algorithm":"SHA256","hash":"f108666e4e37c01c901578fc4bf2d8d81444dbe57e831ec47c8ad8dc80c2e5cf","blockSize":4194304,"blocks":["f108666e4e37c01c901578fc4bf2d8d81444dbe57e831ec47c8ad8dc80c2e5cf"]}},"env.d.ts":{"size":338,"offset":"8995147","integrity":{"algorithm":"SHA256","hash":"20011a4e4f953e14e0708f895aca0b1409bc66de67822edeaff50c7c4e621042","blockSize":4194304,"blocks":["20011a4e4f953e14e0708f895aca0b1409bc66de67822edeaff50c7c4e621042"]}},"env.d.ts.map":{"size":245,"offset":"8995485","integrity":{"algorithm":"SHA256","hash":"4adf0c6b0b19158318734f2b92be192671f8ce3a02889e7d9c6fd08eda59e159","blockSize":4194304,"blocks":["4adf0c6b0b19158318734f2b92be192671f8ce3a02889e7d9c6fd08eda59e159"]}},"envelope.d.ts":{"size":2653,"offset":"8995730","integrity":{"algorithm":"SHA256","hash":"5b9e3580661cb1619ff29aa572e8dc7def24952a2c3f5c041ac769a134c2f0fa","blockSize":4194304,"blocks":["5b9e3580661cb1619ff29aa572e8dc7def24952a2c3f5c041ac769a134c2f0fa"]}},"envelope.d.ts.map":{"size":1608,"offset":"8998383","integrity":{"algorithm":"SHA256","hash":"480a40d6d45d84b09a81881837eb4a964d6ba81037e10f326869ca3e8f650746","blockSize":4194304,"blocks":["480a40d6d45d84b09a81881837eb4a964d6ba81037e10f326869ca3e8f650746"]}},"error.d.ts":{"size":368,"offset":"8999991","integrity":{"algorithm":"SHA256","hash":"97f56e25f8050b3faaeaf2f25a433c13ac7b36bb2b06e5fdec24b8ef6d18e281","blockSize":4194304,"blocks":["97f56e25f8050b3faaeaf2f25a433c13ac7b36bb2b06e5fdec24b8ef6d18e281"]}},"error.d.ts.map":{"size":323,"offset":"9000359","integrity":{"algorithm":"SHA256","hash":"3444a5a0830e5d2a641300ec8856a400c06ca482e861e044e4524981f5f393a1","blockSize":4194304,"blocks":["3444a5a0830e5d2a641300ec8856a400c06ca482e861e044e4524981f5f393a1"]}},"index.d.ts":{"size":824,"offset":"9000682","integrity":{"algorithm":"SHA256","hash":"d5c11fe6203495a7162589c7783515cd2af99185b3708943b6c7a714341bca97","blockSize":4194304,"blocks":["d5c11fe6203495a7162589c7783515cd2af99185b3708943b6c7a714341bca97"]}},"index.d.ts.map":{"size":720,"offset":"9001506","integrity":{"algorithm":"SHA256","hash":"8b473ba7cb17ca51e811db2cb9d2ae3a0c5391f11931f7e9378b7efcba3b9d48","blockSize":4194304,"blocks":["8b473ba7cb17ca51e811db2cb9d2ae3a0c5391f11931f7e9378b7efcba3b9d48"]}},"instrument.d.ts":{"size":820,"offset":"9002226","integrity":{"algorithm":"SHA256","hash":"836a57d2194d1070558281b09c6d66390cfb23eea7c24bc7714eb4f7e3374854","blockSize":4194304,"blocks":["836a57d2194d1070558281b09c6d66390cfb23eea7c24bc7714eb4f7e3374854"]}},"instrument.d.ts.map":{"size":532,"offset":"9003046","integrity":{"algorithm":"SHA256","hash":"159823cad9e96c0ac0b7e570515a619f2cbe7fdb68374d48467cb32c3987040d","blockSize":4194304,"blocks":["159823cad9e96c0ac0b7e570515a619f2cbe7fdb68374d48467cb32c3987040d"]}},"is.d.ts":{"size":3470,"offset":"9003578","integrity":{"algorithm":"SHA256","hash":"0f4e5aee9910ed0832ee6fbc107d6cafa89daed3241d820f6af3e90cdb57645f","blockSize":4194304,"blocks":["0f4e5aee9910ed0832ee6fbc107d6cafa89daed3241d820f6af3e90cdb57645f"]}},"is.d.ts.map":{"size":1242,"offset":"9007048","integrity":{"algorithm":"SHA256","hash":"49925b1d2ac82e3e5aead5f8455b44c3e67c11b01b945d832e672844fc53a09a","blockSize":4194304,"blocks":["49925b1d2ac82e3e5aead5f8455b44c3e67c11b01b945d832e672844fc53a09a"]}},"logger.d.ts":{"size":763,"offset":"9008290","integrity":{"algorithm":"SHA256","hash":"e794abc040306183c946bf013d06d8acce26bdfaba0d8c00f40b91a6041c826c","blockSize":4194304,"blocks":["e794abc040306183c946bf013d06d8acce26bdfaba0d8c00f40b91a6041c826c"]}},"logger.d.ts.map":{"size":602,"offset":"9009053","integrity":{"algorithm":"SHA256","hash":"abb53739be8567465a0d18c8a6055a1af79b8e86f8361b88b663d77fedffc59b","blockSize":4194304,"blocks":["abb53739be8567465a0d18c8a6055a1af79b8e86f8361b88b663d77fedffc59b"]}},"memo.d.ts":{"size":201,"offset":"9009655","integrity":{"algorithm":"SHA256","hash":"9ca7c69ec931f7aab21cd27bb9d57b6a8949cd59a534dccf0a8ad601ddbe72a3","blockSize":4194304,"blocks":["9ca7c69ec931f7aab21cd27bb9d57b6a8949cd59a534dccf0a8ad601ddbe72a3"]}},"memo.d.ts.map":{"size":253,"offset":"9009856","integrity":{"algorithm":"SHA256","hash":"0a5f23e56c091ca9702dd4586021a946be60fb8a704be7eb6d1b3b26ecd0622f","blockSize":4194304,"blocks":["0a5f23e56c091ca9702dd4586021a946be60fb8a704be7eb6d1b3b26ecd0622f"]}},"misc.d.ts":{"size":3783,"offset":"9010109","integrity":{"algorithm":"SHA256","hash":"318cb9cae6757ff744c17f59701417273238591e554d470b76728a940a258316","blockSize":4194304,"blocks":["318cb9cae6757ff744c17f59701417273238591e554d470b76728a940a258316"]}},"misc.d.ts.map":{"size":1071,"offset":"9013892","integrity":{"algorithm":"SHA256","hash":"26831deaca7b9a8030d2e0efdcf80f04221e1be27bcaea671598299610392ecd","blockSize":4194304,"blocks":["26831deaca7b9a8030d2e0efdcf80f04221e1be27bcaea671598299610392ecd"]}},"node-stack-trace.d.ts":{"size":294,"offset":"9014963","integrity":{"algorithm":"SHA256","hash":"11ed5e85966b779f2ba3ba5c9733e8bbcba441b42a9ccb6549a2ee1c18d60c3f","blockSize":4194304,"blocks":["11ed5e85966b779f2ba3ba5c9733e8bbcba441b42a9ccb6549a2ee1c18d60c3f"]}},"node-stack-trace.d.ts.map":{"size":328,"offset":"9015257","integrity":{"algorithm":"SHA256","hash":"43ed93fd83822aa8d72c2dfa88d5c684823cc57d0066a4eaab25fc6704c184bf","blockSize":4194304,"blocks":["43ed93fd83822aa8d72c2dfa88d5c684823cc57d0066a4eaab25fc6704c184bf"]}},"node.d.ts":{"size":1389,"offset":"9015585","integrity":{"algorithm":"SHA256","hash":"96b81074ca6a3a9a9c876b2663e5a694d42100c0835e8d863b6fdbff44af08dc","blockSize":4194304,"blocks":["96b81074ca6a3a9a9c876b2663e5a694d42100c0835e8d863b6fdbff44af08dc"]}},"node.d.ts.map":{"size":343,"offset":"9016974","integrity":{"algorithm":"SHA256","hash":"bd8caf81cc971864f677013c1077724d7b2017c431f26597fcb3acfe9a79824a","blockSize":4194304,"blocks":["bd8caf81cc971864f677013c1077724d7b2017c431f26597fcb3acfe9a79824a"]}},"normalize.d.ts":{"size":1957,"offset":"9017317","integrity":{"algorithm":"SHA256","hash":"a265bd8dcca25655846c976d6561706292d873d1f31da0eecdeb004c41fd24a5","blockSize":4194304,"blocks":["a265bd8dcca25655846c976d6561706292d873d1f31da0eecdeb004c41fd24a5"]}},"normalize.d.ts.map":{"size":788,"offset":"9019274","integrity":{"algorithm":"SHA256","hash":"f67a4cc06c43ff71c22398792df9b8df297f0eba0fffce156e016c6f23f4cb95","blockSize":4194304,"blocks":["f67a4cc06c43ff71c22398792df9b8df297f0eba0fffce156e016c6f23f4cb95"]}},"object.d.ts":{"size":3874,"offset":"9020062","integrity":{"algorithm":"SHA256","hash":"0dfa9b6b0cf87df0c3c5bbb18720df2c9aa81c6aee897ca3b8067a1ceb5ddbc1","blockSize":4194304,"blocks":["0dfa9b6b0cf87df0c3c5bbb18720df2c9aa81c6aee897ca3b8067a1ceb5ddbc1"]}},"object.d.ts.map":{"size":1415,"offset":"9023936","integrity":{"algorithm":"SHA256","hash":"33f105c95478de9e8834e31777df896192de63d29a68b401c7efeab34a0d583c","blockSize":4194304,"blocks":["33f105c95478de9e8834e31777df896192de63d29a68b401c7efeab34a0d583c"]}},"path.d.ts":{"size":555,"offset":"9025351","integrity":{"algorithm":"SHA256","hash":"97cc74443e4222646d2afb9efa9caebe0bd65d470c85563a0607bcc2843c852e","blockSize":4194304,"blocks":["97cc74443e4222646d2afb9efa9caebe0bd65d470c85563a0607bcc2843c852e"]}},"path.d.ts.map":{"size":616,"offset":"9025906","integrity":{"algorithm":"SHA256","hash":"5e5553bde3206c1b3b4b2fdf51495450f3fc637447b354bbaeb34bd8b7e389da","blockSize":4194304,"blocks":["5e5553bde3206c1b3b4b2fdf51495450f3fc637447b354bbaeb34bd8b7e389da"]}},"promisebuffer.d.ts":{"size":447,"offset":"9026522","integrity":{"algorithm":"SHA256","hash":"9b2c647b966af67aab34ea4b9027a11b1d6cf42c0a57f3b1865ccfc0d39b538e","blockSize":4194304,"blocks":["9b2c647b966af67aab34ea4b9027a11b1d6cf42c0a57f3b1865ccfc0d39b538e"]}},"promisebuffer.d.ts.map":{"size":459,"offset":"9026969","integrity":{"algorithm":"SHA256","hash":"99671a4a61e4b16df1a69eb906885c58859db2a9a6f06898b2f66e9c849c50f5","blockSize":4194304,"blocks":["99671a4a61e4b16df1a69eb906885c58859db2a9a6f06898b2f66e9c849c50f5"]}},"ratelimit.d.ts":{"size":1279,"offset":"9027428","integrity":{"algorithm":"SHA256","hash":"76d45bf744f87367438e265bc12de5a65a230549ba3d642d91bffe6f9a396acb","blockSize":4194304,"blocks":["76d45bf744f87367438e265bc12de5a65a230549ba3d642d91bffe6f9a396acb"]}},"ratelimit.d.ts.map":{"size":670,"offset":"9028707","integrity":{"algorithm":"SHA256","hash":"a3cc9344c4cd1d50f94f6e894d580c7189e800aa1636b408e3deff455feaee7c","blockSize":4194304,"blocks":["a3cc9344c4cd1d50f94f6e894d580c7189e800aa1636b408e3deff455feaee7c"]}},"requestdata.d.ts":{"size":3886,"offset":"9029377","integrity":{"algorithm":"SHA256","hash":"37d97f853b13411f0355a7e913ec661f71ed7b5732afa256f516fe8e338017ee","blockSize":4194304,"blocks":["37d97f853b13411f0355a7e913ec661f71ed7b5732afa256f516fe8e338017ee"]}},"requestdata.d.ts.map":{"size":1675,"offset":"9033263","integrity":{"algorithm":"SHA256","hash":"4ea10cf6e11b079881dd90117261ab904568c7d98ff257b72d957f02d433dc27","blockSize":4194304,"blocks":["4ea10cf6e11b079881dd90117261ab904568c7d98ff257b72d957f02d433dc27"]}},"severity.d.ts":{"size":888,"offset":"9034938","integrity":{"algorithm":"SHA256","hash":"9ac4573e85bcb3bfe1af5c254a177e05d8e94a37109699f8bbffb9d0210e0a37","blockSize":4194304,"blocks":["9ac4573e85bcb3bfe1af5c254a177e05d8e94a37109699f8bbffb9d0210e0a37"]}},"severity.d.ts.map":{"size":372,"offset":"9035826","integrity":{"algorithm":"SHA256","hash":"82db8e54eb98ab6192397a24b3c04cd728e620e54681c34abf129233bcd2b7c7","blockSize":4194304,"blocks":["82db8e54eb98ab6192397a24b3c04cd728e620e54681c34abf129233bcd2b7c7"]}},"stacktrace.d.ts":{"size":1663,"offset":"9036198","integrity":{"algorithm":"SHA256","hash":"37e1607eb5201f58f4a371af7692949f678eb065b3c38f2bd3dadc01b261cd2b","blockSize":4194304,"blocks":["37e1607eb5201f58f4a371af7692949f678eb065b3c38f2bd3dadc01b261cd2b"]}},"stacktrace.d.ts.map":{"size":623,"offset":"9037861","integrity":{"algorithm":"SHA256","hash":"089a88cb21f10db5344a17d08817ba7bf6fd0a47011aad6eebea919f8652822d","blockSize":4194304,"blocks":["089a88cb21f10db5344a17d08817ba7bf6fd0a47011aad6eebea919f8652822d"]}},"string.d.ts":{"size":2180,"offset":"9038484","integrity":{"algorithm":"SHA256","hash":"b15fbe49b90a73d7e43ccffa7b5a7b05c50c1f8a135001e9cd45779a06ad4154","blockSize":4194304,"blocks":["b15fbe49b90a73d7e43ccffa7b5a7b05c50c1f8a135001e9cd45779a06ad4154"]}},"string.d.ts.map":{"size":697,"offset":"9040664","integrity":{"algorithm":"SHA256","hash":"59e7993da15cc0b56b2f73ea7633887d400c5740488d88c1b1b02ef16a13bd56","blockSize":4194304,"blocks":["59e7993da15cc0b56b2f73ea7633887d400c5740488d88c1b1b02ef16a13bd56"]}},"supports.d.ts":{"size":1725,"offset":"9041361","integrity":{"algorithm":"SHA256","hash":"3b34394c3d5b41d02314c7b953d2a01e447748fe42e58a63071303d0f8510cc8","blockSize":4194304,"blocks":["3b34394c3d5b41d02314c7b953d2a01e447748fe42e58a63071303d0f8510cc8"]}},"supports.d.ts.map":{"size":562,"offset":"9043086","integrity":{"algorithm":"SHA256","hash":"7cae7ba1e4eb4e77bae31a1d2a361e05a0fa3d659229ac6050abfe8a02e1f3c7","blockSize":4194304,"blocks":["7cae7ba1e4eb4e77bae31a1d2a361e05a0fa3d659229ac6050abfe8a02e1f3c7"]}},"syncpromise.d.ts":{"size":1477,"offset":"9043648","integrity":{"algorithm":"SHA256","hash":"0254693ebc06dcdcefc2cc35f506674154a0f4aeb200a8a9b72286d01ea9fd5e","blockSize":4194304,"blocks":["0254693ebc06dcdcefc2cc35f506674154a0f4aeb200a8a9b72286d01ea9fd5e"]}},"syncpromise.d.ts.map":{"size":1485,"offset":"9045125","integrity":{"algorithm":"SHA256","hash":"8ea4ac6c0fe44e636bce228b0b3d70ff8f21d0a127cbeaba324c112dcba59343","blockSize":4194304,"blocks":["8ea4ac6c0fe44e636bce228b0b3d70ff8f21d0a127cbeaba324c112dcba59343"]}},"time.d.ts":{"size":1433,"offset":"9046610","integrity":{"algorithm":"SHA256","hash":"62587277f13a570ec069f72f87dde034839187ffb73e69d22f488c3aefb22b71","blockSize":4194304,"blocks":["62587277f13a570ec069f72f87dde034839187ffb73e69d22f488c3aefb22b71"]}},"time.d.ts.map":{"size":396,"offset":"9048043","integrity":{"algorithm":"SHA256","hash":"585639d2c60bae1eedd9ff6acc8460f15068f1707413912d067d1e4cb577165e","blockSize":4194304,"blocks":["585639d2c60bae1eedd9ff6acc8460f15068f1707413912d067d1e4cb577165e"]}},"tracing.d.ts":{"size":459,"offset":"9048439","integrity":{"algorithm":"SHA256","hash":"dada166e5670ce838e8dcfe79252a8cad3a18b98d6ecb8a5f6952b62da62c3ed","blockSize":4194304,"blocks":["dada166e5670ce838e8dcfe79252a8cad3a18b98d6ecb8a5f6952b62da62c3ed"]}},"tracing.d.ts.map":{"size":270,"offset":"9048898","integrity":{"algorithm":"SHA256","hash":"c891d77b8a67a8533f3f99348159be7352edf04c65e8096b9db49f197d1a0c95","blockSize":4194304,"blocks":["c891d77b8a67a8533f3f99348159be7352edf04c65e8096b9db49f197d1a0c95"]}},"url.d.ts":{"size":1240,"offset":"9049168","integrity":{"algorithm":"SHA256","hash":"755ab779d751cc1b2ea609637d49a1f604c9459fae281cc9f5458153580d6a0b","blockSize":4194304,"blocks":["755ab779d751cc1b2ea609637d49a1f604c9459fae281cc9f5458153580d6a0b"]}},"url.d.ts.map":{"size":587,"offset":"9050408","integrity":{"algorithm":"SHA256","hash":"1ca1b4678b753d0f54abbdeba295e907eba89652006be58ee1dad57c1fd968cd","blockSize":4194304,"blocks":["1ca1b4678b753d0f54abbdeba295e907eba89652006be58ee1dad57c1fd968cd"]}},"userIntegrations.d.ts":{"size":1879,"offset":"9050995","integrity":{"algorithm":"SHA256","hash":"902eabd24a600888516689ff326abacc2e07b5572d6a8578abb4753beac94f34","blockSize":4194304,"blocks":["902eabd24a600888516689ff326abacc2e07b5572d6a8578abb4753beac94f34"]}},"userIntegrations.d.ts.map":{"size":606,"offset":"9052874","integrity":{"algorithm":"SHA256","hash":"ce184f6b934a5afc05854dc14d534b84ee943db4a01372e95b67acae637595a0","blockSize":4194304,"blocks":["ce184f6b934a5afc05854dc14d534b84ee943db4a01372e95b67acae637595a0"]}},"vendor":{"files":{"escapeStringForRegex.d.ts":{"size":395,"offset":"9053480","integrity":{"algorithm":"SHA256","hash":"8e8f420cee62c0bc18c4082fe9da330a0295e8fb78ec787f1de8c1aa80b153d3","blockSize":4194304,"blocks":["8e8f420cee62c0bc18c4082fe9da330a0295e8fb78ec787f1de8c1aa80b153d3"]}},"escapeStringForRegex.d.ts.map":{"size":217,"offset":"9053875","integrity":{"algorithm":"SHA256","hash":"cdc458e68f55f7fd753a5b1aa896c71b6293ad637a81e84c57fba1f95b44a4bc","blockSize":4194304,"blocks":["cdc458e68f55f7fd753a5b1aa896c71b6293ad637a81e84c57fba1f95b44a4bc"]}},"supportsHistory.d.ts":{"size":236,"offset":"9054092","integrity":{"algorithm":"SHA256","hash":"784e19132b9dc6c6d3850f51cb30e6879d050844a1b531e8a9005055a1a01ef6","blockSize":4194304,"blocks":["784e19132b9dc6c6d3850f51cb30e6879d050844a1b531e8a9005055a1a01ef6"]}},"supportsHistory.d.ts.map":{"size":184,"offset":"9054328","integrity":{"algorithm":"SHA256","hash":"c2978aea8211ac9b78d43a77b58310ca2f634ea44752505657f3028bf1e0eed2","blockSize":4194304,"blocks":["c2978aea8211ac9b78d43a77b58310ca2f634ea44752505657f3028bf1e0eed2"]}}}},"worldwide.d.ts":{"size":2887,"offset":"9054512","integrity":{"algorithm":"SHA256","hash":"12b5c6524e206cc4bb61cd7c3978ccfd3b823ead1742d1e36f4d95a9aa14029f","blockSize":4194304,"blocks":["12b5c6524e206cc4bb61cd7c3978ccfd3b823ead1742d1e36f4d95a9aa14029f"]}},"worldwide.d.ts.map":{"size":1455,"offset":"9057399","integrity":{"algorithm":"SHA256","hash":"40f1314681579180e8765a54032ea8ddbbcb142e928d0ad2f764282f5138f21b","blockSize":4194304,"blocks":["40f1314681579180e8765a54032ea8ddbbcb142e928d0ad2f764282f5138f21b"]}}}}}}}},"@sentry-internal":{"files":{"tracing":{"files":{"cjs":{"files":{"browser":{"files":{"backgroundtab.js":{"size":1549,"offset":"1297309","integrity":{"algorithm":"SHA256","hash":"3f59813a12d75d98135a94b7e28aa73b386af17aa4413bf01eb3c4105d8f8cb5","blockSize":4194304,"blocks":["3f59813a12d75d98135a94b7e28aa73b386af17aa4413bf01eb3c4105d8f8cb5"]}},"backgroundtab.js.map":{"size":2389,"offset":"1298858","integrity":{"algorithm":"SHA256","hash":"d08a77da1a6d5846fa78f23f36675e483ff187a0d387d95d527ef99bec3da1f4","blockSize":4194304,"blocks":["d08a77da1a6d5846fa78f23f36675e483ff187a0d387d95d527ef99bec3da1f4"]}},"browsertracing.js":{"size":9662,"offset":"1301247","integrity":{"algorithm":"SHA256","hash":"2adafa3343081f0c4561193fad3f64c61ca7f8b1c3c0353d836493990efd8029","blockSize":4194304,"blocks":["2adafa3343081f0c4561193fad3f64c61ca7f8b1c3c0353d836493990efd8029"]}},"browsertracing.js.map":{"size":21174,"offset":"1310909","integrity":{"algorithm":"SHA256","hash":"b11e0b47fb9cf6a3330d43ea84736eb33afa473fb86f619bfdf67ddcf404dbd1","blockSize":4194304,"blocks":["b11e0b47fb9cf6a3330d43ea84736eb33afa473fb86f619bfdf67ddcf404dbd1"]}},"metrics":{"files":{"index.js":{"size":16045,"offset":"1332083","integrity":{"algorithm":"SHA256","hash":"dc8dc0da52397be45428799f3bfc769de40b00c3ddd41d1addbf63f22f0aae76","blockSize":4194304,"blocks":["dc8dc0da52397be45428799f3bfc769de40b00c3ddd41d1addbf63f22f0aae76"]}},"index.js.map":{"size":30506,"offset":"1348128","integrity":{"algorithm":"SHA256","hash":"f8e74dc46333fffc29d7c1bcf4b9627fd5b823188008b6ad3f5d91f5db6eef34","blockSize":4194304,"blocks":["f8e74dc46333fffc29d7c1bcf4b9627fd5b823188008b6ad3f5d91f5db6eef34"]}},"utils.js":{"size":839,"offset":"1378634","integrity":{"algorithm":"SHA256","hash":"ab163dee245cfb09911f200f49abe2d05ecf789b4b0b380ba7f40d06e8038f94","blockSize":4194304,"blocks":["ab163dee245cfb09911f200f49abe2d05ecf789b4b0b380ba7f40d06e8038f94"]}},"utils.js.map":{"size":1419,"offset":"1379473","integrity":{"algorithm":"SHA256","hash":"df0bfa8e7257596b4839e74dba4c9522315dc1b42c1cbbf05aa340203583a6ec","blockSize":4194304,"blocks":["df0bfa8e7257596b4839e74dba4c9522315dc1b42c1cbbf05aa340203583a6ec"]}}}},"request.js":{"size":9441,"offset":"1380892","integrity":{"algorithm":"SHA256","hash":"7e0472ea5d7b47981c59f8f1e43c9355dff85c2a18b66756f62ddef3cc62ac1e","blockSize":4194304,"blocks":["7e0472ea5d7b47981c59f8f1e43c9355dff85c2a18b66756f62ddef3cc62ac1e"]}},"request.js.map":{"size":19776,"offset":"1390333","integrity":{"algorithm":"SHA256","hash":"a665b24af2fc306b61e1a87eae03b78c4a99976eaacafc209c01384e39912cd1","blockSize":4194304,"blocks":["a665b24af2fc306b61e1a87eae03b78c4a99976eaacafc209c01384e39912cd1"]}},"router.js":{"size":2510,"offset":"1410109","integrity":{"algorithm":"SHA256","hash":"ea648ee67346e4707aa4bf12d102942bc2f18635e25e91bb6c31774b07ee6aea","blockSize":4194304,"blocks":["ea648ee67346e4707aa4bf12d102942bc2f18635e25e91bb6c31774b07ee6aea"]}},"router.js.map":{"size":4107,"offset":"1412619","integrity":{"algorithm":"SHA256","hash":"0cd3b21e03b84cb6c2dfda9b7e7346ecfa8b358df65f206de157c3ba3319b01c","blockSize":4194304,"blocks":["0cd3b21e03b84cb6c2dfda9b7e7346ecfa8b358df65f206de157c3ba3319b01c"]}},"types.js":{"size":199,"offset":"1416726","integrity":{"algorithm":"SHA256","hash":"0a956494715ff0c0d10f5b8904ed7eade36650b60b343ae0c5a1265598283168","blockSize":4194304,"blocks":["0a956494715ff0c0d10f5b8904ed7eade36650b60b343ae0c5a1265598283168"]}},"types.js.map":{"size":280,"offset":"1416925","integrity":{"algorithm":"SHA256","hash":"cbfde25e4da22f25c3b3d013d302ad0dc6c13a5b95c1872f6a481adc9fd8f1f9","blockSize":4194304,"blocks":["cbfde25e4da22f25c3b3d013d302ad0dc6c13a5b95c1872f6a481adc9fd8f1f9"]}},"web-vitals":{"files":{"getCLS.js":{"size":3902,"offset":"1417205","integrity":{"algorithm":"SHA256","hash":"eba9b909cadf522da71e4345cf058ee99b7cb0f78aa8bad5c1e2bc8ee12f0553","blockSize":4194304,"blocks":["eba9b909cadf522da71e4345cf058ee99b7cb0f78aa8bad5c1e2bc8ee12f0553"]}},"getCLS.js.map":{"size":5923,"offset":"1421107","integrity":{"algorithm":"SHA256","hash":"a3e728349afeeffd01546477c9ac8cccb5ca0c3735d56c30b65462d3ee60ac47","blockSize":4194304,"blocks":["a3e728349afeeffd01546477c9ac8cccb5ca0c3735d56c30b65462d3ee60ac47"]}},"getFID.js":{"size":2257,"offset":"1427030","integrity":{"algorithm":"SHA256","hash":"87086c2271126cb05bb164967fcdfbf163da0ff472ae6e3fb99b0e1a7bff7f5f","blockSize":4194304,"blocks":["87086c2271126cb05bb164967fcdfbf163da0ff472ae6e3fb99b0e1a7bff7f5f"]}},"getFID.js.map":{"size":3581,"offset":"1429287","integrity":{"algorithm":"SHA256","hash":"8ed0dbcda34ac957fa34b06fae1f639dd893fd9c2a5ef723071962b07272c626","blockSize":4194304,"blocks":["8ed0dbcda34ac957fa34b06fae1f639dd893fd9c2a5ef723071962b07272c626"]}},"getLCP.js":{"size":3094,"offset":"1432868","integrity":{"algorithm":"SHA256","hash":"22ec6b925993e8a6d7589053a52757625a0a115dcea4ec2c3e934b74fa961f26","blockSize":4194304,"blocks":["22ec6b925993e8a6d7589053a52757625a0a115dcea4ec2c3e934b74fa961f26"]}},"getLCP.js.map":{"size":4977,"offset":"1435962","integrity":{"algorithm":"SHA256","hash":"4b6ed0d75c8ed9fc86ef16d8cacc00b71fa83edb902c343e1cfa46d8de6f7120","blockSize":4194304,"blocks":["4b6ed0d75c8ed9fc86ef16d8cacc00b71fa83edb902c343e1cfa46d8de6f7120"]}},"lib":{"files":{"bindReporter.js":{"size":843,"offset":"1440939","integrity":{"algorithm":"SHA256","hash":"cb1b42ae09e3a5ebc688e707a81c81b902972aacdf44fb099a61a7c919cf6482","blockSize":4194304,"blocks":["cb1b42ae09e3a5ebc688e707a81c81b902972aacdf44fb099a61a7c919cf6482"]}},"bindReporter.js.map":{"size":2202,"offset":"1441782","integrity":{"algorithm":"SHA256","hash":"1188c014d60c08f1a1cf09aee590daa3b194a38023d31b6567e413b5972ef063","blockSize":4194304,"blocks":["1188c014d60c08f1a1cf09aee590daa3b194a38023d31b6567e413b5972ef063"]}},"generateUniqueID.js":{"size":1031,"offset":"1443984","integrity":{"algorithm":"SHA256","hash":"33bdbdd90132e064dc7c49ea3b28313d1e2b993facb39aa4eafe92a2b0a2d9dd","blockSize":4194304,"blocks":["33bdbdd90132e064dc7c49ea3b28313d1e2b993facb39aa4eafe92a2b0a2d9dd"]}},"generateUniqueID.js.map":{"size":1385,"offset":"1445015","integrity":{"algorithm":"SHA256","hash":"9acb03b2378eca7684ca39be54c0a3dfb60496fa9a10a85c5d51ae7ea516ba6e","blockSize":4194304,"blocks":["9acb03b2378eca7684ca39be54c0a3dfb60496fa9a10a85c5d51ae7ea516ba6e"]}},"getActivationStart.js":{"size":973,"offset":"1446400","integrity":{"algorithm":"SHA256","hash":"65d6d1a8788e72d6c4ccfe44f66a09c19c77ffe0903954d6f62f613ec88476d9","blockSize":4194304,"blocks":["65d6d1a8788e72d6c4ccfe44f66a09c19c77ffe0903954d6f62f613ec88476d9"]}},"getActivationStart.js.map":{"size":1239,"offset":"1447373","integrity":{"algorithm":"SHA256","hash":"64b5ed1df7bbe12e36ca779df872070cee15034c28198be165a47662c069975d","blockSize":4194304,"blocks":["64b5ed1df7bbe12e36ca779df872070cee15034c28198be165a47662c069975d"]}},"getNavigationEntry.js":{"size":1851,"offset":"1448612","integrity":{"algorithm":"SHA256","hash":"9b0f8d80bf334aff47e9e04c9645e70727c14ee9bf3f4199d5d0e20c962ce592","blockSize":4194304,"blocks":["9b0f8d80bf334aff47e9e04c9645e70727c14ee9bf3f4199d5d0e20c962ce592"]}},"getNavigationEntry.js.map":{"size":3238,"offset":"1450463","integrity":{"algorithm":"SHA256","hash":"175115ebc19fa20cdaea9a98cb567863584f338bac6d00d6ae94fa8208e6424c","blockSize":4194304,"blocks":["175115ebc19fa20cdaea9a98cb567863584f338bac6d00d6ae94fa8208e6424c"]}},"getVisibilityWatcher.js":{"size":1795,"offset":"1453701","integrity":{"algorithm":"SHA256","hash":"bf2851d9615de0c52a5e24534bb0ba9efa077dc7973ea70bad6518b38ed91f01","blockSize":4194304,"blocks":["bf2851d9615de0c52a5e24534bb0ba9efa077dc7973ea70bad6518b38ed91f01"]}},"getVisibilityWatcher.js.map":{"size":2615,"offset":"1455496","integrity":{"algorithm":"SHA256","hash":"3de0d85bea4723f565c4912ccad739f69531a9808e2067d328405ae61d7d6f08","blockSize":4194304,"blocks":["3de0d85bea4723f565c4912ccad739f69531a9808e2067d328405ae61d7d6f08"]}},"initMetric.js":{"size":1563,"offset":"1458111","integrity":{"algorithm":"SHA256","hash":"14162572fe03d8fc271c21c6e1e067ba64550e3f9086cb10adbb7bc535a620be","blockSize":4194304,"blocks":["14162572fe03d8fc271c21c6e1e067ba64550e3f9086cb10adbb7bc535a620be"]}},"initMetric.js.map":{"size":2450,"offset":"1459674","integrity":{"algorithm":"SHA256","hash":"04c0ba481d676bc5db24adbcd10f8df773f9a9e1f880efc37449587f2a1f63e6","blockSize":4194304,"blocks":["04c0ba481d676bc5db24adbcd10f8df773f9a9e1f880efc37449587f2a1f63e6"]}},"observe.js":{"size":943,"offset":"1462124","integrity":{"algorithm":"SHA256","hash":"7a772bb12ad4435c2bffd4d0639da1ca6b630147cecaf185da6b5fe1b59e2f12","blockSize":4194304,"blocks":["7a772bb12ad4435c2bffd4d0639da1ca6b630147cecaf185da6b5fe1b59e2f12"]}},"observe.js.map":{"size":3019,"offset":"1463067","integrity":{"algorithm":"SHA256","hash":"c4ba7fa037e6e88b68f1831b96e7babe662c8f3fba02b7ac406824271c454d74","blockSize":4194304,"blocks":["c4ba7fa037e6e88b68f1831b96e7babe662c8f3fba02b7ac406824271c454d74"]}},"onHidden.js":{"size":1379,"offset":"1466086","integrity":{"algorithm":"SHA256","hash":"b144c2691faeba9ea70b17c4f78b0dc7941dc895d4b74cb1f81b142ff80540bb","blockSize":4194304,"blocks":["b144c2691faeba9ea70b17c4f78b0dc7941dc895d4b74cb1f81b142ff80540bb"]}},"onHidden.js.map":{"size":2149,"offset":"1467465","integrity":{"algorithm":"SHA256","hash":"24dbf1be3fda825a673316b859fbaa00ff8934a9e0afab9603bfcb7419f40850","blockSize":4194304,"blocks":["24dbf1be3fda825a673316b859fbaa00ff8934a9e0afab9603bfcb7419f40850"]}}}}}}}},"extensions.js":{"size":1753,"offset":"1469614","integrity":{"algorithm":"SHA256","hash":"d95fcde182989529d2e292b08dfa99051bf4232079000e02e789843a7e0c8981","blockSize":4194304,"blocks":["d95fcde182989529d2e292b08dfa99051bf4232079000e02e789843a7e0c8981"]}},"extensions.js.map":{"size":3734,"offset":"1471367","integrity":{"algorithm":"SHA256","hash":"819d5ccbbb3c63b33e7b6176e223f4572107b58c7c7b291a85c57b72cfa3dc1d","blockSize":4194304,"blocks":["819d5ccbbb3c63b33e7b6176e223f4572107b58c7c7b291a85c57b72cfa3dc1d"]}},"index.js":{"size":2157,"offset":"1475101","integrity":{"algorithm":"SHA256","hash":"14321adf81dde25c551fa7c1deddd3e96f7915249df7ef498b73b29c09d0a998","blockSize":4194304,"blocks":["14321adf81dde25c551fa7c1deddd3e96f7915249df7ef498b73b29c09d0a998"]}},"index.js.map":{"size":131,"offset":"1477258","integrity":{"algorithm":"SHA256","hash":"a7f01e67e5d68fb6ae165a58244d054643abc683e8634455053c52b397027537","blockSize":4194304,"blocks":["a7f01e67e5d68fb6ae165a58244d054643abc683e8634455053c52b397027537"]}},"node":{"files":{"integrations":{"files":{"apollo.js":{"size":5368,"offset":"1477389","integrity":{"algorithm":"SHA256","hash":"2e270e8dd054bc403f80ea9b53b4b6d80f90dbca2d6caea661cc0582d78c0892","blockSize":4194304,"blocks":["2e270e8dd054bc403f80ea9b53b4b6d80f90dbca2d6caea661cc0582d78c0892"]}},"apollo.js.map":{"size":23156,"offset":"1482757","integrity":{"algorithm":"SHA256","hash":"01daa6ded076b19171449159b950dc63bbfedbe9dc0f9b05b26f032ab6c419a5","blockSize":4194304,"blocks":["01daa6ded076b19171449159b950dc63bbfedbe9dc0f9b05b26f032ab6c419a5"]}},"express.js":{"size":12006,"offset":"1505913","integrity":{"algorithm":"SHA256","hash":"74805453f6a2c3c09051194a5b66b549888770593e790b74b0eb3b8a93207078","blockSize":4194304,"blocks":["74805453f6a2c3c09051194a5b66b549888770593e790b74b0eb3b8a93207078"]}},"express.js.map":{"size":55914,"offset":"1517919","integrity":{"algorithm":"SHA256","hash":"5be4f09347d831037e1e7dcf1708f40b780f3dc5011e952d91bdb8d2eee42fe1","blockSize":4194304,"blocks":["5be4f09347d831037e1e7dcf1708f40b780f3dc5011e952d91bdb8d2eee42fe1"]}},"graphql.js":{"size":2405,"offset":"1573833","integrity":{"algorithm":"SHA256","hash":"c58cca71ba7d1f98090c7cdfeabc0e46d8ebe45fc927090ff9a25243eb10c22f","blockSize":4194304,"blocks":["c58cca71ba7d1f98090c7cdfeabc0e46d8ebe45fc927090ff9a25243eb10c22f"]}},"graphql.js.map":{"size":9802,"offset":"1576238","integrity":{"algorithm":"SHA256","hash":"0e9483d069a6a67abc9e6b70d52e7db8889352513b80435fa0035cebd84512b0","blockSize":4194304,"blocks":["0e9483d069a6a67abc9e6b70d52e7db8889352513b80435fa0035cebd84512b0"]}},"lazy.js":{"size":1184,"offset":"1586040","integrity":{"algorithm":"SHA256","hash":"e83f89eb37a0ecd8ec3cdc5a6070099beadaeaaf37da4d5a125f2d7f1b24ff4a","blockSize":4194304,"blocks":["e83f89eb37a0ecd8ec3cdc5a6070099beadaeaaf37da4d5a125f2d7f1b24ff4a"]}},"lazy.js.map":{"size":3054,"offset":"1587224","integrity":{"algorithm":"SHA256","hash":"b856e9bfcd639b8bae1efdb58f21267854fe897ad9f1f36e2935571b473a6b1f","blockSize":4194304,"blocks":["b856e9bfcd639b8bae1efdb58f21267854fe897ad9f1f36e2935571b473a6b1f"]}},"mongo.js":{"size":9496,"offset":"1590278","integrity":{"algorithm":"SHA256","hash":"38140d76832b0a6035a222be17875bf27814084cc1e4bce4acfd7d88d6cb75dc","blockSize":4194304,"blocks":["38140d76832b0a6035a222be17875bf27814084cc1e4bce4acfd7d88d6cb75dc"]}},"mongo.js.map":{"size":43386,"offset":"1599774","integrity":{"algorithm":"SHA256","hash":"ffa3e8ca9167328456f3457c4814ad4814ba5e3cf3fab83405be8e201411e5c1","blockSize":4194304,"blocks":["ffa3e8ca9167328456f3457c4814ad4814ba5e3cf3fab83405be8e201411e5c1"]}},"mysql.js":{"size":2580,"offset":"1643160","integrity":{"algorithm":"SHA256","hash":"644771a3d875322534ee5386607c2a89c831edf72d03ed75284d3195ed4ed4af","blockSize":4194304,"blocks":["644771a3d875322534ee5386607c2a89c831edf72d03ed75284d3195ed4ed4af"]}},"mysql.js.map":{"size":10312,"offset":"1645740","integrity":{"algorithm":"SHA256","hash":"07752e28bea7266551b198c833cb9a45e0f6279ee94d9582dde18bf99cf6efb5","blockSize":4194304,"blocks":["07752e28bea7266551b198c833cb9a45e0f6279ee94d9582dde18bf99cf6efb5"]}},"postgres.js":{"size":3387,"offset":"1656052","integrity":{"algorithm":"SHA256","hash":"433e61190edb066d51e9e99d4b869c7431b16150e4aeef092c147aa980a8e22c","blockSize":4194304,"blocks":["433e61190edb066d51e9e99d4b869c7431b16150e4aeef092c147aa980a8e22c"]}},"postgres.js.map":{"size":13949,"offset":"1659439","integrity":{"algorithm":"SHA256","hash":"25a0a6257698243e0d9f8f9af3a78efc51c2eab7698f5de864134bce65529261","blockSize":4194304,"blocks":["25a0a6257698243e0d9f8f9af3a78efc51c2eab7698f5de864134bce65529261"]}},"prisma.js":{"size":1825,"offset":"1673388","integrity":{"algorithm":"SHA256","hash":"409a22742ed1be9eb336052efb1e79b21471175a272d8713730a7e0a7d70b5c1","blockSize":4194304,"blocks":["409a22742ed1be9eb336052efb1e79b21471175a272d8713730a7e0a7d70b5c1"]}},"prisma.js.map":{"size":4236,"offset":"1675213","integrity":{"algorithm":"SHA256","hash":"2a9a9ce1b892f6167f9ab491382dc474ceeb6fdb68f017f1acb8052cc4893959","blockSize":4194304,"blocks":["2a9a9ce1b892f6167f9ab491382dc474ceeb6fdb68f017f1acb8052cc4893959"]}},"utils":{"files":{"node-utils.js":{"size":793,"offset":"1679449","integrity":{"algorithm":"SHA256","hash":"18f240db2946113a52fa2f9e4bee6451c79fc53bd1e6c2e4e4dd0486fd468f85","blockSize":4194304,"blocks":["18f240db2946113a52fa2f9e4bee6451c79fc53bd1e6c2e4e4dd0486fd468f85"]}},"node-utils.js.map":{"size":2609,"offset":"1680242","integrity":{"algorithm":"SHA256","hash":"437edb66ef3c53f7d3aea9afdfcfd5291a41facddfff18632829be7a9c2ae7f4","blockSize":4194304,"blocks":["437edb66ef3c53f7d3aea9afdfcfd5291a41facddfff18632829be7a9c2ae7f4"]}}}}}}}}}},"esm":{"files":{"browser":{"files":{"backgroundtab.js":{"size":1429,"offset":"1682851","integrity":{"algorithm":"SHA256","hash":"9caebed8c3cf0a1455f33f2e1cbad3a8928f797d654c07769598d95e4e98ac89","blockSize":4194304,"blocks":["9caebed8c3cf0a1455f33f2e1cbad3a8928f797d654c07769598d95e4e98ac89"]}},"backgroundtab.js.map":{"size":2340,"offset":"1684280","integrity":{"algorithm":"SHA256","hash":"38592c17dc65c1b838696b2d72afa774d4053990b93818a5a121d0bfdccd00e2","blockSize":4194304,"blocks":["38592c17dc65c1b838696b2d72afa774d4053990b93818a5a121d0bfdccd00e2"]}},"browsertracing.js":{"size":9706,"offset":"1686620","integrity":{"algorithm":"SHA256","hash":"b50861e9284380e139fd85f89e4c7bffb0b7b36f157d73ac5f1a7bac2a9f9f29","blockSize":4194304,"blocks":["b50861e9284380e139fd85f89e4c7bffb0b7b36f157d73ac5f1a7bac2a9f9f29"]}},"browsertracing.js.map":{"size":20724,"offset":"1696326","integrity":{"algorithm":"SHA256","hash":"35c79860ad4482c5e344548bfae1d485b50ba70e0e5a1d3cd7f10ff551fd2ec6","blockSize":4194304,"blocks":["35c79860ad4482c5e344548bfae1d485b50ba70e0e5a1d3cd7f10ff551fd2ec6"]}},"metrics":{"files":{"index.js":{"size":15585,"offset":"1717050","integrity":{"algorithm":"SHA256","hash":"b0429f0dab7c423b5f1288e99a7f0d5c33382f8cd559522ab49921d8fe28b96e","blockSize":4194304,"blocks":["b0429f0dab7c423b5f1288e99a7f0d5c33382f8cd559522ab49921d8fe28b96e"]}},"index.js.map":{"size":30268,"offset":"1732635","integrity":{"algorithm":"SHA256","hash":"5255b30dae79e54499a1b3c3c935e26ede71354b2989a31ff84d5c3502fce759","blockSize":4194304,"blocks":["5255b30dae79e54499a1b3c3c935e26ede71354b2989a31ff84d5c3502fce759"]}},"utils.js":{"size":735,"offset":"1762903","integrity":{"algorithm":"SHA256","hash":"67052603dcafd948c4ece9389aba6d460dbedd15c8ff5e7d27da22374cbabe65","blockSize":4194304,"blocks":["67052603dcafd948c4ece9389aba6d460dbedd15c8ff5e7d27da22374cbabe65"]}},"utils.js.map":{"size":1416,"offset":"1763638","integrity":{"algorithm":"SHA256","hash":"4e01f7a2af41c11b4ef8c5bdfaad62de7822a804cb05f3e25ce9891fda174579","blockSize":4194304,"blocks":["4e01f7a2af41c11b4ef8c5bdfaad62de7822a804cb05f3e25ce9891fda174579"]}}}},"request.js":{"size":9229,"offset":"1765054","integrity":{"algorithm":"SHA256","hash":"d8a610c2b5838a6803eae75f4c5b2845a95297be506d777e381439228d718a07","blockSize":4194304,"blocks":["d8a610c2b5838a6803eae75f4c5b2845a95297be506d777e381439228d718a07"]}},"request.js.map":{"size":19554,"offset":"1774283","integrity":{"algorithm":"SHA256","hash":"795f1a47cb64b228ad28c4de8e7c553b9cc3e06bdc63f09237d00e2af232f15b","blockSize":4194304,"blocks":["795f1a47cb64b228ad28c4de8e7c553b9cc3e06bdc63f09237d00e2af232f15b"]}},"router.js":{"size":2420,"offset":"1793837","integrity":{"algorithm":"SHA256","hash":"619a826d726c149aed69a3c32e3375b813971ad6ed516885b3560a86092724a1","blockSize":4194304,"blocks":["619a826d726c149aed69a3c32e3375b813971ad6ed516885b3560a86092724a1"]}},"router.js.map":{"size":4020,"offset":"1796257","integrity":{"algorithm":"SHA256","hash":"532a6ae048cb5cbfd6d4a4ac68415119990bee2fef1e7f33cd96c3c040ffcc6e","blockSize":4194304,"blocks":["532a6ae048cb5cbfd6d4a4ac68415119990bee2fef1e7f33cd96c3c040ffcc6e"]}},"types.js":{"size":127,"offset":"1800277","integrity":{"algorithm":"SHA256","hash":"8d1bf842e795ab52544adf8ccb3e86bc371a61026076fbfdb5eacc99ca673918","blockSize":4194304,"blocks":["8d1bf842e795ab52544adf8ccb3e86bc371a61026076fbfdb5eacc99ca673918"]}},"types.js.map":{"size":264,"offset":"1800404","integrity":{"algorithm":"SHA256","hash":"15be539704491e2ee8983de21b5b4356a0da5d0e9d75ea71b0fc97c9369e1a66","blockSize":4194304,"blocks":["15be539704491e2ee8983de21b5b4356a0da5d0e9d75ea71b0fc97c9369e1a66"]}},"web-vitals":{"files":{"getCLS.js":{"size":3788,"offset":"1800668","integrity":{"algorithm":"SHA256","hash":"41ea5987b08c7e0722e369b1175ef61ca4f3d75994baa19fe2ff2110c45b3515","blockSize":4194304,"blocks":["41ea5987b08c7e0722e369b1175ef61ca4f3d75994baa19fe2ff2110c45b3515"]}},"getCLS.js.map":{"size":5866,"offset":"1804456","integrity":{"algorithm":"SHA256","hash":"dbf4ba86fac46b6402a8adcbb6b451ab1cfbdf0f340001c529494f01972bd9fc","blockSize":4194304,"blocks":["dbf4ba86fac46b6402a8adcbb6b451ab1cfbdf0f340001c529494f01972bd9fc"]}},"getFID.js":{"size":2121,"offset":"1810322","integrity":{"algorithm":"SHA256","hash":"3a8ee26e8727a2c3297e09a4b370c4fbb517330d4723134703b5bf81f8982692","blockSize":4194304,"blocks":["3a8ee26e8727a2c3297e09a4b370c4fbb517330d4723134703b5bf81f8982692"]}},"getFID.js.map":{"size":3500,"offset":"1812443","integrity":{"algorithm":"SHA256","hash":"948e2efcc73d13b6c1a1144214692ad9279912050e9b422c7f65bcf2d92ede0d","blockSize":4194304,"blocks":["948e2efcc73d13b6c1a1144214692ad9279912050e9b422c7f65bcf2d92ede0d"]}},"getLCP.js":{"size":2938,"offset":"1815943","integrity":{"algorithm":"SHA256","hash":"072222aae78251352369267c9e10ba1ece5189ccb03769f73a7184cc83bca414","blockSize":4194304,"blocks":["072222aae78251352369267c9e10ba1ece5189ccb03769f73a7184cc83bca414"]}},"getLCP.js.map":{"size":4874,"offset":"1818881","integrity":{"algorithm":"SHA256","hash":"7daa4e68201324c4587f862a75eac00f545671d46d0db033ba3e0ee20833205a","blockSize":4194304,"blocks":["7daa4e68201324c4587f862a75eac00f545671d46d0db033ba3e0ee20833205a"]}},"lib":{"files":{"bindReporter.js":{"size":767,"offset":"1823755","integrity":{"algorithm":"SHA256","hash":"ff115f8f3fc6b789edaabfe8aa16a7ec8f06fe856bbf42c6fa75c3af7e48bdec","blockSize":4194304,"blocks":["ff115f8f3fc6b789edaabfe8aa16a7ec8f06fe856bbf42c6fa75c3af7e48bdec"]}},"bindReporter.js.map":{"size":2200,"offset":"1824522","integrity":{"algorithm":"SHA256","hash":"c184916c6c53059d2275425bc1b5c538c12cb0ba53a087b0a0246bd511eeb6c1","blockSize":4194304,"blocks":["c184916c6c53059d2275425bc1b5c538c12cb0ba53a087b0a0246bd511eeb6c1"]}},"generateUniqueID.js":{"size":951,"offset":"1826722","integrity":{"algorithm":"SHA256","hash":"f79130af6bae48164094ef94d9ed38b9185f4c58be1cde4d9a6e7ff234302e3c","blockSize":4194304,"blocks":["f79130af6bae48164094ef94d9ed38b9185f4c58be1cde4d9a6e7ff234302e3c"]}},"generateUniqueID.js.map":{"size":1383,"offset":"1827673","integrity":{"algorithm":"SHA256","hash":"a2ef4d1f9dcd7bafff3ab5b8ed54e841d1fc5a1c837c3768a10c5805aeead4d5","blockSize":4194304,"blocks":["a2ef4d1f9dcd7bafff3ab5b8ed54e841d1fc5a1c837c3768a10c5805aeead4d5"]}},"getActivationStart.js":{"size":871,"offset":"1829056","integrity":{"algorithm":"SHA256","hash":"45d782e63fcd4b907b059cc03dc73837c25c31ef3b90612c11f216dcc2db645b","blockSize":4194304,"blocks":["45d782e63fcd4b907b059cc03dc73837c25c31ef3b90612c11f216dcc2db645b"]}},"getActivationStart.js.map":{"size":1216,"offset":"1829927","integrity":{"algorithm":"SHA256","hash":"bcf0ba027cb70ef3c56cb19a09de889331b212f74a7a6cc064d703a925459f26","blockSize":4194304,"blocks":["bcf0ba027cb70ef3c56cb19a09de889331b212f74a7a6cc064d703a925459f26"]}},"getNavigationEntry.js":{"size":1739,"offset":"1831143","integrity":{"algorithm":"SHA256","hash":"1a9a6b1bfcb8e20cde90e77bcd21a884544f66ff4d330d21991c2f80ded92ea0","blockSize":4194304,"blocks":["1a9a6b1bfcb8e20cde90e77bcd21a884544f66ff4d330d21991c2f80ded92ea0"]}},"getNavigationEntry.js.map":{"size":3223,"offset":"1832882","integrity":{"algorithm":"SHA256","hash":"c69ae7807a6b8d02eaea339eb09692b0c991a2fe269f7cb60a94a785eb6ac300","blockSize":4194304,"blocks":["c69ae7807a6b8d02eaea339eb09692b0c991a2fe269f7cb60a94a785eb6ac300"]}},"getVisibilityWatcher.js":{"size":1689,"offset":"1836105","integrity":{"algorithm":"SHA256","hash":"a45562753593719721367093c4bcac7c6ce5e0c5dd45fdffa0bc2fb70ac3bb87","blockSize":4194304,"blocks":["a45562753593719721367093c4bcac7c6ce5e0c5dd45fdffa0bc2fb70ac3bb87"]}},"getVisibilityWatcher.js.map":{"size":2590,"offset":"1837794","integrity":{"algorithm":"SHA256","hash":"19055bdb8205e7cc953beba366f47388e996bf92701eb0e81c3b0e0d20cc247f","blockSize":4194304,"blocks":["19055bdb8205e7cc953beba366f47388e996bf92701eb0e81c3b0e0d20cc247f"]}},"initMetric.js":{"size":1425,"offset":"1840384","integrity":{"algorithm":"SHA256","hash":"be1fecda82df118329e91706da3318047fb281339dc7d25b14741e9f2a35e090","blockSize":4194304,"blocks":["be1fecda82df118329e91706da3318047fb281339dc7d25b14741e9f2a35e090"]}},"initMetric.js.map":{"size":2375,"offset":"1841809","integrity":{"algorithm":"SHA256","hash":"0ffec69e36a9cd47d48169789dc1d5ad611ce6ee444b982fa187ee4884da7bf4","blockSize":4194304,"blocks":["0ffec69e36a9cd47d48169789dc1d5ad611ce6ee444b982fa187ee4884da7bf4"]}},"observe.js":{"size":872,"offset":"1844184","integrity":{"algorithm":"SHA256","hash":"f772dc1f1f587c243f55ae4f1066068840f627c5a471c603db04d55843387ca9","blockSize":4194304,"blocks":["f772dc1f1f587c243f55ae4f1066068840f627c5a471c603db04d55843387ca9"]}},"observe.js.map":{"size":3017,"offset":"1845056","integrity":{"algorithm":"SHA256","hash":"ee477e8dd5b7fc83ba742a9d78d23a1e44af29e17011a270e72374a880a2dd26","blockSize":4194304,"blocks":["ee477e8dd5b7fc83ba742a9d78d23a1e44af29e17011a270e72374a880a2dd26"]}},"onHidden.js":{"size":1301,"offset":"1848073","integrity":{"algorithm":"SHA256","hash":"090ecde8a28a08673b96db16e72e0afb5fd0d9ca02551b0c57a4eb6f614be89f","blockSize":4194304,"blocks":["090ecde8a28a08673b96db16e72e0afb5fd0d9ca02551b0c57a4eb6f614be89f"]}},"onHidden.js.map":{"size":2138,"offset":"1849374","integrity":{"algorithm":"SHA256","hash":"85c4a1b5c73470b934fad20a740f0dfb03fdd190b98ed30bc71a89b03993de6d","blockSize":4194304,"blocks":["85c4a1b5c73470b934fad20a740f0dfb03fdd190b98ed30bc71a89b03993de6d"]}}}}}}}},"extensions.js":{"size":1686,"offset":"1851512","integrity":{"algorithm":"SHA256","hash":"6b2bb41acec91b461a3e92b2bd67bba7381c0edba61b610e1cedac4dfd6024b2","blockSize":4194304,"blocks":["6b2bb41acec91b461a3e92b2bd67bba7381c0edba61b610e1cedac4dfd6024b2"]}},"extensions.js.map":{"size":3637,"offset":"1853198","integrity":{"algorithm":"SHA256","hash":"72045742950cfde49ac4e91adf82074d1852248ecfdd7d6d399f2728bca30b06","blockSize":4194304,"blocks":["72045742950cfde49ac4e91adf82074d1852248ecfdd7d6d399f2728bca30b06"]}},"index.js":{"size":1080,"offset":"1856835","integrity":{"algorithm":"SHA256","hash":"749b4103f4c9725803f1891706c7d37be85ecb80cf70766b0a777334bbdd62db","blockSize":4194304,"blocks":["749b4103f4c9725803f1891706c7d37be85ecb80cf70766b0a777334bbdd62db"]}},"index.js.map":{"size":101,"offset":"1857915","integrity":{"algorithm":"SHA256","hash":"561e74fb2560d99fd22eee52fea816d5583e6c4b94d9815f5dfbf9fb802a3c9e","blockSize":4194304,"blocks":["561e74fb2560d99fd22eee52fea816d5583e6c4b94d9815f5dfbf9fb802a3c9e"]}},"node":{"files":{"integrations":{"files":{"apollo.js":{"size":5248,"offset":"1858016","integrity":{"algorithm":"SHA256","hash":"f60d14a68cbc4a83048c4ec7d36f5bbfb4f66d32627cc8c5602174c0a49fbe5a","blockSize":4194304,"blocks":["f60d14a68cbc4a83048c4ec7d36f5bbfb4f66d32627cc8c5602174c0a49fbe5a"]}},"apollo.js.map":{"size":22394,"offset":"1863264","integrity":{"algorithm":"SHA256","hash":"47bf82661869ee7288f4a5b30f788e46509a2abf9db1404660e5723a52c72668","blockSize":4194304,"blocks":["47bf82661869ee7288f4a5b30f788e46509a2abf9db1404660e5723a52c72668"]}},"express.js":{"size":11942,"offset":"1885658","integrity":{"algorithm":"SHA256","hash":"3e55b394ac2e6ec9f96c99e6f712aa0f0cd0728d05d20ee161ad6c35b588f359","blockSize":4194304,"blocks":["3e55b394ac2e6ec9f96c99e6f712aa0f0cd0728d05d20ee161ad6c35b588f359"]}},"express.js.map":{"size":55380,"offset":"1897600","integrity":{"algorithm":"SHA256","hash":"4bc001889bafd5a9b37c4c7488035199fa94fb944a2c970418c3d73918873d14","blockSize":4194304,"blocks":["4bc001889bafd5a9b37c4c7488035199fa94fb944a2c970418c3d73918873d14"]}},"graphql.js":{"size":2340,"offset":"1952980","integrity":{"algorithm":"SHA256","hash":"76c98c9f7665cbbd62639300b07e17108756f6ac68dc2afc54793b605b668b6b","blockSize":4194304,"blocks":["76c98c9f7665cbbd62639300b07e17108756f6ac68dc2afc54793b605b668b6b"]}},"graphql.js.map":{"size":9403,"offset":"1955320","integrity":{"algorithm":"SHA256","hash":"8af0ca6693e52f7366a8e3acef5f48e0dc778406e45960aa12617831f9b7d9dd","blockSize":4194304,"blocks":["8af0ca6693e52f7366a8e3acef5f48e0dc778406e45960aa12617831f9b7d9dd"]}},"lazy.js":{"size":1039,"offset":"1964723","integrity":{"algorithm":"SHA256","hash":"408a7501b5599804c8f13a1aa23152e4ba593410c3551aee109618a31cdc4eca","blockSize":4194304,"blocks":["408a7501b5599804c8f13a1aa23152e4ba593410c3551aee109618a31cdc4eca"]}},"lazy.js.map":{"size":3022,"offset":"1965762","integrity":{"algorithm":"SHA256","hash":"bc666e87bca7b9e6eeb6a4251c96f842467da3bd75dc8092a21a9d83c8aa7a8d","blockSize":4194304,"blocks":["bc666e87bca7b9e6eeb6a4251c96f842467da3bd75dc8092a21a9d83c8aa7a8d"]}},"mongo.js":{"size":9433,"offset":"1968784","integrity":{"algorithm":"SHA256","hash":"b1cde1355bde24d987d7387ddd3c1314861663be7a57d1cca934a9c8ee604aa4","blockSize":4194304,"blocks":["b1cde1355bde24d987d7387ddd3c1314861663be7a57d1cca934a9c8ee604aa4"]}},"mongo.js.map":{"size":43000,"offset":"1978217","integrity":{"algorithm":"SHA256","hash":"754f69a0461811d19ce177532b87b8bbd10629cd937abca176bd82a966c17dda","blockSize":4194304,"blocks":["754f69a0461811d19ce177532b87b8bbd10629cd937abca176bd82a966c17dda"]}},"mysql.js":{"size":2511,"offset":"2021217","integrity":{"algorithm":"SHA256","hash":"35a22aafac21dfe574401d10f0d793ecb50158eed9a9c2e2a1e8d4b093d48a2e","blockSize":4194304,"blocks":["35a22aafac21dfe574401d10f0d793ecb50158eed9a9c2e2a1e8d4b093d48a2e"]}},"mysql.js.map":{"size":9974,"offset":"2023728","integrity":{"algorithm":"SHA256","hash":"a800f8109a8f8ca56fddf69666d4ca018139ab293ccaaa57447ebd376782e09f","blockSize":4194304,"blocks":["a800f8109a8f8ca56fddf69666d4ca018139ab293ccaaa57447ebd376782e09f"]}},"postgres.js":{"size":3315,"offset":"2033702","integrity":{"algorithm":"SHA256","hash":"e2526fc17b64ed1ac61f67b30c8ecb3dd454b1564115eee6fb9d8bbb6b2e693a","blockSize":4194304,"blocks":["e2526fc17b64ed1ac61f67b30c8ecb3dd454b1564115eee6fb9d8bbb6b2e693a"]}},"postgres.js.map":{"size":13506,"offset":"2037017","integrity":{"algorithm":"SHA256","hash":"acc5376d85f0697dfcb1c87e1dfed4834814eeca97567e56980c9b50a7365f54","blockSize":4194304,"blocks":["acc5376d85f0697dfcb1c87e1dfed4834814eeca97567e56980c9b50a7365f54"]}},"prisma.js":{"size":1744,"offset":"2050523","integrity":{"algorithm":"SHA256","hash":"b6f9f9ce862afd859dedf4714fb98ebceb4575001e93af7496dd8e7ab069ba1c","blockSize":4194304,"blocks":["b6f9f9ce862afd859dedf4714fb98ebceb4575001e93af7496dd8e7ab069ba1c"]}},"prisma.js.map":{"size":4178,"offset":"2052267","integrity":{"algorithm":"SHA256","hash":"52e72ee857d9c7cacc1d34d31bca5a2ab5f8c7fb4c6d3c3955d0507027c2427c","blockSize":4194304,"blocks":["52e72ee857d9c7cacc1d34d31bca5a2ab5f8c7fb4c6d3c3955d0507027c2427c"]}},"utils":{"files":{"node-utils.js":{"size":693,"offset":"2056445","integrity":{"algorithm":"SHA256","hash":"47cfa4a50ac248f69c1d7db0d71478427bb2cfffe4b6d159c5f125086b12d1ae","blockSize":4194304,"blocks":["47cfa4a50ac248f69c1d7db0d71478427bb2cfffe4b6d159c5f125086b12d1ae"]}},"node-utils.js.map":{"size":2605,"offset":"2057138","integrity":{"algorithm":"SHA256","hash":"1c51c5eca5d4d2fa47c8129f2f9b204930100119cd111c8c5d7f6a36355d9f15","blockSize":4194304,"blocks":["1c51c5eca5d4d2fa47c8129f2f9b204930100119cd111c8c5d7f6a36355d9f15"]}}}}}}}}}},"LICENSE":{"size":1120,"offset":"2059743","integrity":{"algorithm":"SHA256","hash":"2f22d1019a31790dc1272db93532339242e2fbf475c949bc4ad6864132a73b8c","blockSize":4194304,"blocks":["2f22d1019a31790dc1272db93532339242e2fbf475c949bc4ad6864132a73b8c"]}},"package.json":{"size":723,"offset":"2060863","integrity":{"algorithm":"SHA256","hash":"5a3b2192cde51c329db6b6fed8635fd0e2f1a13f60e21c52db8b380211357a2c","blockSize":4194304,"blocks":["5a3b2192cde51c329db6b6fed8635fd0e2f1a13f60e21c52db8b380211357a2c"]}},"README.md":{"size":562,"offset":"2061586","integrity":{"algorithm":"SHA256","hash":"5d4d6852b18c1524a84f17c30197114f26e6398ebedcb07d3a3aa82b86f7ca66","blockSize":4194304,"blocks":["5d4d6852b18c1524a84f17c30197114f26e6398ebedcb07d3a3aa82b86f7ca66"]}},"types":{"files":{"browser":{"files":{"backgroundtab.d.ts":{"size":212,"offset":"2062148","integrity":{"algorithm":"SHA256","hash":"70eacc20cc449b1c35e0aa4a37e0d7ba62571db9a8689dcbbb2900a3d5bbe8d7","blockSize":4194304,"blocks":["70eacc20cc449b1c35e0aa4a37e0d7ba62571db9a8689dcbbb2900a3d5bbe8d7"]}},"backgroundtab.d.ts.map":{"size":181,"offset":"2062360","integrity":{"algorithm":"SHA256","hash":"b1cd1baa59de907e7c7f2899d095855d375168a2988f5dd915e337e36abf84da","blockSize":4194304,"blocks":["b1cd1baa59de907e7c7f2899d095855d375168a2988f5dd915e337e36abf84da"]}},"browsertracing.d.ts":{"size":5432,"offset":"2062541","integrity":{"algorithm":"SHA256","hash":"c7f40d46d2e5201e7dd18fe78d794607005b4c8aa9345e3f6483d4f1a9cc3d96","blockSize":4194304,"blocks":["c7f40d46d2e5201e7dd18fe78d794607005b4c8aa9345e3f6483d4f1a9cc3d96"]}},"browsertracing.d.ts.map":{"size":1859,"offset":"2067973","integrity":{"algorithm":"SHA256","hash":"60b56db1f55ed6473424793472fc535db391eb5f0a666d43bb54be149a867700","blockSize":4194304,"blocks":["60b56db1f55ed6473424793472fc535db391eb5f0a666d43bb54be149a867700"]}},"index.d.ts":{"size":338,"offset":"2069832","integrity":{"algorithm":"SHA256","hash":"c134810f1c4cb0cb362aa332b4b5e06cbbb215f61ad9623de1136e9dfff3548f","blockSize":4194304,"blocks":["c134810f1c4cb0cb362aa332b4b5e06cbbb215f61ad9623de1136e9dfff3548f"]}},"index.d.ts.map":{"size":305,"offset":"2070170","integrity":{"algorithm":"SHA256","hash":"c3fb5348fa1e60cda6739aabe7e791d44dbf7463d41e7ec31d1ff4905d76eb8d","blockSize":4194304,"blocks":["c3fb5348fa1e60cda6739aabe7e791d44dbf7463d41e7ec31d1ff4905d76eb8d"]}},"metrics":{"files":{"index.d.ts":{"size":1202,"offset":"2070475","integrity":{"algorithm":"SHA256","hash":"182f1d10472b49ceb8a6cbbeb5bfaa68ca1359adce24cb024f77c36ae0033bf9","blockSize":4194304,"blocks":["182f1d10472b49ceb8a6cbbeb5bfaa68ca1359adce24cb024f77c36ae0033bf9"]}},"index.d.ts.map":{"size":966,"offset":"2071677","integrity":{"algorithm":"SHA256","hash":"6623b9b66e98008dc008d0ad80b3492449cdced0ee43b639791663971b4740bc","blockSize":4194304,"blocks":["6623b9b66e98008dc008d0ad80b3492449cdced0ee43b639791663971b4740bc"]}},"utils.d.ts":{"size":625,"offset":"2072643","integrity":{"algorithm":"SHA256","hash":"27be33150e3d7cc4e9301566e5966e2b0dd5b69e106ff15e5cc610ebec981aca","blockSize":4194304,"blocks":["27be33150e3d7cc4e9301566e5966e2b0dd5b69e106ff15e5cc610ebec981aca"]}},"utils.d.ts.map":{"size":417,"offset":"2073268","integrity":{"algorithm":"SHA256","hash":"ae82b6db3a6bcba9a8a39846327d1cb4d1af2c2d39d0c69c6b2b9c62b1dbdcbf","blockSize":4194304,"blocks":["ae82b6db3a6bcba9a8a39846327d1cb4d1af2c2d39d0c69c6b2b9c62b1dbdcbf"]}}}},"request.d.ts":{"size":4015,"offset":"2073685","integrity":{"algorithm":"SHA256","hash":"b5f86270cb69630ea98f56522cccaabf1a2b11e7457fc1dc2439c87eddb196a8","blockSize":4194304,"blocks":["b5f86270cb69630ea98f56522cccaabf1a2b11e7457fc1dc2439c87eddb196a8"]}},"request.d.ts.map":{"size":2652,"offset":"2077700","integrity":{"algorithm":"SHA256","hash":"ac3b550529781f9e345a81cd3785d2984373559cd92e02bb9ab22636023ef951","blockSize":4194304,"blocks":["ac3b550529781f9e345a81cd3785d2984373559cd92e02bb9ab22636023ef951"]}},"router.d.ts":{"size":422,"offset":"2080352","integrity":{"algorithm":"SHA256","hash":"6a866db2fb114cf77bc5e5e4312987ec7dfd7f43e6d68d15a01463132fb9e69e","blockSize":4194304,"blocks":["6a866db2fb114cf77bc5e5e4312987ec7dfd7f43e6d68d15a01463132fb9e69e"]}},"router.d.ts.map":{"size":350,"offset":"2080774","integrity":{"algorithm":"SHA256","hash":"5c62e7e4e3d2c363771cbe2bc7fd1868c8e98824212722e5b5983dbab7e187d1","blockSize":4194304,"blocks":["5c62e7e4e3d2c363771cbe2bc7fd1868c8e98824212722e5b5983dbab7e187d1"]}},"types.d.ts":{"size":113,"offset":"2081124","integrity":{"algorithm":"SHA256","hash":"3e9319cdd330c1bbdd9cc62f4efecc003df3a7216646ac0ca8d71726c4bc2d22","blockSize":4194304,"blocks":["3e9319cdd330c1bbdd9cc62f4efecc003df3a7216646ac0ca8d71726c4bc2d22"]}},"types.d.ts.map":{"size":149,"offset":"2081237","integrity":{"algorithm":"SHA256","hash":"d960617ca8cc478546d5ee04f58a538acd5cd14c62c15f246b6a68202306e29f","blockSize":4194304,"blocks":["d960617ca8cc478546d5ee04f58a538acd5cd14c62c15f246b6a68202306e29f"]}},"web-vitals":{"files":{"getCLS.d.ts":{"size":1361,"offset":"2081386","integrity":{"algorithm":"SHA256","hash":"47be5fdf30ac7b40569472fdaa972f4ba5c6bdae66bd956d09578a1f900b0706","blockSize":4194304,"blocks":["47be5fdf30ac7b40569472fdaa972f4ba5c6bdae66bd956d09578a1f900b0706"]}},"getCLS.d.ts.map":{"size":253,"offset":"2082747","integrity":{"algorithm":"SHA256","hash":"f29631947142b9b6c770fe3094f0aed7906981b4a79c0ee3319204818cd65898","blockSize":4194304,"blocks":["f29631947142b9b6c770fe3094f0aed7906981b4a79c0ee3319204818cd65898"]}},"getFID.d.ts":{"size":585,"offset":"2083000","integrity":{"algorithm":"SHA256","hash":"2f14f9e6ff5b006625879309941ea73b0e8a3815bbf8047420e5334cef5fd3f2","blockSize":4194304,"blocks":["2f14f9e6ff5b006625879309941ea73b0e8a3815bbf8047420e5334cef5fd3f2"]}},"getFID.d.ts.map":{"size":231,"offset":"2083585","integrity":{"algorithm":"SHA256","hash":"568eb078a036407e8c5942fc6675b8a5c7cfe70d8aa418ff5782c5f1d5b5ea68","blockSize":4194304,"blocks":["568eb078a036407e8c5942fc6675b8a5c7cfe70d8aa418ff5782c5f1d5b5ea68"]}},"getLCP.d.ts":{"size":478,"offset":"2083816","integrity":{"algorithm":"SHA256","hash":"91f1dce6dde51a7295cbba153e21eea4dc48a00835475e4f7109fdae962c7daa","blockSize":4194304,"blocks":["91f1dce6dde51a7295cbba153e21eea4dc48a00835475e4f7109fdae962c7daa"]}},"getLCP.d.ts.map":{"size":237,"offset":"2084294","integrity":{"algorithm":"SHA256","hash":"90fd06bd4aeeeb5debeaee5e574fc43c0cdbd6d00961dc26a2d7728bfc8deaf6","blockSize":4194304,"blocks":["90fd06bd4aeeeb5debeaee5e574fc43c0cdbd6d00961dc26a2d7728bfc8deaf6"]}},"lib":{"files":{"bindReporter.d.ts":{"size":264,"offset":"2084531","integrity":{"algorithm":"SHA256","hash":"9476666a14c3a6221de356f80626748165b02db732a02df3c4f1678bd1231952","blockSize":4194304,"blocks":["9476666a14c3a6221de356f80626748165b02db732a02df3c4f1678bd1231952"]}},"bindReporter.d.ts.map":{"size":242,"offset":"2084795","integrity":{"algorithm":"SHA256","hash":"c1e6806623752a24f19bb86c6c61665de11759c71862e0878721d627aadfb428","blockSize":4194304,"blocks":["c1e6806623752a24f19bb86c6c61665de11759c71862e0878721d627aadfb428"]}},"generateUniqueID.d.ts":{"size":265,"offset":"2085037","integrity":{"algorithm":"SHA256","hash":"c6db58b6f44ad584fdd29e0bf20101728e6e46adb6010969dbcbdd979fc453f2","blockSize":4194304,"blocks":["c6db58b6f44ad584fdd29e0bf20101728e6e46adb6010969dbcbdd979fc453f2"]}},"generateUniqueID.d.ts.map":{"size":207,"offset":"2085302","integrity":{"algorithm":"SHA256","hash":"d8985111cdce4ba334b6e29acf6a68863b77b571250fab6603eb6d4c80ab71dc","blockSize":4194304,"blocks":["d8985111cdce4ba334b6e29acf6a68863b77b571250fab6603eb6d4c80ab71dc"]}},"getActivationStart.d.ts":{"size":103,"offset":"2085509","integrity":{"algorithm":"SHA256","hash":"4e699bc194053bc29579d57517d962d459decfdabc950427f96b9de9735dae56","blockSize":4194304,"blocks":["4e699bc194053bc29579d57517d962d459decfdabc950427f96b9de9735dae56"]}},"getActivationStart.d.ts.map":{"size":198,"offset":"2085612","integrity":{"algorithm":"SHA256","hash":"f3efd92e543afcec12859704f5f5adfaac4afdaef09557ea3b5e96bbe472f2cb","blockSize":4194304,"blocks":["f3efd92e543afcec12859704f5f5adfaac4afdaef09557ea3b5e96bbe472f2cb"]}},"getNavigationEntry.d.ts":{"size":637,"offset":"2085810","integrity":{"algorithm":"SHA256","hash":"a7a13f0348732f6b545bfbe1a7efcdeac36b284b695956d3e53ffeb35f682c5b","blockSize":4194304,"blocks":["a7a13f0348732f6b545bfbe1a7efcdeac36b284b695956d3e53ffeb35f682c5b"]}},"getNavigationEntry.d.ts.map":{"size":200,"offset":"2086447","integrity":{"algorithm":"SHA256","hash":"27a2f8fdc0335ef4043d6c757af88cd06575287f893ccde1a5c951f86b2dd1c7","blockSize":4194304,"blocks":["27a2f8fdc0335ef4043d6c757af88cd06575287f893ccde1a5c951f86b2dd1c7"]}},"getVisibilityWatcher.d.ts":{"size":142,"offset":"2086647","integrity":{"algorithm":"SHA256","hash":"3c70de8bba9faca6d495faf7b56971a51687a5efb7763441cfc7b9f62ddb2720","blockSize":4194304,"blocks":["3c70de8bba9faca6d495faf7b56971a51687a5efb7763441cfc7b9f62ddb2720"]}},"getVisibilityWatcher.d.ts.map":{"size":204,"offset":"2086789","integrity":{"algorithm":"SHA256","hash":"910393446f2a52cdac7c403f7cfb81d20097d8b6546cfc324999d63aa6b42d41","blockSize":4194304,"blocks":["910393446f2a52cdac7c403f7cfb81d20097d8b6546cfc324999d63aa6b42d41"]}},"initMetric.d.ts":{"size":207,"offset":"2086993","integrity":{"algorithm":"SHA256","hash":"50f8a6786d42803364cc9dfeff41201a1403933f4aacd602508b97f7a006c2f7","blockSize":4194304,"blocks":["50f8a6786d42803364cc9dfeff41201a1403933f4aacd602508b97f7a006c2f7"]}},"initMetric.d.ts.map":{"size":228,"offset":"2087200","integrity":{"algorithm":"SHA256","hash":"29fc3dddb31d7ed5d3721e7b8da7adeb2bb08aa5a689505a3d49feba7b3bd2db","blockSize":4194304,"blocks":["29fc3dddb31d7ed5d3721e7b8da7adeb2bb08aa5a689505a3d49feba7b3bd2db"]}},"observe.d.ts":{"size":1338,"offset":"2087428","integrity":{"algorithm":"SHA256","hash":"57af1759d898651b5cc4c176f484e9fe422b26e4acd5e511bebbd4a8d0344601","blockSize":4194304,"blocks":["57af1759d898651b5cc4c176f484e9fe422b26e4acd5e511bebbd4a8d0344601"]}},"observe.d.ts.map":{"size":656,"offset":"2088766","integrity":{"algorithm":"SHA256","hash":"0d77f0e7d9c2d9966c886322055f9c62c4e30465355401d07a4afbc338ef7cd7","blockSize":4194304,"blocks":["0d77f0e7d9c2d9966c886322055f9c62c4e30465355401d07a4afbc338ef7cd7"]}},"onHidden.d.ts":{"size":193,"offset":"2089422","integrity":{"algorithm":"SHA256","hash":"9d831503dfa9598f9049a882c1fa8275af67a90ff7e6efd6907b379ffbb1c88f","blockSize":4194304,"blocks":["9d831503dfa9598f9049a882c1fa8275af67a90ff7e6efd6907b379ffbb1c88f"]}},"onHidden.d.ts.map":{"size":246,"offset":"2089615","integrity":{"algorithm":"SHA256","hash":"f0d54683f9fd9e126e4394922592216860f1f54ed38863a6d80b7646706b97e6","blockSize":4194304,"blocks":["f0d54683f9fd9e126e4394922592216860f1f54ed38863a6d80b7646706b97e6"]}}}},"types":{"files":{"base.d.ts":{"size":3494,"offset":"2095485","integrity":{"algorithm":"SHA256","hash":"3a45a1074792e93b7230f98d57fa219a6ba9a19cc1f4ae457f46775c5d544ea6","blockSize":4194304,"blocks":["3a45a1074792e93b7230f98d57fa219a6ba9a19cc1f4ae457f46775c5d544ea6"]}},"base.d.ts.map":{"size":1072,"offset":"2098979","integrity":{"algorithm":"SHA256","hash":"041b8b2e265c65126533a0392f789bba2f44621f83c1e2a21f92946a0e687190","blockSize":4194304,"blocks":["041b8b2e265c65126533a0392f789bba2f44621f83c1e2a21f92946a0e687190"]}},"cls.d.ts":{"size":2395,"offset":"2100051","integrity":{"algorithm":"SHA256","hash":"8844ccbfc231536d61cd334aad543a751557935b7d9a9712a5655b4e0e41ee3a","blockSize":4194304,"blocks":["8844ccbfc231536d61cd334aad543a751557935b7d9a9712a5655b4e0e41ee3a"]}},"cls.d.ts.map":{"size":880,"offset":"2102446","integrity":{"algorithm":"SHA256","hash":"097abaa71514b3f9161d4fc785fb9d7e8af782807a9719e06c881f4e200f5dcb","blockSize":4194304,"blocks":["097abaa71514b3f9161d4fc785fb9d7e8af782807a9719e06c881f4e200f5dcb"]}},"fid.d.ts":{"size":2164,"offset":"2103326","integrity":{"algorithm":"SHA256","hash":"fe7232cbe052c0961655d8c4204d11f285f35ccba8f872a9c8b38e1f1e35e8d2","blockSize":4194304,"blocks":["fe7232cbe052c0961655d8c4204d11f285f35ccba8f872a9c8b38e1f1e35e8d2"]}},"fid.d.ts.map":{"size":881,"offset":"2105490","integrity":{"algorithm":"SHA256","hash":"201c6addaeea07c2c3cfb158c1d4cb014f6a3518f654a4a48bf56f4124429dab","blockSize":4194304,"blocks":["201c6addaeea07c2c3cfb158c1d4cb014f6a3518f654a4a48bf56f4124429dab"]}},"lcp.d.ts":{"size":2862,"offset":"2106371","integrity":{"algorithm":"SHA256","hash":"61a0e356646c76b24c5d71e97166686a7c7ab7b9c2b5977fbdcddd1ee10bde27","blockSize":4194304,"blocks":["61a0e356646c76b24c5d71e97166686a7c7ab7b9c2b5977fbdcddd1ee10bde27"]}},"lcp.d.ts.map":{"size":1038,"offset":"2109233","integrity":{"algorithm":"SHA256","hash":"08c916aab644435b049e00a642f228497f4b65d86fe566c9d03cf0f29af4959b","blockSize":4194304,"blocks":["08c916aab644435b049e00a642f228497f4b65d86fe566c9d03cf0f29af4959b"]}},"polyfills.d.ts":{"size":485,"offset":"2110271","integrity":{"algorithm":"SHA256","hash":"51acc91a8f77bed2cb9df1a628c40b845afe27f88fa1a73e516e603ee9aaf3ba","blockSize":4194304,"blocks":["51acc91a8f77bed2cb9df1a628c40b845afe27f88fa1a73e516e603ee9aaf3ba"]}},"polyfills.d.ts.map":{"size":465,"offset":"2110756","integrity":{"algorithm":"SHA256","hash":"944eaf49676fc167e3c0bf8fb922e3a3140d570f0217ecabc05cd9c709c8302c","blockSize":4194304,"blocks":["944eaf49676fc167e3c0bf8fb922e3a3140d570f0217ecabc05cd9c709c8302c"]}}}},"types.d.ts":{"size":3074,"offset":"2089861","integrity":{"algorithm":"SHA256","hash":"d65130098746141aa64a566d858df6a2d2656f8ab111b39c927f8859edf47862","blockSize":4194304,"blocks":["d65130098746141aa64a566d858df6a2d2656f8ab111b39c927f8859edf47862"]}},"types.d.ts.map":{"size":2550,"offset":"2092935","integrity":{"algorithm":"SHA256","hash":"c66fe37251e47c6db7262d5f3f3a1b75c7b0e5f834a7c04934497cd87900462d","blockSize":4194304,"blocks":["c66fe37251e47c6db7262d5f3f3a1b75c7b0e5f834a7c04934497cd87900462d"]}}}}}},"exports":{"files":{"index.d.ts":{"size":356,"offset":"2111221","integrity":{"algorithm":"SHA256","hash":"84b0ebce0f965ff9fc2ed477adda5f5528b8fce5e911547ae3a23d40b42a4292","blockSize":4194304,"blocks":["84b0ebce0f965ff9fc2ed477adda5f5528b8fce5e911547ae3a23d40b42a4292"]}},"index.d.ts.map":{"size":348,"offset":"2111577","integrity":{"algorithm":"SHA256","hash":"5facd4521d74eb4ec4c411efafec42c380c87dcd58fde646c4c70d1dc9b94678","blockSize":4194304,"blocks":["5facd4521d74eb4ec4c411efafec42c380c87dcd58fde646c4c70d1dc9b94678"]}}}},"extensions.d.ts":{"size":178,"offset":"2111925","integrity":{"algorithm":"SHA256","hash":"490bf2ef4ab727cbf4293cd5fd6b745cd59fa2700bd55154f31d7b3b923cdc04","blockSize":4194304,"blocks":["490bf2ef4ab727cbf4293cd5fd6b745cd59fa2700bd55154f31d7b3b923cdc04"]}},"extensions.d.ts.map":{"size":163,"offset":"2112103","integrity":{"algorithm":"SHA256","hash":"5d6db529b17c2257b316e81ec974fb6655f66c3ff88dc4af24007aa2d9f21377","blockSize":4194304,"blocks":["5d6db529b17c2257b316e81ec974fb6655f66c3ff88dc4af24007aa2d9f21377"]}},"index.d.ts":{"size":540,"offset":"2112266","integrity":{"algorithm":"SHA256","hash":"46b3d9dedffb5ade29a2623eb4af69a50aff3140f82564c9788012a09242ffbc","blockSize":4194304,"blocks":["46b3d9dedffb5ade29a2623eb4af69a50aff3140f82564c9788012a09242ffbc"]}},"index.d.ts.map":{"size":462,"offset":"2112806","integrity":{"algorithm":"SHA256","hash":"bfc16f2a5248a2696bf58a85998c439703654212d3d797d897a72ba941226950","blockSize":4194304,"blocks":["bfc16f2a5248a2696bf58a85998c439703654212d3d797d897a72ba941226950"]}},"node":{"files":{"index.d.ts":{"size":95,"offset":"2113268","integrity":{"algorithm":"SHA256","hash":"c8b8e4d49e4093a3a3ab2fc2be7d815dde809e62b55f7792b1618300cd87013d","blockSize":4194304,"blocks":["c8b8e4d49e4093a3a3ab2fc2be7d815dde809e62b55f7792b1618300cd87013d"]}},"index.d.ts.map":{"size":157,"offset":"2113363","integrity":{"algorithm":"SHA256","hash":"26b175ef36374ed0ca54a83a843c263ff2571915d2b9ab8715fe318f00b0741d","blockSize":4194304,"blocks":["26b175ef36374ed0ca54a83a843c263ff2571915d2b9ab8715fe318f00b0741d"]}},"integrations":{"files":{"apollo.d.ts":{"size":1304,"offset":"2113520","integrity":{"algorithm":"SHA256","hash":"856b953f07da79c4b662b53fac4922e511c6a5fc3b8c1bdc01b16ed9761df3da","blockSize":4194304,"blocks":["856b953f07da79c4b662b53fac4922e511c6a5fc3b8c1bdc01b16ed9761df3da"]}},"apollo.d.ts.map":{"size":1170,"offset":"2114824","integrity":{"algorithm":"SHA256","hash":"302212eaad659cb299a1da216acbcdb1fff3a6f89e7376e8bd76eccacdb9c8cc","blockSize":4194304,"blocks":["302212eaad659cb299a1da216acbcdb1fff3a6f89e7376e8bd76eccacdb9c8cc"]}},"express.d.ts":{"size":1106,"offset":"2115994","integrity":{"algorithm":"SHA256","hash":"e277349bb219c3a908393ad8d6567ba3ed7fe80aafb11f566e48f4d563f47bda","blockSize":4194304,"blocks":["e277349bb219c3a908393ad8d6567ba3ed7fe80aafb11f566e48f4d563f47bda"]}},"express.d.ts.map":{"size":976,"offset":"2117100","integrity":{"algorithm":"SHA256","hash":"6e3d70a3298d56bb3c465be4800770bc9facca46991586005d27d8265425e725","blockSize":4194304,"blocks":["6e3d70a3298d56bb3c465be4800770bc9facca46991586005d27d8265425e725"]}},"graphql.d.ts":{"size":738,"offset":"2118076","integrity":{"algorithm":"SHA256","hash":"524d8dec4b297a9781fba098bc46aeee60213e51d49967b7d9683b4937f731b5","blockSize":4194304,"blocks":["524d8dec4b297a9781fba098bc46aeee60213e51d49967b7d9683b4937f731b5"]}},"graphql.d.ts.map":{"size":700,"offset":"2118814","integrity":{"algorithm":"SHA256","hash":"91787e32d6b8fc90af3d61598ac764e3463e80230c5e6e5313cfcb9394af05e8","blockSize":4194304,"blocks":["91787e32d6b8fc90af3d61598ac764e3463e80230c5e6e5313cfcb9394af05e8"]}},"index.d.ts":{"size":308,"offset":"2119514","integrity":{"algorithm":"SHA256","hash":"966ffbe4dc939e2b11384d68a25f5ea134a266fe7a267958e00319e676dbe506","blockSize":4194304,"blocks":["966ffbe4dc939e2b11384d68a25f5ea134a266fe7a267958e00319e676dbe506"]}},"index.d.ts.map":{"size":437,"offset":"2119822","integrity":{"algorithm":"SHA256","hash":"a19d0fe8d66ff9261da3fe286d47300babd33a6e7f2c48b5514f232c7cb90eb9","blockSize":4194304,"blocks":["a19d0fe8d66ff9261da3fe286d47300babd33a6e7f2c48b5514f232c7cb90eb9"]}},"lazy.d.ts":{"size":487,"offset":"2120259","integrity":{"algorithm":"SHA256","hash":"36a56226c57d0cd7dfdc98b7dd5b2fb33a0143b3b4017da308e654983878d048","blockSize":4194304,"blocks":["36a56226c57d0cd7dfdc98b7dd5b2fb33a0143b3b4017da308e654983878d048"]}},"lazy.d.ts.map":{"size":348,"offset":"2120746","integrity":{"algorithm":"SHA256","hash":"ee6ce1977a2617bfde019eaddfb41dd363b09eb83c533ca1479379aabb01722f","blockSize":4194304,"blocks":["ee6ce1977a2617bfde019eaddfb41dd363b09eb83c533ca1479379aabb01722f"]}},"mongo.d.ts":{"size":2109,"offset":"2121094","integrity":{"algorithm":"SHA256","hash":"d0636fd0bda0aefe894d6bedb999ec5d57cebf77d4eb76672b30206ef5b8f066","blockSize":4194304,"blocks":["d0636fd0bda0aefe894d6bedb999ec5d57cebf77d4eb76672b30206ef5b8f066"]}},"mongo.d.ts.map":{"size":1286,"offset":"2123203","integrity":{"algorithm":"SHA256","hash":"3888dbd833d69bb3ae8ec3135774c7b0935bd6feac369ab181c2f2467887068c","blockSize":4194304,"blocks":["3888dbd833d69bb3ae8ec3135774c7b0935bd6feac369ab181c2f2467887068c"]}},"mysql.d.ts":{"size":711,"offset":"2124489","integrity":{"algorithm":"SHA256","hash":"bac6c19e8d1531cec2a22f695c91f070ba8aaa809a450bd9e607b92c3bc950ce","blockSize":4194304,"blocks":["bac6c19e8d1531cec2a22f695c91f070ba8aaa809a450bd9e607b92c3bc950ce"]}},"mysql.d.ts.map":{"size":641,"offset":"2125200","integrity":{"algorithm":"SHA256","hash":"b65ac4a45dbe44e1573c122614b20f0941e76504c413c33c0fd34123b3414b0d","blockSize":4194304,"blocks":["b65ac4a45dbe44e1573c122614b20f0941e76504c413c33c0fd34123b3414b0d"]}},"postgres.d.ts":{"size":953,"offset":"2125841","integrity":{"algorithm":"SHA256","hash":"912e20c0d4a40f93a8d665b9362953640dd8059318e00307c137f028865dc967","blockSize":4194304,"blocks":["912e20c0d4a40f93a8d665b9362953640dd8059318e00307c137f028865dc967"]}},"postgres.d.ts.map":{"size":901,"offset":"2126794","integrity":{"algorithm":"SHA256","hash":"ee1a6919cf749da8559b34d59fc09ef47d1e046972243b1f856ac35bdaa81e37","blockSize":4194304,"blocks":["ee1a6919cf749da8559b34d59fc09ef47d1e046972243b1f856ac35bdaa81e37"]}},"prisma.d.ts":{"size":662,"offset":"2127695","integrity":{"algorithm":"SHA256","hash":"3ec1050e08afb019dcad34688b6e7b481db0a1349222287021b57c42a31ee130","blockSize":4194304,"blocks":["3ec1050e08afb019dcad34688b6e7b481db0a1349222287021b57c42a31ee130"]}},"prisma.d.ts.map":{"size":578,"offset":"2128357","integrity":{"algorithm":"SHA256","hash":"79f7a62e0f107bbf07dd5adac067d57eb846946d9923269347ab8c5cf64d1a45","blockSize":4194304,"blocks":["79f7a62e0f107bbf07dd5adac067d57eb846946d9923269347ab8c5cf64d1a45"]}},"utils":{"files":{"node-utils.d.ts":{"size":324,"offset":"2128935","integrity":{"algorithm":"SHA256","hash":"57e8ae000cec1802dae48ee2a870603f08efc70b3a95c623b55be2653f8c7755","blockSize":4194304,"blocks":["57e8ae000cec1802dae48ee2a870603f08efc70b3a95c623b55be2653f8c7755"]}},"node-utils.d.ts.map":{"size":269,"offset":"2129259","integrity":{"algorithm":"SHA256","hash":"b2db7fc2960a9e903c1460e49a3418d26f7b7dc99e25c401ee8ee73ba8bf4049","blockSize":4194304,"blocks":["b2db7fc2960a9e903c1460e49a3418d26f7b7dc99e25c401ee8ee73ba8bf4049"]}}}}}}}}}}}}}},"@sindresorhus":{"files":{}},"@szmarczak":{"files":{}},"@tootallnate":{"files":{}},"@types":{"files":{}},"@typescript-eslint":{"files":{}},"@xmldom":{"files":{}},"agent-base":{"files":{"dist":{"files":{"src":{"files":{"index.d.ts":{"size":3197,"offset":"9058854","integrity":{"algorithm":"SHA256","hash":"27dddbe3a7e8f45bc30547499461c74851580b74556570a4d7daa90ba90e2af0","blockSize":4194304,"blocks":["27dddbe3a7e8f45bc30547499461c74851580b74556570a4d7daa90ba90e2af0"]}},"index.js":{"size":7910,"offset":"9062051","integrity":{"algorithm":"SHA256","hash":"13b6d658b492796461358e19fe1de30665ab2efb04c726b82530352cd364d4ac","blockSize":4194304,"blocks":["13b6d658b492796461358e19fe1de30665ab2efb04c726b82530352cd364d4ac"]}},"index.js.map":{"size":5824,"offset":"9069961","integrity":{"algorithm":"SHA256","hash":"9e206a009216ba513d06c1e3e7e34a2a9cfb96b576c40e26645b4732e4420c85","blockSize":4194304,"blocks":["9e206a009216ba513d06c1e3e7e34a2a9cfb96b576c40e26645b4732e4420c85"]}},"promisify.d.ts":{"size":299,"offset":"9075785","integrity":{"algorithm":"SHA256","hash":"b0ec793e363fc425ceba310c8f93d54f90b95e6e3f9e73dcb245b284719d179e","blockSize":4194304,"blocks":["b0ec793e363fc425ceba310c8f93d54f90b95e6e3f9e73dcb245b284719d179e"]}},"promisify.js":{"size":495,"offset":"9076084","integrity":{"algorithm":"SHA256","hash":"7db1e28ac19b38be8cf3edecac66c7084bb00b65f6755a83309bcf10564b5771","blockSize":4194304,"blocks":["7db1e28ac19b38be8cf3edecac66c7084bb00b65f6755a83309bcf10564b5771"]}},"promisify.js.map":{"size":499,"offset":"9076579","integrity":{"algorithm":"SHA256","hash":"7954e5478a28182dfa3d4a21f33ff687c6d725b0a2b8eed04633ea57eefba6d9","blockSize":4194304,"blocks":["7954e5478a28182dfa3d4a21f33ff687c6d725b0a2b8eed04633ea57eefba6d9"]}}}}}},"package.json":{"size":1635,"offset":"9077078","integrity":{"algorithm":"SHA256","hash":"05daa619e51686fd21d15f987f943f6692c56b9f489f555cbaf42a4263d5c5e8","blockSize":4194304,"blocks":["05daa619e51686fd21d15f987f943f6692c56b9f489f555cbaf42a4263d5c5e8"]}},"README.md":{"size":5056,"offset":"9078713","integrity":{"algorithm":"SHA256","hash":"f1425c3b72330fe4fb2aa5a2fb152e939bdf534692a32b5f0b38f74147b98556","blockSize":4194304,"blocks":["f1425c3b72330fe4fb2aa5a2fb152e939bdf534692a32b5f0b38f74147b98556"]}},"src":{"files":{"index.ts":{"size":9018,"offset":"9083769","integrity":{"algorithm":"SHA256","hash":"63b9c52366354393361bbbd40158a3051d39a6e2db4ce564418e01e4ecd1bc64","blockSize":4194304,"blocks":["63b9c52366354393361bbbd40158a3051d39a6e2db4ce564418e01e4ecd1bc64"]}},"promisify.ts":{"size":649,"offset":"9092787","integrity":{"algorithm":"SHA256","hash":"b199581471074102ec7b2c89dbbff48249b3c9c9f9261d9fe32a110d76f7a526","blockSize":4194304,"blocks":["b199581471074102ec7b2c89dbbff48249b3c9c9f9261d9fe32a110d76f7a526"]}}}}}},"ajv":{"files":{".runkit_example.js":{"size":496,"offset":"9145663","integrity":{"algorithm":"SHA256","hash":"e37e85bf1db5d53a6e4e38a9cac83db25208f28c09a2fa19e3971877c8a7b8cf","blockSize":4194304,"blocks":["e37e85bf1db5d53a6e4e38a9cac83db25208f28c09a2fa19e3971877c8a7b8cf"]}},"dist":{"files":{"2019.d.ts":{"size":1241,"offset":"9146159","integrity":{"algorithm":"SHA256","hash":"1e2bbd6318653c49684963a59066e621a3a142ad23b5e809e430e73946aa4223","blockSize":4194304,"blocks":["1e2bbd6318653c49684963a59066e621a3a142ad23b5e809e430e73946aa4223"]}},"2019.js":{"size":3188,"offset":"9147400","integrity":{"algorithm":"SHA256","hash":"4a1b1d479d0b946af0119f3a3960fcabfd964e1c20e87f7a9575f8f9e705d0c4","blockSize":4194304,"blocks":["4a1b1d479d0b946af0119f3a3960fcabfd964e1c20e87f7a9575f8f9e705d0c4"]}},"2019.js.map":{"size":1639,"offset":"9150588","integrity":{"algorithm":"SHA256","hash":"a91b0607c55ef90f269dbefb567c975cfae953341c13761c43b7f8b78e44b91f","blockSize":4194304,"blocks":["a91b0607c55ef90f269dbefb567c975cfae953341c13761c43b7f8b78e44b91f"]}},"2020.d.ts":{"size":1241,"offset":"9152227","integrity":{"algorithm":"SHA256","hash":"66a5ace456d19768103c1da9df2abafa9cb2e78ff61c938746527ec2524e5d11","blockSize":4194304,"blocks":["66a5ace456d19768103c1da9df2abafa9cb2e78ff61c938746527ec2524e5d11"]}},"2020.js":{"size":2894,"offset":"9153468","integrity":{"algorithm":"SHA256","hash":"908e9670b478b2ba126802a221b7e47006f50cf467e2c5dd7935d3dbef10a20a","blockSize":4194304,"blocks":["908e9670b478b2ba126802a221b7e47006f50cf467e2c5dd7935d3dbef10a20a"]}},"2020.js.map":{"size":1473,"offset":"9156362","integrity":{"algorithm":"SHA256","hash":"845f8c979380377abe0db2a8a8ba9c5484d88cc69dc6704db84c6fc176b330d5","blockSize":4194304,"blocks":["845f8c979380377abe0db2a8a8ba9c5484d88cc69dc6704db84c6fc176b330d5"]}},"ajv.d.ts":{"size":1211,"offset":"9157835","integrity":{"algorithm":"SHA256","hash":"41b8775befd7ded7245a627e9f4de6110236688ce4c124d2d40c37bc1a3bfe05","blockSize":4194304,"blocks":["41b8775befd7ded7245a627e9f4de6110236688ce4c124d2d40c37bc1a3bfe05"]}},"ajv.js":{"size":2841,"offset":"9159046","integrity":{"algorithm":"SHA256","hash":"edaed56fc546f5551b0d6dc2ff2a9cc25c2d6c83318a086eaa8c3ad0b2479297","blockSize":4194304,"blocks":["edaed56fc546f5551b0d6dc2ff2a9cc25c2d6c83318a086eaa8c3ad0b2479297"]}},"ajv.js.map":{"size":1476,"offset":"9161887","integrity":{"algorithm":"SHA256","hash":"f6a0d17a5cdb4891ab056a48c852cc6dbb5e5ef262e3fccfc9021782d3714d44","blockSize":4194304,"blocks":["f6a0d17a5cdb4891ab056a48c852cc6dbb5e5ef262e3fccfc9021782d3714d44"]}},"compile":{"files":{"codegen":{"files":{"code.d.ts":{"size":1638,"offset":"9163363","integrity":{"algorithm":"SHA256","hash":"2d225e7bda2871c066a7079c88174340950fb604f624f2586d3ea27bb9e5f4ff","blockSize":4194304,"blocks":["2d225e7bda2871c066a7079c88174340950fb604f624f2586d3ea27bb9e5f4ff"]}},"code.js":{"size":4676,"offset":"9165001","integrity":{"algorithm":"SHA256","hash":"1287153722f1fc3c5342647de7ae1d7b6fb68bdb3378a0776a937d273fc97e0d","blockSize":4194304,"blocks":["1287153722f1fc3c5342647de7ae1d7b6fb68bdb3378a0776a937d273fc97e0d"]}},"code.js.map":{"size":5309,"offset":"9169677","integrity":{"algorithm":"SHA256","hash":"6662bc0c87dfefa43cabfe916340b03c128e6b4ffe8d08d162231a337299fe60","blockSize":4194304,"blocks":["6662bc0c87dfefa43cabfe916340b03c128e6b4ffe8d08d162231a337299fe60"]}},"index.d.ts":{"size":3316,"offset":"9174986","integrity":{"algorithm":"SHA256","hash":"c1422d016f7df2ccd3594c06f2923199acd09898f2c42f50ea8159f1f856f618","blockSize":4194304,"blocks":["c1422d016f7df2ccd3594c06f2923199acd09898f2c42f50ea8159f1f856f618"]}},"index.js":{"size":23127,"offset":"9178302","integrity":{"algorithm":"SHA256","hash":"f03b2b72597ef86878d1d4030580c2d0964046efad4867f3d05aa91065ba034c","blockSize":4194304,"blocks":["f03b2b72597ef86878d1d4030580c2d0964046efad4867f3d05aa91065ba034c"]}},"index.js.map":{"size":23829,"offset":"9201429","integrity":{"algorithm":"SHA256","hash":"081d235ee23ad618f56c6bbda22b646522cba1b20534711fddfdbcb2b075affc","blockSize":4194304,"blocks":["081d235ee23ad618f56c6bbda22b646522cba1b20534711fddfdbcb2b075affc"]}},"scope.d.ts":{"size":2397,"offset":"9225258","integrity":{"algorithm":"SHA256","hash":"6a785f84e63234035e511817dd48ada756d984dd8f9344e56eb8b2bdcd8fd001","blockSize":4194304,"blocks":["6a785f84e63234035e511817dd48ada756d984dd8f9344e56eb8b2bdcd8fd001"]}},"scope.js":{"size":5198,"offset":"9227655","integrity":{"algorithm":"SHA256","hash":"d2a0a97af2faa2cad88702314fe421e235ab17f11e0d62883d58d8d4dc734286","blockSize":4194304,"blocks":["d2a0a97af2faa2cad88702314fe421e235ab17f11e0d62883d58d8d4dc734286"]}},"scope.js.map":{"size":5174,"offset":"9232853","integrity":{"algorithm":"SHA256","hash":"a5a146bfb90c9f6cb861d91503437e230f340c410a63400530e1bf493d84b0ec","blockSize":4194304,"blocks":["a5a146bfb90c9f6cb861d91503437e230f340c410a63400530e1bf493d84b0ec"]}}}},"errors.d.ts":{"size":826,"offset":"9238027","integrity":{"algorithm":"SHA256","hash":"cd44995ee13d5d23df17a10213fed7b483fabfd5ea08f267ab52c07ce0b6b4da","blockSize":4194304,"blocks":["cd44995ee13d5d23df17a10213fed7b483fabfd5ea08f267ab52c07ce0b6b4da"]}},"errors.js":{"size":5771,"offset":"9238853","integrity":{"algorithm":"SHA256","hash":"53990f8f2cc05922bba410ae68231d3f869de4f8343277ede5b4834fa564c6c2","blockSize":4194304,"blocks":["53990f8f2cc05922bba410ae68231d3f869de4f8343277ede5b4834fa564c6c2"]}},"errors.js.map":{"size":6085,"offset":"9244624","integrity":{"algorithm":"SHA256","hash":"5dfef5ea1d9707666aadcda54e93bff03e3a7f9730aec490ac31e5203eccd294","blockSize":4194304,"blocks":["5dfef5ea1d9707666aadcda54e93bff03e3a7f9730aec490ac31e5203eccd294"]}},"index.d.ts":{"size":2914,"offset":"9250709","integrity":{"algorithm":"SHA256","hash":"62d26d8ba4fa15ab425c1b57a050ed76c5b0ecbffaa53f182110aa3a02405a07","blockSize":4194304,"blocks":["62d26d8ba4fa15ab425c1b57a050ed76c5b0ecbffaa53f182110aa3a02405a07"]}},"index.js":{"size":10046,"offset":"9253623","integrity":{"algorithm":"SHA256","hash":"05b34da22814f3787bfa3ac68dad59c9047f56e55a607e0a20719ebf5afe69ac","blockSize":4194304,"blocks":["05b34da22814f3787bfa3ac68dad59c9047f56e55a607e0a20719ebf5afe69ac"]}},"index.js.map":{"size":9269,"offset":"9263669","integrity":{"algorithm":"SHA256","hash":"ad95a3a7cce920acd10b89d06581e3e2542bd0b6a4b44320b55bd18531efe99a","blockSize":4194304,"blocks":["ad95a3a7cce920acd10b89d06581e3e2542bd0b6a4b44320b55bd18531efe99a"]}},"jtd":{"files":{"parse.d.ts":{"size":217,"offset":"9272938","integrity":{"algorithm":"SHA256","hash":"122c92735f34b67fac27fe091234cc879010acb26f67e130951a90feb68c0c49","blockSize":4194304,"blocks":["122c92735f34b67fac27fe091234cc879010acb26f67e130951a90feb68c0c49"]}},"parse.js":{"size":13727,"offset":"9273155","integrity":{"algorithm":"SHA256","hash":"548b7e6ee5558360945f261e092cd328662868995877140ed2ae7ff981300b7f","blockSize":4194304,"blocks":["548b7e6ee5558360945f261e092cd328662868995877140ed2ae7ff981300b7f"]}},"parse.js.map":{"size":15725,"offset":"9286882","integrity":{"algorithm":"SHA256","hash":"90e560b9f7e4b32959b514576dbb0d3a9dc3466e0ea65e0f3ac53e7bb34ab1c0","blockSize":4194304,"blocks":["90e560b9f7e4b32959b514576dbb0d3a9dc3466e0ea65e0f3ac53e7bb34ab1c0"]}},"serialize.d.ts":{"size":221,"offset":"9302607","integrity":{"algorithm":"SHA256","hash":"173d6861b4b5265329e78219a2dc7e5b05a805337707f4de5ff4f7842a3ba0f9","blockSize":4194304,"blocks":["173d6861b4b5265329e78219a2dc7e5b05a805337707f4de5ff4f7842a3ba0f9"]}},"serialize.js":{"size":8962,"offset":"9302828","integrity":{"algorithm":"SHA256","hash":"d4fdfc18734d62f31780b53b5bcc437f07d172b806e35fd12833b4d4871bf803","blockSize":4194304,"blocks":["d4fdfc18734d62f31780b53b5bcc437f07d172b806e35fd12833b4d4871bf803"]}},"serialize.js.map":{"size":10276,"offset":"9311790","integrity":{"algorithm":"SHA256","hash":"5b37d172c97468796d6b435b7a0e737dce25e60ec659b66d4f120796e11b266e","blockSize":4194304,"blocks":["5b37d172c97468796d6b435b7a0e737dce25e60ec659b66d4f120796e11b266e"]}},"types.d.ts":{"size":309,"offset":"9322066","integrity":{"algorithm":"SHA256","hash":"456178f9a8feccf812324213ac362aa49fd3e7df4369e409d398ff072629cfa5","blockSize":4194304,"blocks":["456178f9a8feccf812324213ac362aa49fd3e7df4369e409d398ff072629cfa5"]}},"types.js":{"size":291,"offset":"9322375","integrity":{"algorithm":"SHA256","hash":"e92a89e57c3b7d228be4e2e74c71ef3af52320bf061b411add9dccc34ddb0a78","blockSize":4194304,"blocks":["e92a89e57c3b7d228be4e2e74c71ef3af52320bf061b411add9dccc34ddb0a78"]}},"types.js.map":{"size":236,"offset":"9322666","integrity":{"algorithm":"SHA256","hash":"b1c351a2a5810e00c4bbf3814fdc6b83fde3b016a79b8c5fc66cb32a0988abb5","blockSize":4194304,"blocks":["b1c351a2a5810e00c4bbf3814fdc6b83fde3b016a79b8c5fc66cb32a0988abb5"]}}}},"names.d.ts":{"size":398,"offset":"9322902","integrity":{"algorithm":"SHA256","hash":"fd8346be5f0bb7a9ea588a343420bcd88b12da1bcd40c2d09c7a0d2990b51576","blockSize":4194304,"blocks":["fd8346be5f0bb7a9ea588a343420bcd88b12da1bcd40c2d09c7a0d2990b51576"]}},"names.js":{"size":1440,"offset":"9323300","integrity":{"algorithm":"SHA256","hash":"3cab37a2240b996b9bed92fe7a041d91689cfe3ad2e9ae4c0ab99e4146408493","blockSize":4194304,"blocks":["3cab37a2240b996b9bed92fe7a041d91689cfe3ad2e9ae4c0ab99e4146408493"]}},"names.js.map":{"size":974,"offset":"9324740","integrity":{"algorithm":"SHA256","hash":"2b28eacf577a5b5b2a6bade9e61097af1e84a4fb848fca153432e5c5a239e7d7","blockSize":4194304,"blocks":["2b28eacf577a5b5b2a6bade9e61097af1e84a4fb848fca153432e5c5a239e7d7"]}},"ref_error.d.ts":{"size":252,"offset":"9325714","integrity":{"algorithm":"SHA256","hash":"3d7f9eb12aface876f7b535cc89dcd416daf77f0b3573333f16ec0a70bcf902a","blockSize":4194304,"blocks":["3d7f9eb12aface876f7b535cc89dcd416daf77f0b3573333f16ec0a70bcf902a"]}},"ref_error.js":{"size":543,"offset":"9325966","integrity":{"algorithm":"SHA256","hash":"81c98fdf34c3037c91bfcc02277ec32156c71e34048f36cfe4e084416e916cb7","blockSize":4194304,"blocks":["81c98fdf34c3037c91bfcc02277ec32156c71e34048f36cfe4e084416e916cb7"]}},"ref_error.js.map":{"size":474,"offset":"9326509","integrity":{"algorithm":"SHA256","hash":"3101f665a6485ffee1c377d4cc015d9bb23af186ec941907afe03386406adc4b","blockSize":4194304,"blocks":["3101f665a6485ffee1c377d4cc015d9bb23af186ec941907afe03386406adc4b"]}},"resolve.d.ts":{"size":755,"offset":"9326983","integrity":{"algorithm":"SHA256","hash":"e0205f04611bea8b5b82168065b8ef1476a8e96236201494eb8c785331c43118","blockSize":4194304,"blocks":["e0205f04611bea8b5b82168065b8ef1476a8e96236201494eb8c785331c43118"]}},"resolve.js":{"size":5006,"offset":"9327738","integrity":{"algorithm":"SHA256","hash":"df75af0e0cf03fa1c6452e8dc61019f5aec645a8a5f6f494dc4e13cb5502d2d9","blockSize":4194304,"blocks":["df75af0e0cf03fa1c6452e8dc61019f5aec645a8a5f6f494dc4e13cb5502d2d9"]}},"resolve.js.map":{"size":4850,"offset":"9332744","integrity":{"algorithm":"SHA256","hash":"837e46750307e91c812466a0549472678800b29c1d3c9373f41fd795cb88c5ce","blockSize":4194304,"blocks":["837e46750307e91c812466a0549472678800b29c1d3c9373f41fd795cb88c5ce"]}},"rules.d.ts":{"size":809,"offset":"9337594","integrity":{"algorithm":"SHA256","hash":"2973b1b7857ca144251375b97f98474e9847a890331e27132d5a8b3aea9350a8","blockSize":4194304,"blocks":["2973b1b7857ca144251375b97f98474e9847a890331e27132d5a8b3aea9350a8"]}},"rules.js":{"size":918,"offset":"9338403","integrity":{"algorithm":"SHA256","hash":"ec1d86500f497aa8e20f9f0c1695951159d9a909669d00a261ce1bb22b3cf0a9","blockSize":4194304,"blocks":["ec1d86500f497aa8e20f9f0c1695951159d9a909669d00a261ce1bb22b3cf0a9"]}},"rules.js.map":{"size":1030,"offset":"9339321","integrity":{"algorithm":"SHA256","hash":"d5c077c6e1149c7e92fcaae92def87cd549f9407acbbcaf5a27dd5a76fab67c6","blockSize":4194304,"blocks":["d5c077c6e1149c7e92fcaae92def87cd549f9407acbbcaf5a27dd5a76fab67c6"]}},"util.d.ts":{"size":2210,"offset":"9340351","integrity":{"algorithm":"SHA256","hash":"0eb6152d37c84d6119295493dfcc20c331c6fda1304a513d159cdaa599dcb78b","blockSize":4194304,"blocks":["0eb6152d37c84d6119295493dfcc20c331c6fda1304a513d159cdaa599dcb78b"]}},"util.js":{"size":7103,"offset":"9342561","integrity":{"algorithm":"SHA256","hash":"fa911f5631f29d4d6420adfe086cb693b94b08de2719475c78c54bcb82f831a5","blockSize":4194304,"blocks":["fa911f5631f29d4d6420adfe086cb693b94b08de2719475c78c54bcb82f831a5"]}},"util.js.map":{"size":7083,"offset":"9349664","integrity":{"algorithm":"SHA256","hash":"9deb815ce282c61c7e68adbd649aa7efe1e58f49e0b5c18d022d2f3b3717f442","blockSize":4194304,"blocks":["9deb815ce282c61c7e68adbd649aa7efe1e58f49e0b5c18d022d2f3b3717f442"]}},"validate":{"files":{"applicability.d.ts":{"size":456,"offset":"9356747","integrity":{"algorithm":"SHA256","hash":"b6f3050f59028cbed94bc895d15ac095d104c810a8201a01fac608c5780e7d1d","blockSize":4194304,"blocks":["b6f3050f59028cbed94bc895d15ac095d104c810a8201a01fac608c5780e7d1d"]}},"applicability.js":{"size":853,"offset":"9357203","integrity":{"algorithm":"SHA256","hash":"50c5cba5894a7fb9874b3432355b46ec71b73c9368dafb1323ded8567cca8fc0","blockSize":4194304,"blocks":["50c5cba5894a7fb9874b3432355b46ec71b73c9368dafb1323ded8567cca8fc0"]}},"applicability.js.map":{"size":775,"offset":"9358056","integrity":{"algorithm":"SHA256","hash":"399e5834d6364657feb5c799d87ca3141e8e653ef021b38489937319d7c4f2ad","blockSize":4194304,"blocks":["399e5834d6364657feb5c799d87ca3141e8e653ef021b38489937319d7c4f2ad"]}},"boolSchema.d.ts":{"size":216,"offset":"9358831","integrity":{"algorithm":"SHA256","hash":"7a69c4963a745bc7e9adfc025e0d02b1f0236d1f9e36636d4f8bd0d5210a19ac","blockSize":4194304,"blocks":["7a69c4963a745bc7e9adfc025e0d02b1f0236d1f9e36636d4f8bd0d5210a19ac"]}},"boolSchema.js":{"size":1531,"offset":"9359047","integrity":{"algorithm":"SHA256","hash":"c08abdbdbd3d8b1dcc0552a20fbc7d837ed44f4ca6abb2e464985590ac94377f","blockSize":4194304,"blocks":["c08abdbdbd3d8b1dcc0552a20fbc7d837ed44f4ca6abb2e464985590ac94377f"]}},"boolSchema.js.map":{"size":1380,"offset":"9360578","integrity":{"algorithm":"SHA256","hash":"d2ba3c7b7cc92d4f4488e5dd785ded04ad4a42cdc69c68c45f929566edcf7ab9","blockSize":4194304,"blocks":["d2ba3c7b7cc92d4f4488e5dd785ded04ad4a42cdc69c68c45f929566edcf7ab9"]}},"dataType.d.ts":{"size":884,"offset":"9361958","integrity":{"algorithm":"SHA256","hash":"7557d4d7f19f94341f4413575a3453ba7f6039c9591015bcf4282a8e75414043","blockSize":4194304,"blocks":["7557d4d7f19f94341f4413575a3453ba7f6039c9591015bcf4282a8e75414043"]}},"dataType.js":{"size":8409,"offset":"9362842","integrity":{"algorithm":"SHA256","hash":"697bd7005361ec7066a23c18830a10b0ef28aec1a33138b4e3098bf78c4fae52","blockSize":4194304,"blocks":["697bd7005361ec7066a23c18830a10b0ef28aec1a33138b4e3098bf78c4fae52"]}},"dataType.js.map":{"size":7776,"offset":"9371251","integrity":{"algorithm":"SHA256","hash":"5ddbd0361b1a521ba2e822ed40a7156d9d6211c68ef2c4677f6496c151ce9e08","blockSize":4194304,"blocks":["5ddbd0361b1a521ba2e822ed40a7156d9d6211c68ef2c4677f6496c151ce9e08"]}},"defaults.d.ts":{"size":117,"offset":"9379027","integrity":{"algorithm":"SHA256","hash":"0dfaa8ce667fa1388c2959200efab6337063a3e773930ae3e25dbd59d197018e","blockSize":4194304,"blocks":["0dfaa8ce667fa1388c2959200efab6337063a3e773930ae3e25dbd59d197018e"]}},"defaults.js":{"size":1448,"offset":"9379144","integrity":{"algorithm":"SHA256","hash":"05721971df94faa57b09c8cfd60c2eef81b6d14910a7dea5f539d693a029c428","blockSize":4194304,"blocks":["05721971df94faa57b09c8cfd60c2eef81b6d14910a7dea5f539d693a029c428"]}},"defaults.js.map":{"size":1342,"offset":"9380592","integrity":{"algorithm":"SHA256","hash":"dd09145eaed811c656aeb2e9bf74d7aaafb4dc986a158cb20c017bdbde53d5b5","blockSize":4194304,"blocks":["dd09145eaed811c656aeb2e9bf74d7aaafb4dc986a158cb20c017bdbde53d5b5"]}},"index.d.ts":{"size":2073,"offset":"9381934","integrity":{"algorithm":"SHA256","hash":"58ce1486f851942bd2d3056b399079bc9cb978ec933fe9833ea417e33eab676e","blockSize":4194304,"blocks":["58ce1486f851942bd2d3056b399079bc9cb978ec933fe9833ea417e33eab676e"]}},"index.js":{"size":20552,"offset":"9384007","integrity":{"algorithm":"SHA256","hash":"cb2103e5f890e04592c10d24b45857dad91155bae9f9460138a2459bdaaea2cd","blockSize":4194304,"blocks":["cb2103e5f890e04592c10d24b45857dad91155bae9f9460138a2459bdaaea2cd"]}},"index.js.map":{"size":21391,"offset":"9404559","integrity":{"algorithm":"SHA256","hash":"fc7822f544bb4db6d457c858c53ba2e6be77a55d35a192e67011e1c8dd4d9c5c","blockSize":4194304,"blocks":["fc7822f544bb4db6d457c858c53ba2e6be77a55d35a192e67011e1c8dd4d9c5c"]}},"keyword.d.ts":{"size":679,"offset":"9425950","integrity":{"algorithm":"SHA256","hash":"ce0682a5e73f166fb6e80ad8a46a26af187b524f1f5f5fcc54e4c33c0b36b131","blockSize":4194304,"blocks":["ce0682a5e73f166fb6e80ad8a46a26af187b524f1f5f5fcc54e4c33c0b36b131"]}},"keyword.js":{"size":5695,"offset":"9426629","integrity":{"algorithm":"SHA256","hash":"ab8f070c75c25eee9be5c837f364748909b58f5db66149a2beccbd2f66afeb76","blockSize":4194304,"blocks":["ab8f070c75c25eee9be5c837f364748909b58f5db66149a2beccbd2f66afeb76"]}},"keyword.js.map":{"size":6011,"offset":"9432324","integrity":{"algorithm":"SHA256","hash":"3051e66f0a88cfb62ce8de46e2ca85780e2f0b64f62fc1fa091e77af47a51b4e","blockSize":4194304,"blocks":["3051e66f0a88cfb62ce8de46e2ca85780e2f0b64f62fc1fa091e77af47a51b4e"]}},"subschema.d.ts":{"size":1722,"offset":"9438335","integrity":{"algorithm":"SHA256","hash":"237df26f8c326ca00cd9d2deb40214a079749062156386b6d75bdcecc6988a6b","blockSize":4194304,"blocks":["237df26f8c326ca00cd9d2deb40214a079749062156386b6d75bdcecc6988a6b"]}},"subschema.js":{"size":3858,"offset":"9440057","integrity":{"algorithm":"SHA256","hash":"ca783d6052af91e65ebb59a5b48b47fb459a2241d37ca6a042f767d4ce451bdc","blockSize":4194304,"blocks":["ca783d6052af91e65ebb59a5b48b47fb459a2241d37ca6a042f767d4ce451bdc"]}},"subschema.js.map":{"size":3148,"offset":"9443915","integrity":{"algorithm":"SHA256","hash":"9a6beb742ae31a368004b444fb9ecaa49899eefe05e747e36c11b82e6a2c288a","blockSize":4194304,"blocks":["9a6beb742ae31a368004b444fb9ecaa49899eefe05e747e36c11b82e6a2c288a"]}}}}}},"core.d.ts":{"size":8287,"offset":"9447063","integrity":{"algorithm":"SHA256","hash":"b83139ae818dd20f365118f9999335ca4cd84ae518348619adc5728e7e0372d5","blockSize":4194304,"blocks":["b83139ae818dd20f365118f9999335ca4cd84ae518348619adc5728e7e0372d5"]}},"core.js":{"size":25185,"offset":"9455350","integrity":{"algorithm":"SHA256","hash":"7fdd03e949ecb3d020e560f669da71ce69a70f4bca28e5aff2ebc34d15bc2134","blockSize":4194304,"blocks":["7fdd03e949ecb3d020e560f669da71ce69a70f4bca28e5aff2ebc34d15bc2134"]}},"core.js.map":{"size":21583,"offset":"9480535","integrity":{"algorithm":"SHA256","hash":"242651fa9d0d84cd207032a794e3ca9f11b67a8e345b3c63e1ff99ea91c2e6ae","blockSize":4194304,"blocks":["242651fa9d0d84cd207032a794e3ca9f11b67a8e345b3c63e1ff99ea91c2e6ae"]}},"jtd.d.ts":{"size":2223,"offset":"9502118","integrity":{"algorithm":"SHA256","hash":"88dfdb2a44912a28aea3ebb657dc7fcec6ba59f7233005e3405824995b713dac","blockSize":4194304,"blocks":["88dfdb2a44912a28aea3ebb657dc7fcec6ba59f7233005e3405824995b713dac"]}},"jtd.js":{"size":3360,"offset":"9504341","integrity":{"algorithm":"SHA256","hash":"9554827c19abbb10694cafb71edd72a8303ea71e56b9eb7253200f5395610e44","blockSize":4194304,"blocks":["9554827c19abbb10694cafb71edd72a8303ea71e56b9eb7253200f5395610e44"]}},"jtd.js.map":{"size":2036,"offset":"9507701","integrity":{"algorithm":"SHA256","hash":"b8d25a9ac802a23e0e008abcbe4a9684a1bad31fd36b5e977e677527d6087f51","blockSize":4194304,"blocks":["b8d25a9ac802a23e0e008abcbe4a9684a1bad31fd36b5e977e677527d6087f51"]}},"refs":{"files":{"data.json":{"size":409,"offset":"9509737","integrity":{"algorithm":"SHA256","hash":"d24ab8a97c18b3f5afdde7d7024a0e0ac1df0614a16a41cb88f81379edcc2db3","blockSize":4194304,"blocks":["d24ab8a97c18b3f5afdde7d7024a0e0ac1df0614a16a41cb88f81379edcc2db3"]}},"json-schema-2019-09":{"files":{"index.d.ts":{"size":111,"offset":"9510146","integrity":{"algorithm":"SHA256","hash":"2a181e3ce12d234dc189bc5d8ec5a7977eeb3fdbbdd0551290d18da23a0afcec","blockSize":4194304,"blocks":["2a181e3ce12d234dc189bc5d8ec5a7977eeb3fdbbdd0551290d18da23a0afcec"]}},"index.js":{"size":938,"offset":"9510257","integrity":{"algorithm":"SHA256","hash":"ec400bdf35a0f290266811503cdbfffd7c18c4a690379988b8062c57b48f946d","blockSize":4194304,"blocks":["ec400bdf35a0f290266811503cdbfffd7c18c4a690379988b8062c57b48f946d"]}},"index.js.map":{"size":726,"offset":"9511195","integrity":{"algorithm":"SHA256","hash":"3ba84273c35f49642ee68ddf2ea561e8ecbaf00329e323e210c8b6f6cc580e01","blockSize":4194304,"blocks":["3ba84273c35f49642ee68ddf2ea561e8ecbaf00329e323e210c8b6f6cc580e01"]}},"meta":{"files":{"applicator.json":{"size":1566,"offset":"9511921","integrity":{"algorithm":"SHA256","hash":"9c356a52b0ad5da7d4c1b69f61dff5277c2af46221bc0b0521bbdbf3a12d3a2a","blockSize":4194304,"blocks":["9c356a52b0ad5da7d4c1b69f61dff5277c2af46221bc0b0521bbdbf3a12d3a2a"]}},"content.json":{"size":477,"offset":"9513487","integrity":{"algorithm":"SHA256","hash":"cf4792ae93f4a4580ec9523640945f7756f75fd624935ebf15194b0ac3909267","blockSize":4194304,"blocks":["cf4792ae93f4a4580ec9523640945f7756f75fd624935ebf15194b0ac3909267"]}},"core.json":{"size":1273,"offset":"9513964","integrity":{"algorithm":"SHA256","hash":"629c017994ffaa33f573a96cf01b9dac6cae80c7d5d17dad5e823a3afa18d5fe","blockSize":4194304,"blocks":["629c017994ffaa33f573a96cf01b9dac6cae80c7d5d17dad5e823a3afa18d5fe"]}},"format.json":{"size":375,"offset":"9515237","integrity":{"algorithm":"SHA256","hash":"018ef7c81bcca9e40a4a02ed236e7cabb3a630f2b1ea01fbdeed2f882c15ddc8","blockSize":4194304,"blocks":["018ef7c81bcca9e40a4a02ed236e7cabb3a630f2b1ea01fbdeed2f882c15ddc8"]}},"meta-data.json":{"size":758,"offset":"9515612","integrity":{"algorithm":"SHA256","hash":"e038593d36bf1855875a13b8812469d6a2d62ed309436b9c9a2fa5a4ba59085e","blockSize":4194304,"blocks":["e038593d36bf1855875a13b8812469d6a2d62ed309436b9c9a2fa5a4ba59085e"]}},"validation.json":{"size":2264,"offset":"9516370","integrity":{"algorithm":"SHA256","hash":"aaba7f2d6fcbdfa6ca97fdc3d3da1ae7d66ca3322b7e90cf5a98b067555d06e6","blockSize":4194304,"blocks":["aaba7f2d6fcbdfa6ca97fdc3d3da1ae7d66ca3322b7e90cf5a98b067555d06e6"]}}}},"schema.json":{"size":1579,"offset":"9518634","integrity":{"algorithm":"SHA256","hash":"264720afa0dd61919e21bbe9bc1312121b70e43019ac696240e069adc72cce15","blockSize":4194304,"blocks":["264720afa0dd61919e21bbe9bc1312121b70e43019ac696240e069adc72cce15"]}}}},"json-schema-2020-12":{"files":{"index.d.ts":{"size":111,"offset":"9520213","integrity":{"algorithm":"SHA256","hash":"7d2eaeb15b579ef0682c2a88dcd2b4b13b653a31239fdc0096201024b1d9d87d","blockSize":4194304,"blocks":["7d2eaeb15b579ef0682c2a88dcd2b4b13b653a31239fdc0096201024b1d9d87d"]}},"index.js":{"size":1026,"offset":"9520324","integrity":{"algorithm":"SHA256","hash":"2e39089b0aaa14efa7901ecf5384622ec3d5897b206e1d589d2420f17b9fa6e1","blockSize":4194304,"blocks":["2e39089b0aaa14efa7901ecf5384622ec3d5897b206e1d589d2420f17b9fa6e1"]}},"index.js.map":{"size":751,"offset":"9521350","integrity":{"algorithm":"SHA256","hash":"79fed7d771c96ee134e413a39cac77f0e670228a684e1cbb58cfb0603a8f9877","blockSize":4194304,"blocks":["79fed7d771c96ee134e413a39cac77f0e670228a684e1cbb58cfb0603a8f9877"]}},"meta":{"files":{"applicator.json":{"size":1441,"offset":"9522101","integrity":{"algorithm":"SHA256","hash":"f1e465ff0c0cc86bee5c0cc4b51d2734c532e6ea12c75b60a2ac093a4577b2d4","blockSize":4194304,"blocks":["f1e465ff0c0cc86bee5c0cc4b51d2734c532e6ea12c75b60a2ac093a4577b2d4"]}},"content.json":{"size":479,"offset":"9523542","integrity":{"algorithm":"SHA256","hash":"7ede86f2c48d646202bf1332aefaf46db268c943d59752727db7247dc2920516","blockSize":4194304,"blocks":["7ede86f2c48d646202bf1332aefaf46db268c943d59752727db7247dc2920516"]}},"core.json":{"size":1344,"offset":"9524021","integrity":{"algorithm":"SHA256","hash":"c3a5947992d4fe67c95cda7910911207376bbae41c0a124ec9e7e699172e7a49","blockSize":4194304,"blocks":["c3a5947992d4fe67c95cda7910911207376bbae41c0a124ec9e7e699172e7a49"]}},"format-annotation.json":{"size":420,"offset":"9525365","integrity":{"algorithm":"SHA256","hash":"1e31131b1ed21f98c007f04deb501343b8c4dd77f1c5a8494a9c2085f68d769d","blockSize":4194304,"blocks":["1e31131b1ed21f98c007f04deb501343b8c4dd77f1c5a8494a9c2085f68d769d"]}},"meta-data.json":{"size":758,"offset":"9525785","integrity":{"algorithm":"SHA256","hash":"eb008c756b29bdaa237c1f06d32ea4a21f6ef22148b03c6372cea5e4c0782273","blockSize":4194304,"blocks":["eb008c756b29bdaa237c1f06d32ea4a21f6ef22148b03c6372cea5e4c0782273"]}},"unevaluated.json":{"size":472,"offset":"9526543","integrity":{"algorithm":"SHA256","hash":"8f7f75f4274745faa32e4abdba12de99f49b21df225f52f723b5c62043b0edca","blockSize":4194304,"blocks":["8f7f75f4274745faa32e4abdba12de99f49b21df225f52f723b5c62043b0edca"]}},"validation.json":{"size":2264,"offset":"9527015","integrity":{"algorithm":"SHA256","hash":"3cae7069843679429e4ada7df261bb8961fa34cac15be89296026e69af312092","blockSize":4194304,"blocks":["3cae7069843679429e4ada7df261bb8961fa34cac15be89296026e69af312092"]}}}},"schema.json":{"size":2166,"offset":"9529279","integrity":{"algorithm":"SHA256","hash":"5333c7df76bceee098e865881d0808238dea836126c6c60b49299ec85c6c7a56","blockSize":4194304,"blocks":["5333c7df76bceee098e865881d0808238dea836126c6c60b49299ec85c6c7a56"]}}}},"json-schema-draft-06.json":{"size":3449,"offset":"9531445","integrity":{"algorithm":"SHA256","hash":"a9b6a00af20105009f0924cd7c02d811bbf70c579a96f1552579c3457111f687","blockSize":4194304,"blocks":["a9b6a00af20105009f0924cd7c02d811bbf70c579a96f1552579c3457111f687"]}},"json-schema-draft-07.json":{"size":3811,"offset":"9534894","integrity":{"algorithm":"SHA256","hash":"f7e8b13cad4fecff9771f3626fef33e20e59027b90938a28fd9d2f6c17cd0773","blockSize":4194304,"blocks":["f7e8b13cad4fecff9771f3626fef33e20e59027b90938a28fd9d2f6c17cd0773"]}},"json-schema-secure.json":{"size":2521,"offset":"9538705","integrity":{"algorithm":"SHA256","hash":"b7840b4f1526eee47ac19780906a436d0c39df2aa3d505388caf18864085a421","blockSize":4194304,"blocks":["b7840b4f1526eee47ac19780906a436d0c39df2aa3d505388caf18864085a421"]}},"jtd-schema.d.ts":{"size":114,"offset":"9541226","integrity":{"algorithm":"SHA256","hash":"3a4c2bcb267c132400e8193819dd07eda7055e5a9c997ad62e1c38dd6fb2e922","blockSize":4194304,"blocks":["3a4c2bcb267c132400e8193819dd07eda7055e5a9c997ad62e1c38dd6fb2e922"]}},"jtd-schema.js":{"size":2882,"offset":"9541340","integrity":{"algorithm":"SHA256","hash":"ed529445bf027885182bbed71e5458baecec2d356a788b636ed9f0c7cdaccd92","blockSize":4194304,"blocks":["ed529445bf027885182bbed71e5458baecec2d356a788b636ed9f0c7cdaccd92"]}},"jtd-schema.js.map":{"size":2824,"offset":"9544222","integrity":{"algorithm":"SHA256","hash":"732b58ce3fbd6aaac7a2423daa1f8dc134ff07a2336dbb2c5d13efd91a94a11b","blockSize":4194304,"blocks":["732b58ce3fbd6aaac7a2423daa1f8dc134ff07a2336dbb2c5d13efd91a94a11b"]}}}},"runtime":{"files":{"equal.d.ts":{"size":149,"offset":"9547046","integrity":{"algorithm":"SHA256","hash":"0beb32fbffe3dd6f079b3460c125d7577c49a525dd81b3bd771c94aa0081aecc","blockSize":4194304,"blocks":["0beb32fbffe3dd6f079b3460c125d7577c49a525dd81b3bd771c94aa0081aecc"]}},"equal.js":{"size":286,"offset":"9547195","integrity":{"algorithm":"SHA256","hash":"c94467da09ee94e5d194483a7ab821b9bb3bf1c04397270f2ab53dea9de59274","blockSize":4194304,"blocks":["c94467da09ee94e5d194483a7ab821b9bb3bf1c04397270f2ab53dea9de59274"]}},"equal.js.map":{"size":199,"offset":"9547481","integrity":{"algorithm":"SHA256","hash":"addc8498c8bf12ce8d2dc33c34805d0940eca3692c66105d99e270793c85fcae","blockSize":4194304,"blocks":["addc8498c8bf12ce8d2dc33c34805d0940eca3692c66105d99e270793c85fcae"]}},"parseJson.d.ts":{"size":642,"offset":"9547680","integrity":{"algorithm":"SHA256","hash":"daaf1281de5547ccaa34f77fd4800c97bdf6f2533424bb9f5d82e11300d48e24","blockSize":4194304,"blocks":["daaf1281de5547ccaa34f77fd4800c97bdf6f2533424bb9f5d82e11300d48e24"]}},"parseJson.js":{"size":5401,"offset":"9548322","integrity":{"algorithm":"SHA256","hash":"1bc006064c98afbbb4fc03bef49db7e85dd9493fb54a7dc647d4344ad043848e","blockSize":4194304,"blocks":["1bc006064c98afbbb4fc03bef49db7e85dd9493fb54a7dc647d4344ad043848e"]}},"parseJson.js.map":{"size":5339,"offset":"9553723","integrity":{"algorithm":"SHA256","hash":"cd9de6145208c3b595ccab1a800d1b492c89ddf41f8b682909e8c96d6d6b5bc7","blockSize":4194304,"blocks":["cd9de6145208c3b595ccab1a800d1b492c89ddf41f8b682909e8c96d6d6b5bc7"]}},"quote.d.ts":{"size":115,"offset":"9559062","integrity":{"algorithm":"SHA256","hash":"7821d3f015198f3c0b8e817b5038dce921c2330614743f69c8062fda6a96ca7f","blockSize":4194304,"blocks":["7821d3f015198f3c0b8e817b5038dce921c2330614743f69c8062fda6a96ca7f"]}},"quote.js":{"size":943,"offset":"9559177","integrity":{"algorithm":"SHA256","hash":"1061132b1475fce15821d2b41c74b9ac710f278a33f5dae3385458715cc962b2","blockSize":4194304,"blocks":["1061132b1475fce15821d2b41c74b9ac710f278a33f5dae3385458715cc962b2"]}},"quote.js.map":{"size":877,"offset":"9560120","integrity":{"algorithm":"SHA256","hash":"299ec640699b8c7601d58d6446fa0f3c639b307166971226950c845a819a7dc9","blockSize":4194304,"blocks":["299ec640699b8c7601d58d6446fa0f3c639b307166971226950c845a819a7dc9"]}},"re2.d.ts":{"size":129,"offset":"9560997","integrity":{"algorithm":"SHA256","hash":"ed8fd507cffed16f39d0ae3f2dd2ec46d9fd5e7b00d4e2579bb559243597c435","blockSize":4194304,"blocks":["ed8fd507cffed16f39d0ae3f2dd2ec46d9fd5e7b00d4e2579bb559243597c435"]}},"re2.js":{"size":213,"offset":"9561126","integrity":{"algorithm":"SHA256","hash":"e1a6849652ae9a099c36c9aee9d2efc7412c8f83c4b285142413af99a7238361","blockSize":4194304,"blocks":["e1a6849652ae9a099c36c9aee9d2efc7412c8f83c4b285142413af99a7238361"]}},"re2.js.map":{"size":182,"offset":"9561339","integrity":{"algorithm":"SHA256","hash":"891ce3a6e69c7c08f3e13ab0a950c2def22137c1bcd1f3dff54391f796e122cc","blockSize":4194304,"blocks":["891ce3a6e69c7c08f3e13ab0a950c2def22137c1bcd1f3dff54391f796e122cc"]}},"timestamp.d.ts":{"size":165,"offset":"9561521","integrity":{"algorithm":"SHA256","hash":"a52bc6a407b585e49fe61fba28db84066c96961709a4095ff20ff1fe7430f678","blockSize":4194304,"blocks":["a52bc6a407b585e49fe61fba28db84066c96961709a4095ff20ff1fe7430f678"]}},"timestamp.js":{"size":1536,"offset":"9561686","integrity":{"algorithm":"SHA256","hash":"05cd4fc283b82af25a2a71ee5e587640c1d42945c74cea790627135fff338bef","blockSize":4194304,"blocks":["05cd4fc283b82af25a2a71ee5e587640c1d42945c74cea790627135fff338bef"]}},"timestamp.js.map":{"size":1994,"offset":"9563222","integrity":{"algorithm":"SHA256","hash":"4e4eb1e7923ca19f3935fdfb76dfa7ee88d2914be490b1d702ffab13bfce07fe","blockSize":4194304,"blocks":["4e4eb1e7923ca19f3935fdfb76dfa7ee88d2914be490b1d702ffab13bfce07fe"]}},"ucs2length.d.ts":{"size":132,"offset":"9565216","integrity":{"algorithm":"SHA256","hash":"2423ad491126a769f9973dc3687b86286c5ea2cd52d3a1dd25604fa03f1da2f4","blockSize":4194304,"blocks":["2423ad491126a769f9973dc3687b86286c5ea2cd52d3a1dd25604fa03f1da2f4"]}},"ucs2length.js":{"size":808,"offset":"9565348","integrity":{"algorithm":"SHA256","hash":"1df012dd3d23fced07255a7204798004509687cb1f431ae0ab976db436bbd890","blockSize":4194304,"blocks":["1df012dd3d23fced07255a7204798004509687cb1f431ae0ab976db436bbd890"]}},"ucs2length.js.map":{"size":728,"offset":"9566156","integrity":{"algorithm":"SHA256","hash":"5ad0a6c09c26dd193c807813a9a22304d7c4534af6f13361032ecedaf58e8a7d","blockSize":4194304,"blocks":["5ad0a6c09c26dd193c807813a9a22304d7c4534af6f13361032ecedaf58e8a7d"]}},"uri.d.ts":{"size":134,"offset":"9566884","integrity":{"algorithm":"SHA256","hash":"d2dfc80c21db9f151f6ccd49e3b6dc50e23476e7e4f475a1e3497f86c464dd65","blockSize":4194304,"blocks":["d2dfc80c21db9f151f6ccd49e3b6dc50e23476e7e4f475a1e3497f86c464dd65"]}},"uri.js":{"size":218,"offset":"9567018","integrity":{"algorithm":"SHA256","hash":"d1d61baf97ed87d7310df847a78ed73d19c8cc003207bf5aaec977500bdb1578","blockSize":4194304,"blocks":["d1d61baf97ed87d7310df847a78ed73d19c8cc003207bf5aaec977500bdb1578"]}},"uri.js.map":{"size":182,"offset":"9567236","integrity":{"algorithm":"SHA256","hash":"7751d10beb734802801b650c3e934553f2b26ba26bc68b20796734b7f9fd9955","blockSize":4194304,"blocks":["7751d10beb734802801b650c3e934553f2b26ba26bc68b20796734b7f9fd9955"]}},"validation_error.d.ts":{"size":249,"offset":"9567418","integrity":{"algorithm":"SHA256","hash":"cde493e09daad4bb29922fe633f760be9f0e8e2f39cdca999cce3b8690b5e13a","blockSize":4194304,"blocks":["cde493e09daad4bb29922fe633f760be9f0e8e2f39cdca999cce3b8690b5e13a"]}},"validation_error.js":{"size":337,"offset":"9567667","integrity":{"algorithm":"SHA256","hash":"11bf5b4affc8114e5e7cdf65b93006c2d997ab60ada1152c22e136f9b828b815","blockSize":4194304,"blocks":["11bf5b4affc8114e5e7cdf65b93006c2d997ab60ada1152c22e136f9b828b815"]}},"validation_error.js.map":{"size":332,"offset":"9568004","integrity":{"algorithm":"SHA256","hash":"833d51e4ffee8e2e21c53b6aca02bdf70349233e8620b36d093bfb6b0157bff2","blockSize":4194304,"blocks":["833d51e4ffee8e2e21c53b6aca02bdf70349233e8620b36d093bfb6b0157bff2"]}}}},"standalone":{"files":{"index.d.ts":{"size":243,"offset":"9568336","integrity":{"algorithm":"SHA256","hash":"dd753d8a80fbc019d9001e148b14cdc21c8e503e7afe747632ba87878ab05487","blockSize":4194304,"blocks":["dd753d8a80fbc019d9001e148b14cdc21c8e503e7afe747632ba87878ab05487"]}},"index.js":{"size":4480,"offset":"9568579","integrity":{"algorithm":"SHA256","hash":"361d58a7523548bb1b9c782135fae27e76d93c8feaba8c4d613331dbcd3b888f","blockSize":4194304,"blocks":["361d58a7523548bb1b9c782135fae27e76d93c8feaba8c4d613331dbcd3b888f"]}},"index.js.map":{"size":4078,"offset":"9573059","integrity":{"algorithm":"SHA256","hash":"a1afc5f1e9166c87da0c8e96b39560ba7c2df532adb495ad2b39c2ebfce68860","blockSize":4194304,"blocks":["a1afc5f1e9166c87da0c8e96b39560ba7c2df532adb495ad2b39c2ebfce68860"]}},"instance.d.ts":{"size":633,"offset":"9577137","integrity":{"algorithm":"SHA256","hash":"974948bdf0935ed1da8ec1aa9d71bebe07bfa4b67e1532b841831d053cc9d86b","blockSize":4194304,"blocks":["974948bdf0935ed1da8ec1aa9d71bebe07bfa4b67e1532b841831d053cc9d86b"]}},"instance.js":{"size":1015,"offset":"9577770","integrity":{"algorithm":"SHA256","hash":"4e14aa01e0cb8288fbb75deeb2e738950b0560bd02e1ad8974f391af4c9fc6f3","blockSize":4194304,"blocks":["4e14aa01e0cb8288fbb75deeb2e738950b0560bd02e1ad8974f391af4c9fc6f3"]}},"instance.js.map":{"size":1091,"offset":"9578785","integrity":{"algorithm":"SHA256","hash":"7f59241ec6792fa719f3151610ef417552e986f45eb7c2f368a5c19a9b6261f7","blockSize":4194304,"blocks":["7f59241ec6792fa719f3151610ef417552e986f45eb7c2f368a5c19a9b6261f7"]}}}},"types":{"files":{"index.d.ts":{"size":6383,"offset":"9579876","integrity":{"algorithm":"SHA256","hash":"9941cbf7ca695e95d588f5f1692ab040b078d44a95d231fa9a8f828186b7b77d","blockSize":4194304,"blocks":["9941cbf7ca695e95d588f5f1692ab040b078d44a95d231fa9a8f828186b7b77d"]}},"index.js":{"size":110,"offset":"9586259","integrity":{"algorithm":"SHA256","hash":"fc9c6096246805c2075c83ab1b96082eda2fc98c240a2502caa82f1966096b71","blockSize":4194304,"blocks":["fc9c6096246805c2075c83ab1b96082eda2fc98c240a2502caa82f1966096b71"]}},"index.js.map":{"size":111,"offset":"9586369","integrity":{"algorithm":"SHA256","hash":"dc7dd6ae1631a9726121bba97c02b42640360d3667f8650f78242d078693c4e6","blockSize":4194304,"blocks":["dc7dd6ae1631a9726121bba97c02b42640360d3667f8650f78242d078693c4e6"]}},"json-schema.d.ts":{"size":5029,"offset":"9586480","integrity":{"algorithm":"SHA256","hash":"feeb73d48cc41c6dd23d17473521b0af877751504c30c18dc84267c8eeea429a","blockSize":4194304,"blocks":["feeb73d48cc41c6dd23d17473521b0af877751504c30c18dc84267c8eeea429a"]}},"json-schema.js":{"size":116,"offset":"9591509","integrity":{"algorithm":"SHA256","hash":"2e30aa0c0789b5af8248b081ddc14b439b48937730eb1be0ab28de2ca2353b28","blockSize":4194304,"blocks":["2e30aa0c0789b5af8248b081ddc14b439b48937730eb1be0ab28de2ca2353b28"]}},"json-schema.js.map":{"size":123,"offset":"9591625","integrity":{"algorithm":"SHA256","hash":"c33ce191e73eead1689338837205402bb586032b089eafc83210e4e1f1a5b221","blockSize":4194304,"blocks":["c33ce191e73eead1689338837205402bb586032b089eafc83210e4e1f1a5b221"]}},"jtd-schema.d.ts":{"size":7072,"offset":"9591748","integrity":{"algorithm":"SHA256","hash":"25f1159094dc0bf3a71313a74e0885426af21c5d6564a254004f2cadf9c5b052","blockSize":4194304,"blocks":["25f1159094dc0bf3a71313a74e0885426af21c5d6564a254004f2cadf9c5b052"]}},"jtd-schema.js":{"size":115,"offset":"9598820","integrity":{"algorithm":"SHA256","hash":"6755d0ec5a09cc74205d46089f814c88c1ce4363e56a55486c12a0a86942bd8d","blockSize":4194304,"blocks":["6755d0ec5a09cc74205d46089f814c88c1ce4363e56a55486c12a0a86942bd8d"]}},"jtd-schema.js.map":{"size":121,"offset":"9598935","integrity":{"algorithm":"SHA256","hash":"c2840f14191be8435778a2a64a8e0600500dde376910b05c52865e2deafb09c9","blockSize":4194304,"blocks":["c2840f14191be8435778a2a64a8e0600500dde376910b05c52865e2deafb09c9"]}}}},"vocabularies":{"files":{"applicator":{"files":{"additionalItems.d.ts":{"size":396,"offset":"9599056","integrity":{"algorithm":"SHA256","hash":"a3b2cc16f3ce2d882eca44e1066f57a24751545f2a5e4a153d4de31b4cac9bb5","blockSize":4194304,"blocks":["a3b2cc16f3ce2d882eca44e1066f57a24751545f2a5e4a153d4de31b4cac9bb5"]}},"additionalItems.js":{"size":1931,"offset":"9599452","integrity":{"algorithm":"SHA256","hash":"7beb0fbda5e349907067c8398bb8cc3260a6267b6e5dff9793a5ab2171934099","blockSize":4194304,"blocks":["7beb0fbda5e349907067c8398bb8cc3260a6267b6e5dff9793a5ab2171934099"]}},"additionalItems.js.map":{"size":2093,"offset":"9601383","integrity":{"algorithm":"SHA256","hash":"f8d4898f0f5a507cf88a43dbcffb4ae82e7bb600d56602513085151032aac571","blockSize":4194304,"blocks":["f8d4898f0f5a507cf88a43dbcffb4ae82e7bb600d56602513085151032aac571"]}},"additionalProperties.d.ts":{"size":318,"offset":"9603476","integrity":{"algorithm":"SHA256","hash":"1fce9ecb87a2d3898941c60df617e52e50fb0c03c9b7b2ba8381972448327285","blockSize":4194304,"blocks":["1fce9ecb87a2d3898941c60df617e52e50fb0c03c9b7b2ba8381972448327285"]}},"additionalProperties.js":{"size":4309,"offset":"9603794","integrity":{"algorithm":"SHA256","hash":"e237cb180cd2e3f2e676feb714d7dcc6a42116640f9db2ad830cd20d9dfc540a","blockSize":4194304,"blocks":["e237cb180cd2e3f2e676feb714d7dcc6a42116640f9db2ad830cd20d9dfc540a"]}},"additionalProperties.js.map":{"size":3762,"offset":"9608103","integrity":{"algorithm":"SHA256","hash":"90cae7b84831914a0513d8db46fbe45e39cceba6c8ab3b39d853bd6439edc95a","blockSize":4194304,"blocks":["90cae7b84831914a0513d8db46fbe45e39cceba6c8ab3b39d853bd6439edc95a"]}},"allOf.d.ts":{"size":120,"offset":"9611865","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"allOf.js":{"size":756,"offset":"9611985","integrity":{"algorithm":"SHA256","hash":"98f46a6434ebe5f851b406480e18b776dd7f1bcc275e28c16a13bfef3cc067c7","blockSize":4194304,"blocks":["98f46a6434ebe5f851b406480e18b776dd7f1bcc275e28c16a13bfef3cc067c7"]}},"allOf.js.map":{"size":812,"offset":"9612741","integrity":{"algorithm":"SHA256","hash":"bc57edbf872aa33f295435a714b3612f887c29abf411aa114d2b92a89461ee5b","blockSize":4194304,"blocks":["bc57edbf872aa33f295435a714b3612f887c29abf411aa114d2b92a89461ee5b"]}},"anyOf.d.ts":{"size":208,"offset":"9613553","integrity":{"algorithm":"SHA256","hash":"ac52b775a80badff5f4ac329c5725a26bd5aaadd57afa7ad9e98b4844767312a","blockSize":4194304,"blocks":["ac52b775a80badff5f4ac329c5725a26bd5aaadd57afa7ad9e98b4844767312a"]}},"anyOf.js":{"size":343,"offset":"9613761","integrity":{"algorithm":"SHA256","hash":"8d7368d4aebad0514b713191b934993b4f0bf570e1bab93b07dc69712db2cec5","blockSize":4194304,"blocks":["8d7368d4aebad0514b713191b934993b4f0bf570e1bab93b07dc69712db2cec5"]}},"anyOf.js.map":{"size":327,"offset":"9614104","integrity":{"algorithm":"SHA256","hash":"c05bb310be6b4e46482835cfe8978d34a8591a57722661d039f685d6e1ebd2d3","blockSize":4194304,"blocks":["c05bb310be6b4e46482835cfe8978d34a8591a57722661d039f685d6e1ebd2d3"]}},"contains.d.ts":{"size":264,"offset":"9614431","integrity":{"algorithm":"SHA256","hash":"8deb39d89095469957f73bd194d11f01d9894b8c1f1e27fbf3f6e8122576b336","blockSize":4194304,"blocks":["8deb39d89095469957f73bd194d11f01d9894b8c1f1e27fbf3f6e8122576b336"]}},"contains.js":{"size":3680,"offset":"9614695","integrity":{"algorithm":"SHA256","hash":"56165dc93cd8b0b4611db50a97f1e7d7f9af6c5ffe95a7a5b054d6eeaa7f6a8c","blockSize":4194304,"blocks":["56165dc93cd8b0b4611db50a97f1e7d7f9af6c5ffe95a7a5b054d6eeaa7f6a8c"]}},"contains.js.map":{"size":3843,"offset":"9618375","integrity":{"algorithm":"SHA256","hash":"b6136d502d30985c5f9367214191e1a15f7ffffa7e66d38b5d90ce97c5fb3069","blockSize":4194304,"blocks":["b6136d502d30985c5f9367214191e1a15f7ffffa7e66d38b5d90ce97c5fb3069"]}},"dependencies.d.ts":{"size":839,"offset":"9622218","integrity":{"algorithm":"SHA256","hash":"a38a9c41f433b608a0d37e645a31eecf7233ef3d3fffeb626988d3219f80e32f","blockSize":4194304,"blocks":["a38a9c41f433b608a0d37e645a31eecf7233ef3d3fffeb626988d3219f80e32f"]}},"dependencies.js":{"size":3198,"offset":"9623057","integrity":{"algorithm":"SHA256","hash":"c1a83bf484b6fde4d268935f079ddba5e74a2f589dfc6d15ca2e20ba4d06ee5b","blockSize":4194304,"blocks":["c1a83bf484b6fde4d268935f079ddba5e74a2f589dfc6d15ca2e20ba4d06ee5b"]}},"dependencies.js.map":{"size":3172,"offset":"9626255","integrity":{"algorithm":"SHA256","hash":"58bd7453681e4e1f067f12ee46b0963fbb7b3dd91d5635146e892021541ea0af","blockSize":4194304,"blocks":["58bd7453681e4e1f067f12ee46b0963fbb7b3dd91d5635146e892021541ea0af"]}},"dependentSchemas.d.ts":{"size":120,"offset":"9629427","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"dependentSchemas.js":{"size":354,"offset":"9629547","integrity":{"algorithm":"SHA256","hash":"d17d23755b0cf8699c180dd98b8b7270b688d2e4fe5a4c4fcc53ffdcc18ee58e","blockSize":4194304,"blocks":["d17d23755b0cf8699c180dd98b8b7270b688d2e4fe5a4c4fcc53ffdcc18ee58e"]}},"dependentSchemas.js.map":{"size":353,"offset":"9629901","integrity":{"algorithm":"SHA256","hash":"acf03cc2df2951050a845f391f71d74a82cf2448b628a791cfc37a1ef12cdc69","blockSize":4194304,"blocks":["acf03cc2df2951050a845f391f71d74a82cf2448b628a791cfc37a1ef12cdc69"]}},"if.d.ts":{"size":236,"offset":"9630254","integrity":{"algorithm":"SHA256","hash":"dd7109c49f416f218915921d44f0f28975df78e04e437c62e1e1eb3be5e18a35","blockSize":4194304,"blocks":["dd7109c49f416f218915921d44f0f28975df78e04e437c62e1e1eb3be5e18a35"]}},"if.js":{"size":2438,"offset":"9630490","integrity":{"algorithm":"SHA256","hash":"42374ee5dc681433579cc689b0c4ae5343f5bf78d4d6a561722b9277c5335ec4","blockSize":4194304,"blocks":["42374ee5dc681433579cc689b0c4ae5343f5bf78d4d6a561722b9277c5335ec4"]}},"if.js.map":{"size":2455,"offset":"9632928","integrity":{"algorithm":"SHA256","hash":"ecf2c80d9856d1678e643d6f4c77a36cd7bec448594ec6034fb72b558fce8939","blockSize":4194304,"blocks":["ecf2c80d9856d1678e643d6f4c77a36cd7bec448594ec6034fb72b558fce8939"]}},"index.d.ts":{"size":858,"offset":"9635383","integrity":{"algorithm":"SHA256","hash":"eee181112e420b345fc78422a6cc32385ede3d27e2eaf8b8c4ad8b2c29e3e52e","blockSize":4194304,"blocks":["eee181112e420b345fc78422a6cc32385ede3d27e2eaf8b8c4ad8b2c29e3e52e"]}},"index.js":{"size":1529,"offset":"9636241","integrity":{"algorithm":"SHA256","hash":"5a61978f6d81bbabfa8b9ccb71d7de816ed6dd1fd7de5c72657439a76c2a7cb3","blockSize":4194304,"blocks":["5a61978f6d81bbabfa8b9ccb71d7de816ed6dd1fd7de5c72657439a76c2a7cb3"]}},"index.js.map":{"size":766,"offset":"9637770","integrity":{"algorithm":"SHA256","hash":"0b98845a246a8859fa44824daf69b40fe465f65075e2db2121aace15214dcf50","blockSize":4194304,"blocks":["0b98845a246a8859fa44824daf69b40fe465f65075e2db2121aace15214dcf50"]}},"items.d.ts":{"size":293,"offset":"9638536","integrity":{"algorithm":"SHA256","hash":"65f1d4dd1e542c949d9ef11825c9d568e16affad2d5c0cf5d39c386e3b09d791","blockSize":4194304,"blocks":["65f1d4dd1e542c949d9ef11825c9d568e16affad2d5c0cf5d39c386e3b09d791"]}},"items.js":{"size":1993,"offset":"9638829","integrity":{"algorithm":"SHA256","hash":"fa87f74adc3aac1f1b5e3e7dddf73294e6850e1dd49ed131fca4352e9645c54e","blockSize":4194304,"blocks":["fa87f74adc3aac1f1b5e3e7dddf73294e6850e1dd49ed131fca4352e9645c54e"]}},"items.js.map":{"size":2052,"offset":"9640822","integrity":{"algorithm":"SHA256","hash":"a20b4a4a1802ca7708a0e8bcbb69b3b604522eeab131008bae7e8490b87c434f","blockSize":4194304,"blocks":["a20b4a4a1802ca7708a0e8bcbb69b3b604522eeab131008bae7e8490b87c434f"]}},"items2020.d.ts":{"size":226,"offset":"9642874","integrity":{"algorithm":"SHA256","hash":"ac2b3b377d3068bfb6e1cb8889c99098f2c875955e2325315991882a74d92cc8","blockSize":4194304,"blocks":["ac2b3b377d3068bfb6e1cb8889c99098f2c875955e2325315991882a74d92cc8"]}},"items2020.js":{"size":1037,"offset":"9643100","integrity":{"algorithm":"SHA256","hash":"c449ef64aec16263c7935293ed450cfc2da3ba66f6df5f99c3198c05f169838f","blockSize":4194304,"blocks":["c449ef64aec16263c7935293ed450cfc2da3ba66f6df5f99c3198c05f169838f"]}},"items2020.js.map":{"size":947,"offset":"9644137","integrity":{"algorithm":"SHA256","hash":"8f28ef13b54491f634fbd00c89b87dab96f0e490e0065d5aeac3853345e906dc","blockSize":4194304,"blocks":["8f28ef13b54491f634fbd00c89b87dab96f0e490e0065d5aeac3853345e906dc"]}},"not.d.ts":{"size":209,"offset":"9645084","integrity":{"algorithm":"SHA256","hash":"5ef0597b8238443908b2c4bf69149ed3894ac0ddd0515ac583d38c7595b151f1","blockSize":4194304,"blocks":["5ef0597b8238443908b2c4bf69149ed3894ac0ddd0515ac583d38c7595b151f1"]}},"not.js":{"size":773,"offset":"9645293","integrity":{"algorithm":"SHA256","hash":"ab2f2758d4ea97ac8763fe5540dd0f4d877859676fe5d6c750a18deca387f718","blockSize":4194304,"blocks":["ab2f2758d4ea97ac8763fe5540dd0f4d877859676fe5d6c750a18deca387f718"]}},"not.js.map":{"size":831,"offset":"9646066","integrity":{"algorithm":"SHA256","hash":"c5b821f2b5cee147a5dbc645470a3528d1e87f3f9faa9f5a41cd353a075d60db","blockSize":4194304,"blocks":["c5b821f2b5cee147a5dbc645470a3528d1e87f3f9faa9f5a41cd353a075d60db"]}},"oneOf.d.ts":{"size":254,"offset":"9646897","integrity":{"algorithm":"SHA256","hash":"6ae5b4a63010c82bf2522b4ecfc29ffe6a8b0c5eea6b2b35120077e9ac54d7a1","blockSize":4194304,"blocks":["6ae5b4a63010c82bf2522b4ecfc29ffe6a8b0c5eea6b2b35120077e9ac54d7a1"]}},"oneOf.js":{"size":2257,"offset":"9647151","integrity":{"algorithm":"SHA256","hash":"e2aeb6c22d49fd5f348bedcf7f5c4d7b31f5a05dd7ff1a0c531374c6968792a2","blockSize":4194304,"blocks":["e2aeb6c22d49fd5f348bedcf7f5c4d7b31f5a05dd7ff1a0c531374c6968792a2"]}},"oneOf.js.map":{"size":2046,"offset":"9649408","integrity":{"algorithm":"SHA256","hash":"ebab3ad34f13bc50265cb5ef9943beeef9f4e65c97a64533081da51d765dd526","blockSize":4194304,"blocks":["ebab3ad34f13bc50265cb5ef9943beeef9f4e65c97a64533081da51d765dd526"]}},"patternProperties.d.ts":{"size":120,"offset":"9651454","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"patternProperties.js":{"size":3236,"offset":"9651574","integrity":{"algorithm":"SHA256","hash":"0d43da49a82452c439ba990de7372ad5cedb663717918a5f6dae07025abff655","blockSize":4194304,"blocks":["0d43da49a82452c439ba990de7372ad5cedb663717918a5f6dae07025abff655"]}},"patternProperties.js.map":{"size":2734,"offset":"9654810","integrity":{"algorithm":"SHA256","hash":"a8103db59a1c72cd5fea553943b386d21f5544f40202cb1b1af7ef465142c8d1","blockSize":4194304,"blocks":["a8103db59a1c72cd5fea553943b386d21f5544f40202cb1b1af7ef465142c8d1"]}},"prefixItems.d.ts":{"size":120,"offset":"9657544","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"prefixItems.js":{"size":354,"offset":"9657664","integrity":{"algorithm":"SHA256","hash":"16264f7b3233a6dcb98b48700643efbd3ebc4d11e27b3eacffc83ccb5f44fb23","blockSize":4194304,"blocks":["16264f7b3233a6dcb98b48700643efbd3ebc4d11e27b3eacffc83ccb5f44fb23"]}},"prefixItems.js.map":{"size":381,"offset":"9658018","integrity":{"algorithm":"SHA256","hash":"1f3562cac09a9442410a3b01bdf1930bf4cbb3fc4840704c6c6327be37aec33c","blockSize":4194304,"blocks":["1f3562cac09a9442410a3b01bdf1930bf4cbb3fc4840704c6c6327be37aec33c"]}},"properties.d.ts":{"size":120,"offset":"9658399","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"properties.js":{"size":2153,"offset":"9658519","integrity":{"algorithm":"SHA256","hash":"c896873ae7251093a2c8880545b69b6e8cb55c44817a53ec830a49818d74104f","blockSize":4194304,"blocks":["c896873ae7251093a2c8880545b69b6e8cb55c44817a53ec830a49818d74104f"]}},"properties.js.map":{"size":2054,"offset":"9660672","integrity":{"algorithm":"SHA256","hash":"33599345842c02b84401f6abc5b8df58023ffa180c148430a0e62d8eb2198ba3","blockSize":4194304,"blocks":["33599345842c02b84401f6abc5b8df58023ffa180c148430a0e62d8eb2198ba3"]}},"propertyNames.d.ts":{"size":249,"offset":"9662726","integrity":{"algorithm":"SHA256","hash":"8e1428dcba6a984489863935049893631170a37f9584c0479f06e1a5b1f04332","blockSize":4194304,"blocks":["8e1428dcba6a984489863935049893631170a37f9584c0479f06e1a5b1f04332"]}},"propertyNames.js":{"size":1221,"offset":"9662975","integrity":{"algorithm":"SHA256","hash":"b3411cfeaff8efd5e6de12971bb5dc339e64b61fbe62d3b950794c077315c2e7","blockSize":4194304,"blocks":["b3411cfeaff8efd5e6de12971bb5dc339e64b61fbe62d3b950794c077315c2e7"]}},"propertyNames.js.map":{"size":1230,"offset":"9664196","integrity":{"algorithm":"SHA256","hash":"a606f571bd198bcc4d9414887a57650669989bd0795181d07310e08a46aaec64","blockSize":4194304,"blocks":["a606f571bd198bcc4d9414887a57650669989bd0795181d07310e08a46aaec64"]}},"thenElse.d.ts":{"size":120,"offset":"9665426","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"thenElse.js":{"size":446,"offset":"9665546","integrity":{"algorithm":"SHA256","hash":"9bc42eb8699d57188a7ec2a710d3f38052f92bd78c5d4d0442cf98cf2ebbe22d","blockSize":4194304,"blocks":["9bc42eb8699d57188a7ec2a710d3f38052f92bd78c5d4d0442cf98cf2ebbe22d"]}},"thenElse.js.map":{"size":442,"offset":"9665992","integrity":{"algorithm":"SHA256","hash":"474cff337e6d5c8ac35258cfc1b98d82367934b6d6a31bc261da7058e1008e4e","blockSize":4194304,"blocks":["474cff337e6d5c8ac35258cfc1b98d82367934b6d6a31bc261da7058e1008e4e"]}}}},"code.d.ts":{"size":1462,"offset":"9666434","integrity":{"algorithm":"SHA256","hash":"83ca5b45121b732612f3bfb090ed559fc701e69f385d48597f3ae7f54c535076","blockSize":4194304,"blocks":["83ca5b45121b732612f3bfb090ed559fc701e69f385d48597f3ae7f54c535076"]}},"code.js":{"size":6216,"offset":"9667896","integrity":{"algorithm":"SHA256","hash":"9212ddf8bd0a4c3b1c4b44cdadd141183b2b36f561b91d13df53c83911e3bf63","blockSize":4194304,"blocks":["9212ddf8bd0a4c3b1c4b44cdadd141183b2b36f561b91d13df53c83911e3bf63"]}},"code.js.map":{"size":6030,"offset":"9674112","integrity":{"algorithm":"SHA256","hash":"1db25a8b2b7a34ad9d348246d6f849f61d4e29538a16ad6498d77b1c3497d534","blockSize":4194304,"blocks":["1db25a8b2b7a34ad9d348246d6f849f61d4e29538a16ad6498d77b1c3497d534"]}},"core":{"files":{"id.d.ts":{"size":120,"offset":"9680142","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"id.js":{"size":267,"offset":"9680262","integrity":{"algorithm":"SHA256","hash":"49c8eff694ce4371450c1f9986e934fcbf4bd143311caef5332113f29175bc11","blockSize":4194304,"blocks":["49c8eff694ce4371450c1f9986e934fcbf4bd143311caef5332113f29175bc11"]}},"id.js.map":{"size":257,"offset":"9680529","integrity":{"algorithm":"SHA256","hash":"fdeedb6446a7ddac6fc0dc0094bd70af32d00dc908ae2564f5519c45f6cd0897","blockSize":4194304,"blocks":["fdeedb6446a7ddac6fc0dc0094bd70af32d00dc908ae2564f5519c45f6cd0897"]}},"index.d.ts":{"size":100,"offset":"9680786","integrity":{"algorithm":"SHA256","hash":"817911706e04e79b7ac726cf166ee8d833db6e132693c6a88936713f89551010","blockSize":4194304,"blocks":["817911706e04e79b7ac726cf166ee8d833db6e132693c6a88936713f89551010"]}},"index.js":{"size":357,"offset":"9680886","integrity":{"algorithm":"SHA256","hash":"f420e1011b95e27b54c58323a7ed4ffbd0a88cdb4496f771bb6782c2aa22d23e","blockSize":4194304,"blocks":["f420e1011b95e27b54c58323a7ed4ffbd0a88cdb4496f771bb6782c2aa22d23e"]}},"index.js.map":{"size":306,"offset":"9681243","integrity":{"algorithm":"SHA256","hash":"47810777e556d4dfd64ed64eea5a9553e2c2ad632bac15944c8aafb75da4236d","blockSize":4194304,"blocks":["47810777e556d4dfd64ed64eea5a9553e2c2ad632bac15944c8aafb75da4236d"]}},"ref.d.ts":{"size":443,"offset":"9681549","integrity":{"algorithm":"SHA256","hash":"22caaec568a45c8d7abc8abdfbe2acbe23dfc8137c143e6c6348bfdc640decd4","blockSize":4194304,"blocks":["22caaec568a45c8d7abc8abdfbe2acbe23dfc8137c143e6c6348bfdc640decd4"]}},"ref.js":{"size":5234,"offset":"9681992","integrity":{"algorithm":"SHA256","hash":"1422c1454b3621d890066042048f37746fe1cf213088307099816199889bbfd1","blockSize":4194304,"blocks":["1422c1454b3621d890066042048f37746fe1cf213088307099816199889bbfd1"]}},"ref.js.map":{"size":5094,"offset":"9687226","integrity":{"algorithm":"SHA256","hash":"102a133a0c29f09af757ac3715b3fe8d98b60d3651a8c288fc8aec35c51e4745","blockSize":4194304,"blocks":["102a133a0c29f09af757ac3715b3fe8d98b60d3651a8c288fc8aec35c51e4745"]}}}},"discriminator":{"files":{"index.d.ts":{"size":288,"offset":"9692320","integrity":{"algorithm":"SHA256","hash":"423d2ccc38e369a7527988d682fafc40267bcd6688a7473e59c5eea20a29b64f","blockSize":4194304,"blocks":["423d2ccc38e369a7527988d682fafc40267bcd6688a7473e59c5eea20a29b64f"]}},"index.js":{"size":4845,"offset":"9692608","integrity":{"algorithm":"SHA256","hash":"b58b58025d2dbe5a6967376faec9295b860a338664c47037e9a1035c1e8fb88e","blockSize":4194304,"blocks":["b58b58025d2dbe5a6967376faec9295b860a338664c47037e9a1035c1e8fb88e"]}},"index.js.map":{"size":4243,"offset":"9697453","integrity":{"algorithm":"SHA256","hash":"5dd1b53a8e69c78a9e4eaf155e5e6f9e3856814a529632403d6deecda6efc1b2","blockSize":4194304,"blocks":["5dd1b53a8e69c78a9e4eaf155e5e6f9e3856814a529632403d6deecda6efc1b2"]}},"types.d.ts":{"size":271,"offset":"9701696","integrity":{"algorithm":"SHA256","hash":"3be71f4ce8988a01e2f5368bdd58e1d60236baf511e4510ee9291c7b3729a27e","blockSize":4194304,"blocks":["3be71f4ce8988a01e2f5368bdd58e1d60236baf511e4510ee9291c7b3729a27e"]}},"types.js":{"size":308,"offset":"9701967","integrity":{"algorithm":"SHA256","hash":"2365341d1f30dc72cece7703e908e47aacb8f904b9f66ec4019fe889ae1e57fa","blockSize":4194304,"blocks":["2365341d1f30dc72cece7703e908e47aacb8f904b9f66ec4019fe889ae1e57fa"]}},"types.js.map":{"size":239,"offset":"9702275","integrity":{"algorithm":"SHA256","hash":"4ab17ff95b7fec251f810c0d2c7bf2d9814b9ec733134195b91df6cf11821eaa","blockSize":4194304,"blocks":["4ab17ff95b7fec251f810c0d2c7bf2d9814b9ec733134195b91df6cf11821eaa"]}}}},"draft2020.d.ts":{"size":133,"offset":"9702514","integrity":{"algorithm":"SHA256","hash":"3ea35fd2f7b15955306658465892b2ff6e4bebb342b1a55baa65cbb9d3e5d62a","blockSize":4194304,"blocks":["3ea35fd2f7b15955306658465892b2ff6e4bebb342b1a55baa65cbb9d3e5d62a"]}},"draft2020.js":{"size":762,"offset":"9702647","integrity":{"algorithm":"SHA256","hash":"2d0dc3a14abd48a45ad1407a97f23a0f943fa5244923037f86e95a7de04a7445","blockSize":4194304,"blocks":["2d0dc3a14abd48a45ad1407a97f23a0f943fa5244923037f86e95a7de04a7445"]}},"draft2020.js.map":{"size":419,"offset":"9703409","integrity":{"algorithm":"SHA256","hash":"a45cb9b26d482a3a9018d4815ba277e409b83571c09c3a1065b9ba3390a7f891","blockSize":4194304,"blocks":["a45cb9b26d482a3a9018d4815ba277e409b83571c09c3a1065b9ba3390a7f891"]}},"draft7.d.ts":{"size":127,"offset":"9703828","integrity":{"algorithm":"SHA256","hash":"9218319bc0e9c5e5bd7ebf676273928785813f41ec5501c59bdc2c36dfaba8b1","blockSize":4194304,"blocks":["9218319bc0e9c5e5bd7ebf676273928785813f41ec5501c59bdc2c36dfaba8b1"]}},"draft7.js":{"size":557,"offset":"9703955","integrity":{"algorithm":"SHA256","hash":"8c62022c6c3aa302c3ea6f6709a697fc9eb6385d243fa7c2156dbe9f02228170","blockSize":4194304,"blocks":["8c62022c6c3aa302c3ea6f6709a697fc9eb6385d243fa7c2156dbe9f02228170"]}},"draft7.js.map":{"size":328,"offset":"9704512","integrity":{"algorithm":"SHA256","hash":"e556fccd950796d8b708fe1fa2aa8bcdc37ef037be9e3234be5297085d90cb62","blockSize":4194304,"blocks":["e556fccd950796d8b708fe1fa2aa8bcdc37ef037be9e3234be5297085d90cb62"]}},"dynamic":{"files":{"dynamicAnchor.d.ts":{"size":256,"offset":"9704840","integrity":{"algorithm":"SHA256","hash":"ac1d23564824d637da12dca9543b75a4f104407450469d004783d317c48cb293","blockSize":4194304,"blocks":["ac1d23564824d637da12dca9543b75a4f104407450469d004783d317c48cb293"]}},"dynamicAnchor.js":{"size":1261,"offset":"9705096","integrity":{"algorithm":"SHA256","hash":"78222a5b42bab186253d880f9af4b012394ae5988bfab78e79f2510caed0ccf7","blockSize":4194304,"blocks":["78222a5b42bab186253d880f9af4b012394ae5988bfab78e79f2510caed0ccf7"]}},"dynamicAnchor.js.map":{"size":1351,"offset":"9706357","integrity":{"algorithm":"SHA256","hash":"a1a2f8ca7533601839749c902345c3001c95af3566eb30636eb6994d6bcfc0e7","blockSize":4194304,"blocks":["a1a2f8ca7533601839749c902345c3001c95af3566eb30636eb6994d6bcfc0e7"]}},"dynamicRef.d.ts":{"size":250,"offset":"9707708","integrity":{"algorithm":"SHA256","hash":"3d51d2dc8af506a0345db97741b398cb386a0f8a3c3f3075a9a602158182a73f","blockSize":4194304,"blocks":["3d51d2dc8af506a0345db97741b398cb386a0f8a3c3f3075a9a602158182a73f"]}},"dynamicRef.js":{"size":1985,"offset":"9707958","integrity":{"algorithm":"SHA256","hash":"acc2913c91d11ff57150dde1751cdd5d9f486a0cb156037870ede203273af917","blockSize":4194304,"blocks":["acc2913c91d11ff57150dde1751cdd5d9f486a0cb156037870ede203273af917"]}},"dynamicRef.js.map":{"size":1679,"offset":"9709943","integrity":{"algorithm":"SHA256","hash":"4050eb882360e99c6a92d89a3c4f83e84f7f9df4d8e5c235ff9da9805d721a8f","blockSize":4194304,"blocks":["4050eb882360e99c6a92d89a3c4f83e84f7f9df4d8e5c235ff9da9805d721a8f"]}},"index.d.ts":{"size":106,"offset":"9711622","integrity":{"algorithm":"SHA256","hash":"4bca8e262b63afb07fc894cc4139df757fbabe511c6e47b99b99e9f6c3331d14","blockSize":4194304,"blocks":["4bca8e262b63afb07fc894cc4139df757fbabe511c6e47b99b99e9f6c3331d14"]}},"index.js":{"size":457,"offset":"9711728","integrity":{"algorithm":"SHA256","hash":"8c05d09948653957427f351d9c6172965b932a5663f7dcb63014a491a533cc0b","blockSize":4194304,"blocks":["8c05d09948653957427f351d9c6172965b932a5663f7dcb63014a491a533cc0b"]}},"index.js.map":{"size":278,"offset":"9712185","integrity":{"algorithm":"SHA256","hash":"cae8a099e83300e7e71269dcbd1918b399d9fe4e11d82ca1ddb59547ab962c14","blockSize":4194304,"blocks":["cae8a099e83300e7e71269dcbd1918b399d9fe4e11d82ca1ddb59547ab962c14"]}},"recursiveAnchor.d.ts":{"size":120,"offset":"9712463","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"recursiveAnchor.js":{"size":522,"offset":"9712583","integrity":{"algorithm":"SHA256","hash":"9f6cb7e509f9deada1b884010f08c52876f8eace32dcf0e7da28f6d0d91f3f76","blockSize":4194304,"blocks":["9f6cb7e509f9deada1b884010f08c52876f8eace32dcf0e7da28f6d0d91f3f76"]}},"recursiveAnchor.js.map":{"size":435,"offset":"9713105","integrity":{"algorithm":"SHA256","hash":"14cfed1db7bb14734fd2d0d9dd4be341f16ef368d7890a90424e6646c1d0115f","blockSize":4194304,"blocks":["14cfed1db7bb14734fd2d0d9dd4be341f16ef368d7890a90424e6646c1d0115f"]}},"recursiveRef.d.ts":{"size":120,"offset":"9713540","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"recursiveRef.js":{"size":325,"offset":"9713660","integrity":{"algorithm":"SHA256","hash":"7b0c651e2c5b5218639cd3ad7e5162f1e226fc9814107a85f4c3e47f5138670d","blockSize":4194304,"blocks":["7b0c651e2c5b5218639cd3ad7e5162f1e226fc9814107a85f4c3e47f5138670d"]}},"recursiveRef.js.map":{"size":339,"offset":"9713985","integrity":{"algorithm":"SHA256","hash":"aa22a9e7bdfce86b5eb802e6d806dc7d835d58a0dbc9165d72777206380ed7f6","blockSize":4194304,"blocks":["aa22a9e7bdfce86b5eb802e6d806dc7d835d58a0dbc9165d72777206380ed7f6"]}}}},"errors.d.ts":{"size":737,"offset":"9714324","integrity":{"algorithm":"SHA256","hash":"2f9fde0868ed030277c678b435f63fcf03d27c04301299580a4017963cc04ce6","blockSize":4194304,"blocks":["2f9fde0868ed030277c678b435f63fcf03d27c04301299580a4017963cc04ce6"]}},"errors.js":{"size":111,"offset":"9715061","integrity":{"algorithm":"SHA256","hash":"7758b311e7cba27a8ff8b99a5fcd8db6804265cbc48d2867b72bfe56823d36bc","blockSize":4194304,"blocks":["7758b311e7cba27a8ff8b99a5fcd8db6804265cbc48d2867b72bfe56823d36bc"]}},"errors.js.map":{"size":120,"offset":"9715172","integrity":{"algorithm":"SHA256","hash":"d551cb2d686656a44924038afa1c337933a1e5f953a8e5f09837dc3895332675","blockSize":4194304,"blocks":["d551cb2d686656a44924038afa1c337933a1e5f953a8e5f09837dc3895332675"]}},"format":{"files":{"format.d.ts":{"size":240,"offset":"9715292","integrity":{"algorithm":"SHA256","hash":"596e5b88b6ca8399076afcc22af6e6e0c4700c7cd1f420a78d637c3fb44a885e","blockSize":4194304,"blocks":["596e5b88b6ca8399076afcc22af6e6e0c4700c7cd1f420a78d637c3fb44a885e"]}},"format.js":{"size":4317,"offset":"9715532","integrity":{"algorithm":"SHA256","hash":"6fae0d5124fd821b1a9959492f7d6d7b528bee8830d49a7a4759fc9a9ab81d5f","blockSize":4194304,"blocks":["6fae0d5124fd821b1a9959492f7d6d7b528bee8830d49a7a4759fc9a9ab81d5f"]}},"format.js.map":{"size":3832,"offset":"9719849","integrity":{"algorithm":"SHA256","hash":"35575d56b5d5b5140b5575388d6e8ab5cdc097123eabe8c1e1e2f6d742fffcc5","blockSize":4194304,"blocks":["35575d56b5d5b5140b5575388d6e8ab5cdc097123eabe8c1e1e2f6d742fffcc5"]}},"index.d.ts":{"size":104,"offset":"9723681","integrity":{"algorithm":"SHA256","hash":"f5144b57a017760ef277fe7cdeb1707af63498721918b80650824ab23b75d791","blockSize":4194304,"blocks":["f5144b57a017760ef277fe7cdeb1707af63498721918b80650824ab23b75d791"]}},"index.js":{"size":209,"offset":"9723785","integrity":{"algorithm":"SHA256","hash":"d5dad5f95c9c5f48f8ca956cdbb927aafc7b56baabfca8c0b0403d92c5ebeb67","blockSize":4194304,"blocks":["d5dad5f95c9c5f48f8ca956cdbb927aafc7b56baabfca8c0b0403d92c5ebeb67"]}},"index.js.map":{"size":205,"offset":"9723994","integrity":{"algorithm":"SHA256","hash":"ad27029bd96489edc361684b818651562c0ba5eb6a0484bc52bcbb178e16e68d","blockSize":4194304,"blocks":["ad27029bd96489edc361684b818651562c0ba5eb6a0484bc52bcbb178e16e68d"]}}}},"jtd":{"files":{"discriminator.d.ts":{"size":383,"offset":"9724199","integrity":{"algorithm":"SHA256","hash":"b91034069e217212d8dda6c92669ee9f180b4c36273b5244c3be2c657f9286c7","blockSize":4194304,"blocks":["b91034069e217212d8dda6c92669ee9f180b4c36273b5244c3be2c657f9286c7"]}},"discriminator.js":{"size":2785,"offset":"9724582","integrity":{"algorithm":"SHA256","hash":"14df845b5ef760d96a3c62db8d4446840e3d408a248d1b92ba6db2260fca4da2","blockSize":4194304,"blocks":["14df845b5ef760d96a3c62db8d4446840e3d408a248d1b92ba6db2260fca4da2"]}},"discriminator.js.map":{"size":2701,"offset":"9727367","integrity":{"algorithm":"SHA256","hash":"c3b235680e571d21f99900ac5be4ce3457399b6881926dea7b1f36978e3ec848","blockSize":4194304,"blocks":["c3b235680e571d21f99900ac5be4ce3457399b6881926dea7b1f36978e3ec848"]}},"elements.d.ts":{"size":256,"offset":"9730068","integrity":{"algorithm":"SHA256","hash":"c9b5632d6665177030428d02603aeac3e920d31ec83ac500b55d44c7da74bd84","blockSize":4194304,"blocks":["c9b5632d6665177030428d02603aeac3e920d31ec83ac500b55d44c7da74bd84"]}},"elements.js":{"size":949,"offset":"9730324","integrity":{"algorithm":"SHA256","hash":"b2cad5c59d7c8ce936cea240d70beb41404c729901a60f32013c4facdcacfd5b","blockSize":4194304,"blocks":["b2cad5c59d7c8ce936cea240d70beb41404c729901a60f32013c4facdcacfd5b"]}},"elements.js.map":{"size":908,"offset":"9731273","integrity":{"algorithm":"SHA256","hash":"2cfe04080ae8f1ff3a86805676dd57cb6e55134325d473fa36f57837d72eca05","blockSize":4194304,"blocks":["2cfe04080ae8f1ff3a86805676dd57cb6e55134325d473fa36f57837d72eca05"]}},"enum.d.ts":{"size":225,"offset":"9732181","integrity":{"algorithm":"SHA256","hash":"ac3bcb82d7280fc313a967f311764258d18caf33db6d2b1a0243cde607ff01a0","blockSize":4194304,"blocks":["ac3bcb82d7280fc313a967f311764258d18caf33db6d2b1a0243cde607ff01a0"]}},"enum.js":{"size":1745,"offset":"9732406","integrity":{"algorithm":"SHA256","hash":"4a8b7fa05f94b2e67275445c6e8437c337b92f709d243ed30a48ba6a08a9a154","blockSize":4194304,"blocks":["4a8b7fa05f94b2e67275445c6e8437c337b92f709d243ed30a48ba6a08a9a154"]}},"enum.js.map":{"size":1708,"offset":"9734151","integrity":{"algorithm":"SHA256","hash":"87baba23c330e61539325d324acb2697c83a94e86e2902d2da3a08bc606230ff","blockSize":4194304,"blocks":["87baba23c330e61539325d324acb2697c83a94e86e2902d2da3a08bc606230ff"]}},"error.d.ts":{"size":521,"offset":"9735859","integrity":{"algorithm":"SHA256","hash":"a6613ee552418429af38391e37389036654a882c342a1b81f2711e8ddac597f2","blockSize":4194304,"blocks":["a6613ee552418429af38391e37389036654a882c342a1b81f2711e8ddac597f2"]}},"error.js":{"size":893,"offset":"9736380","integrity":{"algorithm":"SHA256","hash":"d6896337eedc9b71a742912f776580918cb4de58a90b434cd39f152896da16f9","blockSize":4194304,"blocks":["d6896337eedc9b71a742912f776580918cb4de58a90b434cd39f152896da16f9"]}},"error.js.map":{"size":716,"offset":"9737273","integrity":{"algorithm":"SHA256","hash":"4737604dbfbcf18ad231ff4188391cf349fc0238baa89062956fc56fa1703a6f","blockSize":4194304,"blocks":["4737604dbfbcf18ad231ff4188391cf349fc0238baa89062956fc56fa1703a6f"]}},"index.d.ts":{"size":533,"offset":"9737989","integrity":{"algorithm":"SHA256","hash":"b0d06dbb409369169143ede5df1fb58b2fca8d44588e199bd624b6f6d966bf08","blockSize":4194304,"blocks":["b0d06dbb409369169143ede5df1fb58b2fca8d44588e199bd624b6f6d966bf08"]}},"index.js":{"size":962,"offset":"9738522","integrity":{"algorithm":"SHA256","hash":"c57d340cd0709479d8ea9f102549a8fd2a47a2c1f2e6fe7f0e14067fe6385d7d","blockSize":4194304,"blocks":["c57d340cd0709479d8ea9f102549a8fd2a47a2c1f2e6fe7f0e14067fe6385d7d"]}},"index.js.map":{"size":530,"offset":"9739484","integrity":{"algorithm":"SHA256","hash":"31b17824ebfbdb2d2e7f5ae6835627153d57e8ebe801ba93988e4df2fea6f028","blockSize":4194304,"blocks":["31b17824ebfbdb2d2e7f5ae6835627153d57e8ebe801ba93988e4df2fea6f028"]}},"metadata.d.ts":{"size":254,"offset":"9740014","integrity":{"algorithm":"SHA256","hash":"74dbbaddae5c3d5fdea9df3c53cb0b4ac8a18a2098370dee6393c152ff8b6025","blockSize":4194304,"blocks":["74dbbaddae5c3d5fdea9df3c53cb0b4ac8a18a2098370dee6393c152ff8b6025"]}},"metadata.js":{"size":810,"offset":"9740268","integrity":{"algorithm":"SHA256","hash":"237a4bcc04f1a59628ba35aab9bd7c02fa19a007bf026f75c562c20c7a63ab68","blockSize":4194304,"blocks":["237a4bcc04f1a59628ba35aab9bd7c02fa19a007bf026f75c562c20c7a63ab68"]}},"metadata.js.map":{"size":797,"offset":"9741078","integrity":{"algorithm":"SHA256","hash":"b4815c6a53d59294b48ae16adb6bfa3f36a1052b2a23b3763124a8b27747c538","blockSize":4194304,"blocks":["b4815c6a53d59294b48ae16adb6bfa3f36a1052b2a23b3763124a8b27747c538"]}},"nullable.d.ts":{"size":305,"offset":"9741875","integrity":{"algorithm":"SHA256","hash":"06aeb5ecbfc278df2941e3226dedecb838e64e02a6fab7518531854543ecb543","blockSize":4194304,"blocks":["06aeb5ecbfc278df2941e3226dedecb838e64e02a6fab7518531854543ecb543"]}},"nullable.js":{"size":859,"offset":"9742180","integrity":{"algorithm":"SHA256","hash":"ba6494ac04fb1c2654951e8c8a57861e324fafa0f6c3bd2e1716bea8eb5c823a","blockSize":4194304,"blocks":["ba6494ac04fb1c2654951e8c8a57861e324fafa0f6c3bd2e1716bea8eb5c823a"]}},"nullable.js.map":{"size":821,"offset":"9743039","integrity":{"algorithm":"SHA256","hash":"4d28df1f7dbde477e3501ab0d049b5643b5e7911d59603ebb24161ba8ef00f08","blockSize":4194304,"blocks":["4d28df1f7dbde477e3501ab0d049b5643b5e7911d59603ebb24161ba8ef00f08"]}},"optionalProperties.d.ts":{"size":120,"offset":"9743860","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"optionalProperties.js":{"size":436,"offset":"9743980","integrity":{"algorithm":"SHA256","hash":"82b67841649a948b069c8e0cfab712eb883579690065a05658b7df7e4eddcc62","blockSize":4194304,"blocks":["82b67841649a948b069c8e0cfab712eb883579690065a05658b7df7e4eddcc62"]}},"optionalProperties.js.map":{"size":398,"offset":"9744416","integrity":{"algorithm":"SHA256","hash":"58c1f7d7f168abe67793982f655adaef8b76937875373a26552c840c3812b898","blockSize":4194304,"blocks":["58c1f7d7f168abe67793982f655adaef8b76937875373a26552c840c3812b898"]}},"properties.d.ts":{"size":879,"offset":"9744814","integrity":{"algorithm":"SHA256","hash":"46456824df16d60f243a7e386562b27bac838aaba66050b9bc0f31e1ab34c1f2","blockSize":4194304,"blocks":["46456824df16d60f243a7e386562b27bac838aaba66050b9bc0f31e1ab34c1f2"]}},"properties.js":{"size":6320,"offset":"9745693","integrity":{"algorithm":"SHA256","hash":"4a392193b708f69c25511ed059e80a70ea084585731817ad8e459364f479eb35","blockSize":4194304,"blocks":["4a392193b708f69c25511ed059e80a70ea084585731817ad8e459364f479eb35"]}},"properties.js.map":{"size":5884,"offset":"9752013","integrity":{"algorithm":"SHA256","hash":"7323488a259181201748b81e3c70628ef17842fdcc9ff917859240369d7f5380","blockSize":4194304,"blocks":["7323488a259181201748b81e3c70628ef17842fdcc9ff917859240369d7f5380"]}},"ref.d.ts":{"size":203,"offset":"9757897","integrity":{"algorithm":"SHA256","hash":"e875ca9fddf2b2ba80afe86316bc19b2982a6da3482b29a5cf7cfb35e3d07a2e","blockSize":4194304,"blocks":["e875ca9fddf2b2ba80afe86316bc19b2982a6da3482b29a5cf7cfb35e3d07a2e"]}},"ref.js":{"size":2648,"offset":"9758100","integrity":{"algorithm":"SHA256","hash":"4736880c610f3664a8c714fdb5cf4e9db9fcda1721691dcacad2e9796e937460","blockSize":4194304,"blocks":["4736880c610f3664a8c714fdb5cf4e9db9fcda1721691dcacad2e9796e937460"]}},"ref.js.map":{"size":2476,"offset":"9760748","integrity":{"algorithm":"SHA256","hash":"1f76ab8797ae96dadfb9f03bb0c170d822417224ec2e395431cd0d0a51922001","blockSize":4194304,"blocks":["1f76ab8797ae96dadfb9f03bb0c170d822417224ec2e395431cd0d0a51922001"]}},"type.d.ts":{"size":485,"offset":"9763224","integrity":{"algorithm":"SHA256","hash":"da47cb979ae4a849f9b983f43ef34365b7050c4f5ae2ebf818195858774e1d67","blockSize":4194304,"blocks":["da47cb979ae4a849f9b983f43ef34365b7050c4f5ae2ebf818195858774e1d67"]}},"type.js":{"size":2706,"offset":"9763709","integrity":{"algorithm":"SHA256","hash":"f97e19f2c3042938f433cfad0c4500b3342d869719550246bd4fced479db8e1c","blockSize":4194304,"blocks":["f97e19f2c3042938f433cfad0c4500b3342d869719550246bd4fced479db8e1c"]}},"type.js.map":{"size":2614,"offset":"9766415","integrity":{"algorithm":"SHA256","hash":"8956607890334c9fd8eb242e2ae900c64e0c7ccc6879ce5f283fedadaa5e1fc2","blockSize":4194304,"blocks":["8956607890334c9fd8eb242e2ae900c64e0c7ccc6879ce5f283fedadaa5e1fc2"]}},"union.d.ts":{"size":120,"offset":"9769029","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"union.js":{"size":343,"offset":"9769149","integrity":{"algorithm":"SHA256","hash":"f8404ab539ecfc5f6eb1bc489cc541aad6bf79cf58beecfcfe671226678c3280","blockSize":4194304,"blocks":["f8404ab539ecfc5f6eb1bc489cc541aad6bf79cf58beecfcfe671226678c3280"]}},"union.js.map":{"size":320,"offset":"9769492","integrity":{"algorithm":"SHA256","hash":"53c59966c45cc6fb1276f8f933ea2f9fa79be5a91c2595a79d940c147abf5519","blockSize":4194304,"blocks":["53c59966c45cc6fb1276f8f933ea2f9fa79be5a91c2595a79d940c147abf5519"]}},"values.d.ts":{"size":253,"offset":"9769812","integrity":{"algorithm":"SHA256","hash":"0697277dd829ac2610d68fe1b457c9e758105bb52d40e149d9c15e5e2fe6dca4","blockSize":4194304,"blocks":["0697277dd829ac2610d68fe1b457c9e758105bb52d40e149d9c15e5e2fe6dca4"]}},"values.js":{"size":1838,"offset":"9770065","integrity":{"algorithm":"SHA256","hash":"6b98eb1fbe2686a7f26fbf1e8860f61bdc81fe47117c4f5a79d5ca1fc92138f2","blockSize":4194304,"blocks":["6b98eb1fbe2686a7f26fbf1e8860f61bdc81fe47117c4f5a79d5ca1fc92138f2"]}},"values.js.map":{"size":1783,"offset":"9771903","integrity":{"algorithm":"SHA256","hash":"0dc547866a1329dbe62fb89f961c74611069ad797639acce2def6a185e657c6a","blockSize":4194304,"blocks":["0dc547866a1329dbe62fb89f961c74611069ad797639acce2def6a185e657c6a"]}}}},"metadata.d.ts":{"size":149,"offset":"9773686","integrity":{"algorithm":"SHA256","hash":"a63efeef4b2f74a79a7729d6d362a98e3c647a7a439711f3a43372e16c6223aa","blockSize":4194304,"blocks":["a63efeef4b2f74a79a7729d6d362a98e3c647a7a439711f3a43372e16c6223aa"]}},"metadata.js":{"size":427,"offset":"9773835","integrity":{"algorithm":"SHA256","hash":"45c178744a7ec57e20c85ceeaea8d9f36b5663636ab7e495ea2c3c1bf4a58609","blockSize":4194304,"blocks":["45c178744a7ec57e20c85ceeaea8d9f36b5663636ab7e495ea2c3c1bf4a58609"]}},"metadata.js.map":{"size":299,"offset":"9774262","integrity":{"algorithm":"SHA256","hash":"7d888e73dee29bee063f1e98884e6a40386f5ee653a8ed6208e43b973a3542cd","blockSize":4194304,"blocks":["7d888e73dee29bee063f1e98884e6a40386f5ee653a8ed6208e43b973a3542cd"]}},"next.d.ts":{"size":97,"offset":"9774561","integrity":{"algorithm":"SHA256","hash":"0aa6d6107f533bac5f47e8ef5d7fcc39503e0cd547e16b6348d063a24b30a137","blockSize":4194304,"blocks":["0aa6d6107f533bac5f47e8ef5d7fcc39503e0cd547e16b6348d063a24b30a137"]}},"next.js":{"size":433,"offset":"9774658","integrity":{"algorithm":"SHA256","hash":"491c4d9738e50a6c22b3090cb1df49911b4bb7c3b7dcafc2f2dd4c074c4d82e7","blockSize":4194304,"blocks":["491c4d9738e50a6c22b3090cb1df49911b4bb7c3b7dcafc2f2dd4c074c4d82e7"]}},"next.js.map":{"size":243,"offset":"9775091","integrity":{"algorithm":"SHA256","hash":"79890db3838840ab79e117248e523f9d3c97742b042b02382326fb2bf14f0918","blockSize":4194304,"blocks":["79890db3838840ab79e117248e523f9d3c97742b042b02382326fb2bf14f0918"]}},"unevaluated":{"files":{"index.d.ts":{"size":114,"offset":"9775334","integrity":{"algorithm":"SHA256","hash":"87d4054133a5812f28e73373903c8ed8cc4929fd2ed0aa14695e7140e12d24ed","blockSize":4194304,"blocks":["87d4054133a5812f28e73373903c8ed8cc4929fd2ed0aa14695e7140e12d24ed"]}},"index.js":{"size":350,"offset":"9775448","integrity":{"algorithm":"SHA256","hash":"4e7936d1a55051e70e2ebbbfc8de94fbe7f1e7b055252df5a984481ea7c156a4","blockSize":4194304,"blocks":["4e7936d1a55051e70e2ebbbfc8de94fbe7f1e7b055252df5a984481ea7c156a4"]}},"index.js.map":{"size":236,"offset":"9775798","integrity":{"algorithm":"SHA256","hash":"8a4aff71617048ad134ff9d6773270168595b0268c5330d8450b90e71496f8be","blockSize":4194304,"blocks":["8a4aff71617048ad134ff9d6773270168595b0268c5330d8450b90e71496f8be"]}},"unevaluatedItems.d.ts":{"size":248,"offset":"9776034","integrity":{"algorithm":"SHA256","hash":"d4cad9dc13e9c5348637170ddd5d95f7ed5fdfc856ddca40234fa55518bc99a6","blockSize":4194304,"blocks":["d4cad9dc13e9c5348637170ddd5d95f7ed5fdfc856ddca40234fa55518bc99a6"]}},"unevaluatedItems.js":{"size":1588,"offset":"9776282","integrity":{"algorithm":"SHA256","hash":"4d7010c39f1b7af4a2fe1a62e5b65c8f763d4e58ac3d710099d367659f5e4fda","blockSize":4194304,"blocks":["4d7010c39f1b7af4a2fe1a62e5b65c8f763d4e58ac3d710099d367659f5e4fda"]}},"unevaluatedItems.js.map":{"size":1813,"offset":"9777870","integrity":{"algorithm":"SHA256","hash":"03ade2a02a69c0b0bad0dbe74d70964daab47a65f5d4796cdb927edd00c06ec8","blockSize":4194304,"blocks":["03ade2a02a69c0b0bad0dbe74d70964daab47a65f5d4796cdb927edd00c06ec8"]}},"unevaluatedProperties.d.ts":{"size":272,"offset":"9779683","integrity":{"algorithm":"SHA256","hash":"adddf736e08132c7059ee572b128fdacb1c2650ace80d0f582e93d097ed4fbaf","blockSize":4194304,"blocks":["adddf736e08132c7059ee572b128fdacb1c2650ace80d0f582e93d097ed4fbaf"]}},"unevaluatedProperties.js":{"size":2608,"offset":"9779955","integrity":{"algorithm":"SHA256","hash":"665029a99612ec32e9bef99c9c4b09a4dc0be6c71d7b920594d414d404806ebe","blockSize":4194304,"blocks":["665029a99612ec32e9bef99c9c4b09a4dc0be6c71d7b920594d414d404806ebe"]}},"unevaluatedProperties.js.map":{"size":2518,"offset":"9782563","integrity":{"algorithm":"SHA256","hash":"7eea70788f708b843fa81cecb7c90aef4ae473b2cb5f5cf9f3229d1025fcffc0","blockSize":4194304,"blocks":["7eea70788f708b843fa81cecb7c90aef4ae473b2cb5f5cf9f3229d1025fcffc0"]}}}},"validation":{"files":{"const.d.ts":{"size":208,"offset":"9785081","integrity":{"algorithm":"SHA256","hash":"1cf0d15e6ab1ecabbf329b906ae8543e6b8955133b7f6655f04d433e3a0597ab","blockSize":4194304,"blocks":["1cf0d15e6ab1ecabbf329b906ae8543e6b8955133b7f6655f04d433e3a0597ab"]}},"const.js":{"size":852,"offset":"9785289","integrity":{"algorithm":"SHA256","hash":"ace994e9ab97a70899a9484794794f4be5ee03bfb3cf32242d3f091d77f0329a","blockSize":4194304,"blocks":["ace994e9ab97a70899a9484794794f4be5ee03bfb3cf32242d3f091d77f0329a"]}},"const.js.map":{"size":819,"offset":"9786141","integrity":{"algorithm":"SHA256","hash":"5f9e6e0702178bf1ce990751be7fb9369403af96e7f724bc361da8c27b16d8ea","blockSize":4194304,"blocks":["5f9e6e0702178bf1ce990751be7fb9369403af96e7f724bc361da8c27b16d8ea"]}},"dependentRequired.d.ts":{"size":343,"offset":"9786960","integrity":{"algorithm":"SHA256","hash":"d70675ba7ba7d02e52b7070a369957a70827e4b2bca2c1680c38a832e87b61fd","blockSize":4194304,"blocks":["d70675ba7ba7d02e52b7070a369957a70827e4b2bca2c1680c38a832e87b61fd"]}},"dependentRequired.js":{"size":403,"offset":"9787303","integrity":{"algorithm":"SHA256","hash":"cd69a90089328b24d2232c12edae57858c14f66aaa56923c12929eb3d673e8fa","blockSize":4194304,"blocks":["cd69a90089328b24d2232c12edae57858c14f66aaa56923c12929eb3d673e8fa"]}},"dependentRequired.js.map":{"size":376,"offset":"9787706","integrity":{"algorithm":"SHA256","hash":"62fd57bce66b2b2cffa208b30e7dab00011936f05ae2a5b075c04461663e06a4","blockSize":4194304,"blocks":["62fd57bce66b2b2cffa208b30e7dab00011936f05ae2a5b075c04461663e06a4"]}},"enum.d.ts":{"size":241,"offset":"9788082","integrity":{"algorithm":"SHA256","hash":"7c9f98fe812643141502b30fb2b5ec56d16aaf94f98580276ae37b7924dd44a4","blockSize":4194304,"blocks":["7c9f98fe812643141502b30fb2b5ec56d16aaf94f98580276ae37b7924dd44a4"]}},"enum.js":{"size":1901,"offset":"9788323","integrity":{"algorithm":"SHA256","hash":"61062b318a40eb52fc5a8283e7f4781db98349841744961ef4fe04a4722ebf22","blockSize":4194304,"blocks":["61062b318a40eb52fc5a8283e7f4781db98349841744961ef4fe04a4722ebf22"]}},"enum.js.map":{"size":1999,"offset":"9790224","integrity":{"algorithm":"SHA256","hash":"3d74c4a70ce905cb4c07c75fededfb51d7124e683cf4ce394e89835fad8b1a2b","blockSize":4194304,"blocks":["3d74c4a70ce905cb4c07c75fededfb51d7124e683cf4ce394e89835fad8b1a2b"]}},"index.d.ts":{"size":771,"offset":"9792223","integrity":{"algorithm":"SHA256","hash":"b3547893f24f59d0a644c52f55901b15a3fa1a115bc5ea9a582911469b9348b7","blockSize":4194304,"blocks":["b3547893f24f59d0a644c52f55901b15a3fa1a115bc5ea9a582911469b9348b7"]}},"index.js":{"size":1036,"offset":"9792994","integrity":{"algorithm":"SHA256","hash":"4a1839832de5f10ff423c1c0c6cb232b5b6e1b34980a28862cf56b2763136de4","blockSize":4194304,"blocks":["4a1839832de5f10ff423c1c0c6cb232b5b6e1b34980a28862cf56b2763136de4"]}},"index.js.map":{"size":595,"offset":"9794030","integrity":{"algorithm":"SHA256","hash":"42fce077fc1751290cef9a3b2e48546262724d61f91d44751e6e4075ce159ed4","blockSize":4194304,"blocks":["42fce077fc1751290cef9a3b2e48546262724d61f91d44751e6e4075ce159ed4"]}},"limitContains.d.ts":{"size":120,"offset":"9794625","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"limitContains.js":{"size":495,"offset":"9794745","integrity":{"algorithm":"SHA256","hash":"0ea6f2e43359add298e1ed9306fe5020c62e086392f2915f10226b01394b200d","blockSize":4194304,"blocks":["0ea6f2e43359add298e1ed9306fe5020c62e086392f2915f10226b01394b200d"]}},"limitContains.js.map":{"size":473,"offset":"9795240","integrity":{"algorithm":"SHA256","hash":"56076461ebadbfbbd25cf53a8eaf5e61368f325443f6fe8e6ed9bea5d7b24445","blockSize":4194304,"blocks":["56076461ebadbfbbd25cf53a8eaf5e61368f325443f6fe8e6ed9bea5d7b24445"]}},"limitItems.d.ts":{"size":120,"offset":"9795713","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"limitItems.js":{"size":852,"offset":"9795833","integrity":{"algorithm":"SHA256","hash":"49f0427d29b38aef2fa8aead26e68bda12deb9a2da22f7a7804ba0fed44e1fec","blockSize":4194304,"blocks":["49f0427d29b38aef2fa8aead26e68bda12deb9a2da22f7a7804ba0fed44e1fec"]}},"limitItems.js.map":{"size":905,"offset":"9796685","integrity":{"algorithm":"SHA256","hash":"4d8e8e8f64bd85fab47be9c03276d23d52421b18cdabe2962c8cac38d5109459","blockSize":4194304,"blocks":["4d8e8e8f64bd85fab47be9c03276d23d52421b18cdabe2962c8cac38d5109459"]}},"limitLength.d.ts":{"size":120,"offset":"9797590","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"limitLength.js":{"size":1130,"offset":"9797710","integrity":{"algorithm":"SHA256","hash":"379c28317faaf7784680b6049c3562692d3df6d65cce33f48e6c6c723beeeec2","blockSize":4194304,"blocks":["379c28317faaf7784680b6049c3562692d3df6d65cce33f48e6c6c723beeeec2"]}},"limitLength.js.map":{"size":1145,"offset":"9798840","integrity":{"algorithm":"SHA256","hash":"bc33ca19aa1613710c361b334d5387a178441fb79f368898dcdce1d8075f54f5","blockSize":4194304,"blocks":["bc33ca19aa1613710c361b334d5387a178441fb79f368898dcdce1d8075f54f5"]}},"limitNumber.d.ts":{"size":386,"offset":"9799985","integrity":{"algorithm":"SHA256","hash":"25fbe57c8ee3079e2201fe580578fab4f3a78881c98865b7c96233af00bf9624","blockSize":4194304,"blocks":["25fbe57c8ee3079e2201fe580578fab4f3a78881c98865b7c96233af00bf9624"]}},"limitNumber.js":{"size":1036,"offset":"9800371","integrity":{"algorithm":"SHA256","hash":"3dd4bd41dbfc76c522078ff54b6479683485c4e97faa04cfcfaf2d8cb0fb8e65","blockSize":4194304,"blocks":["3dd4bd41dbfc76c522078ff54b6479683485c4e97faa04cfcfaf2d8cb0fb8e65"]}},"limitNumber.js.map":{"size":1300,"offset":"9801407","integrity":{"algorithm":"SHA256","hash":"8fb0880eb5eba874c7424e9b5f4c6f14a436330a471e0c791b39248e1abf2d9f","blockSize":4194304,"blocks":["8fb0880eb5eba874c7424e9b5f4c6f14a436330a471e0c791b39248e1abf2d9f"]}},"limitProperties.d.ts":{"size":120,"offset":"9802707","integrity":{"algorithm":"SHA256","hash":"e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564","blockSize":4194304,"blocks":["e99ba2bf1ceb28ce6a3e60093bd8cb09e05eca71d0004254d3baf97c02152564"]}},"limitProperties.js":{"size":896,"offset":"9802827","integrity":{"algorithm":"SHA256","hash":"8523a3f7b36c34882ca32b0ec71a2157d7930907cb86b778a97c1514fa6258ac","blockSize":4194304,"blocks":["8523a3f7b36c34882ca32b0ec71a2157d7930907cb86b778a97c1514fa6258ac"]}},"limitProperties.js.map":{"size":915,"offset":"9803723","integrity":{"algorithm":"SHA256","hash":"0d819ad8104004b82be28bb3e86c96eefbff850e0fc1bd21bf43678a17a2ebfa","blockSize":4194304,"blocks":["0d819ad8104004b82be28bb3e86c96eefbff850e0fc1bd21bf43678a17a2ebfa"]}},"multipleOf.d.ts":{"size":252,"offset":"9804638","integrity":{"algorithm":"SHA256","hash":"62cc8477858487b4c4de7d7ae5e745a8ce0015c1592f398b63ee05d6e64ca295","blockSize":4194304,"blocks":["62cc8477858487b4c4de7d7ae5e745a8ce0015c1592f398b63ee05d6e64ca295"]}},"multipleOf.js":{"size":1023,"offset":"9804890","integrity":{"algorithm":"SHA256","hash":"df128c2a6ca74ae57c65fbfe3aea8a101447a3ae8c41fd53cfc5693fa23cc8bd","blockSize":4194304,"blocks":["df128c2a6ca74ae57c65fbfe3aea8a101447a3ae8c41fd53cfc5693fa23cc8bd"]}},"multipleOf.js.map":{"size":986,"offset":"9805913","integrity":{"algorithm":"SHA256","hash":"ff3ca557d3ed080cc3397829b9641b11764118afa8ce3c97ec2f6f47ae0c8c69","blockSize":4194304,"blocks":["ff3ca557d3ed080cc3397829b9641b11764118afa8ce3c97ec2f6f47ae0c8c69"]}},"pattern.d.ts":{"size":243,"offset":"9806899","integrity":{"algorithm":"SHA256","hash":"cc2a9ec3cb10e4c0b8738b02c31798fad312d21ef20b6a2f5be1d077e9f5409d","blockSize":4194304,"blocks":["cc2a9ec3cb10e4c0b8738b02c31798fad312d21ef20b6a2f5be1d077e9f5409d"]}},"pattern.js":{"size":905,"offset":"9807142","integrity":{"algorithm":"SHA256","hash":"592f7966bb9dea6256dc8c0242ab9e05cdfef2b1d6dd27ef478c7a20c9a0471b","blockSize":4194304,"blocks":["592f7966bb9dea6256dc8c0242ab9e05cdfef2b1d6dd27ef478c7a20c9a0471b"]}},"pattern.js.map":{"size":933,"offset":"9808047","integrity":{"algorithm":"SHA256","hash":"3b66173d4c1e0d0170438758e1e8349953bdf1de6645f61fafd0be869eb1a751","blockSize":4194304,"blocks":["3b66173d4c1e0d0170438758e1e8349953bdf1de6645f61fafd0be869eb1a751"]}},"required.d.ts":{"size":255,"offset":"9808980","integrity":{"algorithm":"SHA256","hash":"4b4fadcda7d34034737598c07e2dca5d7e1e633cb3ba8dd4d2e6a7782b30b296","blockSize":4194304,"blocks":["4b4fadcda7d34034737598c07e2dca5d7e1e633cb3ba8dd4d2e6a7782b30b296"]}},"required.js":{"size":3188,"offset":"9809235","integrity":{"algorithm":"SHA256","hash":"b953bc18d94274bd73374dd5b4282d7a21159cec8c0e7a357e1eaf3f326b9054","blockSize":4194304,"blocks":["b953bc18d94274bd73374dd5b4282d7a21159cec8c0e7a357e1eaf3f326b9054"]}},"required.js.map":{"size":2994,"offset":"9812423","integrity":{"algorithm":"SHA256","hash":"93e4965462fa0e78f52e96498550ce19eca50f70872ffae95baeb4b59e66b1bd","blockSize":4194304,"blocks":["93e4965462fa0e78f52e96498550ce19eca50f70872ffae95baeb4b59e66b1bd"]}},"uniqueItems.d.ts":{"size":261,"offset":"9815417","integrity":{"algorithm":"SHA256","hash":"360fdc8829a51c5428636f1f83e7db36fef6c5a15ed4411b582d00a1c2bd6e97","blockSize":4194304,"blocks":["360fdc8829a51c5428636f1f83e7db36fef6c5a15ed4411b582d00a1c2bd6e97"]}},"uniqueItems.js":{"size":3037,"offset":"9815678","integrity":{"algorithm":"SHA256","hash":"666d1a2aa25c0dfe3cf41312d0f9d40e9f99eb2c19be7469134ad89005aadd52","blockSize":4194304,"blocks":["666d1a2aa25c0dfe3cf41312d0f9d40e9f99eb2c19be7469134ad89005aadd52"]}},"uniqueItems.js.map":{"size":3354,"offset":"9818715","integrity":{"algorithm":"SHA256","hash":"ca96cb4269f0665b48201bbd3bf767583b2d337cc6bfd1f8e3135c54c09780b5","blockSize":4194304,"blocks":["ca96cb4269f0665b48201bbd3bf767583b2d337cc6bfd1f8e3135c54c09780b5"]}}}}}}}},"lib":{"files":{"2019.ts":{"size":2502,"offset":"9822069","integrity":{"algorithm":"SHA256","hash":"d56766ac02c001a4f808c99281e466c4ed004118169e1d93b1b383dbe8ebfdbc","blockSize":4194304,"blocks":["d56766ac02c001a4f808c99281e466c4ed004118169e1d93b1b383dbe8ebfdbc"]}},"2020.ts":{"size":2217,"offset":"9824571","integrity":{"algorithm":"SHA256","hash":"0172fbdd0f09d7cec4243374ef3148da91ac504b436c1b058bbb482fdb1ad603","blockSize":4194304,"blocks":["0172fbdd0f09d7cec4243374ef3148da91ac504b436c1b058bbb482fdb1ad603"]}},"ajv.ts":{"size":2229,"offset":"9826788","integrity":{"algorithm":"SHA256","hash":"db86e7216e623df616513e1191e428b8d73c9f2cb1a36720fff0f12003d22a85","blockSize":4194304,"blocks":["db86e7216e623df616513e1191e428b8d73c9f2cb1a36720fff0f12003d22a85"]}},"compile":{"files":{"codegen":{"files":{"code.ts":{"size":4474,"offset":"9829017","integrity":{"algorithm":"SHA256","hash":"3e088cc949e98ccef11611d64f11b3035182c257dd055587f3cc3081b59b8f85","blockSize":4194304,"blocks":["3e088cc949e98ccef11611d64f11b3035182c257dd055587f3cc3081b59b8f85"]}},"index.ts":{"size":23051,"offset":"9833491","integrity":{"algorithm":"SHA256","hash":"5d36911057430b7beedd1acf8026afb6529a09bf8b974c47d68d9a72be252ea6","blockSize":4194304,"blocks":["5d36911057430b7beedd1acf8026afb6529a09bf8b974c47d68d9a72be252ea6"]}},"scope.ts":{"size":5981,"offset":"9856542","integrity":{"algorithm":"SHA256","hash":"a4cc6bc51633c0a67e09d61926a769a4d805f13931fd3541957a8e80d2b86a16","blockSize":4194304,"blocks":["a4cc6bc51633c0a67e09d61926a769a4d805f13931fd3541957a8e80d2b86a16"]}}}},"errors.ts":{"size":5269,"offset":"9862523","integrity":{"algorithm":"SHA256","hash":"088cd10b6fb1e7ee6fde64d791f17d06f9b79cb126c35f98ae02cffafec44480","blockSize":4194304,"blocks":["088cd10b6fb1e7ee6fde64d791f17d06f9b79cb126c35f98ae02cffafec44480"]}},"index.ts":{"size":12299,"offset":"9867792","integrity":{"algorithm":"SHA256","hash":"fd39c4872a98fd27d899345d92da8b5e9c92a3b311a9f91e156080349f85c869","blockSize":4194304,"blocks":["fd39c4872a98fd27d899345d92da8b5e9c92a3b311a9f91e156080349f85c869"]}},"jtd":{"files":{"parse.ts":{"size":12345,"offset":"9880091","integrity":{"algorithm":"SHA256","hash":"3f987db29f450b9463fc64a2d594325d21155d3e7934a143ab1a744ce0d7ecd6","blockSize":4194304,"blocks":["3f987db29f450b9463fc64a2d594325d21155d3e7934a143ab1a744ce0d7ecd6"]}},"serialize.ts":{"size":8219,"offset":"9892436","integrity":{"algorithm":"SHA256","hash":"eb33d193cb146f98598f612c4380b15a9a881eac379cc7cc07ec0693b7ec2242","blockSize":4194304,"blocks":["eb33d193cb146f98598f612c4380b15a9a881eac379cc7cc07ec0693b7ec2242"]}},"types.ts":{"size":311,"offset":"9900655","integrity":{"algorithm":"SHA256","hash":"4f9a151d6cb7028d5eb483a2f0aab17a2f8a411b0af6b48108712cf6448b0822","blockSize":4194304,"blocks":["4f9a151d6cb7028d5eb483a2f0aab17a2f8a411b0af6b48108712cf6448b0822"]}}}},"names.ts":{"size":1116,"offset":"9900966","integrity":{"algorithm":"SHA256","hash":"7e985cf51593c03cfac0317c9cceecddc70ab630673a3f5af739885255b2be64","blockSize":4194304,"blocks":["7e985cf51593c03cfac0317c9cceecddc70ab630673a3f5af739885255b2be64"]}},"ref_error.ts":{"size":513,"offset":"9902082","integrity":{"algorithm":"SHA256","hash":"1a3246eb3a9a09e185099600b550185a5fe84b22e27d854ddc7273d5e35315ac","blockSize":4194304,"blocks":["1a3246eb3a9a09e185099600b550185a5fe84b22e27d854ddc7273d5e35315ac"]}},"resolve.ts":{"size":4674,"offset":"9902595","integrity":{"algorithm":"SHA256","hash":"83fa181288f15f4be781fe8baa6735fcfee169efbf3f7710a86a50c6cac5acb5","blockSize":4194304,"blocks":["83fa181288f15f4be781fe8baa6735fcfee169efbf3f7710a86a50c6cac5acb5"]}},"rules.ts":{"size":1456,"offset":"9907269","integrity":{"algorithm":"SHA256","hash":"d736019109db360c5bb5d5fb12132a0d518ff3c01238c93b8f317a2879cbdf85","blockSize":4194304,"blocks":["d736019109db360c5bb5d5fb12132a0d518ff3c01238c93b8f317a2879cbdf85"]}},"util.ts":{"size":6639,"offset":"9908725","integrity":{"algorithm":"SHA256","hash":"2f9441df72d2d7996f90403f5f31d6d156036a9e8e39a773a3e52812462dbcad","blockSize":4194304,"blocks":["2f9441df72d2d7996f90403f5f31d6d156036a9e8e39a773a3e52812462dbcad"]}},"validate":{"files":{"applicability.ts":{"size":739,"offset":"9915364","integrity":{"algorithm":"SHA256","hash":"22a43ed9cc6d17524013990d049d96494db39c95f1122e103c01dfc87a820497","blockSize":4194304,"blocks":["22a43ed9cc6d17524013990d049d96494db39c95f1122e103c01dfc87a820497"]}},"boolSchema.ts":{"size":1298,"offset":"9916103","integrity":{"algorithm":"SHA256","hash":"e5c41cd20170d246d1d40ac54bf7df4cbef084238d27f2a8d69faa2d597600cf","blockSize":4194304,"blocks":["e5c41cd20170d246d1d40ac54bf7df4cbef084238d27f2a8d69faa2d597600cf"]}},"dataType.ts":{"size":7094,"offset":"9917401","integrity":{"algorithm":"SHA256","hash":"37adffaf46b9648699ea8b08a3caf6d5d031de027b955dd5f69ad2a72e7f03e3","blockSize":4194304,"blocks":["37adffaf46b9648699ea8b08a3caf6d5d031de027b955dd5f69ad2a72e7f03e3"]}},"defaults.ts":{"size":1215,"offset":"9924495","integrity":{"algorithm":"SHA256","hash":"8ae3dec515bbf81721af940ed1ca3ff1edbbb5e2c24187f441822c89e3925c27","blockSize":4194304,"blocks":["8ae3dec515bbf81721af940ed1ca3ff1edbbb5e2c24187f441822c89e3925c27"]}},"index.ts":{"size":19445,"offset":"9925710","integrity":{"algorithm":"SHA256","hash":"841338dea0ff90d44bde71f0651879edad186fd50d7bb6d03243b0085e557c48","blockSize":4194304,"blocks":["841338dea0ff90d44bde71f0651879edad186fd50d7bb6d03243b0085e557c48"]}},"keyword.ts":{"size":5337,"offset":"9945155","integrity":{"algorithm":"SHA256","hash":"83e14ccb96fb8e24bb81af1c0d12a724472f713faf5ff2af2a8fd1be43da273f","blockSize":4194304,"blocks":["83e14ccb96fb8e24bb81af1c0d12a724472f713faf5ff2af2a8fd1be43da273f"]}},"subschema.ts":{"size":4366,"offset":"9950492","integrity":{"algorithm":"SHA256","hash":"79eb0fbb091074cdbc7149f3fe6bf0c174f76f53f82cf90f346285505eb4113e","blockSize":4194304,"blocks":["79eb0fbb091074cdbc7149f3fe6bf0c174f76f53f82cf90f346285505eb4113e"]}}}}}},"core.ts":{"size":30726,"offset":"9954858","integrity":{"algorithm":"SHA256","hash":"44069e60c6493073c2f8cf3fda0e5e7e7a20ef110be7cdd5ef21652968ee221f","blockSize":4194304,"blocks":["44069e60c6493073c2f8cf3fda0e5e7e7a20ef110be7cdd5ef21652968ee221f"]}},"jtd.ts":{"size":4172,"offset":"9985584","integrity":{"algorithm":"SHA256","hash":"e7157f96fc310c1488fdc78d12c6c33f3064d23859049e5d1fffa0a21d57f262","blockSize":4194304,"blocks":["e7157f96fc310c1488fdc78d12c6c33f3064d23859049e5d1fffa0a21d57f262"]}},"refs":{"files":{"data.json":{"size":409,"offset":"9989756","integrity":{"algorithm":"SHA256","hash":"d24ab8a97c18b3f5afdde7d7024a0e0ac1df0614a16a41cb88f81379edcc2db3","blockSize":4194304,"blocks":["d24ab8a97c18b3f5afdde7d7024a0e0ac1df0614a16a41cb88f81379edcc2db3"]}},"json-schema-2019-09":{"files":{"index.ts":{"size":899,"offset":"9990165","integrity":{"algorithm":"SHA256","hash":"b0650c20759d7c19f624f1a7c8f3688eb7833a9ff964598dc0d4513e685d6b8d","blockSize":4194304,"blocks":["b0650c20759d7c19f624f1a7c8f3688eb7833a9ff964598dc0d4513e685d6b8d"]}},"meta":{"files":{"applicator.json":{"size":1566,"offset":"9991064","integrity":{"algorithm":"SHA256","hash":"9c356a52b0ad5da7d4c1b69f61dff5277c2af46221bc0b0521bbdbf3a12d3a2a","blockSize":4194304,"blocks":["9c356a52b0ad5da7d4c1b69f61dff5277c2af46221bc0b0521bbdbf3a12d3a2a"]}},"content.json":{"size":477,"offset":"9992630","integrity":{"algorithm":"SHA256","hash":"cf4792ae93f4a4580ec9523640945f7756f75fd624935ebf15194b0ac3909267","blockSize":4194304,"blocks":["cf4792ae93f4a4580ec9523640945f7756f75fd624935ebf15194b0ac3909267"]}},"core.json":{"size":1273,"offset":"9993107","integrity":{"algorithm":"SHA256","hash":"629c017994ffaa33f573a96cf01b9dac6cae80c7d5d17dad5e823a3afa18d5fe","blockSize":4194304,"blocks":["629c017994ffaa33f573a96cf01b9dac6cae80c7d5d17dad5e823a3afa18d5fe"]}},"format.json":{"size":375,"offset":"9994380","integrity":{"algorithm":"SHA256","hash":"018ef7c81bcca9e40a4a02ed236e7cabb3a630f2b1ea01fbdeed2f882c15ddc8","blockSize":4194304,"blocks":["018ef7c81bcca9e40a4a02ed236e7cabb3a630f2b1ea01fbdeed2f882c15ddc8"]}},"meta-data.json":{"size":758,"offset":"9994755","integrity":{"algorithm":"SHA256","hash":"e038593d36bf1855875a13b8812469d6a2d62ed309436b9c9a2fa5a4ba59085e","blockSize":4194304,"blocks":["e038593d36bf1855875a13b8812469d6a2d62ed309436b9c9a2fa5a4ba59085e"]}},"validation.json":{"size":2264,"offset":"9995513","integrity":{"algorithm":"SHA256","hash":"aaba7f2d6fcbdfa6ca97fdc3d3da1ae7d66ca3322b7e90cf5a98b067555d06e6","blockSize":4194304,"blocks":["aaba7f2d6fcbdfa6ca97fdc3d3da1ae7d66ca3322b7e90cf5a98b067555d06e6"]}}}},"schema.json":{"size":1579,"offset":"9997777","integrity":{"algorithm":"SHA256","hash":"264720afa0dd61919e21bbe9bc1312121b70e43019ac696240e069adc72cce15","blockSize":4194304,"blocks":["264720afa0dd61919e21bbe9bc1312121b70e43019ac696240e069adc72cce15"]}}}},"json-schema-2020-12":{"files":{"index.ts":{"size":982,"offset":"9999356","integrity":{"algorithm":"SHA256","hash":"9c4f608142c423538ffee89094935d3dede32664a1fc47c3cb4b248550946000","blockSize":4194304,"blocks":["9c4f608142c423538ffee89094935d3dede32664a1fc47c3cb4b248550946000"]}},"meta":{"files":{"applicator.json":{"size":1441,"offset":"10000338","integrity":{"algorithm":"SHA256","hash":"f1e465ff0c0cc86bee5c0cc4b51d2734c532e6ea12c75b60a2ac093a4577b2d4","blockSize":4194304,"blocks":["f1e465ff0c0cc86bee5c0cc4b51d2734c532e6ea12c75b60a2ac093a4577b2d4"]}},"content.json":{"size":479,"offset":"10001779","integrity":{"algorithm":"SHA256","hash":"7ede86f2c48d646202bf1332aefaf46db268c943d59752727db7247dc2920516","blockSize":4194304,"blocks":["7ede86f2c48d646202bf1332aefaf46db268c943d59752727db7247dc2920516"]}},"core.json":{"size":1344,"offset":"10002258","integrity":{"algorithm":"SHA256","hash":"c3a5947992d4fe67c95cda7910911207376bbae41c0a124ec9e7e699172e7a49","blockSize":4194304,"blocks":["c3a5947992d4fe67c95cda7910911207376bbae41c0a124ec9e7e699172e7a49"]}},"format-annotation.json":{"size":420,"offset":"10003602","integrity":{"algorithm":"SHA256","hash":"1e31131b1ed21f98c007f04deb501343b8c4dd77f1c5a8494a9c2085f68d769d","blockSize":4194304,"blocks":["1e31131b1ed21f98c007f04deb501343b8c4dd77f1c5a8494a9c2085f68d769d"]}},"meta-data.json":{"size":758,"offset":"10004022","integrity":{"algorithm":"SHA256","hash":"eb008c756b29bdaa237c1f06d32ea4a21f6ef22148b03c6372cea5e4c0782273","blockSize":4194304,"blocks":["eb008c756b29bdaa237c1f06d32ea4a21f6ef22148b03c6372cea5e4c0782273"]}},"unevaluated.json":{"size":472,"offset":"10004780","integrity":{"algorithm":"SHA256","hash":"8f7f75f4274745faa32e4abdba12de99f49b21df225f52f723b5c62043b0edca","blockSize":4194304,"blocks":["8f7f75f4274745faa32e4abdba12de99f49b21df225f52f723b5c62043b0edca"]}},"validation.json":{"size":2264,"offset":"10005252","integrity":{"algorithm":"SHA256","hash":"3cae7069843679429e4ada7df261bb8961fa34cac15be89296026e69af312092","blockSize":4194304,"blocks":["3cae7069843679429e4ada7df261bb8961fa34cac15be89296026e69af312092"]}}}},"schema.json":{"size":2166,"offset":"10007516","integrity":{"algorithm":"SHA256","hash":"5333c7df76bceee098e865881d0808238dea836126c6c60b49299ec85c6c7a56","blockSize":4194304,"blocks":["5333c7df76bceee098e865881d0808238dea836126c6c60b49299ec85c6c7a56"]}}}},"json-schema-draft-06.json":{"size":3449,"offset":"10009682","integrity":{"algorithm":"SHA256","hash":"a9b6a00af20105009f0924cd7c02d811bbf70c579a96f1552579c3457111f687","blockSize":4194304,"blocks":["a9b6a00af20105009f0924cd7c02d811bbf70c579a96f1552579c3457111f687"]}},"json-schema-draft-07.json":{"size":3811,"offset":"10013131","integrity":{"algorithm":"SHA256","hash":"f7e8b13cad4fecff9771f3626fef33e20e59027b90938a28fd9d2f6c17cd0773","blockSize":4194304,"blocks":["f7e8b13cad4fecff9771f3626fef33e20e59027b90938a28fd9d2f6c17cd0773"]}},"json-schema-secure.json":{"size":2521,"offset":"10016942","integrity":{"algorithm":"SHA256","hash":"b7840b4f1526eee47ac19780906a436d0c39df2aa3d505388caf18864085a421","blockSize":4194304,"blocks":["b7840b4f1526eee47ac19780906a436d0c39df2aa3d505388caf18864085a421"]}},"jtd-schema.ts":{"size":2586,"offset":"10019463","integrity":{"algorithm":"SHA256","hash":"76b788839e3f26ccbb073309b452595482714f2105295d009145d7b79e336003","blockSize":4194304,"blocks":["76b788839e3f26ccbb073309b452595482714f2105295d009145d7b79e336003"]}}}},"runtime":{"files":{"equal.ts":{"size":236,"offset":"10022049","integrity":{"algorithm":"SHA256","hash":"013de4ec7e4006015ef49ec787737636dc048a913aad0922295fc8b0eb15aa10","blockSize":4194304,"blocks":["013de4ec7e4006015ef49ec787737636dc048a913aad0922295fc8b0eb15aa10"]}},"parseJson.ts":{"size":4553,"offset":"10022285","integrity":{"algorithm":"SHA256","hash":"79d1f9a5ae035324c73d85f146c00c19714f73a61d822470a12d28edd6be0fd5","blockSize":4194304,"blocks":["79d1f9a5ae035324c73d85f146c00c19714f73a61d822470a12d28edd6be0fd5"]}},"quote.ts":{"size":802,"offset":"10026838","integrity":{"algorithm":"SHA256","hash":"b87b625e0ca6a17d96c7af7999b7eaacc956c4265a49b54877d8fa9de295c1e3","blockSize":4194304,"blocks":["b87b625e0ca6a17d96c7af7999b7eaacc956c4265a49b54877d8fa9de295c1e3"]}},"re2.ts":{"size":157,"offset":"10027640","integrity":{"algorithm":"SHA256","hash":"10841997f170df64628a12998362f97dec5052d06495a20ad72f725bd1bac2e7","blockSize":4194304,"blocks":["10841997f170df64628a12998362f97dec5052d06495a20ad72f725bd1bac2e7"]}},"timestamp.ts":{"size":1492,"offset":"10027797","integrity":{"algorithm":"SHA256","hash":"08509863a735667f2b8c5fb68d92f318947bd975cdf2a230ede606af96a8fbd4","blockSize":4194304,"blocks":["08509863a735667f2b8c5fb68d92f318947bd975cdf2a230ede606af96a8fbd4"]}},"ucs2length.ts":{"size":629,"offset":"10029289","integrity":{"algorithm":"SHA256","hash":"a001c95dd2e835b9c61080254c117f02d425eb6760bd2c1d682ab63ed00d12f6","blockSize":4194304,"blocks":["a001c95dd2e835b9c61080254c117f02d425eb6760bd2c1d682ab63ed00d12f6"]}},"uri.ts":{"size":162,"offset":"10029918","integrity":{"algorithm":"SHA256","hash":"4723aa43822e1cf2291029fe9038f317cca49ee685f59b2e48eb154f716a8edb","blockSize":4194304,"blocks":["4723aa43822e1cf2291029fe9038f317cca49ee685f59b2e48eb154f716a8edb"]}},"validation_error.ts":{"size":336,"offset":"10030080","integrity":{"algorithm":"SHA256","hash":"abf8375d3a5d74512cc4d229e4839cf03b84d2e3904804401ca83cf7639e0a64","blockSize":4194304,"blocks":["abf8375d3a5d74512cc4d229e4839cf03b84d2e3904804401ca83cf7639e0a64"]}}}},"standalone":{"files":{"index.ts":{"size":4151,"offset":"10030416","integrity":{"algorithm":"SHA256","hash":"3509ccea2b4677c04074ccb9f6335ef63d36f183349d4c026dacc95928d096ed","blockSize":4194304,"blocks":["3509ccea2b4677c04074ccb9f6335ef63d36f183349d4c026dacc95928d096ed"]}},"instance.ts":{"size":1272,"offset":"10034567","integrity":{"algorithm":"SHA256","hash":"9fa1decae4056176ce7104da136af90419078307baafaeee947740e02eb4fc82","blockSize":4194304,"blocks":["9fa1decae4056176ce7104da136af90419078307baafaeee947740e02eb4fc82"]}}}},"types":{"files":{"index.ts":{"size":7289,"offset":"10035839","integrity":{"algorithm":"SHA256","hash":"3cf1bd15564b691784b1bce4c6fa4223c0a3a8bde7b10d98270d7c66146aefa8","blockSize":4194304,"blocks":["3cf1bd15564b691784b1bce4c6fa4223c0a3a8bde7b10d98270d7c66146aefa8"]}},"json-schema.ts":{"size":6380,"offset":"10043128","integrity":{"algorithm":"SHA256","hash":"4ccc0e648873df7580bb66a9d2e908604ddd96c69a88246dda60f5539e10bed8","blockSize":4194304,"blocks":["4ccc0e648873df7580bb66a9d2e908604ddd96c69a88246dda60f5539e10bed8"]}},"jtd-schema.ts":{"size":9321,"offset":"10049508","integrity":{"algorithm":"SHA256","hash":"1c537a703005dbdf394539f58432861dae5135fddae6f54cebb28ae0f26f3d42","blockSize":4194304,"blocks":["1c537a703005dbdf394539f58432861dae5135fddae6f54cebb28ae0f26f3d42"]}}}},"vocabularies":{"files":{"applicator":{"files":{"additionalItems.ts":{"size":1824,"offset":"10058829","integrity":{"algorithm":"SHA256","hash":"0593c60f31db5cea9022a353e56fd3066a8dac4e35607affb4e556d4d84c3f2a","blockSize":4194304,"blocks":["0593c60f31db5cea9022a353e56fd3066a8dac4e35607affb4e556d4d84c3f2a"]}},"additionalProperties.ts":{"size":3782,"offset":"10060653","integrity":{"algorithm":"SHA256","hash":"1ea5e25fd12131cae2278b7fc4fda354dad5a60d65234b67aaa09adf10268f55","blockSize":4194304,"blocks":["1ea5e25fd12131cae2278b7fc4fda354dad5a60d65234b67aaa09adf10268f55"]}},"allOf.ts":{"size":717,"offset":"10064435","integrity":{"algorithm":"SHA256","hash":"cce43c2f5c51e2c1f40d9e773d052fc9e73beb775c5d6c0ae93e0bdb5a2a32fa","blockSize":4194304,"blocks":["cce43c2f5c51e2c1f40d9e773d052fc9e73beb775c5d6c0ae93e0bdb5a2a32fa"]}},"anyOf.ts":{"size":380,"offset":"10065152","integrity":{"algorithm":"SHA256","hash":"2449024f686a1d8d51dc414849ae039465406adcf7ba04565d8ad2ba7448f594","blockSize":4194304,"blocks":["2449024f686a1d8d51dc414849ae039465406adcf7ba04565d8ad2ba7448f594"]}},"contains.ts":{"size":3278,"offset":"10065532","integrity":{"algorithm":"SHA256","hash":"731c74710381d5484725d7e2bfa97e1f809a495ddae9bd0226a7c91578aeef05","blockSize":4194304,"blocks":["731c74710381d5484725d7e2bfa97e1f809a495ddae9bd0226a7c91578aeef05"]}},"dependencies.ts":{"size":3391,"offset":"10068810","integrity":{"algorithm":"SHA256","hash":"d2e648e8fe45621558c8f14ff5684954a91f6d800d1b2bf3d90f43941c84df65","blockSize":4194304,"blocks":["d2e648e8fe45621558c8f14ff5684954a91f6d800d1b2bf3d90f43941c84df65"]}},"dependentSchemas.ts":{"size":280,"offset":"10072201","integrity":{"algorithm":"SHA256","hash":"ba8f82eb99b70d5e128c69719a15a703f3b5b95844923487fd8d12c5015200cc","blockSize":4194304,"blocks":["ba8f82eb99b70d5e128c69719a15a703f3b5b95844923487fd8d12c5015200cc"]}},"if.ts":{"size":2395,"offset":"10072481","integrity":{"algorithm":"SHA256","hash":"676949dae0592465efcfdb3f15c8700fcc5e0b95bf0674c3b8723acbf2c3285f","blockSize":4194304,"blocks":["676949dae0592465efcfdb3f15c8700fcc5e0b95bf0674c3b8723acbf2c3285f"]}},"index.ts":{"size":1592,"offset":"10074876","integrity":{"algorithm":"SHA256","hash":"85f01326e6589c9b0a8cc38939ac0520c5d213d55f6fefe2a9c23c7bdea680f6","blockSize":4194304,"blocks":["85f01326e6589c9b0a8cc38939ac0520c5d213d55f6fefe2a9c23c7bdea680f6"]}},"items.ts":{"size":1892,"offset":"10076468","integrity":{"algorithm":"SHA256","hash":"9ccc7f93f03988881f366885fd3cc1a1490f36712b7932f3735f2f72136990e3","blockSize":4194304,"blocks":["9ccc7f93f03988881f366885fd3cc1a1490f36712b7932f3735f2f72136990e3"]}},"items2020.ts":{"size":1053,"offset":"10078360","integrity":{"algorithm":"SHA256","hash":"939a853b1f7b3a1ba3907453435dac558d11ba5c059ffc02c87107871ed2a668","blockSize":4194304,"blocks":["939a853b1f7b3a1ba3907453435dac558d11ba5c059ffc02c87107871ed2a668"]}},"not.ts":{"size":859,"offset":"10079413","integrity":{"algorithm":"SHA256","hash":"a458fd0c8a2386906e5e55a2095c6176dc02dcfa19e13ec4ba775b51e2b56971","blockSize":4194304,"blocks":["a458fd0c8a2386906e5e55a2095c6176dc02dcfa19e13ec4ba775b51e2b56971"]}},"oneOf.ts":{"size":2197,"offset":"10080272","integrity":{"algorithm":"SHA256","hash":"ec3681fffbe66ae13befecacc4a400b3986b7819846b8e264320c189eff31ad0","blockSize":4194304,"blocks":["ec3681fffbe66ae13befecacc4a400b3986b7819846b8e264320c189eff31ad0"]}},"patternProperties.ts":{"size":2870,"offset":"10082469","integrity":{"algorithm":"SHA256","hash":"80cb5e80c22228e2ce276b0703627f9057e40993b431a063a93abad5f92c3f75","blockSize":4194304,"blocks":["80cb5e80c22228e2ce276b0703627f9057e40993b431a063a93abad5f92c3f75"]}},"prefixItems.ts":{"size":292,"offset":"10085339","integrity":{"algorithm":"SHA256","hash":"ddddd4d635a17c56713d8938e78a7dc0c7688044ce1a5de033a6fd8e8ff96b0b","blockSize":4194304,"blocks":["ddddd4d635a17c56713d8938e78a7dc0c7688044ce1a5de033a6fd8e8ff96b0b"]}},"properties.ts":{"size":1845,"offset":"10085631","integrity":{"algorithm":"SHA256","hash":"76cd23a45c08a679f196d61e5b937e2a4361c92d9fc958a72d47ebc7efdba1f1","blockSize":4194304,"blocks":["76cd23a45c08a679f196d61e5b937e2a4361c92d9fc958a72d47ebc7efdba1f1"]}},"propertyNames.ts":{"size":1247,"offset":"10087476","integrity":{"algorithm":"SHA256","hash":"ab1b80a1a99dbf16578091b96b1347fda8f0177bfdee7ddbec161af54d01fa8f","blockSize":4194304,"blocks":["ab1b80a1a99dbf16578091b96b1347fda8f0177bfdee7ddbec161af54d01fa8f"]}},"thenElse.ts":{"size":441,"offset":"10088723","integrity":{"algorithm":"SHA256","hash":"29a4fc78180fa88c422b01d2168c29087235238a2516d4c1800542503b5060e4","blockSize":4194304,"blocks":["29a4fc78180fa88c422b01d2168c29087235238a2516d4c1800542503b5060e4"]}}}},"code.ts":{"size":5247,"offset":"10089164","integrity":{"algorithm":"SHA256","hash":"f4bf46f24e44512addfc8b34e8ef1cd6320025236839e176deb59ee8b20c7ee7","blockSize":4194304,"blocks":["f4bf46f24e44512addfc8b34e8ef1cd6320025236839e176deb59ee8b20c7ee7"]}},"core":{"files":{"id.ts":{"size":224,"offset":"10094411","integrity":{"algorithm":"SHA256","hash":"241606f9c18746cb35cb74c728c6d972bd6100edad70692bb27f841ac8b1b4b1","blockSize":4194304,"blocks":["241606f9c18746cb35cb74c728c6d972bd6100edad70692bb27f841ac8b1b4b1"]}},"index.ts":{"size":274,"offset":"10094635","integrity":{"algorithm":"SHA256","hash":"43e089e25baac37f7665f0451e51956ec154f60a058b83f86cc3e577ab800f62","blockSize":4194304,"blocks":["43e089e25baac37f7665f0451e51956ec154f60a058b83f86cc3e577ab800f62"]}},"ref.ts":{"size":4384,"offset":"10094909","integrity":{"algorithm":"SHA256","hash":"0d932d49ef57d32449923e5687e57715f4d08252f749d34d1d9410e8f88711f8","blockSize":4194304,"blocks":["0d932d49ef57d32449923e5687e57715f4d08252f749d34d1d9410e8f88711f8"]}}}},"discriminator":{"files":{"index.ts":{"size":4304,"offset":"10099293","integrity":{"algorithm":"SHA256","hash":"9b89f8b9ab15e49b326bb3505424a1c0cd234397bf7db13a80e74e627fc381a3","blockSize":4194304,"blocks":["9b89f8b9ab15e49b326bb3505424a1c0cd234397bf7db13a80e74e627fc381a3"]}},"types.ts":{"size":251,"offset":"10103597","integrity":{"algorithm":"SHA256","hash":"537bcd41ac270d1a43417d742a1f9f55b319e6f213323f6b00edfbe38e88e7da","blockSize":4194304,"blocks":["537bcd41ac270d1a43417d742a1f9f55b319e6f213323f6b00edfbe38e88e7da"]}}}},"draft2020.ts":{"size":698,"offset":"10103848","integrity":{"algorithm":"SHA256","hash":"840c49657713cbbd6467274f270c77bf16a7ed8b3aedbee6bb5c587550282aea","blockSize":4194304,"blocks":["840c49657713cbbd6467274f270c77bf16a7ed8b3aedbee6bb5c587550282aea"]}},"draft7.ts":{"size":496,"offset":"10104546","integrity":{"algorithm":"SHA256","hash":"9f8fd4fa8b2084b4cae951badc68de3a361e01eea06a158d530c4d55e92b5fb4","blockSize":4194304,"blocks":["9f8fd4fa8b2084b4cae951badc68de3a361e01eea06a158d530c4d55e92b5fb4"]}},"dynamic":{"files":{"dynamicAnchor.ts":{"size":1122,"offset":"10105042","integrity":{"algorithm":"SHA256","hash":"bc8bb7636e8fff1add5d8c36577978f357731c2877fd4d4c59b620d6a8af1d8f","blockSize":4194304,"blocks":["bc8bb7636e8fff1add5d8c36577978f357731c2877fd4d4c59b620d6a8af1d8f"]}},"dynamicRef.ts":{"size":1797,"offset":"10106164","integrity":{"algorithm":"SHA256","hash":"92884e9923f4053155e5c1f13d5e176c17b47f0db65616bf031a4bb93faf969d","blockSize":4194304,"blocks":["92884e9923f4053155e5c1f13d5e176c17b47f0db65616bf031a4bb93faf969d"]}},"index.ts":{"size":328,"offset":"10107961","integrity":{"algorithm":"SHA256","hash":"c5188cd455c45b486350ed74bb08b6fb47db13bea6f218cce9d2cbf88044352b","blockSize":4194304,"blocks":["c5188cd455c45b486350ed74bb08b6fb47db13bea6f218cce9d2cbf88044352b"]}},"recursiveAnchor.ts":{"size":401,"offset":"10108289","integrity":{"algorithm":"SHA256","hash":"7d9e31d581249212f5c831d30d5398c43b6d7ce4d3dcb735880524016b3e8d6a","blockSize":4194304,"blocks":["7d9e31d581249212f5c831d30d5398c43b6d7ce4d3dcb735880524016b3e8d6a"]}},"recursiveRef.ts":{"size":253,"offset":"10108690","integrity":{"algorithm":"SHA256","hash":"6202321b7ce13fb3aec6d0180c3e78b6f91d768be57afef6b1693bd143577ee3","blockSize":4194304,"blocks":["6202321b7ce13fb3aec6d0180c3e78b6f91d768be57afef6b1693bd143577ee3"]}}}},"errors.ts":{"size":731,"offset":"10108943","integrity":{"algorithm":"SHA256","hash":"ccf58af574cd4a8475346998967fa6229b163b6b52af2e9b0b30fa37338b8e2b","blockSize":4194304,"blocks":["ccf58af574cd4a8475346998967fa6229b163b6b52af2e9b0b30fa37338b8e2b"]}},"format":{"files":{"format.ts":{"size":3987,"offset":"10109674","integrity":{"algorithm":"SHA256","hash":"5cd796fed502ebe7f2c650b47daae97c28967dd17fa020df56ec861986d30148","blockSize":4194304,"blocks":["5cd796fed502ebe7f2c650b47daae97c28967dd17fa020df56ec861986d30148"]}},"index.ts":{"size":148,"offset":"10113661","integrity":{"algorithm":"SHA256","hash":"804a833df34f93e7cd1a1809782f65c1ac89610ac736045308d27b659264a40a","blockSize":4194304,"blocks":["804a833df34f93e7cd1a1809782f65c1ac89610ac736045308d27b659264a40a"]}}}},"jtd":{"files":{"discriminator.ts":{"size":2656,"offset":"10113809","integrity":{"algorithm":"SHA256","hash":"9dd6dd40e98239c10d6771c0a0d107e238c12af4b3c5932fe623de649588de1d","blockSize":4194304,"blocks":["9dd6dd40e98239c10d6771c0a0d107e238c12af4b3c5932fe623de649588de1d"]}},"elements.ts":{"size":976,"offset":"10116465","integrity":{"algorithm":"SHA256","hash":"54c00bc71c6bc0f5055c49fa0b6803db07832e5f77aadb1e55e5e045b3a4ad33","blockSize":4194304,"blocks":["54c00bc71c6bc0f5055c49fa0b6803db07832e5f77aadb1e55e5e045b3a4ad33"]}},"enum.ts":{"size":1627,"offset":"10117441","integrity":{"algorithm":"SHA256","hash":"a55ae1c6b7d9ac0e9053e71da407efe41b3156cc0db7091bcd20a9d8897844dd","blockSize":4194304,"blocks":["a55ae1c6b7d9ac0e9053e71da407efe41b3156cc0db7091bcd20a9d8897844dd"]}},"error.ts":{"size":746,"offset":"10119068","integrity":{"algorithm":"SHA256","hash":"e1bdb9dfada76ee42308e134f2e74027ea8398997961a3bae08cd10c792272c5","blockSize":4194304,"blocks":["e1bdb9dfada76ee42308e134f2e74027ea8398997961a3bae08cd10c792272c5"]}},"index.ts":{"size":1007,"offset":"10119814","integrity":{"algorithm":"SHA256","hash":"4ca3295374abddb3c03ada3fdc52b9b7cb175046769a3eef60605bef8a6ef85a","blockSize":4194304,"blocks":["4ca3295374abddb3c03ada3fdc52b9b7cb175046769a3eef60605bef8a6ef85a"]}},"metadata.ts":{"size":716,"offset":"10120821","integrity":{"algorithm":"SHA256","hash":"558fcb3d3b5e39a9a967326ea6a35160bd485755d587c5faafb644e25d0c0f01","blockSize":4194304,"blocks":["558fcb3d3b5e39a9a967326ea6a35160bd485755d587c5faafb644e25d0c0f01"]}},"nullable.ts":{"size":649,"offset":"10121537","integrity":{"algorithm":"SHA256","hash":"75b370cb5ad4c36ff85a57fb9305a8018b5363666f0a5ac21c8de99d984b6bb8","blockSize":4194304,"blocks":["75b370cb5ad4c36ff85a57fb9305a8018b5363666f0a5ac21c8de99d984b6bb8"]}},"optionalProperties.ts":{"size":394,"offset":"10122186","integrity":{"algorithm":"SHA256","hash":"03fdaf041fd433857e78c3b867ad1e6c1f0a964c0292498981e238b40a2a4e77","blockSize":4194304,"blocks":["03fdaf041fd433857e78c3b867ad1e6c1f0a964c0292498981e238b40a2a4e77"]}},"properties.ts":{"size":6244,"offset":"10122580","integrity":{"algorithm":"SHA256","hash":"930071681288045214e10af6065f5d6c7f6ea599d07c607f345b609bac4bf8e5","blockSize":4194304,"blocks":["930071681288045214e10af6065f5d6c7f6ea599d07c607f345b609bac4bf8e5"]}},"ref.ts":{"size":2346,"offset":"10128824","integrity":{"algorithm":"SHA256","hash":"f7dc8a31ad5764cc0c44725713130d5b656ead77483429226507da4dfd24ad2d","blockSize":4194304,"blocks":["f7dc8a31ad5764cc0c44725713130d5b656ead77483429226507da4dfd24ad2d"]}},"type.ts":{"size":2547,"offset":"10131170","integrity":{"algorithm":"SHA256","hash":"0e6c6bb43fa81bff1cb4ba3f4d6d73379f3e013efaa01b790768fa0a5095cd45","blockSize":4194304,"blocks":["0e6c6bb43fa81bff1cb4ba3f4d6d73379f3e013efaa01b790768fa0a5095cd45"]}},"union.ts":{"size":292,"offset":"10133717","integrity":{"algorithm":"SHA256","hash":"1dd265ce69eebbd46cd395b0b9d98ca22d8e681d0ab787e6409cb126450c9536","blockSize":4194304,"blocks":["1dd265ce69eebbd46cd395b0b9d98ca22d8e681d0ab787e6409cb126450c9536"]}},"values.ts":{"size":1681,"offset":"10134009","integrity":{"algorithm":"SHA256","hash":"86236891ca9a9f77f7df5d399be026406d0f375c0a5d8f6d0749859dea245cdd","blockSize":4194304,"blocks":["86236891ca9a9f77f7df5d399be026406d0f375c0a5d8f6d0749859dea245cdd"]}}}},"metadata.ts":{"size":304,"offset":"10135690","integrity":{"algorithm":"SHA256","hash":"a0b32538e6d2c93c7fd10aef9963d990d24d9579d2494350a23f3501300817d1","blockSize":4194304,"blocks":["a0b32538e6d2c93c7fd10aef9963d990d24d9579d2494350a23f3501300817d1"]}},"next.ts":{"size":320,"offset":"10135994","integrity":{"algorithm":"SHA256","hash":"b953c63e395e4e0c95e048ae8778473a744e1d7a7b5fa8c57733c1bfbf7ce443","blockSize":4194304,"blocks":["b953c63e395e4e0c95e048ae8778473a744e1d7a7b5fa8c57733c1bfbf7ce443"]}},"unevaluated":{"files":{"index.ts":{"size":257,"offset":"10136314","integrity":{"algorithm":"SHA256","hash":"0d44afd298469f01304d72a5cf7da11303367fa506200c46785cee4bd3350f40","blockSize":4194304,"blocks":["0d44afd298469f01304d72a5cf7da11303367fa506200c46785cee4bd3350f40"]}},"unevaluatedItems.ts":{"size":1524,"offset":"10136571","integrity":{"algorithm":"SHA256","hash":"c19c3d3e0b290171f674d3dbacc52d946f9e4325f2223355a055e741c5dbbbb2","blockSize":4194304,"blocks":["c19c3d3e0b290171f674d3dbacc52d946f9e4325f2223355a055e741c5dbbbb2"]}},"unevaluatedProperties.ts":{"size":2440,"offset":"10138095","integrity":{"algorithm":"SHA256","hash":"7d725ffb348774d31cc697cc6b632a43431b3d2d92edb819fd7341902340c6de","blockSize":4194304,"blocks":["7d725ffb348774d31cc697cc6b632a43431b3d2d92edb819fd7341902340c6de"]}}}},"validation":{"files":{"const.ts":{"size":863,"offset":"10140535","integrity":{"algorithm":"SHA256","hash":"9dc3c40d6260158b2ee34dadadbc0e738cad939fc725cc1d2f5120bd43768ed5","blockSize":4194304,"blocks":["9dc3c40d6260158b2ee34dadadbc0e738cad939fc725cc1d2f5120bd43768ed5"]}},"dependentRequired.ts":{"size":510,"offset":"10141398","integrity":{"algorithm":"SHA256","hash":"082d569e899aca88dbe28bdf6a0c6c2efa120e107fe4d1244ecf3a0b17fef45b","blockSize":4194304,"blocks":["082d569e899aca88dbe28bdf6a0c6c2efa120e107fe4d1244ecf3a0b17fef45b"]}},"enum.ts":{"size":1837,"offset":"10141908","integrity":{"algorithm":"SHA256","hash":"f62f760dda52c2dbc053ef7b7012aa9db10d3af65e8b1dc5defcaf2ba9c25911","blockSize":4194304,"blocks":["f62f760dda52c2dbc053ef7b7012aa9db10d3af65e8b1dc5defcaf2ba9c25911"]}},"index.ts":{"size":1271,"offset":"10143745","integrity":{"algorithm":"SHA256","hash":"72a7be83642b3da6317dc9661bfbc8a8f521773812ac6e5c58ddee1c4386a86c","blockSize":4194304,"blocks":["72a7be83642b3da6317dc9661bfbc8a8f521773812ac6e5c58ddee1c4386a86c"]}},"limitContains.ts":{"size":485,"offset":"10145016","integrity":{"algorithm":"SHA256","hash":"3097c6f451ff7a527cbce136a08817114ee615f1b29221195cee45dfc89675e5","blockSize":4194304,"blocks":["3097c6f451ff7a527cbce136a08817114ee615f1b29221195cee45dfc89675e5"]}},"limitItems.ts":{"size":812,"offset":"10145501","integrity":{"algorithm":"SHA256","hash":"32098cc56bcd9ff44bfa83b1015a3bc2bb7d2f8f7eecb3113929df732faa8176","blockSize":4194304,"blocks":["32098cc56bcd9ff44bfa83b1015a3bc2bb7d2f8f7eecb3113929df732faa8176"]}},"limitLength.ts":{"size":1025,"offset":"10146313","integrity":{"algorithm":"SHA256","hash":"72afbaaa2718abe23156d8bb4af09fdc98a12054fe3c559b82e22718dbedb7de","blockSize":4194304,"blocks":["72afbaaa2718abe23156d8bb4af09fdc98a12054fe3c559b82e22718dbedb7de"]}},"limitNumber.ts":{"size":1350,"offset":"10147338","integrity":{"algorithm":"SHA256","hash":"61bedba4a12924a84924b096f3b401356805cc24593f4b800bab4ad05be06298","blockSize":4194304,"blocks":["61bedba4a12924a84924b096f3b401356805cc24593f4b800bab4ad05be06298"]}},"limitProperties.ts":{"size":851,"offset":"10148688","integrity":{"algorithm":"SHA256","hash":"d55088c19cd829be5ff23dc7bb98dde9bb0bc9fb3baa2a4a141797044a668048","blockSize":4194304,"blocks":["d55088c19cd829be5ff23dc7bb98dde9bb0bc9fb3baa2a4a141797044a668048"]}},"multipleOf.ts":{"size":1072,"offset":"10149539","integrity":{"algorithm":"SHA256","hash":"5130cb4147d60dbec590b1e153f0f69b3c7ab552da9dd12eb2e1c22ca36daf7c","blockSize":4194304,"blocks":["5130cb4147d60dbec590b1e153f0f69b3c7ab552da9dd12eb2e1c22ca36daf7c"]}},"pattern.ts":{"size":961,"offset":"10150611","integrity":{"algorithm":"SHA256","hash":"9bdea618249c43667c80c253f28ff36f97ddf02bdda63f8897f7764014c3b314","blockSize":4194304,"blocks":["9bdea618249c43667c80c253f28ff36f97ddf02bdda63f8897f7764014c3b314"]}},"required.ts":{"size":2961,"offset":"10151572","integrity":{"algorithm":"SHA256","hash":"73f26a08d78ace7a164eca526843086bfbb986799d9a7ecc02fb67a87d2456aa","blockSize":4194304,"blocks":["73f26a08d78ace7a164eca526843086bfbb986799d9a7ecc02fb67a87d2456aa"]}},"uniqueItems.ts":{"size":2690,"offset":"10154533","integrity":{"algorithm":"SHA256","hash":"9d978fd6b3dc81c07c60f5067253490b54962571a4b510e18f4e257508809ee0","blockSize":4194304,"blocks":["9d978fd6b3dc81c07c60f5067253490b54962571a4b510e18f4e257508809ee0"]}}}}}}}},"LICENSE":{"size":1090,"offset":"10157223","integrity":{"algorithm":"SHA256","hash":"a05350a88e318e4f5f2c2a1ff1e2e88daa4dd38e6e78b71cccae422bdc762cc3","blockSize":4194304,"blocks":["a05350a88e318e4f5f2c2a1ff1e2e88daa4dd38e6e78b71cccae422bdc762cc3"]}},"package.json":{"size":4457,"offset":"10158313","integrity":{"algorithm":"SHA256","hash":"ce1539e6f4e0f345ed402c47137d2679497b2035d4a4f420ee11acdde03dea92","blockSize":4194304,"blocks":["ce1539e6f4e0f345ed402c47137d2679497b2035d4a4f420ee11acdde03dea92"]}},"README.md":{"size":13781,"offset":"10162770","integrity":{"algorithm":"SHA256","hash":"57d9f5c9d12d019ee1c42fcd7be6a1c5b2944608b011714146ecdd20972374ed","blockSize":4194304,"blocks":["57d9f5c9d12d019ee1c42fcd7be6a1c5b2944608b011714146ecdd20972374ed"]}}}},"ajv-formats":{"files":{"dist":{"files":{"formats.d.ts":{"size":643,"offset":"9093436","integrity":{"algorithm":"SHA256","hash":"18992725cbd51b0846132ec46237bc7de4da1db440deb66a6242e2de8715dcfb","blockSize":4194304,"blocks":["18992725cbd51b0846132ec46237bc7de4da1db440deb66a6242e2de8715dcfb"]}},"formats.js":{"size":10870,"offset":"9094079","integrity":{"algorithm":"SHA256","hash":"0970043fe6605b30a696562ff8f1ff621eff5f1250f961a92668db8ad9d0cf8c","blockSize":4194304,"blocks":["0970043fe6605b30a696562ff8f1ff621eff5f1250f961a92668db8ad9d0cf8c"]}},"formats.js.map":{"size":5586,"offset":"9104949","integrity":{"algorithm":"SHA256","hash":"166778cb8feec069034babf6e20700d9c92220d04d70b9d2f90cce95de7fae24","blockSize":4194304,"blocks":["166778cb8feec069034babf6e20700d9c92220d04d70b9d2f90cce95de7fae24"]}},"index.d.ts":{"size":580,"offset":"9110535","integrity":{"algorithm":"SHA256","hash":"19ab78c1376c16e18c5b87dfa750813c935f0c4ce1d6ef88058ec38f9cf5ef08","blockSize":4194304,"blocks":["19ab78c1376c16e18c5b87dfa750813c935f0c4ce1d6ef88058ec38f9cf5ef08"]}},"index.js":{"size":1498,"offset":"9111115","integrity":{"algorithm":"SHA256","hash":"25ae29038da0fd1021a623de0db504f2eff2d2e1fed832f3a41b795833182dde","blockSize":4194304,"blocks":["25ae29038da0fd1021a623de0db504f2eff2d2e1fed832f3a41b795833182dde"]}},"index.js.map":{"size":1524,"offset":"9112613","integrity":{"algorithm":"SHA256","hash":"aaec578d5a2af589e3d726a6383198fa7b116b4e6c41900f4e5fb285bc9f6a67","blockSize":4194304,"blocks":["aaec578d5a2af589e3d726a6383198fa7b116b4e6c41900f4e5fb285bc9f6a67"]}},"limit.d.ts":{"size":492,"offset":"9114137","integrity":{"algorithm":"SHA256","hash":"44f29187cfbc7aa4a6109204c8e5186509abc3b78874a2ee1498c51ab50f0f62","blockSize":4194304,"blocks":["44f29187cfbc7aa4a6109204c8e5186509abc3b78874a2ee1498c51ab50f0f62"]}},"limit.js":{"size":2850,"offset":"9114629","integrity":{"algorithm":"SHA256","hash":"8ed43a480952d8aa1afa2da3c41450cadf9a39995be7c4e0e54cd75a9c373944","blockSize":4194304,"blocks":["8ed43a480952d8aa1afa2da3c41450cadf9a39995be7c4e0e54cd75a9c373944"]}},"limit.js.map":{"size":2818,"offset":"9117479","integrity":{"algorithm":"SHA256","hash":"80835360b0867a81d4761783a4aec70825d658474e57dbd2a740c05d7b607bba","blockSize":4194304,"blocks":["80835360b0867a81d4761783a4aec70825d658474e57dbd2a740c05d7b607bba"]}}}},"LICENSE":{"size":1074,"offset":"9120297","integrity":{"algorithm":"SHA256","hash":"9df3bb69929a3b650ed73b3bfa1756725aaff0ac296461605753547004eafeaf","blockSize":4194304,"blocks":["9df3bb69929a3b650ed73b3bfa1756725aaff0ac296461605753547004eafeaf"]}},"package.json":{"size":1897,"offset":"9121371","integrity":{"algorithm":"SHA256","hash":"dab973bf13d8248fc5f6b2b0b7b3e87fd1dc92a71abdc559fbcbb5c29ed48e63","blockSize":4194304,"blocks":["dab973bf13d8248fc5f6b2b0b7b3e87fd1dc92a71abdc559fbcbb5c29ed48e63"]}},"README.md":{"size":6052,"offset":"9123268","integrity":{"algorithm":"SHA256","hash":"94a341854ce2561e7484f927c65d4da699be47097964e97cfb044d8516b856a8","blockSize":4194304,"blocks":["94a341854ce2561e7484f927c65d4da699be47097964e97cfb044d8516b856a8"]}},"src":{"files":{"formats.ts":{"size":11476,"offset":"9129320","integrity":{"algorithm":"SHA256","hash":"01c1c1aa3feec9f4555e46609aade1763bf1d95083ae752b7d0b3dfe7f19d8d7","blockSize":4194304,"blocks":["01c1c1aa3feec9f4555e46609aade1763bf1d95083ae752b7d0b3dfe7f19d8d7"]}},"index.ts":{"size":1793,"offset":"9140796","integrity":{"algorithm":"SHA256","hash":"fb330a47ec7d2c8498d03078834603dab1a0689f40ca15875e6d57d740c5ff71","blockSize":4194304,"blocks":["fb330a47ec7d2c8498d03078834603dab1a0689f40ca15875e6d57d740c5ff71"]}},"limit.ts":{"size":3074,"offset":"9142589","integrity":{"algorithm":"SHA256","hash":"62402e4fcb3bd9a0f4a22d2b228f1371897d47982e67ecd62950fdadb46261e6","blockSize":4194304,"blocks":["62402e4fcb3bd9a0f4a22d2b228f1371897d47982e67ecd62950fdadb46261e6"]}}}}}},"atomically":{"files":{".editorconfig":{"size":189,"offset":"10176551","integrity":{"algorithm":"SHA256","hash":"42a82ef9e641f12b19ae3919e6fe8ef14f9c4c3b4185df730a82d04300b4620e","blockSize":4194304,"blocks":["42a82ef9e641f12b19ae3919e6fe8ef14f9c4c3b4185df730a82d04300b4620e"]}},".nvmrc":{"size":9,"offset":"10176740","integrity":{"algorithm":"SHA256","hash":"890a9ba685b9cb0ecf37267be4c5b5f76a404598d26897d9b0ab9b95c3fc308b","blockSize":4194304,"blocks":["890a9ba685b9cb0ecf37267be4c5b5f76a404598d26897d9b0ab9b95c3fc308b"]}},"dist":{"files":{"consts.d.ts":{"size":715,"offset":"10176749","integrity":{"algorithm":"SHA256","hash":"b5ff598387cd8905efac36df1782a788c1a6055a9550c991a7ff66232c4e6aff","blockSize":4194304,"blocks":["b5ff598387cd8905efac36df1782a788c1a6055a9550c991a7ff66232c4e6aff"]}},"consts.js":{"size":1572,"offset":"10177464","integrity":{"algorithm":"SHA256","hash":"feb31cc92d3c258df9008e9584d74362e661cac42ad6abb4cc305ff2d7432337","blockSize":4194304,"blocks":["feb31cc92d3c258df9008e9584d74362e661cac42ad6abb4cc305ff2d7432337"]}},"index.d.ts":{"size":822,"offset":"10179036","integrity":{"algorithm":"SHA256","hash":"08f9c96b682fd0cc595da2842a95a81c44bb4882b853e34aa1ccf75a3aa198ab","blockSize":4194304,"blocks":["08f9c96b682fd0cc595da2842a95a81c44bb4882b853e34aa1ccf75a3aa198ab"]}},"index.js":{"size":7780,"offset":"10179858","integrity":{"algorithm":"SHA256","hash":"95c30ea2977ce45e25f8b42ae64b58f8c90543cbd9763c828f6170e554ff680a","blockSize":4194304,"blocks":["95c30ea2977ce45e25f8b42ae64b58f8c90543cbd9763c828f6170e554ff680a"]}},"types.d.ts":{"size":960,"offset":"10187638","integrity":{"algorithm":"SHA256","hash":"0bb4ed4c74f61071d39792996a8968dedb837168b8d9017f84ab79fb84ae61fe","blockSize":4194304,"blocks":["0bb4ed4c74f61071d39792996a8968dedb837168b8d9017f84ab79fb84ae61fe"]}},"types.js":{"size":89,"offset":"10188598","integrity":{"algorithm":"SHA256","hash":"b4435decae0d0ea87851e7cdd3139043de0246a78302b6f355e5b059b50e6553","blockSize":4194304,"blocks":["b4435decae0d0ea87851e7cdd3139043de0246a78302b6f355e5b059b50e6553"]}},"utils":{"files":{"attemptify.d.ts":{"size":281,"offset":"10188687","integrity":{"algorithm":"SHA256","hash":"62da9b78344611492df4c74937b57cf84cd7dcb4bc164ba33df68afd9f1d2bbe","blockSize":4194304,"blocks":["62da9b78344611492df4c74937b57cf84cd7dcb4bc164ba33df68afd9f1d2bbe"]}},"attemptify.js":{"size":788,"offset":"10188968","integrity":{"algorithm":"SHA256","hash":"f570e6c261b2c413992073e48023163b21afb5f4cf1ad7ee2d230566595ddf82","blockSize":4194304,"blocks":["f570e6c261b2c413992073e48023163b21afb5f4cf1ad7ee2d230566595ddf82"]}},"fs_handlers.d.ts":{"size":244,"offset":"10189756","integrity":{"algorithm":"SHA256","hash":"d994f68b8085f45a421d98080a27630471db3e2b35d86986ff1b7f783b0f76c7","blockSize":4194304,"blocks":["d994f68b8085f45a421d98080a27630471db3e2b35d86986ff1b7f783b0f76c7"]}},"fs_handlers.js":{"size":865,"offset":"10190000","integrity":{"algorithm":"SHA256","hash":"b7cb366f755bb3297cf90797a6b0db7a1c7c0e23f2350eb09cffb16eecab16d9","blockSize":4194304,"blocks":["b7cb366f755bb3297cf90797a6b0db7a1c7c0e23f2350eb09cffb16eecab16d9"]}},"fs.d.ts":{"size":1890,"offset":"10190865","integrity":{"algorithm":"SHA256","hash":"ce2c541f8c1340ec484baec3e00b4febed08461a31bc7cb8fe2635a3e5664c2e","blockSize":4194304,"blocks":["ce2c541f8c1340ec484baec3e00b4febed08461a31bc7cb8fe2635a3e5664c2e"]}},"fs.js":{"size":3037,"offset":"10192755","integrity":{"algorithm":"SHA256","hash":"b15a3ea242de95a06402dd37172412553e481c67f7cd9bbaf4f8a3edeaca52e6","blockSize":4194304,"blocks":["b15a3ea242de95a06402dd37172412553e481c67f7cd9bbaf4f8a3edeaca52e6"]}},"lang.d.ts":{"size":173,"offset":"10195792","integrity":{"algorithm":"SHA256","hash":"63a7a77fd2925bb7421c56db1a4aca214527271a794a4f999274bcd25df02b8d","blockSize":4194304,"blocks":["63a7a77fd2925bb7421c56db1a4aca214527271a794a4f999274bcd25df02b8d"]}},"lang.js":{"size":356,"offset":"10195965","integrity":{"algorithm":"SHA256","hash":"e84c44f703058eca395c41920501b3c450de15d687e1b509716fcda3e029d822","blockSize":4194304,"blocks":["e84c44f703058eca395c41920501b3c450de15d687e1b509716fcda3e029d822"]}},"retryify_queue.d.ts":{"size":418,"offset":"10196321","integrity":{"algorithm":"SHA256","hash":"6a4eb31accd5e9bd087c8ce2f2bbb80b70f06cc1b33be28781dc466a6581c7db","blockSize":4194304,"blocks":["6a4eb31accd5e9bd087c8ce2f2bbb80b70f06cc1b33be28781dc466a6581c7db"]}},"retryify_queue.js":{"size":1836,"offset":"10196739","integrity":{"algorithm":"SHA256","hash":"9b6e5ad524ac9f29d9fab8fe740b660caebf54f0da7554541c8edb4c74710951","blockSize":4194304,"blocks":["9b6e5ad524ac9f29d9fab8fe740b660caebf54f0da7554541c8edb4c74710951"]}},"retryify.d.ts":{"size":349,"offset":"10198575","integrity":{"algorithm":"SHA256","hash":"3c1e81916008152588c0818db54681801f2fa55706e9993e5ddcdc342008d1c7","blockSize":4194304,"blocks":["3c1e81916008152588c0818db54681801f2fa55706e9993e5ddcdc342008d1c7"]}},"retryify.js":{"size":1653,"offset":"10198924","integrity":{"algorithm":"SHA256","hash":"2bd96d6f5af98a990f6774f28a943a2126d98df3bd66e25eb5bc546ac12b7338","blockSize":4194304,"blocks":["2bd96d6f5af98a990f6774f28a943a2126d98df3bd66e25eb5bc546ac12b7338"]}},"scheduler.d.ts":{"size":174,"offset":"10200577","integrity":{"algorithm":"SHA256","hash":"9f4d501d3ae7677a56d5e23566c2efe75f0b5af94b7067052a570dca5a8586b6","blockSize":4194304,"blocks":["9f4d501d3ae7677a56d5e23566c2efe75f0b5af94b7067052a570dca5a8586b6"]}},"scheduler.js":{"size":860,"offset":"10200751","integrity":{"algorithm":"SHA256","hash":"f32626546190ecb8dd54cdf66ccf6a82f17b23efb8d287ed656e189086b34de6","blockSize":4194304,"blocks":["f32626546190ecb8dd54cdf66ccf6a82f17b23efb8d287ed656e189086b34de6"]}},"temp.d.ts":{"size":424,"offset":"10201611","integrity":{"algorithm":"SHA256","hash":"2cae9d467cd5de2a9f804b63dd3720767621a41bf2c0e803a0cf3c074ffd2003","blockSize":4194304,"blocks":["2cae9d467cd5de2a9f804b63dd3720767621a41bf2c0e803a0cf3c074ffd2003"]}},"temp.js":{"size":2458,"offset":"10202035","integrity":{"algorithm":"SHA256","hash":"f4dad31de0b8d678dacbf7b6ee0f182575dc6555871a42a3a73506f9c37090b5","blockSize":4194304,"blocks":["f4dad31de0b8d678dacbf7b6ee0f182575dc6555871a42a3a73506f9c37090b5"]}}}}}},"LICENSE":{"size":1091,"offset":"10204493","integrity":{"algorithm":"SHA256","hash":"716bd9213ef82d9017ed813688703837aaa99fc56de205a7b97475d40056a500","blockSize":4194304,"blocks":["716bd9213ef82d9017ed813688703837aaa99fc56de205a7b97475d40056a500"]}},"package.json":{"size":1322,"offset":"10205584","integrity":{"algorithm":"SHA256","hash":"6b62f6dae967b0926c57559b4bab73016d22427413edc992f31a1420d92d10e5","blockSize":4194304,"blocks":["6b62f6dae967b0926c57559b4bab73016d22427413edc992f31a1420d92d10e5"]}},"README.md":{"size":8539,"offset":"10206906","integrity":{"algorithm":"SHA256","hash":"8908888894cb0abf6589618019f38ce8196e2399030c73a772fe60f31441af91","blockSize":4194304,"blocks":["8908888894cb0abf6589618019f38ce8196e2399030c73a772fe60f31441af91"]}},"src":{"files":{"consts.ts":{"size":856,"offset":"10215445","integrity":{"algorithm":"SHA256","hash":"f498bdb1bc9c896023263b55f186acb6cc6126aa4e5f0607cf5b6333425297e8","blockSize":4194304,"blocks":["f498bdb1bc9c896023263b55f186acb6cc6126aa4e5f0607cf5b6333425297e8"]}},"index.ts":{"size":7267,"offset":"10216301","integrity":{"algorithm":"SHA256","hash":"36c448bdc9880cf8c0ee392d40f8115aa96e1503fb18aba6c2d3b48f7f3386fa","blockSize":4194304,"blocks":["36c448bdc9880cf8c0ee392d40f8115aa96e1503fb18aba6c2d3b48f7f3386fa"]}},"types.ts":{"size":860,"offset":"10223568","integrity":{"algorithm":"SHA256","hash":"bfc9769ba84d2652939c183db17be1161e0b529773c1191c64b935d73e6fce83","blockSize":4194304,"blocks":["bfc9769ba84d2652939c183db17be1161e0b529773c1191c64b935d73e6fce83"]}},"utils":{"files":{"attemptify.ts":{"size":718,"offset":"10224428","integrity":{"algorithm":"SHA256","hash":"12c5cf67f4b8b370d186692ba1a8db7bf3bbceafd4701f3dc6bf3bc6d21765b2","blockSize":4194304,"blocks":["12c5cf67f4b8b370d186692ba1a8db7bf3bbceafd4701f3dc6bf3bc6d21765b2"]}},"fs_handlers.ts":{"size":896,"offset":"10225146","integrity":{"algorithm":"SHA256","hash":"c21cfc9b2f8399f1b907cb616e96d9ab67945976a53c143240ba083b4a6afab4","blockSize":4194304,"blocks":["c21cfc9b2f8399f1b907cb616e96d9ab67945976a53c143240ba083b4a6afab4"]}},"fs.ts":{"size":2374,"offset":"10226042","integrity":{"algorithm":"SHA256","hash":"1b8572451d5aa1dd0edb3b2053893097f4013c7a849366c47b52d6a9fe174b19","blockSize":4194304,"blocks":["1b8572451d5aa1dd0edb3b2053893097f4013c7a849366c47b52d6a9fe174b19"]}},"lang.ts":{"size":331,"offset":"10228416","integrity":{"algorithm":"SHA256","hash":"2e48eb2ab29cc4322a9705bd044cd95cdea462b162a010001a299bf793b799d9","blockSize":4194304,"blocks":["2e48eb2ab29cc4322a9705bd044cd95cdea462b162a010001a299bf793b799d9"]}},"retryify_queue.ts":{"size":1752,"offset":"10228747","integrity":{"algorithm":"SHA256","hash":"08a6494e551620918c9025946503ad62aed236065d3489cc1cccfcfb11907681","blockSize":4194304,"blocks":["08a6494e551620918c9025946503ad62aed236065d3489cc1cccfcfb11907681"]}},"retryify.ts":{"size":1515,"offset":"10230499","integrity":{"algorithm":"SHA256","hash":"5752dea4d9e9fd1d55bcc5197997dbda25e46bff94a67da1e3cf2d5a7d32f00e","blockSize":4194304,"blocks":["5752dea4d9e9fd1d55bcc5197997dbda25e46bff94a67da1e3cf2d5a7d32f00e"]}},"scheduler.ts":{"size":818,"offset":"10232014","integrity":{"algorithm":"SHA256","hash":"09ba274d361ae2924a87f38c0fe8879b1a3fe310e036118b4975520d28588606","blockSize":4194304,"blocks":["09ba274d361ae2924a87f38c0fe8879b1a3fe310e036118b4975520d28588606"]}},"temp.ts":{"size":2711,"offset":"10232832","integrity":{"algorithm":"SHA256","hash":"cc5627b41c491382129794303a218536417f3bbb7e9f143778e55e2f6d84cd0d","blockSize":4194304,"blocks":["cc5627b41c491382129794303a218536417f3bbb7e9f143778e55e2f6d84cd0d"]}}}}}},"tasks":{"files":{"benchmark.js":{"size":2747,"offset":"10235543","integrity":{"algorithm":"SHA256","hash":"988ecbd8462edfc5867759fc55613c0d90462d43b54078b13124b0301be040ce","blockSize":4194304,"blocks":["988ecbd8462edfc5867759fc55613c0d90462d43b54078b13124b0301be040ce"]}}}},"test":{"files":{"basic.js":{"size":18318,"offset":"10238290","integrity":{"algorithm":"SHA256","hash":"e231cd79b5b915fb40aa3b2e025dbd038e20c2ade38befb424fc2b8185ada815","blockSize":4194304,"blocks":["e231cd79b5b915fb40aa3b2e025dbd038e20c2ade38befb424fc2b8185ada815"]}},"concurrency.js":{"size":4429,"offset":"10256608","integrity":{"algorithm":"SHA256","hash":"c7f21b4bf4b888e09667ba57acb1cf2a479063f8f333ab1cd1b203f0c40d52db","blockSize":4194304,"blocks":["c7f21b4bf4b888e09667ba57acb1cf2a479063f8f333ab1cd1b203f0c40d52db"]}},"integration.js":{"size":8145,"offset":"10261037","integrity":{"algorithm":"SHA256","hash":"007711314b99ee02bae3c8b0aef3205e1dbf7535fa0c60bbc64e73b7362f878a","blockSize":4194304,"blocks":["007711314b99ee02bae3c8b0aef3205e1dbf7535fa0c60bbc64e73b7362f878a"]}}}},"tsconfig.json":{"size":687,"offset":"10269182","integrity":{"algorithm":"SHA256","hash":"be665bb12b0c8433412ccc07afdcffbb5cd4b5770a028ff39067cb177c4f85d0","blockSize":4194304,"blocks":["be665bb12b0c8433412ccc07afdcffbb5cd4b5770a028ff39067cb177c4f85d0"]}}}},"conf":{"files":{"dist":{"files":{"source":{"files":{"index.d.ts":{"size":3462,"offset":"10269869","integrity":{"algorithm":"SHA256","hash":"aad617b9fdbe2511653b914d301cd1d652c7a3127909a19be0bf0fe01cc44fba","blockSize":4194304,"blocks":["aad617b9fdbe2511653b914d301cd1d652c7a3127909a19be0bf0fe01cc44fba"]}},"index.js":{"size":20779,"offset":"10273331","integrity":{"algorithm":"SHA256","hash":"bb9f43d6800ae8a54239dffdb4d8bf9532a3620454d2195762e91daf4303e586","blockSize":4194304,"blocks":["bb9f43d6800ae8a54239dffdb4d8bf9532a3620454d2195762e91daf4303e586"]}},"types.d.ts":{"size":9466,"offset":"10294110","integrity":{"algorithm":"SHA256","hash":"1fcc61c95dc7d29e20e1b811a095b61f458cc24637635002337afe65071768d1","blockSize":4194304,"blocks":["1fcc61c95dc7d29e20e1b811a095b61f458cc24637635002337afe65071768d1"]}},"types.js":{"size":77,"offset":"10303576","integrity":{"algorithm":"SHA256","hash":"d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230","blockSize":4194304,"blocks":["d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230"]}}}}}},"license":{"size":1117,"offset":"10303653","integrity":{"algorithm":"SHA256","hash":"5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3","blockSize":4194304,"blocks":["5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3"]}},"package.json":{"size":1831,"offset":"10304770","integrity":{"algorithm":"SHA256","hash":"fa2205e5ada480ebab68cc652800a8e1857780d629874a18c8c1bb1fb0f1b9a2","blockSize":4194304,"blocks":["fa2205e5ada480ebab68cc652800a8e1857780d629874a18c8c1bb1fb0f1b9a2"]}},"readme.md":{"size":13240,"offset":"10306601","integrity":{"algorithm":"SHA256","hash":"f1398e85b1c1c2924c5ec4a153e685aba6781ff51f0f9f6f462b191b63779c91","blockSize":4194304,"blocks":["f1398e85b1c1c2924c5ec4a153e685aba6781ff51f0f9f6f462b191b63779c91"]}}}},"cookie":{"files":{"HISTORY.md":{"size":2922,"offset":"10319841","integrity":{"algorithm":"SHA256","hash":"45225432098ef8410f1d157ecd14394c514c87cecd8a53784af7f1a3146a8ca3","blockSize":4194304,"blocks":["45225432098ef8410f1d157ecd14394c514c87cecd8a53784af7f1a3146a8ca3"]}},"index.js":{"size":4047,"offset":"10322763","integrity":{"algorithm":"SHA256","hash":"4776494df4702b47ce2f562e25d7e9c948733ac3245dc46199fe492ea9385e04","blockSize":4194304,"blocks":["4776494df4702b47ce2f562e25d7e9c948733ac3245dc46199fe492ea9385e04"]}},"LICENSE":{"size":1175,"offset":"10326810","integrity":{"algorithm":"SHA256","hash":"c02110eedc16c7114f1a9bdc026c65626ce1d9c7e27fd51a8e0feee8a48a6858","blockSize":4194304,"blocks":["c02110eedc16c7114f1a9bdc026c65626ce1d9c7e27fd51a8e0feee8a48a6858"]}},"package.json":{"size":1104,"offset":"10327985","integrity":{"algorithm":"SHA256","hash":"07269baaaad9a16ef8a4666d69cdd387891658eaf31af3026abd8b9e3fefc9c9","blockSize":4194304,"blocks":["07269baaaad9a16ef8a4666d69cdd387891658eaf31af3026abd8b9e3fefc9c9"]}},"README.md":{"size":10473,"offset":"10329089","integrity":{"algorithm":"SHA256","hash":"d90a0d47e6d29b14950e8b7d9abebb85c76f16e744b149a4c5f7147bff47247d","blockSize":4194304,"blocks":["d90a0d47e6d29b14950e8b7d9abebb85c76f16e744b149a4c5f7147bff47247d"]}}}},"debounce-fn":{"files":{"index.d.ts":{"size":2092,"offset":"10339562","integrity":{"algorithm":"SHA256","hash":"5402ff170b45fedb5234ccffd91d1c1d5e8bd21cfa03791eab49b889c014ba81","blockSize":4194304,"blocks":["5402ff170b45fedb5234ccffd91d1c1d5e8bd21cfa03791eab49b889c014ba81"]}},"index.js":{"size":1080,"offset":"10341654","integrity":{"algorithm":"SHA256","hash":"c9b8c0476e48445718d35a34c18dae9eb7b07f63e84cb827f4eeb26c13508ea6","blockSize":4194304,"blocks":["c9b8c0476e48445718d35a34c18dae9eb7b07f63e84cb827f4eeb26c13508ea6"]}},"license":{"size":1117,"offset":"10342734","integrity":{"algorithm":"SHA256","hash":"5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3","blockSize":4194304,"blocks":["5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3"]}},"node_modules":{"files":{"mimic-fn":{"files":{"index.d.ts":{"size":1359,"offset":"10343851","integrity":{"algorithm":"SHA256","hash":"7814b6eded71b2b9d196eb473b18b79946d80e5eddfba2b5715df2164cb87da2","blockSize":4194304,"blocks":["7814b6eded71b2b9d196eb473b18b79946d80e5eddfba2b5715df2164cb87da2"]}},"index.js":{"size":2930,"offset":"10345210","integrity":{"algorithm":"SHA256","hash":"d4a832347a07a4df9b32a010fc5ffb1c4447c51769423cd5a3a47da0213fe5c0","blockSize":4194304,"blocks":["d4a832347a07a4df9b32a010fc5ffb1c4447c51769423cd5a3a47da0213fe5c0"]}},"license":{"size":1109,"offset":"10348140","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":641,"offset":"10349249","integrity":{"algorithm":"SHA256","hash":"71fa24afc41e43246126eaef9f0c4dd7a94047e8a67456d02c9b56924dbf0969","blockSize":4194304,"blocks":["71fa24afc41e43246126eaef9f0c4dd7a94047e8a67456d02c9b56924dbf0969"]}},"readme.md":{"size":2205,"offset":"10349890","integrity":{"algorithm":"SHA256","hash":"34bd638efee6163692ed1b27e47a1783488f6e20dbfa88e6546431723191952d","blockSize":4194304,"blocks":["34bd638efee6163692ed1b27e47a1783488f6e20dbfa88e6546431723191952d"]}}}}}},"package.json":{"size":716,"offset":"10352095","integrity":{"algorithm":"SHA256","hash":"6e0812316bd0c2f48a279327d4846aee74b9ebab3c816ab348b17dd5cc3dff8c","blockSize":4194304,"blocks":["6e0812316bd0c2f48a279327d4846aee74b9ebab3c816ab348b17dd5cc3dff8c"]}},"readme.md":{"size":1362,"offset":"10352811","integrity":{"algorithm":"SHA256","hash":"583cc7808e3ee85aca69e581bf6573f6528b9eae80001e224e21dc423a4fc5e7","blockSize":4194304,"blocks":["583cc7808e3ee85aca69e581bf6573f6528b9eae80001e224e21dc423a4fc5e7"]}}}},"debug":{"files":{"LICENSE":{"size":1139,"offset":"10354173","integrity":{"algorithm":"SHA256","hash":"3a61c6c96caf5c1d9b623fb9b04c822b783dfcb78aa7e49c76a3f643e6ed7f95","blockSize":4194304,"blocks":["3a61c6c96caf5c1d9b623fb9b04c822b783dfcb78aa7e49c76a3f643e6ed7f95"]}},"package.json":{"size":1455,"offset":"10355312","integrity":{"algorithm":"SHA256","hash":"7a60ed9b6b14aa67f2ffe975715aaa6a78303844a5b43d33bfd619812088fe4d","blockSize":4194304,"blocks":["7a60ed9b6b14aa67f2ffe975715aaa6a78303844a5b43d33bfd619812088fe4d"]}},"README.md":{"size":22115,"offset":"10356767","integrity":{"algorithm":"SHA256","hash":"486cb669048bd5014adf9ea117e27a45c4e61b0e668f464c724273beb8170797","blockSize":4194304,"blocks":["486cb669048bd5014adf9ea117e27a45c4e61b0e668f464c724273beb8170797"]}},"src":{"files":{"browser.js":{"size":6020,"offset":"10378882","integrity":{"algorithm":"SHA256","hash":"4afa722281f0817504bb7a9d060eea7e8ab2eae342611b525aff9b9204b9c9af","blockSize":4194304,"blocks":["4afa722281f0817504bb7a9d060eea7e8ab2eae342611b525aff9b9204b9c9af"]}},"common.js":{"size":6289,"offset":"10384902","integrity":{"algorithm":"SHA256","hash":"c65bff44c189188e0c45afdbd9b02c427ff5c6e54b94da53c102fbb7a53f0e37","blockSize":4194304,"blocks":["c65bff44c189188e0c45afdbd9b02c427ff5c6e54b94da53c102fbb7a53f0e37"]}},"index.js":{"size":314,"offset":"10391191","integrity":{"algorithm":"SHA256","hash":"aa127ff1752b7d9c7415c5c7bb6994d9aa722b81bcbcab4bd48316b013d23bf3","blockSize":4194304,"blocks":["aa127ff1752b7d9c7415c5c7bb6994d9aa722b81bcbcab4bd48316b013d23bf3"]}},"node.js":{"size":4728,"offset":"10391505","integrity":{"algorithm":"SHA256","hash":"d7b26d7c92f8ea7794b77ce11f3c11cd18c9084df7c357e3c7025344fa28aac6","blockSize":4194304,"blocks":["d7b26d7c92f8ea7794b77ce11f3c11cd18c9084df7c357e3c7025344fa28aac6"]}}}}}},"deepmerge":{"files":{".editorconfig":{"size":113,"offset":"10396233","integrity":{"algorithm":"SHA256","hash":"73cc38e40b41f1eea6fd2d98d0ade5324f1ad564c3f111ebd0040b4286d2c25c","blockSize":4194304,"blocks":["73cc38e40b41f1eea6fd2d98d0ade5324f1ad564c3f111ebd0040b4286d2c25c"]}},"changelog.md":{"size":9610,"offset":"10396346","integrity":{"algorithm":"SHA256","hash":"5769e5556b552718161e6d627f9e0c0858d111a9aaaeb117a2769cb58bd18d78","blockSize":4194304,"blocks":["5769e5556b552718161e6d627f9e0c0858d111a9aaaeb117a2769cb58bd18d78"]}},"dist":{"files":{"cjs.js":{"size":4048,"offset":"10405956","integrity":{"algorithm":"SHA256","hash":"2e5160f84a1141bd927264afe4d15766f1e6cf07daef182b37ff53fea121de7d","blockSize":4194304,"blocks":["2e5160f84a1141bd927264afe4d15766f1e6cf07daef182b37ff53fea121de7d"]}},"umd.js":{"size":4420,"offset":"10410004","integrity":{"algorithm":"SHA256","hash":"f33e6596482d1fb5c7c427f8ef92f2aa849eea9223acd974176b2fb27ddbf73a","blockSize":4194304,"blocks":["f33e6596482d1fb5c7c427f8ef92f2aa849eea9223acd974176b2fb27ddbf73a"]}}}},"index.d.ts":{"size":652,"offset":"10414424","integrity":{"algorithm":"SHA256","hash":"f163b1edf76fbde01836f8522fbe646fe2f55e313bb7fdd363891748f9b57c60","blockSize":4194304,"blocks":["f163b1edf76fbde01836f8522fbe646fe2f55e313bb7fdd363891748f9b57c60"]}},"index.js":{"size":3293,"offset":"10415076","integrity":{"algorithm":"SHA256","hash":"12440c84957c1990ea2d5e33dc0091722dc1dc1585c6d20e0c780e568ffa9d30","blockSize":4194304,"blocks":["12440c84957c1990ea2d5e33dc0091722dc1dc1585c6d20e0c780e568ffa9d30"]}},"license.txt":{"size":1116,"offset":"10418369","integrity":{"algorithm":"SHA256","hash":"6cfc4687cb2f2d86f4a77e6b526290d3878e5e512f3fec2f4cb36a9cb36f798b","blockSize":4194304,"blocks":["6cfc4687cb2f2d86f4a77e6b526290d3878e5e512f3fec2f4cb36a9cb36f798b"]}},"package.json":{"size":1174,"offset":"10419485","integrity":{"algorithm":"SHA256","hash":"72bdafebe979db29d8a4f36e8ce982b02fcf62797073a19ca71923189c594882","blockSize":4194304,"blocks":["72bdafebe979db29d8a4f36e8ce982b02fcf62797073a19ca71923189c594882"]}},"readme.md":{"size":5678,"offset":"10420659","integrity":{"algorithm":"SHA256","hash":"a751ecd2832809c66434a7fe81798bd50d92cf8d2b62d64a5dd42b8bda4ab1f6","blockSize":4194304,"blocks":["a751ecd2832809c66434a7fe81798bd50d92cf8d2b62d64a5dd42b8bda4ab1f6"]}},"rollup.config.js":{"size":343,"offset":"10426337","integrity":{"algorithm":"SHA256","hash":"abba48beb11daa282e69134e4928ec32737ae6f6d192dd5f00a6e660e032bb25","blockSize":4194304,"blocks":["abba48beb11daa282e69134e4928ec32737ae6f6d192dd5f00a6e660e032bb25"]}}}},"dot-prop":{"files":{"index.d.ts":{"size":2747,"offset":"10426680","integrity":{"algorithm":"SHA256","hash":"08dffaab04612b529713ca020f13b1d14bb34f1ae28d7a7fcf4d9d4e38de7d31","blockSize":4194304,"blocks":["08dffaab04612b529713ca020f13b1d14bb34f1ae28d7a7fcf4d9d4e38de7d31"]}},"index.js":{"size":2705,"offset":"10429427","integrity":{"algorithm":"SHA256","hash":"9f475c2dcec98af9a2b7fa5017f09e734808aa0c1c8c61ac38ad161764b47c65","blockSize":4194304,"blocks":["9f475c2dcec98af9a2b7fa5017f09e734808aa0c1c8c61ac38ad161764b47c65"]}},"license":{"size":1117,"offset":"10432132","integrity":{"algorithm":"SHA256","hash":"5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3","blockSize":4194304,"blocks":["5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3"]}},"package.json":{"size":896,"offset":"10433249","integrity":{"algorithm":"SHA256","hash":"277e0aee4f3623d350ee747a3025b4eeb9f1dd53215a5f0398ed8b69ab32498e","blockSize":4194304,"blocks":["277e0aee4f3623d350ee747a3025b4eeb9f1dd53215a5f0398ed8b69ab32498e"]}},"readme.md":{"size":2689,"offset":"10434145","integrity":{"algorithm":"SHA256","hash":"8f2fc1dfe2b68b8d3548be0ce7be7c093db08e69d3eed5b496e15fc1060f2850","blockSize":4194304,"blocks":["8f2fc1dfe2b68b8d3548be0ce7be7c093db08e69d3eed5b496e15fc1060f2850"]}}}},"electron-log":{"files":{"LICENSE":{"size":1082,"offset":"10436834","integrity":{"algorithm":"SHA256","hash":"8a7030a9df0eac3ba1948991278d847d3e4c8dc4908a777b5868692c975ccfa8","blockSize":4194304,"blocks":["8a7030a9df0eac3ba1948991278d847d3e4c8dc4908a777b5868692c975ccfa8"]}},"main.d.ts":{"size":117,"offset":"10437916","integrity":{"algorithm":"SHA256","hash":"52f0bd092c057d5e1bc0aa08775fb6a8237a4e8bff06e1395b78e8c97f168247","blockSize":4194304,"blocks":["52f0bd092c057d5e1bc0aa08775fb6a8237a4e8bff06e1395b78e8c97f168247"]}},"main.js":{"size":75,"offset":"10438033","integrity":{"algorithm":"SHA256","hash":"fae41b809b95f890613ddda64561cd0fa4b3cc1de2c5aa2df753b31b02123365","blockSize":4194304,"blocks":["fae41b809b95f890613ddda64561cd0fa4b3cc1de2c5aa2df753b31b02123365"]}},"node.d.ts":{"size":117,"offset":"10438108","integrity":{"algorithm":"SHA256","hash":"20014c0d215a5a5c800a784edfb5ee76667a8720b02fb73d57f53455d8fece9e","blockSize":4194304,"blocks":["20014c0d215a5a5c800a784edfb5ee76667a8720b02fb73d57f53455d8fece9e"]}},"node.js":{"size":75,"offset":"10438225","integrity":{"algorithm":"SHA256","hash":"3fdad739e0f2096fef0196a841d4a5fd7b84a355a1e07247fe0ada59e3215bed","blockSize":4194304,"blocks":["3fdad739e0f2096fef0196a841d4a5fd7b84a355a1e07247fe0ada59e3215bed"]}},"package.json":{"size":1650,"offset":"10438300","integrity":{"algorithm":"SHA256","hash":"088a06a821dca09da1e5c022f9cd9ede6d0dd3f6e4784e0c58a4891661b27cb5","blockSize":4194304,"blocks":["088a06a821dca09da1e5c022f9cd9ede6d0dd3f6e4784e0c58a4891661b27cb5"]}},"preload.js":{"size":106,"offset":"10439950","integrity":{"algorithm":"SHA256","hash":"cfbc921386f62a953a6aa967b047b6aae1a6fd2268ea02f6fea6da164da34d30","blockSize":4194304,"blocks":["cfbc921386f62a953a6aa967b047b6aae1a6fd2268ea02f6fea6da164da34d30"]}},"README.md":{"size":6582,"offset":"10440056","integrity":{"algorithm":"SHA256","hash":"7fde62ec128a4c020d17a388b3dfcc58b79b7ee1a24396eac3f970fd14535e44","blockSize":4194304,"blocks":["7fde62ec128a4c020d17a388b3dfcc58b79b7ee1a24396eac3f970fd14535e44"]}},"renderer.d.ts":{"size":129,"offset":"10446638","integrity":{"algorithm":"SHA256","hash":"77d3fb43ea897d5f54585e4dafc60f044475124a2aa49d869c3a1fe453918eb6","blockSize":4194304,"blocks":["77d3fb43ea897d5f54585e4dafc60f044475124a2aa49d869c3a1fe453918eb6"]}},"renderer.js":{"size":87,"offset":"10446767","integrity":{"algorithm":"SHA256","hash":"5a21e4441e3894b7e786482d3c7ea770874a307d4673ba180fa9a6591bbb8cfa","blockSize":4194304,"blocks":["5a21e4441e3894b7e786482d3c7ea770874a307d4673ba180fa9a6591bbb8cfa"]}},"src":{"files":{"__specs__":{"files":{"index.main.test.ts":{"size":436,"offset":"10446854","integrity":{"algorithm":"SHA256","hash":"c665d3ee48b0426e4ba93c88ab0570c5ffbc148404bd686f8b06c5295a4e5004","blockSize":4194304,"blocks":["c665d3ee48b0426e4ba93c88ab0570c5ffbc148404bd686f8b06c5295a4e5004"]}},"index.renderer.test.ts":{"size":207,"offset":"10447290","integrity":{"algorithm":"SHA256","hash":"39cab2e7045d4269a68070cca83f333a9c9bb2ae020d90001e3de71b8821e8ac","blockSize":4194304,"blocks":["39cab2e7045d4269a68070cca83f333a9c9bb2ae020d90001e3de71b8821e8ac"]}},"utils":{"files":{"fsHelpers.js":{"size":541,"offset":"10447497","integrity":{"algorithm":"SHA256","hash":"58a808d33eb260f37a5ce6d2c301598cdc7821eda92dd6db36ddfd75ca0a9f58","blockSize":4194304,"blocks":["58a808d33eb260f37a5ce6d2c301598cdc7821eda92dd6db36ddfd75ca0a9f58"]}},"TestLogReader.js":{"size":2499,"offset":"10448038","integrity":{"algorithm":"SHA256","hash":"bcaa66bf10bc4c354fb65ca592a3b391ba685a92e1f9a33ee279fe5510b1764f","blockSize":4194304,"blocks":["bcaa66bf10bc4c354fb65ca592a3b391ba685a92e1f9a33ee279fe5510b1764f"]}}}}}},"core":{"files":{"__specs":{"files":{"Logger.spec.js":{"size":2297,"offset":"10450537","integrity":{"algorithm":"SHA256","hash":"fb4c05b00f4348237e2aa3e8ec7c811ee1983afbe479ff106f1d1d19ac9fab01","blockSize":4194304,"blocks":["fb4c05b00f4348237e2aa3e8ec7c811ee1983afbe479ff106f1d1d19ac9fab01"]}},"scope.spec.js":{"size":1303,"offset":"10452834","integrity":{"algorithm":"SHA256","hash":"dbc4b96921a89c83b878eabff22333b81751a08d3a7da2a7c522e854fd9979b4","blockSize":4194304,"blocks":["dbc4b96921a89c83b878eabff22333b81751a08d3a7da2a7c522e854fd9979b4"]}}}},"Logger.js":{"size":5205,"offset":"10454137","integrity":{"algorithm":"SHA256","hash":"6e008f684ce4ba720f0f1d40eaecee0e16b7a3c155383caa661691cefd66257b","blockSize":4194304,"blocks":["6e008f684ce4ba720f0f1d40eaecee0e16b7a3c155383caa661691cefd66257b"]}},"scope.js":{"size":832,"offset":"10459342","integrity":{"algorithm":"SHA256","hash":"028c1926d99aec74546a3645e102546bc5bdcaaa7336efa996d2f6fa9f89edfd","blockSize":4194304,"blocks":["028c1926d99aec74546a3645e102546bc5bdcaaa7336efa996d2f6fa9f89edfd"]}}}},"index.d.ts":{"size":14171,"offset":"10460174","integrity":{"algorithm":"SHA256","hash":"a5c5462c364f6f8e66ddb4f662bc6e9dfc351602f97f200d96d42cda56aace53","blockSize":4194304,"blocks":["a5c5462c364f6f8e66ddb4f662bc6e9dfc351602f97f200d96d42cda56aace53"]}},"index.js":{"size":513,"offset":"10474345","integrity":{"algorithm":"SHA256","hash":"9554d4b13d8c2a36378d4853a8e1b28563f03fa3f610a692e755df04d64ba53f","blockSize":4194304,"blocks":["9554d4b13d8c2a36378d4853a8e1b28563f03fa3f610a692e755df04d64ba53f"]}},"main":{"files":{"__specs__":{"files":{"ElectronExternalApi.spec.js":{"size":1546,"offset":"10474858","integrity":{"algorithm":"SHA256","hash":"42a69741b23e1e9a347c5a3ecd484d1c4cd196dca4c208cb5767f15c7377a49c","blockSize":4194304,"blocks":["42a69741b23e1e9a347c5a3ecd484d1c4cd196dca4c208cb5767f15c7377a49c"]}},"index.spec.js":{"size":1081,"offset":"10476404","integrity":{"algorithm":"SHA256","hash":"aa0f7e6e691d6205b67aeed0cd7504b142ba52206c1c4af3326ff93cd52e07f5","blockSize":4194304,"blocks":["aa0f7e6e691d6205b67aeed0cd7504b142ba52206c1c4af3326ff93cd52e07f5"]}}}},"ElectronExternalApi.js":{"size":4369,"offset":"10477485","integrity":{"algorithm":"SHA256","hash":"4487024eecf2b69859a8159097062d5ee8aa8fb2d3385e526a3e84dff28f91e0","blockSize":4194304,"blocks":["4487024eecf2b69859a8159097062d5ee8aa8fb2d3385e526a3e84dff28f91e0"]}},"index.js":{"size":1204,"offset":"10481854","integrity":{"algorithm":"SHA256","hash":"9232a0dd58735cf11489fb21b35506619faf723b7cb3a1bf699ee0965a929325","blockSize":4194304,"blocks":["9232a0dd58735cf11489fb21b35506619faf723b7cb3a1bf699ee0965a929325"]}},"initialize.js":{"size":2026,"offset":"10483058","integrity":{"algorithm":"SHA256","hash":"e670a46a592a916c95d9e393a8acb2b043e2004bc658f19d5243ea03e09f54aa","blockSize":4194304,"blocks":["e670a46a592a916c95d9e393a8acb2b043e2004bc658f19d5243ea03e09f54aa"]}}}},"node":{"files":{"__specs__":{"files":{"ErrorHandler.spec.js":{"size":1144,"offset":"10485084","integrity":{"algorithm":"SHA256","hash":"f0a3c3490607cec64c9aafe0cb0e271f8c992825e0f26b4dfa74a94b6bb94e38","blockSize":4194304,"blocks":["f0a3c3490607cec64c9aafe0cb0e271f8c992825e0f26b4dfa74a94b6bb94e38"]}},"index.spec.js":{"size":1081,"offset":"10486228","integrity":{"algorithm":"SHA256","hash":"1098fc5aa9ed2f2df2bcced486d99c91303b9352dc2f08a6a583ee844525d06e","blockSize":4194304,"blocks":["1098fc5aa9ed2f2df2bcced486d99c91303b9352dc2f08a6a583ee844525d06e"]}},"NodeExternalApi.spec.js":{"size":3015,"offset":"10487309","integrity":{"algorithm":"SHA256","hash":"39e7046247ae1f746167198ae30282898814baa7dc0f9f9d9b3af545143f35d8","blockSize":4194304,"blocks":["39e7046247ae1f746167198ae30282898814baa7dc0f9f9d9b3af545143f35d8"]}},"packageJson.spec.js":{"size":798,"offset":"10490324","integrity":{"algorithm":"SHA256","hash":"75bce6d71420b733bdb09caf65e7818cffb4aa345abcd8bf358d48f2ba5a7c0f","blockSize":4194304,"blocks":["75bce6d71420b733bdb09caf65e7818cffb4aa345abcd8bf358d48f2ba5a7c0f"]}}}},"createDefaultLogger.js":{"size":1205,"offset":"10491122","integrity":{"algorithm":"SHA256","hash":"832b6e548db30fcf367b7ee5afff2dd7325a377af5ea9f00404cdc083ea54d96","blockSize":4194304,"blocks":["832b6e548db30fcf367b7ee5afff2dd7325a377af5ea9f00404cdc083ea54d96"]}},"ErrorHandler.js":{"size":3311,"offset":"10492327","integrity":{"algorithm":"SHA256","hash":"42052a03eda2f33163ea5f46d4d78dac799e801539ae474ab1b730a507a1b7ee","blockSize":4194304,"blocks":["42052a03eda2f33163ea5f46d4d78dac799e801539ae474ab1b730a507a1b7ee"]}},"EventLogger.js":{"size":5836,"offset":"10495638","integrity":{"algorithm":"SHA256","hash":"9f82f44f0dbc60c9ac2276699f1d6fda1a46c605dd28a8e8c32f2af186919e97","blockSize":4194304,"blocks":["9f82f44f0dbc60c9ac2276699f1d6fda1a46c605dd28a8e8c32f2af186919e97"]}},"index.js":{"size":290,"offset":"10501474","integrity":{"algorithm":"SHA256","hash":"a950d587bb76139ddfbcfa9d80f869e00e6d0299664758631d6977198cc5b2a6","blockSize":4194304,"blocks":["a950d587bb76139ddfbcfa9d80f869e00e6d0299664758631d6977198cc5b2a6"]}},"NodeExternalApi.js":{"size":4539,"offset":"10501764","integrity":{"algorithm":"SHA256","hash":"2cdae37f7cae411e2fd5f368788bd72615795ab05d5f33bd6c2143b282d823af","blockSize":4194304,"blocks":["2cdae37f7cae411e2fd5f368788bd72615795ab05d5f33bd6c2143b282d823af"]}},"packageJson.js":{"size":2349,"offset":"10506303","integrity":{"algorithm":"SHA256","hash":"0c2a87c76002dedd9778d04a2e360d10009fc8561dc2d649e41f9196ffa8668e","blockSize":4194304,"blocks":["0c2a87c76002dedd9778d04a2e360d10009fc8561dc2d649e41f9196ffa8668e"]}},"transforms":{"files":{"__specs__":{"files":{"format.spec.js":{"size":3988,"offset":"10508652","integrity":{"algorithm":"SHA256","hash":"694e02b921fab1a11c6ff92b4baa8c975731f60295392c13e86c4d198418d9d7","blockSize":4194304,"blocks":["694e02b921fab1a11c6ff92b4baa8c975731f60295392c13e86c4d198418d9d7"]}},"object.spec.js":{"size":2079,"offset":"10512640","integrity":{"algorithm":"SHA256","hash":"658d2901f484925623fd0b63d5a42020bd394474e3939f579b8c5bccdced0bc1","blockSize":4194304,"blocks":["658d2901f484925623fd0b63d5a42020bd394474e3939f579b8c5bccdced0bc1"]}},"style.spec.js":{"size":1163,"offset":"10514719","integrity":{"algorithm":"SHA256","hash":"5f9807e69a724ba371c59f57d7667d29aaa16a443f623ce4db235c76bebfd937","blockSize":4194304,"blocks":["5f9807e69a724ba371c59f57d7667d29aaa16a443f623ce4db235c76bebfd937"]}},"transform.spec.js":{"size":342,"offset":"10515882","integrity":{"algorithm":"SHA256","hash":"6be83a7189e66b96ad96cb8fd8fe5cfbab27e75e6c59bb78e0a9c084465a69fc","blockSize":4194304,"blocks":["6be83a7189e66b96ad96cb8fd8fe5cfbab27e75e6c59bb78e0a9c084465a69fc"]}}}},"format.js":{"size":4095,"offset":"10516224","integrity":{"algorithm":"SHA256","hash":"53da4d5e8dc0a3f5dc757fef88d569ebfa73779b35338336fefc3bf5aa4bcef2","blockSize":4194304,"blocks":["53da4d5e8dc0a3f5dc757fef88d569ebfa73779b35338336fefc3bf5aa4bcef2"]}},"object.js":{"size":2906,"offset":"10520319","integrity":{"algorithm":"SHA256","hash":"990e63a431feef1addad96aa8525fa4d0e797583244a04f527776869a0be6d4d","blockSize":4194304,"blocks":["990e63a431feef1addad96aa8525fa4d0e797583244a04f527776869a0be6d4d"]}},"style.js":{"size":1500,"offset":"10523225","integrity":{"algorithm":"SHA256","hash":"41d6643ed9f11cefb3692a0309dfc3867d24e950a446deacfb833965ef448d9d","blockSize":4194304,"blocks":["41d6643ed9f11cefb3692a0309dfc3867d24e950a446deacfb833965ef448d9d"]}},"transform.js":{"size":372,"offset":"10524725","integrity":{"algorithm":"SHA256","hash":"d41edd15ea18c66efc749f05848357afecfa36b42f65167827f7e795578784d8","blockSize":4194304,"blocks":["d41edd15ea18c66efc749f05848357afecfa36b42f65167827f7e795578784d8"]}}}},"transports":{"files":{"__specs__":{"files":{"console.spec.js":{"size":3131,"offset":"10525097","integrity":{"algorithm":"SHA256","hash":"96094205425e7a89be6aa9bfa2774644d017c213f63b2f5d8c222ed9a98d8db5","blockSize":4194304,"blocks":["96094205425e7a89be6aa9bfa2774644d017c213f63b2f5d8c222ed9a98d8db5"]}}}},"console.js":{"size":2270,"offset":"10528228","integrity":{"algorithm":"SHA256","hash":"2f593a897feb65572a83e42ca1ebfd9a1cd0e5b78148308a1eab85359a86bfa1","blockSize":4194304,"blocks":["2f593a897feb65572a83e42ca1ebfd9a1cd0e5b78148308a1eab85359a86bfa1"]}},"file":{"files":{"__specs__":{"files":{"File.spec.js":{"size":3410,"offset":"10530498","integrity":{"algorithm":"SHA256","hash":"cb0762767a165c8c1bc1f91252281143fe5d9179b8ae18d26ddbbf74aea8dbfe","blockSize":4194304,"blocks":["cb0762767a165c8c1bc1f91252281143fe5d9179b8ae18d26ddbbf74aea8dbfe"]}},"FileRegistry.spec.js":{"size":1365,"offset":"10533908","integrity":{"algorithm":"SHA256","hash":"b656412644196fa5ac2c2c6e95a3427378f9c18f8fb573301e56554accbd67e6","blockSize":4194304,"blocks":["b656412644196fa5ac2c2c6e95a3427378f9c18f8fb573301e56554accbd67e6"]}},"index.spec.js":{"size":2950,"offset":"10535273","integrity":{"algorithm":"SHA256","hash":"53a4268c8256dd3b68177c2acaf023335d8183f3b88379308b4bb3cbdcbcf6b0","blockSize":4194304,"blocks":["53a4268c8256dd3b68177c2acaf023335d8183f3b88379308b4bb3cbdcbcf6b0"]}},"makeTmpDir.js":{"size":546,"offset":"10538223","integrity":{"algorithm":"SHA256","hash":"3c46e6937ad4047612aa2918013a7a19450831bed18b0d93c7904f82f6b550d6","blockSize":4194304,"blocks":["3c46e6937ad4047612aa2918013a7a19450831bed18b0d93c7904f82f6b550d6"]}},"NullFile.spec.js":{"size":281,"offset":"10538769","integrity":{"algorithm":"SHA256","hash":"e745dc1aa9cf16981c3e9591fceb5b8232f70f1e8f7688398e539f33900bee37","blockSize":4194304,"blocks":["e745dc1aa9cf16981c3e9591fceb5b8232f70f1e8f7688398e539f33900bee37"]}}}},"File.js":{"size":3299,"offset":"10539050","integrity":{"algorithm":"SHA256","hash":"c993861cbe264159b7d77cf6489ea875e1b248f4cdf95bb8a338fcb63b0b48a4","blockSize":4194304,"blocks":["c993861cbe264159b7d77cf6489ea875e1b248f4cdf95bb8a338fcb63b0b48a4"]}},"FileRegistry.js":{"size":1683,"offset":"10542349","integrity":{"algorithm":"SHA256","hash":"95d1c6602c10b704fc0dab7c4b31baba3342175139b11f6384a677c773c5a9ab","blockSize":4194304,"blocks":["95d1c6602c10b704fc0dab7c4b31baba3342175139b11f6384a677c773c5a9ab"]}},"index.js":{"size":4247,"offset":"10544032","integrity":{"algorithm":"SHA256","hash":"de432e78ec80ae08a1c64a72c924b74559ff33c582e15cb91ce294e92756cf4d","blockSize":4194304,"blocks":["de432e78ec80ae08a1c64a72c924b74559ff33c582e15cb91ce294e92756cf4d"]}},"NullFile.js":{"size":232,"offset":"10548279","integrity":{"algorithm":"SHA256","hash":"f59571c2745779b7ab0c1fb54f2e219964444adac1d1d03de8fbc9e633d78a32","blockSize":4194304,"blocks":["f59571c2745779b7ab0c1fb54f2e219964444adac1d1d03de8fbc9e633d78a32"]}}}},"ipc.js":{"size":800,"offset":"10548511","integrity":{"algorithm":"SHA256","hash":"353514315682b90f0c4ad9c1ad804be3d8fa21137839e91b498b9f070518d2fb","blockSize":4194304,"blocks":["353514315682b90f0c4ad9c1ad804be3d8fa21137839e91b498b9f070518d2fb"]}},"remote.js":{"size":2098,"offset":"10549311","integrity":{"algorithm":"SHA256","hash":"bfb14f398d95cdcdb07b0683c02a93813beb648682214959cedffdf3da453d82","blockSize":4194304,"blocks":["bfb14f398d95cdcdb07b0683c02a93813beb648682214959cedffdf3da453d82"]}}}}}},"renderer":{"files":{"__specs__":{"files":{"index.spec.js":{"size":3512,"offset":"10551409","integrity":{"algorithm":"SHA256","hash":"0263559d1235e46f5e31fc60ad8e04c8c16ff3e246b20c9b195a1f4e2c32415c","blockSize":4194304,"blocks":["0263559d1235e46f5e31fc60ad8e04c8c16ff3e246b20c9b195a1f4e2c32415c"]}}}},".eslintrc.js":{"size":211,"offset":"10554921","integrity":{"algorithm":"SHA256","hash":"e7ea271305c3e8325702da724e62d8bff9cb4b3c84718b4d6be4e9b751ffd359","blockSize":4194304,"blocks":["e7ea271305c3e8325702da724e62d8bff9cb4b3c84718b4d6be4e9b751ffd359"]}},"electron-log-preload.js":{"size":2054,"offset":"10555132","integrity":{"algorithm":"SHA256","hash":"6e488d9b11ea738f05f51c2a22cc68c8add00ba5126f797f9192cc92ae899d13","blockSize":4194304,"blocks":["6e488d9b11ea738f05f51c2a22cc68c8add00ba5126f797f9192cc92ae899d13"]}},"index.js":{"size":1791,"offset":"10557186","integrity":{"algorithm":"SHA256","hash":"3bd9185244f15b1f0dcf43f77a474214391b000821ebe375ed7c93d0f35c2a07","blockSize":4194304,"blocks":["3bd9185244f15b1f0dcf43f77a474214391b000821ebe375ed7c93d0f35c2a07"]}},"lib":{"files":{"RendererErrorHandler.js":{"size":1998,"offset":"10558977","integrity":{"algorithm":"SHA256","hash":"5656699c9b819e572e3631f833e6b612e64648fefc43d2d7bc388932c58fa247","blockSize":4194304,"blocks":["5656699c9b819e572e3631f833e6b612e64648fefc43d2d7bc388932c58fa247"]}},"transports":{"files":{"console.js":{"size":2465,"offset":"10560975","integrity":{"algorithm":"SHA256","hash":"ae9fd0be43b611fd8be68ed7e3e8d0aac7db5cb16fe0c603c68a18ef2ec9f0b3","blockSize":4194304,"blocks":["ae9fd0be43b611fd8be68ed7e3e8d0aac7db5cb16fe0c603c68a18ef2ec9f0b3"]}},"ipc.js":{"size":2678,"offset":"10563440","integrity":{"algorithm":"SHA256","hash":"89c24fc0b2de6e99402b0bb3d25d61a1cf9192857c5831a59e6deddd6309e7e4","blockSize":4194304,"blocks":["89c24fc0b2de6e99402b0bb3d25d61a1cf9192857c5831a59e6deddd6309e7e4"]}}}}}}}}}}}},"electron-squirrel-startup":{"files":{".eslintrc":{"size":35,"offset":"10566118","integrity":{"algorithm":"SHA256","hash":"7ba7f8bd99cf2db751efd7937b0d5081d7e93818c073d9eef79b1a1938fd8b1b","blockSize":4194304,"blocks":["7ba7f8bd99cf2db751efd7937b0d5081d7e93818c073d9eef79b1a1938fd8b1b"]}},".jsfmtrc":{"size":5492,"offset":"10566153","integrity":{"algorithm":"SHA256","hash":"ceab48d6ad3da427a1c7a1d50889986d3f07ae6e28103da36d0bae7354cc0a81","blockSize":4194304,"blocks":["ceab48d6ad3da427a1c7a1d50889986d3f07ae6e28103da36d0bae7354cc0a81"]}},".npmignore":{"size":30,"offset":"10571645","integrity":{"algorithm":"SHA256","hash":"2f9aebd7a15d0a9e62d69bff1c888bb93ec5eab506a9db272de622defda4735c","blockSize":4194304,"blocks":["2f9aebd7a15d0a9e62d69bff1c888bb93ec5eab506a9db272de622defda4735c"]}},".travis.yml":{"size":103,"offset":"10571675","integrity":{"algorithm":"SHA256","hash":"08eb5ecff1bdce19a2908df9d60a1bf918c58130c9d3176415d0b76403f174d9","blockSize":4194304,"blocks":["08eb5ecff1bdce19a2908df9d60a1bf918c58130c9d3176415d0b76403f174d9"]}},"appveyor.yml":{"size":287,"offset":"10571778","integrity":{"algorithm":"SHA256","hash":"e34046d32edf13334e8e410b6b2c504461ef5e562fda19a1068ca5ea7d587ae4","blockSize":4194304,"blocks":["e34046d32edf13334e8e410b6b2c504461ef5e562fda19a1068ca5ea7d587ae4"]}},"index.js":{"size":1027,"offset":"10572065","integrity":{"algorithm":"SHA256","hash":"800efee091fc95f5809a01df5c9b06a3bd577fa935c5f9fc6a2d2cc8a795f401","blockSize":4194304,"blocks":["800efee091fc95f5809a01df5c9b06a3bd577fa935c5f9fc6a2d2cc8a795f401"]}},"LICENSE":{"size":10255,"offset":"10573092","integrity":{"algorithm":"SHA256","hash":"9cf5de169b595cdae317551ef69a794b59fa3d1e151db4190d337fe08d13d5f8","blockSize":4194304,"blocks":["9cf5de169b595cdae317551ef69a794b59fa3d1e151db4190d337fe08d13d5f8"]}},"node_modules":{"files":{"debug":{"files":{".coveralls.yml":{"size":46,"offset":"10583347","integrity":{"algorithm":"SHA256","hash":"64e6b64f19837a76c30865579aabdde1a825729ae0204ba73ba6de77296ce18e","blockSize":4194304,"blocks":["64e6b64f19837a76c30865579aabdde1a825729ae0204ba73ba6de77296ce18e"]}},".eslintrc":{"size":180,"offset":"10583393","integrity":{"algorithm":"SHA256","hash":"7b7d5a5736dddae0e7cf1c06cdf41ddd9f98e73db8f57a18fe4c9bd0f52f9aa3","blockSize":4194304,"blocks":["7b7d5a5736dddae0e7cf1c06cdf41ddd9f98e73db8f57a18fe4c9bd0f52f9aa3"]}},".npmignore":{"size":72,"offset":"10583573","integrity":{"algorithm":"SHA256","hash":"f4580152a6f48954b44cb2a0a002fa500467663db5a6dc8e796b52533dc04ec1","blockSize":4194304,"blocks":["f4580152a6f48954b44cb2a0a002fa500467663db5a6dc8e796b52533dc04ec1"]}},".travis.yml":{"size":140,"offset":"10583645","integrity":{"algorithm":"SHA256","hash":"839e44ee0a96a3e302dc6472800b51822982b77d08f19200ab2cc70534781fd8","blockSize":4194304,"blocks":["839e44ee0a96a3e302dc6472800b51822982b77d08f19200ab2cc70534781fd8"]}},"CHANGELOG.md":{"size":11707,"offset":"10583785","integrity":{"algorithm":"SHA256","hash":"d8c1b0717964e189010b13521379c3b970eecc889cb8b788ac21d8dd85247165","blockSize":4194304,"blocks":["d8c1b0717964e189010b13521379c3b970eecc889cb8b788ac21d8dd85247165"]}},"component.json":{"size":321,"offset":"10595492","integrity":{"algorithm":"SHA256","hash":"2e5ab9ae90f41699e00d00fca16765024f437300a0568c2208669cc281ba7656","blockSize":4194304,"blocks":["2e5ab9ae90f41699e00d00fca16765024f437300a0568c2208669cc281ba7656"]}},"karma.conf.js":{"size":1736,"offset":"10595813","integrity":{"algorithm":"SHA256","hash":"2430869adb61a5e24a3612110a9b49a948e6db43ab7e947c003a9c19c478e609","blockSize":4194304,"blocks":["2430869adb61a5e24a3612110a9b49a948e6db43ab7e947c003a9c19c478e609"]}},"LICENSE":{"size":1107,"offset":"10597549","integrity":{"algorithm":"SHA256","hash":"98c970de440dcfc77471610aec2377c9d9b0db2b3be6d1add524a586e1d7f422","blockSize":4194304,"blocks":["98c970de440dcfc77471610aec2377c9d9b0db2b3be6d1add524a586e1d7f422"]}},"Makefile":{"size":1059,"offset":"10598656","integrity":{"algorithm":"SHA256","hash":"f6466507e02c62f14e477af08e4a13ec883152b54d87feeffb8f0d6de6e9013b","blockSize":4194304,"blocks":["f6466507e02c62f14e477af08e4a13ec883152b54d87feeffb8f0d6de6e9013b"]}},"node.js":{"size":40,"offset":"10599715","integrity":{"algorithm":"SHA256","hash":"996b381f353555cb172ebb2802bb2a7323442ff67b7b530cc26834058d7f31a2","blockSize":4194304,"blocks":["996b381f353555cb172ebb2802bb2a7323442ff67b7b530cc26834058d7f31a2"]}},"package.json":{"size":1138,"offset":"10599755","integrity":{"algorithm":"SHA256","hash":"6c3d2c892db282317913ce7c340dd2edccd326bcafd18b644b8738144967d6ee","blockSize":4194304,"blocks":["6c3d2c892db282317913ce7c340dd2edccd326bcafd18b644b8738144967d6ee"]}},"README.md":{"size":17918,"offset":"10600893","integrity":{"algorithm":"SHA256","hash":"cda3dbd285a2b65894758565a565e7bc2e7c3696225af7b5bd01454240df0aea","blockSize":4194304,"blocks":["cda3dbd285a2b65894758565a565e7bc2e7c3696225af7b5bd01454240df0aea"]}},"src":{"files":{"browser.js":{"size":4734,"offset":"10618811","integrity":{"algorithm":"SHA256","hash":"0144ab6a52b9330c567de11a5c3a4aea35cdac47a4c106482aa24ae8054cdc6f","blockSize":4194304,"blocks":["0144ab6a52b9330c567de11a5c3a4aea35cdac47a4c106482aa24ae8054cdc6f"]}},"debug.js":{"size":4394,"offset":"10623545","integrity":{"algorithm":"SHA256","hash":"d8d1c1d6c387ab67c3f28d78fd0b20b9becd69442db9d3efe110ca464b509c8a","blockSize":4194304,"blocks":["d8d1c1d6c387ab67c3f28d78fd0b20b9becd69442db9d3efe110ca464b509c8a"]}},"index.js":{"size":263,"offset":"10627939","integrity":{"algorithm":"SHA256","hash":"9a34fedeb2d269c46ed94e6f13039eb0d16d866dd460ec66fa3acd78122fa9fe","blockSize":4194304,"blocks":["9a34fedeb2d269c46ed94e6f13039eb0d16d866dd460ec66fa3acd78122fa9fe"]}},"inspector-log.js":{"size":373,"offset":"10628202","integrity":{"algorithm":"SHA256","hash":"949ae67ec1b655694f83dce57d47d9d77234f9e7d698616932a90e69c7afee91","blockSize":4194304,"blocks":["949ae67ec1b655694f83dce57d47d9d77234f9e7d698616932a90e69c7afee91"]}},"node.js":{"size":6015,"offset":"10628575","integrity":{"algorithm":"SHA256","hash":"a3e83594a4ce88997e2e4fc66bc942b17b9d736290ad62560c7f09d6d0989ad0","blockSize":4194304,"blocks":["a3e83594a4ce88997e2e4fc66bc942b17b9d736290ad62560c7f09d6d0989ad0"]}}}}}},"ms":{"files":{"index.js":{"size":2764,"offset":"10634590","integrity":{"algorithm":"SHA256","hash":"4bd92209cb9dacf3e3773e725acb7aaec43ea9e78540324e4d0f73e5ce9adef7","blockSize":4194304,"blocks":["4bd92209cb9dacf3e3773e725acb7aaec43ea9e78540324e4d0f73e5ce9adef7"]}},"license.md":{"size":1077,"offset":"10637354","integrity":{"algorithm":"SHA256","hash":"6652830c2607c722b66f1b57de15877ab8fc5dca406cc5b335afeb365d0f32c1","blockSize":4194304,"blocks":["6652830c2607c722b66f1b57de15877ab8fc5dca406cc5b335afeb365d0f32c1"]}},"package.json":{"size":704,"offset":"10638431","integrity":{"algorithm":"SHA256","hash":"30fbfaa3840b2f63978ad4bcd7ed8dc24d277b818e4755fe93eda8cb1bc8b74c","blockSize":4194304,"blocks":["30fbfaa3840b2f63978ad4bcd7ed8dc24d277b818e4755fe93eda8cb1bc8b74c"]}},"readme.md":{"size":1721,"offset":"10639135","integrity":{"algorithm":"SHA256","hash":"c9ac67ff103c01871b0ff09e2f094631991908c1fd0dc08bdb53287e5a760ae5","blockSize":4194304,"blocks":["c9ac67ff103c01871b0ff09e2f094631991908c1fd0dc08bdb53287e5a760ae5"]}}}}}},"package.json":{"size":936,"offset":"10640856","integrity":{"algorithm":"SHA256","hash":"17d9acfe78d4456b6f9aa6dbb46722052224681b94aafc5dfdc41cc0246b76fb","blockSize":4194304,"blocks":["17d9acfe78d4456b6f9aa6dbb46722052224681b94aafc5dfdc41cc0246b76fb"]}},"README.md":{"size":832,"offset":"10641792","integrity":{"algorithm":"SHA256","hash":"913a5bc29ac3a8c1678fa9fda57a65f85c6f5907555a3a36c77ce4eb4199d8a4","blockSize":4194304,"blocks":["913a5bc29ac3a8c1678fa9fda57a65f85c6f5907555a3a36c77ce4eb4199d8a4"]}},"test":{"files":{"index.test.js":{"size":250,"offset":"10642624","integrity":{"algorithm":"SHA256","hash":"4df95088bf976361127297d3963c48670ce722169ec84e4c4b6841147bcd98dc","blockSize":4194304,"blocks":["4df95088bf976361127297d3963c48670ce722169ec84e4c4b6841147bcd98dc"]}},"mocha.opts":{"size":0,"offset":"10642874","integrity":{"algorithm":"SHA256","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","blockSize":4194304,"blocks":["e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"]}}}}}},"electron-store":{"files":{"index.d.ts":{"size":1826,"offset":"10642874","integrity":{"algorithm":"SHA256","hash":"9b56b98402cd73394776761ec51654a57412ba763334b06818ce60e8f9c4ab0c","blockSize":4194304,"blocks":["9b56b98402cd73394776761ec51654a57412ba763334b06818ce60e8f9c4ab0c"]}},"index.js":{"size":1796,"offset":"10644700","integrity":{"algorithm":"SHA256","hash":"70f41358d4faa3f6fe7875621335280be53adc942f9e12effaccbe13c12c5fdb","blockSize":4194304,"blocks":["70f41358d4faa3f6fe7875621335280be53adc942f9e12effaccbe13c12c5fdb"]}},"license":{"size":1117,"offset":"10646496","integrity":{"algorithm":"SHA256","hash":"5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3","blockSize":4194304,"blocks":["5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3"]}},"package.json":{"size":959,"offset":"10647613","integrity":{"algorithm":"SHA256","hash":"cfc1f73531bd5c140f06d3a3f73ecdac09466ff612a4cb131ba720188eb31a69","blockSize":4194304,"blocks":["cfc1f73531bd5c140f06d3a3f73ecdac09466ff612a4cb131ba720188eb31a69"]}},"readme.md":{"size":14376,"offset":"10648572","integrity":{"algorithm":"SHA256","hash":"46966a173ba1aa6145795cf3cf181c5c81875f1f588fd0b4c300ecfadf5c4320","blockSize":4194304,"blocks":["46966a173ba1aa6145795cf3cf181c5c81875f1f588fd0b4c300ecfadf5c4320"]}}}},"env-paths":{"files":{"index.d.ts":{"size":3074,"offset":"10662948","integrity":{"algorithm":"SHA256","hash":"6bc60b4956b1e7f38b44938f14aeaf6fc79f1aa72a8a3281116521a418c968af","blockSize":4194304,"blocks":["6bc60b4956b1e7f38b44938f14aeaf6fc79f1aa72a8a3281116521a418c968af"]}},"index.js":{"size":2155,"offset":"10666022","integrity":{"algorithm":"SHA256","hash":"84351667051b005f9856319267407b06affad12888355462c7c8740f22ca3999","blockSize":4194304,"blocks":["84351667051b005f9856319267407b06affad12888355462c7c8740f22ca3999"]}},"license":{"size":1109,"offset":"10668177","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":698,"offset":"10669286","integrity":{"algorithm":"SHA256","hash":"b92833e5851ec53bd4cd8093f6099d0c6e6818c4374ec1d09aa25d4f9ba91ec4","blockSize":4194304,"blocks":["b92833e5851ec53bd4cd8093f6099d0c6e6818c4374ec1d09aa25d4f9ba91ec4"]}},"readme.md":{"size":3127,"offset":"10669984","integrity":{"algorithm":"SHA256","hash":"0e7e14cbbc73f780195e6115b26acfb561741bab0860e954b1780271b1566966","blockSize":4194304,"blocks":["0e7e14cbbc73f780195e6115b26acfb561741bab0860e954b1780271b1566966"]}}}},"fast-deep-equal":{"files":{"es6":{"files":{"index.d.ts":{"size":66,"offset":"10673111","integrity":{"algorithm":"SHA256","hash":"d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e","blockSize":4194304,"blocks":["d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e"]}},"index.js":{"size":1935,"offset":"10673177","integrity":{"algorithm":"SHA256","hash":"d7f027497048c75e17268dbc66b670579d4f70f2dc0e019cdc9edf5078c247d6","blockSize":4194304,"blocks":["d7f027497048c75e17268dbc66b670579d4f70f2dc0e019cdc9edf5078c247d6"]}},"react.d.ts":{"size":66,"offset":"10675112","integrity":{"algorithm":"SHA256","hash":"d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e","blockSize":4194304,"blocks":["d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e"]}},"react.js":{"size":2209,"offset":"10675178","integrity":{"algorithm":"SHA256","hash":"366779cbb7821d26d18b9eaa12b6788cbb101cdbbabcae36f2919a5f48534ef0","blockSize":4194304,"blocks":["366779cbb7821d26d18b9eaa12b6788cbb101cdbbabcae36f2919a5f48534ef0"]}}}},"index.d.ts":{"size":103,"offset":"10677387","integrity":{"algorithm":"SHA256","hash":"37ffe3c12813b6a6d512f7c27b71f3388d03dafa10555ad5094cea393ed3d1f6","blockSize":4194304,"blocks":["37ffe3c12813b6a6d512f7c27b71f3388d03dafa10555ad5094cea393ed3d1f6"]}},"index.js":{"size":1177,"offset":"10677490","integrity":{"algorithm":"SHA256","hash":"eb469e206280321a3878f2335ec98aa2104a155079d8ed83a23029098dccd215","blockSize":4194304,"blocks":["eb469e206280321a3878f2335ec98aa2104a155079d8ed83a23029098dccd215"]}},"LICENSE":{"size":1074,"offset":"10678667","integrity":{"algorithm":"SHA256","hash":"7bf9b2de73a6b356761c948d0e9eeb4be6c1270bd04c79cd489c1e400ffdfc1a","blockSize":4194304,"blocks":["7bf9b2de73a6b356761c948d0e9eeb4be6c1270bd04c79cd489c1e400ffdfc1a"]}},"package.json":{"size":1496,"offset":"10679741","integrity":{"algorithm":"SHA256","hash":"a5c63940db0260739be9e2ac67f3aac268df4db5770420ee4e34e493152f97d2","blockSize":4194304,"blocks":["a5c63940db0260739be9e2ac67f3aac268df4db5770420ee4e34e493152f97d2"]}},"react.d.ts":{"size":66,"offset":"10681237","integrity":{"algorithm":"SHA256","hash":"d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e","blockSize":4194304,"blocks":["d979def17dea97ee491c975f3d3cb31957b7970a791c1d5a3854ea6cd4cce91e"]}},"react.js":{"size":1451,"offset":"10681303","integrity":{"algorithm":"SHA256","hash":"37cbd168dbd42c73119ce7326556bddef40b3a5fbd2e215cf81a7c78fb73ff9a","blockSize":4194304,"blocks":["37cbd168dbd42c73119ce7326556bddef40b3a5fbd2e215cf81a7c78fb73ff9a"]}},"README.md":{"size":3323,"offset":"10682754","integrity":{"algorithm":"SHA256","hash":"ada32c1b53bd74640a22806e99b25c2b8ab2946eed338f325114be87bd5b9fce","blockSize":4194304,"blocks":["ada32c1b53bd74640a22806e99b25c2b8ab2946eed338f325114be87bd5b9fce"]}}}},"fast-uri":{"files":{".gitattributes":{"size":80,"offset":"10686077","integrity":{"algorithm":"SHA256","hash":"e173bffc6cde613d3e6d06e49f2b1d05385cb02aa68c4931656b5b051ab649dd","blockSize":4194304,"blocks":["e173bffc6cde613d3e6d06e49f2b1d05385cb02aa68c4931656b5b051ab649dd"]}},".github":{"files":{".stale.yml":{"size":771,"offset":"10686157","integrity":{"algorithm":"SHA256","hash":"edc967ba3a63eccac1612fd0ae279145907a95d4f84dd02dd3b531275d748a1a","blockSize":4194304,"blocks":["edc967ba3a63eccac1612fd0ae279145907a95d4f84dd02dd3b531275d748a1a"]}},"dependabot.yml":{"size":273,"offset":"10686928","integrity":{"algorithm":"SHA256","hash":"67dcd2013ebde5683fd6684194a6df609eeed7de80098198f59a7e07b5c19eba","blockSize":4194304,"blocks":["67dcd2013ebde5683fd6684194a6df609eeed7de80098198f59a7e07b5c19eba"]}},"tests_checker.yml":{"size":223,"offset":"10687201","integrity":{"algorithm":"SHA256","hash":"5b3f95a1820ec3eba458bfb113aad4626b85113b456041557e4bb797b11d08c1","blockSize":4194304,"blocks":["5b3f95a1820ec3eba458bfb113aad4626b85113b456041557e4bb797b11d08c1"]}},"workflows":{"files":{"ci.yml":{"size":371,"offset":"10687424","integrity":{"algorithm":"SHA256","hash":"dd9fd8a1d847fb9f11954281fa6a74bcec3e1c0804d1c4a329820527af3f96b2","blockSize":4194304,"blocks":["dd9fd8a1d847fb9f11954281fa6a74bcec3e1c0804d1c4a329820527af3f96b2"]}},"package-manager-ci.yml":{"size":319,"offset":"10687795","integrity":{"algorithm":"SHA256","hash":"8081e66750a5e84963e9d1ec86ccc5919e23bbb9008cf5d512994c71046c699d","blockSize":4194304,"blocks":["8081e66750a5e84963e9d1ec86ccc5919e23bbb9008cf5d512994c71046c699d"]}}}}}},"benchmark.js":{"size":2677,"offset":"10688114","integrity":{"algorithm":"SHA256","hash":"9ac34a732cb3f3cf9fb847dfb24f8eedc4ca26641cf41cdc80016eef540f8631","blockSize":4194304,"blocks":["9ac34a732cb3f3cf9fb847dfb24f8eedc4ca26641cf41cdc80016eef540f8631"]}},"index.js":{"size":9626,"offset":"10690791","integrity":{"algorithm":"SHA256","hash":"3f8b27a70a4e97757da52b14a435763add8050d29234f3d6727c07e30d42d3b7","blockSize":4194304,"blocks":["3f8b27a70a4e97757da52b14a435763add8050d29234f3d6727c07e30d42d3b7"]}},"lib":{"files":{"schemes.js":{"size":4724,"offset":"10700417","integrity":{"algorithm":"SHA256","hash":"833e0965701d6d335c6f95a771be769c07032ca3d79cf83106d62ba81ce5a409","blockSize":4194304,"blocks":["833e0965701d6d335c6f95a771be769c07032ca3d79cf83106d62ba81ce5a409"]}},"scopedChars.js":{"size":245,"offset":"10705141","integrity":{"algorithm":"SHA256","hash":"e7db8c1d1a2cf6d028b3fa980a48673b5132a31927c79a3b78581105a1e263b6","blockSize":4194304,"blocks":["e7db8c1d1a2cf6d028b3fa980a48673b5132a31927c79a3b78581105a1e263b6"]}},"utils.js":{"size":5863,"offset":"10705386","integrity":{"algorithm":"SHA256","hash":"d157ec3c985c681c2a289acea5fb7a37b8c7432f90c6fe597c3b5651ee9f89ee","blockSize":4194304,"blocks":["d157ec3c985c681c2a289acea5fb7a37b8c7432f90c6fe597c3b5651ee9f89ee"]}}}},"LICENSE":{"size":1763,"offset":"10711249","integrity":{"algorithm":"SHA256","hash":"bf13d2149c7784aeabc5575262251fde5a26bec741a9fd05558a4afe72326ae8","blockSize":4194304,"blocks":["bf13d2149c7784aeabc5575262251fde5a26bec741a9fd05558a4afe72326ae8"]}},"package.json":{"size":1220,"offset":"10713012","integrity":{"algorithm":"SHA256","hash":"f00c965b328bd399e8394e7b926392f19589ec0e7df37ceec728c0da14f4bd5f","blockSize":4194304,"blocks":["f00c965b328bd399e8394e7b926392f19589ec0e7df37ceec728c0da14f4bd5f"]}},"README.md":{"size":4292,"offset":"10714232","integrity":{"algorithm":"SHA256","hash":"093000ad99452e8313839b0044f79f24024bdf683a773f16d319d76f9b667ca6","blockSize":4194304,"blocks":["093000ad99452e8313839b0044f79f24024bdf683a773f16d319d76f9b667ca6"]}},"test":{"files":{".gitkeep":{"size":0,"offset":"10718524","integrity":{"algorithm":"SHA256","hash":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","blockSize":4194304,"blocks":["e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"]}},"ajv.test.js":{"size":737,"offset":"10718524","integrity":{"algorithm":"SHA256","hash":"3841e70f0cba209b4934db39e6bad4a3cbbb03ef8c2f56a65388b2a8bd000114","blockSize":4194304,"blocks":["3841e70f0cba209b4934db39e6bad4a3cbbb03ef8c2f56a65388b2a8bd000114"]}},"compatibility.test.js":{"size":4117,"offset":"10719261","integrity":{"algorithm":"SHA256","hash":"be859e5c7e33d219d639182729de8b362e0976437e9fc5a80d18dc89f849988f","blockSize":4194304,"blocks":["be859e5c7e33d219d639182729de8b362e0976437e9fc5a80d18dc89f849988f"]}},"equal.test.js":{"size":3300,"offset":"10723378","integrity":{"algorithm":"SHA256","hash":"fe73df7895a2c9ea0ea0cf76a7c5e94558efa963369141f8d50a6dfacf8ed5ca","blockSize":4194304,"blocks":["fe73df7895a2c9ea0ea0cf76a7c5e94558efa963369141f8d50a6dfacf8ed5ca"]}},"parse.test.js":{"size":13870,"offset":"10726678","integrity":{"algorithm":"SHA256","hash":"a176c3e2e896baf9e0054f2e272b6e9b043769a24176e417adefe796030b0834","blockSize":4194304,"blocks":["a176c3e2e896baf9e0054f2e272b6e9b043769a24176e417adefe796030b0834"]}},"resolve.test.js":{"size":3803,"offset":"10740548","integrity":{"algorithm":"SHA256","hash":"5b84efe8508e37791cf1d7d60dfffd88ce21c3df338ae30999c6276ac9304a62","blockSize":4194304,"blocks":["5b84efe8508e37791cf1d7d60dfffd88ce21c3df338ae30999c6276ac9304a62"]}},"serialize.test.js":{"size":5887,"offset":"10744351","integrity":{"algorithm":"SHA256","hash":"212e480dcf59bc4bf64be491adf78ecda2ccfc51c64df34b961d889f3d4e609c","blockSize":4194304,"blocks":["212e480dcf59bc4bf64be491adf78ecda2ccfc51c64df34b961d889f3d4e609c"]}},"uri-js.test.js":{"size":41117,"offset":"10750238","integrity":{"algorithm":"SHA256","hash":"cb1285122ccfca41d5e8998c31483b43ab7740975dbbb463ddfa25f2e906620b","blockSize":4194304,"blocks":["cb1285122ccfca41d5e8998c31483b43ab7740975dbbb463ddfa25f2e906620b"]}},"util.test.js":{"size":572,"offset":"10791355","integrity":{"algorithm":"SHA256","hash":"bcc03c8c0e5f20eab983d31650287ce0bee319f70581a316f3114e74074a14e7","blockSize":4194304,"blocks":["bcc03c8c0e5f20eab983d31650287ce0bee319f70581a316f3114e74074a14e7"]}}}},"types":{"files":{"index.d.ts":{"size":1458,"offset":"10791927","integrity":{"algorithm":"SHA256","hash":"ee660a1f2acd3d7fc7b28df06c4e2125229666c4d72e5455ae3841bfd222f684","blockSize":4194304,"blocks":["ee660a1f2acd3d7fc7b28df06c4e2125229666c4d72e5455ae3841bfd222f684"]}},"index.test-d.ts":{"size":490,"offset":"10793385","integrity":{"algorithm":"SHA256","hash":"8b4870eca02388af083bcff02d624a7c53b6935e9e6931242fa5505e91a98fc2","blockSize":4194304,"blocks":["8b4870eca02388af083bcff02d624a7c53b6935e9e6931242fa5505e91a98fc2"]}}}}}},"https-proxy-agent":{"files":{"dist":{"files":{"agent.d.ts":{"size":1126,"offset":"10793875","integrity":{"algorithm":"SHA256","hash":"ce0c414305ae2797f220adcd5e83079802d0b9879e62ca476f000b56a5d31adf","blockSize":4194304,"blocks":["ce0c414305ae2797f220adcd5e83079802d0b9879e62ca476f000b56a5d31adf"]}},"agent.js":{"size":7841,"offset":"10795001","integrity":{"algorithm":"SHA256","hash":"cdf5601776256dee031a1275186c409578ddba5aa441e66c0bea785f81e185e6","blockSize":4194304,"blocks":["cdf5601776256dee031a1275186c409578ddba5aa441e66c0bea785f81e185e6"]}},"agent.js.map":{"size":4367,"offset":"10802842","integrity":{"algorithm":"SHA256","hash":"d9334573c441d153128eb3401147fdb3ba34ab48fd9fc85e88c2d389b3ce5cd3","blockSize":4194304,"blocks":["d9334573c441d153128eb3401147fdb3ba34ab48fd9fc85e88c2d389b3ce5cd3"]}},"index.d.ts":{"size":970,"offset":"10807209","integrity":{"algorithm":"SHA256","hash":"67918f0ddd6271a88574dfe495942f4a6e982b9c3c1a2ce14c273f103691394d","blockSize":4194304,"blocks":["67918f0ddd6271a88574dfe495942f4a6e982b9c3c1a2ce14c273f103691394d"]}},"index.js":{"size":579,"offset":"10808179","integrity":{"algorithm":"SHA256","hash":"7f18e187a92bf3691b1728523ad5863f08ace4d25599535e1471f1f81e90f2cd","blockSize":4194304,"blocks":["7f18e187a92bf3691b1728523ad5863f08ace4d25599535e1471f1f81e90f2cd"]}},"index.js.map":{"size":362,"offset":"10808758","integrity":{"algorithm":"SHA256","hash":"87ee8e0ed31bf580ee85f91cd0a0a05528a8b3a34336bd7b150d082b412ce82d","blockSize":4194304,"blocks":["87ee8e0ed31bf580ee85f91cd0a0a05528a8b3a34336bd7b150d082b412ce82d"]}},"parse-proxy-response.d.ts":{"size":233,"offset":"10809120","integrity":{"algorithm":"SHA256","hash":"743628d052d2c0370690985b2ea279aa2230b48c7b89db617e8a00fd92b2229e","blockSize":4194304,"blocks":["743628d052d2c0370690985b2ea279aa2230b48c7b89db617e8a00fd92b2229e"]}},"parse-proxy-response.js":{"size":2460,"offset":"10809353","integrity":{"algorithm":"SHA256","hash":"24c1737b73db4c109a4cb184ca768b4e85f6cc6cfcc74ed3836388a995b3e557","blockSize":4194304,"blocks":["24c1737b73db4c109a4cb184ca768b4e85f6cc6cfcc74ed3836388a995b3e557"]}},"parse-proxy-response.js.map":{"size":1904,"offset":"10811813","integrity":{"algorithm":"SHA256","hash":"57a386a0393252db29cd35ca216a1da4e7a0896871cdc8c9caddec99572bb88b","blockSize":4194304,"blocks":["57a386a0393252db29cd35ca216a1da4e7a0896871cdc8c9caddec99572bb88b"]}}}},"package.json":{"size":1405,"offset":"10813717","integrity":{"algorithm":"SHA256","hash":"d41d9127cbed43df8e2d404bfaf41361942a8afeb82eb57ccf8515e04eb33d1d","blockSize":4194304,"blocks":["d41d9127cbed43df8e2d404bfaf41361942a8afeb82eb57ccf8515e04eb33d1d"]}},"README.md":{"size":4761,"offset":"10815122","integrity":{"algorithm":"SHA256","hash":"32f0856d2c43df7d05cca960fdee84e1e38ab545bd7b2186433dfa41aa90a712","blockSize":4194304,"blocks":["32f0856d2c43df7d05cca960fdee84e1e38ab545bd7b2186433dfa41aa90a712"]}}}},"is-obj":{"files":{"index.d.ts":{"size":345,"offset":"10819883","integrity":{"algorithm":"SHA256","hash":"aa907eac671382bb40ccad4bb8e9e33d48d3a7ecc264757b63da80e4cd1bbb14","blockSize":4194304,"blocks":["aa907eac671382bb40ccad4bb8e9e33d48d3a7ecc264757b63da80e4cd1bbb14"]}},"index.js":{"size":144,"offset":"10820228","integrity":{"algorithm":"SHA256","hash":"0833a3eed3b0075f23e58f0107bebdedec6db53b4e7b1034d7ea7c9cfb932b0b","blockSize":4194304,"blocks":["0833a3eed3b0075f23e58f0107bebdedec6db53b4e7b1034d7ea7c9cfb932b0b"]}},"license":{"size":1109,"offset":"10820372","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":535,"offset":"10821481","integrity":{"algorithm":"SHA256","hash":"c0054ad88d13ab39db752632edbce44b5c8d2142e2e49fc565436a939a0d190e","blockSize":4194304,"blocks":["c0054ad88d13ab39db752632edbce44b5c8d2142e2e49fc565436a939a0d190e"]}},"readme.md":{"size":688,"offset":"10822016","integrity":{"algorithm":"SHA256","hash":"5eadfb41fae37e54e44c6b8e1267634d725b2fc1e9d02ed96c75a5776267d627","blockSize":4194304,"blocks":["5eadfb41fae37e54e44c6b8e1267634d725b2fc1e9d02ed96c75a5776267d627"]}}}},"json-schema-traverse":{"files":{".eslintrc.yml":{"size":630,"offset":"10822704","integrity":{"algorithm":"SHA256","hash":"b1ea981e2461f053646b08a616efcaba0d3b278b223957e9eb931bcbc3971ccc","blockSize":4194304,"blocks":["b1ea981e2461f053646b08a616efcaba0d3b278b223957e9eb931bcbc3971ccc"]}},".github":{"files":{"FUNDING.yml":{"size":57,"offset":"10823334","integrity":{"algorithm":"SHA256","hash":"83e77adf3dbe6261917b160553f75cbb96de8e99c3259f4f1de85e1c6e4bd156","blockSize":4194304,"blocks":["83e77adf3dbe6261917b160553f75cbb96de8e99c3259f4f1de85e1c6e4bd156"]}},"workflows":{"files":{"build.yml":{"size":582,"offset":"10823391","integrity":{"algorithm":"SHA256","hash":"f0f23bb3b380800e214b19abfd69c1b093131bb030c056fabdd9cddec7e785c5","blockSize":4194304,"blocks":["f0f23bb3b380800e214b19abfd69c1b093131bb030c056fabdd9cddec7e785c5"]}},"publish.yml":{"size":678,"offset":"10823973","integrity":{"algorithm":"SHA256","hash":"56cbec53748d486f04b5c37bec8ea5e5588e02fb2882db8ce36c6e9689bfd2fc","blockSize":4194304,"blocks":["56cbec53748d486f04b5c37bec8ea5e5588e02fb2882db8ce36c6e9689bfd2fc"]}}}}}},"index.d.ts":{"size":740,"offset":"10824651","integrity":{"algorithm":"SHA256","hash":"a76003875cf31f09428a535df140f122f580b5bf811f996273d5aa2733feeadd","blockSize":4194304,"blocks":["a76003875cf31f09428a535df140f122f580b5bf811f996273d5aa2733feeadd"]}},"index.js":{"size":2428,"offset":"10825391","integrity":{"algorithm":"SHA256","hash":"024191b747afac01b28ff11d744e9f82720bbad5f716163ba5c962eb62aa2350","blockSize":4194304,"blocks":["024191b747afac01b28ff11d744e9f82720bbad5f716163ba5c962eb62aa2350"]}},"LICENSE":{"size":1074,"offset":"10827819","integrity":{"algorithm":"SHA256","hash":"7bf9b2de73a6b356761c948d0e9eeb4be6c1270bd04c79cd489c1e400ffdfc1a","blockSize":4194304,"blocks":["7bf9b2de73a6b356761c948d0e9eeb4be6c1270bd04c79cd489c1e400ffdfc1a"]}},"package.json":{"size":1004,"offset":"10828893","integrity":{"algorithm":"SHA256","hash":"156fb24af02845c190701360d06dfda35ef04282e34a734289ea9535ad9819ae","blockSize":4194304,"blocks":["156fb24af02845c190701360d06dfda35ef04282e34a734289ea9535ad9819ae"]}},"README.md":{"size":3350,"offset":"10829897","integrity":{"algorithm":"SHA256","hash":"e6137660d373bc510f4d41789d7fea74e0ed9f94c99d4892dee22292ac2a39a7","blockSize":4194304,"blocks":["e6137660d373bc510f4d41789d7fea74e0ed9f94c99d4892dee22292ac2a39a7"]}},"spec":{"files":{".eslintrc.yml":{"size":91,"offset":"10833247","integrity":{"algorithm":"SHA256","hash":"8df0cb64273b71c11db4f99be49c92e6f80f10a13de4599743e4372c8a0be82c","blockSize":4194304,"blocks":["8df0cb64273b71c11db4f99be49c92e6f80f10a13de4599743e4372c8a0be82c"]}},"fixtures":{"files":{"schema.js":{"size":5544,"offset":"10833338","integrity":{"algorithm":"SHA256","hash":"0262591e321bc88b22dc33ec78bcded5ab664e2fce2c10b9e0c35d3eb6030d27","blockSize":4194304,"blocks":["0262591e321bc88b22dc33ec78bcded5ab664e2fce2c10b9e0c35d3eb6030d27"]}}}},"index.spec.js":{"size":6042,"offset":"10838882","integrity":{"algorithm":"SHA256","hash":"40e6986bda700387e2d397971087a3977d6801bf954591505229691a267c5f69","blockSize":4194304,"blocks":["40e6986bda700387e2d397971087a3977d6801bf954591505229691a267c5f69"]}}}}}},"json-schema-typed":{"files":{"dist-node":{"files":{"index.js":{"size":2596,"offset":"10844924","integrity":{"algorithm":"SHA256","hash":"9fbf92ce11a8e03f63fca828fb7aa814b8f35f0e9d78ed95242988c71a82a3e2","blockSize":4194304,"blocks":["9fbf92ce11a8e03f63fca828fb7aa814b8f35f0e9d78ed95242988c71a82a3e2"]}},"index.js.map":{"size":5062,"offset":"10847520","integrity":{"algorithm":"SHA256","hash":"f79d09e7609ed719a725eadbb67efac05f551a6c3cc4af8279d9bcae3bbb6e82","blockSize":4194304,"blocks":["f79d09e7609ed719a725eadbb67efac05f551a6c3cc4af8279d9bcae3bbb6e82"]}}}},"dist-src":{"files":{"index.js":{"size":2511,"offset":"10852582","integrity":{"algorithm":"SHA256","hash":"d7019674db69d5a5b7443d643a5c909b7b0a320183cb9a149603fb35fa16bf06","blockSize":4194304,"blocks":["d7019674db69d5a5b7443d643a5c909b7b0a320183cb9a149603fb35fa16bf06"]}}}},"dist-types":{"files":{"__tests__":{"files":{"index.test.d.ts":{"size":11,"offset":"10855093","integrity":{"algorithm":"SHA256","hash":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","blockSize":4194304,"blocks":["8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"]}}}},"index.d.ts":{"size":33746,"offset":"10855104","integrity":{"algorithm":"SHA256","hash":"1be2a504e838c8bdea1952ac190e13ec093066a37e061ddbde6ac4c03e4a369c","blockSize":4194304,"blocks":["1be2a504e838c8bdea1952ac190e13ec093066a37e061ddbde6ac4c03e4a369c"]}}}},"dist-web":{"files":{"index.js":{"size":2592,"offset":"10888850","integrity":{"algorithm":"SHA256","hash":"2720267bff58c5728dd9ea8cfb1de124ce525003ea58a692c0bdb473f2a8d7e0","blockSize":4194304,"blocks":["2720267bff58c5728dd9ea8cfb1de124ce525003ea58a692c0bdb473f2a8d7e0"]}},"index.js.map":{"size":5058,"offset":"10891442","integrity":{"algorithm":"SHA256","hash":"8a7fdb4ab2111b6add021fa38aaf10ccc1cad3a5d5034e3e1150a2720105e7c3","blockSize":4194304,"blocks":["8a7fdb4ab2111b6add021fa38aaf10ccc1cad3a5d5034e3e1150a2720105e7c3"]}}}},"LICENSE":{"size":1386,"offset":"10896500","integrity":{"algorithm":"SHA256","hash":"59992f12a42bfad11b6586e1bffda51749bb468847ca27c7070647462a66ed7b","blockSize":4194304,"blocks":["59992f12a42bfad11b6586e1bffda51749bb468847ca27c7070647462a66ed7b"]}},"package.json":{"size":1936,"offset":"10897886","integrity":{"algorithm":"SHA256","hash":"ca6961fa381a3e69966864830b5b6b65c0ed8245a094a7415383dd30910048cc","blockSize":4194304,"blocks":["ca6961fa381a3e69966864830b5b6b65c0ed8245a094a7415383dd30910048cc"]}},"README.md":{"size":2025,"offset":"10899822","integrity":{"algorithm":"SHA256","hash":"7d2e7c3aa03cd83054560a45c957acd9b0a55e7551ccd8017c20307fdad72510","blockSize":4194304,"blocks":["7d2e7c3aa03cd83054560a45c957acd9b0a55e7551ccd8017c20307fdad72510"]}}}},"locate-path":{"files":{"index.js":{"size":539,"offset":"10901847","integrity":{"algorithm":"SHA256","hash":"0d01be23e2a31212f61ae8856bd916709156f2c56c7434dbe97ea29624b77fd7","blockSize":4194304,"blocks":["0d01be23e2a31212f61ae8856bd916709156f2c56c7434dbe97ea29624b77fd7"]}},"license":{"size":1109,"offset":"10902386","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"node_modules":{"files":{"path-exists":{"files":{"index.js":{"size":252,"offset":"10903495","integrity":{"algorithm":"SHA256","hash":"2557a5378ea2cab729e51b6fce5da24c782940d219a6bd6ade069190e919894f","blockSize":4194304,"blocks":["2557a5378ea2cab729e51b6fce5da24c782940d219a6bd6ade069190e919894f"]}},"license":{"size":1119,"offset":"10903747","integrity":{"algorithm":"SHA256","hash":"6fb9754611c20f6649f68805e8c990e83261f29316e29de9e6cedae607b8634c","blockSize":4194304,"blocks":["6fb9754611c20f6649f68805e8c990e83261f29316e29de9e6cedae607b8634c"]}},"package.json":{"size":641,"offset":"10904866","integrity":{"algorithm":"SHA256","hash":"1df6a195380a8d52cff58f4b13a9ff57d3f96aee725d7d69819b44c9e056fd9a","blockSize":4194304,"blocks":["1df6a195380a8d52cff58f4b13a9ff57d3f96aee725d7d69819b44c9e056fd9a"]}},"readme.md":{"size":1304,"offset":"10905507","integrity":{"algorithm":"SHA256","hash":"36f7a7e9eb9d8c462c5ccdf3f2f7dc2e3307a960c0f1b08b2f5b66fb124b48b0","blockSize":4194304,"blocks":["36f7a7e9eb9d8c462c5ccdf3f2f7dc2e3307a960c0f1b08b2f5b66fb124b48b0"]}}}}}},"package.json":{"size":694,"offset":"10906811","integrity":{"algorithm":"SHA256","hash":"e66ebe46039c86b953484b10b8a64b620d3851cf35eeebb16c2d0a60ada5e41b","blockSize":4194304,"blocks":["e66ebe46039c86b953484b10b8a64b620d3851cf35eeebb16c2d0a60ada5e41b"]}},"readme.md":{"size":1527,"offset":"10907505","integrity":{"algorithm":"SHA256","hash":"f91cb3b67e01a6eba365555ed7f995597d72d4ecda6f5771a333504e784f1bd8","blockSize":4194304,"blocks":["f91cb3b67e01a6eba365555ed7f995597d72d4ecda6f5771a333504e784f1bd8"]}}}},"lru_map":{"files":{".npmignore":{"size":50,"offset":"10909032","integrity":{"algorithm":"SHA256","hash":"65ef8688c5283d37c445d568663556f9c3f6e5ea206c07c13a751090498a1139","blockSize":4194304,"blocks":["65ef8688c5283d37c445d568663556f9c3f6e5ea206c07c13a751090498a1139"]}},".travis.yml":{"size":81,"offset":"10909082","integrity":{"algorithm":"SHA256","hash":"3621aefb63866df9b35ad0953a4e75222e61839d41d7ce63655b2de60dd4f23e","blockSize":4194304,"blocks":["3621aefb63866df9b35ad0953a4e75222e61839d41d7ce63655b2de60dd4f23e"]}},"benchmark.js":{"size":4625,"offset":"10909163","integrity":{"algorithm":"SHA256","hash":"fd59d98ddd1db5e49ebd7106a64cfa8bf31228c22a4cf7b448028a6621d25208","blockSize":4194304,"blocks":["fd59d98ddd1db5e49ebd7106a64cfa8bf31228c22a4cf7b448028a6621d25208"]}},"benchmark.out.txt":{"size":3719,"offset":"10913788","integrity":{"algorithm":"SHA256","hash":"5a1ec3f90333b0dbe16433c333fcd6c0dcef623a90c436ebbc5d6d6c8dbb697b","blockSize":4194304,"blocks":["5a1ec3f90333b0dbe16433c333fcd6c0dcef623a90c436ebbc5d6d6c8dbb697b"]}},"example.html":{"size":2135,"offset":"10917507","integrity":{"algorithm":"SHA256","hash":"24dfb3b10ddadc9f73b849b7ea73c3790c22cab4fca2b824807b6e72db7f6411","blockSize":4194304,"blocks":["24dfb3b10ddadc9f73b849b7ea73c3790c22cab4fca2b824807b6e72db7f6411"]}},"lru.d.ts":{"size":2949,"offset":"10919642","integrity":{"algorithm":"SHA256","hash":"d3d8455595703dd80b84e57d5f60b3e15b7883ae70a2c4a28bb5858c41d1a913","blockSize":4194304,"blocks":["d3d8455595703dd80b84e57d5f60b3e15b7883ae70a2c4a28bb5858c41d1a913"]}},"lru.js":{"size":7934,"offset":"10922591","integrity":{"algorithm":"SHA256","hash":"de295860f6fda54498417ce4007417b111b38a46d3f9bfc3ecd92752161f6147","blockSize":4194304,"blocks":["de295860f6fda54498417ce4007417b111b38a46d3f9bfc3ecd92752161f6147"]}},"package.json":{"size":901,"offset":"10930525","integrity":{"algorithm":"SHA256","hash":"6e03e008c8b5f91079307810c10e5183fb8f59faa3cf6755f367dd3a229698ba","blockSize":4194304,"blocks":["6e03e008c8b5f91079307810c10e5183fb8f59faa3cf6755f367dd3a229698ba"]}},"README.md":{"size":8991,"offset":"10931426","integrity":{"algorithm":"SHA256","hash":"d444ac3606db5ac9790b4aa809172b9f7d88fe7a0093a1b01fd0abefb277dc05","blockSize":4194304,"blocks":["d444ac3606db5ac9790b4aa809172b9f7d88fe7a0093a1b01fd0abefb277dc05"]}},"test.js":{"size":7366,"offset":"10940417","integrity":{"algorithm":"SHA256","hash":"e9b58a1069c881ba54d5b79007f72ed56eaeead70a08f63e7351fa19f279f11f","blockSize":4194304,"blocks":["e9b58a1069c881ba54d5b79007f72ed56eaeead70a08f63e7351fa19f279f11f"]}},"tsconfig.json":{"size":227,"offset":"10947783","integrity":{"algorithm":"SHA256","hash":"cc71546914ebdfdcd52b845b657b0600d356261666652bb52d80a7a04375dd6b","blockSize":4194304,"blocks":["cc71546914ebdfdcd52b845b657b0600d356261666652bb52d80a7a04375dd6b"]}},"tstest.ts":{"size":174,"offset":"10948010","integrity":{"algorithm":"SHA256","hash":"e5c580cb267f1674eae1e9aac53157f8f7782055056ba25e0e1059205733b937","blockSize":4194304,"blocks":["e5c580cb267f1674eae1e9aac53157f8f7782055056ba25e0e1059205733b937"]}}}},"mimic-fn":{"files":{"index.d.ts":{"size":1211,"offset":"10948184","integrity":{"algorithm":"SHA256","hash":"304e461b1cd4f15d82f6f11cde33a90e5a6a6f4425ededbff3c95ab3284c5ba2","blockSize":4194304,"blocks":["304e461b1cd4f15d82f6f11cde33a90e5a6a6f4425ededbff3c95ab3284c5ba2"]}},"index.js":{"size":300,"offset":"10949395","integrity":{"algorithm":"SHA256","hash":"9ca2b409cdf1718ce957292dc479c83516e4ea369f4b2cb3510066d4e50074e2","blockSize":4194304,"blocks":["9ca2b409cdf1718ce957292dc479c83516e4ea369f4b2cb3510066d4e50074e2"]}},"license":{"size":1109,"offset":"10949695","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":641,"offset":"10950804","integrity":{"algorithm":"SHA256","hash":"4601a9fd2b6cdcc0ee3220f2544523bea4366099ac356ca6a6d2fb73b5d4fef6","blockSize":4194304,"blocks":["4601a9fd2b6cdcc0ee3220f2544523bea4366099ac356ca6a6d2fb73b5d4fef6"]}},"readme.md":{"size":1196,"offset":"10951445","integrity":{"algorithm":"SHA256","hash":"4bd571e682d96c3915f33f19c0ba15879879f1dac5a91ac1079d7b6b9aa53c8a","blockSize":4194304,"blocks":["4bd571e682d96c3915f33f19c0ba15879879f1dac5a91ac1079d7b6b9aa53c8a"]}}}},"ms":{"files":{"index.js":{"size":3024,"offset":"10952641","integrity":{"algorithm":"SHA256","hash":"e5f0b6a946a9b2b356a28557728410717df54ea2f599edb619f9839df6b7b0e9","blockSize":4194304,"blocks":["e5f0b6a946a9b2b356a28557728410717df54ea2f599edb619f9839df6b7b0e9"]}},"license.md":{"size":1079,"offset":"10955665","integrity":{"algorithm":"SHA256","hash":"1662fae9b5314d11cf51284e2dcd1f006a354f7343f08712a730fcff9a359801","blockSize":4194304,"blocks":["1662fae9b5314d11cf51284e2dcd1f006a354f7343f08712a730fcff9a359801"]}},"package.json":{"size":732,"offset":"10956744","integrity":{"algorithm":"SHA256","hash":"1a6b4d9739790c0b94ab96c8cc0507e281c164c311ff4fbf5e57fb8d26290b40","blockSize":4194304,"blocks":["1a6b4d9739790c0b94ab96c8cc0507e281c164c311ff4fbf5e57fb8d26290b40"]}},"readme.md":{"size":1886,"offset":"10957476","integrity":{"algorithm":"SHA256","hash":"8bf6c4f414b123ea2a9375b91982882d01d8561ce7d12e3bb4f448c23359f040","blockSize":4194304,"blocks":["8bf6c4f414b123ea2a9375b91982882d01d8561ce7d12e3bb4f448c23359f040"]}}}},"onetime":{"files":{"index.d.ts":{"size":1259,"offset":"10959362","integrity":{"algorithm":"SHA256","hash":"473dc2a4d220778e0d12e3df20b4434008b8a62f0eb33adf2f91825a1bd81773","blockSize":4194304,"blocks":["473dc2a4d220778e0d12e3df20b4434008b8a62f0eb33adf2f91825a1bd81773"]}},"index.js":{"size":1120,"offset":"10960621","integrity":{"algorithm":"SHA256","hash":"59a0b25379fff19195343d47759339397c689e8ab93270adcab2d106a80e1625","blockSize":4194304,"blocks":["59a0b25379fff19195343d47759339397c689e8ab93270adcab2d106a80e1625"]}},"license":{"size":1117,"offset":"10961741","integrity":{"algorithm":"SHA256","hash":"5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3","blockSize":4194304,"blocks":["5c932d88256b4ab958f64a856fa48e8bd1f55bc1d96b8149c65689e0c61789d3"]}},"package.json":{"size":715,"offset":"10962858","integrity":{"algorithm":"SHA256","hash":"2ccc81d28d7d13e2868eaf69e8e7fcdac6a4ae912235707cbdaef321385344b7","blockSize":4194304,"blocks":["2ccc81d28d7d13e2868eaf69e8e7fcdac6a4ae912235707cbdaef321385344b7"]}},"readme.md":{"size":1962,"offset":"10963573","integrity":{"algorithm":"SHA256","hash":"ff63f66c164b2869e1963865c4f77875fa26f47e8ace82691e1e81b053c0e07a","blockSize":4194304,"blocks":["ff63f66c164b2869e1963865c4f77875fa26f47e8ace82691e1e81b053c0e07a"]}}}},"p-limit":{"files":{"index.d.ts":{"size":1349,"offset":"10965535","integrity":{"algorithm":"SHA256","hash":"f0f0fa01772a2d3baedca7341b361483e25bb275cb645bc3b52d9c8b569eb40f","blockSize":4194304,"blocks":["f0f0fa01772a2d3baedca7341b361483e25bb275cb645bc3b52d9c8b569eb40f"]}},"index.js":{"size":1114,"offset":"10966884","integrity":{"algorithm":"SHA256","hash":"b005ce7e192e136df67e3b724bfc156c396ac46928c79508d6fd532bef98cbec","blockSize":4194304,"blocks":["b005ce7e192e136df67e3b724bfc156c396ac46928c79508d6fd532bef98cbec"]}},"license":{"size":1109,"offset":"10967998","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":924,"offset":"10969107","integrity":{"algorithm":"SHA256","hash":"d4529e88d06488042103f25322b0b60d90dfc5de0ed61c3b7c7d27f2ac3fe1bb","blockSize":4194304,"blocks":["d4529e88d06488042103f25322b0b60d90dfc5de0ed61c3b7c7d27f2ac3fe1bb"]}},"readme.md":{"size":2894,"offset":"10970031","integrity":{"algorithm":"SHA256","hash":"f33a3fea32927b4a53e8a07ccff4e6722c5e1e8c4c44175f266a914816d88903","blockSize":4194304,"blocks":["f33a3fea32927b4a53e8a07ccff4e6722c5e1e8c4c44175f266a914816d88903"]}}}},"p-locate":{"files":{"index.js":{"size":1042,"offset":"10972925","integrity":{"algorithm":"SHA256","hash":"8e5e49ae61d019cf6f74e59e114190fc06bafa85c2084d1731b3ccbeb445e572","blockSize":4194304,"blocks":["8e5e49ae61d019cf6f74e59e114190fc06bafa85c2084d1731b3ccbeb445e572"]}},"license":{"size":1109,"offset":"10973967","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":823,"offset":"10975076","integrity":{"algorithm":"SHA256","hash":"e319842e7dae3cf6a281799f69d1b1cbb11cb98a92a02e7a2bac27d9d6f31570","blockSize":4194304,"blocks":["e319842e7dae3cf6a281799f69d1b1cbb11cb98a92a02e7a2bac27d9d6f31570"]}},"readme.md":{"size":2081,"offset":"10975899","integrity":{"algorithm":"SHA256","hash":"5478269bf3241e8ac647fdb50a0bf9e4c9a84e7cd81cb468afb1af8d6355d52d","blockSize":4194304,"blocks":["5478269bf3241e8ac647fdb50a0bf9e4c9a84e7cd81cb468afb1af8d6355d52d"]}}}},"p-try":{"files":{"index.d.ts":{"size":1082,"offset":"10977980","integrity":{"algorithm":"SHA256","hash":"eed362bb69f02efd66fbe7050f1681f87751209cea8c877d5ee3e00d1ae36bb5","blockSize":4194304,"blocks":["eed362bb69f02efd66fbe7050f1681f87751209cea8c877d5ee3e00d1ae36bb5"]}},"index.js":{"size":211,"offset":"10979062","integrity":{"algorithm":"SHA256","hash":"98b069ba5ff64b0f988162a310c47110d5c121d42c33aa7314817393f453c9e3","blockSize":4194304,"blocks":["98b069ba5ff64b0f988162a310c47110d5c121d42c33aa7314817393f453c9e3"]}},"license":{"size":1109,"offset":"10979273","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":636,"offset":"10980382","integrity":{"algorithm":"SHA256","hash":"ff793c821f36985cde9f9d9ff6297e6c1304f8e597aa2d48dc53eda83c11e54c","blockSize":4194304,"blocks":["ff793c821f36985cde9f9d9ff6297e6c1304f8e597aa2d48dc53eda83c11e54c"]}},"readme.md":{"size":1333,"offset":"10981018","integrity":{"algorithm":"SHA256","hash":"2389e9cb72fae2955b9c76b1f45c9a626c23dd506a44a474796fc5212c16607b","blockSize":4194304,"blocks":["2389e9cb72fae2955b9c76b1f45c9a626c23dd506a44a474796fc5212c16607b"]}}}},"pkg-up":{"files":{"index.d.ts":{"size":914,"offset":"10982351","integrity":{"algorithm":"SHA256","hash":"a1ca0d54b80bcb6d19c95dd43e72dcf65fb9c510181db0fdbffdd756e7763a16","blockSize":4194304,"blocks":["a1ca0d54b80bcb6d19c95dd43e72dcf65fb9c510181db0fdbffdd756e7763a16"]}},"index.js":{"size":194,"offset":"10983265","integrity":{"algorithm":"SHA256","hash":"424a480322b22b7315bddab07ef565f450f6f63b5ab920d853237b986d419df2","blockSize":4194304,"blocks":["424a480322b22b7315bddab07ef565f450f6f63b5ab920d853237b986d419df2"]}},"license":{"size":1109,"offset":"10983459","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"node_modules":{"files":{"find-up":{"files":{"index.js":{"size":968,"offset":"10984568","integrity":{"algorithm":"SHA256","hash":"b2b7a4a3a202785dfc044bc9d3798df684c9983008254e44e23258f80c7aba54","blockSize":4194304,"blocks":["b2b7a4a3a202785dfc044bc9d3798df684c9983008254e44e23258f80c7aba54"]}},"license":{"size":1109,"offset":"10985536","integrity":{"algorithm":"SHA256","hash":"48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0","blockSize":4194304,"blocks":["48da2f39e100d4085767e94966b43f4fa95ff6a0698fba57ed460914e35f94a0"]}},"package.json":{"size":750,"offset":"10986645","integrity":{"algorithm":"SHA256","hash":"2a2df73310e2581d941e5c1b5e8bc93abfb1737c04d5e175651bbec692d8a9d4","blockSize":4194304,"blocks":["2a2df73310e2581d941e5c1b5e8bc93abfb1737c04d5e175651bbec692d8a9d4"]}},"readme.md":{"size":2018,"offset":"10987395","integrity":{"algorithm":"SHA256","hash":"3884d34601cfe2581ddaae7dce6982798a6cfe01dab2b76c239c19f09f666f75","blockSize":4194304,"blocks":["3884d34601cfe2581ddaae7dce6982798a6cfe01dab2b76c239c19f09f666f75"]}}}}}},"package.json":{"size":762,"offset":"10989413","integrity":{"algorithm":"SHA256","hash":"dc9df43a568637b6bb93feadf9aeee769fe24f183481d2259c47953c55464645","blockSize":4194304,"blocks":["dc9df43a568637b6bb93feadf9aeee769fe24f183481d2259c47953c55464645"]}},"readme.md":{"size":1271,"offset":"10990175","integrity":{"algorithm":"SHA256","hash":"2f81a8fff9a5449eb953477f2a4104480aeedf30dca450ebbcb31519b0271a6f","blockSize":4194304,"blocks":["2f81a8fff9a5449eb953477f2a4104480aeedf30dca450ebbcb31519b0271a6f"]}}}},"require-from-string":{"files":{"index.js":{"size":866,"offset":"10991446","integrity":{"algorithm":"SHA256","hash":"cb059342a762b955997bf780f3693add176922727f2fa9f11fcaf1b3fc323239","blockSize":4194304,"blocks":["cb059342a762b955997bf780f3693add176922727f2fa9f11fcaf1b3fc323239"]}},"license":{"size":1128,"offset":"10992312","integrity":{"algorithm":"SHA256","hash":"6ee0feb1f6ef996ff5a68600f8cf98909cf412d39ef3cdceaefd87d636fa1b7f","blockSize":4194304,"blocks":["6ee0feb1f6ef996ff5a68600f8cf98909cf412d39ef3cdceaefd87d636fa1b7f"]}},"package.json":{"size":511,"offset":"10993440","integrity":{"algorithm":"SHA256","hash":"c0002f7d4c7d7e2a885cf0f97226344902417c3a0980f2beca41962d2bc1f6d8","blockSize":4194304,"blocks":["c0002f7d4c7d7e2a885cf0f97226344902417c3a0980f2beca41962d2bc1f6d8"]}},"readme.md":{"size":917,"offset":"10993951","integrity":{"algorithm":"SHA256","hash":"969286b710026d911ed5e09e5bdca2dbf1c921662defa2ad3a1b3760a0bdb213","blockSize":4194304,"blocks":["969286b710026d911ed5e09e5bdca2dbf1c921662defa2ad3a1b3760a0bdb213"]}}}},"semver":{"files":{"bin":{"files":{"semver.js":{"size":4690,"offset":"10994868","integrity":{"algorithm":"SHA256","hash":"bd2513623cb89fdd6b0de34553d45b41957f179fb8c7ed7fd57aadb00599dfcf","blockSize":4194304,"blocks":["bd2513623cb89fdd6b0de34553d45b41957f179fb8c7ed7fd57aadb00599dfcf"]}}}},"classes":{"files":{"comparator.js":{"size":3617,"offset":"10999558","integrity":{"algorithm":"SHA256","hash":"5e6c49b503b8dd4d62435cddf50763bbad210e180648ebc96311a5207c4b776e","blockSize":4194304,"blocks":["5e6c49b503b8dd4d62435cddf50763bbad210e180648ebc96311a5207c4b776e"]}},"index.js":{"size":129,"offset":"11003175","integrity":{"algorithm":"SHA256","hash":"3eab3d0ab16e6b89eb282a8d97e0020f85d938b2d064386445c7d10858a2be98","blockSize":4194304,"blocks":["3eab3d0ab16e6b89eb282a8d97e0020f85d938b2d064386445c7d10858a2be98"]}},"range.js":{"size":14924,"offset":"11003304","integrity":{"algorithm":"SHA256","hash":"9c8e93a7d2976ad9155b57e4f473b209da99e1916bfc5e1f9c71841903be4b31","blockSize":4194304,"blocks":["9c8e93a7d2976ad9155b57e4f473b209da99e1916bfc5e1f9c71841903be4b31"]}},"semver.js":{"size":8751,"offset":"11018228","integrity":{"algorithm":"SHA256","hash":"97fa6bb39568689fc8ea80f9cf4852296d5f72950aa77e0e9fd5e9ea33cb76b0","blockSize":4194304,"blocks":["97fa6bb39568689fc8ea80f9cf4852296d5f72950aa77e0e9fd5e9ea33cb76b0"]}}}},"functions":{"files":{"clean.js":{"size":191,"offset":"11026979","integrity":{"algorithm":"SHA256","hash":"f539e00fdd674e57cec16ac7aa8c0d10483b31bf01c1c3f1f4bb202014b280ca","blockSize":4194304,"blocks":["f539e00fdd674e57cec16ac7aa8c0d10483b31bf01c1c3f1f4bb202014b280ca"]}},"cmp.js":{"size":947,"offset":"11027170","integrity":{"algorithm":"SHA256","hash":"19d0f4d1a269078002691b4b617240c7e3ee5957e4a3610e00c1408c63e9a4a9","blockSize":4194304,"blocks":["19d0f4d1a269078002691b4b617240c7e3ee5957e4a3610e00c1408c63e9a4a9"]}},"coerce.js":{"size":1990,"offset":"11028117","integrity":{"algorithm":"SHA256","hash":"6451d7fd1d2ca73ac37f205b9a8ee80785a149b8460451fa7a93e0dc0d124cf1","blockSize":4194304,"blocks":["6451d7fd1d2ca73ac37f205b9a8ee80785a149b8460451fa7a93e0dc0d124cf1"]}},"compare-build.js":{"size":267,"offset":"11030107","integrity":{"algorithm":"SHA256","hash":"56191fa0ed27633a33fed9c99d657e305cf5452b1e677dd38610948a050146e0","blockSize":4194304,"blocks":["56191fa0ed27633a33fed9c99d657e305cf5452b1e677dd38610948a050146e0"]}},"compare-loose.js":{"size":118,"offset":"11030374","integrity":{"algorithm":"SHA256","hash":"9b75aece458d05e13a299afdd745de6ae6069287862e1d5bc718facb24da7692","blockSize":4194304,"blocks":["9b75aece458d05e13a299afdd745de6ae6069287862e1d5bc718facb24da7692"]}},"compare.js":{"size":156,"offset":"11030492","integrity":{"algorithm":"SHA256","hash":"cf3e198a250760cf344e0b575dbaad7d8b470cb56e25ce2152adbdf82fa3e5e8","blockSize":4194304,"blocks":["cf3e198a250760cf344e0b575dbaad7d8b470cb56e25ce2152adbdf82fa3e5e8"]}},"diff.js":{"size":1612,"offset":"11030648","integrity":{"algorithm":"SHA256","hash":"c6694c00d8a5dd9592b9767c53b3cff370cdd039d3de43a2735be73aa4da7aa2","blockSize":4194304,"blocks":["c6694c00d8a5dd9592b9767c53b3cff370cdd039d3de43a2735be73aa4da7aa2"]}},"eq.js":{"size":112,"offset":"11032260","integrity":{"algorithm":"SHA256","hash":"ee5dc50b4a4b35219e016730aa8631b25d122447dd7df56ec447dd202fd79ad4","blockSize":4194304,"blocks":["ee5dc50b4a4b35219e016730aa8631b25d122447dd7df56ec447dd202fd79ad4"]}},"gt.js":{"size":110,"offset":"11032372","integrity":{"algorithm":"SHA256","hash":"0776eca71f280f369a20f6edbd03c192b1722dfe6a0681c40d63798bb81a6459","blockSize":4194304,"blocks":["0776eca71f280f369a20f6edbd03c192b1722dfe6a0681c40d63798bb81a6459"]}},"gte.js":{"size":113,"offset":"11032482","integrity":{"algorithm":"SHA256","hash":"67f27bd87586a498c22954fd41f45971c079aea34cec7d63563becd62de0c810","blockSize":4194304,"blocks":["67f27bd87586a498c22954fd41f45971c079aea34cec7d63563becd62de0c810"]}},"inc.js":{"size":464,"offset":"11032595","integrity":{"algorithm":"SHA256","hash":"cf98803f6d73f5a9954b3d1a548145bd41a0486b9fc0b354bca2802996242c3d","blockSize":4194304,"blocks":["cf98803f6d73f5a9954b3d1a548145bd41a0486b9fc0b354bca2802996242c3d"]}},"lt.js":{"size":110,"offset":"11033059","integrity":{"algorithm":"SHA256","hash":"124f2039c547d2a4fe83b9a56e6c3b911d383289d47238f4f558ea4061c4348e","blockSize":4194304,"blocks":["124f2039c547d2a4fe83b9a56e6c3b911d383289d47238f4f558ea4061c4348e"]}},"lte.js":{"size":113,"offset":"11033169","integrity":{"algorithm":"SHA256","hash":"5ad1ce1860079ccf25a7fe62211361fe6cd2ac06a9fc4616a288fa3bb6ffa648","blockSize":4194304,"blocks":["5ad1ce1860079ccf25a7fe62211361fe6cd2ac06a9fc4616a288fa3bb6ffa648"]}},"major.js":{"size":122,"offset":"11033282","integrity":{"algorithm":"SHA256","hash":"c7e03fbb9bc1528ea1681c2433ad73d241b023c6200a7b13fa63ec083b81e017","blockSize":4194304,"blocks":["c7e03fbb9bc1528ea1681c2433ad73d241b023c6200a7b13fa63ec083b81e017"]}},"minor.js":{"size":122,"offset":"11033404","integrity":{"algorithm":"SHA256","hash":"a1bd5b53471eaf3d551c3bfb4b611f64832a0be79d82bc0a2d5ee0ff8b6892e4","blockSize":4194304,"blocks":["a1bd5b53471eaf3d551c3bfb4b611f64832a0be79d82bc0a2d5ee0ff8b6892e4"]}},"neq.js":{"size":114,"offset":"11033526","integrity":{"algorithm":"SHA256","hash":"e1acdf7fbb4cd40e372a37443d2ef2504fe1524e0f214317912418ed5a0a246e","blockSize":4194304,"blocks":["e1acdf7fbb4cd40e372a37443d2ef2504fe1524e0f214317912418ed5a0a246e"]}},"parse.js":{"size":317,"offset":"11033640","integrity":{"algorithm":"SHA256","hash":"7fc0f13440bef81f8a7fb4591f8ebaa8f2c219319d63e669e514710417d10806","blockSize":4194304,"blocks":["7fc0f13440bef81f8a7fb4591f8ebaa8f2c219319d63e669e514710417d10806"]}},"patch.js":{"size":122,"offset":"11033957","integrity":{"algorithm":"SHA256","hash":"6bc095689e62eb2aa401033b090870d24373aa4e992089c2256773133c994969","blockSize":4194304,"blocks":["6bc095689e62eb2aa401033b090870d24373aa4e992089c2256773133c994969"]}},"prerelease.js":{"size":220,"offset":"11034079","integrity":{"algorithm":"SHA256","hash":"683e026b74f0d18374161c14c4b367ff0848e568da9fb8bfb3196bc985c26d95","blockSize":4194304,"blocks":["683e026b74f0d18374161c14c4b367ff0848e568da9fb8bfb3196bc985c26d95"]}},"rcompare.js":{"size":118,"offset":"11034299","integrity":{"algorithm":"SHA256","hash":"5c95ff2fa2f8533041579f34835e2b4f5680ea9f4d8d08ff1f4d537cfd9f7896","blockSize":4194304,"blocks":["5c95ff2fa2f8533041579f34835e2b4f5680ea9f4d8d08ff1f4d537cfd9f7896"]}},"rsort.js":{"size":149,"offset":"11034417","integrity":{"algorithm":"SHA256","hash":"89dbdb1542343cb549ecd12cd8c79ae01e6111215445ea6b091f337faddd6ebe","blockSize":4194304,"blocks":["89dbdb1542343cb549ecd12cd8c79ae01e6111215445ea6b091f337faddd6ebe"]}},"satisfies.js":{"size":233,"offset":"11034566","integrity":{"algorithm":"SHA256","hash":"dac3a0af5bbd5ebd2e9b8486582ed61ddec694a9fc9d6afb343b185a1fb3e59f","blockSize":4194304,"blocks":["dac3a0af5bbd5ebd2e9b8486582ed61ddec694a9fc9d6afb343b185a1fb3e59f"]}},"sort.js":{"size":147,"offset":"11034799","integrity":{"algorithm":"SHA256","hash":"5e3e30991733d8c977afb5cef564a855c2bccd96c080d83e5422e3876cd512fd","blockSize":4194304,"blocks":["5e3e30991733d8c977afb5cef564a855c2bccd96c080d83e5422e3876cd512fd"]}},"valid.js":{"size":162,"offset":"11034946","integrity":{"algorithm":"SHA256","hash":"d60b69794e2094b2aef35abbed5d17b9e14b41a4fef2ad5a38da4e2171d1c49f","blockSize":4194304,"blocks":["d60b69794e2094b2aef35abbed5d17b9e14b41a4fef2ad5a38da4e2171d1c49f"]}}}},"index.js":{"size":2616,"offset":"11035108","integrity":{"algorithm":"SHA256","hash":"02d8461fc6158ed3fdd4dad17905bee651a1638218db1fb5fbb84e83144aa3a9","blockSize":4194304,"blocks":["02d8461fc6158ed3fdd4dad17905bee651a1638218db1fb5fbb84e83144aa3a9"]}},"internal":{"files":{"constants.js":{"size":859,"offset":"11037724","integrity":{"algorithm":"SHA256","hash":"0e3c33323906f2c612b0855895965f3ebac4865dd8fa9c6b4893cd4ea71e383e","blockSize":4194304,"blocks":["0e3c33323906f2c612b0855895965f3ebac4865dd8fa9c6b4893cd4ea71e383e"]}},"debug.js":{"size":226,"offset":"11038583","integrity":{"algorithm":"SHA256","hash":"9557f905ecf6e36f97653841e08fd30074ba37ad529070a090ba352986de4fa2","blockSize":4194304,"blocks":["9557f905ecf6e36f97653841e08fd30074ba37ad529070a090ba352986de4fa2"]}},"identifiers.js":{"size":410,"offset":"11038809","integrity":{"algorithm":"SHA256","hash":"b8799f9187c52ceefee48a395e09073f1d1594c8468c012e84104e72d8f7014d","blockSize":4194304,"blocks":["b8799f9187c52ceefee48a395e09073f1d1594c8468c012e84104e72d8f7014d"]}},"lrucache.js":{"size":788,"offset":"11039219","integrity":{"algorithm":"SHA256","hash":"b6d63fb5bb131ff5fd0e5eac6ae830fd04495e180af03663154e0aa98d9eb5ad","blockSize":4194304,"blocks":["b6d63fb5bb131ff5fd0e5eac6ae830fd04495e180af03663154e0aa98d9eb5ad"]}},"parse-options.js":{"size":324,"offset":"11040007","integrity":{"algorithm":"SHA256","hash":"481b04e12442738b4621d07fad8ee5b87bff5bab69830458731fa91611035972","blockSize":4194304,"blocks":["481b04e12442738b4621d07fad8ee5b87bff5bab69830458731fa91611035972"]}},"re.js":{"size":7937,"offset":"11040331","integrity":{"algorithm":"SHA256","hash":"8f2f0bb0b0f1316070110bdcd0fa7461ac38d11a92f7ccea86cbde465cafc71d","blockSize":4194304,"blocks":["8f2f0bb0b0f1316070110bdcd0fa7461ac38d11a92f7ccea86cbde465cafc71d"]}}}},"LICENSE":{"size":765,"offset":"11048268","integrity":{"algorithm":"SHA256","hash":"4ec3d4c66cd87f5c8d8ad911b10f99bf27cb00cdfcff82621956e379186b016b","blockSize":4194304,"blocks":["4ec3d4c66cd87f5c8d8ad911b10f99bf27cb00cdfcff82621956e379186b016b"]}},"package.json":{"size":1629,"offset":"11049033","integrity":{"algorithm":"SHA256","hash":"3ef741769b181fd6a352c30e1254c6a9e55de3588376188ad3f6265765027278","blockSize":4194304,"blocks":["3ef741769b181fd6a352c30e1254c6a9e55de3588376188ad3f6265765027278"]}},"preload.js":{"size":69,"offset":"11050662","integrity":{"algorithm":"SHA256","hash":"4117401437ccb64a0438e0b65f92215706fb892a4a1161367fbee215a4627716","blockSize":4194304,"blocks":["4117401437ccb64a0438e0b65f92215706fb892a4a1161367fbee215a4627716"]}},"range.bnf":{"size":619,"offset":"11050731","integrity":{"algorithm":"SHA256","hash":"ed628fdaff64be366d07f6cc4559eae4de109826f743ea7f5e1588c370bca49a","blockSize":4194304,"blocks":["ed628fdaff64be366d07f6cc4559eae4de109826f743ea7f5e1588c370bca49a"]}},"ranges":{"files":{"gtr.js":{"size":217,"offset":"11051350","integrity":{"algorithm":"SHA256","hash":"3584a1c39f7482b8a2733cc4630777a6881c627cf2fb1065e7b3387134ae0899","blockSize":4194304,"blocks":["3584a1c39f7482b8a2733cc4630777a6881c627cf2fb1065e7b3387134ae0899"]}},"intersects.js":{"size":210,"offset":"11051567","integrity":{"algorithm":"SHA256","hash":"64f5052c8850641901e2946af711de41f4a20c2ffeb4671c08d305c525d4fa22","blockSize":4194304,"blocks":["64f5052c8850641901e2946af711de41f4a20c2ffeb4671c08d305c525d4fa22"]}},"ltr.js":{"size":213,"offset":"11051777","integrity":{"algorithm":"SHA256","hash":"9b2b8cad227317839a7e47c5b835a7f45e3e861270ca3e335c2bb693c1bd425a","blockSize":4194304,"blocks":["9b2b8cad227317839a7e47c5b835a7f45e3e861270ca3e335c2bb693c1bd425a"]}},"max-satisfying.js":{"size":579,"offset":"11051990","integrity":{"algorithm":"SHA256","hash":"cbc560048c06fb1a3c75412638bf89ddb9782f373a744ffc4d8f2aa0b8d11c3c","blockSize":4194304,"blocks":["cbc560048c06fb1a3c75412638bf89ddb9782f373a744ffc4d8f2aa0b8d11c3c"]}},"min-satisfying.js":{"size":577,"offset":"11052569","integrity":{"algorithm":"SHA256","hash":"9ea81eb30019b58fd6218ff40f565af60e9e52574ac1cc882e6841fc75b3e8bd","blockSize":4194304,"blocks":["9ea81eb30019b58fd6218ff40f565af60e9e52574ac1cc882e6841fc75b3e8bd"]}},"min-version.js":{"size":1500,"offset":"11053146","integrity":{"algorithm":"SHA256","hash":"639d348b2c5b0e1690c790fbf6daa4a619ebcf52a1b675002fdb8b4b99823500","blockSize":4194304,"blocks":["639d348b2c5b0e1690c790fbf6daa4a619ebcf52a1b675002fdb8b4b99823500"]}},"outside.js":{"size":2190,"offset":"11054646","integrity":{"algorithm":"SHA256","hash":"94adbe6d54f2da683d27c3c5ee7c98223400d96ad57a5851eb069743e11e8538","blockSize":4194304,"blocks":["94adbe6d54f2da683d27c3c5ee7c98223400d96ad57a5851eb069743e11e8538"]}},"simplify.js":{"size":1341,"offset":"11056836","integrity":{"algorithm":"SHA256","hash":"9120ea55b47227123790fc401f7496a60d85791d010a4311bb34d071f8718456","blockSize":4194304,"blocks":["9120ea55b47227123790fc401f7496a60d85791d010a4311bb34d071f8718456"]}},"subset.js":{"size":7510,"offset":"11058177","integrity":{"algorithm":"SHA256","hash":"47a24ce992a4ccf180ff865a5be97da6e33344ee0544da87dac9b6ac50323e8b","blockSize":4194304,"blocks":["47a24ce992a4ccf180ff865a5be97da6e33344ee0544da87dac9b6ac50323e8b"]}},"to-comparators.js":{"size":268,"offset":"11065687","integrity":{"algorithm":"SHA256","hash":"c809ef2c27b2e9e47cea6781d1b61e92adabccb139abfac009df253cfc4f6fd3","blockSize":4194304,"blocks":["c809ef2c27b2e9e47cea6781d1b61e92adabccb139abfac009df253cfc4f6fd3"]}},"valid.js":{"size":312,"offset":"11065955","integrity":{"algorithm":"SHA256","hash":"4f6b4eb0d05fda0e9774ecb1b7464d6fc25c75f1d9df3423ace4cbb2ec466fc4","blockSize":4194304,"blocks":["4f6b4eb0d05fda0e9774ecb1b7464d6fc25c75f1d9df3423ace4cbb2ec466fc4"]}}}},"README.md":{"size":24425,"offset":"11066267","integrity":{"algorithm":"SHA256","hash":"6045246f9f1f04c93268cd20e204ec28c984d8c0e0a8675b300a22aa1ae11782","blockSize":4194304,"blocks":["6045246f9f1f04c93268cd20e204ec28c984d8c0e0a8675b300a22aa1ae11782"]}}}},"tslib":{"files":{"CopyrightNotice.txt":{"size":824,"offset":"11090692","integrity":{"algorithm":"SHA256","hash":"dd835e67a9a297da32f9467d7677a5d02c8e50e10f15da43b810147c79c04b9b","blockSize":4194304,"blocks":["dd835e67a9a297da32f9467d7677a5d02c8e50e10f15da43b810147c79c04b9b"]}},"LICENSE.txt":{"size":655,"offset":"11091516","integrity":{"algorithm":"SHA256","hash":"210b19e543130388c68654b7497e967119ce17145f66ab7d85688fbd70f08751","blockSize":4194304,"blocks":["210b19e543130388c68654b7497e967119ce17145f66ab7d85688fbd70f08751"]}},"modules":{"files":{"index.js":{"size":943,"offset":"11092171","integrity":{"algorithm":"SHA256","hash":"0cbc8b41cba19bb8ad0426fef9483ed7aa3ac394dbc0e81ce867dc70628ba7dd","blockSize":4194304,"blocks":["0cbc8b41cba19bb8ad0426fef9483ed7aa3ac394dbc0e81ce867dc70628ba7dd"]}},"package.json":{"size":26,"offset":"11093114","integrity":{"algorithm":"SHA256","hash":"f2a77d1fa2e7ee710b2835b2933d75d9c7f5dad4f1bab69e1679876e32b5e9eb","blockSize":4194304,"blocks":["f2a77d1fa2e7ee710b2835b2933d75d9c7f5dad4f1bab69e1679876e32b5e9eb"]}}}},"package.json":{"size":915,"offset":"11093140","integrity":{"algorithm":"SHA256","hash":"f685f35daa1c75b3e6e3e2e9158de36130e34aee095498f65af9e508ea2d56b0","blockSize":4194304,"blocks":["f685f35daa1c75b3e6e3e2e9158de36130e34aee095498f65af9e508ea2d56b0"]}},"README.md":{"size":3447,"offset":"11094055","integrity":{"algorithm":"SHA256","hash":"54f35179f2036fd5b0ec8644da382d8b7bff7bacad270fccf1551ebd87bacdfc","blockSize":4194304,"blocks":["54f35179f2036fd5b0ec8644da382d8b7bff7bacad270fccf1551ebd87bacdfc"]}},"test":{"files":{"validateModuleExportsMatchCommonJS":{"files":{"index.js":{"size":824,"offset":"11097502","integrity":{"algorithm":"SHA256","hash":"00b5ce45bce6112112e095b29000ebb956b574578158d4db75b6ffa886b82847","blockSize":4194304,"blocks":["00b5ce45bce6112112e095b29000ebb956b574578158d4db75b6ffa886b82847"]}},"package.json":{"size":71,"offset":"11098326","integrity":{"algorithm":"SHA256","hash":"78788bda138d0c32fdf5b5dce49f5dfb75cc90dc25cf59ba703259dfc33812ce","blockSize":4194304,"blocks":["78788bda138d0c32fdf5b5dce49f5dfb75cc90dc25cf59ba703259dfc33812ce"]}}}}}},"tslib.d.ts":{"size":2714,"offset":"11098397","integrity":{"algorithm":"SHA256","hash":"4576b4e61049f5ffd7c9e935cf88832e089265bdb15ffc35077310042cbbbeea","blockSize":4194304,"blocks":["4576b4e61049f5ffd7c9e935cf88832e089265bdb15ffc35077310042cbbbeea"]}},"tslib.es6.html":{"size":36,"offset":"11101111","integrity":{"algorithm":"SHA256","hash":"759c26504a9ccbbfcd730269c9c5ef15512cf16ba617e61a92212365e57c9f5d","blockSize":4194304,"blocks":["759c26504a9ccbbfcd730269c9c5ef15512cf16ba617e61a92212365e57c9f5d"]}},"tslib.es6.js":{"size":10274,"offset":"11101147","integrity":{"algorithm":"SHA256","hash":"cd10f47b56da85cf5d1b7fa03f973b1f011bfe975e2a82a18ef7abe844491b12","blockSize":4194304,"blocks":["cd10f47b56da85cf5d1b7fa03f973b1f011bfe975e2a82a18ef7abe844491b12"]}},"tslib.html":{"size":32,"offset":"11111421","integrity":{"algorithm":"SHA256","hash":"e14179f388a9690437165289d45ff7747f0f839538b5abec63d2dcfe21c2a5f4","blockSize":4194304,"blocks":["e14179f388a9690437165289d45ff7747f0f839538b5abec63d2dcfe21c2a5f4"]}},"tslib.js":{"size":13204,"offset":"11111453","integrity":{"algorithm":"SHA256","hash":"84df36bfcbbdfdbea006f78f150e70655d4801a402dc56a8e466806fe018e585","blockSize":4194304,"blocks":["84df36bfcbbdfdbea006f78f150e70655d4801a402dc56a8e466806fe018e585"]}}}},"type-fest":{"files":{"index.d.ts":{"size":4493,"offset":"11124657","integrity":{"algorithm":"SHA256","hash":"e133066d15e9e860ca96220a548dee28640039a8ac33a9130d0f83c814a78605","blockSize":4194304,"blocks":["e133066d15e9e860ca96220a548dee28640039a8ac33a9130d0f83c814a78605"]}},"package.json":{"size":1134,"offset":"11129150","integrity":{"algorithm":"SHA256","hash":"253bf6cd34d58314361fcda6d7eeaa12974cbf4f251e3171e0fb9ffccb1b07f4","blockSize":4194304,"blocks":["253bf6cd34d58314361fcda6d7eeaa12974cbf4f251e3171e0fb9ffccb1b07f4"]}},"readme.md":{"size":43433,"offset":"11130284","integrity":{"algorithm":"SHA256","hash":"15b3ed208ed59be2601610ceb50b906914766bb681632980af727d960f882cf3","blockSize":4194304,"blocks":["15b3ed208ed59be2601610ceb50b906914766bb681632980af727d960f882cf3"]}},"source":{"files":{"async-return-type.d.ts":{"size":742,"offset":"11173717","integrity":{"algorithm":"SHA256","hash":"03f4449c691dd9c51e42efd51155b63c8b89a5f56b5cf3015062e2f818be8959","blockSize":4194304,"blocks":["03f4449c691dd9c51e42efd51155b63c8b89a5f56b5cf3015062e2f818be8959"]}},"asyncify.d.ts":{"size":1246,"offset":"11174459","integrity":{"algorithm":"SHA256","hash":"84315d5153613eeb4b34990fb3bc3a1261879a06812ee7ae481141e30876d8dc","blockSize":4194304,"blocks":["84315d5153613eeb4b34990fb3bc3a1261879a06812ee7ae481141e30876d8dc"]}},"basic.d.ts":{"size":1379,"offset":"11175705","integrity":{"algorithm":"SHA256","hash":"4a15fc59b27b65b9894952048be2afc561865ec37606cd0f5e929ee4a102233b","blockSize":4194304,"blocks":["4a15fc59b27b65b9894952048be2afc561865ec37606cd0f5e929ee4a102233b"]}},"camel-case.d.ts":{"size":2040,"offset":"11177084","integrity":{"algorithm":"SHA256","hash":"6ef829366514e4a8f75ce55fa390ebe080810b347e6f4a87bbeecb41e612c079","blockSize":4194304,"blocks":["6ef829366514e4a8f75ce55fa390ebe080810b347e6f4a87bbeecb41e612c079"]}},"camel-cased-properties-deep.d.ts":{"size":1025,"offset":"11179124","integrity":{"algorithm":"SHA256","hash":"e789eb929b46299187312a01ff71905222f67907e546e491952c384b6f956a63","blockSize":4194304,"blocks":["e789eb929b46299187312a01ff71905222f67907e546e491952c384b6f956a63"]}},"camel-cased-properties.d.ts":{"size":695,"offset":"11180149","integrity":{"algorithm":"SHA256","hash":"8f313aa8055158f08bd75e3a57161fa473a50884c20142f3318f89f19bfc0373","blockSize":4194304,"blocks":["8f313aa8055158f08bd75e3a57161fa473a50884c20142f3318f89f19bfc0373"]}},"conditional-except.d.ts":{"size":1050,"offset":"11180844","integrity":{"algorithm":"SHA256","hash":"f0abf96437a6e57b9751a792ba2ebb765729a40d0d573f7f6800b305691b1afb","blockSize":4194304,"blocks":["f0abf96437a6e57b9751a792ba2ebb765729a40d0d573f7f6800b305691b1afb"]}},"conditional-keys.d.ts":{"size":1271,"offset":"11181894","integrity":{"algorithm":"SHA256","hash":"23b213ec3af677b3d33ec17d9526a88d5f226506e1b50e28ce4090fb7e4050a8","blockSize":4194304,"blocks":["23b213ec3af677b3d33ec17d9526a88d5f226506e1b50e28ce4090fb7e4050a8"]}},"conditional-pick.d.ts":{"size":966,"offset":"11183165","integrity":{"algorithm":"SHA256","hash":"7d30aee3d35e64b4f49c235d17a09e7a7ce2961bebb3996ee1db5aa192f3feba","blockSize":4194304,"blocks":["7d30aee3d35e64b4f49c235d17a09e7a7ce2961bebb3996ee1db5aa192f3feba"]}},"delimiter-case.d.ts":{"size":3103,"offset":"11184131","integrity":{"algorithm":"SHA256","hash":"a0147b607f8c88a5433a5313cdc10443c6a45ed430e1b0a335a413dc2b099fd5","blockSize":4194304,"blocks":["a0147b607f8c88a5433a5313cdc10443c6a45ed430e1b0a335a413dc2b099fd5"]}},"delimiter-cased-properties-deep.d.ts":{"size":1205,"offset":"11187234","integrity":{"algorithm":"SHA256","hash":"1285ddb279c6d0bc5fe46162a893855078ae5b708d804cd93bfc4a23d1e903d9","blockSize":4194304,"blocks":["1285ddb279c6d0bc5fe46162a893855078ae5b708d804cd93bfc4a23d1e903d9"]}},"delimiter-cased-properties.d.ts":{"size":777,"offset":"11188439","integrity":{"algorithm":"SHA256","hash":"6b1071c06abcbe1c9f60638d570fdbfe944b6768f95d9f28ebc06c7eec9b4087","blockSize":4194304,"blocks":["6b1071c06abcbe1c9f60638d570fdbfe944b6768f95d9f28ebc06c7eec9b4087"]}},"entries.d.ts":{"size":2563,"offset":"11189216","integrity":{"algorithm":"SHA256","hash":"c122227064c2ebf6a5bd2800383181395b56bb71fd6683d5e92add550302e45f","blockSize":4194304,"blocks":["c122227064c2ebf6a5bd2800383181395b56bb71fd6683d5e92add550302e45f"]}},"entry.d.ts":{"size":2842,"offset":"11191779","integrity":{"algorithm":"SHA256","hash":"4571a6886b4414403eacdd1b4cdbd854453626900ece196a173e15fb2b795155","blockSize":4194304,"blocks":["4571a6886b4414403eacdd1b4cdbd854453626900ece196a173e15fb2b795155"]}},"exact.d.ts":{"size":2940,"offset":"11194621","integrity":{"algorithm":"SHA256","hash":"5126032fe6e999f333827ee8e67f7ca1d5f3d6418025878aa5ebf13b499c2024","blockSize":4194304,"blocks":["5126032fe6e999f333827ee8e67f7ca1d5f3d6418025878aa5ebf13b499c2024"]}},"except.d.ts":{"size":1613,"offset":"11197561","integrity":{"algorithm":"SHA256","hash":"326da4aebf555d54b995854ff8f3432f63ba067be354fa16c6e1f50daa0667de","blockSize":4194304,"blocks":["326da4aebf555d54b995854ff8f3432f63ba067be354fa16c6e1f50daa0667de"]}},"fixed-length-array.d.ts":{"size":1628,"offset":"11199174","integrity":{"algorithm":"SHA256","hash":"4f92df9d64e5413d4b34020ae6b382edda84347daec97099e7c008a9d5c0910b","blockSize":4194304,"blocks":["4f92df9d64e5413d4b34020ae6b382edda84347daec97099e7c008a9d5c0910b"]}},"get.d.ts":{"size":6266,"offset":"11200802","integrity":{"algorithm":"SHA256","hash":"8e7653c13989dca094412bc4de20d5c449457fc92735546331d5e9cdd79ac16e","blockSize":4194304,"blocks":["8e7653c13989dca094412bc4de20d5c449457fc92735546331d5e9cdd79ac16e"]}},"has-optional-keys.d.ts":{"size":662,"offset":"11207068","integrity":{"algorithm":"SHA256","hash":"1573cae51ae8a5b889ec55ecb58e88978fe251fd3962efa5c4fdb69ce00b23ba","blockSize":4194304,"blocks":["1573cae51ae8a5b889ec55ecb58e88978fe251fd3962efa5c4fdb69ce00b23ba"]}},"has-required-keys.d.ts":{"size":1192,"offset":"11207730","integrity":{"algorithm":"SHA256","hash":"f2d1ac34b05bb6ce326ea1702befb0216363f1d5eccdd1b4b0b2f5a7e953ed8a","blockSize":4194304,"blocks":["f2d1ac34b05bb6ce326ea1702befb0216363f1d5eccdd1b4b0b2f5a7e953ed8a"]}},"includes.d.ts":{"size":561,"offset":"11208922","integrity":{"algorithm":"SHA256","hash":"f3dedc92d06e0fdc43e76c2e1acca21759dd63d2572c9ec78a5188249965d944","blockSize":4194304,"blocks":["f3dedc92d06e0fdc43e76c2e1acca21759dd63d2572c9ec78a5188249965d944"]}},"internal.d.ts":{"size":2159,"offset":"11209483","integrity":{"algorithm":"SHA256","hash":"c05dcfbd5bd0abcefa3ad7d2931424d4d8090bc55bbe4f5c8acb8d2ca5886b2e","blockSize":4194304,"blocks":["c05dcfbd5bd0abcefa3ad7d2931424d4d8090bc55bbe4f5c8acb8d2ca5886b2e"]}},"invariant-of.d.ts":{"size":2238,"offset":"11211642","integrity":{"algorithm":"SHA256","hash":"eec9e706eef30b4f1c6ff674738d3fca572829b7fa1715f37742863dabb3d2f2","blockSize":4194304,"blocks":["eec9e706eef30b4f1c6ff674738d3fca572829b7fa1715f37742863dabb3d2f2"]}},"iterable-element.d.ts":{"size":1449,"offset":"11213880","integrity":{"algorithm":"SHA256","hash":"7086cca41a87b3bf52c6abfc37cda0a0ec86bb7e8e5ef166b07976abec73fa5e","blockSize":4194304,"blocks":["7086cca41a87b3bf52c6abfc37cda0a0ec86bb7e8e5ef166b07976abec73fa5e"]}},"join.d.ts":{"size":1048,"offset":"11215329","integrity":{"algorithm":"SHA256","hash":"a1d1e49ccd2ac07ed8a49a3f98dfd2f7357cf03649b9e348b58b97bb75116f18","blockSize":4194304,"blocks":["a1d1e49ccd2ac07ed8a49a3f98dfd2f7357cf03649b9e348b58b97bb75116f18"]}},"jsonify.d.ts":{"size":3445,"offset":"11216377","integrity":{"algorithm":"SHA256","hash":"8fefaef4be2d484cdfc35a1b514ee7e7bb51680ef998fb9f651f532c0b169e6b","blockSize":4194304,"blocks":["8fefaef4be2d484cdfc35a1b514ee7e7bb51680ef998fb9f651f532c0b169e6b"]}},"kebab-case.d.ts":{"size":755,"offset":"11219822","integrity":{"algorithm":"SHA256","hash":"a86492d82baf906c071536e8de073e601eaa5deed138c2d9c42d471d72395d7e","blockSize":4194304,"blocks":["a86492d82baf906c071536e8de073e601eaa5deed138c2d9c42d471d72395d7e"]}},"kebab-cased-properties-deep.d.ts":{"size":880,"offset":"11220577","integrity":{"algorithm":"SHA256","hash":"d729b8b400507b9b51ff40d11e012379dbf0acd6e2f66bf596a3bc59444d9bf1","blockSize":4194304,"blocks":["d729b8b400507b9b51ff40d11e012379dbf0acd6e2f66bf596a3bc59444d9bf1"]}},"kebab-cased-properties.d.ts":{"size":639,"offset":"11221457","integrity":{"algorithm":"SHA256","hash":"92eb8a98444729aa61be5e6e489602363d763da27d1bcfdf89356c1d360484da","blockSize":4194304,"blocks":["92eb8a98444729aa61be5e6e489602363d763da27d1bcfdf89356c1d360484da"]}},"last-array-element.d.ts":{"size":771,"offset":"11222096","integrity":{"algorithm":"SHA256","hash":"189dedb255e41c8556d0d61d7f1c18506501896354d0925cbd47060bcddccab1","blockSize":4194304,"blocks":["189dedb255e41c8556d0d61d7f1c18506501896354d0925cbd47060bcddccab1"]}},"literal-to-primitive.d.ts":{"size":857,"offset":"11222867","integrity":{"algorithm":"SHA256","hash":"6626bbc69c25a92f6d32e6d2f25038f156b4c2380cbf29a420f7084fb1d2f7d7","blockSize":4194304,"blocks":["6626bbc69c25a92f6d32e6d2f25038f156b4c2380cbf29a420f7084fb1d2f7d7"]}},"literal-union.d.ts":{"size":1174,"offset":"11223724","integrity":{"algorithm":"SHA256","hash":"da2aa652d2bf03cc042e2ff31e4194f4f18f042b8344dcb2568f761daaf7869f","blockSize":4194304,"blocks":["da2aa652d2bf03cc042e2ff31e4194f4f18f042b8344dcb2568f761daaf7869f"]}},"merge-exclusive.d.ts":{"size":1363,"offset":"11224898","integrity":{"algorithm":"SHA256","hash":"f981ffdbd651f67db134479a5352dac96648ca195f981284e79dc0a1dbc53fd5","blockSize":4194304,"blocks":["f981ffdbd651f67db134479a5352dac96648ca195f981284e79dc0a1dbc53fd5"]}},"merge.d.ts":{"size":564,"offset":"11226261","integrity":{"algorithm":"SHA256","hash":"2cf38989b23031694f04308b6797877534a49818b2f5257f4a5d824e7ea82a5a","blockSize":4194304,"blocks":["2cf38989b23031694f04308b6797877534a49818b2f5257f4a5d824e7ea82a5a"]}},"multidimensional-array.d.ts":{"size":1314,"offset":"11226825","integrity":{"algorithm":"SHA256","hash":"fcc438e50c00c9e865d9c1777627d3fdc1e13a4078c996fb4b04e67e462648c8","blockSize":4194304,"blocks":["fcc438e50c00c9e865d9c1777627d3fdc1e13a4078c996fb4b04e67e462648c8"]}},"multidimensional-readonly-array.d.ts":{"size":1474,"offset":"11228139","integrity":{"algorithm":"SHA256","hash":"d0f07efa072420758194c452edb3f04f8eabc01cd4b3884a23e7274d4e2a7b69","blockSize":4194304,"blocks":["d0f07efa072420758194c452edb3f04f8eabc01cd4b3884a23e7274d4e2a7b69"]}},"mutable.d.ts":{"size":181,"offset":"11229613","integrity":{"algorithm":"SHA256","hash":"144dfcee38ebc38aae93a85bc47211c9268d529b099127b74d61242ec5c17f35","blockSize":4194304,"blocks":["144dfcee38ebc38aae93a85bc47211c9268d529b099127b74d61242ec5c17f35"]}},"numeric.d.ts":{"size":4327,"offset":"11229794","integrity":{"algorithm":"SHA256","hash":"4f0781ec008bb24dc1923285d25d648ea48fb5a3c36d0786e2ee82eb00eff426","blockSize":4194304,"blocks":["4f0781ec008bb24dc1923285d25d648ea48fb5a3c36d0786e2ee82eb00eff426"]}},"observable-like.d.ts":{"size":2055,"offset":"11234121","integrity":{"algorithm":"SHA256","hash":"744e7c636288493667d553c8f8ebd666ccbc0e715df445a4a7c4a48812f20544","blockSize":4194304,"blocks":["744e7c636288493667d553c8f8ebd666ccbc0e715df445a4a7c4a48812f20544"]}},"opaque.d.ts":{"size":3837,"offset":"11236176","integrity":{"algorithm":"SHA256","hash":"de2b56099545de410af72a7e430ead88894e43e4f959de29663d4d0ba464944d","blockSize":4194304,"blocks":["de2b56099545de410af72a7e430ead88894e43e4f959de29663d4d0ba464944d"]}},"optional-keys-of.d.ts":{"size":893,"offset":"11240013","integrity":{"algorithm":"SHA256","hash":"1edc9192dfc277c60b92525cdfa1980e1bfd161ae77286c96777d10db36be73c","blockSize":4194304,"blocks":["1edc9192dfc277c60b92525cdfa1980e1bfd161ae77286c96777d10db36be73c"]}},"package-json.d.ts":{"size":15591,"offset":"11240906","integrity":{"algorithm":"SHA256","hash":"48f0819c2e14214770232f1ab0058125bafdde1d04c4be84339d5533098bf60a","blockSize":4194304,"blocks":["48f0819c2e14214770232f1ab0058125bafdde1d04c4be84339d5533098bf60a"]}},"partial-deep.d.ts":{"size":3802,"offset":"11256497","integrity":{"algorithm":"SHA256","hash":"8fe68442c15f8952b8816fa4e7e6bd8d5c45542832206bd7bcf3ebdc77d1c3f3","blockSize":4194304,"blocks":["8fe68442c15f8952b8816fa4e7e6bd8d5c45542832206bd7bcf3ebdc77d1c3f3"]}},"partial-on-undefined-deep.d.ts":{"size":2638,"offset":"11260299","integrity":{"algorithm":"SHA256","hash":"3add9402f56a60e9b379593f69729831ac0fc9eae604b6fafde5fa86d2f8a4b9","blockSize":4194304,"blocks":["3add9402f56a60e9b379593f69729831ac0fc9eae604b6fafde5fa86d2f8a4b9"]}},"pascal-case.d.ts":{"size":672,"offset":"11262937","integrity":{"algorithm":"SHA256","hash":"fc3ee92b81a6188a545cba5c15dc7c5d38ee0aaca3d8adc29af419d9bdb1fdb9","blockSize":4194304,"blocks":["fc3ee92b81a6188a545cba5c15dc7c5d38ee0aaca3d8adc29af419d9bdb1fdb9"]}},"pascal-cased-properties-deep.d.ts":{"size":1053,"offset":"11263609","integrity":{"algorithm":"SHA256","hash":"755bcc456b4dd032244b51a8b4fe68ee3b2d2e463cf795f3fde970bb3f269fb1","blockSize":4194304,"blocks":["755bcc456b4dd032244b51a8b4fe68ee3b2d2e463cf795f3fde970bb3f269fb1"]}},"pascal-cased-properties.d.ts":{"size":697,"offset":"11264662","integrity":{"algorithm":"SHA256","hash":"a14371dc39f95c27264f8eb02ce2f80fd84ac693a2750983ac422877f0ae586d","blockSize":4194304,"blocks":["a14371dc39f95c27264f8eb02ce2f80fd84ac693a2750983ac422877f0ae586d"]}},"primitive.d.ts":{"size":212,"offset":"11265359","integrity":{"algorithm":"SHA256","hash":"cd51ceafea7762ad639afb3ca5b68e1e4ffeaacaa402d7ef2cae17016e29e098","blockSize":4194304,"blocks":["cd51ceafea7762ad639afb3ca5b68e1e4ffeaacaa402d7ef2cae17016e29e098"]}},"promisable.d.ts":{"size":791,"offset":"11265571","integrity":{"algorithm":"SHA256","hash":"03ed68319c97cd4ce8f1c4ded110d9b40b8a283c3242b9fe934ccfa834e45572","blockSize":4194304,"blocks":["03ed68319c97cd4ce8f1c4ded110d9b40b8a283c3242b9fe934ccfa834e45572"]}},"promise-value.d.ts":{"size":1157,"offset":"11266362","integrity":{"algorithm":"SHA256","hash":"d5a5025f04e7a3264ecfa3030ca9a3cb0353450f1915a26d5b84f596240a11cd","blockSize":4194304,"blocks":["d5a5025f04e7a3264ecfa3030ca9a3cb0353450f1915a26d5b84f596240a11cd"]}},"readonly-deep.d.ts":{"size":2614,"offset":"11267519","integrity":{"algorithm":"SHA256","hash":"cc28c8b188905e790de427f3cd00b96734c9c662fb849d68ff9d5f0327165c0d","blockSize":4194304,"blocks":["cc28c8b188905e790de427f3cd00b96734c9c662fb849d68ff9d5f0327165c0d"]}},"readonly-tuple.d.ts":{"size":1577,"offset":"11270133","integrity":{"algorithm":"SHA256","hash":"4ce53edb8fb1d2f8b2f6814084b773cdf5846f49bf5a426fbe4029327bda95bf","blockSize":4194304,"blocks":["4ce53edb8fb1d2f8b2f6814084b773cdf5846f49bf5a426fbe4029327bda95bf"]}},"remove-index-signature.d.ts":{"size":3692,"offset":"11271710","integrity":{"algorithm":"SHA256","hash":"116205156fb819f2afe33f9c6378ea11b6123fa3090f858211c23f667fff75da","blockSize":4194304,"blocks":["116205156fb819f2afe33f9c6378ea11b6123fa3090f858211c23f667fff75da"]}},"replace.d.ts":{"size":1504,"offset":"11275402","integrity":{"algorithm":"SHA256","hash":"0e0b8353d6d7f7cc3344adbabf3866e64f2f2813b23477254ba51f69e8fdf0eb","blockSize":4194304,"blocks":["0e0b8353d6d7f7cc3344adbabf3866e64f2f2813b23477254ba51f69e8fdf0eb"]}},"require-all-or-none.d.ts":{"size":1118,"offset":"11276906","integrity":{"algorithm":"SHA256","hash":"f35a727758da36dd885a70dd13a74d9167691aaff662d50eaaf66ed591957702","blockSize":4194304,"blocks":["f35a727758da36dd885a70dd13a74d9167691aaff662d50eaaf66ed591957702"]}},"require-at-least-one.d.ts":{"size":877,"offset":"11278024","integrity":{"algorithm":"SHA256","hash":"e4ace1cf5316aa7720e58c8dd511ba86bab1c981336996fb694fa64b8231d5f0","blockSize":4194304,"blocks":["e4ace1cf5316aa7720e58c8dd511ba86bab1c981336996fb694fa64b8231d5f0"]}},"require-exactly-one.d.ts":{"size":1155,"offset":"11278901","integrity":{"algorithm":"SHA256","hash":"a1c85a61ff2b66291676ab84ae03c1b1ff7139ffde1942173f6aee8dc4ee357b","blockSize":4194304,"blocks":["a1c85a61ff2b66291676ab84ae03c1b1ff7139ffde1942173f6aee8dc4ee357b"]}},"required-keys-of.d.ts":{"size":921,"offset":"11280056","integrity":{"algorithm":"SHA256","hash":"75a7db3b7ddf0ca49651629bb665e0294fda8d19ba04fddc8a14d32bb35eb248","blockSize":4194304,"blocks":["75a7db3b7ddf0ca49651629bb665e0294fda8d19ba04fddc8a14d32bb35eb248"]}},"schema.d.ts":{"size":1698,"offset":"11280977","integrity":{"algorithm":"SHA256","hash":"8be5c5be3dbf0003a628f99ad870e31bebc2364c28ea3b96231089a94e09f7a6","blockSize":4194304,"blocks":["8be5c5be3dbf0003a628f99ad870e31bebc2364c28ea3b96231089a94e09f7a6"]}},"screaming-snake-case.d.ts":{"size":935,"offset":"11282675","integrity":{"algorithm":"SHA256","hash":"25b1108faedaf2043a97a76218240b1b537459bbca5ae9e2207c236c40dcfdef","blockSize":4194304,"blocks":["25b1108faedaf2043a97a76218240b1b537459bbca5ae9e2207c236c40dcfdef"]}},"set-non-nullable.d.ts":{"size":993,"offset":"11283610","integrity":{"algorithm":"SHA256","hash":"3f4d43bb3f61d173a4646c19557e090a06e9a2ec9415313a6d84af388df64923","blockSize":4194304,"blocks":["3f4d43bb3f61d173a4646c19557e090a06e9a2ec9415313a6d84af388df64923"]}},"set-optional.d.ts":{"size":944,"offset":"11284603","integrity":{"algorithm":"SHA256","hash":"cec67731fce8577b0a90aa67ef0522ddb9f1fd681bece50cdcb80a833b4ed06f","blockSize":4194304,"blocks":["cec67731fce8577b0a90aa67ef0522ddb9f1fd681bece50cdcb80a833b4ed06f"]}},"set-required.d.ts":{"size":947,"offset":"11285547","integrity":{"algorithm":"SHA256","hash":"a14679c24962a81ef24b6f4e95bbc31601551f150d91af2dc0bce51f7961f223","blockSize":4194304,"blocks":["a14679c24962a81ef24b6f4e95bbc31601551f150d91af2dc0bce51f7961f223"]}},"set-return-type.d.ts":{"size":1723,"offset":"11286494","integrity":{"algorithm":"SHA256","hash":"60f476f1c4de44a08d6a566c6f1e1b7de6cbe53d9153c9cc2284ca0022e21fba","blockSize":4194304,"blocks":["60f476f1c4de44a08d6a566c6f1e1b7de6cbe53d9153c9cc2284ca0022e21fba"]}},"simplify.d.ts":{"size":2816,"offset":"11288217","integrity":{"algorithm":"SHA256","hash":"90748076a143bbeb455f8d5e8ad1cc451424c4856d41410e491268a496165256","blockSize":4194304,"blocks":["90748076a143bbeb455f8d5e8ad1cc451424c4856d41410e491268a496165256"]}},"snake-case.d.ts":{"size":742,"offset":"11291033","integrity":{"algorithm":"SHA256","hash":"c00b402135ef36fb09d59519e34d03445fd6541c09e68b189abb64151f211b12","blockSize":4194304,"blocks":["c00b402135ef36fb09d59519e34d03445fd6541c09e68b189abb64151f211b12"]}},"snake-cased-properties-deep.d.ts":{"size":864,"offset":"11291775","integrity":{"algorithm":"SHA256","hash":"c0fe2b1135ca803efa203408c953e1e12645b8065e1a4c1336ad8bb11ea1101b","blockSize":4194304,"blocks":["c0fe2b1135ca803efa203408c953e1e12645b8065e1a4c1336ad8bb11ea1101b"]}},"snake-cased-properties.d.ts":{"size":635,"offset":"11292639","integrity":{"algorithm":"SHA256","hash":"e08e58ac493a27b29ceee80da90bb31ec64341b520907d480df6244cdbec01f8","blockSize":4194304,"blocks":["e08e58ac493a27b29ceee80da90bb31ec64341b520907d480df6244cdbec01f8"]}},"split.d.ts":{"size":687,"offset":"11293274","integrity":{"algorithm":"SHA256","hash":"bb30fb0534dceb2e41a884c1e4e2bb7a0c668dadd148092bba9ff15aafb94790","blockSize":4194304,"blocks":["bb30fb0534dceb2e41a884c1e4e2bb7a0c668dadd148092bba9ff15aafb94790"]}},"spread.d.ts":{"size":1822,"offset":"11293961","integrity":{"algorithm":"SHA256","hash":"789665f0cd78bc675a31140d8f133ec6a482d753a514012fe1bb7f86d0a21040","blockSize":4194304,"blocks":["789665f0cd78bc675a31140d8f133ec6a482d753a514012fe1bb7f86d0a21040"]}},"string-key-of.d.ts":{"size":506,"offset":"11295783","integrity":{"algorithm":"SHA256","hash":"f351eaa598ba2046e3078e5480a7533be7051e4db9212bb40f4eeb84279aa24d","blockSize":4194304,"blocks":["f351eaa598ba2046e3078e5480a7533be7051e4db9212bb40f4eeb84279aa24d"]}},"stringified.d.ts":{"size":439,"offset":"11296289","integrity":{"algorithm":"SHA256","hash":"1a923815c127b27f7f375c143bb0d9313ccf3c66478d5d2965375eeb7da72a4c","blockSize":4194304,"blocks":["1a923815c127b27f7f375c143bb0d9313ccf3c66478d5d2965375eeb7da72a4c"]}},"trim.d.ts":{"size":485,"offset":"11296728","integrity":{"algorithm":"SHA256","hash":"7ad042f7d744ccfbcf6398216203c7712f01359d6fd4348c8bd8df8164e98096","blockSize":4194304,"blocks":["7ad042f7d744ccfbcf6398216203c7712f01359d6fd4348c8bd8df8164e98096"]}},"tsconfig-json.d.ts":{"size":23913,"offset":"11297213","integrity":{"algorithm":"SHA256","hash":"2641aff32336e35a5b702aa2d870a0891da29dc1c19ae48602678e2050614041","blockSize":4194304,"blocks":["2641aff32336e35a5b702aa2d870a0891da29dc1c19ae48602678e2050614041"]}},"typed-array.d.ts":{"size":380,"offset":"11321126","integrity":{"algorithm":"SHA256","hash":"1b8357b3fef5be61b5de6d6a4805a534d68fe3e040c11f1944e27d4aec85936a","blockSize":4194304,"blocks":["1b8357b3fef5be61b5de6d6a4805a534d68fe3e040c11f1944e27d4aec85936a"]}},"union-to-intersection.d.ts":{"size":1987,"offset":"11321506","integrity":{"algorithm":"SHA256","hash":"eb1625bab70cfed00931a1e09ecb7834b61a666b0011913b0ec24a8e219023ef","blockSize":4194304,"blocks":["eb1625bab70cfed00931a1e09ecb7834b61a666b0011913b0ec24a8e219023ef"]}},"value-of.d.ts":{"size":852,"offset":"11323493","integrity":{"algorithm":"SHA256","hash":"18b86125c67d99150f54225df07349ddd07acde086b55f3eeac1c34c81e424d8","blockSize":4194304,"blocks":["18b86125c67d99150f54225df07349ddd07acde086b55f3eeac1c34c81e424d8"]}},"writable.d.ts":{"size":1846,"offset":"11324345","integrity":{"algorithm":"SHA256","hash":"76e3f3a30c533bf20840d4185ce2d143dc18ca955b64400ac09670a89d388198","blockSize":4194304,"blocks":["76e3f3a30c533bf20840d4185ce2d143dc18ca955b64400ac09670a89d388198"]}}}}}}}},"package.json":{"size":2095,"offset":"11326191","integrity":{"algorithm":"SHA256","hash":"5ba116ec0718b2ad714d771f0a883bbad83e4c754332f55dadecdee323dce78a","blockSize":4194304,"blocks":["5ba116ec0718b2ad714d771f0a883bbad83e4c754332f55dadecdee323dce78a"]}}}}  PNG

   IHDR         x   	pHYs        sRGB    gAMA  a 4IDATxK5qeߙK A&!BvY;!{(3qww^;BL{ñc@"1SeV; g5sNwuUVVf~YUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\*WUr\e]WYGq{?=yl8C➢!=dקSvxy}+Y?Cnm$bTϓGHv|d*>RS*㐌Ʃ-Km9&tD}?5`hҵkZcBsv7uzk؊KFї	eI{s2Ⰾ߽OkkȤ]y|7xO!xCU辿/qxո®?{~]\*G 7>ē諧~Y9@]To9f,$?SXVO 8{"'(wo"@v:ٸ	 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 Á}G܇f<t`+|@8c60z!CiG}?pt`@^~g0zl"Z6כ׿Q&!8`I @ }9Ʈ&οymHpm4"XH0XPGr[{0vI$ WhNBGH
@2d    IENDB`var Le=Object.create;var K=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,Ae=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable;var Y=Math.pow,Z=(e,t,o)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Q=(e,t)=>{for(var o in t||(t={}))j.call(t,o)&&Z(e,o,t[o]);if(X)for(var o of X(t))We.call(t,o)&&Z(e,o,t[o]);return e};var De=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ce(t))!j.call(e,i)&&i!==o&&K(e,i,{get:()=>t[i],enumerable:!(n=Ne(t,i))||n.enumerable});return e};var f=(e,t,o)=>(o=e!=null?Le(Ae(e)):{},De(t||!e||!e.__esModule?K(o,"default",{value:e,enumerable:!0}):o,e));var T=(e,t,o)=>new Promise((n,i)=>{var l=O=>{try{r(o.next(O))}catch(B){i(B)}},U=O=>{try{r(o.throw(O))}catch(B){i(B)}},r=O=>O.done?n(O.value):Promise.resolve(O.value).then(l,U);r((o=o.apply(e,t)).next())});var p=require("electron");var E=require("electron");var b=require("electron"),v=f(require("path")),$="Replit",F="replit",J=b.nativeImage.createFromPath(v.join(__dirname,"assets","logo.png")),ee=b.nativeImage.createFromPath(v.join(__dirname,"assets","logo-mac.png")),te=v.join(__dirname,"preload.js"),oe="https://replit.com",c=process.env.REPLIT_URL||oe,ne=c.includes("localhost"),re=c.includes("staging"),ie=c===oe,D=/^\/@([^/#?]+?)(?:\/([^/#?]+?))[/#?]?$/i,y=/^\/t(?:\/([^/#?]+?))(?:\/([^/#?]+?))\/repls(?:\/([^/#?]+?))[/#?]?$/i,P=/^\/t(?:\/([^/#?]+?))\/repls(?:\/([^/#?]+?))[/#?]?$/i,x="/desktopApp/home",M="/desktopApp/auth",se="/desktopApp",ae=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/,u=b.app.isPackaged;var H=f(require("electron-log/main"));var ye=["logout"];function k(e){return e.startsWith(se)||D.test(e)||P.test(e)||y.test(e)||ye.includes(e)}function m(){return process.platform==="darwin"}function L(){return process.platform==="win32"}function C(){return!m()&&!L()}var z=require("electron"),le=f(require("electron-store"));var Pe="#0E1525",xe="#F5F9FC";function Te(){if(u)return"config";if(ie)return"config-dev";if(ne)return"config-dev-local";if(re)return"config-dev-staging";let{host:e}=new URL(c);return`config-dev-${e}`}function be(){let e=Te(),t=new le.default({name:e});return{setLastSeenBackgroundColor(o){t.set("LAST_SEEN_BACKGROUND_COLOR",o)},getLastSeenBackgroundColor(){return t.get("LAST_SEEN_BACKGROUND_COLOR",Pe)},setLastSeenForegroundColor(o){t.set("LAST_SEEN_FOREGROUND_COLOR",o)},getLastSeenForegroundColor(){return t.get("LAST_SEEN_FOREGROUND_COLOR",xe)},clearWindowBounds(){t.delete("WINDOW_BOUNDS")},setWindowBounds(o){t.set("WINDOW_BOUNDS",o)},getWindowBounds(){let o=z.screen.getCursorScreenPoint(),n=z.screen.getDisplayNearestPoint(o);return t.get("WINDOW_BOUNDS",n.workArea)},getUser(){return t.get("USER_INFO",null)},setUser(o){t.set("USER_INFO",o)},setLastOpenRepl(o){t.set("LAST_OPEN_REPL",o)},getLastOpenRepl(){return t.get("LAST_OPEN_REPL",null)},onLastOpenReplChange(o){return t.onDidChange("LAST_OPEN_REPL",o)}}}var s=be();var Fe=`${c}${x}`;function ke(e){return e?e.startsWith("/")?`${c}${e}`:e:Fe}function pe(e,t){if(!e)return;let o=new URL(e);if(o.origin===c){if(o.pathname===x){t!=null&&s.setLastOpenRepl(null);return}!D.test(o.pathname)&&!P.test(o.pathname)&&!y.test(o.pathname)||t!==o.pathname&&s.setLastOpenRepl(o.pathname)}}function Ie(e){return E.screen.getAllDisplays().some(({bounds:t})=>{let{x:o,y:n,width:i,height:l}=t,U=o+i+100,r=n+l+100;return U>=e.x+e.width&&r>=e.y+e.height})}function Be(){let e=E.BrowserWindow.getAllWindows();if(e.length===0)return;let t=E.BrowserWindow.getFocusedWindow()||e[0];s.setWindowBounds(t.getBounds())}function ve({backgroundColor:e,foregroundColor:t}){return m()?{titleBarStyle:"hidden",titleBarOverlay:{height:48},trafficLightPosition:{x:20,y:16}}:L()?{titleBarStyle:"hidden",titleBarOverlay:{color:e,symbolColor:t,height:47}}:{}}var ce=["http","https","replit","vscode"].map(e=>`${e}:`);function d(e){Be();let t=s.getLastSeenBackgroundColor(),o=s.getLastSeenForegroundColor(),n=ke(e==null?void 0:e.url),i=s.getLastOpenRepl(),l=s.onLastOpenReplChange(g=>{i=g});H.default.info("Creating window with URL: ",n);let U=ve({foregroundColor:o,backgroundColor:t}),r=new E.BrowserWindow(Q({webPreferences:{preload:te,additionalArguments:[`--app-version=${E.app.getVersion()}`,`--platform=${process.platform}`],webviewTag:!0},title:$,icon:J,minWidth:720,minHeight:480,backgroundColor:t,autoHideMenuBar:!0,show:!1},U)),O=u?"ReplitDesktop":"ReplitDesktop (Development)";return r.webContents.setUserAgent(`${r.webContents.getUserAgent()} ${O}`),r.webContents.setWindowOpenHandler(g=>{try{let S=new URL(g.url);if(!ce.includes(S.protocol))return{action:"deny"}}catch(S){return{action:"deny"}}return r.isFocused()&&(H.default.info("Opening external URL in window open handler: ",g),E.shell.openExternal(g.url)),{action:"deny"}}),r.webContents.on("did-navigate-in-page",(g,S)=>{pe(S,i)}),r.webContents.on("will-navigate",g=>{let S=new URL(g.url);if(!(S.origin===c)||!k(S.pathname)){if(!ce.includes(S.protocol))return;g.preventDefault(),r.isFocused()&&(H.default.info("Opening external URL in will-navigate event handler: ",g),E.shell.openExternal(g.url))}}),Ie(s.getWindowBounds())||s.clearWindowBounds(),r.setBounds(s.getWindowBounds()),r.on("close",()=>{s.setWindowBounds(r.getBounds()),l()}),r.on("focus",()=>{r.webContents.send("ON_FOCUSED_CHANGED",!0),pe(r.webContents.getURL(),i)}),r.on("blur",()=>{r.webContents.send("ON_FOCUSED_CHANGED",!1)}),r.on("enter-full-screen",()=>{r.webContents.send("ON_FULLSCREEN_CHANGED",!0)}),r.on("leave-full-screen",()=>{r.webContents.send("ON_FULLSCREEN_CHANGED",!1)}),r.loadURL(n,{extraHeaders:`pragma: no-cache
`}),r.show(),r}var I=f(require("@sentry/electron"));var de=f(require("electron-log/main"));var me=require("electron"),$e="https://d88a656213ca4c1892091cc955fd7783@o1151714.ingest.sentry.io/4505167464693760",Me="https://o1151714.ingest.sentry.io/api/4505167464693760/minidump/?sentry_key=d88a656213ca4c1892091cc955fd7783";function ge(){u&&(de.default.info("Initializing Sentry"),I.init({dsn:$e}),G(s.getUser()),me.crashReporter.start({submitURL:Me}))}function G(e){if(!u)return;if(!e){I.setUser(null);return}let{id:t,username:o,email:n}=e;I.setUser({id:t.toString(),email:n,username:o})}var A=require("electron");var fe={label:"New Window",accelerator:"CommandOrControl+Shift+N",click:()=>d()};function Ee(){let e=new A.Menu;return e.append(new A.MenuItem(fe)),e}var He=!u||process.env.ENABLE_DEVTOOLS;function Re(){let e=[];m()&&e.push({label:A.app.name,submenu:[{role:"about"},{type:"separator"},{role:"services"},{type:"separator"},{role:"hide"},{role:"hideOthers"},{role:"unhide"},{type:"separator"},{role:"quit"}]}),e.push({label:"File",submenu:[fe,{type:"separator"},m()?{role:"close"}:{role:"quit"}]}),e.push({label:"Edit",submenu:[{role:"undo"},{role:"redo"},{type:"separator"},{role:"cut"},{role:"copy"},{role:"paste"},{role:"pasteandmatchstyle"},{role:"delete"},{role:"selectall"}]});let t=[{role:"reload"},{role:"forceReload"},{type:"separator"}];return e.push({label:"View",submenu:[...u?[]:t,...He?[{role:"toggleDevTools"}]:[],{role:"togglefullscreen"}]}),e.push({label:"Window",submenu:[{role:"minimize"},{role:"zoom"},...m()?[{type:"separator"},{role:"front"},{type:"separator"},{role:"window"}]:[{role:"close"}]]}),e.push({role:"help"}),A.Menu.buildFromTemplate(e)}var V=f(require("@sentry/electron")),w=require("electron");var N=f(require("electron-log/main"));var Ge=m()&&process.arch==="arm64"?"darwin_arm64":process.platform,Ke="https://desktop.replit.com",ze=`${Ke}/update/${Ge}/${w.app.getVersion()}`;function q(){if(!u){N.default.info("Skipping auto-update. App is not packaged.");return}if(C()){N.default.info("Skipping auto-update. Auto-update is not supported on Linux.");return}try{w.autoUpdater.setFeedURL({url:ze})}catch(l){N.default.error("Skipping auto-update. setFeedURL threw with the following error: ",l),V.captureException(l);return}let e=null;w.autoUpdater.on("update-downloaded",()=>{let l={type:"info",buttons:["Restart","Later"],title:"Application Update",message:"New Update Available",detail:"A new version has been downloaded. Restart the application to apply the updates."};clearTimeout(e),N.default.info("Update downloaded"),w.dialog.showMessageBox(l).then(U=>{N.default.info("Update dialog selected: ",l.buttons[U.response]),U.response===0&&w.autoUpdater.quitAndInstall()})}),w.autoUpdater.on("error",l=>{N.default.error("There was a problem updating the application: ",l.message),V.captureException(l)});let t=30*60*1e3,o=24*60*60*1e3;function n(){N.default.info("Checking for updates"),w.autoUpdater.checkForUpdates()}function i(l=1){e=setTimeout(()=>{n(),i(Math.min(l+1,10))},Math.max(t*Y(2,l-1),o))}n(),i()}var R=require("electron");var Oe=f(require("path"));var W=f(require("electron-log/main"));function _e(){Ve(),Qe()}function Ve(){W.default.info("Registering deeplink protocol"),process.defaultApp&&L()&&process.argv.length>=2?R.app.setAsDefaultProtocolClient(F,process.execPath,[Oe.default.resolve(process.argv[1])]):R.app.setAsDefaultProtocolClient(F)}function qe(e){W.default.info(`Arrived from deeplink: ${e}`);try{if(new URL(e).protocol.slice(0,-1)!==F)return!1}catch(t){return W.default.warn("Invalid URL for deeplink"),!1}return!0}function we(e){return T(this,null,function*(){let t=new URL(e);switch(yield R.app.whenReady(),t.hostname){case"authComplete":{Ye(t.searchParams.get("authToken"));break}case"home":{Xe();break}case"new":{Ze(t.searchParams.get("language")||"python3");break}case"repl":{je(t.pathname);break}default:{let o=`Unrecognized hostname: ${t.hostname}`;W.default.error(o)}}})}function he(){let e=R.BrowserWindow.getAllWindows();return e.length===0?null:R.BrowserWindow.getFocusedWindow()||e[0]}function Xe(){let e=`${c}${x}`,t=he();if(t){t.loadURL(e);return}d({url:e})}function Ze(e){let t=`${c}${x}?language=${e}`;d({url:t})}function je(e){if(!D.test(e)&&!P.test(e)&&!y.test(e)){W.default.error("Expected valid workspace URL");return}let t=he();if(t){t.loadURL(`${c}${e}`);return}d({url:e})}function Ye(e){let t=R.BrowserWindow.getAllWindows(),o=`${c}${M}`,n=t.find(i=>i.webContents.getURL()===o);if(R.BrowserWindow.getAllWindows().forEach(i=>{n&&i.id===n.id||i.close()}),!n){let i=`${o}?authToken=${e}`;d({url:i});return}n.isMinimized()&&n.restore(),n.focus(),n.webContents.send("AUTH_TOKEN_RECEIVED",e)}function Qe(){if(W.default.info("Setting deeplink listeners"),L()||C()){R.app.on("second-instance",(e,t)=>{if(t.length===0)throw new Error("Expected command line arguments");let o=t[t.length-1],n=t[0];if(!ae.test(o)){if(!qe(o)){C()&&n===F&&d();return}we(o)}});return}R.app.on("open-url",(e,t)=>{we(t)})}var a=require("electron"),Ue=f(require("electron-log/main"));function _(e,t){Ue.default.info(`Recieved IPC event: ${e}${t?` with params ${JSON.stringify(t)}`:""}`)}function Se(){a.ipcMain.on("CLOSE_CURRENT_WINDOW",e=>{_("CLOSE_CURRENT_WINDOW"),a.BrowserWindow.getAllWindows().find(o=>o.webContents.id===e.sender.id).close()}),a.ipcMain.on("OPEN_WINDOW",(e,t)=>{if(_("OPEN_WINDOW",{slug:t}),!k(t))throw new Error("Page not supported");let o=`${c}${t}`;d({url:o})}),a.ipcMain.on("OPEN_EXTERNAL_URL",(e,t)=>{_("OPEN_EXTERNAL_URL",{url:t}),a.shell.openExternal(t)}),a.ipcMain.on("LOGOUT",()=>{_("LOGOUT"),s.setLastOpenRepl(null),s.setUser(null),G(null);let e=`${c}/logout?goto=${M}`;a.BrowserWindow.getAllWindows().forEach(t=>t.close()),d({url:e})}),a.ipcMain.on("CHECK_FOR_UPDATES",()=>{_("CHECK_FOR_UPDATES"),u&&C()&&a.autoUpdater.checkForUpdates()}),a.ipcMain.handle("SHOW_MESSAGE_BOX",(e,t)=>T(this,null,function*(){_("SHOW_MESSAGE_BOX",t);let{response:o}=yield a.dialog.showMessageBox(t);return o})),a.ipcMain.on("UPDATE_USER_INFO",(e,t)=>T(this,null,function*(){_("UPDATE_USER_INFO",t),s.setUser(t),G(t)})),a.ipcMain.handle("GET_USER_INFO",()=>(_("GET_USER_INFO"),s.getUser())),a.ipcMain.on("THEME_VALUES_CHANGED",(e,t)=>{_("THEME_VALUES_CHANGED",t);let o=a.BrowserWindow.getAllWindows().find(l=>l.webContents.id===e.sender.id),{backgroundRoot:n,foregroundDefault:i}=t;s.setLastSeenBackgroundColor(n),s.setLastSeenForegroundColor(i),o.setBackgroundColor(n),L()&&o.setTitleBarOverlay({color:n,symbolColor:i})})}var h=f(require("electron-log/main"));h.default.initialize({preload:!0});h.default.errorHandler.startCatching();var Je=u?p.app.getVersion():`${p.app.getVersion()} (development)`;h.default.info(`Launching app version: ${Je}`);h.default.info(`Platform: ${process.platform} (${process.arch})`);h.default.info(`Args: ${process.argv}`);require("electron-squirrel-startup")&&(h.default.info("electron-squirrel-startup returned true. Quitting the app"),p.app.quit());ge();p.app.setName($);_e();Se();var et=p.app.requestSingleInstanceLock();et||(h.default.info("Failed to acquire instance lock. Quitting the app."),p.app.quit());p.Menu.setApplicationMenu(Re());p.app.commandLine.appendSwitch("enable-experimental-web-platform-features");p.app.whenReady().then(()=>{h.default.info("App Ready"),m()&&(p.app.dock.setIcon(ee),p.app.dock.setMenu(Ee())),p.BrowserWindow.getAllWindows().length===0&&d({url:s.getLastOpenRepl()}),q(),p.app.on("activate",()=>{p.BrowserWindow.getAllWindows().length===0&&d()})});p.app.on("window-all-closed",()=>{m()||p.app.quit()});
var U=(e,E,r)=>new Promise((o,i)=>{var s=_=>{try{t(r.next(_))}catch(N){i(N)}},O=_=>{try{t(r.throw(_))}catch(N){i(N)}},t=_=>_.done?o(_.value):Promise.resolve(_.value).then(s,O);t((r=r.apply(e,E)).next())});var n=require("electron");function c(e){let E=process.argv.find(o=>o.includes(`--${e}=`));if(!E)throw new Error(`Expected ${e} argument`);let[,r]=E.split("=");return r}var a=c("app-version"),d=c("platform");function C(){return U(this,null,function*(){if(yield n.ipcRenderer.invoke("GET_USER_INFO"))return;let r=`${new URL(window.location.href).origin}/is_authenticated`,o=yield fetch(r),{success:i,user:s}=yield o.json();if(!i)return;if(!s)throw new Error("Expected user");let{id:O,username:t,email:_}=s;if(!O||!t||!_)throw new Error("Expected id, username, and email");n.ipcRenderer.send("UPDATE_USER_INFO",{id:O,username:t,email:_})})}C();n.contextBridge.exposeInMainWorld("replitDesktop",{closeCurrentWindow:()=>n.ipcRenderer.send("CLOSE_CURRENT_WINDOW"),openWindow:e=>n.ipcRenderer.send("OPEN_WINDOW",e),openExternalUrl:e=>n.ipcRenderer.send("OPEN_EXTERNAL_URL",e),onAuthTokenReceived:e=>{function E(r,o){e(o)}return n.ipcRenderer.on("AUTH_TOKEN_RECEIVED",E),()=>{n.ipcRenderer.removeListener("AUTH_TOKEN_RECEIVED",E)}},showMessageBox:e=>U(exports,null,function*(){return n.ipcRenderer.invoke("SHOW_MESSAGE_BOX",e)}),onFullScreenChanged:e=>{function E(r,o){e(o)}return n.ipcRenderer.on("ON_FULLSCREEN_CHANGED",E),()=>{n.ipcRenderer.removeListener("ON_FULLSCREEN_CHANGED",E)}},onFocusChanged:e=>{function E(r,o){e(o)}return n.ipcRenderer.on("ON_FOCUSED_CHANGED",E),()=>{n.ipcRenderer.removeListener("ON_FOCUSED_CHANGED",E)}},updateThemeValues:e=>n.ipcRenderer.send("THEME_VALUES_CHANGED",e),checkForUpdates:()=>n.ipcRenderer.send("CHECK_FOR_UPDATES"),logout:()=>n.ipcRenderer.send("LOGOUT"),platform:d,version:a});
hoistPattern:
  - '*'
hoistedLocations:
  /@electron-forge/cli/7.4.0:
    - node_modules\@electron-forge\cli
  /@electron-forge/core-utils/7.4.0:
    - node_modules\@electron-forge\core-utils
  /@electron-forge/core/7.4.0:
    - node_modules\@electron-forge\core
  /@electron-forge/maker-base/7.4.0:
    - node_modules\@electron-forge\maker-base
  /@electron-forge/maker-deb/7.4.0:
    - node_modules\@electron-forge\maker-deb
  /@electron-forge/maker-dmg/7.4.0:
    - node_modules\@electron-forge\maker-dmg
  /@electron-forge/maker-squirrel/7.4.0:
    - node_modules\@electron-forge\maker-squirrel
  /@electron-forge/maker-zip/7.4.0:
    - node_modules\@electron-forge\maker-zip
  /@electron-forge/plugin-base/7.4.0:
    - node_modules\@electron-forge\plugin-base
  /@electron-forge/publisher-base/7.4.0:
    - node_modules\@electron-forge\publisher-base
  /@electron-forge/publisher-github/7.4.0:
    - node_modules\@electron-forge\publisher-github
  /@electron-forge/shared-types/7.4.0:
    - node_modules\@electron-forge\shared-types
  /@electron-forge/template-base/7.4.0:
    - node_modules\@electron-forge\template-base
  /@electron-forge/template-vite-typescript/7.4.0:
    - node_modules\@electron-forge\template-vite-typescript
  /@electron-forge/template-vite/7.4.0:
    - node_modules\@electron-forge\template-vite
  /@electron-forge/template-webpack-typescript/7.4.0:
    - node_modules\@electron-forge\template-webpack-typescript
  /@electron-forge/template-webpack/7.4.0:
    - node_modules\@electron-forge\template-webpack
  /@electron-forge/tracer/7.4.0:
    - node_modules\@electron-forge\tracer
  /@electron/asar/3.2.15:
    - node_modules\@electron\asar
  /@electron/get/2.0.3:
    - node_modules\electron\node_modules\@electron\get
  /@electron/get/3.1.0:
    - node_modules\@electron\get
  /@electron/notarize/2.5.0:
    - node_modules\@electron\notarize
  /@electron/osx-sign/1.3.1:
    - node_modules\@electron\osx-sign
  /@electron/packager/18.3.5:
    - node_modules\@electron\packager
  /@electron/rebuild/3.7.0:
    - node_modules\@electron\rebuild
  /@electron/universal/2.0.1:
    - node_modules\@electron\universal
  /@electron/windows-sign/1.1.3:
    - node_modules\@electron\windows-sign
  /@esbuild/win32-x64/0.18.6:
    - node_modules\@esbuild\win32-x64
  /@eslint-community/eslint-utils/4.4.1(eslint@8.47.0):
    - node_modules\@eslint-community\eslint-utils
  /@eslint-community/regexpp/4.12.1:
    - node_modules\@eslint-community\regexpp
  /@eslint/eslintrc/2.1.4:
    - node_modules\@eslint\eslintrc
  /@eslint/js/8.57.1:
    - node_modules\@eslint\js
  /@gar/promisify/1.1.3:
    - node_modules\@gar\promisify
  /@humanwhocodes/config-array/0.11.14:
    - node_modules\@humanwhocodes\config-array
  /@humanwhocodes/module-importer/1.0.1:
    - node_modules\@humanwhocodes\module-importer
  /@humanwhocodes/object-schema/2.0.3:
    - node_modules\@humanwhocodes\object-schema
  /@isaacs/cliui/8.0.2:
    - node_modules\@isaacs\cliui
  /@malept/cross-spawn-promise/2.0.0:
    - node_modules\@malept\cross-spawn-promise
  /@nodelib/fs.scandir/2.1.5:
    - node_modules\@nodelib\fs.scandir
  /@nodelib/fs.stat/2.0.5:
    - node_modules\@nodelib\fs.stat
  /@nodelib/fs.walk/1.2.8:
    - node_modules\@nodelib\fs.walk
  /@npmcli/fs/2.1.2:
    - node_modules\@npmcli\fs
  /@npmcli/move-file/2.0.1:
    - node_modules\@npmcli\move-file
  /@octokit/auth-token/2.5.0:
    - node_modules\@octokit\auth-token
  /@octokit/core/3.6.0:
    - node_modules\@octokit\core
  /@octokit/endpoint/6.0.12:
    - node_modules\@octokit\endpoint
  /@octokit/graphql/4.8.0:
    - node_modules\@octokit\graphql
  /@octokit/openapi-types/12.11.0:
    - node_modules\@octokit\openapi-types
  /@octokit/plugin-paginate-rest/2.21.3(@octokit/core@3.6.0):
    - node_modules\@octokit\plugin-paginate-rest
  /@octokit/plugin-request-log/1.0.4(@octokit/core@3.6.0):
    - node_modules\@octokit\plugin-request-log
  /@octokit/plugin-rest-endpoint-methods/5.16.2(@octokit/core@3.6.0):
    - node_modules\@octokit\plugin-rest-endpoint-methods
  /@octokit/plugin-retry/3.0.9:
    - node_modules\@octokit\plugin-retry
  /@octokit/request-error/2.1.0:
    - node_modules\@octokit\request-error
  /@octokit/request/5.6.3:
    - node_modules\@octokit\request
  /@octokit/rest/18.12.0:
    - node_modules\@octokit\rest
  /@octokit/types/6.41.0:
    - node_modules\@octokit\types
  /@pkgjs/parseargs/0.11.0:
    - node_modules\@pkgjs\parseargs
  /@pkgr/core/0.1.1:
    - node_modules\@pkgr\core
  /@sentry-internal/tracing/7.48.0:
    - node_modules\@sentry-internal\tracing
  /@sentry/browser/7.48.0:
    - node_modules\@sentry\browser
  /@sentry/core/7.48.0:
    - node_modules\@sentry\core
  /@sentry/electron/4.5.0:
    - node_modules\@sentry\electron
  /@sentry/node/7.48.0:
    - node_modules\@sentry\node
  /@sentry/replay/7.48.0:
    - node_modules\@sentry\replay
  /@sentry/types/7.48.0:
    - node_modules\@sentry\types
  /@sentry/utils/7.48.0:
    - node_modules\@sentry\utils
  /@sindresorhus/is/4.6.0:
    - node_modules\@sindresorhus\is
  /@szmarczak/http-timer/4.0.6:
    - node_modules\@szmarczak\http-timer
  /@tootallnate/once/2.0.0:
    - node_modules\@tootallnate\once
  /@types/cacheable-request/6.0.3:
    - node_modules\@types\cacheable-request
  /@types/eslint/8.44.2:
    - node_modules\@types\eslint
  /@types/estree/1.0.6:
    - node_modules\@types\estree
  /@types/http-cache-semantics/4.0.4:
    - node_modules\@types\http-cache-semantics
  /@types/json-schema/7.0.15:
    - node_modules\@types\json-schema
  /@types/keyv/3.1.4:
    - node_modules\@types\keyv
  /@types/node/20.10.0:
    - node_modules\@types\node
  /@types/responselike/1.0.3:
    - node_modules\@types\responselike
  /@types/semver/7.5.8:
    - node_modules\@types\semver
  /@types/yauzl/2.10.3:
    - node_modules\@types\yauzl
  /@typescript-eslint/eslint-plugin/6.4.1(@typescript-eslint/parser@4.33.0)(eslint@8.47.0)(typescript@4.9.5):
    - node_modules\@typescript-eslint\eslint-plugin
  /@typescript-eslint/parser/4.33.0(eslint@8.47.0)(typescript@4.9.5):
    - node_modules\@typescript-eslint\parser
  /@typescript-eslint/scope-manager/4.33.0:
    - node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\scope-manager
  /@typescript-eslint/scope-manager/6.4.1:
    - node_modules\@typescript-eslint\scope-manager
  /@typescript-eslint/type-utils/6.4.1(eslint@8.47.0)(typescript@4.9.5):
    - node_modules\@typescript-eslint\type-utils
  /@typescript-eslint/types/4.33.0:
    - node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\types
  /@typescript-eslint/types/6.4.1:
    - node_modules\@typescript-eslint\types
  /@typescript-eslint/typescript-estree/4.33.0(typescript@4.9.5):
    - node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\typescript-estree
  /@typescript-eslint/typescript-estree/6.4.1(typescript@4.9.5):
    - node_modules\@typescript-eslint\typescript-estree
  /@typescript-eslint/utils/6.4.1(eslint@8.47.0)(typescript@4.9.5):
    - node_modules\@typescript-eslint\utils
  /@typescript-eslint/visitor-keys/4.33.0:
    - node_modules\@typescript-eslint\parser\node_modules\@typescript-eslint\visitor-keys
  /@typescript-eslint/visitor-keys/6.4.1:
    - node_modules\@typescript-eslint\visitor-keys
  /@xmldom/xmldom/0.8.10:
    - node_modules\@xmldom\xmldom
  /abbrev/1.1.1:
    - node_modules\abbrev
  /acorn-jsx/5.3.2(acorn@8.14.0):
    - node_modules\acorn-jsx
  /acorn/8.14.0:
    - node_modules\acorn
  /agent-base/6.0.2:
    - node_modules\agent-base
  /agentkeepalive/4.5.0:
    - node_modules\agentkeepalive
  /aggregate-error/3.1.0:
    - node_modules\aggregate-error
  /aggregate-error/4.0.1:
    - node_modules\p-map\node_modules\aggregate-error
  /ajv-formats/2.1.1(ajv@8.17.1):
    - node_modules\ajv-formats
  /ajv/6.12.6:
    - node_modules\eslint\node_modules\ajv
    - node_modules\@eslint\eslintrc\node_modules\ajv
  /ajv/8.17.1:
    - node_modules\ajv
  /ansi-escapes/5.0.0:
    - node_modules\ansi-escapes
  /ansi-regex/5.0.1:
    - node_modules\strip-ansi\node_modules\ansi-regex
    - node_modules\strip-ansi-cjs\node_modules\ansi-regex
  /ansi-regex/6.1.0:
    - node_modules\ansi-regex
  /ansi-styles/3.2.1:
    - node_modules\npm-run-all\node_modules\ansi-styles
  /ansi-styles/4.3.0:
    - node_modules\ansi-styles
  /ansi-styles/6.2.1:
    - node_modules\wrap-ansi\node_modules\ansi-styles
    - node_modules\slice-ansi\node_modules\ansi-styles
  /argparse/2.0.1:
    - node_modules\argparse
  /array-buffer-byte-length/1.0.1:
    - node_modules\array-buffer-byte-length
  /array-union/2.1.0:
    - node_modules\array-union
  /arraybuffer.prototype.slice/1.0.3:
    - node_modules\arraybuffer.prototype.slice
  /arrify/3.0.0:
    - node_modules\arrify
  /at-least-node/1.0.0:
    - node_modules\at-least-node
  /atomically/1.7.0:
    - node_modules\atomically
  /author-regex/1.0.0:
    - node_modules\author-regex
  /available-typed-arrays/1.0.7:
    - node_modules\available-typed-arrays
  /balanced-match/1.0.2:
    - node_modules\balanced-match
  /base64-js/1.5.1:
    - node_modules\base64-js
  /before-after-hook/2.2.3:
    - node_modules\before-after-hook
  /bl/4.1.0:
    - node_modules\bl
  /bluebird/3.7.2:
    - node_modules\bluebird
  /boolean/3.2.0:
    - node_modules\boolean
  /bottleneck/2.19.5:
    - node_modules\bottleneck
  /brace-expansion/1.1.11:
    - node_modules\minimatch\node_modules\brace-expansion
  /brace-expansion/2.0.1:
    - node_modules\brace-expansion
  /braces/3.0.3:
    - node_modules\braces
  /buffer-crc32/0.2.13:
    - node_modules\buffer-crc32
  /buffer-from/1.1.2:
    - node_modules\buffer-from
  /buffer/5.7.1:
    - node_modules\buffer
  /cacache/16.1.3:
    - node_modules\cacache
  /cacheable-lookup/5.0.4:
    - node_modules\cacheable-lookup
  /cacheable-request/7.0.4:
    - node_modules\cacheable-request
  /call-bind/1.0.7:
    - node_modules\call-bind
  /callsites/3.1.0:
    - node_modules\callsites
  /chalk/2.4.2:
    - node_modules\npm-run-all\node_modules\chalk
  /chalk/4.1.2:
    - node_modules\chalk
  /chownr/2.0.0:
    - node_modules\chownr
  /chrome-trace-event/1.0.4:
    - node_modules\chrome-trace-event
  /clean-stack/2.2.0:
    - node_modules\clean-stack
  /clean-stack/4.2.0:
    - node_modules\p-map\node_modules\clean-stack
  /cli-cursor/3.1.0:
    - node_modules\ora\node_modules\cli-cursor
  /cli-cursor/4.0.0:
    - node_modules\cli-cursor
  /cli-spinners/2.9.2:
    - node_modules\cli-spinners
  /cli-truncate/3.1.0:
    - node_modules\cli-truncate
  /cliui/8.0.1:
    - node_modules\cliui
  /clone-response/1.0.3:
    - node_modules\clone-response
  /clone/1.0.4:
    - node_modules\clone
  /color-convert/1.9.3:
    - node_modules\npm-run-all\node_modules\color-convert
  /color-convert/2.0.1:
    - node_modules\color-convert
  /color-name/1.1.3:
    - node_modules\npm-run-all\node_modules\color-name
  /color-name/1.1.4:
    - node_modules\color-name
  /colorette/2.0.20:
    - node_modules\colorette
  /commander/4.1.1:
    - node_modules\@electron-forge\cli\node_modules\commander
  /commander/5.1.0:
    - node_modules\commander
  /commander/9.5.0:
    - node_modules\postject\node_modules\commander
  /compare-version/0.1.2:
    - node_modules\compare-version
  /concat-map/0.0.1:
    - node_modules\concat-map
  /conf/10.2.0:
    - node_modules\conf
  /cookie/0.4.2:
    - node_modules\cookie
  /cp-file/9.1.0:
    - node_modules\cp-file
  /cpy/9.0.1:
    - node_modules\cpy
  /cross-dirname/0.1.0:
    - node_modules\cross-dirname
  /cross-env/7.0.3:
    - node_modules\cross-env
  /cross-spawn/6.0.5:
    - node_modules\npm-run-all\node_modules\cross-spawn
    - node_modules\yarn-or-npm\node_modules\cross-spawn
    - node_modules\execa\node_modules\cross-spawn
  /cross-spawn/7.0.3:
    - node_modules\cross-spawn
  /cross-zip/4.0.1:
    - node_modules\cross-zip
  /data-view-buffer/1.0.1:
    - node_modules\data-view-buffer
  /data-view-byte-length/1.0.1:
    - node_modules\data-view-byte-length
  /data-view-byte-offset/1.0.0:
    - node_modules\data-view-byte-offset
  /debounce-fn/4.0.0:
    - node_modules\debounce-fn
  /debug/2.6.9:
    - node_modules\electron-squirrel-startup\node_modules\debug
    - node_modules\get-package-info\node_modules\debug
  /debug/4.3.7:
    - node_modules\debug
  /decompress-response/6.0.0:
    - node_modules\decompress-response
  /deep-is/0.1.4:
    - node_modules\deep-is
  /deepmerge/4.3.0:
    - node_modules\deepmerge
  /defaults/1.0.4:
    - node_modules\defaults
  /defer-to-connect/2.0.1:
    - node_modules\defer-to-connect
  /define-data-property/1.1.4:
    - node_modules\define-data-property
  /define-properties/1.2.1:
    - node_modules\define-properties
  /deprecation/2.3.1:
    - node_modules\deprecation
  /detect-libc/2.0.3:
    - node_modules\detect-libc
  /detect-node/2.1.0:
    - node_modules\detect-node
  /dir-compare/4.2.0:
    - node_modules\dir-compare
  /dir-glob/3.0.1:
    - node_modules\dir-glob
  /doctrine/3.0.0:
    - node_modules\doctrine
  /dot-prop/6.0.1:
    - node_modules\dot-prop
  /eastasianwidth/0.2.0:
    - node_modules\eastasianwidth
  /electron-installer-dmg/4.0.0:
    - node_modules\electron-installer-dmg
  /electron-log/5.1.4:
    - node_modules\electron-log
  /electron-squirrel-startup/1.0.0:
    - node_modules\electron-squirrel-startup
  /electron-store/8.1.0:
    - node_modules\electron-store
  /electron-winstaller/5.3.1:
    - node_modules\electron-winstaller
  /electron/30.0.3:
    - node_modules\electron
  /emoji-regex/8.0.0:
    - node_modules\string-width\node_modules\emoji-regex
    - node_modules\string-width-cjs\node_modules\emoji-regex
  /emoji-regex/9.2.2:
    - node_modules\emoji-regex
  /encoding/0.1.13:
    - node_modules\encoding
  /end-of-stream/1.4.4:
    - node_modules\end-of-stream
  /env-paths/2.2.1:
    - node_modules\env-paths
  /err-code/2.0.3:
    - node_modules\err-code
  /error-ex/1.3.2:
    - node_modules\error-ex
  /es-abstract/1.23.3:
    - node_modules\es-abstract
  /es-define-property/1.0.0:
    - node_modules\es-define-property
  /es-errors/1.3.0:
    - node_modules\es-errors
  /es-object-atoms/1.0.0:
    - node_modules\es-object-atoms
  /es-set-tostringtag/2.0.3:
    - node_modules\es-set-tostringtag
  /es-to-primitive/1.2.1:
    - node_modules\es-to-primitive
  /es6-error/4.1.1:
    - node_modules\es6-error
  /esbuild/0.18.6:
    - node_modules\esbuild
  /escalade/3.2.0:
    - node_modules\escalade
  /escape-string-regexp/1.0.5:
    - node_modules\escape-string-regexp
  /escape-string-regexp/4.0.0:
    - node_modules\eslint\node_modules\escape-string-regexp
    - node_modules\matcher\node_modules\escape-string-regexp
  /escape-string-regexp/5.0.0:
    - node_modules\p-map\node_modules\escape-string-regexp
  /eslint-config-prettier/9.0.0(eslint@8.47.0):
    - node_modules\eslint-config-prettier
  /eslint-plugin-prettier/5.0.0(@types/eslint@8.44.2)(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2):
    - node_modules\eslint-plugin-prettier
  /eslint-scope/7.2.2:
    - node_modules\eslint-scope
  /eslint-visitor-keys/2.1.0:
    - node_modules\@typescript-eslint\parser\node_modules\eslint-visitor-keys
  /eslint-visitor-keys/3.4.3:
    - node_modules\eslint-visitor-keys
  /eslint/8.47.0:
    - node_modules\eslint
  /espree/9.6.1:
    - node_modules\espree
  /esquery/1.6.0:
    - node_modules\esquery
  /esrecurse/4.3.0:
    - node_modules\esrecurse
  /estraverse/5.3.0:
    - node_modules\estraverse
  /esutils/2.0.3:
    - node_modules\esutils
  /eventemitter3/5.0.1:
    - node_modules\eventemitter3
  /execa/1.0.0:
    - node_modules\execa
  /expand-tilde/2.0.2:
    - node_modules\expand-tilde
  /exponential-backoff/3.1.1:
    - node_modules\exponential-backoff
  /extract-zip/2.0.1:
    - node_modules\extract-zip
  /fast-deep-equal/3.1.3:
    - node_modules\fast-deep-equal
  /fast-diff/1.3.0:
    - node_modules\fast-diff
  /fast-glob/3.3.2:
    - node_modules\fast-glob
  /fast-json-stable-stringify/2.1.0:
    - node_modules\fast-json-stable-stringify
  /fast-levenshtein/2.0.6:
    - node_modules\fast-levenshtein
  /fast-uri/3.0.3:
    - node_modules\fast-uri
  /fastq/1.17.1:
    - node_modules\fastq
  /fd-slicer/1.1.0:
    - node_modules\fd-slicer
  /file-entry-cache/6.0.1:
    - node_modules\file-entry-cache
  /filename-reserved-regex/2.0.0:
    - node_modules\filename-reserved-regex
  /filenamify/4.3.0:
    - node_modules\filenamify
  /fill-range/7.1.1:
    - node_modules\fill-range
  /find-up/2.1.0:
    - node_modules\read-pkg-up\node_modules\find-up
  /find-up/3.0.0:
    - node_modules\pkg-up\node_modules\find-up
  /find-up/4.1.0:
    - node_modules\pkg-dir\node_modules\find-up
  /find-up/5.0.0:
    - node_modules\find-up
  /flat-cache/3.2.0:
    - node_modules\flat-cache
  /flatted/3.3.1:
    - node_modules\flatted
  /flora-colossus/2.0.0:
    - node_modules\flora-colossus
  /for-each/0.3.3:
    - node_modules\for-each
  /foreground-child/3.3.0:
    - node_modules\foreground-child
  /fs-extra/10.1.0:
    - node_modules\fs-extra
  /fs-extra/11.2.0:
    - node_modules\@electron\windows-sign\node_modules\fs-extra
    - node_modules\@electron\packager\node_modules\fs-extra
    - node_modules\@electron\universal\node_modules\fs-extra
  /fs-extra/7.0.1:
    - node_modules\electron-winstaller\node_modules\fs-extra
  /fs-extra/8.1.0:
    - node_modules\electron\node_modules\fs-extra
    - node_modules\@electron\get\node_modules\fs-extra
  /fs-extra/9.1.0:
    - node_modules\@electron\notarize\node_modules\fs-extra
  /fs-minipass/2.1.0:
    - node_modules\fs-minipass
  /fs.realpath/1.0.0:
    - node_modules\fs.realpath
  /function-bind/1.1.2:
    - node_modules\function-bind
  /function.prototype.name/1.1.6:
    - node_modules\function.prototype.name
  /functions-have-names/1.2.3:
    - node_modules\functions-have-names
  /galactus/1.0.0:
    - node_modules\galactus
  /get-caller-file/2.0.5:
    - node_modules\get-caller-file
  /get-installed-path/2.1.1:
    - node_modules\get-installed-path
  /get-intrinsic/1.2.4:
    - node_modules\get-intrinsic
  /get-package-info/1.0.0:
    - node_modules\get-package-info
  /get-stream/4.1.0:
    - node_modules\execa\node_modules\get-stream
  /get-stream/5.2.0:
    - node_modules\get-stream
  /get-symbol-description/1.0.2:
    - node_modules\get-symbol-description
  /glob-parent/5.1.2:
    - node_modules\glob-parent
  /glob-parent/6.0.2:
    - node_modules\eslint\node_modules\glob-parent
  /glob/10.4.5:
    - node_modules\rimraf\node_modules\glob
  /glob/7.2.3:
    - node_modules\glob
    - node_modules\cacache\node_modules\rimraf\node_modules\glob
  /glob/8.1.0:
    - node_modules\@electron\node-gyp\node_modules\glob
    - node_modules\cacache\node_modules\glob
  /global-agent/3.0.0:
    - node_modules\global-agent
  /global-modules/1.0.0:
    - node_modules\global-modules
  /global-prefix/1.0.2:
    - node_modules\global-prefix
  /globals/13.24.0:
    - node_modules\globals
  /globalthis/1.0.4:
    - node_modules\globalthis
  /globby/11.1.0:
    - node_modules\globby
  /globby/13.2.2:
    - node_modules\cpy\node_modules\globby
  /gopd/1.0.1:
    - node_modules\gopd
  /got/11.8.6:
    - node_modules\got
  /graceful-fs/4.2.11:
    - node_modules\graceful-fs
  /graphemer/1.4.0:
    - node_modules\graphemer
  /has-bigints/1.0.2:
    - node_modules\has-bigints
  /has-flag/3.0.0:
    - node_modules\npm-run-all\node_modules\has-flag
  /has-flag/4.0.0:
    - node_modules\has-flag
  /has-property-descriptors/1.0.2:
    - node_modules\has-property-descriptors
  /has-proto/1.0.3:
    - node_modules\has-proto
  /has-symbols/1.0.3:
    - node_modules\has-symbols
  /has-tostringtag/1.0.2:
    - node_modules\has-tostringtag
  /hasown/2.0.2:
    - node_modules\hasown
  /homedir-polyfill/1.0.3:
    - node_modules\homedir-polyfill
  /hosted-git-info/2.8.9:
    - node_modules\hosted-git-info
  /http-cache-semantics/4.1.1:
    - node_modules\http-cache-semantics
  /http-proxy-agent/5.0.0:
    - node_modules\http-proxy-agent
  /http2-wrapper/1.0.3:
    - node_modules\http2-wrapper
  /https-proxy-agent/5.0.1:
    - node_modules\https-proxy-agent
  /humanize-ms/1.2.1:
    - node_modules\humanize-ms
  /iconv-lite/0.6.3:
    - node_modules\iconv-lite
  /ieee754/1.2.1:
    - node_modules\ieee754
  /ignore/5.3.2:
    - node_modules\ignore
  /import-fresh/3.3.0:
    - node_modules\import-fresh
  /imurmurhash/0.1.4:
    - node_modules\imurmurhash
  /indent-string/4.0.0:
    - node_modules\indent-string
  /indent-string/5.0.0:
    - node_modules\p-map\node_modules\indent-string
  /infer-owner/1.0.4:
    - node_modules\infer-owner
  /inflight/1.0.6:
    - node_modules\inflight
  /inherits/2.0.4:
    - node_modules\inherits
  /ini/1.3.8:
    - node_modules\ini
  /internal-slot/1.0.7:
    - node_modules\internal-slot
  /interpret/3.1.1:
    - node_modules\interpret
  /ip-address/9.0.5:
    - node_modules\ip-address
  /is-array-buffer/3.0.4:
    - node_modules\is-array-buffer
  /is-arrayish/0.2.1:
    - node_modules\is-arrayish
  /is-bigint/1.0.4:
    - node_modules\is-bigint
  /is-boolean-object/1.1.2:
    - node_modules\is-boolean-object
  /is-callable/1.2.7:
    - node_modules\is-callable
  /is-core-module/2.15.1:
    - node_modules\is-core-module
  /is-data-view/1.0.1:
    - node_modules\is-data-view
  /is-date-object/1.0.5:
    - node_modules\is-date-object
  /is-extglob/2.1.1:
    - node_modules\is-extglob
  /is-fullwidth-code-point/3.0.0:
    - node_modules\string-width\node_modules\is-fullwidth-code-point
    - node_modules\string-width-cjs\node_modules\is-fullwidth-code-point
  /is-fullwidth-code-point/4.0.0:
    - node_modules\is-fullwidth-code-point
  /is-glob/4.0.3:
    - node_modules\is-glob
  /is-interactive/1.0.0:
    - node_modules\is-interactive
  /is-lambda/1.0.1:
    - node_modules\is-lambda
  /is-negative-zero/2.0.3:
    - node_modules\is-negative-zero
  /is-number-object/1.0.7:
    - node_modules\is-number-object
  /is-number/7.0.0:
    - node_modules\is-number
  /is-obj/2.0.0:
    - node_modules\is-obj
  /is-path-inside/3.0.3:
    - node_modules\is-path-inside
  /is-plain-object/5.0.0:
    - node_modules\is-plain-object
  /is-regex/1.1.4:
    - node_modules\is-regex
  /is-shared-array-buffer/1.0.3:
    - node_modules\is-shared-array-buffer
  /is-stream/1.1.0:
    - node_modules\is-stream
  /is-string/1.0.7:
    - node_modules\is-string
  /is-symbol/1.0.4:
    - node_modules\is-symbol
  /is-typed-array/1.1.13:
    - node_modules\is-typed-array
  /is-unicode-supported/0.1.0:
    - node_modules\is-unicode-supported
  /is-weakref/1.0.2:
    - node_modules\is-weakref
  /is-windows/1.0.2:
    - node_modules\is-windows
  /isarray/2.0.5:
    - node_modules\isarray
  /isbinaryfile/4.0.10:
    - node_modules\isbinaryfile
  /isexe/2.0.0:
    - node_modules\isexe
  /jackspeak/3.4.3:
    - node_modules\jackspeak
  /js-yaml/4.1.0:
    - node_modules\js-yaml
  /jsbn/1.1.0:
    - node_modules\jsbn
  /json-buffer/3.0.1:
    - node_modules\json-buffer
  /json-parse-better-errors/1.0.2:
    - node_modules\json-parse-better-errors
  /json-schema-traverse/0.4.1:
    - node_modules\eslint\node_modules\json-schema-traverse
    - node_modules\@eslint\eslintrc\node_modules\json-schema-traverse
  /json-schema-traverse/1.0.0:
    - node_modules\json-schema-traverse
  /json-schema-typed/7.0.3:
    - node_modules\json-schema-typed
  /json-stable-stringify-without-jsonify/1.0.1:
    - node_modules\json-stable-stringify-without-jsonify
  /json-stringify-safe/5.0.1:
    - node_modules\json-stringify-safe
  /jsonfile/4.0.0:
    - node_modules\electron\node_modules\jsonfile
    - node_modules\electron-winstaller\node_modules\jsonfile
    - node_modules\@electron\get\node_modules\jsonfile
  /jsonfile/6.1.0:
    - node_modules\jsonfile
  /junk/3.1.0:
    - node_modules\junk
  /junk/4.0.1:
    - node_modules\cpy\node_modules\junk
  /keyv/4.5.4:
    - node_modules\keyv
  /levn/0.4.1:
    - node_modules\levn
  /listr2/7.0.2:
    - node_modules\listr2
  /load-json-file/2.0.0:
    - node_modules\load-json-file
  /load-json-file/4.0.0:
    - node_modules\npm-run-all\node_modules\load-json-file
  /locate-path/2.0.0:
    - node_modules\read-pkg-up\node_modules\locate-path
  /locate-path/3.0.0:
    - node_modules\locate-path
  /locate-path/5.0.0:
    - node_modules\pkg-dir\node_modules\locate-path
  /locate-path/6.0.0:
    - node_modules\find-up\node_modules\locate-path
  /lodash.get/4.4.2:
    - node_modules\lodash.get
  /lodash.merge/4.6.2:
    - node_modules\lodash.merge
  /lodash/4.17.21:
    - node_modules\lodash
  /log-symbols/4.1.0:
    - node_modules\log-symbols
  /log-update/5.0.1:
    - node_modules\log-update
  /lowercase-keys/2.0.0:
    - node_modules\lowercase-keys
  /lru-cache/10.4.3:
    - node_modules\path-scurry\node_modules\lru-cache
  /lru-cache/7.18.3:
    - node_modules\lru-cache
  /lru_map/0.3.3:
    - node_modules\lru_map
  /make-dir/3.1.0:
    - node_modules\make-dir
  /make-fetch-happen/10.2.1:
    - node_modules\make-fetch-happen
  /map-age-cleaner/0.1.3:
    - node_modules\map-age-cleaner
  /matcher/3.0.0:
    - node_modules\matcher
  /mem/4.3.0:
    - node_modules\mem
  /memorystream/0.3.1:
    - node_modules\memorystream
  /merge2/1.4.1:
    - node_modules\merge2
  /micromatch/4.0.8:
    - node_modules\micromatch
  /mime-db/1.52.0:
    - node_modules\mime-db
  /mime-types/2.1.35:
    - node_modules\mime-types
  /mimic-fn/2.1.0:
    - node_modules\mimic-fn
  /mimic-fn/3.1.0:
    - node_modules\debounce-fn\node_modules\mimic-fn
  /mimic-response/1.0.1:
    - node_modules\mimic-response
  /mimic-response/3.1.0:
    - node_modules\decompress-response\node_modules\mimic-response
  /minimatch/3.1.2:
    - node_modules\minimatch
  /minimatch/5.1.6:
    - node_modules\@electron\node-gyp\node_modules\minimatch
    - node_modules\cacache\node_modules\glob\node_modules\minimatch
  /minimatch/9.0.5:
    - node_modules\rimraf\node_modules\minimatch
    - node_modules\@electron\universal\node_modules\minimatch
  /minimist/1.2.8:
    - node_modules\minimist
  /minipass-collect/1.0.2:
    - node_modules\minipass-collect
  /minipass-fetch/2.1.2:
    - node_modules\minipass-fetch
  /minipass-flush/1.0.5:
    - node_modules\minipass-flush
  /minipass-pipeline/1.2.4:
    - node_modules\minipass-pipeline
  /minipass-sized/1.0.3:
    - node_modules\minipass-sized
  /minipass/3.3.6:
    - node_modules\minipass
  /minipass/5.0.0:
    - node_modules\tar\node_modules\minipass
  /minipass/7.1.2:
    - node_modules\rimraf\node_modules\minipass
    - node_modules\path-scurry\node_modules\minipass
  /minizlib/2.1.2:
    - node_modules\minizlib
  /mkdirp/0.5.6:
    - node_modules\temp\node_modules\mkdirp
  /mkdirp/1.0.4:
    - node_modules\mkdirp
  /ms/2.0.0:
    - node_modules\electron-squirrel-startup\node_modules\ms
    - node_modules\get-package-info\node_modules\ms
  /ms/2.1.3:
    - node_modules\ms
  /natural-compare/1.4.0:
    - node_modules\natural-compare
  /negotiator/0.6.4:
    - node_modules\negotiator
  /nested-error-stacks/2.1.1:
    - node_modules\nested-error-stacks
  /nice-try/1.0.5:
    - node_modules\nice-try
  /node-abi/3.71.0:
    - node_modules\node-abi
  /node-api-version/0.2.0:
    - node_modules\node-api-version
  /node-fetch/2.7.0:
    - node_modules\node-fetch
  /nopt/6.0.0:
    - node_modules\nopt
  /normalize-package-data/2.5.0:
    - node_modules\normalize-package-data
  /normalize-url/6.1.0:
    - node_modules\normalize-url
  /npm-run-all/4.1.5:
    - node_modules\npm-run-all
  /npm-run-path/2.0.2:
    - node_modules\npm-run-path
  /object-inspect/1.13.2:
    - node_modules\object-inspect
  /object-keys/1.1.1:
    - node_modules\object-keys
  /object.assign/4.1.5:
    - node_modules\object.assign
  /once/1.4.0:
    - node_modules\once
  /onetime/5.1.2:
    - node_modules\onetime
  /optionator/0.9.4:
    - node_modules\optionator
  /ora/5.4.1:
    - node_modules\ora
  /p-cancelable/2.1.1:
    - node_modules\p-cancelable
  /p-defer/1.0.0:
    - node_modules\p-defer
  /p-event/4.2.0:
    - node_modules\p-event
  /p-filter/3.0.0:
    - node_modules\p-filter
  /p-finally/1.0.0:
    - node_modules\p-finally
  /p-is-promise/2.1.0:
    - node_modules\p-is-promise
  /p-limit/1.3.0:
    - node_modules\read-pkg-up\node_modules\p-limit
  /p-limit/2.3.0:
    - node_modules\p-limit
  /p-limit/3.1.0:
    - node_modules\find-up\node_modules\p-limit
    - node_modules\dir-compare\node_modules\p-limit
  /p-locate/2.0.0:
    - node_modules\read-pkg-up\node_modules\p-locate
  /p-locate/3.0.0:
    - node_modules\p-locate
  /p-locate/4.1.0:
    - node_modules\pkg-dir\node_modules\p-locate
  /p-locate/5.0.0:
    - node_modules\find-up\node_modules\p-locate
  /p-map/4.0.0:
    - node_modules\cacache\node_modules\p-map
  /p-map/5.5.0:
    - node_modules\p-map
  /p-timeout/3.2.0:
    - node_modules\p-timeout
  /p-try/1.0.0:
    - node_modules\read-pkg-up\node_modules\p-try
  /p-try/2.2.0:
    - node_modules\p-try
  /package-json-from-dist/1.0.1:
    - node_modules\package-json-from-dist
  /parent-module/1.0.1:
    - node_modules\parent-module
  /parse-author/2.0.0:
    - node_modules\parse-author
  /parse-json/2.2.0:
    - node_modules\parse-json
  /parse-json/4.0.0:
    - node_modules\npm-run-all\node_modules\parse-json
  /parse-passwd/1.0.0:
    - node_modules\parse-passwd
  /path-exists/3.0.0:
    - node_modules\locate-path\node_modules\path-exists
    - node_modules\read-pkg-up\node_modules\path-exists
  /path-exists/4.0.0:
    - node_modules\path-exists
  /path-is-absolute/1.0.1:
    - node_modules\path-is-absolute
  /path-key/2.0.1:
    - node_modules\path-key
  /path-key/3.1.1:
    - node_modules\cross-spawn\node_modules\path-key
  /path-parse/1.0.7:
    - node_modules\path-parse
  /path-scurry/1.11.1:
    - node_modules\path-scurry
  /path-type/2.0.0:
    - node_modules\path-type
  /path-type/3.0.0:
    - node_modules\npm-run-all\node_modules\path-type
  /path-type/4.0.0:
    - node_modules\dir-glob\node_modules\path-type
  /pe-library/1.0.1:
    - node_modules\pe-library
  /pend/1.2.0:
    - node_modules\pend
  /picomatch/2.3.1:
    - node_modules\picomatch
  /pidtree/0.3.1:
    - node_modules\pidtree
  /pify/2.3.0:
    - node_modules\pify
  /pify/3.0.0:
    - node_modules\npm-run-all\node_modules\pify
  /pkg-dir/4.2.0:
    - node_modules\pkg-dir
  /pkg-up/3.1.0:
    - node_modules\pkg-up
  /plist/3.1.0:
    - node_modules\plist
  /possible-typed-array-names/1.0.0:
    - node_modules\possible-typed-array-names
  /postject/1.0.0-alpha.6:
    - node_modules\postject
  /prelude-ls/1.2.1:
    - node_modules\prelude-ls
  /prettier-linter-helpers/1.0.0:
    - node_modules\prettier-linter-helpers
  /prettier/3.0.2:
    - node_modules\prettier
  /proc-log/2.0.1:
    - node_modules\proc-log
  /progress/2.0.3:
    - node_modules\progress
  /promise-inflight/1.0.1:
    - node_modules\promise-inflight
  /promise-retry/2.0.1:
    - node_modules\promise-retry
  /pump/3.0.2:
    - node_modules\pump
  /punycode/2.3.1:
    - node_modules\punycode
  /queue-microtask/1.2.3:
    - node_modules\queue-microtask
  /quick-lru/5.1.1:
    - node_modules\quick-lru
  /read-binary-file-arch/1.0.6:
    - node_modules\read-binary-file-arch
  /read-pkg-up/2.0.0:
    - node_modules\read-pkg-up
  /read-pkg/2.0.0:
    - node_modules\read-pkg
  /read-pkg/3.0.0:
    - node_modules\npm-run-all\node_modules\read-pkg
  /readable-stream/3.6.2:
    - node_modules\readable-stream
  /rechoir/0.8.0:
    - node_modules\rechoir
  /regexp.prototype.flags/1.5.3:
    - node_modules\regexp.prototype.flags
  /require-directory/2.1.1:
    - node_modules\require-directory
  /require-from-string/2.0.2:
    - node_modules\require-from-string
  /resedit/2.0.3:
    - node_modules\resedit
  /resolve-alpn/1.2.1:
    - node_modules\resolve-alpn
  /resolve-dir/1.0.1:
    - node_modules\resolve-dir
  /resolve-from/4.0.0:
    - node_modules\resolve-from
  /resolve-package/1.0.1:
    - node_modules\resolve-package
  /resolve/1.22.8:
    - node_modules\resolve
  /responselike/2.0.1:
    - node_modules\responselike
  /restore-cursor/3.1.0:
    - node_modules\ora\node_modules\restore-cursor
  /restore-cursor/4.0.0:
    - node_modules\restore-cursor
  /retry/0.12.0:
    - node_modules\retry
  /reusify/1.0.4:
    - node_modules\reusify
  /rfdc/1.4.1:
    - node_modules\rfdc
  /rimraf/2.6.3:
    - node_modules\temp\node_modules\rimraf
  /rimraf/3.0.2:
    - node_modules\flat-cache\node_modules\rimraf
    - node_modules\@npmcli\move-file\node_modules\rimraf
    - node_modules\cacache\node_modules\rimraf
  /rimraf/5.0.1:
    - node_modules\rimraf
  /roarr/2.15.4:
    - node_modules\roarr
  /run-parallel/1.2.0:
    - node_modules\run-parallel
  /safe-array-concat/1.1.2:
    - node_modules\safe-array-concat
  /safe-buffer/5.2.1:
    - node_modules\safe-buffer
  /safe-regex-test/1.0.3:
    - node_modules\safe-regex-test
  /safer-buffer/2.1.2:
    - node_modules\safer-buffer
  /semver-compare/1.0.0:
    - node_modules\semver-compare
  /semver/5.7.2:
    - node_modules\npm-run-all\node_modules\semver
    - node_modules\normalize-package-data\node_modules\semver
    - node_modules\yarn-or-npm\node_modules\semver
    - node_modules\execa\node_modules\semver
  /semver/6.3.1:
    - node_modules\electron\node_modules\semver
    - node_modules\@electron\get\node_modules\semver
    - node_modules\make-dir\node_modules\semver
  /semver/7.6.3:
    - node_modules\semver
  /serialize-error/7.0.1:
    - node_modules\serialize-error
  /set-function-length/1.2.2:
    - node_modules\set-function-length
  /set-function-name/2.0.2:
    - node_modules\set-function-name
  /shebang-command/1.2.0:
    - node_modules\shebang-command
  /shebang-command/2.0.0:
    - node_modules\cross-spawn\node_modules\shebang-command
  /shebang-regex/1.0.0:
    - node_modules\shebang-regex
  /shebang-regex/3.0.0:
    - node_modules\cross-spawn\node_modules\shebang-regex
  /shell-quote/1.8.1:
    - node_modules\shell-quote
  /side-channel/1.0.6:
    - node_modules\side-channel
  /signal-exit/3.0.7:
    - node_modules\signal-exit
  /signal-exit/4.1.0:
    - node_modules\foreground-child\node_modules\signal-exit
  /slash/3.0.0:
    - node_modules\slash
  /slash/4.0.0:
    - node_modules\cpy\node_modules\slash
  /slice-ansi/5.0.0:
    - node_modules\slice-ansi
  /smart-buffer/4.2.0:
    - node_modules\smart-buffer
  /socks-proxy-agent/7.0.0:
    - node_modules\socks-proxy-agent
  /socks/2.8.3:
    - node_modules\socks
  /source-map-support/0.5.21:
    - node_modules\source-map-support
  /source-map/0.6.1:
    - node_modules\source-map
  /spdx-correct/3.2.0:
    - node_modules\spdx-correct
  /spdx-exceptions/2.5.0:
    - node_modules\spdx-exceptions
  /spdx-expression-parse/3.0.1:
    - node_modules\spdx-expression-parse
  /spdx-license-ids/3.0.20:
    - node_modules\spdx-license-ids
  /sprintf-js/1.1.3:
    - node_modules\sprintf-js
  /ssri/9.0.1:
    - node_modules\ssri
  /string-width/4.2.3:
    - node_modules\string-width
    - node_modules\string-width-cjs
  /string-width/5.1.2:
    - node_modules\wrap-ansi\node_modules\string-width
    - node_modules\cli-truncate\node_modules\string-width
    - node_modules\@isaacs\cliui\node_modules\string-width
  /string.prototype.padend/3.1.6:
    - node_modules\string.prototype.padend
  /string.prototype.trim/1.2.9:
    - node_modules\string.prototype.trim
  /string.prototype.trimend/1.0.8:
    - node_modules\string.prototype.trimend
  /string.prototype.trimstart/1.0.8:
    - node_modules\string.prototype.trimstart
  /string_decoder/1.3.0:
    - node_modules\string_decoder
  /strip-ansi/6.0.1:
    - node_modules\strip-ansi
    - node_modules\strip-ansi-cjs
  /strip-ansi/7.1.0:
    - node_modules\wrap-ansi\node_modules\strip-ansi
    - node_modules\log-update\node_modules\strip-ansi
    - node_modules\cli-truncate\node_modules\strip-ansi
    - node_modules\@isaacs\cliui\node_modules\strip-ansi
  /strip-bom/3.0.0:
    - node_modules\strip-bom
  /strip-eof/1.0.0:
    - node_modules\strip-eof
  /strip-json-comments/3.1.1:
    - node_modules\strip-json-comments
  /strip-outer/1.0.1:
    - node_modules\strip-outer
  /sudo-prompt/9.2.1:
    - node_modules\sudo-prompt
  /sumchecker/3.0.1:
    - node_modules\sumchecker
  /supports-color/5.5.0:
    - node_modules\npm-run-all\node_modules\supports-color
  /supports-color/7.2.0:
    - node_modules\supports-color
  /supports-preserve-symlinks-flag/1.0.0:
    - node_modules\supports-preserve-symlinks-flag
  /synckit/0.8.8:
    - node_modules\synckit
  /tar/6.2.1:
    - node_modules\tar
  /temp/0.9.4:
    - node_modules\temp
  /text-table/0.2.0:
    - node_modules\text-table
  /to-regex-range/5.0.1:
    - node_modules\to-regex-range
  /tr46/0.0.3:
    - node_modules\tr46
  /trim-repeated/1.0.0:
    - node_modules\trim-repeated
  /ts-api-utils/1.4.0(typescript@4.9.5):
    - node_modules\ts-api-utils
  /tslib/1.14.1:
    - node_modules\tslib
  /tslib/2.8.1:
    - node_modules\@sentry\electron\node_modules\tslib
    - node_modules\synckit\node_modules\tslib
  /tsutils/3.21.0(typescript@4.9.5):
    - node_modules\tsutils
  /type-check/0.4.0:
    - node_modules\type-check
  /type-fest/0.13.1:
    - node_modules\serialize-error\node_modules\type-fest
  /type-fest/0.20.2:
    - node_modules\globals\node_modules\type-fest
  /type-fest/1.4.0:
    - node_modules\ansi-escapes\node_modules\type-fest
  /type-fest/2.19.0:
    - node_modules\type-fest
  /typed-array-buffer/1.0.2:
    - node_modules\typed-array-buffer
  /typed-array-byte-length/1.0.1:
    - node_modules\typed-array-byte-length
  /typed-array-byte-offset/1.0.2:
    - node_modules\typed-array-byte-offset
  /typed-array-length/1.0.6:
    - node_modules\typed-array-length
  /typescript/4.9.5:
    - node_modules\typescript
  /unbox-primitive/1.0.2:
    - node_modules\unbox-primitive
  /undici-types/5.26.5:
    - node_modules\undici-types
  /unique-filename/2.0.1:
    - node_modules\unique-filename
  /unique-slug/3.0.0:
    - node_modules\unique-slug
  /universal-user-agent/6.0.1:
    - node_modules\universal-user-agent
  /universalify/0.1.2:
    - node_modules\electron\node_modules\universalify
    - node_modules\electron-winstaller\node_modules\universalify
    - node_modules\@electron\get\node_modules\universalify
  /universalify/2.0.1:
    - node_modules\universalify
  /uri-js/4.4.1:
    - node_modules\uri-js
  /username/5.1.0:
    - node_modules\username
  /util-deprecate/1.0.2:
    - node_modules\util-deprecate
  /validate-npm-package-license/3.0.4:
    - node_modules\validate-npm-package-license
  /wcwidth/1.0.1:
    - node_modules\wcwidth
  /webidl-conversions/3.0.1:
    - node_modules\webidl-conversions
  /whatwg-url/5.0.0:
    - node_modules\whatwg-url
  /which-boxed-primitive/1.0.2:
    - node_modules\which-boxed-primitive
  /which-typed-array/1.1.15:
    - node_modules\which-typed-array
  /which/1.3.1:
    - node_modules\npm-run-all\node_modules\which
    - node_modules\yarn-or-npm\node_modules\which
    - node_modules\execa\node_modules\which
    - node_modules\global-prefix\node_modules\which
  /which/2.0.2:
    - node_modules\which
  /word-wrap/1.2.5:
    - node_modules\word-wrap
  /wrap-ansi/7.0.0:
    - node_modules\wrap-ansi-cjs
    - node_modules\cliui\node_modules\wrap-ansi
  /wrap-ansi/8.1.0:
    - node_modules\wrap-ansi
  /wrappy/1.0.2:
    - node_modules\wrappy
  /xmlbuilder/15.1.1:
    - node_modules\xmlbuilder
  /y18n/5.0.8:
    - node_modules\y18n
  /yallist/4.0.0:
    - node_modules\yallist
  /yargs-parser/21.1.1:
    - node_modules\yargs-parser
  /yargs/17.7.2:
    - node_modules\yargs
  /yarn-or-npm/3.0.1:
    - node_modules\yarn-or-npm
  /yauzl/2.10.0:
    - node_modules\yauzl
  /yocto-queue/0.1.0:
    - node_modules\yocto-queue
  github.com/electron/node-gyp/06b29aafb7708acef8b3669835c8a7857ebc92d2:
    - node_modules\@electron\node-gyp
included:
  dependencies: true
  devDependencies: true
  optionalDependencies: true
injectedDeps: {}
layoutVersion: 5
nodeLinker: hoisted
packageManager: pnpm@8.5.1
pendingBuilds: []
prunedAt: Fri, 01 Nov 2024 17:38:20 GMT
publicHoistPattern:
  - '*'
registries:
  default: https://registry.npmjs.org/
skipped:
  - /@esbuild/android-arm/0.18.6
  - /@esbuild/android-arm64/0.18.6
  - /@esbuild/android-x64/0.18.6
  - /@esbuild/darwin-arm64/0.18.6
  - /@esbuild/darwin-x64/0.18.6
  - /@esbuild/freebsd-arm64/0.18.6
  - /@esbuild/freebsd-x64/0.18.6
  - /@esbuild/linux-arm/0.18.6
  - /@esbuild/linux-arm64/0.18.6
  - /@esbuild/linux-ia32/0.18.6
  - /@esbuild/linux-loong64/0.18.6
  - /@esbuild/linux-mips64el/0.18.6
  - /@esbuild/linux-ppc64/0.18.6
  - /@esbuild/linux-riscv64/0.18.6
  - /@esbuild/linux-s390x/0.18.6
  - /@esbuild/linux-x64/0.18.6
  - /@esbuild/netbsd-x64/0.18.6
  - /@esbuild/openbsd-x64/0.18.6
  - /@esbuild/sunos-x64/0.18.6
  - /@esbuild/win32-arm64/0.18.6
  - /@esbuild/win32-ia32/0.18.6
  - /@malept/cross-spawn-promise/1.1.1
  - /@types/fs-extra/9.0.13
  - /@types/glob/7.2.0
  - /@types/minimatch/5.1.2
  - /appdmg/0.6.6
  - /asar/3.2.0
  - /async/1.5.2
  - /base32-encode/1.2.0
  - /bplist-creator/0.0.8
  - /chromium-pickle-js/0.2.0
  - /cliui/7.0.4
  - /color-convert/0.5.3
  - /ds-store/0.1.6
  - /electron-installer-common/0.10.3
  - /electron-installer-debian/3.2.0
  - /encode-utf8/1.0.3
  - /fmix/0.1.0
  - /fs-temp/1.2.1
  - /fs-xattr/0.3.1
  - /gar/1.0.4
  - /generate-function/2.3.1
  - /generate-object-property/1.2.0
  - /get-folder-size/2.0.1
  - /image-size/0.7.5
  - /imul/1.0.1
  - /is-my-ip-valid/1.0.1
  - /is-my-json-valid/2.20.6
  - /is-property/1.0.2
  - /jsonpointer/5.0.1
  - /macos-alias/0.2.11
  - /murmur-32/0.2.0
  - /nan/2.22.0
  - /parse-color/1.0.0
  - /random-path/0.1.2
  - /repeat-string/1.6.1
  - /stream-buffers/2.2.0
  - /tiny-each-async/2.0.3
  - /tmp-promise/3.0.3
  - /tmp/0.2.3
  - /tn1150/0.1.0
  - /to-data-view/1.1.0
  - /unorm/1.6.0
  - /xtend/4.0.2
  - /yargs-parser/20.2.9
  - /yargs/16.2.0
storeDir: D:\.pnpm-store\v3
virtualStoreDir: D:\a\desktop\desktop\node_modules\.pnpm
lockfileVersion: '6.0'

dependencies:
  '@sentry/electron':
    specifier: ^4.5.0
    version: 4.5.0
  electron-log:
    specifier: 5.1.4
    version: 5.1.4
  electron-squirrel-startup:
    specifier: ^1.0.0
    version: 1.0.0
  electron-store:
    specifier: ^8.1.0
    version: 8.1.0

devDependencies:
  '@electron-forge/cli':
    specifier: ^7.4.0
    version: 7.4.0
  '@electron-forge/maker-deb':
    specifier: ^7.4.0
    version: 7.4.0
  '@electron-forge/maker-dmg':
    specifier: ^7.4.0
    version: 7.4.0
  '@electron-forge/maker-squirrel':
    specifier: ^7.4.0
    version: 7.4.0
  '@electron-forge/maker-zip':
    specifier: ^7.4.0
    version: 7.4.0
  '@electron-forge/publisher-github':
    specifier: ^7.4.0
    version: 7.4.0
  '@types/eslint':
    specifier: ^8.44.2
    version: 8.44.2
  '@types/node':
    specifier: ^20.10.0
    version: 20.10.0
  '@typescript-eslint/eslint-plugin':
    specifier: ^6.4.1
    version: 6.4.1(@typescript-eslint/parser@4.33.0)(eslint@8.47.0)(typescript@4.9.5)
  '@typescript-eslint/parser':
    specifier: ^4.33.0
    version: 4.33.0(eslint@8.47.0)(typescript@4.9.5)
  cpy:
    specifier: ^9.0.1
    version: 9.0.1
  cross-env:
    specifier: ^7.0.3
    version: 7.0.3
  electron:
    specifier: ^30.0.3
    version: 30.0.3
  electron-winstaller:
    specifier: ^5.3.1
    version: 5.3.1
  esbuild:
    specifier: ^0.18.6
    version: 0.18.6
  eslint:
    specifier: ^8.47.0
    version: 8.47.0
  eslint-config-prettier:
    specifier: ^9.0.0
    version: 9.0.0(eslint@8.47.0)
  eslint-plugin-prettier:
    specifier: ^5.0.0
    version: 5.0.0(@types/eslint@8.44.2)(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2)
  npm-run-all:
    specifier: ^4.1.5
    version: 4.1.5
  prettier:
    specifier: ^3.0.2
    version: 3.0.2
  rimraf:
    specifier: ^5.0.1
    version: 5.0.1
  typescript:
    specifier: ^4.9.5
    version: 4.9.5

packages:

  /@electron-forge/cli@7.4.0:
    resolution: {integrity: sha512-a+zZv3ja/IxkJzNyx4sOHSZv6DPV85S0PEVF6pcRjUpbDL5r+DxjRFsNc0Nq4UIWyFm1nw7RWoPdd9uDst4Tvg==}
    engines: {node: '>= 16.4.0'}
    hasBin: true
    dependencies:
      '@electron-forge/core': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      '@electron/get': 3.1.0
      chalk: 4.1.2
      commander: 4.1.1
      debug: 4.3.7
      fs-extra: 10.1.0
      listr2: 7.0.2
      semver: 7.6.3
    transitivePeerDependencies:
      - bluebird
      - encoding
      - supports-color
    dev: true

  /@electron-forge/core-utils@7.4.0:
    resolution: {integrity: sha512-9RLG0F9SX466TpkaTcW+V15KmnGuTpmr7NKMRlngtHXmnkBUJz4Mxp1x33WZLgL90dJrxrRgHSfVBtA4lstDPw==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@electron/rebuild': 3.7.0
      '@malept/cross-spawn-promise': 2.0.0
      chalk: 4.1.2
      debug: 4.3.7
      find-up: 5.0.0
      fs-extra: 10.1.0
      log-symbols: 4.1.0
      semver: 7.6.3
      yarn-or-npm: 3.0.1
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/core@7.4.0:
    resolution: {integrity: sha512-pYHKpB2CKeQgWsb+gox+FPkEvP+6Q2zGj2eZtgZRtKppoWIXrHIpOtcm6FllJ/gZ5u4AsQzVIYReAHGaBa0osw==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/core-utils': 7.4.0
      '@electron-forge/maker-base': 7.4.0
      '@electron-forge/plugin-base': 7.4.0
      '@electron-forge/publisher-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      '@electron-forge/template-base': 7.4.0
      '@electron-forge/template-vite': 7.4.0
      '@electron-forge/template-vite-typescript': 7.4.0
      '@electron-forge/template-webpack': 7.4.0
      '@electron-forge/template-webpack-typescript': 7.4.0
      '@electron-forge/tracer': 7.4.0
      '@electron/get': 3.1.0
      '@electron/packager': 18.3.5
      '@electron/rebuild': 3.7.0
      '@malept/cross-spawn-promise': 2.0.0
      chalk: 4.1.2
      debug: 4.3.7
      fast-glob: 3.3.2
      filenamify: 4.3.0
      find-up: 5.0.0
      fs-extra: 10.1.0
      got: 11.8.6
      interpret: 3.1.1
      listr2: 7.0.2
      lodash: 4.17.21
      log-symbols: 4.1.0
      node-fetch: 2.7.0
      progress: 2.0.3
      rechoir: 0.8.0
      resolve-package: 1.0.1
      semver: 7.6.3
      source-map-support: 0.5.21
      sudo-prompt: 9.2.1
      username: 5.1.0
      yarn-or-npm: 3.0.1
    transitivePeerDependencies:
      - bluebird
      - encoding
      - supports-color
    dev: true

  /@electron-forge/maker-base@7.4.0:
    resolution: {integrity: sha512-LwWS4VPdwjISl1KpLhmM1Qr1M3sRTTQ/RsX+GlFd7cQ1W/FsgxMjaTG4Od1d+a5CGVTh3s6X2g99TSUfxjOveg==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      fs-extra: 10.1.0
      which: 2.0.2
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/maker-deb@7.4.0:
    resolution: {integrity: sha512-npWea3IpGeu96xNqJpsCOYX6V4E+HY6u/okeTUzUOMX96UteT14MecdUefMam158glRTX84k2ryh7WcBoOa4mg==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/maker-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
    optionalDependencies:
      electron-installer-debian: 3.2.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/maker-dmg@7.4.0:
    resolution: {integrity: sha512-xRCMNtnpvQNwrDYvwbVFegnErnIMpHGZANrjwushlH9+Fsu60DFvf5s3AVkgsYdQTqlY7wYRG1mziYZmRlPAIw==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/maker-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      fs-extra: 10.1.0
    optionalDependencies:
      electron-installer-dmg: 4.0.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/maker-squirrel@7.4.0:
    resolution: {integrity: sha512-mCQyufnSNfjffiKho59ZqVg4W601zGOl6h01OyfDwjOU/G4iQtpnnDEOXGe26q7OVT5ORb1WDnfyGgBeJ6Ge7g==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/maker-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      fs-extra: 10.1.0
    optionalDependencies:
      electron-winstaller: 5.3.1
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/maker-zip@7.4.0:
    resolution: {integrity: sha512-UGbMdpuK/P29x1FFRWNOs3bNz+7QNFWVWyTM5hcWqib66cNuUmoaPifQyuwW2POIrIohrxlzLK87/i9Zc8g4dA==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/maker-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      cross-zip: 4.0.1
      fs-extra: 10.1.0
      got: 11.8.6
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/plugin-base@7.4.0:
    resolution: {integrity: sha512-LcTNtEc2YaWvhhqWVIfdJ+J0/krSgc2dqYAHhOH2aLUSm9End3dKO/PZ1Y6DPsiPiJKHnSLBJ/XBN/16NY4Sjw==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/publisher-base@7.4.0:
    resolution: {integrity: sha512-PiJk4RfaC55SnVnteLW2ZIQNM9DpGOi6YoUn5t8i9UcVp2rFIdya7bJY/b9u1hwubm4d5+TdypMVEuJjM44CJQ==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/publisher-github@7.4.0:
    resolution: {integrity: sha512-hrxKNssJyU8Yuz0qv384y5RKojMG0nWeG7/kidjp8PX/RnqjGRU/JJ0Worl28g8LGiLt5R5JIfNLngLaFMn8tg==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/publisher-base': 7.4.0
      '@electron-forge/shared-types': 7.4.0
      '@octokit/core': 3.6.0
      '@octokit/plugin-retry': 3.0.9
      '@octokit/request-error': 2.1.0
      '@octokit/rest': 18.12.0
      '@octokit/types': 6.41.0
      chalk: 4.1.2
      debug: 4.3.7
      fs-extra: 10.1.0
      log-symbols: 4.1.0
      mime-types: 2.1.35
    transitivePeerDependencies:
      - bluebird
      - encoding
      - supports-color
    dev: true

  /@electron-forge/shared-types@7.4.0:
    resolution: {integrity: sha512-5Ehy6enUjBaU08odf9u9TOhmOVXlqobzMvKUixtkdAWgV1XZAUJmn+p21xhj0IkO92MQiXMGv66w9pDNjRT8uQ==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/tracer': 7.4.0
      '@electron/packager': 18.3.5
      '@electron/rebuild': 3.7.0
      listr2: 7.0.2
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/template-base@7.4.0:
    resolution: {integrity: sha512-3YWdRSGzQfQPQkQxStn2wkJ/SuNGGKo9slwFJGvqMV+Pbx3/M/hYi9sMXOuaqVZgeaBp8Ap27yFPxaIIOC3vcA==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@malept/cross-spawn-promise': 2.0.0
      debug: 4.3.7
      fs-extra: 10.1.0
      username: 5.1.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/template-vite-typescript@7.4.0:
    resolution: {integrity: sha512-wdByG807VWcUd81E6572b/G/Ki8gb+GrCIWxO7Cl3qBa+yNaU1sHhBwB1RyTbQy1r8ubSBtsWrRD1J/yzHKWoQ==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@electron-forge/template-base': 7.4.0
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/template-vite@7.4.0:
    resolution: {integrity: sha512-YPVyCGiBKmZPCxK/Bd2louV3PBcxI2nT2+tRKP+mlEHOWrxbZIfmZSR2lIAFvK/ALKlwUKROdmlwyi7ZcdT7JQ==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@electron-forge/template-base': 7.4.0
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/template-webpack-typescript@7.4.0:
    resolution: {integrity: sha512-O5gwjNSGFNRdJWyiCtevcOBDPAMhgOPvLORh9qR1GcjyTutWwHWmZzycqH+MmkhpQPgrAYDEeipXcOQhSbzNZA==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@electron-forge/template-base': 7.4.0
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/template-webpack@7.4.0:
    resolution: {integrity: sha512-W558AEGwQrwEtKIbIJPPs0LIsaC/1Vncj5NgqKehEMJjBb0KQq4hwBu/6dauQrfun4jRCOp7LV+OVrf5XPJ7QA==}
    engines: {node: '>= 16.4.0'}
    dependencies:
      '@electron-forge/shared-types': 7.4.0
      '@electron-forge/template-base': 7.4.0
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron-forge/tracer@7.4.0:
    resolution: {integrity: sha512-F4jbnDn4yIZjmky1FZ6rgBKTM05AZQQfHkyJW2hdS4pDKJjdKAqWytoZKDi1/S6Cr6tN+DD0TFGD3V0i6HPHYQ==}
    engines: {node: '>= 14.17.5'}
    dependencies:
      chrome-trace-event: 1.0.4
    dev: true

  /@electron/asar@3.2.15:
    resolution: {integrity: sha512-AerUbRZpkDVRs58WP32t4U2bx85sfwRkQI8RMIEi6s2NBE++sgjsgAAMtXvnfTISKUkXo386pxFW7sa7WtMCrw==}
    engines: {node: '>=10.12.0'}
    hasBin: true
    dependencies:
      commander: 5.1.0
      glob: 7.2.3
      minimatch: 3.1.2
    dev: true

  /@electron/get@2.0.3:
    resolution: {integrity: sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ==}
    engines: {node: '>=12'}
    dependencies:
      debug: 4.3.7
      env-paths: 2.2.1
      fs-extra: 8.1.0
      got: 11.8.6
      progress: 2.0.3
      semver: 6.3.1
      sumchecker: 3.0.1
    optionalDependencies:
      global-agent: 3.0.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/get@3.1.0:
    resolution: {integrity: sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==}
    engines: {node: '>=14'}
    dependencies:
      debug: 4.3.7
      env-paths: 2.2.1
      fs-extra: 8.1.0
      got: 11.8.6
      progress: 2.0.3
      semver: 6.3.1
      sumchecker: 3.0.1
    optionalDependencies:
      global-agent: 3.0.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/notarize@2.5.0:
    resolution: {integrity: sha512-jNT8nwH1f9X5GEITXaQ8IF/KdskvIkOFfB2CvwumsveVidzpSc+mvhhTMdAGSYF3O+Nq49lJ7y+ssODRXu06+A==}
    engines: {node: '>= 10.0.0'}
    dependencies:
      debug: 4.3.7
      fs-extra: 9.1.0
      promise-retry: 2.0.1
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/osx-sign@1.3.1:
    resolution: {integrity: sha512-BAfviURMHpmb1Yb50YbCxnOY0wfwaLXH5KJ4+80zS0gUkzDX3ec23naTlEqKsN+PwYn+a1cCzM7BJ4Wcd3sGzw==}
    engines: {node: '>=12.0.0'}
    hasBin: true
    dependencies:
      compare-version: 0.1.2
      debug: 4.3.7
      fs-extra: 10.1.0
      isbinaryfile: 4.0.10
      minimist: 1.2.8
      plist: 3.1.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/packager@18.3.5:
    resolution: {integrity: sha512-ClgTxXTt3MesWAcjIxIkgxELjTcllw1FRoVsihP7uT48kpDMqI71p4XvnMWbq8PvU57TcrKICAaLkxRhbc+/wQ==}
    engines: {node: '>= 16.13.0'}
    hasBin: true
    dependencies:
      '@electron/asar': 3.2.15
      '@electron/get': 3.1.0
      '@electron/notarize': 2.5.0
      '@electron/osx-sign': 1.3.1
      '@electron/universal': 2.0.1
      '@electron/windows-sign': 1.1.3
      debug: 4.3.7
      extract-zip: 2.0.1
      filenamify: 4.3.0
      fs-extra: 11.2.0
      galactus: 1.0.0
      get-package-info: 1.0.0
      junk: 3.1.0
      parse-author: 2.0.0
      plist: 3.1.0
      resedit: 2.0.3
      resolve: 1.22.8
      semver: 7.6.3
      yargs-parser: 21.1.1
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/rebuild@3.7.0:
    resolution: {integrity: sha512-VW++CNSlZwMYP7MyXEbrKjpzEwhB5kDNbzGtiPEjwYysqyTCF+YbNJ210Dj3AjWsGSV4iEEwNkmJN9yGZmVvmw==}
    engines: {node: '>=12.13.0'}
    hasBin: true
    dependencies:
      '@electron/node-gyp': github.com/electron/node-gyp/06b29aafb7708acef8b3669835c8a7857ebc92d2
      '@malept/cross-spawn-promise': 2.0.0
      chalk: 4.1.2
      debug: 4.3.7
      detect-libc: 2.0.3
      fs-extra: 10.1.0
      got: 11.8.6
      node-abi: 3.71.0
      node-api-version: 0.2.0
      ora: 5.4.1
      read-binary-file-arch: 1.0.6
      semver: 7.6.3
      tar: 6.2.1
      yargs: 17.7.2
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /@electron/universal@2.0.1:
    resolution: {integrity: sha512-fKpv9kg4SPmt+hY7SVBnIYULE9QJl8L3sCfcBsnqbJwwBwAeTLokJ9TRt9y7bK0JAzIW2y78TVVjvnQEms/yyA==}
    engines: {node: '>=16.4'}
    dependencies:
      '@electron/asar': 3.2.15
      '@malept/cross-spawn-promise': 2.0.0
      debug: 4.3.7
      dir-compare: 4.2.0
      fs-extra: 11.2.0
      minimatch: 9.0.5
      plist: 3.1.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@electron/windows-sign@1.1.3:
    resolution: {integrity: sha512-OqVSdAe+/88fIjvTDWiy+5Ho1nXsiBhE5RTsIQ6M/zcxcDAEP2TlQCkOyusItnmzXRN+XTFaK9gKhiZ6KGyXQw==}
    engines: {node: '>=14.14'}
    hasBin: true
    dependencies:
      cross-dirname: 0.1.0
      debug: 4.3.7
      fs-extra: 11.2.0
      minimist: 1.2.8
      postject: 1.0.0-alpha.6
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@esbuild/android-arm64@0.18.6:
    resolution: {integrity: sha512-pL0Ci8P9q1sWbtPx8CXbc8JvPvvYdJJQ+LO09PLFsbz3aYNdFBGWJjiHU+CaObO4Ames+GOFpXRAJZS2L3ZK/A==}
    engines: {node: '>=12'}
    cpu: [arm64]
    os: [android]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/android-arm@0.18.6:
    resolution: {integrity: sha512-J3lwhDSXBBppSzm/LC1uZ8yKSIpExc+5T8MxrYD9KNVZG81FOAu2VF2gXi/6A/LwDDQQ+b6DpQbYlo3VwxFepQ==}
    engines: {node: '>=12'}
    cpu: [arm]
    os: [android]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/android-x64@0.18.6:
    resolution: {integrity: sha512-hE2vZxOlJ05aY28lUpB0y0RokngtZtcUB+TVl9vnLEnY0z/8BicSvrkThg5/iI1rbf8TwXrbr2heEjl9fLf+EA==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [android]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/darwin-arm64@0.18.6:
    resolution: {integrity: sha512-/tuyl4R+QhhoROQtuQj9E/yfJtZNdv2HKaHwYhhHGQDN1Teziem2Kh7BWQMumfiY7Lu9g5rO7scWdGE4OsQ6MQ==}
    engines: {node: '>=12'}
    cpu: [arm64]
    os: [darwin]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/darwin-x64@0.18.6:
    resolution: {integrity: sha512-L7IQga2pDT+14Ti8HZwsVfbCjuKP4U213T3tuPggOzyK/p4KaUJxQFXJgfUFHKzU0zOXx8QcYRYZf0hSQtppkw==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [darwin]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/freebsd-arm64@0.18.6:
    resolution: {integrity: sha512-bq10jFv42V20Kk77NvmO+WEZaLHBKuXcvEowixnBOMkaBgS7kQaqTc77ZJDbsUpXU3KKNLQFZctfaeINmeTsZA==}
    engines: {node: '>=12'}
    cpu: [arm64]
    os: [freebsd]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/freebsd-x64@0.18.6:
    resolution: {integrity: sha512-HbDLlkDZqUMBQaiday0pJzB6/8Xx/10dI3xRebJBReOEeDSeS+7GzTtW9h8ZnfB7/wBCqvtAjGtWQLTNPbR2+g==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [freebsd]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-arm64@0.18.6:
    resolution: {integrity: sha512-NMY9yg/88MskEZH2s4i6biz/3av+M8xY5ua4HE7CCz5DBz542cr7REe317+v7oKjnYBCijHpkzo5vU85bkXQmQ==}
    engines: {node: '>=12'}
    cpu: [arm64]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-arm@0.18.6:
    resolution: {integrity: sha512-C+5kb6rgsGMmvIdUI7v1PPgC98A6BMv233e97aXZ5AE03iMdlILFD/20HlHrOi0x2CzbspXn9HOnlE4/Ijn5Kw==}
    engines: {node: '>=12'}
    cpu: [arm]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-ia32@0.18.6:
    resolution: {integrity: sha512-AXazA0ljvQEp7cA9jscABNXsjodKbEcqPcAE3rDzKN82Vb3lYOq6INd+HOCA7hk8IegEyHW4T72Z7QGIhyCQEA==}
    engines: {node: '>=12'}
    cpu: [ia32]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-loong64@0.18.6:
    resolution: {integrity: sha512-JjBf7TwY7ldcPgHYt9UcrjZB03+WZqg/jSwMAfzOzM5ZG+tu5umUqzy5ugH/crGI4eoDIhSOTDp1NL3Uo/05Fw==}
    engines: {node: '>=12'}
    cpu: [loong64]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-mips64el@0.18.6:
    resolution: {integrity: sha512-kATNsslryVxcH1sO3KP2nnyUWtZZVkgyhAUnyTVVa0OQQ9pmDRjTpHaE+2EQHoCM5wt/uav2edrAUqbwn3tkKQ==}
    engines: {node: '>=12'}
    cpu: [mips64el]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-ppc64@0.18.6:
    resolution: {integrity: sha512-B+wTKz+8pi7mcWXFQV0LA79dJ+qhiut5uK9q0omoKnq8yRIwQJwfg3/vclXoqqcX89Ri5Y5538V0Se2v5qlcLA==}
    engines: {node: '>=12'}
    cpu: [ppc64]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-riscv64@0.18.6:
    resolution: {integrity: sha512-h44RBLVXFUSjvhOfseE+5UxQ/r9LVeqK2S8JziJKOm9W7SePYRPDyn7MhzhNCCFPkcjIy+soCxfhlJXHXXCR0A==}
    engines: {node: '>=12'}
    cpu: [riscv64]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-s390x@0.18.6:
    resolution: {integrity: sha512-FlYpyr2Xc2AUePoAbc84NRV+mj7xpsISeQ36HGf9etrY5rTBEA+IU9HzWVmw5mDFtC62EQxzkLRj8h5Hq85yOQ==}
    engines: {node: '>=12'}
    cpu: [s390x]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/linux-x64@0.18.6:
    resolution: {integrity: sha512-Mc4EUSYwzLci77u0Kao6ajB2WbTe5fNc7+lHwS3a+vJISC/oprwURezUYu1SdWAYoczbsyOvKAJwuNftoAdjjg==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [linux]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/netbsd-x64@0.18.6:
    resolution: {integrity: sha512-3hgZlp7NqIM5lNG3fpdhBI5rUnPmdahraSmwAi+YX/bp7iZ7mpTv2NkypGs/XngdMtpzljICxnUG3uPfqLFd3w==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [netbsd]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/openbsd-x64@0.18.6:
    resolution: {integrity: sha512-aEWTdZQHtSRROlDYn7ygB8yAqtnall/UnmoVIJVqccKitkAWVVSYocQUWrBOxLEFk8XdlRouVrLZe6WXszyviA==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [openbsd]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/sunos-x64@0.18.6:
    resolution: {integrity: sha512-uxk/5yAGpjKZUHOECtI9W+9IcLjKj+2m0qf+RG7f7eRBHr8wP6wsr3XbNbgtOD1qSpPapd6R2ZfSeXTkCcAo5g==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [sunos]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/win32-arm64@0.18.6:
    resolution: {integrity: sha512-oXlXGS9zvNCGoAT/tLHAsFKrIKye1JaIIP0anCdpaI+Dc10ftaNZcqfLzEwyhdzFAYInXYH4V7kEdH4hPyo9GA==}
    engines: {node: '>=12'}
    cpu: [arm64]
    os: [win32]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/win32-ia32@0.18.6:
    resolution: {integrity: sha512-qh7IcAHUvvmMBmoIG+V+BbE9ZWSR0ohF51e5g8JZvU08kZF58uDFL5tHs0eoYz31H6Finv17te3W3QB042GqVA==}
    engines: {node: '>=12'}
    cpu: [ia32]
    os: [win32]
    requiresBuild: true
    dev: true
    optional: true

  /@esbuild/win32-x64@0.18.6:
    resolution: {integrity: sha512-9UDwkz7Wlm4N9jnv+4NL7F8vxLhSZfEkRArz2gD33HesAFfMLGIGNVXRoIHtWNw8feKsnGly9Hq1EUuRkWl0zA==}
    engines: {node: '>=12'}
    cpu: [x64]
    os: [win32]
    requiresBuild: true
    dev: true
    optional: true

  /@eslint-community/eslint-utils@4.4.1(eslint@8.47.0):
    resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    peerDependencies:
      eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
    dependencies:
      eslint: 8.47.0
      eslint-visitor-keys: 3.4.3
    dev: true

  /@eslint-community/regexpp@4.12.1:
    resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==}
    engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0}
    dev: true

  /@eslint/eslintrc@2.1.4:
    resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    dependencies:
      ajv: 6.12.6
      debug: 4.3.7
      espree: 9.6.1
      globals: 13.24.0
      ignore: 5.3.2
      import-fresh: 3.3.0
      js-yaml: 4.1.0
      minimatch: 3.1.2
      strip-json-comments: 3.1.1
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@eslint/js@8.57.1:
    resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    dev: true

  /@gar/promisify@1.1.3:
    resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==}
    dev: true

  /@humanwhocodes/config-array@0.11.14:
    resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==}
    engines: {node: '>=10.10.0'}
    deprecated: Use @eslint/config-array instead
    dependencies:
      '@humanwhocodes/object-schema': 2.0.3
      debug: 4.3.7
      minimatch: 3.1.2
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@humanwhocodes/module-importer@1.0.1:
    resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
    engines: {node: '>=12.22'}
    dev: true

  /@humanwhocodes/object-schema@2.0.3:
    resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
    deprecated: Use @eslint/object-schema instead
    dev: true

  /@isaacs/cliui@8.0.2:
    resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
    engines: {node: '>=12'}
    dependencies:
      string-width: 5.1.2
      string-width-cjs: /string-width@4.2.3
      strip-ansi: 7.1.0
      strip-ansi-cjs: /strip-ansi@6.0.1
      wrap-ansi: 8.1.0
      wrap-ansi-cjs: /wrap-ansi@7.0.0
    dev: true

  /@malept/cross-spawn-promise@1.1.1:
    resolution: {integrity: sha512-RTBGWL5FWQcg9orDOCcp4LvItNzUPcyEU9bwaeJX0rJ1IQxzucC48Y0/sQLp/g6t99IQgAlGIaesJS+gTn7tVQ==}
    engines: {node: '>= 10'}
    requiresBuild: true
    dependencies:
      cross-spawn: 7.0.3
    dev: true
    optional: true

  /@malept/cross-spawn-promise@2.0.0:
    resolution: {integrity: sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==}
    engines: {node: '>= 12.13.0'}
    dependencies:
      cross-spawn: 7.0.3
    dev: true

  /@nodelib/fs.scandir@2.1.5:
    resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
    engines: {node: '>= 8'}
    dependencies:
      '@nodelib/fs.stat': 2.0.5
      run-parallel: 1.2.0
    dev: true

  /@nodelib/fs.stat@2.0.5:
    resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
    engines: {node: '>= 8'}
    dev: true

  /@nodelib/fs.walk@1.2.8:
    resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
    engines: {node: '>= 8'}
    dependencies:
      '@nodelib/fs.scandir': 2.1.5
      fastq: 1.17.1
    dev: true

  /@npmcli/fs@2.1.2:
    resolution: {integrity: sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      '@gar/promisify': 1.1.3
      semver: 7.6.3
    dev: true

  /@npmcli/move-file@2.0.1:
    resolution: {integrity: sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    deprecated: This functionality has been moved to @npmcli/fs
    dependencies:
      mkdirp: 1.0.4
      rimraf: 3.0.2
    dev: true

  /@octokit/auth-token@2.5.0:
    resolution: {integrity: sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==}
    dependencies:
      '@octokit/types': 6.41.0
    dev: true

  /@octokit/core@3.6.0:
    resolution: {integrity: sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==}
    dependencies:
      '@octokit/auth-token': 2.5.0
      '@octokit/graphql': 4.8.0
      '@octokit/request': 5.6.3
      '@octokit/request-error': 2.1.0
      '@octokit/types': 6.41.0
      before-after-hook: 2.2.3
      universal-user-agent: 6.0.1
    transitivePeerDependencies:
      - encoding
    dev: true

  /@octokit/endpoint@6.0.12:
    resolution: {integrity: sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==}
    dependencies:
      '@octokit/types': 6.41.0
      is-plain-object: 5.0.0
      universal-user-agent: 6.0.1
    dev: true

  /@octokit/graphql@4.8.0:
    resolution: {integrity: sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==}
    dependencies:
      '@octokit/request': 5.6.3
      '@octokit/types': 6.41.0
      universal-user-agent: 6.0.1
    transitivePeerDependencies:
      - encoding
    dev: true

  /@octokit/openapi-types@12.11.0:
    resolution: {integrity: sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ==}
    dev: true

  /@octokit/plugin-paginate-rest@2.21.3(@octokit/core@3.6.0):
    resolution: {integrity: sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw==}
    peerDependencies:
      '@octokit/core': '>=2'
    dependencies:
      '@octokit/core': 3.6.0
      '@octokit/types': 6.41.0
    dev: true

  /@octokit/plugin-request-log@1.0.4(@octokit/core@3.6.0):
    resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==}
    peerDependencies:
      '@octokit/core': '>=3'
    dependencies:
      '@octokit/core': 3.6.0
    dev: true

  /@octokit/plugin-rest-endpoint-methods@5.16.2(@octokit/core@3.6.0):
    resolution: {integrity: sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw==}
    peerDependencies:
      '@octokit/core': '>=3'
    dependencies:
      '@octokit/core': 3.6.0
      '@octokit/types': 6.41.0
      deprecation: 2.3.1
    dev: true

  /@octokit/plugin-retry@3.0.9:
    resolution: {integrity: sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==}
    dependencies:
      '@octokit/types': 6.41.0
      bottleneck: 2.19.5
    dev: true

  /@octokit/request-error@2.1.0:
    resolution: {integrity: sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==}
    dependencies:
      '@octokit/types': 6.41.0
      deprecation: 2.3.1
      once: 1.4.0
    dev: true

  /@octokit/request@5.6.3:
    resolution: {integrity: sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==}
    dependencies:
      '@octokit/endpoint': 6.0.12
      '@octokit/request-error': 2.1.0
      '@octokit/types': 6.41.0
      is-plain-object: 5.0.0
      node-fetch: 2.7.0
      universal-user-agent: 6.0.1
    transitivePeerDependencies:
      - encoding
    dev: true

  /@octokit/rest@18.12.0:
    resolution: {integrity: sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==}
    dependencies:
      '@octokit/core': 3.6.0
      '@octokit/plugin-paginate-rest': 2.21.3(@octokit/core@3.6.0)
      '@octokit/plugin-request-log': 1.0.4(@octokit/core@3.6.0)
      '@octokit/plugin-rest-endpoint-methods': 5.16.2(@octokit/core@3.6.0)
    transitivePeerDependencies:
      - encoding
    dev: true

  /@octokit/types@6.41.0:
    resolution: {integrity: sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg==}
    dependencies:
      '@octokit/openapi-types': 12.11.0
    dev: true

  /@pkgjs/parseargs@0.11.0:
    resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
    engines: {node: '>=14'}
    requiresBuild: true
    dev: true
    optional: true

  /@pkgr/core@0.1.1:
    resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
    engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
    dev: true

  /@sentry-internal/tracing@7.48.0:
    resolution: {integrity: sha512-MFAPDTrvCtfSm0/Zbmx7HA0Q5uCfRadOUpN8Y8rP1ndz+329h2kA3mZRCuC+3/aXL11zs2CHUhcAkGjwH2vogg==}
    engines: {node: '>=8'}
    dependencies:
      '@sentry/core': 7.48.0
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
      tslib: 1.14.1
    dev: false

  /@sentry/browser@7.48.0:
    resolution: {integrity: sha512-tdx/2nhuiykncmXFlV4Dpp+Hxgt/v31LiyXE79IcM560wc+QmWKtzoW9azBWQ0xt5KOO3ERMib9qPE4/ql1/EQ==}
    engines: {node: '>=8'}
    dependencies:
      '@sentry-internal/tracing': 7.48.0
      '@sentry/core': 7.48.0
      '@sentry/replay': 7.48.0
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
      tslib: 1.14.1
    dev: false

  /@sentry/core@7.48.0:
    resolution: {integrity: sha512-8FYuJTMpyuxRZvlen3gQ3rpOtVInSDmSyXqWEhCLuG/w34AtWoTiW7G516rsAAh6Hy1TP91GooMWbonP3XQNTQ==}
    engines: {node: '>=8'}
    dependencies:
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
      tslib: 1.14.1
    dev: false

  /@sentry/electron@4.5.0:
    resolution: {integrity: sha512-Xe5PsaiCw8CfqpgF9BQ0hn2fhBWqGHXPQgCh5oSLWOrck3MRhpWqH3g1sZJYlTBueJVXh5hxv1LveZwuKDiG2w==}
    dependencies:
      '@sentry/browser': 7.48.0
      '@sentry/core': 7.48.0
      '@sentry/node': 7.48.0
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
      deepmerge: 4.3.0
      tslib: 2.8.1
    transitivePeerDependencies:
      - supports-color
    dev: false

  /@sentry/node@7.48.0:
    resolution: {integrity: sha512-DJyyZaVhv/pUzJPof7es6zYDHeWbNqE0T3tQfLCkShdyfR+Ew8In8W/x2s7S8vq0cfRq0rqv1E6B2/HpVdYO7g==}
    engines: {node: '>=8'}
    dependencies:
      '@sentry-internal/tracing': 7.48.0
      '@sentry/core': 7.48.0
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
      cookie: 0.4.2
      https-proxy-agent: 5.0.1
      lru_map: 0.3.3
      tslib: 1.14.1
    transitivePeerDependencies:
      - supports-color
    dev: false

  /@sentry/replay@7.48.0:
    resolution: {integrity: sha512-8fRHMGJ0NJeIZi6UucxUTvfDPaBa7+jU1kCTLjCcuH3X/UVz5PtGLMtFSO5U8HP+mUDlPs97MP1uoDvMa4S2Ng==}
    engines: {node: '>=12'}
    dependencies:
      '@sentry/core': 7.48.0
      '@sentry/types': 7.48.0
      '@sentry/utils': 7.48.0
    dev: false

  /@sentry/types@7.48.0:
    resolution: {integrity: sha512-kkAszZwQ5/v4n7Yyw/DPNRWx7h724mVNRGZIJa9ggUMvTgMe7UKCZZ5wfQmYiKVlGbwd9pxXAcP8Oq15EbByFQ==}
    engines: {node: '>=8'}
    dev: false

  /@sentry/utils@7.48.0:
    resolution: {integrity: sha512-d977sghkFVMfld0LrEyyY2gYrfayLPdDEpUDT+hg5y79r7zZDCFyHtdB86699E5K89MwDZahW7Erk+a1nk4x5w==}
    engines: {node: '>=8'}
    dependencies:
      '@sentry/types': 7.48.0
      tslib: 1.14.1
    dev: false

  /@sindresorhus/is@4.6.0:
    resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==}
    engines: {node: '>=10'}
    dev: true

  /@szmarczak/http-timer@4.0.6:
    resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==}
    engines: {node: '>=10'}
    dependencies:
      defer-to-connect: 2.0.1
    dev: true

  /@tootallnate/once@2.0.0:
    resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==}
    engines: {node: '>= 10'}
    dev: true

  /@types/cacheable-request@6.0.3:
    resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==}
    dependencies:
      '@types/http-cache-semantics': 4.0.4
      '@types/keyv': 3.1.4
      '@types/node': 20.10.0
      '@types/responselike': 1.0.3
    dev: true

  /@types/eslint@8.44.2:
    resolution: {integrity: sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==}
    dependencies:
      '@types/estree': 1.0.6
      '@types/json-schema': 7.0.15
    dev: true

  /@types/estree@1.0.6:
    resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
    dev: true

  /@types/fs-extra@9.0.13:
    resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==}
    requiresBuild: true
    dependencies:
      '@types/node': 20.10.0
    dev: true
    optional: true

  /@types/glob@7.2.0:
    resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
    requiresBuild: true
    dependencies:
      '@types/minimatch': 5.1.2
      '@types/node': 20.10.0
    dev: true
    optional: true

  /@types/http-cache-semantics@4.0.4:
    resolution: {integrity: sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==}
    dev: true

  /@types/json-schema@7.0.15:
    resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
    dev: true

  /@types/keyv@3.1.4:
    resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
    dependencies:
      '@types/node': 20.10.0
    dev: true

  /@types/minimatch@5.1.2:
    resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
    requiresBuild: true
    dev: true
    optional: true

  /@types/node@20.10.0:
    resolution: {integrity: sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==}
    dependencies:
      undici-types: 5.26.5
    dev: true

  /@types/responselike@1.0.3:
    resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==}
    dependencies:
      '@types/node': 20.10.0
    dev: true

  /@types/semver@7.5.8:
    resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==}
    dev: true

  /@types/yauzl@2.10.3:
    resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
    requiresBuild: true
    dependencies:
      '@types/node': 20.10.0
    dev: true
    optional: true

  /@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@4.33.0)(eslint@8.47.0)(typescript@4.9.5):
    resolution: {integrity: sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==}
    engines: {node: ^16.0.0 || >=18.0.0}
    peerDependencies:
      '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
      eslint: ^7.0.0 || ^8.0.0
      typescript: '*'
    peerDependenciesMeta:
      typescript:
        optional: true
    dependencies:
      '@eslint-community/regexpp': 4.12.1
      '@typescript-eslint/parser': 4.33.0(eslint@8.47.0)(typescript@4.9.5)
      '@typescript-eslint/scope-manager': 6.4.1
      '@typescript-eslint/type-utils': 6.4.1(eslint@8.47.0)(typescript@4.9.5)
      '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@4.9.5)
      '@typescript-eslint/visitor-keys': 6.4.1
      debug: 4.3.7
      eslint: 8.47.0
      graphemer: 1.4.0
      ignore: 5.3.2
      natural-compare: 1.4.0
      semver: 7.6.3
      ts-api-utils: 1.4.0(typescript@4.9.5)
      typescript: 4.9.5
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@typescript-eslint/parser@4.33.0(eslint@8.47.0)(typescript@4.9.5):
    resolution: {integrity: sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==}
    engines: {node: ^10.12.0 || >=12.0.0}
    peerDependencies:
      eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
      typescript: '*'
    peerDependenciesMeta:
      typescript:
        optional: true
    dependencies:
      '@typescript-eslint/scope-manager': 4.33.0
      '@typescript-eslint/types': 4.33.0
      '@typescript-eslint/typescript-estree': 4.33.0(typescript@4.9.5)
      debug: 4.3.7
      eslint: 8.47.0
      typescript: 4.9.5
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@typescript-eslint/scope-manager@4.33.0:
    resolution: {integrity: sha512-5IfJHpgTsTZuONKbODctL4kKuQje/bzBRkwHE8UOZ4f89Zeddg+EGZs8PD8NcN4LdM3ygHWYB3ukPAYjvl/qbQ==}
    engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
    dependencies:
      '@typescript-eslint/types': 4.33.0
      '@typescript-eslint/visitor-keys': 4.33.0
    dev: true

  /@typescript-eslint/scope-manager@6.4.1:
    resolution: {integrity: sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==}
    engines: {node: ^16.0.0 || >=18.0.0}
    dependencies:
      '@typescript-eslint/types': 6.4.1
      '@typescript-eslint/visitor-keys': 6.4.1
    dev: true

  /@typescript-eslint/type-utils@6.4.1(eslint@8.47.0)(typescript@4.9.5):
    resolution: {integrity: sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==}
    engines: {node: ^16.0.0 || >=18.0.0}
    peerDependencies:
      eslint: ^7.0.0 || ^8.0.0
      typescript: '*'
    peerDependenciesMeta:
      typescript:
        optional: true
    dependencies:
      '@typescript-eslint/typescript-estree': 6.4.1(typescript@4.9.5)
      '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@4.9.5)
      debug: 4.3.7
      eslint: 8.47.0
      ts-api-utils: 1.4.0(typescript@4.9.5)
      typescript: 4.9.5
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@typescript-eslint/types@4.33.0:
    resolution: {integrity: sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==}
    engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
    dev: true

  /@typescript-eslint/types@6.4.1:
    resolution: {integrity: sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==}
    engines: {node: ^16.0.0 || >=18.0.0}
    dev: true

  /@typescript-eslint/typescript-estree@4.33.0(typescript@4.9.5):
    resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==}
    engines: {node: ^10.12.0 || >=12.0.0}
    peerDependencies:
      typescript: '*'
    peerDependenciesMeta:
      typescript:
        optional: true
    dependencies:
      '@typescript-eslint/types': 4.33.0
      '@typescript-eslint/visitor-keys': 4.33.0
      debug: 4.3.7
      globby: 11.1.0
      is-glob: 4.0.3
      semver: 7.6.3
      tsutils: 3.21.0(typescript@4.9.5)
      typescript: 4.9.5
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@typescript-eslint/typescript-estree@6.4.1(typescript@4.9.5):
    resolution: {integrity: sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==}
    engines: {node: ^16.0.0 || >=18.0.0}
    peerDependencies:
      typescript: '*'
    peerDependenciesMeta:
      typescript:
        optional: true
    dependencies:
      '@typescript-eslint/types': 6.4.1
      '@typescript-eslint/visitor-keys': 6.4.1
      debug: 4.3.7
      globby: 11.1.0
      is-glob: 4.0.3
      semver: 7.6.3
      ts-api-utils: 1.4.0(typescript@4.9.5)
      typescript: 4.9.5
    transitivePeerDependencies:
      - supports-color
    dev: true

  /@typescript-eslint/utils@6.4.1(eslint@8.47.0)(typescript@4.9.5):
    resolution: {integrity: sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==}
    engines: {node: ^16.0.0 || >=18.0.0}
    peerDependencies:
      eslint: ^7.0.0 || ^8.0.0
    dependencies:
      '@eslint-community/eslint-utils': 4.4.1(eslint@8.47.0)
      '@types/json-schema': 7.0.15
      '@types/semver': 7.5.8
      '@typescript-eslint/scope-manager': 6.4.1
      '@typescript-eslint/types': 6.4.1
      '@typescript-eslint/typescript-estree': 6.4.1(typescript@4.9.5)
      eslint: 8.47.0
      semver: 7.6.3
    transitivePeerDependencies:
      - supports-color
      - typescript
    dev: true

  /@typescript-eslint/visitor-keys@4.33.0:
    resolution: {integrity: sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg==}
    engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
    dependencies:
      '@typescript-eslint/types': 4.33.0
      eslint-visitor-keys: 2.1.0
    dev: true

  /@typescript-eslint/visitor-keys@6.4.1:
    resolution: {integrity: sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==}
    engines: {node: ^16.0.0 || >=18.0.0}
    dependencies:
      '@typescript-eslint/types': 6.4.1
      eslint-visitor-keys: 3.4.3
    dev: true

  /@xmldom/xmldom@0.8.10:
    resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
    engines: {node: '>=10.0.0'}
    dev: true

  /abbrev@1.1.1:
    resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}
    dev: true

  /acorn-jsx@5.3.2(acorn@8.14.0):
    resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
    peerDependencies:
      acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
    dependencies:
      acorn: 8.14.0
    dev: true

  /acorn@8.14.0:
    resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==}
    engines: {node: '>=0.4.0'}
    hasBin: true
    dev: true

  /agent-base@6.0.2:
    resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
    engines: {node: '>= 6.0.0'}
    dependencies:
      debug: 4.3.7
    transitivePeerDependencies:
      - supports-color

  /agentkeepalive@4.5.0:
    resolution: {integrity: sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==}
    engines: {node: '>= 8.0.0'}
    dependencies:
      humanize-ms: 1.2.1
    dev: true

  /aggregate-error@3.1.0:
    resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
    engines: {node: '>=8'}
    dependencies:
      clean-stack: 2.2.0
      indent-string: 4.0.0
    dev: true

  /aggregate-error@4.0.1:
    resolution: {integrity: sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==}
    engines: {node: '>=12'}
    dependencies:
      clean-stack: 4.2.0
      indent-string: 5.0.0
    dev: true

  /ajv-formats@2.1.1(ajv@8.17.1):
    resolution: {integrity: sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==}
    peerDependencies:
      ajv: ^8.0.0
    peerDependenciesMeta:
      ajv:
        optional: true
    dependencies:
      ajv: 8.17.1
    dev: false

  /ajv@6.12.6:
    resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==}
    dependencies:
      fast-deep-equal: 3.1.3
      fast-json-stable-stringify: 2.1.0
      json-schema-traverse: 0.4.1
      uri-js: 4.4.1
    dev: true

  /ajv@8.17.1:
    resolution: {integrity: sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==}
    dependencies:
      fast-deep-equal: 3.1.3
      fast-uri: 3.0.3
      json-schema-traverse: 1.0.0
      require-from-string: 2.0.2
    dev: false

  /ansi-escapes@5.0.0:
    resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==}
    engines: {node: '>=12'}
    dependencies:
      type-fest: 1.4.0
    dev: true

  /ansi-regex@5.0.1:
    resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
    engines: {node: '>=8'}
    dev: true

  /ansi-regex@6.1.0:
    resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==}
    engines: {node: '>=12'}
    dev: true

  /ansi-styles@3.2.1:
    resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
    engines: {node: '>=4'}
    dependencies:
      color-convert: 1.9.3
    dev: true

  /ansi-styles@4.3.0:
    resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
    engines: {node: '>=8'}
    dependencies:
      color-convert: 2.0.1
    dev: true

  /ansi-styles@6.2.1:
    resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
    engines: {node: '>=12'}
    dev: true

  /appdmg@0.6.6:
    resolution: {integrity: sha512-GRmFKlCG+PWbcYF4LUNonTYmy0GjguDy6Jh9WP8mpd0T6j80XIJyXBiWlD0U+MLNhqV9Nhx49Gl9GpVToulpLg==}
    engines: {node: '>=8.5'}
    os: [darwin]
    hasBin: true
    requiresBuild: true
    dependencies:
      async: 1.5.2
      ds-store: 0.1.6
      execa: 1.0.0
      fs-temp: 1.2.1
      fs-xattr: 0.3.1
      image-size: 0.7.5
      is-my-json-valid: 2.20.6
      minimist: 1.2.8
      parse-color: 1.0.0
      path-exists: 4.0.0
      repeat-string: 1.6.1
    dev: true
    optional: true

  /argparse@2.0.1:
    resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
    dev: true

  /array-buffer-byte-length@1.0.1:
    resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      is-array-buffer: 3.0.4
    dev: true

  /array-union@2.1.0:
    resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
    engines: {node: '>=8'}
    dev: true

  /arraybuffer.prototype.slice@1.0.3:
    resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==}
    engines: {node: '>= 0.4'}
    dependencies:
      array-buffer-byte-length: 1.0.1
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-abstract: 1.23.3
      es-errors: 1.3.0
      get-intrinsic: 1.2.4
      is-array-buffer: 3.0.4
      is-shared-array-buffer: 1.0.3
    dev: true

  /arrify@3.0.0:
    resolution: {integrity: sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==}
    engines: {node: '>=12'}
    dev: true

  /asar@3.2.0:
    resolution: {integrity: sha512-COdw2ZQvKdFGFxXwX3oYh2/sOsJWJegrdJCGxnN4MZ7IULgRBp9P6665aqj9z1v9VwP4oP1hRBojRDQ//IGgAg==}
    engines: {node: '>=10.12.0'}
    deprecated: Please use @electron/asar moving forward.  There is no API change, just a package name change
    hasBin: true
    requiresBuild: true
    dependencies:
      chromium-pickle-js: 0.2.0
      commander: 5.1.0
      glob: 7.2.3
      minimatch: 3.1.2
    optionalDependencies:
      '@types/glob': 7.2.0
    dev: true
    optional: true

  /async@1.5.2:
    resolution: {integrity: sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==}
    requiresBuild: true
    dev: true
    optional: true

  /at-least-node@1.0.0:
    resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
    engines: {node: '>= 4.0.0'}
    requiresBuild: true
    dev: true

  /atomically@1.7.0:
    resolution: {integrity: sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==}
    engines: {node: '>=10.12.0'}
    dev: false

  /author-regex@1.0.0:
    resolution: {integrity: sha512-KbWgR8wOYRAPekEmMXrYYdc7BRyhn2Ftk7KWfMUnQ43hFdojWEFRxhhRUm3/OFEdPa1r0KAvTTg9YQK57xTe0g==}
    engines: {node: '>=0.8'}
    dev: true

  /available-typed-arrays@1.0.7:
    resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      possible-typed-array-names: 1.0.0
    dev: true

  /balanced-match@1.0.2:
    resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
    dev: true

  /base32-encode@1.2.0:
    resolution: {integrity: sha512-cHFU8XeRyx0GgmoWi5qHMCVRiqU6J3MHWxVgun7jggCBUpVzm1Ir7M9dYr2whjSNc3tFeXfQ/oZjQu/4u55h9A==}
    requiresBuild: true
    dependencies:
      to-data-view: 1.1.0
    dev: true
    optional: true

  /base64-js@1.5.1:
    resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
    dev: true

  /before-after-hook@2.2.3:
    resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==}
    dev: true

  /bl@4.1.0:
    resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
    dependencies:
      buffer: 5.7.1
      inherits: 2.0.4
      readable-stream: 3.6.2
    dev: true

  /bluebird@3.7.2:
    resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==}
    dev: true

  /boolean@3.2.0:
    resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==}
    deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
    dev: true
    optional: true

  /bottleneck@2.19.5:
    resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==}
    dev: true

  /bplist-creator@0.0.8:
    resolution: {integrity: sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==}
    requiresBuild: true
    dependencies:
      stream-buffers: 2.2.0
    dev: true
    optional: true

  /brace-expansion@1.1.11:
    resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
    dependencies:
      balanced-match: 1.0.2
      concat-map: 0.0.1
    dev: true

  /brace-expansion@2.0.1:
    resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==}
    dependencies:
      balanced-match: 1.0.2
    dev: true

  /braces@3.0.3:
    resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
    engines: {node: '>=8'}
    dependencies:
      fill-range: 7.1.1
    dev: true

  /buffer-crc32@0.2.13:
    resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==}
    dev: true

  /buffer-from@1.1.2:
    resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
    dev: true

  /buffer@5.7.1:
    resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
    dependencies:
      base64-js: 1.5.1
      ieee754: 1.2.1
    dev: true

  /cacache@16.1.3:
    resolution: {integrity: sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      '@npmcli/fs': 2.1.2
      '@npmcli/move-file': 2.0.1
      chownr: 2.0.0
      fs-minipass: 2.1.0
      glob: 8.1.0
      infer-owner: 1.0.4
      lru-cache: 7.18.3
      minipass: 3.3.6
      minipass-collect: 1.0.2
      minipass-flush: 1.0.5
      minipass-pipeline: 1.2.4
      mkdirp: 1.0.4
      p-map: 4.0.0
      promise-inflight: 1.0.1
      rimraf: 3.0.2
      ssri: 9.0.1
      tar: 6.2.1
      unique-filename: 2.0.1
    transitivePeerDependencies:
      - bluebird
    dev: true

  /cacheable-lookup@5.0.4:
    resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==}
    engines: {node: '>=10.6.0'}
    dev: true

  /cacheable-request@7.0.4:
    resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==}
    engines: {node: '>=8'}
    dependencies:
      clone-response: 1.0.3
      get-stream: 5.2.0
      http-cache-semantics: 4.1.1
      keyv: 4.5.4
      lowercase-keys: 2.0.0
      normalize-url: 6.1.0
      responselike: 2.0.1
    dev: true

  /call-bind@1.0.7:
    resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==}
    engines: {node: '>= 0.4'}
    dependencies:
      es-define-property: 1.0.0
      es-errors: 1.3.0
      function-bind: 1.1.2
      get-intrinsic: 1.2.4
      set-function-length: 1.2.2
    dev: true

  /callsites@3.1.0:
    resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
    engines: {node: '>=6'}
    dev: true

  /chalk@2.4.2:
    resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
    engines: {node: '>=4'}
    dependencies:
      ansi-styles: 3.2.1
      escape-string-regexp: 1.0.5
      supports-color: 5.5.0
    dev: true

  /chalk@4.1.2:
    resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
    engines: {node: '>=10'}
    dependencies:
      ansi-styles: 4.3.0
      supports-color: 7.2.0
    dev: true

  /chownr@2.0.0:
    resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
    engines: {node: '>=10'}
    dev: true

  /chrome-trace-event@1.0.4:
    resolution: {integrity: sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==}
    engines: {node: '>=6.0'}
    dev: true

  /chromium-pickle-js@0.2.0:
    resolution: {integrity: sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==}
    requiresBuild: true
    dev: true
    optional: true

  /clean-stack@2.2.0:
    resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
    engines: {node: '>=6'}
    dev: true

  /clean-stack@4.2.0:
    resolution: {integrity: sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==}
    engines: {node: '>=12'}
    dependencies:
      escape-string-regexp: 5.0.0
    dev: true

  /cli-cursor@3.1.0:
    resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
    engines: {node: '>=8'}
    dependencies:
      restore-cursor: 3.1.0
    dev: true

  /cli-cursor@4.0.0:
    resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      restore-cursor: 4.0.0
    dev: true

  /cli-spinners@2.9.2:
    resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==}
    engines: {node: '>=6'}
    dev: true

  /cli-truncate@3.1.0:
    resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      slice-ansi: 5.0.0
      string-width: 5.1.2
    dev: true

  /cliui@7.0.4:
    resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==}
    requiresBuild: true
    dependencies:
      string-width: 4.2.3
      strip-ansi: 6.0.1
      wrap-ansi: 7.0.0
    dev: true
    optional: true

  /cliui@8.0.1:
    resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
    engines: {node: '>=12'}
    dependencies:
      string-width: 4.2.3
      strip-ansi: 6.0.1
      wrap-ansi: 7.0.0
    dev: true

  /clone-response@1.0.3:
    resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==}
    dependencies:
      mimic-response: 1.0.1
    dev: true

  /clone@1.0.4:
    resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
    engines: {node: '>=0.8'}
    dev: true

  /color-convert@0.5.3:
    resolution: {integrity: sha512-RwBeO/B/vZR3dfKL1ye/vx8MHZ40ugzpyfeVG5GsiuGnrlMWe2o8wxBbLCpw9CsxV+wHuzYlCiWnybrIA0ling==}
    requiresBuild: true
    dev: true
    optional: true

  /color-convert@1.9.3:
    resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
    dependencies:
      color-name: 1.1.3
    dev: true

  /color-convert@2.0.1:
    resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
    engines: {node: '>=7.0.0'}
    dependencies:
      color-name: 1.1.4
    dev: true

  /color-name@1.1.3:
    resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==}
    dev: true

  /color-name@1.1.4:
    resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
    dev: true

  /colorette@2.0.20:
    resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
    dev: true

  /commander@4.1.1:
    resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
    engines: {node: '>= 6'}
    dev: true

  /commander@5.1.0:
    resolution: {integrity: sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==}
    engines: {node: '>= 6'}
    dev: true

  /commander@9.5.0:
    resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==}
    engines: {node: ^12.20.0 || >=14}
    dev: true

  /compare-version@0.1.2:
    resolution: {integrity: sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==}
    engines: {node: '>=0.10.0'}
    dev: true

  /concat-map@0.0.1:
    resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
    dev: true

  /conf@10.2.0:
    resolution: {integrity: sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==}
    engines: {node: '>=12'}
    dependencies:
      ajv: 8.17.1
      ajv-formats: 2.1.1(ajv@8.17.1)
      atomically: 1.7.0
      debounce-fn: 4.0.0
      dot-prop: 6.0.1
      env-paths: 2.2.1
      json-schema-typed: 7.0.3
      onetime: 5.1.2
      pkg-up: 3.1.0
      semver: 7.6.3
    dev: false

  /cookie@0.4.2:
    resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==}
    engines: {node: '>= 0.6'}
    dev: false

  /cp-file@9.1.0:
    resolution: {integrity: sha512-3scnzFj/94eb7y4wyXRWwvzLFaQp87yyfTnChIjlfYrVqp5lVO3E2hIJMeQIltUT0K2ZAB3An1qXcBmwGyvuwA==}
    engines: {node: '>=10'}
    dependencies:
      graceful-fs: 4.2.11
      make-dir: 3.1.0
      nested-error-stacks: 2.1.1
      p-event: 4.2.0
    dev: true

  /cpy@9.0.1:
    resolution: {integrity: sha512-D9U0DR5FjTCN3oMTcFGktanHnAG5l020yvOCR1zKILmAyPP7I/9pl6NFgRbDcmSENtbK1sQLBz1p9HIOlroiNg==}
    engines: {node: ^12.20.0 || ^14.17.0 || >=16.0.0}
    dependencies:
      arrify: 3.0.0
      cp-file: 9.1.0
      globby: 13.2.2
      junk: 4.0.1
      micromatch: 4.0.8
      nested-error-stacks: 2.1.1
      p-filter: 3.0.0
      p-map: 5.5.0
    dev: true

  /cross-dirname@0.1.0:
    resolution: {integrity: sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==}
    dev: true

  /cross-env@7.0.3:
    resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
    engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
    hasBin: true
    dependencies:
      cross-spawn: 7.0.3
    dev: true

  /cross-spawn@6.0.5:
    resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==}
    engines: {node: '>=4.8'}
    dependencies:
      nice-try: 1.0.5
      path-key: 2.0.1
      semver: 5.7.2
      shebang-command: 1.2.0
      which: 1.3.1
    dev: true

  /cross-spawn@7.0.3:
    resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
    engines: {node: '>= 8'}
    dependencies:
      path-key: 3.1.1
      shebang-command: 2.0.0
      which: 2.0.2
    dev: true

  /cross-zip@4.0.1:
    resolution: {integrity: sha512-n63i0lZ0rvQ6FXiGQ+/JFCKAUyPFhLQYJIqKaa+tSJtfKeULF/IDNDAbdnSIxgS4NTuw2b0+lj8LzfITuq+ZxQ==}
    engines: {node: '>=12.10'}
    dev: true

  /data-view-buffer@1.0.1:
    resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      is-data-view: 1.0.1
    dev: true

  /data-view-byte-length@1.0.1:
    resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      is-data-view: 1.0.1
    dev: true

  /data-view-byte-offset@1.0.0:
    resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      is-data-view: 1.0.1
    dev: true

  /debounce-fn@4.0.0:
    resolution: {integrity: sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ==}
    engines: {node: '>=10'}
    dependencies:
      mimic-fn: 3.1.0
    dev: false

  /debug@2.6.9:
    resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
    peerDependencies:
      supports-color: '*'
    peerDependenciesMeta:
      supports-color:
        optional: true
    dependencies:
      ms: 2.0.0

  /debug@4.3.7:
    resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==}
    engines: {node: '>=6.0'}
    peerDependencies:
      supports-color: '*'
    peerDependenciesMeta:
      supports-color:
        optional: true
    dependencies:
      ms: 2.1.3

  /decompress-response@6.0.0:
    resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==}
    engines: {node: '>=10'}
    dependencies:
      mimic-response: 3.1.0
    dev: true

  /deep-is@0.1.4:
    resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
    dev: true

  /deepmerge@4.3.0:
    resolution: {integrity: sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==}
    engines: {node: '>=0.10.0'}
    dev: false

  /defaults@1.0.4:
    resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
    dependencies:
      clone: 1.0.4
    dev: true

  /defer-to-connect@2.0.1:
    resolution: {integrity: sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==}
    engines: {node: '>=10'}
    dev: true

  /define-data-property@1.1.4:
    resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}
    engines: {node: '>= 0.4'}
    dependencies:
      es-define-property: 1.0.0
      es-errors: 1.3.0
      gopd: 1.0.1
    dev: true

  /define-properties@1.2.1:
    resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
    engines: {node: '>= 0.4'}
    dependencies:
      define-data-property: 1.1.4
      has-property-descriptors: 1.0.2
      object-keys: 1.1.1
    dev: true

  /deprecation@2.3.1:
    resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==}
    dev: true

  /detect-libc@2.0.3:
    resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==}
    engines: {node: '>=8'}
    dev: true

  /detect-node@2.1.0:
    resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==}
    dev: true
    optional: true

  /dir-compare@4.2.0:
    resolution: {integrity: sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==}
    dependencies:
      minimatch: 3.1.2
      p-limit: 3.1.0
    dev: true

  /dir-glob@3.0.1:
    resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
    engines: {node: '>=8'}
    dependencies:
      path-type: 4.0.0
    dev: true

  /doctrine@3.0.0:
    resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
    engines: {node: '>=6.0.0'}
    dependencies:
      esutils: 2.0.3
    dev: true

  /dot-prop@6.0.1:
    resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==}
    engines: {node: '>=10'}
    dependencies:
      is-obj: 2.0.0
    dev: false

  /ds-store@0.1.6:
    resolution: {integrity: sha512-kY21M6Lz+76OS3bnCzjdsJSF7LBpLYGCVfavW8TgQD2XkcqIZ86W0y9qUDZu6fp7SIZzqosMDW2zi7zVFfv4hw==}
    requiresBuild: true
    dependencies:
      bplist-creator: 0.0.8
      macos-alias: 0.2.11
      tn1150: 0.1.0
    dev: true
    optional: true

  /eastasianwidth@0.2.0:
    resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
    dev: true

  /electron-installer-common@0.10.3:
    resolution: {integrity: sha512-mYbP+6i+nHMIm0WZHXgGdmmXMe+KXncl6jZYQNcCF9C1WsNA9C5SZ2VP4TLQMSIoFO+X4ugkMEA5uld1bmyEvA==}
    engines: {node: '>= 10.0.0'}
    requiresBuild: true
    dependencies:
      '@malept/cross-spawn-promise': 1.1.1
      asar: 3.2.0
      debug: 4.3.7
      fs-extra: 9.1.0
      glob: 7.2.3
      lodash: 4.17.21
      parse-author: 2.0.0
      semver: 7.6.3
      tmp-promise: 3.0.3
    optionalDependencies:
      '@types/fs-extra': 9.0.13
    transitivePeerDependencies:
      - supports-color
    dev: true
    optional: true

  /electron-installer-debian@3.2.0:
    resolution: {integrity: sha512-58ZrlJ1HQY80VucsEIG9tQ//HrTlG6sfofA3nRGr6TmkX661uJyu4cMPPh6kXW+aHdq/7+q25KyQhDrXvRL7jw==}
    engines: {node: '>= 10.0.0'}
    os: [darwin, linux]
    hasBin: true
    requiresBuild: true
    dependencies:
      '@malept/cross-spawn-promise': 1.1.1
      debug: 4.3.7
      electron-installer-common: 0.10.3
      fs-extra: 9.1.0
      get-folder-size: 2.0.1
      lodash: 4.17.21
      word-wrap: 1.2.5
      yargs: 16.2.0
    transitivePeerDependencies:
      - supports-color
    dev: true
    optional: true

  /electron-installer-dmg@4.0.0:
    resolution: {integrity: sha512-g3W6XnyUa7QGrAF7ViewHdt6bXV2KYU1Pm1CY3pZpp+H6mOjCHHAhf/iZAxtaX1ERCb+SQHz7xSsAHuNH9I8ZQ==}
    engines: {node: '>= 12.13.0'}
    hasBin: true
    requiresBuild: true
    dependencies:
      debug: 4.3.7
      minimist: 1.2.8
    optionalDependencies:
      appdmg: 0.6.6
    transitivePeerDependencies:
      - supports-color
    dev: true
    optional: true

  /electron-log@5.1.4:
    resolution: {integrity: sha512-P0RSXnwT3z+e89Z5uAcZDeN85/QjIgv764a93kqCi+wh2Jm22CCbc3AGDt4S8rsxAHWHB4Q0PGsQl3fw1AN0kQ==}
    engines: {node: '>= 14'}
    dev: false

  /electron-squirrel-startup@1.0.0:
    resolution: {integrity: sha512-Oce8mvgGdFmwr+DsAcXBmFK8jFfN6yaFAP9IvyhTfupM3nFkBku/7VS/mdtJteWumImkC6P+BKGsxScoDDkv9Q==}
    dependencies:
      debug: 2.6.9
    transitivePeerDependencies:
      - supports-color
    dev: false

  /electron-store@8.1.0:
    resolution: {integrity: sha512-2clHg/juMjOH0GT9cQ6qtmIvK183B39ZXR0bUoPwKwYHJsEF3quqyDzMFUAu+0OP8ijmN2CbPRAelhNbWUbzwA==}
    dependencies:
      conf: 10.2.0
      type-fest: 2.19.0
    dev: false

  /electron-winstaller@5.3.1:
    resolution: {integrity: sha512-oM8BW3a8NEqG0XW+Vx3xywhk0DyDV4T0jT0zZfWt0IczNT3jHAAvQWBorF8osQDplSsCyXXyxrsrQ8cY0Slb/A==}
    engines: {node: '>=8.0.0'}
    requiresBuild: true
    dependencies:
      '@electron/asar': 3.2.15
      debug: 4.3.7
      fs-extra: 7.0.1
      lodash: 4.17.21
      temp: 0.9.4
    optionalDependencies:
      '@electron/windows-sign': 1.1.3
    transitivePeerDependencies:
      - supports-color
    dev: true

  /electron@30.0.3:
    resolution: {integrity: sha512-h+suwx6e0fnv/9wi0/cmCMtG+4LrPzJZa+3DEEpxcPcP+pcWnBI70t8QspxgMNIh2wzXLMD9XVqrLkEbiBAInw==}
    engines: {node: '>= 12.20.55'}
    hasBin: true
    requiresBuild: true
    dependencies:
      '@electron/get': 2.0.3
      '@types/node': 20.10.0
      extract-zip: 2.0.1
    transitivePeerDependencies:
      - supports-color
    dev: true

  /emoji-regex@8.0.0:
    resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
    requiresBuild: true
    dev: true

  /emoji-regex@9.2.2:
    resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==}
    dev: true

  /encode-utf8@1.0.3:
    resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==}
    requiresBuild: true
    dev: true
    optional: true

  /encoding@0.1.13:
    resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==}
    requiresBuild: true
    dependencies:
      iconv-lite: 0.6.3
    dev: true
    optional: true

  /end-of-stream@1.4.4:
    resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
    dependencies:
      once: 1.4.0
    dev: true

  /env-paths@2.2.1:
    resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==}
    engines: {node: '>=6'}

  /err-code@2.0.3:
    resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==}
    dev: true

  /error-ex@1.3.2:
    resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
    dependencies:
      is-arrayish: 0.2.1
    dev: true

  /es-abstract@1.23.3:
    resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==}
    engines: {node: '>= 0.4'}
    dependencies:
      array-buffer-byte-length: 1.0.1
      arraybuffer.prototype.slice: 1.0.3
      available-typed-arrays: 1.0.7
      call-bind: 1.0.7
      data-view-buffer: 1.0.1
      data-view-byte-length: 1.0.1
      data-view-byte-offset: 1.0.0
      es-define-property: 1.0.0
      es-errors: 1.3.0
      es-object-atoms: 1.0.0
      es-set-tostringtag: 2.0.3
      es-to-primitive: 1.2.1
      function.prototype.name: 1.1.6
      get-intrinsic: 1.2.4
      get-symbol-description: 1.0.2
      globalthis: 1.0.4
      gopd: 1.0.1
      has-property-descriptors: 1.0.2
      has-proto: 1.0.3
      has-symbols: 1.0.3
      hasown: 2.0.2
      internal-slot: 1.0.7
      is-array-buffer: 3.0.4
      is-callable: 1.2.7
      is-data-view: 1.0.1
      is-negative-zero: 2.0.3
      is-regex: 1.1.4
      is-shared-array-buffer: 1.0.3
      is-string: 1.0.7
      is-typed-array: 1.1.13
      is-weakref: 1.0.2
      object-inspect: 1.13.2
      object-keys: 1.1.1
      object.assign: 4.1.5
      regexp.prototype.flags: 1.5.3
      safe-array-concat: 1.1.2
      safe-regex-test: 1.0.3
      string.prototype.trim: 1.2.9
      string.prototype.trimend: 1.0.8
      string.prototype.trimstart: 1.0.8
      typed-array-buffer: 1.0.2
      typed-array-byte-length: 1.0.1
      typed-array-byte-offset: 1.0.2
      typed-array-length: 1.0.6
      unbox-primitive: 1.0.2
      which-typed-array: 1.1.15
    dev: true

  /es-define-property@1.0.0:
    resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      get-intrinsic: 1.2.4
    dev: true

  /es-errors@1.3.0:
    resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
    engines: {node: '>= 0.4'}
    dev: true

  /es-object-atoms@1.0.0:
    resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==}
    engines: {node: '>= 0.4'}
    dependencies:
      es-errors: 1.3.0
    dev: true

  /es-set-tostringtag@2.0.3:
    resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      get-intrinsic: 1.2.4
      has-tostringtag: 1.0.2
      hasown: 2.0.2
    dev: true

  /es-to-primitive@1.2.1:
    resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==}
    engines: {node: '>= 0.4'}
    dependencies:
      is-callable: 1.2.7
      is-date-object: 1.0.5
      is-symbol: 1.0.4
    dev: true

  /es6-error@4.1.1:
    resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==}
    dev: true
    optional: true

  /esbuild@0.18.6:
    resolution: {integrity: sha512-5QgxWaAhU/tPBpvkxUmnFv2YINHuZzjbk0LeUUnC2i3aJHjfi5yR49lgKgF7cb98bclOp/kans8M5TGbGFfJlQ==}
    engines: {node: '>=12'}
    hasBin: true
    requiresBuild: true
    optionalDependencies:
      '@esbuild/android-arm': 0.18.6
      '@esbuild/android-arm64': 0.18.6
      '@esbuild/android-x64': 0.18.6
      '@esbuild/darwin-arm64': 0.18.6
      '@esbuild/darwin-x64': 0.18.6
      '@esbuild/freebsd-arm64': 0.18.6
      '@esbuild/freebsd-x64': 0.18.6
      '@esbuild/linux-arm': 0.18.6
      '@esbuild/linux-arm64': 0.18.6
      '@esbuild/linux-ia32': 0.18.6
      '@esbuild/linux-loong64': 0.18.6
      '@esbuild/linux-mips64el': 0.18.6
      '@esbuild/linux-ppc64': 0.18.6
      '@esbuild/linux-riscv64': 0.18.6
      '@esbuild/linux-s390x': 0.18.6
      '@esbuild/linux-x64': 0.18.6
      '@esbuild/netbsd-x64': 0.18.6
      '@esbuild/openbsd-x64': 0.18.6
      '@esbuild/sunos-x64': 0.18.6
      '@esbuild/win32-arm64': 0.18.6
      '@esbuild/win32-ia32': 0.18.6
      '@esbuild/win32-x64': 0.18.6
    dev: true

  /escalade@3.2.0:
    resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}
    engines: {node: '>=6'}
    dev: true

  /escape-string-regexp@1.0.5:
    resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==}
    engines: {node: '>=0.8.0'}
    dev: true

  /escape-string-regexp@4.0.0:
    resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
    engines: {node: '>=10'}
    dev: true

  /escape-string-regexp@5.0.0:
    resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
    engines: {node: '>=12'}
    dev: true

  /eslint-config-prettier@9.0.0(eslint@8.47.0):
    resolution: {integrity: sha512-IcJsTkJae2S35pRsRAwoCE+925rJJStOdkKnLVgtE+tEpqU0EVVM7OqrwxqgptKdX29NUwC82I5pXsGFIgSevw==}
    hasBin: true
    peerDependencies:
      eslint: '>=7.0.0'
    dependencies:
      eslint: 8.47.0
    dev: true

  /eslint-plugin-prettier@5.0.0(@types/eslint@8.44.2)(eslint-config-prettier@9.0.0)(eslint@8.47.0)(prettier@3.0.2):
    resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==}
    engines: {node: ^14.18.0 || >=16.0.0}
    peerDependencies:
      '@types/eslint': '>=8.0.0'
      eslint: '>=8.0.0'
      eslint-config-prettier: '*'
      prettier: '>=3.0.0'
    peerDependenciesMeta:
      '@types/eslint':
        optional: true
      eslint-config-prettier:
        optional: true
    dependencies:
      '@types/eslint': 8.44.2
      eslint: 8.47.0
      eslint-config-prettier: 9.0.0(eslint@8.47.0)
      prettier: 3.0.2
      prettier-linter-helpers: 1.0.0
      synckit: 0.8.8
    dev: true

  /eslint-scope@7.2.2:
    resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    dependencies:
      esrecurse: 4.3.0
      estraverse: 5.3.0
    dev: true

  /eslint-visitor-keys@2.1.0:
    resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}
    engines: {node: '>=10'}
    dev: true

  /eslint-visitor-keys@3.4.3:
    resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    dev: true

  /eslint@8.47.0:
    resolution: {integrity: sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
    hasBin: true
    dependencies:
      '@eslint-community/eslint-utils': 4.4.1(eslint@8.47.0)
      '@eslint-community/regexpp': 4.12.1
      '@eslint/eslintrc': 2.1.4
      '@eslint/js': 8.57.1
      '@humanwhocodes/config-array': 0.11.14
      '@humanwhocodes/module-importer': 1.0.1
      '@nodelib/fs.walk': 1.2.8
      ajv: 6.12.6
      chalk: 4.1.2
      cross-spawn: 7.0.3
      debug: 4.3.7
      doctrine: 3.0.0
      escape-string-regexp: 4.0.0
      eslint-scope: 7.2.2
      eslint-visitor-keys: 3.4.3
      espree: 9.6.1
      esquery: 1.6.0
      esutils: 2.0.3
      fast-deep-equal: 3.1.3
      file-entry-cache: 6.0.1
      find-up: 5.0.0
      glob-parent: 6.0.2
      globals: 13.24.0
      graphemer: 1.4.0
      ignore: 5.3.2
      imurmurhash: 0.1.4
      is-glob: 4.0.3
      is-path-inside: 3.0.3
      js-yaml: 4.1.0
      json-stable-stringify-without-jsonify: 1.0.1
      levn: 0.4.1
      lodash.merge: 4.6.2
      minimatch: 3.1.2
      natural-compare: 1.4.0
      optionator: 0.9.4
      strip-ansi: 6.0.1
      text-table: 0.2.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /espree@9.6.1:
    resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
    engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
    dependencies:
      acorn: 8.14.0
      acorn-jsx: 5.3.2(acorn@8.14.0)
      eslint-visitor-keys: 3.4.3
    dev: true

  /esquery@1.6.0:
    resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==}
    engines: {node: '>=0.10'}
    dependencies:
      estraverse: 5.3.0
    dev: true

  /esrecurse@4.3.0:
    resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
    engines: {node: '>=4.0'}
    dependencies:
      estraverse: 5.3.0
    dev: true

  /estraverse@5.3.0:
    resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==}
    engines: {node: '>=4.0'}
    dev: true

  /esutils@2.0.3:
    resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
    engines: {node: '>=0.10.0'}
    dev: true

  /eventemitter3@5.0.1:
    resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
    dev: true

  /execa@1.0.0:
    resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==}
    engines: {node: '>=6'}
    dependencies:
      cross-spawn: 6.0.5
      get-stream: 4.1.0
      is-stream: 1.1.0
      npm-run-path: 2.0.2
      p-finally: 1.0.0
      signal-exit: 3.0.7
      strip-eof: 1.0.0
    dev: true

  /expand-tilde@2.0.2:
    resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==}
    engines: {node: '>=0.10.0'}
    dependencies:
      homedir-polyfill: 1.0.3
    dev: true

  /exponential-backoff@3.1.1:
    resolution: {integrity: sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==}
    dev: true

  /extract-zip@2.0.1:
    resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==}
    engines: {node: '>= 10.17.0'}
    hasBin: true
    dependencies:
      debug: 4.3.7
      get-stream: 5.2.0
      yauzl: 2.10.0
    optionalDependencies:
      '@types/yauzl': 2.10.3
    transitivePeerDependencies:
      - supports-color
    dev: true

  /fast-deep-equal@3.1.3:
    resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}

  /fast-diff@1.3.0:
    resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
    dev: true

  /fast-glob@3.3.2:
    resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
    engines: {node: '>=8.6.0'}
    dependencies:
      '@nodelib/fs.stat': 2.0.5
      '@nodelib/fs.walk': 1.2.8
      glob-parent: 5.1.2
      merge2: 1.4.1
      micromatch: 4.0.8
    dev: true

  /fast-json-stable-stringify@2.1.0:
    resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
    dev: true

  /fast-levenshtein@2.0.6:
    resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
    dev: true

  /fast-uri@3.0.3:
    resolution: {integrity: sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==}
    dev: false

  /fastq@1.17.1:
    resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
    dependencies:
      reusify: 1.0.4
    dev: true

  /fd-slicer@1.1.0:
    resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==}
    dependencies:
      pend: 1.2.0
    dev: true

  /file-entry-cache@6.0.1:
    resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
    engines: {node: ^10.12.0 || >=12.0.0}
    dependencies:
      flat-cache: 3.2.0
    dev: true

  /filename-reserved-regex@2.0.0:
    resolution: {integrity: sha512-lc1bnsSr4L4Bdif8Xb/qrtokGbq5zlsms/CYH8PP+WtCkGNF65DPiQY8vG3SakEdRn8Dlnm+gW/qWKKjS5sZzQ==}
    engines: {node: '>=4'}
    dev: true

  /filenamify@4.3.0:
    resolution: {integrity: sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==}
    engines: {node: '>=8'}
    dependencies:
      filename-reserved-regex: 2.0.0
      strip-outer: 1.0.1
      trim-repeated: 1.0.0
    dev: true

  /fill-range@7.1.1:
    resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
    engines: {node: '>=8'}
    dependencies:
      to-regex-range: 5.0.1
    dev: true

  /find-up@2.1.0:
    resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==}
    engines: {node: '>=4'}
    dependencies:
      locate-path: 2.0.0
    dev: true

  /find-up@3.0.0:
    resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==}
    engines: {node: '>=6'}
    dependencies:
      locate-path: 3.0.0
    dev: false

  /find-up@4.1.0:
    resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
    engines: {node: '>=8'}
    dependencies:
      locate-path: 5.0.0
      path-exists: 4.0.0
    dev: true

  /find-up@5.0.0:
    resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
    engines: {node: '>=10'}
    dependencies:
      locate-path: 6.0.0
      path-exists: 4.0.0
    dev: true

  /flat-cache@3.2.0:
    resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==}
    engines: {node: ^10.12.0 || >=12.0.0}
    dependencies:
      flatted: 3.3.1
      keyv: 4.5.4
      rimraf: 3.0.2
    dev: true

  /flatted@3.3.1:
    resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==}
    dev: true

  /flora-colossus@2.0.0:
    resolution: {integrity: sha512-dz4HxH6pOvbUzZpZ/yXhafjbR2I8cenK5xL0KtBFb7U2ADsR+OwXifnxZjij/pZWF775uSCMzWVd+jDik2H2IA==}
    engines: {node: '>= 12'}
    dependencies:
      debug: 4.3.7
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /fmix@0.1.0:
    resolution: {integrity: sha512-Y6hyofImk9JdzU8k5INtTXX1cu8LDlePWDFU5sftm9H+zKCr5SGrVjdhkvsim646cw5zD0nADj8oHyXMZmCZ9w==}
    requiresBuild: true
    dependencies:
      imul: 1.0.1
    dev: true
    optional: true

  /for-each@0.3.3:
    resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==}
    dependencies:
      is-callable: 1.2.7
    dev: true

  /foreground-child@3.3.0:
    resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==}
    engines: {node: '>=14'}
    dependencies:
      cross-spawn: 7.0.3
      signal-exit: 4.1.0
    dev: true

  /fs-extra@10.1.0:
    resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
    engines: {node: '>=12'}
    dependencies:
      graceful-fs: 4.2.11
      jsonfile: 6.1.0
      universalify: 2.0.1
    dev: true

  /fs-extra@11.2.0:
    resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==}
    engines: {node: '>=14.14'}
    dependencies:
      graceful-fs: 4.2.11
      jsonfile: 6.1.0
      universalify: 2.0.1
    dev: true

  /fs-extra@7.0.1:
    resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
    engines: {node: '>=6 <7 || >=8'}
    dependencies:
      graceful-fs: 4.2.11
      jsonfile: 4.0.0
      universalify: 0.1.2
    dev: true

  /fs-extra@8.1.0:
    resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
    engines: {node: '>=6 <7 || >=8'}
    dependencies:
      graceful-fs: 4.2.11
      jsonfile: 4.0.0
      universalify: 0.1.2
    dev: true

  /fs-extra@9.1.0:
    resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}
    engines: {node: '>=10'}
    dependencies:
      at-least-node: 1.0.0
      graceful-fs: 4.2.11
      jsonfile: 6.1.0
      universalify: 2.0.1
    dev: true

  /fs-minipass@2.1.0:
    resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
    engines: {node: '>= 8'}
    dependencies:
      minipass: 3.3.6
    dev: true

  /fs-temp@1.2.1:
    resolution: {integrity: sha512-okTwLB7/Qsq82G6iN5zZJFsOfZtx2/pqrA7Hk/9fvy+c+eJS9CvgGXT2uNxwnI14BDY9L/jQPkaBgSvlKfSW9w==}
    requiresBuild: true
    dependencies:
      random-path: 0.1.2
    dev: true
    optional: true

  /fs-xattr@0.3.1:
    resolution: {integrity: sha512-UVqkrEW0GfDabw4C3HOrFlxKfx0eeigfRne69FxSBdHIP8Qt5Sq6Pu3RM9KmMlkygtC4pPKkj5CiPO5USnj2GA==}
    engines: {node: '>=8.6.0'}
    os: ['!win32']
    requiresBuild: true
    dev: true
    optional: true

  /fs.realpath@1.0.0:
    resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
    dev: true

  /function-bind@1.1.2:
    resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
    dev: true

  /function.prototype.name@1.1.6:
    resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-abstract: 1.23.3
      functions-have-names: 1.2.3
    dev: true

  /functions-have-names@1.2.3:
    resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==}
    dev: true

  /galactus@1.0.0:
    resolution: {integrity: sha512-R1fam6D4CyKQGNlvJne4dkNF+PvUUl7TAJInvTGa9fti9qAv95quQz29GXapA4d8Ec266mJJxFVh82M4GIIGDQ==}
    engines: {node: '>= 12'}
    dependencies:
      debug: 4.3.7
      flora-colossus: 2.0.0
      fs-extra: 10.1.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /gar@1.0.4:
    resolution: {integrity: sha512-w4n9cPWyP7aHxKxYHFQMegj7WIAsL/YX/C4Bs5Rr8s1H9M1rNtRWRsw+ovYMkXDQ5S4ZbYHsHAPmevPjPgw44w==}
    deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
    requiresBuild: true
    dev: true
    optional: true

  /generate-function@2.3.1:
    resolution: {integrity: sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==}
    requiresBuild: true
    dependencies:
      is-property: 1.0.2
    dev: true
    optional: true

  /generate-object-property@1.2.0:
    resolution: {integrity: sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ==}
    requiresBuild: true
    dependencies:
      is-property: 1.0.2
    dev: true
    optional: true

  /get-caller-file@2.0.5:
    resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
    engines: {node: 6.* || 8.* || >= 10.*}
    dev: true

  /get-folder-size@2.0.1:
    resolution: {integrity: sha512-+CEb+GDCM7tkOS2wdMKTn9vU7DgnKUTuDlehkNJKNSovdCOVxs14OfKCk4cvSaR3za4gj+OBdl9opPN9xrJ0zA==}
    hasBin: true
    requiresBuild: true
    dependencies:
      gar: 1.0.4
      tiny-each-async: 2.0.3
    dev: true
    optional: true

  /get-installed-path@2.1.1:
    resolution: {integrity: sha512-Qkn9eq6tW5/q9BDVdMpB8tOHljX9OSP0jRC5TRNVA4qRc839t4g8KQaR8t0Uv0EFVL0MlyG7m/ofjEgAROtYsA==}
    dependencies:
      global-modules: 1.0.0
    dev: true

  /get-intrinsic@1.2.4:
    resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      es-errors: 1.3.0
      function-bind: 1.1.2
      has-proto: 1.0.3
      has-symbols: 1.0.3
      hasown: 2.0.2
    dev: true

  /get-package-info@1.0.0:
    resolution: {integrity: sha512-SCbprXGAPdIhKAXiG+Mk6yeoFH61JlYunqdFQFHDtLjJlDjFf6x07dsS8acO+xWt52jpdVo49AlVDnUVK1sDNw==}
    engines: {node: '>= 4.0'}
    dependencies:
      bluebird: 3.7.2
      debug: 2.6.9
      lodash.get: 4.4.2
      read-pkg-up: 2.0.0
    transitivePeerDependencies:
      - supports-color
    dev: true

  /get-stream@4.1.0:
    resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==}
    engines: {node: '>=6'}
    dependencies:
      pump: 3.0.2
    dev: true

  /get-stream@5.2.0:
    resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
    engines: {node: '>=8'}
    dependencies:
      pump: 3.0.2
    dev: true

  /get-symbol-description@1.0.2:
    resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      get-intrinsic: 1.2.4
    dev: true

  /glob-parent@5.1.2:
    resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
    engines: {node: '>= 6'}
    dependencies:
      is-glob: 4.0.3
    dev: true

  /glob-parent@6.0.2:
    resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}
    engines: {node: '>=10.13.0'}
    dependencies:
      is-glob: 4.0.3
    dev: true

  /glob@10.4.5:
    resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==}
    hasBin: true
    dependencies:
      foreground-child: 3.3.0
      jackspeak: 3.4.3
      minimatch: 9.0.5
      minipass: 7.1.2
      package-json-from-dist: 1.0.1
      path-scurry: 1.11.1
    dev: true

  /glob@7.2.3:
    resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
    deprecated: Glob versions prior to v9 are no longer supported
    dependencies:
      fs.realpath: 1.0.0
      inflight: 1.0.6
      inherits: 2.0.4
      minimatch: 3.1.2
      once: 1.4.0
      path-is-absolute: 1.0.1
    dev: true

  /glob@8.1.0:
    resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==}
    engines: {node: '>=12'}
    deprecated: Glob versions prior to v9 are no longer supported
    dependencies:
      fs.realpath: 1.0.0
      inflight: 1.0.6
      inherits: 2.0.4
      minimatch: 5.1.6
      once: 1.4.0
    dev: true

  /global-agent@3.0.0:
    resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}
    engines: {node: '>=10.0'}
    requiresBuild: true
    dependencies:
      boolean: 3.2.0
      es6-error: 4.1.1
      matcher: 3.0.0
      roarr: 2.15.4
      semver: 7.6.3
      serialize-error: 7.0.1
    dev: true
    optional: true

  /global-modules@1.0.0:
    resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      global-prefix: 1.0.2
      is-windows: 1.0.2
      resolve-dir: 1.0.1
    dev: true

  /global-prefix@1.0.2:
    resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      expand-tilde: 2.0.2
      homedir-polyfill: 1.0.3
      ini: 1.3.8
      is-windows: 1.0.2
      which: 1.3.1
    dev: true

  /globals@13.24.0:
    resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==}
    engines: {node: '>=8'}
    dependencies:
      type-fest: 0.20.2
    dev: true

  /globalthis@1.0.4:
    resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      define-properties: 1.2.1
      gopd: 1.0.1
    dev: true

  /globby@11.1.0:
    resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
    engines: {node: '>=10'}
    dependencies:
      array-union: 2.1.0
      dir-glob: 3.0.1
      fast-glob: 3.3.2
      ignore: 5.3.2
      merge2: 1.4.1
      slash: 3.0.0
    dev: true

  /globby@13.2.2:
    resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      dir-glob: 3.0.1
      fast-glob: 3.3.2
      ignore: 5.3.2
      merge2: 1.4.1
      slash: 4.0.0
    dev: true

  /gopd@1.0.1:
    resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
    dependencies:
      get-intrinsic: 1.2.4
    dev: true

  /got@11.8.6:
    resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==}
    engines: {node: '>=10.19.0'}
    dependencies:
      '@sindresorhus/is': 4.6.0
      '@szmarczak/http-timer': 4.0.6
      '@types/cacheable-request': 6.0.3
      '@types/responselike': 1.0.3
      cacheable-lookup: 5.0.4
      cacheable-request: 7.0.4
      decompress-response: 6.0.0
      http2-wrapper: 1.0.3
      lowercase-keys: 2.0.0
      p-cancelable: 2.1.1
      responselike: 2.0.1
    dev: true

  /graceful-fs@4.2.11:
    resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
    dev: true

  /graphemer@1.4.0:
    resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==}
    dev: true

  /has-bigints@1.0.2:
    resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==}
    dev: true

  /has-flag@3.0.0:
    resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
    engines: {node: '>=4'}
    dev: true

  /has-flag@4.0.0:
    resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
    engines: {node: '>=8'}
    dev: true

  /has-property-descriptors@1.0.2:
    resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}
    dependencies:
      es-define-property: 1.0.0
    dev: true

  /has-proto@1.0.3:
    resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==}
    engines: {node: '>= 0.4'}
    dev: true

  /has-symbols@1.0.3:
    resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==}
    engines: {node: '>= 0.4'}
    dev: true

  /has-tostringtag@1.0.2:
    resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
    engines: {node: '>= 0.4'}
    dependencies:
      has-symbols: 1.0.3
    dev: true

  /hasown@2.0.2:
    resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      function-bind: 1.1.2
    dev: true

  /homedir-polyfill@1.0.3:
    resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
    engines: {node: '>=0.10.0'}
    dependencies:
      parse-passwd: 1.0.0
    dev: true

  /hosted-git-info@2.8.9:
    resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
    dev: true

  /http-cache-semantics@4.1.1:
    resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==}
    dev: true

  /http-proxy-agent@5.0.0:
    resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==}
    engines: {node: '>= 6'}
    dependencies:
      '@tootallnate/once': 2.0.0
      agent-base: 6.0.2
      debug: 4.3.7
    transitivePeerDependencies:
      - supports-color
    dev: true

  /http2-wrapper@1.0.3:
    resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==}
    engines: {node: '>=10.19.0'}
    dependencies:
      quick-lru: 5.1.1
      resolve-alpn: 1.2.1
    dev: true

  /https-proxy-agent@5.0.1:
    resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==}
    engines: {node: '>= 6'}
    dependencies:
      agent-base: 6.0.2
      debug: 4.3.7
    transitivePeerDependencies:
      - supports-color

  /humanize-ms@1.2.1:
    resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==}
    dependencies:
      ms: 2.1.3
    dev: true

  /iconv-lite@0.6.3:
    resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
    engines: {node: '>=0.10.0'}
    dependencies:
      safer-buffer: 2.1.2
    dev: true
    optional: true

  /ieee754@1.2.1:
    resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
    dev: true

  /ignore@5.3.2:
    resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
    engines: {node: '>= 4'}
    dev: true

  /image-size@0.7.5:
    resolution: {integrity: sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==}
    engines: {node: '>=6.9.0'}
    hasBin: true
    requiresBuild: true
    dev: true
    optional: true

  /import-fresh@3.3.0:
    resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
    engines: {node: '>=6'}
    dependencies:
      parent-module: 1.0.1
      resolve-from: 4.0.0
    dev: true

  /imul@1.0.1:
    resolution: {integrity: sha512-WFAgfwPLAjU66EKt6vRdTlKj4nAgIDQzh29JonLa4Bqtl6D8JrIMvWjCnx7xEjVNmP3U0fM5o8ZObk7d0f62bA==}
    engines: {node: '>=0.10.0'}
    requiresBuild: true
    dev: true
    optional: true

  /imurmurhash@0.1.4:
    resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
    engines: {node: '>=0.8.19'}
    dev: true

  /indent-string@4.0.0:
    resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
    engines: {node: '>=8'}
    dev: true

  /indent-string@5.0.0:
    resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==}
    engines: {node: '>=12'}
    dev: true

  /infer-owner@1.0.4:
    resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==}
    dev: true

  /inflight@1.0.6:
    resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
    deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
    dependencies:
      once: 1.4.0
      wrappy: 1.0.2
    dev: true

  /inherits@2.0.4:
    resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
    dev: true

  /ini@1.3.8:
    resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==}
    dev: true

  /internal-slot@1.0.7:
    resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==}
    engines: {node: '>= 0.4'}
    dependencies:
      es-errors: 1.3.0
      hasown: 2.0.2
      side-channel: 1.0.6
    dev: true

  /interpret@3.1.1:
    resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==}
    engines: {node: '>=10.13.0'}
    dev: true

  /ip-address@9.0.5:
    resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
    engines: {node: '>= 12'}
    dependencies:
      jsbn: 1.1.0
      sprintf-js: 1.1.3
    dev: true

  /is-array-buffer@3.0.4:
    resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      get-intrinsic: 1.2.4
    dev: true

  /is-arrayish@0.2.1:
    resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==}
    dev: true

  /is-bigint@1.0.4:
    resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==}
    dependencies:
      has-bigints: 1.0.2
    dev: true

  /is-boolean-object@1.1.2:
    resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      has-tostringtag: 1.0.2
    dev: true

  /is-callable@1.2.7:
    resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==}
    engines: {node: '>= 0.4'}
    dev: true

  /is-core-module@2.15.1:
    resolution: {integrity: sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      hasown: 2.0.2
    dev: true

  /is-data-view@1.0.1:
    resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==}
    engines: {node: '>= 0.4'}
    dependencies:
      is-typed-array: 1.1.13
    dev: true

  /is-date-object@1.0.5:
    resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      has-tostringtag: 1.0.2
    dev: true

  /is-extglob@2.1.1:
    resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
    engines: {node: '>=0.10.0'}
    dev: true

  /is-fullwidth-code-point@3.0.0:
    resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
    engines: {node: '>=8'}
    requiresBuild: true
    dev: true

  /is-fullwidth-code-point@4.0.0:
    resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==}
    engines: {node: '>=12'}
    dev: true

  /is-glob@4.0.3:
    resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      is-extglob: 2.1.1
    dev: true

  /is-interactive@1.0.0:
    resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==}
    engines: {node: '>=8'}
    dev: true

  /is-lambda@1.0.1:
    resolution: {integrity: sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==}
    dev: true

  /is-my-ip-valid@1.0.1:
    resolution: {integrity: sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg==}
    requiresBuild: true
    dev: true
    optional: true

  /is-my-json-valid@2.20.6:
    resolution: {integrity: sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==}
    requiresBuild: true
    dependencies:
      generate-function: 2.3.1
      generate-object-property: 1.2.0
      is-my-ip-valid: 1.0.1
      jsonpointer: 5.0.1
      xtend: 4.0.2
    dev: true
    optional: true

  /is-negative-zero@2.0.3:
    resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==}
    engines: {node: '>= 0.4'}
    dev: true

  /is-number-object@1.0.7:
    resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      has-tostringtag: 1.0.2
    dev: true

  /is-number@7.0.0:
    resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
    engines: {node: '>=0.12.0'}
    dev: true

  /is-obj@2.0.0:
    resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==}
    engines: {node: '>=8'}
    dev: false

  /is-path-inside@3.0.3:
    resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
    engines: {node: '>=8'}
    dev: true

  /is-plain-object@5.0.0:
    resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
    engines: {node: '>=0.10.0'}
    dev: true

  /is-property@1.0.2:
    resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==}
    requiresBuild: true
    dev: true
    optional: true

  /is-regex@1.1.4:
    resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      has-tostringtag: 1.0.2
    dev: true

  /is-shared-array-buffer@1.0.3:
    resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
    dev: true

  /is-stream@1.1.0:
    resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==}
    engines: {node: '>=0.10.0'}
    dev: true

  /is-string@1.0.7:
    resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
    engines: {node: '>= 0.4'}
    dependencies:
      has-tostringtag: 1.0.2
    dev: true

  /is-symbol@1.0.4:
    resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==}
    engines: {node: '>= 0.4'}
    dependencies:
      has-symbols: 1.0.3
    dev: true

  /is-typed-array@1.1.13:
    resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==}
    engines: {node: '>= 0.4'}
    dependencies:
      which-typed-array: 1.1.15
    dev: true

  /is-unicode-supported@0.1.0:
    resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
    engines: {node: '>=10'}
    dev: true

  /is-weakref@1.0.2:
    resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==}
    dependencies:
      call-bind: 1.0.7
    dev: true

  /is-windows@1.0.2:
    resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==}
    engines: {node: '>=0.10.0'}
    dev: true

  /isarray@2.0.5:
    resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==}
    dev: true

  /isbinaryfile@4.0.10:
    resolution: {integrity: sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==}
    engines: {node: '>= 8.0.0'}
    dev: true

  /isexe@2.0.0:
    resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
    dev: true

  /jackspeak@3.4.3:
    resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
    dependencies:
      '@isaacs/cliui': 8.0.2
    optionalDependencies:
      '@pkgjs/parseargs': 0.11.0
    dev: true

  /js-yaml@4.1.0:
    resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==}
    hasBin: true
    dependencies:
      argparse: 2.0.1
    dev: true

  /jsbn@1.1.0:
    resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
    dev: true

  /json-buffer@3.0.1:
    resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
    dev: true

  /json-parse-better-errors@1.0.2:
    resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
    dev: true

  /json-schema-traverse@0.4.1:
    resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
    dev: true

  /json-schema-traverse@1.0.0:
    resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
    dev: false

  /json-schema-typed@7.0.3:
    resolution: {integrity: sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A==}
    dev: false

  /json-stable-stringify-without-jsonify@1.0.1:
    resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
    dev: true

  /json-stringify-safe@5.0.1:
    resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
    dev: true
    optional: true

  /jsonfile@4.0.0:
    resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
    optionalDependencies:
      graceful-fs: 4.2.11
    dev: true

  /jsonfile@6.1.0:
    resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
    dependencies:
      universalify: 2.0.1
    optionalDependencies:
      graceful-fs: 4.2.11
    dev: true

  /jsonpointer@5.0.1:
    resolution: {integrity: sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==}
    engines: {node: '>=0.10.0'}
    requiresBuild: true
    dev: true
    optional: true

  /junk@3.1.0:
    resolution: {integrity: sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==}
    engines: {node: '>=8'}
    dev: true

  /junk@4.0.1:
    resolution: {integrity: sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==}
    engines: {node: '>=12.20'}
    dev: true

  /keyv@4.5.4:
    resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}
    dependencies:
      json-buffer: 3.0.1
    dev: true

  /levn@0.4.1:
    resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
    engines: {node: '>= 0.8.0'}
    dependencies:
      prelude-ls: 1.2.1
      type-check: 0.4.0
    dev: true

  /listr2@7.0.2:
    resolution: {integrity: sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==}
    engines: {node: '>=16.0.0'}
    dependencies:
      cli-truncate: 3.1.0
      colorette: 2.0.20
      eventemitter3: 5.0.1
      log-update: 5.0.1
      rfdc: 1.4.1
      wrap-ansi: 8.1.0
    dev: true

  /load-json-file@2.0.0:
    resolution: {integrity: sha512-3p6ZOGNbiX4CdvEd1VcE6yi78UrGNpjHO33noGwHCnT/o2fyllJDepsm8+mFFv/DvtwFHht5HIHSyOy5a+ChVQ==}
    engines: {node: '>=4'}
    dependencies:
      graceful-fs: 4.2.11
      parse-json: 2.2.0
      pify: 2.3.0
      strip-bom: 3.0.0
    dev: true

  /load-json-file@4.0.0:
    resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==}
    engines: {node: '>=4'}
    dependencies:
      graceful-fs: 4.2.11
      parse-json: 4.0.0
      pify: 3.0.0
      strip-bom: 3.0.0
    dev: true

  /locate-path@2.0.0:
    resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==}
    engines: {node: '>=4'}
    dependencies:
      p-locate: 2.0.0
      path-exists: 3.0.0
    dev: true

  /locate-path@3.0.0:
    resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==}
    engines: {node: '>=6'}
    dependencies:
      p-locate: 3.0.0
      path-exists: 3.0.0
    dev: false

  /locate-path@5.0.0:
    resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
    engines: {node: '>=8'}
    dependencies:
      p-locate: 4.1.0
    dev: true

  /locate-path@6.0.0:
    resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
    engines: {node: '>=10'}
    dependencies:
      p-locate: 5.0.0
    dev: true

  /lodash.get@4.4.2:
    resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==}
    dev: true

  /lodash.merge@4.6.2:
    resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
    dev: true

  /lodash@4.17.21:
    resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
    dev: true

  /log-symbols@4.1.0:
    resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
    engines: {node: '>=10'}
    dependencies:
      chalk: 4.1.2
      is-unicode-supported: 0.1.0
    dev: true

  /log-update@5.0.1:
    resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      ansi-escapes: 5.0.0
      cli-cursor: 4.0.0
      slice-ansi: 5.0.0
      strip-ansi: 7.1.0
      wrap-ansi: 8.1.0
    dev: true

  /lowercase-keys@2.0.0:
    resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==}
    engines: {node: '>=8'}
    dev: true

  /lru-cache@10.4.3:
    resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}
    dev: true

  /lru-cache@7.18.3:
    resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==}
    engines: {node: '>=12'}
    dev: true

  /lru_map@0.3.3:
    resolution: {integrity: sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==}
    dev: false

  /macos-alias@0.2.11:
    resolution: {integrity: sha512-zIUs3+qpml+w3wiRuADutd7XIO8UABqksot10Utl/tji4UxZzLG4fWDC+yJZoO8/Ehg5RqsvSRE/6TS5AEOeWw==}
    os: [darwin]
    requiresBuild: true
    dependencies:
      nan: 2.22.0
    dev: true
    optional: true

  /make-dir@3.1.0:
    resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
    engines: {node: '>=8'}
    dependencies:
      semver: 6.3.1
    dev: true

  /make-fetch-happen@10.2.1:
    resolution: {integrity: sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      agentkeepalive: 4.5.0
      cacache: 16.1.3
      http-cache-semantics: 4.1.1
      http-proxy-agent: 5.0.0
      https-proxy-agent: 5.0.1
      is-lambda: 1.0.1
      lru-cache: 7.18.3
      minipass: 3.3.6
      minipass-collect: 1.0.2
      minipass-fetch: 2.1.2
      minipass-flush: 1.0.5
      minipass-pipeline: 1.2.4
      negotiator: 0.6.4
      promise-retry: 2.0.1
      socks-proxy-agent: 7.0.0
      ssri: 9.0.1
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true

  /map-age-cleaner@0.1.3:
    resolution: {integrity: sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==}
    engines: {node: '>=6'}
    dependencies:
      p-defer: 1.0.0
    dev: true

  /matcher@3.0.0:
    resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==}
    engines: {node: '>=10'}
    dependencies:
      escape-string-regexp: 4.0.0
    dev: true
    optional: true

  /mem@4.3.0:
    resolution: {integrity: sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==}
    engines: {node: '>=6'}
    dependencies:
      map-age-cleaner: 0.1.3
      mimic-fn: 2.1.0
      p-is-promise: 2.1.0
    dev: true

  /memorystream@0.3.1:
    resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
    engines: {node: '>= 0.10.0'}
    dev: true

  /merge2@1.4.1:
    resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
    engines: {node: '>= 8'}
    dev: true

  /micromatch@4.0.8:
    resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
    engines: {node: '>=8.6'}
    dependencies:
      braces: 3.0.3
      picomatch: 2.3.1
    dev: true

  /mime-db@1.52.0:
    resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
    engines: {node: '>= 0.6'}
    dev: true

  /mime-types@2.1.35:
    resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
    engines: {node: '>= 0.6'}
    dependencies:
      mime-db: 1.52.0
    dev: true

  /mimic-fn@2.1.0:
    resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
    engines: {node: '>=6'}

  /mimic-fn@3.1.0:
    resolution: {integrity: sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==}
    engines: {node: '>=8'}
    dev: false

  /mimic-response@1.0.1:
    resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==}
    engines: {node: '>=4'}
    dev: true

  /mimic-response@3.1.0:
    resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
    engines: {node: '>=10'}
    dev: true

  /minimatch@3.1.2:
    resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
    dependencies:
      brace-expansion: 1.1.11
    dev: true

  /minimatch@5.1.6:
    resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==}
    engines: {node: '>=10'}
    dependencies:
      brace-expansion: 2.0.1
    dev: true

  /minimatch@9.0.5:
    resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==}
    engines: {node: '>=16 || 14 >=14.17'}
    dependencies:
      brace-expansion: 2.0.1
    dev: true

  /minimist@1.2.8:
    resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
    dev: true

  /minipass-collect@1.0.2:
    resolution: {integrity: sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==}
    engines: {node: '>= 8'}
    dependencies:
      minipass: 3.3.6
    dev: true

  /minipass-fetch@2.1.2:
    resolution: {integrity: sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      minipass: 3.3.6
      minipass-sized: 1.0.3
      minizlib: 2.1.2
    optionalDependencies:
      encoding: 0.1.13
    dev: true

  /minipass-flush@1.0.5:
    resolution: {integrity: sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==}
    engines: {node: '>= 8'}
    dependencies:
      minipass: 3.3.6
    dev: true

  /minipass-pipeline@1.2.4:
    resolution: {integrity: sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==}
    engines: {node: '>=8'}
    dependencies:
      minipass: 3.3.6
    dev: true

  /minipass-sized@1.0.3:
    resolution: {integrity: sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==}
    engines: {node: '>=8'}
    dependencies:
      minipass: 3.3.6
    dev: true

  /minipass@3.3.6:
    resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}
    engines: {node: '>=8'}
    dependencies:
      yallist: 4.0.0
    dev: true

  /minipass@5.0.0:
    resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}
    engines: {node: '>=8'}
    dev: true

  /minipass@7.1.2:
    resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==}
    engines: {node: '>=16 || 14 >=14.17'}
    dev: true

  /minizlib@2.1.2:
    resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}
    engines: {node: '>= 8'}
    dependencies:
      minipass: 3.3.6
      yallist: 4.0.0
    dev: true

  /mkdirp@0.5.6:
    resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}
    hasBin: true
    dependencies:
      minimist: 1.2.8
    dev: true

  /mkdirp@1.0.4:
    resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}
    engines: {node: '>=10'}
    hasBin: true
    dev: true

  /ms@2.0.0:
    resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}

  /ms@2.1.3:
    resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}

  /murmur-32@0.2.0:
    resolution: {integrity: sha512-ZkcWZudylwF+ir3Ld1n7gL6bI2mQAzXvSobPwVtu8aYi2sbXeipeSkdcanRLzIofLcM5F53lGaKm2dk7orBi7Q==}
    requiresBuild: true
    dependencies:
      encode-utf8: 1.0.3
      fmix: 0.1.0
      imul: 1.0.1
    dev: true
    optional: true

  /nan@2.22.0:
    resolution: {integrity: sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==}
    requiresBuild: true
    dev: true
    optional: true

  /natural-compare@1.4.0:
    resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
    dev: true

  /negotiator@0.6.4:
    resolution: {integrity: sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w==}
    engines: {node: '>= 0.6'}
    dev: true

  /nested-error-stacks@2.1.1:
    resolution: {integrity: sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==}
    dev: true

  /nice-try@1.0.5:
    resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==}
    dev: true

  /node-abi@3.71.0:
    resolution: {integrity: sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==}
    engines: {node: '>=10'}
    dependencies:
      semver: 7.6.3
    dev: true

  /node-api-version@0.2.0:
    resolution: {integrity: sha512-fthTTsi8CxaBXMaBAD7ST2uylwvsnYxh2PfaScwpMhos6KlSFajXQPcM4ogNE1q2s3Lbz9GCGqeIHC+C6OZnKg==}
    dependencies:
      semver: 7.6.3
    dev: true

  /node-fetch@2.7.0:
    resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
    engines: {node: 4.x || >=6.0.0}
    peerDependencies:
      encoding: ^0.1.0
    peerDependenciesMeta:
      encoding:
        optional: true
    dependencies:
      whatwg-url: 5.0.0
    dev: true

  /nopt@6.0.0:
    resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    hasBin: true
    dependencies:
      abbrev: 1.1.1
    dev: true

  /normalize-package-data@2.5.0:
    resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
    dependencies:
      hosted-git-info: 2.8.9
      resolve: 1.22.8
      semver: 5.7.2
      validate-npm-package-license: 3.0.4
    dev: true

  /normalize-url@6.1.0:
    resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==}
    engines: {node: '>=10'}
    dev: true

  /npm-run-all@4.1.5:
    resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==}
    engines: {node: '>= 4'}
    hasBin: true
    dependencies:
      ansi-styles: 3.2.1
      chalk: 2.4.2
      cross-spawn: 6.0.5
      memorystream: 0.3.1
      minimatch: 3.1.2
      pidtree: 0.3.1
      read-pkg: 3.0.0
      shell-quote: 1.8.1
      string.prototype.padend: 3.1.6
    dev: true

  /npm-run-path@2.0.2:
    resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==}
    engines: {node: '>=4'}
    dependencies:
      path-key: 2.0.1
    dev: true

  /object-inspect@1.13.2:
    resolution: {integrity: sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==}
    engines: {node: '>= 0.4'}
    dev: true

  /object-keys@1.1.1:
    resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
    engines: {node: '>= 0.4'}
    dev: true

  /object.assign@4.1.5:
    resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      has-symbols: 1.0.3
      object-keys: 1.1.1
    dev: true

  /once@1.4.0:
    resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
    dependencies:
      wrappy: 1.0.2
    dev: true

  /onetime@5.1.2:
    resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
    engines: {node: '>=6'}
    dependencies:
      mimic-fn: 2.1.0

  /optionator@0.9.4:
    resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==}
    engines: {node: '>= 0.8.0'}
    dependencies:
      deep-is: 0.1.4
      fast-levenshtein: 2.0.6
      levn: 0.4.1
      prelude-ls: 1.2.1
      type-check: 0.4.0
      word-wrap: 1.2.5
    dev: true

  /ora@5.4.1:
    resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==}
    engines: {node: '>=10'}
    dependencies:
      bl: 4.1.0
      chalk: 4.1.2
      cli-cursor: 3.1.0
      cli-spinners: 2.9.2
      is-interactive: 1.0.0
      is-unicode-supported: 0.1.0
      log-symbols: 4.1.0
      strip-ansi: 6.0.1
      wcwidth: 1.0.1
    dev: true

  /p-cancelable@2.1.1:
    resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==}
    engines: {node: '>=8'}
    dev: true

  /p-defer@1.0.0:
    resolution: {integrity: sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==}
    engines: {node: '>=4'}
    dev: true

  /p-event@4.2.0:
    resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==}
    engines: {node: '>=8'}
    dependencies:
      p-timeout: 3.2.0
    dev: true

  /p-filter@3.0.0:
    resolution: {integrity: sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      p-map: 5.5.0
    dev: true

  /p-finally@1.0.0:
    resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==}
    engines: {node: '>=4'}
    dev: true

  /p-is-promise@2.1.0:
    resolution: {integrity: sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==}
    engines: {node: '>=6'}
    dev: true

  /p-limit@1.3.0:
    resolution: {integrity: sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==}
    engines: {node: '>=4'}
    dependencies:
      p-try: 1.0.0
    dev: true

  /p-limit@2.3.0:
    resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
    engines: {node: '>=6'}
    dependencies:
      p-try: 2.2.0

  /p-limit@3.1.0:
    resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==}
    engines: {node: '>=10'}
    dependencies:
      yocto-queue: 0.1.0
    dev: true

  /p-locate@2.0.0:
    resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==}
    engines: {node: '>=4'}
    dependencies:
      p-limit: 1.3.0
    dev: true

  /p-locate@3.0.0:
    resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==}
    engines: {node: '>=6'}
    dependencies:
      p-limit: 2.3.0
    dev: false

  /p-locate@4.1.0:
    resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
    engines: {node: '>=8'}
    dependencies:
      p-limit: 2.3.0
    dev: true

  /p-locate@5.0.0:
    resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==}
    engines: {node: '>=10'}
    dependencies:
      p-limit: 3.1.0
    dev: true

  /p-map@4.0.0:
    resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
    engines: {node: '>=10'}
    dependencies:
      aggregate-error: 3.1.0
    dev: true

  /p-map@5.5.0:
    resolution: {integrity: sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==}
    engines: {node: '>=12'}
    dependencies:
      aggregate-error: 4.0.1
    dev: true

  /p-timeout@3.2.0:
    resolution: {integrity: sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==}
    engines: {node: '>=8'}
    dependencies:
      p-finally: 1.0.0
    dev: true

  /p-try@1.0.0:
    resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==}
    engines: {node: '>=4'}
    dev: true

  /p-try@2.2.0:
    resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
    engines: {node: '>=6'}

  /package-json-from-dist@1.0.1:
    resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}
    dev: true

  /parent-module@1.0.1:
    resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
    engines: {node: '>=6'}
    dependencies:
      callsites: 3.1.0
    dev: true

  /parse-author@2.0.0:
    resolution: {integrity: sha512-yx5DfvkN8JsHL2xk2Os9oTia467qnvRgey4ahSm2X8epehBLx/gWLcy5KI+Y36ful5DzGbCS6RazqZGgy1gHNw==}
    engines: {node: '>=0.10.0'}
    dependencies:
      author-regex: 1.0.0
    dev: true

  /parse-color@1.0.0:
    resolution: {integrity: sha512-fuDHYgFHJGbpGMgw9skY/bj3HL/Jrn4l/5rSspy00DoT4RyLnDcRvPxdZ+r6OFwIsgAuhDh4I09tAId4mI12bw==}
    requiresBuild: true
    dependencies:
      color-convert: 0.5.3
    dev: true
    optional: true

  /parse-json@2.2.0:
    resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==}
    engines: {node: '>=0.10.0'}
    dependencies:
      error-ex: 1.3.2
    dev: true

  /parse-json@4.0.0:
    resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==}
    engines: {node: '>=4'}
    dependencies:
      error-ex: 1.3.2
      json-parse-better-errors: 1.0.2
    dev: true

  /parse-passwd@1.0.0:
    resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==}
    engines: {node: '>=0.10.0'}
    dev: true

  /path-exists@3.0.0:
    resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==}
    engines: {node: '>=4'}

  /path-exists@4.0.0:
    resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
    engines: {node: '>=8'}
    dev: true

  /path-is-absolute@1.0.1:
    resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
    engines: {node: '>=0.10.0'}
    dev: true

  /path-key@2.0.1:
    resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==}
    engines: {node: '>=4'}
    dev: true

  /path-key@3.1.1:
    resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
    engines: {node: '>=8'}
    dev: true

  /path-parse@1.0.7:
    resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
    dev: true

  /path-scurry@1.11.1:
    resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
    engines: {node: '>=16 || 14 >=14.18'}
    dependencies:
      lru-cache: 10.4.3
      minipass: 7.1.2
    dev: true

  /path-type@2.0.0:
    resolution: {integrity: sha512-dUnb5dXUf+kzhC/W/F4e5/SkluXIFf5VUHolW1Eg1irn1hGWjPGdsRcvYJ1nD6lhk8Ir7VM0bHJKsYTx8Jx9OQ==}
    engines: {node: '>=4'}
    dependencies:
      pify: 2.3.0
    dev: true

  /path-type@3.0.0:
    resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
    engines: {node: '>=4'}
    dependencies:
      pify: 3.0.0
    dev: true

  /path-type@4.0.0:
    resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
    engines: {node: '>=8'}
    dev: true

  /pe-library@1.0.1:
    resolution: {integrity: sha512-nh39Mo1eGWmZS7y+mK/dQIqg7S1lp38DpRxkyoHf0ZcUs/HDc+yyTjuOtTvSMZHmfSLuSQaX945u05Y2Q6UWZg==}
    engines: {node: '>=14', npm: '>=7'}
    dev: true

  /pend@1.2.0:
    resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==}
    dev: true

  /picomatch@2.3.1:
    resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
    engines: {node: '>=8.6'}
    dev: true

  /pidtree@0.3.1:
    resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==}
    engines: {node: '>=0.10'}
    hasBin: true
    dev: true

  /pify@2.3.0:
    resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
    engines: {node: '>=0.10.0'}
    dev: true

  /pify@3.0.0:
    resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
    engines: {node: '>=4'}
    dev: true

  /pkg-dir@4.2.0:
    resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==}
    engines: {node: '>=8'}
    dependencies:
      find-up: 4.1.0
    dev: true

  /pkg-up@3.1.0:
    resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==}
    engines: {node: '>=8'}
    dependencies:
      find-up: 3.0.0
    dev: false

  /plist@3.1.0:
    resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==}
    engines: {node: '>=10.4.0'}
    dependencies:
      '@xmldom/xmldom': 0.8.10
      base64-js: 1.5.1
      xmlbuilder: 15.1.1
    dev: true

  /possible-typed-array-names@1.0.0:
    resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==}
    engines: {node: '>= 0.4'}
    dev: true

  /postject@1.0.0-alpha.6:
    resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==}
    engines: {node: '>=14.0.0'}
    hasBin: true
    dependencies:
      commander: 9.5.0
    dev: true

  /prelude-ls@1.2.1:
    resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
    engines: {node: '>= 0.8.0'}
    dev: true

  /prettier-linter-helpers@1.0.0:
    resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==}
    engines: {node: '>=6.0.0'}
    dependencies:
      fast-diff: 1.3.0
    dev: true

  /prettier@3.0.2:
    resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==}
    engines: {node: '>=14'}
    hasBin: true
    dev: true

  /proc-log@2.0.1:
    resolution: {integrity: sha512-Kcmo2FhfDTXdcbfDH76N7uBYHINxc/8GW7UAVuVP9I+Va3uHSerrnKV6dLooga/gh7GlgzuCCr/eoldnL1muGw==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dev: true

  /progress@2.0.3:
    resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==}
    engines: {node: '>=0.4.0'}
    dev: true

  /promise-inflight@1.0.1:
    resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==}
    peerDependencies:
      bluebird: '*'
    peerDependenciesMeta:
      bluebird:
        optional: true
    dev: true

  /promise-retry@2.0.1:
    resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==}
    engines: {node: '>=10'}
    dependencies:
      err-code: 2.0.3
      retry: 0.12.0
    dev: true

  /pump@3.0.2:
    resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
    dependencies:
      end-of-stream: 1.4.4
      once: 1.4.0
    dev: true

  /punycode@2.3.1:
    resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
    engines: {node: '>=6'}
    dev: true

  /queue-microtask@1.2.3:
    resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
    dev: true

  /quick-lru@5.1.1:
    resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==}
    engines: {node: '>=10'}
    dev: true

  /random-path@0.1.2:
    resolution: {integrity: sha512-4jY0yoEaQ5v9StCl5kZbNIQlg1QheIDBrdkDn53EynpPb9FgO6//p3X/tgMnrC45XN6QZCzU1Xz/+pSSsJBpRw==}
    requiresBuild: true
    dependencies:
      base32-encode: 1.2.0
      murmur-32: 0.2.0
    dev: true
    optional: true

  /read-binary-file-arch@1.0.6:
    resolution: {integrity: sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==}
    hasBin: true
    dependencies:
      debug: 4.3.7
    transitivePeerDependencies:
      - supports-color
    dev: true

  /read-pkg-up@2.0.0:
    resolution: {integrity: sha512-1orxQfbWGUiTn9XsPlChs6rLie/AV9jwZTGmu2NZw/CUDJQchXJFYE0Fq5j7+n558T1JhDWLdhyd1Zj+wLY//w==}
    engines: {node: '>=4'}
    dependencies:
      find-up: 2.1.0
      read-pkg: 2.0.0
    dev: true

  /read-pkg@2.0.0:
    resolution: {integrity: sha512-eFIBOPW7FGjzBuk3hdXEuNSiTZS/xEMlH49HxMyzb0hyPfu4EhVjT2DH32K1hSSmVq4sebAWnZuuY5auISUTGA==}
    engines: {node: '>=4'}
    dependencies:
      load-json-file: 2.0.0
      normalize-package-data: 2.5.0
      path-type: 2.0.0
    dev: true

  /read-pkg@3.0.0:
    resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==}
    engines: {node: '>=4'}
    dependencies:
      load-json-file: 4.0.0
      normalize-package-data: 2.5.0
      path-type: 3.0.0
    dev: true

  /readable-stream@3.6.2:
    resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
    engines: {node: '>= 6'}
    dependencies:
      inherits: 2.0.4
      string_decoder: 1.3.0
      util-deprecate: 1.0.2
    dev: true

  /rechoir@0.8.0:
    resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==}
    engines: {node: '>= 10.13.0'}
    dependencies:
      resolve: 1.22.8
    dev: true

  /regexp.prototype.flags@1.5.3:
    resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-errors: 1.3.0
      set-function-name: 2.0.2
    dev: true

  /repeat-string@1.6.1:
    resolution: {integrity: sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==}
    engines: {node: '>=0.10'}
    requiresBuild: true
    dev: true
    optional: true

  /require-directory@2.1.1:
    resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}
    engines: {node: '>=0.10.0'}
    dev: true

  /require-from-string@2.0.2:
    resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
    engines: {node: '>=0.10.0'}
    dev: false

  /resedit@2.0.3:
    resolution: {integrity: sha512-oTeemxwoMuxxTYxXUwjkrOPfngTQehlv0/HoYFNkB4uzsP1Un1A9nI8JQKGOFkxpqkC7qkMs0lUsGrvUlbLNUA==}
    engines: {node: '>=14', npm: '>=7'}
    dependencies:
      pe-library: 1.0.1
    dev: true

  /resolve-alpn@1.2.1:
    resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==}
    dev: true

  /resolve-dir@1.0.1:
    resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      expand-tilde: 2.0.2
      global-modules: 1.0.0
    dev: true

  /resolve-from@4.0.0:
    resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
    engines: {node: '>=4'}
    dev: true

  /resolve-package@1.0.1:
    resolution: {integrity: sha512-rzB7NnQpOkPHBWFPP3prUMqOP6yg3HkRGgcvR+lDyvyHoY3fZLFLYDkPXh78SPVBAE6VTCk/V+j8we4djg6o4g==}
    engines: {node: '>=4', npm: '>=2'}
    dependencies:
      get-installed-path: 2.1.1
    dev: true

  /resolve@1.22.8:
    resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==}
    hasBin: true
    dependencies:
      is-core-module: 2.15.1
      path-parse: 1.0.7
      supports-preserve-symlinks-flag: 1.0.0
    dev: true

  /responselike@2.0.1:
    resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==}
    dependencies:
      lowercase-keys: 2.0.0
    dev: true

  /restore-cursor@3.1.0:
    resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
    engines: {node: '>=8'}
    dependencies:
      onetime: 5.1.2
      signal-exit: 3.0.7
    dev: true

  /restore-cursor@4.0.0:
    resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==}
    engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
    dependencies:
      onetime: 5.1.2
      signal-exit: 3.0.7
    dev: true

  /retry@0.12.0:
    resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==}
    engines: {node: '>= 4'}
    dev: true

  /reusify@1.0.4:
    resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
    engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
    dev: true

  /rfdc@1.4.1:
    resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}
    dev: true

  /rimraf@2.6.3:
    resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==}
    deprecated: Rimraf versions prior to v4 are no longer supported
    hasBin: true
    dependencies:
      glob: 7.2.3
    dev: true

  /rimraf@3.0.2:
    resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
    deprecated: Rimraf versions prior to v4 are no longer supported
    hasBin: true
    dependencies:
      glob: 7.2.3
    dev: true

  /rimraf@5.0.1:
    resolution: {integrity: sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg==}
    engines: {node: '>=14'}
    hasBin: true
    dependencies:
      glob: 10.4.5
    dev: true

  /roarr@2.15.4:
    resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==}
    engines: {node: '>=8.0'}
    dependencies:
      boolean: 3.2.0
      detect-node: 2.1.0
      globalthis: 1.0.4
      json-stringify-safe: 5.0.1
      semver-compare: 1.0.0
      sprintf-js: 1.1.3
    dev: true
    optional: true

  /run-parallel@1.2.0:
    resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
    dependencies:
      queue-microtask: 1.2.3
    dev: true

  /safe-array-concat@1.1.2:
    resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==}
    engines: {node: '>=0.4'}
    dependencies:
      call-bind: 1.0.7
      get-intrinsic: 1.2.4
      has-symbols: 1.0.3
      isarray: 2.0.5
    dev: true

  /safe-buffer@5.2.1:
    resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}
    dev: true

  /safe-regex-test@1.0.3:
    resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      is-regex: 1.1.4
    dev: true

  /safer-buffer@2.1.2:
    resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
    dev: true
    optional: true

  /semver-compare@1.0.0:
    resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}
    dev: true
    optional: true

  /semver@5.7.2:
    resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==}
    hasBin: true
    dev: true

  /semver@6.3.1:
    resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==}
    hasBin: true
    dev: true

  /semver@7.6.3:
    resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}
    engines: {node: '>=10'}
    hasBin: true

  /serialize-error@7.0.1:
    resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==}
    engines: {node: '>=10'}
    dependencies:
      type-fest: 0.13.1
    dev: true
    optional: true

  /set-function-length@1.2.2:
    resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==}
    engines: {node: '>= 0.4'}
    dependencies:
      define-data-property: 1.1.4
      es-errors: 1.3.0
      function-bind: 1.1.2
      get-intrinsic: 1.2.4
      gopd: 1.0.1
      has-property-descriptors: 1.0.2
    dev: true

  /set-function-name@2.0.2:
    resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      define-data-property: 1.1.4
      es-errors: 1.3.0
      functions-have-names: 1.2.3
      has-property-descriptors: 1.0.2
    dev: true

  /shebang-command@1.2.0:
    resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      shebang-regex: 1.0.0
    dev: true

  /shebang-command@2.0.0:
    resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
    engines: {node: '>=8'}
    dependencies:
      shebang-regex: 3.0.0
    dev: true

  /shebang-regex@1.0.0:
    resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==}
    engines: {node: '>=0.10.0'}
    dev: true

  /shebang-regex@3.0.0:
    resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
    engines: {node: '>=8'}
    dev: true

  /shell-quote@1.8.1:
    resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
    dev: true

  /side-channel@1.0.6:
    resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      get-intrinsic: 1.2.4
      object-inspect: 1.13.2
    dev: true

  /signal-exit@3.0.7:
    resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
    dev: true

  /signal-exit@4.1.0:
    resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
    engines: {node: '>=14'}
    dev: true

  /slash@3.0.0:
    resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
    engines: {node: '>=8'}
    dev: true

  /slash@4.0.0:
    resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==}
    engines: {node: '>=12'}
    dev: true

  /slice-ansi@5.0.0:
    resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==}
    engines: {node: '>=12'}
    dependencies:
      ansi-styles: 6.2.1
      is-fullwidth-code-point: 4.0.0
    dev: true

  /smart-buffer@4.2.0:
    resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==}
    engines: {node: '>= 6.0.0', npm: '>= 3.0.0'}
    dev: true

  /socks-proxy-agent@7.0.0:
    resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==}
    engines: {node: '>= 10'}
    dependencies:
      agent-base: 6.0.2
      debug: 4.3.7
      socks: 2.8.3
    transitivePeerDependencies:
      - supports-color
    dev: true

  /socks@2.8.3:
    resolution: {integrity: sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==}
    engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
    dependencies:
      ip-address: 9.0.5
      smart-buffer: 4.2.0
    dev: true

  /source-map-support@0.5.21:
    resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
    dependencies:
      buffer-from: 1.1.2
      source-map: 0.6.1
    dev: true

  /source-map@0.6.1:
    resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
    engines: {node: '>=0.10.0'}
    dev: true

  /spdx-correct@3.2.0:
    resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==}
    dependencies:
      spdx-expression-parse: 3.0.1
      spdx-license-ids: 3.0.20
    dev: true

  /spdx-exceptions@2.5.0:
    resolution: {integrity: sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==}
    dev: true

  /spdx-expression-parse@3.0.1:
    resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==}
    dependencies:
      spdx-exceptions: 2.5.0
      spdx-license-ids: 3.0.20
    dev: true

  /spdx-license-ids@3.0.20:
    resolution: {integrity: sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==}
    dev: true

  /sprintf-js@1.1.3:
    resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
    dev: true

  /ssri@9.0.1:
    resolution: {integrity: sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      minipass: 3.3.6
    dev: true

  /stream-buffers@2.2.0:
    resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==}
    engines: {node: '>= 0.10.0'}
    requiresBuild: true
    dev: true
    optional: true

  /string-width@4.2.3:
    resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
    engines: {node: '>=8'}
    dependencies:
      emoji-regex: 8.0.0
      is-fullwidth-code-point: 3.0.0
      strip-ansi: 6.0.1
    dev: true

  /string-width@5.1.2:
    resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}
    engines: {node: '>=12'}
    dependencies:
      eastasianwidth: 0.2.0
      emoji-regex: 9.2.2
      strip-ansi: 7.1.0
    dev: true

  /string.prototype.padend@3.1.6:
    resolution: {integrity: sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-abstract: 1.23.3
      es-object-atoms: 1.0.0
    dev: true

  /string.prototype.trim@1.2.9:
    resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-abstract: 1.23.3
      es-object-atoms: 1.0.0
    dev: true

  /string.prototype.trimend@1.0.8:
    resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-object-atoms: 1.0.0
    dev: true

  /string.prototype.trimstart@1.0.8:
    resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      define-properties: 1.2.1
      es-object-atoms: 1.0.0
    dev: true

  /string_decoder@1.3.0:
    resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
    dependencies:
      safe-buffer: 5.2.1
    dev: true

  /strip-ansi@6.0.1:
    resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
    engines: {node: '>=8'}
    dependencies:
      ansi-regex: 5.0.1
    dev: true

  /strip-ansi@7.1.0:
    resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==}
    engines: {node: '>=12'}
    dependencies:
      ansi-regex: 6.1.0
    dev: true

  /strip-bom@3.0.0:
    resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
    engines: {node: '>=4'}
    dev: true

  /strip-eof@1.0.0:
    resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==}
    engines: {node: '>=0.10.0'}
    dev: true

  /strip-json-comments@3.1.1:
    resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
    engines: {node: '>=8'}
    dev: true

  /strip-outer@1.0.1:
    resolution: {integrity: sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      escape-string-regexp: 1.0.5
    dev: true

  /sudo-prompt@9.2.1:
    resolution: {integrity: sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==}
    dev: true

  /sumchecker@3.0.1:
    resolution: {integrity: sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==}
    engines: {node: '>= 8.0'}
    dependencies:
      debug: 4.3.7
    transitivePeerDependencies:
      - supports-color
    dev: true

  /supports-color@5.5.0:
    resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
    engines: {node: '>=4'}
    dependencies:
      has-flag: 3.0.0
    dev: true

  /supports-color@7.2.0:
    resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
    engines: {node: '>=8'}
    dependencies:
      has-flag: 4.0.0
    dev: true

  /supports-preserve-symlinks-flag@1.0.0:
    resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
    engines: {node: '>= 0.4'}
    dev: true

  /synckit@0.8.8:
    resolution: {integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==}
    engines: {node: ^14.18.0 || >=16.0.0}
    dependencies:
      '@pkgr/core': 0.1.1
      tslib: 2.8.1
    dev: true

  /tar@6.2.1:
    resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}
    engines: {node: '>=10'}
    dependencies:
      chownr: 2.0.0
      fs-minipass: 2.1.0
      minipass: 5.0.0
      minizlib: 2.1.2
      mkdirp: 1.0.4
      yallist: 4.0.0
    dev: true

  /temp@0.9.4:
    resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==}
    engines: {node: '>=6.0.0'}
    dependencies:
      mkdirp: 0.5.6
      rimraf: 2.6.3
    dev: true

  /text-table@0.2.0:
    resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
    dev: true

  /tiny-each-async@2.0.3:
    resolution: {integrity: sha512-5ROII7nElnAirvFn8g7H7MtpfV1daMcyfTGQwsn/x2VtyV+VPiO5CjReCJtWLvoKTDEDmZocf3cNPraiMnBXLA==}
    requiresBuild: true
    dev: true
    optional: true

  /tmp-promise@3.0.3:
    resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==}
    requiresBuild: true
    dependencies:
      tmp: 0.2.3
    dev: true
    optional: true

  /tmp@0.2.3:
    resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==}
    engines: {node: '>=14.14'}
    requiresBuild: true
    dev: true
    optional: true

  /tn1150@0.1.0:
    resolution: {integrity: sha512-DbplOfQFkqG5IHcDyyrs/lkvSr3mPUVsFf/RbDppOshs22yTPnSJWEe6FkYd1txAwU/zcnR905ar2fi4kwF29w==}
    engines: {node: '>=0.12'}
    requiresBuild: true
    dependencies:
      unorm: 1.6.0
    dev: true
    optional: true

  /to-data-view@1.1.0:
    resolution: {integrity: sha512-1eAdufMg6mwgmlojAx3QeMnzB/BTVp7Tbndi3U7ftcT2zCZadjxkkmLmd97zmaxWi+sgGcgWrokmpEoy0Dn0vQ==}
    requiresBuild: true
    dev: true
    optional: true

  /to-regex-range@5.0.1:
    resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
    engines: {node: '>=8.0'}
    dependencies:
      is-number: 7.0.0
    dev: true

  /tr46@0.0.3:
    resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
    dev: true

  /trim-repeated@1.0.0:
    resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==}
    engines: {node: '>=0.10.0'}
    dependencies:
      escape-string-regexp: 1.0.5
    dev: true

  /ts-api-utils@1.4.0(typescript@4.9.5):
    resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==}
    engines: {node: '>=16'}
    peerDependencies:
      typescript: '>=4.2.0'
    dependencies:
      typescript: 4.9.5
    dev: true

  /tslib@1.14.1:
    resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}

  /tslib@2.8.1:
    resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}

  /tsutils@3.21.0(typescript@4.9.5):
    resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
    engines: {node: '>= 6'}
    peerDependencies:
      typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
    dependencies:
      tslib: 1.14.1
      typescript: 4.9.5
    dev: true

  /type-check@0.4.0:
    resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
    engines: {node: '>= 0.8.0'}
    dependencies:
      prelude-ls: 1.2.1
    dev: true

  /type-fest@0.13.1:
    resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
    engines: {node: '>=10'}
    dev: true
    optional: true

  /type-fest@0.20.2:
    resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
    engines: {node: '>=10'}
    dev: true

  /type-fest@1.4.0:
    resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==}
    engines: {node: '>=10'}
    dev: true

  /type-fest@2.19.0:
    resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==}
    engines: {node: '>=12.20'}
    dev: false

  /typed-array-buffer@1.0.2:
    resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      es-errors: 1.3.0
      is-typed-array: 1.1.13
    dev: true

  /typed-array-byte-length@1.0.1:
    resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      for-each: 0.3.3
      gopd: 1.0.1
      has-proto: 1.0.3
      is-typed-array: 1.1.13
    dev: true

  /typed-array-byte-offset@1.0.2:
    resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==}
    engines: {node: '>= 0.4'}
    dependencies:
      available-typed-arrays: 1.0.7
      call-bind: 1.0.7
      for-each: 0.3.3
      gopd: 1.0.1
      has-proto: 1.0.3
      is-typed-array: 1.1.13
    dev: true

  /typed-array-length@1.0.6:
    resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==}
    engines: {node: '>= 0.4'}
    dependencies:
      call-bind: 1.0.7
      for-each: 0.3.3
      gopd: 1.0.1
      has-proto: 1.0.3
      is-typed-array: 1.1.13
      possible-typed-array-names: 1.0.0
    dev: true

  /typescript@4.9.5:
    resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
    engines: {node: '>=4.2.0'}
    hasBin: true
    dev: true

  /unbox-primitive@1.0.2:
    resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==}
    dependencies:
      call-bind: 1.0.7
      has-bigints: 1.0.2
      has-symbols: 1.0.3
      which-boxed-primitive: 1.0.2
    dev: true

  /undici-types@5.26.5:
    resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
    dev: true

  /unique-filename@2.0.1:
    resolution: {integrity: sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      unique-slug: 3.0.0
    dev: true

  /unique-slug@3.0.0:
    resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==}
    engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0}
    dependencies:
      imurmurhash: 0.1.4
    dev: true

  /universal-user-agent@6.0.1:
    resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==}
    dev: true

  /universalify@0.1.2:
    resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
    engines: {node: '>= 4.0.0'}
    dev: true

  /universalify@2.0.1:
    resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
    engines: {node: '>= 10.0.0'}
    dev: true

  /unorm@1.6.0:
    resolution: {integrity: sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==}
    engines: {node: '>= 0.4.0'}
    requiresBuild: true
    dev: true
    optional: true

  /uri-js@4.4.1:
    resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
    dependencies:
      punycode: 2.3.1
    dev: true

  /username@5.1.0:
    resolution: {integrity: sha512-PCKbdWw85JsYMvmCv5GH3kXmM66rCd9m1hBEDutPNv94b/pqCMT4NtcKyeWYvLFiE8b+ha1Jdl8XAaUdPn5QTg==}
    engines: {node: '>=8'}
    dependencies:
      execa: 1.0.0
      mem: 4.3.0
    dev: true

  /util-deprecate@1.0.2:
    resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
    dev: true

  /validate-npm-package-license@3.0.4:
    resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
    dependencies:
      spdx-correct: 3.2.0
      spdx-expression-parse: 3.0.1
    dev: true

  /wcwidth@1.0.1:
    resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
    dependencies:
      defaults: 1.0.4
    dev: true

  /webidl-conversions@3.0.1:
    resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
    dev: true

  /whatwg-url@5.0.0:
    resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
    dependencies:
      tr46: 0.0.3
      webidl-conversions: 3.0.1
    dev: true

  /which-boxed-primitive@1.0.2:
    resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
    dependencies:
      is-bigint: 1.0.4
      is-boolean-object: 1.1.2
      is-number-object: 1.0.7
      is-string: 1.0.7
      is-symbol: 1.0.4
    dev: true

  /which-typed-array@1.1.15:
    resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==}
    engines: {node: '>= 0.4'}
    dependencies:
      available-typed-arrays: 1.0.7
      call-bind: 1.0.7
      for-each: 0.3.3
      gopd: 1.0.1
      has-tostringtag: 1.0.2
    dev: true

  /which@1.3.1:
    resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
    hasBin: true
    dependencies:
      isexe: 2.0.0
    dev: true

  /which@2.0.2:
    resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
    engines: {node: '>= 8'}
    hasBin: true
    dependencies:
      isexe: 2.0.0
    dev: true

  /word-wrap@1.2.5:
    resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
    engines: {node: '>=0.10.0'}
    dev: true

  /wrap-ansi@7.0.0:
    resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
    engines: {node: '>=10'}
    dependencies:
      ansi-styles: 4.3.0
      string-width: 4.2.3
      strip-ansi: 6.0.1
    dev: true

  /wrap-ansi@8.1.0:
    resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
    engines: {node: '>=12'}
    dependencies:
      ansi-styles: 6.2.1
      string-width: 5.1.2
      strip-ansi: 7.1.0
    dev: true

  /wrappy@1.0.2:
    resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
    dev: true

  /xmlbuilder@15.1.1:
    resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==}
    engines: {node: '>=8.0'}
    dev: true

  /xtend@4.0.2:
    resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
    engines: {node: '>=0.4'}
    requiresBuild: true
    dev: true
    optional: true

  /y18n@5.0.8:
    resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
    engines: {node: '>=10'}
    dev: true

  /yallist@4.0.0:
    resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
    dev: true

  /yargs-parser@20.2.9:
    resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
    engines: {node: '>=10'}
    requiresBuild: true
    dev: true
    optional: true

  /yargs-parser@21.1.1:
    resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
    engines: {node: '>=12'}
    dev: true

  /yargs@16.2.0:
    resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==}
    engines: {node: '>=10'}
    requiresBuild: true
    dependencies:
      cliui: 7.0.4
      escalade: 3.2.0
      get-caller-file: 2.0.5
      require-directory: 2.1.1
      string-width: 4.2.3
      y18n: 5.0.8
      yargs-parser: 20.2.9
    dev: true
    optional: true

  /yargs@17.7.2:
    resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
    engines: {node: '>=12'}
    dependencies:
      cliui: 8.0.1
      escalade: 3.2.0
      get-caller-file: 2.0.5
      require-directory: 2.1.1
      string-width: 4.2.3
      y18n: 5.0.8
      yargs-parser: 21.1.1
    dev: true

  /yarn-or-npm@3.0.1:
    resolution: {integrity: sha512-fTiQP6WbDAh5QZAVdbMQkecZoahnbOjClTQhzv74WX5h2Uaidj1isf9FDes11TKtsZ0/ZVfZsqZ+O3x6aLERHQ==}
    engines: {node: '>=8.6.0'}
    hasBin: true
    dependencies:
      cross-spawn: 6.0.5
      pkg-dir: 4.2.0
    dev: true

  /yauzl@2.10.0:
    resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==}
    dependencies:
      buffer-crc32: 0.2.13
      fd-slicer: 1.1.0
    dev: true

  /yocto-queue@0.1.0:
    resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
    engines: {node: '>=10'}
    dev: true

  github.com/electron/node-gyp/06b29aafb7708acef8b3669835c8a7857ebc92d2:
    resolution: {tarball: https://codeload.github.com/electron/node-gyp/tar.gz/06b29aafb7708acef8b3669835c8a7857ebc92d2}
    name: '@electron/node-gyp'
    version: 10.2.0-electron.1
    engines: {node: '>=12.13.0'}
    hasBin: true
    dependencies:
      env-paths: 2.2.1
      exponential-backoff: 3.1.1
      glob: 8.1.0
      graceful-fs: 4.2.11
      make-fetch-happen: 10.2.1
      nopt: 6.0.0
      proc-log: 2.0.1
      semver: 7.6.3
      tar: 6.2.1
      which: 2.0.2
    transitivePeerDependencies:
      - bluebird
      - supports-color
    dev: true
Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const types = require('./types.js');

/**
 * Add a listener that cancels and finishes a transaction when the global
 * document is hidden.
 */
function registerBackgroundTabDetection() {
  if (types.WINDOW && types.WINDOW.document) {
    types.WINDOW.document.addEventListener('visibilitychange', () => {
      const activeTransaction = core.getActiveTransaction() ;
      if (types.WINDOW.document.hidden && activeTransaction) {
        const statusType = 'cancelled';

        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          utils.logger.log(
            `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,
          );
        // We should not set status if it is already set, this prevent important statuses like
        // error or data loss from being overwritten on transaction.
        if (!activeTransaction.status) {
          activeTransaction.setStatus(statusType);
        }
        activeTransaction.setTag('visibilitychange', 'document.hidden');
        activeTransaction.finish();
      }
    });
  } else {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');
  }
}

exports.registerBackgroundTabDetection = registerBackgroundTabDetection;
//# sourceMappingURL=backgroundtab.js.map
{"version":3,"file":"backgroundtab.js","sources":["../../../src/browser/backgroundtab.ts"],"sourcesContent":["import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n  if (WINDOW && WINDOW.document) {\n    WINDOW.document.addEventListener('visibilitychange', () => {\n      const activeTransaction = getActiveTransaction() as IdleTransaction;\n      if (WINDOW.document.hidden && activeTransaction) {\n        const statusType: SpanStatusType = 'cancelled';\n\n        __DEBUG_BUILD__ &&\n          logger.log(\n            `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n          );\n        // We should not set status if it is already set, this prevent important statuses like\n        // error or data loss from being overwritten on transaction.\n        if (!activeTransaction.status) {\n          activeTransaction.setStatus(statusType);\n        }\n        activeTransaction.setTag('visibilitychange', 'document.hidden');\n        activeTransaction.finish();\n      }\n    });\n  } else {\n    __DEBUG_BUILD__ &&\n      logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n  }\n}\n"],"names":["WINDOW","getActiveTransaction","logger"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA,SAAA,8BAAA,GAAA;AACA,EAAA,IAAAA,YAAA,IAAAA,YAAA,CAAA,QAAA,EAAA;AACA,IAAAA,YAAA,CAAA,QAAA,CAAA,gBAAA,CAAA,kBAAA,EAAA,MAAA;AACA,MAAA,MAAA,iBAAA,GAAAC,yBAAA,EAAA,EAAA;AACA,MAAA,IAAAD,YAAA,CAAA,QAAA,CAAA,MAAA,IAAA,iBAAA,EAAA;AACA,QAAA,MAAA,UAAA,GAAA,WAAA,CAAA;AACA;AACA,QAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,UAAAE,YAAA,CAAA,GAAA;AACA,YAAA,CAAA,uBAAA,EAAA,UAAA,CAAA,2CAAA,EAAA,iBAAA,CAAA,EAAA,CAAA,CAAA;AACA,WAAA,CAAA;AACA;AACA;AACA,QAAA,IAAA,CAAA,iBAAA,CAAA,MAAA,EAAA;AACA,UAAA,iBAAA,CAAA,SAAA,CAAA,UAAA,CAAA,CAAA;AACA,SAAA;AACA,QAAA,iBAAA,CAAA,MAAA,CAAA,kBAAA,EAAA,iBAAA,CAAA,CAAA;AACA,QAAA,iBAAA,CAAA,MAAA,EAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,MAAAA,YAAA,CAAA,IAAA,CAAA,oFAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const backgroundtab = require('./backgroundtab.js');
const index = require('./metrics/index.js');
const request = require('./request.js');
const router = require('./router.js');
const types = require('./types.js');

const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';

/** Options for Browser Tracing integration */

const DEFAULT_BROWSER_TRACING_OPTIONS = {
  ...core.TRACING_DEFAULTS,
  markBackgroundTransactions: true,
  routingInstrumentation: router.instrumentRoutingWithDefaults,
  startTransactionOnLocationChange: true,
  startTransactionOnPageLoad: true,
  enableLongTask: true,
  _experiments: {},
  ...request.defaultRequestInstrumentationOptions,
};

/**
 * The Browser Tracing integration automatically instruments browser pageload/navigation
 * actions as transactions, and captures requests, metrics and errors as spans.
 *
 * The integration can be configured with a variety of options, and can be extended to use
 * any routing library. This integration uses {@see IdleTransaction} to create transactions.
 */
class BrowserTracing  {
  // This class currently doesn't have a static `id` field like the other integration classes, because it prevented
  // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.
  // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all
  // integrations.

  /** Browser Tracing integration options */

  /**
   * @inheritDoc
   */
   __init() {this.name = BROWSER_TRACING_INTEGRATION_ID;}

   constructor(_options) {BrowserTracing.prototype.__init.call(this);
    core.addTracingExtensions();

    this.options = {
      ...DEFAULT_BROWSER_TRACING_OPTIONS,
      ..._options,
    };

    // Special case: enableLongTask can be set in _experiments
    // TODO (v8): Remove this in v8
    if (this.options._experiments.enableLongTask !== undefined) {
      this.options.enableLongTask = this.options._experiments.enableLongTask;
    }

    // TODO (v8): remove this block after tracingOrigins is removed
    // Set tracePropagationTargets to tracingOrigins if specified by the user
    // In case both are specified, tracePropagationTargets takes precedence
    // eslint-disable-next-line deprecation/deprecation
    if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {
      // eslint-disable-next-line deprecation/deprecation
      this.options.tracePropagationTargets = _options.tracingOrigins;
    }

    this._collectWebVitals = index.startTrackingWebVitals();
    if (this.options.enableLongTask) {
      index.startTrackingLongTasks();
    }
    if (this.options._experiments.enableInteractions) {
      index.startTrackingInteractions();
    }
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    this._getCurrentHub = getCurrentHub;

    const {
      routingInstrumentation: instrumentRouting,
      startTransactionOnLocationChange,
      startTransactionOnPageLoad,
      markBackgroundTransactions,
      traceFetch,
      traceXHR,
      tracePropagationTargets,
      shouldCreateSpanForRequest,
      _experiments,
    } = this.options;

    instrumentRouting(
      (context) => {
        const transaction = this._createRouteTransaction(context);

        this.options._experiments.onStartRouteTransaction &&
          this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);

        return transaction;
      },
      startTransactionOnPageLoad,
      startTransactionOnLocationChange,
    );

    if (markBackgroundTransactions) {
      backgroundtab.registerBackgroundTabDetection();
    }

    if (_experiments.enableInteractions) {
      this._registerInteractionListener();
    }

    request.instrumentOutgoingRequests({
      traceFetch,
      traceXHR,
      tracePropagationTargets,
      shouldCreateSpanForRequest,
    });
  }

  /** Create routing idle transaction. */
   _createRouteTransaction(context) {
    if (!this._getCurrentHub) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);
      return undefined;
    }

    const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;

    const isPageloadTransaction = context.op === 'pageload';

    const sentryTraceMetaTagValue = isPageloadTransaction ? getMetaContent('sentry-trace') : null;
    const baggageMetaTagValue = isPageloadTransaction ? getMetaContent('baggage') : null;

    const traceParentData = sentryTraceMetaTagValue ? core.extractTraceparentData(sentryTraceMetaTagValue) : undefined;
    const dynamicSamplingContext = baggageMetaTagValue
      ? utils.baggageHeaderToDynamicSamplingContext(baggageMetaTagValue)
      : undefined;

    const expandedContext = {
      ...context,
      ...traceParentData,
      metadata: {
        ...context.metadata,
        dynamicSamplingContext: traceParentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,
      },
      trimEnd: true,
    };

    const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;

    // For backwards compatibility reasons, beforeNavigate can return undefined to "drop" the transaction (prevent it
    // from being sent to Sentry).
    const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;

    // If `beforeNavigate` set a custom name, record that fact
    finalContext.metadata =
      finalContext.name !== expandedContext.name
        ? { ...finalContext.metadata, source: 'custom' }
        : finalContext.metadata;

    this._latestRouteName = finalContext.name;
    this._latestRouteSource = finalContext.metadata && finalContext.metadata.source;

    if (finalContext.sampled === false) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);

    const hub = this._getCurrentHub();
    const { location } = types.WINDOW;

    const idleTransaction = core.startIdleTransaction(
      hub,
      finalContext,
      idleTimeout,
      finalTimeout,
      true,
      { location }, // for use in the tracesSampler
      heartbeatInterval,
    );
    idleTransaction.registerBeforeFinishCallback(transaction => {
      this._collectWebVitals();
      index.addPerformanceEntries(transaction);
    });

    return idleTransaction ;
  }

  /** Start listener for interaction transactions */
   _registerInteractionListener() {
    let inflightInteractionTransaction;
    const registerInteractionTransaction = () => {
      const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;
      const op = 'ui.action.click';

      const currentTransaction = core.getActiveTransaction();
      if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          utils.logger.warn(
            `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,
          );
        return undefined;
      }

      if (inflightInteractionTransaction) {
        inflightInteractionTransaction.setFinishReason('interactionInterrupted');
        inflightInteractionTransaction.finish();
        inflightInteractionTransaction = undefined;
      }

      if (!this._getCurrentHub) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);
        return undefined;
      }

      if (!this._latestRouteName) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          utils.logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
        return undefined;
      }

      const hub = this._getCurrentHub();
      const { location } = types.WINDOW;

      const context = {
        name: this._latestRouteName,
        op,
        trimEnd: true,
        metadata: {
          source: this._latestRouteSource || 'url',
        },
      };

      inflightInteractionTransaction = core.startIdleTransaction(
        hub,
        context,
        idleTimeout,
        finalTimeout,
        true,
        { location }, // for use in the tracesSampler
        heartbeatInterval,
      );
    };

    ['click'].forEach(type => {
      addEventListener(type, registerInteractionTransaction, { once: false, capture: true });
    });
  }
}

/** Returns the value of a meta tag */
function getMetaContent(metaName) {
  // Can't specify generic to `getDomElement` because tracing can be used
  // in a variety of environments, have to disable `no-unsafe-member-access`
  // as a result.
  const metaTag = utils.getDomElement(`meta[name=${metaName}]`);
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return metaTag ? metaTag.getAttribute('content') : null;
}

exports.BROWSER_TRACING_INTEGRATION_ID = BROWSER_TRACING_INTEGRATION_ID;
exports.BrowserTracing = BrowserTracing;
exports.getMetaContent = getMetaContent;
//# sourceMappingURL=browsertracing.js.map
{"version":3,"file":"browsertracing.js","sources":["../../../src/browser/browsertracing.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Hub, IdleTransaction } from '@sentry/core';\nimport {\n  addTracingExtensions,\n  extractTraceparentData,\n  getActiveTransaction,\n  startIdleTransaction,\n  TRACING_DEFAULTS,\n} from '@sentry/core';\nimport type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { baggageHeaderToDynamicSamplingContext, getDomElement, logger } from '@sentry/utils';\n\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport {\n  addPerformanceEntries,\n  startTrackingInteractions,\n  startTrackingLongTasks,\n  startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { instrumentRoutingWithDefaults } from './router';\nimport { WINDOW } from './types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n  /**\n   * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n   * by a moment where there are no in-progress spans.\n   *\n   * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n   * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n   * Time is in ms.\n   *\n   * Default: 1000\n   */\n  idleTimeout: number;\n\n  /**\n   * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n   * will be finished.\n   * Time is in ms.\n   *\n   * Default: 30000\n   */\n  finalTimeout: number;\n\n  /**\n   * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n   * the transaction will be finished.\n   * Time is in ms.\n   *\n   * Default: 5000\n   */\n  heartbeatInterval: number;\n\n  /**\n   * Flag to enable/disable creation of `navigation` transaction on history changes.\n   *\n   * Default: true\n   */\n  startTransactionOnLocationChange: boolean;\n\n  /**\n   * Flag to enable/disable creation of `pageload` transaction on first pageload.\n   *\n   * Default: true\n   */\n  startTransactionOnPageLoad: boolean;\n\n  /**\n   * Flag Transactions where tabs moved to background with \"cancelled\". Browser background tab timing is\n   * not suited towards doing precise measurements of operations. By default, we recommend that this option\n   * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n   *\n   * Default: true\n   */\n  markBackgroundTransactions: boolean;\n\n  /**\n   * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n   *\n   * Default: true\n   */\n  enableLongTask: boolean;\n\n  /**\n   * _metricOptions allows the user to send options to change how metrics are collected.\n   *\n   * _metricOptions is currently experimental.\n   *\n   * Default: undefined\n   */\n  _metricOptions?: Partial<{\n    /**\n     * @deprecated This property no longer has any effect and will be removed in v8.\n     */\n    _reportAllChanges: boolean;\n  }>;\n\n  /**\n   * _experiments allows the user to send options to define how this integration works.\n   * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n   *\n   * TODO (v8): Remove enableLongTask\n   *\n   * Default: undefined\n   */\n  _experiments: Partial<{\n    enableLongTask: boolean;\n    enableInteractions: boolean;\n    onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;\n  }>;\n\n  /**\n   * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction\n   * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n   *\n   * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.\n   *\n   * @param context: The context data which will be passed to `startTransaction` by default\n   *\n   * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n   */\n  beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;\n\n  /**\n   * Instrumentation that creates routing change transactions. By default creates\n   * pageload and navigation transactions.\n   */\n  routingInstrumentation<T extends Transaction>(\n    this: void,\n    customStartTransaction: (context: TransactionContext) => T | undefined,\n    startTransactionOnPageLoad?: boolean,\n    startTransactionOnLocationChange?: boolean,\n  ): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n  ...TRACING_DEFAULTS,\n  markBackgroundTransactions: true,\n  routingInstrumentation: instrumentRoutingWithDefaults,\n  startTransactionOnLocationChange: true,\n  startTransactionOnPageLoad: true,\n  enableLongTask: true,\n  _experiments: {},\n  ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n */\nexport class BrowserTracing implements Integration {\n  // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n  // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n  // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n  // integrations.\n\n  /** Browser Tracing integration options */\n  public options: BrowserTracingOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = BROWSER_TRACING_INTEGRATION_ID;\n\n  private _getCurrentHub?: () => Hub;\n\n  private _latestRouteName?: string;\n  private _latestRouteSource?: TransactionSource;\n\n  private _collectWebVitals: () => void;\n\n  public constructor(_options?: Partial<BrowserTracingOptions>) {\n    addTracingExtensions();\n\n    this.options = {\n      ...DEFAULT_BROWSER_TRACING_OPTIONS,\n      ..._options,\n    };\n\n    // Special case: enableLongTask can be set in _experiments\n    // TODO (v8): Remove this in v8\n    if (this.options._experiments.enableLongTask !== undefined) {\n      this.options.enableLongTask = this.options._experiments.enableLongTask;\n    }\n\n    // TODO (v8): remove this block after tracingOrigins is removed\n    // Set tracePropagationTargets to tracingOrigins if specified by the user\n    // In case both are specified, tracePropagationTargets takes precedence\n    // eslint-disable-next-line deprecation/deprecation\n    if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n      // eslint-disable-next-line deprecation/deprecation\n      this.options.tracePropagationTargets = _options.tracingOrigins;\n    }\n\n    this._collectWebVitals = startTrackingWebVitals();\n    if (this.options.enableLongTask) {\n      startTrackingLongTasks();\n    }\n    if (this.options._experiments.enableInteractions) {\n      startTrackingInteractions();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this._getCurrentHub = getCurrentHub;\n\n    const {\n      routingInstrumentation: instrumentRouting,\n      startTransactionOnLocationChange,\n      startTransactionOnPageLoad,\n      markBackgroundTransactions,\n      traceFetch,\n      traceXHR,\n      tracePropagationTargets,\n      shouldCreateSpanForRequest,\n      _experiments,\n    } = this.options;\n\n    instrumentRouting(\n      (context: TransactionContext) => {\n        const transaction = this._createRouteTransaction(context);\n\n        this.options._experiments.onStartRouteTransaction &&\n          this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n        return transaction;\n      },\n      startTransactionOnPageLoad,\n      startTransactionOnLocationChange,\n    );\n\n    if (markBackgroundTransactions) {\n      registerBackgroundTabDetection();\n    }\n\n    if (_experiments.enableInteractions) {\n      this._registerInteractionListener();\n    }\n\n    instrumentOutgoingRequests({\n      traceFetch,\n      traceXHR,\n      tracePropagationTargets,\n      shouldCreateSpanForRequest,\n    });\n  }\n\n  /** Create routing idle transaction. */\n  private _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n    if (!this._getCurrentHub) {\n      __DEBUG_BUILD__ &&\n        logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n      return undefined;\n    }\n\n    const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n    const isPageloadTransaction = context.op === 'pageload';\n\n    const sentryTraceMetaTagValue = isPageloadTransaction ? getMetaContent('sentry-trace') : null;\n    const baggageMetaTagValue = isPageloadTransaction ? getMetaContent('baggage') : null;\n\n    const traceParentData = sentryTraceMetaTagValue ? extractTraceparentData(sentryTraceMetaTagValue) : undefined;\n    const dynamicSamplingContext = baggageMetaTagValue\n      ? baggageHeaderToDynamicSamplingContext(baggageMetaTagValue)\n      : undefined;\n\n    const expandedContext: TransactionContext = {\n      ...context,\n      ...traceParentData,\n      metadata: {\n        ...context.metadata,\n        dynamicSamplingContext: traceParentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n      },\n      trimEnd: true,\n    };\n\n    const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n    // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n    // from being sent to Sentry).\n    const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n    // If `beforeNavigate` set a custom name, record that fact\n    finalContext.metadata =\n      finalContext.name !== expandedContext.name\n        ? { ...finalContext.metadata, source: 'custom' }\n        : finalContext.metadata;\n\n    this._latestRouteName = finalContext.name;\n    this._latestRouteSource = finalContext.metadata && finalContext.metadata.source;\n\n    if (finalContext.sampled === false) {\n      __DEBUG_BUILD__ &&\n        logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n    const hub = this._getCurrentHub();\n    const { location } = WINDOW;\n\n    const idleTransaction = startIdleTransaction(\n      hub,\n      finalContext,\n      idleTimeout,\n      finalTimeout,\n      true,\n      { location }, // for use in the tracesSampler\n      heartbeatInterval,\n    );\n    idleTransaction.registerBeforeFinishCallback(transaction => {\n      this._collectWebVitals();\n      addPerformanceEntries(transaction);\n    });\n\n    return idleTransaction as Transaction;\n  }\n\n  /** Start listener for interaction transactions */\n  private _registerInteractionListener(): void {\n    let inflightInteractionTransaction: IdleTransaction | undefined;\n    const registerInteractionTransaction = (): void => {\n      const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n      const op = 'ui.action.click';\n\n      const currentTransaction = getActiveTransaction();\n      if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n        __DEBUG_BUILD__ &&\n          logger.warn(\n            `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n          );\n        return undefined;\n      }\n\n      if (inflightInteractionTransaction) {\n        inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n        inflightInteractionTransaction.finish();\n        inflightInteractionTransaction = undefined;\n      }\n\n      if (!this._getCurrentHub) {\n        __DEBUG_BUILD__ && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n        return undefined;\n      }\n\n      if (!this._latestRouteName) {\n        __DEBUG_BUILD__ &&\n          logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n        return undefined;\n      }\n\n      const hub = this._getCurrentHub();\n      const { location } = WINDOW;\n\n      const context: TransactionContext = {\n        name: this._latestRouteName,\n        op,\n        trimEnd: true,\n        metadata: {\n          source: this._latestRouteSource || 'url',\n        },\n      };\n\n      inflightInteractionTransaction = startIdleTransaction(\n        hub,\n        context,\n        idleTimeout,\n        finalTimeout,\n        true,\n        { location }, // for use in the tracesSampler\n        heartbeatInterval,\n      );\n    };\n\n    ['click'].forEach(type => {\n      addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n    });\n  }\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | null {\n  // Can't specify generic to `getDomElement` because tracing can be used\n  // in a variety of environments, have to disable `no-unsafe-member-access`\n  // as a result.\n  const metaTag = getDomElement(`meta[name=${metaName}]`);\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return metaTag ? metaTag.getAttribute('content') : null;\n}\n"],"names":["TRACING_DEFAULTS","instrumentRoutingWithDefaults","defaultRequestInstrumentationOptions","addTracingExtensions","startTrackingWebVitals","startTrackingLongTasks","startTrackingInteractions","registerBackgroundTabDetection","instrumentOutgoingRequests","logger","extractTraceparentData","baggageHeaderToDynamicSamplingContext","WINDOW","startIdleTransaction","addPerformanceEntries","getActiveTransaction","getDomElement"],"mappings":";;;;;;;;;;AAwBA,MAAA,8BAAA,GAAA,iBAAA;AACA;AACA;;AAkHA,MAAA,+BAAA,GAAA;AACA,EAAA,GAAAA,qBAAA;AACA,EAAA,0BAAA,EAAA,IAAA;AACA,EAAA,sBAAA,EAAAC,oCAAA;AACA,EAAA,gCAAA,EAAA,IAAA;AACA,EAAA,0BAAA,EAAA,IAAA;AACA,EAAA,cAAA,EAAA,IAAA;AACA,EAAA,YAAA,EAAA,EAAA;AACA,EAAA,GAAAC,4CAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,+BAAA,CAAA;;AASA,GAAA,WAAA,CAAA,QAAA,EAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAAC,yBAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA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A;AACA,OAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,CAAA,OAAA,CAAA,CAAA,OAAA,CAAA,IAAA,IAAA;AACA,MAAA,gBAAA,CAAA,IAAA,EAAA,8BAAA,EAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,cAAA,CAAA,QAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,MAAA,OAAA,GAAAG,mBAAA,CAAA,CAAA,UAAA,EAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA,GAAA,OAAA,CAAA,YAAA,CAAA,SAAA,CAAA,GAAA,IAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const types = require('../types.js');
const getCLS = require('../web-vitals/getCLS.js');
const getFID = require('../web-vitals/getFID.js');
const getLCP = require('../web-vitals/getLCP.js');
const getVisibilityWatcher = require('../web-vitals/lib/getVisibilityWatcher.js');
const observe = require('../web-vitals/lib/observe.js');
const utils$1 = require('./utils.js');

/**
 * Converts from milliseconds to seconds
 * @param time time in ms
 */
function msToSec(time) {
  return time / 1000;
}

function getBrowserPerformanceAPI() {
  return types.WINDOW && types.WINDOW.addEventListener && types.WINDOW.performance;
}

let _performanceCursor = 0;

let _measurements = {};
let _lcpEntry;
let _clsEntry;

/**
 * Start tracking web vitals
 *
 * @returns A function that forces web vitals collection
 */
function startTrackingWebVitals() {
  const performance = getBrowserPerformanceAPI();
  if (performance && utils.browserPerformanceTimeOrigin) {
    if (performance.mark) {
      types.WINDOW.performance.mark('sentry-tracing-init');
    }
    _trackFID();
    const clsCallback = _trackCLS();
    const lcpCallback = _trackLCP();

    return () => {
      if (clsCallback) {
        clsCallback();
      }
      if (lcpCallback) {
        lcpCallback();
      }
    };
  }

  return () => undefined;
}

/**
 * Start tracking long tasks.
 */
function startTrackingLongTasks() {
  const entryHandler = (entries) => {
    for (const entry of entries) {
      const transaction = core.getActiveTransaction() ;
      if (!transaction) {
        return;
      }
      const startTime = msToSec((utils.browserPerformanceTimeOrigin ) + entry.startTime);
      const duration = msToSec(entry.duration);

      transaction.startChild({
        description: 'Main UI thread blocked',
        op: 'ui.long-task',
        startTimestamp: startTime,
        endTimestamp: startTime + duration,
      });
    }
  };

  observe.observe('longtask', entryHandler);
}

/**
 * Start tracking interaction events.
 */
function startTrackingInteractions() {
  const entryHandler = (entries) => {
    for (const entry of entries) {
      const transaction = core.getActiveTransaction() ;
      if (!transaction) {
        return;
      }

      if (entry.name === 'click') {
        const startTime = msToSec((utils.browserPerformanceTimeOrigin ) + entry.startTime);
        const duration = msToSec(entry.duration);

        transaction.startChild({
          description: utils.htmlTreeAsString(entry.target),
          op: `ui.interaction.${entry.name}`,
          startTimestamp: startTime,
          endTimestamp: startTime + duration,
        });
      }
    }
  };

  observe.observe('event', entryHandler, { durationThreshold: 0 });
}

/** Starts tracking the Cumulative Layout Shift on the current page. */
function _trackCLS() {
  // See:
  // https://web.dev/evolving-cls/
  // https://web.dev/cls-web-tooling/
  return getCLS.onCLS(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding CLS');
    _measurements['cls'] = { value: metric.value, unit: '' };
    _clsEntry = entry ;
  });
}

/** Starts tracking the Largest Contentful Paint on the current page. */
function _trackLCP() {
  return getLCP.onLCP(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding LCP');
    _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };
    _lcpEntry = entry ;
  });
}

/** Starts tracking the First Input Delay on the current page. */
function _trackFID() {
  getFID.onFID(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    const timeOrigin = msToSec(utils.browserPerformanceTimeOrigin );
    const startTime = msToSec(entry.startTime);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding FID');
    _measurements['fid'] = { value: metric.value, unit: 'millisecond' };
    _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };
  });
}

/** Add performance related spans to a transaction */
function addPerformanceEntries(transaction) {
  const performance = getBrowserPerformanceAPI();
  if (!performance || !types.WINDOW.performance.getEntries || !utils.browserPerformanceTimeOrigin) {
    // Gatekeeper if performance API not available
    return;
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] Adding & adjusting spans using Performance API');
  const timeOrigin = msToSec(utils.browserPerformanceTimeOrigin);

  const performanceEntries = performance.getEntries();

  let responseStartTimestamp;
  let requestStartTimestamp;

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  performanceEntries.slice(_performanceCursor).forEach((entry) => {
    const startTime = msToSec(entry.startTime);
    const duration = msToSec(entry.duration);

    if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {
      return;
    }

    switch (entry.entryType) {
      case 'navigation': {
        _addNavigationSpans(transaction, entry, timeOrigin);
        responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);
        requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);
        break;
      }
      case 'mark':
      case 'paint':
      case 'measure': {
        _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);

        // capture web vitals
        const firstHidden = getVisibilityWatcher.getVisibilityWatcher();
        // Only report if the page wasn't hidden prior to the web vital.
        const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;

        if (entry.name === 'first-paint' && shouldRecord) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding FP');
          _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };
        }
        if (entry.name === 'first-contentful-paint' && shouldRecord) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding FCP');
          _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };
        }
        break;
      }
      case 'resource': {
        const resourceName = (entry.name ).replace(types.WINDOW.location.origin, '');
        _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);
        break;
      }
      // Ignore other entry types.
    }
  });

  _performanceCursor = Math.max(performanceEntries.length - 1, 0);

  _trackNavigator(transaction);

  // Measurements are only available for pageload transactions
  if (transaction.op === 'pageload') {
    // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the
    // start of the response in milliseconds
    if (typeof responseStartTimestamp === 'number') {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding TTFB');
      _measurements['ttfb'] = {
        value: (responseStartTimestamp - transaction.startTimestamp) * 1000,
        unit: 'millisecond',
      };

      if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {
        // Capture the time spent making the request and receiving the first byte of the response.
        // This is the time between the start of the request and the start of the response in milliseconds.
        _measurements['ttfb.requestTime'] = {
          value: (responseStartTimestamp - requestStartTimestamp) * 1000,
          unit: 'millisecond',
        };
      }
    }

    ['fcp', 'fp', 'lcp'].forEach(name => {
      if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {
        return;
      }
      // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.
      // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need
      // to be adjusted to be relative to transaction.startTimestamp.
      const oldValue = _measurements[name].value;
      const measurementTimestamp = timeOrigin + msToSec(oldValue);

      // normalizedValue should be in milliseconds
      const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);
      const delta = normalizedValue - oldValue;

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);
      _measurements[name].value = normalizedValue;
    });

    const fidMark = _measurements['mark.fid'];
    if (fidMark && _measurements['fid']) {
      // create span for FID
      utils$1._startChild(transaction, {
        description: 'first input delay',
        endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),
        op: 'ui.action',
        startTimestamp: fidMark.value,
      });

      // Delete mark.fid as we don't want it to be part of final payload
      delete _measurements['mark.fid'];
    }

    // If FCP is not recorded we should not record the cls value
    // according to the new definition of CLS.
    if (!('fcp' in _measurements)) {
      delete _measurements.cls;
    }

    Object.keys(_measurements).forEach(measurementName => {
      transaction.setMeasurement(
        measurementName,
        _measurements[measurementName].value,
        _measurements[measurementName].unit,
      );
    });

    _tagMetricInfo(transaction);
  }

  _lcpEntry = undefined;
  _clsEntry = undefined;
  _measurements = {};
}

/** Create measure related spans */
function _addMeasureSpans(
  transaction,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  entry,
  startTime,
  duration,
  timeOrigin,
) {
  const measureStartTimestamp = timeOrigin + startTime;
  const measureEndTimestamp = measureStartTimestamp + duration;

  utils$1._startChild(transaction, {
    description: entry.name ,
    endTimestamp: measureEndTimestamp,
    op: entry.entryType ,
    startTimestamp: measureStartTimestamp,
  });

  return measureStartTimestamp;
}

/** Instrument navigation entries */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _addNavigationSpans(transaction, entry, timeOrigin) {
  ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {
    _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);
  });
  _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');
  _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');
  _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');
  _addRequest(transaction, entry, timeOrigin);
}

/** Create performance navigation related spans */
function _addPerformanceNavigationTiming(
  transaction,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  entry,
  event,
  timeOrigin,
  description,
  eventEnd,
) {
  const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] );
  const start = entry[`${event}Start`] ;
  if (!start || !end) {
    return;
  }
  utils$1._startChild(transaction, {
    op: 'browser',
    description: description || event,
    startTimestamp: timeOrigin + msToSec(start),
    endTimestamp: timeOrigin + msToSec(end),
  });
}

/** Create request and response related spans */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _addRequest(transaction, entry, timeOrigin) {
  utils$1._startChild(transaction, {
    op: 'browser',
    description: 'request',
    startTimestamp: timeOrigin + msToSec(entry.requestStart ),
    endTimestamp: timeOrigin + msToSec(entry.responseEnd ),
  });

  utils$1._startChild(transaction, {
    op: 'browser',
    description: 'response',
    startTimestamp: timeOrigin + msToSec(entry.responseStart ),
    endTimestamp: timeOrigin + msToSec(entry.responseEnd ),
  });
}

/** Create resource-related spans */
function _addResourceSpans(
  transaction,
  entry,
  resourceName,
  startTime,
  duration,
  timeOrigin,
) {
  // we already instrument based on fetch and xhr, so we don't need to
  // duplicate spans here.
  if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
    return;
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const data = {};
  if ('transferSize' in entry) {
    data['Transfer Size'] = entry.transferSize;
  }
  if ('encodedBodySize' in entry) {
    data['Encoded Body Size'] = entry.encodedBodySize;
  }
  if ('decodedBodySize' in entry) {
    data['Decoded Body Size'] = entry.decodedBodySize;
  }
  if ('renderBlockingStatus' in entry) {
    data['resource.render_blocking_status'] = entry.renderBlockingStatus;
  }

  const startTimestamp = timeOrigin + startTime;
  const endTimestamp = startTimestamp + duration;

  utils$1._startChild(transaction, {
    description: resourceName,
    endTimestamp,
    op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',
    startTimestamp,
    data,
  });
}

/**
 * Capture the information of the user agent.
 */
function _trackNavigator(transaction) {
  const navigator = types.WINDOW.navigator ;
  if (!navigator) {
    return;
  }

  // track network connectivity
  const connection = navigator.connection;
  if (connection) {
    if (connection.effectiveType) {
      transaction.setTag('effectiveConnectionType', connection.effectiveType);
    }

    if (connection.type) {
      transaction.setTag('connectionType', connection.type);
    }

    if (utils$1.isMeasurementValue(connection.rtt)) {
      _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };
    }
  }

  if (utils$1.isMeasurementValue(navigator.deviceMemory)) {
    transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);
  }

  if (utils$1.isMeasurementValue(navigator.hardwareConcurrency)) {
    transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));
  }
}

/** Add LCP / CLS data to transaction to allow debugging */
function _tagMetricInfo(transaction) {
  if (_lcpEntry) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding LCP Data');

    // Capture Properties of the LCP element that contributes to the LCP.

    if (_lcpEntry.element) {
      transaction.setTag('lcp.element', utils.htmlTreeAsString(_lcpEntry.element));
    }

    if (_lcpEntry.id) {
      transaction.setTag('lcp.id', _lcpEntry.id);
    }

    if (_lcpEntry.url) {
      // Trim URL to the first 200 characters.
      transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));
    }

    transaction.setTag('lcp.size', _lcpEntry.size);
  }

  // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift
  if (_clsEntry && _clsEntry.sources) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Measurements] Adding CLS Data');
    _clsEntry.sources.forEach((source, index) =>
      transaction.setTag(`cls.source.${index + 1}`, utils.htmlTreeAsString(source.node)),
    );
  }
}

exports._addMeasureSpans = _addMeasureSpans;
exports._addResourceSpans = _addResourceSpans;
exports.addPerformanceEntries = addPerformanceEntries;
exports.startTrackingInteractions = startTrackingInteractions;
exports.startTrackingLongTasks = startTrackingLongTasks;
exports.startTrackingWebVitals = startTrackingWebVitals;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../../src/browser/metrics/index.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type { Measurements } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../types';\nimport { onCLS } from '../web-vitals/getCLS';\nimport { onFID } from '../web-vitals/getFID';\nimport { onLCP } from '../web-vitals/getLCP';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport { observe } from '../web-vitals/lib/observe';\nimport type { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n  return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n  return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n  const performance = getBrowserPerformanceAPI();\n  if (performance && browserPerformanceTimeOrigin) {\n    if (performance.mark) {\n      WINDOW.performance.mark('sentry-tracing-init');\n    }\n    _trackFID();\n    const clsCallback = _trackCLS();\n    const lcpCallback = _trackLCP();\n\n    return (): void => {\n      if (clsCallback) {\n        clsCallback();\n      }\n      if (lcpCallback) {\n        lcpCallback();\n      }\n    };\n  }\n\n  return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n  const entryHandler = (entries: PerformanceEntry[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n      const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n      const duration = msToSec(entry.duration);\n\n      transaction.startChild({\n        description: 'Main UI thread blocked',\n        op: 'ui.long-task',\n        startTimestamp: startTime,\n        endTimestamp: startTime + duration,\n      });\n    }\n  };\n\n  observe('longtask', entryHandler);\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n  const entryHandler = (entries: PerformanceEventTiming[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n\n      if (entry.name === 'click') {\n        const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n        const duration = msToSec(entry.duration);\n\n        transaction.startChild({\n          description: htmlTreeAsString(entry.target),\n          op: `ui.interaction.${entry.name}`,\n          startTimestamp: startTime,\n          endTimestamp: startTime + duration,\n        });\n      }\n    }\n  };\n\n  observe('event', entryHandler, { durationThreshold: 0 });\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): ReturnType<typeof onCLS> {\n  // See:\n  // https://web.dev/evolving-cls/\n  // https://web.dev/cls-web-tooling/\n  return onCLS(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS');\n    _measurements['cls'] = { value: metric.value, unit: '' };\n    _clsEntry = entry as LayoutShift;\n  });\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): ReturnType<typeof onLCP> {\n  return onLCP(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP');\n    _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n    _lcpEntry = entry as LargestContentfulPaint;\n  });\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): void {\n  onFID(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n    const startTime = msToSec(entry.startTime);\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding FID');\n    _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n    _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n  });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n  const performance = getBrowserPerformanceAPI();\n  if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n    // Gatekeeper if performance API not available\n    return;\n  }\n\n  __DEBUG_BUILD__ && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n  const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n  const performanceEntries = performance.getEntries();\n\n  let responseStartTimestamp: number | undefined;\n  let requestStartTimestamp: number | undefined;\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  performanceEntries.slice(_performanceCursor).forEach((entry: Record<string, any>) => {\n    const startTime = msToSec(entry.startTime);\n    const duration = msToSec(entry.duration);\n\n    if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {\n      return;\n    }\n\n    switch (entry.entryType) {\n      case 'navigation': {\n        _addNavigationSpans(transaction, entry, timeOrigin);\n        responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);\n        requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);\n        break;\n      }\n      case 'mark':\n      case 'paint':\n      case 'measure': {\n        _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n        // capture web vitals\n        const firstHidden = getVisibilityWatcher();\n        // Only report if the page wasn't hidden prior to the web vital.\n        const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n        if (entry.name === 'first-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FP');\n          _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        if (entry.name === 'first-contentful-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FCP');\n          _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        break;\n      }\n      case 'resource': {\n        const resourceName = (entry.name as string).replace(WINDOW.location.origin, '');\n        _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);\n        break;\n      }\n      default:\n      // Ignore other entry types.\n    }\n  });\n\n  _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n  _trackNavigator(transaction);\n\n  // Measurements are only available for pageload transactions\n  if (transaction.op === 'pageload') {\n    // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the\n    // start of the response in milliseconds\n    if (typeof responseStartTimestamp === 'number') {\n      __DEBUG_BUILD__ && logger.log('[Measurements] Adding TTFB');\n      _measurements['ttfb'] = {\n        value: (responseStartTimestamp - transaction.startTimestamp) * 1000,\n        unit: 'millisecond',\n      };\n\n      if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {\n        // Capture the time spent making the request and receiving the first byte of the response.\n        // This is the time between the start of the request and the start of the response in milliseconds.\n        _measurements['ttfb.requestTime'] = {\n          value: (responseStartTimestamp - requestStartTimestamp) * 1000,\n          unit: 'millisecond',\n        };\n      }\n    }\n\n    ['fcp', 'fp', 'lcp'].forEach(name => {\n      if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {\n        return;\n      }\n      // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n      // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n      // to be adjusted to be relative to transaction.startTimestamp.\n      const oldValue = _measurements[name].value;\n      const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n      // normalizedValue should be in milliseconds\n      const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);\n      const delta = normalizedValue - oldValue;\n\n      __DEBUG_BUILD__ &&\n        logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n      _measurements[name].value = normalizedValue;\n    });\n\n    const fidMark = _measurements['mark.fid'];\n    if (fidMark && _measurements['fid']) {\n      // create span for FID\n      _startChild(transaction, {\n        description: 'first input delay',\n        endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n        op: 'ui.action',\n        startTimestamp: fidMark.value,\n      });\n\n      // Delete mark.fid as we don't want it to be part of final payload\n      delete _measurements['mark.fid'];\n    }\n\n    // If FCP is not recorded we should not record the cls value\n    // according to the new definition of CLS.\n    if (!('fcp' in _measurements)) {\n      delete _measurements.cls;\n    }\n\n    Object.keys(_measurements).forEach(measurementName => {\n      transaction.setMeasurement(\n        measurementName,\n        _measurements[measurementName].value,\n        _measurements[measurementName].unit,\n      );\n    });\n\n    _tagMetricInfo(transaction);\n  }\n\n  _lcpEntry = undefined;\n  _clsEntry = undefined;\n  _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): number {\n  const measureStartTimestamp = timeOrigin + startTime;\n  const measureEndTimestamp = measureStartTimestamp + duration;\n\n  _startChild(transaction, {\n    description: entry.name as string,\n    endTimestamp: measureEndTimestamp,\n    op: entry.entryType as string,\n    startTimestamp: measureStartTimestamp,\n  });\n\n  return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n    _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n  });\n  _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n  _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n  _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n  _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  event: string,\n  timeOrigin: number,\n  description?: string,\n  eventEnd?: string,\n): void {\n  const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n  const start = entry[`${event}Start`] as number | undefined;\n  if (!start || !end) {\n    return;\n  }\n  _startChild(transaction, {\n    op: 'browser',\n    description: description || event,\n    startTimestamp: timeOrigin + msToSec(start),\n    endTimestamp: timeOrigin + msToSec(end),\n  });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  _startChild(transaction, {\n    op: 'browser',\n    description: 'request',\n    startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n\n  _startChild(transaction, {\n    op: 'browser',\n    description: 'response',\n    startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n}\n\nexport interface ResourceEntry extends Record<string, unknown> {\n  initiatorType?: string;\n  transferSize?: number;\n  encodedBodySize?: number;\n  decodedBodySize?: number;\n  renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n  transaction: Transaction,\n  entry: ResourceEntry,\n  resourceName: string,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): void {\n  // we already instrument based on fetch and xhr, so we don't need to\n  // duplicate spans here.\n  if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n    return;\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const data: Record<string, any> = {};\n  if ('transferSize' in entry) {\n    data['Transfer Size'] = entry.transferSize;\n  }\n  if ('encodedBodySize' in entry) {\n    data['Encoded Body Size'] = entry.encodedBodySize;\n  }\n  if ('decodedBodySize' in entry) {\n    data['Decoded Body Size'] = entry.decodedBodySize;\n  }\n  if ('renderBlockingStatus' in entry) {\n    data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n  }\n\n  const startTimestamp = timeOrigin + startTime;\n  const endTimestamp = startTimestamp + duration;\n\n  _startChild(transaction, {\n    description: resourceName,\n    endTimestamp,\n    op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n    startTimestamp,\n    data,\n  });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n  const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n  if (!navigator) {\n    return;\n  }\n\n  // track network connectivity\n  const connection = navigator.connection;\n  if (connection) {\n    if (connection.effectiveType) {\n      transaction.setTag('effectiveConnectionType', connection.effectiveType);\n    }\n\n    if (connection.type) {\n      transaction.setTag('connectionType', connection.type);\n    }\n\n    if (isMeasurementValue(connection.rtt)) {\n      _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n    }\n  }\n\n  if (isMeasurementValue(navigator.deviceMemory)) {\n    transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n  }\n\n  if (isMeasurementValue(navigator.hardwareConcurrency)) {\n    transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n  }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n  if (_lcpEntry) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP Data');\n\n    // Capture Properties of the LCP element that contributes to the LCP.\n\n    if (_lcpEntry.element) {\n      transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n    }\n\n    if (_lcpEntry.id) {\n      transaction.setTag('lcp.id', _lcpEntry.id);\n    }\n\n    if (_lcpEntry.url) {\n      // Trim URL to the first 200 characters.\n      transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n    }\n\n    transaction.setTag('lcp.size', _lcpEntry.size);\n  }\n\n  // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n  if (_clsEntry && _clsEntry.sources) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS Data');\n    _clsEntry.sources.forEach((source, index) =>\n      transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n    );\n  }\n}\n"],"names":["WINDOW","browserPerformanceTimeOrigin","getActiveTransaction","observe","htmlTreeAsString","onCLS","logger","onLCP","onFID","getVisibilityWatcher","_startChild","isMeasurementValue"],"mappings":";;;;;;;;;;;;AAeA;AACA;AACA;AACA;AACA,SAAA,OAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,IAAA,GAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,wBAAA,GAAA;AACA,EAAA,OAAAA,YAAA,IAAAA,YAAA,CAAA,gBAAA,IAAAA,YAAA,CAAA,WAAA,CAAA;AACA,CAAA;AACA;AACA,IAAA,kBAAA,GAAA,CAAA,CAAA;AACA;AACA,IAAA,aAAA,GAAA,EAAA,CAAA;AACA,IAAA,SAAA,CAAA;AACA,IAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,GAAA;AACA,EAAA,MAAA,WAAA,GAAA,wBAAA,EAAA,CAAA;AACA,EAAA,IAAA,WAAA,IAAAC,kCAAA,EAAA;AACA,IAAA,IAAA,WAAA,CAAA,IAAA,EAAA;AACA,MAAAD,YAAA,CAAA,WAAA,CAAA,IAAA,CAAA,qBAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,SAAA,EAAA,CAA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AAL,YAAA,CAAA,GAAA,CAAA,gCAAA,CAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,SAAA,CAAA,OAAA,EAAA;AACA,MAAA,WAAA,CAAA,MAAA,CAAA,aAAA,EAAAF,sBAAA,CAAA,SAAA,CAAA,OAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,SAAA,CAAA,EAAA,EAAA;AACA,MAAA,WAAA,CAAA,MAAA,CAAA,QAAA,EAAA,SAAA,CAAA,EAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,SAAA,CAAA,GAAA,EAAA;AACA;AACA,MAAA,WAAA,CAAA,MAAA,CAAA,SAAA,EAAA,SAAA,CAAA,GAAA,CAAA,IAAA,EAAA,CAAA,KAAA,CAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,WAAA,CAAA,MAAA,CAAA,UAAA,EAAA,SAAA,CAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,SAAA,IAAA,SAAA,CAAA,OAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAE,YAAA,CAAA,GAAA,CAAA,gCAAA,CAAA,CAAA;AACA,IAAA,SAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA,MAAA,EAAA,KAAA;AACA,MAAA,WAAA,CAAA,MAAA,CAAA,CAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA,EAAAF,sBAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Checks if a given value is a valid measurement value.
 */
function isMeasurementValue(value) {
  return typeof value === 'number' && isFinite(value);
}

/**
 * Helper function to start child on transactions. This function will make sure that the transaction will
 * use the start timestamp of the created child span if it is earlier than the transactions actual
 * start timestamp.
 */
function _startChild(transaction, { startTimestamp, ...ctx }) {
  if (startTimestamp && transaction.startTimestamp > startTimestamp) {
    transaction.startTimestamp = startTimestamp;
  }

  return transaction.startChild({
    startTimestamp,
    ...ctx,
  });
}

exports._startChild = _startChild;
exports.isMeasurementValue = isMeasurementValue;
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/browser/metrics/utils.ts"],"sourcesContent":["import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n  return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n  if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n    transaction.startTimestamp = startTimestamp;\n  }\n\n  return transaction.startChild({\n    startTimestamp,\n    ...ctx,\n  });\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,OAAA,KAAA,KAAA,QAAA,IAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,WAAA,EAAA,EAAA,cAAA,EAAA,GAAA,GAAA,EAAA,EAAA;AACA,EAAA,IAAA,cAAA,IAAA,WAAA,CAAA,cAAA,GAAA,cAAA,EAAA;AACA,IAAA,WAAA,CAAA,cAAA,GAAA,cAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,WAAA,CAAA,UAAA,CAAA;AACA,IAAA,cAAA;AACA,IAAA,GAAA,GAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

/* eslint-disable max-lines */

const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\//];

/** Options for Request Instrumentation */

const defaultRequestInstrumentationOptions = {
  traceFetch: true,
  traceXHR: true,
  // TODO (v8): Remove this property
  tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,
  tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,
};

/** Registers span creators for xhr and fetch requests  */
function instrumentOutgoingRequests(_options) {
  // eslint-disable-next-line deprecation/deprecation
  const { traceFetch, traceXHR, tracePropagationTargets, tracingOrigins, shouldCreateSpanForRequest } = {
    traceFetch: defaultRequestInstrumentationOptions.traceFetch,
    traceXHR: defaultRequestInstrumentationOptions.traceXHR,
    ..._options,
  };

  const shouldCreateSpan =
    typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true;

  // TODO(v8) Remove tracingOrigins here
  // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported
  // and we don't want to break the API. We can remove it in v8.
  const shouldAttachHeadersWithTargets = (url) =>
    shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);

  const spans = {};

  if (traceFetch) {
    utils.addInstrumentationHandler('fetch', (handlerData) => {
      fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
    });
  }

  if (traceXHR) {
    utils.addInstrumentationHandler('xhr', (handlerData) => {
      xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
    });
  }
}

/**
 * A function that determines whether to attach tracing headers to a request.
 * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.
 * We only export this fuction for testing purposes.
 */
function shouldAttachHeaders(url, tracePropagationTargets) {
  return utils.stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);
}

/**
 * Create and track fetch request spans
 */
function fetchCallback(
  handlerData,
  shouldCreateSpan,
  shouldAttachHeaders,
  spans,
) {
  if (!core.hasTracingEnabled() || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) {
    return;
  }

  if (handlerData.endTimestamp) {
    const spanId = handlerData.fetchData.__span;
    if (!spanId) return;

    const span = spans[spanId];
    if (span) {
      if (handlerData.response) {
        // TODO (kmclb) remove this once types PR goes through
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        span.setHttpStatus(handlerData.response.status);
      } else if (handlerData.error) {
        span.setStatus('internal_error');
      }
      span.finish();

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete spans[spanId];
    }
    return;
  }

  const currentScope = core.getCurrentHub().getScope();
  const currentSpan = currentScope && currentScope.getSpan();
  const activeTransaction = currentSpan && currentSpan.transaction;

  if (currentSpan && activeTransaction) {
    const span = currentSpan.startChild({
      data: {
        ...handlerData.fetchData,
        type: 'fetch',
      },
      description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,
      op: 'http.client',
    });

    handlerData.fetchData.__span = span.spanId;
    spans[span.spanId] = span;

    const request = handlerData.args[0];

    // In case the user hasn't set the second argument of a fetch call we default it to `{}`.
    handlerData.args[1] = handlerData.args[1] || {};

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const options = handlerData.args[1];

    if (shouldAttachHeaders(handlerData.fetchData.url)) {
      options.headers = addTracingHeadersToFetchRequest(
        request,
        activeTransaction.getDynamicSamplingContext(),
        span,
        options,
      );
    }
  }
}

/**
 * Adds sentry-trace and baggage headers to the various forms of fetch headers
 */
function addTracingHeadersToFetchRequest(
  request, // unknown is actually type Request but we can't export DOM types from this package,
  dynamicSamplingContext,
  span,
  options

,
) {
  const sentryBaggageHeader = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
  const sentryTraceHeader = span.toTraceparent();

  const headers =
    typeof Request !== 'undefined' && utils.isInstanceOf(request, Request) ? (request ).headers : options.headers;

  if (!headers) {
    return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };
  } else if (typeof Headers !== 'undefined' && utils.isInstanceOf(headers, Headers)) {
    const newHeaders = new Headers(headers );

    newHeaders.append('sentry-trace', sentryTraceHeader);

    if (sentryBaggageHeader) {
      // If the same header is appended multiple times the browser will merge the values into a single request header.
      // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
      newHeaders.append(utils.BAGGAGE_HEADER_NAME, sentryBaggageHeader);
    }

    return newHeaders ;
  } else if (Array.isArray(headers)) {
    const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];

    if (sentryBaggageHeader) {
      // If there are multiple entries with the same key, the browser will merge the values into a single request header.
      // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
      newHeaders.push([utils.BAGGAGE_HEADER_NAME, sentryBaggageHeader]);
    }

    return newHeaders ;
  } else {
    const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;
    const newBaggageHeaders = [];

    if (Array.isArray(existingBaggageHeader)) {
      newBaggageHeaders.push(...existingBaggageHeader);
    } else if (existingBaggageHeader) {
      newBaggageHeaders.push(existingBaggageHeader);
    }

    if (sentryBaggageHeader) {
      newBaggageHeaders.push(sentryBaggageHeader);
    }

    return {
      ...(headers ),
      'sentry-trace': sentryTraceHeader,
      baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
    };
  }
}

/**
 * Create and track xhr request spans
 */
function xhrCallback(
  handlerData,
  shouldCreateSpan,
  shouldAttachHeaders,
  spans,
) {
  const xhr = handlerData.xhr;
  const sentryXhrData = xhr && xhr[utils.SENTRY_XHR_DATA_KEY];

  if (
    !core.hasTracingEnabled() ||
    (xhr && xhr.__sentry_own_request__) ||
    !(xhr && sentryXhrData && shouldCreateSpan(sentryXhrData.url))
  ) {
    return;
  }

  // check first if the request has finished and is tracked by an existing span which should now end
  if (handlerData.endTimestamp) {
    const spanId = xhr.__sentry_xhr_span_id__;
    if (!spanId) return;

    const span = spans[spanId];
    if (span) {
      span.setHttpStatus(sentryXhrData.status_code);
      span.finish();

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete spans[spanId];
    }
    return;
  }

  const currentScope = core.getCurrentHub().getScope();
  const currentSpan = currentScope && currentScope.getSpan();
  const activeTransaction = currentSpan && currentSpan.transaction;

  if (currentSpan && activeTransaction) {
    const span = currentSpan.startChild({
      data: {
        ...sentryXhrData.data,
        type: 'xhr',
        method: sentryXhrData.method,
        url: sentryXhrData.url,
      },
      description: `${sentryXhrData.method} ${sentryXhrData.url}`,
      op: 'http.client',
    });

    xhr.__sentry_xhr_span_id__ = span.spanId;
    spans[xhr.__sentry_xhr_span_id__] = span;

    if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {
      try {
        xhr.setRequestHeader('sentry-trace', span.toTraceparent());

        const dynamicSamplingContext = activeTransaction.getDynamicSamplingContext();
        const sentryBaggageHeader = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);

        if (sentryBaggageHeader) {
          // From MDN: "If this method is called several times with the same header, the values are merged into one single request header."
          // We can therefore simply set a baggage header without checking what was there before
          // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader
          xhr.setRequestHeader(utils.BAGGAGE_HEADER_NAME, sentryBaggageHeader);
        }
      } catch (_) {
        // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
      }
    }
  }
}

exports.DEFAULT_TRACE_PROPAGATION_TARGETS = DEFAULT_TRACE_PROPAGATION_TARGETS;
exports.addTracingHeadersToFetchRequest = addTracingHeadersToFetchRequest;
exports.defaultRequestInstrumentationOptions = defaultRequestInstrumentationOptions;
exports.fetchCallback = fetchCallback;
exports.instrumentOutgoingRequests = instrumentOutgoingRequests;
exports.shouldAttachHeaders = shouldAttachHeaders;
exports.xhrCallback = xhrCallback;
//# sourceMappingURL=request.js.map
{"version":3,"file":"request.js","sources":["../../../src/browser/request.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport { getCurrentHub, hasTracingEnabled } from '@sentry/core';\nimport type { DynamicSamplingContext, Span } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  BAGGAGE_HEADER_NAME,\n  dynamicSamplingContextToSentryBaggageHeader,\n  isInstanceOf,\n  SENTRY_XHR_DATA_KEY,\n  stringMatchesSomePattern,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\//];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n  /**\n   * @deprecated Will be removed in v8.\n   * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n   * trace header attachment.\n   */\n  tracingOrigins: Array<string | RegExp>;\n\n  /**\n   * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n   * headers attached.\n   *\n   * Default: ['localhost', /^\\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}\n   */\n  tracePropagationTargets: Array<string | RegExp>;\n\n  /**\n   * Flag to disable patching all together for fetch requests.\n   *\n   * Default: true\n   */\n  traceFetch: boolean;\n\n  /**\n   * Flag to disable patching all together for xhr requests.\n   *\n   * Default: true\n   */\n  traceXHR: boolean;\n\n  /**\n   * This function will be called before creating a span for a request with the given url.\n   * Return false if you don't want a span for the given url.\n   *\n   * Default: (url: string) => true\n   */\n  shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\n/** Data returned from fetch callback */\nexport interface FetchData {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  args: any[]; // the arguments passed to the fetch call itself\n  fetchData?: {\n    method: string;\n    url: string;\n    // span_id\n    __span?: string;\n  };\n\n  // TODO Should this be unknown instead? If we vendor types, make it a Response\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  response?: any;\n  error?: unknown;\n\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\n/** Data returned from XHR request */\nexport interface XHRData {\n  xhr?: {\n    [SENTRY_XHR_DATA_KEY]?: {\n      method: string;\n      url: string;\n      status_code: number;\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      data: Record<string, any>;\n    };\n    __sentry_xhr_span_id__?: string;\n    setRequestHeader?: (key: string, val: string) => void;\n    getRequestHeader?: (key: string) => string;\n    __sentry_own_request__?: boolean;\n  };\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\ntype PolymorphicRequestHeaders =\n  | Record<string, string | undefined>\n  | Array<[string, string]>\n  // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n  | {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      [key: string]: any;\n      append: (key: string, value: string) => void;\n      get: (key: string) => string | null | undefined;\n    };\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n  traceFetch: true,\n  traceXHR: true,\n  // TODO (v8): Remove this property\n  tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n  tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests  */\nexport function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void {\n  // eslint-disable-next-line deprecation/deprecation\n  const { traceFetch, traceXHR, tracePropagationTargets, tracingOrigins, shouldCreateSpanForRequest } = {\n    traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n    traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n    ..._options,\n  };\n\n  const shouldCreateSpan =\n    typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n  // TODO(v8) Remove tracingOrigins here\n  // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n  // and we don't want to break the API. We can remove it in v8.\n  const shouldAttachHeadersWithTargets = (url: string): boolean =>\n    shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n  const spans: Record<string, Span> = {};\n\n  if (traceFetch) {\n    addInstrumentationHandler('fetch', (handlerData: FetchData) => {\n      fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n    });\n  }\n\n  if (traceXHR) {\n    addInstrumentationHandler('xhr', (handlerData: XHRData) => {\n      xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n    });\n  }\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n  return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track fetch request spans\n */\nexport function fetchCallback(\n  handlerData: FetchData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): void {\n  if (!hasTracingEnabled() || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) {\n    return;\n  }\n\n  if (handlerData.endTimestamp) {\n    const spanId = handlerData.fetchData.__span;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      if (handlerData.response) {\n        // TODO (kmclb) remove this once types PR goes through\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        span.setHttpStatus(handlerData.response.status);\n      } else if (handlerData.error) {\n        span.setStatus('internal_error');\n      }\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return;\n  }\n\n  const currentScope = getCurrentHub().getScope();\n  const currentSpan = currentScope && currentScope.getSpan();\n  const activeTransaction = currentSpan && currentSpan.transaction;\n\n  if (currentSpan && activeTransaction) {\n    const span = currentSpan.startChild({\n      data: {\n        ...handlerData.fetchData,\n        type: 'fetch',\n      },\n      description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,\n      op: 'http.client',\n    });\n\n    handlerData.fetchData.__span = span.spanId;\n    spans[span.spanId] = span;\n\n    const request: string | Request = handlerData.args[0];\n\n    // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n    handlerData.args[1] = handlerData.args[1] || {};\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const options: { [key: string]: any } = handlerData.args[1];\n\n    if (shouldAttachHeaders(handlerData.fetchData.url)) {\n      options.headers = addTracingHeadersToFetchRequest(\n        request,\n        activeTransaction.getDynamicSamplingContext(),\n        span,\n        options,\n      );\n    }\n  }\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n  request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n  dynamicSamplingContext: Partial<DynamicSamplingContext>,\n  span: Span,\n  options: {\n    headers?:\n      | {\n          [key: string]: string[] | string | undefined;\n        }\n      | PolymorphicRequestHeaders;\n  },\n): PolymorphicRequestHeaders {\n  const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n  const sentryTraceHeader = span.toTraceparent();\n\n  const headers =\n    typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : options.headers;\n\n  if (!headers) {\n    return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n  } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n    const newHeaders = new Headers(headers as Headers);\n\n    newHeaders.append('sentry-trace', sentryTraceHeader);\n\n    if (sentryBaggageHeader) {\n      // If the same header is appended multiple times the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else if (Array.isArray(headers)) {\n    const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n    if (sentryBaggageHeader) {\n      // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else {\n    const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n    const newBaggageHeaders: string[] = [];\n\n    if (Array.isArray(existingBaggageHeader)) {\n      newBaggageHeaders.push(...existingBaggageHeader);\n    } else if (existingBaggageHeader) {\n      newBaggageHeaders.push(existingBaggageHeader);\n    }\n\n    if (sentryBaggageHeader) {\n      newBaggageHeaders.push(sentryBaggageHeader);\n    }\n\n    return {\n      ...(headers as Exclude<typeof headers, Headers>),\n      'sentry-trace': sentryTraceHeader,\n      baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n    };\n  }\n}\n\n/**\n * Create and track xhr request spans\n */\nexport function xhrCallback(\n  handlerData: XHRData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): void {\n  const xhr = handlerData.xhr;\n  const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n  if (\n    !hasTracingEnabled() ||\n    (xhr && xhr.__sentry_own_request__) ||\n    !(xhr && sentryXhrData && shouldCreateSpan(sentryXhrData.url))\n  ) {\n    return;\n  }\n\n  // check first if the request has finished and is tracked by an existing span which should now end\n  if (handlerData.endTimestamp) {\n    const spanId = xhr.__sentry_xhr_span_id__;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      span.setHttpStatus(sentryXhrData.status_code);\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return;\n  }\n\n  const currentScope = getCurrentHub().getScope();\n  const currentSpan = currentScope && currentScope.getSpan();\n  const activeTransaction = currentSpan && currentSpan.transaction;\n\n  if (currentSpan && activeTransaction) {\n    const span = currentSpan.startChild({\n      data: {\n        ...sentryXhrData.data,\n        type: 'xhr',\n        method: sentryXhrData.method,\n        url: sentryXhrData.url,\n      },\n      description: `${sentryXhrData.method} ${sentryXhrData.url}`,\n      op: 'http.client',\n    });\n\n    xhr.__sentry_xhr_span_id__ = span.spanId;\n    spans[xhr.__sentry_xhr_span_id__] = span;\n\n    if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {\n      try {\n        xhr.setRequestHeader('sentry-trace', span.toTraceparent());\n\n        const dynamicSamplingContext = activeTransaction.getDynamicSamplingContext();\n        const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n        if (sentryBaggageHeader) {\n          // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n          // We can therefore simply set a baggage header without checking what was there before\n          // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n          xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n        }\n      } catch (_) {\n        // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n      }\n    }\n  }\n}\n"],"names":["addInstrumentationHandler","stringMatchesSomePattern","hasTracingEnabled","getCurrentHub","dynamicSamplingContextToSentryBaggageHeader","isInstanceOf","BAGGAGE_HEADER_NAME","SENTRY_XHR_DATA_KEY"],"mappings":";;;;;AAAA;AAWA;AACA,MAAA,iCAAA,GAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA;AACA;;AA0FA,MAAA,oCAAA,GAAA;AACA,EAAA,UAAA,EAAA,IAAA;AACA,EAAA,QAAA,EAAA,IAAA;AACA;AACA,EAAA,cAAA,EAAA,iCAAA;AACA,EAAA,uBAAA,EAAA,iCAAA;AACA,EAAA;AACA;AACA;AACA,SAAA,0BAAA,CAAA,QAAA,EAAA;AACA;AACA,EAAA,MAAA,EAAA,UAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,cAAA,EAAA,0BAAA,EAAA,GAAA;AACA,IAAA,UAAA,EAAA,oCAAA,CAAA,UAAA;AACA,IAAA,QAAA,EAAA,oCAAA,CAAA,QAAA;AACA,IAAA,GAAA,QAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,gBAAA;AACA,IAAA,OAAA,0BAAA,KAAA,UAAA,GAA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AAA,aAAA,CAAA,IAAA;AACA,QAAA,IAAA,EAAA,KAAA;AACA,QAAA,MAAA,EAAA,aAAA,CAAA,MAAA;AACA,QAAA,GAAA,EAAA,aAAA,CAAA,GAAA;AACA,OAAA;AACA,MAAA,WAAA,EAAA,CAAA,EAAA,aAAA,CAAA,MAAA,CAAA,CAAA,EAAA,aAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,EAAA,EAAA,aAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAA,GAAA,CAAA,sBAAA,GAAA,IAAA,CAAA,MAAA,CAAA;AACA,IAAA,KAAA,CAAA,GAAA,CAAA,sBAAA,CAAA,GAAA,IAAA,CAAA;AACA;AACA,IAAA,IAAA,GAAA,CAAA,gBAAA,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA;AACA,QAAA,GAAA,CAAA,gBAAA,CAAA,cAAA,EAAA,IAAA,CAAA,aAAA,EAAA,CAAA,CAAA;AACA;AACA,QAAA,MAAA,sBAAA,GAAA,iBAAA,CAAA,yBAAA,EAAA,CAAA;AACA,QAAA,MAAA,mBAAA,GAAAC,iDAAA,CAAA,sBAAA,CAAA,CAAA;AACA;AACA,QAAA,IAAA,mBAAA,EAAA;AACA;AACA;AACA;AACA,UAAA,GAAA,CAAA,gBAAA,CAAAE,yBAAA,EAAA,mBAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA,KAAA;AACA,GAAA;AACA;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const types = require('./types.js');

/**
 * Default function implementing pageload and navigation transactions
 */
function instrumentRoutingWithDefaults(
  customStartTransaction,
  startTransactionOnPageLoad = true,
  startTransactionOnLocationChange = true,
) {
  if (!types.WINDOW || !types.WINDOW.location) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Could not initialize routing instrumentation due to invalid location');
    return;
  }

  let startingUrl = types.WINDOW.location.href;

  let activeTransaction;
  if (startTransactionOnPageLoad) {
    activeTransaction = customStartTransaction({
      name: types.WINDOW.location.pathname,
      // pageload should always start at timeOrigin
      startTimestamp: utils.browserPerformanceTimeOrigin,
      op: 'pageload',
      metadata: { source: 'url' },
    });
  }

  if (startTransactionOnLocationChange) {
    utils.addInstrumentationHandler('history', ({ to, from }) => {
      /**
       * This early return is there to account for some cases where a navigation transaction starts right after
       * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
       * create an uneccessary navigation transaction.
       *
       * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
       * only be caused in certain development environments where the usage of a hot module reloader is causing
       * errors.
       */
      if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {
        startingUrl = undefined;
        return;
      }

      if (from !== to) {
        startingUrl = undefined;
        if (activeTransaction) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);
          // If there's an open transaction on the scope, we need to finish it before creating an new one.
          activeTransaction.finish();
        }
        activeTransaction = customStartTransaction({
          name: types.WINDOW.location.pathname,
          op: 'navigation',
          metadata: { source: 'url' },
        });
      }
    });
  }
}

exports.instrumentRoutingWithDefaults = instrumentRoutingWithDefaults;
//# sourceMappingURL=router.js.map
{"version":3,"file":"router.js","sources":["../../../src/browser/router.ts"],"sourcesContent":["import type { Transaction, TransactionContext } from '@sentry/types';\nimport { addInstrumentationHandler, browserPerformanceTimeOrigin, logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nexport function instrumentRoutingWithDefaults<T extends Transaction>(\n  customStartTransaction: (context: TransactionContext) => T | undefined,\n  startTransactionOnPageLoad: boolean = true,\n  startTransactionOnLocationChange: boolean = true,\n): void {\n  if (!WINDOW || !WINDOW.location) {\n    __DEBUG_BUILD__ && logger.warn('Could not initialize routing instrumentation due to invalid location');\n    return;\n  }\n\n  let startingUrl: string | undefined = WINDOW.location.href;\n\n  let activeTransaction: T | undefined;\n  if (startTransactionOnPageLoad) {\n    activeTransaction = customStartTransaction({\n      name: WINDOW.location.pathname,\n      // pageload should always start at timeOrigin\n      startTimestamp: browserPerformanceTimeOrigin,\n      op: 'pageload',\n      metadata: { source: 'url' },\n    });\n  }\n\n  if (startTransactionOnLocationChange) {\n    addInstrumentationHandler('history', ({ to, from }: { to: string; from?: string }) => {\n      /**\n       * This early return is there to account for some cases where a navigation transaction starts right after\n       * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n       * create an uneccessary navigation transaction.\n       *\n       * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n       * only be caused in certain development environments where the usage of a hot module reloader is causing\n       * errors.\n       */\n      if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n        startingUrl = undefined;\n        return;\n      }\n\n      if (from !== to) {\n        startingUrl = undefined;\n        if (activeTransaction) {\n          __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n          // If there's an open transaction on the scope, we need to finish it before creating an new one.\n          activeTransaction.finish();\n        }\n        activeTransaction = customStartTransaction({\n          name: WINDOW.location.pathname,\n          op: 'navigation',\n          metadata: { source: 'url' },\n        });\n      }\n    });\n  }\n}\n"],"names":["WINDOW","logger","browserPerformanceTimeOrigin","addInstrumentationHandler"],"mappings":";;;;;AAKA;AACA;AACA;AACA,SAAA,6BAAA;AACA,EAAA,sBAAA;AACA,EAAA,0BAAA,GAAA,IAAA;AACA,EAAA,gCAAA,GAAA,IAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAAA,YAAA,IAAA,CAAAA,YAAA,CAAA,QAAA,EAAA;AACA,IAAA,iEAAAC,YAAA,CAAA,IAAA,CAAA,sEAAA,CAAA,CAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,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CAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const WINDOW = utils.GLOBAL_OBJ ;

exports.WINDOW = WINDOW;
//# sourceMappingURL=types.js.map
{"version":3,"file":"types.js","sources":["../../../src/browser/types.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n"],"names":["GLOBAL_OBJ"],"mappings":";;;;AAEA,MAAA,MAAA,GAAAA,gBAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const bindReporter = require('./lib/bindReporter.js');
const initMetric = require('./lib/initMetric.js');
const observe = require('./lib/observe.js');
const onHidden = require('./lib/onHidden.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Calculates the [CLS](https://web.dev/cls/) value for the current page and
 * calls the `callback` function once the value is ready to be reported, along
 * with all `layout-shift` performance entries that were used in the metric
 * value calculation. The reported value is a `double` (corresponding to a
 * [layout shift score](https://web.dev/cls/#layout-shift-score)).
 *
 * If the `reportAllChanges` configuration option is set to `true`, the
 * `callback` function will be called as soon as the value is initially
 * determined as well as any time the value changes throughout the page
 * lifespan.
 *
 * _**Important:** CLS should be continually monitored for changes throughout
 * the entire lifespan of a page—including if the user returns to the page after
 * it's been hidden/backgrounded. However, since browsers often [will not fire
 * additional callbacks once the user has backgrounded a
 * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
 * `callback` is always called when the page's visibility state changes to
 * hidden. As a result, the `callback` function might be called multiple times
 * during the same page load._
 */
const onCLS = (onReport) => {
  const metric = initMetric.initMetric('CLS', 0);
  let report;

  let sessionValue = 0;
  let sessionEntries = [];

  // const handleEntries = (entries: Metric['entries']) => {
  const handleEntries = (entries) => {
    entries.forEach(entry => {
      // Only count layout shifts without recent user input.
      if (!entry.hadRecentInput) {
        const firstSessionEntry = sessionEntries[0];
        const lastSessionEntry = sessionEntries[sessionEntries.length - 1];

        // If the entry occurred less than 1 second after the previous entry and
        // less than 5 seconds after the first entry in the session, include the
        // entry in the current session. Otherwise, start a new session.
        if (
          sessionValue &&
          sessionEntries.length !== 0 &&
          entry.startTime - lastSessionEntry.startTime < 1000 &&
          entry.startTime - firstSessionEntry.startTime < 5000
        ) {
          sessionValue += entry.value;
          sessionEntries.push(entry);
        } else {
          sessionValue = entry.value;
          sessionEntries = [entry];
        }

        // If the current session value is larger than the current CLS value,
        // update CLS and the entries contributing to it.
        if (sessionValue > metric.value) {
          metric.value = sessionValue;
          metric.entries = sessionEntries;
          if (report) {
            report();
          }
        }
      }
    });
  };

  const po = observe.observe('layout-shift', handleEntries);
  if (po) {
    report = bindReporter.bindReporter(onReport, metric);

    const stopListening = () => {
      handleEntries(po.takeRecords() );
      report(true);
    };

    onHidden.onHidden(stopListening);

    return stopListening;
  }

  return;
};

exports.onCLS = onCLS;
//# sourceMappingURL=getCLS.js.map
{"version":3,"file":"getCLS.js","sources":["../../../../src/browser/web-vitals/getCLS.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (onReport: ReportCallback): StopListening | undefined => {\n  const metric = initMetric('CLS', 0);\n  let report: ReturnType<typeof bindReporter>;\n\n  let sessionValue = 0;\n  let sessionEntries: PerformanceEntry[] = [];\n\n  // const handleEntries = (entries: Metric['entries']) => {\n  const handleEntries = (entries: LayoutShift[]): void => {\n    entries.forEach(entry => {\n      // Only count layout shifts without recent user input.\n      if (!entry.hadRecentInput) {\n        const firstSessionEntry = sessionEntries[0];\n        const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n        // If the entry occurred less than 1 second after the previous entry and\n        // less than 5 seconds after the first entry in the session, include the\n        // entry in the current session. Otherwise, start a new session.\n        if (\n          sessionValue &&\n          sessionEntries.length !== 0 &&\n          entry.startTime - lastSessionEntry.startTime < 1000 &&\n          entry.startTime - firstSessionEntry.startTime < 5000\n        ) {\n          sessionValue += entry.value;\n          sessionEntries.push(entry);\n        } else {\n          sessionValue = entry.value;\n          sessionEntries = [entry];\n        }\n\n        // If the current session value is larger than the current CLS value,\n        // update CLS and the entries contributing to it.\n        if (sessionValue > metric.value) {\n          metric.value = sessionValue;\n          metric.entries = sessionEntries;\n          if (report) {\n            report();\n          }\n        }\n      }\n    });\n  };\n\n  const po = observe('layout-shift', handleEntries);\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      handleEntries(po.takeRecords() as CLSMetric['entries']);\n      report(true);\n    };\n\n    onHidden(stopListening);\n\n    return stopListening;\n  }\n\n  return;\n};\n"],"names":["initMetric","observe","bindReporter","onHidden"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAAA,qBAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,MAAA,CAAA;AACA;AACA,EAAA,IAAA,YAAA,GAAA,CAAA,CAAA;AACA,EAAA,IAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,CAAA,OAAA,KAAA;AACA,IAAA,OAAA,CAAA,OAAA,CAAA,KAAA,IAAA;AACA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,cAAA,EAAA;AACA,QAAA,MAAA,iBAAA,GAAA,cAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,MAAA,gBAAA,GAAA,cAAA,CAAA,cAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,QAAA;AACA,UAAA,YAAA;AACA,UAAA,cAAA,CAAA,MAAA,KAAA,CAAA;AACA,UAAA,KAAA,CAAA,SAAA,GAAA,gBAAA,CAAA,SAAA,GAAA,IAAA;AACA,UAAA,KAAA,CAAA,SAAA,GAAA,iBAAA,CAAA,SAAA,GAAA,IAAA;AACA,UAAA;AACA,UAAA,YAAA,IAAA,KAAA,CAAA,KAAA,CAAA;AACA,UAAA,cAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,YAAA,GAAA,KAAA,CAAA,KAAA,CAAA;AACA,UAAA,cAAA,GAAA,CAAA,KAAA,CAAA,CAAA;AACA,SAAA;AACA;AACA;AACA;AACA,QAAA,IAAA,YAAA,GAAA,MAAA,CAAA,KAAA,EAAA;AACA,UAAA,MAAA,CAAA,KAAA,GAAA,YAAA,CAAA;AACA,UAAA,MAAA,CAAA,OAAA,GAAA,cAAA,CAAA;AACA,UAAA,IAAA,MAAA,EAAA;AACA,YAAA,MAAA,EAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAAC,eAAA,CAAA,cAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAA,MAAA,GAAAC,yBAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,aAAA,GAAA,MAAA;AACA,MAAA,aAAA,CAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA,IAAAC,iBAAA,CAAA,aAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,aAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const bindReporter = require('./lib/bindReporter.js');
const getVisibilityWatcher = require('./lib/getVisibilityWatcher.js');
const initMetric = require('./lib/initMetric.js');
const observe = require('./lib/observe.js');
const onHidden = require('./lib/onHidden.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Calculates the [FID](https://web.dev/fid/) value for the current page and
 * calls the `callback` function once the value is ready, along with the
 * relevant `first-input` performance entry used to determine the value. The
 * reported value is a `DOMHighResTimeStamp`.
 *
 * _**Important:** since FID is only reported after the user interacts with the
 * page, it's possible that it will not be reported for some page loads._
 */
const onFID = (onReport) => {
  const visibilityWatcher = getVisibilityWatcher.getVisibilityWatcher();
  const metric = initMetric.initMetric('FID');
  // eslint-disable-next-line prefer-const
  let report;

  const handleEntry = (entry) => {
    // Only report if the page wasn't hidden prior to the first input.
    if (entry.startTime < visibilityWatcher.firstHiddenTime) {
      metric.value = entry.processingStart - entry.startTime;
      metric.entries.push(entry);
      report(true);
    }
  };

  const handleEntries = (entries) => {
    (entries ).forEach(handleEntry);
  };

  const po = observe.observe('first-input', handleEntries);
  report = bindReporter.bindReporter(onReport, metric);

  if (po) {
    onHidden.onHidden(() => {
      handleEntries(po.takeRecords() );
      po.disconnect();
    }, true);
  }
};

exports.onFID = onFID;
//# sourceMappingURL=getFID.js.map
{"version":3,"file":"getFID.js","sources":["../../../../src/browser/web-vitals/getFID.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('FID');\n  // eslint-disable-next-line prefer-const\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntry = (entry: PerformanceEventTiming): void => {\n    // Only report if the page wasn't hidden prior to the first input.\n    if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n      metric.value = entry.processingStart - entry.startTime;\n      metric.entries.push(entry);\n      report(true);\n    }\n  };\n\n  const handleEntries = (entries: FIDMetric['entries']): void => {\n    (entries as PerformanceEventTiming[]).forEach(handleEntry);\n  };\n\n  const po = observe('first-input', handleEntries);\n  report = bindReporter(onReport, metric);\n\n  if (po) {\n    onHidden(() => {\n      handleEntries(po.takeRecords() as FIDMetric['entries']);\n      po.disconnect();\n    }, true);\n  }\n};\n"],"names":["getVisibilityWatcher","initMetric","observe","bindReporter","onHidden"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,iBAAA,GAAAA,yCAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAAC,qBAAA,CAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,CAAA;AACA;AACA,EAAA,MAAA,WAAA,GAAA,CAAA,KAAA,KAAA;AACA;AACA,IAAA,IAAA,KAAA,CAAA,SAAA,GAAA,iBAAA,CAAA,eAAA,EAAA;AACA,MAAA,MAAA,CAAA,KAAA,GAAA,KAAA,CAAA,eAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA,MAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,CAAA,OAAA,KAAA;AACA,IAAA,CAAA,OAAA,GAAA,OAAA,CAAA,WAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAAC,eAAA,CAAA,aAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAA,MAAA,GAAAC,yBAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAAC,iBAAA,CAAA,MAAA;AACA,MAAA,aAAA,CAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA;AACA,MAAA,EAAA,CAAA,UAAA,EAAA,CAAA;AACA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const bindReporter = require('./lib/bindReporter.js');
const getActivationStart = require('./lib/getActivationStart.js');
const getVisibilityWatcher = require('./lib/getVisibilityWatcher.js');
const initMetric = require('./lib/initMetric.js');
const observe = require('./lib/observe.js');
const onHidden = require('./lib/onHidden.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const reportedMetricIDs = {};

/**
 * Calculates the [LCP](https://web.dev/lcp/) value for the current page and
 * calls the `callback` function once the value is ready (along with the
 * relevant `largest-contentful-paint` performance entry used to determine the
 * value). The reported value is a `DOMHighResTimeStamp`.
 */
const onLCP = (onReport) => {
  const visibilityWatcher = getVisibilityWatcher.getVisibilityWatcher();
  const metric = initMetric.initMetric('LCP');
  let report;

  const handleEntries = (entries) => {
    const lastEntry = entries[entries.length - 1] ;
    if (lastEntry) {
      // The startTime attribute returns the value of the renderTime if it is
      // not 0, and the value of the loadTime otherwise. The activationStart
      // reference is used because LCP should be relative to page activation
      // rather than navigation start if the page was prerendered.
      const value = Math.max(lastEntry.startTime - getActivationStart.getActivationStart(), 0);

      // Only report if the page wasn't hidden prior to LCP.
      if (value < visibilityWatcher.firstHiddenTime) {
        metric.value = value;
        metric.entries = [lastEntry];
        report();
      }
    }
  };

  const po = observe.observe('largest-contentful-paint', handleEntries);

  if (po) {
    report = bindReporter.bindReporter(onReport, metric);

    const stopListening = () => {
      if (!reportedMetricIDs[metric.id]) {
        handleEntries(po.takeRecords() );
        po.disconnect();
        reportedMetricIDs[metric.id] = true;
        report(true);
      }
    };

    // Stop listening after input. Note: while scrolling is an input that
    // stop LCP observation, it's unreliable since it can be programmatically
    // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75
    ['keydown', 'click'].forEach(type => {
      addEventListener(type, stopListening, { once: true, capture: true });
    });

    onHidden.onHidden(stopListening, true);

    return stopListening;
  }

  return;
};

exports.onLCP = onLCP;
//# sourceMappingURL=getLCP.js.map
{"version":3,"file":"getLCP.js","sources":["../../../../src/browser/web-vitals/getLCP.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record<string, boolean> = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('LCP');\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntries = (entries: LCPMetric['entries']): void => {\n    const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n    if (lastEntry) {\n      // The startTime attribute returns the value of the renderTime if it is\n      // not 0, and the value of the loadTime otherwise. The activationStart\n      // reference is used because LCP should be relative to page activation\n      // rather than navigation start if the page was prerendered.\n      const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n      // Only report if the page wasn't hidden prior to LCP.\n      if (value < visibilityWatcher.firstHiddenTime) {\n        metric.value = value;\n        metric.entries = [lastEntry];\n        report();\n      }\n    }\n  };\n\n  const po = observe('largest-contentful-paint', handleEntries);\n\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      if (!reportedMetricIDs[metric.id]) {\n        handleEntries(po.takeRecords() as LCPMetric['entries']);\n        po.disconnect();\n        reportedMetricIDs[metric.id] = true;\n        report(true);\n      }\n    };\n\n    // Stop listening after input. Note: while scrolling is an input that\n    // stop LCP observation, it's unreliable since it can be programmatically\n    // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n    ['keydown', 'click'].forEach(type => {\n      addEventListener(type, stopListening, { once: true, capture: true });\n    });\n\n    onHidden(stopListening, true);\n\n    return stopListening;\n  }\n\n  return;\n};\n"],"names":["getVisibilityWatcher","initMetric","getActivationStart","observe","bindReporter","onHidden"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,MAAA,iBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,iBAAA,GAAAA,yCAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAAC,qBAAA,CAAA,KAAA,CAAA,CAAA;AACA,EAAA,IAAA,MAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,CAAA,OAAA,KAAA;AACA,IAAA,MAAA,SAAA,GAAA,OAAA,CAAA,OAAA,CAAA,MAAA,GAAA,CAAA,CAAA,EAAA;AACA,IAAA,IAAA,SAAA,EAAA;AACA;AACA;AACA;AACA;AACA,MAAA,MAAA,KAAA,GAAA,IAAA,CAAA,GAAA,CAAA,SAAA,CAAA,SAAA,GAAAC,qCAAA,EAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA,MAAA,IAAA,KAAA,GAAA,iBAAA,CAAA,eAAA,EAAA;AACA,QAAA,MAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AACA,QAAA,MAAA,CAAA,OAAA,GAAA,CAAA,SAAA,CAAA,CAAA;AACA,QAAA,MAAA,EAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAAC,eAAA,CAAA,0BAAA,EAAA,aAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAA,MAAA,GAAAC,yBAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,aAAA,GAAA,MAAA;AACA,MAAA,IAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA;AACA,QAAA,aAAA,CAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA;AACA,QAAA,EAAA,CAAA,UAAA,EAAA,CAAA;AACA,QAAA,iBAAA,CAAA,MAAA,CAAA,EAAA,CAAA,GAAA,IAAA,CAAA;AACA,QAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,CAAA,SAAA,EAAA,OAAA,CAAA,CAAA,OAAA,CAAA,IAAA,IAAA;AACA,MAAA,gBAAA,CAAA,IAAA,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAAC,iBAAA,CAAA,aAAA,EAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,aAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const bindReporter = (
  callback,
  metric,
  reportAllChanges,
) => {
  let prevValue;
  let delta;
  return (forceReport) => {
    if (metric.value >= 0) {
      if (forceReport || reportAllChanges) {
        delta = metric.value - (prevValue || 0);

        // Report the metric if there's a non-zero delta or if no previous
        // value exists (which can happen in the case of the document becoming
        // hidden when the metric value is 0).
        // See: https://github.com/GoogleChrome/web-vitals/issues/14
        if (delta || prevValue === undefined) {
          prevValue = metric.value;
          metric.delta = delta;
          callback(metric);
        }
      }
    }
  };
};

exports.bindReporter = bindReporter;
//# sourceMappingURL=bindReporter.js.map
{"version":3,"file":"bindReporter.js","sources":["../../../../../src/browser/web-vitals/lib/bindReporter.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n  callback: ReportCallback,\n  metric: Metric,\n  reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n  let prevValue: number;\n  let delta: number;\n  return (forceReport?: boolean) => {\n    if (metric.value >= 0) {\n      if (forceReport || reportAllChanges) {\n        delta = metric.value - (prevValue || 0);\n\n        // Report the metric if there's a non-zero delta or if no previous\n        // value exists (which can happen in the case of the document becoming\n        // hidden when the metric value is 0).\n        // See: https://github.com/GoogleChrome/web-vitals/issues/14\n        if (delta || prevValue === undefined) {\n          prevValue = metric.value;\n          metric.delta = delta;\n          callback(metric);\n        }\n      }\n    }\n  };\n};\n"],"names":[],"mappings":";;AAkBA,MAAA,YAAA,GAAA;AACA,EAAA,QAAA;AACA,EAAA,MAAA;AACA,EAAA,gBAAA;AACA,KAAA;AACA,EAAA,IAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,CAAA;AACA,EAAA,OAAA,CAAA,WAAA,KAAA;AACA,IAAA,IAAA,MAAA,CAAA,KAAA,IAAA,CAAA,EAAA;AACA,MAAA,IAAA,WAAA,IAAA,gBAAA,EAAA;AACA,QAAA,KAAA,GAAA,MAAA,CAAA,KAAA,IAAA,SAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,QAAA,IAAA,KAAA,IAAA,SAAA,KAAA,SAAA,EAAA;AACA,UAAA,SAAA,GAAA,MAAA,CAAA,KAAA,CAAA;AACA,UAAA,MAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AACA,UAAA,QAAA,CAAA,MAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Performantly generate a unique, 30-char string by combining a version
 * number, the current timestamp with a 13-digit number integer.
 * @return {string}
 */
const generateUniqueID = () => {
  return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;
};

exports.generateUniqueID = generateUniqueID;
//# sourceMappingURL=generateUniqueID.js.map
{"version":3,"file":"generateUniqueID.js","sources":["../../../../../src/browser/web-vitals/lib/generateUniqueID.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n  return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,MAAA;AACA,EAAA,OAAA,CAAA,GAAA,EAAA,IAAA,CAAA,GAAA,EAAA,CAAA,CAAA,EAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,EAAA,IAAA,IAAA,GAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const getNavigationEntry = require('./getNavigationEntry.js');

/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const getActivationStart = () => {
  const navEntry = getNavigationEntry.getNavigationEntry();
  return (navEntry && navEntry.activationStart) || 0;
};

exports.getActivationStart = getActivationStart;
//# sourceMappingURL=getActivationStart.js.map
{"version":3,"file":"getActivationStart.js","sources":["../../../../../src/browser/web-vitals/lib/getActivationStart.ts"],"sourcesContent":["/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n  const navEntry = getNavigationEntry();\n  return (navEntry && navEntry.activationStart) || 0;\n};\n"],"names":["getNavigationEntry"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA,MAAA,kBAAA,GAAA,MAAA;AACA,EAAA,MAAA,QAAA,GAAAA,qCAAA,EAAA,CAAA;AACA,EAAA,OAAA,CAAA,QAAA,IAAA,QAAA,CAAA,eAAA,KAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const types = require('../../types.js');

/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const getNavigationEntryFromPerformanceTiming = () => {
  // eslint-disable-next-line deprecation/deprecation
  const timing = types.WINDOW.performance.timing;
  // eslint-disable-next-line deprecation/deprecation
  const type = types.WINDOW.performance.navigation.type;

  const navigationEntry = {
    entryType: 'navigation',
    startTime: 0,
    type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',
  };

  for (const key in timing) {
    if (key !== 'navigationStart' && key !== 'toJSON') {
      navigationEntry[key] = Math.max((timing[key ] ) - timing.navigationStart, 0);
    }
  }
  return navigationEntry ;
};

const getNavigationEntry = () => {
  if (types.WINDOW.__WEB_VITALS_POLYFILL__) {
    return (
      types.WINDOW.performance &&
      ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||
        getNavigationEntryFromPerformanceTiming())
    );
  } else {
    return types.WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];
  }
};

exports.getNavigationEntry = getNavigationEntry;
//# sourceMappingURL=getNavigationEntry.js.map
{"version":3,"file":"getNavigationEntry.js","sources":["../../../../../src/browser/web-vitals/lib/getNavigationEntry.ts"],"sourcesContent":["/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n  // eslint-disable-next-line deprecation/deprecation\n  const timing = WINDOW.performance.timing;\n  // eslint-disable-next-line deprecation/deprecation\n  const type = WINDOW.performance.navigation.type;\n\n  const navigationEntry: { [key: string]: number | string } = {\n    entryType: 'navigation',\n    startTime: 0,\n    type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n  };\n\n  for (const key in timing) {\n    if (key !== 'navigationStart' && key !== 'toJSON') {\n      navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n    }\n  }\n  return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n  if (WINDOW.__WEB_VITALS_POLYFILL__) {\n    return (\n      WINDOW.performance &&\n      ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n        getNavigationEntryFromPerformanceTiming())\n    );\n  } else {\n    return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n  }\n};\n"],"names":["WINDOW"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAA,uCAAA,GAAA,MAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAAA,YAAA,CAAA,WAAA,CAAA,MAAA,CAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAAA,YAAA,CAAA,WAAA,CAAA,UAAA,CAAA,IAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA;AACA,IAAA,SAAA,EAAA,YAAA;AACA,IAAA,SAAA,EAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA,IAAA,CAAA,GAAA,cAAA,GAAA,IAAA,KAAA,CAAA,GAAA,QAAA,GAAA,UAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,KAAA,MAAA,GAAA,IAAA,MAAA,EAAA;AACA,IAAA,IAAA,GAAA,KAAA,iBAAA,IAAA,GAAA,KAAA,QAAA,EAAA;AACA,MAAA,eAAA,CAAA,GAAA,CAAA,GAAA,IAAA,CAAA,GAAA,CAAA,CAAA,MAAA,CAAA,GAAA,EAAA,KAAA,MAAA,CAAA,eAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,eAAA,EAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,kBAAA,GAAA,MAAA;AACA,EAAA,IAAAA,YAAA,CAAA,uBAAA,EAAA;AACA,IAAA;AACA,MAAAA,YAAA,CAAA,WAAA;AACA,OAAA,CAAA,WAAA,CAAA,gBAAA,IAAA,WAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,uCAAA,EAAA,CAAA;AACA,MAAA;AACA,GAAA,MAAA;AACA,IAAA,OAAAA,YAAA,CAAA,WAAA,IAAA,WAAA,CAAA,gBAAA,IAAA,WAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const types = require('../../types.js');
const onHidden = require('./onHidden.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

let firstHiddenTime = -1;

const initHiddenTime = () => {
  // If the document is hidden and not prerendering, assume it was always
  // hidden and the page was loaded in the background.
  return types.WINDOW.document.visibilityState === 'hidden' && !types.WINDOW.document.prerendering ? 0 : Infinity;
};

const trackChanges = () => {
  // Update the time if/when the document becomes hidden.
  onHidden.onHidden(({ timeStamp }) => {
    firstHiddenTime = timeStamp;
  }, true);
};

const getVisibilityWatcher = (

) => {
  if (firstHiddenTime < 0) {
    // If the document is hidden when this code runs, assume it was hidden
    // since navigation start. This isn't a perfect heuristic, but it's the
    // best we can do until an API is available to support querying past
    // visibilityState.
    firstHiddenTime = initHiddenTime();
    trackChanges();
  }
  return {
    get firstHiddenTime() {
      return firstHiddenTime;
    },
  };
};

exports.getVisibilityWatcher = getVisibilityWatcher;
//# sourceMappingURL=getVisibilityWatcher.js.map
{"version":3,"file":"getVisibilityWatcher.js","sources":["../../../../../src/browser/web-vitals/lib/getVisibilityWatcher.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): number => {\n  // If the document is hidden and not prerendering, assume it was always\n  // hidden and the page was loaded in the background.\n  return WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n};\n\nconst trackChanges = (): void => {\n  // Update the time if/when the document becomes hidden.\n  onHidden(({ timeStamp }) => {\n    firstHiddenTime = timeStamp;\n  }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n  readonly firstHiddenTime: number;\n} => {\n  if (firstHiddenTime < 0) {\n    // If the document is hidden when this code runs, assume it was hidden\n    // since navigation start. This isn't a perfect heuristic, but it's the\n    // best we can do until an API is available to support querying past\n    // visibilityState.\n    firstHiddenTime = initHiddenTime();\n    trackChanges();\n  }\n  return {\n    get firstHiddenTime() {\n      return firstHiddenTime;\n    },\n  };\n};\n"],"names":["WINDOW","onHidden"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA,IAAA,eAAA,GAAA,CAAA,CAAA,CAAA;AACA;AACA,MAAA,cAAA,GAAA,MAAA;AACA;AACA;AACA,EAAA,OAAAA,YAAA,CAAA,QAAA,CAAA,eAAA,KAAA,QAAA,IAAA,CAAAA,YAAA,CAAA,QAAA,CAAA,YAAA,GAAA,CAAA,GAAA,QAAA,CAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,YAAA,GAAA,MAAA;AACA;AACA,EAAAC,iBAAA,CAAA,CAAA,EAAA,SAAA,EAAA,KAAA;AACA,IAAA,eAAA,GAAA,SAAA,CAAA;AACA,GAAA,EAAA,IAAA,CAAA,CAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,oBAAA,GAAA;AACA;AACA,KAAA;AACA,EAAA,IAAA,eAAA,GAAA,CAAA,EAAA;AACA;AACA;AACA;AACA;AACA,IAAA,eAAA,GAAA,cAAA,EAAA,CAAA;AACA,IAAA,YAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,eAAA,GAAA;AACA,MAAA,OAAA,eAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const types = require('../../types.js');
const generateUniqueID = require('./generateUniqueID.js');
const getActivationStart = require('./getActivationStart.js');
const getNavigationEntry = require('./getNavigationEntry.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const initMetric = (name, value) => {
  const navEntry = getNavigationEntry.getNavigationEntry();
  let navigationType = 'navigate';

  if (navEntry) {
    if (types.WINDOW.document.prerendering || getActivationStart.getActivationStart() > 0) {
      navigationType = 'prerender';
    } else {
      navigationType = navEntry.type.replace(/_/g, '-') ;
    }
  }

  return {
    name,
    value: typeof value === 'undefined' ? -1 : value,
    rating: 'good', // Will be updated if the value changes.
    delta: 0,
    entries: [],
    id: generateUniqueID.generateUniqueID(),
    navigationType,
  };
};

exports.initMetric = initMetric;
//# sourceMappingURL=initMetric.js.map
{"version":3,"file":"initMetric.js","sources":["../../../../../src/browser/web-vitals/lib/initMetric.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n  const navEntry = getNavigationEntry();\n  let navigationType: Metric['navigationType'] = 'navigate';\n\n  if (navEntry) {\n    if (WINDOW.document.prerendering || getActivationStart() > 0) {\n      navigationType = 'prerender';\n    } else {\n      navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n    }\n  }\n\n  return {\n    name,\n    value: typeof value === 'undefined' ? -1 : value,\n    rating: 'good', // Will be updated if the value changes.\n    delta: 0,\n    entries: [],\n    id: generateUniqueID(),\n    navigationType,\n  };\n};\n"],"names":["getNavigationEntry","WINDOW","getActivationStart","generateUniqueID"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA,MAAA,UAAA,GAAA,CAAA,IAAA,EAAA,KAAA,KAAA;AACA,EAAA,MAAA,QAAA,GAAAA,qCAAA,EAAA,CAAA;AACA,EAAA,IAAA,cAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,EAAA;AACA,IAAA,IAAAC,YAAA,CAAA,QAAA,CAAA,YAAA,IAAAC,qCAAA,EAAA,GAAA,CAAA,EAAA;AACA,MAAA,cAAA,GAAA,WAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,cAAA,GAAA,QAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,EAAA,GAAA,CAAA,EAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,IAAA;AACA,IAAA,KAAA,EAAA,OAAA,KAAA,KAAA,WAAA,GAAA,CAAA,CAAA,GAAA,KAAA;AACA,IAAA,MAAA,EAAA,MAAA;AACA,IAAA,KAAA,EAAA,CAAA;AACA,IAAA,OAAA,EAAA,EAAA;AACA,IAAA,EAAA,EAAAC,iCAAA,EAAA;AACA,IAAA,cAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Takes a performance entry type and a callback function, and creates a
 * `PerformanceObserver` instance that will observe the specified entry type
 * with buffering enabled and call the callback _for each entry_.
 *
 * This function also feature-detects entry support and wraps the logic in a
 * try/catch to avoid errors in unsupporting browsers.
 */
const observe = (
  type,
  callback,
  opts,
) => {
  try {
    if (PerformanceObserver.supportedEntryTypes.includes(type)) {
      const po = new PerformanceObserver(list => {
        callback(list.getEntries() );
      });
      po.observe(
        Object.assign(
          {
            type,
            buffered: true,
          },
          opts || {},
        ) ,
      );
      return po;
    }
  } catch (e) {
    // Do nothing.
  }
  return;
};

exports.observe = observe;
//# sourceMappingURL=observe.js.map
{"version":3,"file":"observe.js","sources":["../../../../../src/browser/web-vitals/lib/observe.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n  (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n  event: PerformanceEventTiming[];\n  paint: PerformancePaintTiming[];\n  'layout-shift': LayoutShift[];\n  'largest-contentful-paint': LargestContentfulPaint[];\n  'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n  navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n  resource: PerformanceResourceTiming[];\n  longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = <K extends keyof PerformanceEntryMap>(\n  type: K,\n  callback: (entries: PerformanceEntryMap[K]) => void,\n  opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n  try {\n    if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n      const po = new PerformanceObserver(list => {\n        callback(list.getEntries() as PerformanceEntryMap[K]);\n      });\n      po.observe(\n        Object.assign(\n          {\n            type,\n            buffered: true,\n          },\n          opts || {},\n        ) as PerformanceObserverInit,\n      );\n      return po;\n    }\n  } catch (e) {\n    // Do nothing.\n  }\n  return;\n};\n"],"names":[],"mappings":";;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,OAAA,GAAA;AACA,EAAA,IAAA;AACA,EAAA,QAAA;AACA,EAAA,IAAA;AACA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,mBAAA,CAAA,mBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,EAAA;AACA,MAAA,MAAA,EAAA,GAAA,IAAA,mBAAA,CAAA,IAAA,IAAA;AACA,QAAA,QAAA,CAAA,IAAA,CAAA,UAAA,EAAA,EAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,MAAA,EAAA,CAAA,OAAA;AACA,QAAA,MAAA,CAAA,MAAA;AACA,UAAA;AACA,YAAA,IAAA;AACA,YAAA,QAAA,EAAA,IAAA;AACA,WAAA;AACA,UAAA,IAAA,IAAA,EAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,MAAA,OAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA,EAAA,OAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const types = require('../../types.js');

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const onHidden = (cb, once) => {
  const onHiddenOrPageHide = (event) => {
    if (event.type === 'pagehide' || types.WINDOW.document.visibilityState === 'hidden') {
      cb(event);
      if (once) {
        removeEventListener('visibilitychange', onHiddenOrPageHide, true);
        removeEventListener('pagehide', onHiddenOrPageHide, true);
      }
    }
  };
  addEventListener('visibilitychange', onHiddenOrPageHide, true);
  // Some browsers have buggy implementations of visibilitychange,
  // so we use pagehide in addition, just to be safe.
  addEventListener('pagehide', onHiddenOrPageHide, true);
};

exports.onHidden = onHidden;
//# sourceMappingURL=onHidden.js.map
{"version":3,"file":"onHidden.js","sources":["../../../../../src/browser/web-vitals/lib/onHidden.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n  (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n  const onHiddenOrPageHide = (event: Event): void => {\n    if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n      cb(event);\n      if (once) {\n        removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n        removeEventListener('pagehide', onHiddenOrPageHide, true);\n      }\n    }\n  };\n  addEventListener('visibilitychange', onHiddenOrPageHide, true);\n  // Some browsers have buggy implementations of visibilitychange,\n  // so we use pagehide in addition, just to be safe.\n  addEventListener('pagehide', onHiddenOrPageHide, true);\n};\n"],"names":["WINDOW"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,MAAA,QAAA,GAAA,CAAA,EAAA,EAAA,IAAA,KAAA;AACA,EAAA,MAAA,kBAAA,GAAA,CAAA,KAAA,KAAA;AACA,IAAA,IAAA,KAAA,CAAA,IAAA,KAAA,UAAA,IAAAA,YAAA,CAAA,QAAA,CAAA,eAAA,KAAA,QAAA,EAAA;AACA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,IAAA,IAAA,EAAA;AACA,QAAA,mBAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA,QAAA,mBAAA,CAAA,UAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,gBAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,gBAAA,CAAA,UAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

/**
 * @private
 */
function _autoloadDatabaseIntegrations() {
  const carrier = core.getMainCarrier();
  if (!carrier.__SENTRY__) {
    return;
  }

  const packageToIntegrationMapping = {
    mongodb() {
      const integration = utils.dynamicRequire(module, './node/integrations/mongo')

;
      return new integration.Mongo();
    },
    mongoose() {
      const integration = utils.dynamicRequire(module, './node/integrations/mongo')

;
      return new integration.Mongo({ mongoose: true });
    },
    mysql() {
      const integration = utils.dynamicRequire(module, './node/integrations/mysql')

;
      return new integration.Mysql();
    },
    pg() {
      const integration = utils.dynamicRequire(module, './node/integrations/postgres')

;
      return new integration.Postgres();
    },
  };

  const mappedPackages = Object.keys(packageToIntegrationMapping)
    .filter(moduleName => !!utils.loadModule(moduleName))
    .map(pkg => {
      try {
        return packageToIntegrationMapping[pkg]();
      } catch (e) {
        return undefined;
      }
    })
    .filter(p => p) ;

  if (mappedPackages.length > 0) {
    carrier.__SENTRY__.integrations = [...(carrier.__SENTRY__.integrations || []), ...mappedPackages];
  }
}

/**
 * This patches the global object and injects the Tracing extensions methods
 */
function addExtensionMethods() {
  core.addTracingExtensions();

  // Detect and automatically load specified integrations.
  if (utils.isNodeEnv()) {
    _autoloadDatabaseIntegrations();
  }
}

exports.addExtensionMethods = addExtensionMethods;
//# sourceMappingURL=extensions.js.map
{"version":3,"file":"extensions.js","sources":["../../src/extensions.ts"],"sourcesContent":["import { addTracingExtensions, getMainCarrier } from '@sentry/core';\nimport type { Integration, IntegrationClass } from '@sentry/types';\nimport { dynamicRequire, isNodeEnv, loadModule } from '@sentry/utils';\n\n/**\n * @private\n */\nfunction _autoloadDatabaseIntegrations(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    return;\n  }\n\n  const packageToIntegrationMapping: Record<string, () => Integration> = {\n    mongodb() {\n      const integration = dynamicRequire(module, './node/integrations/mongo') as {\n        Mongo: IntegrationClass<Integration>;\n      };\n      return new integration.Mongo();\n    },\n    mongoose() {\n      const integration = dynamicRequire(module, './node/integrations/mongo') as {\n        Mongo: IntegrationClass<Integration>;\n      };\n      return new integration.Mongo({ mongoose: true });\n    },\n    mysql() {\n      const integration = dynamicRequire(module, './node/integrations/mysql') as {\n        Mysql: IntegrationClass<Integration>;\n      };\n      return new integration.Mysql();\n    },\n    pg() {\n      const integration = dynamicRequire(module, './node/integrations/postgres') as {\n        Postgres: IntegrationClass<Integration>;\n      };\n      return new integration.Postgres();\n    },\n  };\n\n  const mappedPackages = Object.keys(packageToIntegrationMapping)\n    .filter(moduleName => !!loadModule(moduleName))\n    .map(pkg => {\n      try {\n        return packageToIntegrationMapping[pkg]();\n      } catch (e) {\n        return undefined;\n      }\n    })\n    .filter(p => p) as Integration[];\n\n  if (mappedPackages.length > 0) {\n    carrier.__SENTRY__.integrations = [...(carrier.__SENTRY__.integrations || []), ...mappedPackages];\n  }\n}\n\n/**\n * This patches the global object and injects the Tracing extensions methods\n */\nexport function addExtensionMethods(): void {\n  addTracingExtensions();\n\n  // Detect and automatically load specified integrations.\n  if (isNodeEnv()) {\n    _autoloadDatabaseIntegrations();\n  }\n}\n"],"names":["getMainCarrier","dynamicRequire","loadModule","addTracingExtensions","isNodeEnv"],"mappings":";;;;;AAIA;AACA;AACA;AACA,SAAA,6BAAA,GAAA;AACA,EAAA,MAAA,OAAA,GAAAA,mBAAA,EAAA,CAAA;AACA,EAAA,IAAA,CAAA,OAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,2BAAA,GAAA;AACA,IAAA,OAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAAC,oBAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,QAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,KAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,EAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,8BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,QAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,cAAA,GAAA,MAAA,CAAA,IAAA,CAAA,2BAAA,CAAA;AACA,KAAA,MAAA,CAAA,UAAA,IAAA,CAAA,CAAAC,gBAAA,CAAA,UAAA,CAAA,CAAA;AACA,KAAA,GAAA,CAAA,GAAA,IAAA;AACA,MAAA,IAAA;AACA,QAAA,OAAA,2BAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,KAAA,MAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA,EAAA,IAAA,cAAA,CAAA,MAAA,GAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,YAAA,GAAA,CAAA,IAAA,OAAA,CAAA,UAAA,CAAA,YAAA,IAAA,EAAA,CAAA,EAAA,GAAA,cAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,GAAA;AACA,EAAAC,yBAAA,EAAA,CAAA;AACA;AACA;AACA,EAAA,IAAAC,eAAA,EAAA,EAAA;AACA,IAAA,6BAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const express = require('./node/integrations/express.js');
const postgres = require('./node/integrations/postgres.js');
const mysql = require('./node/integrations/mysql.js');
const mongo = require('./node/integrations/mongo.js');
const prisma = require('./node/integrations/prisma.js');
const graphql = require('./node/integrations/graphql.js');
const apollo = require('./node/integrations/apollo.js');
const lazy = require('./node/integrations/lazy.js');
const browsertracing = require('./browser/browsertracing.js');
const request = require('./browser/request.js');
const extensions = require('./extensions.js');



exports.IdleTransaction = core.IdleTransaction;
exports.Span = core.Span;
exports.SpanStatus = core.SpanStatus;
exports.Transaction = core.Transaction;
exports.extractTraceparentData = core.extractTraceparentData;
exports.getActiveTransaction = core.getActiveTransaction;
exports.hasTracingEnabled = core.hasTracingEnabled;
exports.spanStatusfromHttpCode = core.spanStatusfromHttpCode;
exports.startIdleTransaction = core.startIdleTransaction;
exports.TRACEPARENT_REGEXP = utils.TRACEPARENT_REGEXP;
exports.stripUrlQueryAndFragment = utils.stripUrlQueryAndFragment;
exports.Express = express.Express;
exports.Postgres = postgres.Postgres;
exports.Mysql = mysql.Mysql;
exports.Mongo = mongo.Mongo;
exports.Prisma = prisma.Prisma;
exports.GraphQL = graphql.GraphQL;
exports.Apollo = apollo.Apollo;
exports.lazyLoadedNodePerformanceMonitoringIntegrations = lazy.lazyLoadedNodePerformanceMonitoringIntegrations;
exports.BROWSER_TRACING_INTEGRATION_ID = browsertracing.BROWSER_TRACING_INTEGRATION_ID;
exports.BrowserTracing = browsertracing.BrowserTracing;
exports.addTracingHeadersToFetchRequest = request.addTracingHeadersToFetchRequest;
exports.defaultRequestInstrumentationOptions = request.defaultRequestInstrumentationOptions;
exports.instrumentOutgoingRequests = request.instrumentOutgoingRequests;
exports.addExtensionMethods = extensions.addExtensionMethods;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

/** Tracing integration for Apollo */
class Apollo  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Apollo';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Apollo.id;}

  /**
   * @inheritDoc
   */
   constructor(
    options = {
      useNestjs: false,
    },
  ) {Apollo.prototype.__init.call(this);
    this._useNest = !!options.useNestjs;
  }

  /** @inheritdoc */
   loadDependency() {
    if (this._useNest) {
      this._module = this._module || utils.loadModule('@nestjs/graphql');
    } else {
      this._module = this._module || utils.loadModule('apollo-server-core');
    }

    return this._module;
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Apollo Integration is skipped because of instrumenter configuration.');
      return;
    }

    if (this._useNest) {
      const pkg = this.loadDependency();

      if (!pkg) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.');
        return;
      }

      /**
       * Iterate over resolvers of NestJS ResolversExplorerService before schemas are constructed.
       */
      utils.fill(
        pkg.GraphQLFactory.prototype,
        'mergeWithSchema',
        function (orig) {
          return function (

            ...args
          ) {
            utils.fill(this.resolversExplorerService, 'explore', function (orig) {
              return function () {
                const resolvers = utils.arrayify(orig.call(this));

                const instrumentedResolvers = instrumentResolvers(resolvers, getCurrentHub);

                return instrumentedResolvers;
              };
            });

            return orig.call(this, ...args);
          };
        },
      );
    } else {
      const pkg = this.loadDependency();

      if (!pkg) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Apollo Integration was unable to require apollo-server-core package.');
        return;
      }

      /**
       * Iterate over resolvers of the ApolloServer instance before schemas are constructed.
       */
      utils.fill(pkg.ApolloServerBase.prototype, 'constructSchema', function (orig) {
        return function (

) {
          if (!this.config.resolvers) {
            if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
              if (this.config.schema) {
                utils.logger.warn(
                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.' +
                    'If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead.',
                );
                utils.logger.warn();
              } else if (this.config.modules) {
                utils.logger.warn(
                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property.',
                );
              }

              utils.logger.error('Skipping tracing as no resolvers found on the `ApolloServer` instance.');
            }

            return orig.call(this);
          }

          const resolvers = utils.arrayify(this.config.resolvers);

          this.config.resolvers = instrumentResolvers(resolvers, getCurrentHub);

          return orig.call(this);
        };
      });
    }
  }
}Apollo.__initStatic();

function instrumentResolvers(resolvers, getCurrentHub) {
  return resolvers.map(model => {
    Object.keys(model).forEach(resolverGroupName => {
      Object.keys(model[resolverGroupName]).forEach(resolverName => {
        if (typeof model[resolverGroupName][resolverName] !== 'function') {
          return;
        }

        wrapResolver(model, resolverGroupName, resolverName, getCurrentHub);
      });
    });

    return model;
  });
}

/**
 * Wrap a single resolver which can be a parent of other resolvers and/or db operations.
 */
function wrapResolver(
  model,
  resolverGroupName,
  resolverName,
  getCurrentHub,
) {
  utils.fill(model[resolverGroupName], resolverName, function (orig) {
    return function ( ...args) {
      const scope = getCurrentHub().getScope();
      const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
      const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
        description: `${resolverGroupName}.${resolverName}`,
        op: 'graphql.resolve',
      })]);

      const rv = orig.call(this, ...args);

      if (utils.isThenable(rv)) {
        return rv.then((res) => {
          _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
          return res;
        });
      }

      _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);

      return rv;
    };
  });
}

exports.Apollo = Apollo;
//# sourceMappingURL=apollo.js.map
{"version":3,"file":"apollo.js","sources":["../../../../src/node/integrations/apollo.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { arrayify, fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface ApolloOptions {\n  useNestjs?: boolean;\n}\n\ntype ApolloResolverGroup = {\n  [key: string]: () => unknown;\n};\n\ntype ApolloModelResolvers = {\n  [key: string]: ApolloResolverGroup;\n};\n\ntype GraphQLModule = {\n  GraphQLFactory: {\n    prototype: {\n      create: (resolvers: ApolloModelResolvers[]) => unknown;\n    };\n  };\n};\n\ntype ApolloModule = {\n  ApolloServerBase: {\n    prototype: {\n      constructSchema: (config: unknown) => unknown;\n    };\n  };\n};\n\n/** Tracing integration for Apollo */\nexport class Apollo implements LazyLoadedIntegration<GraphQLModule & ApolloModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Apollo';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Apollo.id;\n\n  private readonly _useNest: boolean;\n\n  private _module?: GraphQLModule & ApolloModule;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(\n    options: ApolloOptions = {\n      useNestjs: false,\n    },\n  ) {\n    this._useNest = !!options.useNestjs;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): (GraphQLModule & ApolloModule) | undefined {\n    if (this._useNest) {\n      this._module = this._module || loadModule('@nestjs/graphql');\n    } else {\n      this._module = this._module || loadModule('apollo-server-core');\n    }\n\n    return this._module;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Apollo Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    if (this._useNest) {\n      const pkg = this.loadDependency();\n\n      if (!pkg) {\n        __DEBUG_BUILD__ && logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.');\n        return;\n      }\n\n      /**\n       * Iterate over resolvers of NestJS ResolversExplorerService before schemas are constructed.\n       */\n      fill(\n        pkg.GraphQLFactory.prototype,\n        'mergeWithSchema',\n        function (orig: (this: unknown, ...args: unknown[]) => unknown) {\n          return function (\n            this: { resolversExplorerService: { explore: () => ApolloModelResolvers[] } },\n            ...args: unknown[]\n          ) {\n            fill(this.resolversExplorerService, 'explore', function (orig: () => ApolloModelResolvers[]) {\n              return function (this: unknown) {\n                const resolvers = arrayify(orig.call(this));\n\n                const instrumentedResolvers = instrumentResolvers(resolvers, getCurrentHub);\n\n                return instrumentedResolvers;\n              };\n            });\n\n            return orig.call(this, ...args);\n          };\n        },\n      );\n    } else {\n      const pkg = this.loadDependency();\n\n      if (!pkg) {\n        __DEBUG_BUILD__ && logger.error('Apollo Integration was unable to require apollo-server-core package.');\n        return;\n      }\n\n      /**\n       * Iterate over resolvers of the ApolloServer instance before schemas are constructed.\n       */\n      fill(pkg.ApolloServerBase.prototype, 'constructSchema', function (orig: (config: unknown) => unknown) {\n        return function (this: {\n          config: { resolvers?: ApolloModelResolvers[]; schema?: unknown; modules?: unknown };\n        }) {\n          if (!this.config.resolvers) {\n            if (__DEBUG_BUILD__) {\n              if (this.config.schema) {\n                logger.warn(\n                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.' +\n                    'If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead.',\n                );\n                logger.warn();\n              } else if (this.config.modules) {\n                logger.warn(\n                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property.',\n                );\n              }\n\n              logger.error('Skipping tracing as no resolvers found on the `ApolloServer` instance.');\n            }\n\n            return orig.call(this);\n          }\n\n          const resolvers = arrayify(this.config.resolvers);\n\n          this.config.resolvers = instrumentResolvers(resolvers, getCurrentHub);\n\n          return orig.call(this);\n        };\n      });\n    }\n  }\n}\n\nfunction instrumentResolvers(resolvers: ApolloModelResolvers[], getCurrentHub: () => Hub): ApolloModelResolvers[] {\n  return resolvers.map(model => {\n    Object.keys(model).forEach(resolverGroupName => {\n      Object.keys(model[resolverGroupName]).forEach(resolverName => {\n        if (typeof model[resolverGroupName][resolverName] !== 'function') {\n          return;\n        }\n\n        wrapResolver(model, resolverGroupName, resolverName, getCurrentHub);\n      });\n    });\n\n    return model;\n  });\n}\n\n/**\n * Wrap a single resolver which can be a parent of other resolvers and/or db operations.\n */\nfunction wrapResolver(\n  model: ApolloModelResolvers,\n  resolverGroupName: string,\n  resolverName: string,\n  getCurrentHub: () => Hub,\n): void {\n  fill(model[resolverGroupName], resolverName, function (orig: () => unknown | Promise<unknown>) {\n    return function (this: unknown, ...args: unknown[]) {\n      const scope = getCurrentHub().getScope();\n      const parentSpan = scope?.getSpan();\n      const span = parentSpan?.startChild({\n        description: `${resolverGroupName}.${resolverName}`,\n        op: 'graphql.resolve',\n      });\n\n      const rv = orig.call(this, ...args);\n\n      if (isThenable(rv)) {\n        return rv.then((res: unknown) => {\n          span?.finish();\n          return res;\n        });\n      }\n\n      span?.finish();\n\n      return rv;\n    };\n  });\n}\n"],"names":["loadModule","shouldDisableAutoInstrumentation","logger","fill","arrayify","isThenable"],"mappings":";;;;;;;;;AAmCA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,QAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;EAEA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;EAMA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,QAAA,EA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;UACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA;QACA,CAAA,CAAA;MACA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA;IACA,CAAA;EACA,CAAA,CAAA;AACA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

/**
 * Express integration
 *
 * Provides an request and error handler for Express framework as well as tracing capabilities
 */
class Express  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Express';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Express.id;}

  /**
   * Express App instance
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Express.prototype.__init.call(this);
    this._router = options.router || options.app;
    this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (!this._router) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('ExpressIntegration is missing an Express instance');
      return;
    }

    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Express Integration is skipped because of instrumenter configuration.');
      return;
    }

    instrumentMiddlewares(this._router, this._methods);
    instrumentRouter(this._router );
  }
}Express.__initStatic();

/**
 * Wraps original middleware function in a tracing call, which stores the info about the call as a span,
 * and finishes it once the middleware is done invoking.
 *
 * Express middlewares have 3 various forms, thus we have to take care of all of them:
 * // sync
 * app.use(function (req, res) { ... })
 * // async
 * app.use(function (req, res, next) { ... })
 * // error handler
 * app.use(function (err, req, res, next) { ... })
 *
 * They all internally delegate to the `router[method]` of the given application instance.
 */
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
function wrap(fn, method) {
  const arity = fn.length;

  switch (arity) {
    case 2: {
      return function ( req, res) {
        const transaction = res.__sentry_transaction;
        if (transaction) {
          const span = transaction.startChild({
            description: fn.name,
            op: `middleware.express.${method}`,
          });
          res.once('finish', () => {
            span.finish();
          });
        }
        return fn.call(this, req, res);
      };
    }
    case 3: {
      return function (

        req,
        res,
        next,
      ) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, 'optionalAccess', _2 => _2.startChild, 'call', _3 => _3({
          description: fn.name,
          op: `middleware.express.${method}`,
        })]);
        fn.call(this, req, res, function ( ...args) {
          _optionalChain([span, 'optionalAccess', _4 => _4.finish, 'call', _5 => _5()]);
          next.call(this, ...args);
        });
      };
    }
    case 4: {
      return function (

        err,
        req,
        res,
        next,
      ) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
          description: fn.name,
          op: `middleware.express.${method}`,
        })]);
        fn.call(this, err, req, res, function ( ...args) {
          _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
          next.call(this, ...args);
        });
      };
    }
    default: {
      throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);
    }
  }
}

/**
 * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`
 * and wraps every function, as well as array of functions with a call to our `wrap` method.
 * We have to take care of the arrays as well as iterate over all of the arguments,
 * as `app.use` can accept middlewares in few various forms.
 *
 * app.use([<path>], <fn>)
 * app.use([<path>], <fn>, ...<fn>)
 * app.use([<path>], ...<fn>[])
 */
function wrapMiddlewareArgs(args, method) {
  return args.map((arg) => {
    if (typeof arg === 'function') {
      return wrap(arg, method);
    }

    if (Array.isArray(arg)) {
      return arg.map((a) => {
        if (typeof a === 'function') {
          return wrap(a, method);
        }
        return a;
      });
    }

    return arg;
  });
}

/**
 * Patches original router to utilize our tracing functionality
 */
function patchMiddleware(router, method) {
  const originalCallback = router[method];

  router[method] = function (...args) {
    return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));
  };

  return router;
}

/**
 * Patches original router methods
 */
function instrumentMiddlewares(router, methods = []) {
  methods.forEach((method) => patchMiddleware(router, method));
}

/**
 * Patches the prototype of Express.Router to accumulate the resolved route
 * if a layer instance's `match` function was called and it returned a successful match.
 *
 * @see https://github.com/expressjs/express/blob/master/lib/router/index.js
 *
 * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.
 */
function instrumentRouter(appOrRouter) {
  // This is how we can distinguish between app and routers
  const isApp = 'settings' in appOrRouter;

  // In case the app's top-level router hasn't been initialized yet, we have to do it now
  if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {
    appOrRouter.lazyrouter();
  }

  const router = isApp ? appOrRouter._router : appOrRouter;

  if (!router) {
    /*
    If we end up here, this means likely that this integration is used with Express 3 or Express 5.
    For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,
    we'd need to make more changes to the routing instrumentation because the router is no longer part of
    the Express core package but maintained in its own package. The new router has different function
    signatures and works slightly differently, demanding more changes than just taking the router from
    `app.router` instead of `app._router`.
    @see https://github.com/pillarjs/router

    TODO: Proper Express 5 support
    */
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.debug('Routing instrumentation is currently only supported in Express 4.');
    return;
  }

  const routerProto = Object.getPrototypeOf(router) ;

  const originalProcessParams = routerProto.process_params;
  routerProto.process_params = function process_params(
    layer,
    called,
    req,
    res,
    done,
  ) {
    // Base case: We're in the first part of the URL (thus we start with the root '/')
    if (!req._reconstructedRoute) {
      req._reconstructedRoute = '';
    }

    // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.
    const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer);

    if (layerRoutePath || isRegex || isArray) {
      req._hasParameters = true;
    }

    // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path
    const partialRoute = layerRoutePath || layer.path || '';

    // Normalize the partial route so that it doesn't contain leading or trailing slashes
    // and exclude empty or '*' wildcard routes.
    // The exclusion of '*' routes is our best effort to not "pollute" the transaction name
    // with interim handlers (e.g. ones that check authentication or do other middleware stuff).
    // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.
    const finalPartialRoute = partialRoute
      .split('/')
      .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))
      .join('/');

    // If we found a valid partial URL, we append it to the reconstructed route
    if (finalPartialRoute && finalPartialRoute.length > 0) {
      // If the partial route is from a regex route, we append a '/' to close the regex
      req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;
    }

    // Now we check if we are in the "last" part of the route. We determine this by comparing the
    // number of URL segments from the original URL to that of our reconstructed parameterized URL.
    // If we've reached our final destination, we update the transaction name.
    const urlLength = utils.getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;
    const routeLength = utils.getNumberOfUrlSegments(req._reconstructedRoute);

    if (urlLength === routeLength) {
      if (!req._hasParameters) {
        if (req._reconstructedRoute !== req.originalUrl) {
          req._reconstructedRoute = req.originalUrl;
        }
      }

      const transaction = res.__sentry_transaction;
      if (transaction && transaction.metadata.source !== 'custom') {
        // If the request URL is '/' or empty, the reconstructed route will be empty.
        // Therefore, we fall back to setting the final route to '/' in this case.
        const finalRoute = req._reconstructedRoute || '/';

        transaction.setName(...utils.extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));
      }
    }

    return originalProcessParams.call(this, layer, called, req, res, done);
  };
}

/**
 * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),
 * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\/path[2-5]/, /path/:id]`). Additionally
 * returns extra information about the route, such as if the route is defined as regex or as an array.
 *
 * @param layer the layer to extract the stringified route from
 *
 * @returns an object containing the stringified route, a flag determining if the route was a regex
 *          and the number of extra segments to the matched path that are additionally in the route,
 *          if the route was an array (defaults to 0).
 */
function getLayerRoutePathInfo(layer) {
  const lrp = _optionalChain([layer, 'access', _10 => _10.route, 'optionalAccess', _11 => _11.path]);

  const isRegex = utils.isRegExp(lrp);
  const isArray = Array.isArray(lrp);

  if (!lrp) {
    return { isRegex, isArray, numExtraSegments: 0 };
  }

  const numExtraSegments = isArray
    ? Math.max(getNumberOfArrayUrlSegments(lrp ) - utils.getNumberOfUrlSegments(layer.path || ''), 0)
    : 0;

  const layerRoutePath = getLayerRoutePathString(isArray, lrp);

  return { layerRoutePath, isRegex, isArray, numExtraSegments };
}

/**
 * Returns the number of URL segments in an array of routes
 *
 * Example: ['/api/test', /\/api\/post[0-9]/, '/users/:id/details`] -> 7
 */
function getNumberOfArrayUrlSegments(routesArray) {
  return routesArray.reduce((accNumSegments, currentRoute) => {
    // array members can be a RegEx -> convert them toString
    return accNumSegments + utils.getNumberOfUrlSegments(currentRoute.toString());
  }, 0);
}

/**
 * Extracts and returns the stringified version of the layers route path
 * Handles route arrays (by joining the paths together) as well as RegExp and normal
 * string values (in the latter case the toString conversion is technically unnecessary but
 * it doesn't hurt us either).
 */
function getLayerRoutePathString(isArray, lrp) {
  if (isArray) {
    return (lrp ).map(r => r.toString()).join(',');
  }
  return lrp && lrp.toString();
}

exports.Express = Express;
//# sourceMappingURL=express.js.map
{"version":3,"file":"express.js","sources":["../../../../src/node/integrations/express.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types';\nimport { extractPathForTransaction, getNumberOfUrlSegments, isRegExp, logger } from '@sentry/utils';\n\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype Method =\n  | 'all'\n  | 'get'\n  | 'post'\n  | 'put'\n  | 'delete'\n  | 'patch'\n  | 'options'\n  | 'head'\n  | 'checkout'\n  | 'copy'\n  | 'lock'\n  | 'merge'\n  | 'mkactivity'\n  | 'mkcol'\n  | 'move'\n  | 'm-search'\n  | 'notify'\n  | 'purge'\n  | 'report'\n  | 'search'\n  | 'subscribe'\n  | 'trace'\n  | 'unlock'\n  | 'unsubscribe'\n  | 'use';\n\ntype Router = {\n  [method in Method]: (...args: any) => any; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/* Extend the PolymorphicRequest type with a patched parameter to build a reconstructed route */\ntype PatchedRequest = PolymorphicRequest & { _reconstructedRoute?: string; _hasParameters?: boolean };\n\n/* Types used for patching the express router prototype */\ntype ExpressRouter = Router & {\n  _router?: ExpressRouter;\n  stack?: Layer[];\n  lazyrouter?: () => void;\n  settings?: unknown;\n  process_params: (\n    layer: Layer,\n    called: unknown,\n    req: PatchedRequest,\n    res: ExpressResponse,\n    done: () => void,\n  ) => unknown;\n};\n\ntype Layer = {\n  match: (path: string) => boolean;\n  handle_request: (req: PatchedRequest, res: ExpressResponse, next: () => void) => void;\n  route?: { path: RouteType | RouteType[] };\n  path?: string;\n};\n\ntype RouteType = string | RegExp;\n\ninterface ExpressResponse {\n  once(name: string, callback: () => void): void;\n}\n\n/**\n * Internal helper for `__sentry_transaction`\n * @hidden\n */\ninterface SentryTracingResponse {\n  __sentry_transaction?: Transaction;\n}\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework as well as tracing capabilities\n */\nexport class Express implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Express';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Express.id;\n\n  /**\n   * Express App instance\n   */\n  private readonly _router?: Router;\n  private readonly _methods?: Method[];\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { app?: Router; router?: Router; methods?: Method[] } = {}) {\n    this._router = options.router || options.app;\n    this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: unknown, getCurrentHub: () => Hub): void {\n    if (!this._router) {\n      __DEBUG_BUILD__ && logger.error('ExpressIntegration is missing an Express instance');\n      return;\n    }\n\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Express Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    instrumentMiddlewares(this._router, this._methods);\n    instrumentRouter(this._router as ExpressRouter);\n  }\n}\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n *\n * They all internally delegate to the `router[method]` of the given application instance.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any\nfunction wrap(fn: Function, method: Method): (...args: any[]) => void {\n  const arity = fn.length;\n\n  switch (arity) {\n    case 2: {\n      return function (this: NodeJS.Global, req: unknown, res: ExpressResponse & SentryTracingResponse): void {\n        const transaction = res.__sentry_transaction;\n        if (transaction) {\n          const span = transaction.startChild({\n            description: fn.name,\n            op: `middleware.express.${method}`,\n          });\n          res.once('finish', () => {\n            span.finish();\n          });\n        }\n        return fn.call(this, req, res);\n      };\n    }\n    case 3: {\n      return function (\n        this: NodeJS.Global,\n        req: unknown,\n        res: ExpressResponse & SentryTracingResponse,\n        next: () => void,\n      ): void {\n        const transaction = res.__sentry_transaction;\n        const span = transaction?.startChild({\n          description: fn.name,\n          op: `middleware.express.${method}`,\n        });\n        fn.call(this, req, res, function (this: NodeJS.Global, ...args: unknown[]): void {\n          span?.finish();\n          next.call(this, ...args);\n        });\n      };\n    }\n    case 4: {\n      return function (\n        this: NodeJS.Global,\n        err: Error,\n        req: Request,\n        res: Response & SentryTracingResponse,\n        next: () => void,\n      ): void {\n        const transaction = res.__sentry_transaction;\n        const span = transaction?.startChild({\n          description: fn.name,\n          op: `middleware.express.${method}`,\n        });\n        fn.call(this, err, req, res, function (this: NodeJS.Global, ...args: unknown[]): void {\n          span?.finish();\n          next.call(this, ...args);\n        });\n      };\n    }\n    default: {\n      throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);\n    }\n  }\n}\n\n/**\n * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([<path>], <fn>)\n * app.use([<path>], <fn>, ...<fn>)\n * app.use([<path>], ...<fn>[])\n */\nfunction wrapMiddlewareArgs(args: unknown[], method: Method): unknown[] {\n  return args.map((arg: unknown) => {\n    if (typeof arg === 'function') {\n      return wrap(arg, method);\n    }\n\n    if (Array.isArray(arg)) {\n      return arg.map((a: unknown) => {\n        if (typeof a === 'function') {\n          return wrap(a, method);\n        }\n        return a;\n      });\n    }\n\n    return arg;\n  });\n}\n\n/**\n * Patches original router to utilize our tracing functionality\n */\nfunction patchMiddleware(router: Router, method: Method): Router {\n  const originalCallback = router[method];\n\n  router[method] = function (...args: unknown[]): void {\n    return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));\n  };\n\n  return router;\n}\n\n/**\n * Patches original router methods\n */\nfunction instrumentMiddlewares(router: Router, methods: Method[] = []): void {\n  methods.forEach((method: Method) => patchMiddleware(router, method));\n}\n\n/**\n * Patches the prototype of Express.Router to accumulate the resolved route\n * if a layer instance's `match` function was called and it returned a successful match.\n *\n * @see https://github.com/expressjs/express/blob/master/lib/router/index.js\n *\n * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.\n */\nfunction instrumentRouter(appOrRouter: ExpressRouter): void {\n  // This is how we can distinguish between app and routers\n  const isApp = 'settings' in appOrRouter;\n\n  // In case the app's top-level router hasn't been initialized yet, we have to do it now\n  if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {\n    appOrRouter.lazyrouter();\n  }\n\n  const router = isApp ? appOrRouter._router : appOrRouter;\n\n  if (!router) {\n    /*\n    If we end up here, this means likely that this integration is used with Express 3 or Express 5.\n    For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,\n    we'd need to make more changes to the routing instrumentation because the router is no longer part of\n    the Express core package but maintained in its own package. The new router has different function\n    signatures and works slightly differently, demanding more changes than just taking the router from\n    `app.router` instead of `app._router`.\n    @see https://github.com/pillarjs/router\n\n    TODO: Proper Express 5 support\n    */\n    __DEBUG_BUILD__ && logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');\n    __DEBUG_BUILD__ && logger.debug('Routing instrumentation is currently only supported in Express 4.');\n    return;\n  }\n\n  const routerProto = Object.getPrototypeOf(router) as ExpressRouter;\n\n  const originalProcessParams = routerProto.process_params;\n  routerProto.process_params = function process_params(\n    layer: Layer,\n    called: unknown,\n    req: PatchedRequest,\n    res: ExpressResponse & SentryTracingResponse,\n    done: () => unknown,\n  ) {\n    // Base case: We're in the first part of the URL (thus we start with the root '/')\n    if (!req._reconstructedRoute) {\n      req._reconstructedRoute = '';\n    }\n\n    // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.\n    const { layerRoutePath, isRegex, isArray, numExtraSegments }: LayerRoutePathInfo = getLayerRoutePathInfo(layer);\n\n    if (layerRoutePath || isRegex || isArray) {\n      req._hasParameters = true;\n    }\n\n    // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path\n    const partialRoute = layerRoutePath || layer.path || '';\n\n    // Normalize the partial route so that it doesn't contain leading or trailing slashes\n    // and exclude empty or '*' wildcard routes.\n    // The exclusion of '*' routes is our best effort to not \"pollute\" the transaction name\n    // with interim handlers (e.g. ones that check authentication or do other middleware stuff).\n    // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.\n    const finalPartialRoute = partialRoute\n      .split('/')\n      .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))\n      .join('/');\n\n    // If we found a valid partial URL, we append it to the reconstructed route\n    if (finalPartialRoute && finalPartialRoute.length > 0) {\n      // If the partial route is from a regex route, we append a '/' to close the regex\n      req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;\n    }\n\n    // Now we check if we are in the \"last\" part of the route. We determine this by comparing the\n    // number of URL segments from the original URL to that of our reconstructed parameterized URL.\n    // If we've reached our final destination, we update the transaction name.\n    const urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;\n    const routeLength = getNumberOfUrlSegments(req._reconstructedRoute);\n\n    if (urlLength === routeLength) {\n      if (!req._hasParameters) {\n        if (req._reconstructedRoute !== req.originalUrl) {\n          req._reconstructedRoute = req.originalUrl;\n        }\n      }\n\n      const transaction = res.__sentry_transaction;\n      if (transaction && transaction.metadata.source !== 'custom') {\n        // If the request URL is '/' or empty, the reconstructed route will be empty.\n        // Therefore, we fall back to setting the final route to '/' in this case.\n        const finalRoute = req._reconstructedRoute || '/';\n\n        transaction.setName(...extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));\n      }\n    }\n\n    return originalProcessParams.call(this, layer, called, req, res, done);\n  };\n}\n\ntype LayerRoutePathInfo = {\n  layerRoutePath?: string;\n  isRegex: boolean;\n  isArray: boolean;\n  numExtraSegments: number;\n};\n\n/**\n * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),\n * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\\/path[2-5]/, /path/:id]`). Additionally\n * returns extra information about the route, such as if the route is defined as regex or as an array.\n *\n * @param layer the layer to extract the stringified route from\n *\n * @returns an object containing the stringified route, a flag determining if the route was a regex\n *          and the number of extra segments to the matched path that are additionally in the route,\n *          if the route was an array (defaults to 0).\n */\nfunction getLayerRoutePathInfo(layer: Layer): LayerRoutePathInfo {\n  const lrp = layer.route?.path;\n\n  const isRegex = isRegExp(lrp);\n  const isArray = Array.isArray(lrp);\n\n  if (!lrp) {\n    return { isRegex, isArray, numExtraSegments: 0 };\n  }\n\n  const numExtraSegments = isArray\n    ? Math.max(getNumberOfArrayUrlSegments(lrp as RouteType[]) - getNumberOfUrlSegments(layer.path || ''), 0)\n    : 0;\n\n  const layerRoutePath = getLayerRoutePathString(isArray, lrp);\n\n  return { layerRoutePath, isRegex, isArray, numExtraSegments };\n}\n\n/**\n * Returns the number of URL segments in an array of routes\n *\n * Example: ['/api/test', /\\/api\\/post[0-9]/, '/users/:id/details`] -> 7\n */\nfunction getNumberOfArrayUrlSegments(routesArray: RouteType[]): number {\n  return routesArray.reduce((accNumSegments: number, currentRoute: RouteType) => {\n    // array members can be a RegEx -> convert them toString\n    return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());\n  }, 0);\n}\n\n/**\n * Extracts and returns the stringified version of the layers route path\n * Handles route arrays (by joining the paths together) as well as RegExp and normal\n * string values (in the latter case the toString conversion is technically unnecessary but\n * it doesn't hurt us either).\n */\nfunction getLayerRoutePathString(isArray: boolean, lrp?: RouteType | RouteType[]): string | undefined {\n  if (isArray) {\n    return (lrp as RouteType[]).map(r => r.toString()).join(',');\n  }\n  return lrp && lrp.toString();\n}\n"],"names":["logger","shouldDisableAutoInstrumentation","getNumberOfUrlSegments","extractPathForTransaction","isRegExp"],"mappings":";;;;;;;;;AA4EA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,C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,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;CACA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,EAAA;EACA,CAAA,EAAA,CAAA,OAAA,EAAA;IACA,OAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;EACA,OAAA,CAAA,CAAA,EAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;AACA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

/** Tracing integration for graphql package */
class GraphQL  {constructor() { GraphQL.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'GraphQL';}

  /**
   * @inheritDoc
   */
   __init() {this.name = GraphQL.id;}

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || utils.loadModule('graphql/execution/execute.js'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('GraphQL Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('GraphQL Integration was unable to require graphql/execution package.');
      return;
    }

    utils.fill(pkg, 'execute', function (orig) {
      return function ( ...args) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);

        const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
          description: 'execute',
          op: 'graphql.execute',
        })]);

        _optionalChain([scope, 'optionalAccess', _6 => _6.setSpan, 'call', _7 => _7(span)]);

        const rv = orig.call(this, ...args);

        if (utils.isThenable(rv)) {
          return rv.then((res) => {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            _optionalChain([scope, 'optionalAccess', _10 => _10.setSpan, 'call', _11 => _11(parentSpan)]);

            return res;
          });
        }

        _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
        _optionalChain([scope, 'optionalAccess', _14 => _14.setSpan, 'call', _15 => _15(parentSpan)]);
        return rv;
      };
    });
  }
}GraphQL.__initStatic();

exports.GraphQL = GraphQL;
//# sourceMappingURL=graphql.js.map
{"version":3,"file":"graphql.js","sources":["../../../../src/node/integrations/graphql.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype GraphQLModule = {\n  [method: string]: (...args: unknown[]) => unknown;\n};\n\n/** Tracing integration for graphql package */\nexport class GraphQL implements LazyLoadedIntegration<GraphQLModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GraphQL';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = GraphQL.id;\n\n  private _module?: GraphQLModule;\n\n  /** @inheritdoc */\n  public loadDependency(): GraphQLModule | undefined {\n    return (this._module = this._module || loadModule('graphql/execution/execute.js'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('GraphQL Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('GraphQL Integration was unable to require graphql/execution package.');\n      return;\n    }\n\n    fill(pkg, 'execute', function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, ...args: unknown[]) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n\n        const span = parentSpan?.startChild({\n          description: 'execute',\n          op: 'graphql.execute',\n        });\n\n        scope?.setSpan(span);\n\n        const rv = orig.call(this, ...args);\n\n        if (isThenable(rv)) {\n          return rv.then((res: unknown) => {\n            span?.finish();\n            scope?.setSpan(parentSpan);\n\n            return res;\n          });\n        }\n\n        span?.finish();\n        scope?.setSpan(parentSpan);\n        return rv;\n      };\n    });\n  }\n}\n"],"names":["loadModule","shouldDisableAutoInstrumentation","logger","fill","isThenable"],"mappings":";;;;;;;;;AAWA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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EAAA,EAAA;MACA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const lazyLoadedNodePerformanceMonitoringIntegrations = [
  () => {
    const integration = utils.dynamicRequire(module, './apollo')

;
    return new integration.Apollo();
  },
  () => {
    const integration = utils.dynamicRequire(module, './apollo')

;
    return new integration.Apollo({ useNestjs: true });
  },
  () => {
    const integration = utils.dynamicRequire(module, './graphql')

;
    return new integration.GraphQL();
  },
  () => {
    const integration = utils.dynamicRequire(module, './mongo')

;
    return new integration.Mongo();
  },
  () => {
    const integration = utils.dynamicRequire(module, './mongo')

;
    return new integration.Mongo({ mongoose: true });
  },
  () => {
    const integration = utils.dynamicRequire(module, './mysql')

;
    return new integration.Mysql();
  },
  () => {
    const integration = utils.dynamicRequire(module, './postgres')

;
    return new integration.Postgres();
  },
];

exports.lazyLoadedNodePerformanceMonitoringIntegrations = lazyLoadedNodePerformanceMonitoringIntegrations;
//# sourceMappingURL=lazy.js.map
{"version":3,"file":"lazy.js","sources":["../../../../src/node/integrations/lazy.ts"],"sourcesContent":["import type { Integration, IntegrationClass } from '@sentry/types';\nimport { dynamicRequire } from '@sentry/utils';\n\nexport interface LazyLoadedIntegration<T = object> extends Integration {\n  /**\n   * Loads the integration's dependency and caches it so it doesn't have to be loaded again.\n   *\n   * If this returns undefined, the dependency could not be loaded.\n   */\n  loadDependency(): T | undefined;\n}\n\nexport const lazyLoadedNodePerformanceMonitoringIntegrations: (() => LazyLoadedIntegration)[] = [\n  () => {\n    const integration = dynamicRequire(module, './apollo') as {\n      Apollo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Apollo();\n  },\n  () => {\n    const integration = dynamicRequire(module, './apollo') as {\n      Apollo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Apollo({ useNestjs: true });\n  },\n  () => {\n    const integration = dynamicRequire(module, './graphql') as {\n      GraphQL: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.GraphQL();\n  },\n  () => {\n    const integration = dynamicRequire(module, './mongo') as {\n      Mongo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mongo();\n  },\n  () => {\n    const integration = dynamicRequire(module, './mongo') as {\n      Mongo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mongo({ mongoose: true });\n  },\n  () => {\n    const integration = dynamicRequire(module, './mysql') as {\n      Mysql: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mysql();\n  },\n  () => {\n    const integration = dynamicRequire(module, './postgres') as {\n      Postgres: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Postgres();\n  },\n];\n"],"names":["dynamicRequire"],"mappings":";;;;AAYA,MAAA,+CAAA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,UAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,MAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,UAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,MAAA,CAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,WAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAAA,oBAAA,CAAA,MAAA,EAAA,YAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,QAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

// This allows us to use the same array for both defaults options and the type itself.
// (note `as const` at the end to make it a union of string literal types (i.e. "a" | "b" | ... )
// and not just a string[])

const OPERATIONS = [
  'aggregate', // aggregate(pipeline, options, callback)
  'bulkWrite', // bulkWrite(operations, options, callback)
  'countDocuments', // countDocuments(query, options, callback)
  'createIndex', // createIndex(fieldOrSpec, options, callback)
  'createIndexes', // createIndexes(indexSpecs, options, callback)
  'deleteMany', // deleteMany(filter, options, callback)
  'deleteOne', // deleteOne(filter, options, callback)
  'distinct', // distinct(key, query, options, callback)
  'drop', // drop(options, callback)
  'dropIndex', // dropIndex(indexName, options, callback)
  'dropIndexes', // dropIndexes(options, callback)
  'estimatedDocumentCount', // estimatedDocumentCount(options, callback)
  'find', // find(query, options, callback)
  'findOne', // findOne(query, options, callback)
  'findOneAndDelete', // findOneAndDelete(filter, options, callback)
  'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)
  'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)
  'indexes', // indexes(options, callback)
  'indexExists', // indexExists(indexes, options, callback)
  'indexInformation', // indexInformation(options, callback)
  'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)
  'insertMany', // insertMany(docs, options, callback)
  'insertOne', // insertOne(doc, options, callback)
  'isCapped', // isCapped(options, callback)
  'mapReduce', // mapReduce(map, reduce, options, callback)
  'options', // options(options, callback)
  'parallelCollectionScan', // parallelCollectionScan(options, callback)
  'rename', // rename(newName, options, callback)
  'replaceOne', // replaceOne(filter, doc, options, callback)
  'stats', // stats(options, callback)
  'updateMany', // updateMany(filter, update, options, callback)
  'updateOne', // updateOne(filter, update, options, callback)
] ;

// All of the operations above take `options` and `callback` as their final parameters, but some of them
// take additional parameters as well. For those operations, this is a map of
// { <operation name>:  [<names of additional parameters>] }, as a way to know what to call the operation's
// positional arguments when we add them to the span's `data` object later
const OPERATION_SIGNATURES

 = {
  // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well
  // see https://github.com/getsentry/sentry-javascript/pull/3102
  bulkWrite: ['operations'],
  countDocuments: ['query'],
  createIndex: ['fieldOrSpec'],
  createIndexes: ['indexSpecs'],
  deleteMany: ['filter'],
  deleteOne: ['filter'],
  distinct: ['key', 'query'],
  dropIndex: ['indexName'],
  find: ['query'],
  findOne: ['query'],
  findOneAndDelete: ['filter'],
  findOneAndReplace: ['filter', 'replacement'],
  findOneAndUpdate: ['filter', 'update'],
  indexExists: ['indexes'],
  insertMany: ['docs'],
  insertOne: ['doc'],
  mapReduce: ['map', 'reduce'],
  rename: ['newName'],
  replaceOne: ['filter', 'doc'],
  updateMany: ['filter', 'update'],
  updateOne: ['filter', 'update'],
};

function isCursor(maybeCursor) {
  return maybeCursor && typeof maybeCursor === 'object' && maybeCursor.once && typeof maybeCursor.once === 'function';
}

/** Tracing integration for mongo package */
class Mongo  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Mongo';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Mongo.id;}

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Mongo.prototype.__init.call(this);
    this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS );
    this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;
    this._useMongoose = !!options.useMongoose;
  }

  /** @inheritdoc */
   loadDependency() {
    const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';
    return (this._module = this._module || utils.loadModule(moduleName));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Mongo Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(`Mongo Integration was unable to require \`${moduleName}\` package.`);
      return;
    }

    this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub);
  }

  /**
   * Patches original collection methods
   */
   _instrumentOperations(collection, operations, getCurrentHub) {
    operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));
  }

  /**
   * Patches original collection to utilize our tracing functionality
   */
   _patchOperation(collection, operation, getCurrentHub) {
    if (!(operation in collection.prototype)) return;

    const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);

    utils.fill(collection.prototype, operation, function (orig) {
      return function ( ...args) {
        const lastArg = args[args.length - 1];
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);

        // Check if the operation was passed a callback. (mapReduce requires a different check, as
        // its (non-callback) arguments can also be functions.)
        if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {
          const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5(getSpanContext(this, operation, args))]);
          const maybePromiseOrCursor = orig.call(this, ...args);

          if (utils.isThenable(maybePromiseOrCursor)) {
            return maybePromiseOrCursor.then((res) => {
              _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
              return res;
            });
          }
          // If the operation returns a Cursor
          // we need to attach a listener to it to finish the span when the cursor is closed.
          else if (isCursor(maybePromiseOrCursor)) {
            const cursor = maybePromiseOrCursor ;

            try {
              cursor.once('close', () => {
                _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
              });
            } catch (e) {
              // If the cursor is already closed, `once` will throw an error. In that case, we can
              // finish the span immediately.
              _optionalChain([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);
            }

            return cursor;
          } else {
            _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
            return maybePromiseOrCursor;
          }
        }

        const span = _optionalChain([parentSpan, 'optionalAccess', _14 => _14.startChild, 'call', _15 => _15(getSpanContext(this, operation, args.slice(0, -1)))]);

        return orig.call(this, ...args.slice(0, -1), function (err, result) {
          _optionalChain([span, 'optionalAccess', _16 => _16.finish, 'call', _17 => _17()]);
          lastArg(err, result);
        });
      };
    });
  }

  /**
   * Form a SpanContext based on the user input to a given operation.
   */
   _getSpanContextFromOperationArguments(
    collection,
    operation,
    args,
  ) {
    const data = {
      collectionName: collection.collectionName,
      dbName: collection.dbName,
      namespace: collection.namespace,
    };
    const spanContext = {
      op: 'db',
      description: operation,
      data,
    };

    // If the operation takes no arguments besides `options` and `callback`, or if argument
    // collection is disabled for this operation, just return early.
    const signature = OPERATION_SIGNATURES[operation];
    const shouldDescribe = Array.isArray(this._describeOperations)
      ? this._describeOperations.includes(operation)
      : this._describeOperations;

    if (!signature || !shouldDescribe) {
      return spanContext;
    }

    try {
      // Special case for `mapReduce`, as the only one accepting functions as arguments.
      if (operation === 'mapReduce') {
        const [map, reduce] = args ;
        data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';
        data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';
      } else {
        for (let i = 0; i < signature.length; i++) {
          data[signature[i]] = JSON.stringify(args[i]);
        }
      }
    } catch (_oO) {
      // no-empty
    }

    return spanContext;
  }
}Mongo.__initStatic();

exports.Mongo = Mongo;
//# sourceMappingURL=mongo.js.map
{"version":3,"file":"mongo.js","sources":["../../../../src/node/integrations/mongo.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor, SpanContext } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\n// This allows us to use the same array for both defaults options and the type itself.\n// (note `as const` at the end to make it a union of string literal types (i.e. \"a\" | \"b\" | ... )\n// and not just a string[])\ntype Operation = (typeof OPERATIONS)[number];\nconst OPERATIONS = [\n  'aggregate', // aggregate(pipeline, options, callback)\n  'bulkWrite', // bulkWrite(operations, options, callback)\n  'countDocuments', // countDocuments(query, options, callback)\n  'createIndex', // createIndex(fieldOrSpec, options, callback)\n  'createIndexes', // createIndexes(indexSpecs, options, callback)\n  'deleteMany', // deleteMany(filter, options, callback)\n  'deleteOne', // deleteOne(filter, options, callback)\n  'distinct', // distinct(key, query, options, callback)\n  'drop', // drop(options, callback)\n  'dropIndex', // dropIndex(indexName, options, callback)\n  'dropIndexes', // dropIndexes(options, callback)\n  'estimatedDocumentCount', // estimatedDocumentCount(options, callback)\n  'find', // find(query, options, callback)\n  'findOne', // findOne(query, options, callback)\n  'findOneAndDelete', // findOneAndDelete(filter, options, callback)\n  'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)\n  'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)\n  'indexes', // indexes(options, callback)\n  'indexExists', // indexExists(indexes, options, callback)\n  'indexInformation', // indexInformation(options, callback)\n  'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)\n  'insertMany', // insertMany(docs, options, callback)\n  'insertOne', // insertOne(doc, options, callback)\n  'isCapped', // isCapped(options, callback)\n  'mapReduce', // mapReduce(map, reduce, options, callback)\n  'options', // options(options, callback)\n  'parallelCollectionScan', // parallelCollectionScan(options, callback)\n  'rename', // rename(newName, options, callback)\n  'replaceOne', // replaceOne(filter, doc, options, callback)\n  'stats', // stats(options, callback)\n  'updateMany', // updateMany(filter, update, options, callback)\n  'updateOne', // updateOne(filter, update, options, callback)\n] as const;\n\n// All of the operations above take `options` and `callback` as their final parameters, but some of them\n// take additional parameters as well. For those operations, this is a map of\n// { <operation name>:  [<names of additional parameters>] }, as a way to know what to call the operation's\n// positional arguments when we add them to the span's `data` object later\nconst OPERATION_SIGNATURES: {\n  [op in Operation]?: string[];\n} = {\n  // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well\n  // see https://github.com/getsentry/sentry-javascript/pull/3102\n  bulkWrite: ['operations'],\n  countDocuments: ['query'],\n  createIndex: ['fieldOrSpec'],\n  createIndexes: ['indexSpecs'],\n  deleteMany: ['filter'],\n  deleteOne: ['filter'],\n  distinct: ['key', 'query'],\n  dropIndex: ['indexName'],\n  find: ['query'],\n  findOne: ['query'],\n  findOneAndDelete: ['filter'],\n  findOneAndReplace: ['filter', 'replacement'],\n  findOneAndUpdate: ['filter', 'update'],\n  indexExists: ['indexes'],\n  insertMany: ['docs'],\n  insertOne: ['doc'],\n  mapReduce: ['map', 'reduce'],\n  rename: ['newName'],\n  replaceOne: ['filter', 'doc'],\n  updateMany: ['filter', 'update'],\n  updateOne: ['filter', 'update'],\n};\n\ninterface MongoCollection {\n  collectionName: string;\n  dbName: string;\n  namespace: string;\n  prototype: {\n    [operation in Operation]: (...args: unknown[]) => unknown;\n  };\n}\n\ninterface MongoOptions {\n  operations?: Operation[];\n  describeOperations?: boolean | Operation[];\n  useMongoose?: boolean;\n}\n\ninterface MongoCursor {\n  once(event: 'close', listener: () => void): void;\n}\n\nfunction isCursor(maybeCursor: MongoCursor): maybeCursor is MongoCursor {\n  return maybeCursor && typeof maybeCursor === 'object' && maybeCursor.once && typeof maybeCursor.once === 'function';\n}\n\ntype MongoModule = { Collection: MongoCollection };\n\n/** Tracing integration for mongo package */\nexport class Mongo implements LazyLoadedIntegration<MongoModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Mongo';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Mongo.id;\n\n  private _operations: Operation[];\n  private _describeOperations?: boolean | Operation[];\n  private _useMongoose: boolean;\n\n  private _module?: MongoModule;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: MongoOptions = {}) {\n    this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS as unknown as Operation[]);\n    this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;\n    this._useMongoose = !!options.useMongoose;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): MongoModule | undefined {\n    const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n    return (this._module = this._module || loadModule(moduleName));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Mongo Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n      __DEBUG_BUILD__ && logger.error(`Mongo Integration was unable to require \\`${moduleName}\\` package.`);\n      return;\n    }\n\n    this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub);\n  }\n\n  /**\n   * Patches original collection methods\n   */\n  private _instrumentOperations(collection: MongoCollection, operations: Operation[], getCurrentHub: () => Hub): void {\n    operations.forEach((operation: Operation) => this._patchOperation(collection, operation, getCurrentHub));\n  }\n\n  /**\n   * Patches original collection to utilize our tracing functionality\n   */\n  private _patchOperation(collection: MongoCollection, operation: Operation, getCurrentHub: () => Hub): void {\n    if (!(operation in collection.prototype)) return;\n\n    const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);\n\n    fill(collection.prototype, operation, function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, ...args: unknown[]) {\n        const lastArg = args[args.length - 1];\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n\n        // Check if the operation was passed a callback. (mapReduce requires a different check, as\n        // its (non-callback) arguments can also be functions.)\n        if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {\n          const span = parentSpan?.startChild(getSpanContext(this, operation, args));\n          const maybePromiseOrCursor = orig.call(this, ...args);\n\n          if (isThenable(maybePromiseOrCursor)) {\n            return maybePromiseOrCursor.then((res: unknown) => {\n              span?.finish();\n              return res;\n            });\n          }\n          // If the operation returns a Cursor\n          // we need to attach a listener to it to finish the span when the cursor is closed.\n          else if (isCursor(maybePromiseOrCursor)) {\n            const cursor = maybePromiseOrCursor as MongoCursor;\n\n            try {\n              cursor.once('close', () => {\n                span?.finish();\n              });\n            } catch (e) {\n              // If the cursor is already closed, `once` will throw an error. In that case, we can\n              // finish the span immediately.\n              span?.finish();\n            }\n\n            return cursor;\n          } else {\n            span?.finish();\n            return maybePromiseOrCursor;\n          }\n        }\n\n        const span = parentSpan?.startChild(getSpanContext(this, operation, args.slice(0, -1)));\n\n        return orig.call(this, ...args.slice(0, -1), function (err: Error, result: unknown) {\n          span?.finish();\n          lastArg(err, result);\n        });\n      };\n    });\n  }\n\n  /**\n   * Form a SpanContext based on the user input to a given operation.\n   */\n  private _getSpanContextFromOperationArguments(\n    collection: MongoCollection,\n    operation: Operation,\n    args: unknown[],\n  ): SpanContext {\n    const data: { [key: string]: string } = {\n      collectionName: collection.collectionName,\n      dbName: collection.dbName,\n      namespace: collection.namespace,\n    };\n    const spanContext: SpanContext = {\n      op: 'db',\n      description: operation,\n      data,\n    };\n\n    // If the operation takes no arguments besides `options` and `callback`, or if argument\n    // collection is disabled for this operation, just return early.\n    const signature = OPERATION_SIGNATURES[operation];\n    const shouldDescribe = Array.isArray(this._describeOperations)\n      ? this._describeOperations.includes(operation)\n      : this._describeOperations;\n\n    if (!signature || !shouldDescribe) {\n      return spanContext;\n    }\n\n    try {\n      // Special case for `mapReduce`, as the only one accepting functions as arguments.\n      if (operation === 'mapReduce') {\n        const [map, reduce] = args as { name?: string }[];\n        data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';\n        data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';\n      } else {\n        for (let i = 0; i < signature.length; i++) {\n          data[signature[i]] = JSON.stringify(args[i]);\n        }\n      }\n    } catch (_oO) {\n      // no-empty\n    }\n\n    return spanContext;\n  }\n}\n"],"names":["loadModule","shouldDisableAutoInstrumentation","logger","fill","isThenable"],"mappings":";;;;;;;;;AAOA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA;MACA;IACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA;MACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA;;IAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,WAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

/** Tracing integration for node-mysql package */
class Mysql  {constructor() { Mysql.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Mysql';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Mysql.id;}

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || utils.loadModule('mysql/lib/Connection.js'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Mysql Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Mysql Integration was unable to require `mysql` package.');
      return;
    }

    // The original function will have one of these signatures:
    //    function (callback) => void
    //    function (options, callback) => void
    //    function (options, values, callback) => void
    utils.fill(pkg, 'createQuery', function (orig) {
      return function ( options, values, callback) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
        const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
          description: typeof options === 'string' ? options : (options ).sql,
          op: 'db',
        })]);

        if (typeof callback === 'function') {
          return orig.call(this, options, values, function (err, result, fields) {
            _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
            callback(err, result, fields);
          });
        }

        if (typeof values === 'function') {
          return orig.call(this, options, function (err, result, fields) {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            values(err, result, fields);
          });
        }

        return orig.call(this, options, values, callback);
      };
    });
  }
}Mysql.__initStatic();

exports.Mysql = Mysql;
//# sourceMappingURL=mysql.js.map
{"version":3,"file":"mysql.js","sources":["../../../../src/node/integrations/mysql.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface MysqlConnection {\n  createQuery: () => void;\n}\n\n/** Tracing integration for node-mysql package */\nexport class Mysql implements LazyLoadedIntegration<MysqlConnection> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Mysql';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Mysql.id;\n\n  private _module?: MysqlConnection;\n\n  /** @inheritdoc */\n  public loadDependency(): MysqlConnection | undefined {\n    return (this._module = this._module || loadModule('mysql/lib/Connection.js'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Mysql Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('Mysql Integration was unable to require `mysql` package.');\n      return;\n    }\n\n    // The original function will have one of these signatures:\n    //    function (callback) => void\n    //    function (options, callback) => void\n    //    function (options, values, callback) => void\n    fill(pkg, 'createQuery', function (orig: () => void) {\n      return function (this: unknown, options: unknown, values: unknown, callback: unknown) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n        const span = parentSpan?.startChild({\n          description: typeof options === 'string' ? options : (options as { sql: string }).sql,\n          op: 'db',\n        });\n\n        if (typeof callback === 'function') {\n          return orig.call(this, options, values, function (err: Error, result: unknown, fields: unknown) {\n            span?.finish();\n            callback(err, result, fields);\n          });\n        }\n\n        if (typeof values === 'function') {\n          return orig.call(this, options, function (err: Error, result: unknown, fields: unknown) {\n            span?.finish();\n            values(err, result, fields);\n          });\n        }\n\n        return orig.call(this, options, values, callback);\n      };\n    });\n  }\n}\n"],"names":["loadModule","shouldDisableAutoInstrumentation","logger","fill"],"mappings":";;;;;;;;;AAWA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA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A,MAAA,EAAA;YACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;YACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;UACA,CAAA,CAAA;QACA;;QAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

/** Tracing integration for node-postgres package */
class Postgres  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Postgres';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Postgres.id;}

   constructor(options = {}) {Postgres.prototype.__init.call(this);
    this._usePgNative = !!options.usePgNative;
  }

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || utils.loadModule('pg'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Postgres Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Postgres Integration was unable to require `pg` package.');
      return;
    }

    if (this._usePgNative && !_optionalChain([pkg, 'access', _2 => _2.native, 'optionalAccess', _3 => _3.Client])) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");
      return;
    }

    const { Client } = this._usePgNative ? pkg.native : pkg;

    /**
     * function (query, callback) => void
     * function (query, params, callback) => void
     * function (query) => Promise
     * function (query, params) => Promise
     * function (pg.Cursor) => pg.Cursor
     */
    utils.fill(Client.prototype, 'query', function (orig) {
      return function ( config, values, callback) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);
        const span = _optionalChain([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
          description: typeof config === 'string' ? config : (config ).text,
          op: 'db',
        })]);

        if (typeof callback === 'function') {
          return orig.call(this, config, values, function (err, result) {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            callback(err, result);
          });
        }

        if (typeof values === 'function') {
          return orig.call(this, config, function (err, result) {
            _optionalChain([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);
            values(err, result);
          });
        }

        const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);

        if (utils.isThenable(rv)) {
          return rv.then((res) => {
            _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
            return res;
          });
        }

        _optionalChain([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]);
        return rv;
      };
    });
  }
}Postgres.__initStatic();

exports.Postgres = Postgres;
//# sourceMappingURL=postgres.js.map
{"version":3,"file":"postgres.js","sources":["../../../../src/node/integrations/postgres.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface PgClient {\n  prototype: {\n    query: () => void | Promise<unknown>;\n  };\n}\n\ninterface PgOptions {\n  usePgNative?: boolean;\n}\n\ntype PGModule = { Client: PgClient; native: { Client: PgClient } };\n\n/** Tracing integration for node-postgres package */\nexport class Postgres implements LazyLoadedIntegration<PGModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Postgres';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Postgres.id;\n\n  private _usePgNative: boolean;\n\n  private _module?: PGModule;\n\n  public constructor(options: PgOptions = {}) {\n    this._usePgNative = !!options.usePgNative;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): PGModule | undefined {\n    return (this._module = this._module || loadModule('pg'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Postgres Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('Postgres Integration was unable to require `pg` package.');\n      return;\n    }\n\n    if (this._usePgNative && !pkg.native?.Client) {\n      __DEBUG_BUILD__ && logger.error(\"Postgres Integration was unable to access 'pg-native' bindings.\");\n      return;\n    }\n\n    const { Client } = this._usePgNative ? pkg.native : pkg;\n\n    /**\n     * function (query, callback) => void\n     * function (query, params, callback) => void\n     * function (query) => Promise\n     * function (query, params) => Promise\n     * function (pg.Cursor) => pg.Cursor\n     */\n    fill(Client.prototype, 'query', function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, config: unknown, values: unknown, callback: unknown) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n        const span = parentSpan?.startChild({\n          description: typeof config === 'string' ? config : (config as { text: string }).text,\n          op: 'db',\n        });\n\n        if (typeof callback === 'function') {\n          return orig.call(this, config, values, function (err: Error, result: unknown) {\n            span?.finish();\n            callback(err, result);\n          });\n        }\n\n        if (typeof values === 'function') {\n          return orig.call(this, config, function (err: Error, result: unknown) {\n            span?.finish();\n            values(err, result);\n          });\n        }\n\n        const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);\n\n        if (isThenable(rv)) {\n          return rv.then((res: unknown) => {\n            span?.finish();\n            return res;\n          });\n        }\n\n        span?.finish();\n        return rv;\n      };\n    });\n  }\n}\n"],"names":["loadModule","shouldDisableAutoInstrumentation","logger","fill","isThenable"],"mappings":";;;;;;;;;AAmBA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,UAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,CAAA,IAAA,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AA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;YACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA;UACA,CAAA,CAAA;QACA;;QAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA;MACA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const nodeUtils = require('./utils/node-utils.js');

function isValidPrismaClient(possibleClient) {
  return possibleClient && !!(possibleClient )['$use'];
}

/** Tracing integration for @prisma/client package */
class Prisma  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Prisma';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Prisma.id;}

  /**
   * Prisma ORM Client Instance
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Prisma.prototype.__init.call(this);
    if (isValidPrismaClient(options.client)) {
      this._client = options.client;
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.warn(
          `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,
        );
    }
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (!this._client) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('PrismaIntegration is missing a Prisma Client Instance');
      return;
    }

    if (nodeUtils.shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Prisma Integration is skipped because of instrumenter configuration.');
      return;
    }

    this._client.$use((params, next) => {
      const action = params.action;
      const model = params.model;
      return core.trace({ name: model ? `${model} ${action}` : action, op: 'db.sql.prisma' }, () => next(params));
    });
  }
} Prisma.__initStatic();

exports.Prisma = Prisma;
//# sourceMappingURL=prisma.js.map
{"version":3,"file":"prisma.js","sources":["../../../../src/node/integrations/prisma.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport { trace } from '@sentry/core';\nimport type { EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype PrismaAction =\n  | 'findUnique'\n  | 'findMany'\n  | 'findFirst'\n  | 'create'\n  | 'createMany'\n  | 'update'\n  | 'updateMany'\n  | 'upsert'\n  | 'delete'\n  | 'deleteMany'\n  | 'executeRaw'\n  | 'queryRaw'\n  | 'aggregate'\n  | 'count'\n  | 'runCommandRaw';\n\ninterface PrismaMiddlewareParams {\n  model?: unknown;\n  action: PrismaAction;\n  args: unknown;\n  dataPath: string[];\n  runInTransaction: boolean;\n}\n\ntype PrismaMiddleware<T = unknown> = (\n  params: PrismaMiddlewareParams,\n  next: (params: PrismaMiddlewareParams) => Promise<T>,\n) => Promise<T>;\n\ninterface PrismaClient {\n  $use: (cb: PrismaMiddleware) => void;\n}\n\nfunction isValidPrismaClient(possibleClient: unknown): possibleClient is PrismaClient {\n  return possibleClient && !!(possibleClient as PrismaClient)['$use'];\n}\n\n/** Tracing integration for @prisma/client package */\nexport class Prisma implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Prisma';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Prisma.id;\n\n  /**\n   * Prisma ORM Client Instance\n   */\n  private readonly _client?: PrismaClient;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { client?: unknown } = {}) {\n    if (isValidPrismaClient(options.client)) {\n      this._client = options.client;\n    } else {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,\n        );\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (!this._client) {\n      __DEBUG_BUILD__ && logger.error('PrismaIntegration is missing a Prisma Client Instance');\n      return;\n    }\n\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Prisma Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    this._client.$use((params, next: (params: PrismaMiddlewareParams) => Promise<unknown>) => {\n      const action = params.action;\n      const model = params.model;\n      return trace({ name: model ? `${model} ${action}` : action, op: 'db.sql.prisma' }, () => next(params));\n    });\n  }\n}\n"],"names":["logger","shouldDisableAutoInstrumentation","trace"],"mappings":";;;;;;AAyCA,SAAA,mBAAA,CAAA,cAAA,EAAA;AACA,EAAA,OAAA,cAAA,IAAA,CAAA,CAAA,CAAA,cAAA,GAAA,MAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,MAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IA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GAAA,MAAA,EAAA,EAAA,EAAA,eAAA,EAAA,EAAA,MAAA,IAAA,CAAA,MAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,MAAA,CAAA,YAAA,EAAA;;;;"}var {
 _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Check if Sentry auto-instrumentation should be disabled.
 *
 * @param getCurrentHub A method to fetch the current hub
 * @returns boolean
 */
function shouldDisableAutoInstrumentation(getCurrentHub) {
  const clientOptions = _optionalChain([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);
  const instrumenter = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.instrumenter]) || 'sentry';

  return instrumenter !== 'sentry';
}

exports.shouldDisableAutoInstrumentation = shouldDisableAutoInstrumentation;
//# sourceMappingURL=node-utils.js.map
{"version":3,"file":"node-utils.js","sources":["../../../../../src/node/integrations/utils/node-utils.ts"],"sourcesContent":["import type { Hub } from '@sentry/types';\n\n/**\n * Check if Sentry auto-instrumentation should be disabled.\n *\n * @param getCurrentHub A method to fetch the current hub\n * @returns boolean\n */\nexport function shouldDisableAutoInstrumentation(getCurrentHub: () => Hub): boolean {\n  const clientOptions = getCurrentHub().getClient()?.getOptions();\n  const instrumenter = clientOptions?.instrumenter || 'sentry';\n\n  return instrumenter !== 'sentry';\n}\n"],"names":[],"mappings":";;;;;;AAEA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA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,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,cAAA,CAAA,CAAA,aAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,QAAA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;;"}import { getActiveTransaction } from '@sentry/core';
import { logger } from '@sentry/utils';
import { WINDOW } from './types.js';

/**
 * Add a listener that cancels and finishes a transaction when the global
 * document is hidden.
 */
function registerBackgroundTabDetection() {
  if (WINDOW && WINDOW.document) {
    WINDOW.document.addEventListener('visibilitychange', () => {
      const activeTransaction = getActiveTransaction() ;
      if (WINDOW.document.hidden && activeTransaction) {
        const statusType = 'cancelled';

        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          logger.log(
            `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,
          );
        // We should not set status if it is already set, this prevent important statuses like
        // error or data loss from being overwritten on transaction.
        if (!activeTransaction.status) {
          activeTransaction.setStatus(statusType);
        }
        activeTransaction.setTag('visibilitychange', 'document.hidden');
        activeTransaction.finish();
      }
    });
  } else {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');
  }
}

export { registerBackgroundTabDetection };
//# sourceMappingURL=backgroundtab.js.map
{"version":3,"file":"backgroundtab.js","sources":["../../../src/browser/backgroundtab.ts"],"sourcesContent":["import type { IdleTransaction, SpanStatusType } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Add a listener that cancels and finishes a transaction when the global\n * document is hidden.\n */\nexport function registerBackgroundTabDetection(): void {\n  if (WINDOW && WINDOW.document) {\n    WINDOW.document.addEventListener('visibilitychange', () => {\n      const activeTransaction = getActiveTransaction() as IdleTransaction;\n      if (WINDOW.document.hidden && activeTransaction) {\n        const statusType: SpanStatusType = 'cancelled';\n\n        __DEBUG_BUILD__ &&\n          logger.log(\n            `[Tracing] Transaction: ${statusType} -> since tab moved to the background, op: ${activeTransaction.op}`,\n          );\n        // We should not set status if it is already set, this prevent important statuses like\n        // error or data loss from being overwritten on transaction.\n        if (!activeTransaction.status) {\n          activeTransaction.setStatus(statusType);\n        }\n        activeTransaction.setTag('visibilitychange', 'document.hidden');\n        activeTransaction.finish();\n      }\n    });\n  } else {\n    __DEBUG_BUILD__ &&\n      logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n  }\n}\n"],"names":[],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA,SAAA,8BAAA,GAAA;AACA,EAAA,IAAA,MAAA,IAAA,MAAA,CAAA,QAAA,EAAA;AACA,IAAA,MAAA,CAAA,QAAA,CAAA,gBAAA,CAAA,kBAAA,EAAA,MAAA;AACA,MAAA,MAAA,iBAAA,GAAA,oBAAA,EAAA,EAAA;AACA,MAAA,IAAA,MAAA,CAAA,QAAA,CAAA,MAAA,IAAA,iBAAA,EAAA;AACA,QAAA,MAAA,UAAA,GAAA,WAAA,CAAA;AACA;AACA,QAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,UAAA,MAAA,CAAA,GAAA;AACA,YAAA,CAAA,uBAAA,EAAA,UAAA,CAAA,2CAAA,EAAA,iBAAA,CAAA,EAAA,CAAA,CAAA;AACA,WAAA,CAAA;AACA;AACA;AACA,QAAA,IAAA,CAAA,iBAAA,CAAA,MAAA,EAAA;AACA,UAAA,iBAAA,CAAA,SAAA,CAAA,UAAA,CAAA,CAAA;AACA,SAAA;AACA,QAAA,iBAAA,CAAA,MAAA,CAAA,kBAAA,EAAA,iBAAA,CAAA,CAAA;AACA,QAAA,iBAAA,CAAA,MAAA,EAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,oFAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { TRACING_DEFAULTS, addTracingExtensions, extractTraceparentData, startIdleTransaction, getActiveTransaction } from '@sentry/core';
import { logger, baggageHeaderToDynamicSamplingContext, getDomElement } from '@sentry/utils';
import { registerBackgroundTabDetection } from './backgroundtab.js';
import { startTrackingWebVitals, startTrackingLongTasks, startTrackingInteractions, addPerformanceEntries } from './metrics/index.js';
import { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request.js';
import { instrumentRoutingWithDefaults } from './router.js';
import { WINDOW } from './types.js';

const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';

/** Options for Browser Tracing integration */

const DEFAULT_BROWSER_TRACING_OPTIONS = {
  ...TRACING_DEFAULTS,
  markBackgroundTransactions: true,
  routingInstrumentation: instrumentRoutingWithDefaults,
  startTransactionOnLocationChange: true,
  startTransactionOnPageLoad: true,
  enableLongTask: true,
  _experiments: {},
  ...defaultRequestInstrumentationOptions,
};

/**
 * The Browser Tracing integration automatically instruments browser pageload/navigation
 * actions as transactions, and captures requests, metrics and errors as spans.
 *
 * The integration can be configured with a variety of options, and can be extended to use
 * any routing library. This integration uses {@see IdleTransaction} to create transactions.
 */
class BrowserTracing  {
  // This class currently doesn't have a static `id` field like the other integration classes, because it prevented
  // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.
  // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all
  // integrations.

  /** Browser Tracing integration options */

  /**
   * @inheritDoc
   */
   __init() {this.name = BROWSER_TRACING_INTEGRATION_ID;}

   constructor(_options) {BrowserTracing.prototype.__init.call(this);
    addTracingExtensions();

    this.options = {
      ...DEFAULT_BROWSER_TRACING_OPTIONS,
      ..._options,
    };

    // Special case: enableLongTask can be set in _experiments
    // TODO (v8): Remove this in v8
    if (this.options._experiments.enableLongTask !== undefined) {
      this.options.enableLongTask = this.options._experiments.enableLongTask;
    }

    // TODO (v8): remove this block after tracingOrigins is removed
    // Set tracePropagationTargets to tracingOrigins if specified by the user
    // In case both are specified, tracePropagationTargets takes precedence
    // eslint-disable-next-line deprecation/deprecation
    if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {
      // eslint-disable-next-line deprecation/deprecation
      this.options.tracePropagationTargets = _options.tracingOrigins;
    }

    this._collectWebVitals = startTrackingWebVitals();
    if (this.options.enableLongTask) {
      startTrackingLongTasks();
    }
    if (this.options._experiments.enableInteractions) {
      startTrackingInteractions();
    }
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    this._getCurrentHub = getCurrentHub;

    const {
      routingInstrumentation: instrumentRouting,
      startTransactionOnLocationChange,
      startTransactionOnPageLoad,
      markBackgroundTransactions,
      traceFetch,
      traceXHR,
      tracePropagationTargets,
      shouldCreateSpanForRequest,
      _experiments,
    } = this.options;

    instrumentRouting(
      (context) => {
        const transaction = this._createRouteTransaction(context);

        this.options._experiments.onStartRouteTransaction &&
          this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);

        return transaction;
      },
      startTransactionOnPageLoad,
      startTransactionOnLocationChange,
    );

    if (markBackgroundTransactions) {
      registerBackgroundTabDetection();
    }

    if (_experiments.enableInteractions) {
      this._registerInteractionListener();
    }

    instrumentOutgoingRequests({
      traceFetch,
      traceXHR,
      tracePropagationTargets,
      shouldCreateSpanForRequest,
    });
  }

  /** Create routing idle transaction. */
   _createRouteTransaction(context) {
    if (!this._getCurrentHub) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);
      return undefined;
    }

    const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;

    const isPageloadTransaction = context.op === 'pageload';

    const sentryTraceMetaTagValue = isPageloadTransaction ? getMetaContent('sentry-trace') : null;
    const baggageMetaTagValue = isPageloadTransaction ? getMetaContent('baggage') : null;

    const traceParentData = sentryTraceMetaTagValue ? extractTraceparentData(sentryTraceMetaTagValue) : undefined;
    const dynamicSamplingContext = baggageMetaTagValue
      ? baggageHeaderToDynamicSamplingContext(baggageMetaTagValue)
      : undefined;

    const expandedContext = {
      ...context,
      ...traceParentData,
      metadata: {
        ...context.metadata,
        dynamicSamplingContext: traceParentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,
      },
      trimEnd: true,
    };

    const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;

    // For backwards compatibility reasons, beforeNavigate can return undefined to "drop" the transaction (prevent it
    // from being sent to Sentry).
    const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;

    // If `beforeNavigate` set a custom name, record that fact
    finalContext.metadata =
      finalContext.name !== expandedContext.name
        ? { ...finalContext.metadata, source: 'custom' }
        : finalContext.metadata;

    this._latestRouteName = finalContext.name;
    this._latestRouteSource = finalContext.metadata && finalContext.metadata.source;

    if (finalContext.sampled === false) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);

    const hub = this._getCurrentHub();
    const { location } = WINDOW;

    const idleTransaction = startIdleTransaction(
      hub,
      finalContext,
      idleTimeout,
      finalTimeout,
      true,
      { location }, // for use in the tracesSampler
      heartbeatInterval,
    );
    idleTransaction.registerBeforeFinishCallback(transaction => {
      this._collectWebVitals();
      addPerformanceEntries(transaction);
    });

    return idleTransaction ;
  }

  /** Start listener for interaction transactions */
   _registerInteractionListener() {
    let inflightInteractionTransaction;
    const registerInteractionTransaction = () => {
      const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;
      const op = 'ui.action.click';

      const currentTransaction = getActiveTransaction();
      if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          logger.warn(
            `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,
          );
        return undefined;
      }

      if (inflightInteractionTransaction) {
        inflightInteractionTransaction.setFinishReason('interactionInterrupted');
        inflightInteractionTransaction.finish();
        inflightInteractionTransaction = undefined;
      }

      if (!this._getCurrentHub) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);
        return undefined;
      }

      if (!this._latestRouteName) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
        return undefined;
      }

      const hub = this._getCurrentHub();
      const { location } = WINDOW;

      const context = {
        name: this._latestRouteName,
        op,
        trimEnd: true,
        metadata: {
          source: this._latestRouteSource || 'url',
        },
      };

      inflightInteractionTransaction = startIdleTransaction(
        hub,
        context,
        idleTimeout,
        finalTimeout,
        true,
        { location }, // for use in the tracesSampler
        heartbeatInterval,
      );
    };

    ['click'].forEach(type => {
      addEventListener(type, registerInteractionTransaction, { once: false, capture: true });
    });
  }
}

/** Returns the value of a meta tag */
function getMetaContent(metaName) {
  // Can't specify generic to `getDomElement` because tracing can be used
  // in a variety of environments, have to disable `no-unsafe-member-access`
  // as a result.
  const metaTag = getDomElement(`meta[name=${metaName}]`);
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return metaTag ? metaTag.getAttribute('content') : null;
}

export { BROWSER_TRACING_INTEGRATION_ID, BrowserTracing, getMetaContent };
//# sourceMappingURL=browsertracing.js.map
{"version":3,"file":"browsertracing.js","sources":["../../../src/browser/browsertracing.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Hub, IdleTransaction } from '@sentry/core';\nimport {\n  addTracingExtensions,\n  extractTraceparentData,\n  getActiveTransaction,\n  startIdleTransaction,\n  TRACING_DEFAULTS,\n} from '@sentry/core';\nimport type { EventProcessor, Integration, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { baggageHeaderToDynamicSamplingContext, getDomElement, logger } from '@sentry/utils';\n\nimport { registerBackgroundTabDetection } from './backgroundtab';\nimport {\n  addPerformanceEntries,\n  startTrackingInteractions,\n  startTrackingLongTasks,\n  startTrackingWebVitals,\n} from './metrics';\nimport type { RequestInstrumentationOptions } from './request';\nimport { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request';\nimport { instrumentRoutingWithDefaults } from './router';\nimport { WINDOW } from './types';\n\nexport const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';\n\n/** Options for Browser Tracing integration */\nexport interface BrowserTracingOptions extends RequestInstrumentationOptions {\n  /**\n   * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined\n   * by a moment where there are no in-progress spans.\n   *\n   * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.\n   * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.\n   * Time is in ms.\n   *\n   * Default: 1000\n   */\n  idleTimeout: number;\n\n  /**\n   * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it\n   * will be finished.\n   * Time is in ms.\n   *\n   * Default: 30000\n   */\n  finalTimeout: number;\n\n  /**\n   * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,\n   * the transaction will be finished.\n   * Time is in ms.\n   *\n   * Default: 5000\n   */\n  heartbeatInterval: number;\n\n  /**\n   * Flag to enable/disable creation of `navigation` transaction on history changes.\n   *\n   * Default: true\n   */\n  startTransactionOnLocationChange: boolean;\n\n  /**\n   * Flag to enable/disable creation of `pageload` transaction on first pageload.\n   *\n   * Default: true\n   */\n  startTransactionOnPageLoad: boolean;\n\n  /**\n   * Flag Transactions where tabs moved to background with \"cancelled\". Browser background tab timing is\n   * not suited towards doing precise measurements of operations. By default, we recommend that this option\n   * be enabled as background transactions can mess up your statistics in nondeterministic ways.\n   *\n   * Default: true\n   */\n  markBackgroundTransactions: boolean;\n\n  /**\n   * If true, Sentry will capture long tasks and add them to the corresponding transaction.\n   *\n   * Default: true\n   */\n  enableLongTask: boolean;\n\n  /**\n   * _metricOptions allows the user to send options to change how metrics are collected.\n   *\n   * _metricOptions is currently experimental.\n   *\n   * Default: undefined\n   */\n  _metricOptions?: Partial<{\n    /**\n     * @deprecated This property no longer has any effect and will be removed in v8.\n     */\n    _reportAllChanges: boolean;\n  }>;\n\n  /**\n   * _experiments allows the user to send options to define how this integration works.\n   * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.\n   *\n   * TODO (v8): Remove enableLongTask\n   *\n   * Default: undefined\n   */\n  _experiments: Partial<{\n    enableLongTask: boolean;\n    enableInteractions: boolean;\n    onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;\n  }>;\n\n  /**\n   * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction\n   * context data, or drop the transaction entirely (by setting `sampled = false` in the context).\n   *\n   * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.\n   *\n   * @param context: The context data which will be passed to `startTransaction` by default\n   *\n   * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.\n   */\n  beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;\n\n  /**\n   * Instrumentation that creates routing change transactions. By default creates\n   * pageload and navigation transactions.\n   */\n  routingInstrumentation<T extends Transaction>(\n    this: void,\n    customStartTransaction: (context: TransactionContext) => T | undefined,\n    startTransactionOnPageLoad?: boolean,\n    startTransactionOnLocationChange?: boolean,\n  ): void;\n}\n\nconst DEFAULT_BROWSER_TRACING_OPTIONS: BrowserTracingOptions = {\n  ...TRACING_DEFAULTS,\n  markBackgroundTransactions: true,\n  routingInstrumentation: instrumentRoutingWithDefaults,\n  startTransactionOnLocationChange: true,\n  startTransactionOnPageLoad: true,\n  enableLongTask: true,\n  _experiments: {},\n  ...defaultRequestInstrumentationOptions,\n};\n\n/**\n * The Browser Tracing integration automatically instruments browser pageload/navigation\n * actions as transactions, and captures requests, metrics and errors as spans.\n *\n * The integration can be configured with a variety of options, and can be extended to use\n * any routing library. This integration uses {@see IdleTransaction} to create transactions.\n */\nexport class BrowserTracing implements Integration {\n  // This class currently doesn't have a static `id` field like the other integration classes, because it prevented\n  // @sentry/tracing from being treeshaken. Tree shakers do not like static fields, because they behave like side effects.\n  // TODO: Come up with a better plan, than using static fields on integration classes, and use that plan on all\n  // integrations.\n\n  /** Browser Tracing integration options */\n  public options: BrowserTracingOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = BROWSER_TRACING_INTEGRATION_ID;\n\n  private _getCurrentHub?: () => Hub;\n\n  private _latestRouteName?: string;\n  private _latestRouteSource?: TransactionSource;\n\n  private _collectWebVitals: () => void;\n\n  public constructor(_options?: Partial<BrowserTracingOptions>) {\n    addTracingExtensions();\n\n    this.options = {\n      ...DEFAULT_BROWSER_TRACING_OPTIONS,\n      ..._options,\n    };\n\n    // Special case: enableLongTask can be set in _experiments\n    // TODO (v8): Remove this in v8\n    if (this.options._experiments.enableLongTask !== undefined) {\n      this.options.enableLongTask = this.options._experiments.enableLongTask;\n    }\n\n    // TODO (v8): remove this block after tracingOrigins is removed\n    // Set tracePropagationTargets to tracingOrigins if specified by the user\n    // In case both are specified, tracePropagationTargets takes precedence\n    // eslint-disable-next-line deprecation/deprecation\n    if (_options && !_options.tracePropagationTargets && _options.tracingOrigins) {\n      // eslint-disable-next-line deprecation/deprecation\n      this.options.tracePropagationTargets = _options.tracingOrigins;\n    }\n\n    this._collectWebVitals = startTrackingWebVitals();\n    if (this.options.enableLongTask) {\n      startTrackingLongTasks();\n    }\n    if (this.options._experiments.enableInteractions) {\n      startTrackingInteractions();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this._getCurrentHub = getCurrentHub;\n\n    const {\n      routingInstrumentation: instrumentRouting,\n      startTransactionOnLocationChange,\n      startTransactionOnPageLoad,\n      markBackgroundTransactions,\n      traceFetch,\n      traceXHR,\n      tracePropagationTargets,\n      shouldCreateSpanForRequest,\n      _experiments,\n    } = this.options;\n\n    instrumentRouting(\n      (context: TransactionContext) => {\n        const transaction = this._createRouteTransaction(context);\n\n        this.options._experiments.onStartRouteTransaction &&\n          this.options._experiments.onStartRouteTransaction(transaction, context, getCurrentHub);\n\n        return transaction;\n      },\n      startTransactionOnPageLoad,\n      startTransactionOnLocationChange,\n    );\n\n    if (markBackgroundTransactions) {\n      registerBackgroundTabDetection();\n    }\n\n    if (_experiments.enableInteractions) {\n      this._registerInteractionListener();\n    }\n\n    instrumentOutgoingRequests({\n      traceFetch,\n      traceXHR,\n      tracePropagationTargets,\n      shouldCreateSpanForRequest,\n    });\n  }\n\n  /** Create routing idle transaction. */\n  private _createRouteTransaction(context: TransactionContext): Transaction | undefined {\n    if (!this._getCurrentHub) {\n      __DEBUG_BUILD__ &&\n        logger.warn(`[Tracing] Did not create ${context.op} transaction because _getCurrentHub is invalid.`);\n      return undefined;\n    }\n\n    const { beforeNavigate, idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n\n    const isPageloadTransaction = context.op === 'pageload';\n\n    const sentryTraceMetaTagValue = isPageloadTransaction ? getMetaContent('sentry-trace') : null;\n    const baggageMetaTagValue = isPageloadTransaction ? getMetaContent('baggage') : null;\n\n    const traceParentData = sentryTraceMetaTagValue ? extractTraceparentData(sentryTraceMetaTagValue) : undefined;\n    const dynamicSamplingContext = baggageMetaTagValue\n      ? baggageHeaderToDynamicSamplingContext(baggageMetaTagValue)\n      : undefined;\n\n    const expandedContext: TransactionContext = {\n      ...context,\n      ...traceParentData,\n      metadata: {\n        ...context.metadata,\n        dynamicSamplingContext: traceParentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n      },\n      trimEnd: true,\n    };\n\n    const modifiedContext = typeof beforeNavigate === 'function' ? beforeNavigate(expandedContext) : expandedContext;\n\n    // For backwards compatibility reasons, beforeNavigate can return undefined to \"drop\" the transaction (prevent it\n    // from being sent to Sentry).\n    const finalContext = modifiedContext === undefined ? { ...expandedContext, sampled: false } : modifiedContext;\n\n    // If `beforeNavigate` set a custom name, record that fact\n    finalContext.metadata =\n      finalContext.name !== expandedContext.name\n        ? { ...finalContext.metadata, source: 'custom' }\n        : finalContext.metadata;\n\n    this._latestRouteName = finalContext.name;\n    this._latestRouteSource = finalContext.metadata && finalContext.metadata.source;\n\n    if (finalContext.sampled === false) {\n      __DEBUG_BUILD__ &&\n        logger.log(`[Tracing] Will not send ${finalContext.op} transaction because of beforeNavigate.`);\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Starting ${finalContext.op} transaction on scope`);\n\n    const hub = this._getCurrentHub();\n    const { location } = WINDOW;\n\n    const idleTransaction = startIdleTransaction(\n      hub,\n      finalContext,\n      idleTimeout,\n      finalTimeout,\n      true,\n      { location }, // for use in the tracesSampler\n      heartbeatInterval,\n    );\n    idleTransaction.registerBeforeFinishCallback(transaction => {\n      this._collectWebVitals();\n      addPerformanceEntries(transaction);\n    });\n\n    return idleTransaction as Transaction;\n  }\n\n  /** Start listener for interaction transactions */\n  private _registerInteractionListener(): void {\n    let inflightInteractionTransaction: IdleTransaction | undefined;\n    const registerInteractionTransaction = (): void => {\n      const { idleTimeout, finalTimeout, heartbeatInterval } = this.options;\n      const op = 'ui.action.click';\n\n      const currentTransaction = getActiveTransaction();\n      if (currentTransaction && currentTransaction.op && ['navigation', 'pageload'].includes(currentTransaction.op)) {\n        __DEBUG_BUILD__ &&\n          logger.warn(\n            `[Tracing] Did not create ${op} transaction because a pageload or navigation transaction is in progress.`,\n          );\n        return undefined;\n      }\n\n      if (inflightInteractionTransaction) {\n        inflightInteractionTransaction.setFinishReason('interactionInterrupted');\n        inflightInteractionTransaction.finish();\n        inflightInteractionTransaction = undefined;\n      }\n\n      if (!this._getCurrentHub) {\n        __DEBUG_BUILD__ && logger.warn(`[Tracing] Did not create ${op} transaction because _getCurrentHub is invalid.`);\n        return undefined;\n      }\n\n      if (!this._latestRouteName) {\n        __DEBUG_BUILD__ &&\n          logger.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);\n        return undefined;\n      }\n\n      const hub = this._getCurrentHub();\n      const { location } = WINDOW;\n\n      const context: TransactionContext = {\n        name: this._latestRouteName,\n        op,\n        trimEnd: true,\n        metadata: {\n          source: this._latestRouteSource || 'url',\n        },\n      };\n\n      inflightInteractionTransaction = startIdleTransaction(\n        hub,\n        context,\n        idleTimeout,\n        finalTimeout,\n        true,\n        { location }, // for use in the tracesSampler\n        heartbeatInterval,\n      );\n    };\n\n    ['click'].forEach(type => {\n      addEventListener(type, registerInteractionTransaction, { once: false, capture: true });\n    });\n  }\n}\n\n/** Returns the value of a meta tag */\nexport function getMetaContent(metaName: string): string | null {\n  // Can't specify generic to `getDomElement` because tracing can be used\n  // in a variety of environments, have to disable `no-unsafe-member-access`\n  // as a result.\n  const metaTag = getDomElement(`meta[name=${metaName}]`);\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return metaTag ? metaTag.getAttribute('content') : null;\n}\n"],"names":[],"mappings":";;;;;;;;AAwBA,MAAA,8BAAA,GAAA,iBAAA;AACA;AACA;;AAkHA,MAAA,+BAAA,GAAA;AACA,EAAA,GAAA,gBAAA;AACA,EAAA,0BAAA,EAAA,IAAA;AACA,EAAA,sBAAA,EAAA,6BAAA;AACA,EAAA,gCAAA,EAAA,IAAA;AACA,EAAA,0BAAA,EAAA,IAAA;AACA,EAAA,cAAA,EAAA,IAAA;AACA,EAAA,YAAA,EAAA,EAAA;AACA,EAAA,GAAA,oCAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,+BAAA,CAAA;;AASA,GAAA,WAAA,CAAA,QAAA,EAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,oBAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA;AACA,MAAA,GAAA,+BAAA;AACA,MAAA,GAAA,QAAA;AACA,KAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,OAAA,CAAA,YAAA,CAAA,cAAA,KAAA,SAAA,EAAA;AACA,MAAA,IAAA,CAAA,OAAA,CAAA,cAAA,GAAA,IAAA,CAAA,OAAA,CAAA,YAAA,CAAA,cAAA,CAAA;AACA,KAAA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,IAAA,QAAA,IAAA,CAAA,QAAA,CAAA,uBAAA,IAAA,QAAA,CAAA,cAAA,EAAA;AACA;AAC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,CAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA,GAAA,OAAA,CAAA,YAAA,CAAA,SAAA,CAAA,GAAA,IAAA,CAAA;AACA;;;;"}import { getActiveTransaction } from '@sentry/core';
import { browserPerformanceTimeOrigin, logger, htmlTreeAsString } from '@sentry/utils';
import { WINDOW } from '../types.js';
import { onCLS } from '../web-vitals/getCLS.js';
import { onFID } from '../web-vitals/getFID.js';
import { onLCP } from '../web-vitals/getLCP.js';
import { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher.js';
import { observe } from '../web-vitals/lib/observe.js';
import { _startChild, isMeasurementValue } from './utils.js';

/**
 * Converts from milliseconds to seconds
 * @param time time in ms
 */
function msToSec(time) {
  return time / 1000;
}

function getBrowserPerformanceAPI() {
  return WINDOW && WINDOW.addEventListener && WINDOW.performance;
}

let _performanceCursor = 0;

let _measurements = {};
let _lcpEntry;
let _clsEntry;

/**
 * Start tracking web vitals
 *
 * @returns A function that forces web vitals collection
 */
function startTrackingWebVitals() {
  const performance = getBrowserPerformanceAPI();
  if (performance && browserPerformanceTimeOrigin) {
    if (performance.mark) {
      WINDOW.performance.mark('sentry-tracing-init');
    }
    _trackFID();
    const clsCallback = _trackCLS();
    const lcpCallback = _trackLCP();

    return () => {
      if (clsCallback) {
        clsCallback();
      }
      if (lcpCallback) {
        lcpCallback();
      }
    };
  }

  return () => undefined;
}

/**
 * Start tracking long tasks.
 */
function startTrackingLongTasks() {
  const entryHandler = (entries) => {
    for (const entry of entries) {
      const transaction = getActiveTransaction() ;
      if (!transaction) {
        return;
      }
      const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);
      const duration = msToSec(entry.duration);

      transaction.startChild({
        description: 'Main UI thread blocked',
        op: 'ui.long-task',
        startTimestamp: startTime,
        endTimestamp: startTime + duration,
      });
    }
  };

  observe('longtask', entryHandler);
}

/**
 * Start tracking interaction events.
 */
function startTrackingInteractions() {
  const entryHandler = (entries) => {
    for (const entry of entries) {
      const transaction = getActiveTransaction() ;
      if (!transaction) {
        return;
      }

      if (entry.name === 'click') {
        const startTime = msToSec((browserPerformanceTimeOrigin ) + entry.startTime);
        const duration = msToSec(entry.duration);

        transaction.startChild({
          description: htmlTreeAsString(entry.target),
          op: `ui.interaction.${entry.name}`,
          startTimestamp: startTime,
          endTimestamp: startTime + duration,
        });
      }
    }
  };

  observe('event', entryHandler, { durationThreshold: 0 });
}

/** Starts tracking the Cumulative Layout Shift on the current page. */
function _trackCLS() {
  // See:
  // https://web.dev/evolving-cls/
  // https://web.dev/cls-web-tooling/
  return onCLS(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding CLS');
    _measurements['cls'] = { value: metric.value, unit: '' };
    _clsEntry = entry ;
  });
}

/** Starts tracking the Largest Contentful Paint on the current page. */
function _trackLCP() {
  return onLCP(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding LCP');
    _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };
    _lcpEntry = entry ;
  });
}

/** Starts tracking the First Input Delay on the current page. */
function _trackFID() {
  onFID(metric => {
    const entry = metric.entries.pop();
    if (!entry) {
      return;
    }

    const timeOrigin = msToSec(browserPerformanceTimeOrigin );
    const startTime = msToSec(entry.startTime);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FID');
    _measurements['fid'] = { value: metric.value, unit: 'millisecond' };
    _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };
  });
}

/** Add performance related spans to a transaction */
function addPerformanceEntries(transaction) {
  const performance = getBrowserPerformanceAPI();
  if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {
    // Gatekeeper if performance API not available
    return;
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Adding & adjusting spans using Performance API');
  const timeOrigin = msToSec(browserPerformanceTimeOrigin);

  const performanceEntries = performance.getEntries();

  let responseStartTimestamp;
  let requestStartTimestamp;

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  performanceEntries.slice(_performanceCursor).forEach((entry) => {
    const startTime = msToSec(entry.startTime);
    const duration = msToSec(entry.duration);

    if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {
      return;
    }

    switch (entry.entryType) {
      case 'navigation': {
        _addNavigationSpans(transaction, entry, timeOrigin);
        responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);
        requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);
        break;
      }
      case 'mark':
      case 'paint':
      case 'measure': {
        _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);

        // capture web vitals
        const firstHidden = getVisibilityWatcher();
        // Only report if the page wasn't hidden prior to the web vital.
        const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;

        if (entry.name === 'first-paint' && shouldRecord) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FP');
          _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };
        }
        if (entry.name === 'first-contentful-paint' && shouldRecord) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding FCP');
          _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };
        }
        break;
      }
      case 'resource': {
        const resourceName = (entry.name ).replace(WINDOW.location.origin, '');
        _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);
        break;
      }
      // Ignore other entry types.
    }
  });

  _performanceCursor = Math.max(performanceEntries.length - 1, 0);

  _trackNavigator(transaction);

  // Measurements are only available for pageload transactions
  if (transaction.op === 'pageload') {
    // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the
    // start of the response in milliseconds
    if (typeof responseStartTimestamp === 'number') {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding TTFB');
      _measurements['ttfb'] = {
        value: (responseStartTimestamp - transaction.startTimestamp) * 1000,
        unit: 'millisecond',
      };

      if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {
        // Capture the time spent making the request and receiving the first byte of the response.
        // This is the time between the start of the request and the start of the response in milliseconds.
        _measurements['ttfb.requestTime'] = {
          value: (responseStartTimestamp - requestStartTimestamp) * 1000,
          unit: 'millisecond',
        };
      }
    }

    ['fcp', 'fp', 'lcp'].forEach(name => {
      if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {
        return;
      }
      // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.
      // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need
      // to be adjusted to be relative to transaction.startTimestamp.
      const oldValue = _measurements[name].value;
      const measurementTimestamp = timeOrigin + msToSec(oldValue);

      // normalizedValue should be in milliseconds
      const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);
      const delta = normalizedValue - oldValue;

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);
      _measurements[name].value = normalizedValue;
    });

    const fidMark = _measurements['mark.fid'];
    if (fidMark && _measurements['fid']) {
      // create span for FID
      _startChild(transaction, {
        description: 'first input delay',
        endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),
        op: 'ui.action',
        startTimestamp: fidMark.value,
      });

      // Delete mark.fid as we don't want it to be part of final payload
      delete _measurements['mark.fid'];
    }

    // If FCP is not recorded we should not record the cls value
    // according to the new definition of CLS.
    if (!('fcp' in _measurements)) {
      delete _measurements.cls;
    }

    Object.keys(_measurements).forEach(measurementName => {
      transaction.setMeasurement(
        measurementName,
        _measurements[measurementName].value,
        _measurements[measurementName].unit,
      );
    });

    _tagMetricInfo(transaction);
  }

  _lcpEntry = undefined;
  _clsEntry = undefined;
  _measurements = {};
}

/** Create measure related spans */
function _addMeasureSpans(
  transaction,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  entry,
  startTime,
  duration,
  timeOrigin,
) {
  const measureStartTimestamp = timeOrigin + startTime;
  const measureEndTimestamp = measureStartTimestamp + duration;

  _startChild(transaction, {
    description: entry.name ,
    endTimestamp: measureEndTimestamp,
    op: entry.entryType ,
    startTimestamp: measureStartTimestamp,
  });

  return measureStartTimestamp;
}

/** Instrument navigation entries */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _addNavigationSpans(transaction, entry, timeOrigin) {
  ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {
    _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);
  });
  _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');
  _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');
  _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');
  _addRequest(transaction, entry, timeOrigin);
}

/** Create performance navigation related spans */
function _addPerformanceNavigationTiming(
  transaction,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  entry,
  event,
  timeOrigin,
  description,
  eventEnd,
) {
  const end = eventEnd ? (entry[eventEnd] ) : (entry[`${event}End`] );
  const start = entry[`${event}Start`] ;
  if (!start || !end) {
    return;
  }
  _startChild(transaction, {
    op: 'browser',
    description: description || event,
    startTimestamp: timeOrigin + msToSec(start),
    endTimestamp: timeOrigin + msToSec(end),
  });
}

/** Create request and response related spans */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _addRequest(transaction, entry, timeOrigin) {
  _startChild(transaction, {
    op: 'browser',
    description: 'request',
    startTimestamp: timeOrigin + msToSec(entry.requestStart ),
    endTimestamp: timeOrigin + msToSec(entry.responseEnd ),
  });

  _startChild(transaction, {
    op: 'browser',
    description: 'response',
    startTimestamp: timeOrigin + msToSec(entry.responseStart ),
    endTimestamp: timeOrigin + msToSec(entry.responseEnd ),
  });
}

/** Create resource-related spans */
function _addResourceSpans(
  transaction,
  entry,
  resourceName,
  startTime,
  duration,
  timeOrigin,
) {
  // we already instrument based on fetch and xhr, so we don't need to
  // duplicate spans here.
  if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {
    return;
  }

  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const data = {};
  if ('transferSize' in entry) {
    data['Transfer Size'] = entry.transferSize;
  }
  if ('encodedBodySize' in entry) {
    data['Encoded Body Size'] = entry.encodedBodySize;
  }
  if ('decodedBodySize' in entry) {
    data['Decoded Body Size'] = entry.decodedBodySize;
  }
  if ('renderBlockingStatus' in entry) {
    data['resource.render_blocking_status'] = entry.renderBlockingStatus;
  }

  const startTimestamp = timeOrigin + startTime;
  const endTimestamp = startTimestamp + duration;

  _startChild(transaction, {
    description: resourceName,
    endTimestamp,
    op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',
    startTimestamp,
    data,
  });
}

/**
 * Capture the information of the user agent.
 */
function _trackNavigator(transaction) {
  const navigator = WINDOW.navigator ;
  if (!navigator) {
    return;
  }

  // track network connectivity
  const connection = navigator.connection;
  if (connection) {
    if (connection.effectiveType) {
      transaction.setTag('effectiveConnectionType', connection.effectiveType);
    }

    if (connection.type) {
      transaction.setTag('connectionType', connection.type);
    }

    if (isMeasurementValue(connection.rtt)) {
      _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };
    }
  }

  if (isMeasurementValue(navigator.deviceMemory)) {
    transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);
  }

  if (isMeasurementValue(navigator.hardwareConcurrency)) {
    transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));
  }
}

/** Add LCP / CLS data to transaction to allow debugging */
function _tagMetricInfo(transaction) {
  if (_lcpEntry) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding LCP Data');

    // Capture Properties of the LCP element that contributes to the LCP.

    if (_lcpEntry.element) {
      transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));
    }

    if (_lcpEntry.id) {
      transaction.setTag('lcp.id', _lcpEntry.id);
    }

    if (_lcpEntry.url) {
      // Trim URL to the first 200 characters.
      transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));
    }

    transaction.setTag('lcp.size', _lcpEntry.size);
  }

  // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift
  if (_clsEntry && _clsEntry.sources) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Measurements] Adding CLS Data');
    _clsEntry.sources.forEach((source, index) =>
      transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),
    );
  }
}

export { _addMeasureSpans, _addResourceSpans, addPerformanceEntries, startTrackingInteractions, startTrackingLongTasks, startTrackingWebVitals };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../../src/browser/metrics/index.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { IdleTransaction, Transaction } from '@sentry/core';\nimport { getActiveTransaction } from '@sentry/core';\nimport type { Measurements } from '@sentry/types';\nimport { browserPerformanceTimeOrigin, htmlTreeAsString, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../types';\nimport { onCLS } from '../web-vitals/getCLS';\nimport { onFID } from '../web-vitals/getFID';\nimport { onLCP } from '../web-vitals/getLCP';\nimport { getVisibilityWatcher } from '../web-vitals/lib/getVisibilityWatcher';\nimport { observe } from '../web-vitals/lib/observe';\nimport type { NavigatorDeviceMemory, NavigatorNetworkInformation } from '../web-vitals/types';\nimport { _startChild, isMeasurementValue } from './utils';\n\n/**\n * Converts from milliseconds to seconds\n * @param time time in ms\n */\nfunction msToSec(time: number): number {\n  return time / 1000;\n}\n\nfunction getBrowserPerformanceAPI(): Performance | undefined {\n  return WINDOW && WINDOW.addEventListener && WINDOW.performance;\n}\n\nlet _performanceCursor: number = 0;\n\nlet _measurements: Measurements = {};\nlet _lcpEntry: LargestContentfulPaint | undefined;\nlet _clsEntry: LayoutShift | undefined;\n\n/**\n * Start tracking web vitals\n *\n * @returns A function that forces web vitals collection\n */\nexport function startTrackingWebVitals(): () => void {\n  const performance = getBrowserPerformanceAPI();\n  if (performance && browserPerformanceTimeOrigin) {\n    if (performance.mark) {\n      WINDOW.performance.mark('sentry-tracing-init');\n    }\n    _trackFID();\n    const clsCallback = _trackCLS();\n    const lcpCallback = _trackLCP();\n\n    return (): void => {\n      if (clsCallback) {\n        clsCallback();\n      }\n      if (lcpCallback) {\n        lcpCallback();\n      }\n    };\n  }\n\n  return () => undefined;\n}\n\n/**\n * Start tracking long tasks.\n */\nexport function startTrackingLongTasks(): void {\n  const entryHandler = (entries: PerformanceEntry[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n      const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n      const duration = msToSec(entry.duration);\n\n      transaction.startChild({\n        description: 'Main UI thread blocked',\n        op: 'ui.long-task',\n        startTimestamp: startTime,\n        endTimestamp: startTime + duration,\n      });\n    }\n  };\n\n  observe('longtask', entryHandler);\n}\n\n/**\n * Start tracking interaction events.\n */\nexport function startTrackingInteractions(): void {\n  const entryHandler = (entries: PerformanceEventTiming[]): void => {\n    for (const entry of entries) {\n      const transaction = getActiveTransaction() as IdleTransaction | undefined;\n      if (!transaction) {\n        return;\n      }\n\n      if (entry.name === 'click') {\n        const startTime = msToSec((browserPerformanceTimeOrigin as number) + entry.startTime);\n        const duration = msToSec(entry.duration);\n\n        transaction.startChild({\n          description: htmlTreeAsString(entry.target),\n          op: `ui.interaction.${entry.name}`,\n          startTimestamp: startTime,\n          endTimestamp: startTime + duration,\n        });\n      }\n    }\n  };\n\n  observe('event', entryHandler, { durationThreshold: 0 });\n}\n\n/** Starts tracking the Cumulative Layout Shift on the current page. */\nfunction _trackCLS(): ReturnType<typeof onCLS> {\n  // See:\n  // https://web.dev/evolving-cls/\n  // https://web.dev/cls-web-tooling/\n  return onCLS(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS');\n    _measurements['cls'] = { value: metric.value, unit: '' };\n    _clsEntry = entry as LayoutShift;\n  });\n}\n\n/** Starts tracking the Largest Contentful Paint on the current page. */\nfunction _trackLCP(): ReturnType<typeof onLCP> {\n  return onLCP(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP');\n    _measurements['lcp'] = { value: metric.value, unit: 'millisecond' };\n    _lcpEntry = entry as LargestContentfulPaint;\n  });\n}\n\n/** Starts tracking the First Input Delay on the current page. */\nfunction _trackFID(): void {\n  onFID(metric => {\n    const entry = metric.entries.pop();\n    if (!entry) {\n      return;\n    }\n\n    const timeOrigin = msToSec(browserPerformanceTimeOrigin as number);\n    const startTime = msToSec(entry.startTime);\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding FID');\n    _measurements['fid'] = { value: metric.value, unit: 'millisecond' };\n    _measurements['mark.fid'] = { value: timeOrigin + startTime, unit: 'second' };\n  });\n}\n\n/** Add performance related spans to a transaction */\nexport function addPerformanceEntries(transaction: Transaction): void {\n  const performance = getBrowserPerformanceAPI();\n  if (!performance || !WINDOW.performance.getEntries || !browserPerformanceTimeOrigin) {\n    // Gatekeeper if performance API not available\n    return;\n  }\n\n  __DEBUG_BUILD__ && logger.log('[Tracing] Adding & adjusting spans using Performance API');\n  const timeOrigin = msToSec(browserPerformanceTimeOrigin);\n\n  const performanceEntries = performance.getEntries();\n\n  let responseStartTimestamp: number | undefined;\n  let requestStartTimestamp: number | undefined;\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  performanceEntries.slice(_performanceCursor).forEach((entry: Record<string, any>) => {\n    const startTime = msToSec(entry.startTime);\n    const duration = msToSec(entry.duration);\n\n    if (transaction.op === 'navigation' && timeOrigin + startTime < transaction.startTimestamp) {\n      return;\n    }\n\n    switch (entry.entryType) {\n      case 'navigation': {\n        _addNavigationSpans(transaction, entry, timeOrigin);\n        responseStartTimestamp = timeOrigin + msToSec(entry.responseStart);\n        requestStartTimestamp = timeOrigin + msToSec(entry.requestStart);\n        break;\n      }\n      case 'mark':\n      case 'paint':\n      case 'measure': {\n        _addMeasureSpans(transaction, entry, startTime, duration, timeOrigin);\n\n        // capture web vitals\n        const firstHidden = getVisibilityWatcher();\n        // Only report if the page wasn't hidden prior to the web vital.\n        const shouldRecord = entry.startTime < firstHidden.firstHiddenTime;\n\n        if (entry.name === 'first-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FP');\n          _measurements['fp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        if (entry.name === 'first-contentful-paint' && shouldRecord) {\n          __DEBUG_BUILD__ && logger.log('[Measurements] Adding FCP');\n          _measurements['fcp'] = { value: entry.startTime, unit: 'millisecond' };\n        }\n        break;\n      }\n      case 'resource': {\n        const resourceName = (entry.name as string).replace(WINDOW.location.origin, '');\n        _addResourceSpans(transaction, entry, resourceName, startTime, duration, timeOrigin);\n        break;\n      }\n      default:\n      // Ignore other entry types.\n    }\n  });\n\n  _performanceCursor = Math.max(performanceEntries.length - 1, 0);\n\n  _trackNavigator(transaction);\n\n  // Measurements are only available for pageload transactions\n  if (transaction.op === 'pageload') {\n    // Generate TTFB (Time to First Byte), which measured as the time between the beginning of the transaction and the\n    // start of the response in milliseconds\n    if (typeof responseStartTimestamp === 'number') {\n      __DEBUG_BUILD__ && logger.log('[Measurements] Adding TTFB');\n      _measurements['ttfb'] = {\n        value: (responseStartTimestamp - transaction.startTimestamp) * 1000,\n        unit: 'millisecond',\n      };\n\n      if (typeof requestStartTimestamp === 'number' && requestStartTimestamp <= responseStartTimestamp) {\n        // Capture the time spent making the request and receiving the first byte of the response.\n        // This is the time between the start of the request and the start of the response in milliseconds.\n        _measurements['ttfb.requestTime'] = {\n          value: (responseStartTimestamp - requestStartTimestamp) * 1000,\n          unit: 'millisecond',\n        };\n      }\n    }\n\n    ['fcp', 'fp', 'lcp'].forEach(name => {\n      if (!_measurements[name] || timeOrigin >= transaction.startTimestamp) {\n        return;\n      }\n      // The web vitals, fcp, fp, lcp, and ttfb, all measure relative to timeOrigin.\n      // Unfortunately, timeOrigin is not captured within the transaction span data, so these web vitals will need\n      // to be adjusted to be relative to transaction.startTimestamp.\n      const oldValue = _measurements[name].value;\n      const measurementTimestamp = timeOrigin + msToSec(oldValue);\n\n      // normalizedValue should be in milliseconds\n      const normalizedValue = Math.abs((measurementTimestamp - transaction.startTimestamp) * 1000);\n      const delta = normalizedValue - oldValue;\n\n      __DEBUG_BUILD__ &&\n        logger.log(`[Measurements] Normalized ${name} from ${oldValue} to ${normalizedValue} (${delta})`);\n      _measurements[name].value = normalizedValue;\n    });\n\n    const fidMark = _measurements['mark.fid'];\n    if (fidMark && _measurements['fid']) {\n      // create span for FID\n      _startChild(transaction, {\n        description: 'first input delay',\n        endTimestamp: fidMark.value + msToSec(_measurements['fid'].value),\n        op: 'ui.action',\n        startTimestamp: fidMark.value,\n      });\n\n      // Delete mark.fid as we don't want it to be part of final payload\n      delete _measurements['mark.fid'];\n    }\n\n    // If FCP is not recorded we should not record the cls value\n    // according to the new definition of CLS.\n    if (!('fcp' in _measurements)) {\n      delete _measurements.cls;\n    }\n\n    Object.keys(_measurements).forEach(measurementName => {\n      transaction.setMeasurement(\n        measurementName,\n        _measurements[measurementName].value,\n        _measurements[measurementName].unit,\n      );\n    });\n\n    _tagMetricInfo(transaction);\n  }\n\n  _lcpEntry = undefined;\n  _clsEntry = undefined;\n  _measurements = {};\n}\n\n/** Create measure related spans */\nexport function _addMeasureSpans(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): number {\n  const measureStartTimestamp = timeOrigin + startTime;\n  const measureEndTimestamp = measureStartTimestamp + duration;\n\n  _startChild(transaction, {\n    description: entry.name as string,\n    endTimestamp: measureEndTimestamp,\n    op: entry.entryType as string,\n    startTimestamp: measureStartTimestamp,\n  });\n\n  return measureStartTimestamp;\n}\n\n/** Instrument navigation entries */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addNavigationSpans(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  ['unloadEvent', 'redirect', 'domContentLoadedEvent', 'loadEvent', 'connect'].forEach(event => {\n    _addPerformanceNavigationTiming(transaction, entry, event, timeOrigin);\n  });\n  _addPerformanceNavigationTiming(transaction, entry, 'secureConnection', timeOrigin, 'TLS/SSL', 'connectEnd');\n  _addPerformanceNavigationTiming(transaction, entry, 'fetch', timeOrigin, 'cache', 'domainLookupStart');\n  _addPerformanceNavigationTiming(transaction, entry, 'domainLookup', timeOrigin, 'DNS');\n  _addRequest(transaction, entry, timeOrigin);\n}\n\n/** Create performance navigation related spans */\nfunction _addPerformanceNavigationTiming(\n  transaction: Transaction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  entry: Record<string, any>,\n  event: string,\n  timeOrigin: number,\n  description?: string,\n  eventEnd?: string,\n): void {\n  const end = eventEnd ? (entry[eventEnd] as number | undefined) : (entry[`${event}End`] as number | undefined);\n  const start = entry[`${event}Start`] as number | undefined;\n  if (!start || !end) {\n    return;\n  }\n  _startChild(transaction, {\n    op: 'browser',\n    description: description || event,\n    startTimestamp: timeOrigin + msToSec(start),\n    endTimestamp: timeOrigin + msToSec(end),\n  });\n}\n\n/** Create request and response related spans */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _addRequest(transaction: Transaction, entry: Record<string, any>, timeOrigin: number): void {\n  _startChild(transaction, {\n    op: 'browser',\n    description: 'request',\n    startTimestamp: timeOrigin + msToSec(entry.requestStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n\n  _startChild(transaction, {\n    op: 'browser',\n    description: 'response',\n    startTimestamp: timeOrigin + msToSec(entry.responseStart as number),\n    endTimestamp: timeOrigin + msToSec(entry.responseEnd as number),\n  });\n}\n\nexport interface ResourceEntry extends Record<string, unknown> {\n  initiatorType?: string;\n  transferSize?: number;\n  encodedBodySize?: number;\n  decodedBodySize?: number;\n  renderBlockingStatus?: string;\n}\n\n/** Create resource-related spans */\nexport function _addResourceSpans(\n  transaction: Transaction,\n  entry: ResourceEntry,\n  resourceName: string,\n  startTime: number,\n  duration: number,\n  timeOrigin: number,\n): void {\n  // we already instrument based on fetch and xhr, so we don't need to\n  // duplicate spans here.\n  if (entry.initiatorType === 'xmlhttprequest' || entry.initiatorType === 'fetch') {\n    return;\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const data: Record<string, any> = {};\n  if ('transferSize' in entry) {\n    data['Transfer Size'] = entry.transferSize;\n  }\n  if ('encodedBodySize' in entry) {\n    data['Encoded Body Size'] = entry.encodedBodySize;\n  }\n  if ('decodedBodySize' in entry) {\n    data['Decoded Body Size'] = entry.decodedBodySize;\n  }\n  if ('renderBlockingStatus' in entry) {\n    data['resource.render_blocking_status'] = entry.renderBlockingStatus;\n  }\n\n  const startTimestamp = timeOrigin + startTime;\n  const endTimestamp = startTimestamp + duration;\n\n  _startChild(transaction, {\n    description: resourceName,\n    endTimestamp,\n    op: entry.initiatorType ? `resource.${entry.initiatorType}` : 'resource.other',\n    startTimestamp,\n    data,\n  });\n}\n\n/**\n * Capture the information of the user agent.\n */\nfunction _trackNavigator(transaction: Transaction): void {\n  const navigator = WINDOW.navigator as null | (Navigator & NavigatorNetworkInformation & NavigatorDeviceMemory);\n  if (!navigator) {\n    return;\n  }\n\n  // track network connectivity\n  const connection = navigator.connection;\n  if (connection) {\n    if (connection.effectiveType) {\n      transaction.setTag('effectiveConnectionType', connection.effectiveType);\n    }\n\n    if (connection.type) {\n      transaction.setTag('connectionType', connection.type);\n    }\n\n    if (isMeasurementValue(connection.rtt)) {\n      _measurements['connection.rtt'] = { value: connection.rtt, unit: 'millisecond' };\n    }\n  }\n\n  if (isMeasurementValue(navigator.deviceMemory)) {\n    transaction.setTag('deviceMemory', `${navigator.deviceMemory} GB`);\n  }\n\n  if (isMeasurementValue(navigator.hardwareConcurrency)) {\n    transaction.setTag('hardwareConcurrency', String(navigator.hardwareConcurrency));\n  }\n}\n\n/** Add LCP / CLS data to transaction to allow debugging */\nfunction _tagMetricInfo(transaction: Transaction): void {\n  if (_lcpEntry) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding LCP Data');\n\n    // Capture Properties of the LCP element that contributes to the LCP.\n\n    if (_lcpEntry.element) {\n      transaction.setTag('lcp.element', htmlTreeAsString(_lcpEntry.element));\n    }\n\n    if (_lcpEntry.id) {\n      transaction.setTag('lcp.id', _lcpEntry.id);\n    }\n\n    if (_lcpEntry.url) {\n      // Trim URL to the first 200 characters.\n      transaction.setTag('lcp.url', _lcpEntry.url.trim().slice(0, 200));\n    }\n\n    transaction.setTag('lcp.size', _lcpEntry.size);\n  }\n\n  // See: https://developer.mozilla.org/en-US/docs/Web/API/LayoutShift\n  if (_clsEntry && _clsEntry.sources) {\n    __DEBUG_BUILD__ && logger.log('[Measurements] Adding CLS Data');\n    _clsEntry.sources.forEach((source, index) =>\n      transaction.setTag(`cls.source.${index + 1}`, htmlTreeAsString(source.node)),\n    );\n  }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAeA;AACA;AACA;AACA;AACA,SAAA,OAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,IAAA,GAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,wBAAA,GAAA;AACA,EAAA,OAAA,MAAA,IAAA,MAAA,CAAA,gBAAA,IAAA,MAAA,CAAA,WAAA,CAAA;AACA,CAAA;AACA;AACA,IAAA,kBAAA,GAAA,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ACA,IAAA,SAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA,MAAA,EAAA,KAAA;AACA,MAAA,WAAA,CAAA,MAAA,CAAA,CAAA,WAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA,EAAA,gBAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}/**
 * Checks if a given value is a valid measurement value.
 */
function isMeasurementValue(value) {
  return typeof value === 'number' && isFinite(value);
}

/**
 * Helper function to start child on transactions. This function will make sure that the transaction will
 * use the start timestamp of the created child span if it is earlier than the transactions actual
 * start timestamp.
 */
function _startChild(transaction, { startTimestamp, ...ctx }) {
  if (startTimestamp && transaction.startTimestamp > startTimestamp) {
    transaction.startTimestamp = startTimestamp;
  }

  return transaction.startChild({
    startTimestamp,
    ...ctx,
  });
}

export { _startChild, isMeasurementValue };
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/browser/metrics/utils.ts"],"sourcesContent":["import type { Transaction } from '@sentry/core';\nimport type { Span, SpanContext } from '@sentry/types';\n\n/**\n * Checks if a given value is a valid measurement value.\n */\nexport function isMeasurementValue(value: unknown): value is number {\n  return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Helper function to start child on transactions. This function will make sure that the transaction will\n * use the start timestamp of the created child span if it is earlier than the transactions actual\n * start timestamp.\n */\nexport function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span {\n  if (startTimestamp && transaction.startTimestamp > startTimestamp) {\n    transaction.startTimestamp = startTimestamp;\n  }\n\n  return transaction.startChild({\n    startTimestamp,\n    ...ctx,\n  });\n}\n"],"names":[],"mappings":"AAGA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,OAAA,KAAA,KAAA,QAAA,IAAA,QAAA,CAAA,KAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,WAAA,EAAA,EAAA,cAAA,EAAA,GAAA,GAAA,EAAA,EAAA;AACA,EAAA,IAAA,cAAA,IAAA,WAAA,CAAA,cAAA,GAAA,cAAA,EAAA;AACA,IAAA,WAAA,CAAA,cAAA,GAAA,cAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,WAAA,CAAA,UAAA,CAAA;AACA,IAAA,cAAA;AACA,IAAA,GAAA,GAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;"}import { hasTracingEnabled, getCurrentHub } from '@sentry/core';
import { addInstrumentationHandler, dynamicSamplingContextToSentryBaggageHeader, isInstanceOf, BAGGAGE_HEADER_NAME, SENTRY_XHR_DATA_KEY, stringMatchesSomePattern } from '@sentry/utils';

/* eslint-disable max-lines */

const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\//];

/** Options for Request Instrumentation */

const defaultRequestInstrumentationOptions = {
  traceFetch: true,
  traceXHR: true,
  // TODO (v8): Remove this property
  tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,
  tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,
};

/** Registers span creators for xhr and fetch requests  */
function instrumentOutgoingRequests(_options) {
  // eslint-disable-next-line deprecation/deprecation
  const { traceFetch, traceXHR, tracePropagationTargets, tracingOrigins, shouldCreateSpanForRequest } = {
    traceFetch: defaultRequestInstrumentationOptions.traceFetch,
    traceXHR: defaultRequestInstrumentationOptions.traceXHR,
    ..._options,
  };

  const shouldCreateSpan =
    typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_) => true;

  // TODO(v8) Remove tracingOrigins here
  // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported
  // and we don't want to break the API. We can remove it in v8.
  const shouldAttachHeadersWithTargets = (url) =>
    shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);

  const spans = {};

  if (traceFetch) {
    addInstrumentationHandler('fetch', (handlerData) => {
      fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
    });
  }

  if (traceXHR) {
    addInstrumentationHandler('xhr', (handlerData) => {
      xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);
    });
  }
}

/**
 * A function that determines whether to attach tracing headers to a request.
 * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.
 * We only export this fuction for testing purposes.
 */
function shouldAttachHeaders(url, tracePropagationTargets) {
  return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);
}

/**
 * Create and track fetch request spans
 */
function fetchCallback(
  handlerData,
  shouldCreateSpan,
  shouldAttachHeaders,
  spans,
) {
  if (!hasTracingEnabled() || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) {
    return;
  }

  if (handlerData.endTimestamp) {
    const spanId = handlerData.fetchData.__span;
    if (!spanId) return;

    const span = spans[spanId];
    if (span) {
      if (handlerData.response) {
        // TODO (kmclb) remove this once types PR goes through
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        span.setHttpStatus(handlerData.response.status);
      } else if (handlerData.error) {
        span.setStatus('internal_error');
      }
      span.finish();

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete spans[spanId];
    }
    return;
  }

  const currentScope = getCurrentHub().getScope();
  const currentSpan = currentScope && currentScope.getSpan();
  const activeTransaction = currentSpan && currentSpan.transaction;

  if (currentSpan && activeTransaction) {
    const span = currentSpan.startChild({
      data: {
        ...handlerData.fetchData,
        type: 'fetch',
      },
      description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,
      op: 'http.client',
    });

    handlerData.fetchData.__span = span.spanId;
    spans[span.spanId] = span;

    const request = handlerData.args[0];

    // In case the user hasn't set the second argument of a fetch call we default it to `{}`.
    handlerData.args[1] = handlerData.args[1] || {};

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const options = handlerData.args[1];

    if (shouldAttachHeaders(handlerData.fetchData.url)) {
      options.headers = addTracingHeadersToFetchRequest(
        request,
        activeTransaction.getDynamicSamplingContext(),
        span,
        options,
      );
    }
  }
}

/**
 * Adds sentry-trace and baggage headers to the various forms of fetch headers
 */
function addTracingHeadersToFetchRequest(
  request, // unknown is actually type Request but we can't export DOM types from this package,
  dynamicSamplingContext,
  span,
  options

,
) {
  const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
  const sentryTraceHeader = span.toTraceparent();

  const headers =
    typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request ).headers : options.headers;

  if (!headers) {
    return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };
  } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {
    const newHeaders = new Headers(headers );

    newHeaders.append('sentry-trace', sentryTraceHeader);

    if (sentryBaggageHeader) {
      // If the same header is appended multiple times the browser will merge the values into a single request header.
      // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
      newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);
    }

    return newHeaders ;
  } else if (Array.isArray(headers)) {
    const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];

    if (sentryBaggageHeader) {
      // If there are multiple entries with the same key, the browser will merge the values into a single request header.
      // Its therefore safe to simply push a "baggage" entry, even though there might already be another baggage header.
      newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);
    }

    return newHeaders ;
  } else {
    const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;
    const newBaggageHeaders = [];

    if (Array.isArray(existingBaggageHeader)) {
      newBaggageHeaders.push(...existingBaggageHeader);
    } else if (existingBaggageHeader) {
      newBaggageHeaders.push(existingBaggageHeader);
    }

    if (sentryBaggageHeader) {
      newBaggageHeaders.push(sentryBaggageHeader);
    }

    return {
      ...(headers ),
      'sentry-trace': sentryTraceHeader,
      baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,
    };
  }
}

/**
 * Create and track xhr request spans
 */
function xhrCallback(
  handlerData,
  shouldCreateSpan,
  shouldAttachHeaders,
  spans,
) {
  const xhr = handlerData.xhr;
  const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];

  if (
    !hasTracingEnabled() ||
    (xhr && xhr.__sentry_own_request__) ||
    !(xhr && sentryXhrData && shouldCreateSpan(sentryXhrData.url))
  ) {
    return;
  }

  // check first if the request has finished and is tracked by an existing span which should now end
  if (handlerData.endTimestamp) {
    const spanId = xhr.__sentry_xhr_span_id__;
    if (!spanId) return;

    const span = spans[spanId];
    if (span) {
      span.setHttpStatus(sentryXhrData.status_code);
      span.finish();

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete spans[spanId];
    }
    return;
  }

  const currentScope = getCurrentHub().getScope();
  const currentSpan = currentScope && currentScope.getSpan();
  const activeTransaction = currentSpan && currentSpan.transaction;

  if (currentSpan && activeTransaction) {
    const span = currentSpan.startChild({
      data: {
        ...sentryXhrData.data,
        type: 'xhr',
        method: sentryXhrData.method,
        url: sentryXhrData.url,
      },
      description: `${sentryXhrData.method} ${sentryXhrData.url}`,
      op: 'http.client',
    });

    xhr.__sentry_xhr_span_id__ = span.spanId;
    spans[xhr.__sentry_xhr_span_id__] = span;

    if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {
      try {
        xhr.setRequestHeader('sentry-trace', span.toTraceparent());

        const dynamicSamplingContext = activeTransaction.getDynamicSamplingContext();
        const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);

        if (sentryBaggageHeader) {
          // From MDN: "If this method is called several times with the same header, the values are merged into one single request header."
          // We can therefore simply set a baggage header without checking what was there before
          // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader
          xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);
        }
      } catch (_) {
        // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.
      }
    }
  }
}

export { DEFAULT_TRACE_PROPAGATION_TARGETS, addTracingHeadersToFetchRequest, defaultRequestInstrumentationOptions, fetchCallback, instrumentOutgoingRequests, shouldAttachHeaders, xhrCallback };
//# sourceMappingURL=request.js.map
{"version":3,"file":"request.js","sources":["../../../src/browser/request.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport { getCurrentHub, hasTracingEnabled } from '@sentry/core';\nimport type { DynamicSamplingContext, Span } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  BAGGAGE_HEADER_NAME,\n  dynamicSamplingContextToSentryBaggageHeader,\n  isInstanceOf,\n  SENTRY_XHR_DATA_KEY,\n  stringMatchesSomePattern,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRACE_PROPAGATION_TARGETS = ['localhost', /^\\//];\n\n/** Options for Request Instrumentation */\nexport interface RequestInstrumentationOptions {\n  /**\n   * @deprecated Will be removed in v8.\n   * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control\n   * trace header attachment.\n   */\n  tracingOrigins: Array<string | RegExp>;\n\n  /**\n   * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`\n   * headers attached.\n   *\n   * Default: ['localhost', /^\\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}\n   */\n  tracePropagationTargets: Array<string | RegExp>;\n\n  /**\n   * Flag to disable patching all together for fetch requests.\n   *\n   * Default: true\n   */\n  traceFetch: boolean;\n\n  /**\n   * Flag to disable patching all together for xhr requests.\n   *\n   * Default: true\n   */\n  traceXHR: boolean;\n\n  /**\n   * This function will be called before creating a span for a request with the given url.\n   * Return false if you don't want a span for the given url.\n   *\n   * Default: (url: string) => true\n   */\n  shouldCreateSpanForRequest?(this: void, url: string): boolean;\n}\n\n/** Data returned from fetch callback */\nexport interface FetchData {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  args: any[]; // the arguments passed to the fetch call itself\n  fetchData?: {\n    method: string;\n    url: string;\n    // span_id\n    __span?: string;\n  };\n\n  // TODO Should this be unknown instead? If we vendor types, make it a Response\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  response?: any;\n  error?: unknown;\n\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\n/** Data returned from XHR request */\nexport interface XHRData {\n  xhr?: {\n    [SENTRY_XHR_DATA_KEY]?: {\n      method: string;\n      url: string;\n      status_code: number;\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      data: Record<string, any>;\n    };\n    __sentry_xhr_span_id__?: string;\n    setRequestHeader?: (key: string, val: string) => void;\n    getRequestHeader?: (key: string) => string;\n    __sentry_own_request__?: boolean;\n  };\n  startTimestamp: number;\n  endTimestamp?: number;\n}\n\ntype PolymorphicRequestHeaders =\n  | Record<string, string | undefined>\n  | Array<[string, string]>\n  // the below is not preicsely the Header type used in Request, but it'll pass duck-typing\n  | {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      [key: string]: any;\n      append: (key: string, value: string) => void;\n      get: (key: string) => string | null | undefined;\n    };\n\nexport const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {\n  traceFetch: true,\n  traceXHR: true,\n  // TODO (v8): Remove this property\n  tracingOrigins: DEFAULT_TRACE_PROPAGATION_TARGETS,\n  tracePropagationTargets: DEFAULT_TRACE_PROPAGATION_TARGETS,\n};\n\n/** Registers span creators for xhr and fetch requests  */\nexport function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void {\n  // eslint-disable-next-line deprecation/deprecation\n  const { traceFetch, traceXHR, tracePropagationTargets, tracingOrigins, shouldCreateSpanForRequest } = {\n    traceFetch: defaultRequestInstrumentationOptions.traceFetch,\n    traceXHR: defaultRequestInstrumentationOptions.traceXHR,\n    ..._options,\n  };\n\n  const shouldCreateSpan =\n    typeof shouldCreateSpanForRequest === 'function' ? shouldCreateSpanForRequest : (_: string) => true;\n\n  // TODO(v8) Remove tracingOrigins here\n  // The only reason we're passing it in here is because this instrumentOutgoingRequests function is publicly exported\n  // and we don't want to break the API. We can remove it in v8.\n  const shouldAttachHeadersWithTargets = (url: string): boolean =>\n    shouldAttachHeaders(url, tracePropagationTargets || tracingOrigins);\n\n  const spans: Record<string, Span> = {};\n\n  if (traceFetch) {\n    addInstrumentationHandler('fetch', (handlerData: FetchData) => {\n      fetchCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n    });\n  }\n\n  if (traceXHR) {\n    addInstrumentationHandler('xhr', (handlerData: XHRData) => {\n      xhrCallback(handlerData, shouldCreateSpan, shouldAttachHeadersWithTargets, spans);\n    });\n  }\n}\n\n/**\n * A function that determines whether to attach tracing headers to a request.\n * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.\n * We only export this fuction for testing purposes.\n */\nexport function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean {\n  return stringMatchesSomePattern(url, tracePropagationTargets || DEFAULT_TRACE_PROPAGATION_TARGETS);\n}\n\n/**\n * Create and track fetch request spans\n */\nexport function fetchCallback(\n  handlerData: FetchData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): void {\n  if (!hasTracingEnabled() || !(handlerData.fetchData && shouldCreateSpan(handlerData.fetchData.url))) {\n    return;\n  }\n\n  if (handlerData.endTimestamp) {\n    const spanId = handlerData.fetchData.__span;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      if (handlerData.response) {\n        // TODO (kmclb) remove this once types PR goes through\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        span.setHttpStatus(handlerData.response.status);\n      } else if (handlerData.error) {\n        span.setStatus('internal_error');\n      }\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return;\n  }\n\n  const currentScope = getCurrentHub().getScope();\n  const currentSpan = currentScope && currentScope.getSpan();\n  const activeTransaction = currentSpan && currentSpan.transaction;\n\n  if (currentSpan && activeTransaction) {\n    const span = currentSpan.startChild({\n      data: {\n        ...handlerData.fetchData,\n        type: 'fetch',\n      },\n      description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,\n      op: 'http.client',\n    });\n\n    handlerData.fetchData.__span = span.spanId;\n    spans[span.spanId] = span;\n\n    const request: string | Request = handlerData.args[0];\n\n    // In case the user hasn't set the second argument of a fetch call we default it to `{}`.\n    handlerData.args[1] = handlerData.args[1] || {};\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const options: { [key: string]: any } = handlerData.args[1];\n\n    if (shouldAttachHeaders(handlerData.fetchData.url)) {\n      options.headers = addTracingHeadersToFetchRequest(\n        request,\n        activeTransaction.getDynamicSamplingContext(),\n        span,\n        options,\n      );\n    }\n  }\n}\n\n/**\n * Adds sentry-trace and baggage headers to the various forms of fetch headers\n */\nexport function addTracingHeadersToFetchRequest(\n  request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,\n  dynamicSamplingContext: Partial<DynamicSamplingContext>,\n  span: Span,\n  options: {\n    headers?:\n      | {\n          [key: string]: string[] | string | undefined;\n        }\n      | PolymorphicRequestHeaders;\n  },\n): PolymorphicRequestHeaders {\n  const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n  const sentryTraceHeader = span.toTraceparent();\n\n  const headers =\n    typeof Request !== 'undefined' && isInstanceOf(request, Request) ? (request as Request).headers : options.headers;\n\n  if (!headers) {\n    return { 'sentry-trace': sentryTraceHeader, baggage: sentryBaggageHeader };\n  } else if (typeof Headers !== 'undefined' && isInstanceOf(headers, Headers)) {\n    const newHeaders = new Headers(headers as Headers);\n\n    newHeaders.append('sentry-trace', sentryTraceHeader);\n\n    if (sentryBaggageHeader) {\n      // If the same header is appended multiple times the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.append(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else if (Array.isArray(headers)) {\n    const newHeaders = [...headers, ['sentry-trace', sentryTraceHeader]];\n\n    if (sentryBaggageHeader) {\n      // If there are multiple entries with the same key, the browser will merge the values into a single request header.\n      // Its therefore safe to simply push a \"baggage\" entry, even though there might already be another baggage header.\n      newHeaders.push([BAGGAGE_HEADER_NAME, sentryBaggageHeader]);\n    }\n\n    return newHeaders as PolymorphicRequestHeaders;\n  } else {\n    const existingBaggageHeader = 'baggage' in headers ? headers.baggage : undefined;\n    const newBaggageHeaders: string[] = [];\n\n    if (Array.isArray(existingBaggageHeader)) {\n      newBaggageHeaders.push(...existingBaggageHeader);\n    } else if (existingBaggageHeader) {\n      newBaggageHeaders.push(existingBaggageHeader);\n    }\n\n    if (sentryBaggageHeader) {\n      newBaggageHeaders.push(sentryBaggageHeader);\n    }\n\n    return {\n      ...(headers as Exclude<typeof headers, Headers>),\n      'sentry-trace': sentryTraceHeader,\n      baggage: newBaggageHeaders.length > 0 ? newBaggageHeaders.join(',') : undefined,\n    };\n  }\n}\n\n/**\n * Create and track xhr request spans\n */\nexport function xhrCallback(\n  handlerData: XHRData,\n  shouldCreateSpan: (url: string) => boolean,\n  shouldAttachHeaders: (url: string) => boolean,\n  spans: Record<string, Span>,\n): void {\n  const xhr = handlerData.xhr;\n  const sentryXhrData = xhr && xhr[SENTRY_XHR_DATA_KEY];\n\n  if (\n    !hasTracingEnabled() ||\n    (xhr && xhr.__sentry_own_request__) ||\n    !(xhr && sentryXhrData && shouldCreateSpan(sentryXhrData.url))\n  ) {\n    return;\n  }\n\n  // check first if the request has finished and is tracked by an existing span which should now end\n  if (handlerData.endTimestamp) {\n    const spanId = xhr.__sentry_xhr_span_id__;\n    if (!spanId) return;\n\n    const span = spans[spanId];\n    if (span) {\n      span.setHttpStatus(sentryXhrData.status_code);\n      span.finish();\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete spans[spanId];\n    }\n    return;\n  }\n\n  const currentScope = getCurrentHub().getScope();\n  const currentSpan = currentScope && currentScope.getSpan();\n  const activeTransaction = currentSpan && currentSpan.transaction;\n\n  if (currentSpan && activeTransaction) {\n    const span = currentSpan.startChild({\n      data: {\n        ...sentryXhrData.data,\n        type: 'xhr',\n        method: sentryXhrData.method,\n        url: sentryXhrData.url,\n      },\n      description: `${sentryXhrData.method} ${sentryXhrData.url}`,\n      op: 'http.client',\n    });\n\n    xhr.__sentry_xhr_span_id__ = span.spanId;\n    spans[xhr.__sentry_xhr_span_id__] = span;\n\n    if (xhr.setRequestHeader && shouldAttachHeaders(sentryXhrData.url)) {\n      try {\n        xhr.setRequestHeader('sentry-trace', span.toTraceparent());\n\n        const dynamicSamplingContext = activeTransaction.getDynamicSamplingContext();\n        const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n        if (sentryBaggageHeader) {\n          // From MDN: \"If this method is called several times with the same header, the values are merged into one single request header.\"\n          // We can therefore simply set a baggage header without checking what was there before\n          // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n          xhr.setRequestHeader(BAGGAGE_HEADER_NAME, sentryBaggageHeader);\n        }\n      } catch (_) {\n        // Error: InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.\n      }\n    }\n  }\n}\n"],"names":[],"mappings":";;;AAAA;AAWA;AACA,MAAA,iCAAA,GAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA;AACA;;AA0FA,MAAA,oCAAA,GAAA;AACA,EAAA,UAAA,EAAA,IAAA;AACA,EAAA,QAAA,EAAA,IAAA;AACA;AACA,EAAA,cAAA,EAAA,iCAAA;AACA,EAAA,uBAAA,EAAA,iCAAA;AACA,EAAA;AACA;AACA;AACA,SAAA,0BAAA,CAAA,QAAA,EAAA;AACA;AACA,EAAA,MAAA,EAAA,UAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,cAAA,EAAA,0BAAA,EAAA,GAAA;AACA,IAAA,UAAA,EAAA,oCAAA,CAAA,UAAA;AACA,IAAA,QAA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A,WAAA,IAAA,iBAAA,EAAA;AACA,IAAA,MAAA,IAAA,GAAA,WAAA,CAAA,UAAA,CAAA;AACA,MAAA,IAAA,EAAA;AACA,QAAA,GAAA,aAAA,CAAA,IAAA;AACA,QAAA,IAAA,EAAA,KAAA;AACA,QAAA,MAAA,EAAA,aAAA,CAAA,MAAA;AACA,QAAA,GAAA,EAAA,aAAA,CAAA,GAAA;AACA,OAAA;AACA,MAAA,WAAA,EAAA,CAAA,EAAA,aAAA,CAAA,MAAA,CAAA,CAAA,EAAA,aAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,EAAA,EAAA,aAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAA,GAAA,CAAA,sBAAA,GAAA,IAAA,CAAA,MAAA,CAAA;AACA,IAAA,KAAA,CAAA,GAAA,CAAA,sBAAA,CAAA,GAAA,IAAA,CAAA;AACA;AACA,IAAA,IAAA,GAAA,CAAA,gBAAA,IAAA,mBAAA,CAAA,aAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,IAAA;AACA,QAAA,GAAA,CAAA,gBAAA,CAAA,cAAA,EAAA,IAAA,CAAA,aAAA,EAAA,CAAA,CAAA;AACA;AACA,QAAA,MAAA,sBAAA,GAAA,iBAAA,CAAA,yBAAA,EAAA,CAAA;AACA,QAAA,MAAA,mBAAA,GAAA,2CAAA,CAAA,sBAAA,CAAA,CAAA;AACA;AACA,QAAA,IAAA,mBAAA,EAAA;AACA;AACA;AACA;AACA,UAAA,GAAA,CAAA,gBAAA,CAAA,mBAAA,EAAA,mBAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA,KAAA;AACA,GAAA;AACA;;;;"}import { logger, browserPerformanceTimeOrigin, addInstrumentationHandler } from '@sentry/utils';
import { WINDOW } from './types.js';

/**
 * Default function implementing pageload and navigation transactions
 */
function instrumentRoutingWithDefaults(
  customStartTransaction,
  startTransactionOnPageLoad = true,
  startTransactionOnLocationChange = true,
) {
  if (!WINDOW || !WINDOW.location) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Could not initialize routing instrumentation due to invalid location');
    return;
  }

  let startingUrl = WINDOW.location.href;

  let activeTransaction;
  if (startTransactionOnPageLoad) {
    activeTransaction = customStartTransaction({
      name: WINDOW.location.pathname,
      // pageload should always start at timeOrigin
      startTimestamp: browserPerformanceTimeOrigin,
      op: 'pageload',
      metadata: { source: 'url' },
    });
  }

  if (startTransactionOnLocationChange) {
    addInstrumentationHandler('history', ({ to, from }) => {
      /**
       * This early return is there to account for some cases where a navigation transaction starts right after
       * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
       * create an uneccessary navigation transaction.
       *
       * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
       * only be caused in certain development environments where the usage of a hot module reloader is causing
       * errors.
       */
      if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {
        startingUrl = undefined;
        return;
      }

      if (from !== to) {
        startingUrl = undefined;
        if (activeTransaction) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);
          // If there's an open transaction on the scope, we need to finish it before creating an new one.
          activeTransaction.finish();
        }
        activeTransaction = customStartTransaction({
          name: WINDOW.location.pathname,
          op: 'navigation',
          metadata: { source: 'url' },
        });
      }
    });
  }
}

export { instrumentRoutingWithDefaults };
//# sourceMappingURL=router.js.map
{"version":3,"file":"router.js","sources":["../../../src/browser/router.ts"],"sourcesContent":["import type { Transaction, TransactionContext } from '@sentry/types';\nimport { addInstrumentationHandler, browserPerformanceTimeOrigin, logger } from '@sentry/utils';\n\nimport { WINDOW } from './types';\n\n/**\n * Default function implementing pageload and navigation transactions\n */\nexport function instrumentRoutingWithDefaults<T extends Transaction>(\n  customStartTransaction: (context: TransactionContext) => T | undefined,\n  startTransactionOnPageLoad: boolean = true,\n  startTransactionOnLocationChange: boolean = true,\n): void {\n  if (!WINDOW || !WINDOW.location) {\n    __DEBUG_BUILD__ && logger.warn('Could not initialize routing instrumentation due to invalid location');\n    return;\n  }\n\n  let startingUrl: string | undefined = WINDOW.location.href;\n\n  let activeTransaction: T | undefined;\n  if (startTransactionOnPageLoad) {\n    activeTransaction = customStartTransaction({\n      name: WINDOW.location.pathname,\n      // pageload should always start at timeOrigin\n      startTimestamp: browserPerformanceTimeOrigin,\n      op: 'pageload',\n      metadata: { source: 'url' },\n    });\n  }\n\n  if (startTransactionOnLocationChange) {\n    addInstrumentationHandler('history', ({ to, from }: { to: string; from?: string }) => {\n      /**\n       * This early return is there to account for some cases where a navigation transaction starts right after\n       * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't\n       * create an uneccessary navigation transaction.\n       *\n       * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also\n       * only be caused in certain development environments where the usage of a hot module reloader is causing\n       * errors.\n       */\n      if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) {\n        startingUrl = undefined;\n        return;\n      }\n\n      if (from !== to) {\n        startingUrl = undefined;\n        if (activeTransaction) {\n          __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing current transaction with op: ${activeTransaction.op}`);\n          // If there's an open transaction on the scope, we need to finish it before creating an new one.\n          activeTransaction.finish();\n        }\n        activeTransaction = customStartTransaction({\n          name: WINDOW.location.pathname,\n          op: 'navigation',\n          metadata: { source: 'url' },\n        });\n      }\n    });\n  }\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA,SAAA,6BAAA;AACA,EAAA,sBAAA;AACA,EAAA,0BAAA,GAAA,IAAA;AACA,EAAA,gCAAA,GAAA,IAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAA,MAAA,IAAA,CAAA,MAAA,CAAA,QAAA,EAAA;AACA,IAAA,iEAAA,MAAA,CAAA,IAAA,CAAA,sEAAA,CAAA,CAAA;AACA,IAAA,OAAA;AACA,G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A;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { GLOBAL_OBJ } from '@sentry/utils';

const WINDOW = GLOBAL_OBJ ;

export { WINDOW };
//# sourceMappingURL=types.js.map
{"version":3,"file":"types.js","sources":["../../../src/browser/types.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n"],"names":[],"mappings":";;AAEA,MAAA,MAAA,GAAA,UAAA;;;;"}import { bindReporter } from './lib/bindReporter.js';
import { initMetric } from './lib/initMetric.js';
import { observe } from './lib/observe.js';
import { onHidden } from './lib/onHidden.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Calculates the [CLS](https://web.dev/cls/) value for the current page and
 * calls the `callback` function once the value is ready to be reported, along
 * with all `layout-shift` performance entries that were used in the metric
 * value calculation. The reported value is a `double` (corresponding to a
 * [layout shift score](https://web.dev/cls/#layout-shift-score)).
 *
 * If the `reportAllChanges` configuration option is set to `true`, the
 * `callback` function will be called as soon as the value is initially
 * determined as well as any time the value changes throughout the page
 * lifespan.
 *
 * _**Important:** CLS should be continually monitored for changes throughout
 * the entire lifespan of a page—including if the user returns to the page after
 * it's been hidden/backgrounded. However, since browsers often [will not fire
 * additional callbacks once the user has backgrounded a
 * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
 * `callback` is always called when the page's visibility state changes to
 * hidden. As a result, the `callback` function might be called multiple times
 * during the same page load._
 */
const onCLS = (onReport) => {
  const metric = initMetric('CLS', 0);
  let report;

  let sessionValue = 0;
  let sessionEntries = [];

  // const handleEntries = (entries: Metric['entries']) => {
  const handleEntries = (entries) => {
    entries.forEach(entry => {
      // Only count layout shifts without recent user input.
      if (!entry.hadRecentInput) {
        const firstSessionEntry = sessionEntries[0];
        const lastSessionEntry = sessionEntries[sessionEntries.length - 1];

        // If the entry occurred less than 1 second after the previous entry and
        // less than 5 seconds after the first entry in the session, include the
        // entry in the current session. Otherwise, start a new session.
        if (
          sessionValue &&
          sessionEntries.length !== 0 &&
          entry.startTime - lastSessionEntry.startTime < 1000 &&
          entry.startTime - firstSessionEntry.startTime < 5000
        ) {
          sessionValue += entry.value;
          sessionEntries.push(entry);
        } else {
          sessionValue = entry.value;
          sessionEntries = [entry];
        }

        // If the current session value is larger than the current CLS value,
        // update CLS and the entries contributing to it.
        if (sessionValue > metric.value) {
          metric.value = sessionValue;
          metric.entries = sessionEntries;
          if (report) {
            report();
          }
        }
      }
    });
  };

  const po = observe('layout-shift', handleEntries);
  if (po) {
    report = bindReporter(onReport, metric);

    const stopListening = () => {
      handleEntries(po.takeRecords() );
      report(true);
    };

    onHidden(stopListening);

    return stopListening;
  }

  return;
};

export { onCLS };
//# sourceMappingURL=getCLS.js.map
{"version":3,"file":"getCLS.js","sources":["../../../../src/browser/web-vitals/getCLS.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { CLSMetric, ReportCallback, StopListening } from './types';\n\n/**\n * Calculates the [CLS](https://web.dev/cls/) value for the current page and\n * calls the `callback` function once the value is ready to be reported, along\n * with all `layout-shift` performance entries that were used in the metric\n * value calculation. The reported value is a `double` (corresponding to a\n * [layout shift score](https://web.dev/cls/#layout-shift-score)).\n *\n * If the `reportAllChanges` configuration option is set to `true`, the\n * `callback` function will be called as soon as the value is initially\n * determined as well as any time the value changes throughout the page\n * lifespan.\n *\n * _**Important:** CLS should be continually monitored for changes throughout\n * the entire lifespan of a page—including if the user returns to the page after\n * it's been hidden/backgrounded. However, since browsers often [will not fire\n * additional callbacks once the user has backgrounded a\n * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),\n * `callback` is always called when the page's visibility state changes to\n * hidden. As a result, the `callback` function might be called multiple times\n * during the same page load._\n */\nexport const onCLS = (onReport: ReportCallback): StopListening | undefined => {\n  const metric = initMetric('CLS', 0);\n  let report: ReturnType<typeof bindReporter>;\n\n  let sessionValue = 0;\n  let sessionEntries: PerformanceEntry[] = [];\n\n  // const handleEntries = (entries: Metric['entries']) => {\n  const handleEntries = (entries: LayoutShift[]): void => {\n    entries.forEach(entry => {\n      // Only count layout shifts without recent user input.\n      if (!entry.hadRecentInput) {\n        const firstSessionEntry = sessionEntries[0];\n        const lastSessionEntry = sessionEntries[sessionEntries.length - 1];\n\n        // If the entry occurred less than 1 second after the previous entry and\n        // less than 5 seconds after the first entry in the session, include the\n        // entry in the current session. Otherwise, start a new session.\n        if (\n          sessionValue &&\n          sessionEntries.length !== 0 &&\n          entry.startTime - lastSessionEntry.startTime < 1000 &&\n          entry.startTime - firstSessionEntry.startTime < 5000\n        ) {\n          sessionValue += entry.value;\n          sessionEntries.push(entry);\n        } else {\n          sessionValue = entry.value;\n          sessionEntries = [entry];\n        }\n\n        // If the current session value is larger than the current CLS value,\n        // update CLS and the entries contributing to it.\n        if (sessionValue > metric.value) {\n          metric.value = sessionValue;\n          metric.entries = sessionEntries;\n          if (report) {\n            report();\n          }\n        }\n      }\n    });\n  };\n\n  const po = observe('layout-shift', handleEntries);\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      handleEntries(po.takeRecords() as CLSMetric['entries']);\n      report(true);\n    };\n\n    onHidden(stopListening);\n\n    return stopListening;\n  }\n\n  return;\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,MAAA,GAAA,UAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,MAAA,CAAA;AACA;AACA,EAAA,IAAA,YAAA,GAAA,CAAA,CAAA;AACA,EAAA,IAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,CAAA,OAAA,KAAA;AACA,IAAA,OAAA,CAAA,OAAA,CAAA,KAAA,IAAA;AACA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,cAAA,EAAA;AACA,QAAA,MAAA,iBAAA,GAAA,cAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,MAAA,gBAAA,GAAA,cAAA,CAAA,cAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,QAAA;AACA,UAAA,YAAA;AACA,UAAA,cAAA,CAAA,MAAA,KAAA,CAAA;AACA,UAAA,KAAA,CAAA,SAAA,GAAA,gBAAA,CAAA,SAAA,GAAA,IAAA;AACA,UAAA,KAAA,CAAA,SAAA,GAAA,iBAAA,CAAA,SAAA,GAAA,IAAA;AACA,UAAA;AACA,UAAA,YAAA,IAAA,KAAA,CAAA,KAAA,CAAA;AACA,UAAA,cAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,YAAA,GAAA,KAAA,CAAA,KAAA,CAAA;AACA,UAAA,cAAA,GAAA,CAAA,KAAA,CAAA,CAAA;AACA,SAAA;AACA;AACA;AACA;AACA,QAAA,IAAA,YAAA,GAAA,MAAA,CAAA,KAAA,EAAA;AACA,UAAA,MAAA,CAAA,KAAA,GAAA,YAAA,CAAA;AACA,UAAA,MAAA,CAAA,OAAA,GAAA,cAAA,CAAA;AACA,UAAA,IAAA,MAAA,EAAA;AACA,YAAA,MAAA,EAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAA,OAAA,CAAA,cAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAA,MAAA,GAAA,YAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,aAAA,GAAA,MAAA;AACA,MAAA,aAAA,CAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,QAAA,CAAA,aAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,aAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA;;;;"}import { bindReporter } from './lib/bindReporter.js';
import { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';
import { initMetric } from './lib/initMetric.js';
import { observe } from './lib/observe.js';
import { onHidden } from './lib/onHidden.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Calculates the [FID](https://web.dev/fid/) value for the current page and
 * calls the `callback` function once the value is ready, along with the
 * relevant `first-input` performance entry used to determine the value. The
 * reported value is a `DOMHighResTimeStamp`.
 *
 * _**Important:** since FID is only reported after the user interacts with the
 * page, it's possible that it will not be reported for some page loads._
 */
const onFID = (onReport) => {
  const visibilityWatcher = getVisibilityWatcher();
  const metric = initMetric('FID');
  // eslint-disable-next-line prefer-const
  let report;

  const handleEntry = (entry) => {
    // Only report if the page wasn't hidden prior to the first input.
    if (entry.startTime < visibilityWatcher.firstHiddenTime) {
      metric.value = entry.processingStart - entry.startTime;
      metric.entries.push(entry);
      report(true);
    }
  };

  const handleEntries = (entries) => {
    (entries ).forEach(handleEntry);
  };

  const po = observe('first-input', handleEntries);
  report = bindReporter(onReport, metric);

  if (po) {
    onHidden(() => {
      handleEntries(po.takeRecords() );
      po.disconnect();
    }, true);
  }
};

export { onFID };
//# sourceMappingURL=getFID.js.map
{"version":3,"file":"getFID.js","sources":["../../../../src/browser/web-vitals/getFID.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { FIDMetric, PerformanceEventTiming, ReportCallback } from './types';\n\n/**\n * Calculates the [FID](https://web.dev/fid/) value for the current page and\n * calls the `callback` function once the value is ready, along with the\n * relevant `first-input` performance entry used to determine the value. The\n * reported value is a `DOMHighResTimeStamp`.\n *\n * _**Important:** since FID is only reported after the user interacts with the\n * page, it's possible that it will not be reported for some page loads._\n */\nexport const onFID = (onReport: ReportCallback): void => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('FID');\n  // eslint-disable-next-line prefer-const\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntry = (entry: PerformanceEventTiming): void => {\n    // Only report if the page wasn't hidden prior to the first input.\n    if (entry.startTime < visibilityWatcher.firstHiddenTime) {\n      metric.value = entry.processingStart - entry.startTime;\n      metric.entries.push(entry);\n      report(true);\n    }\n  };\n\n  const handleEntries = (entries: FIDMetric['entries']): void => {\n    (entries as PerformanceEventTiming[]).forEach(handleEntry);\n  };\n\n  const po = observe('first-input', handleEntries);\n  report = bindReporter(onReport, metric);\n\n  if (po) {\n    onHidden(() => {\n      handleEntries(po.takeRecords() as FIDMetric['entries']);\n      po.disconnect();\n    }, true);\n  }\n};\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,iBAAA,GAAA,oBAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,UAAA,CAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,CAAA;AACA;AACA,EAAA,MAAA,WAAA,GAAA,CAAA,KAAA,KAAA;AACA;AACA,IAAA,IAAA,KAAA,CAAA,SAAA,GAAA,iBAAA,CAAA,eAAA,EAAA;AACA,MAAA,MAAA,CAAA,KAAA,GAAA,KAAA,CAAA,eAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA,MAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,CAAA,OAAA,KAAA;AACA,IAAA,CAAA,OAAA,GAAA,OAAA,CAAA,WAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAA,OAAA,CAAA,aAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAA,MAAA,GAAA,YAAA,CAAA,QAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,EAAA,EAAA;AACA,IAAA,QAAA,CAAA,MAAA;AACA,MAAA,aAAA,CAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA;AACA,MAAA,EAAA,CAAA,UAAA,EAAA,CAAA;AACA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { bindReporter } from './lib/bindReporter.js';
import { getActivationStart } from './lib/getActivationStart.js';
import { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';
import { initMetric } from './lib/initMetric.js';
import { observe } from './lib/observe.js';
import { onHidden } from './lib/onHidden.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const reportedMetricIDs = {};

/**
 * Calculates the [LCP](https://web.dev/lcp/) value for the current page and
 * calls the `callback` function once the value is ready (along with the
 * relevant `largest-contentful-paint` performance entry used to determine the
 * value). The reported value is a `DOMHighResTimeStamp`.
 */
const onLCP = (onReport) => {
  const visibilityWatcher = getVisibilityWatcher();
  const metric = initMetric('LCP');
  let report;

  const handleEntries = (entries) => {
    const lastEntry = entries[entries.length - 1] ;
    if (lastEntry) {
      // The startTime attribute returns the value of the renderTime if it is
      // not 0, and the value of the loadTime otherwise. The activationStart
      // reference is used because LCP should be relative to page activation
      // rather than navigation start if the page was prerendered.
      const value = Math.max(lastEntry.startTime - getActivationStart(), 0);

      // Only report if the page wasn't hidden prior to LCP.
      if (value < visibilityWatcher.firstHiddenTime) {
        metric.value = value;
        metric.entries = [lastEntry];
        report();
      }
    }
  };

  const po = observe('largest-contentful-paint', handleEntries);

  if (po) {
    report = bindReporter(onReport, metric);

    const stopListening = () => {
      if (!reportedMetricIDs[metric.id]) {
        handleEntries(po.takeRecords() );
        po.disconnect();
        reportedMetricIDs[metric.id] = true;
        report(true);
      }
    };

    // Stop listening after input. Note: while scrolling is an input that
    // stop LCP observation, it's unreliable since it can be programmatically
    // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75
    ['keydown', 'click'].forEach(type => {
      addEventListener(type, stopListening, { once: true, capture: true });
    });

    onHidden(stopListening, true);

    return stopListening;
  }

  return;
};

export { onLCP };
//# sourceMappingURL=getLCP.js.map
{"version":3,"file":"getLCP.js","sources":["../../../../src/browser/web-vitals/getLCP.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bindReporter } from './lib/bindReporter';\nimport { getActivationStart } from './lib/getActivationStart';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher';\nimport { initMetric } from './lib/initMetric';\nimport { observe } from './lib/observe';\nimport { onHidden } from './lib/onHidden';\nimport type { LCPMetric, ReportCallback, StopListening } from './types';\n\nconst reportedMetricIDs: Record<string, boolean> = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nexport const onLCP = (onReport: ReportCallback): StopListening | undefined => {\n  const visibilityWatcher = getVisibilityWatcher();\n  const metric = initMetric('LCP');\n  let report: ReturnType<typeof bindReporter>;\n\n  const handleEntries = (entries: LCPMetric['entries']): void => {\n    const lastEntry = entries[entries.length - 1] as LargestContentfulPaint;\n    if (lastEntry) {\n      // The startTime attribute returns the value of the renderTime if it is\n      // not 0, and the value of the loadTime otherwise. The activationStart\n      // reference is used because LCP should be relative to page activation\n      // rather than navigation start if the page was prerendered.\n      const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n      // Only report if the page wasn't hidden prior to LCP.\n      if (value < visibilityWatcher.firstHiddenTime) {\n        metric.value = value;\n        metric.entries = [lastEntry];\n        report();\n      }\n    }\n  };\n\n  const po = observe('largest-contentful-paint', handleEntries);\n\n  if (po) {\n    report = bindReporter(onReport, metric);\n\n    const stopListening = (): void => {\n      if (!reportedMetricIDs[metric.id]) {\n        handleEntries(po.takeRecords() as LCPMetric['entries']);\n        po.disconnect();\n        reportedMetricIDs[metric.id] = true;\n        report(true);\n      }\n    };\n\n    // Stop listening after input. Note: while scrolling is an input that\n    // stop LCP observation, it's unreliable since it can be programmatically\n    // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n    ['keydown', 'click'].forEach(type => {\n      addEventListener(type, stopListening, { once: true, capture: true });\n    });\n\n    onHidden(stopListening, true);\n\n    return stopListening;\n  }\n\n  return;\n};\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA,MAAA,iBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AACA,EAAA,MAAA,iBAAA,GAAA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AAA,IAAA,IAAA;AACA,MAAA,gBAAA,CAAA,IAAA,EAAA,aAAA,EAAA,EAAA,IAAA,EAAA,IAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAA,QAAA,CAAA,aAAA,EAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,aAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA;;;;"}const bindReporter = (
  callback,
  metric,
  reportAllChanges,
) => {
  let prevValue;
  let delta;
  return (forceReport) => {
    if (metric.value >= 0) {
      if (forceReport || reportAllChanges) {
        delta = metric.value - (prevValue || 0);

        // Report the metric if there's a non-zero delta or if no previous
        // value exists (which can happen in the case of the document becoming
        // hidden when the metric value is 0).
        // See: https://github.com/GoogleChrome/web-vitals/issues/14
        if (delta || prevValue === undefined) {
          prevValue = metric.value;
          metric.delta = delta;
          callback(metric);
        }
      }
    }
  };
};

export { bindReporter };
//# sourceMappingURL=bindReporter.js.map
{"version":3,"file":"bindReporter.js","sources":["../../../../../src/browser/web-vitals/lib/bindReporter.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Metric, ReportCallback } from '../types';\n\nexport const bindReporter = (\n  callback: ReportCallback,\n  metric: Metric,\n  reportAllChanges?: boolean,\n): ((forceReport?: boolean) => void) => {\n  let prevValue: number;\n  let delta: number;\n  return (forceReport?: boolean) => {\n    if (metric.value >= 0) {\n      if (forceReport || reportAllChanges) {\n        delta = metric.value - (prevValue || 0);\n\n        // Report the metric if there's a non-zero delta or if no previous\n        // value exists (which can happen in the case of the document becoming\n        // hidden when the metric value is 0).\n        // See: https://github.com/GoogleChrome/web-vitals/issues/14\n        if (delta || prevValue === undefined) {\n          prevValue = metric.value;\n          metric.delta = delta;\n          callback(metric);\n        }\n      }\n    }\n  };\n};\n"],"names":[],"mappings":"AAkBA,MAAA,YAAA,GAAA;AACA,EAAA,QAAA;AACA,EAAA,MAAA;AACA,EAAA,gBAAA;AACA,KAAA;AACA,EAAA,IAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,CAAA;AACA,EAAA,OAAA,CAAA,WAAA,KAAA;AACA,IAAA,IAAA,MAAA,CAAA,KAAA,IAAA,CAAA,EAAA;AACA,MAAA,IAAA,WAAA,IAAA,gBAAA,EAAA;AACA,QAAA,KAAA,GAAA,MAAA,CAAA,KAAA,IAAA,SAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,QAAA,IAAA,KAAA,IAAA,SAAA,KAAA,SAAA,EAAA;AACA,UAAA,SAAA,GAAA,MAAA,CAAA,KAAA,CAAA;AACA,UAAA,MAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AACA,UAAA,QAAA,CAAA,MAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Performantly generate a unique, 30-char string by combining a version
 * number, the current timestamp with a 13-digit number integer.
 * @return {string}
 */
const generateUniqueID = () => {
  return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;
};

export { generateUniqueID };
//# sourceMappingURL=generateUniqueID.js.map
{"version":3,"file":"generateUniqueID.js","sources":["../../../../../src/browser/web-vitals/lib/generateUniqueID.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nexport const generateUniqueID = (): string => {\n  return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,MAAA;AACA,EAAA,OAAA,CAAA,GAAA,EAAA,IAAA,CAAA,GAAA,EAAA,CAAA,CAAA,EAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,EAAA,IAAA,IAAA,GAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { getNavigationEntry } from './getNavigationEntry.js';

/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const getActivationStart = () => {
  const navEntry = getNavigationEntry();
  return (navEntry && navEntry.activationStart) || 0;
};

export { getActivationStart };
//# sourceMappingURL=getActivationStart.js.map
{"version":3,"file":"getActivationStart.js","sources":["../../../../../src/browser/web-vitals/lib/getActivationStart.ts"],"sourcesContent":["/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const getActivationStart = (): number => {\n  const navEntry = getNavigationEntry();\n  return (navEntry && navEntry.activationStart) || 0;\n};\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA,MAAA,kBAAA,GAAA,MAAA;AACA,EAAA,MAAA,QAAA,GAAA,kBAAA,EAAA,CAAA;AACA,EAAA,OAAA,CAAA,QAAA,IAAA,QAAA,CAAA,eAAA,KAAA,CAAA,CAAA;AACA;;;;"}import { WINDOW } from '../../types.js';

/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const getNavigationEntryFromPerformanceTiming = () => {
  // eslint-disable-next-line deprecation/deprecation
  const timing = WINDOW.performance.timing;
  // eslint-disable-next-line deprecation/deprecation
  const type = WINDOW.performance.navigation.type;

  const navigationEntry = {
    entryType: 'navigation',
    startTime: 0,
    type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',
  };

  for (const key in timing) {
    if (key !== 'navigationStart' && key !== 'toJSON') {
      navigationEntry[key] = Math.max((timing[key ] ) - timing.navigationStart, 0);
    }
  }
  return navigationEntry ;
};

const getNavigationEntry = () => {
  if (WINDOW.__WEB_VITALS_POLYFILL__) {
    return (
      WINDOW.performance &&
      ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||
        getNavigationEntryFromPerformanceTiming())
    );
  } else {
    return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];
  }
};

export { getNavigationEntry };
//# sourceMappingURL=getNavigationEntry.js.map
{"version":3,"file":"getNavigationEntry.js","sources":["../../../../../src/browser/web-vitals/lib/getNavigationEntry.ts"],"sourcesContent":["/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { NavigationTimingPolyfillEntry } from '../types';\n\nconst getNavigationEntryFromPerformanceTiming = (): NavigationTimingPolyfillEntry => {\n  // eslint-disable-next-line deprecation/deprecation\n  const timing = WINDOW.performance.timing;\n  // eslint-disable-next-line deprecation/deprecation\n  const type = WINDOW.performance.navigation.type;\n\n  const navigationEntry: { [key: string]: number | string } = {\n    entryType: 'navigation',\n    startTime: 0,\n    type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n  };\n\n  for (const key in timing) {\n    if (key !== 'navigationStart' && key !== 'toJSON') {\n      navigationEntry[key] = Math.max((timing[key as keyof PerformanceTiming] as number) - timing.navigationStart, 0);\n    }\n  }\n  return navigationEntry as unknown as NavigationTimingPolyfillEntry;\n};\n\nexport const getNavigationEntry = (): PerformanceNavigationTiming | NavigationTimingPolyfillEntry | undefined => {\n  if (WINDOW.__WEB_VITALS_POLYFILL__) {\n    return (\n      WINDOW.performance &&\n      ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n        getNavigationEntryFromPerformanceTiming())\n    );\n  } else {\n    return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n  }\n};\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,MAAA,uCAAA,GAAA,MAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,MAAA,CAAA,WAAA,CAAA,MAAA,CAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAA,MAAA,CAAA,WAAA,CAAA,UAAA,CAAA,IAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA;AACA,IAAA,SAAA,EAAA,YAAA;AACA,IAAA,SAAA,EAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA,IAAA,CAAA,GAAA,cAAA,GAAA,IAAA,KAAA,CAAA,GAAA,QAAA,GAAA,UAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,KAAA,MAAA,GAAA,IAAA,MAAA,EAAA;AACA,IAAA,IAAA,GAAA,KAAA,iBAAA,IAAA,GAAA,KAAA,QAAA,EAAA;AACA,MAAA,eAAA,CAAA,GAAA,CAAA,GAAA,IAAA,CAAA,GAAA,CAAA,CAAA,MAAA,CAAA,GAAA,EAAA,KAAA,MAAA,CAAA,eAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,eAAA,EAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,kBAAA,GAAA,MAAA;AACA,EAAA,IAAA,MAAA,CAAA,uBAAA,EAAA;AACA,IAAA;AACA,MAAA,MAAA,CAAA,WAAA;AACA,OAAA,CAAA,WAAA,CAAA,gBAAA,IAAA,WAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,uCAAA,EAAA,CAAA;AACA,MAAA;AACA,GAAA,MAAA;AACA,IAAA,OAAA,MAAA,CAAA,WAAA,IAAA,WAAA,CAAA,gBAAA,IAAA,WAAA,CAAA,gBAAA,CAAA,YAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { WINDOW } from '../../types.js';
import { onHidden } from './onHidden.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

let firstHiddenTime = -1;

const initHiddenTime = () => {
  // If the document is hidden and not prerendering, assume it was always
  // hidden and the page was loaded in the background.
  return WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;
};

const trackChanges = () => {
  // Update the time if/when the document becomes hidden.
  onHidden(({ timeStamp }) => {
    firstHiddenTime = timeStamp;
  }, true);
};

const getVisibilityWatcher = (

) => {
  if (firstHiddenTime < 0) {
    // If the document is hidden when this code runs, assume it was hidden
    // since navigation start. This isn't a perfect heuristic, but it's the
    // best we can do until an API is available to support querying past
    // visibilityState.
    firstHiddenTime = initHiddenTime();
    trackChanges();
  }
  return {
    get firstHiddenTime() {
      return firstHiddenTime;
    },
  };
};

export { getVisibilityWatcher };
//# sourceMappingURL=getVisibilityWatcher.js.map
{"version":3,"file":"getVisibilityWatcher.js","sources":["../../../../../src/browser/web-vitals/lib/getVisibilityWatcher.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport { onHidden } from './onHidden';\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = (): number => {\n  // If the document is hidden and not prerendering, assume it was always\n  // hidden and the page was loaded in the background.\n  return WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n};\n\nconst trackChanges = (): void => {\n  // Update the time if/when the document becomes hidden.\n  onHidden(({ timeStamp }) => {\n    firstHiddenTime = timeStamp;\n  }, true);\n};\n\nexport const getVisibilityWatcher = (): {\n  readonly firstHiddenTime: number;\n} => {\n  if (firstHiddenTime < 0) {\n    // If the document is hidden when this code runs, assume it was hidden\n    // since navigation start. This isn't a perfect heuristic, but it's the\n    // best we can do until an API is available to support querying past\n    // visibilityState.\n    firstHiddenTime = initHiddenTime();\n    trackChanges();\n  }\n  return {\n    get firstHiddenTime() {\n      return firstHiddenTime;\n    },\n  };\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA,IAAA,eAAA,GAAA,CAAA,CAAA,CAAA;AACA;AACA,MAAA,cAAA,GAAA,MAAA;AACA;AACA;AACA,EAAA,OAAA,MAAA,CAAA,QAAA,CAAA,eAAA,KAAA,QAAA,IAAA,CAAA,MAAA,CAAA,QAAA,CAAA,YAAA,GAAA,CAAA,GAAA,QAAA,CAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,YAAA,GAAA,MAAA;AACA;AACA,EAAA,QAAA,CAAA,CAAA,EAAA,SAAA,EAAA,KAAA;AACA,IAAA,eAAA,GAAA,SAAA,CAAA;AACA,GAAA,EAAA,IAAA,CAAA,CAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,oBAAA,GAAA;AACA;AACA,KAAA;AACA,EAAA,IAAA,eAAA,GAAA,CAAA,EAAA;AACA;AACA;AACA;AACA;AACA,IAAA,eAAA,GAAA,cAAA,EAAA,CAAA;AACA,IAAA,YAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,eAAA,GAAA;AACA,MAAA,OAAA,eAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}import { WINDOW } from '../../types.js';
import { generateUniqueID } from './generateUniqueID.js';
import { getActivationStart } from './getActivationStart.js';
import { getNavigationEntry } from './getNavigationEntry.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const initMetric = (name, value) => {
  const navEntry = getNavigationEntry();
  let navigationType = 'navigate';

  if (navEntry) {
    if (WINDOW.document.prerendering || getActivationStart() > 0) {
      navigationType = 'prerender';
    } else {
      navigationType = navEntry.type.replace(/_/g, '-') ;
    }
  }

  return {
    name,
    value: typeof value === 'undefined' ? -1 : value,
    rating: 'good', // Will be updated if the value changes.
    delta: 0,
    entries: [],
    id: generateUniqueID(),
    navigationType,
  };
};

export { initMetric };
//# sourceMappingURL=initMetric.js.map
{"version":3,"file":"initMetric.js","sources":["../../../../../src/browser/web-vitals/lib/initMetric.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\nimport type { Metric } from '../types';\nimport { generateUniqueID } from './generateUniqueID';\nimport { getActivationStart } from './getActivationStart';\nimport { getNavigationEntry } from './getNavigationEntry';\n\nexport const initMetric = (name: Metric['name'], value?: number): Metric => {\n  const navEntry = getNavigationEntry();\n  let navigationType: Metric['navigationType'] = 'navigate';\n\n  if (navEntry) {\n    if (WINDOW.document.prerendering || getActivationStart() > 0) {\n      navigationType = 'prerender';\n    } else {\n      navigationType = navEntry.type.replace(/_/g, '-') as Metric['navigationType'];\n    }\n  }\n\n  return {\n    name,\n    value: typeof value === 'undefined' ? -1 : value,\n    rating: 'good', // Will be updated if the value changes.\n    delta: 0,\n    entries: [],\n    id: generateUniqueID(),\n    navigationType,\n  };\n};\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA;AACA,MAAA,UAAA,GAAA,CAAA,IAAA,EAAA,KAAA,KAAA;AACA,EAAA,MAAA,QAAA,GAAA,kBAAA,EAAA,CAAA;AACA,EAAA,IAAA,cAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,EAAA;AACA,IAAA,IAAA,MAAA,CAAA,QAAA,CAAA,YAAA,IAAA,kBAAA,EAAA,GAAA,CAAA,EAAA;AACA,MAAA,cAAA,GAAA,WAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,cAAA,GAAA,QAAA,CAAA,IAAA,CAAA,OAAA,CAAA,IAAA,EAAA,GAAA,CAAA,EAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,IAAA;AACA,IAAA,KAAA,EAAA,OAAA,KAAA,KAAA,WAAA,GAAA,CAAA,CAAA,GAAA,KAAA;AACA,IAAA,MAAA,EAAA,MAAA;AACA,IAAA,KAAA,EAAA,CAAA;AACA,IAAA,OAAA,EAAA,EAAA;AACA,IAAA,EAAA,EAAA,gBAAA,EAAA;AACA,IAAA,cAAA;AACA,GAAA,CAAA;AACA;;;;"}/**
 * Takes a performance entry type and a callback function, and creates a
 * `PerformanceObserver` instance that will observe the specified entry type
 * with buffering enabled and call the callback _for each entry_.
 *
 * This function also feature-detects entry support and wraps the logic in a
 * try/catch to avoid errors in unsupporting browsers.
 */
const observe = (
  type,
  callback,
  opts,
) => {
  try {
    if (PerformanceObserver.supportedEntryTypes.includes(type)) {
      const po = new PerformanceObserver(list => {
        callback(list.getEntries() );
      });
      po.observe(
        Object.assign(
          {
            type,
            buffered: true,
          },
          opts || {},
        ) ,
      );
      return po;
    }
  } catch (e) {
    // Do nothing.
  }
  return;
};

export { observe };
//# sourceMappingURL=observe.js.map
{"version":3,"file":"observe.js","sources":["../../../../../src/browser/web-vitals/lib/observe.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';\n\nexport interface PerformanceEntryHandler {\n  (entry: PerformanceEntry): void;\n}\n\ninterface PerformanceEntryMap {\n  event: PerformanceEventTiming[];\n  paint: PerformancePaintTiming[];\n  'layout-shift': LayoutShift[];\n  'largest-contentful-paint': LargestContentfulPaint[];\n  'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];\n  navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];\n  resource: PerformanceResourceTiming[];\n  longtask: PerformanceEntry[];\n}\n\n/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nexport const observe = <K extends keyof PerformanceEntryMap>(\n  type: K,\n  callback: (entries: PerformanceEntryMap[K]) => void,\n  opts?: PerformanceObserverInit,\n): PerformanceObserver | undefined => {\n  try {\n    if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n      const po = new PerformanceObserver(list => {\n        callback(list.getEntries() as PerformanceEntryMap[K]);\n      });\n      po.observe(\n        Object.assign(\n          {\n            type,\n            buffered: true,\n          },\n          opts || {},\n        ) as PerformanceObserverInit,\n      );\n      return po;\n    }\n  } catch (e) {\n    // Do nothing.\n  }\n  return;\n};\n"],"names":[],"mappings":"AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,OAAA,GAAA;AACA,EAAA,IAAA;AACA,EAAA,QAAA;AACA,EAAA,IAAA;AACA,KAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,mBAAA,CAAA,mBAAA,CAAA,QAAA,CAAA,IAAA,CAAA,EAAA;AACA,MAAA,MAAA,EAAA,GAAA,IAAA,mBAAA,CAAA,IAAA,IAAA;AACA,QAAA,QAAA,CAAA,IAAA,CAAA,UAAA,EAAA,EAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,MAAA,EAAA,CAAA,OAAA;AACA,QAAA,MAAA,CAAA,MAAA;AACA,UAAA;AACA,YAAA,IAAA;AACA,YAAA,QAAA,EAAA,IAAA;AACA,WAAA;AACA,UAAA,IAAA,IAAA,EAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,MAAA,OAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA,EAAA,OAAA;AACA;;;;"}import { WINDOW } from '../../types.js';

/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const onHidden = (cb, once) => {
  const onHiddenOrPageHide = (event) => {
    if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {
      cb(event);
      if (once) {
        removeEventListener('visibilitychange', onHiddenOrPageHide, true);
        removeEventListener('pagehide', onHiddenOrPageHide, true);
      }
    }
  };
  addEventListener('visibilitychange', onHiddenOrPageHide, true);
  // Some browsers have buggy implementations of visibilitychange,
  // so we use pagehide in addition, just to be safe.
  addEventListener('pagehide', onHiddenOrPageHide, true);
};

export { onHidden };
//# sourceMappingURL=onHidden.js.map
{"version":3,"file":"onHidden.js","sources":["../../../../../src/browser/web-vitals/lib/onHidden.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { WINDOW } from '../../types';\n\nexport interface OnHiddenCallback {\n  (event: Event): void;\n}\n\nexport const onHidden = (cb: OnHiddenCallback, once?: boolean): void => {\n  const onHiddenOrPageHide = (event: Event): void => {\n    if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n      cb(event);\n      if (once) {\n        removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n        removeEventListener('pagehide', onHiddenOrPageHide, true);\n      }\n    }\n  };\n  addEventListener('visibilitychange', onHiddenOrPageHide, true);\n  // Some browsers have buggy implementations of visibilitychange,\n  // so we use pagehide in addition, just to be safe.\n  addEventListener('pagehide', onHiddenOrPageHide, true);\n};\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,MAAA,QAAA,GAAA,CAAA,EAAA,EAAA,IAAA,KAAA;AACA,EAAA,MAAA,kBAAA,GAAA,CAAA,KAAA,KAAA;AACA,IAAA,IAAA,KAAA,CAAA,IAAA,KAAA,UAAA,IAAA,MAAA,CAAA,QAAA,CAAA,eAAA,KAAA,QAAA,EAAA;AACA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,MAAA,IAAA,IAAA,EAAA;AACA,QAAA,mBAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA,QAAA,mBAAA,CAAA,UAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,gBAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,gBAAA,CAAA,UAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AACA;;;;"}import { addTracingExtensions, getMainCarrier } from '@sentry/core';
import { isNodeEnv, loadModule, dynamicRequire } from '@sentry/utils';

/**
 * @private
 */
function _autoloadDatabaseIntegrations() {
  const carrier = getMainCarrier();
  if (!carrier.__SENTRY__) {
    return;
  }

  const packageToIntegrationMapping = {
    mongodb() {
      const integration = dynamicRequire(module, './node/integrations/mongo')

;
      return new integration.Mongo();
    },
    mongoose() {
      const integration = dynamicRequire(module, './node/integrations/mongo')

;
      return new integration.Mongo({ mongoose: true });
    },
    mysql() {
      const integration = dynamicRequire(module, './node/integrations/mysql')

;
      return new integration.Mysql();
    },
    pg() {
      const integration = dynamicRequire(module, './node/integrations/postgres')

;
      return new integration.Postgres();
    },
  };

  const mappedPackages = Object.keys(packageToIntegrationMapping)
    .filter(moduleName => !!loadModule(moduleName))
    .map(pkg => {
      try {
        return packageToIntegrationMapping[pkg]();
      } catch (e) {
        return undefined;
      }
    })
    .filter(p => p) ;

  if (mappedPackages.length > 0) {
    carrier.__SENTRY__.integrations = [...(carrier.__SENTRY__.integrations || []), ...mappedPackages];
  }
}

/**
 * This patches the global object and injects the Tracing extensions methods
 */
function addExtensionMethods() {
  addTracingExtensions();

  // Detect and automatically load specified integrations.
  if (isNodeEnv()) {
    _autoloadDatabaseIntegrations();
  }
}

export { addExtensionMethods };
//# sourceMappingURL=extensions.js.map
{"version":3,"file":"extensions.js","sources":["../../src/extensions.ts"],"sourcesContent":["import { addTracingExtensions, getMainCarrier } from '@sentry/core';\nimport type { Integration, IntegrationClass } from '@sentry/types';\nimport { dynamicRequire, isNodeEnv, loadModule } from '@sentry/utils';\n\n/**\n * @private\n */\nfunction _autoloadDatabaseIntegrations(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    return;\n  }\n\n  const packageToIntegrationMapping: Record<string, () => Integration> = {\n    mongodb() {\n      const integration = dynamicRequire(module, './node/integrations/mongo') as {\n        Mongo: IntegrationClass<Integration>;\n      };\n      return new integration.Mongo();\n    },\n    mongoose() {\n      const integration = dynamicRequire(module, './node/integrations/mongo') as {\n        Mongo: IntegrationClass<Integration>;\n      };\n      return new integration.Mongo({ mongoose: true });\n    },\n    mysql() {\n      const integration = dynamicRequire(module, './node/integrations/mysql') as {\n        Mysql: IntegrationClass<Integration>;\n      };\n      return new integration.Mysql();\n    },\n    pg() {\n      const integration = dynamicRequire(module, './node/integrations/postgres') as {\n        Postgres: IntegrationClass<Integration>;\n      };\n      return new integration.Postgres();\n    },\n  };\n\n  const mappedPackages = Object.keys(packageToIntegrationMapping)\n    .filter(moduleName => !!loadModule(moduleName))\n    .map(pkg => {\n      try {\n        return packageToIntegrationMapping[pkg]();\n      } catch (e) {\n        return undefined;\n      }\n    })\n    .filter(p => p) as Integration[];\n\n  if (mappedPackages.length > 0) {\n    carrier.__SENTRY__.integrations = [...(carrier.__SENTRY__.integrations || []), ...mappedPackages];\n  }\n}\n\n/**\n * This patches the global object and injects the Tracing extensions methods\n */\nexport function addExtensionMethods(): void {\n  addTracingExtensions();\n\n  // Detect and automatically load specified integrations.\n  if (isNodeEnv()) {\n    _autoloadDatabaseIntegrations();\n  }\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACA,SAAA,6BAAA,GAAA;AACA,EAAA,MAAA,OAAA,GAAA,cAAA,EAAA,CAAA;AACA,EAAA,IAAA,CAAA,OAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,2BAAA,GAAA;AACA,IAAA,OAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,QAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,KAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,2BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,EAAA,GAAA;AACA,MAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,8BAAA,CAAA;;AAEA,CAAA;AACA,MAAA,OAAA,IAAA,WAAA,CAAA,QAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,cAAA,GAAA,MAAA,CAAA,IAAA,CAAA,2BAAA,CAAA;AACA,KAAA,MAAA,CAAA,UAAA,IAAA,CAAA,CAAA,UAAA,CAAA,UAAA,CAAA,CAAA;AACA,KAAA,GAAA,CAAA,GAAA,IAAA;AACA,MAAA,IAAA;AACA,QAAA,OAAA,2BAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,KAAA,MAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA,EAAA,IAAA,cAAA,CAAA,MAAA,GAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,YAAA,GAAA,CAAA,IAAA,OAAA,CAAA,UAAA,CAAA,YAAA,IAAA,EAAA,CAAA,EAAA,GAAA,cAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,GAAA;AACA,EAAA,oBAAA,EAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,SAAA,EAAA,EAAA;AACA,IAAA,6BAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}export { IdleTransaction, Span, SpanStatus, Transaction, extractTraceparentData, getActiveTransaction, hasTracingEnabled, spanStatusfromHttpCode, startIdleTransaction } from '@sentry/core';
export { TRACEPARENT_REGEXP, stripUrlQueryAndFragment } from '@sentry/utils';
export { Express } from './node/integrations/express.js';
export { Postgres } from './node/integrations/postgres.js';
export { Mysql } from './node/integrations/mysql.js';
export { Mongo } from './node/integrations/mongo.js';
export { Prisma } from './node/integrations/prisma.js';
export { GraphQL } from './node/integrations/graphql.js';
export { Apollo } from './node/integrations/apollo.js';
export { lazyLoadedNodePerformanceMonitoringIntegrations } from './node/integrations/lazy.js';
export { BROWSER_TRACING_INTEGRATION_ID, BrowserTracing } from './browser/browsertracing.js';
export { addTracingHeadersToFetchRequest, defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './browser/request.js';
export { addExtensionMethods } from './extensions.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { loadModule, logger, fill, arrayify, isThenable } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

/** Tracing integration for Apollo */
class Apollo  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Apollo';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Apollo.id;}

  /**
   * @inheritDoc
   */
   constructor(
    options = {
      useNestjs: false,
    },
  ) {Apollo.prototype.__init.call(this);
    this._useNest = !!options.useNestjs;
  }

  /** @inheritdoc */
   loadDependency() {
    if (this._useNest) {
      this._module = this._module || loadModule('@nestjs/graphql');
    } else {
      this._module = this._module || loadModule('apollo-server-core');
    }

    return this._module;
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Apollo Integration is skipped because of instrumenter configuration.');
      return;
    }

    if (this._useNest) {
      const pkg = this.loadDependency();

      if (!pkg) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.');
        return;
      }

      /**
       * Iterate over resolvers of NestJS ResolversExplorerService before schemas are constructed.
       */
      fill(
        pkg.GraphQLFactory.prototype,
        'mergeWithSchema',
        function (orig) {
          return function (

            ...args
          ) {
            fill(this.resolversExplorerService, 'explore', function (orig) {
              return function () {
                const resolvers = arrayify(orig.call(this));

                const instrumentedResolvers = instrumentResolvers(resolvers, getCurrentHub);

                return instrumentedResolvers;
              };
            });

            return orig.call(this, ...args);
          };
        },
      );
    } else {
      const pkg = this.loadDependency();

      if (!pkg) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Apollo Integration was unable to require apollo-server-core package.');
        return;
      }

      /**
       * Iterate over resolvers of the ApolloServer instance before schemas are constructed.
       */
      fill(pkg.ApolloServerBase.prototype, 'constructSchema', function (orig) {
        return function (

) {
          if (!this.config.resolvers) {
            if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
              if (this.config.schema) {
                logger.warn(
                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.' +
                    'If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead.',
                );
                logger.warn();
              } else if (this.config.modules) {
                logger.warn(
                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property.',
                );
              }

              logger.error('Skipping tracing as no resolvers found on the `ApolloServer` instance.');
            }

            return orig.call(this);
          }

          const resolvers = arrayify(this.config.resolvers);

          this.config.resolvers = instrumentResolvers(resolvers, getCurrentHub);

          return orig.call(this);
        };
      });
    }
  }
}Apollo.__initStatic();

function instrumentResolvers(resolvers, getCurrentHub) {
  return resolvers.map(model => {
    Object.keys(model).forEach(resolverGroupName => {
      Object.keys(model[resolverGroupName]).forEach(resolverName => {
        if (typeof model[resolverGroupName][resolverName] !== 'function') {
          return;
        }

        wrapResolver(model, resolverGroupName, resolverName, getCurrentHub);
      });
    });

    return model;
  });
}

/**
 * Wrap a single resolver which can be a parent of other resolvers and/or db operations.
 */
function wrapResolver(
  model,
  resolverGroupName,
  resolverName,
  getCurrentHub,
) {
  fill(model[resolverGroupName], resolverName, function (orig) {
    return function ( ...args) {
      const scope = getCurrentHub().getScope();
      const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
      const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
        description: `${resolverGroupName}.${resolverName}`,
        op: 'graphql.resolve',
      })]);

      const rv = orig.call(this, ...args);

      if (isThenable(rv)) {
        return rv.then((res) => {
          _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
          return res;
        });
      }

      _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);

      return rv;
    };
  });
}

export { Apollo };
//# sourceMappingURL=apollo.js.map
{"version":3,"file":"apollo.js","sources":["../../../../src/node/integrations/apollo.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { arrayify, fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface ApolloOptions {\n  useNestjs?: boolean;\n}\n\ntype ApolloResolverGroup = {\n  [key: string]: () => unknown;\n};\n\ntype ApolloModelResolvers = {\n  [key: string]: ApolloResolverGroup;\n};\n\ntype GraphQLModule = {\n  GraphQLFactory: {\n    prototype: {\n      create: (resolvers: ApolloModelResolvers[]) => unknown;\n    };\n  };\n};\n\ntype ApolloModule = {\n  ApolloServerBase: {\n    prototype: {\n      constructSchema: (config: unknown) => unknown;\n    };\n  };\n};\n\n/** Tracing integration for Apollo */\nexport class Apollo implements LazyLoadedIntegration<GraphQLModule & ApolloModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Apollo';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Apollo.id;\n\n  private readonly _useNest: boolean;\n\n  private _module?: GraphQLModule & ApolloModule;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(\n    options: ApolloOptions = {\n      useNestjs: false,\n    },\n  ) {\n    this._useNest = !!options.useNestjs;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): (GraphQLModule & ApolloModule) | undefined {\n    if (this._useNest) {\n      this._module = this._module || loadModule('@nestjs/graphql');\n    } else {\n      this._module = this._module || loadModule('apollo-server-core');\n    }\n\n    return this._module;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Apollo Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    if (this._useNest) {\n      const pkg = this.loadDependency();\n\n      if (!pkg) {\n        __DEBUG_BUILD__ && logger.error('Apollo-NestJS Integration was unable to require @nestjs/graphql package.');\n        return;\n      }\n\n      /**\n       * Iterate over resolvers of NestJS ResolversExplorerService before schemas are constructed.\n       */\n      fill(\n        pkg.GraphQLFactory.prototype,\n        'mergeWithSchema',\n        function (orig: (this: unknown, ...args: unknown[]) => unknown) {\n          return function (\n            this: { resolversExplorerService: { explore: () => ApolloModelResolvers[] } },\n            ...args: unknown[]\n          ) {\n            fill(this.resolversExplorerService, 'explore', function (orig: () => ApolloModelResolvers[]) {\n              return function (this: unknown) {\n                const resolvers = arrayify(orig.call(this));\n\n                const instrumentedResolvers = instrumentResolvers(resolvers, getCurrentHub);\n\n                return instrumentedResolvers;\n              };\n            });\n\n            return orig.call(this, ...args);\n          };\n        },\n      );\n    } else {\n      const pkg = this.loadDependency();\n\n      if (!pkg) {\n        __DEBUG_BUILD__ && logger.error('Apollo Integration was unable to require apollo-server-core package.');\n        return;\n      }\n\n      /**\n       * Iterate over resolvers of the ApolloServer instance before schemas are constructed.\n       */\n      fill(pkg.ApolloServerBase.prototype, 'constructSchema', function (orig: (config: unknown) => unknown) {\n        return function (this: {\n          config: { resolvers?: ApolloModelResolvers[]; schema?: unknown; modules?: unknown };\n        }) {\n          if (!this.config.resolvers) {\n            if (__DEBUG_BUILD__) {\n              if (this.config.schema) {\n                logger.warn(\n                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.' +\n                    'If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead.',\n                );\n                logger.warn();\n              } else if (this.config.modules) {\n                logger.warn(\n                  'Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property.',\n                );\n              }\n\n              logger.error('Skipping tracing as no resolvers found on the `ApolloServer` instance.');\n            }\n\n            return orig.call(this);\n          }\n\n          const resolvers = arrayify(this.config.resolvers);\n\n          this.config.resolvers = instrumentResolvers(resolvers, getCurrentHub);\n\n          return orig.call(this);\n        };\n      });\n    }\n  }\n}\n\nfunction instrumentResolvers(resolvers: ApolloModelResolvers[], getCurrentHub: () => Hub): ApolloModelResolvers[] {\n  return resolvers.map(model => {\n    Object.keys(model).forEach(resolverGroupName => {\n      Object.keys(model[resolverGroupName]).forEach(resolverName => {\n        if (typeof model[resolverGroupName][resolverName] !== 'function') {\n          return;\n        }\n\n        wrapResolver(model, resolverGroupName, resolverName, getCurrentHub);\n      });\n    });\n\n    return model;\n  });\n}\n\n/**\n * Wrap a single resolver which can be a parent of other resolvers and/or db operations.\n */\nfunction wrapResolver(\n  model: ApolloModelResolvers,\n  resolverGroupName: string,\n  resolverName: string,\n  getCurrentHub: () => Hub,\n): void {\n  fill(model[resolverGroupName], resolverName, function (orig: () => unknown | Promise<unknown>) {\n    return function (this: unknown, ...args: unknown[]) {\n      const scope = getCurrentHub().getScope();\n      const parentSpan = scope?.getSpan();\n      const span = parentSpan?.startChild({\n        description: `${resolverGroupName}.${resolverName}`,\n        op: 'graphql.resolve',\n      });\n\n      const rv = orig.call(this, ...args);\n\n      if (isThenable(rv)) {\n        return rv.then((res: unknown) => {\n          span?.finish();\n          return res;\n        });\n      }\n\n      span?.finish();\n\n      return rv;\n    };\n  });\n}\n"],"names":[],"mappings":";;;;AAmCA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAA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AAA,CAAA,EAAA,GAAA;QACA,CAAA,CAAA;MACA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA;IACA,CAAA;EACA,CAAA,CAAA;AACA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { logger, getNumberOfUrlSegments, extractPathForTransaction, isRegExp } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

/**
 * Express integration
 *
 * Provides an request and error handler for Express framework as well as tracing capabilities
 */
class Express  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Express';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Express.id;}

  /**
   * Express App instance
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Express.prototype.__init.call(this);
    this._router = options.router || options.app;
    this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (!this._router) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('ExpressIntegration is missing an Express instance');
      return;
    }

    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Express Integration is skipped because of instrumenter configuration.');
      return;
    }

    instrumentMiddlewares(this._router, this._methods);
    instrumentRouter(this._router );
  }
}Express.__initStatic();

/**
 * Wraps original middleware function in a tracing call, which stores the info about the call as a span,
 * and finishes it once the middleware is done invoking.
 *
 * Express middlewares have 3 various forms, thus we have to take care of all of them:
 * // sync
 * app.use(function (req, res) { ... })
 * // async
 * app.use(function (req, res, next) { ... })
 * // error handler
 * app.use(function (err, req, res, next) { ... })
 *
 * They all internally delegate to the `router[method]` of the given application instance.
 */
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
function wrap(fn, method) {
  const arity = fn.length;

  switch (arity) {
    case 2: {
      return function ( req, res) {
        const transaction = res.__sentry_transaction;
        if (transaction) {
          const span = transaction.startChild({
            description: fn.name,
            op: `middleware.express.${method}`,
          });
          res.once('finish', () => {
            span.finish();
          });
        }
        return fn.call(this, req, res);
      };
    }
    case 3: {
      return function (

        req,
        res,
        next,
      ) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, 'optionalAccess', _2 => _2.startChild, 'call', _3 => _3({
          description: fn.name,
          op: `middleware.express.${method}`,
        })]);
        fn.call(this, req, res, function ( ...args) {
          _optionalChain([span, 'optionalAccess', _4 => _4.finish, 'call', _5 => _5()]);
          next.call(this, ...args);
        });
      };
    }
    case 4: {
      return function (

        err,
        req,
        res,
        next,
      ) {
        const transaction = res.__sentry_transaction;
        const span = _optionalChain([transaction, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
          description: fn.name,
          op: `middleware.express.${method}`,
        })]);
        fn.call(this, err, req, res, function ( ...args) {
          _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
          next.call(this, ...args);
        });
      };
    }
    default: {
      throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);
    }
  }
}

/**
 * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`
 * and wraps every function, as well as array of functions with a call to our `wrap` method.
 * We have to take care of the arrays as well as iterate over all of the arguments,
 * as `app.use` can accept middlewares in few various forms.
 *
 * app.use([<path>], <fn>)
 * app.use([<path>], <fn>, ...<fn>)
 * app.use([<path>], ...<fn>[])
 */
function wrapMiddlewareArgs(args, method) {
  return args.map((arg) => {
    if (typeof arg === 'function') {
      return wrap(arg, method);
    }

    if (Array.isArray(arg)) {
      return arg.map((a) => {
        if (typeof a === 'function') {
          return wrap(a, method);
        }
        return a;
      });
    }

    return arg;
  });
}

/**
 * Patches original router to utilize our tracing functionality
 */
function patchMiddleware(router, method) {
  const originalCallback = router[method];

  router[method] = function (...args) {
    return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));
  };

  return router;
}

/**
 * Patches original router methods
 */
function instrumentMiddlewares(router, methods = []) {
  methods.forEach((method) => patchMiddleware(router, method));
}

/**
 * Patches the prototype of Express.Router to accumulate the resolved route
 * if a layer instance's `match` function was called and it returned a successful match.
 *
 * @see https://github.com/expressjs/express/blob/master/lib/router/index.js
 *
 * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.
 */
function instrumentRouter(appOrRouter) {
  // This is how we can distinguish between app and routers
  const isApp = 'settings' in appOrRouter;

  // In case the app's top-level router hasn't been initialized yet, we have to do it now
  if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {
    appOrRouter.lazyrouter();
  }

  const router = isApp ? appOrRouter._router : appOrRouter;

  if (!router) {
    /*
    If we end up here, this means likely that this integration is used with Express 3 or Express 5.
    For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,
    we'd need to make more changes to the routing instrumentation because the router is no longer part of
    the Express core package but maintained in its own package. The new router has different function
    signatures and works slightly differently, demanding more changes than just taking the router from
    `app.router` instead of `app._router`.
    @see https://github.com/pillarjs/router

    TODO: Proper Express 5 support
    */
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.debug('Routing instrumentation is currently only supported in Express 4.');
    return;
  }

  const routerProto = Object.getPrototypeOf(router) ;

  const originalProcessParams = routerProto.process_params;
  routerProto.process_params = function process_params(
    layer,
    called,
    req,
    res,
    done,
  ) {
    // Base case: We're in the first part of the URL (thus we start with the root '/')
    if (!req._reconstructedRoute) {
      req._reconstructedRoute = '';
    }

    // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.
    const { layerRoutePath, isRegex, isArray, numExtraSegments } = getLayerRoutePathInfo(layer);

    if (layerRoutePath || isRegex || isArray) {
      req._hasParameters = true;
    }

    // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path
    const partialRoute = layerRoutePath || layer.path || '';

    // Normalize the partial route so that it doesn't contain leading or trailing slashes
    // and exclude empty or '*' wildcard routes.
    // The exclusion of '*' routes is our best effort to not "pollute" the transaction name
    // with interim handlers (e.g. ones that check authentication or do other middleware stuff).
    // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.
    const finalPartialRoute = partialRoute
      .split('/')
      .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))
      .join('/');

    // If we found a valid partial URL, we append it to the reconstructed route
    if (finalPartialRoute && finalPartialRoute.length > 0) {
      // If the partial route is from a regex route, we append a '/' to close the regex
      req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;
    }

    // Now we check if we are in the "last" part of the route. We determine this by comparing the
    // number of URL segments from the original URL to that of our reconstructed parameterized URL.
    // If we've reached our final destination, we update the transaction name.
    const urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;
    const routeLength = getNumberOfUrlSegments(req._reconstructedRoute);

    if (urlLength === routeLength) {
      if (!req._hasParameters) {
        if (req._reconstructedRoute !== req.originalUrl) {
          req._reconstructedRoute = req.originalUrl;
        }
      }

      const transaction = res.__sentry_transaction;
      if (transaction && transaction.metadata.source !== 'custom') {
        // If the request URL is '/' or empty, the reconstructed route will be empty.
        // Therefore, we fall back to setting the final route to '/' in this case.
        const finalRoute = req._reconstructedRoute || '/';

        transaction.setName(...extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));
      }
    }

    return originalProcessParams.call(this, layer, called, req, res, done);
  };
}

/**
 * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),
 * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\/path[2-5]/, /path/:id]`). Additionally
 * returns extra information about the route, such as if the route is defined as regex or as an array.
 *
 * @param layer the layer to extract the stringified route from
 *
 * @returns an object containing the stringified route, a flag determining if the route was a regex
 *          and the number of extra segments to the matched path that are additionally in the route,
 *          if the route was an array (defaults to 0).
 */
function getLayerRoutePathInfo(layer) {
  const lrp = _optionalChain([layer, 'access', _10 => _10.route, 'optionalAccess', _11 => _11.path]);

  const isRegex = isRegExp(lrp);
  const isArray = Array.isArray(lrp);

  if (!lrp) {
    return { isRegex, isArray, numExtraSegments: 0 };
  }

  const numExtraSegments = isArray
    ? Math.max(getNumberOfArrayUrlSegments(lrp ) - getNumberOfUrlSegments(layer.path || ''), 0)
    : 0;

  const layerRoutePath = getLayerRoutePathString(isArray, lrp);

  return { layerRoutePath, isRegex, isArray, numExtraSegments };
}

/**
 * Returns the number of URL segments in an array of routes
 *
 * Example: ['/api/test', /\/api\/post[0-9]/, '/users/:id/details`] -> 7
 */
function getNumberOfArrayUrlSegments(routesArray) {
  return routesArray.reduce((accNumSegments, currentRoute) => {
    // array members can be a RegEx -> convert them toString
    return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());
  }, 0);
}

/**
 * Extracts and returns the stringified version of the layers route path
 * Handles route arrays (by joining the paths together) as well as RegExp and normal
 * string values (in the latter case the toString conversion is technically unnecessary but
 * it doesn't hurt us either).
 */
function getLayerRoutePathString(isArray, lrp) {
  if (isArray) {
    return (lrp ).map(r => r.toString()).join(',');
  }
  return lrp && lrp.toString();
}

export { Express };
//# sourceMappingURL=express.js.map
{"version":3,"file":"express.js","sources":["../../../../src/node/integrations/express.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types';\nimport { extractPathForTransaction, getNumberOfUrlSegments, isRegExp, logger } from '@sentry/utils';\n\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype Method =\n  | 'all'\n  | 'get'\n  | 'post'\n  | 'put'\n  | 'delete'\n  | 'patch'\n  | 'options'\n  | 'head'\n  | 'checkout'\n  | 'copy'\n  | 'lock'\n  | 'merge'\n  | 'mkactivity'\n  | 'mkcol'\n  | 'move'\n  | 'm-search'\n  | 'notify'\n  | 'purge'\n  | 'report'\n  | 'search'\n  | 'subscribe'\n  | 'trace'\n  | 'unlock'\n  | 'unsubscribe'\n  | 'use';\n\ntype Router = {\n  [method in Method]: (...args: any) => any; // eslint-disable-line @typescript-eslint/no-explicit-any\n};\n\n/* Extend the PolymorphicRequest type with a patched parameter to build a reconstructed route */\ntype PatchedRequest = PolymorphicRequest & { _reconstructedRoute?: string; _hasParameters?: boolean };\n\n/* Types used for patching the express router prototype */\ntype ExpressRouter = Router & {\n  _router?: ExpressRouter;\n  stack?: Layer[];\n  lazyrouter?: () => void;\n  settings?: unknown;\n  process_params: (\n    layer: Layer,\n    called: unknown,\n    req: PatchedRequest,\n    res: ExpressResponse,\n    done: () => void,\n  ) => unknown;\n};\n\ntype Layer = {\n  match: (path: string) => boolean;\n  handle_request: (req: PatchedRequest, res: ExpressResponse, next: () => void) => void;\n  route?: { path: RouteType | RouteType[] };\n  path?: string;\n};\n\ntype RouteType = string | RegExp;\n\ninterface ExpressResponse {\n  once(name: string, callback: () => void): void;\n}\n\n/**\n * Internal helper for `__sentry_transaction`\n * @hidden\n */\ninterface SentryTracingResponse {\n  __sentry_transaction?: Transaction;\n}\n\n/**\n * Express integration\n *\n * Provides an request and error handler for Express framework as well as tracing capabilities\n */\nexport class Express implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Express';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Express.id;\n\n  /**\n   * Express App instance\n   */\n  private readonly _router?: Router;\n  private readonly _methods?: Method[];\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { app?: Router; router?: Router; methods?: Method[] } = {}) {\n    this._router = options.router || options.app;\n    this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: unknown, getCurrentHub: () => Hub): void {\n    if (!this._router) {\n      __DEBUG_BUILD__ && logger.error('ExpressIntegration is missing an Express instance');\n      return;\n    }\n\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Express Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    instrumentMiddlewares(this._router, this._methods);\n    instrumentRouter(this._router as ExpressRouter);\n  }\n}\n\n/**\n * Wraps original middleware function in a tracing call, which stores the info about the call as a span,\n * and finishes it once the middleware is done invoking.\n *\n * Express middlewares have 3 various forms, thus we have to take care of all of them:\n * // sync\n * app.use(function (req, res) { ... })\n * // async\n * app.use(function (req, res, next) { ... })\n * // error handler\n * app.use(function (err, req, res, next) { ... })\n *\n * They all internally delegate to the `router[method]` of the given application instance.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any\nfunction wrap(fn: Function, method: Method): (...args: any[]) => void {\n  const arity = fn.length;\n\n  switch (arity) {\n    case 2: {\n      return function (this: NodeJS.Global, req: unknown, res: ExpressResponse & SentryTracingResponse): void {\n        const transaction = res.__sentry_transaction;\n        if (transaction) {\n          const span = transaction.startChild({\n            description: fn.name,\n            op: `middleware.express.${method}`,\n          });\n          res.once('finish', () => {\n            span.finish();\n          });\n        }\n        return fn.call(this, req, res);\n      };\n    }\n    case 3: {\n      return function (\n        this: NodeJS.Global,\n        req: unknown,\n        res: ExpressResponse & SentryTracingResponse,\n        next: () => void,\n      ): void {\n        const transaction = res.__sentry_transaction;\n        const span = transaction?.startChild({\n          description: fn.name,\n          op: `middleware.express.${method}`,\n        });\n        fn.call(this, req, res, function (this: NodeJS.Global, ...args: unknown[]): void {\n          span?.finish();\n          next.call(this, ...args);\n        });\n      };\n    }\n    case 4: {\n      return function (\n        this: NodeJS.Global,\n        err: Error,\n        req: Request,\n        res: Response & SentryTracingResponse,\n        next: () => void,\n      ): void {\n        const transaction = res.__sentry_transaction;\n        const span = transaction?.startChild({\n          description: fn.name,\n          op: `middleware.express.${method}`,\n        });\n        fn.call(this, err, req, res, function (this: NodeJS.Global, ...args: unknown[]): void {\n          span?.finish();\n          next.call(this, ...args);\n        });\n      };\n    }\n    default: {\n      throw new Error(`Express middleware takes 2-4 arguments. Got: ${arity}`);\n    }\n  }\n}\n\n/**\n * Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`\n * and wraps every function, as well as array of functions with a call to our `wrap` method.\n * We have to take care of the arrays as well as iterate over all of the arguments,\n * as `app.use` can accept middlewares in few various forms.\n *\n * app.use([<path>], <fn>)\n * app.use([<path>], <fn>, ...<fn>)\n * app.use([<path>], ...<fn>[])\n */\nfunction wrapMiddlewareArgs(args: unknown[], method: Method): unknown[] {\n  return args.map((arg: unknown) => {\n    if (typeof arg === 'function') {\n      return wrap(arg, method);\n    }\n\n    if (Array.isArray(arg)) {\n      return arg.map((a: unknown) => {\n        if (typeof a === 'function') {\n          return wrap(a, method);\n        }\n        return a;\n      });\n    }\n\n    return arg;\n  });\n}\n\n/**\n * Patches original router to utilize our tracing functionality\n */\nfunction patchMiddleware(router: Router, method: Method): Router {\n  const originalCallback = router[method];\n\n  router[method] = function (...args: unknown[]): void {\n    return originalCallback.call(this, ...wrapMiddlewareArgs(args, method));\n  };\n\n  return router;\n}\n\n/**\n * Patches original router methods\n */\nfunction instrumentMiddlewares(router: Router, methods: Method[] = []): void {\n  methods.forEach((method: Method) => patchMiddleware(router, method));\n}\n\n/**\n * Patches the prototype of Express.Router to accumulate the resolved route\n * if a layer instance's `match` function was called and it returned a successful match.\n *\n * @see https://github.com/expressjs/express/blob/master/lib/router/index.js\n *\n * @param appOrRouter the router instance which can either be an app (i.e. top-level) or a (nested) router.\n */\nfunction instrumentRouter(appOrRouter: ExpressRouter): void {\n  // This is how we can distinguish between app and routers\n  const isApp = 'settings' in appOrRouter;\n\n  // In case the app's top-level router hasn't been initialized yet, we have to do it now\n  if (isApp && appOrRouter._router === undefined && appOrRouter.lazyrouter) {\n    appOrRouter.lazyrouter();\n  }\n\n  const router = isApp ? appOrRouter._router : appOrRouter;\n\n  if (!router) {\n    /*\n    If we end up here, this means likely that this integration is used with Express 3 or Express 5.\n    For now, we don't support these versions (3 is very old and 5 is still in beta). To support Express 5,\n    we'd need to make more changes to the routing instrumentation because the router is no longer part of\n    the Express core package but maintained in its own package. The new router has different function\n    signatures and works slightly differently, demanding more changes than just taking the router from\n    `app.router` instead of `app._router`.\n    @see https://github.com/pillarjs/router\n\n    TODO: Proper Express 5 support\n    */\n    __DEBUG_BUILD__ && logger.debug('Cannot instrument router for URL Parameterization (did not find a valid router).');\n    __DEBUG_BUILD__ && logger.debug('Routing instrumentation is currently only supported in Express 4.');\n    return;\n  }\n\n  const routerProto = Object.getPrototypeOf(router) as ExpressRouter;\n\n  const originalProcessParams = routerProto.process_params;\n  routerProto.process_params = function process_params(\n    layer: Layer,\n    called: unknown,\n    req: PatchedRequest,\n    res: ExpressResponse & SentryTracingResponse,\n    done: () => unknown,\n  ) {\n    // Base case: We're in the first part of the URL (thus we start with the root '/')\n    if (!req._reconstructedRoute) {\n      req._reconstructedRoute = '';\n    }\n\n    // If the layer's partial route has params, is a regex or an array, the route is stored in layer.route.\n    const { layerRoutePath, isRegex, isArray, numExtraSegments }: LayerRoutePathInfo = getLayerRoutePathInfo(layer);\n\n    if (layerRoutePath || isRegex || isArray) {\n      req._hasParameters = true;\n    }\n\n    // Otherwise, the hardcoded path (i.e. a partial route without params) is stored in layer.path\n    const partialRoute = layerRoutePath || layer.path || '';\n\n    // Normalize the partial route so that it doesn't contain leading or trailing slashes\n    // and exclude empty or '*' wildcard routes.\n    // The exclusion of '*' routes is our best effort to not \"pollute\" the transaction name\n    // with interim handlers (e.g. ones that check authentication or do other middleware stuff).\n    // We want to end up with the parameterized URL of the incoming request without any extraneous path segments.\n    const finalPartialRoute = partialRoute\n      .split('/')\n      .filter(segment => segment.length > 0 && (isRegex || isArray || !segment.includes('*')))\n      .join('/');\n\n    // If we found a valid partial URL, we append it to the reconstructed route\n    if (finalPartialRoute && finalPartialRoute.length > 0) {\n      // If the partial route is from a regex route, we append a '/' to close the regex\n      req._reconstructedRoute += `/${finalPartialRoute}${isRegex ? '/' : ''}`;\n    }\n\n    // Now we check if we are in the \"last\" part of the route. We determine this by comparing the\n    // number of URL segments from the original URL to that of our reconstructed parameterized URL.\n    // If we've reached our final destination, we update the transaction name.\n    const urlLength = getNumberOfUrlSegments(req.originalUrl || '') + numExtraSegments;\n    const routeLength = getNumberOfUrlSegments(req._reconstructedRoute);\n\n    if (urlLength === routeLength) {\n      if (!req._hasParameters) {\n        if (req._reconstructedRoute !== req.originalUrl) {\n          req._reconstructedRoute = req.originalUrl;\n        }\n      }\n\n      const transaction = res.__sentry_transaction;\n      if (transaction && transaction.metadata.source !== 'custom') {\n        // If the request URL is '/' or empty, the reconstructed route will be empty.\n        // Therefore, we fall back to setting the final route to '/' in this case.\n        const finalRoute = req._reconstructedRoute || '/';\n\n        transaction.setName(...extractPathForTransaction(req, { path: true, method: true, customRoute: finalRoute }));\n      }\n    }\n\n    return originalProcessParams.call(this, layer, called, req, res, done);\n  };\n}\n\ntype LayerRoutePathInfo = {\n  layerRoutePath?: string;\n  isRegex: boolean;\n  isArray: boolean;\n  numExtraSegments: number;\n};\n\n/**\n * Extracts and stringifies the layer's route which can either be a string with parameters (`users/:id`),\n * a RegEx (`/test/`) or an array of strings and regexes (`['/path1', /\\/path[2-5]/, /path/:id]`). Additionally\n * returns extra information about the route, such as if the route is defined as regex or as an array.\n *\n * @param layer the layer to extract the stringified route from\n *\n * @returns an object containing the stringified route, a flag determining if the route was a regex\n *          and the number of extra segments to the matched path that are additionally in the route,\n *          if the route was an array (defaults to 0).\n */\nfunction getLayerRoutePathInfo(layer: Layer): LayerRoutePathInfo {\n  const lrp = layer.route?.path;\n\n  const isRegex = isRegExp(lrp);\n  const isArray = Array.isArray(lrp);\n\n  if (!lrp) {\n    return { isRegex, isArray, numExtraSegments: 0 };\n  }\n\n  const numExtraSegments = isArray\n    ? Math.max(getNumberOfArrayUrlSegments(lrp as RouteType[]) - getNumberOfUrlSegments(layer.path || ''), 0)\n    : 0;\n\n  const layerRoutePath = getLayerRoutePathString(isArray, lrp);\n\n  return { layerRoutePath, isRegex, isArray, numExtraSegments };\n}\n\n/**\n * Returns the number of URL segments in an array of routes\n *\n * Example: ['/api/test', /\\/api\\/post[0-9]/, '/users/:id/details`] -> 7\n */\nfunction getNumberOfArrayUrlSegments(routesArray: RouteType[]): number {\n  return routesArray.reduce((accNumSegments: number, currentRoute: RouteType) => {\n    // array members can be a RegEx -> convert them toString\n    return accNumSegments + getNumberOfUrlSegments(currentRoute.toString());\n  }, 0);\n}\n\n/**\n * Extracts and returns the stringified version of the layers route path\n * Handles route arrays (by joining the paths together) as well as RegExp and normal\n * string values (in the latter case the toString conversion is technically unnecessary but\n * it doesn't hurt us either).\n */\nfunction getLayerRoutePathString(isArray: boolean, lrp?: RouteType | RouteType[]): string | undefined {\n  if (isArray) {\n    return (lrp as RouteType[]).map(r => r.toString()).join(',');\n  }\n  return lrp && lrp.toString();\n}\n"],"names":[],"mappings":";;;;AA4EA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,C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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA,EAAA;EACA,CAAA,EAAA,CAAA,OAAA,EAAA;IACA,OAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;EACA,OAAA,CAAA,CAAA,EAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;AACA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { loadModule, logger, fill, isThenable } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

/** Tracing integration for graphql package */
class GraphQL  {constructor() { GraphQL.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'GraphQL';}

  /**
   * @inheritDoc
   */
   __init() {this.name = GraphQL.id;}

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || loadModule('graphql/execution/execute.js'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('GraphQL Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('GraphQL Integration was unable to require graphql/execution package.');
      return;
    }

    fill(pkg, 'execute', function (orig) {
      return function ( ...args) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);

        const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
          description: 'execute',
          op: 'graphql.execute',
        })]);

        _optionalChain([scope, 'optionalAccess', _6 => _6.setSpan, 'call', _7 => _7(span)]);

        const rv = orig.call(this, ...args);

        if (isThenable(rv)) {
          return rv.then((res) => {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            _optionalChain([scope, 'optionalAccess', _10 => _10.setSpan, 'call', _11 => _11(parentSpan)]);

            return res;
          });
        }

        _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
        _optionalChain([scope, 'optionalAccess', _14 => _14.setSpan, 'call', _15 => _15(parentSpan)]);
        return rv;
      };
    });
  }
}GraphQL.__initStatic();

export { GraphQL };
//# sourceMappingURL=graphql.js.map
{"version":3,"file":"graphql.js","sources":["../../../../src/node/integrations/graphql.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype GraphQLModule = {\n  [method: string]: (...args: unknown[]) => unknown;\n};\n\n/** Tracing integration for graphql package */\nexport class GraphQL implements LazyLoadedIntegration<GraphQLModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GraphQL';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = GraphQL.id;\n\n  private _module?: GraphQLModule;\n\n  /** @inheritdoc */\n  public loadDependency(): GraphQLModule | undefined {\n    return (this._module = this._module || loadModule('graphql/execution/execute.js'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('GraphQL Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('GraphQL Integration was unable to require graphql/execution package.');\n      return;\n    }\n\n    fill(pkg, 'execute', function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, ...args: unknown[]) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n\n        const span = parentSpan?.startChild({\n          description: 'execute',\n          op: 'graphql.execute',\n        });\n\n        scope?.setSpan(span);\n\n        const rv = orig.call(this, ...args);\n\n        if (isThenable(rv)) {\n          return rv.then((res: unknown) => {\n            span?.finish();\n            scope?.setSpan(parentSpan);\n\n            return res;\n          });\n        }\n\n        span?.finish();\n        scope?.setSpan(parentSpan);\n        return rv;\n      };\n    });\n  }\n}\n"],"names":[],"mappings":";;;;AAWA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;EAEA,C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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA;MACA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}import { dynamicRequire } from '@sentry/utils';

const lazyLoadedNodePerformanceMonitoringIntegrations = [
  () => {
    const integration = dynamicRequire(module, './apollo')

;
    return new integration.Apollo();
  },
  () => {
    const integration = dynamicRequire(module, './apollo')

;
    return new integration.Apollo({ useNestjs: true });
  },
  () => {
    const integration = dynamicRequire(module, './graphql')

;
    return new integration.GraphQL();
  },
  () => {
    const integration = dynamicRequire(module, './mongo')

;
    return new integration.Mongo();
  },
  () => {
    const integration = dynamicRequire(module, './mongo')

;
    return new integration.Mongo({ mongoose: true });
  },
  () => {
    const integration = dynamicRequire(module, './mysql')

;
    return new integration.Mysql();
  },
  () => {
    const integration = dynamicRequire(module, './postgres')

;
    return new integration.Postgres();
  },
];

export { lazyLoadedNodePerformanceMonitoringIntegrations };
//# sourceMappingURL=lazy.js.map
{"version":3,"file":"lazy.js","sources":["../../../../src/node/integrations/lazy.ts"],"sourcesContent":["import type { Integration, IntegrationClass } from '@sentry/types';\nimport { dynamicRequire } from '@sentry/utils';\n\nexport interface LazyLoadedIntegration<T = object> extends Integration {\n  /**\n   * Loads the integration's dependency and caches it so it doesn't have to be loaded again.\n   *\n   * If this returns undefined, the dependency could not be loaded.\n   */\n  loadDependency(): T | undefined;\n}\n\nexport const lazyLoadedNodePerformanceMonitoringIntegrations: (() => LazyLoadedIntegration)[] = [\n  () => {\n    const integration = dynamicRequire(module, './apollo') as {\n      Apollo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Apollo();\n  },\n  () => {\n    const integration = dynamicRequire(module, './apollo') as {\n      Apollo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Apollo({ useNestjs: true });\n  },\n  () => {\n    const integration = dynamicRequire(module, './graphql') as {\n      GraphQL: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.GraphQL();\n  },\n  () => {\n    const integration = dynamicRequire(module, './mongo') as {\n      Mongo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mongo();\n  },\n  () => {\n    const integration = dynamicRequire(module, './mongo') as {\n      Mongo: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mongo({ mongoose: true });\n  },\n  () => {\n    const integration = dynamicRequire(module, './mysql') as {\n      Mysql: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Mysql();\n  },\n  () => {\n    const integration = dynamicRequire(module, './postgres') as {\n      Postgres: IntegrationClass<LazyLoadedIntegration>;\n    };\n    return new integration.Postgres();\n  },\n];\n"],"names":[],"mappings":";;AAYA,MAAA,+CAAA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,UAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,MAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,UAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,MAAA,CAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,WAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,SAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,KAAA,EAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA;AACA,IAAA,MAAA,WAAA,GAAA,cAAA,CAAA,MAAA,EAAA,YAAA,CAAA;;AAEA,CAAA;AACA,IAAA,OAAA,IAAA,WAAA,CAAA,QAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { loadModule, logger, fill, isThenable } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

// This allows us to use the same array for both defaults options and the type itself.
// (note `as const` at the end to make it a union of string literal types (i.e. "a" | "b" | ... )
// and not just a string[])

const OPERATIONS = [
  'aggregate', // aggregate(pipeline, options, callback)
  'bulkWrite', // bulkWrite(operations, options, callback)
  'countDocuments', // countDocuments(query, options, callback)
  'createIndex', // createIndex(fieldOrSpec, options, callback)
  'createIndexes', // createIndexes(indexSpecs, options, callback)
  'deleteMany', // deleteMany(filter, options, callback)
  'deleteOne', // deleteOne(filter, options, callback)
  'distinct', // distinct(key, query, options, callback)
  'drop', // drop(options, callback)
  'dropIndex', // dropIndex(indexName, options, callback)
  'dropIndexes', // dropIndexes(options, callback)
  'estimatedDocumentCount', // estimatedDocumentCount(options, callback)
  'find', // find(query, options, callback)
  'findOne', // findOne(query, options, callback)
  'findOneAndDelete', // findOneAndDelete(filter, options, callback)
  'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)
  'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)
  'indexes', // indexes(options, callback)
  'indexExists', // indexExists(indexes, options, callback)
  'indexInformation', // indexInformation(options, callback)
  'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)
  'insertMany', // insertMany(docs, options, callback)
  'insertOne', // insertOne(doc, options, callback)
  'isCapped', // isCapped(options, callback)
  'mapReduce', // mapReduce(map, reduce, options, callback)
  'options', // options(options, callback)
  'parallelCollectionScan', // parallelCollectionScan(options, callback)
  'rename', // rename(newName, options, callback)
  'replaceOne', // replaceOne(filter, doc, options, callback)
  'stats', // stats(options, callback)
  'updateMany', // updateMany(filter, update, options, callback)
  'updateOne', // updateOne(filter, update, options, callback)
] ;

// All of the operations above take `options` and `callback` as their final parameters, but some of them
// take additional parameters as well. For those operations, this is a map of
// { <operation name>:  [<names of additional parameters>] }, as a way to know what to call the operation's
// positional arguments when we add them to the span's `data` object later
const OPERATION_SIGNATURES

 = {
  // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well
  // see https://github.com/getsentry/sentry-javascript/pull/3102
  bulkWrite: ['operations'],
  countDocuments: ['query'],
  createIndex: ['fieldOrSpec'],
  createIndexes: ['indexSpecs'],
  deleteMany: ['filter'],
  deleteOne: ['filter'],
  distinct: ['key', 'query'],
  dropIndex: ['indexName'],
  find: ['query'],
  findOne: ['query'],
  findOneAndDelete: ['filter'],
  findOneAndReplace: ['filter', 'replacement'],
  findOneAndUpdate: ['filter', 'update'],
  indexExists: ['indexes'],
  insertMany: ['docs'],
  insertOne: ['doc'],
  mapReduce: ['map', 'reduce'],
  rename: ['newName'],
  replaceOne: ['filter', 'doc'],
  updateMany: ['filter', 'update'],
  updateOne: ['filter', 'update'],
};

function isCursor(maybeCursor) {
  return maybeCursor && typeof maybeCursor === 'object' && maybeCursor.once && typeof maybeCursor.once === 'function';
}

/** Tracing integration for mongo package */
class Mongo  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Mongo';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Mongo.id;}

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Mongo.prototype.__init.call(this);
    this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS );
    this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;
    this._useMongoose = !!options.useMongoose;
  }

  /** @inheritdoc */
   loadDependency() {
    const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';
    return (this._module = this._module || loadModule(moduleName));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Mongo Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Mongo Integration was unable to require \`${moduleName}\` package.`);
      return;
    }

    this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub);
  }

  /**
   * Patches original collection methods
   */
   _instrumentOperations(collection, operations, getCurrentHub) {
    operations.forEach((operation) => this._patchOperation(collection, operation, getCurrentHub));
  }

  /**
   * Patches original collection to utilize our tracing functionality
   */
   _patchOperation(collection, operation, getCurrentHub) {
    if (!(operation in collection.prototype)) return;

    const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);

    fill(collection.prototype, operation, function (orig) {
      return function ( ...args) {
        const lastArg = args[args.length - 1];
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);

        // Check if the operation was passed a callback. (mapReduce requires a different check, as
        // its (non-callback) arguments can also be functions.)
        if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {
          const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5(getSpanContext(this, operation, args))]);
          const maybePromiseOrCursor = orig.call(this, ...args);

          if (isThenable(maybePromiseOrCursor)) {
            return maybePromiseOrCursor.then((res) => {
              _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
              return res;
            });
          }
          // If the operation returns a Cursor
          // we need to attach a listener to it to finish the span when the cursor is closed.
          else if (isCursor(maybePromiseOrCursor)) {
            const cursor = maybePromiseOrCursor ;

            try {
              cursor.once('close', () => {
                _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
              });
            } catch (e) {
              // If the cursor is already closed, `once` will throw an error. In that case, we can
              // finish the span immediately.
              _optionalChain([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);
            }

            return cursor;
          } else {
            _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
            return maybePromiseOrCursor;
          }
        }

        const span = _optionalChain([parentSpan, 'optionalAccess', _14 => _14.startChild, 'call', _15 => _15(getSpanContext(this, operation, args.slice(0, -1)))]);

        return orig.call(this, ...args.slice(0, -1), function (err, result) {
          _optionalChain([span, 'optionalAccess', _16 => _16.finish, 'call', _17 => _17()]);
          lastArg(err, result);
        });
      };
    });
  }

  /**
   * Form a SpanContext based on the user input to a given operation.
   */
   _getSpanContextFromOperationArguments(
    collection,
    operation,
    args,
  ) {
    const data = {
      collectionName: collection.collectionName,
      dbName: collection.dbName,
      namespace: collection.namespace,
    };
    const spanContext = {
      op: 'db',
      description: operation,
      data,
    };

    // If the operation takes no arguments besides `options` and `callback`, or if argument
    // collection is disabled for this operation, just return early.
    const signature = OPERATION_SIGNATURES[operation];
    const shouldDescribe = Array.isArray(this._describeOperations)
      ? this._describeOperations.includes(operation)
      : this._describeOperations;

    if (!signature || !shouldDescribe) {
      return spanContext;
    }

    try {
      // Special case for `mapReduce`, as the only one accepting functions as arguments.
      if (operation === 'mapReduce') {
        const [map, reduce] = args ;
        data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';
        data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';
      } else {
        for (let i = 0; i < signature.length; i++) {
          data[signature[i]] = JSON.stringify(args[i]);
        }
      }
    } catch (_oO) {
      // no-empty
    }

    return spanContext;
  }
}Mongo.__initStatic();

export { Mongo };
//# sourceMappingURL=mongo.js.map
{"version":3,"file":"mongo.js","sources":["../../../../src/node/integrations/mongo.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor, SpanContext } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\n// This allows us to use the same array for both defaults options and the type itself.\n// (note `as const` at the end to make it a union of string literal types (i.e. \"a\" | \"b\" | ... )\n// and not just a string[])\ntype Operation = (typeof OPERATIONS)[number];\nconst OPERATIONS = [\n  'aggregate', // aggregate(pipeline, options, callback)\n  'bulkWrite', // bulkWrite(operations, options, callback)\n  'countDocuments', // countDocuments(query, options, callback)\n  'createIndex', // createIndex(fieldOrSpec, options, callback)\n  'createIndexes', // createIndexes(indexSpecs, options, callback)\n  'deleteMany', // deleteMany(filter, options, callback)\n  'deleteOne', // deleteOne(filter, options, callback)\n  'distinct', // distinct(key, query, options, callback)\n  'drop', // drop(options, callback)\n  'dropIndex', // dropIndex(indexName, options, callback)\n  'dropIndexes', // dropIndexes(options, callback)\n  'estimatedDocumentCount', // estimatedDocumentCount(options, callback)\n  'find', // find(query, options, callback)\n  'findOne', // findOne(query, options, callback)\n  'findOneAndDelete', // findOneAndDelete(filter, options, callback)\n  'findOneAndReplace', // findOneAndReplace(filter, replacement, options, callback)\n  'findOneAndUpdate', // findOneAndUpdate(filter, update, options, callback)\n  'indexes', // indexes(options, callback)\n  'indexExists', // indexExists(indexes, options, callback)\n  'indexInformation', // indexInformation(options, callback)\n  'initializeOrderedBulkOp', // initializeOrderedBulkOp(options, callback)\n  'insertMany', // insertMany(docs, options, callback)\n  'insertOne', // insertOne(doc, options, callback)\n  'isCapped', // isCapped(options, callback)\n  'mapReduce', // mapReduce(map, reduce, options, callback)\n  'options', // options(options, callback)\n  'parallelCollectionScan', // parallelCollectionScan(options, callback)\n  'rename', // rename(newName, options, callback)\n  'replaceOne', // replaceOne(filter, doc, options, callback)\n  'stats', // stats(options, callback)\n  'updateMany', // updateMany(filter, update, options, callback)\n  'updateOne', // updateOne(filter, update, options, callback)\n] as const;\n\n// All of the operations above take `options` and `callback` as their final parameters, but some of them\n// take additional parameters as well. For those operations, this is a map of\n// { <operation name>:  [<names of additional parameters>] }, as a way to know what to call the operation's\n// positional arguments when we add them to the span's `data` object later\nconst OPERATION_SIGNATURES: {\n  [op in Operation]?: string[];\n} = {\n  // aggregate intentionally not included because `pipeline` arguments are too complex to serialize well\n  // see https://github.com/getsentry/sentry-javascript/pull/3102\n  bulkWrite: ['operations'],\n  countDocuments: ['query'],\n  createIndex: ['fieldOrSpec'],\n  createIndexes: ['indexSpecs'],\n  deleteMany: ['filter'],\n  deleteOne: ['filter'],\n  distinct: ['key', 'query'],\n  dropIndex: ['indexName'],\n  find: ['query'],\n  findOne: ['query'],\n  findOneAndDelete: ['filter'],\n  findOneAndReplace: ['filter', 'replacement'],\n  findOneAndUpdate: ['filter', 'update'],\n  indexExists: ['indexes'],\n  insertMany: ['docs'],\n  insertOne: ['doc'],\n  mapReduce: ['map', 'reduce'],\n  rename: ['newName'],\n  replaceOne: ['filter', 'doc'],\n  updateMany: ['filter', 'update'],\n  updateOne: ['filter', 'update'],\n};\n\ninterface MongoCollection {\n  collectionName: string;\n  dbName: string;\n  namespace: string;\n  prototype: {\n    [operation in Operation]: (...args: unknown[]) => unknown;\n  };\n}\n\ninterface MongoOptions {\n  operations?: Operation[];\n  describeOperations?: boolean | Operation[];\n  useMongoose?: boolean;\n}\n\ninterface MongoCursor {\n  once(event: 'close', listener: () => void): void;\n}\n\nfunction isCursor(maybeCursor: MongoCursor): maybeCursor is MongoCursor {\n  return maybeCursor && typeof maybeCursor === 'object' && maybeCursor.once && typeof maybeCursor.once === 'function';\n}\n\ntype MongoModule = { Collection: MongoCollection };\n\n/** Tracing integration for mongo package */\nexport class Mongo implements LazyLoadedIntegration<MongoModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Mongo';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Mongo.id;\n\n  private _operations: Operation[];\n  private _describeOperations?: boolean | Operation[];\n  private _useMongoose: boolean;\n\n  private _module?: MongoModule;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: MongoOptions = {}) {\n    this._operations = Array.isArray(options.operations) ? options.operations : (OPERATIONS as unknown as Operation[]);\n    this._describeOperations = 'describeOperations' in options ? options.describeOperations : true;\n    this._useMongoose = !!options.useMongoose;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): MongoModule | undefined {\n    const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n    return (this._module = this._module || loadModule(moduleName));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Mongo Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      const moduleName = this._useMongoose ? 'mongoose' : 'mongodb';\n      __DEBUG_BUILD__ && logger.error(`Mongo Integration was unable to require \\`${moduleName}\\` package.`);\n      return;\n    }\n\n    this._instrumentOperations(pkg.Collection, this._operations, getCurrentHub);\n  }\n\n  /**\n   * Patches original collection methods\n   */\n  private _instrumentOperations(collection: MongoCollection, operations: Operation[], getCurrentHub: () => Hub): void {\n    operations.forEach((operation: Operation) => this._patchOperation(collection, operation, getCurrentHub));\n  }\n\n  /**\n   * Patches original collection to utilize our tracing functionality\n   */\n  private _patchOperation(collection: MongoCollection, operation: Operation, getCurrentHub: () => Hub): void {\n    if (!(operation in collection.prototype)) return;\n\n    const getSpanContext = this._getSpanContextFromOperationArguments.bind(this);\n\n    fill(collection.prototype, operation, function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, ...args: unknown[]) {\n        const lastArg = args[args.length - 1];\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n\n        // Check if the operation was passed a callback. (mapReduce requires a different check, as\n        // its (non-callback) arguments can also be functions.)\n        if (typeof lastArg !== 'function' || (operation === 'mapReduce' && args.length === 2)) {\n          const span = parentSpan?.startChild(getSpanContext(this, operation, args));\n          const maybePromiseOrCursor = orig.call(this, ...args);\n\n          if (isThenable(maybePromiseOrCursor)) {\n            return maybePromiseOrCursor.then((res: unknown) => {\n              span?.finish();\n              return res;\n            });\n          }\n          // If the operation returns a Cursor\n          // we need to attach a listener to it to finish the span when the cursor is closed.\n          else if (isCursor(maybePromiseOrCursor)) {\n            const cursor = maybePromiseOrCursor as MongoCursor;\n\n            try {\n              cursor.once('close', () => {\n                span?.finish();\n              });\n            } catch (e) {\n              // If the cursor is already closed, `once` will throw an error. In that case, we can\n              // finish the span immediately.\n              span?.finish();\n            }\n\n            return cursor;\n          } else {\n            span?.finish();\n            return maybePromiseOrCursor;\n          }\n        }\n\n        const span = parentSpan?.startChild(getSpanContext(this, operation, args.slice(0, -1)));\n\n        return orig.call(this, ...args.slice(0, -1), function (err: Error, result: unknown) {\n          span?.finish();\n          lastArg(err, result);\n        });\n      };\n    });\n  }\n\n  /**\n   * Form a SpanContext based on the user input to a given operation.\n   */\n  private _getSpanContextFromOperationArguments(\n    collection: MongoCollection,\n    operation: Operation,\n    args: unknown[],\n  ): SpanContext {\n    const data: { [key: string]: string } = {\n      collectionName: collection.collectionName,\n      dbName: collection.dbName,\n      namespace: collection.namespace,\n    };\n    const spanContext: SpanContext = {\n      op: 'db',\n      description: operation,\n      data,\n    };\n\n    // If the operation takes no arguments besides `options` and `callback`, or if argument\n    // collection is disabled for this operation, just return early.\n    const signature = OPERATION_SIGNATURES[operation];\n    const shouldDescribe = Array.isArray(this._describeOperations)\n      ? this._describeOperations.includes(operation)\n      : this._describeOperations;\n\n    if (!signature || !shouldDescribe) {\n      return spanContext;\n    }\n\n    try {\n      // Special case for `mapReduce`, as the only one accepting functions as arguments.\n      if (operation === 'mapReduce') {\n        const [map, reduce] = args as { name?: string }[];\n        data[signature[0]] = typeof map === 'string' ? map : map.name || '<anonymous>';\n        data[signature[1]] = typeof reduce === 'string' ? reduce : reduce.name || '<anonymous>';\n      } else {\n        for (let i = 0; i < signature.length; i++) {\n          data[signature[i]] = JSON.stringify(args[i]);\n        }\n      }\n    } catch (_oO) {\n      // no-empty\n    }\n\n    return spanContext;\n  }\n}\n"],"names":[],"mappings":";;;;AAOA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CA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_optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { loadModule, logger, fill } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

/** Tracing integration for node-mysql package */
class Mysql  {constructor() { Mysql.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Mysql';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Mysql.id;}

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || loadModule('mysql/lib/Connection.js'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Mysql Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Mysql Integration was unable to require `mysql` package.');
      return;
    }

    // The original function will have one of these signatures:
    //    function (callback) => void
    //    function (options, callback) => void
    //    function (options, values, callback) => void
    fill(pkg, 'createQuery', function (orig) {
      return function ( options, values, callback) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _2 => _2.getSpan, 'call', _3 => _3()]);
        const span = _optionalChain([parentSpan, 'optionalAccess', _4 => _4.startChild, 'call', _5 => _5({
          description: typeof options === 'string' ? options : (options ).sql,
          op: 'db',
        })]);

        if (typeof callback === 'function') {
          return orig.call(this, options, values, function (err, result, fields) {
            _optionalChain([span, 'optionalAccess', _6 => _6.finish, 'call', _7 => _7()]);
            callback(err, result, fields);
          });
        }

        if (typeof values === 'function') {
          return orig.call(this, options, function (err, result, fields) {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            values(err, result, fields);
          });
        }

        return orig.call(this, options, values, callback);
      };
    });
  }
}Mysql.__initStatic();

export { Mysql };
//# sourceMappingURL=mysql.js.map
{"version":3,"file":"mysql.js","sources":["../../../../src/node/integrations/mysql.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface MysqlConnection {\n  createQuery: () => void;\n}\n\n/** Tracing integration for node-mysql package */\nexport class Mysql implements LazyLoadedIntegration<MysqlConnection> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Mysql';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Mysql.id;\n\n  private _module?: MysqlConnection;\n\n  /** @inheritdoc */\n  public loadDependency(): MysqlConnection | undefined {\n    return (this._module = this._module || loadModule('mysql/lib/Connection.js'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Mysql Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('Mysql Integration was unable to require `mysql` package.');\n      return;\n    }\n\n    // The original function will have one of these signatures:\n    //    function (callback) => void\n    //    function (options, callback) => void\n    //    function (options, values, callback) => void\n    fill(pkg, 'createQuery', function (orig: () => void) {\n      return function (this: unknown, options: unknown, values: unknown, callback: unknown) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n        const span = parentSpan?.startChild({\n          description: typeof options === 'string' ? options : (options as { sql: string }).sql,\n          op: 'db',\n        });\n\n        if (typeof callback === 'function') {\n          return orig.call(this, options, values, function (err: Error, result: unknown, fields: unknown) {\n            span?.finish();\n            callback(err, result, fields);\n          });\n        }\n\n        if (typeof values === 'function') {\n          return orig.call(this, options, function (err: Error, result: unknown, fields: unknown) {\n            span?.finish();\n            values(err, result, fields);\n          });\n        }\n\n        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;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { loadModule, logger, fill, isThenable } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

/** Tracing integration for node-postgres package */
class Postgres  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Postgres';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Postgres.id;}

   constructor(options = {}) {Postgres.prototype.__init.call(this);
    this._usePgNative = !!options.usePgNative;
  }

  /** @inheritdoc */
   loadDependency() {
    return (this._module = this._module || loadModule('pg'));
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Postgres Integration is skipped because of instrumenter configuration.');
      return;
    }

    const pkg = this.loadDependency();

    if (!pkg) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Postgres Integration was unable to require `pg` package.');
      return;
    }

    if (this._usePgNative && !_optionalChain([pkg, 'access', _2 => _2.native, 'optionalAccess', _3 => _3.Client])) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error("Postgres Integration was unable to access 'pg-native' bindings.");
      return;
    }

    const { Client } = this._usePgNative ? pkg.native : pkg;

    /**
     * function (query, callback) => void
     * function (query, params, callback) => void
     * function (query) => Promise
     * function (query, params) => Promise
     * function (pg.Cursor) => pg.Cursor
     */
    fill(Client.prototype, 'query', function (orig) {
      return function ( config, values, callback) {
        const scope = getCurrentHub().getScope();
        const parentSpan = _optionalChain([scope, 'optionalAccess', _4 => _4.getSpan, 'call', _5 => _5()]);
        const span = _optionalChain([parentSpan, 'optionalAccess', _6 => _6.startChild, 'call', _7 => _7({
          description: typeof config === 'string' ? config : (config ).text,
          op: 'db',
        })]);

        if (typeof callback === 'function') {
          return orig.call(this, config, values, function (err, result) {
            _optionalChain([span, 'optionalAccess', _8 => _8.finish, 'call', _9 => _9()]);
            callback(err, result);
          });
        }

        if (typeof values === 'function') {
          return orig.call(this, config, function (err, result) {
            _optionalChain([span, 'optionalAccess', _10 => _10.finish, 'call', _11 => _11()]);
            values(err, result);
          });
        }

        const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);

        if (isThenable(rv)) {
          return rv.then((res) => {
            _optionalChain([span, 'optionalAccess', _12 => _12.finish, 'call', _13 => _13()]);
            return res;
          });
        }

        _optionalChain([span, 'optionalAccess', _14 => _14.finish, 'call', _15 => _15()]);
        return rv;
      };
    });
  }
}Postgres.__initStatic();

export { Postgres };
//# sourceMappingURL=postgres.js.map
{"version":3,"file":"postgres.js","sources":["../../../../src/node/integrations/postgres.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor } from '@sentry/types';\nimport { fill, isThenable, loadModule, logger } from '@sentry/utils';\n\nimport type { LazyLoadedIntegration } from './lazy';\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ninterface PgClient {\n  prototype: {\n    query: () => void | Promise<unknown>;\n  };\n}\n\ninterface PgOptions {\n  usePgNative?: boolean;\n}\n\ntype PGModule = { Client: PgClient; native: { Client: PgClient } };\n\n/** Tracing integration for node-postgres package */\nexport class Postgres implements LazyLoadedIntegration<PGModule> {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Postgres';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Postgres.id;\n\n  private _usePgNative: boolean;\n\n  private _module?: PGModule;\n\n  public constructor(options: PgOptions = {}) {\n    this._usePgNative = !!options.usePgNative;\n  }\n\n  /** @inheritdoc */\n  public loadDependency(): PGModule | undefined {\n    return (this._module = this._module || loadModule('pg'));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Postgres Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    const pkg = this.loadDependency();\n\n    if (!pkg) {\n      __DEBUG_BUILD__ && logger.error('Postgres Integration was unable to require `pg` package.');\n      return;\n    }\n\n    if (this._usePgNative && !pkg.native?.Client) {\n      __DEBUG_BUILD__ && logger.error(\"Postgres Integration was unable to access 'pg-native' bindings.\");\n      return;\n    }\n\n    const { Client } = this._usePgNative ? pkg.native : pkg;\n\n    /**\n     * function (query, callback) => void\n     * function (query, params, callback) => void\n     * function (query) => Promise\n     * function (query, params) => Promise\n     * function (pg.Cursor) => pg.Cursor\n     */\n    fill(Client.prototype, 'query', function (orig: () => void | Promise<unknown>) {\n      return function (this: unknown, config: unknown, values: unknown, callback: unknown) {\n        const scope = getCurrentHub().getScope();\n        const parentSpan = scope?.getSpan();\n        const span = parentSpan?.startChild({\n          description: typeof config === 'string' ? config : (config as { text: string }).text,\n          op: 'db',\n        });\n\n        if (typeof callback === 'function') {\n          return orig.call(this, config, values, function (err: Error, result: unknown) {\n            span?.finish();\n            callback(err, result);\n          });\n        }\n\n        if (typeof values === 'function') {\n          return orig.call(this, config, function (err: Error, result: unknown) {\n            span?.finish();\n            values(err, result);\n          });\n        }\n\n        const rv = typeof values !== 'undefined' ? orig.call(this, config, values) : orig.call(this, config);\n\n        if (isThenable(rv)) {\n          return rv.then((res: unknown) => {\n            span?.finish();\n            return res;\n          });\n        }\n\n        span?.finish();\n        return rv;\n      };\n    });\n  }\n}\n"],"names":[],"mappings":";;;;AAmBA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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CAAA,CAAA,CAAA,CAAA;YACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,GAAA;UACA,CAAA,CAAA;QACA;;QAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA;MACA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}import { trace } from '@sentry/core';
import { logger } from '@sentry/utils';
import { shouldDisableAutoInstrumentation } from './utils/node-utils.js';

function isValidPrismaClient(possibleClient) {
  return possibleClient && !!(possibleClient )['$use'];
}

/** Tracing integration for @prisma/client package */
class Prisma  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Prisma';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Prisma.id;}

  /**
   * Prisma ORM Client Instance
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Prisma.prototype.__init.call(this);
    if (isValidPrismaClient(options.client)) {
      this._client = options.client;
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn(
          `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,
        );
    }
  }

  /**
   * @inheritDoc
   */
   setupOnce(_, getCurrentHub) {
    if (!this._client) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('PrismaIntegration is missing a Prisma Client Instance');
      return;
    }

    if (shouldDisableAutoInstrumentation(getCurrentHub)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Prisma Integration is skipped because of instrumenter configuration.');
      return;
    }

    this._client.$use((params, next) => {
      const action = params.action;
      const model = params.model;
      return trace({ name: model ? `${model} ${action}` : action, op: 'db.sql.prisma' }, () => next(params));
    });
  }
} Prisma.__initStatic();

export { Prisma };
//# sourceMappingURL=prisma.js.map
{"version":3,"file":"prisma.js","sources":["../../../../src/node/integrations/prisma.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport { trace } from '@sentry/core';\nimport type { EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { shouldDisableAutoInstrumentation } from './utils/node-utils';\n\ntype PrismaAction =\n  | 'findUnique'\n  | 'findMany'\n  | 'findFirst'\n  | 'create'\n  | 'createMany'\n  | 'update'\n  | 'updateMany'\n  | 'upsert'\n  | 'delete'\n  | 'deleteMany'\n  | 'executeRaw'\n  | 'queryRaw'\n  | 'aggregate'\n  | 'count'\n  | 'runCommandRaw';\n\ninterface PrismaMiddlewareParams {\n  model?: unknown;\n  action: PrismaAction;\n  args: unknown;\n  dataPath: string[];\n  runInTransaction: boolean;\n}\n\ntype PrismaMiddleware<T = unknown> = (\n  params: PrismaMiddlewareParams,\n  next: (params: PrismaMiddlewareParams) => Promise<T>,\n) => Promise<T>;\n\ninterface PrismaClient {\n  $use: (cb: PrismaMiddleware) => void;\n}\n\nfunction isValidPrismaClient(possibleClient: unknown): possibleClient is PrismaClient {\n  return possibleClient && !!(possibleClient as PrismaClient)['$use'];\n}\n\n/** Tracing integration for @prisma/client package */\nexport class Prisma implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Prisma';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Prisma.id;\n\n  /**\n   * Prisma ORM Client Instance\n   */\n  private readonly _client?: PrismaClient;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { client?: unknown } = {}) {\n    if (isValidPrismaClient(options.client)) {\n      this._client = options.client;\n    } else {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `Unsupported Prisma client provided to PrismaIntegration. Provided client: ${JSON.stringify(options.client)}`,\n        );\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    if (!this._client) {\n      __DEBUG_BUILD__ && logger.error('PrismaIntegration is missing a Prisma Client Instance');\n      return;\n    }\n\n    if (shouldDisableAutoInstrumentation(getCurrentHub)) {\n      __DEBUG_BUILD__ && logger.log('Prisma Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    this._client.$use((params, next: (params: PrismaMiddlewareParams) => Promise<unknown>) => {\n      const action = params.action;\n      const model = params.model;\n      return trace({ name: model ? `${model} ${action}` : action, op: 'db.sql.prisma' }, () => next(params));\n    });\n  }\n}\n"],"names":[],"mappings":";;;;AAyCA,SAAA,mBAAA,CAAA,cAAA,EAAA;AACA,EAAA,OAAA,cAAA,IAAA,CAAA,CAAA,CAAA,cAAA,GAAA,MAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,MAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,MAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,GAAA,EAAA,EAAA,CAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IA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/**
 * Check if Sentry auto-instrumentation should be disabled.
 *
 * @param getCurrentHub A method to fetch the current hub
 * @returns boolean
 */
function shouldDisableAutoInstrumentation(getCurrentHub) {
  const clientOptions = _optionalChain([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);
  const instrumenter = _optionalChain([clientOptions, 'optionalAccess', _6 => _6.instrumenter]) || 'sentry';

  return instrumenter !== 'sentry';
}

export { shouldDisableAutoInstrumentation };
//# sourceMappingURL=node-utils.js.map
{"version":3,"file":"node-utils.js","sources":["../../../../../src/node/integrations/utils/node-utils.ts"],"sourcesContent":["import type { Hub } from '@sentry/types';\n\n/**\n * Check if Sentry auto-instrumentation should be disabled.\n *\n * @param getCurrentHub A method to fetch the current hub\n * @returns boolean\n */\nexport function shouldDisableAutoInstrumentation(getCurrentHub: () => Hub): boolean {\n  const clientOptions = getCurrentHub().getClient()?.getOptions();\n  const instrumenter = clientOptions?.instrumenter || 'sentry';\n\n  return instrumenter !== 'sentry';\n}\n"],"names":[],"mappings":";;AAEA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA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AA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,cAAA,CAAA,CAAA,aAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,QAAA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;;"}Copyright (c) 2020 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry-internal/tracing",
  "version": "7.48.0",
  "description": "Sentry Internal Tracing Package",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing-internal",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@sentry/core": "7.48.0",
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0",
    "tslib": "^1.9.3"
  },
  "devDependencies": {
    "@types/express": "^4.17.14"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

## Sentry Internal Tracing Package - Do not use directly, for internal use only

This is an internal package that is being used to migrate @sentry/tracing code to its respective runtime packages.

For v8, @sentry/tracing will be dropped and the code in this package will be split into @sentry/browser and @sentry/node.
/**
 * Add a listener that cancels and finishes a transaction when the global
 * document is hidden.
 */
export declare function registerBackgroundTabDetection(): void;
//# sourceMappingURL=backgroundtab.d.ts.map{"version":3,"file":"backgroundtab.d.ts","sourceRoot":"","sources":["../../../src/browser/backgroundtab.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAgB,8BAA8B,IAAI,IAAI,CAwBrD"}import type { Hub } from '@sentry/core';
import type { EventProcessor, Integration, Transaction, TransactionContext } from '@sentry/types';
import type { RequestInstrumentationOptions } from './request';
export declare const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing";
/** Options for Browser Tracing integration */
export interface BrowserTracingOptions extends RequestInstrumentationOptions {
    /**
     * The time to wait in ms until the transaction will be finished during an idle state. An idle state is defined
     * by a moment where there are no in-progress spans.
     *
     * The transaction will use the end timestamp of the last finished span as the endtime for the transaction.
     * If there are still active spans when this the `idleTimeout` is set, the `idleTimeout` will get reset.
     * Time is in ms.
     *
     * Default: 1000
     */
    idleTimeout: number;
    /**
     * The max duration for a transaction. If a transaction duration hits the `finalTimeout` value, it
     * will be finished.
     * Time is in ms.
     *
     * Default: 30000
     */
    finalTimeout: number;
    /**
     * The heartbeat interval. If no new spans are started or open spans are finished within 3 heartbeats,
     * the transaction will be finished.
     * Time is in ms.
     *
     * Default: 5000
     */
    heartbeatInterval: number;
    /**
     * Flag to enable/disable creation of `navigation` transaction on history changes.
     *
     * Default: true
     */
    startTransactionOnLocationChange: boolean;
    /**
     * Flag to enable/disable creation of `pageload` transaction on first pageload.
     *
     * Default: true
     */
    startTransactionOnPageLoad: boolean;
    /**
     * Flag Transactions where tabs moved to background with "cancelled". Browser background tab timing is
     * not suited towards doing precise measurements of operations. By default, we recommend that this option
     * be enabled as background transactions can mess up your statistics in nondeterministic ways.
     *
     * Default: true
     */
    markBackgroundTransactions: boolean;
    /**
     * If true, Sentry will capture long tasks and add them to the corresponding transaction.
     *
     * Default: true
     */
    enableLongTask: boolean;
    /**
     * _metricOptions allows the user to send options to change how metrics are collected.
     *
     * _metricOptions is currently experimental.
     *
     * Default: undefined
     */
    _metricOptions?: Partial<{
        /**
         * @deprecated This property no longer has any effect and will be removed in v8.
         */
        _reportAllChanges: boolean;
    }>;
    /**
     * _experiments allows the user to send options to define how this integration works.
     * Note that the `enableLongTask` options is deprecated in favor of the option at the top level, and will be removed in v8.
     *
     * TODO (v8): Remove enableLongTask
     *
     * Default: undefined
     */
    _experiments: Partial<{
        enableLongTask: boolean;
        enableInteractions: boolean;
        onStartRouteTransaction: (t: Transaction | undefined, ctx: TransactionContext, getCurrentHub: () => Hub) => void;
    }>;
    /**
     * beforeNavigate is called before a pageload/navigation transaction is created and allows users to modify transaction
     * context data, or drop the transaction entirely (by setting `sampled = false` in the context).
     *
     * Note: For legacy reasons, transactions can also be dropped by returning `undefined`.
     *
     * @param context: The context data which will be passed to `startTransaction` by default
     *
     * @returns A (potentially) modified context object, with `sampled = false` if the transaction should be dropped.
     */
    beforeNavigate?(this: void, context: TransactionContext): TransactionContext | undefined;
    /**
     * Instrumentation that creates routing change transactions. By default creates
     * pageload and navigation transactions.
     */
    routingInstrumentation<T extends Transaction>(this: void, customStartTransaction: (context: TransactionContext) => T | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean): void;
}
/**
 * The Browser Tracing integration automatically instruments browser pageload/navigation
 * actions as transactions, and captures requests, metrics and errors as spans.
 *
 * The integration can be configured with a variety of options, and can be extended to use
 * any routing library. This integration uses {@see IdleTransaction} to create transactions.
 */
export declare class BrowserTracing implements Integration {
    /** Browser Tracing integration options */
    options: BrowserTracingOptions;
    /**
     * @inheritDoc
     */
    name: string;
    private _getCurrentHub?;
    private _latestRouteName?;
    private _latestRouteSource?;
    private _collectWebVitals;
    constructor(_options?: Partial<BrowserTracingOptions>);
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
    /** Create routing idle transaction. */
    private _createRouteTransaction;
    /** Start listener for interaction transactions */
    private _registerInteractionListener;
}
/** Returns the value of a meta tag */
export declare function getMetaContent(metaName: string): string | null;
//# sourceMappingURL=browsertracing.d.ts.map{"version":3,"file":"browsertracing.d.ts","sourceRoot":"","sources":["../../../src/browser/browsertracing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAmB,MAAM,cAAc,CAAC;AAQzD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAC;AAUrH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAK/D,eAAO,MAAM,8BAA8B,mBAAmB,CAAC;AAE/D,8CAA8C;AAC9C,MAAM,WAAW,qBAAsB,SAAQ,6BAA6B;IAC1E;;;;;;;;;OASG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,C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AoB;IAE/C,OAAO,CAAC,iBAAiB,CAAa;gBAEnB,QAAQ,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAgC5D;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;IA4CvF,uCAAuC;IACvC,OAAO,CAAC,uBAAuB;IAuE/B,kDAAkD;IAClD,OAAO,CAAC,4BAA4B;CA2DrC;AAED,sCAAsC;AACtC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D"}export * from '../exports';
export type { RequestInstrumentationOptions } from './request';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID } from './browsertracing';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './request';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,WAAW,CAAC"}import type { Transaction } from '@sentry/core';
/**
 * Start tracking web vitals
 *
 * @returns A function that forces web vitals collection
 */
export declare function startTrackingWebVitals(): () => void;
/**
 * Start tracking long tasks.
 */
export declare function startTrackingLongTasks(): void;
/**
 * Start tracking interaction events.
 */
export declare function startTrackingInteractions(): void;
/** Add performance related spans to a transaction */
export declare function addPerformanceEntries(transaction: Transaction): void;
/** Create measure related spans */
export declare function _addMeasureSpans(transaction: Transaction, entry: Record<string, any>, startTime: number, duration: number, timeOrigin: number): number;
export interface ResourceEntry extends Record<string, unknown> {
    initiatorType?: string;
    transferSize?: number;
    encodedBodySize?: number;
    decodedBodySize?: number;
    renderBlockingStatus?: string;
}
/** Create resource-related spans */
export declare function _addResourceSpans(transaction: Transaction, entry: ResourceEntry, resourceName: string, startTime: number, duration: number, timeOrigin: number): void;
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/browser/metrics/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,WAAW,EAAE,MAAM,cAAc,CAAC;AAgCjE;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,IAAI,CAqBnD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAoB7C;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAuBhD;AAiDD,qDAAqD;AACrD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CA2IpE;AAED,mCAAmC;AACnC,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EAExB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAYR;AAuDD,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,oCAAoC;AACpC,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,IAAI,CAgCN"}import type { Transaction } from '@sentry/core';
import type { Span, SpanContext } from '@sentry/types';
/**
 * Checks if a given value is a valid measurement value.
 */
export declare function isMeasurementValue(value: unknown): value is number;
/**
 * Helper function to start child on transactions. This function will make sure that the transaction will
 * use the start timestamp of the created child span if it is earlier than the transactions actual
 * start timestamp.
 */
export declare function _startChild(transaction: Transaction, { startTimestamp, ...ctx }: SpanContext): Span;
//# sourceMappingURL=utils.d.ts.map{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/browser/metrics/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAElE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,cAAc,EAAE,GAAG,GAAG,EAAE,EAAE,WAAW,GAAG,IAAI,CASnG"}import type { DynamicSamplingContext, Span } from '@sentry/types';
import { SENTRY_XHR_DATA_KEY } from '@sentry/utils';
export declare const DEFAULT_TRACE_PROPAGATION_TARGETS: (string | RegExp)[];
/** Options for Request Instrumentation */
export interface RequestInstrumentationOptions {
    /**
     * @deprecated Will be removed in v8.
     * Use `shouldCreateSpanForRequest` to control span creation and `tracePropagationTargets` to control
     * trace header attachment.
     */
    tracingOrigins: Array<string | RegExp>;
    /**
     * List of strings and/or regexes used to determine which outgoing requests will have `sentry-trace` and `baggage`
     * headers attached.
     *
     * Default: ['localhost', /^\//] {@see DEFAULT_TRACE_PROPAGATION_TARGETS}
     */
    tracePropagationTargets: Array<string | RegExp>;
    /**
     * Flag to disable patching all together for fetch requests.
     *
     * Default: true
     */
    traceFetch: boolean;
    /**
     * Flag to disable patching all together for xhr requests.
     *
     * Default: true
     */
    traceXHR: boolean;
    /**
     * This function will be called before creating a span for a request with the given url.
     * Return false if you don't want a span for the given url.
     *
     * Default: (url: string) => true
     */
    shouldCreateSpanForRequest?(this: void, url: string): boolean;
}
/** Data returned from fetch callback */
export interface FetchData {
    args: any[];
    fetchData?: {
        method: string;
        url: string;
        __span?: string;
    };
    response?: any;
    error?: unknown;
    startTimestamp: number;
    endTimestamp?: number;
}
/** Data returned from XHR request */
export interface XHRData {
    xhr?: {
        [SENTRY_XHR_DATA_KEY]?: {
            method: string;
            url: string;
            status_code: number;
            data: Record<string, any>;
        };
        __sentry_xhr_span_id__?: string;
        setRequestHeader?: (key: string, val: string) => void;
        getRequestHeader?: (key: string) => string;
        __sentry_own_request__?: boolean;
    };
    startTimestamp: number;
    endTimestamp?: number;
}
declare type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[string, string]> | {
    [key: string]: any;
    append: (key: string, value: string) => void;
    get: (key: string) => string | null | undefined;
};
export declare const defaultRequestInstrumentationOptions: RequestInstrumentationOptions;
/** Registers span creators for xhr and fetch requests  */
export declare function instrumentOutgoingRequests(_options?: Partial<RequestInstrumentationOptions>): void;
/**
 * A function that determines whether to attach tracing headers to a request.
 * This was extracted from `instrumentOutgoingRequests` to make it easier to test shouldAttachHeaders.
 * We only export this fuction for testing purposes.
 */
export declare function shouldAttachHeaders(url: string, tracePropagationTargets: (string | RegExp)[] | undefined): boolean;
/**
 * Create and track fetch request spans
 */
export declare function fetchCallback(handlerData: FetchData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): void;
/**
 * Adds sentry-trace and baggage headers to the various forms of fetch headers
 */
export declare function addTracingHeadersToFetchRequest(request: string | unknown, // unknown is actually type Request but we can't export DOM types from this package,
dynamicSamplingContext: Partial<DynamicSamplingContext>, span: Span, options: {
    headers?: {
        [key: string]: string[] | string | undefined;
    } | PolymorphicRequestHeaders;
}): PolymorphicRequestHeaders;
/**
 * Create and track xhr request spans
 */
export declare function xhrCallback(handlerData: XHRData, shouldCreateSpan: (url: string) => boolean, shouldAttachHeaders: (url: string) => boolean, spans: Record<string, Span>): void;
export {};
//# sourceMappingURL=request.d.ts.map{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/browser/request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAKL,mBAAmB,EAEpB,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,iCAAiC,qBAAuB,CAAC;AAEtE,0CAA0C;AAC1C,MAAM,WAAW,6BAA6B;IAC5C;;;;OAIG;IACH,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEvC;;;;;OAKG;IACH,uBAAuB,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAEhD;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;;OAKG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/D;AAED,wCAAwC;AACxC,MAAM,WAAW,SAAS;IAExB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,SAAS,CAAC,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QAEZ,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IAIF,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qCAAqC;AACrC,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE;QACJ,CAAC,mBAAmB,CAAC,CAAC,EAAE;YACtB,MAAM,EAAE,MAAM,CAAC;YACf,GAAG,EAAE,MAAM,CAAC;YACZ,WAAW,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AAE,MAAM,KAAK,OAAO,EAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAC1B,IAAI,CA4DN;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,oFAAoF;AAC/G,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,CAAC,EACvD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IACP,OAAO,CAAC,EACJ;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;KAC9C,GACD,yBAAyB,CAAC;CAC/B,GACA,yBAAyB,CAmD3B;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,OAAO,EACpB,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,EAC1C,mBAAmB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,EAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAC1B,IAAI,CAiEN"}import type { Transaction, TransactionContext } from '@sentry/types';
/**
 * Default function implementing pageload and navigation transactions
 */
export declare function instrumentRoutingWithDefaults<T extends Transaction>(customStartTransaction: (context: TransactionContext) => T | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean): void;
//# sourceMappingURL=router.d.ts.map{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/browser/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAKrE;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,WAAW,EACjE,sBAAsB,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,CAAC,GAAG,SAAS,EACtE,0BAA0B,GAAE,OAAc,EAC1C,gCAAgC,GAAE,OAAc,GAC/C,IAAI,CAkDN"}export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/browser/types.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,iDAA2C,CAAC"}import type { ReportCallback, StopListening } from './types';
/**
 * Calculates the [CLS](https://web.dev/cls/) value for the current page and
 * calls the `callback` function once the value is ready to be reported, along
 * with all `layout-shift` performance entries that were used in the metric
 * value calculation. The reported value is a `double` (corresponding to a
 * [layout shift score](https://web.dev/cls/#layout-shift-score)).
 *
 * If the `reportAllChanges` configuration option is set to `true`, the
 * `callback` function will be called as soon as the value is initially
 * determined as well as any time the value changes throughout the page
 * lifespan.
 *
 * _**Important:** CLS should be continually monitored for changes throughout
 * the entire lifespan of a page—including if the user returns to the page after
 * it's been hidden/backgrounded. However, since browsers often [will not fire
 * additional callbacks once the user has backgrounded a
 * page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
 * `callback` is always called when the page's visibility state changes to
 * hidden. As a result, the `callback` function might be called multiple times
 * during the same page load._
 */
export declare const onCLS: (onReport: ReportCallback) => StopListening | undefined;
//# sourceMappingURL=getCLS.d.ts.map{"version":3,"file":"getCLS.d.ts","sourceRoot":"","sources":["../../../../src/browser/web-vitals/getCLS.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAa,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,KAAK,yDA2DjB,CAAC"}import type { ReportCallback } from './types';
/**
 * Calculates the [FID](https://web.dev/fid/) value for the current page and
 * calls the `callback` function once the value is ready, along with the
 * relevant `first-input` performance entry used to determine the value. The
 * reported value is a `DOMHighResTimeStamp`.
 *
 * _**Important:** since FID is only reported after the user interacts with the
 * page, it's possible that it will not be reported for some page loads._
 */
export declare const onFID: (onReport: ReportCallback) => void;
//# sourceMappingURL=getFID.d.ts.map{"version":3,"file":"getFID.d.ts","sourceRoot":"","sources":["../../../../src/browser/web-vitals/getFID.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAqC,cAAc,EAAE,MAAM,SAAS,CAAC;AAEjF;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,oCA4BjB,CAAC"}import type { ReportCallback, StopListening } from './types';
/**
 * Calculates the [LCP](https://web.dev/lcp/) value for the current page and
 * calls the `callback` function once the value is ready (along with the
 * relevant `largest-contentful-paint` performance entry used to determine the
 * value). The reported value is a `DOMHighResTimeStamp`.
 */
export declare const onLCP: (onReport: ReportCallback) => StopListening | undefined;
//# sourceMappingURL=getLCP.d.ts.map{"version":3,"file":"getLCP.d.ts","sourceRoot":"","sources":["../../../../src/browser/web-vitals/getLCP.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAa,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxE;;;;;GAKG;AACH,eAAO,MAAM,KAAK,yDAkDjB,CAAC"}import type { Metric, ReportCallback } from '../types';
export declare const bindReporter: (callback: ReportCallback, metric: Metric, reportAllChanges?: boolean | undefined) => (forceReport?: boolean | undefined) => void;
//# sourceMappingURL=bindReporter.d.ts.map{"version":3,"file":"bindReporter.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/bindReporter.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEvD,eAAO,MAAM,YAAY,mIAwBxB,CAAC"}/**
 * Performantly generate a unique, 30-char string by combining a version
 * number, the current timestamp with a 13-digit number integer.
 * @return {string}
 */
export declare const generateUniqueID: () => string;
//# sourceMappingURL=generateUniqueID.d.ts.map{"version":3,"file":"generateUniqueID.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/generateUniqueID.ts"],"names":[],"mappings":"AAgBA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAE5B,CAAC"}export declare const getActivationStart: () => number;
//# sourceMappingURL=getActivationStart.d.ts.map{"version":3,"file":"getActivationStart.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/getActivationStart.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,cAG9B,CAAC"}export declare const getNavigationEntry: () => PerformanceNavigationTiming | Pick<PerformanceNavigationTiming, "duration" | "entryType" | "name" | "startTime" | "type" | "domComplete" | "domContentLoadedEventEnd" | "domContentLoadedEventStart" | "domInteractive" | "loadEventEnd" | "loadEventStart" | "unloadEventEnd" | "unloadEventStart" | "activationStart" | "connectEnd" | "connectStart" | "domainLookupEnd" | "domainLookupStart" | "fetchStart" | "redirectEnd" | "redirectStart" | "requestStart" | "responseEnd" | "responseStart" | "secureConnectionStart" | "workerStart"> | undefined;
//# sourceMappingURL=getNavigationEntry.d.ts.map{"version":3,"file":"getNavigationEntry.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/getNavigationEntry.ts"],"names":[],"mappings":"AAuCA,eAAO,MAAM,kBAAkB,oiBAU9B,CAAC"}export declare const getVisibilityWatcher: () => {
    readonly firstHiddenTime: number;
};
//# sourceMappingURL=getVisibilityWatcher.d.ts.map{"version":3,"file":"getVisibilityWatcher.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/getVisibilityWatcher.ts"],"names":[],"mappings":"AAkCA,eAAO,MAAM,oBAAoB;;CAgBhC,CAAC"}import type { Metric } from '../types';
export declare const initMetric: (name: "CLS" | "FCP" | "FID" | "INP" | "LCP" | "TTFB", value?: number | undefined) => Metric;
//# sourceMappingURL=initMetric.d.ts.map{"version":3,"file":"initMetric.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/initMetric.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAKvC,eAAO,MAAM,UAAU,8FAqBtB,CAAC"}import type { FirstInputPolyfillEntry, NavigationTimingPolyfillEntry, PerformancePaintTiming } from '../types';
export interface PerformanceEntryHandler {
    (entry: PerformanceEntry): void;
}
interface PerformanceEntryMap {
    event: PerformanceEventTiming[];
    paint: PerformancePaintTiming[];
    'layout-shift': LayoutShift[];
    'largest-contentful-paint': LargestContentfulPaint[];
    'first-input': PerformanceEventTiming[] | FirstInputPolyfillEntry[];
    navigation: PerformanceNavigationTiming[] | NavigationTimingPolyfillEntry[];
    resource: PerformanceResourceTiming[];
    longtask: PerformanceEntry[];
}
/**
 * Takes a performance entry type and a callback function, and creates a
 * `PerformanceObserver` instance that will observe the specified entry type
 * with buffering enabled and call the callback _for each entry_.
 *
 * This function also feature-detects entry support and wraps the logic in a
 * try/catch to avoid errors in unsupporting browsers.
 */
export declare const observe: <K extends "navigation" | "resource" | "paint" | "event" | "layout-shift" | "largest-contentful-paint" | "first-input" | "longtask">(type: K, callback: (entries: PerformanceEntryMap[K]) => void, opts?: PerformanceObserverInit | undefined) => PerformanceObserver | undefined;
export {};
//# sourceMappingURL=observe.d.ts.map{"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/observe.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE/G,MAAM,WAAW,uBAAuB;IACtC,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,cAAc,EAAE,WAAW,EAAE,CAAC;IAC9B,0BAA0B,EAAE,sBAAsB,EAAE,CAAC;IACrD,aAAa,EAAE,sBAAsB,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACpE,UAAU,EAAE,2BAA2B,EAAE,GAAG,6BAA6B,EAAE,CAAC;IAC5E,QAAQ,EAAE,yBAAyB,EAAE,CAAC;IACtC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,mRAyBnB,CAAC"}export interface OnHiddenCallback {
    (event: Event): void;
}
export declare const onHidden: (cb: OnHiddenCallback, once?: boolean | undefined) => void;
//# sourceMappingURL=onHidden.d.ts.map{"version":3,"file":"onHidden.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/lib/onHidden.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,4DAcpB,CAAC"}import type { FirstInputPolyfillCallback } from './types/polyfills';
export * from './types/base';
export * from './types/polyfills';
export * from './types/cls';
export * from './types/fid';
export * from './types/lcp';
export interface WebVitalsGlobal {
    firstInputPolyfill: (onFirstInput: FirstInputPolyfillCallback) => void;
    resetFirstInputPolyfill: () => void;
    firstHiddenTime: number;
}
declare global {
    interface Window {
        webVitals: WebVitalsGlobal;
        __WEB_VITALS_POLYFILL__: boolean;
    }
}
export declare type PerformancePaintTiming = PerformanceEntry;
export interface PerformanceEventTiming extends PerformanceEntry {
    processingStart: DOMHighResTimeStamp;
    processingEnd: DOMHighResTimeStamp;
    duration: DOMHighResTimeStamp;
    cancelable?: boolean;
    target?: Element;
}
interface PerformanceEntryMap {
    navigation: PerformanceNavigationTiming;
    resource: PerformanceResourceTiming;
    paint: PerformancePaintTiming;
}
export interface NavigatorNetworkInformation {
    readonly connection?: NetworkInformation;
}
declare type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
declare type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
declare type Megabit = number;
declare type Millisecond = number;
interface NetworkInformation extends EventTarget {
    readonly type?: ConnectionType;
    readonly effectiveType?: EffectiveConnectionType;
    readonly downlinkMax?: Megabit;
    readonly downlink?: Megabit;
    readonly rtt?: Millisecond;
    readonly saveData?: boolean;
    onchange?: EventListener;
}
export interface NavigatorDeviceMemory {
    readonly deviceMemory?: number;
}
export declare type NavigationTimingPolyfillEntry = Omit<PerformanceNavigationTiming, 'initiatorType' | 'nextHopProtocol' | 'redirectCount' | 'transferSize' | 'encodedBodySize' | 'decodedBodySize' | 'toJSON'>;
declare global {
    interface Document {
        prerendering?: boolean;
    }
    interface Performance {
        getEntriesByType<K extends keyof PerformanceEntryMap>(type: K): PerformanceEntryMap[K][];
    }
    interface PerformanceObserverInit {
        durationThreshold?: number;
    }
    interface PerformanceNavigationTiming {
        activationStart?: number;
    }
    interface PerformanceEventTiming extends PerformanceEntry {
        duration: DOMHighResTimeStamp;
        interactionId?: number;
        readonly target: Node | null;
    }
    interface LayoutShiftAttribution {
        node?: Node;
        previousRect: DOMRectReadOnly;
        currentRect: DOMRectReadOnly;
    }
    interface LayoutShift extends PerformanceEntry {
        value: number;
        sources: LayoutShiftAttribution[];
        hadRecentInput: boolean;
    }
    interface LargestContentfulPaint extends PerformanceEntry {
        renderTime: DOMHighResTimeStamp;
        loadTime: DOMHighResTimeStamp;
        size: number;
        id: string;
        url: string;
        element?: Element;
    }
}
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/browser/web-vitals/types.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAEpE,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAElC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAM5B,MAAM,WAAW,eAAe;IAC9B,kBAAkB,EAAE,CAAC,YAAY,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACvE,uBAAuB,EAAE,MAAM,IAAI,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,SAAS,EAAE,eAAe,CAAC;QAG3B,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illEntry, NavigationTimingPolyfillEntry } from './polyfills';
export interface Metric {
    /**
     * The name of the metric (in acronym form).
     */
    name: 'CLS' | 'FCP' | 'FID' | 'INP' | 'LCP' | 'TTFB';
    /**
     * The current value of the metric.
     */
    value: number;
    /**
     * The rating as to whether the metric value is within the "good",
     * "needs improvement", or "poor" thresholds of the metric.
     */
    rating: 'good' | 'needs-improvement' | 'poor';
    /**
     * The delta between the current value and the last-reported value.
     * On the first report, `delta` and `value` will always be the same.
     */
    delta: number;
    /**
     * A unique ID representing this particular metric instance. This ID can
     * be used by an analytics tool to dedupe multiple values sent for the same
     * metric instance, or to group multiple deltas together and calculate a
     * total. It can also be used to differentiate multiple different metric
     * instances sent from the same page, which can happen if the page is
     * restored from the back/forward cache (in that case new metrics object
     * get created).
     */
    id: string;
    /**
     * Any performance entries relevant to the metric value calculation.
     * The array may also be empty if the metric value was not based on any
     * entries (e.g. a CLS value of 0 given no layout shifts).
     */
    entries: (PerformanceEntry | LayoutShift | FirstInputPolyfillEntry | NavigationTimingPolyfillEntry)[];
    /**
     * The type of navigation
     *
     * Navigation Timing API (or `undefined` if the browser doesn't
     * support that API). For pages that are restored from the bfcache, this
     * value will be 'back-forward-cache'.
     */
    navigationType: 'navigate' | 'reload' | 'back-forward' | 'back-forward-cache' | 'prerender';
}
/**
 * A version of the `Metric` that is used with the attribution build.
 */
export interface MetricWithAttribution extends Metric {
    /**
     * An object containing potentially-helpful debugging information that
     * can be sent along with the metric value for the current page visit in
     * order to help identify issues happening to real-users in the field.
     */
    attribution: {
        [key: string]: unknown;
    };
}
export interface ReportCallback {
    (metric: Metric): void;
}
export interface ReportOpts {
    reportAllChanges?: boolean;
    durationThreshold?: number;
}
/**
 * The loading state of the document. Note: this value is similar to
 * `document.readyState` but it subdivides the "interactive" state into the
 * time before and after the DOMContentLoaded event fires.
 *
 * State descriptions:
 * - `loading`: the initial document response has not yet been fully downloaded
 *   and parsed. This is equivalent to the corresponding `readyState` value.
 * - `dom-interactive`: the document has been fully loaded and parsed, but
 *   scripts may not have yet finished loading and executing.
 * - `dom-content-loaded`: the document is fully loaded and parsed, and all
 *   scripts (except `async` scripts) have loaded and finished executing.
 * - `complete`: the document and all of its sub-resources have finished
 *   loading. This is equivalent to the corresponding `readyState` value.
 */
export declare type LoadState = 'loading' | 'dom-interactive' | 'dom-content-loaded' | 'complete';
export declare type StopListening = () => void;
//# sourceMappingURL=base.d.ts.map{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/types/base.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE1F,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAErD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,mBAAmB,GAAG,MAAM,CAAC;IAE9C;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;OAIG;IACH,OAAO,EAAE,CAAC,gBAAgB,GAAG,WAAW,GAAG,uBAAuB,GAAG,6BAA6B,CAAC,EAAE,CAAC;IAEtG;;;;;;OAMG;IACH,cAAc,EAAE,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,oBAAoB,GAAG,WAAW,CAAC;CAC7F;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACnD;;;;OAIG;IACH,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,oBAAY,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,UAAU,CAAC;AAE1F,oBAAY,aAAa,GAAG,MAAM,IAAI,CAAC"}import type { LoadState, Metric, ReportCallback } from './base';
/**
 * A CLS-specific version of the Metric object.
 */
export interface CLSMetric extends Metric {
    name: 'CLS';
    entries: LayoutShift[];
}
/**
 * An object containing potentially-helpful debugging information that
 * can be sent along with the CLS value for the current page visit in order
 * to help identify issues happening to real-users in the field.
 */
export interface CLSAttribution {
    /**
     * A selector identifying the first element (in document order) that
     * shifted when the single largest layout shift contributing to the page's
     * CLS score occurred.
     */
    largestShiftTarget?: string;
    /**
     * The time when the single largest layout shift contributing to the page's
     * CLS score occurred.
     */
    largestShiftTime?: DOMHighResTimeStamp;
    /**
     * The layout shift score of the single largest layout shift contributing to
     * the page's CLS score.
     */
    largestShiftValue?: number;
    /**
     * The `LayoutShiftEntry` representing the single largest layout shift
     * contributing to the page's CLS score. (Useful when you need more than just
     * `largestShiftTarget`, `largestShiftTime`, and `largestShiftValue`).
     */
    largestShiftEntry?: LayoutShift;
    /**
     * The first element source (in document order) among the `sources` list
     * of the `largestShiftEntry` object. (Also useful when you need more than
     * just `largestShiftTarget`, `largestShiftTime`, and `largestShiftValue`).
     */
    largestShiftSource?: LayoutShiftAttribution;
    /**
     * The loading state of the document at the time when the largest layout
     * shift contribution to the page's CLS score occurred (see `LoadState`
     * for details).
     */
    loadState?: LoadState;
}
/**
 * A CLS-specific version of the Metric object with attribution.
 */
export interface CLSMetricWithAttribution extends CLSMetric {
    attribution: CLSAttribution;
}
/**
 * A CLS-specific version of the ReportCallback function.
 */
export interface CLSReportCallback extends ReportCallback {
    (metric: CLSMetric): void;
}
/**
 * A CLS-specific version of the ReportCallback function with attribution.
 */
export interface CLSReportCallbackWithAttribution extends CLSReportCallback {
    (metric: CLSMetricWithAttribution): void;
}
//# sourceMappingURL=cls.d.ts.map{"version":3,"file":"cls.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/types/cls.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IACvC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,WAAW,CAAC;IAChC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;IAC5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IACzE,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC1C"}import type { LoadState, Metric, ReportCallback } from './base';
import type { FirstInputPolyfillEntry } from './polyfills';
/**
 * An FID-specific version of the Metric object.
 */
export interface FIDMetric extends Metric {
    name: 'FID';
    entries: (PerformanceEventTiming | FirstInputPolyfillEntry)[];
}
/**
 * An object containing potentially-helpful debugging information that
 * can be sent along with the FID value for the current page visit in order
 * to help identify issues happening to real-users in the field.
 */
export interface FIDAttribution {
    /**
     * A selector identifying the element that the user interacted with. This
     * element will be the `target` of the `event` dispatched.
     */
    eventTarget: string;
    /**
     * The time when the user interacted. This time will match the `timeStamp`
     * value of the `event` dispatched.
     */
    eventTime: number;
    /**
     * The `type` of the `event` dispatched from the user interaction.
     */
    eventType: string;
    /**
     * The `PerformanceEventTiming` entry corresponding to FID (or the
     * polyfill entry in browsers that don't support Event Timing).
     */
    eventEntry: PerformanceEventTiming | FirstInputPolyfillEntry;
    /**
     * The loading state of the document at the time when the first interaction
     * occurred (see `LoadState` for details). If the first interaction occurred
     * while the document was loading and executing script (e.g. usually in the
     * `dom-interactive` phase) it can result in long input delays.
     */
    loadState: LoadState;
}
/**
 * An FID-specific version of the Metric object with attribution.
 */
export interface FIDMetricWithAttribution extends FIDMetric {
    attribution: FIDAttribution;
}
/**
 * An FID-specific version of the ReportCallback function.
 */
export interface FIDReportCallback extends ReportCallback {
    (metric: FIDMetric): void;
}
/**
 * An FID-specific version of the ReportCallback function with attribution.
 */
export interface FIDReportCallbackWithAttribution extends FIDReportCallback {
    (metric: FIDMetricWithAttribution): void;
}
//# sourceMappingURL=fid.d.ts.map{"version":3,"file":"fid.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/types/fid.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,CAAC,sBAAsB,GAAG,uBAAuB,CAAC,EAAE,CAAC;CAC/D;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,sBAAsB,GAAG,uBAAuB,CAAC;IAC7D;;;;;OAKG;IACH,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IACzE,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC1C"}import type { Metric, ReportCallback } from './base';
import type { NavigationTimingPolyfillEntry } from './polyfills';
/**
 * An LCP-specific version of the Metric object.
 */
export interface LCPMetric extends Metric {
    name: 'LCP';
    entries: LargestContentfulPaint[];
}
/**
 * An object containing potentially-helpful debugging information that
 * can be sent along with the LCP value for the current page visit in order
 * to help identify issues happening to real-users in the field.
 */
export interface LCPAttribution {
    /**
     * The element corresponding to the largest contentful paint for the page.
     */
    element?: string;
    /**
     * The URL (if applicable) of the LCP image resource. If the LCP element
     * is a text node, this value will not be set.
     */
    url?: string;
    /**
     * The time from when the user initiates loading the page until when the
     * browser receives the first byte of the response (a.k.a. TTFB). See
     * [Optimize LCP](https://web.dev/optimize-lcp/) for details.
     */
    timeToFirstByte: number;
    /**
     * The delta between TTFB and when the browser starts loading the LCP
     * resource (if there is one, otherwise 0). See [Optimize
     * LCP](https://web.dev/optimize-lcp/) for details.
     */
    resourceLoadDelay: number;
    /**
     * The total time it takes to load the LCP resource itself (if there is one,
     * otherwise 0). See [Optimize LCP](https://web.dev/optimize-lcp/) for
     * details.
     */
    resourceLoadTime: number;
    /**
     * The delta between when the LCP resource finishes loading until the LCP
     * element is fully rendered. See [Optimize
     * LCP](https://web.dev/optimize-lcp/) for details.
     */
    elementRenderDelay: number;
    /**
     * The `navigation` entry of the current page, which is useful for diagnosing
     * general page load issues.
     */
    navigationEntry?: PerformanceNavigationTiming | NavigationTimingPolyfillEntry;
    /**
     * The `resource` entry for the LCP resource (if applicable), which is useful
     * for diagnosing resource load issues.
     */
    lcpResourceEntry?: PerformanceResourceTiming;
    /**
     * The `LargestContentfulPaint` entry corresponding to LCP.
     */
    lcpEntry?: LargestContentfulPaint;
}
/**
 * An LCP-specific version of the Metric object with attribution.
 */
export interface LCPMetricWithAttribution extends LCPMetric {
    attribution: LCPAttribution;
}
/**
 * An LCP-specific version of the ReportCallback function.
 */
export interface LCPReportCallback extends ReportCallback {
    (metric: LCPMetric): void;
}
/**
 * An LCP-specific version of the ReportCallback function with attribution.
 */
export interface LCPReportCallbackWithAttribution extends LCPReportCallback {
    (metric: LCPMetricWithAttribution): void;
}
//# sourceMappingURL=lcp.d.ts.map{"version":3,"file":"lcp.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/types/lcp.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,MAAM;IACvC,IAAI,EAAE,KAAK,CAAC;IACZ,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,eAAe,CAAC,EAAE,2BAA2B,GAAG,6BAA6B,CAAC;IAC9E;;;OAGG;IACH,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAC7C;;OAEG;IACH,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,WAAW,EAAE,cAAc,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,gCAAiC,SAAQ,iBAAiB;IACzE,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI,CAAC;CAC1C"}export declare type FirstInputPolyfillEntry = Omit<PerformanceEventTiming, 'processingEnd'>;
export interface FirstInputPolyfillCallback {
    (entry: FirstInputPolyfillEntry): void;
}
export declare type NavigationTimingPolyfillEntry = Omit<PerformanceNavigationTiming, 'initiatorType' | 'nextHopProtocol' | 'redirectCount' | 'transferSize' | 'encodedBodySize' | 'decodedBodySize' | 'type'> & {
    type: PerformanceNavigationTiming['type'];
};
//# sourceMappingURL=polyfills.d.ts.map{"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../../../../../src/browser/web-vitals/types/polyfills.ts"],"names":[],"mappings":"AAgBA,oBAAY,uBAAuB,GAAG,IAAI,CAAC,sBAAsB,EAAE,eAAe,CAAC,CAAC;AAEpF,MAAM,WAAW,0BAA0B;IACzC,CAAC,KAAK,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACxC;AAED,oBAAY,6BAA6B,GAAG,IAAI,CAC9C,2BAA2B,EACzB,eAAe,GACf,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GACjB,MAAM,CACT,GAAG;IACF,IAAI,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAC;CAC3C,CAAC"}export { extractTraceparentData, getActiveTransaction, hasTracingEnabled, IdleTransaction, Span, SpanStatus, spanStatusfromHttpCode, startIdleTransaction, Transaction, } from '@sentry/core';
export type { SpanStatusType } from '@sentry/core';
export { stripUrlQueryAndFragment, TRACEPARENT_REGEXP } from '@sentry/utils';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EACf,IAAI,EAEJ,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC"}/**
 * This patches the global object and injects the Tracing extensions methods
 */
export declare function addExtensionMethods(): void;
//# sourceMappingURL=extensions.d.ts.map{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/extensions.ts"],"names":[],"mappings":"AAwDA;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAO1C"}export * from './exports';
export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma, lazyLoadedNodePerformanceMonitoringIntegrations, } from './node';
export type { LazyLoadedIntegration } from './node';
export { BrowserTracing, BROWSER_TRACING_INTEGRATION_ID, instrumentOutgoingRequests, defaultRequestInstrumentationOptions, addTracingHeadersToFetchRequest, } from './browser';
export type { RequestInstrumentationOptions } from './browser';
export { addExtensionMethods } from './extensions';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B,OAAO,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,+CAA+C,GAChD,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EACL,cAAc,EACd,8BAA8B,EAC9B,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,WAAW,CAAC;AAEnB,YAAY,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}export * from '../exports';
export * from './integrations';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,gBAAgB,CAAC"}import type { Hub } from '@sentry/core';
import type { EventProcessor } from '@sentry/types';
import type { LazyLoadedIntegration } from './lazy';
interface ApolloOptions {
    useNestjs?: boolean;
}
declare type ApolloResolverGroup = {
    [key: string]: () => unknown;
};
declare type ApolloModelResolvers = {
    [key: string]: ApolloResolverGroup;
};
declare type GraphQLModule = {
    GraphQLFactory: {
        prototype: {
            create: (resolvers: ApolloModelResolvers[]) => unknown;
        };
    };
};
declare type ApolloModule = {
    ApolloServerBase: {
        prototype: {
            constructSchema: (config: unknown) => unknown;
        };
    };
};
/** Tracing integration for Apollo */
export declare class Apollo implements LazyLoadedIntegration<GraphQLModule & ApolloModule> {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private readonly _useNest;
    private _module?;
    /**
     * @inheritDoc
     */
    constructor(options?: ApolloOptions);
    /** @inheritdoc */
    loadDependency(): (GraphQLModule & ApolloModule) | undefined;
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=apollo.d.ts.map{"version":3,"file":"apollo.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/apollo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAGpD,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,aAAK,mBAAmB,GAAG;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC;CAC9B,CAAC;AAEF,aAAK,oBAAoB,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAC;CACpC,CAAC;AAEF,aAAK,aAAa,GAAG;IACnB,cAAc,EAAE;QACd,SAAS,EAAE;YACT,MAAM,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,KAAK,OAAO,CAAC;SACxD,CAAC;KACH,CAAC;CACH,CAAC;AAEF,aAAK,YAAY,GAAG;IAClB,gBAAgB,EAAE;QAChB,SAAS,EAAE;YACT,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;SAC/C,CAAC;KACH,CAAC;CACH,CAAC;AAEF,qCAAqC;AACrC,qBAAa,MAAO,YAAW,qBAAqB,CAAC,aAAa,GAAG,YAAY,CAAC;IAChF;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IAEnC,OAAO,CAAC,OAAO,CAAC,CAA+B;IAE/C;;OAEG;gBAED,OAAO,GAAE,aAER;IAKH,kBAAkB;IACX,cAAc,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC,GAAG,SAAS;IAUnE;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAmFxF"}import type { Hub, Integration } from '@sentry/types';
declare type Method = 'all' | 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options' | 'head' | 'checkout' | 'copy' | 'lock' | 'merge' | 'mkactivity' | 'mkcol' | 'move' | 'm-search' | 'notify' | 'purge' | 'report' | 'search' | 'subscribe' | 'trace' | 'unlock' | 'unsubscribe' | 'use';
declare type Router = {
    [method in Method]: (...args: any) => any;
};
/**
 * Express integration
 *
 * Provides an request and error handler for Express framework as well as tracing capabilities
 */
export declare class Express implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Express App instance
     */
    private readonly _router?;
    private readonly _methods?;
    /**
     * @inheritDoc
     */
    constructor(options?: {
        app?: Router;
        router?: Router;
        methods?: Method[];
    });
    /**
     * @inheritDoc
     */
    setupOnce(_: unknown, getCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=express.d.ts.map{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/express.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAmC,MAAM,eAAe,CAAC;AAKvF,aAAK,MAAM,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,SAAS,GACT,MAAM,GACN,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,GACZ,OAAO,GACP,MAAM,GACN,UAAU,GACV,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,OAAO,GACP,QAAQ,GACR,aAAa,GACb,KAAK,CAAC;AAEV,aAAK,MAAM,GAAG;KACX,MAAM,IAAI,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG;CAC1C,CAAC;AAyCF;;;;GAIG;AACH,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAW;IAErC;;OAEG;gBACgB,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAO;IAKtF;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAc7D"}import type { Hub } from '@sentry/core';
import type { EventProcessor } from '@sentry/types';
import type { LazyLoadedIntegration } from './lazy';
declare type GraphQLModule = {
    [method: string]: (...args: unknown[]) => unknown;
};
/** Tracing integration for graphql package */
export declare class GraphQL implements LazyLoadedIntegration<GraphQLModule> {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private _module?;
    /** @inheritdoc */
    loadDependency(): GraphQLModule | undefined;
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=graphql.d.ts.map{"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/graphql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAGpD,aAAK,aAAa,GAAG;IACnB,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;CACnD,CAAC;AAEF,8CAA8C;AAC9C,qBAAa,OAAQ,YAAW,qBAAqB,CAAC,aAAa,CAAC;IAClE;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC,OAAO,CAAC,OAAO,CAAC,CAAgB;IAEhC,kBAAkB;IACX,cAAc,IAAI,aAAa,GAAG,SAAS;IAIlD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA0CxF"}export { Express } from './express';
export { Postgres } from './postgres';
export { Mysql } from './mysql';
export { Mongo } from './mongo';
export { Prisma } from './prisma';
export { GraphQL } from './graphql';
export { Apollo } from './apollo';
export * from './lazy';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,QAAQ,CAAC"}import type { Integration } from '@sentry/types';
export interface LazyLoadedIntegration<T = object> extends Integration {
    /**
     * Loads the integration's dependency and caches it so it doesn't have to be loaded again.
     *
     * If this returns undefined, the dependency could not be loaded.
     */
    loadDependency(): T | undefined;
}
export declare const lazyLoadedNodePerformanceMonitoringIntegrations: (() => LazyLoadedIntegration)[];
//# sourceMappingURL=lazy.d.ts.map{"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AAGnE,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW;IACpE;;;;OAIG;IACH,cAAc,IAAI,CAAC,GAAG,SAAS,CAAC;CACjC;AAED,eAAO,MAAM,+CAA+C,EAAE,CAAC,MAAM,qBAAqB,CAAC,EA2C1F,CAAC"}import type { Hub } from '@sentry/core';
import type { EventProcessor } from '@sentry/types';
import type { LazyLoadedIntegration } from './lazy';
declare type Operation = (typeof OPERATIONS)[number];
declare const OPERATIONS: readonly ["aggregate", "bulkWrite", "countDocuments", "createIndex", "createIndexes", "deleteMany", "deleteOne", "distinct", "drop", "dropIndex", "dropIndexes", "estimatedDocumentCount", "find", "findOne", "findOneAndDelete", "findOneAndReplace", "findOneAndUpdate", "indexes", "indexExists", "indexInformation", "initializeOrderedBulkOp", "insertMany", "insertOne", "isCapped", "mapReduce", "options", "parallelCollectionScan", "rename", "replaceOne", "stats", "updateMany", "updateOne"];
interface MongoCollection {
    collectionName: string;
    dbName: string;
    namespace: string;
    prototype: {
        [operation in Operation]: (...args: unknown[]) => unknown;
    };
}
interface MongoOptions {
    operations?: Operation[];
    describeOperations?: boolean | Operation[];
    useMongoose?: boolean;
}
declare type MongoModule = {
    Collection: MongoCollection;
};
/** Tracing integration for mongo package */
export declare class Mongo implements LazyLoadedIntegration<MongoModule> {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private _operations;
    private _describeOperations?;
    private _useMongoose;
    private _module?;
    /**
     * @inheritDoc
     */
    constructor(options?: MongoOptions);
    /** @inheritdoc */
    loadDependency(): MongoModule | undefined;
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
    /**
     * Patches original collection methods
     */
    private _instrumentOperations;
    /**
     * Patches original collection to utilize our tracing functionality
     */
    private _patchOperation;
    /**
     * Form a SpanContext based on the user input to a given operation.
     */
    private _getSpanContextFromOperationArguments;
}
export {};
//# sourceMappingURL=mongo.d.ts.map{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/mongo.ts"],"names":[],"mappings":"AAAA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AI;IAiBvF;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAI7B;;OAEG;IACH,OAAO,CAAC,eAAe;IAuDvB;;OAEG;IACH,OAAO,CAAC,qCAAqC;CA4C9C"}import type { Hub } from '@sentry/core';
import type { EventProcessor } from '@sentry/types';
import type { LazyLoadedIntegration } from './lazy';
interface MysqlConnection {
    createQuery: () => void;
}
/** Tracing integration for node-mysql package */
export declare class Mysql implements LazyLoadedIntegration<MysqlConnection> {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private _module?;
    /** @inheritdoc */
    loadDependency(): MysqlConnection | undefined;
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=mysql.d.ts.map{"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/mysql.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAGpD,UAAU,eAAe;IACvB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,iDAAiD;AACjD,qBAAa,KAAM,YAAW,qBAAqB,CAAC,eAAe,CAAC;IAClE;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAW;IAEnC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAY;IAE/B,OAAO,CAAC,OAAO,CAAC,CAAkB;IAElC,kBAAkB;IACX,cAAc,IAAI,eAAe,GAAG,SAAS;IAIpD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA4CxF"}import type { Hub } from '@sentry/core';
import type { EventProcessor } from '@sentry/types';
import type { LazyLoadedIntegration } from './lazy';
interface PgClient {
    prototype: {
        query: () => void | Promise<unknown>;
    };
}
interface PgOptions {
    usePgNative?: boolean;
}
declare type PGModule = {
    Client: PgClient;
    native: {
        Client: PgClient;
    };
};
/** Tracing integration for node-postgres package */
export declare class Postgres implements LazyLoadedIntegration<PGModule> {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private _usePgNative;
    private _module?;
    constructor(options?: PgOptions);
    /** @inheritdoc */
    loadDependency(): PGModule | undefined;
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=postgres.d.ts.map{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/postgres.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAGpD,UAAU,QAAQ;IAChB,SAAS,EAAE;QACT,KAAK,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC;CACH;AAED,UAAU,SAAS;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,aAAK,QAAQ,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,CAAA;CAAE,CAAC;AAEnE,oDAAoD;AACpD,qBAAa,QAAS,YAAW,qBAAqB,CAAC,QAAQ,CAAC;IAC9D;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAc;IAEtC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAe;IAElC,OAAO,CAAC,YAAY,CAAU;IAE9B,OAAO,CAAC,OAAO,CAAC,CAAW;gBAER,OAAO,GAAE,SAAc;IAI1C,kBAAkB;IACX,cAAc,IAAI,QAAQ,GAAG,SAAS;IAI7C;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAgExF"}import type { Hub } from '@sentry/core';
import type { EventProcessor, Integration } from '@sentry/types';
/** Tracing integration for @prisma/client package */
export declare class Prisma implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Prisma ORM Client Instance
     */
    private readonly _client?;
    /**
     * @inheritDoc
     */
    constructor(options?: {
        client?: unknown;
    });
    /**
     * @inheritDoc
     */
    setupOnce(_: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
//# sourceMappingURL=prisma.d.ts.map{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/node/integrations/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA2CjE,qDAAqD;AACrD,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAe;IAExC;;OAEG;gBACgB,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO;IAWrD;;OAEG;IACI,SAAS,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAiBxF"}import type { Hub } from '@sentry/types';
/**
 * Check if Sentry auto-instrumentation should be disabled.
 *
 * @param getCurrentHub A method to fetch the current hub
 * @returns boolean
 */
export declare function shouldDisableAutoInstrumentation(getCurrentHub: () => Hub): boolean;
//# sourceMappingURL=node-utils.d.ts.map{"version":3,"file":"node-utils.d.ts","sourceRoot":"","sources":["../../../../../src/node/integrations/utils/node-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,OAAO,CAKlF"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const eventbuilder = require('./eventbuilder.js');
const helpers = require('./helpers.js');
const breadcrumbs = require('./integrations/breadcrumbs.js');
const userfeedback = require('./userfeedback.js');

/**
 * Configuration options for the Sentry Browser SDK.
 * @see @sentry/types Options for more information.
 */

/**
 * The Sentry Browser SDK Client.
 *
 * @see BrowserOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
class BrowserClient extends core.BaseClient {
  /**
   * Creates a new Browser SDK instance.
   *
   * @param options Configuration options for this SDK.
   */
   constructor(options) {
    const sdkSource = helpers.WINDOW.SENTRY_SDK_SOURCE || utils.getSDKSource();

    options._metadata = options._metadata || {};
    options._metadata.sdk = options._metadata.sdk || {
      name: 'sentry.javascript.browser',
      packages: [
        {
          name: `${sdkSource}:@sentry/browser`,
          version: core.SDK_VERSION,
        },
      ],
      version: core.SDK_VERSION,
    };

    super(options);

    if (options.sendClientReports && helpers.WINDOW.document) {
      helpers.WINDOW.document.addEventListener('visibilitychange', () => {
        if (helpers.WINDOW.document.visibilityState === 'hidden') {
          this._flushOutcomes();
        }
      });
    }
  }

  /**
   * @inheritDoc
   */
   eventFromException(exception, hint) {
    return eventbuilder.eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);
  }

  /**
   * @inheritDoc
   */
   eventFromMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level = 'info',
    hint,
  ) {
    return eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
  }

  /**
   * @inheritDoc
   */
   sendEvent(event, hint) {
    // We only want to add the sentry event breadcrumb when the user has the breadcrumb integration installed and
    // activated its `sentry` option.
    // We also do not want to use the `Breadcrumbs` class here directly, because we do not want it to be included in
    // bundles, if it is not used by the SDK.
    // This all sadly is a bit ugly, but we currently don't have a "pre-send" hook on the integrations so we do it this
    // way for now.
    const breadcrumbIntegration = this.getIntegrationById(breadcrumbs.BREADCRUMB_INTEGRATION_ID) ;
    // We check for definedness of `addSentryBreadcrumb` in case users provided their own integration with id
    // "Breadcrumbs" that does not have this function.
    if (breadcrumbIntegration && breadcrumbIntegration.addSentryBreadcrumb) {
      breadcrumbIntegration.addSentryBreadcrumb(event);
    }

    super.sendEvent(event, hint);
  }

  /**
   * Sends user feedback to Sentry.
   */
   captureUserFeedback(feedback) {
    if (!this._isEnabled()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('SDK not enabled, will not capture user feedback.');
      return;
    }

    const envelope = userfeedback.createUserFeedbackEnvelope(feedback, {
      metadata: this.getSdkMetadata(),
      dsn: this.getDsn(),
      tunnel: this.getOptions().tunnel,
    });
    void this._sendEnvelope(envelope);
  }

  /**
   * @inheritDoc
   */
   _prepareEvent(event, hint, scope) {
    event.platform = event.platform || 'javascript';
    return super._prepareEvent(event, hint, scope);
  }

  /**
   * Sends client reports as an envelope.
   */
   _flushOutcomes() {
    const outcomes = this._clearOutcomes();

    if (outcomes.length === 0) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('No outcomes to send');
      return;
    }

    if (!this._dsn) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('No dsn provided, will not send outcomes');
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Sending outcomes:', outcomes);

    const envelope = utils.createClientReportEnvelope(outcomes, this._options.tunnel && utils.dsnToString(this._dsn));
    void this._sendEnvelope(envelope);
  }
}

exports.BrowserClient = BrowserClient;
//# sourceMappingURL=client.js.map
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport type {\n  BrowserClientReplayOptions,\n  ClientOptions,\n  Event,\n  EventHint,\n  Options,\n  Severity,\n  SeverityLevel,\n  UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { Breadcrumbs } from './integrations';\nimport { BREADCRUMB_INTEGRATION_ID } from './integrations/breadcrumbs';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> & BrowserClientReplayOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions>;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient<BrowserClientOptions> {\n  /**\n   * Creates a new Browser SDK instance.\n   *\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: BrowserClientOptions) {\n    const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n\n    options._metadata = options._metadata || {};\n    options._metadata.sdk = options._metadata.sdk || {\n      name: 'sentry.javascript.browser',\n      packages: [\n        {\n          name: `${sdkSource}:@sentry/browser`,\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    super(options);\n\n    if (options.sendClientReports && WINDOW.document) {\n      WINDOW.document.addEventListener('visibilitychange', () => {\n        if (WINDOW.document.visibilityState === 'hidden') {\n          this._flushOutcomes();\n        }\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n    return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event, hint?: EventHint): void {\n    // We only want to add the sentry event breadcrumb when the user has the breadcrumb integration installed and\n    // activated its `sentry` option.\n    // We also do not want to use the `Breadcrumbs` class here directly, because we do not want it to be included in\n    // bundles, if it is not used by the SDK.\n    // This all sadly is a bit ugly, but we currently don't have a \"pre-send\" hook on the integrations so we do it this\n    // way for now.\n    const breadcrumbIntegration = this.getIntegrationById(BREADCRUMB_INTEGRATION_ID) as Breadcrumbs | undefined;\n    // We check for definedness of `addSentryBreadcrumb` in case users provided their own integration with id\n    // \"Breadcrumbs\" that does not have this function.\n    if (breadcrumbIntegration && breadcrumbIntegration.addSentryBreadcrumb) {\n      breadcrumbIntegration.addSentryBreadcrumb(event);\n    }\n\n    super.sendEvent(event, hint);\n  }\n\n  /**\n   * Sends user feedback to Sentry.\n   */\n  public captureUserFeedback(feedback: UserFeedback): void {\n    if (!this._isEnabled()) {\n      __DEBUG_BUILD__ && logger.warn('SDK not enabled, will not capture user feedback.');\n      return;\n    }\n\n    const envelope = createUserFeedbackEnvelope(feedback, {\n      metadata: this.getSdkMetadata(),\n      dsn: this.getDsn(),\n      tunnel: this.getOptions().tunnel,\n    });\n    void this._sendEnvelope(envelope);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    event.platform = event.platform || 'javascript';\n    return super._prepareEvent(event, hint, scope);\n  }\n\n  /**\n   * Sends client reports as an envelope.\n   */\n  private _flushOutcomes(): void {\n    const outcomes = this._clearOutcomes();\n\n    if (outcomes.length === 0) {\n      __DEBUG_BUILD__ && logger.log('No outcomes to send');\n      return;\n    }\n\n    if (!this._dsn) {\n      __DEBUG_BUILD__ && logger.log('No dsn provided, will not send outcomes');\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('Sending outcomes:', outcomes);\n\n    const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n    void this._sendEnvelope(envelope);\n  }\n}\n"],"names":["BaseClient","WINDOW","getSDKSource","SDK_VERSION","eventFromException","eventFromMessage","BREADCRUMB_INTEGRATION_ID","logger","createUserFeedbackEnvelope","createClientReportEnvelope","dsnToString"],"mappings":";;;;;;;;;AAqBA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,aAAA,SAAAA,eAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAAC,cAAA,CAAA,iBAAA,IAAAC,kBAAA,EAAA,CAAA;AACA;AACA,IAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,SAAA,IAAA,EAAA,CAAA;AACA,IAAA,OAAA,CAAA,SAAA,CAAA,GAAA,GAAA,OAAA,CAAA,SAAA,CAAA,GAAA,IAAA;AACA,MAAA,IAAA,EAAA,2BAAA;AACA,MAAA,QAAA,EAAA;AACA,QAAA;AACA,UAAA,IAAA,EAAA,CAAA,EAAA,SAAA,CAAA,gBAAA,CAAA;AACA,UAAA,OAAA,EAAAC,gBAAA;AACA,SAAA;AACA,OAAA;AACA,MAAA,OAAA,EAAAA,gBAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,OAAA,CAAA,iBAAA,IAA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YAAA,CAAA,GAAA,CAAA,mBAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,QAAA,GAAAE,gCAAA,CAAA,QAAA,EAAA,IAAA,CAAA,QAAA,CAAA,MAAA,IAAAC,iBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,IAAA,KAAA,IAAA,CAAA,aAAA,CAAA,QAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

/**
 * This function creates an exception from a JavaScript Error
 */
function exceptionFromError(stackParser, ex) {
  // Get the frames first since Opera can lose the stack if we touch anything else first
  const frames = parseStackFrames(stackParser, ex);

  const exception = {
    type: ex && ex.name,
    value: extractMessage(ex),
  };

  if (frames.length) {
    exception.stacktrace = { frames };
  }

  if (exception.type === undefined && exception.value === '') {
    exception.value = 'Unrecoverable error caught';
  }

  return exception;
}

/**
 * @hidden
 */
function eventFromPlainObject(
  stackParser,
  exception,
  syntheticException,
  isUnhandledRejection,
) {
  const hub = core.getCurrentHub();
  const client = hub.getClient();
  const normalizeDepth = client && client.getOptions().normalizeDepth;

  const event = {
    exception: {
      values: [
        {
          type: utils.isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
          value: `Non-Error ${
            isUnhandledRejection ? 'promise rejection' : 'exception'
          } captured with keys: ${utils.extractExceptionKeysForMessage(exception)}`,
        },
      ],
    },
    extra: {
      __serialized__: utils.normalizeToSize(exception, normalizeDepth),
    },
  };

  if (syntheticException) {
    const frames = parseStackFrames(stackParser, syntheticException);
    if (frames.length) {
      // event.exception.values[0] has been set above
      (event.exception ).values[0].stacktrace = { frames };
    }
  }

  return event;
}

/**
 * @hidden
 */
function eventFromError(stackParser, ex) {
  return {
    exception: {
      values: [exceptionFromError(stackParser, ex)],
    },
  };
}

/** Parses stack frames from an error */
function parseStackFrames(
  stackParser,
  ex,
) {
  // Access and store the stacktrace property before doing ANYTHING
  // else to it because Opera is not very good at providing it
  // reliably in other circumstances.
  const stacktrace = ex.stacktrace || ex.stack || '';

  const popSize = getPopSize(ex);

  try {
    return stackParser(stacktrace, popSize);
  } catch (e) {
    // no-empty
  }

  return [];
}

// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
const reactMinifiedRegexp = /Minified React error #\d+;/i;

function getPopSize(ex) {
  if (ex) {
    if (typeof ex.framesToPop === 'number') {
      return ex.framesToPop;
    }

    if (reactMinifiedRegexp.test(ex.message)) {
      return 1;
    }
  }

  return 0;
}

/**
 * There are cases where stacktrace.message is an Event object
 * https://github.com/getsentry/sentry-javascript/issues/1949
 * In this specific case we try to extract stacktrace.message.error.message
 */
function extractMessage(ex) {
  const message = ex && ex.message;
  if (!message) {
    return 'No error message';
  }
  if (message.error && typeof message.error.message === 'string') {
    return message.error.message;
  }
  return message;
}

/**
 * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
 * @hidden
 */
function eventFromException(
  stackParser,
  exception,
  hint,
  attachStacktrace,
) {
  const syntheticException = (hint && hint.syntheticException) || undefined;
  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
  utils.addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
  event.level = 'error';
  if (hint && hint.event_id) {
    event.event_id = hint.event_id;
  }
  return utils.resolvedSyncPromise(event);
}

/**
 * Builds and Event from a Message
 * @hidden
 */
function eventFromMessage(
  stackParser,
  message,
  // eslint-disable-next-line deprecation/deprecation
  level = 'info',
  hint,
  attachStacktrace,
) {
  const syntheticException = (hint && hint.syntheticException) || undefined;
  const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
  event.level = level;
  if (hint && hint.event_id) {
    event.event_id = hint.event_id;
  }
  return utils.resolvedSyncPromise(event);
}

/**
 * @hidden
 */
function eventFromUnknownInput(
  stackParser,
  exception,
  syntheticException,
  attachStacktrace,
  isUnhandledRejection,
) {
  let event;

  if (utils.isErrorEvent(exception ) && (exception ).error) {
    // If it is an ErrorEvent with `error` property, extract it to get actual Error
    const errorEvent = exception ;
    return eventFromError(stackParser, errorEvent.error );
  }

  // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
  // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
  // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
  //
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
  // https://webidl.spec.whatwg.org/#es-DOMException-specialness
  if (utils.isDOMError(exception ) || utils.isDOMException(exception )) {
    const domException = exception ;

    if ('stack' in (exception )) {
      event = eventFromError(stackParser, exception );
    } else {
      const name = domException.name || (utils.isDOMError(domException) ? 'DOMError' : 'DOMException');
      const message = domException.message ? `${name}: ${domException.message}` : name;
      event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
      utils.addExceptionTypeValue(event, message);
    }
    if ('code' in domException) {
      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
    }

    return event;
  }
  if (utils.isError(exception)) {
    // we have a real Error object, do nothing
    return eventFromError(stackParser, exception);
  }
  if (utils.isPlainObject(exception) || utils.isEvent(exception)) {
    // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
    // it manually. This will allow us to group events based on top-level keys which is much better than creating a new
    // group on any key/value change.
    const objectException = exception ;
    event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
    utils.addExceptionMechanism(event, {
      synthetic: true,
    });
    return event;
  }

  // If none of previous checks were valid, then it means that it's not:
  // - an instance of DOMError
  // - an instance of DOMException
  // - an instance of Event
  // - an instance of Error
  // - a valid ErrorEvent (one with an error property)
  // - a plain Object
  //
  // So bail out and capture it as a simple message:
  event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
  utils.addExceptionTypeValue(event, `${exception}`, undefined);
  utils.addExceptionMechanism(event, {
    synthetic: true,
  });

  return event;
}

/**
 * @hidden
 */
function eventFromString(
  stackParser,
  input,
  syntheticException,
  attachStacktrace,
) {
  const event = {
    message: input,
  };

  if (attachStacktrace && syntheticException) {
    const frames = parseStackFrames(stackParser, syntheticException);
    if (frames.length) {
      event.exception = {
        values: [{ value: input, stacktrace: { frames } }],
      };
    }
  }

  return event;
}

exports.eventFromError = eventFromError;
exports.eventFromException = eventFromException;
exports.eventFromMessage = eventFromMessage;
exports.eventFromPlainObject = eventFromPlainObject;
exports.eventFromString = eventFromString;
exports.eventFromUnknownInput = eventFromUnknownInput;
exports.exceptionFromError = exceptionFromError;
exports.parseStackFrames = parseStackFrames;
//# sourceMappingURL=eventbuilder.js.map
{"version":3,"file":"eventbuilder.js","sources":["../../../src/eventbuilder.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  extractExceptionKeysForMessage,\n  isDOMError,\n  isDOMException,\n  isError,\n  isErrorEvent,\n  isEvent,\n  isPlainObject,\n  normalizeToSize,\n  resolvedSyncPromise,\n} from '@sentry/utils';\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n  // Get the frames first since Opera can lose the stack if we touch anything else first\n  const frames = parseStackFrames(stackParser, ex);\n\n  const exception: Exception = {\n    type: ex && ex.name,\n    value: extractMessage(ex),\n  };\n\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  if (exception.type === undefined && exception.value === '') {\n    exception.value = 'Unrecoverable error caught';\n  }\n\n  return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n  stackParser: StackParser,\n  exception: Record<string, unknown>,\n  syntheticException?: Error,\n  isUnhandledRejection?: boolean,\n): Event {\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n  const event: Event = {\n    exception: {\n      values: [\n        {\n          type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n          value: `Non-Error ${\n            isUnhandledRejection ? 'promise rejection' : 'exception'\n          } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n        },\n      ],\n    },\n    extra: {\n      __serialized__: normalizeToSize(exception, normalizeDepth),\n    },\n  };\n\n  if (syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      // event.exception.values[0] has been set above\n      (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n    }\n  }\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n  return {\n    exception: {\n      values: [exceptionFromError(stackParser, ex)],\n    },\n  };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n  stackParser: StackParser,\n  ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n  // Access and store the stacktrace property before doing ANYTHING\n  // else to it because Opera is not very good at providing it\n  // reliably in other circumstances.\n  const stacktrace = ex.stacktrace || ex.stack || '';\n\n  const popSize = getPopSize(ex);\n\n  try {\n    return stackParser(stacktrace, popSize);\n  } catch (e) {\n    // no-empty\n  }\n\n  return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n  if (ex) {\n    if (typeof ex.framesToPop === 'number') {\n      return ex.framesToPop;\n    }\n\n    if (reactMinifiedRegexp.test(ex.message)) {\n      return 1;\n    }\n  }\n\n  return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n  const message = ex && ex.message;\n  if (!message) {\n    return 'No error message';\n  }\n  if (message.error && typeof message.error.message === 'string') {\n    return message.error.message;\n  }\n  return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n  stackParser: StackParser,\n  exception: unknown,\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n  addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n  event.level = 'error';\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n  event.level = level;\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n  stackParser: StackParser,\n  exception: unknown,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n  isUnhandledRejection?: boolean,\n): Event {\n  let event: Event;\n\n  if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n    // If it is an ErrorEvent with `error` property, extract it to get actual Error\n    const errorEvent = exception as ErrorEvent;\n    return eventFromError(stackParser, errorEvent.error as Error);\n  }\n\n  // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n  // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n  // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n  //\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n  // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n  if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n    const domException = exception as DOMException;\n\n    if ('stack' in (exception as Error)) {\n      event = eventFromError(stackParser, exception as Error);\n    } else {\n      const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n      const message = domException.message ? `${name}: ${domException.message}` : name;\n      event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n      addExceptionTypeValue(event, message);\n    }\n    if ('code' in domException) {\n      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n    }\n\n    return event;\n  }\n  if (isError(exception)) {\n    // we have a real Error object, do nothing\n    return eventFromError(stackParser, exception);\n  }\n  if (isPlainObject(exception) || isEvent(exception)) {\n    // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n    // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n    // group on any key/value change.\n    const objectException = exception as Record<string, unknown>;\n    event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n    addExceptionMechanism(event, {\n      synthetic: true,\n    });\n    return event;\n  }\n\n  // If none of previous checks were valid, then it means that it's not:\n  // - an instance of DOMError\n  // - an instance of DOMException\n  // - an instance of Event\n  // - an instance of Error\n  // - a valid ErrorEvent (one with an error property)\n  // - a plain Object\n  //\n  // So bail out and capture it as a simple message:\n  event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n  addExceptionTypeValue(event, `${exception}`, undefined);\n  addExceptionMechanism(event, {\n    synthetic: true,\n  });\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n  stackParser: StackParser,\n  input: string,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    message: input,\n  };\n\n  if (attachStacktrace && syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [{ value: input, stacktrace: { frames } }],\n      };\n    }\n  }\n\n  return event;\n}\n"],"names":["getCurrentHub","isEvent","extractExceptionKeysForMessage","normalizeToSize","addExceptionMechanism","resolvedSyncPromise","isErrorEvent","isDOMError","isDOMException","addExceptionTypeValue","isError","isPlainObject"],"mappings":";;;;;AAgBA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,WAAA,EAAA,EAAA,EAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,gBAAA,CAAA,WAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,SAAA,GAAA;AACA,IAAA,IAAA,EAAA,EAAA,IAAA,EAAA,CAAA,IAAA;AACA,IAAA,KAAA,EAAA,cAAA,CAAA,EAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,CAAA,MAAA,EAAA;AACA,IAAA,SAAA,CAAA,UAAA,GAAA,EAAA,MAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,SAAA,CAAA,IAAA,KAAA,SAAA,IAAA,SAAA,CAAA,KAAA,KAAA,EAAA,EAAA;AACA,IAAA,SAAA,CAAA,KAAA,GAAA,4BAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA;AACA,EAAA,WAAA;AACA,EAAA,SAAA;AACA,EAAA,kBAAA;AACA,EAAA,oBAAA;AACA,EAAA;AACA,EAAA,MAAA,GAAA,GAAAA,kBAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,cAAA,GAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA,CAAA,cAAA,CAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA;A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AAA,SAAA,EAAA;AACA,IAAA,KAAA,GAAA,oBAAA,CAAA,WAAA,EAAA,eAAA,EAAA,kBAAA,EAAA,oBAAA,CAAA,CAAA;AACA,IAAAG,2BAAA,CAAA,KAAA,EAAA;AACA,MAAA,SAAA,EAAA,IAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,KAAA,GAAA,eAAA,CAAA,WAAA,EAAA,SAAA,GAAA,kBAAA,EAAA,gBAAA,CAAA,CAAA;AACA,EAAAK,2BAAA,CAAA,KAAA,EAAA,CAAA,EAAA,SAAA,CAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,EAAAL,2BAAA,CAAA,KAAA,EAAA;AACA,IAAA,SAAA,EAAA,IAAA;AACA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA;AACA,EAAA,WAAA;AACA,EAAA,KAAA;AACA,EAAA,kBAAA;AACA,EAAA,gBAAA;AACA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA;AACA,IAAA,OAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,gBAAA,IAAA,kBAAA,EAAA;AACA,IAAA,MAAA,MAAA,GAAA,gBAAA,CAAA,WAAA,EAAA,kBAAA,CAAA,CAAA;AACA,IAAA,IAAA,MAAA,CAAA,MAAA,EAAA;AACA,MAAA,KAAA,CAAA,SAAA,GAAA;AACA,QAAA,MAAA,EAAA,CAAA,EAAA,KAAA,EAAA,KAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

const WINDOW = utils.GLOBAL_OBJ ;

let ignoreOnError = 0;

/**
 * @hidden
 */
function shouldIgnoreOnError() {
  return ignoreOnError > 0;
}

/**
 * @hidden
 */
function ignoreNextOnError() {
  // onerror should trigger before setTimeout
  ignoreOnError++;
  setTimeout(() => {
    ignoreOnError--;
  });
}

/**
 * Instruments the given function and sends an event to Sentry every time the
 * function throws an exception.
 *
 * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
 * has a correct `this` context.
 * @returns The wrapped function.
 * @hidden
 */
function wrap(
  fn,
  options

 = {},
  before,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
  // for future readers what this does is wrap a function and then create
  // a bi-directional wrapping between them.
  //
  // example: wrapped = wrap(original);
  //  original.__sentry_wrapped__ -> wrapped
  //  wrapped.__sentry_original__ -> original

  if (typeof fn !== 'function') {
    return fn;
  }

  try {
    // if we're dealing with a function that was previously wrapped, return
    // the original wrapper.
    const wrapper = fn.__sentry_wrapped__;
    if (wrapper) {
      return wrapper;
    }

    // We don't wanna wrap it twice
    if (utils.getOriginalFunction(fn)) {
      return fn;
    }
  } catch (e) {
    // Just accessing custom props in some Selenium environments
    // can cause a "Permission denied" exception (see raven-js#495).
    // Bail on wrapping and return the function as-is (defers to window.onerror).
    return fn;
  }

  /* eslint-disable prefer-rest-params */
  // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
  const sentryWrapped = function () {
    const args = Array.prototype.slice.call(arguments);

    try {
      if (before && typeof before === 'function') {
        before.apply(this, arguments);
      }

      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
      const wrappedArguments = args.map((arg) => wrap(arg, options));

      // Attempt to invoke user-land function
      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
      //       means the sentry.javascript SDK caught an error invoking your application code. This
      //       is expected behavior and NOT indicative of a bug with sentry.javascript.
      return fn.apply(this, wrappedArguments);
    } catch (ex) {
      ignoreNextOnError();

      core.withScope((scope) => {
        scope.addEventProcessor((event) => {
          if (options.mechanism) {
            utils.addExceptionTypeValue(event, undefined, undefined);
            utils.addExceptionMechanism(event, options.mechanism);
          }

          event.extra = {
            ...event.extra,
            arguments: args,
          };

          return event;
        });

        core.captureException(ex);
      });

      throw ex;
    }
  };
  /* eslint-enable prefer-rest-params */

  // Accessing some objects may throw
  // ref: https://github.com/getsentry/sentry-javascript/issues/1168
  try {
    for (const property in fn) {
      if (Object.prototype.hasOwnProperty.call(fn, property)) {
        sentryWrapped[property] = fn[property];
      }
    }
  } catch (_oO) {} // eslint-disable-line no-empty

  // Signal that this function has been wrapped/filled already
  // for both debugging and to prevent it to being wrapped/filled twice
  utils.markFunctionWrapped(sentryWrapped, fn);

  utils.addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);

  // Restore original function name (not all browsers allow that)
  try {
    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;
    if (descriptor.configurable) {
      Object.defineProperty(sentryWrapped, 'name', {
        get() {
          return fn.name;
        },
      });
    }
    // eslint-disable-next-line no-empty
  } catch (_oO) {}

  return sentryWrapped;
}

/**
 * All properties the report dialog supports
 */

exports.WINDOW = WINDOW;
exports.ignoreNextOnError = ignoreNextOnError;
exports.shouldIgnoreOnError = shouldIgnoreOnError;
exports.wrap = wrap;
//# sourceMappingURL=helpers.js.map
{"version":3,"file":"helpers.js","sources":["../../../src/helpers.ts"],"sourcesContent":["import { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  addNonEnumerableProperty,\n  getOriginalFunction,\n  GLOBAL_OBJ,\n  markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n  return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n  // onerror should trigger before setTimeout\n  ignoreOnError++;\n  setTimeout(() => {\n    ignoreOnError--;\n  });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n  fn: WrappedFunction,\n  options: {\n    mechanism?: Mechanism;\n  } = {},\n  before?: WrappedFunction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n  // for future readers what this does is wrap a function and then create\n  // a bi-directional wrapping between them.\n  //\n  // example: wrapped = wrap(original);\n  //  original.__sentry_wrapped__ -> wrapped\n  //  wrapped.__sentry_original__ -> original\n\n  if (typeof fn !== 'function') {\n    return fn;\n  }\n\n  try {\n    // if we're dealing with a function that was previously wrapped, return\n    // the original wrapper.\n    const wrapper = fn.__sentry_wrapped__;\n    if (wrapper) {\n      return wrapper;\n    }\n\n    // We don't wanna wrap it twice\n    if (getOriginalFunction(fn)) {\n      return fn;\n    }\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    // Bail on wrapping and return the function as-is (defers to window.onerror).\n    return fn;\n  }\n\n  /* eslint-disable prefer-rest-params */\n  // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n  const sentryWrapped: WrappedFunction = function (this: unknown): void {\n    const args = Array.prototype.slice.call(arguments);\n\n    try {\n      if (before && typeof before === 'function') {\n        before.apply(this, arguments);\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n      const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n      // Attempt to invoke user-land function\n      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n      //       means the sentry.javascript SDK caught an error invoking your application code. This\n      //       is expected behavior and NOT indicative of a bug with sentry.javascript.\n      return fn.apply(this, wrappedArguments);\n    } catch (ex) {\n      ignoreNextOnError();\n\n      withScope((scope: Scope) => {\n        scope.addEventProcessor((event: SentryEvent) => {\n          if (options.mechanism) {\n            addExceptionTypeValue(event, undefined, undefined);\n            addExceptionMechanism(event, options.mechanism);\n          }\n\n          event.extra = {\n            ...event.extra,\n            arguments: args,\n          };\n\n          return event;\n        });\n\n        captureException(ex);\n      });\n\n      throw ex;\n    }\n  };\n  /* eslint-enable prefer-rest-params */\n\n  // Accessing some objects may throw\n  // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n  try {\n    for (const property in fn) {\n      if (Object.prototype.hasOwnProperty.call(fn, property)) {\n        sentryWrapped[property] = fn[property];\n      }\n    }\n  } catch (_oO) {} // eslint-disable-line no-empty\n\n  // Signal that this function has been wrapped/filled already\n  // for both debugging and to prevent it to being wrapped/filled twice\n  markFunctionWrapped(sentryWrapped, fn);\n\n  addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n  // Restore original function name (not all browsers allow that)\n  try {\n    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n    if (descriptor.configurable) {\n      Object.defineProperty(sentryWrapped, 'name', {\n        get(): string {\n          return fn.name;\n        },\n      });\n    }\n    // eslint-disable-next-line no-empty\n  } catch (_oO) {}\n\n  return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: string]: any;\n  eventId?: string;\n  dsn?: DsnLike;\n  user?: {\n    email?: string;\n    name?: string;\n  };\n  lang?: string;\n  title?: string;\n  subtitle?: string;\n  subtitle2?: string;\n  labelName?: string;\n  labelEmail?: string;\n  labelComments?: string;\n  labelClose?: string;\n  labelSubmit?: string;\n  errorGeneric?: string;\n  errorFormEntry?: string;\n  successMessage?: string;\n  /** Callback after reportDialog showed up */\n  onLoad?(this: void): void;\n}\n"],"names":["GLOBAL_OBJ","getOriginalFunction","withScope","addExceptionTypeValue","addExceptionMechanism","captureException","markFunctionWrapped","addNonEnumerableProperty"],"mappings":";;;;;AAWA,MAAA,MAAA,GAAAA,gBAAA,EAAA;AACA;AACA,IAAA,aAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,GAAA;AACA,EAAA,OAAA,aAAA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,GAAA;AACA;AACA,EAAA,aAAA,EAAA,CAAA;AACA,EAAA,UAAA,CAAA,MAAA;AACA,IAAA,aAAA,EAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA;AACA,EAAA,EAAA;AACA,EAAA,OAAA;AACA;AACA,GAAA,EAAA;AACA,EAAA,MAAA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,OAAA,EAAA,KAAA,UAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA;AACA;AACA,IAAA,MAAA,OAAA,GAAA,EAAA,CAAA,kBAAA,CAAA;AACA,IAAA,IAAA,OAAA,EAAA;AACA,MAAA,OAAA,OAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAAC,yBAAA,CAAA,EAAA,CAAA,EAAA;AACA,MAAA,OAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,YAAA;AACA,IAAA,MAAA,IAAA,GAAA,KAAA,CAAA,SAAA,CAAA,KAAA,CAAA,IAAA,CAAA,SAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA;AACA,MAAA,IAAA,MAAA,I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AA,CAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA;AACA;AACA;AACA,EAAAC,yBAAA,CAAA,aAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,EAAAC,8BAAA,CAAA,EAAA,EAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,UAAA,GAAA,MAAA,CAAA,wBAAA,CAAA,aAAA,EAAA,MAAA,CAAA,EAAA;AACA,IAAA,IAAA,UAAA,CAAA,YAAA,EAAA;AACA,MAAA,MAAA,CAAA,cAAA,CAAA,aAAA,EAAA,MAAA,EAAA;AACA,QAAA,GAAA,GAAA;AACA,UAAA,OAAA,EAAA,CAAA,IAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA;AACA,EAAA,OAAA,aAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const helpers = require('./helpers.js');
const client = require('./client.js');
const fetch = require('./transports/fetch.js');
const xhr = require('./transports/xhr.js');
const stackParsers = require('./stack-parsers.js');
const eventbuilder = require('./eventbuilder.js');
const userfeedback = require('./userfeedback.js');
const sdk = require('./sdk.js');
const index = require('./integrations/index.js');
const replay = require('@sentry/replay');
const tracing = require('@sentry-internal/tracing');
const offline = require('./transports/offline.js');
const hubextensions = require('./profiling/hubextensions.js');
const integration = require('./profiling/integration.js');
const globalhandlers = require('./integrations/globalhandlers.js');
const trycatch = require('./integrations/trycatch.js');
const breadcrumbs = require('./integrations/breadcrumbs.js');
const linkederrors = require('./integrations/linkederrors.js');
const httpcontext = require('./integrations/httpcontext.js');
const dedupe = require('./integrations/dedupe.js');

let windowIntegrations = {};

// This block is needed to add compatibility with the integrations packages when used with a CDN
if (helpers.WINDOW.Sentry && helpers.WINDOW.Sentry.Integrations) {
  windowIntegrations = helpers.WINDOW.Sentry.Integrations;
}

const INTEGRATIONS = {
  ...windowIntegrations,
  ...core.Integrations,
  ...index,
};

exports.FunctionToString = core.FunctionToString;
exports.Hub = core.Hub;
exports.InboundFilters = core.InboundFilters;
exports.SDK_VERSION = core.SDK_VERSION;
exports.Scope = core.Scope;
exports.addBreadcrumb = core.addBreadcrumb;
exports.addGlobalEventProcessor = core.addGlobalEventProcessor;
exports.addTracingExtensions = core.addTracingExtensions;
exports.captureEvent = core.captureEvent;
exports.captureException = core.captureException;
exports.captureMessage = core.captureMessage;
exports.configureScope = core.configureScope;
exports.createTransport = core.createTransport;
exports.extractTraceparentData = core.extractTraceparentData;
exports.getActiveTransaction = core.getActiveTransaction;
exports.getCurrentHub = core.getCurrentHub;
exports.getHubFromCarrier = core.getHubFromCarrier;
exports.makeMain = core.makeMain;
exports.setContext = core.setContext;
exports.setExtra = core.setExtra;
exports.setExtras = core.setExtras;
exports.setTag = core.setTag;
exports.setTags = core.setTags;
exports.setUser = core.setUser;
exports.spanStatusfromHttpCode = core.spanStatusfromHttpCode;
exports.startTransaction = core.startTransaction;
exports.trace = core.trace;
exports.withScope = core.withScope;
exports.WINDOW = helpers.WINDOW;
exports.BrowserClient = client.BrowserClient;
exports.makeFetchTransport = fetch.makeFetchTransport;
exports.makeXHRTransport = xhr.makeXHRTransport;
exports.chromeStackLineParser = stackParsers.chromeStackLineParser;
exports.defaultStackLineParsers = stackParsers.defaultStackLineParsers;
exports.defaultStackParser = stackParsers.defaultStackParser;
exports.geckoStackLineParser = stackParsers.geckoStackLineParser;
exports.opera10StackLineParser = stackParsers.opera10StackLineParser;
exports.opera11StackLineParser = stackParsers.opera11StackLineParser;
exports.winjsStackLineParser = stackParsers.winjsStackLineParser;
exports.eventFromException = eventbuilder.eventFromException;
exports.eventFromMessage = eventbuilder.eventFromMessage;
exports.createUserFeedbackEnvelope = userfeedback.createUserFeedbackEnvelope;
exports.captureUserFeedback = sdk.captureUserFeedback;
exports.close = sdk.close;
exports.defaultIntegrations = sdk.defaultIntegrations;
exports.flush = sdk.flush;
exports.forceLoad = sdk.forceLoad;
exports.init = sdk.init;
exports.lastEventId = sdk.lastEventId;
exports.onLoad = sdk.onLoad;
exports.showReportDialog = sdk.showReportDialog;
exports.wrap = sdk.wrap;
exports.Replay = replay.Replay;
exports.BrowserTracing = tracing.BrowserTracing;
exports.defaultRequestInstrumentationOptions = tracing.defaultRequestInstrumentationOptions;
exports.instrumentOutgoingRequests = tracing.instrumentOutgoingRequests;
exports.makeBrowserOfflineTransport = offline.makeBrowserOfflineTransport;
exports.onProfilingStartRouteTransaction = hubextensions.onProfilingStartRouteTransaction;
exports.BrowserProfilingIntegration = integration.BrowserProfilingIntegration;
exports.GlobalHandlers = globalhandlers.GlobalHandlers;
exports.TryCatch = trycatch.TryCatch;
exports.Breadcrumbs = breadcrumbs.Breadcrumbs;
exports.LinkedErrors = linkederrors.LinkedErrors;
exports.HttpContext = httpcontext.HttpContext;
exports.Dedupe = dedupe.Dedupe;
exports.Integrations = INTEGRATIONS;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport { WINDOW } from './helpers';\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nif (WINDOW.Sentry && WINDOW.Sentry.Integrations) {\n  windowIntegrations = WINDOW.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n  ...windowIntegrations,\n  ...CoreIntegrations,\n  ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations };\n\nexport { Replay } from '@sentry/replay';\nexport {\n  BrowserTracing,\n  defaultRequestInstrumentationOptions,\n  instrumentOutgoingRequests,\n} from '@sentry-internal/tracing';\nexport type { RequestInstrumentationOptions } from '@sentry-internal/tracing';\nexport {\n  addTracingExtensions,\n  extractTraceparentData,\n  getActiveTransaction,\n  spanStatusfromHttpCode,\n  trace,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport type { Span } from '@sentry/types';\nexport { makeBrowserOfflineTransport } from './transports/offline';\nexport { onProfilingStartRouteTransaction } from './profiling/hubextensions';\nexport { BrowserProfilingIntegration } from './profiling/integration';\n"],"names":["WINDOW","CoreIntegrations","BrowserIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAA,kBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,IAAAA,cAAA,CAAA,MAAA,IAAAA,cAAA,CAAA,MAAA,CAAA,YAAA,EAAA;AACA,EAAA,kBAAA,GAAAA,cAAA,CAAA,MAAA,CAAA,YAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,YAAA,GAAA;AACA,EAAA,GAAA,kBAAA;AACA,EAAA,GAAAC,iBAAA;AACA,EAAA,GAAAC,KAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const helpers = require('../helpers.js');

/* eslint-disable @typescript-eslint/no-unsafe-member-access */

/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */
const MAX_ALLOWED_STRING_LENGTH = 1024;

const BREADCRUMB_INTEGRATION_ID = 'Breadcrumbs';

/**
 * Default Breadcrumbs instrumentations
 * TODO: Deprecated - with v6, this will be renamed to `Instrument`
 */
class Breadcrumbs  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = BREADCRUMB_INTEGRATION_ID;}

  /**
   * @inheritDoc
   */
   __init() {this.name = Breadcrumbs.id;}

  /**
   * Options of the breadcrumbs integration.
   */
  // This field is public, because we use it in the browser client to check if the `sentry` option is enabled.

  /**
   * @inheritDoc
   */
   constructor(options) {Breadcrumbs.prototype.__init.call(this);
    this.options = {
      console: true,
      dom: true,
      fetch: true,
      history: true,
      sentry: true,
      xhr: true,
      ...options,
    };
  }

  /**
   * Instrument browser built-ins w/ breadcrumb capturing
   *  - Console API
   *  - DOM API (click/typing)
   *  - XMLHttpRequest API
   *  - Fetch API
   *  - History API
   */
   setupOnce() {
    if (this.options.console) {
      utils.addInstrumentationHandler('console', _consoleBreadcrumb);
    }
    if (this.options.dom) {
      utils.addInstrumentationHandler('dom', _domBreadcrumb(this.options.dom));
    }
    if (this.options.xhr) {
      utils.addInstrumentationHandler('xhr', _xhrBreadcrumb);
    }
    if (this.options.fetch) {
      utils.addInstrumentationHandler('fetch', _fetchBreadcrumb);
    }
    if (this.options.history) {
      utils.addInstrumentationHandler('history', _historyBreadcrumb);
    }
  }

  /**
   * Adds a breadcrumb for Sentry events or transactions if this option is enabled.
   */
   addSentryBreadcrumb(event) {
    if (this.options.sentry) {
      core.getCurrentHub().addBreadcrumb(
        {
          category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
          event_id: event.event_id,
          level: event.level,
          message: utils.getEventDescription(event),
        },
        {
          event,
        },
      );
    }
  }
} Breadcrumbs.__initStatic();

/**
 * A HOC that creaes a function that creates breadcrumbs from DOM API calls.
 * This is a HOC so that we get access to dom options in the closure.
 */
function _domBreadcrumb(dom) {
  function _innerDomBreadcrumb(handlerData) {
    let target;
    let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;

    let maxStringLength =
      typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
    if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.warn(
          `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,
        );
      maxStringLength = MAX_ALLOWED_STRING_LENGTH;
    }

    if (typeof keyAttrs === 'string') {
      keyAttrs = [keyAttrs];
    }

    // Accessing event.target can throw (see getsentry/raven-js#838, #768)
    try {
      const event = handlerData.event ;
      target = _isEvent(event)
        ? utils.htmlTreeAsString(event.target, { keyAttrs, maxStringLength })
        : utils.htmlTreeAsString(event, { keyAttrs, maxStringLength });
    } catch (e) {
      target = '<unknown>';
    }

    if (target.length === 0) {
      return;
    }

    core.getCurrentHub().addBreadcrumb(
      {
        category: `ui.${handlerData.name}`,
        message: target,
      },
      {
        event: handlerData.event,
        name: handlerData.name,
        global: handlerData.global,
      },
    );
  }

  return _innerDomBreadcrumb;
}

/**
 * Creates breadcrumbs from console API calls
 */
function _consoleBreadcrumb(handlerData) {
  // This is a hack to fix a Vue3-specific bug that causes an infinite loop of
  // console warnings. This happens when a Vue template is rendered with
  // an undeclared variable, which we try to stringify, ultimately causing
  // Vue to issue another warning which repeats indefinitely.
  // see: https://github.com/getsentry/sentry-javascript/pull/6010
  // see: https://github.com/getsentry/sentry-javascript/issues/5916
  for (let i = 0; i < handlerData.args.length; i++) {
    if (handlerData.args[i] === 'ref=Ref<') {
      handlerData.args[i + 1] = 'viewRef';
      break;
    }
  }
  const breadcrumb = {
    category: 'console',
    data: {
      arguments: handlerData.args,
      logger: 'console',
    },
    level: utils.severityLevelFromString(handlerData.level),
    message: utils.safeJoin(handlerData.args, ' '),
  };

  if (handlerData.level === 'assert') {
    if (handlerData.args[0] === false) {
      breadcrumb.message = `Assertion failed: ${utils.safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
      breadcrumb.data.arguments = handlerData.args.slice(1);
    } else {
      // Don't capture a breadcrumb for passed assertions
      return;
    }
  }

  core.getCurrentHub().addBreadcrumb(breadcrumb, {
    input: handlerData.args,
    level: handlerData.level,
  });
}

/**
 * Creates breadcrumbs from XHR API calls
 */
function _xhrBreadcrumb(handlerData) {
  const { startTimestamp, endTimestamp } = handlerData;

  const sentryXhrData = handlerData.xhr[utils.SENTRY_XHR_DATA_KEY];

  // We only capture complete, non-sentry requests
  if (!startTimestamp || !endTimestamp || !sentryXhrData) {
    return;
  }

  const { method, url, status_code, body } = sentryXhrData;

  const data = {
    method,
    url,
    status_code,
  };

  const hint = {
    xhr: handlerData.xhr,
    input: body,
    startTimestamp,
    endTimestamp,
  };

  core.getCurrentHub().addBreadcrumb(
    {
      category: 'xhr',
      data,
      type: 'http',
    },
    hint,
  );
}

/**
 * Creates breadcrumbs from fetch API calls
 */
function _fetchBreadcrumb(handlerData) {
  const { startTimestamp, endTimestamp } = handlerData;

  // We only capture complete fetch requests
  if (!endTimestamp) {
    return;
  }

  if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {
    // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)
    return;
  }

  if (handlerData.error) {
    const data = handlerData.fetchData;
    const hint = {
      data: handlerData.error,
      input: handlerData.args,
      startTimestamp,
      endTimestamp,
    };

    core.getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data,
        level: 'error',
        type: 'http',
      },
      hint,
    );
  } else {
    const data = {
      ...handlerData.fetchData,
      status_code: handlerData.response && handlerData.response.status,
    };
    const hint = {
      input: handlerData.args,
      response: handlerData.response,
      startTimestamp,
      endTimestamp,
    };
    core.getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data,
        type: 'http',
      },
      hint,
    );
  }
}

/**
 * Creates breadcrumbs from history API calls
 */
function _historyBreadcrumb(handlerData) {
  let from = handlerData.from;
  let to = handlerData.to;
  const parsedLoc = utils.parseUrl(helpers.WINDOW.location.href);
  let parsedFrom = utils.parseUrl(from);
  const parsedTo = utils.parseUrl(to);

  // Initial pushState doesn't provide `from` information
  if (!parsedFrom.path) {
    parsedFrom = parsedLoc;
  }

  // Use only the path component of the URL if the URL matches the current
  // document (almost all the time when using pushState)
  if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
    to = parsedTo.relative;
  }
  if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
    from = parsedFrom.relative;
  }

  core.getCurrentHub().addBreadcrumb({
    category: 'navigation',
    data: {
      from,
      to,
    },
  });
}

function _isEvent(event) {
  return event && !!(event ).target;
}

exports.BREADCRUMB_INTEGRATION_ID = BREADCRUMB_INTEGRATION_ID;
exports.Breadcrumbs = Breadcrumbs;
//# sourceMappingURL=breadcrumbs.js.map
{"version":3,"file":"breadcrumbs.js","sources":["../../../../src/integrations/breadcrumbs.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable max-lines */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event as SentryEvent, HandlerDataFetch, HandlerDataXhr, Integration } from '@sentry/types';\nimport type {\n  FetchBreadcrumbData,\n  FetchBreadcrumbHint,\n  XhrBreadcrumbData,\n  XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n  addInstrumentationHandler,\n  getEventDescription,\n  htmlTreeAsString,\n  logger,\n  parseUrl,\n  safeJoin,\n  SENTRY_XHR_DATA_KEY,\n  severityLevelFromString,\n} from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\ntype HandlerData = Record<string, unknown>;\n\n/** JSDoc */\ninterface BreadcrumbsOptions {\n  console: boolean;\n  dom:\n    | boolean\n    | {\n        serializeAttribute?: string | string[];\n        maxStringLength?: number;\n      };\n  fetch: boolean;\n  history: boolean;\n  sentry: boolean;\n  xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nexport const BREADCRUMB_INTEGRATION_ID = 'Breadcrumbs';\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = BREADCRUMB_INTEGRATION_ID;\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Breadcrumbs.id;\n\n  /**\n   * Options of the breadcrumbs integration.\n   */\n  // This field is public, because we use it in the browser client to check if the `sentry` option is enabled.\n  public readonly options: Readonly<BreadcrumbsOptions>;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<BreadcrumbsOptions>) {\n    this.options = {\n      console: true,\n      dom: true,\n      fetch: true,\n      history: true,\n      sentry: true,\n      xhr: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Instrument browser built-ins w/ breadcrumb capturing\n   *  - Console API\n   *  - DOM API (click/typing)\n   *  - XMLHttpRequest API\n   *  - Fetch API\n   *  - History API\n   */\n  public setupOnce(): void {\n    if (this.options.console) {\n      addInstrumentationHandler('console', _consoleBreadcrumb);\n    }\n    if (this.options.dom) {\n      addInstrumentationHandler('dom', _domBreadcrumb(this.options.dom));\n    }\n    if (this.options.xhr) {\n      addInstrumentationHandler('xhr', _xhrBreadcrumb);\n    }\n    if (this.options.fetch) {\n      addInstrumentationHandler('fetch', _fetchBreadcrumb);\n    }\n    if (this.options.history) {\n      addInstrumentationHandler('history', _historyBreadcrumb);\n    }\n  }\n\n  /**\n   * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n   */\n  public addSentryBreadcrumb(event: SentryEvent): void {\n    if (this.options.sentry) {\n      getCurrentHub().addBreadcrumb(\n        {\n          category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n          event_id: event.event_id,\n          level: event.level,\n          message: getEventDescription(event),\n        },\n        {\n          event,\n        },\n      );\n    }\n  }\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: HandlerData) => void {\n  function _innerDomBreadcrumb(handlerData: HandlerData): void {\n    let target;\n    let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n    let maxStringLength =\n      typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n    if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n        );\n      maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n    }\n\n    if (typeof keyAttrs === 'string') {\n      keyAttrs = [keyAttrs];\n    }\n\n    // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n    try {\n      const event = handlerData.event as Event | Node;\n      target = _isEvent(event)\n        ? htmlTreeAsString(event.target, { keyAttrs, maxStringLength })\n        : htmlTreeAsString(event, { keyAttrs, maxStringLength });\n    } catch (e) {\n      target = '<unknown>';\n    }\n\n    if (target.length === 0) {\n      return;\n    }\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: `ui.${handlerData.name}`,\n        message: target,\n      },\n      {\n        event: handlerData.event,\n        name: handlerData.name,\n        global: handlerData.global,\n      },\n    );\n  }\n\n  return _innerDomBreadcrumb;\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _consoleBreadcrumb(handlerData: HandlerData & { args: unknown[]; level: string }): void {\n  // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n  // console warnings. This happens when a Vue template is rendered with\n  // an undeclared variable, which we try to stringify, ultimately causing\n  // Vue to issue another warning which repeats indefinitely.\n  // see: https://github.com/getsentry/sentry-javascript/pull/6010\n  // see: https://github.com/getsentry/sentry-javascript/issues/5916\n  for (let i = 0; i < handlerData.args.length; i++) {\n    if (handlerData.args[i] === 'ref=Ref<') {\n      handlerData.args[i + 1] = 'viewRef';\n      break;\n    }\n  }\n  const breadcrumb = {\n    category: 'console',\n    data: {\n      arguments: handlerData.args,\n      logger: 'console',\n    },\n    level: severityLevelFromString(handlerData.level),\n    message: safeJoin(handlerData.args, ' '),\n  };\n\n  if (handlerData.level === 'assert') {\n    if (handlerData.args[0] === false) {\n      breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n      breadcrumb.data.arguments = handlerData.args.slice(1);\n    } else {\n      // Don't capture a breadcrumb for passed assertions\n      return;\n    }\n  }\n\n  getCurrentHub().addBreadcrumb(breadcrumb, {\n    input: handlerData.args,\n    level: handlerData.level,\n  });\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _xhrBreadcrumb(handlerData: HandlerData & HandlerDataXhr): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n  // We only capture complete, non-sentry requests\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return;\n  }\n\n  const { method, url, status_code, body } = sentryXhrData;\n\n  const data: XhrBreadcrumbData = {\n    method,\n    url,\n    status_code,\n  };\n\n  const hint: XhrBreadcrumbHint = {\n    xhr: handlerData.xhr,\n    input: body,\n    startTimestamp,\n    endTimestamp,\n  };\n\n  getCurrentHub().addBreadcrumb(\n    {\n      category: 'xhr',\n      data,\n      type: 'http',\n    },\n    hint,\n  );\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _fetchBreadcrumb(handlerData: HandlerData & HandlerDataFetch & { response?: Response }): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  // We only capture complete fetch requests\n  if (!endTimestamp) {\n    return;\n  }\n\n  if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n    // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n    return;\n  }\n\n  if (handlerData.error) {\n    const data: FetchBreadcrumbData = handlerData.fetchData;\n    const hint: FetchBreadcrumbHint = {\n      data: handlerData.error,\n      input: handlerData.args,\n      startTimestamp,\n      endTimestamp,\n    };\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        level: 'error',\n        type: 'http',\n      },\n      hint,\n    );\n  } else {\n    const data: FetchBreadcrumbData = {\n      ...handlerData.fetchData,\n      status_code: handlerData.response && handlerData.response.status,\n    };\n    const hint: FetchBreadcrumbHint = {\n      input: handlerData.args,\n      response: handlerData.response,\n      startTimestamp,\n      endTimestamp,\n    };\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        type: 'http',\n      },\n      hint,\n    );\n  }\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _historyBreadcrumb(handlerData: HandlerData & { from: string; to: string }): void {\n  let from: string | undefined = handlerData.from;\n  let to: string | undefined = handlerData.to;\n  const parsedLoc = parseUrl(WINDOW.location.href);\n  let parsedFrom = parseUrl(from);\n  const parsedTo = parseUrl(to);\n\n  // Initial pushState doesn't provide `from` information\n  if (!parsedFrom.path) {\n    parsedFrom = parsedLoc;\n  }\n\n  // Use only the path component of the URL if the URL matches the current\n  // document (almost all the time when using pushState)\n  if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n    to = parsedTo.relative;\n  }\n  if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n    from = parsedFrom.relative;\n  }\n\n  getCurrentHub().addBreadcrumb({\n    category: 'navigation',\n    data: {\n      from,\n      to,\n    },\n  });\n}\n\nfunction _isEvent(event: unknown): event is Event {\n  return event && !!(event as Record<string, unknown>).target;\n}\n"],"names":["addInstrumentationHandler","getCurrentHub","getEventDescription","logger","htmlTreeAsString","severityLevelFromString","safeJoin","SENTRY_XHR_DATA_KEY","parseUrl","WINDOW"],"mappings":";;;;;;AAAA;;AAwCA;AACA,MAAA,yBAAA,GAAA,IAAA,CAAA;AACA;AACA,MAAA,yBAAA,GAAA,cAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,WAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,0BAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,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IAAA,SAAA,CAAA,IAAA,KAAA,QAAA,CAAA,IAAA,EAAA;AACA,IAAA,EAAA,GAAA,QAAA,CAAA,QAAA,CAAA;AACA,GAAA;AACA,EAAA,IAAA,SAAA,CAAA,QAAA,KAAA,UAAA,CAAA,QAAA,IAAA,SAAA,CAAA,IAAA,KAAA,UAAA,CAAA,IAAA,EAAA;AACA,IAAA,IAAA,GAAA,UAAA,CAAA,QAAA,CAAA;AACA,GAAA;AACA;AACA,EAAAP,kBAAA,EAAA,CAAA,aAAA,CAAA;AACA,IAAA,QAAA,EAAA,YAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,IAAA;AACA,MAAA,EAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,QAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,IAAA,CAAA,CAAA,CAAA,KAAA,GAAA,MAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

/** Deduplication filter */
class Dedupe  {constructor() { Dedupe.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Dedupe';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Dedupe.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    const eventProcessor = currentEvent => {
      // We want to ignore any non-error type events, e.g. transactions or replays
      // These should never be deduped, and also not be compared against as _previousEvent.
      if (currentEvent.type) {
        return currentEvent;
      }

      const self = getCurrentHub().getIntegration(Dedupe);
      if (self) {
        // Juuust in case something goes wrong
        try {
          if (_shouldDropEvent(currentEvent, self._previousEvent)) {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Event dropped due to being a duplicate of previously captured event.');
            return null;
          }
        } catch (_oO) {
          return (self._previousEvent = currentEvent);
        }

        return (self._previousEvent = currentEvent);
      }
      return currentEvent;
    };

    eventProcessor.id = this.name;
    addGlobalEventProcessor(eventProcessor);
  }
} Dedupe.__initStatic();

/** JSDoc */
function _shouldDropEvent(currentEvent, previousEvent) {
  if (!previousEvent) {
    return false;
  }

  if (_isSameMessageEvent(currentEvent, previousEvent)) {
    return true;
  }

  if (_isSameExceptionEvent(currentEvent, previousEvent)) {
    return true;
  }

  return false;
}

/** JSDoc */
function _isSameMessageEvent(currentEvent, previousEvent) {
  const currentMessage = currentEvent.message;
  const previousMessage = previousEvent.message;

  // If neither event has a message property, they were both exceptions, so bail out
  if (!currentMessage && !previousMessage) {
    return false;
  }

  // If only one event has a stacktrace, but not the other one, they are not the same
  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {
    return false;
  }

  if (currentMessage !== previousMessage) {
    return false;
  }

  if (!_isSameFingerprint(currentEvent, previousEvent)) {
    return false;
  }

  if (!_isSameStacktrace(currentEvent, previousEvent)) {
    return false;
  }

  return true;
}

/** JSDoc */
function _isSameExceptionEvent(currentEvent, previousEvent) {
  const previousException = _getExceptionFromEvent(previousEvent);
  const currentException = _getExceptionFromEvent(currentEvent);

  if (!previousException || !currentException) {
    return false;
  }

  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {
    return false;
  }

  if (!_isSameFingerprint(currentEvent, previousEvent)) {
    return false;
  }

  if (!_isSameStacktrace(currentEvent, previousEvent)) {
    return false;
  }

  return true;
}

/** JSDoc */
function _isSameStacktrace(currentEvent, previousEvent) {
  let currentFrames = _getFramesFromEvent(currentEvent);
  let previousFrames = _getFramesFromEvent(previousEvent);

  // If neither event has a stacktrace, they are assumed to be the same
  if (!currentFrames && !previousFrames) {
    return true;
  }

  // If only one event has a stacktrace, but not the other one, they are not the same
  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {
    return false;
  }

  currentFrames = currentFrames ;
  previousFrames = previousFrames ;

  // If number of frames differ, they are not the same
  if (previousFrames.length !== currentFrames.length) {
    return false;
  }

  // Otherwise, compare the two
  for (let i = 0; i < previousFrames.length; i++) {
    const frameA = previousFrames[i];
    const frameB = currentFrames[i];

    if (
      frameA.filename !== frameB.filename ||
      frameA.lineno !== frameB.lineno ||
      frameA.colno !== frameB.colno ||
      frameA.function !== frameB.function
    ) {
      return false;
    }
  }

  return true;
}

/** JSDoc */
function _isSameFingerprint(currentEvent, previousEvent) {
  let currentFingerprint = currentEvent.fingerprint;
  let previousFingerprint = previousEvent.fingerprint;

  // If neither event has a fingerprint, they are assumed to be the same
  if (!currentFingerprint && !previousFingerprint) {
    return true;
  }

  // If only one event has a fingerprint, but not the other one, they are not the same
  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {
    return false;
  }

  currentFingerprint = currentFingerprint ;
  previousFingerprint = previousFingerprint ;

  // Otherwise, compare the two
  try {
    return !!(currentFingerprint.join('') === previousFingerprint.join(''));
  } catch (_oO) {
    return false;
  }
}

/** JSDoc */
function _getExceptionFromEvent(event) {
  return event.exception && event.exception.values && event.exception.values[0];
}

/** JSDoc */
function _getFramesFromEvent(event) {
  const exception = event.exception;

  if (exception) {
    try {
      // @ts-ignore Object could be undefined
      return exception.values[0].stacktrace.frames;
    } catch (_oO) {
      return undefined;
    }
  }
  return undefined;
}

exports.Dedupe = Dedupe;
//# sourceMappingURL=dedupe.js.map
{"version":3,"file":"dedupe.js","sources":["../../../../src/integrations/dedupe.ts"],"sourcesContent":["import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** Deduplication filter */\nexport class Dedupe implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Dedupe';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Dedupe.id;\n\n  /**\n   * @inheritDoc\n   */\n  private _previousEvent?: Event;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const eventProcessor: EventProcessor = currentEvent => {\n      // We want to ignore any non-error type events, e.g. transactions or replays\n      // These should never be deduped, and also not be compared against as _previousEvent.\n      if (currentEvent.type) {\n        return currentEvent;\n      }\n\n      const self = getCurrentHub().getIntegration(Dedupe);\n      if (self) {\n        // Juuust in case something goes wrong\n        try {\n          if (_shouldDropEvent(currentEvent, self._previousEvent)) {\n            __DEBUG_BUILD__ && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n            return null;\n          }\n        } catch (_oO) {\n          return (self._previousEvent = currentEvent);\n        }\n\n        return (self._previousEvent = currentEvent);\n      }\n      return currentEvent;\n    };\n\n    eventProcessor.id = this.name;\n    addGlobalEventProcessor(eventProcessor);\n  }\n}\n\n/** JSDoc */\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n  if (!previousEvent) {\n    return false;\n  }\n\n  if (_isSameMessageEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  return false;\n}\n\n/** JSDoc */\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const currentMessage = currentEvent.message;\n  const previousMessage = previousEvent.message;\n\n  // If neither event has a message property, they were both exceptions, so bail out\n  if (!currentMessage && !previousMessage) {\n    return false;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n    return false;\n  }\n\n  if (currentMessage !== previousMessage) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const previousException = _getExceptionFromEvent(previousEvent);\n  const currentException = _getExceptionFromEvent(currentEvent);\n\n  if (!previousException || !currentException) {\n    return false;\n  }\n\n  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFrames = _getFramesFromEvent(currentEvent);\n  let previousFrames = _getFramesFromEvent(previousEvent);\n\n  // If neither event has a stacktrace, they are assumed to be the same\n  if (!currentFrames && !previousFrames) {\n    return true;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n    return false;\n  }\n\n  currentFrames = currentFrames as StackFrame[];\n  previousFrames = previousFrames as StackFrame[];\n\n  // If number of frames differ, they are not the same\n  if (previousFrames.length !== currentFrames.length) {\n    return false;\n  }\n\n  // Otherwise, compare the two\n  for (let i = 0; i < previousFrames.length; i++) {\n    const frameA = previousFrames[i];\n    const frameB = currentFrames[i];\n\n    if (\n      frameA.filename !== frameB.filename ||\n      frameA.lineno !== frameB.lineno ||\n      frameA.colno !== frameB.colno ||\n      frameA.function !== frameB.function\n    ) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFingerprint = currentEvent.fingerprint;\n  let previousFingerprint = previousEvent.fingerprint;\n\n  // If neither event has a fingerprint, they are assumed to be the same\n  if (!currentFingerprint && !previousFingerprint) {\n    return true;\n  }\n\n  // If only one event has a fingerprint, but not the other one, they are not the same\n  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n    return false;\n  }\n\n  currentFingerprint = currentFingerprint as string[];\n  previousFingerprint = previousFingerprint as string[];\n\n  // Otherwise, compare the two\n  try {\n    return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n  } catch (_oO) {\n    return false;\n  }\n}\n\n/** JSDoc */\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n  return event.exception && event.exception.values && event.exception.values[0];\n}\n\n/** JSDoc */\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n  const exception = event.exception;\n\n  if (exception) {\n    try {\n      // @ts-ignore Object could be undefined\n      return exception.values[0].stacktrace.frames;\n    } catch (_oO) {\n      return undefined;\n    }\n  }\n  return undefined;\n}\n"],"names":["logger"],"mappings":";;;;AAGA;AACA,MAAA,MAAA,EAAA,CAAA,WAAA,GAAA,EAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,MAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA,aAAA,EAAA;AACA,IAAA,MAAA,cAAA,GAAA,YAAA,IAAA;AACA;AACA;AACA,MAAA,IAAA,YAAA,CAAA,IAAA,EAAA;AACA,QAAA,OAAA,YAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,MAAA,IAAA,GAAA,aAAA,EAAA,CAAA,cAAA,CAAA,MAAA,CAAA,CAAA;AACA,MAAA,IAAA,IAAA,EAAA;AACA;AACA,QAAA,IAAA;AACA,UAAA,IAAA,gBAAA,CAAA,YAAA,EAAA,IAAA,CAAA,cAAA,CAAA,EAAA;AACA,YAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAA,YAAA,CAAA,IAAA,CAAA,sEAAA,CAAA,CAAA;AACA,YAAA,OAAA,IAAA,CAAA;AACA,WAAA;AACA,SAAA,CAAA,OAAA,GAAA,EAAA;AACA,UAAA,QAAA,IAAA,CAAA,cAAA,GAAA,YAAA,EAAA;AACA,SAAA;AACA;AACA,QAAA,QAAA,IAAA,CAAA,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AAA,GAAA,kBAAA,EAAA;AACA,EAAA,mBAAA,GAAA,mBAAA,EAAA;AACA;AACA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,CAAA,EAAA,kBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,KAAA,mBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,SAAA,CAAA,MAAA,IAAA,KAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,IAAA;AACA;AACA,MAAA,OAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA;AACA,KAAA,CAAA,OAAA,GAAA,EAAA;AACA,MAAA,OAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,SAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const eventbuilder = require('../eventbuilder.js');
const helpers = require('../helpers.js');

/* eslint-disable @typescript-eslint/no-unsafe-member-access */

/** Global handlers */
class GlobalHandlers  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'GlobalHandlers';}

  /**
   * @inheritDoc
   */
   __init() {this.name = GlobalHandlers.id;}

  /** JSDoc */

  /**
   * Stores references functions to installing handlers. Will set to undefined
   * after they have been run so that they are not used twice.
   */
   __init2() {this._installFunc = {
    onerror: _installGlobalOnErrorHandler,
    onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,
  };}

  /** JSDoc */
   constructor(options) {GlobalHandlers.prototype.__init.call(this);GlobalHandlers.prototype.__init2.call(this);
    this._options = {
      onerror: true,
      onunhandledrejection: true,
      ...options,
    };
  }
  /**
   * @inheritDoc
   */
   setupOnce() {
    Error.stackTraceLimit = 50;
    const options = this._options;

    // We can disable guard-for-in as we construct the options object above + do checks against
    // `this._installFunc` for the property.
    // eslint-disable-next-line guard-for-in
    for (const key in options) {
      const installFunc = this._installFunc[key ];
      if (installFunc && options[key ]) {
        globalHandlerLog(key);
        installFunc();
        this._installFunc[key ] = undefined;
      }
    }
  }
} GlobalHandlers.__initStatic();

/** JSDoc */
function _installGlobalOnErrorHandler() {
  utils.addInstrumentationHandler(
    'error',
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (data) => {
      const [hub, stackParser, attachStacktrace] = getHubAndOptions();
      if (!hub.getIntegration(GlobalHandlers)) {
        return;
      }
      const { msg, url, line, column, error } = data;
      if (helpers.shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {
        return;
      }

      const event =
        error === undefined && utils.isString(msg)
          ? _eventFromIncompleteOnError(msg, url, line, column)
          : _enhanceEventWithInitialFrame(
              eventbuilder.eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),
              url,
              line,
              column,
            );

      event.level = 'error';

      addMechanismAndCapture(hub, error, event, 'onerror');
    },
  );
}

/** JSDoc */
function _installGlobalOnUnhandledRejectionHandler() {
  utils.addInstrumentationHandler(
    'unhandledrejection',
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (e) => {
      const [hub, stackParser, attachStacktrace] = getHubAndOptions();
      if (!hub.getIntegration(GlobalHandlers)) {
        return;
      }
      let error = e;

      // dig the object of the rejection out of known event types
      try {
        // PromiseRejectionEvents store the object of the rejection under 'reason'
        // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
        if ('reason' in e) {
          error = e.reason;
        }
        // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents
        // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into
        // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec
        // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and
        // https://github.com/getsentry/sentry-javascript/issues/2380
        else if ('detail' in e && 'reason' in e.detail) {
          error = e.detail.reason;
        }
      } catch (_oO) {
        // no-empty
      }

      if (helpers.shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {
        return true;
      }

      const event = utils.isPrimitive(error)
        ? _eventFromRejectionWithPrimitive(error)
        : eventbuilder.eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);

      event.level = 'error';

      addMechanismAndCapture(hub, error, event, 'onunhandledrejection');
      return;
    },
  );
}

/**
 * Create an event from a promise rejection where the `reason` is a primitive.
 *
 * @param reason: The `reason` property of the promise rejection
 * @returns An Event object with an appropriate `exception` value
 */
function _eventFromRejectionWithPrimitive(reason) {
  return {
    exception: {
      values: [
        {
          type: 'UnhandledRejection',
          // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)
          value: `Non-Error promise rejection captured with value: ${String(reason)}`,
        },
      ],
    },
  };
}

/**
 * This function creates a stack from an old, error-less onerror handler.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _eventFromIncompleteOnError(msg, url, line, column) {
  const ERROR_TYPES_RE =
    /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;

  // If 'message' is ErrorEvent, get real message from inside
  let message = utils.isErrorEvent(msg) ? msg.message : msg;
  let name = 'Error';

  const groups = message.match(ERROR_TYPES_RE);
  if (groups) {
    name = groups[1];
    message = groups[2];
  }

  const event = {
    exception: {
      values: [
        {
          type: name,
          value: message,
        },
      ],
    },
  };

  return _enhanceEventWithInitialFrame(event, url, line, column);
}

/** JSDoc */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _enhanceEventWithInitialFrame(event, url, line, column) {
  // event.exception
  const e = (event.exception = event.exception || {});
  // event.exception.values
  const ev = (e.values = e.values || []);
  // event.exception.values[0]
  const ev0 = (ev[0] = ev[0] || {});
  // event.exception.values[0].stacktrace
  const ev0s = (ev0.stacktrace = ev0.stacktrace || {});
  // event.exception.values[0].stacktrace.frames
  const ev0sf = (ev0s.frames = ev0s.frames || []);

  const colno = isNaN(parseInt(column, 10)) ? undefined : column;
  const lineno = isNaN(parseInt(line, 10)) ? undefined : line;
  const filename = utils.isString(url) && url.length > 0 ? url : utils.getLocationHref();

  // event.exception.values[0].stacktrace.frames
  if (ev0sf.length === 0) {
    ev0sf.push({
      colno,
      filename,
      function: '?',
      in_app: true,
      lineno,
    });
  }

  return event;
}

function globalHandlerLog(type) {
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`Global Handler attached: ${type}`);
}

function addMechanismAndCapture(hub, error, event, type) {
  utils.addExceptionMechanism(event, {
    handled: false,
    type,
  });
  hub.captureEvent(event, {
    originalException: error,
  });
}

function getHubAndOptions() {
  const hub = core.getCurrentHub();
  const client = hub.getClient();
  const options = (client && client.getOptions()) || {
    stackParser: () => [],
    attachStacktrace: false,
  };
  return [hub, options.stackParser, options.attachStacktrace];
}

exports.GlobalHandlers = GlobalHandlers;
//# sourceMappingURL=globalhandlers.js.map
{"version":3,"file":"globalhandlers.js","sources":["../../../../src/integrations/globalhandlers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Hub, Integration, Primitive, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addInstrumentationHandler,\n  getLocationHref,\n  isErrorEvent,\n  isPrimitive,\n  isString,\n  logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\n/** JSDoc */\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GlobalHandlers';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = GlobalHandlers.id;\n\n  /** JSDoc */\n  private readonly _options: GlobalHandlersIntegrations;\n\n  /**\n   * Stores references functions to installing handlers. Will set to undefined\n   * after they have been run so that they are not used twice.\n   */\n  private _installFunc: Record<GlobalHandlersIntegrationsOptionKeys, (() => void) | undefined> = {\n    onerror: _installGlobalOnErrorHandler,\n    onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,\n  };\n\n  /** JSDoc */\n  public constructor(options?: GlobalHandlersIntegrations) {\n    this._options = {\n      onerror: true,\n      onunhandledrejection: true,\n      ...options,\n    };\n  }\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    Error.stackTraceLimit = 50;\n    const options = this._options;\n\n    // We can disable guard-for-in as we construct the options object above + do checks against\n    // `this._installFunc` for the property.\n    // eslint-disable-next-line guard-for-in\n    for (const key in options) {\n      const installFunc = this._installFunc[key as GlobalHandlersIntegrationsOptionKeys];\n      if (installFunc && options[key as GlobalHandlersIntegrationsOptionKeys]) {\n        globalHandlerLog(key);\n        installFunc();\n        this._installFunc[key as GlobalHandlersIntegrationsOptionKeys] = undefined;\n      }\n    }\n  }\n}\n\n/** JSDoc */\nfunction _installGlobalOnErrorHandler(): void {\n  addInstrumentationHandler(\n    'error',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      const { msg, url, line, column, error } = data;\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return;\n      }\n\n      const event =\n        error === undefined && isString(msg)\n          ? _eventFromIncompleteOnError(msg, url, line, column)\n          : _enhanceEventWithInitialFrame(\n              eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n              url,\n              line,\n              column,\n            );\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onerror');\n    },\n  );\n}\n\n/** JSDoc */\nfunction _installGlobalOnUnhandledRejectionHandler(): void {\n  addInstrumentationHandler(\n    'unhandledrejection',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (e: any) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      let error = e;\n\n      // dig the object of the rejection out of known event types\n      try {\n        // PromiseRejectionEvents store the object of the rejection under 'reason'\n        // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n        if ('reason' in e) {\n          error = e.reason;\n        }\n        // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n        // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n        // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n        // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n        // https://github.com/getsentry/sentry-javascript/issues/2380\n        else if ('detail' in e && 'reason' in e.detail) {\n          error = e.detail.reason;\n        }\n      } catch (_oO) {\n        // no-empty\n      }\n\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return true;\n      }\n\n      const event = isPrimitive(error)\n        ? _eventFromRejectionWithPrimitive(error)\n        : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onunhandledrejection');\n      return;\n    },\n  );\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n  return {\n    exception: {\n      values: [\n        {\n          type: 'UnhandledRejection',\n          // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n          value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n        },\n      ],\n    },\n  };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n  const ERROR_TYPES_RE =\n    /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n  // If 'message' is ErrorEvent, get real message from inside\n  let message = isErrorEvent(msg) ? msg.message : msg;\n  let name = 'Error';\n\n  const groups = message.match(ERROR_TYPES_RE);\n  if (groups) {\n    name = groups[1];\n    message = groups[2];\n  }\n\n  const event = {\n    exception: {\n      values: [\n        {\n          type: name,\n          value: message,\n        },\n      ],\n    },\n  };\n\n  return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n  // event.exception\n  const e = (event.exception = event.exception || {});\n  // event.exception.values\n  const ev = (e.values = e.values || []);\n  // event.exception.values[0]\n  const ev0 = (ev[0] = ev[0] || {});\n  // event.exception.values[0].stacktrace\n  const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n  // event.exception.values[0].stacktrace.frames\n  const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n  const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n  const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n  const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n  // event.exception.values[0].stacktrace.frames\n  if (ev0sf.length === 0) {\n    ev0sf.push({\n      colno,\n      filename,\n      function: '?',\n      in_app: true,\n      lineno,\n    });\n  }\n\n  return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n  __DEBUG_BUILD__ && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction addMechanismAndCapture(hub: Hub, error: EventHint['originalException'], event: Event, type: string): void {\n  addExceptionMechanism(event, {\n    handled: false,\n    type,\n  });\n  hub.captureEvent(event, {\n    originalException: error,\n  });\n}\n\nfunction getHubAndOptions(): [Hub, StackParser, boolean | undefined] {\n  const hub = getCurrentHub();\n  const client = hub.getClient<BrowserClient>();\n  const options = (client && client.getOptions()) || {\n    stackParser: () => [],\n    attachStacktrace: false,\n  };\n  return [hub, options.stackParser, options.attachStacktrace];\n}\n"],"names":["addInstrumentationHandler","shouldIgnoreOnError","isString","eventFromUnknownInput","isPrimitive","isErrorEvent","getLocationHref","logger","addExceptionMechanism","getCurrentHub"],"mappings":";;;;;;;AAAA;;AAsBA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,cAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,YAAA,GAAA;AACA,IAAA,OAAA,EAAA,4BAAA;AACA,IAAA,oBAAA,EAAA,yCAAA;AACA,IAAA,CAAA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,EAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,cAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,OAAA,EAAA,IAAA;AACA,MAAA,oBAAA,EAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,KAAA,CAAA,eAAA,GAAA,EAAA,CAAA;AACA,IAAA,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A,MAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,gBAAA,CAAA,IAAA,EAAA;AACA,EAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAC,YAAA,CAAA,GAAA,CAAA,CAAA,yBAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,sBAAA,CAAA,GAAA,EAAA,KAAA,EAAA,KAAA,EAAA,IAAA,EAAA;AACA,EAAAC,2BAAA,CAAA,KAAA,EAAA;AACA,IAAA,OAAA,EAAA,KAAA;AACA,IAAA,IAAA;AACA,GAAA,CAAA,CAAA;AACA,EAAA,GAAA,CAAA,YAAA,CAAA,KAAA,EAAA;AACA,IAAA,iBAAA,EAAA,KAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,gBAAA,GAAA;AACA,EAAA,MAAA,GAAA,GAAAC,kBAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,CAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA,KAAA;AACA,IAAA,WAAA,EAAA,MAAA,EAAA;AACA,IAAA,gBAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,EAAA,OAAA,CAAA,WAAA,EAAA,OAAA,CAAA,gBAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const helpers = require('../helpers.js');

/** HttpContext integration collects information about HTTP request headers */
class HttpContext  {constructor() { HttpContext.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'HttpContext';}

  /**
   * @inheritDoc
   */
   __init() {this.name = HttpContext.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    core.addGlobalEventProcessor((event) => {
      if (core.getCurrentHub().getIntegration(HttpContext)) {
        // if none of the information we want exists, don't bother
        if (!helpers.WINDOW.navigator && !helpers.WINDOW.location && !helpers.WINDOW.document) {
          return event;
        }

        // grab as much info as exists and add it to the event
        const url = (event.request && event.request.url) || (helpers.WINDOW.location && helpers.WINDOW.location.href);
        const { referrer } = helpers.WINDOW.document || {};
        const { userAgent } = helpers.WINDOW.navigator || {};

        const headers = {
          ...(event.request && event.request.headers),
          ...(referrer && { Referer: referrer }),
          ...(userAgent && { 'User-Agent': userAgent }),
        };
        const request = { ...event.request, ...(url && { url }), headers };

        return { ...event, request };
      }
      return event;
    });
  }
} HttpContext.__initStatic();

exports.HttpContext = HttpContext;
//# sourceMappingURL=httpcontext.js.map
{"version":3,"file":"httpcontext.js","sources":["../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, Integration } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\n/** HttpContext integration collects information about HTTP request headers */\nexport class HttpContext implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'HttpContext';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = HttpContext.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor((event: Event) => {\n      if (getCurrentHub().getIntegration(HttpContext)) {\n        // if none of the information we want exists, don't bother\n        if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n          return event;\n        }\n\n        // grab as much info as exists and add it to the event\n        const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n        const { referrer } = WINDOW.document || {};\n        const { userAgent } = WINDOW.navigator || {};\n\n        const headers = {\n          ...(event.request && event.request.headers),\n          ...(referrer && { Referer: referrer }),\n          ...(userAgent && { 'User-Agent': userAgent }),\n        };\n        const request = { ...event.request, ...(url && { url }), headers };\n\n        return { ...event, request };\n      }\n      return event;\n    });\n  }\n}\n"],"names":["addGlobalEventProc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AA;AACA,QAAA,MAAA,OAAA,GAAA,EAAA,GAAA,KAAA,CAAA,OAAA,EAAA,IAAA,GAAA,IAAA,EAAA,GAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA;AACA;AACA,QAAA,OAAA,EAAA,GAAA,KAAA,EAAA,OAAA,EAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA,KAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,WAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const globalhandlers = require('./globalhandlers.js');
const trycatch = require('./trycatch.js');
const breadcrumbs = require('./breadcrumbs.js');
const linkederrors = require('./linkederrors.js');
const httpcontext = require('./httpcontext.js');
const dedupe = require('./dedupe.js');



exports.GlobalHandlers = globalhandlers.GlobalHandlers;
exports.TryCatch = trycatch.TryCatch;
exports.Breadcrumbs = breadcrumbs.Breadcrumbs;
exports.LinkedErrors = linkederrors.LinkedErrors;
exports.HttpContext = httpcontext.HttpContext;
exports.Dedupe = dedupe.Dedupe;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const eventbuilder = require('../eventbuilder.js');

const DEFAULT_KEY = 'cause';
const DEFAULT_LIMIT = 5;

/** Adds SDK info to an event. */
class LinkedErrors  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'LinkedErrors';}

  /**
   * @inheritDoc
   */
    __init() {this.name = LinkedErrors.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {LinkedErrors.prototype.__init.call(this);
    this._key = options.key || DEFAULT_KEY;
    this._limit = options.limit || DEFAULT_LIMIT;
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    const client = core.getCurrentHub().getClient();
    if (!client) {
      return;
    }
    core.addGlobalEventProcessor((event, hint) => {
      const self = core.getCurrentHub().getIntegration(LinkedErrors);
      return self ? _handler(client.getOptions().stackParser, self._key, self._limit, event, hint) : event;
    });
  }
} LinkedErrors.__initStatic();

/**
 * @inheritDoc
 */
function _handler(
  parser,
  key,
  limit,
  event,
  hint,
) {
  if (!event.exception || !event.exception.values || !hint || !utils.isInstanceOf(hint.originalException, Error)) {
    return event;
  }
  const linkedErrors = _walkErrorTree(parser, limit, hint.originalException , key);
  event.exception.values = [...linkedErrors, ...event.exception.values];
  return event;
}

/**
 * JSDOC
 */
function _walkErrorTree(
  parser,
  limit,
  error,
  key,
  stack = [],
) {
  if (!utils.isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {
    return stack;
  }
  const exception = eventbuilder.exceptionFromError(parser, error[key]);
  return _walkErrorTree(parser, limit, error[key], key, [exception, ...stack]);
}

exports.LinkedErrors = LinkedErrors;
exports._handler = _handler;
exports._walkErrorTree = _walkErrorTree;
//# sourceMappingURL=linkederrors.js.map
{"version":3,"file":"linkederrors.js","sources":["../../../../src/integrations/linkederrors.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { exceptionFromError } from '../eventbuilder';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n  key: string;\n  limit: number;\n}\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = LinkedErrors.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: LinkedErrorsOptions['key'];\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: LinkedErrorsOptions['limit'];\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: Partial<LinkedErrorsOptions> = {}) {\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    const client = getCurrentHub().getClient<BrowserClient>();\n    if (!client) {\n      return;\n    }\n    addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n      const self = getCurrentHub().getIntegration(LinkedErrors);\n      return self ? _handler(client.getOptions().stackParser, self._key, self._limit, event, hint) : event;\n    });\n  }\n}\n\n/**\n * @inheritDoc\n */\nexport function _handler(\n  parser: StackParser,\n  key: string,\n  limit: number,\n  event: Event,\n  hint?: EventHint,\n): Event | null {\n  if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n    return event;\n  }\n  const linkedErrors = _walkErrorTree(parser, limit, hint.originalException as ExtendedError, key);\n  event.exception.values = [...linkedErrors, ...event.exception.values];\n  return event;\n}\n\n/**\n * JSDOC\n */\nexport function _walkErrorTree(\n  parser: StackParser,\n  limit: number,\n  error: ExtendedError,\n  key: string,\n  stack: Exception[] = [],\n): Exception[] {\n  if (!isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {\n    return stack;\n  }\n  const exception = exceptionFromError(parser, error[key]);\n  return _walkErrorTree(parser, limit, error[key], key, [exception, ...stack]);\n}\n"],"names":["getCurrentHub","addGlobalEventProcessor","isInstanceOf","exceptionFromError"],"mappings":";;;;;;AAOA,MAAA,WAAA,GAAA,OAAA,CAAA;AACA,MAAA,aAAA,GAAA,CAAA,CAAA;;AAOA;AACA,MAAA,YAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,eAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,YAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AA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A,EAAA,KAAA,EAAA,IAAA,CAAA,iBAAA,GAAA,GAAA,CAAA,CAAA;AACA,EAAA,KAAA,CAAA,SAAA,CAAA,MAAA,GAAA,CAAA,GAAA,YAAA,EAAA,GAAA,KAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA;AACA,EAAA,MAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,GAAA;AACA,EAAA,KAAA,GAAA,EAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAAA,kBAAA,CAAA,KAAA,CAAA,GAAA,CAAA,EAAA,KAAA,CAAA,IAAA,KAAA,CAAA,MAAA,GAAA,CAAA,IAAA,KAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,EAAA,MAAA,SAAA,GAAAC,+BAAA,CAAA,MAAA,EAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACA,EAAA,OAAA,cAAA,CAAA,MAAA,EAAA,KAAA,EAAA,KAAA,CAAA,GAAA,CAAA,EAAA,GAAA,EAAA,CAAA,SAAA,EAAA,GAAA,KAAA,CAAA,CAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const helpers = require('../helpers.js');

const DEFAULT_EVENT_TARGET = [
  'EventTarget',
  'Window',
  'Node',
  'ApplicationCache',
  'AudioTrackList',
  'ChannelMergerNode',
  'CryptoOperation',
  'EventSource',
  'FileReader',
  'HTMLUnknownElement',
  'IDBDatabase',
  'IDBRequest',
  'IDBTransaction',
  'KeyOperation',
  'MediaController',
  'MessagePort',
  'ModalWindow',
  'Notification',
  'SVGElementInstance',
  'Screen',
  'TextTrack',
  'TextTrackCue',
  'TextTrackList',
  'WebSocket',
  'WebSocketWorker',
  'Worker',
  'XMLHttpRequest',
  'XMLHttpRequestEventTarget',
  'XMLHttpRequestUpload',
];

/** Wrap timer functions and event targets to catch errors and provide better meta data */
class TryCatch  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'TryCatch';}

  /**
   * @inheritDoc
   */
   __init() {this.name = TryCatch.id;}

  /** JSDoc */

  /**
   * @inheritDoc
   */
   constructor(options) {TryCatch.prototype.__init.call(this);
    this._options = {
      XMLHttpRequest: true,
      eventTarget: true,
      requestAnimationFrame: true,
      setInterval: true,
      setTimeout: true,
      ...options,
    };
  }

  /**
   * Wrap timer functions and event targets to catch errors
   * and provide better metadata.
   */
   setupOnce() {
    if (this._options.setTimeout) {
      utils.fill(helpers.WINDOW, 'setTimeout', _wrapTimeFunction);
    }

    if (this._options.setInterval) {
      utils.fill(helpers.WINDOW, 'setInterval', _wrapTimeFunction);
    }

    if (this._options.requestAnimationFrame) {
      utils.fill(helpers.WINDOW, 'requestAnimationFrame', _wrapRAF);
    }

    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in helpers.WINDOW) {
      utils.fill(XMLHttpRequest.prototype, 'send', _wrapXHR);
    }

    const eventTargetOption = this._options.eventTarget;
    if (eventTargetOption) {
      const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
      eventTarget.forEach(_wrapEventTarget);
    }
  }
} TryCatch.__initStatic();

/** JSDoc */
function _wrapTimeFunction(original) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( ...args) {
    const originalCallback = args[0];
    args[0] = helpers.wrap(originalCallback, {
      mechanism: {
        data: { function: utils.getFunctionName(original) },
        handled: true,
        type: 'instrument',
      },
    });
    return original.apply(this, args);
  };
}

/** JSDoc */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _wrapRAF(original) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( callback) {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    return original.apply(this, [
      helpers.wrap(callback, {
        mechanism: {
          data: {
            function: 'requestAnimationFrame',
            handler: utils.getFunctionName(original),
          },
          handled: true,
          type: 'instrument',
        },
      }),
    ]);
  };
}

/** JSDoc */
function _wrapXHR(originalSend) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( ...args) {
    // eslint-disable-next-line @typescript-eslint/no-this-alias
    const xhr = this;
    const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];

    xmlHttpRequestProps.forEach(prop => {
      if (prop in xhr && typeof xhr[prop] === 'function') {
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        utils.fill(xhr, prop, function (original) {
          const wrapOptions = {
            mechanism: {
              data: {
                function: prop,
                handler: utils.getFunctionName(original),
              },
              handled: true,
              type: 'instrument',
            },
          };

          // If Instrument integration has been called before TryCatch, get the name of original function
          const originalFunction = utils.getOriginalFunction(original);
          if (originalFunction) {
            wrapOptions.mechanism.data.handler = utils.getFunctionName(originalFunction);
          }

          // Otherwise wrap directly
          return helpers.wrap(original, wrapOptions);
        });
      }
    });

    return originalSend.apply(this, args);
  };
}

/** JSDoc */
function _wrapEventTarget(target) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const globalObject = helpers.WINDOW ;
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  const proto = globalObject[target] && globalObject[target].prototype;

  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
    return;
  }

  utils.fill(proto, 'addEventListener', function (original)

 {
    return function (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any

      eventName,
      fn,
      options,
    ) {
      try {
        if (typeof fn.handleEvent === 'function') {
          // ESlint disable explanation:
          //  First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would
          //  introduce a bug here, because bind returns a new function that doesn't have our
          //  flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.
          //  Without those flags, every call to addEventListener wraps the function again, causing a memory leak.
          // eslint-disable-next-line @typescript-eslint/unbound-method
          fn.handleEvent = helpers.wrap(fn.handleEvent, {
            mechanism: {
              data: {
                function: 'handleEvent',
                handler: utils.getFunctionName(fn),
                target,
              },
              handled: true,
              type: 'instrument',
            },
          });
        }
      } catch (err) {
        // can sometimes get 'Permission denied to access property "handle Event'
      }

      return original.apply(this, [
        eventName,
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        helpers.wrap(fn , {
          mechanism: {
            data: {
              function: 'addEventListener',
              handler: utils.getFunctionName(fn),
              target,
            },
            handled: true,
            type: 'instrument',
          },
        }),
        options,
      ]);
    };
  });

  utils.fill(
    proto,
    'removeEventListener',
    function (
      originalRemoveEventListener,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
    ) {
      return function (
        // eslint-disable-next-line @typescript-eslint/no-explicit-any

        eventName,
        fn,
        options,
      ) {
        /**
         * There are 2 possible scenarios here:
         *
         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
         * as a pass-through, and call original `removeEventListener` with it.
         *
         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.
         * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
         * in order for us to make a distinction between wrapped/non-wrapped functions possible.
         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
         *
         * When someone adds a handler prior to initialization, and then do it again, but after,
         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
         * to get rid of the initial handler and it'd stick there forever.
         */
        const wrappedEventHandler = fn ;
        try {
          const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;
          if (originalEventHandler) {
            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
          }
        } catch (e) {
          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
        }
        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);
      };
    },
  );
}

exports.TryCatch = TryCatch;
//# sourceMappingURL=trycatch.js.map
{"version":3,"file":"trycatch.js","sources":["../../../../src/integrations/trycatch.ts"],"sourcesContent":["import type { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n  'EventTarget',\n  'Window',\n  'Node',\n  'ApplicationCache',\n  'AudioTrackList',\n  'ChannelMergerNode',\n  'CryptoOperation',\n  'EventSource',\n  'FileReader',\n  'HTMLUnknownElement',\n  'IDBDatabase',\n  'IDBRequest',\n  'IDBTransaction',\n  'KeyOperation',\n  'MediaController',\n  'MessagePort',\n  'ModalWindow',\n  'Notification',\n  'SVGElementInstance',\n  'Screen',\n  'TextTrack',\n  'TextTrackCue',\n  'TextTrackList',\n  'WebSocket',\n  'WebSocketWorker',\n  'Worker',\n  'XMLHttpRequest',\n  'XMLHttpRequestEventTarget',\n  'XMLHttpRequestUpload',\n];\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** JSDoc */\ninterface TryCatchOptions {\n  setTimeout: boolean;\n  setInterval: boolean;\n  requestAnimationFrame: boolean;\n  XMLHttpRequest: boolean;\n  eventTarget: boolean | string[];\n}\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'TryCatch';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = TryCatch.id;\n\n  /** JSDoc */\n  private readonly _options: TryCatchOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<TryCatchOptions>) {\n    this._options = {\n      XMLHttpRequest: true,\n      eventTarget: true,\n      requestAnimationFrame: true,\n      setInterval: true,\n      setTimeout: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Wrap timer functions and event targets to catch errors\n   * and provide better metadata.\n   */\n  public setupOnce(): void {\n    if (this._options.setTimeout) {\n      fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n    }\n\n    if (this._options.setInterval) {\n      fill(WINDOW, 'setInterval', _wrapTimeFunction);\n    }\n\n    if (this._options.requestAnimationFrame) {\n      fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n    }\n\n    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n      fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n    }\n\n    const eventTargetOption = this._options.eventTarget;\n    if (eventTargetOption) {\n      const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n      eventTarget.forEach(_wrapEventTarget);\n    }\n  }\n}\n\n/** JSDoc */\nfunction _wrapTimeFunction(original: () => void): () => number {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, ...args: any[]): number {\n    const originalCallback = args[0];\n    args[0] = wrap(originalCallback, {\n      mechanism: {\n        data: { function: getFunctionName(original) },\n        handled: true,\n        type: 'instrument',\n      },\n    });\n    return original.apply(this, args);\n  };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, callback: () => void): () => void {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return original.apply(this, [\n      wrap(callback, {\n        mechanism: {\n          data: {\n            function: 'requestAnimationFrame',\n            handler: getFunctionName(original),\n          },\n          handled: true,\n          type: 'instrument',\n        },\n      }),\n    ]);\n  };\n}\n\n/** JSDoc */\nfunction _wrapXHR(originalSend: () => void): () => void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: XMLHttpRequest, ...args: any[]): void {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const xhr = this;\n    const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n    xmlHttpRequestProps.forEach(prop => {\n      if (prop in xhr && typeof xhr[prop] === 'function') {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        fill(xhr, prop, function (original: WrappedFunction): () => any {\n          const wrapOptions = {\n            mechanism: {\n              data: {\n                function: prop,\n                handler: getFunctionName(original),\n              },\n              handled: true,\n              type: 'instrument',\n            },\n          };\n\n          // If Instrument integration has been called before TryCatch, get the name of original function\n          const originalFunction = getOriginalFunction(original);\n          if (originalFunction) {\n            wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n          }\n\n          // Otherwise wrap directly\n          return wrap(original, wrapOptions);\n        });\n      }\n    });\n\n    return originalSend.apply(this, args);\n  };\n}\n\n/** JSDoc */\nfunction _wrapEventTarget(target: string): void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const globalObject = WINDOW as { [key: string]: any };\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  const proto = globalObject[target] && globalObject[target].prototype;\n\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n    return;\n  }\n\n  fill(proto, 'addEventListener', function (original: () => void): (\n    eventName: string,\n    fn: EventListenerObject,\n    options?: boolean | AddEventListenerOptions,\n  ) => void {\n    return function (\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this: any,\n      eventName: string,\n      fn: EventListenerObject,\n      options?: boolean | AddEventListenerOptions,\n    ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n      try {\n        if (typeof fn.handleEvent === 'function') {\n          // ESlint disable explanation:\n          //  First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n          //  introduce a bug here, because bind returns a new function that doesn't have our\n          //  flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n          //  Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n          // eslint-disable-next-line @typescript-eslint/unbound-method\n          fn.handleEvent = wrap(fn.handleEvent, {\n            mechanism: {\n              data: {\n                function: 'handleEvent',\n                handler: getFunctionName(fn),\n                target,\n              },\n              handled: true,\n              type: 'instrument',\n            },\n          });\n        }\n      } catch (err) {\n        // can sometimes get 'Permission denied to access property \"handle Event'\n      }\n\n      return original.apply(this, [\n        eventName,\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        wrap(fn as any as WrappedFunction, {\n          mechanism: {\n            data: {\n              function: 'addEventListener',\n              handler: getFunctionName(fn),\n              target,\n            },\n            handled: true,\n            type: 'instrument',\n          },\n        }),\n        options,\n      ]);\n    };\n  });\n\n  fill(\n    proto,\n    'removeEventListener',\n    function (\n      originalRemoveEventListener: () => void,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n      return function (\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this: any,\n        eventName: string,\n        fn: EventListenerObject,\n        options?: boolean | EventListenerOptions,\n      ): () => void {\n        /**\n         * There are 2 possible scenarios here:\n         *\n         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n         * as a pass-through, and call original `removeEventListener` with it.\n         *\n         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n         * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n         * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n         *\n         * When someone adds a handler prior to initialization, and then do it again, but after,\n         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n         * to get rid of the initial handler and it'd stick there forever.\n         */\n        const wrappedEventHandler = fn as unknown as WrappedFunction;\n        try {\n          const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n          if (originalEventHandler) {\n            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n          }\n        } catch (e) {\n          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n        }\n        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n      };\n    },\n  );\n}\n"],"names":["fill","WINDOW","wrap","getFunctionName","getOriginalFunction"],"mappings":";;;;;AAKA,MAAA,oBAAA,GAAA;AACA,EAAA,aAAA;AACA,EAAA,QAAA;AACA,EAAA,MAAA;AACA,EAAA,kBAAA;AACA,EAAA,gBAAA;AACA,EAAA,mBAAA;AACA,EAAA,iBAAA;AACA,EAAA,aAAA;AACA,EAAA,YAAA;AACA,EAAA,oBAAA;AACA,EAAA,aAAA;AACA,EAAA,YAAA;AACA,EAAA,gBAAA;AACA,EAAA,cAAA;AACA,EAAA,iBAAA;AACA,EAAA,aAAA;AACA,EAAA,aAAA;AACA,EAAA,cAAA;AACA,EAAA,oBAAA;AACA,EAAA,QAAA;AACA,EAAA,WAAA;AACA,EAAA,cAAA;AACA,EAAA,eAAA;AACA,EAAA,WAAA;AACA,EAAA,iBAAA;AACA,EAAA,QAAA;AACA,EAAA,gBAAA;AACA,EAAA,2BAAA;AACA,EAAA,sBAAA;AACA,CAAA,CAAA;;AAaA;AACA,MAAA,QAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,WAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,QAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,EAAA,CAAA,QAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,cAAA,EAAA,IAAA;AACA,MAAA,WAAA,EAAA,IAAA;AACA,MAAA,qBAAA,EAAA,IAAA;AACA,MA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A,mBAAA,IAAA,mBAAA,CAAA,kBAAA,CAAA;AACA,UAAA,IAAA,oBAAA,EAAA;AACA,YAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,oBAAA,EAAA,OAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,SAAA;AACA,QAAA,OAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,OAAA,CAAA,CAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Creates a cache that evicts keys in fifo order
 * @param size {Number}
 */
function makeProfilingCache(
  size,
)

 {
  // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it.
  let evictionOrder = [];
  let cache = {};

  return {
    add(key, value) {
      while (evictionOrder.length >= size) {
        // shift is O(n) but this is small size and only happens if we are
        // exceeding the cache size so it should be fine.
        const evictCandidate = evictionOrder.shift();

        if (evictCandidate !== undefined) {
          // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
          delete cache[evictCandidate];
        }
      }

      // in case we have a collision, delete the old key.
      if (cache[key]) {
        this.delete(key);
      }

      evictionOrder.push(key);
      cache[key] = value;
    },
    clear() {
      cache = {};
      evictionOrder = [];
    },
    get(key) {
      return cache[key];
    },
    size() {
      return evictionOrder.length;
    },
    // Delete cache key and return true if it existed, false otherwise.
    delete(key) {
      if (!cache[key]) {
        return false;
      }

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete cache[key];

      for (let i = 0; i < evictionOrder.length; i++) {
        if (evictionOrder[i] === key) {
          evictionOrder.splice(i, 1);
          break;
        }
      }

      return true;
    },
  };
}

const PROFILING_EVENT_CACHE = makeProfilingCache(20);

exports.PROFILING_EVENT_CACHE = PROFILING_EVENT_CACHE;
exports.makeProfilingCache = makeProfilingCache;
//# sourceMappingURL=cache.js.map
{"version":3,"file":"cache.js","sources":["../../../../src/profiling/cache.ts"],"sourcesContent":["import type { Event } from '@sentry/types';\n\n/**\n * Creates a cache that evicts keys in fifo order\n * @param size {Number}\n */\nexport function makeProfilingCache<Key extends string, Value extends Event>(\n  size: number,\n): {\n  get: (key: Key) => Value | undefined;\n  add: (key: Key, value: Value) => void;\n  delete: (key: Key) => boolean;\n  clear: () => void;\n  size: () => number;\n} {\n  // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it.\n  let evictionOrder: Key[] = [];\n  let cache: Record<string, Value> = {};\n\n  return {\n    add(key: Key, value: Value) {\n      while (evictionOrder.length >= size) {\n        // shift is O(n) but this is small size and only happens if we are\n        // exceeding the cache size so it should be fine.\n        const evictCandidate = evictionOrder.shift();\n\n        if (evictCandidate !== undefined) {\n          // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n          delete cache[evictCandidate];\n        }\n      }\n\n      // in case we have a collision, delete the old key.\n      if (cache[key]) {\n        this.delete(key);\n      }\n\n      evictionOrder.push(key);\n      cache[key] = value;\n    },\n    clear() {\n      cache = {};\n      evictionOrder = [];\n    },\n    get(key: Key): Value | undefined {\n      return cache[key];\n    },\n    size() {\n      return evictionOrder.length;\n    },\n    // Delete cache key and return true if it existed, false otherwise.\n    delete(key: Key): boolean {\n      if (!cache[key]) {\n        return false;\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete cache[key];\n\n      for (let i = 0; i < evictionOrder.length; i++) {\n        if (evictionOrder[i] === key) {\n          evictionOrder.splice(i, 1);\n          break;\n        }\n      }\n\n      return true;\n    },\n  };\n}\n\nexport const PROFILING_EVENT_CACHE = makeProfilingCache<string, Event>(20);\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA,SAAA,kBAAA;AACA,EAAA,IAAA;AACA;;AAMA,CAAA;AACA;AACA,EAAA,IAAA,aAAA,GAAA,EAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,EAAA,CAAA;AACA;AACA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AACA,UAAA,MAAA;AACA,SAAA;AACA,OAAA;AACA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,qBAAA,GAAA,kBAAA,CAAA,EAAA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const helpers = require('../helpers.js');
const sendProfile = require('./sendProfile.js');

// Max profile duration.
const MAX_PROFILE_DURATION_MS = 30000;
// Keep a flag value to avoid re-initializing the profiler constructor. If it fails
// once, it will always fail and this allows us to early return.
let PROFILING_CONSTRUCTOR_FAILED = false;

// While we experiment, per transaction sampling interval will be more flexible to work with.

/**
 * Check if profiler constructor is available.
 * @param maybeProfiler
 */
function isJSProfilerSupported(maybeProfiler) {
  return typeof maybeProfiler === 'function';
}

/**
 * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -
 * if that happens we want to avoid throwing an error from profiling code.
 * see https://github.com/getsentry/sentry-javascript/issues/4731.
 *
 * @experimental
 */
function onProfilingStartRouteTransaction(transaction) {
  if (!transaction) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Transaction is undefined, skipping profiling');
    }
    return transaction;
  }

  return wrapTransactionWithProfiling(transaction);
}

/**
 * Wraps startTransaction and stopTransaction with profiling related logic.
 * startProfiling is called after the call to startTransaction in order to avoid our own code from
 * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
 */
function wrapTransactionWithProfiling(transaction) {
  // Feature support check first
  const JSProfilerConstructor = helpers.WINDOW.Profiler;

  if (!isJSProfilerSupported(JSProfilerConstructor)) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.',
      );
    }
    return transaction;
  }

  // profilesSampleRate is multiplied with tracesSampleRate to get the final sampling rate.
  if (!transaction.sampled) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Transaction is not sampled, skipping profiling');
    }
    return transaction;
  }

  // If constructor failed once, it will always fail, so we can early return.
  if (PROFILING_CONSTRUCTOR_FAILED) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.');
    }
    return transaction;
  }

  const client = core.getCurrentHub().getClient();
  const options = client && client.getOptions();

  // @ts-ignore not part of the browser options yet
  const profilesSampleRate = (options && options.profilesSampleRate) || 0;
  if (profilesSampleRate === undefined) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');
    }
    return transaction;
  }

  // Check if we should sample this profile
  if (Math.random() > profilesSampleRate) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Skip profiling transaction due to sampling.');
    }
    return transaction;
  }

  // From initial testing, it seems that the minimum value for sampleInterval is 10ms.
  const samplingIntervalMS = 10;
  // Start the profiler
  const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);
  let profiler;

  // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.
  // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens
  // as we risk breaking the user's application, so just disable profiling and log an error.
  try {
    profiler = new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });
  } catch (e) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        "[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.",
      );
      utils.logger.log('[Profiling] Disabling profiling for current user session.');
    }
    PROFILING_CONSTRUCTOR_FAILED = true;
  }

  // We failed to construct the profiler, fallback to original transaction - there is no need to log
  // anything as we already did that in the try/catch block.
  if (!profiler) {
    return transaction;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    utils.logger.log(`[Profiling] started profiling transaction: ${transaction.name || transaction.description}`);
  }

  // We create "unique" transaction names to avoid concurrent transactions with same names
  // from being ignored by the profiler. From here on, only this transaction name should be used when
  // calling the profiler methods. Note: we log the original name to the user to avoid confusion.
  const profileId = utils.uuid4();

  // A couple of important things to note here:
  // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.
  // Whichever of the two (transaction.finish/timeout) is first to run, the profiling will be stopped and the gathered profile
  // will be processed when the original transaction is finished. Since onProfileHandler can be invoked multiple times in the
  // event of an error or user mistake (calling transaction.finish multiple times), it is important that the behavior of onProfileHandler
  // is idempotent as we do not want any timings or profiles to be overriden by the last call to onProfileHandler.
  // After the original finish method is called, the event will be reported through the integration and delegated to transport.
  let processedProfile = null;

  /**
   * Idempotent handler for profile stop
   */
  function onProfileHandler() {
    // Check if the profile exists and return it the behavior has to be idempotent as users may call transaction.finish multiple times.
    if (!transaction) {
      return;
    }
    // Satisfy the type checker, but profiler will always be defined here.
    if (!profiler) {
      return;
    }
    if (processedProfile) {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        utils.logger.log(
          '[Profiling] profile for:',
          transaction.name || transaction.description,
          'already exists, returning early',
        );
      }
      return;
    }

    profiler
      .stop()
      .then((p) => {
        if (maxDurationTimeoutID) {
          helpers.WINDOW.clearTimeout(maxDurationTimeoutID);
          maxDurationTimeoutID = undefined;
        }

        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          utils.logger.log(`[Profiling] stopped profiling of transaction: ${transaction.name || transaction.description}`);
        }

        // In case of an overlapping transaction, stopProfiling may return null and silently ignore the overlapping profile.
        if (!p) {
          if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
            utils.logger.log(
              `[Profiling] profiler returned null profile for: ${transaction.name || transaction.description}`,
              'this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started',
            );
          }
          return;
        }

        // If a profile has less than 2 samples, it is not useful and should be discarded.
        if (p.samples.length < 2) {
          return;
        }

        processedProfile = { ...p, profile_id: profileId };
        sendProfile.sendProfile(profileId, processedProfile);
      })
      .catch(error => {
        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          utils.logger.log('[Profiling] error while stopping profiler:', error);
        }
        return null;
      });
  }

  // Enqueue a timeout to prevent profiles from running over max duration.
  let maxDurationTimeoutID = helpers.WINDOW.setTimeout(() => {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] max profile duration elapsed, stopping profiling for:',
        transaction.name || transaction.description,
      );
    }
    void onProfileHandler();
  }, MAX_PROFILE_DURATION_MS);

  // We need to reference the original finish call to avoid creating an infinite loop
  const originalFinish = transaction.finish.bind(transaction);

  /**
   * Wraps startTransaction and stopTransaction with profiling related logic.
   * startProfiling is called after the call to startTransaction in order to avoid our own code from
   * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
   */
  function profilingWrappedTransactionFinish() {
    if (!transaction) {
      return originalFinish();
    }
    // onProfileHandler should always return the same profile even if this is called multiple times.
    // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.
    onProfileHandler();

    // Set profile context
    transaction.setContext('profile', { profile_id: profileId });

    return originalFinish();
  }

  transaction.finish = profilingWrappedTransactionFinish;
  return transaction;
}

/**
 * Wraps startTransaction with profiling logic. This is done automatically by the profiling integration.
 */
function __PRIVATE__wrapStartTransactionWithProfiling(startTransaction) {
  return function wrappedStartTransaction(

    transactionContext,
    customSamplingContext,
  ) {
    const transaction = startTransaction.call(this, transactionContext, customSamplingContext);
    if (transaction === undefined) {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        utils.logger.log('[Profiling] Transaction is undefined, skipping profiling');
      }
      return transaction;
    }

    return wrapTransactionWithProfiling(transaction);
  };
}

/**
 * Patches startTransaction and stopTransaction with profiling logic.
 */
function addProfilingExtensionMethods() {
  const carrier = core.getMainCarrier();
  if (!carrier.__SENTRY__) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log("[Profiling] Can't find main carrier, profiling won't work.");
    }
    return;
  }
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};

  if (!carrier.__SENTRY__.extensions['startTransaction']) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] startTransaction does not exists, profiling will not work. Make sure you import @sentry/tracing package before @sentry/profiling-node as import order matters.',
      );
    }
    return;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    utils.logger.log('[Profiling] startTransaction exists, patching it with profiling functionality...');
  }

  carrier.__SENTRY__.extensions['startTransaction'] = __PRIVATE__wrapStartTransactionWithProfiling(
    // This is already patched by sentry/tracing, we are going to re-patch it...
    carrier.__SENTRY__.extensions['startTransaction'] ,
  );
}

exports.addProfilingExtensionMethods = addProfilingExtensionMethods;
exports.onProfilingStartRouteTransaction = onProfilingStartRouteTransaction;
//# sourceMappingURL=hubextensions.js.map
{"version":3,"file":"hubextensions.js","sources":["../../../../src/profiling/hubextensions.ts"],"sourcesContent":["import { getCurrentHub, getMainCarrier } from '@sentry/core';\nimport type { CustomSamplingContext, Hub, Transaction, TransactionContext } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type {\n  JSSelfProfile,\n  JSSelfProfiler,\n  JSSelfProfilerConstructor,\n  ProcessedJSSelfProfile,\n} from './jsSelfProfiling';\nimport { sendProfile } from './sendProfile';\n\n// Max profile duration.\nconst MAX_PROFILE_DURATION_MS = 30_000;\n// Keep a flag value to avoid re-initializing the profiler constructor. If it fails\n// once, it will always fail and this allows us to early return.\nlet PROFILING_CONSTRUCTOR_FAILED = false;\n\n// While we experiment, per transaction sampling interval will be more flexible to work with.\ntype StartTransaction = (\n  this: Hub,\n  transactionContext: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n) => Transaction | undefined;\n\n/**\n * Check if profiler constructor is available.\n * @param maybeProfiler\n */\nfunction isJSProfilerSupported(maybeProfiler: unknown): maybeProfiler is typeof JSSelfProfilerConstructor {\n  return typeof maybeProfiler === 'function';\n}\n\n/**\n * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -\n * if that happens we want to avoid throwing an error from profiling code.\n * see https://github.com/getsentry/sentry-javascript/issues/4731.\n *\n * @experimental\n */\nexport function onProfilingStartRouteTransaction(transaction: Transaction | undefined): Transaction | undefined {\n  if (!transaction) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Transaction is undefined, skipping profiling');\n    }\n    return transaction;\n  }\n\n  return wrapTransactionWithProfiling(transaction);\n}\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfiling is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nfunction wrapTransactionWithProfiling(transaction: Transaction): Transaction {\n  // Feature support check first\n  const JSProfilerConstructor = WINDOW.Profiler;\n\n  if (!isJSProfilerSupported(JSProfilerConstructor)) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.',\n      );\n    }\n    return transaction;\n  }\n\n  // profilesSampleRate is multiplied with tracesSampleRate to get the final sampling rate.\n  if (!transaction.sampled) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n    }\n    return transaction;\n  }\n\n  // If constructor failed once, it will always fail, so we can early return.\n  if (PROFILING_CONSTRUCTOR_FAILED) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.');\n    }\n    return transaction;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = client && client.getOptions();\n\n  // @ts-ignore not part of the browser options yet\n  const profilesSampleRate = (options && options.profilesSampleRate) || 0;\n  if (profilesSampleRate === undefined) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');\n    }\n    return transaction;\n  }\n\n  // Check if we should sample this profile\n  if (Math.random() > profilesSampleRate) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Skip profiling transaction due to sampling.');\n    }\n    return transaction;\n  }\n\n  // From initial testing, it seems that the minimum value for sampleInterval is 10ms.\n  const samplingIntervalMS = 10;\n  // Start the profiler\n  const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);\n  let profiler: JSSelfProfiler | undefined;\n\n  // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.\n  // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens\n  // as we risk breaking the user's application, so just disable profiling and log an error.\n  try {\n    profiler = new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });\n  } catch (e) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        \"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.\",\n      );\n      logger.log('[Profiling] Disabling profiling for current user session.');\n    }\n    PROFILING_CONSTRUCTOR_FAILED = true;\n  }\n\n  // We failed to construct the profiler, fallback to original transaction - there is no need to log\n  // anything as we already did that in the try/catch block.\n  if (!profiler) {\n    return transaction;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log(`[Profiling] started profiling transaction: ${transaction.name || transaction.description}`);\n  }\n\n  // We create \"unique\" transaction names to avoid concurrent transactions with same names\n  // from being ignored by the profiler. From here on, only this transaction name should be used when\n  // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n  const profileId = uuid4();\n\n  // A couple of important things to note here:\n  // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n  // Whichever of the two (transaction.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n  // will be processed when the original transaction is finished. Since onProfileHandler can be invoked multiple times in the\n  // event of an error or user mistake (calling transaction.finish multiple times), it is important that the behavior of onProfileHandler\n  // is idempotent as we do not want any timings or profiles to be overriden by the last call to onProfileHandler.\n  // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n  let processedProfile: ProcessedJSSelfProfile | null = null;\n\n  /**\n   * Idempotent handler for profile stop\n   */\n  function onProfileHandler(): void {\n    // Check if the profile exists and return it the behavior has to be idempotent as users may call transaction.finish multiple times.\n    if (!transaction) {\n      return;\n    }\n    // Satisfy the type checker, but profiler will always be defined here.\n    if (!profiler) {\n      return;\n    }\n    if (processedProfile) {\n      if (__DEBUG_BUILD__) {\n        logger.log(\n          '[Profiling] profile for:',\n          transaction.name || transaction.description,\n          'already exists, returning early',\n        );\n      }\n      return;\n    }\n\n    profiler\n      .stop()\n      .then((p: JSSelfProfile): void => {\n        if (maxDurationTimeoutID) {\n          WINDOW.clearTimeout(maxDurationTimeoutID);\n          maxDurationTimeoutID = undefined;\n        }\n\n        if (__DEBUG_BUILD__) {\n          logger.log(`[Profiling] stopped profiling of transaction: ${transaction.name || transaction.description}`);\n        }\n\n        // In case of an overlapping transaction, stopProfiling may return null and silently ignore the overlapping profile.\n        if (!p) {\n          if (__DEBUG_BUILD__) {\n            logger.log(\n              `[Profiling] profiler returned null profile for: ${transaction.name || transaction.description}`,\n              'this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started',\n            );\n          }\n          return;\n        }\n\n        // If a profile has less than 2 samples, it is not useful and should be discarded.\n        if (p.samples.length < 2) {\n          return;\n        }\n\n        processedProfile = { ...p, profile_id: profileId };\n        sendProfile(profileId, processedProfile);\n      })\n      .catch(error => {\n        if (__DEBUG_BUILD__) {\n          logger.log('[Profiling] error while stopping profiler:', error);\n        }\n        return null;\n      });\n  }\n\n  // Enqueue a timeout to prevent profiles from running over max duration.\n  let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] max profile duration elapsed, stopping profiling for:',\n        transaction.name || transaction.description,\n      );\n    }\n    void onProfileHandler();\n  }, MAX_PROFILE_DURATION_MS);\n\n  // We need to reference the original finish call to avoid creating an infinite loop\n  const originalFinish = transaction.finish.bind(transaction);\n\n  /**\n   * Wraps startTransaction and stopTransaction with profiling related logic.\n   * startProfiling is called after the call to startTransaction in order to avoid our own code from\n   * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n   */\n  function profilingWrappedTransactionFinish(): Promise<Transaction> {\n    if (!transaction) {\n      return originalFinish();\n    }\n    // onProfileHandler should always return the same profile even if this is called multiple times.\n    // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n    onProfileHandler();\n\n    // Set profile context\n    transaction.setContext('profile', { profile_id: profileId });\n\n    return originalFinish();\n  }\n\n  transaction.finish = profilingWrappedTransactionFinish;\n  return transaction;\n}\n\n/**\n * Wraps startTransaction with profiling logic. This is done automatically by the profiling integration.\n */\nfunction __PRIVATE__wrapStartTransactionWithProfiling(startTransaction: StartTransaction): StartTransaction {\n  return function wrappedStartTransaction(\n    this: Hub,\n    transactionContext: TransactionContext,\n    customSamplingContext?: CustomSamplingContext,\n  ): Transaction | undefined {\n    const transaction: Transaction | undefined = startTransaction.call(this, transactionContext, customSamplingContext);\n    if (transaction === undefined) {\n      if (__DEBUG_BUILD__) {\n        logger.log('[Profiling] Transaction is undefined, skipping profiling');\n      }\n      return transaction;\n    }\n\n    return wrapTransactionWithProfiling(transaction);\n  };\n}\n\n/**\n * Patches startTransaction and stopTransaction with profiling logic.\n */\nexport function addProfilingExtensionMethods(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\"[Profiling] Can't find main carrier, profiling won't work.\");\n    }\n    return;\n  }\n  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n\n  if (!carrier.__SENTRY__.extensions['startTransaction']) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] startTransaction does not exists, profiling will not work. Make sure you import @sentry/tracing package before @sentry/profiling-node as import order matters.',\n      );\n    }\n    return;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] startTransaction exists, patching it with profiling functionality...');\n  }\n\n  carrier.__SENTRY__.extensions['startTransaction'] = __PRIVATE__wrapStartTransactionWithProfiling(\n    // This is already patched by sentry/tracing, we are going to re-patch it...\n    carrier.__SENTRY__.extensions['startTransaction'] as StartTransaction,\n  );\n}\n"],"names":["logger","WINDOW","getCurrentHub","uuid4","sendProfile","getMainCarrier"],"mappings":";;;;;;;AAaA;AACA,MAAA,uBAAA,GAAA,KAAA,CAAA;AACA;AACA;AACA,IAAA,4BAAA,GAAA,KAAA,CAAA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,OAAA,aAAA,KAAA,UAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gCAAA,CAAA,WAAA,EAAA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAAA,YAAA,CAAA,GAAA,CAAA,0DAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,4BAAA,CAAA,WAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,CAAA,WAAA,EAAA;AACA;AACA,EAAA,MAAA,qBAAA,GAAAC,cAAA,CAAA,QAAA,CA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A,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,4CAAA;AACA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,kBAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const cache = require('./cache.js');
const hubextensions = require('./hubextensions.js');

/**
 * Browser profiling integration. Stores any event that has contexts["profile"]["profile_id"]
 * This exists because we do not want to await async profiler.stop calls as transaction.finish is called
 * in a synchronous context. Instead, we handle sending the profile async from the promise callback and
 * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the
 * integration less reliable as we might be dropping profiles when the cache is full.
 *
 * @experimental
 */
class BrowserProfilingIntegration  {constructor() { BrowserProfilingIntegration.prototype.__init.call(this); }
    __init() {this.name = 'BrowserProfilingIntegration';}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    // Patching the hub to add the extension methods.
    // Warning: we have an implicit dependency on import order and we will fail patching if the constructor of
    // BrowserProfilingIntegration is called before @sentry/tracing is imported. This is because we need to patch
    // the methods of @sentry/tracing which are patched as a side effect of importing @sentry/tracing.
    hubextensions.addProfilingExtensionMethods();

    // Add our event processor
    addGlobalEventProcessor(this.handleGlobalEvent.bind(this));
  }

  /**
   * @inheritDoc
   */
   handleGlobalEvent(event) {
    const profileId = event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id'];

    if (profileId && typeof profileId === 'string') {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        utils.logger.log('[Profiling] Profiling event found, caching it.');
      }
      cache.PROFILING_EVENT_CACHE.add(profileId, event);
    }

    return event;
  }
}

exports.BrowserProfilingIntegration = BrowserProfilingIntegration;
//# sourceMappingURL=integration.js.map
{"version":3,"file":"integration.js","sources":["../../../../src/profiling/integration.ts"],"sourcesContent":["import type { Event, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { PROFILING_EVENT_CACHE } from './cache';\nimport { addProfilingExtensionMethods } from './hubextensions';\n\n/**\n * Browser profiling integration. Stores any event that has contexts[\"profile\"][\"profile_id\"]\n * This exists because we do not want to await async profiler.stop calls as transaction.finish is called\n * in a synchronous context. Instead, we handle sending the profile async from the promise callback and\n * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the\n * integration less reliable as we might be dropping profiles when the cache is full.\n *\n * @experimental\n */\nexport class BrowserProfilingIntegration implements Integration {\n  public readonly name: string = 'BrowserProfilingIntegration';\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    // Patching the hub to add the extension methods.\n    // Warning: we have an implicit dependency on import order and we will fail patching if the constructor of\n    // BrowserProfilingIntegration is called before @sentry/tracing is imported. This is because we need to patch\n    // the methods of @sentry/tracing which are patched as a side effect of importing @sentry/tracing.\n    addProfilingExtensionMethods();\n\n    // Add our event processor\n    addGlobalEventProcessor(this.handleGlobalEvent.bind(this));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public handleGlobalEvent(event: Event): Event {\n    const profileId = event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id'];\n\n    if (profileId && typeof profileId === 'string') {\n      if (__DEBUG_BUILD__) {\n        logger.log('[Profiling] Profiling event found, caching it.');\n      }\n      PROFILING_EVENT_CACHE.add(profileId, event);\n    }\n\n    return event;\n  }\n}\n"],"names":["addProfilingExtensionMethods","logger","PROFILING_EVENT_CACHE"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,2BAAA,EAAA,CAAA,WAAA,GAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,8BAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA;AACA;AACA;AACA;AACA;AACA,IAAAA,0CAAA,EAAA,CAAA;AACA;AACA;AACA,IAAA,uBAAA,CAAA,IAAA,CAAA,iBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,iBAAA,CAAA,KAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,QAAA,CAAA,SAAA,CAAA,IAAA,KAAA,CAAA,QAAA,CAAA,SAAA,CAAA,CAAA,YAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,SAAA,IAAA,OAAA,SAAA,KAAA,QAAA,EAAA;AACA,MAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,QAAAC,YAAA,CAAA,GAAA,CAAA,gDAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAAC,2BAAA,CAAA,GAAA,CAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const cache = require('./cache.js');
const utils$1 = require('./utils.js');

/**
 * Performs lookup in the event cache and sends the profile to Sentry.
 * If the profiled transaction event is found, we use the profiled transaction event and profile
 * to construct a profile type envelope and send it to Sentry.
 */
function sendProfile(profileId, profile) {
  const event = cache.PROFILING_EVENT_CACHE.get(profileId);

  if (!event) {
    // We could not find a corresponding transaction event for this profile.
    // Opt to do nothing for now, but in the future we should implement a simple retry mechanism.
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log("[Profiling] Couldn't find a transaction event for this profile, dropping it.");
    }
    return;
  }

  event.sdkProcessingMetadata = event.sdkProcessingMetadata || {};
  if (event.sdkProcessingMetadata && !event.sdkProcessingMetadata['profile']) {
    event.sdkProcessingMetadata['profile'] = profile;
  }

  // Client, Dsn and Transport are all required to be able to send the profiling event to Sentry.
  // If either of them is not available, we remove the profile from the transaction event.
  // and forward it to the next event processor.
  const hub = core.getCurrentHub();
  const client = hub.getClient();

  if (!client) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] getClient did not return a Client, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  const dsn = client.getDsn();
  if (!dsn) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] getDsn did not return a Dsn, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  const transport = client.getTransport();
  if (!transport) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(
        '[Profiling] getTransport did not return a Transport, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  // If all required components are available, we construct a profiling event envelope and send it to Sentry.
  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    utils.logger.log('[Profiling] Preparing envelope and sending a profiling event');
  }
  const envelope = utils$1.createProfilingEventEnvelope(event , dsn);

  // Evict event from the cache - we want to prevent the LRU cache from prioritizing already sent events over new ones.
  cache.PROFILING_EVENT_CACHE.delete(profileId);

  if (!envelope) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log('[Profiling] Failed to construct envelope');
    }
    return;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    utils.logger.log('[Profiling] Envelope constructed, sending it');
  }

  // Wrap in try/catch because send will throw in case of a network error.
  transport.send(envelope).then(null, reason => {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Profiling] Error while sending event:', reason);
  });
}

exports.sendProfile = sendProfile;
//# sourceMappingURL=sendProfile.js.map
{"version":3,"file":"sendProfile.js","sources":["../../../../src/profiling/sendProfile.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { PROFILING_EVENT_CACHE } from './cache';\nimport type { ProcessedJSSelfProfile } from './jsSelfProfiling';\nimport type { ProfiledEvent } from './utils';\nimport { createProfilingEventEnvelope } from './utils';\n/**\n * Performs lookup in the event cache and sends the profile to Sentry.\n * If the profiled transaction event is found, we use the profiled transaction event and profile\n * to construct a profile type envelope and send it to Sentry.\n */\nexport function sendProfile(profileId: string, profile: ProcessedJSSelfProfile): void {\n  const event = PROFILING_EVENT_CACHE.get(profileId);\n\n  if (!event) {\n    // We could not find a corresponding transaction event for this profile.\n    // Opt to do nothing for now, but in the future we should implement a simple retry mechanism.\n    if (__DEBUG_BUILD__) {\n      logger.log(\"[Profiling] Couldn't find a transaction event for this profile, dropping it.\");\n    }\n    return;\n  }\n\n  event.sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n  if (event.sdkProcessingMetadata && !event.sdkProcessingMetadata['profile']) {\n    event.sdkProcessingMetadata['profile'] = profile;\n  }\n\n  // Client, Dsn and Transport are all required to be able to send the profiling event to Sentry.\n  // If either of them is not available, we remove the profile from the transaction event.\n  // and forward it to the next event processor.\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n\n  if (!client) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getClient did not return a Client, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  const dsn = client.getDsn();\n  if (!dsn) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getDsn did not return a Dsn, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  const transport = client.getTransport();\n  if (!transport) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getTransport did not return a Transport, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  // If all required components are available, we construct a profiling event envelope and send it to Sentry.\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] Preparing envelope and sending a profiling event');\n  }\n  const envelope = createProfilingEventEnvelope(event as ProfiledEvent, dsn);\n\n  // Evict event from the cache - we want to prevent the LRU cache from prioritizing already sent events over new ones.\n  PROFILING_EVENT_CACHE.delete(profileId);\n\n  if (!envelope) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Failed to construct envelope');\n    }\n    return;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] Envelope constructed, sending it');\n  }\n\n  // Wrap in try/catch because send will throw in case of a network error.\n  transport.send(envelope).then(null, reason => {\n    __DEBUG_BUILD__ && logger.log('[Profiling] Error while sending event:', reason);\n  });\n}\n"],"names":["PROFILING_EVENT_CACHE","logger","getCurrentHub","createProfilingEventEnvelope"],"mappings":";;;;;;;AAOA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,SAAA,EAAA,OAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAAA,2BAAA,CAAA,GAAA,CAAA,SAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,EAAA;AACA;AACA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAAC,YAAA,CAAA,GAAA,CAAA,8EAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,KAAA,CAAA,qBAAA,GAAA,KAAA,CAAA,qBAAA,IAAA,EAAA,CAAA;AACA,EAAA,IAAA,KAAA,CAAA,qBAAA,IAAA,CAAA,KAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,KAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,GAAA,GAAAC,kBAAA,EAAA,CAAA;AACA,EAAA,MAAA,M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AACA,GAAA;AACA;AACA,EAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,IAAAA,YAAA,CAAA,GAAA,CAAA,8CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,SAAA,CAAA,IAAA,CAAA,QAAA,CAAA,CAAA,IAAA,CAAA,IAAA,EAAA,MAAA,IAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAA,YAAA,CAAA,GAAA,CAAA,wCAAA,EAAA,MAAA,CAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const helpers = require('../helpers.js');

const MS_TO_NS = 1e6;
// Use 0 as main thread id which is identical to threadId in node:worker_threads
// where main logs 0 and workers seem to log in increments of 1
const THREAD_ID_STRING = String(0);
const THREAD_NAME = 'main';

// Machine properties (eval only once)
let OS_PLATFORM = ''; // macos
let OS_PLATFORM_VERSION = ''; // 13.2
let OS_ARCH = ''; // arm64
let OS_BROWSER = (helpers.WINDOW.navigator && helpers.WINDOW.navigator.userAgent) || '';
let OS_MODEL = '';
const OS_LOCALE =
  (helpers.WINDOW.navigator && helpers.WINDOW.navigator.language) ||
  (helpers.WINDOW.navigator && helpers.WINDOW.navigator.languages && helpers.WINDOW.navigator.languages[0]) ||
  '';

function isUserAgentData(data) {
  return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;
}

// @ts-ignore userAgentData is not part of the navigator interface yet
const userAgentData = helpers.WINDOW.navigator && helpers.WINDOW.navigator.userAgentData;

if (isUserAgentData(userAgentData)) {
  userAgentData
    .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])
    .then((ua) => {
      OS_PLATFORM = ua.platform || '';
      OS_ARCH = ua.architecture || '';
      OS_MODEL = ua.model || '';
      OS_PLATFORM_VERSION = ua.platformVersion || '';

      if (ua.fullVersionList && ua.fullVersionList.length > 0) {
        const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1];
        OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;
      }
    })
    .catch(e => void e);
}

function isRawThreadCpuProfile(profile) {
  return !('thread_metadata' in profile);
}

// Enriches the profile with threadId of the current thread.
// This is done in node as we seem to not be able to get the info from C native code.
/**
 *
 */
function enrichWithThreadInformation(profile) {
  if (!isRawThreadCpuProfile(profile)) {
    return profile;
  }

  return convertJSSelfProfileToSampledFormat(profile);
}

// Profile is marked as optional because it is deleted from the metadata
// by the integration before the event is processed by other integrations.

/** Extract sdk info from from the API metadata */
function getSdkMetadataForEnvelopeHeader(metadata) {
  if (!metadata || !metadata.sdk) {
    return undefined;
  }

  return { name: metadata.sdk.name, version: metadata.sdk.version } ;
}

/**
 * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
 * Merge with existing data if any.
 **/
function enhanceEventWithSdkInfo(event, sdkInfo) {
  if (!sdkInfo) {
    return event;
  }
  event.sdk = event.sdk || {};
  event.sdk.name = event.sdk.name || sdkInfo.name || 'unknown sdk';
  event.sdk.version = event.sdk.version || sdkInfo.version || 'unknown sdk version';
  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];
  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];
  return event;
}

function createEventEnvelopeHeaders(
  event,
  sdkInfo,
  tunnel,
  dsn,
) {
  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata['dynamicSamplingContext'];

  return {
    event_id: event.event_id ,
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: utils.dsnToString(dsn) }),
    ...(event.type === 'transaction' &&
      dynamicSamplingContext && {
        trace: utils.dropUndefinedKeys({ ...dynamicSamplingContext }) ,
      }),
  };
}

function getTraceId(event) {
  const traceId = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id'];
  // Log a warning if the profile has an invalid traceId (should be uuidv4).
  // All profiles and transactions are rejected if this is the case and we want to
  // warn users that this is happening if they enable debug flag
  if (typeof traceId === 'string' && traceId.length !== 32) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);
    }
  }
  if (typeof traceId !== 'string') {
    return '';
  }

  return traceId;
}
/**
 * Creates a profiling event envelope from a Sentry event. If profile does not pass
 * validation, returns null.
 * @param event
 * @param dsn
 * @param metadata
 * @param tunnel
 * @returns {EventEnvelope | null}
 */

/**
 * Creates a profiling event envelope from a Sentry event.
 */
function createProfilingEventEnvelope(
  event,
  dsn,
  metadata,
  tunnel,
) {
  if (event.type !== 'transaction') {
    // createProfilingEventEnvelope should only be called for transactions,
    // we type guard this behavior with isProfiledTransactionEvent.
    throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');
  }

  const rawProfile = event.sdkProcessingMetadata['profile'];

  if (rawProfile === undefined || rawProfile === null) {
    throw new TypeError(
      `Cannot construct profiling event envelope without a valid profile. Got ${rawProfile} instead.`,
    );
  }

  if (!rawProfile.profile_id) {
    throw new TypeError('Profile is missing profile_id');
  }

  if (rawProfile.samples.length <= 1) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      // Log a warning if the profile has less than 2 samples so users can know why
      // they are not seeing any profiling data and we cant avoid the back and forth
      // of asking them to provide us with a dump of the profile data.
      utils.logger.log('[Profiling] Discarding profile because it contains less than 2 samples');
    }
    return null;
  }

  const traceId = getTraceId(event);
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);
  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);
  const enrichedThreadProfile = enrichWithThreadInformation(rawProfile);
  const transactionStartMs = typeof event.start_timestamp === 'number' ? event.start_timestamp * 1000 : Date.now();
  const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now();

  const profile = {
    event_id: rawProfile.profile_id,
    timestamp: new Date(transactionStartMs).toISOString(),
    platform: 'javascript',
    version: '1',
    release: event.release || '',
    environment: event.environment || core.DEFAULT_ENVIRONMENT,
    runtime: {
      name: 'javascript',
      version: helpers.WINDOW.navigator.userAgent,
    },
    os: {
      name: OS_PLATFORM,
      version: OS_PLATFORM_VERSION,
      build_number: OS_BROWSER,
    },
    device: {
      locale: OS_LOCALE,
      model: OS_MODEL,
      manufacturer: OS_BROWSER,
      architecture: OS_ARCH,
      is_emulator: false,
    },
    profile: enrichedThreadProfile,
    transactions: [
      {
        name: event.transaction || '',
        id: event.event_id || utils.uuid4(),
        trace_id: traceId,
        active_thread_id: THREAD_ID_STRING,
        relative_start_ns: '0',
        relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),
      },
    ],
  };

  const envelopeItem = [
    {
      type: 'profile',
    },
    // @ts-ignore this is missing in typedef
    profile,
  ];

  return utils.createEnvelope(envelopeHeaders, [envelopeItem]);
}

/**
 * Converts a JSSelfProfile to a our sampled format.
 * Does not currently perform stack indexing.
 */
function convertJSSelfProfileToSampledFormat(input) {
  let EMPTY_STACK_ID = undefined;
  let STACK_ID = 0;

  // Initialize the profile that we will fill with data
  const profile = {
    samples: [],
    stacks: [],
    frames: [],
    thread_metadata: {
      [THREAD_ID_STRING]: { name: THREAD_NAME },
    },
  };

  if (!input.samples.length) {
    return profile;
  }

  // We assert samples.length > 0 above and timestamp should always be present
  const start = input.samples[0].timestamp;

  for (let i = 0; i < input.samples.length; i++) {
    const jsSample = input.samples[i];

    // If sample has no stack, add an empty sample
    if (jsSample.stackId === undefined) {
      if (EMPTY_STACK_ID === undefined) {
        EMPTY_STACK_ID = STACK_ID;
        profile.stacks[EMPTY_STACK_ID] = [];
        STACK_ID++;
      }

      profile['samples'][i] = {
        // convert ms timestamp to ns
        elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),
        stack_id: EMPTY_STACK_ID,
        thread_id: THREAD_ID_STRING,
      };
      continue;
    }

    let stackTop = input.stacks[jsSample.stackId];

    // Functions in top->down order (root is last)
    // We follow the stackTop.parentId trail and collect each visited frameId
    const stack = [];

    while (stackTop) {
      stack.push(stackTop.frameId);

      const frame = input.frames[stackTop.frameId];

      // If our frame has not been indexed yet, index it
      if (profile.frames[stackTop.frameId] === undefined) {
        profile.frames[stackTop.frameId] = {
          function: frame.name,
          file: frame.resourceId ? input.resources[frame.resourceId] : undefined,
          line: frame.line,
          column: frame.column,
        };
      }

      stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];
    }

    const sample = {
      // convert ms timestamp to ns
      elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),
      stack_id: STACK_ID,
      thread_id: THREAD_ID_STRING,
    };

    profile['stacks'][STACK_ID] = stack;
    profile['samples'][i] = sample;
    STACK_ID++;
  }

  return profile;
}

exports.convertJSSelfProfileToSampledFormat = convertJSSelfProfileToSampledFormat;
exports.createProfilingEventEnvelope = createProfilingEventEnvelope;
exports.enrichWithThreadInformation = enrichWithThreadInformation;
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/profiling/utils.ts"],"sourcesContent":["import { DEFAULT_ENVIRONMENT } from '@sentry/core';\nimport type {\n  DsnComponents,\n  DynamicSamplingContext,\n  Event,\n  EventEnvelope,\n  EventEnvelopeHeaders,\n  EventItem,\n  SdkInfo,\n  SdkMetadata,\n} from '@sentry/types';\nimport { createEnvelope, dropUndefinedKeys, dsnToString, logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type {\n  JSSelfProfile,\n  JSSelfProfileStack,\n  RawThreadCpuProfile,\n  SentryProfile,\n  ThreadCpuProfile,\n} from './jsSelfProfiling';\n\nconst MS_TO_NS = 1e6;\n// Use 0 as main thread id which is identical to threadId in node:worker_threads\n// where main logs 0 and workers seem to log in increments of 1\nconst THREAD_ID_STRING = String(0);\nconst THREAD_NAME = 'main';\n\n// Machine properties (eval only once)\nlet OS_PLATFORM = ''; // macos\nlet OS_PLATFORM_VERSION = ''; // 13.2\nlet OS_ARCH = ''; // arm64\nlet OS_BROWSER = (WINDOW.navigator && WINDOW.navigator.userAgent) || '';\nlet OS_MODEL = '';\nconst OS_LOCALE =\n  (WINDOW.navigator && WINDOW.navigator.language) ||\n  (WINDOW.navigator && WINDOW.navigator.languages && WINDOW.navigator.languages[0]) ||\n  '';\n\ntype UAData = {\n  platform?: string;\n  architecture?: string;\n  model?: string;\n  platformVersion?: string;\n  fullVersionList?: {\n    brand: string;\n    version: string;\n  }[];\n};\n\ninterface UserAgentData {\n  getHighEntropyValues: (keys: string[]) => Promise<UAData>;\n}\n\nfunction isUserAgentData(data: unknown): data is UserAgentData {\n  return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;\n}\n\n// @ts-ignore userAgentData is not part of the navigator interface yet\nconst userAgentData = WINDOW.navigator && WINDOW.navigator.userAgentData;\n\nif (isUserAgentData(userAgentData)) {\n  userAgentData\n    .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])\n    .then((ua: UAData) => {\n      OS_PLATFORM = ua.platform || '';\n      OS_ARCH = ua.architecture || '';\n      OS_MODEL = ua.model || '';\n      OS_PLATFORM_VERSION = ua.platformVersion || '';\n\n      if (ua.fullVersionList && ua.fullVersionList.length > 0) {\n        const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1];\n        OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;\n      }\n    })\n    .catch(e => void e);\n}\n\nfunction isRawThreadCpuProfile(profile: ThreadCpuProfile | RawThreadCpuProfile): profile is RawThreadCpuProfile {\n  return !('thread_metadata' in profile);\n}\n\n// Enriches the profile with threadId of the current thread.\n// This is done in node as we seem to not be able to get the info from C native code.\n/**\n *\n */\nexport function enrichWithThreadInformation(profile: ThreadCpuProfile | RawThreadCpuProfile): ThreadCpuProfile {\n  if (!isRawThreadCpuProfile(profile)) {\n    return profile;\n  }\n\n  return convertJSSelfProfileToSampledFormat(profile);\n}\n\n// Profile is marked as optional because it is deleted from the metadata\n// by the integration before the event is processed by other integrations.\nexport interface ProfiledEvent extends Event {\n  sdkProcessingMetadata: {\n    profile?: RawThreadCpuProfile;\n  };\n}\n\n/** Extract sdk info from from the API metadata */\nfunction getSdkMetadataForEnvelopeHeader(metadata?: SdkMetadata): SdkInfo | undefined {\n  if (!metadata || !metadata.sdk) {\n    return undefined;\n  }\n\n  return { name: metadata.sdk.name, version: metadata.sdk.version } as SdkInfo;\n}\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n  if (!sdkInfo) {\n    return event;\n  }\n  event.sdk = event.sdk || {};\n  event.sdk.name = event.sdk.name || sdkInfo.name || 'unknown sdk';\n  event.sdk.version = event.sdk.version || sdkInfo.version || 'unknown sdk version';\n  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n  return event;\n}\n\nfunction createEventEnvelopeHeaders(\n  event: Event,\n  sdkInfo: SdkInfo | undefined,\n  tunnel: string | undefined,\n  dsn: DsnComponents,\n): EventEnvelopeHeaders {\n  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata['dynamicSamplingContext'];\n\n  return {\n    event_id: event.event_id as string,\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n    ...(event.type === 'transaction' &&\n      dynamicSamplingContext && {\n        trace: dropUndefinedKeys({ ...dynamicSamplingContext }) as DynamicSamplingContext,\n      }),\n  };\n}\n\nfunction getTraceId(event: Event): string {\n  const traceId: unknown = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id'];\n  // Log a warning if the profile has an invalid traceId (should be uuidv4).\n  // All profiles and transactions are rejected if this is the case and we want to\n  // warn users that this is happening if they enable debug flag\n  if (typeof traceId === 'string' && traceId.length !== 32) {\n    if (__DEBUG_BUILD__) {\n      logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);\n    }\n  }\n  if (typeof traceId !== 'string') {\n    return '';\n  }\n\n  return traceId;\n}\n/**\n * Creates a profiling event envelope from a Sentry event. If profile does not pass\n * validation, returns null.\n * @param event\n * @param dsn\n * @param metadata\n * @param tunnel\n * @returns {EventEnvelope | null}\n */\n\n/**\n * Creates a profiling event envelope from a Sentry event.\n */\nexport function createProfilingEventEnvelope(\n  event: ProfiledEvent,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): EventEnvelope | null {\n  if (event.type !== 'transaction') {\n    // createProfilingEventEnvelope should only be called for transactions,\n    // we type guard this behavior with isProfiledTransactionEvent.\n    throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');\n  }\n\n  const rawProfile = event.sdkProcessingMetadata['profile'];\n\n  if (rawProfile === undefined || rawProfile === null) {\n    throw new TypeError(\n      `Cannot construct profiling event envelope without a valid profile. Got ${rawProfile} instead.`,\n    );\n  }\n\n  if (!rawProfile.profile_id) {\n    throw new TypeError('Profile is missing profile_id');\n  }\n\n  if (rawProfile.samples.length <= 1) {\n    if (__DEBUG_BUILD__) {\n      // Log a warning if the profile has less than 2 samples so users can know why\n      // they are not seeing any profiling data and we cant avoid the back and forth\n      // of asking them to provide us with a dump of the profile data.\n      logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n    }\n    return null;\n  }\n\n  const traceId = getTraceId(event);\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n  const enrichedThreadProfile = enrichWithThreadInformation(rawProfile);\n  const transactionStartMs = typeof event.start_timestamp === 'number' ? event.start_timestamp * 1000 : Date.now();\n  const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now();\n\n  const profile: SentryProfile = {\n    event_id: rawProfile.profile_id,\n    timestamp: new Date(transactionStartMs).toISOString(),\n    platform: 'javascript',\n    version: '1',\n    release: event.release || '',\n    environment: event.environment || DEFAULT_ENVIRONMENT,\n    runtime: {\n      name: 'javascript',\n      version: WINDOW.navigator.userAgent,\n    },\n    os: {\n      name: OS_PLATFORM,\n      version: OS_PLATFORM_VERSION,\n      build_number: OS_BROWSER,\n    },\n    device: {\n      locale: OS_LOCALE,\n      model: OS_MODEL,\n      manufacturer: OS_BROWSER,\n      architecture: OS_ARCH,\n      is_emulator: false,\n    },\n    profile: enrichedThreadProfile,\n    transactions: [\n      {\n        name: event.transaction || '',\n        id: event.event_id || uuid4(),\n        trace_id: traceId,\n        active_thread_id: THREAD_ID_STRING,\n        relative_start_ns: '0',\n        relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),\n      },\n    ],\n  };\n\n  const envelopeItem: EventItem = [\n    {\n      type: 'profile',\n    },\n    // @ts-ignore this is missing in typedef\n    profile,\n  ];\n\n  return createEnvelope<EventEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n *\n */\nexport function isProfiledTransactionEvent(event: Event): event is ProfiledEvent {\n  return !!(event.sdkProcessingMetadata && event.sdkProcessingMetadata['profile']);\n}\n\n// Due to how profiles are attached to event metadata, we may sometimes want to remove them to ensure\n// they are not processed by other Sentry integrations. This can be the case when we cannot construct a valid\n// profile from the data we have or some of the mechanisms to send the event (Hub, Transport etc) are not available to us.\n/**\n *\n */\nexport function maybeRemoveProfileFromSdkMetadata(event: Event | ProfiledEvent): Event {\n  if (!isProfiledTransactionEvent(event)) {\n    return event;\n  }\n\n  delete event.sdkProcessingMetadata.profile;\n  return event;\n}\n\n/**\n * Converts a JSSelfProfile to a our sampled format.\n * Does not currently perform stack indexing.\n */\nexport function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): ThreadCpuProfile {\n  let EMPTY_STACK_ID: undefined | number = undefined;\n  let STACK_ID = 0;\n\n  // Initialize the profile that we will fill with data\n  const profile: ThreadCpuProfile = {\n    samples: [],\n    stacks: [],\n    frames: [],\n    thread_metadata: {\n      [THREAD_ID_STRING]: { name: THREAD_NAME },\n    },\n  };\n\n  if (!input.samples.length) {\n    return profile;\n  }\n\n  // We assert samples.length > 0 above and timestamp should always be present\n  const start = input.samples[0].timestamp;\n\n  for (let i = 0; i < input.samples.length; i++) {\n    const jsSample = input.samples[i];\n\n    // If sample has no stack, add an empty sample\n    if (jsSample.stackId === undefined) {\n      if (EMPTY_STACK_ID === undefined) {\n        EMPTY_STACK_ID = STACK_ID;\n        profile.stacks[EMPTY_STACK_ID] = [];\n        STACK_ID++;\n      }\n\n      profile['samples'][i] = {\n        // convert ms timestamp to ns\n        elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),\n        stack_id: EMPTY_STACK_ID,\n        thread_id: THREAD_ID_STRING,\n      };\n      continue;\n    }\n\n    let stackTop: JSSelfProfileStack | undefined = input.stacks[jsSample.stackId];\n\n    // Functions in top->down order (root is last)\n    // We follow the stackTop.parentId trail and collect each visited frameId\n    const stack: number[] = [];\n\n    while (stackTop) {\n      stack.push(stackTop.frameId);\n\n      const frame = input.frames[stackTop.frameId];\n\n      // If our frame has not been indexed yet, index it\n      if (profile.frames[stackTop.frameId] === undefined) {\n        profile.frames[stackTop.frameId] = {\n          function: frame.name,\n          file: frame.resourceId ? input.resources[frame.resourceId] : undefined,\n          line: frame.line,\n          column: frame.column,\n        };\n      }\n\n      stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];\n    }\n\n    const sample: ThreadCpuProfile['samples'][0] = {\n      // convert ms timestamp to ns\n      elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),\n      stack_id: STACK_ID,\n      thread_id: THREAD_ID_STRING,\n    };\n\n    profile['stacks'][STACK_ID] = stack;\n    profile['samples'][i] = sample;\n    STACK_ID++;\n  }\n\n  return profile;\n}\n"],"names":["WINDOW","dsnToString","dropUndefinedKeys","logger","DEFAULT_ENVIRONMENT","uuid4","createEnvelope"],"mappings":";;;;;;AAsBA,MAAA,QAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,MAAA,WAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,IAAA,WAAA,GAAA,EAAA,CAAA;AACA,IAAA,mBAAA,GAAA,EAAA,CAAA;AACA,IAAA,OAAA,GAAA,EAAA,CAAA;AACA,IAAA,UAAA,GAAA,CAAAA,cAAA,CAAA,SAAA,IAAAA,cAAA,CAAA,SAAA,CAAA,SAAA,KAAA,EAAA,CAAA;AACA,IAAA,QAAA,GAAA,EAAA,CAAA;AACA,MAAA,SAAA;AACA,EAAA,CAAAA,cAAA,CAAA,SAAA,IAAAA,cAAA,CAAA,SAAA,CAAA,QAAA;AACA,GAAAA,cAAA,CAAA,SAAA,IAAAA,cAAA,CAAA,SAAA,CAAA,SAAA,IAAAA,cAAA,CAAA,SAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,EAAA,CAAA;;AAiBA,SAAA,eAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,OAAA,IAAA,KAAA,QAAA,IAAA,IAAA,KAAA,IAAA,IAAA,sBAAA,IAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,aAAA,GAAAA,cAAA,CAAA,SAAA,IAAAA,cAAA,CAAA,SAAA,CAAA,aAAA,CAAA;AACA;AACA,IAAA,eAAA,CAAA,aAAA,CAAA,EAAA;AACA,EAAA,aAAA;AACA,KAAA,oBAAA,CAAA,CAAA,cAAA,EAAA,OAAA,EAAA,UAAA,EAAA,iBAAA,EAAA,iBAAA,CAAA,CAAA;AACA,KAAA,IAAA,CAAA,C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AA,QAAA,EAAA,QAAA;AACA,MAAA,SAAA,EAAA,gBAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,OAAA,CAAA,QAAA,CAAA,CAAA,QAAA,CAAA,GAAA,KAAA,CAAA;AACA,IAAA,OAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,GAAA,MAAA,CAAA;AACA,IAAA,QAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const client = require('./client.js');
const helpers = require('./helpers.js');
const globalhandlers = require('./integrations/globalhandlers.js');
const trycatch = require('./integrations/trycatch.js');
const breadcrumbs = require('./integrations/breadcrumbs.js');
const linkederrors = require('./integrations/linkederrors.js');
const httpcontext = require('./integrations/httpcontext.js');
const dedupe = require('./integrations/dedupe.js');
const stackParsers = require('./stack-parsers.js');
const fetch = require('./transports/fetch.js');
const xhr = require('./transports/xhr.js');

const defaultIntegrations = [
  new core.Integrations.InboundFilters(),
  new core.Integrations.FunctionToString(),
  new trycatch.TryCatch(),
  new breadcrumbs.Breadcrumbs(),
  new globalhandlers.GlobalHandlers(),
  new linkederrors.LinkedErrors(),
  new dedupe.Dedupe(),
  new httpcontext.HttpContext(),
];

/**
 * A magic string that build tooling can leverage in order to inject a release value into the SDK.
 */

/**
 * The Sentry Browser SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible when
 * loading the web page. To set context information or send manual events, use
 * the provided methods.
 *
 * @example
 *
 * ```
 *
 * import { init } from '@sentry/browser';
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { configureScope } from '@sentry/browser';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { addBreadcrumb } from '@sentry/browser';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 *
 * ```
 *
 * import * as Sentry from '@sentry/browser';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link BrowserOptions} for documentation on configuration options.
 */
function init(options = {}) {
  if (options.defaultIntegrations === undefined) {
    options.defaultIntegrations = defaultIntegrations;
  }
  if (options.release === undefined) {
    // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value
    if (typeof __SENTRY_RELEASE__ === 'string') {
      options.release = __SENTRY_RELEASE__;
    }

    // This supports the variable that sentry-webpack-plugin injects
    if (helpers.WINDOW.SENTRY_RELEASE && helpers.WINDOW.SENTRY_RELEASE.id) {
      options.release = helpers.WINDOW.SENTRY_RELEASE.id;
    }
  }
  if (options.autoSessionTracking === undefined) {
    options.autoSessionTracking = true;
  }
  if (options.sendClientReports === undefined) {
    options.sendClientReports = true;
  }

  const clientOptions = {
    ...options,
    stackParser: utils.stackParserFromStackParserOptions(options.stackParser || stackParsers.defaultStackParser),
    integrations: core.getIntegrationsToSetup(options),
    transport: options.transport || (utils.supportsFetch() ? fetch.makeFetchTransport : xhr.makeXHRTransport),
  };

  core.initAndBind(client.BrowserClient, clientOptions);

  if (options.autoSessionTracking) {
    startSessionTracking();
  }
}

/**
 * Present the user with a report dialog.
 *
 * @param options Everything is optional, we try to fetch all info need from the global scope.
 */
function showReportDialog(options = {}, hub = core.getCurrentHub()) {
  // doesn't work without a document (React Native)
  if (!helpers.WINDOW.document) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Global document not defined in showReportDialog call');
    return;
  }

  const { client, scope } = hub.getStackTop();
  const dsn = options.dsn || (client && client.getDsn());
  if (!dsn) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('DSN not configured for showReportDialog call');
    return;
  }

  if (scope) {
    options.user = {
      ...scope.getUser(),
      ...options.user,
    };
  }

  if (!options.eventId) {
    options.eventId = hub.lastEventId();
  }

  const script = helpers.WINDOW.document.createElement('script');
  script.async = true;
  script.src = core.getReportDialogEndpoint(dsn, options);

  if (options.onLoad) {
    script.onload = options.onLoad;
  }

  const injectionPoint = helpers.WINDOW.document.head || helpers.WINDOW.document.body;
  if (injectionPoint) {
    injectionPoint.appendChild(script);
  } else {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Not injecting report dialog. No injection point found in HTML');
  }
}

/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
function lastEventId() {
  return core.getCurrentHub().lastEventId();
}

/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
function forceLoad() {
  // Noop
}

/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
function onLoad(callback) {
  callback();
}

/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function flush(timeout) {
  const client = core.getCurrentHub().getClient();
  if (client) {
    return client.flush(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Cannot flush events. No client defined.');
  return utils.resolvedSyncPromise(false);
}

/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function close(timeout) {
  const client = core.getCurrentHub().getClient();
  if (client) {
    return client.close(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Cannot flush events and disable SDK. No client defined.');
  return utils.resolvedSyncPromise(false);
}

/**
 * Wrap code within a try/catch block so the SDK is able to capture errors.
 *
 * @param fn A function to wrap.
 *
 * @returns The result of wrapped function call.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function wrap(fn) {
  return helpers.wrap(fn)();
}

function startSessionOnHub(hub) {
  hub.startSession({ ignoreDuration: true });
  hub.captureSession();
}

/**
 * Enable automatic Session Tracking for the initial page load.
 */
function startSessionTracking() {
  if (typeof helpers.WINDOW.document === 'undefined') {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
    return;
  }

  const hub = core.getCurrentHub();

  // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and
  // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are
  // pinned at the same version in package.json, but there are edge cases where it's possible. See
  // https://github.com/getsentry/sentry-javascript/issues/3207 and
  // https://github.com/getsentry/sentry-javascript/issues/3234 and
  // https://github.com/getsentry/sentry-javascript/issues/3278.
  if (!hub.captureSession) {
    return;
  }

  // The session duration for browser sessions does not track a meaningful
  // concept that can be used as a metric.
  // Automatically captured sessions are akin to page views, and thus we
  // discard their duration.
  startSessionOnHub(hub);

  // We want to create a session for every navigation as well
  utils.addInstrumentationHandler('history', ({ from, to }) => {
    // Don't create an additional session for the initial route or if the location did not change
    if (!(from === undefined || from === to)) {
      startSessionOnHub(core.getCurrentHub());
    }
  });
}

/**
 * Captures user feedback and sends it to Sentry.
 */
function captureUserFeedback(feedback) {
  const client = core.getCurrentHub().getClient();
  if (client) {
    client.captureUserFeedback(feedback);
  }
}

exports.captureUserFeedback = captureUserFeedback;
exports.close = close;
exports.defaultIntegrations = defaultIntegrations;
exports.flush = flush;
exports.forceLoad = forceLoad;
exports.init = init;
exports.lastEventId = lastEventId;
exports.onLoad = onLoad;
exports.showReportDialog = showReportDialog;
exports.wrap = wrap;
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../../src/sdk.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport {\n  getCurrentHub,\n  getIntegrationsToSetup,\n  getReportDialogEndpoint,\n  initAndBind,\n  Integrations as CoreIntegrations,\n} from '@sentry/core';\nimport type { UserFeedback } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  logger,\n  resolvedSyncPromise,\n  stackParserFromStackParserOptions,\n  supportsFetch,\n} from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\nexport const defaultIntegrations = [\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  new TryCatch(),\n  new Breadcrumbs(),\n  new GlobalHandlers(),\n  new LinkedErrors(),\n  new Dedupe(),\n  new HttpContext(),\n];\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n  if (options.release === undefined) {\n    // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n    if (typeof __SENTRY_RELEASE__ === 'string') {\n      options.release = __SENTRY_RELEASE__;\n    }\n\n    // This supports the variable that sentry-webpack-plugin injects\n    if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n      options.release = WINDOW.SENTRY_RELEASE.id;\n    }\n  }\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = true;\n  }\n  if (options.sendClientReports === undefined) {\n    options.sendClientReports = true;\n  }\n\n  const clientOptions: BrowserClientOptions = {\n    ...options,\n    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n    integrations: getIntegrationsToSetup(options),\n    transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n  };\n\n  initAndBind(BrowserClient, clientOptions);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}, hub: Hub = getCurrentHub()): void {\n  // doesn't work without a document (React Native)\n  if (!WINDOW.document) {\n    __DEBUG_BUILD__ && logger.error('Global document not defined in showReportDialog call');\n    return;\n  }\n\n  const { client, scope } = hub.getStackTop();\n  const dsn = options.dsn || (client && client.getDsn());\n  if (!dsn) {\n    __DEBUG_BUILD__ && logger.error('DSN not configured for showReportDialog call');\n    return;\n  }\n\n  if (scope) {\n    options.user = {\n      ...scope.getUser(),\n      ...options.user,\n    };\n  }\n\n  if (!options.eventId) {\n    options.eventId = hub.lastEventId();\n  }\n\n  const script = WINDOW.document.createElement('script');\n  script.async = true;\n  script.src = getReportDialogEndpoint(dsn, options);\n\n  if (options.onLoad) {\n    script.onload = options.onLoad;\n  }\n\n  const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n  if (injectionPoint) {\n    injectionPoint.appendChild(script);\n  } else {\n    __DEBUG_BUILD__ && logger.error('Not injecting report dialog. No injection point found in HTML');\n  }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n  // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n  callback();\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport function flush(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.flush(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events. No client defined.');\n  return resolvedSyncPromise(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport function close(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.close(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events and disable SDK. No client defined.');\n  return resolvedSyncPromise(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n  return internalWrap(fn)();\n}\n\nfunction startSessionOnHub(hub: Hub): void {\n  hub.startSession({ ignoreDuration: true });\n  hub.captureSession();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n  if (typeof WINDOW.document === 'undefined') {\n    __DEBUG_BUILD__ &&\n      logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n    return;\n  }\n\n  const hub = getCurrentHub();\n\n  // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n  // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n  // pinned at the same version in package.json, but there are edge cases where it's possible. See\n  // https://github.com/getsentry/sentry-javascript/issues/3207 and\n  // https://github.com/getsentry/sentry-javascript/issues/3234 and\n  // https://github.com/getsentry/sentry-javascript/issues/3278.\n  if (!hub.captureSession) {\n    return;\n  }\n\n  // The session duration for browser sessions does not track a meaningful\n  // concept that can be used as a metric.\n  // Automatically captured sessions are akin to page views, and thus we\n  // discard their duration.\n  startSessionOnHub(hub);\n\n  // We want to create a session for every navigation as well\n  addInstrumentationHandler('history', ({ from, to }) => {\n    // Don't create an additional session for the initial route or if the location did not change\n    if (!(from === undefined || from === to)) {\n      startSessionOnHub(getCurrentHub());\n    }\n  });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    client.captureUserFeedback(feedback);\n  }\n}\n"],"names":["CoreIntegrations","TryCatch","Breadcrumbs","GlobalHandlers","LinkedErrors","Dedupe","HttpContext","WINDOW","stackParserFromStackParserOptions","defaultStackParser","getIntegrationsToSetup","supportsFetch","makeFetchTransport","makeXHRTransport","initAndBind","BrowserClient","getCurrentHub","logger","getReportDialogEndpoint","resolvedSyncPromise","internalWrap","addInstrumentationHandler"],"mappings":";;;;;;;;;;;;;;;;AAyBA,MAAA,mBAAA,GAAA;AACA,EAAA,IAAAA,iBAAA,CAAA,cAAA,EAAA;AACA,EAAA,IAAAA,iBAAA,CAAA,gBAAA,EAAA;AACA,EAAA,IAAAC,iBAAA,EAAA;AACA,EAAA,IAAAC,uBAAA,EAAA;AACA,EAAA,IAAAC,6BAAA,EAAA;AACA,EAAA,IAAAC,yBAAA,EAAA;AACA,EAAA,IAAAC,aAAA,EAAA;AACA,EAAA,IAAAC,uBAAA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA,EAAA,IAAA,OAAA,CAAA,mBAAA,KAAA,SAAA,EAAA;AACA,IAAA,OAAA,CAAA,mBAAA,GAAA,mBAAA,CAAA;AACA,GAAA;AACA,EAAA,IAAA,OAAA,CAAA,OAAA,KAAA,SAAA,EAAA;AACA;AACA,IAAA,IAAA,OAAA,kBAAA,KAAA,QAAA,EAAA;AACA,MAAA,OAAA,CAAA,OAAA,GAAA,kBAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAAC,cAAA,CAAA,cAAA,IAAAA,cA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,CAAA,EAAA,cAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,EAAA,GAAA,CAAA,cAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,IAAA,OAAAb,cAAA,CAAA,QAAA,KAAA,WAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,MAAAU,YAAA,CAAA,IAAA,CAAA,oFAAA,CAAA,CAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,GAAA,GAAAD,kBAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,cAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,iBAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA,EAAAK,+BAAA,CAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA;AACA;AACA,IAAA,IAAA,EAAA,IAAA,KAAA,SAAA,IAAA,IAAA,KAAA,EAAA,CAAA,EAAA;AACA,MAAA,iBAAA,CAAAL,kBAAA,EAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAA,kBAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAA,mBAAA,CAAA,QAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

// global reference to slice
const UNKNOWN_FUNCTION = '?';

const OPERA10_PRIORITY = 10;
const OPERA11_PRIORITY = 20;
const CHROME_PRIORITY = 30;
const WINJS_PRIORITY = 40;
const GECKO_PRIORITY = 50;

function createFrame(filename, func, lineno, colno) {
  const frame = {
    filename,
    function: func,
    in_app: true, // All browser frames are considered in_app
  };

  if (lineno !== undefined) {
    frame.lineno = lineno;
  }

  if (colno !== undefined) {
    frame.colno = colno;
  }

  return frame;
}

// Chromium based browsers: Chrome, Brave, new Opera, new Edge
const chromeRegex =
  /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;

const chrome = line => {
  const parts = chromeRegex.exec(line);

  if (parts) {
    const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line

    if (isEval) {
      const subMatch = chromeEvalRegex.exec(parts[2]);

      if (subMatch) {
        // throw out eval line/column and use top-most line/column number
        parts[2] = subMatch[1]; // url
        parts[3] = subMatch[2]; // line
        parts[4] = subMatch[3]; // column
      }
    }

    // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
    // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
    const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);

    return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);
  }

  return;
};

const chromeStackLineParser = [CHROME_PRIORITY, chrome];

// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
// We need this specific case for now because we want no other regex to match.
const geckoREgex =
  /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;

const gecko = line => {
  const parts = geckoREgex.exec(line);

  if (parts) {
    const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
    if (isEval) {
      const subMatch = geckoEvalRegex.exec(parts[3]);

      if (subMatch) {
        // throw out eval line/column and use top-most line number
        parts[1] = parts[1] || 'eval';
        parts[3] = subMatch[1];
        parts[4] = subMatch[2];
        parts[5] = ''; // no column when eval
      }
    }

    let filename = parts[3];
    let func = parts[1] || UNKNOWN_FUNCTION;
    [func, filename] = extractSafariExtensionDetails(func, filename);

    return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);
  }

  return;
};

const geckoStackLineParser = [GECKO_PRIORITY, gecko];

const winjsRegex =
  /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;

const winjs = line => {
  const parts = winjsRegex.exec(line);

  return parts
    ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)
    : undefined;
};

const winjsStackLineParser = [WINJS_PRIORITY, winjs];

const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;

const opera10 = line => {
  const parts = opera10Regex.exec(line);
  return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
};

const opera10StackLineParser = [OPERA10_PRIORITY, opera10];

const opera11Regex =
  / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;

const opera11 = line => {
  const parts = opera11Regex.exec(line);
  return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
};

const opera11StackLineParser = [OPERA11_PRIORITY, opera11];

const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];

const defaultStackParser = utils.createStackParser(...defaultStackLineParsers);

/**
 * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
 * What it means, is that instead of format like:
 *
 * Error: wat
 *   at function@url:row:col
 *   at function@url:row:col
 *   at function@url:row:col
 *
 * it produces something like:
 *
 *   function@url:row:col
 *   function@url:row:col
 *   function@url:row:col
 *
 * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.
 * This function is extracted so that we can use it in both places without duplicating the logic.
 * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests
 * and fix this case seems like an impossible, or at least way too time-consuming task.
 */
const extractSafariExtensionDetails = (func, filename) => {
  const isSafariExtension = func.indexOf('safari-extension') !== -1;
  const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;

  return isSafariExtension || isSafariWebExtension
    ? [
        func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,
        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,
      ]
    : [func, filename];
};

exports.chromeStackLineParser = chromeStackLineParser;
exports.defaultStackLineParsers = defaultStackLineParsers;
exports.defaultStackParser = defaultStackParser;
exports.geckoStackLineParser = geckoStackLineParser;
exports.opera10StackLineParser = opera10StackLineParser;
exports.opera11StackLineParser = opera11StackLineParser;
exports.winjsStackLineParser = winjsStackLineParser;
//# sourceMappingURL=stack-parsers.js.map
{"version":3,"file":"stack-parsers.js","sources":["../../../src/stack-parsers.ts"],"sourcesContent":["// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n  const frame: StackFrame = {\n    filename,\n    function: func,\n    in_app: true, // All browser frames are considered in_app\n  };\n\n  if (lineno !== undefined) {\n    frame.lineno = lineno;\n  }\n\n  if (colno !== undefined) {\n    frame.colno = colno;\n  }\n\n  return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n  /^\\s*at (?:(.*\\).*?|.*?) ?\\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nconst chrome: StackLineParserFn = line => {\n  const parts = chromeRegex.exec(line);\n\n  if (parts) {\n    const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n    if (isEval) {\n      const subMatch = chromeEvalRegex.exec(parts[2]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line/column number\n        parts[2] = subMatch[1]; // url\n        parts[3] = subMatch[2]; // line\n        parts[4] = subMatch[3]; // column\n      }\n    }\n\n    // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n    // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n    const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n    return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n  }\n\n  return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n  /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n  const parts = geckoREgex.exec(line);\n\n  if (parts) {\n    const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n    if (isEval) {\n      const subMatch = geckoEvalRegex.exec(parts[3]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line number\n        parts[1] = parts[1] || 'eval';\n        parts[3] = subMatch[1];\n        parts[4] = subMatch[2];\n        parts[5] = ''; // no column when eval\n      }\n    }\n\n    let filename = parts[3];\n    let func = parts[1] || UNKNOWN_FUNCTION;\n    [func, filename] = extractSafariExtensionDetails(func, filename);\n\n    return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n  }\n\n  return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex =\n  /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n  const parts = winjsRegex.exec(line);\n\n  return parts\n    ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n    : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n  const parts = opera10Regex.exec(line);\n  return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n  / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n  const parts = opera11Regex.exec(line);\n  return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n *   at function@url:row:col\n *   at function@url:row:col\n *   at function@url:row:col\n *\n * it produces something like:\n *\n *   function@url:row:col\n *   function@url:row:col\n *   function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n  const isSafariExtension = func.indexOf('safari-extension') !== -1;\n  const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n  return isSafariExtension || isSafariWebExtension\n    ? [\n        func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n      ]\n    : [func, filename];\n};\n"],"names":["createStackParser"],"mappings":";;;;AA4BA;AACA,MAAA,gBAAA,GAAA,GAAA,CAAA;AACA;AACA,MAAA,gBAAA,GAAA,EAAA,CAAA;AACA,MAAA,gBAAA,GAAA,EAAA,CAAA;AACA,MAAA,eAAA,GAAA,EAAA,CAAA;AACA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA,SAAA,WAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA;AACA,IAAA,QAAA;AACA,IAAA,QAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,IAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,KAAA,SAAA,EAAA;AACA,IAAA,KAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,KAAA,KAAA,SAAA,EAAA;AACA,IAAA,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,WAAA;AACA,EAAA,gMAAA,CAAA;AACA,MAAA,eAAA,GAA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AA,CAAA,IAAA,KAAA,CAAA,CAAA,CAAA,IAAA,gBAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,GAAA,SAAA,CAAA;AACA,CAAA,CAAA;AACA;AACA,MAAA,sBAAA,GAAA,CAAA,gBAAA,EAAA,OAAA,EAAA;AACA;AACA,MAAA,uBAAA,GAAA,CAAA,qBAAA,EAAA,oBAAA,EAAA,oBAAA,EAAA;AACA;AACA,MAAA,kBAAA,GAAAA,uBAAA,CAAA,GAAA,uBAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,6BAAA,GAAA,CAAA,IAAA,EAAA,QAAA,KAAA;AACA,EAAA,MAAA,iBAAA,GAAA,IAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,EAAA,MAAA,oBAAA,GAAA,IAAA,CAAA,OAAA,CAAA,sBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,iBAAA,IAAA,oBAAA;AACA,MAAA;AACA,QAAA,IAAA,CAAA,OAAA,CAAA,GAAA,CAAA,KAAA,CAAA,CAAA,GAAA,IAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,gBAAA;AACA,QAAA,iBAAA,GAAA,CAAA,iBAAA,EAAA,QAAA,CAAA,CAAA,GAAA,CAAA,qBAAA,EAAA,QAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AACA,CAAA;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils$1 = require('@sentry/utils');
const utils = require('./utils.js');

/**
 * Creates a Transport that uses the Fetch API to send events to Sentry.
 */
function makeFetchTransport(
  options,
  nativeFetch = utils.getNativeFetchImplementation(),
) {
  let pendingBodySize = 0;
  let pendingCount = 0;

  function makeRequest(request) {
    const requestSize = request.body.length;
    pendingBodySize += requestSize;
    pendingCount++;

    const requestOptions = {
      body: request.body,
      method: 'POST',
      referrerPolicy: 'origin',
      headers: options.headers,
      // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to
      // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)".
      // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're
      // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).
      // Gotchas:
      // - `keepalive` isn't supported by Firefox
      // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):
      //   If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.
      //   We will therefore only activate the flag when we're below that limit.
      // There is also a limit of requests that can be open at the same time, so we also limit this to 15
      // See https://github.com/getsentry/sentry-javascript/pull/7553 for details
      keepalive: pendingBodySize <= 60000 && pendingCount < 15,
      ...options.fetchOptions,
    };

    try {
      return nativeFetch(options.url, requestOptions).then(response => {
        pendingBodySize -= requestSize;
        pendingCount--;
        return {
          statusCode: response.status,
          headers: {
            'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
            'retry-after': response.headers.get('Retry-After'),
          },
        };
      });
    } catch (e) {
      utils.clearCachedFetchImplementation();
      pendingBodySize -= requestSize;
      pendingCount--;
      return utils$1.rejectedSyncPromise(e);
    }
  }

  return core.createTransport(options, makeRequest);
}

exports.makeFetchTransport = makeFetchTransport;
//# sourceMappingURL=fetch.js.map
{"version":3,"file":"fetch.js","sources":["../../../../src/transports/fetch.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n  options: BrowserTransportOptions,\n  nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n  let pendingBodySize = 0;\n  let pendingCount = 0;\n\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    const requestSize = request.body.length;\n    pendingBodySize += requestSize;\n    pendingCount++;\n\n    const requestOptions: RequestInit = {\n      body: request.body,\n      method: 'POST',\n      referrerPolicy: 'origin',\n      headers: options.headers,\n      // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n      // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n      // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n      // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n      // Gotchas:\n      // - `keepalive` isn't supported by Firefox\n      // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n      //   If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n      //   We will therefore only activate the flag when we're below that limit.\n      // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n      // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n      keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n      ...options.fetchOptions,\n    };\n\n    try {\n      return nativeFetch(options.url, requestOptions).then(response => {\n        pendingBodySize -= requestSize;\n        pendingCount--;\n        return {\n          statusCode: response.status,\n          headers: {\n            'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n            'retry-after': response.headers.get('Retry-After'),\n          },\n        };\n      });\n    } catch (e) {\n      clearCachedFetchImplementation();\n      pendingBodySize -= requestSize;\n      pendingCount--;\n      return rejectedSyncPromise(e);\n    }\n  }\n\n  return createTransport(options, makeRequest);\n}\n"],"names":["getNativeFetchImplementation","clearCachedFetchImplementation","rejectedSyncPromise","createTransport"],"mappings":";;;;;;AAQ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,IAAA,WAAA,CAAA;AACA,MAAA,YAAA,EAAA,CAAA;AACA,MAAA,OAAAC,2BAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAAC,oBAAA,CAAA,OAAA,EAAA,WAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being
// modified and simplified: https://github.com/jakearchibald/idb-keyval
//
// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca
// Original licence:

// Copyright 2016, Jake Archibald
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

function promisifyRequest(request) {
  return new Promise((resolve, reject) => {
    // @ts-ignore - file size hacks
    request.oncomplete = request.onsuccess = () => resolve(request.result);
    // @ts-ignore - file size hacks
    request.onabort = request.onerror = () => reject(request.error);
  });
}

/** Create or open an IndexedDb store */
function createStore(dbName, storeName) {
  const request = indexedDB.open(dbName);
  request.onupgradeneeded = () => request.result.createObjectStore(storeName);
  const dbp = promisifyRequest(request);

  return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
}

function keys(store) {
  return promisifyRequest(store.getAllKeys() );
}

/** Insert into the store */
function insert(store, value, maxQueueSize) {
  return store(store => {
    return keys(store).then(keys => {
      if (keys.length >= maxQueueSize) {
        return;
      }

      // We insert with an incremented key so that the entries are popped in order
      store.put(value, Math.max(...keys, 0) + 1);
      return promisifyRequest(store.transaction);
    });
  });
}

/** Pop the oldest value from the store */
function pop(store) {
  return store(store => {
    return keys(store).then(keys => {
      if (keys.length === 0) {
        return undefined;
      }

      return promisifyRequest(store.get(keys[0])).then(value => {
        store.delete(keys[0]);
        return promisifyRequest(store.transaction).then(() => value);
      });
    });
  });
}

function createIndexedDbStore(options) {
  let store;

  // Lazily create the store only when it's needed
  function getStore() {
    if (store == undefined) {
      store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');
    }

    return store;
  }

  return {
    insert: async (env) => {
      try {
        const serialized = await utils.serializeEnvelope(env, options.textEncoder);
        await insert(getStore(), serialized, options.maxQueueSize || 30);
      } catch (_) {
        //
      }
    },
    pop: async () => {
      try {
        const deserialized = await pop(getStore());
        if (deserialized) {
          return utils.parseEnvelope(
            deserialized,
            options.textEncoder || new TextEncoder(),
            options.textDecoder || new TextDecoder(),
          );
        }
      } catch (_) {
        //
      }

      return undefined;
    },
  };
}

function makeIndexedDbOfflineTransport(
  createTransport,
) {
  return options => createTransport({ ...options, createStore: createIndexedDbStore });
}

/**
 * Creates a transport that uses IndexedDb to store events when offline.
 */
function makeBrowserOfflineTransport(
  createTransport,
) {
  return makeIndexedDbOfflineTransport(core.makeOfflineTransport(createTransport));
}

exports.createStore = createStore;
exports.insert = insert;
exports.makeBrowserOfflineTransport = makeBrowserOfflineTransport;
exports.pop = pop;
//# sourceMappingURL=offline.js.map
{"version":3,"file":"offline.js","sources":["../../../../src/transports/offline.ts"],"sourcesContent":["import type { OfflineStore, OfflineTransportOptions } from '@sentry/core';\nimport { makeOfflineTransport } from '@sentry/core';\nimport type { Envelope, InternalBaseTransportOptions, Transport } from '@sentry/types';\nimport type { TextDecoderInternal } from '@sentry/utils';\nimport { parseEnvelope, serializeEnvelope } from '@sentry/utils';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original licence:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n  return new Promise<T>((resolve, reject) => {\n    // @ts-ignore - file size hacks\n    request.oncomplete = request.onsuccess = () => resolve(request.result);\n    // @ts-ignore - file size hacks\n    request.onabort = request.onerror = () => reject(request.error);\n  });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n  const request = indexedDB.open(dbName);\n  request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n  const dbp = promisifyRequest(request);\n\n  return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n  return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the store */\nexport function insert(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length >= maxQueueSize) {\n        return;\n      }\n\n      // We insert with an incremented key so that the entries are popped in order\n      store.put(value, Math.max(...keys, 0) + 1);\n      return promisifyRequest(store.transaction);\n    });\n  });\n}\n\n/** Pop the oldest value from the store */\nexport function pop(store: Store): Promise<Uint8Array | string | undefined> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length === 0) {\n        return undefined;\n      }\n\n      return promisifyRequest(store.get(keys[0])).then(value => {\n        store.delete(keys[0]);\n        return promisifyRequest(store.transaction).then(() => value);\n      });\n    });\n  });\n}\n\nexport interface BrowserOfflineTransportOptions extends OfflineTransportOptions {\n  /**\n   * Name of indexedDb database to store envelopes in\n   * Default: 'sentry-offline'\n   */\n  dbName?: string;\n  /**\n   * Name of indexedDb object store to store envelopes in\n   * Default: 'queue'\n   */\n  storeName?: string;\n  /**\n   * Maximum number of envelopes to store\n   * Default: 30\n   */\n  maxQueueSize?: number;\n  /**\n   * Only required for testing on node.js\n   * @ignore\n   */\n  textDecoder?: TextDecoderInternal;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n  let store: Store | undefined;\n\n  // Lazily create the store only when it's needed\n  function getStore(): Store {\n    if (store == undefined) {\n      store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n    }\n\n    return store;\n  }\n\n  return {\n    insert: async (env: Envelope) => {\n      try {\n        const serialized = await serializeEnvelope(env, options.textEncoder);\n        await insert(getStore(), serialized, options.maxQueueSize || 30);\n      } catch (_) {\n        //\n      }\n    },\n    pop: async () => {\n      try {\n        const deserialized = await pop(getStore());\n        if (deserialized) {\n          return parseEnvelope(\n            deserialized,\n            options.textEncoder || new TextEncoder(),\n            options.textDecoder || new TextDecoder(),\n          );\n        }\n      } catch (_) {\n        //\n      }\n\n      return undefined;\n    },\n  };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return options => createTransport({ ...options, createStore: createIndexedDbStore });\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends InternalBaseTransportOptions>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":["serializeEnvelope","parseEnvelope","makeOfflineTransport"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAAA,gBAAA,CAAA,OAAA,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,UAAA,GAAA,MAAAA,uBAAA,CAAA,GAAA,EAAA,OAAA,CAAA,WAAA,CAAA,CAAA;AACA,QAAA,MAAA,MAAA,CAAA,QAAA,EAAA,EAAA,UAAA,EAAA,OAAA,CAAA,YAAA,IAAA,EAAA,CAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA,KAAA;AACA,IAAA,GAAA,EAAA,YAAA;AACA,MAAA,IAAA;AACA,QAAA,MAAA,YAAA,GAAA,MAAA,GAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AACA,QAAA,IAAA,YAAA,EAAA;AACA,UAAA,OAAAC,mBAAA;AACA,YAAA,YAAA;AACA,YAAA,OAAA,CAAA,WAAA,IAAA,IAAA,WAAA,EAAA;AACA,YAAA,OAAA,CAAA,WAAA,IAAA,IAAA,WAAA,EAAA;AACA,WAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA;AACA,MAAA,OAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,6BAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA,EAAA,OAAA,OAAA,IAAA,eAAA,CAAA,EAAA,GAAA,OAAA,EAAA,WAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,2BAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA,EAAA,OAAA,6BAAA,CAAAC,yBAAA,CAAA,eAAA,CAAA,CAAA,CAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const helpers = require('../helpers.js');

let cachedFetchImpl = undefined;

/**
 * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
 * Whenever someone wraps the Fetch API and returns the wrong promise chain,
 * this chain becomes orphaned and there is no possible way to capture it's rejections
 * other than allowing it bubble up to this very handler. eg.
 *
 * const f = window.fetch;
 * window.fetch = function () {
 *   const p = f.apply(this, arguments);
 *
 *   p.then(function() {
 *     console.log('hi.');
 *   });
 *
 *   return p;
 * }
 *
 * `p.then(function () { ... })` is producing a completely separate promise chain,
 * however, what's returned is `p` - the result of original `fetch` call.
 *
 * This mean, that whenever we use the Fetch API to send our own requests, _and_
 * some ad-blocker blocks it, this orphaned chain will _always_ reject,
 * effectively causing another event to be captured.
 * This makes a whole process become an infinite loop, which we need to somehow
 * deal with, and break it in one way or another.
 *
 * To deal with this issue, we are making sure that we _always_ use the real
 * browser Fetch API, instead of relying on what `window.fetch` exposes.
 * The only downside to this would be missing our own requests as breadcrumbs,
 * but because we are already not doing this, it should be just fine.
 *
 * Possible failed fetch error messages per-browser:
 *
 * Chrome:  Failed to fetch
 * Edge:    Failed to Fetch
 * Firefox: NetworkError when attempting to fetch resource
 * Safari:  resource blocked by content blocker
 */
function getNativeFetchImplementation() {
  if (cachedFetchImpl) {
    return cachedFetchImpl;
  }

  /* eslint-disable @typescript-eslint/unbound-method */

  // Fast path to avoid DOM I/O
  if (utils.isNativeFetch(helpers.WINDOW.fetch)) {
    return (cachedFetchImpl = helpers.WINDOW.fetch.bind(helpers.WINDOW));
  }

  const document = helpers.WINDOW.document;
  let fetchImpl = helpers.WINDOW.fetch;
  // eslint-disable-next-line deprecation/deprecation
  if (document && typeof document.createElement === 'function') {
    try {
      const sandbox = document.createElement('iframe');
      sandbox.hidden = true;
      document.head.appendChild(sandbox);
      const contentWindow = sandbox.contentWindow;
      if (contentWindow && contentWindow.fetch) {
        fetchImpl = contentWindow.fetch;
      }
      document.head.removeChild(sandbox);
    } catch (e) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);
    }
  }

  return (cachedFetchImpl = fetchImpl.bind(helpers.WINDOW));
  /* eslint-enable @typescript-eslint/unbound-method */
}

/** Clears cached fetch impl */
function clearCachedFetchImplementation() {
  cachedFetchImpl = undefined;
}

exports.clearCachedFetchImplementation = clearCachedFetchImplementation;
exports.getNativeFetchImplementation = getNativeFetchImplementation;
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/transports/utils.ts"],"sourcesContent":["import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n *   const p = f.apply(this, arguments);\n *\n *   p.then(function() {\n *     console.log('hi.');\n *   });\n *\n *   return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome:  Failed to fetch\n * Edge:    Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari:  resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n  if (cachedFetchImpl) {\n    return cachedFetchImpl;\n  }\n\n  /* eslint-disable @typescript-eslint/unbound-method */\n\n  // Fast path to avoid DOM I/O\n  if (isNativeFetch(WINDOW.fetch)) {\n    return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n  }\n\n  const document = WINDOW.document;\n  let fetchImpl = WINDOW.fetch;\n  // eslint-disable-next-line deprecation/deprecation\n  if (document && typeof document.createElement === 'function') {\n    try {\n      const sandbox = document.createElement('iframe');\n      sandbox.hidden = true;\n      document.head.appendChild(sandbox);\n      const contentWindow = sandbox.contentWindow;\n      if (contentWindow && contentWindow.fetch) {\n        fetchImpl = contentWindow.fetch;\n      }\n      document.head.removeChild(sandbox);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n    }\n  }\n\n  return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n  /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n  cachedFetchImpl = undefined;\n}\n"],"names":["isNativeFetch","WINDOW","logger"],"mappings":";;;;;AAIA,IAAA,eAAA,GAAA,SAAA,CAAA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,GAAA;AACA,EAAA,IAAA,eAAA,EAAA;AACA,IAAA,OAAA,eAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAAA,mBAAA,CAAAC,cAAA,CAAA,KAAA,CAAA,EAAA;AACA,IAAA,QAAA,eAAA,GAAAA,cAAA,CAAA,KAAA,CAAA,IAAA,CAAAA,cAAA,CAAA,EAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAAA,cAAA,CAAA,QAAA,CAAA;AACA,EAAA,IAAA,SAAA,GAAAA,cAAA,CAAA,KAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,OAAA,QAAA,CAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,OAAA,GAAA,QAAA,CAAA,aAAA,CAAA,QAAA,CAAA,CAAA;AACA,MAAA,OAAA,CAAA,MAAA,GAAA,IAAA,CAAA;AACA,MAAA,QAAA,CAAA,IAAA,CAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,MAAA,MAAA,aAAA,GAAA,OAAA,CAAA,aAAA,CAAA;AACA,MAAA,IAAA,aAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,QAAA,SAAA,GAAA,aAAA,CAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,QAAA,CAAA,IAAA,CAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,QAAAC,YAAA,CAAA,IAAA,CAAA,iFAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,QAAA,eAAA,GAAA,SAAA,CAAA,IAAA,CAAAD,cAAA,CAAA,EAAA;AACA;AACA,CAAA;AACA;AACA;AACA,SAAA,8BAAA,GAAA;AACA,EAAA,eAAA,GAAA,SAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

/**
 * The DONE ready state for XmlHttpRequest
 *
 * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined
 * (e.g. during testing, it is `undefined`)
 *
 * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}
 */
const XHR_READYSTATE_DONE = 4;

/**
 * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
 */
function makeXHRTransport(options) {
  function makeRequest(request) {
    return new utils.SyncPromise((resolve, reject) => {
      const xhr = new XMLHttpRequest();

      xhr.onerror = reject;

      xhr.onreadystatechange = () => {
        if (xhr.readyState === XHR_READYSTATE_DONE) {
          resolve({
            statusCode: xhr.status,
            headers: {
              'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),
              'retry-after': xhr.getResponseHeader('Retry-After'),
            },
          });
        }
      };

      xhr.open('POST', options.url);

      for (const header in options.headers) {
        if (Object.prototype.hasOwnProperty.call(options.headers, header)) {
          xhr.setRequestHeader(header, options.headers[header]);
        }
      }

      xhr.send(request.body);
    });
  }

  return core.createTransport(options, makeRequest);
}

exports.makeXHRTransport = makeXHRTransport;
//# sourceMappingURL=xhr.js.map
{"version":3,"file":"xhr.js","sources":["../../../../src/transports/xhr.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    return new SyncPromise((resolve, reject) => {\n      const xhr = new XMLHttpRequest();\n\n      xhr.onerror = reject;\n\n      xhr.onreadystatechange = (): void => {\n        if (xhr.readyState === XHR_READYSTATE_DONE) {\n          resolve({\n            statusCode: xhr.status,\n            headers: {\n              'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n              'retry-after': xhr.getResponseHeader('Retry-After'),\n            },\n          });\n        }\n      };\n\n      xhr.open('POST', options.url);\n\n      for (const header in options.headers) {\n        if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n          xhr.setRequestHeader(header, options.headers[header]);\n        }\n      }\n\n      xhr.send(request.body);\n    });\n  }\n\n  return createTransport(options, makeRequest);\n}\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ACA,EAAA,OAAAC,oBAAA,CAAA,OAAA,EAAA,WAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

/**
 * Creates an envelope from a user feedback.
 */
function createUserFeedbackEnvelope(
  feedback,
  {
    metadata,
    tunnel,
    dsn,
  }

,
) {
  const headers = {
    event_id: feedback.event_id,
    sent_at: new Date().toISOString(),
    ...(metadata &&
      metadata.sdk && {
        sdk: {
          name: metadata.sdk.name,
          version: metadata.sdk.version,
        },
      }),
    ...(!!tunnel && !!dsn && { dsn: utils.dsnToString(dsn) }),
  };
  const item = createUserFeedbackEnvelopeItem(feedback);

  return utils.createEnvelope(headers, [item]);
}

function createUserFeedbackEnvelopeItem(feedback) {
  const feedbackHeaders = {
    type: 'user_report',
  };
  return [feedbackHeaders, feedback];
}

exports.createUserFeedbackEnvelope = createUserFeedbackEnvelope;
//# sourceMappingURL=userfeedback.js.map
{"version":3,"file":"userfeedback.js","sources":["../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n  feedback: UserFeedback,\n  {\n    metadata,\n    tunnel,\n    dsn,\n  }: {\n    metadata: SdkMetadata | undefined;\n    tunnel: string | undefined;\n    dsn: DsnComponents | undefined;\n  },\n): EventEnvelope {\n  const headers: EventEnvelope[0] = {\n    event_id: feedback.event_id,\n    sent_at: new Date().toISOString(),\n    ...(metadata &&\n      metadata.sdk && {\n        sdk: {\n          name: metadata.sdk.name,\n          version: metadata.sdk.version,\n        },\n      }),\n    ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n  };\n  const item = createUserFeedbackEnvelopeItem(feedback);\n\n  return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n  const feedbackHeaders: UserFeedbackItem[0] = {\n    type: 'user_report',\n  };\n  return [feedbackHeaders, feedback];\n}\n"],"names":["dsnToString","createEnvelope"],"mappings":";;;;AAGA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,QAAA;AACA,EAAA;AACA,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,GAAA;AACA,GAAA;;AAIA;AACA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA;AACA,IAAA,QAAA,EAAA,QAAA,CAAA,QAAA;AACA,IAAA,OAAA,EAAA,IAAA,IAAA,EAAA,CAAA,WAAA,EAAA;AACA,IAAA,IAAA,QAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA;AACA,QAAA,GAAA,EAAA;AACA,UAAA,IAAA,EAAA,QAAA,CAAA,GAAA,CAAA,IAAA;AACA,UAAA,OAAA,EAAA,QAAA,CAAA,GAAA,CAAA,OAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,IAAA,IAAA,CAAA,CAAA,MAAA,IAAA,CAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAAA,iBAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACA,GAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,8BAAA,CAAA,QAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAAC,oBAAA,CAAA,OAAA,EAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,8BAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAA,eAAA,GAAA;AACA,IAAA,IAAA,EAAA,aAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA;AACA;;;;"}import { BaseClient, SDK_VERSION } from '@sentry/core';
import { getSDKSource, logger, createClientReportEnvelope, dsnToString } from '@sentry/utils';
import { eventFromException, eventFromMessage } from './eventbuilder.js';
import { WINDOW } from './helpers.js';
import { BREADCRUMB_INTEGRATION_ID } from './integrations/breadcrumbs.js';
import { createUserFeedbackEnvelope } from './userfeedback.js';

/**
 * Configuration options for the Sentry Browser SDK.
 * @see @sentry/types Options for more information.
 */

/**
 * The Sentry Browser SDK Client.
 *
 * @see BrowserOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
class BrowserClient extends BaseClient {
  /**
   * Creates a new Browser SDK instance.
   *
   * @param options Configuration options for this SDK.
   */
   constructor(options) {
    const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();

    options._metadata = options._metadata || {};
    options._metadata.sdk = options._metadata.sdk || {
      name: 'sentry.javascript.browser',
      packages: [
        {
          name: `${sdkSource}:@sentry/browser`,
          version: SDK_VERSION,
        },
      ],
      version: SDK_VERSION,
    };

    super(options);

    if (options.sendClientReports && WINDOW.document) {
      WINDOW.document.addEventListener('visibilitychange', () => {
        if (WINDOW.document.visibilityState === 'hidden') {
          this._flushOutcomes();
        }
      });
    }
  }

  /**
   * @inheritDoc
   */
   eventFromException(exception, hint) {
    return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);
  }

  /**
   * @inheritDoc
   */
   eventFromMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level = 'info',
    hint,
  ) {
    return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);
  }

  /**
   * @inheritDoc
   */
   sendEvent(event, hint) {
    // We only want to add the sentry event breadcrumb when the user has the breadcrumb integration installed and
    // activated its `sentry` option.
    // We also do not want to use the `Breadcrumbs` class here directly, because we do not want it to be included in
    // bundles, if it is not used by the SDK.
    // This all sadly is a bit ugly, but we currently don't have a "pre-send" hook on the integrations so we do it this
    // way for now.
    const breadcrumbIntegration = this.getIntegrationById(BREADCRUMB_INTEGRATION_ID) ;
    // We check for definedness of `addSentryBreadcrumb` in case users provided their own integration with id
    // "Breadcrumbs" that does not have this function.
    if (breadcrumbIntegration && breadcrumbIntegration.addSentryBreadcrumb) {
      breadcrumbIntegration.addSentryBreadcrumb(event);
    }

    super.sendEvent(event, hint);
  }

  /**
   * Sends user feedback to Sentry.
   */
   captureUserFeedback(feedback) {
    if (!this._isEnabled()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('SDK not enabled, will not capture user feedback.');
      return;
    }

    const envelope = createUserFeedbackEnvelope(feedback, {
      metadata: this.getSdkMetadata(),
      dsn: this.getDsn(),
      tunnel: this.getOptions().tunnel,
    });
    void this._sendEnvelope(envelope);
  }

  /**
   * @inheritDoc
   */
   _prepareEvent(event, hint, scope) {
    event.platform = event.platform || 'javascript';
    return super._prepareEvent(event, hint, scope);
  }

  /**
   * Sends client reports as an envelope.
   */
   _flushOutcomes() {
    const outcomes = this._clearOutcomes();

    if (outcomes.length === 0) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('No outcomes to send');
      return;
    }

    if (!this._dsn) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('No dsn provided, will not send outcomes');
      return;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Sending outcomes:', outcomes);

    const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));
    void this._sendEnvelope(envelope);
  }
}

export { BrowserClient };
//# sourceMappingURL=client.js.map
{"version":3,"file":"client.js","sources":["../../../src/client.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { BaseClient, SDK_VERSION } from '@sentry/core';\nimport type {\n  BrowserClientReplayOptions,\n  ClientOptions,\n  Event,\n  EventHint,\n  Options,\n  Severity,\n  SeverityLevel,\n  UserFeedback,\n} from '@sentry/types';\nimport { createClientReportEnvelope, dsnToString, getSDKSource, logger } from '@sentry/utils';\n\nimport { eventFromException, eventFromMessage } from './eventbuilder';\nimport { WINDOW } from './helpers';\nimport type { Breadcrumbs } from './integrations';\nimport { BREADCRUMB_INTEGRATION_ID } from './integrations/breadcrumbs';\nimport type { BrowserTransportOptions } from './transports/types';\nimport { createUserFeedbackEnvelope } from './userfeedback';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\nexport type BrowserOptions = Options<BrowserTransportOptions> & BrowserClientReplayOptions;\n\n/**\n * Configuration options for the Sentry Browser SDK Client class\n * @see BrowserClient for more information.\n */\nexport type BrowserClientOptions = ClientOptions<BrowserTransportOptions>;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class BrowserClient extends BaseClient<BrowserClientOptions> {\n  /**\n   * Creates a new Browser SDK instance.\n   *\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: BrowserClientOptions) {\n    const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n\n    options._metadata = options._metadata || {};\n    options._metadata.sdk = options._metadata.sdk || {\n      name: 'sentry.javascript.browser',\n      packages: [\n        {\n          name: `${sdkSource}:@sentry/browser`,\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    super(options);\n\n    if (options.sendClientReports && WINDOW.document) {\n      WINDOW.document.addEventListener('visibilitychange', () => {\n        if (WINDOW.document.visibilityState === 'hidden') {\n          this._flushOutcomes();\n        }\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event> {\n    return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event, hint?: EventHint): void {\n    // We only want to add the sentry event breadcrumb when the user has the breadcrumb integration installed and\n    // activated its `sentry` option.\n    // We also do not want to use the `Breadcrumbs` class here directly, because we do not want it to be included in\n    // bundles, if it is not used by the SDK.\n    // This all sadly is a bit ugly, but we currently don't have a \"pre-send\" hook on the integrations so we do it this\n    // way for now.\n    const breadcrumbIntegration = this.getIntegrationById(BREADCRUMB_INTEGRATION_ID) as Breadcrumbs | undefined;\n    // We check for definedness of `addSentryBreadcrumb` in case users provided their own integration with id\n    // \"Breadcrumbs\" that does not have this function.\n    if (breadcrumbIntegration && breadcrumbIntegration.addSentryBreadcrumb) {\n      breadcrumbIntegration.addSentryBreadcrumb(event);\n    }\n\n    super.sendEvent(event, hint);\n  }\n\n  /**\n   * Sends user feedback to Sentry.\n   */\n  public captureUserFeedback(feedback: UserFeedback): void {\n    if (!this._isEnabled()) {\n      __DEBUG_BUILD__ && logger.warn('SDK not enabled, will not capture user feedback.');\n      return;\n    }\n\n    const envelope = createUserFeedbackEnvelope(feedback, {\n      metadata: this.getSdkMetadata(),\n      dsn: this.getDsn(),\n      tunnel: this.getOptions().tunnel,\n    });\n    void this._sendEnvelope(envelope);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    event.platform = event.platform || 'javascript';\n    return super._prepareEvent(event, hint, scope);\n  }\n\n  /**\n   * Sends client reports as an envelope.\n   */\n  private _flushOutcomes(): void {\n    const outcomes = this._clearOutcomes();\n\n    if (outcomes.length === 0) {\n      __DEBUG_BUILD__ && logger.log('No outcomes to send');\n      return;\n    }\n\n    if (!this._dsn) {\n      __DEBUG_BUILD__ && logger.log('No dsn provided, will not send outcomes');\n      return;\n    }\n\n    __DEBUG_BUILD__ && logger.log('Sending outcomes:', outcomes);\n\n    const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n    void this._sendEnvelope(envelope);\n  }\n}\n"],"names":[],"mappings":";;;;;;;AAqBA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,aAAA,SA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A,CAAA,KAAA,EAAA,IAAA,EAAA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,cAAA,GAAA;AACA,IAAA,MAAA,QAAA,GAAA,IAAA,CAAA,cAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,QAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,GAAA,CAAA,qBAAA,CAAA,CAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,GAAA,CAAA,yCAAA,CAAA,CAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,GAAA,CAAA,mBAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,QAAA,GAAA,0BAAA,CAAA,QAAA,EAAA,IAAA,CAAA,QAAA,CAAA,MAAA,IAAA,WAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,IAAA,KAAA,IAAA,CAAA,aAAA,CAAA,QAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { getCurrentHub } from '@sentry/core';
import { addExceptionMechanism, resolvedSyncPromise, isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, extractExceptionKeysForMessage, normalizeToSize } from '@sentry/utils';

/**
 * This function creates an exception from a JavaScript Error
 */
function exceptionFromError(stackParser, ex) {
  // Get the frames first since Opera can lose the stack if we touch anything else first
  const frames = parseStackFrames(stackParser, ex);

  const exception = {
    type: ex && ex.name,
    value: extractMessage(ex),
  };

  if (frames.length) {
    exception.stacktrace = { frames };
  }

  if (exception.type === undefined && exception.value === '') {
    exception.value = 'Unrecoverable error caught';
  }

  return exception;
}

/**
 * @hidden
 */
function eventFromPlainObject(
  stackParser,
  exception,
  syntheticException,
  isUnhandledRejection,
) {
  const hub = getCurrentHub();
  const client = hub.getClient();
  const normalizeDepth = client && client.getOptions().normalizeDepth;

  const event = {
    exception: {
      values: [
        {
          type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',
          value: `Non-Error ${
            isUnhandledRejection ? 'promise rejection' : 'exception'
          } captured with keys: ${extractExceptionKeysForMessage(exception)}`,
        },
      ],
    },
    extra: {
      __serialized__: normalizeToSize(exception, normalizeDepth),
    },
  };

  if (syntheticException) {
    const frames = parseStackFrames(stackParser, syntheticException);
    if (frames.length) {
      // event.exception.values[0] has been set above
      (event.exception ).values[0].stacktrace = { frames };
    }
  }

  return event;
}

/**
 * @hidden
 */
function eventFromError(stackParser, ex) {
  return {
    exception: {
      values: [exceptionFromError(stackParser, ex)],
    },
  };
}

/** Parses stack frames from an error */
function parseStackFrames(
  stackParser,
  ex,
) {
  // Access and store the stacktrace property before doing ANYTHING
  // else to it because Opera is not very good at providing it
  // reliably in other circumstances.
  const stacktrace = ex.stacktrace || ex.stack || '';

  const popSize = getPopSize(ex);

  try {
    return stackParser(stacktrace, popSize);
  } catch (e) {
    // no-empty
  }

  return [];
}

// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108
const reactMinifiedRegexp = /Minified React error #\d+;/i;

function getPopSize(ex) {
  if (ex) {
    if (typeof ex.framesToPop === 'number') {
      return ex.framesToPop;
    }

    if (reactMinifiedRegexp.test(ex.message)) {
      return 1;
    }
  }

  return 0;
}

/**
 * There are cases where stacktrace.message is an Event object
 * https://github.com/getsentry/sentry-javascript/issues/1949
 * In this specific case we try to extract stacktrace.message.error.message
 */
function extractMessage(ex) {
  const message = ex && ex.message;
  if (!message) {
    return 'No error message';
  }
  if (message.error && typeof message.error.message === 'string') {
    return message.error.message;
  }
  return message;
}

/**
 * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
 * @hidden
 */
function eventFromException(
  stackParser,
  exception,
  hint,
  attachStacktrace,
) {
  const syntheticException = (hint && hint.syntheticException) || undefined;
  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);
  addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }
  event.level = 'error';
  if (hint && hint.event_id) {
    event.event_id = hint.event_id;
  }
  return resolvedSyncPromise(event);
}

/**
 * Builds and Event from a Message
 * @hidden
 */
function eventFromMessage(
  stackParser,
  message,
  // eslint-disable-next-line deprecation/deprecation
  level = 'info',
  hint,
  attachStacktrace,
) {
  const syntheticException = (hint && hint.syntheticException) || undefined;
  const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
  event.level = level;
  if (hint && hint.event_id) {
    event.event_id = hint.event_id;
  }
  return resolvedSyncPromise(event);
}

/**
 * @hidden
 */
function eventFromUnknownInput(
  stackParser,
  exception,
  syntheticException,
  attachStacktrace,
  isUnhandledRejection,
) {
  let event;

  if (isErrorEvent(exception ) && (exception ).error) {
    // If it is an ErrorEvent with `error` property, extract it to get actual Error
    const errorEvent = exception ;
    return eventFromError(stackParser, errorEvent.error );
  }

  // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name
  // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be
  // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.
  //
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError
  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException
  // https://webidl.spec.whatwg.org/#es-DOMException-specialness
  if (isDOMError(exception ) || isDOMException(exception )) {
    const domException = exception ;

    if ('stack' in (exception )) {
      event = eventFromError(stackParser, exception );
    } else {
      const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');
      const message = domException.message ? `${name}: ${domException.message}` : name;
      event = eventFromString(stackParser, message, syntheticException, attachStacktrace);
      addExceptionTypeValue(event, message);
    }
    if ('code' in domException) {
      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
    }

    return event;
  }
  if (isError(exception)) {
    // we have a real Error object, do nothing
    return eventFromError(stackParser, exception);
  }
  if (isPlainObject(exception) || isEvent(exception)) {
    // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize
    // it manually. This will allow us to group events based on top-level keys which is much better than creating a new
    // group on any key/value change.
    const objectException = exception ;
    event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);
    addExceptionMechanism(event, {
      synthetic: true,
    });
    return event;
  }

  // If none of previous checks were valid, then it means that it's not:
  // - an instance of DOMError
  // - an instance of DOMException
  // - an instance of Event
  // - an instance of Error
  // - a valid ErrorEvent (one with an error property)
  // - a plain Object
  //
  // So bail out and capture it as a simple message:
  event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);
  addExceptionTypeValue(event, `${exception}`, undefined);
  addExceptionMechanism(event, {
    synthetic: true,
  });

  return event;
}

/**
 * @hidden
 */
function eventFromString(
  stackParser,
  input,
  syntheticException,
  attachStacktrace,
) {
  const event = {
    message: input,
  };

  if (attachStacktrace && syntheticException) {
    const frames = parseStackFrames(stackParser, syntheticException);
    if (frames.length) {
      event.exception = {
        values: [{ value: input, stacktrace: { frames } }],
      };
    }
  }

  return event;
}

export { eventFromError, eventFromException, eventFromMessage, eventFromPlainObject, eventFromString, eventFromUnknownInput, exceptionFromError, parseStackFrames };
//# sourceMappingURL=eventbuilder.js.map
{"version":3,"file":"eventbuilder.js","sources":["../../../src/eventbuilder.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  extractExceptionKeysForMessage,\n  isDOMError,\n  isDOMException,\n  isError,\n  isErrorEvent,\n  isEvent,\n  isPlainObject,\n  normalizeToSize,\n  resolvedSyncPromise,\n} from '@sentry/utils';\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nexport function exceptionFromError(stackParser: StackParser, ex: Error): Exception {\n  // Get the frames first since Opera can lose the stack if we touch anything else first\n  const frames = parseStackFrames(stackParser, ex);\n\n  const exception: Exception = {\n    type: ex && ex.name,\n    value: extractMessage(ex),\n  };\n\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  if (exception.type === undefined && exception.value === '') {\n    exception.value = 'Unrecoverable error caught';\n  }\n\n  return exception;\n}\n\n/**\n * @hidden\n */\nexport function eventFromPlainObject(\n  stackParser: StackParser,\n  exception: Record<string, unknown>,\n  syntheticException?: Error,\n  isUnhandledRejection?: boolean,\n): Event {\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n  const event: Event = {\n    exception: {\n      values: [\n        {\n          type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n          value: `Non-Error ${\n            isUnhandledRejection ? 'promise rejection' : 'exception'\n          } captured with keys: ${extractExceptionKeysForMessage(exception)}`,\n        },\n      ],\n    },\n    extra: {\n      __serialized__: normalizeToSize(exception, normalizeDepth),\n    },\n  };\n\n  if (syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      // event.exception.values[0] has been set above\n      (event.exception as { values: Exception[] }).values[0].stacktrace = { frames };\n    }\n  }\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromError(stackParser: StackParser, ex: Error): Event {\n  return {\n    exception: {\n      values: [exceptionFromError(stackParser, ex)],\n    },\n  };\n}\n\n/** Parses stack frames from an error */\nexport function parseStackFrames(\n  stackParser: StackParser,\n  ex: Error & { framesToPop?: number; stacktrace?: string },\n): StackFrame[] {\n  // Access and store the stacktrace property before doing ANYTHING\n  // else to it because Opera is not very good at providing it\n  // reliably in other circumstances.\n  const stacktrace = ex.stacktrace || ex.stack || '';\n\n  const popSize = getPopSize(ex);\n\n  try {\n    return stackParser(stacktrace, popSize);\n  } catch (e) {\n    // no-empty\n  }\n\n  return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex: Error & { framesToPop?: number }): number {\n  if (ex) {\n    if (typeof ex.framesToPop === 'number') {\n      return ex.framesToPop;\n    }\n\n    if (reactMinifiedRegexp.test(ex.message)) {\n      return 1;\n    }\n  }\n\n  return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex: Error & { message: { error?: Error } }): string {\n  const message = ex && ex.message;\n  if (!message) {\n    return 'No error message';\n  }\n  if (message.error && typeof message.error.message === 'string') {\n    return message.error.message;\n  }\n  return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nexport function eventFromException(\n  stackParser: StackParser,\n  exception: unknown,\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n  addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n  event.level = 'error';\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): PromiseLike<Event> {\n  const syntheticException = (hint && hint.syntheticException) || undefined;\n  const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n  event.level = level;\n  if (hint && hint.event_id) {\n    event.event_id = hint.event_id;\n  }\n  return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nexport function eventFromUnknownInput(\n  stackParser: StackParser,\n  exception: unknown,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n  isUnhandledRejection?: boolean,\n): Event {\n  let event: Event;\n\n  if (isErrorEvent(exception as ErrorEvent) && (exception as ErrorEvent).error) {\n    // If it is an ErrorEvent with `error` property, extract it to get actual Error\n    const errorEvent = exception as ErrorEvent;\n    return eventFromError(stackParser, errorEvent.error as Error);\n  }\n\n  // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n  // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n  // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n  //\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n  // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n  // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n  if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {\n    const domException = exception as DOMException;\n\n    if ('stack' in (exception as Error)) {\n      event = eventFromError(stackParser, exception as Error);\n    } else {\n      const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n      const message = domException.message ? `${name}: ${domException.message}` : name;\n      event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n      addExceptionTypeValue(event, message);\n    }\n    if ('code' in domException) {\n      event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n    }\n\n    return event;\n  }\n  if (isError(exception)) {\n    // we have a real Error object, do nothing\n    return eventFromError(stackParser, exception);\n  }\n  if (isPlainObject(exception) || isEvent(exception)) {\n    // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n    // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n    // group on any key/value change.\n    const objectException = exception as Record<string, unknown>;\n    event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n    addExceptionMechanism(event, {\n      synthetic: true,\n    });\n    return event;\n  }\n\n  // If none of previous checks were valid, then it means that it's not:\n  // - an instance of DOMError\n  // - an instance of DOMException\n  // - an instance of Event\n  // - an instance of Error\n  // - a valid ErrorEvent (one with an error property)\n  // - a plain Object\n  //\n  // So bail out and capture it as a simple message:\n  event = eventFromString(stackParser, exception as string, syntheticException, attachStacktrace);\n  addExceptionTypeValue(event, `${exception}`, undefined);\n  addExceptionMechanism(event, {\n    synthetic: true,\n  });\n\n  return event;\n}\n\n/**\n * @hidden\n */\nexport function eventFromString(\n  stackParser: StackParser,\n  input: string,\n  syntheticException?: Error,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    message: input,\n  };\n\n  if (attachStacktrace && syntheticException) {\n    const frames = parseStackFrames(stackParser, syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [{ value: input, stacktrace: { frames } }],\n      };\n    }\n  }\n\n  return event;\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,WAAA,EAAA,EAAA,EAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,gBAAA,CAAA,WAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,SAAA,GAAA;AACA,IAAA,IAAA,EAAA,EAAA,IAAA,EAAA,CAAA,IAAA;AACA,IAAA,KAAA,EAAA,cAAA,CAAA,EAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,CAAA,MAAA,EAAA;AACA,IAAA,SAAA,CAAA,UAAA,GAAA,EAAA,MAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,SAAA,CAAA,IAAA,KAAA,SAAA,IAAA,SAAA,CAAA,KAAA,KAAA,EAAA,EAAA;AACA,IAAA,SAAA,CAAA,KAAA,GAAA,4BAAA,CAAA;AACA,GAAA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BAAA,CAAA,WAAA,EAAA,kBAAA,CAAA,CAAA;AACA,IAAA,IAAA,MAAA,CAAA,MAAA,EAAA;AACA,MAAA,KAAA,CAAA,SAAA,GAAA;AACA,QAAA,MAAA,EAAA,CAAA,EAAA,KAAA,EAAA,KAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA;;;;"}import { withScope, captureException } from '@sentry/core';
import { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, addExceptionTypeValue, addExceptionMechanism } from '@sentry/utils';

const WINDOW = GLOBAL_OBJ ;

let ignoreOnError = 0;

/**
 * @hidden
 */
function shouldIgnoreOnError() {
  return ignoreOnError > 0;
}

/**
 * @hidden
 */
function ignoreNextOnError() {
  // onerror should trigger before setTimeout
  ignoreOnError++;
  setTimeout(() => {
    ignoreOnError--;
  });
}

/**
 * Instruments the given function and sends an event to Sentry every time the
 * function throws an exception.
 *
 * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
 * has a correct `this` context.
 * @returns The wrapped function.
 * @hidden
 */
function wrap(
  fn,
  options

 = {},
  before,
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
  // for future readers what this does is wrap a function and then create
  // a bi-directional wrapping between them.
  //
  // example: wrapped = wrap(original);
  //  original.__sentry_wrapped__ -> wrapped
  //  wrapped.__sentry_original__ -> original

  if (typeof fn !== 'function') {
    return fn;
  }

  try {
    // if we're dealing with a function that was previously wrapped, return
    // the original wrapper.
    const wrapper = fn.__sentry_wrapped__;
    if (wrapper) {
      return wrapper;
    }

    // We don't wanna wrap it twice
    if (getOriginalFunction(fn)) {
      return fn;
    }
  } catch (e) {
    // Just accessing custom props in some Selenium environments
    // can cause a "Permission denied" exception (see raven-js#495).
    // Bail on wrapping and return the function as-is (defers to window.onerror).
    return fn;
  }

  /* eslint-disable prefer-rest-params */
  // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`
  const sentryWrapped = function () {
    const args = Array.prototype.slice.call(arguments);

    try {
      if (before && typeof before === 'function') {
        before.apply(this, arguments);
      }

      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
      const wrappedArguments = args.map((arg) => wrap(arg, options));

      // Attempt to invoke user-land function
      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
      //       means the sentry.javascript SDK caught an error invoking your application code. This
      //       is expected behavior and NOT indicative of a bug with sentry.javascript.
      return fn.apply(this, wrappedArguments);
    } catch (ex) {
      ignoreNextOnError();

      withScope((scope) => {
        scope.addEventProcessor((event) => {
          if (options.mechanism) {
            addExceptionTypeValue(event, undefined, undefined);
            addExceptionMechanism(event, options.mechanism);
          }

          event.extra = {
            ...event.extra,
            arguments: args,
          };

          return event;
        });

        captureException(ex);
      });

      throw ex;
    }
  };
  /* eslint-enable prefer-rest-params */

  // Accessing some objects may throw
  // ref: https://github.com/getsentry/sentry-javascript/issues/1168
  try {
    for (const property in fn) {
      if (Object.prototype.hasOwnProperty.call(fn, property)) {
        sentryWrapped[property] = fn[property];
      }
    }
  } catch (_oO) {} // eslint-disable-line no-empty

  // Signal that this function has been wrapped/filled already
  // for both debugging and to prevent it to being wrapped/filled twice
  markFunctionWrapped(sentryWrapped, fn);

  addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);

  // Restore original function name (not all browsers allow that)
  try {
    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;
    if (descriptor.configurable) {
      Object.defineProperty(sentryWrapped, 'name', {
        get() {
          return fn.name;
        },
      });
    }
    // eslint-disable-next-line no-empty
  } catch (_oO) {}

  return sentryWrapped;
}

/**
 * All properties the report dialog supports
 */

export { WINDOW, ignoreNextOnError, shouldIgnoreOnError, wrap };
//# sourceMappingURL=helpers.js.map
{"version":3,"file":"helpers.js","sources":["../../../src/helpers.ts"],"sourcesContent":["import { captureException, withScope } from '@sentry/core';\nimport type { DsnLike, Event as SentryEvent, Mechanism, Scope, WrappedFunction } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  addNonEnumerableProperty,\n  getOriginalFunction,\n  GLOBAL_OBJ,\n  markFunctionWrapped,\n} from '@sentry/utils';\n\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nlet ignoreOnError: number = 0;\n\n/**\n * @hidden\n */\nexport function shouldIgnoreOnError(): boolean {\n  return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nexport function ignoreNextOnError(): void {\n  // onerror should trigger before setTimeout\n  ignoreOnError++;\n  setTimeout(() => {\n    ignoreOnError--;\n  });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nexport function wrap(\n  fn: WrappedFunction,\n  options: {\n    mechanism?: Mechanism;\n  } = {},\n  before?: WrappedFunction,\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): any {\n  // for future readers what this does is wrap a function and then create\n  // a bi-directional wrapping between them.\n  //\n  // example: wrapped = wrap(original);\n  //  original.__sentry_wrapped__ -> wrapped\n  //  wrapped.__sentry_original__ -> original\n\n  if (typeof fn !== 'function') {\n    return fn;\n  }\n\n  try {\n    // if we're dealing with a function that was previously wrapped, return\n    // the original wrapper.\n    const wrapper = fn.__sentry_wrapped__;\n    if (wrapper) {\n      return wrapper;\n    }\n\n    // We don't wanna wrap it twice\n    if (getOriginalFunction(fn)) {\n      return fn;\n    }\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    // Bail on wrapping and return the function as-is (defers to window.onerror).\n    return fn;\n  }\n\n  /* eslint-disable prefer-rest-params */\n  // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n  const sentryWrapped: WrappedFunction = function (this: unknown): void {\n    const args = Array.prototype.slice.call(arguments);\n\n    try {\n      if (before && typeof before === 'function') {\n        before.apply(this, arguments);\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n      const wrappedArguments = args.map((arg: any) => wrap(arg, options));\n\n      // Attempt to invoke user-land function\n      // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n      //       means the sentry.javascript SDK caught an error invoking your application code. This\n      //       is expected behavior and NOT indicative of a bug with sentry.javascript.\n      return fn.apply(this, wrappedArguments);\n    } catch (ex) {\n      ignoreNextOnError();\n\n      withScope((scope: Scope) => {\n        scope.addEventProcessor((event: SentryEvent) => {\n          if (options.mechanism) {\n            addExceptionTypeValue(event, undefined, undefined);\n            addExceptionMechanism(event, options.mechanism);\n          }\n\n          event.extra = {\n            ...event.extra,\n            arguments: args,\n          };\n\n          return event;\n        });\n\n        captureException(ex);\n      });\n\n      throw ex;\n    }\n  };\n  /* eslint-enable prefer-rest-params */\n\n  // Accessing some objects may throw\n  // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n  try {\n    for (const property in fn) {\n      if (Object.prototype.hasOwnProperty.call(fn, property)) {\n        sentryWrapped[property] = fn[property];\n      }\n    }\n  } catch (_oO) {} // eslint-disable-line no-empty\n\n  // Signal that this function has been wrapped/filled already\n  // for both debugging and to prevent it to being wrapped/filled twice\n  markFunctionWrapped(sentryWrapped, fn);\n\n  addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n  // Restore original function name (not all browsers allow that)\n  try {\n    const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') as PropertyDescriptor;\n    if (descriptor.configurable) {\n      Object.defineProperty(sentryWrapped, 'name', {\n        get(): string {\n          return fn.name;\n        },\n      });\n    }\n    // eslint-disable-next-line no-empty\n  } catch (_oO) {}\n\n  return sentryWrapped;\n}\n\n/**\n * All properties the report dialog supports\n */\nexport interface ReportDialogOptions {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: string]: any;\n  eventId?: string;\n  dsn?: DsnLike;\n  user?: {\n    email?: string;\n    name?: string;\n  };\n  lang?: string;\n  title?: string;\n  subtitle?: string;\n  subtitle2?: string;\n  labelName?: string;\n  labelEmail?: string;\n  labelComments?: string;\n  labelClose?: string;\n  labelSubmit?: string;\n  errorGeneric?: string;\n  errorFormEntry?: string;\n  successMessage?: string;\n  /** Callback after reportDialog showed up */\n  onLoad?(this: void): void;\n}\n"],"names":[],"mappings":";;;AAWA,MAAA,MAAA,GAAA,UAAA,EAAA;AACA;AACA,IAAA,aAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,GAAA;AACA,EAAA,OAAA,aAAA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,GAAA;AACA;AACA,EAAA,aAAA,EAAA,CAAA;AACA,EAAA,UAAA,CAAA,MAAA;AACA,IAAA,aAAA,EAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA;AACA,EAAA,EAAA;AACA,EAAA,OAAA;AACA;AACA,GAAA,EAAA;AACA,EAAA,MAAA;AACA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,OAAA,EAAA,KAAA,UAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA;AACA;AACA,IAAA,MAAA,OAAA,GAAA,EAAA,CAAA,kBAAA,CAAA;AACA,IAAA,IAAA,OAAA,EAAA;AACA,MAAA,OAAA,OAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAA,mBAAA,CAAA,EAAA,CAAA,EAAA;AACA,MAAA,OAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA;AAC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ACA;AACA;AACA;AACA,EAAA,IAAA;AACA,IAAA,KAAA,MAAA,QAAA,IAAA,EAAA,EAAA;AACA,MAAA,IAAA,MAAA,CAAA,SAAA,CAAA,cAAA,CAAA,IAAA,CAAA,EAAA,EAAA,QAAA,CAAA,EAAA;AACA,QAAA,aAAA,CAAA,QAAA,CAAA,GAAA,EAAA,CAAA,QAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,mBAAA,CAAA,aAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,EAAA,wBAAA,CAAA,EAAA,EAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,UAAA,GAAA,MAAA,CAAA,wBAAA,CAAA,aAAA,EAAA,MAAA,CAAA,EAAA;AACA,IAAA,IAAA,UAAA,CAAA,YAAA,EAAA;AACA,MAAA,MAAA,CAAA,cAAA,CAAA,aAAA,EAAA,MAAA,EAAA;AACA,QAAA,GAAA,GAAA;AACA,UAAA,OAAA,EAAA,CAAA,IAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA;AACA,EAAA,OAAA,aAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;;;;"}import { Integrations } from '@sentry/core';
export { FunctionToString, Hub, InboundFilters, SDK_VERSION, Scope, addBreadcrumb, addGlobalEventProcessor, addTracingExtensions, captureEvent, captureException, captureMessage, configureScope, createTransport, extractTraceparentData, getActiveTransaction, getCurrentHub, getHubFromCarrier, makeMain, setContext, setExtra, setExtras, setTag, setTags, setUser, spanStatusfromHttpCode, startTransaction, trace, withScope } from '@sentry/core';
import { WINDOW } from './helpers.js';
export { WINDOW } from './helpers.js';
export { BrowserClient } from './client.js';
export { makeFetchTransport } from './transports/fetch.js';
export { makeXHRTransport } from './transports/xhr.js';
export { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser } from './stack-parsers.js';
export { eventFromException, eventFromMessage } from './eventbuilder.js';
export { createUserFeedbackEnvelope } from './userfeedback.js';
export { captureUserFeedback, close, defaultIntegrations, flush, forceLoad, init, lastEventId, onLoad, showReportDialog, wrap } from './sdk.js';
import * as index from './integrations/index.js';
export { Replay } from '@sentry/replay';
export { BrowserTracing, defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from '@sentry-internal/tracing';
export { makeBrowserOfflineTransport } from './transports/offline.js';
export { onProfilingStartRouteTransaction } from './profiling/hubextensions.js';
export { BrowserProfilingIntegration } from './profiling/integration.js';
export { GlobalHandlers } from './integrations/globalhandlers.js';
export { TryCatch } from './integrations/trycatch.js';
export { Breadcrumbs } from './integrations/breadcrumbs.js';
export { LinkedErrors } from './integrations/linkederrors.js';
export { HttpContext } from './integrations/httpcontext.js';
export { Dedupe } from './integrations/dedupe.js';

let windowIntegrations = {};

// This block is needed to add compatibility with the integrations packages when used with a CDN
if (WINDOW.Sentry && WINDOW.Sentry.Integrations) {
  windowIntegrations = WINDOW.Sentry.Integrations;
}

const INTEGRATIONS = {
  ...windowIntegrations,
  ...Integrations,
  ...index,
};

export { INTEGRATIONS as Integrations };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["export * from './exports';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport { WINDOW } from './helpers';\nimport * as BrowserIntegrations from './integrations';\n\nlet windowIntegrations = {};\n\n// This block is needed to add compatibility with the integrations packages when used with a CDN\nif (WINDOW.Sentry && WINDOW.Sentry.Integrations) {\n  windowIntegrations = WINDOW.Sentry.Integrations;\n}\n\nconst INTEGRATIONS = {\n  ...windowIntegrations,\n  ...CoreIntegrations,\n  ...BrowserIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations };\n\nexport { Replay } from '@sentry/replay';\nexport {\n  BrowserTracing,\n  defaultRequestInstrumentationOptions,\n  instrumentOutgoingRequests,\n} from '@sentry-internal/tracing';\nexport type { RequestInstrumentationOptions } from '@sentry-internal/tracing';\nexport {\n  addTracingExtensions,\n  extractTraceparentData,\n  getActiveTransaction,\n  spanStatusfromHttpCode,\n  trace,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport type { Span } from '@sentry/types';\nexport { makeBrowserOfflineTransport } from './transports/offline';\nexport { onProfilingStartRouteTransaction } from './profiling/hubextensions';\nexport { BrowserProfilingIntegration } from './profiling/integration';\n"],"names":["CoreIntegrations","BrowserIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAA,kBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,IAAA,MAAA,CAAA,MAAA,IAAA,MAAA,CAAA,MAAA,CAAA,YAAA,EAAA;AACA,EAAA,kBAAA,GAAA,MAAA,CAAA,MAAA,CAAA,YAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,YAAA,GAAA;AACA,EAAA,GAAA,kBAAA;AACA,EAAA,GAAAA,YAAA;AACA,EAAA,GAAAC,KAAA;AACA;;;;"}import { getCurrentHub } from '@sentry/core';
import { addInstrumentationHandler, getEventDescription, severityLevelFromString, safeJoin, SENTRY_XHR_DATA_KEY, parseUrl, logger, htmlTreeAsString } from '@sentry/utils';
import { WINDOW } from '../helpers.js';

/* eslint-disable @typescript-eslint/no-unsafe-member-access */

/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */
const MAX_ALLOWED_STRING_LENGTH = 1024;

const BREADCRUMB_INTEGRATION_ID = 'Breadcrumbs';

/**
 * Default Breadcrumbs instrumentations
 * TODO: Deprecated - with v6, this will be renamed to `Instrument`
 */
class Breadcrumbs  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = BREADCRUMB_INTEGRATION_ID;}

  /**
   * @inheritDoc
   */
   __init() {this.name = Breadcrumbs.id;}

  /**
   * Options of the breadcrumbs integration.
   */
  // This field is public, because we use it in the browser client to check if the `sentry` option is enabled.

  /**
   * @inheritDoc
   */
   constructor(options) {Breadcrumbs.prototype.__init.call(this);
    this.options = {
      console: true,
      dom: true,
      fetch: true,
      history: true,
      sentry: true,
      xhr: true,
      ...options,
    };
  }

  /**
   * Instrument browser built-ins w/ breadcrumb capturing
   *  - Console API
   *  - DOM API (click/typing)
   *  - XMLHttpRequest API
   *  - Fetch API
   *  - History API
   */
   setupOnce() {
    if (this.options.console) {
      addInstrumentationHandler('console', _consoleBreadcrumb);
    }
    if (this.options.dom) {
      addInstrumentationHandler('dom', _domBreadcrumb(this.options.dom));
    }
    if (this.options.xhr) {
      addInstrumentationHandler('xhr', _xhrBreadcrumb);
    }
    if (this.options.fetch) {
      addInstrumentationHandler('fetch', _fetchBreadcrumb);
    }
    if (this.options.history) {
      addInstrumentationHandler('history', _historyBreadcrumb);
    }
  }

  /**
   * Adds a breadcrumb for Sentry events or transactions if this option is enabled.
   */
   addSentryBreadcrumb(event) {
    if (this.options.sentry) {
      getCurrentHub().addBreadcrumb(
        {
          category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,
          event_id: event.event_id,
          level: event.level,
          message: getEventDescription(event),
        },
        {
          event,
        },
      );
    }
  }
} Breadcrumbs.__initStatic();

/**
 * A HOC that creaes a function that creates breadcrumbs from DOM API calls.
 * This is a HOC so that we get access to dom options in the closure.
 */
function _domBreadcrumb(dom) {
  function _innerDomBreadcrumb(handlerData) {
    let target;
    let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;

    let maxStringLength =
      typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;
    if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn(
          `\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,
        );
      maxStringLength = MAX_ALLOWED_STRING_LENGTH;
    }

    if (typeof keyAttrs === 'string') {
      keyAttrs = [keyAttrs];
    }

    // Accessing event.target can throw (see getsentry/raven-js#838, #768)
    try {
      const event = handlerData.event ;
      target = _isEvent(event)
        ? htmlTreeAsString(event.target, { keyAttrs, maxStringLength })
        : htmlTreeAsString(event, { keyAttrs, maxStringLength });
    } catch (e) {
      target = '<unknown>';
    }

    if (target.length === 0) {
      return;
    }

    getCurrentHub().addBreadcrumb(
      {
        category: `ui.${handlerData.name}`,
        message: target,
      },
      {
        event: handlerData.event,
        name: handlerData.name,
        global: handlerData.global,
      },
    );
  }

  return _innerDomBreadcrumb;
}

/**
 * Creates breadcrumbs from console API calls
 */
function _consoleBreadcrumb(handlerData) {
  // This is a hack to fix a Vue3-specific bug that causes an infinite loop of
  // console warnings. This happens when a Vue template is rendered with
  // an undeclared variable, which we try to stringify, ultimately causing
  // Vue to issue another warning which repeats indefinitely.
  // see: https://github.com/getsentry/sentry-javascript/pull/6010
  // see: https://github.com/getsentry/sentry-javascript/issues/5916
  for (let i = 0; i < handlerData.args.length; i++) {
    if (handlerData.args[i] === 'ref=Ref<') {
      handlerData.args[i + 1] = 'viewRef';
      break;
    }
  }
  const breadcrumb = {
    category: 'console',
    data: {
      arguments: handlerData.args,
      logger: 'console',
    },
    level: severityLevelFromString(handlerData.level),
    message: safeJoin(handlerData.args, ' '),
  };

  if (handlerData.level === 'assert') {
    if (handlerData.args[0] === false) {
      breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;
      breadcrumb.data.arguments = handlerData.args.slice(1);
    } else {
      // Don't capture a breadcrumb for passed assertions
      return;
    }
  }

  getCurrentHub().addBreadcrumb(breadcrumb, {
    input: handlerData.args,
    level: handlerData.level,
  });
}

/**
 * Creates breadcrumbs from XHR API calls
 */
function _xhrBreadcrumb(handlerData) {
  const { startTimestamp, endTimestamp } = handlerData;

  const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];

  // We only capture complete, non-sentry requests
  if (!startTimestamp || !endTimestamp || !sentryXhrData) {
    return;
  }

  const { method, url, status_code, body } = sentryXhrData;

  const data = {
    method,
    url,
    status_code,
  };

  const hint = {
    xhr: handlerData.xhr,
    input: body,
    startTimestamp,
    endTimestamp,
  };

  getCurrentHub().addBreadcrumb(
    {
      category: 'xhr',
      data,
      type: 'http',
    },
    hint,
  );
}

/**
 * Creates breadcrumbs from fetch API calls
 */
function _fetchBreadcrumb(handlerData) {
  const { startTimestamp, endTimestamp } = handlerData;

  // We only capture complete fetch requests
  if (!endTimestamp) {
    return;
  }

  if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {
    // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)
    return;
  }

  if (handlerData.error) {
    const data = handlerData.fetchData;
    const hint = {
      data: handlerData.error,
      input: handlerData.args,
      startTimestamp,
      endTimestamp,
    };

    getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data,
        level: 'error',
        type: 'http',
      },
      hint,
    );
  } else {
    const data = {
      ...handlerData.fetchData,
      status_code: handlerData.response && handlerData.response.status,
    };
    const hint = {
      input: handlerData.args,
      response: handlerData.response,
      startTimestamp,
      endTimestamp,
    };
    getCurrentHub().addBreadcrumb(
      {
        category: 'fetch',
        data,
        type: 'http',
      },
      hint,
    );
  }
}

/**
 * Creates breadcrumbs from history API calls
 */
function _historyBreadcrumb(handlerData) {
  let from = handlerData.from;
  let to = handlerData.to;
  const parsedLoc = parseUrl(WINDOW.location.href);
  let parsedFrom = parseUrl(from);
  const parsedTo = parseUrl(to);

  // Initial pushState doesn't provide `from` information
  if (!parsedFrom.path) {
    parsedFrom = parsedLoc;
  }

  // Use only the path component of the URL if the URL matches the current
  // document (almost all the time when using pushState)
  if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {
    to = parsedTo.relative;
  }
  if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {
    from = parsedFrom.relative;
  }

  getCurrentHub().addBreadcrumb({
    category: 'navigation',
    data: {
      from,
      to,
    },
  });
}

function _isEvent(event) {
  return event && !!(event ).target;
}

export { BREADCRUMB_INTEGRATION_ID, Breadcrumbs };
//# sourceMappingURL=breadcrumbs.js.map
{"version":3,"file":"breadcrumbs.js","sources":["../../../../src/integrations/breadcrumbs.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable max-lines */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event as SentryEvent, HandlerDataFetch, HandlerDataXhr, Integration } from '@sentry/types';\nimport type {\n  FetchBreadcrumbData,\n  FetchBreadcrumbHint,\n  XhrBreadcrumbData,\n  XhrBreadcrumbHint,\n} from '@sentry/types/build/types/breadcrumb';\nimport {\n  addInstrumentationHandler,\n  getEventDescription,\n  htmlTreeAsString,\n  logger,\n  parseUrl,\n  safeJoin,\n  SENTRY_XHR_DATA_KEY,\n  severityLevelFromString,\n} from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\ntype HandlerData = Record<string, unknown>;\n\n/** JSDoc */\ninterface BreadcrumbsOptions {\n  console: boolean;\n  dom:\n    | boolean\n    | {\n        serializeAttribute?: string | string[];\n        maxStringLength?: number;\n      };\n  fetch: boolean;\n  history: boolean;\n  sentry: boolean;\n  xhr: boolean;\n}\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nexport const BREADCRUMB_INTEGRATION_ID = 'Breadcrumbs';\n\n/**\n * Default Breadcrumbs instrumentations\n * TODO: Deprecated - with v6, this will be renamed to `Instrument`\n */\nexport class Breadcrumbs implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = BREADCRUMB_INTEGRATION_ID;\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Breadcrumbs.id;\n\n  /**\n   * Options of the breadcrumbs integration.\n   */\n  // This field is public, because we use it in the browser client to check if the `sentry` option is enabled.\n  public readonly options: Readonly<BreadcrumbsOptions>;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<BreadcrumbsOptions>) {\n    this.options = {\n      console: true,\n      dom: true,\n      fetch: true,\n      history: true,\n      sentry: true,\n      xhr: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Instrument browser built-ins w/ breadcrumb capturing\n   *  - Console API\n   *  - DOM API (click/typing)\n   *  - XMLHttpRequest API\n   *  - Fetch API\n   *  - History API\n   */\n  public setupOnce(): void {\n    if (this.options.console) {\n      addInstrumentationHandler('console', _consoleBreadcrumb);\n    }\n    if (this.options.dom) {\n      addInstrumentationHandler('dom', _domBreadcrumb(this.options.dom));\n    }\n    if (this.options.xhr) {\n      addInstrumentationHandler('xhr', _xhrBreadcrumb);\n    }\n    if (this.options.fetch) {\n      addInstrumentationHandler('fetch', _fetchBreadcrumb);\n    }\n    if (this.options.history) {\n      addInstrumentationHandler('history', _historyBreadcrumb);\n    }\n  }\n\n  /**\n   * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n   */\n  public addSentryBreadcrumb(event: SentryEvent): void {\n    if (this.options.sentry) {\n      getCurrentHub().addBreadcrumb(\n        {\n          category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n          event_id: event.event_id,\n          level: event.level,\n          message: getEventDescription(event),\n        },\n        {\n          event,\n        },\n      );\n    }\n  }\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _domBreadcrumb(dom: BreadcrumbsOptions['dom']): (handlerData: HandlerData) => void {\n  function _innerDomBreadcrumb(handlerData: HandlerData): void {\n    let target;\n    let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n    let maxStringLength =\n      typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n    if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n        );\n      maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n    }\n\n    if (typeof keyAttrs === 'string') {\n      keyAttrs = [keyAttrs];\n    }\n\n    // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n    try {\n      const event = handlerData.event as Event | Node;\n      target = _isEvent(event)\n        ? htmlTreeAsString(event.target, { keyAttrs, maxStringLength })\n        : htmlTreeAsString(event, { keyAttrs, maxStringLength });\n    } catch (e) {\n      target = '<unknown>';\n    }\n\n    if (target.length === 0) {\n      return;\n    }\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: `ui.${handlerData.name}`,\n        message: target,\n      },\n      {\n        event: handlerData.event,\n        name: handlerData.name,\n        global: handlerData.global,\n      },\n    );\n  }\n\n  return _innerDomBreadcrumb;\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _consoleBreadcrumb(handlerData: HandlerData & { args: unknown[]; level: string }): void {\n  // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n  // console warnings. This happens when a Vue template is rendered with\n  // an undeclared variable, which we try to stringify, ultimately causing\n  // Vue to issue another warning which repeats indefinitely.\n  // see: https://github.com/getsentry/sentry-javascript/pull/6010\n  // see: https://github.com/getsentry/sentry-javascript/issues/5916\n  for (let i = 0; i < handlerData.args.length; i++) {\n    if (handlerData.args[i] === 'ref=Ref<') {\n      handlerData.args[i + 1] = 'viewRef';\n      break;\n    }\n  }\n  const breadcrumb = {\n    category: 'console',\n    data: {\n      arguments: handlerData.args,\n      logger: 'console',\n    },\n    level: severityLevelFromString(handlerData.level),\n    message: safeJoin(handlerData.args, ' '),\n  };\n\n  if (handlerData.level === 'assert') {\n    if (handlerData.args[0] === false) {\n      breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n      breadcrumb.data.arguments = handlerData.args.slice(1);\n    } else {\n      // Don't capture a breadcrumb for passed assertions\n      return;\n    }\n  }\n\n  getCurrentHub().addBreadcrumb(breadcrumb, {\n    input: handlerData.args,\n    level: handlerData.level,\n  });\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _xhrBreadcrumb(handlerData: HandlerData & HandlerDataXhr): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n  // We only capture complete, non-sentry requests\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return;\n  }\n\n  const { method, url, status_code, body } = sentryXhrData;\n\n  const data: XhrBreadcrumbData = {\n    method,\n    url,\n    status_code,\n  };\n\n  const hint: XhrBreadcrumbHint = {\n    xhr: handlerData.xhr,\n    input: body,\n    startTimestamp,\n    endTimestamp,\n  };\n\n  getCurrentHub().addBreadcrumb(\n    {\n      category: 'xhr',\n      data,\n      type: 'http',\n    },\n    hint,\n  );\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _fetchBreadcrumb(handlerData: HandlerData & HandlerDataFetch & { response?: Response }): void {\n  const { startTimestamp, endTimestamp } = handlerData;\n\n  // We only capture complete fetch requests\n  if (!endTimestamp) {\n    return;\n  }\n\n  if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n    // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n    return;\n  }\n\n  if (handlerData.error) {\n    const data: FetchBreadcrumbData = handlerData.fetchData;\n    const hint: FetchBreadcrumbHint = {\n      data: handlerData.error,\n      input: handlerData.args,\n      startTimestamp,\n      endTimestamp,\n    };\n\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        level: 'error',\n        type: 'http',\n      },\n      hint,\n    );\n  } else {\n    const data: FetchBreadcrumbData = {\n      ...handlerData.fetchData,\n      status_code: handlerData.response && handlerData.response.status,\n    };\n    const hint: FetchBreadcrumbHint = {\n      input: handlerData.args,\n      response: handlerData.response,\n      startTimestamp,\n      endTimestamp,\n    };\n    getCurrentHub().addBreadcrumb(\n      {\n        category: 'fetch',\n        data,\n        type: 'http',\n      },\n      hint,\n    );\n  }\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _historyBreadcrumb(handlerData: HandlerData & { from: string; to: string }): void {\n  let from: string | undefined = handlerData.from;\n  let to: string | undefined = handlerData.to;\n  const parsedLoc = parseUrl(WINDOW.location.href);\n  let parsedFrom = parseUrl(from);\n  const parsedTo = parseUrl(to);\n\n  // Initial pushState doesn't provide `from` information\n  if (!parsedFrom.path) {\n    parsedFrom = parsedLoc;\n  }\n\n  // Use only the path component of the URL if the URL matches the current\n  // document (almost all the time when using pushState)\n  if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n    to = parsedTo.relative;\n  }\n  if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n    from = parsedFrom.relative;\n  }\n\n  getCurrentHub().addBreadcrumb({\n    category: 'navigation',\n    data: {\n      from,\n      to,\n    },\n  });\n}\n\nfunction _isEvent(event: unknown): event is Event {\n  return event && !!(event as Record<string, unknown>).target;\n}\n"],"names":[],"mappings":";;;;AAAA;;AAwCA;AACA,MAAA,yBAAA,GAAA,IAAA,CAAA;AACA;AACA,MAAA,yBAAA,GAAA,cAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,WAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,0BAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,WAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;A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AA,CAAA,QAAA,KAAA,UAAA,CAAA,QAAA,IAAA,SAAA,CAAA,IAAA,KAAA,UAAA,CAAA,IAAA,EAAA;AACA,IAAA,IAAA,GAAA,UAAA,CAAA,QAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,aAAA,EAAA,CAAA,aAAA,CAAA;AACA,IAAA,QAAA,EAAA,YAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,IAAA;AACA,MAAA,EAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,QAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,IAAA,CAAA,CAAA,CAAA,KAAA,GAAA,MAAA,CAAA;AACA;;;;"}import { logger } from '@sentry/utils';

/** Deduplication filter */
class Dedupe  {constructor() { Dedupe.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Dedupe';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Dedupe.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    const eventProcessor = currentEvent => {
      // We want to ignore any non-error type events, e.g. transactions or replays
      // These should never be deduped, and also not be compared against as _previousEvent.
      if (currentEvent.type) {
        return currentEvent;
      }

      const self = getCurrentHub().getIntegration(Dedupe);
      if (self) {
        // Juuust in case something goes wrong
        try {
          if (_shouldDropEvent(currentEvent, self._previousEvent)) {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Event dropped due to being a duplicate of previously captured event.');
            return null;
          }
        } catch (_oO) {
          return (self._previousEvent = currentEvent);
        }

        return (self._previousEvent = currentEvent);
      }
      return currentEvent;
    };

    eventProcessor.id = this.name;
    addGlobalEventProcessor(eventProcessor);
  }
} Dedupe.__initStatic();

/** JSDoc */
function _shouldDropEvent(currentEvent, previousEvent) {
  if (!previousEvent) {
    return false;
  }

  if (_isSameMessageEvent(currentEvent, previousEvent)) {
    return true;
  }

  if (_isSameExceptionEvent(currentEvent, previousEvent)) {
    return true;
  }

  return false;
}

/** JSDoc */
function _isSameMessageEvent(currentEvent, previousEvent) {
  const currentMessage = currentEvent.message;
  const previousMessage = previousEvent.message;

  // If neither event has a message property, they were both exceptions, so bail out
  if (!currentMessage && !previousMessage) {
    return false;
  }

  // If only one event has a stacktrace, but not the other one, they are not the same
  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {
    return false;
  }

  if (currentMessage !== previousMessage) {
    return false;
  }

  if (!_isSameFingerprint(currentEvent, previousEvent)) {
    return false;
  }

  if (!_isSameStacktrace(currentEvent, previousEvent)) {
    return false;
  }

  return true;
}

/** JSDoc */
function _isSameExceptionEvent(currentEvent, previousEvent) {
  const previousException = _getExceptionFromEvent(previousEvent);
  const currentException = _getExceptionFromEvent(currentEvent);

  if (!previousException || !currentException) {
    return false;
  }

  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {
    return false;
  }

  if (!_isSameFingerprint(currentEvent, previousEvent)) {
    return false;
  }

  if (!_isSameStacktrace(currentEvent, previousEvent)) {
    return false;
  }

  return true;
}

/** JSDoc */
function _isSameStacktrace(currentEvent, previousEvent) {
  let currentFrames = _getFramesFromEvent(currentEvent);
  let previousFrames = _getFramesFromEvent(previousEvent);

  // If neither event has a stacktrace, they are assumed to be the same
  if (!currentFrames && !previousFrames) {
    return true;
  }

  // If only one event has a stacktrace, but not the other one, they are not the same
  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {
    return false;
  }

  currentFrames = currentFrames ;
  previousFrames = previousFrames ;

  // If number of frames differ, they are not the same
  if (previousFrames.length !== currentFrames.length) {
    return false;
  }

  // Otherwise, compare the two
  for (let i = 0; i < previousFrames.length; i++) {
    const frameA = previousFrames[i];
    const frameB = currentFrames[i];

    if (
      frameA.filename !== frameB.filename ||
      frameA.lineno !== frameB.lineno ||
      frameA.colno !== frameB.colno ||
      frameA.function !== frameB.function
    ) {
      return false;
    }
  }

  return true;
}

/** JSDoc */
function _isSameFingerprint(currentEvent, previousEvent) {
  let currentFingerprint = currentEvent.fingerprint;
  let previousFingerprint = previousEvent.fingerprint;

  // If neither event has a fingerprint, they are assumed to be the same
  if (!currentFingerprint && !previousFingerprint) {
    return true;
  }

  // If only one event has a fingerprint, but not the other one, they are not the same
  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {
    return false;
  }

  currentFingerprint = currentFingerprint ;
  previousFingerprint = previousFingerprint ;

  // Otherwise, compare the two
  try {
    return !!(currentFingerprint.join('') === previousFingerprint.join(''));
  } catch (_oO) {
    return false;
  }
}

/** JSDoc */
function _getExceptionFromEvent(event) {
  return event.exception && event.exception.values && event.exception.values[0];
}

/** JSDoc */
function _getFramesFromEvent(event) {
  const exception = event.exception;

  if (exception) {
    try {
      // @ts-ignore Object could be undefined
      return exception.values[0].stacktrace.frames;
    } catch (_oO) {
      return undefined;
    }
  }
  return undefined;
}

export { Dedupe };
//# sourceMappingURL=dedupe.js.map
{"version":3,"file":"dedupe.js","sources":["../../../../src/integrations/dedupe.ts"],"sourcesContent":["import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/** Deduplication filter */\nexport class Dedupe implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Dedupe';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Dedupe.id;\n\n  /**\n   * @inheritDoc\n   */\n  private _previousEvent?: Event;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const eventProcessor: EventProcessor = currentEvent => {\n      // We want to ignore any non-error type events, e.g. transactions or replays\n      // These should never be deduped, and also not be compared against as _previousEvent.\n      if (currentEvent.type) {\n        return currentEvent;\n      }\n\n      const self = getCurrentHub().getIntegration(Dedupe);\n      if (self) {\n        // Juuust in case something goes wrong\n        try {\n          if (_shouldDropEvent(currentEvent, self._previousEvent)) {\n            __DEBUG_BUILD__ && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n            return null;\n          }\n        } catch (_oO) {\n          return (self._previousEvent = currentEvent);\n        }\n\n        return (self._previousEvent = currentEvent);\n      }\n      return currentEvent;\n    };\n\n    eventProcessor.id = this.name;\n    addGlobalEventProcessor(eventProcessor);\n  }\n}\n\n/** JSDoc */\nfunction _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean {\n  if (!previousEvent) {\n    return false;\n  }\n\n  if (_isSameMessageEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n    return true;\n  }\n\n  return false;\n}\n\n/** JSDoc */\nfunction _isSameMessageEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const currentMessage = currentEvent.message;\n  const previousMessage = previousEvent.message;\n\n  // If neither event has a message property, they were both exceptions, so bail out\n  if (!currentMessage && !previousMessage) {\n    return false;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n    return false;\n  }\n\n  if (currentMessage !== previousMessage) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameExceptionEvent(currentEvent: Event, previousEvent: Event): boolean {\n  const previousException = _getExceptionFromEvent(previousEvent);\n  const currentException = _getExceptionFromEvent(currentEvent);\n\n  if (!previousException || !currentException) {\n    return false;\n  }\n\n  if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n    return false;\n  }\n\n  if (!_isSameFingerprint(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  if (!_isSameStacktrace(currentEvent, previousEvent)) {\n    return false;\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameStacktrace(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFrames = _getFramesFromEvent(currentEvent);\n  let previousFrames = _getFramesFromEvent(previousEvent);\n\n  // If neither event has a stacktrace, they are assumed to be the same\n  if (!currentFrames && !previousFrames) {\n    return true;\n  }\n\n  // If only one event has a stacktrace, but not the other one, they are not the same\n  if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n    return false;\n  }\n\n  currentFrames = currentFrames as StackFrame[];\n  previousFrames = previousFrames as StackFrame[];\n\n  // If number of frames differ, they are not the same\n  if (previousFrames.length !== currentFrames.length) {\n    return false;\n  }\n\n  // Otherwise, compare the two\n  for (let i = 0; i < previousFrames.length; i++) {\n    const frameA = previousFrames[i];\n    const frameB = currentFrames[i];\n\n    if (\n      frameA.filename !== frameB.filename ||\n      frameA.lineno !== frameB.lineno ||\n      frameA.colno !== frameB.colno ||\n      frameA.function !== frameB.function\n    ) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/** JSDoc */\nfunction _isSameFingerprint(currentEvent: Event, previousEvent: Event): boolean {\n  let currentFingerprint = currentEvent.fingerprint;\n  let previousFingerprint = previousEvent.fingerprint;\n\n  // If neither event has a fingerprint, they are assumed to be the same\n  if (!currentFingerprint && !previousFingerprint) {\n    return true;\n  }\n\n  // If only one event has a fingerprint, but not the other one, they are not the same\n  if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n    return false;\n  }\n\n  currentFingerprint = currentFingerprint as string[];\n  previousFingerprint = previousFingerprint as string[];\n\n  // Otherwise, compare the two\n  try {\n    return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n  } catch (_oO) {\n    return false;\n  }\n}\n\n/** JSDoc */\nfunction _getExceptionFromEvent(event: Event): Exception | undefined {\n  return event.exception && event.exception.values && event.exception.values[0];\n}\n\n/** JSDoc */\nfunction _getFramesFromEvent(event: Event): StackFrame[] | undefined {\n  const exception = event.exception;\n\n  if (exception) {\n    try {\n      // @ts-ignore Object could be undefined\n      return exception.values[0].stacktrace.frames;\n    } catch (_oO) {\n      return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AA,EAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,SAAA,IAAA,KAAA,CAAA,SAAA,CAAA,MAAA,IAAA,KAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,IAAA;AACA;AACA,MAAA,OAAA,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA;AACA,KAAA,CAAA,OAAA,GAAA,EAAA;AACA,MAAA,OAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,SAAA,CAAA;AACA;;;;"}import { getCurrentHub } from '@sentry/core';
import { addInstrumentationHandler, isString, isPrimitive, isErrorEvent, getLocationHref, logger, addExceptionMechanism } from '@sentry/utils';
import { eventFromUnknownInput } from '../eventbuilder.js';
import { shouldIgnoreOnError } from '../helpers.js';

/* eslint-disable @typescript-eslint/no-unsafe-member-access */

/** Global handlers */
class GlobalHandlers  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'GlobalHandlers';}

  /**
   * @inheritDoc
   */
   __init() {this.name = GlobalHandlers.id;}

  /** JSDoc */

  /**
   * Stores references functions to installing handlers. Will set to undefined
   * after they have been run so that they are not used twice.
   */
   __init2() {this._installFunc = {
    onerror: _installGlobalOnErrorHandler,
    onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,
  };}

  /** JSDoc */
   constructor(options) {GlobalHandlers.prototype.__init.call(this);GlobalHandlers.prototype.__init2.call(this);
    this._options = {
      onerror: true,
      onunhandledrejection: true,
      ...options,
    };
  }
  /**
   * @inheritDoc
   */
   setupOnce() {
    Error.stackTraceLimit = 50;
    const options = this._options;

    // We can disable guard-for-in as we construct the options object above + do checks against
    // `this._installFunc` for the property.
    // eslint-disable-next-line guard-for-in
    for (const key in options) {
      const installFunc = this._installFunc[key ];
      if (installFunc && options[key ]) {
        globalHandlerLog(key);
        installFunc();
        this._installFunc[key ] = undefined;
      }
    }
  }
} GlobalHandlers.__initStatic();

/** JSDoc */
function _installGlobalOnErrorHandler() {
  addInstrumentationHandler(
    'error',
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (data) => {
      const [hub, stackParser, attachStacktrace] = getHubAndOptions();
      if (!hub.getIntegration(GlobalHandlers)) {
        return;
      }
      const { msg, url, line, column, error } = data;
      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {
        return;
      }

      const event =
        error === undefined && isString(msg)
          ? _eventFromIncompleteOnError(msg, url, line, column)
          : _enhanceEventWithInitialFrame(
              eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),
              url,
              line,
              column,
            );

      event.level = 'error';

      addMechanismAndCapture(hub, error, event, 'onerror');
    },
  );
}

/** JSDoc */
function _installGlobalOnUnhandledRejectionHandler() {
  addInstrumentationHandler(
    'unhandledrejection',
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    (e) => {
      const [hub, stackParser, attachStacktrace] = getHubAndOptions();
      if (!hub.getIntegration(GlobalHandlers)) {
        return;
      }
      let error = e;

      // dig the object of the rejection out of known event types
      try {
        // PromiseRejectionEvents store the object of the rejection under 'reason'
        // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent
        if ('reason' in e) {
          error = e.reason;
        }
        // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents
        // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into
        // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec
        // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and
        // https://github.com/getsentry/sentry-javascript/issues/2380
        else if ('detail' in e && 'reason' in e.detail) {
          error = e.detail.reason;
        }
      } catch (_oO) {
        // no-empty
      }

      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {
        return true;
      }

      const event = isPrimitive(error)
        ? _eventFromRejectionWithPrimitive(error)
        : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);

      event.level = 'error';

      addMechanismAndCapture(hub, error, event, 'onunhandledrejection');
      return;
    },
  );
}

/**
 * Create an event from a promise rejection where the `reason` is a primitive.
 *
 * @param reason: The `reason` property of the promise rejection
 * @returns An Event object with an appropriate `exception` value
 */
function _eventFromRejectionWithPrimitive(reason) {
  return {
    exception: {
      values: [
        {
          type: 'UnhandledRejection',
          // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)
          value: `Non-Error promise rejection captured with value: ${String(reason)}`,
        },
      ],
    },
  };
}

/**
 * This function creates a stack from an old, error-less onerror handler.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _eventFromIncompleteOnError(msg, url, line, column) {
  const ERROR_TYPES_RE =
    /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;

  // If 'message' is ErrorEvent, get real message from inside
  let message = isErrorEvent(msg) ? msg.message : msg;
  let name = 'Error';

  const groups = message.match(ERROR_TYPES_RE);
  if (groups) {
    name = groups[1];
    message = groups[2];
  }

  const event = {
    exception: {
      values: [
        {
          type: name,
          value: message,
        },
      ],
    },
  };

  return _enhanceEventWithInitialFrame(event, url, line, column);
}

/** JSDoc */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _enhanceEventWithInitialFrame(event, url, line, column) {
  // event.exception
  const e = (event.exception = event.exception || {});
  // event.exception.values
  const ev = (e.values = e.values || []);
  // event.exception.values[0]
  const ev0 = (ev[0] = ev[0] || {});
  // event.exception.values[0].stacktrace
  const ev0s = (ev0.stacktrace = ev0.stacktrace || {});
  // event.exception.values[0].stacktrace.frames
  const ev0sf = (ev0s.frames = ev0s.frames || []);

  const colno = isNaN(parseInt(column, 10)) ? undefined : column;
  const lineno = isNaN(parseInt(line, 10)) ? undefined : line;
  const filename = isString(url) && url.length > 0 ? url : getLocationHref();

  // event.exception.values[0].stacktrace.frames
  if (ev0sf.length === 0) {
    ev0sf.push({
      colno,
      filename,
      function: '?',
      in_app: true,
      lineno,
    });
  }

  return event;
}

function globalHandlerLog(type) {
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Global Handler attached: ${type}`);
}

function addMechanismAndCapture(hub, error, event, type) {
  addExceptionMechanism(event, {
    handled: false,
    type,
  });
  hub.captureEvent(event, {
    originalException: error,
  });
}

function getHubAndOptions() {
  const hub = getCurrentHub();
  const client = hub.getClient();
  const options = (client && client.getOptions()) || {
    stackParser: () => [],
    attachStacktrace: false,
  };
  return [hub, options.stackParser, options.attachStacktrace];
}

export { GlobalHandlers };
//# sourceMappingURL=globalhandlers.js.map
{"version":3,"file":"globalhandlers.js","sources":["../../../../src/integrations/globalhandlers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Hub, Integration, Primitive, StackParser } from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addInstrumentationHandler,\n  getLocationHref,\n  isErrorEvent,\n  isPrimitive,\n  isString,\n  logger,\n} from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { eventFromUnknownInput } from '../eventbuilder';\nimport { shouldIgnoreOnError } from '../helpers';\n\ntype GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';\n\n/** JSDoc */\ntype GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;\n\n/** Global handlers */\nexport class GlobalHandlers implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'GlobalHandlers';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = GlobalHandlers.id;\n\n  /** JSDoc */\n  private readonly _options: GlobalHandlersIntegrations;\n\n  /**\n   * Stores references functions to installing handlers. Will set to undefined\n   * after they have been run so that they are not used twice.\n   */\n  private _installFunc: Record<GlobalHandlersIntegrationsOptionKeys, (() => void) | undefined> = {\n    onerror: _installGlobalOnErrorHandler,\n    onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,\n  };\n\n  /** JSDoc */\n  public constructor(options?: GlobalHandlersIntegrations) {\n    this._options = {\n      onerror: true,\n      onunhandledrejection: true,\n      ...options,\n    };\n  }\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    Error.stackTraceLimit = 50;\n    const options = this._options;\n\n    // We can disable guard-for-in as we construct the options object above + do checks against\n    // `this._installFunc` for the property.\n    // eslint-disable-next-line guard-for-in\n    for (const key in options) {\n      const installFunc = this._installFunc[key as GlobalHandlersIntegrationsOptionKeys];\n      if (installFunc && options[key as GlobalHandlersIntegrationsOptionKeys]) {\n        globalHandlerLog(key);\n        installFunc();\n        this._installFunc[key as GlobalHandlersIntegrationsOptionKeys] = undefined;\n      }\n    }\n  }\n}\n\n/** JSDoc */\nfunction _installGlobalOnErrorHandler(): void {\n  addInstrumentationHandler(\n    'error',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (data: { msg: any; url: any; line: any; column: any; error: any }) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      const { msg, url, line, column, error } = data;\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return;\n      }\n\n      const event =\n        error === undefined && isString(msg)\n          ? _eventFromIncompleteOnError(msg, url, line, column)\n          : _enhanceEventWithInitialFrame(\n              eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n              url,\n              line,\n              column,\n            );\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onerror');\n    },\n  );\n}\n\n/** JSDoc */\nfunction _installGlobalOnUnhandledRejectionHandler(): void {\n  addInstrumentationHandler(\n    'unhandledrejection',\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    (e: any) => {\n      const [hub, stackParser, attachStacktrace] = getHubAndOptions();\n      if (!hub.getIntegration(GlobalHandlers)) {\n        return;\n      }\n      let error = e;\n\n      // dig the object of the rejection out of known event types\n      try {\n        // PromiseRejectionEvents store the object of the rejection under 'reason'\n        // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n        if ('reason' in e) {\n          error = e.reason;\n        }\n        // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n        // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n        // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n        // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n        // https://github.com/getsentry/sentry-javascript/issues/2380\n        else if ('detail' in e && 'reason' in e.detail) {\n          error = e.detail.reason;\n        }\n      } catch (_oO) {\n        // no-empty\n      }\n\n      if (shouldIgnoreOnError() || (error && error.__sentry_own_request__)) {\n        return true;\n      }\n\n      const event = isPrimitive(error)\n        ? _eventFromRejectionWithPrimitive(error)\n        : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n      event.level = 'error';\n\n      addMechanismAndCapture(hub, error, event, 'onunhandledrejection');\n      return;\n    },\n  );\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason: Primitive): Event {\n  return {\n    exception: {\n      values: [\n        {\n          type: 'UnhandledRejection',\n          // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n          value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n        },\n      ],\n    },\n  };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg: any, url: any, line: any, column: any): Event {\n  const ERROR_TYPES_RE =\n    /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n  // If 'message' is ErrorEvent, get real message from inside\n  let message = isErrorEvent(msg) ? msg.message : msg;\n  let name = 'Error';\n\n  const groups = message.match(ERROR_TYPES_RE);\n  if (groups) {\n    name = groups[1];\n    message = groups[2];\n  }\n\n  const event = {\n    exception: {\n      values: [\n        {\n          type: name,\n          value: message,\n        },\n      ],\n    },\n  };\n\n  return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event: Event, url: any, line: any, column: any): Event {\n  // event.exception\n  const e = (event.exception = event.exception || {});\n  // event.exception.values\n  const ev = (e.values = e.values || []);\n  // event.exception.values[0]\n  const ev0 = (ev[0] = ev[0] || {});\n  // event.exception.values[0].stacktrace\n  const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n  // event.exception.values[0].stacktrace.frames\n  const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n  const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n  const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n  const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n  // event.exception.values[0].stacktrace.frames\n  if (ev0sf.length === 0) {\n    ev0sf.push({\n      colno,\n      filename,\n      function: '?',\n      in_app: true,\n      lineno,\n    });\n  }\n\n  return event;\n}\n\nfunction globalHandlerLog(type: string): void {\n  __DEBUG_BUILD__ && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction addMechanismAndCapture(hub: Hub, error: EventHint['originalException'], event: Event, type: string): void {\n  addExceptionMechanism(event, {\n    handled: false,\n    type,\n  });\n  hub.captureEvent(event, {\n    originalException: error,\n  });\n}\n\nfunction getHubAndOptions(): [Hub, StackParser, boolean | undefined] {\n  const hub = getCurrentHub();\n  const client = hub.getClient<BrowserClient>();\n  const options = (client && client.getOptions()) || {\n    stackParser: () => [],\n    attachStacktrace: false,\n  };\n  return [hub, options.stackParser, options.attachStacktrace];\n}\n"],"names":[],"mappings":";;;;;AAAA;;AAsBA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,cAAA,CAAA,GAAA,CAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,YAAA,GAAA;AACA,IAAA,OAAA,EAAA,4BAAA;AACA,IAAA,oBAAA,EAAA,yCAAA;AACA,IAAA,CAAA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,EAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,cAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,OAAA,EAAA,IAAA;AACA,MAAA,oBAAA,EAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,KAAA,CAAA,eAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,IAAA,CAAA,QAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,KAAA,MAAA,GAAA,IAAA,OAAA,EAAA;AACA,MAAA,MAAA,WAAA,GAAA,IAAA,CAAA,YAAA,CAAA,GAAA,EAAA,CAAA;AACA,MAAA,IAAA,WAAA,IAAA,OAAA,CAAA,GAAA,EAAA,EAAA;AACA,QAAA,gBAAA,CAAA,GAAA,CAAA,CAAA;AACA,QAAA,WAAA,EAA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A,EAAA,KAAA,EAAA,IAAA,EAAA;AACA,EAAA,qBAAA,CAAA,KAAA,EAAA;AACA,IAAA,OAAA,EAAA,KAAA;AACA,IAAA,IAAA;AACA,GAAA,CAAA,CAAA;AACA,EAAA,GAAA,CAAA,YAAA,CAAA,KAAA,EAAA;AACA,IAAA,iBAAA,EAAA,KAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,gBAAA,GAAA;AACA,EAAA,MAAA,GAAA,GAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,CAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA,KAAA;AACA,IAAA,WAAA,EAAA,MAAA,EAAA;AACA,IAAA,gBAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,EAAA,OAAA,CAAA,WAAA,EAAA,OAAA,CAAA,gBAAA,CAAA,CAAA;AACA;;;;"}import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
import { WINDOW } from '../helpers.js';

/** HttpContext integration collects information about HTTP request headers */
class HttpContext  {constructor() { HttpContext.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'HttpContext';}

  /**
   * @inheritDoc
   */
   __init() {this.name = HttpContext.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    addGlobalEventProcessor((event) => {
      if (getCurrentHub().getIntegration(HttpContext)) {
        // if none of the information we want exists, don't bother
        if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {
          return event;
        }

        // grab as much info as exists and add it to the event
        const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);
        const { referrer } = WINDOW.document || {};
        const { userAgent } = WINDOW.navigator || {};

        const headers = {
          ...(event.request && event.request.headers),
          ...(referrer && { Referer: referrer }),
          ...(userAgent && { 'User-Agent': userAgent }),
        };
        const request = { ...event.request, ...(url && { url }), headers };

        return { ...event, request };
      }
      return event;
    });
  }
} HttpContext.__initStatic();

export { HttpContext };
//# sourceMappingURL=httpcontext.js.map
{"version":3,"file":"httpcontext.js","sources":["../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, Integration } from '@sentry/types';\n\nimport { WINDOW } from '../helpers';\n\n/** HttpContext integration collects information about HTTP request headers */\nexport class HttpContext implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'HttpContext';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = HttpContext.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor((event: Event) => {\n      if (getCurrentHub().getIntegration(HttpContext)) {\n        // if none of the information we want exists, don't bother\n        if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n          return event;\n        }\n\n        // grab as much info as exists and add it to the event\n        const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n        const { referrer } = WINDOW.document || {};\n        const { userAgent } = WINDOW.navigator || {};\n\n        const headers = {\n          ...(event.request && event.request.headers),\n          ...(referrer && { Referer: referrer }),\n          ...(userAgent && { 'User-Agent': userAgent }),\n        };\n        const request = { ...event.request, ...(url && { url }), headers };\n\n        return { ...event, request };\n      }\n      return event;\n    });\n  }\n}\n"],"names":[],"mappings":";;;AAKA;AACA,MAAA,WAAA,EAAA,CAAA,WAAA,GAAA,EAAA,WAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,cAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,WAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,uBAAA,CAAA,CAAA,KAAA,KAAA;AACA,MAAA,IAAA,aAAA,EAAA,CAAA,cAAA,CAAA,WAAA,CAAA,EAAA;AACA;AACA,QAAA,IAAA,CAAA,MAAA,CAAA,SAAA,IAAA,CAAA,MAAA,CAAA,QAAA,IAAA,CAAA,MAAA,CAAA,QAAA,EAAA;AACA,UAAA,OAAA,KAAA,CAAA;AACA,SAAA;AACA;AACA;AACA,QAAA,MAAA,GAAA,GAAA,CAAA,KAAA,CAAA,OAAA,IAAA,KAAA,CAAA,OAAA,CAAA,GAAA,MAAA,MAAA,CAAA,QAAA,IAAA,MAAA,CAAA,QAAA,CAAA,IAAA,CAAA,CAAA;AACA,QAAA,MAAA,EAAA,QAAA,EAAA,GAAA,MAAA,CAAA,QAAA,IAAA,EAAA,CAAA;AACA,QAAA,MAAA,EAAA,SAAA,EAAA,GAAA,MAAA,CAAA,SAAA,IAAA,EAAA,CAAA;AACA;AACA,QAAA,MAAA,OAAA,GAAA;AACA,UAAA,IAAA,KAAA,CAAA,OAAA,IAAA,KAAA,CAAA,OAAA,CAAA,OAAA,CAAA;AACA,UAAA,IAAA,QAAA,IAAA,EAAA,OAAA,EAAA,QAAA,EAAA,CAAA;AACA,UAAA,IAAA,SAAA,IAAA,EAAA,YAAA,EAAA,SAAA,EAAA,CAAA;AACA,SAAA,CAAA;AACA,QAAA,MAAA,OAAA,GAAA,EAAA,GAAA,KAAA,CAAA,OAAA,EAAA,IAAA,GAAA,IAAA,EAAA,GAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA;AACA;AACA,QAAA,OAAA,EAAA,GAAA,KAAA,EAAA,OAAA,EAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA,KAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,WAAA,CAAA,YAAA,EAAA;;;;"}export { GlobalHandlers } from './globalhandlers.js';
export { TryCatch } from './trycatch.js';
export { Breadcrumbs } from './breadcrumbs.js';
export { LinkedErrors } from './linkederrors.js';
export { HttpContext } from './httpcontext.js';
export { Dedupe } from './dedupe.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}import { getCurrentHub, addGlobalEventProcessor } from '@sentry/core';
import { isInstanceOf } from '@sentry/utils';
import { exceptionFromError } from '../eventbuilder.js';

const DEFAULT_KEY = 'cause';
const DEFAULT_LIMIT = 5;

/** Adds SDK info to an event. */
class LinkedErrors  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'LinkedErrors';}

  /**
   * @inheritDoc
   */
    __init() {this.name = LinkedErrors.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {LinkedErrors.prototype.__init.call(this);
    this._key = options.key || DEFAULT_KEY;
    this._limit = options.limit || DEFAULT_LIMIT;
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    const client = getCurrentHub().getClient();
    if (!client) {
      return;
    }
    addGlobalEventProcessor((event, hint) => {
      const self = getCurrentHub().getIntegration(LinkedErrors);
      return self ? _handler(client.getOptions().stackParser, self._key, self._limit, event, hint) : event;
    });
  }
} LinkedErrors.__initStatic();

/**
 * @inheritDoc
 */
function _handler(
  parser,
  key,
  limit,
  event,
  hint,
) {
  if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {
    return event;
  }
  const linkedErrors = _walkErrorTree(parser, limit, hint.originalException , key);
  event.exception.values = [...linkedErrors, ...event.exception.values];
  return event;
}

/**
 * JSDOC
 */
function _walkErrorTree(
  parser,
  limit,
  error,
  key,
  stack = [],
) {
  if (!isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {
    return stack;
  }
  const exception = exceptionFromError(parser, error[key]);
  return _walkErrorTree(parser, limit, error[key], key, [exception, ...stack]);
}

export { LinkedErrors, _handler, _walkErrorTree };
//# sourceMappingURL=linkederrors.js.map
{"version":3,"file":"linkederrors.js","sources":["../../../../src/integrations/linkederrors.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';\nimport { isInstanceOf } from '@sentry/utils';\n\nimport type { BrowserClient } from '../client';\nimport { exceptionFromError } from '../eventbuilder';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\ninterface LinkedErrorsOptions {\n  key: string;\n  limit: number;\n}\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = LinkedErrors.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: LinkedErrorsOptions['key'];\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: LinkedErrorsOptions['limit'];\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: Partial<LinkedErrorsOptions> = {}) {\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    const client = getCurrentHub().getClient<BrowserClient>();\n    if (!client) {\n      return;\n    }\n    addGlobalEventProcessor((event: Event, hint?: EventHint) => {\n      const self = getCurrentHub().getIntegration(LinkedErrors);\n      return self ? _handler(client.getOptions().stackParser, self._key, self._limit, event, hint) : event;\n    });\n  }\n}\n\n/**\n * @inheritDoc\n */\nexport function _handler(\n  parser: StackParser,\n  key: string,\n  limit: number,\n  event: Event,\n  hint?: EventHint,\n): Event | null {\n  if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n    return event;\n  }\n  const linkedErrors = _walkErrorTree(parser, limit, hint.originalException as ExtendedError, key);\n  event.exception.values = [...linkedErrors, ...event.exception.values];\n  return event;\n}\n\n/**\n * JSDOC\n */\nexport function _walkErrorTree(\n  parser: StackParser,\n  limit: number,\n  error: ExtendedError,\n  key: string,\n  stack: Exception[] = [],\n): Exception[] {\n  if (!isInstanceOf(error[key], Error) || stack.length + 1 >= limit) {\n    return stack;\n  }\n  const exception = exceptionFromError(parser, error[key]);\n  return _walkErrorTree(parser, limit, error[key], key, [exception, ...stack]);\n}\n"],"names":[],"mappings":";;;;AAOA,MAAA,WAAA,GAAA,OAAA,CAAA;AACA,MAAA,aAAA,GAAA,CAAA,CAAA;;AAOA;AACA,MAAA,YAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,eAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,YAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,GAAA,EAAA,EAAA,CAAA,YAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,OAAA,CAAA,GAAA,IAAA,WAAA,CAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,OAAA,CAAA,KAAA,IAAA,aAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,MAAA,MAAA,GAAA,aAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,MAAA,EAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA,IAAA,uBAAA,CAAA,CAAA,KAAA,EAAA,IAAA,KAAA;AACA,MAAA,MAAA,IAAA,GAAA,aAAA,EAAA,CAAA,cAAA,CAAA,YAAA,CAAA,CAAA;AACA,MAAA,OAAA,IAAA,GAAA,QAAA,CAAA,MAAA,CAAA,UAAA,EAAA,CAAA,WAAA,EAAA,IAAA,CAAA,IAAA,EAAA,IAAA,CAAA,MAAA,EAAA,KAAA,EAAA,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A,GAAA,KAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';
import { WINDOW, wrap } from '../helpers.js';

const DEFAULT_EVENT_TARGET = [
  'EventTarget',
  'Window',
  'Node',
  'ApplicationCache',
  'AudioTrackList',
  'ChannelMergerNode',
  'CryptoOperation',
  'EventSource',
  'FileReader',
  'HTMLUnknownElement',
  'IDBDatabase',
  'IDBRequest',
  'IDBTransaction',
  'KeyOperation',
  'MediaController',
  'MessagePort',
  'ModalWindow',
  'Notification',
  'SVGElementInstance',
  'Screen',
  'TextTrack',
  'TextTrackCue',
  'TextTrackList',
  'WebSocket',
  'WebSocketWorker',
  'Worker',
  'XMLHttpRequest',
  'XMLHttpRequestEventTarget',
  'XMLHttpRequestUpload',
];

/** Wrap timer functions and event targets to catch errors and provide better meta data */
class TryCatch  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'TryCatch';}

  /**
   * @inheritDoc
   */
   __init() {this.name = TryCatch.id;}

  /** JSDoc */

  /**
   * @inheritDoc
   */
   constructor(options) {TryCatch.prototype.__init.call(this);
    this._options = {
      XMLHttpRequest: true,
      eventTarget: true,
      requestAnimationFrame: true,
      setInterval: true,
      setTimeout: true,
      ...options,
    };
  }

  /**
   * Wrap timer functions and event targets to catch errors
   * and provide better metadata.
   */
   setupOnce() {
    if (this._options.setTimeout) {
      fill(WINDOW, 'setTimeout', _wrapTimeFunction);
    }

    if (this._options.setInterval) {
      fill(WINDOW, 'setInterval', _wrapTimeFunction);
    }

    if (this._options.requestAnimationFrame) {
      fill(WINDOW, 'requestAnimationFrame', _wrapRAF);
    }

    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {
      fill(XMLHttpRequest.prototype, 'send', _wrapXHR);
    }

    const eventTargetOption = this._options.eventTarget;
    if (eventTargetOption) {
      const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;
      eventTarget.forEach(_wrapEventTarget);
    }
  }
} TryCatch.__initStatic();

/** JSDoc */
function _wrapTimeFunction(original) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( ...args) {
    const originalCallback = args[0];
    args[0] = wrap(originalCallback, {
      mechanism: {
        data: { function: getFunctionName(original) },
        handled: true,
        type: 'instrument',
      },
    });
    return original.apply(this, args);
  };
}

/** JSDoc */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function _wrapRAF(original) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( callback) {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    return original.apply(this, [
      wrap(callback, {
        mechanism: {
          data: {
            function: 'requestAnimationFrame',
            handler: getFunctionName(original),
          },
          handled: true,
          type: 'instrument',
        },
      }),
    ]);
  };
}

/** JSDoc */
function _wrapXHR(originalSend) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  return function ( ...args) {
    // eslint-disable-next-line @typescript-eslint/no-this-alias
    const xhr = this;
    const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];

    xmlHttpRequestProps.forEach(prop => {
      if (prop in xhr && typeof xhr[prop] === 'function') {
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        fill(xhr, prop, function (original) {
          const wrapOptions = {
            mechanism: {
              data: {
                function: prop,
                handler: getFunctionName(original),
              },
              handled: true,
              type: 'instrument',
            },
          };

          // If Instrument integration has been called before TryCatch, get the name of original function
          const originalFunction = getOriginalFunction(original);
          if (originalFunction) {
            wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);
          }

          // Otherwise wrap directly
          return wrap(original, wrapOptions);
        });
      }
    });

    return originalSend.apply(this, args);
  };
}

/** JSDoc */
function _wrapEventTarget(target) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const globalObject = WINDOW ;
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  const proto = globalObject[target] && globalObject[target].prototype;

  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
    return;
  }

  fill(proto, 'addEventListener', function (original)

 {
    return function (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any

      eventName,
      fn,
      options,
    ) {
      try {
        if (typeof fn.handleEvent === 'function') {
          // ESlint disable explanation:
          //  First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would
          //  introduce a bug here, because bind returns a new function that doesn't have our
          //  flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.
          //  Without those flags, every call to addEventListener wraps the function again, causing a memory leak.
          // eslint-disable-next-line @typescript-eslint/unbound-method
          fn.handleEvent = wrap(fn.handleEvent, {
            mechanism: {
              data: {
                function: 'handleEvent',
                handler: getFunctionName(fn),
                target,
              },
              handled: true,
              type: 'instrument',
            },
          });
        }
      } catch (err) {
        // can sometimes get 'Permission denied to access property "handle Event'
      }

      return original.apply(this, [
        eventName,
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        wrap(fn , {
          mechanism: {
            data: {
              function: 'addEventListener',
              handler: getFunctionName(fn),
              target,
            },
            handled: true,
            type: 'instrument',
          },
        }),
        options,
      ]);
    };
  });

  fill(
    proto,
    'removeEventListener',
    function (
      originalRemoveEventListener,
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
    ) {
      return function (
        // eslint-disable-next-line @typescript-eslint/no-explicit-any

        eventName,
        fn,
        options,
      ) {
        /**
         * There are 2 possible scenarios here:
         *
         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified
         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function
         * as a pass-through, and call original `removeEventListener` with it.
         *
         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using
         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.
         * This helper "wraps" whole callback inside a try/catch statement, and attached appropriate metadata to it,
         * in order for us to make a distinction between wrapped/non-wrapped functions possible.
         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.
         *
         * When someone adds a handler prior to initialization, and then do it again, but after,
         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible
         * to get rid of the initial handler and it'd stick there forever.
         */
        const wrappedEventHandler = fn ;
        try {
          const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;
          if (originalEventHandler) {
            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);
          }
        } catch (e) {
          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments
        }
        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);
      };
    },
  );
}

export { TryCatch };
//# sourceMappingURL=trycatch.js.map
{"version":3,"file":"trycatch.js","sources":["../../../../src/integrations/trycatch.ts"],"sourcesContent":["import type { Integration, WrappedFunction } from '@sentry/types';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\n\nimport { WINDOW, wrap } from '../helpers';\n\nconst DEFAULT_EVENT_TARGET = [\n  'EventTarget',\n  'Window',\n  'Node',\n  'ApplicationCache',\n  'AudioTrackList',\n  'ChannelMergerNode',\n  'CryptoOperation',\n  'EventSource',\n  'FileReader',\n  'HTMLUnknownElement',\n  'IDBDatabase',\n  'IDBRequest',\n  'IDBTransaction',\n  'KeyOperation',\n  'MediaController',\n  'MessagePort',\n  'ModalWindow',\n  'Notification',\n  'SVGElementInstance',\n  'Screen',\n  'TextTrack',\n  'TextTrackCue',\n  'TextTrackList',\n  'WebSocket',\n  'WebSocketWorker',\n  'Worker',\n  'XMLHttpRequest',\n  'XMLHttpRequestEventTarget',\n  'XMLHttpRequestUpload',\n];\n\ntype XMLHttpRequestProp = 'onload' | 'onerror' | 'onprogress' | 'onreadystatechange';\n\n/** JSDoc */\ninterface TryCatchOptions {\n  setTimeout: boolean;\n  setInterval: boolean;\n  requestAnimationFrame: boolean;\n  XMLHttpRequest: boolean;\n  eventTarget: boolean | string[];\n}\n\n/** Wrap timer functions and event targets to catch errors and provide better meta data */\nexport class TryCatch implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'TryCatch';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = TryCatch.id;\n\n  /** JSDoc */\n  private readonly _options: TryCatchOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options?: Partial<TryCatchOptions>) {\n    this._options = {\n      XMLHttpRequest: true,\n      eventTarget: true,\n      requestAnimationFrame: true,\n      setInterval: true,\n      setTimeout: true,\n      ...options,\n    };\n  }\n\n  /**\n   * Wrap timer functions and event targets to catch errors\n   * and provide better metadata.\n   */\n  public setupOnce(): void {\n    if (this._options.setTimeout) {\n      fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n    }\n\n    if (this._options.setInterval) {\n      fill(WINDOW, 'setInterval', _wrapTimeFunction);\n    }\n\n    if (this._options.requestAnimationFrame) {\n      fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n    }\n\n    if (this._options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n      fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n    }\n\n    const eventTargetOption = this._options.eventTarget;\n    if (eventTargetOption) {\n      const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n      eventTarget.forEach(_wrapEventTarget);\n    }\n  }\n}\n\n/** JSDoc */\nfunction _wrapTimeFunction(original: () => void): () => number {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, ...args: any[]): number {\n    const originalCallback = args[0];\n    args[0] = wrap(originalCallback, {\n      mechanism: {\n        data: { function: getFunctionName(original) },\n        handled: true,\n        type: 'instrument',\n      },\n    });\n    return original.apply(this, args);\n  };\n}\n\n/** JSDoc */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original: any): (callback: () => void) => any {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: any, callback: () => void): () => void {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return original.apply(this, [\n      wrap(callback, {\n        mechanism: {\n          data: {\n            function: 'requestAnimationFrame',\n            handler: getFunctionName(original),\n          },\n          handled: true,\n          type: 'instrument',\n        },\n      }),\n    ]);\n  };\n}\n\n/** JSDoc */\nfunction _wrapXHR(originalSend: () => void): () => void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return function (this: XMLHttpRequest, ...args: any[]): void {\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const xhr = this;\n    const xmlHttpRequestProps: XMLHttpRequestProp[] = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n    xmlHttpRequestProps.forEach(prop => {\n      if (prop in xhr && typeof xhr[prop] === 'function') {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        fill(xhr, prop, function (original: WrappedFunction): () => any {\n          const wrapOptions = {\n            mechanism: {\n              data: {\n                function: prop,\n                handler: getFunctionName(original),\n              },\n              handled: true,\n              type: 'instrument',\n            },\n          };\n\n          // If Instrument integration has been called before TryCatch, get the name of original function\n          const originalFunction = getOriginalFunction(original);\n          if (originalFunction) {\n            wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n          }\n\n          // Otherwise wrap directly\n          return wrap(original, wrapOptions);\n        });\n      }\n    });\n\n    return originalSend.apply(this, args);\n  };\n}\n\n/** JSDoc */\nfunction _wrapEventTarget(target: string): void {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const globalObject = WINDOW as { [key: string]: any };\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  const proto = globalObject[target] && globalObject[target].prototype;\n\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n    return;\n  }\n\n  fill(proto, 'addEventListener', function (original: () => void): (\n    eventName: string,\n    fn: EventListenerObject,\n    options?: boolean | AddEventListenerOptions,\n  ) => void {\n    return function (\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      this: any,\n      eventName: string,\n      fn: EventListenerObject,\n      options?: boolean | AddEventListenerOptions,\n    ): (eventName: string, fn: EventListenerObject, capture?: boolean, secure?: boolean) => void {\n      try {\n        if (typeof fn.handleEvent === 'function') {\n          // ESlint disable explanation:\n          //  First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n          //  introduce a bug here, because bind returns a new function that doesn't have our\n          //  flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n          //  Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n          // eslint-disable-next-line @typescript-eslint/unbound-method\n          fn.handleEvent = wrap(fn.handleEvent, {\n            mechanism: {\n              data: {\n                function: 'handleEvent',\n                handler: getFunctionName(fn),\n                target,\n              },\n              handled: true,\n              type: 'instrument',\n            },\n          });\n        }\n      } catch (err) {\n        // can sometimes get 'Permission denied to access property \"handle Event'\n      }\n\n      return original.apply(this, [\n        eventName,\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        wrap(fn as any as WrappedFunction, {\n          mechanism: {\n            data: {\n              function: 'addEventListener',\n              handler: getFunctionName(fn),\n              target,\n            },\n            handled: true,\n            type: 'instrument',\n          },\n        }),\n        options,\n      ]);\n    };\n  });\n\n  fill(\n    proto,\n    'removeEventListener',\n    function (\n      originalRemoveEventListener: () => void,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    ): (this: any, eventName: string, fn: EventListenerObject, options?: boolean | EventListenerOptions) => () => void {\n      return function (\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        this: any,\n        eventName: string,\n        fn: EventListenerObject,\n        options?: boolean | EventListenerOptions,\n      ): () => void {\n        /**\n         * There are 2 possible scenarios here:\n         *\n         * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n         * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n         * as a pass-through, and call original `removeEventListener` with it.\n         *\n         * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n         * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n         * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n         * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n         * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n         *\n         * When someone adds a handler prior to initialization, and then do it again, but after,\n         * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n         * to get rid of the initial handler and it'd stick there forever.\n         */\n        const wrappedEventHandler = fn as unknown as WrappedFunction;\n        try {\n          const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n          if (originalEventHandler) {\n            originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n          }\n        } catch (e) {\n          // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n        }\n        return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n      };\n    },\n  );\n}\n"],"names":[],"mappings":";;;AAKA,MAAA,oBAAA,GAAA;AACA,EAAA,aAAA;AACA,EAAA,QAAA;AACA,EAAA,MAAA;AACA,EAAA,kBAAA;AACA,EAAA,gBAAA;AACA,EAAA,mBAAA;AACA,EAAA,iBAAA;AACA,EAAA,aAAA;AACA,EAAA,YAAA;AACA,EAAA,oBAAA;AACA,EAAA,aAAA;AACA,EAAA,YAAA;AACA,EAAA,gBAAA;AACA,EAAA,cAAA;AACA,EAAA,iBAAA;AACA,EAAA,aAAA;AACA,EAAA,aAAA;AACA,EAAA,cAAA;AACA,EAAA,oBAAA;AACA,EAAA,QAAA;AACA,EAAA,WAAA;AACA,EAAA,cAAA;AACA,EAAA,eAAA;AACA,EAAA,WAAA;AACA,EAAA,iBAAA;AACA,EAAA,QAAA;AACA,EAAA,gBAAA;AACA,EAAA,2BAAA;AACA,EAAA,sBAAA;AACA,CAAA,CAAA;;AAaA;AACA,MAAA,QAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,WAAA,CAAA;AACA;AACA;AACA;A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A,qBAAA;AACA,IAAA;AACA,MAAA,2BAAA;AACA;AACA,MAAA;AACA,MAAA,OAAA;AACA;;AAEA,QAAA,SAAA;AACA,QAAA,EAAA;AACA,QAAA,OAAA;AACA,QAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAA,MAAA,mBAAA,GAAA,EAAA,EAAA;AACA,QAAA,IAAA;AACA,UAAA,MAAA,oBAAA,GAAA,mBAAA,IAAA,mBAAA,CAAA,kBAAA,CAAA;AACA,UAAA,IAAA,oBAAA,EAAA;AACA,YAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,oBAAA,EAAA,OAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,SAAA;AACA,QAAA,OAAA,2BAAA,CAAA,IAAA,CAAA,IAAA,EAAA,SAAA,EAAA,mBAAA,EAAA,OAAA,CAAA,CAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}/**
 * Creates a cache that evicts keys in fifo order
 * @param size {Number}
 */
function makeProfilingCache(
  size,
)

 {
  // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it.
  let evictionOrder = [];
  let cache = {};

  return {
    add(key, value) {
      while (evictionOrder.length >= size) {
        // shift is O(n) but this is small size and only happens if we are
        // exceeding the cache size so it should be fine.
        const evictCandidate = evictionOrder.shift();

        if (evictCandidate !== undefined) {
          // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
          delete cache[evictCandidate];
        }
      }

      // in case we have a collision, delete the old key.
      if (cache[key]) {
        this.delete(key);
      }

      evictionOrder.push(key);
      cache[key] = value;
    },
    clear() {
      cache = {};
      evictionOrder = [];
    },
    get(key) {
      return cache[key];
    },
    size() {
      return evictionOrder.length;
    },
    // Delete cache key and return true if it existed, false otherwise.
    delete(key) {
      if (!cache[key]) {
        return false;
      }

      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete cache[key];

      for (let i = 0; i < evictionOrder.length; i++) {
        if (evictionOrder[i] === key) {
          evictionOrder.splice(i, 1);
          break;
        }
      }

      return true;
    },
  };
}

const PROFILING_EVENT_CACHE = makeProfilingCache(20);

export { PROFILING_EVENT_CACHE, makeProfilingCache };
//# sourceMappingURL=cache.js.map
{"version":3,"file":"cache.js","sources":["../../../../src/profiling/cache.ts"],"sourcesContent":["import type { Event } from '@sentry/types';\n\n/**\n * Creates a cache that evicts keys in fifo order\n * @param size {Number}\n */\nexport function makeProfilingCache<Key extends string, Value extends Event>(\n  size: number,\n): {\n  get: (key: Key) => Value | undefined;\n  add: (key: Key, value: Value) => void;\n  delete: (key: Key) => boolean;\n  clear: () => void;\n  size: () => number;\n} {\n  // Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it.\n  let evictionOrder: Key[] = [];\n  let cache: Record<string, Value> = {};\n\n  return {\n    add(key: Key, value: Value) {\n      while (evictionOrder.length >= size) {\n        // shift is O(n) but this is small size and only happens if we are\n        // exceeding the cache size so it should be fine.\n        const evictCandidate = evictionOrder.shift();\n\n        if (evictCandidate !== undefined) {\n          // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n          delete cache[evictCandidate];\n        }\n      }\n\n      // in case we have a collision, delete the old key.\n      if (cache[key]) {\n        this.delete(key);\n      }\n\n      evictionOrder.push(key);\n      cache[key] = value;\n    },\n    clear() {\n      cache = {};\n      evictionOrder = [];\n    },\n    get(key: Key): Value | undefined {\n      return cache[key];\n    },\n    size() {\n      return evictionOrder.length;\n    },\n    // Delete cache key and return true if it existed, false otherwise.\n    delete(key: Key): boolean {\n      if (!cache[key]) {\n        return false;\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete cache[key];\n\n      for (let i = 0; i < evictionOrder.length; i++) {\n        if (evictionOrder[i] === key) {\n          evictionOrder.splice(i, 1);\n          break;\n        }\n      }\n\n      return true;\n    },\n  };\n}\n\nexport const PROFILING_EVENT_CACHE = makeProfilingCache<string, Event>(20);\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA,SAAA,kBAAA;AACA,EAAA,IAAA;AACA;;AAMA,CAAA;AACA;AACA,EAAA,IAAA,aAAA,GAAA,EAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,GAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA,MAAA,OAAA,aAAA,CAAA,MAAA,IAAA,IAAA,EAAA;AACA;AACA;AACA,QAAA,MAAA,cAAA,GAAA,aAAA,CAAA,KAAA,EAAA,CAAA;AACA;AACA,QAAA,IAAA,cAAA,KAAA,SAAA,EAAA;AACA;AACA,UAAA,OAAA,KAAA,CAAA,cAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA;AACA;AACA,MAAA,IAAA,KAAA,CAAA,GAAA,CAAA,EAAA;AACA,QAAA,IAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,aAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,KAAA,CAAA,GAAA,CAAA,GAAA,KAAA,CAAA;AACA,KAAA;AACA,IAAA,KAAA,GAAA;AACA,MAAA,KAAA,GAAA,EAAA,CAAA;AACA,MAAA,aAAA,GAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,GAAA,CAAA,GAAA,EAAA;AACA,MAAA,OAAA,KAAA,CAAA,GAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,IAAA,GAAA;AACA,MAAA,OAAA,aAAA,CAAA,MAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,MAAA,CAAA,GAAA,EAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,GAAA,CAAA,EAAA;AACA,QAAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA;AACA;AACA,MAAA,OAAA,KAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,MAAA,KAAA,IAAA,CAAA,GAAA,CAAA,EAAA,CAAA,GAAA,aAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,QAAA,IAAA,aAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,UAAA,aAAA,CAAA,MAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AACA,UAAA,MAAA;AACA,SAAA;AACA,OAAA;AACA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,qBAAA,GAAA,kBAAA,CAAA,EAAA;;;;"}import { getCurrentHub, getMainCarrier } from '@sentry/core';
import { logger, uuid4 } from '@sentry/utils';
import { WINDOW } from '../helpers.js';
import { sendProfile } from './sendProfile.js';

// Max profile duration.
const MAX_PROFILE_DURATION_MS = 30000;
// Keep a flag value to avoid re-initializing the profiler constructor. If it fails
// once, it will always fail and this allows us to early return.
let PROFILING_CONSTRUCTOR_FAILED = false;

// While we experiment, per transaction sampling interval will be more flexible to work with.

/**
 * Check if profiler constructor is available.
 * @param maybeProfiler
 */
function isJSProfilerSupported(maybeProfiler) {
  return typeof maybeProfiler === 'function';
}

/**
 * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -
 * if that happens we want to avoid throwing an error from profiling code.
 * see https://github.com/getsentry/sentry-javascript/issues/4731.
 *
 * @experimental
 */
function onProfilingStartRouteTransaction(transaction) {
  if (!transaction) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Transaction is undefined, skipping profiling');
    }
    return transaction;
  }

  return wrapTransactionWithProfiling(transaction);
}

/**
 * Wraps startTransaction and stopTransaction with profiling related logic.
 * startProfiling is called after the call to startTransaction in order to avoid our own code from
 * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
 */
function wrapTransactionWithProfiling(transaction) {
  // Feature support check first
  const JSProfilerConstructor = WINDOW.Profiler;

  if (!isJSProfilerSupported(JSProfilerConstructor)) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.',
      );
    }
    return transaction;
  }

  // profilesSampleRate is multiplied with tracesSampleRate to get the final sampling rate.
  if (!transaction.sampled) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Transaction is not sampled, skipping profiling');
    }
    return transaction;
  }

  // If constructor failed once, it will always fail, so we can early return.
  if (PROFILING_CONSTRUCTOR_FAILED) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.');
    }
    return transaction;
  }

  const client = getCurrentHub().getClient();
  const options = client && client.getOptions();

  // @ts-ignore not part of the browser options yet
  const profilesSampleRate = (options && options.profilesSampleRate) || 0;
  if (profilesSampleRate === undefined) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');
    }
    return transaction;
  }

  // Check if we should sample this profile
  if (Math.random() > profilesSampleRate) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Skip profiling transaction due to sampling.');
    }
    return transaction;
  }

  // From initial testing, it seems that the minimum value for sampleInterval is 10ms.
  const samplingIntervalMS = 10;
  // Start the profiler
  const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);
  let profiler;

  // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.
  // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens
  // as we risk breaking the user's application, so just disable profiling and log an error.
  try {
    profiler = new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });
  } catch (e) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        "[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.",
      );
      logger.log('[Profiling] Disabling profiling for current user session.');
    }
    PROFILING_CONSTRUCTOR_FAILED = true;
  }

  // We failed to construct the profiler, fallback to original transaction - there is no need to log
  // anything as we already did that in the try/catch block.
  if (!profiler) {
    return transaction;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    logger.log(`[Profiling] started profiling transaction: ${transaction.name || transaction.description}`);
  }

  // We create "unique" transaction names to avoid concurrent transactions with same names
  // from being ignored by the profiler. From here on, only this transaction name should be used when
  // calling the profiler methods. Note: we log the original name to the user to avoid confusion.
  const profileId = uuid4();

  // A couple of important things to note here:
  // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.
  // Whichever of the two (transaction.finish/timeout) is first to run, the profiling will be stopped and the gathered profile
  // will be processed when the original transaction is finished. Since onProfileHandler can be invoked multiple times in the
  // event of an error or user mistake (calling transaction.finish multiple times), it is important that the behavior of onProfileHandler
  // is idempotent as we do not want any timings or profiles to be overriden by the last call to onProfileHandler.
  // After the original finish method is called, the event will be reported through the integration and delegated to transport.
  let processedProfile = null;

  /**
   * Idempotent handler for profile stop
   */
  function onProfileHandler() {
    // Check if the profile exists and return it the behavior has to be idempotent as users may call transaction.finish multiple times.
    if (!transaction) {
      return;
    }
    // Satisfy the type checker, but profiler will always be defined here.
    if (!profiler) {
      return;
    }
    if (processedProfile) {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        logger.log(
          '[Profiling] profile for:',
          transaction.name || transaction.description,
          'already exists, returning early',
        );
      }
      return;
    }

    profiler
      .stop()
      .then((p) => {
        if (maxDurationTimeoutID) {
          WINDOW.clearTimeout(maxDurationTimeoutID);
          maxDurationTimeoutID = undefined;
        }

        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          logger.log(`[Profiling] stopped profiling of transaction: ${transaction.name || transaction.description}`);
        }

        // In case of an overlapping transaction, stopProfiling may return null and silently ignore the overlapping profile.
        if (!p) {
          if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
            logger.log(
              `[Profiling] profiler returned null profile for: ${transaction.name || transaction.description}`,
              'this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started',
            );
          }
          return;
        }

        // If a profile has less than 2 samples, it is not useful and should be discarded.
        if (p.samples.length < 2) {
          return;
        }

        processedProfile = { ...p, profile_id: profileId };
        sendProfile(profileId, processedProfile);
      })
      .catch(error => {
        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          logger.log('[Profiling] error while stopping profiler:', error);
        }
        return null;
      });
  }

  // Enqueue a timeout to prevent profiles from running over max duration.
  let maxDurationTimeoutID = WINDOW.setTimeout(() => {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] max profile duration elapsed, stopping profiling for:',
        transaction.name || transaction.description,
      );
    }
    void onProfileHandler();
  }, MAX_PROFILE_DURATION_MS);

  // We need to reference the original finish call to avoid creating an infinite loop
  const originalFinish = transaction.finish.bind(transaction);

  /**
   * Wraps startTransaction and stopTransaction with profiling related logic.
   * startProfiling is called after the call to startTransaction in order to avoid our own code from
   * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.
   */
  function profilingWrappedTransactionFinish() {
    if (!transaction) {
      return originalFinish();
    }
    // onProfileHandler should always return the same profile even if this is called multiple times.
    // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.
    onProfileHandler();

    // Set profile context
    transaction.setContext('profile', { profile_id: profileId });

    return originalFinish();
  }

  transaction.finish = profilingWrappedTransactionFinish;
  return transaction;
}

/**
 * Wraps startTransaction with profiling logic. This is done automatically by the profiling integration.
 */
function __PRIVATE__wrapStartTransactionWithProfiling(startTransaction) {
  return function wrappedStartTransaction(

    transactionContext,
    customSamplingContext,
  ) {
    const transaction = startTransaction.call(this, transactionContext, customSamplingContext);
    if (transaction === undefined) {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        logger.log('[Profiling] Transaction is undefined, skipping profiling');
      }
      return transaction;
    }

    return wrapTransactionWithProfiling(transaction);
  };
}

/**
 * Patches startTransaction and stopTransaction with profiling logic.
 */
function addProfilingExtensionMethods() {
  const carrier = getMainCarrier();
  if (!carrier.__SENTRY__) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log("[Profiling] Can't find main carrier, profiling won't work.");
    }
    return;
  }
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};

  if (!carrier.__SENTRY__.extensions['startTransaction']) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] startTransaction does not exists, profiling will not work. Make sure you import @sentry/tracing package before @sentry/profiling-node as import order matters.',
      );
    }
    return;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    logger.log('[Profiling] startTransaction exists, patching it with profiling functionality...');
  }

  carrier.__SENTRY__.extensions['startTransaction'] = __PRIVATE__wrapStartTransactionWithProfiling(
    // This is already patched by sentry/tracing, we are going to re-patch it...
    carrier.__SENTRY__.extensions['startTransaction'] ,
  );
}

export { addProfilingExtensionMethods, onProfilingStartRouteTransaction };
//# sourceMappingURL=hubextensions.js.map
{"version":3,"file":"hubextensions.js","sources":["../../../../src/profiling/hubextensions.ts"],"sourcesContent":["import { getCurrentHub, getMainCarrier } from '@sentry/core';\nimport type { CustomSamplingContext, Hub, Transaction, TransactionContext } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type {\n  JSSelfProfile,\n  JSSelfProfiler,\n  JSSelfProfilerConstructor,\n  ProcessedJSSelfProfile,\n} from './jsSelfProfiling';\nimport { sendProfile } from './sendProfile';\n\n// Max profile duration.\nconst MAX_PROFILE_DURATION_MS = 30_000;\n// Keep a flag value to avoid re-initializing the profiler constructor. If it fails\n// once, it will always fail and this allows us to early return.\nlet PROFILING_CONSTRUCTOR_FAILED = false;\n\n// While we experiment, per transaction sampling interval will be more flexible to work with.\ntype StartTransaction = (\n  this: Hub,\n  transactionContext: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n) => Transaction | undefined;\n\n/**\n * Check if profiler constructor is available.\n * @param maybeProfiler\n */\nfunction isJSProfilerSupported(maybeProfiler: unknown): maybeProfiler is typeof JSSelfProfilerConstructor {\n  return typeof maybeProfiler === 'function';\n}\n\n/**\n * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -\n * if that happens we want to avoid throwing an error from profiling code.\n * see https://github.com/getsentry/sentry-javascript/issues/4731.\n *\n * @experimental\n */\nexport function onProfilingStartRouteTransaction(transaction: Transaction | undefined): Transaction | undefined {\n  if (!transaction) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Transaction is undefined, skipping profiling');\n    }\n    return transaction;\n  }\n\n  return wrapTransactionWithProfiling(transaction);\n}\n\n/**\n * Wraps startTransaction and stopTransaction with profiling related logic.\n * startProfiling is called after the call to startTransaction in order to avoid our own code from\n * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n */\nfunction wrapTransactionWithProfiling(transaction: Transaction): Transaction {\n  // Feature support check first\n  const JSProfilerConstructor = WINDOW.Profiler;\n\n  if (!isJSProfilerSupported(JSProfilerConstructor)) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.',\n      );\n    }\n    return transaction;\n  }\n\n  // profilesSampleRate is multiplied with tracesSampleRate to get the final sampling rate.\n  if (!transaction.sampled) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Transaction is not sampled, skipping profiling');\n    }\n    return transaction;\n  }\n\n  // If constructor failed once, it will always fail, so we can early return.\n  if (PROFILING_CONSTRUCTOR_FAILED) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Profiling has been disabled for the duration of the current user session.');\n    }\n    return transaction;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = client && client.getOptions();\n\n  // @ts-ignore not part of the browser options yet\n  const profilesSampleRate = (options && options.profilesSampleRate) || 0;\n  if (profilesSampleRate === undefined) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Profiling disabled, enable it by setting `profilesSampleRate` option to SDK init call.');\n    }\n    return transaction;\n  }\n\n  // Check if we should sample this profile\n  if (Math.random() > profilesSampleRate) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Skip profiling transaction due to sampling.');\n    }\n    return transaction;\n  }\n\n  // From initial testing, it seems that the minimum value for sampleInterval is 10ms.\n  const samplingIntervalMS = 10;\n  // Start the profiler\n  const maxSamples = Math.floor(MAX_PROFILE_DURATION_MS / samplingIntervalMS);\n  let profiler: JSSelfProfiler | undefined;\n\n  // Attempt to initialize the profiler constructor, if it fails, we disable profiling for the current user session.\n  // This is likely due to a missing 'Document-Policy': 'js-profiling' header. We do not want to throw an error if this happens\n  // as we risk breaking the user's application, so just disable profiling and log an error.\n  try {\n    profiler = new JSProfilerConstructor({ sampleInterval: samplingIntervalMS, maxBufferSize: maxSamples });\n  } catch (e) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        \"[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header.\",\n      );\n      logger.log('[Profiling] Disabling profiling for current user session.');\n    }\n    PROFILING_CONSTRUCTOR_FAILED = true;\n  }\n\n  // We failed to construct the profiler, fallback to original transaction - there is no need to log\n  // anything as we already did that in the try/catch block.\n  if (!profiler) {\n    return transaction;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log(`[Profiling] started profiling transaction: ${transaction.name || transaction.description}`);\n  }\n\n  // We create \"unique\" transaction names to avoid concurrent transactions with same names\n  // from being ignored by the profiler. From here on, only this transaction name should be used when\n  // calling the profiler methods. Note: we log the original name to the user to avoid confusion.\n  const profileId = uuid4();\n\n  // A couple of important things to note here:\n  // `CpuProfilerBindings.stopProfiling` will be scheduled to run in 30seconds in order to exceed max profile duration.\n  // Whichever of the two (transaction.finish/timeout) is first to run, the profiling will be stopped and the gathered profile\n  // will be processed when the original transaction is finished. Since onProfileHandler can be invoked multiple times in the\n  // event of an error or user mistake (calling transaction.finish multiple times), it is important that the behavior of onProfileHandler\n  // is idempotent as we do not want any timings or profiles to be overriden by the last call to onProfileHandler.\n  // After the original finish method is called, the event will be reported through the integration and delegated to transport.\n  let processedProfile: ProcessedJSSelfProfile | null = null;\n\n  /**\n   * Idempotent handler for profile stop\n   */\n  function onProfileHandler(): void {\n    // Check if the profile exists and return it the behavior has to be idempotent as users may call transaction.finish multiple times.\n    if (!transaction) {\n      return;\n    }\n    // Satisfy the type checker, but profiler will always be defined here.\n    if (!profiler) {\n      return;\n    }\n    if (processedProfile) {\n      if (__DEBUG_BUILD__) {\n        logger.log(\n          '[Profiling] profile for:',\n          transaction.name || transaction.description,\n          'already exists, returning early',\n        );\n      }\n      return;\n    }\n\n    profiler\n      .stop()\n      .then((p: JSSelfProfile): void => {\n        if (maxDurationTimeoutID) {\n          WINDOW.clearTimeout(maxDurationTimeoutID);\n          maxDurationTimeoutID = undefined;\n        }\n\n        if (__DEBUG_BUILD__) {\n          logger.log(`[Profiling] stopped profiling of transaction: ${transaction.name || transaction.description}`);\n        }\n\n        // In case of an overlapping transaction, stopProfiling may return null and silently ignore the overlapping profile.\n        if (!p) {\n          if (__DEBUG_BUILD__) {\n            logger.log(\n              `[Profiling] profiler returned null profile for: ${transaction.name || transaction.description}`,\n              'this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started',\n            );\n          }\n          return;\n        }\n\n        // If a profile has less than 2 samples, it is not useful and should be discarded.\n        if (p.samples.length < 2) {\n          return;\n        }\n\n        processedProfile = { ...p, profile_id: profileId };\n        sendProfile(profileId, processedProfile);\n      })\n      .catch(error => {\n        if (__DEBUG_BUILD__) {\n          logger.log('[Profiling] error while stopping profiler:', error);\n        }\n        return null;\n      });\n  }\n\n  // Enqueue a timeout to prevent profiles from running over max duration.\n  let maxDurationTimeoutID: number | undefined = WINDOW.setTimeout(() => {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] max profile duration elapsed, stopping profiling for:',\n        transaction.name || transaction.description,\n      );\n    }\n    void onProfileHandler();\n  }, MAX_PROFILE_DURATION_MS);\n\n  // We need to reference the original finish call to avoid creating an infinite loop\n  const originalFinish = transaction.finish.bind(transaction);\n\n  /**\n   * Wraps startTransaction and stopTransaction with profiling related logic.\n   * startProfiling is called after the call to startTransaction in order to avoid our own code from\n   * being profiled. Because of that same reason, stopProfiling is called before the call to stopTransaction.\n   */\n  function profilingWrappedTransactionFinish(): Promise<Transaction> {\n    if (!transaction) {\n      return originalFinish();\n    }\n    // onProfileHandler should always return the same profile even if this is called multiple times.\n    // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared.\n    onProfileHandler();\n\n    // Set profile context\n    transaction.setContext('profile', { profile_id: profileId });\n\n    return originalFinish();\n  }\n\n  transaction.finish = profilingWrappedTransactionFinish;\n  return transaction;\n}\n\n/**\n * Wraps startTransaction with profiling logic. This is done automatically by the profiling integration.\n */\nfunction __PRIVATE__wrapStartTransactionWithProfiling(startTransaction: StartTransaction): StartTransaction {\n  return function wrappedStartTransaction(\n    this: Hub,\n    transactionContext: TransactionContext,\n    customSamplingContext?: CustomSamplingContext,\n  ): Transaction | undefined {\n    const transaction: Transaction | undefined = startTransaction.call(this, transactionContext, customSamplingContext);\n    if (transaction === undefined) {\n      if (__DEBUG_BUILD__) {\n        logger.log('[Profiling] Transaction is undefined, skipping profiling');\n      }\n      return transaction;\n    }\n\n    return wrapTransactionWithProfiling(transaction);\n  };\n}\n\n/**\n * Patches startTransaction and stopTransaction with profiling logic.\n */\nexport function addProfilingExtensionMethods(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\"[Profiling] Can't find main carrier, profiling won't work.\");\n    }\n    return;\n  }\n  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n\n  if (!carrier.__SENTRY__.extensions['startTransaction']) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] startTransaction does not exists, profiling will not work. Make sure you import @sentry/tracing package before @sentry/profiling-node as import order matters.',\n      );\n    }\n    return;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] startTransaction exists, patching it with profiling functionality...');\n  }\n\n  carrier.__SENTRY__.extensions['startTransaction'] = __PRIVATE__wrapStartTransactionWithProfiling(\n    // This is already patched by sentry/tracing, we are going to re-patch it...\n    carrier.__SENTRY__.extensions['startTransaction'] as StartTransaction,\n  );\n}\n"],"names":[],"mappings":";;;;;AAaA;AACA,MAAA,uBAAA,GAAA,KAAA,CAAA;AACA;AACA;AACA,IAAA,4BAAA,GAAA,KAAA,CAAA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,OAAA,aAAA,KAAA,UAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gCAAA,CAAA,WAAA,EAAA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAA,MAAA,CAAA,GAAA,CAAA,0DAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,4BAAA,CAAA,WAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,CAAA,WAAA,EA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AA,GAAA,CAAA,kFAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,4CAAA;AACA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,kBAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}import { logger } from '@sentry/utils';
import { PROFILING_EVENT_CACHE } from './cache.js';
import { addProfilingExtensionMethods } from './hubextensions.js';

/**
 * Browser profiling integration. Stores any event that has contexts["profile"]["profile_id"]
 * This exists because we do not want to await async profiler.stop calls as transaction.finish is called
 * in a synchronous context. Instead, we handle sending the profile async from the promise callback and
 * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the
 * integration less reliable as we might be dropping profiles when the cache is full.
 *
 * @experimental
 */
class BrowserProfilingIntegration  {constructor() { BrowserProfilingIntegration.prototype.__init.call(this); }
    __init() {this.name = 'BrowserProfilingIntegration';}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    // Patching the hub to add the extension methods.
    // Warning: we have an implicit dependency on import order and we will fail patching if the constructor of
    // BrowserProfilingIntegration is called before @sentry/tracing is imported. This is because we need to patch
    // the methods of @sentry/tracing which are patched as a side effect of importing @sentry/tracing.
    addProfilingExtensionMethods();

    // Add our event processor
    addGlobalEventProcessor(this.handleGlobalEvent.bind(this));
  }

  /**
   * @inheritDoc
   */
   handleGlobalEvent(event) {
    const profileId = event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id'];

    if (profileId && typeof profileId === 'string') {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        logger.log('[Profiling] Profiling event found, caching it.');
      }
      PROFILING_EVENT_CACHE.add(profileId, event);
    }

    return event;
  }
}

export { BrowserProfilingIntegration };
//# sourceMappingURL=integration.js.map
{"version":3,"file":"integration.js","sources":["../../../../src/profiling/integration.ts"],"sourcesContent":["import type { Event, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { PROFILING_EVENT_CACHE } from './cache';\nimport { addProfilingExtensionMethods } from './hubextensions';\n\n/**\n * Browser profiling integration. Stores any event that has contexts[\"profile\"][\"profile_id\"]\n * This exists because we do not want to await async profiler.stop calls as transaction.finish is called\n * in a synchronous context. Instead, we handle sending the profile async from the promise callback and\n * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the\n * integration less reliable as we might be dropping profiles when the cache is full.\n *\n * @experimental\n */\nexport class BrowserProfilingIntegration implements Integration {\n  public readonly name: string = 'BrowserProfilingIntegration';\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    // Patching the hub to add the extension methods.\n    // Warning: we have an implicit dependency on import order and we will fail patching if the constructor of\n    // BrowserProfilingIntegration is called before @sentry/tracing is imported. This is because we need to patch\n    // the methods of @sentry/tracing which are patched as a side effect of importing @sentry/tracing.\n    addProfilingExtensionMethods();\n\n    // Add our event processor\n    addGlobalEventProcessor(this.handleGlobalEvent.bind(this));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public handleGlobalEvent(event: Event): Event {\n    const profileId = event.contexts && event.contexts['profile'] && event.contexts['profile']['profile_id'];\n\n    if (profileId && typeof profileId === 'string') {\n      if (__DEBUG_BUILD__) {\n        logger.log('[Profiling] Profiling event found, caching it.');\n      }\n      PROFILING_EVENT_CACHE.add(profileId, event);\n    }\n\n    return event;\n  }\n}\n"],"names":[],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,2BAAA,EAAA,CAAA,WAAA,GAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,8BAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA;AACA;AACA;AACA;AACA;AACA,IAAA,4BAAA,EAAA,CAAA;AACA;AACA;AACA,IAAA,uBAAA,CAAA,IAAA,CAAA,iBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,iBAAA,CAAA,KAAA,EAAA;AACA,IAAA,MAAA,SAAA,GAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,QAAA,CAAA,SAAA,CAAA,IAAA,KAAA,CAAA,QAAA,CAAA,SAAA,CAAA,CAAA,YAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,SAAA,IAAA,OAAA,SAAA,KAAA,QAAA,EAAA;AACA,MAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,QAAA,MAAA,CAAA,GAAA,CAAA,gDAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,qBAAA,CAAA,GAAA,CAAA,SAAA,EAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}import { getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';
import { PROFILING_EVENT_CACHE } from './cache.js';
import { createProfilingEventEnvelope } from './utils.js';

/**
 * Performs lookup in the event cache and sends the profile to Sentry.
 * If the profiled transaction event is found, we use the profiled transaction event and profile
 * to construct a profile type envelope and send it to Sentry.
 */
function sendProfile(profileId, profile) {
  const event = PROFILING_EVENT_CACHE.get(profileId);

  if (!event) {
    // We could not find a corresponding transaction event for this profile.
    // Opt to do nothing for now, but in the future we should implement a simple retry mechanism.
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log("[Profiling] Couldn't find a transaction event for this profile, dropping it.");
    }
    return;
  }

  event.sdkProcessingMetadata = event.sdkProcessingMetadata || {};
  if (event.sdkProcessingMetadata && !event.sdkProcessingMetadata['profile']) {
    event.sdkProcessingMetadata['profile'] = profile;
  }

  // Client, Dsn and Transport are all required to be able to send the profiling event to Sentry.
  // If either of them is not available, we remove the profile from the transaction event.
  // and forward it to the next event processor.
  const hub = getCurrentHub();
  const client = hub.getClient();

  if (!client) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] getClient did not return a Client, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  const dsn = client.getDsn();
  if (!dsn) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] getDsn did not return a Dsn, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  const transport = client.getTransport();
  if (!transport) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(
        '[Profiling] getTransport did not return a Transport, removing profile from event and forwarding to next event processors.',
      );
    }
    return;
  }

  // If all required components are available, we construct a profiling event envelope and send it to Sentry.
  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    logger.log('[Profiling] Preparing envelope and sending a profiling event');
  }
  const envelope = createProfilingEventEnvelope(event , dsn);

  // Evict event from the cache - we want to prevent the LRU cache from prioritizing already sent events over new ones.
  PROFILING_EVENT_CACHE.delete(profileId);

  if (!envelope) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log('[Profiling] Failed to construct envelope');
    }
    return;
  }

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    logger.log('[Profiling] Envelope constructed, sending it');
  }

  // Wrap in try/catch because send will throw in case of a network error.
  transport.send(envelope).then(null, reason => {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Profiling] Error while sending event:', reason);
  });
}

export { sendProfile };
//# sourceMappingURL=sendProfile.js.map
{"version":3,"file":"sendProfile.js","sources":["../../../../src/profiling/sendProfile.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { PROFILING_EVENT_CACHE } from './cache';\nimport type { ProcessedJSSelfProfile } from './jsSelfProfiling';\nimport type { ProfiledEvent } from './utils';\nimport { createProfilingEventEnvelope } from './utils';\n/**\n * Performs lookup in the event cache and sends the profile to Sentry.\n * If the profiled transaction event is found, we use the profiled transaction event and profile\n * to construct a profile type envelope and send it to Sentry.\n */\nexport function sendProfile(profileId: string, profile: ProcessedJSSelfProfile): void {\n  const event = PROFILING_EVENT_CACHE.get(profileId);\n\n  if (!event) {\n    // We could not find a corresponding transaction event for this profile.\n    // Opt to do nothing for now, but in the future we should implement a simple retry mechanism.\n    if (__DEBUG_BUILD__) {\n      logger.log(\"[Profiling] Couldn't find a transaction event for this profile, dropping it.\");\n    }\n    return;\n  }\n\n  event.sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n  if (event.sdkProcessingMetadata && !event.sdkProcessingMetadata['profile']) {\n    event.sdkProcessingMetadata['profile'] = profile;\n  }\n\n  // Client, Dsn and Transport are all required to be able to send the profiling event to Sentry.\n  // If either of them is not available, we remove the profile from the transaction event.\n  // and forward it to the next event processor.\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n\n  if (!client) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getClient did not return a Client, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  const dsn = client.getDsn();\n  if (!dsn) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getDsn did not return a Dsn, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  const transport = client.getTransport();\n  if (!transport) {\n    if (__DEBUG_BUILD__) {\n      logger.log(\n        '[Profiling] getTransport did not return a Transport, removing profile from event and forwarding to next event processors.',\n      );\n    }\n    return;\n  }\n\n  // If all required components are available, we construct a profiling event envelope and send it to Sentry.\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] Preparing envelope and sending a profiling event');\n  }\n  const envelope = createProfilingEventEnvelope(event as ProfiledEvent, dsn);\n\n  // Evict event from the cache - we want to prevent the LRU cache from prioritizing already sent events over new ones.\n  PROFILING_EVENT_CACHE.delete(profileId);\n\n  if (!envelope) {\n    if (__DEBUG_BUILD__) {\n      logger.log('[Profiling] Failed to construct envelope');\n    }\n    return;\n  }\n\n  if (__DEBUG_BUILD__) {\n    logger.log('[Profiling] Envelope constructed, sending it');\n  }\n\n  // Wrap in try/catch because send will throw in case of a network error.\n  transport.send(envelope).then(null, reason => {\n    __DEBUG_BUILD__ && logger.log('[Profiling] Error while sending event:', reason);\n  });\n}\n"],"names":[],"mappings":";;;;;AAOA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,SAAA,EAAA,OAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,qBAAA,CAAA,GAAA,CAAA,SAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,EAAA;AACA;AACA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAA,MAAA,CAAA,GAAA,CAAA,8EAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,KAAA,CAAA,qBAAA,GAAA,KAAA,CAAA,qBAAA,IAAA,EAAA,CAAA;AACA,EAAA,IAAA,KAAA,CAAA,qBAAA,IAAA,CAAA,KAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,EAAA;AACA,IAAA,KAAA,CAAA,qBAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,GAAA,GAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,SAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,MAAA,EAAA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAA,MAAA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A,CAAA,IAAA,CAAA,QAAA,CAAA,CAAA,IAAA,CAAA,IAAA,EAAA,MAAA,IAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,GAAA,CAAA,wCAAA,EAAA,MAAA,CAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;"}import { DEFAULT_ENVIRONMENT } from '@sentry/core';
import { logger, uuid4, createEnvelope, dsnToString, dropUndefinedKeys } from '@sentry/utils';
import { WINDOW } from '../helpers.js';

const MS_TO_NS = 1e6;
// Use 0 as main thread id which is identical to threadId in node:worker_threads
// where main logs 0 and workers seem to log in increments of 1
const THREAD_ID_STRING = String(0);
const THREAD_NAME = 'main';

// Machine properties (eval only once)
let OS_PLATFORM = ''; // macos
let OS_PLATFORM_VERSION = ''; // 13.2
let OS_ARCH = ''; // arm64
let OS_BROWSER = (WINDOW.navigator && WINDOW.navigator.userAgent) || '';
let OS_MODEL = '';
const OS_LOCALE =
  (WINDOW.navigator && WINDOW.navigator.language) ||
  (WINDOW.navigator && WINDOW.navigator.languages && WINDOW.navigator.languages[0]) ||
  '';

function isUserAgentData(data) {
  return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;
}

// @ts-ignore userAgentData is not part of the navigator interface yet
const userAgentData = WINDOW.navigator && WINDOW.navigator.userAgentData;

if (isUserAgentData(userAgentData)) {
  userAgentData
    .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])
    .then((ua) => {
      OS_PLATFORM = ua.platform || '';
      OS_ARCH = ua.architecture || '';
      OS_MODEL = ua.model || '';
      OS_PLATFORM_VERSION = ua.platformVersion || '';

      if (ua.fullVersionList && ua.fullVersionList.length > 0) {
        const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1];
        OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;
      }
    })
    .catch(e => void e);
}

function isRawThreadCpuProfile(profile) {
  return !('thread_metadata' in profile);
}

// Enriches the profile with threadId of the current thread.
// This is done in node as we seem to not be able to get the info from C native code.
/**
 *
 */
function enrichWithThreadInformation(profile) {
  if (!isRawThreadCpuProfile(profile)) {
    return profile;
  }

  return convertJSSelfProfileToSampledFormat(profile);
}

// Profile is marked as optional because it is deleted from the metadata
// by the integration before the event is processed by other integrations.

/** Extract sdk info from from the API metadata */
function getSdkMetadataForEnvelopeHeader(metadata) {
  if (!metadata || !metadata.sdk) {
    return undefined;
  }

  return { name: metadata.sdk.name, version: metadata.sdk.version } ;
}

/**
 * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
 * Merge with existing data if any.
 **/
function enhanceEventWithSdkInfo(event, sdkInfo) {
  if (!sdkInfo) {
    return event;
  }
  event.sdk = event.sdk || {};
  event.sdk.name = event.sdk.name || sdkInfo.name || 'unknown sdk';
  event.sdk.version = event.sdk.version || sdkInfo.version || 'unknown sdk version';
  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];
  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];
  return event;
}

function createEventEnvelopeHeaders(
  event,
  sdkInfo,
  tunnel,
  dsn,
) {
  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata['dynamicSamplingContext'];

  return {
    event_id: event.event_id ,
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: dsnToString(dsn) }),
    ...(event.type === 'transaction' &&
      dynamicSamplingContext && {
        trace: dropUndefinedKeys({ ...dynamicSamplingContext }) ,
      }),
  };
}

function getTraceId(event) {
  const traceId = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id'];
  // Log a warning if the profile has an invalid traceId (should be uuidv4).
  // All profiles and transactions are rejected if this is the case and we want to
  // warn users that this is happening if they enable debug flag
  if (typeof traceId === 'string' && traceId.length !== 32) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);
    }
  }
  if (typeof traceId !== 'string') {
    return '';
  }

  return traceId;
}
/**
 * Creates a profiling event envelope from a Sentry event. If profile does not pass
 * validation, returns null.
 * @param event
 * @param dsn
 * @param metadata
 * @param tunnel
 * @returns {EventEnvelope | null}
 */

/**
 * Creates a profiling event envelope from a Sentry event.
 */
function createProfilingEventEnvelope(
  event,
  dsn,
  metadata,
  tunnel,
) {
  if (event.type !== 'transaction') {
    // createProfilingEventEnvelope should only be called for transactions,
    // we type guard this behavior with isProfiledTransactionEvent.
    throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');
  }

  const rawProfile = event.sdkProcessingMetadata['profile'];

  if (rawProfile === undefined || rawProfile === null) {
    throw new TypeError(
      `Cannot construct profiling event envelope without a valid profile. Got ${rawProfile} instead.`,
    );
  }

  if (!rawProfile.profile_id) {
    throw new TypeError('Profile is missing profile_id');
  }

  if (rawProfile.samples.length <= 1) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      // Log a warning if the profile has less than 2 samples so users can know why
      // they are not seeing any profiling data and we cant avoid the back and forth
      // of asking them to provide us with a dump of the profile data.
      logger.log('[Profiling] Discarding profile because it contains less than 2 samples');
    }
    return null;
  }

  const traceId = getTraceId(event);
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);
  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);
  const enrichedThreadProfile = enrichWithThreadInformation(rawProfile);
  const transactionStartMs = typeof event.start_timestamp === 'number' ? event.start_timestamp * 1000 : Date.now();
  const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now();

  const profile = {
    event_id: rawProfile.profile_id,
    timestamp: new Date(transactionStartMs).toISOString(),
    platform: 'javascript',
    version: '1',
    release: event.release || '',
    environment: event.environment || DEFAULT_ENVIRONMENT,
    runtime: {
      name: 'javascript',
      version: WINDOW.navigator.userAgent,
    },
    os: {
      name: OS_PLATFORM,
      version: OS_PLATFORM_VERSION,
      build_number: OS_BROWSER,
    },
    device: {
      locale: OS_LOCALE,
      model: OS_MODEL,
      manufacturer: OS_BROWSER,
      architecture: OS_ARCH,
      is_emulator: false,
    },
    profile: enrichedThreadProfile,
    transactions: [
      {
        name: event.transaction || '',
        id: event.event_id || uuid4(),
        trace_id: traceId,
        active_thread_id: THREAD_ID_STRING,
        relative_start_ns: '0',
        relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),
      },
    ],
  };

  const envelopeItem = [
    {
      type: 'profile',
    },
    // @ts-ignore this is missing in typedef
    profile,
  ];

  return createEnvelope(envelopeHeaders, [envelopeItem]);
}

/**
 * Converts a JSSelfProfile to a our sampled format.
 * Does not currently perform stack indexing.
 */
function convertJSSelfProfileToSampledFormat(input) {
  let EMPTY_STACK_ID = undefined;
  let STACK_ID = 0;

  // Initialize the profile that we will fill with data
  const profile = {
    samples: [],
    stacks: [],
    frames: [],
    thread_metadata: {
      [THREAD_ID_STRING]: { name: THREAD_NAME },
    },
  };

  if (!input.samples.length) {
    return profile;
  }

  // We assert samples.length > 0 above and timestamp should always be present
  const start = input.samples[0].timestamp;

  for (let i = 0; i < input.samples.length; i++) {
    const jsSample = input.samples[i];

    // If sample has no stack, add an empty sample
    if (jsSample.stackId === undefined) {
      if (EMPTY_STACK_ID === undefined) {
        EMPTY_STACK_ID = STACK_ID;
        profile.stacks[EMPTY_STACK_ID] = [];
        STACK_ID++;
      }

      profile['samples'][i] = {
        // convert ms timestamp to ns
        elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),
        stack_id: EMPTY_STACK_ID,
        thread_id: THREAD_ID_STRING,
      };
      continue;
    }

    let stackTop = input.stacks[jsSample.stackId];

    // Functions in top->down order (root is last)
    // We follow the stackTop.parentId trail and collect each visited frameId
    const stack = [];

    while (stackTop) {
      stack.push(stackTop.frameId);

      const frame = input.frames[stackTop.frameId];

      // If our frame has not been indexed yet, index it
      if (profile.frames[stackTop.frameId] === undefined) {
        profile.frames[stackTop.frameId] = {
          function: frame.name,
          file: frame.resourceId ? input.resources[frame.resourceId] : undefined,
          line: frame.line,
          column: frame.column,
        };
      }

      stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];
    }

    const sample = {
      // convert ms timestamp to ns
      elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),
      stack_id: STACK_ID,
      thread_id: THREAD_ID_STRING,
    };

    profile['stacks'][STACK_ID] = stack;
    profile['samples'][i] = sample;
    STACK_ID++;
  }

  return profile;
}

export { convertJSSelfProfileToSampledFormat, createProfilingEventEnvelope, enrichWithThreadInformation };
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/profiling/utils.ts"],"sourcesContent":["import { DEFAULT_ENVIRONMENT } from '@sentry/core';\nimport type {\n  DsnComponents,\n  DynamicSamplingContext,\n  Event,\n  EventEnvelope,\n  EventEnvelopeHeaders,\n  EventItem,\n  SdkInfo,\n  SdkMetadata,\n} from '@sentry/types';\nimport { createEnvelope, dropUndefinedKeys, dsnToString, logger, uuid4 } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\nimport type {\n  JSSelfProfile,\n  JSSelfProfileStack,\n  RawThreadCpuProfile,\n  SentryProfile,\n  ThreadCpuProfile,\n} from './jsSelfProfiling';\n\nconst MS_TO_NS = 1e6;\n// Use 0 as main thread id which is identical to threadId in node:worker_threads\n// where main logs 0 and workers seem to log in increments of 1\nconst THREAD_ID_STRING = String(0);\nconst THREAD_NAME = 'main';\n\n// Machine properties (eval only once)\nlet OS_PLATFORM = ''; // macos\nlet OS_PLATFORM_VERSION = ''; // 13.2\nlet OS_ARCH = ''; // arm64\nlet OS_BROWSER = (WINDOW.navigator && WINDOW.navigator.userAgent) || '';\nlet OS_MODEL = '';\nconst OS_LOCALE =\n  (WINDOW.navigator && WINDOW.navigator.language) ||\n  (WINDOW.navigator && WINDOW.navigator.languages && WINDOW.navigator.languages[0]) ||\n  '';\n\ntype UAData = {\n  platform?: string;\n  architecture?: string;\n  model?: string;\n  platformVersion?: string;\n  fullVersionList?: {\n    brand: string;\n    version: string;\n  }[];\n};\n\ninterface UserAgentData {\n  getHighEntropyValues: (keys: string[]) => Promise<UAData>;\n}\n\nfunction isUserAgentData(data: unknown): data is UserAgentData {\n  return typeof data === 'object' && data !== null && 'getHighEntropyValues' in data;\n}\n\n// @ts-ignore userAgentData is not part of the navigator interface yet\nconst userAgentData = WINDOW.navigator && WINDOW.navigator.userAgentData;\n\nif (isUserAgentData(userAgentData)) {\n  userAgentData\n    .getHighEntropyValues(['architecture', 'model', 'platform', 'platformVersion', 'fullVersionList'])\n    .then((ua: UAData) => {\n      OS_PLATFORM = ua.platform || '';\n      OS_ARCH = ua.architecture || '';\n      OS_MODEL = ua.model || '';\n      OS_PLATFORM_VERSION = ua.platformVersion || '';\n\n      if (ua.fullVersionList && ua.fullVersionList.length > 0) {\n        const firstUa = ua.fullVersionList[ua.fullVersionList.length - 1];\n        OS_BROWSER = `${firstUa.brand} ${firstUa.version}`;\n      }\n    })\n    .catch(e => void e);\n}\n\nfunction isRawThreadCpuProfile(profile: ThreadCpuProfile | RawThreadCpuProfile): profile is RawThreadCpuProfile {\n  return !('thread_metadata' in profile);\n}\n\n// Enriches the profile with threadId of the current thread.\n// This is done in node as we seem to not be able to get the info from C native code.\n/**\n *\n */\nexport function enrichWithThreadInformation(profile: ThreadCpuProfile | RawThreadCpuProfile): ThreadCpuProfile {\n  if (!isRawThreadCpuProfile(profile)) {\n    return profile;\n  }\n\n  return convertJSSelfProfileToSampledFormat(profile);\n}\n\n// Profile is marked as optional because it is deleted from the metadata\n// by the integration before the event is processed by other integrations.\nexport interface ProfiledEvent extends Event {\n  sdkProcessingMetadata: {\n    profile?: RawThreadCpuProfile;\n  };\n}\n\n/** Extract sdk info from from the API metadata */\nfunction getSdkMetadataForEnvelopeHeader(metadata?: SdkMetadata): SdkInfo | undefined {\n  if (!metadata || !metadata.sdk) {\n    return undefined;\n  }\n\n  return { name: metadata.sdk.name, version: metadata.sdk.version } as SdkInfo;\n}\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n  if (!sdkInfo) {\n    return event;\n  }\n  event.sdk = event.sdk || {};\n  event.sdk.name = event.sdk.name || sdkInfo.name || 'unknown sdk';\n  event.sdk.version = event.sdk.version || sdkInfo.version || 'unknown sdk version';\n  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n  return event;\n}\n\nfunction createEventEnvelopeHeaders(\n  event: Event,\n  sdkInfo: SdkInfo | undefined,\n  tunnel: string | undefined,\n  dsn: DsnComponents,\n): EventEnvelopeHeaders {\n  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata['dynamicSamplingContext'];\n\n  return {\n    event_id: event.event_id as string,\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n    ...(event.type === 'transaction' &&\n      dynamicSamplingContext && {\n        trace: dropUndefinedKeys({ ...dynamicSamplingContext }) as DynamicSamplingContext,\n      }),\n  };\n}\n\nfunction getTraceId(event: Event): string {\n  const traceId: unknown = event && event.contexts && event.contexts['trace'] && event.contexts['trace']['trace_id'];\n  // Log a warning if the profile has an invalid traceId (should be uuidv4).\n  // All profiles and transactions are rejected if this is the case and we want to\n  // warn users that this is happening if they enable debug flag\n  if (typeof traceId === 'string' && traceId.length !== 32) {\n    if (__DEBUG_BUILD__) {\n      logger.log(`[Profiling] Invalid traceId: ${traceId} on profiled event`);\n    }\n  }\n  if (typeof traceId !== 'string') {\n    return '';\n  }\n\n  return traceId;\n}\n/**\n * Creates a profiling event envelope from a Sentry event. If profile does not pass\n * validation, returns null.\n * @param event\n * @param dsn\n * @param metadata\n * @param tunnel\n * @returns {EventEnvelope | null}\n */\n\n/**\n * Creates a profiling event envelope from a Sentry event.\n */\nexport function createProfilingEventEnvelope(\n  event: ProfiledEvent,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): EventEnvelope | null {\n  if (event.type !== 'transaction') {\n    // createProfilingEventEnvelope should only be called for transactions,\n    // we type guard this behavior with isProfiledTransactionEvent.\n    throw new TypeError('Profiling events may only be attached to transactions, this should never occur.');\n  }\n\n  const rawProfile = event.sdkProcessingMetadata['profile'];\n\n  if (rawProfile === undefined || rawProfile === null) {\n    throw new TypeError(\n      `Cannot construct profiling event envelope without a valid profile. Got ${rawProfile} instead.`,\n    );\n  }\n\n  if (!rawProfile.profile_id) {\n    throw new TypeError('Profile is missing profile_id');\n  }\n\n  if (rawProfile.samples.length <= 1) {\n    if (__DEBUG_BUILD__) {\n      // Log a warning if the profile has less than 2 samples so users can know why\n      // they are not seeing any profiling data and we cant avoid the back and forth\n      // of asking them to provide us with a dump of the profile data.\n      logger.log('[Profiling] Discarding profile because it contains less than 2 samples');\n    }\n    return null;\n  }\n\n  const traceId = getTraceId(event);\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n  const enrichedThreadProfile = enrichWithThreadInformation(rawProfile);\n  const transactionStartMs = typeof event.start_timestamp === 'number' ? event.start_timestamp * 1000 : Date.now();\n  const transactionEndMs = typeof event.timestamp === 'number' ? event.timestamp * 1000 : Date.now();\n\n  const profile: SentryProfile = {\n    event_id: rawProfile.profile_id,\n    timestamp: new Date(transactionStartMs).toISOString(),\n    platform: 'javascript',\n    version: '1',\n    release: event.release || '',\n    environment: event.environment || DEFAULT_ENVIRONMENT,\n    runtime: {\n      name: 'javascript',\n      version: WINDOW.navigator.userAgent,\n    },\n    os: {\n      name: OS_PLATFORM,\n      version: OS_PLATFORM_VERSION,\n      build_number: OS_BROWSER,\n    },\n    device: {\n      locale: OS_LOCALE,\n      model: OS_MODEL,\n      manufacturer: OS_BROWSER,\n      architecture: OS_ARCH,\n      is_emulator: false,\n    },\n    profile: enrichedThreadProfile,\n    transactions: [\n      {\n        name: event.transaction || '',\n        id: event.event_id || uuid4(),\n        trace_id: traceId,\n        active_thread_id: THREAD_ID_STRING,\n        relative_start_ns: '0',\n        relative_end_ns: ((transactionEndMs - transactionStartMs) * 1e6).toFixed(0),\n      },\n    ],\n  };\n\n  const envelopeItem: EventItem = [\n    {\n      type: 'profile',\n    },\n    // @ts-ignore this is missing in typedef\n    profile,\n  ];\n\n  return createEnvelope<EventEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n *\n */\nexport function isProfiledTransactionEvent(event: Event): event is ProfiledEvent {\n  return !!(event.sdkProcessingMetadata && event.sdkProcessingMetadata['profile']);\n}\n\n// Due to how profiles are attached to event metadata, we may sometimes want to remove them to ensure\n// they are not processed by other Sentry integrations. This can be the case when we cannot construct a valid\n// profile from the data we have or some of the mechanisms to send the event (Hub, Transport etc) are not available to us.\n/**\n *\n */\nexport function maybeRemoveProfileFromSdkMetadata(event: Event | ProfiledEvent): Event {\n  if (!isProfiledTransactionEvent(event)) {\n    return event;\n  }\n\n  delete event.sdkProcessingMetadata.profile;\n  return event;\n}\n\n/**\n * Converts a JSSelfProfile to a our sampled format.\n * Does not currently perform stack indexing.\n */\nexport function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): ThreadCpuProfile {\n  let EMPTY_STACK_ID: undefined | number = undefined;\n  let STACK_ID = 0;\n\n  // Initialize the profile that we will fill with data\n  const profile: ThreadCpuProfile = {\n    samples: [],\n    stacks: [],\n    frames: [],\n    thread_metadata: {\n      [THREAD_ID_STRING]: { name: THREAD_NAME },\n    },\n  };\n\n  if (!input.samples.length) {\n    return profile;\n  }\n\n  // We assert samples.length > 0 above and timestamp should always be present\n  const start = input.samples[0].timestamp;\n\n  for (let i = 0; i < input.samples.length; i++) {\n    const jsSample = input.samples[i];\n\n    // If sample has no stack, add an empty sample\n    if (jsSample.stackId === undefined) {\n      if (EMPTY_STACK_ID === undefined) {\n        EMPTY_STACK_ID = STACK_ID;\n        profile.stacks[EMPTY_STACK_ID] = [];\n        STACK_ID++;\n      }\n\n      profile['samples'][i] = {\n        // convert ms timestamp to ns\n        elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),\n        stack_id: EMPTY_STACK_ID,\n        thread_id: THREAD_ID_STRING,\n      };\n      continue;\n    }\n\n    let stackTop: JSSelfProfileStack | undefined = input.stacks[jsSample.stackId];\n\n    // Functions in top->down order (root is last)\n    // We follow the stackTop.parentId trail and collect each visited frameId\n    const stack: number[] = [];\n\n    while (stackTop) {\n      stack.push(stackTop.frameId);\n\n      const frame = input.frames[stackTop.frameId];\n\n      // If our frame has not been indexed yet, index it\n      if (profile.frames[stackTop.frameId] === undefined) {\n        profile.frames[stackTop.frameId] = {\n          function: frame.name,\n          file: frame.resourceId ? input.resources[frame.resourceId] : undefined,\n          line: frame.line,\n          column: frame.column,\n        };\n      }\n\n      stackTop = stackTop.parentId === undefined ? undefined : input.stacks[stackTop.parentId];\n    }\n\n    const sample: ThreadCpuProfile['samples'][0] = {\n      // convert ms timestamp to ns\n      elapsed_since_start_ns: ((jsSample.timestamp - start) * MS_TO_NS).toFixed(0),\n      stack_id: STACK_ID,\n      thread_id: THREAD_ID_STRING,\n    };\n\n    profile['stacks'][STACK_ID] = stack;\n    profile['samples'][i] = sample;\n    STACK_ID++;\n  }\n\n  return profile;\n}\n"],"names":[],"mappings":";;;;AAsBA,MAAA,QAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,MAAA,WAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,IAAA,WAAA,GAAA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import { stackParserFromStackParserOptions, supportsFetch, logger, resolvedSyncPromise, addInstrumentationHandler } from '@sentry/utils';
import { BrowserClient } from './client.js';
import { WINDOW, wrap as wrap$1 } from './helpers.js';
import { GlobalHandlers } from './integrations/globalhandlers.js';
import { TryCatch } from './integrations/trycatch.js';
import { Breadcrumbs } from './integrations/breadcrumbs.js';
import { LinkedErrors } from './integrations/linkederrors.js';
import { HttpContext } from './integrations/httpcontext.js';
import { Dedupe } from './integrations/dedupe.js';
import { defaultStackParser } from './stack-parsers.js';
import { makeFetchTransport } from './transports/fetch.js';
import { makeXHRTransport } from './transports/xhr.js';

const defaultIntegrations = [
  new Integrations.InboundFilters(),
  new Integrations.FunctionToString(),
  new TryCatch(),
  new Breadcrumbs(),
  new GlobalHandlers(),
  new LinkedErrors(),
  new Dedupe(),
  new HttpContext(),
];

/**
 * A magic string that build tooling can leverage in order to inject a release value into the SDK.
 */

/**
 * The Sentry Browser SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible when
 * loading the web page. To set context information or send manual events, use
 * the provided methods.
 *
 * @example
 *
 * ```
 *
 * import { init } from '@sentry/browser';
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { configureScope } from '@sentry/browser';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { addBreadcrumb } from '@sentry/browser';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 *
 * ```
 *
 * import * as Sentry from '@sentry/browser';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link BrowserOptions} for documentation on configuration options.
 */
function init(options = {}) {
  if (options.defaultIntegrations === undefined) {
    options.defaultIntegrations = defaultIntegrations;
  }
  if (options.release === undefined) {
    // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value
    if (typeof __SENTRY_RELEASE__ === 'string') {
      options.release = __SENTRY_RELEASE__;
    }

    // This supports the variable that sentry-webpack-plugin injects
    if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {
      options.release = WINDOW.SENTRY_RELEASE.id;
    }
  }
  if (options.autoSessionTracking === undefined) {
    options.autoSessionTracking = true;
  }
  if (options.sendClientReports === undefined) {
    options.sendClientReports = true;
  }

  const clientOptions = {
    ...options,
    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
    integrations: getIntegrationsToSetup(options),
    transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),
  };

  initAndBind(BrowserClient, clientOptions);

  if (options.autoSessionTracking) {
    startSessionTracking();
  }
}

/**
 * Present the user with a report dialog.
 *
 * @param options Everything is optional, we try to fetch all info need from the global scope.
 */
function showReportDialog(options = {}, hub = getCurrentHub()) {
  // doesn't work without a document (React Native)
  if (!WINDOW.document) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Global document not defined in showReportDialog call');
    return;
  }

  const { client, scope } = hub.getStackTop();
  const dsn = options.dsn || (client && client.getDsn());
  if (!dsn) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('DSN not configured for showReportDialog call');
    return;
  }

  if (scope) {
    options.user = {
      ...scope.getUser(),
      ...options.user,
    };
  }

  if (!options.eventId) {
    options.eventId = hub.lastEventId();
  }

  const script = WINDOW.document.createElement('script');
  script.async = true;
  script.src = getReportDialogEndpoint(dsn, options);

  if (options.onLoad) {
    script.onload = options.onLoad;
  }

  const injectionPoint = WINDOW.document.head || WINDOW.document.body;
  if (injectionPoint) {
    injectionPoint.appendChild(script);
  } else {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Not injecting report dialog. No injection point found in HTML');
  }
}

/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
function lastEventId() {
  return getCurrentHub().lastEventId();
}

/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
function forceLoad() {
  // Noop
}

/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
function onLoad(callback) {
  callback();
}

/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function flush(timeout) {
  const client = getCurrentHub().getClient();
  if (client) {
    return client.flush(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events. No client defined.');
  return resolvedSyncPromise(false);
}

/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function close(timeout) {
  const client = getCurrentHub().getClient();
  if (client) {
    return client.close(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events and disable SDK. No client defined.');
  return resolvedSyncPromise(false);
}

/**
 * Wrap code within a try/catch block so the SDK is able to capture errors.
 *
 * @param fn A function to wrap.
 *
 * @returns The result of wrapped function call.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function wrap(fn) {
  return wrap$1(fn)();
}

function startSessionOnHub(hub) {
  hub.startSession({ ignoreDuration: true });
  hub.captureSession();
}

/**
 * Enable automatic Session Tracking for the initial page load.
 */
function startSessionTracking() {
  if (typeof WINDOW.document === 'undefined') {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
    return;
  }

  const hub = getCurrentHub();

  // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and
  // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are
  // pinned at the same version in package.json, but there are edge cases where it's possible. See
  // https://github.com/getsentry/sentry-javascript/issues/3207 and
  // https://github.com/getsentry/sentry-javascript/issues/3234 and
  // https://github.com/getsentry/sentry-javascript/issues/3278.
  if (!hub.captureSession) {
    return;
  }

  // The session duration for browser sessions does not track a meaningful
  // concept that can be used as a metric.
  // Automatically captured sessions are akin to page views, and thus we
  // discard their duration.
  startSessionOnHub(hub);

  // We want to create a session for every navigation as well
  addInstrumentationHandler('history', ({ from, to }) => {
    // Don't create an additional session for the initial route or if the location did not change
    if (!(from === undefined || from === to)) {
      startSessionOnHub(getCurrentHub());
    }
  });
}

/**
 * Captures user feedback and sends it to Sentry.
 */
function captureUserFeedback(feedback) {
  const client = getCurrentHub().getClient();
  if (client) {
    client.captureUserFeedback(feedback);
  }
}

export { captureUserFeedback, close, defaultIntegrations, flush, forceLoad, init, lastEventId, onLoad, showReportDialog, wrap };
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../../src/sdk.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport {\n  getCurrentHub,\n  getIntegrationsToSetup,\n  getReportDialogEndpoint,\n  initAndBind,\n  Integrations as CoreIntegrations,\n} from '@sentry/core';\nimport type { UserFeedback } from '@sentry/types';\nimport {\n  addInstrumentationHandler,\n  logger,\n  resolvedSyncPromise,\n  stackParserFromStackParserOptions,\n  supportsFetch,\n} from '@sentry/utils';\n\nimport type { BrowserClientOptions, BrowserOptions } from './client';\nimport { BrowserClient } from './client';\nimport type { ReportDialogOptions } from './helpers';\nimport { WINDOW, wrap as internalWrap } from './helpers';\nimport { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations';\nimport { defaultStackParser } from './stack-parsers';\nimport { makeFetchTransport, makeXHRTransport } from './transports';\n\nexport const defaultIntegrations = [\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  new TryCatch(),\n  new Breadcrumbs(),\n  new GlobalHandlers(),\n  new LinkedErrors(),\n  new Dedupe(),\n  new HttpContext(),\n];\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\ndeclare const __SENTRY_RELEASE__: string | undefined;\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nexport function init(options: BrowserOptions = {}): void {\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n  if (options.release === undefined) {\n    // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n    if (typeof __SENTRY_RELEASE__ === 'string') {\n      options.release = __SENTRY_RELEASE__;\n    }\n\n    // This supports the variable that sentry-webpack-plugin injects\n    if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n      options.release = WINDOW.SENTRY_RELEASE.id;\n    }\n  }\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = true;\n  }\n  if (options.sendClientReports === undefined) {\n    options.sendClientReports = true;\n  }\n\n  const clientOptions: BrowserClientOptions = {\n    ...options,\n    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n    integrations: getIntegrationsToSetup(options),\n    transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n  };\n\n  initAndBind(BrowserClient, clientOptions);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * Present the user with a report dialog.\n *\n * @param options Everything is optional, we try to fetch all info need from the global scope.\n */\nexport function showReportDialog(options: ReportDialogOptions = {}, hub: Hub = getCurrentHub()): void {\n  // doesn't work without a document (React Native)\n  if (!WINDOW.document) {\n    __DEBUG_BUILD__ && logger.error('Global document not defined in showReportDialog call');\n    return;\n  }\n\n  const { client, scope } = hub.getStackTop();\n  const dsn = options.dsn || (client && client.getDsn());\n  if (!dsn) {\n    __DEBUG_BUILD__ && logger.error('DSN not configured for showReportDialog call');\n    return;\n  }\n\n  if (scope) {\n    options.user = {\n      ...scope.getUser(),\n      ...options.user,\n    };\n  }\n\n  if (!options.eventId) {\n    options.eventId = hub.lastEventId();\n  }\n\n  const script = WINDOW.document.createElement('script');\n  script.async = true;\n  script.src = getReportDialogEndpoint(dsn, options);\n\n  if (options.onLoad) {\n    script.onload = options.onLoad;\n  }\n\n  const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n  if (injectionPoint) {\n    injectionPoint.appendChild(script);\n  } else {\n    __DEBUG_BUILD__ && logger.error('Not injecting report dialog. No injection point found in HTML');\n  }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function forceLoad(): void {\n  // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nexport function onLoad(callback: () => void): void {\n  callback();\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport function flush(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.flush(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events. No client defined.');\n  return resolvedSyncPromise(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport function close(timeout?: number): PromiseLike<boolean> {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    return client.close(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events and disable SDK. No client defined.');\n  return resolvedSyncPromise(false);\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrap(fn: (...args: any) => any): any {\n  return internalWrap(fn)();\n}\n\nfunction startSessionOnHub(hub: Hub): void {\n  hub.startSession({ ignoreDuration: true });\n  hub.captureSession();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking(): void {\n  if (typeof WINDOW.document === 'undefined') {\n    __DEBUG_BUILD__ &&\n      logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n    return;\n  }\n\n  const hub = getCurrentHub();\n\n  // The only way for this to be false is for there to be a version mismatch between @sentry/browser (>= 6.0.0) and\n  // @sentry/hub (< 5.27.0). In the simple case, there won't ever be such a mismatch, because the two packages are\n  // pinned at the same version in package.json, but there are edge cases where it's possible. See\n  // https://github.com/getsentry/sentry-javascript/issues/3207 and\n  // https://github.com/getsentry/sentry-javascript/issues/3234 and\n  // https://github.com/getsentry/sentry-javascript/issues/3278.\n  if (!hub.captureSession) {\n    return;\n  }\n\n  // The session duration for browser sessions does not track a meaningful\n  // concept that can be used as a metric.\n  // Automatically captured sessions are akin to page views, and thus we\n  // discard their duration.\n  startSessionOnHub(hub);\n\n  // We want to create a session for every navigation as well\n  addInstrumentationHandler('history', ({ from, to }) => {\n    // Don't create an additional session for the initial route or if the location did not change\n    if (!(from === undefined || from === to)) {\n      startSessionOnHub(getCurrentHub());\n    }\n  });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nexport function captureUserFeedback(feedback: UserFeedback): void {\n  const client = getCurrentHub().getClient<BrowserClient>();\n  if (client) {\n    client.captureUserFeedback(feedback);\n  }\n}\n"],"names":["CoreIntegrations","internalWrap"],"mappings":";;;;;;;;;;;;;;AAyBA,MAAA,mBAAA,GAAA;AACA,EAAA,IAAAA,YAAA,CAAA,cAAA,EAAA;AACA,EAAA,IAAAA,YAAA,CAAA,gBAAA,EAAA;AACA,EAAA,IAAA,QAAA,EAAA;AACA,EAAA,IAAA,WAAA,EAAA;AACA,EAAA,IAAA,cAAA,EAAA;AACA,EAAA,IAAA,YAAA,EAAA;AACA,EAAA,IAAA,MAAA,EAAA;AACA,EAAA,IAAA,WAAA,EAAA;AACA,EAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,aAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,IAAA,MAAA,EAAA;AACA,IAAA,MAAA,CAAA,mBAAA,CAAA,QAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { createStackParser } from '@sentry/utils';

// global reference to slice
const UNKNOWN_FUNCTION = '?';

const OPERA10_PRIORITY = 10;
const OPERA11_PRIORITY = 20;
const CHROME_PRIORITY = 30;
const WINJS_PRIORITY = 40;
const GECKO_PRIORITY = 50;

function createFrame(filename, func, lineno, colno) {
  const frame = {
    filename,
    function: func,
    in_app: true, // All browser frames are considered in_app
  };

  if (lineno !== undefined) {
    frame.lineno = lineno;
  }

  if (colno !== undefined) {
    frame.colno = colno;
  }

  return frame;
}

// Chromium based browsers: Chrome, Brave, new Opera, new Edge
const chromeRegex =
  /^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
const chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;

const chrome = line => {
  const parts = chromeRegex.exec(line);

  if (parts) {
    const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line

    if (isEval) {
      const subMatch = chromeEvalRegex.exec(parts[2]);

      if (subMatch) {
        // throw out eval line/column and use top-most line/column number
        parts[2] = subMatch[1]; // url
        parts[3] = subMatch[2]; // line
        parts[4] = subMatch[3]; // column
      }
    }

    // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now
    // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)
    const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);

    return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);
  }

  return;
};

const chromeStackLineParser = [CHROME_PRIORITY, chrome];

// gecko regex: `(?:bundle|\d+\.js)`: `bundle` is for react native, `\d+\.js` also but specifically for ram bundles because it
// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js
// We need this specific case for now because we want no other regex to match.
const geckoREgex =
  /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
const geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;

const gecko = line => {
  const parts = geckoREgex.exec(line);

  if (parts) {
    const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;
    if (isEval) {
      const subMatch = geckoEvalRegex.exec(parts[3]);

      if (subMatch) {
        // throw out eval line/column and use top-most line number
        parts[1] = parts[1] || 'eval';
        parts[3] = subMatch[1];
        parts[4] = subMatch[2];
        parts[5] = ''; // no column when eval
      }
    }

    let filename = parts[3];
    let func = parts[1] || UNKNOWN_FUNCTION;
    [func, filename] = extractSafariExtensionDetails(func, filename);

    return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);
  }

  return;
};

const geckoStackLineParser = [GECKO_PRIORITY, gecko];

const winjsRegex =
  /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;

const winjs = line => {
  const parts = winjsRegex.exec(line);

  return parts
    ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)
    : undefined;
};

const winjsStackLineParser = [WINJS_PRIORITY, winjs];

const opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;

const opera10 = line => {
  const parts = opera10Regex.exec(line);
  return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
};

const opera10StackLineParser = [OPERA10_PRIORITY, opera10];

const opera11Regex =
  / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;

const opera11 = line => {
  const parts = opera11Regex.exec(line);
  return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
};

const opera11StackLineParser = [OPERA11_PRIORITY, opera11];

const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];

const defaultStackParser = createStackParser(...defaultStackLineParsers);

/**
 * Safari web extensions, starting version unknown, can produce "frames-only" stacktraces.
 * What it means, is that instead of format like:
 *
 * Error: wat
 *   at function@url:row:col
 *   at function@url:row:col
 *   at function@url:row:col
 *
 * it produces something like:
 *
 *   function@url:row:col
 *   function@url:row:col
 *   function@url:row:col
 *
 * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.
 * This function is extracted so that we can use it in both places without duplicating the logic.
 * Unfortunately "just" changing RegExp is too complicated now and making it pass all tests
 * and fix this case seems like an impossible, or at least way too time-consuming task.
 */
const extractSafariExtensionDetails = (func, filename) => {
  const isSafariExtension = func.indexOf('safari-extension') !== -1;
  const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;

  return isSafariExtension || isSafariWebExtension
    ? [
        func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,
        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,
      ]
    : [func, filename];
};

export { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser };
//# sourceMappingURL=stack-parsers.js.map
{"version":3,"file":"stack-parsers.js","sources":["../../../src/stack-parsers.ts"],"sourcesContent":["// This was originally forked from https://github.com/csnover/TraceKit, and was largely\n// re - written as part of raven - js.\n//\n// This code was later copied to the JavaScript mono - repo and further modified and\n// refactored over the years.\n\n// Copyright (c) 2013 Onur Can Cakmak onur.cakmak@gmail.com and all TraceKit contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this\n// software and associated documentation files(the 'Software'), to deal in the Software\n// without restriction, including without limitation the rights to use, copy, modify,\n// merge, publish, distribute, sublicense, and / or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to the following\n// conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies\n// or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n// PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { StackFrame, StackLineParser, StackLineParserFn } from '@sentry/types';\nimport { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename: string, func: string, lineno?: number, colno?: number): StackFrame {\n  const frame: StackFrame = {\n    filename,\n    function: func,\n    in_app: true, // All browser frames are considered in_app\n  };\n\n  if (lineno !== undefined) {\n    frame.lineno = lineno;\n  }\n\n  if (colno !== undefined) {\n    frame.colno = colno;\n  }\n\n  return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n  /^\\s*at (?:(.*\\).*?|.*?) ?\\((?:address at )?)?(?:async )?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nconst chrome: StackLineParserFn = line => {\n  const parts = chromeRegex.exec(line);\n\n  if (parts) {\n    const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n    if (isEval) {\n      const subMatch = chromeEvalRegex.exec(parts[2]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line/column number\n        parts[2] = subMatch[1]; // url\n        parts[3] = subMatch[2]; // line\n        parts[4] = subMatch[3]; // column\n      }\n    }\n\n    // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n    // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n    const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n    return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n  }\n\n  return;\n};\n\nexport const chromeStackLineParser: StackLineParser = [CHROME_PRIORITY, chrome];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n  /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko: StackLineParserFn = line => {\n  const parts = geckoREgex.exec(line);\n\n  if (parts) {\n    const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n    if (isEval) {\n      const subMatch = geckoEvalRegex.exec(parts[3]);\n\n      if (subMatch) {\n        // throw out eval line/column and use top-most line number\n        parts[1] = parts[1] || 'eval';\n        parts[3] = subMatch[1];\n        parts[4] = subMatch[2];\n        parts[5] = ''; // no column when eval\n      }\n    }\n\n    let filename = parts[3];\n    let func = parts[1] || UNKNOWN_FUNCTION;\n    [func, filename] = extractSafariExtensionDetails(func, filename);\n\n    return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n  }\n\n  return;\n};\n\nexport const geckoStackLineParser: StackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex =\n  /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs: StackLineParserFn = line => {\n  const parts = winjsRegex.exec(line);\n\n  return parts\n    ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n    : undefined;\n};\n\nexport const winjsStackLineParser: StackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10: StackLineParserFn = line => {\n  const parts = opera10Regex.exec(line);\n  return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nexport const opera10StackLineParser: StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n  / line (\\d+), column (\\d+)\\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11: StackLineParserFn = line => {\n  const parts = opera11Regex.exec(line);\n  return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nexport const opera11StackLineParser: StackLineParser = [OPERA11_PRIORITY, opera11];\n\nexport const defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nexport const defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n *   at function@url:row:col\n *   at function@url:row:col\n *   at function@url:row:col\n *\n * it produces something like:\n *\n *   function@url:row:col\n *   function@url:row:col\n *   function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func: string, filename: string): [string, string] => {\n  const isSafariExtension = func.indexOf('safari-extension') !== -1;\n  const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n  return isSafariExtension || isSafariWebExtension\n    ? [\n        func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n        isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n      ]\n    : [func, filename];\n};\n"],"names":[],"mappings":";;AA4BA;AACA,MAAA,gBAAA,GAAA,GAAA,CAAA;AACA;AACA,MAAA,gBAAA,GAAA,EAAA,CAAA;AACA,MAAA,gBAAA,GAAA,EAAA,CAAA;AACA,MAAA,eAAA,GAAA,EAAA,CAAA;AACA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA,SAAA,WAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA;AACA,IAAA,QAAA;AACA,IAAA,QAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,IAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,KAAA,SAAA,EAAA;AACA,IA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A,qBAAA,EAAA,QAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AACA,CAAA;;;;"}import { createTransport } from '@sentry/core';
import { rejectedSyncPromise } from '@sentry/utils';
import { getNativeFetchImplementation, clearCachedFetchImplementation } from './utils.js';

/**
 * Creates a Transport that uses the Fetch API to send events to Sentry.
 */
function makeFetchTransport(
  options,
  nativeFetch = getNativeFetchImplementation(),
) {
  let pendingBodySize = 0;
  let pendingCount = 0;

  function makeRequest(request) {
    const requestSize = request.body.length;
    pendingBodySize += requestSize;
    pendingCount++;

    const requestOptions = {
      body: request.body,
      method: 'POST',
      referrerPolicy: 'origin',
      headers: options.headers,
      // Outgoing requests are usually cancelled when navigating to a different page, causing a "TypeError: Failed to
      // fetch" error and sending a "network_error" client-outcome - in Chrome, the request status shows "(cancelled)".
      // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're
      // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).
      // Gotchas:
      // - `keepalive` isn't supported by Firefox
      // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):
      //   If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.
      //   We will therefore only activate the flag when we're below that limit.
      // There is also a limit of requests that can be open at the same time, so we also limit this to 15
      // See https://github.com/getsentry/sentry-javascript/pull/7553 for details
      keepalive: pendingBodySize <= 60000 && pendingCount < 15,
      ...options.fetchOptions,
    };

    try {
      return nativeFetch(options.url, requestOptions).then(response => {
        pendingBodySize -= requestSize;
        pendingCount--;
        return {
          statusCode: response.status,
          headers: {
            'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
            'retry-after': response.headers.get('Retry-After'),
          },
        };
      });
    } catch (e) {
      clearCachedFetchImplementation();
      pendingBodySize -= requestSize;
      pendingCount--;
      return rejectedSyncPromise(e);
    }
  }

  return createTransport(options, makeRequest);
}

export { makeFetchTransport };
//# sourceMappingURL=fetch.js.map
{"version":3,"file":"fetch.js","sources":["../../../../src/transports/fetch.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { rejectedSyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\nimport type { FetchImpl } from './utils';\nimport { clearCachedFetchImplementation, getNativeFetchImplementation } from './utils';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nexport function makeFetchTransport(\n  options: BrowserTransportOptions,\n  nativeFetch: FetchImpl = getNativeFetchImplementation(),\n): Transport {\n  let pendingBodySize = 0;\n  let pendingCount = 0;\n\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    const requestSize = request.body.length;\n    pendingBodySize += requestSize;\n    pendingCount++;\n\n    const requestOptions: RequestInit = {\n      body: request.body,\n      method: 'POST',\n      referrerPolicy: 'origin',\n      headers: options.headers,\n      // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n      // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n      // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n      // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n      // Gotchas:\n      // - `keepalive` isn't supported by Firefox\n      // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n      //   If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n      //   We will therefore only activate the flag when we're below that limit.\n      // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n      // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n      keepalive: pendingBodySize <= 60_000 && pendingCount < 15,\n      ...options.fetchOptions,\n    };\n\n    try {\n      return nativeFetch(options.url, requestOptions).then(response => {\n        pendingBodySize -= requestSize;\n        pendingCount--;\n        return {\n          statusCode: response.status,\n          headers: {\n            'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n            'retry-after': response.headers.get('Retry-After'),\n          },\n        };\n      });\n    } catch (e) {\n      clearCachedFetchImplementation();\n      pendingBodySize -= requestSize;\n      pendingCount--;\n      return rejectedSyncPromise(e);\n    }\n  }\n\n  return createTransport(options, makeRequest);\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;AACA,SAAA,kBAAA;AACA,EAAA,OAAA;AACA,EAAA,WAAA,GAAA,4BAAA,EAAA;AACA,EAAA;AACA,EAAA,IAAA,eAAA,GAAA,CAAA,CAAA;AACA,EAAA,IAAA,YAAA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,SAAA,WAAA,CAAA,OAAA,EAAA;AACA,IAAA,MAAA,WAAA,GAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAAA;AACA,IAAA,eAAA,IAAA,WAAA,CAAA;AACA,IAAA,YAAA,EAAA,CAAA;AACA;AACA,IAAA,MAAA,cAAA,GAAA;AACA,MAAA,IAAA,EAAA,OAAA,CAAA,IAAA;AACA,MAAA,MAAA,EAAA,MAAA;AACA,MAAA,cAAA,EAAA,QAAA;AACA,MAAA,OAAA,EAAA,OAAA,CAAA,OAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,SAAA,EAAA,eAAA,IAAA,KAAA,IAAA,YAAA,GAAA,EAAA;AACA,MAAA,GAAA,OAAA,CAAA,YAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,IAAA;AACA,MAAA,OAAA,WAAA,CAAA,OAAA,CAAA,GAAA,EAAA,cAAA,CAAA,CAAA,IAAA,CAAA,QAAA,IAAA;AACA,QAAA,eAAA,IAAA,WAAA,CAAA;AACA,QAAA,YAAA,EAAA,CAAA;AACA,QAAA,OAAA;AACA,UAAA,UAAA,EAAA,QAAA,CAAA,MAAA;AACA,UAAA,OAAA,EAAA;AACA,YAAA,sBAAA,EAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,sBAAA,CAAA;AACA,YAAA,aAAA,EAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,aAAA,CAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA,MAAA,8BAAA,EAAA,CAAA;AACA,MAAA,eAAA,IAAA,WAAA,CAAA;AACA,MAAA,YAAA,EAAA,CAAA;AACA,MAAA,OAAA,mBAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,eAAA,CAAA,OAAA,EAAA,WAAA,CAAA,CAAA;AACA;;;;"}import { makeOfflineTransport } from '@sentry/core';
import { serializeEnvelope, parseEnvelope } from '@sentry/utils';

// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being
// modified and simplified: https://github.com/jakearchibald/idb-keyval
//
// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca
// Original licence:

// Copyright 2016, Jake Archibald
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

function promisifyRequest(request) {
  return new Promise((resolve, reject) => {
    // @ts-ignore - file size hacks
    request.oncomplete = request.onsuccess = () => resolve(request.result);
    // @ts-ignore - file size hacks
    request.onabort = request.onerror = () => reject(request.error);
  });
}

/** Create or open an IndexedDb store */
function createStore(dbName, storeName) {
  const request = indexedDB.open(dbName);
  request.onupgradeneeded = () => request.result.createObjectStore(storeName);
  const dbp = promisifyRequest(request);

  return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));
}

function keys(store) {
  return promisifyRequest(store.getAllKeys() );
}

/** Insert into the store */
function insert(store, value, maxQueueSize) {
  return store(store => {
    return keys(store).then(keys => {
      if (keys.length >= maxQueueSize) {
        return;
      }

      // We insert with an incremented key so that the entries are popped in order
      store.put(value, Math.max(...keys, 0) + 1);
      return promisifyRequest(store.transaction);
    });
  });
}

/** Pop the oldest value from the store */
function pop(store) {
  return store(store => {
    return keys(store).then(keys => {
      if (keys.length === 0) {
        return undefined;
      }

      return promisifyRequest(store.get(keys[0])).then(value => {
        store.delete(keys[0]);
        return promisifyRequest(store.transaction).then(() => value);
      });
    });
  });
}

function createIndexedDbStore(options) {
  let store;

  // Lazily create the store only when it's needed
  function getStore() {
    if (store == undefined) {
      store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');
    }

    return store;
  }

  return {
    insert: async (env) => {
      try {
        const serialized = await serializeEnvelope(env, options.textEncoder);
        await insert(getStore(), serialized, options.maxQueueSize || 30);
      } catch (_) {
        //
      }
    },
    pop: async () => {
      try {
        const deserialized = await pop(getStore());
        if (deserialized) {
          return parseEnvelope(
            deserialized,
            options.textEncoder || new TextEncoder(),
            options.textDecoder || new TextDecoder(),
          );
        }
      } catch (_) {
        //
      }

      return undefined;
    },
  };
}

function makeIndexedDbOfflineTransport(
  createTransport,
) {
  return options => createTransport({ ...options, createStore: createIndexedDbStore });
}

/**
 * Creates a transport that uses IndexedDb to store events when offline.
 */
function makeBrowserOfflineTransport(
  createTransport,
) {
  return makeIndexedDbOfflineTransport(makeOfflineTransport(createTransport));
}

export { createStore, insert, makeBrowserOfflineTransport, pop };
//# sourceMappingURL=offline.js.map
{"version":3,"file":"offline.js","sources":["../../../../src/transports/offline.ts"],"sourcesContent":["import type { OfflineStore, OfflineTransportOptions } from '@sentry/core';\nimport { makeOfflineTransport } from '@sentry/core';\nimport type { Envelope, InternalBaseTransportOptions, Transport } from '@sentry/types';\nimport type { TextDecoderInternal } from '@sentry/utils';\nimport { parseEnvelope, serializeEnvelope } from '@sentry/utils';\n\n// 'Store', 'promisifyRequest' and 'createStore' were originally copied from the 'idb-keyval' package before being\n// modified and simplified: https://github.com/jakearchibald/idb-keyval\n//\n// At commit: 0420a704fd6cbb4225429c536b1f61112d012fca\n// Original licence:\n\n// Copyright 2016, Jake Archibald\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//   http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\ntype Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;\n\nfunction promisifyRequest<T = undefined>(request: IDBRequest<T> | IDBTransaction): Promise<T> {\n  return new Promise<T>((resolve, reject) => {\n    // @ts-ignore - file size hacks\n    request.oncomplete = request.onsuccess = () => resolve(request.result);\n    // @ts-ignore - file size hacks\n    request.onabort = request.onerror = () => reject(request.error);\n  });\n}\n\n/** Create or open an IndexedDb store */\nexport function createStore(dbName: string, storeName: string): Store {\n  const request = indexedDB.open(dbName);\n  request.onupgradeneeded = () => request.result.createObjectStore(storeName);\n  const dbp = promisifyRequest(request);\n\n  return callback => dbp.then(db => callback(db.transaction(storeName, 'readwrite').objectStore(storeName)));\n}\n\nfunction keys(store: IDBObjectStore): Promise<number[]> {\n  return promisifyRequest(store.getAllKeys() as IDBRequest<number[]>);\n}\n\n/** Insert into the store */\nexport function insert(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length >= maxQueueSize) {\n        return;\n      }\n\n      // We insert with an incremented key so that the entries are popped in order\n      store.put(value, Math.max(...keys, 0) + 1);\n      return promisifyRequest(store.transaction);\n    });\n  });\n}\n\n/** Pop the oldest value from the store */\nexport function pop(store: Store): Promise<Uint8Array | string | undefined> {\n  return store(store => {\n    return keys(store).then(keys => {\n      if (keys.length === 0) {\n        return undefined;\n      }\n\n      return promisifyRequest(store.get(keys[0])).then(value => {\n        store.delete(keys[0]);\n        return promisifyRequest(store.transaction).then(() => value);\n      });\n    });\n  });\n}\n\nexport interface BrowserOfflineTransportOptions extends OfflineTransportOptions {\n  /**\n   * Name of indexedDb database to store envelopes in\n   * Default: 'sentry-offline'\n   */\n  dbName?: string;\n  /**\n   * Name of indexedDb object store to store envelopes in\n   * Default: 'queue'\n   */\n  storeName?: string;\n  /**\n   * Maximum number of envelopes to store\n   * Default: 30\n   */\n  maxQueueSize?: number;\n  /**\n   * Only required for testing on node.js\n   * @ignore\n   */\n  textDecoder?: TextDecoderInternal;\n}\n\nfunction createIndexedDbStore(options: BrowserOfflineTransportOptions): OfflineStore {\n  let store: Store | undefined;\n\n  // Lazily create the store only when it's needed\n  function getStore(): Store {\n    if (store == undefined) {\n      store = createStore(options.dbName || 'sentry-offline', options.storeName || 'queue');\n    }\n\n    return store;\n  }\n\n  return {\n    insert: async (env: Envelope) => {\n      try {\n        const serialized = await serializeEnvelope(env, options.textEncoder);\n        await insert(getStore(), serialized, options.maxQueueSize || 30);\n      } catch (_) {\n        //\n      }\n    },\n    pop: async () => {\n      try {\n        const deserialized = await pop(getStore());\n        if (deserialized) {\n          return parseEnvelope(\n            deserialized,\n            options.textEncoder || new TextEncoder(),\n            options.textDecoder || new TextDecoder(),\n          );\n        }\n      } catch (_) {\n        //\n      }\n\n      return undefined;\n    },\n  };\n}\n\nfunction makeIndexedDbOfflineTransport<T>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return options => createTransport({ ...options, createStore: createIndexedDbStore });\n}\n\n/**\n * Creates a transport that uses IndexedDb to store events when offline.\n */\nexport function makeBrowserOfflineTransport<T extends InternalBaseTransportOptions>(\n  createTransport: (options: T) => Transport,\n): (options: T & BrowserOfflineTransportOptions) => Transport {\n  return makeIndexedDbOfflineTransport<T>(makeOfflineTransport(createTransport));\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACA;AACA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;AACA;AACA,EAAA,OAAA;AACA,IAAA,MAAA,EAAA,OAAA,GAAA,KAAA;AACA,MAAA,IAAA;AACA,QAAA,MAAA,UAAA,GAAA,MAAA,iBAAA,CAAA,GAAA,EAAA,OAAA,CAAA,WAAA,CAAA,CAAA;AACA,QAAA,MAAA,MAAA,CAAA,QAAA,EAAA,EAAA,UAAA,EAAA,OAAA,CAAA,YAAA,IAAA,EAAA,CAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA,KAAA;AACA,IAAA,GAAA,EAAA,YAAA;AACA,MAAA,IAAA;AACA,QAAA,MAAA,YAAA,GAAA,MAAA,GAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AACA,QAAA,IAAA,YAAA,EAAA;AACA,UAAA,OAAA,aAAA;AACA,YAAA,YAAA;AACA,YAAA,OAAA,CAAA,WAAA,IAAA,IAAA,WAAA,EAAA;AACA,YAAA,OAAA,CAAA,WAAA,IAAA,IAAA,WAAA,EAAA;AACA,WAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,OAAA;AACA;AACA,MAAA,OAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,6BAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA,EAAA,OAAA,OAAA,IAAA,eAAA,CAAA,EAAA,GAAA,OAAA,EAAA,WAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,2BAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA,EAAA,OAAA,6BAAA,CAAA,oBAAA,CAAA,eAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { isNativeFetch, logger } from '@sentry/utils';
import { WINDOW } from '../helpers.js';

let cachedFetchImpl = undefined;

/**
 * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
 * Whenever someone wraps the Fetch API and returns the wrong promise chain,
 * this chain becomes orphaned and there is no possible way to capture it's rejections
 * other than allowing it bubble up to this very handler. eg.
 *
 * const f = window.fetch;
 * window.fetch = function () {
 *   const p = f.apply(this, arguments);
 *
 *   p.then(function() {
 *     console.log('hi.');
 *   });
 *
 *   return p;
 * }
 *
 * `p.then(function () { ... })` is producing a completely separate promise chain,
 * however, what's returned is `p` - the result of original `fetch` call.
 *
 * This mean, that whenever we use the Fetch API to send our own requests, _and_
 * some ad-blocker blocks it, this orphaned chain will _always_ reject,
 * effectively causing another event to be captured.
 * This makes a whole process become an infinite loop, which we need to somehow
 * deal with, and break it in one way or another.
 *
 * To deal with this issue, we are making sure that we _always_ use the real
 * browser Fetch API, instead of relying on what `window.fetch` exposes.
 * The only downside to this would be missing our own requests as breadcrumbs,
 * but because we are already not doing this, it should be just fine.
 *
 * Possible failed fetch error messages per-browser:
 *
 * Chrome:  Failed to fetch
 * Edge:    Failed to Fetch
 * Firefox: NetworkError when attempting to fetch resource
 * Safari:  resource blocked by content blocker
 */
function getNativeFetchImplementation() {
  if (cachedFetchImpl) {
    return cachedFetchImpl;
  }

  /* eslint-disable @typescript-eslint/unbound-method */

  // Fast path to avoid DOM I/O
  if (isNativeFetch(WINDOW.fetch)) {
    return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));
  }

  const document = WINDOW.document;
  let fetchImpl = WINDOW.fetch;
  // eslint-disable-next-line deprecation/deprecation
  if (document && typeof document.createElement === 'function') {
    try {
      const sandbox = document.createElement('iframe');
      sandbox.hidden = true;
      document.head.appendChild(sandbox);
      const contentWindow = sandbox.contentWindow;
      if (contentWindow && contentWindow.fetch) {
        fetchImpl = contentWindow.fetch;
      }
      document.head.removeChild(sandbox);
    } catch (e) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);
    }
  }

  return (cachedFetchImpl = fetchImpl.bind(WINDOW));
  /* eslint-enable @typescript-eslint/unbound-method */
}

/** Clears cached fetch impl */
function clearCachedFetchImplementation() {
  cachedFetchImpl = undefined;
}

export { clearCachedFetchImplementation, getNativeFetchImplementation };
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../../src/transports/utils.ts"],"sourcesContent":["import { isNativeFetch, logger } from '@sentry/utils';\n\nimport { WINDOW } from '../helpers';\n\nlet cachedFetchImpl: FetchImpl | undefined = undefined;\n\nexport type FetchImpl = typeof fetch;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n *   const p = f.apply(this, arguments);\n *\n *   p.then(function() {\n *     console.log('hi.');\n *   });\n *\n *   return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome:  Failed to fetch\n * Edge:    Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari:  resource blocked by content blocker\n */\nexport function getNativeFetchImplementation(): FetchImpl {\n  if (cachedFetchImpl) {\n    return cachedFetchImpl;\n  }\n\n  /* eslint-disable @typescript-eslint/unbound-method */\n\n  // Fast path to avoid DOM I/O\n  if (isNativeFetch(WINDOW.fetch)) {\n    return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n  }\n\n  const document = WINDOW.document;\n  let fetchImpl = WINDOW.fetch;\n  // eslint-disable-next-line deprecation/deprecation\n  if (document && typeof document.createElement === 'function') {\n    try {\n      const sandbox = document.createElement('iframe');\n      sandbox.hidden = true;\n      document.head.appendChild(sandbox);\n      const contentWindow = sandbox.contentWindow;\n      if (contentWindow && contentWindow.fetch) {\n        fetchImpl = contentWindow.fetch;\n      }\n      document.head.removeChild(sandbox);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n    }\n  }\n\n  return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n  /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nexport function clearCachedFetchImplementation(): void {\n  cachedFetchImpl = undefined;\n}\n"],"names":[],"mappings":";;;AAIA,IAAA,eAAA,GAAA,SAAA,CAAA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,GAAA;AACA,EAAA,IAAA,eAAA,EAAA;AACA,IAAA,OAAA,eAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,aAAA,CAAA,MAAA,CAAA,KAAA,CAAA,EAAA;AACA,IAAA,QAAA,eAAA,GAAA,MAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,CAAA,EAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,MAAA,CAAA,QAAA,CAAA;AACA,EAAA,IAAA,SAAA,GAAA,MAAA,CAAA,KAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,OAAA,QAAA,CAAA,aAAA,KAAA,UAAA,EAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,OAAA,GAAA,QAAA,CAAA,aAAA,CAAA,QAAA,CAAA,CAAA;AACA,MAAA,OAAA,CAAA,MAAA,GAAA,IAAA,CAAA;AACA,MAAA,QAAA,CAAA,IAAA,CAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,MAAA,MAAA,aAAA,GAAA,OAAA,CAAA,aAAA,CAAA;AACA,MAAA,IAAA,aAAA,IAAA,aAAA,CAAA,KAAA,EAAA;AACA,QAAA,SAAA,GAAA,aAAA,CAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,QAAA,CAAA,IAAA,CAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,QAAA,MAAA,CAAA,IAAA,CAAA,iFAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,QAAA,eAAA,GAAA,SAAA,CAAA,IAAA,CAAA,MAAA,CAAA,EAAA;AACA;AACA,CAAA;AACA;AACA;AACA,SAAA,8BAAA,GAAA;AACA,EAAA,eAAA,GAAA,SAAA,CAAA;AACA;;;;"}import { createTransport } from '@sentry/core';
import { SyncPromise } from '@sentry/utils';

/**
 * The DONE ready state for XmlHttpRequest
 *
 * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined
 * (e.g. during testing, it is `undefined`)
 *
 * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}
 */
const XHR_READYSTATE_DONE = 4;

/**
 * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
 */
function makeXHRTransport(options) {
  function makeRequest(request) {
    return new SyncPromise((resolve, reject) => {
      const xhr = new XMLHttpRequest();

      xhr.onerror = reject;

      xhr.onreadystatechange = () => {
        if (xhr.readyState === XHR_READYSTATE_DONE) {
          resolve({
            statusCode: xhr.status,
            headers: {
              'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),
              'retry-after': xhr.getResponseHeader('Retry-After'),
            },
          });
        }
      };

      xhr.open('POST', options.url);

      for (const header in options.headers) {
        if (Object.prototype.hasOwnProperty.call(options.headers, header)) {
          xhr.setRequestHeader(header, options.headers[header]);
        }
      }

      xhr.send(request.body);
    });
  }

  return createTransport(options, makeRequest);
}

export { makeXHRTransport };
//# sourceMappingURL=xhr.js.map
{"version":3,"file":"xhr.js","sources":["../../../../src/transports/xhr.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { SyncPromise } from '@sentry/utils';\n\nimport type { BrowserTransportOptions } from './types';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nexport function makeXHRTransport(options: BrowserTransportOptions): Transport {\n  function makeRequest(request: TransportRequest): PromiseLike<TransportMakeRequestResponse> {\n    return new SyncPromise((resolve, reject) => {\n      const xhr = new XMLHttpRequest();\n\n      xhr.onerror = reject;\n\n      xhr.onreadystatechange = (): void => {\n        if (xhr.readyState === XHR_READYSTATE_DONE) {\n          resolve({\n            statusCode: xhr.status,\n            headers: {\n              'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n              'retry-after': xhr.getResponseHeader('Retry-After'),\n            },\n          });\n        }\n      };\n\n      xhr.open('POST', options.url);\n\n      for (const header in options.headers) {\n        if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n          xhr.setRequestHeader(header, options.headers[header]);\n        }\n      }\n\n      xhr.send(request.body);\n    });\n  }\n\n  return createTransport(options, makeRequest);\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,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@sentry/utils';

/**
 * Creates an envelope from a user feedback.
 */
function createUserFeedbackEnvelope(
  feedback,
  {
    metadata,
    tunnel,
    dsn,
  }

,
) {
  const headers = {
    event_id: feedback.event_id,
    sent_at: new Date().toISOString(),
    ...(metadata &&
      metadata.sdk && {
        sdk: {
          name: metadata.sdk.name,
          version: metadata.sdk.version,
        },
      }),
    ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),
  };
  const item = createUserFeedbackEnvelopeItem(feedback);

  return createEnvelope(headers, [item]);
}

function createUserFeedbackEnvelopeItem(feedback) {
  const feedbackHeaders = {
    type: 'user_report',
  };
  return [feedbackHeaders, feedback];
}

export { createUserFeedbackEnvelope };
//# sourceMappingURL=userfeedback.js.map
{"version":3,"file":"userfeedback.js","sources":["../../../src/userfeedback.ts"],"sourcesContent":["import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback, UserFeedbackItem } from '@sentry/types';\nimport { createEnvelope, dsnToString } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nexport function createUserFeedbackEnvelope(\n  feedback: UserFeedback,\n  {\n    metadata,\n    tunnel,\n    dsn,\n  }: {\n    metadata: SdkMetadata | undefined;\n    tunnel: string | undefined;\n    dsn: DsnComponents | undefined;\n  },\n): EventEnvelope {\n  const headers: EventEnvelope[0] = {\n    event_id: feedback.event_id,\n    sent_at: new Date().toISOString(),\n    ...(metadata &&\n      metadata.sdk && {\n        sdk: {\n          name: metadata.sdk.name,\n          version: metadata.sdk.version,\n        },\n      }),\n    ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n  };\n  const item = createUserFeedbackEnvelopeItem(feedback);\n\n  return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback: UserFeedback): UserFeedbackItem {\n  const feedbackHeaders: UserFeedbackItem[0] = {\n    type: 'user_report',\n  };\n  return [feedbackHeaders, feedback];\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,QAAA;AACA,EAAA;AACA,IAAA,QAAA;AACA,IAAA,MAAA;AACA,IAAA,GAAA;AACA,GAAA;;AAIA;AACA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA;AACA,IAAA,QAAA,EAAA,QAAA,CAAA,QAAA;AACA,IAAA,OAAA,EAAA,IAAA,IAAA,EAAA,CAAA,WAAA,EAAA;AACA,IAAA,IAAA,QAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA;AACA,QAAA,GAAA,EAAA;AACA,UAAA,IAAA,EAAA,QAAA,CAAA,GAAA,CAAA,IAAA;AACA,UAAA,OAAA,EAAA,QAAA,CAAA,GAAA,CAAA,OAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,IAAA,IAAA,CAAA,CAAA,MAAA,IAAA,CAAA,CAAA,GAAA,IAAA,EAAA,GAAA,EAAA,WAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACA,GAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,8BAAA,CAAA,QAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,cAAA,CAAA,OAAA,EAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,8BAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAA,eAAA,GAAA;AACA,IAAA,IAAA,EAAA,aAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA;AACA;;;;"}Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/browser",
  "version": "7.48.0",
  "description": "Official Sentry SDK for browsers",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@sentry-internal/tracing": "7.48.0",
    "@sentry/core": "7.48.0",
    "@sentry/replay": "7.48.0",
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0",
    "tslib": "^1.9.3"
  },
  "devDependencies": {
    "@sentry-internal/integration-shims": "7.48.0",
    "@types/md5": "2.1.33",
    "btoa": "^1.2.1",
    "chai": "^4.1.2",
    "chokidar": "^3.0.2",
    "fake-indexeddb": "^4.0.1",
    "karma": "^6.3.16",
    "karma-chai": "^0.1.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-firefox-launcher": "^2.1.2",
    "karma-mocha": "^1.3.0",
    "karma-mocha-reporter": "^2.2.5",
    "karma-rollup-preprocessor": "^7.0.0",
    "karma-sinon": "^1.0.5",
    "karma-typescript": "^4.0.0",
    "karma-typescript-es6-transform": "^4.0.0",
    "karma-webkit-launcher": "^1.0.2",
    "node-fetch": "^2.6.0",
    "playwright": "^1.31.1",
    "sinon": "^7.3.2",
    "webpack": "^4.30.0"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Official Sentry SDK for Browsers

[![Sauce Test Status](https://saucelabs.com/buildstatus/sentryio)](https://saucelabs.com/u/sentryio)
[![npm version](https://img.shields.io/npm/v/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)
[![npm dm](https://img.shields.io/npm/dm/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)
[![npm dt](https://img.shields.io/npm/dt/@sentry/browser.svg)](https://www.npmjs.com/package/@sentry/browser)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

## Usage

To use this SDK, call `Sentry.init(options)` as early as possible after loading the page. This will initialize the SDK
and hook into the environment. Note that you can turn off almost all side effects using the respective options.

```javascript
import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: '__DSN__',
  // ...
});
```

To set context information or send manual events, use the exported functions of `@sentry/browser`. Note that these
functions will not perform any action before you have called `Sentry.init()`:

```javascript
import * as Sentry from '@sentry/browser';

// Set user information, as well as tags and further extras
Sentry.configureScope(scope => {
  scope.setExtra('battery', 0.7);
  scope.setTag('user_mode', 'admin');
  scope.setUser({ id: '4711' });
  // scope.clear();
});

// Add a breadcrumb for future events
Sentry.addBreadcrumb({
  message: 'My Breadcrumb',
  // ...
});

// Capture exceptions, messages or manual events
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
  message: 'Manual',
  stacktrace: [
    // ...
  ],
});
```
import type { Scope } from '@sentry/core';
import { BaseClient } from '@sentry/core';
import type { BrowserClientReplayOptions, ClientOptions, Event, EventHint, Options, Severity, SeverityLevel, UserFeedback } from '@sentry/types';
import type { BrowserTransportOptions } from './transports/types';
/**
 * Configuration options for the Sentry Browser SDK.
 * @see @sentry/types Options for more information.
 */
export declare type BrowserOptions = Options<BrowserTransportOptions> & BrowserClientReplayOptions;
/**
 * Configuration options for the Sentry Browser SDK Client class
 * @see BrowserClient for more information.
 */
export declare type BrowserClientOptions = ClientOptions<BrowserTransportOptions>;
/**
 * The Sentry Browser SDK Client.
 *
 * @see BrowserOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
export declare class BrowserClient extends BaseClient<BrowserClientOptions> {
    /**
     * Creates a new Browser SDK instance.
     *
     * @param options Configuration options for this SDK.
     */
    constructor(options: BrowserClientOptions);
    /**
     * @inheritDoc
     */
    eventFromException(exception: unknown, hint?: EventHint): PromiseLike<Event>;
    /**
     * @inheritDoc
     */
    eventFromMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
    /**
     * @inheritDoc
     */
    sendEvent(event: Event, hint?: EventHint): void;
    /**
     * Sends user feedback to Sentry.
     */
    captureUserFeedback(feedback: UserFeedback): void;
    /**
     * @inheritDoc
     */
    protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
    /**
     * Sends client reports as an envelope.
     */
    private _flushOutcomes;
}
//# sourceMappingURL=client.d.ts.map{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EACV,0BAA0B,EAC1B,aAAa,EACb,KAAK,EACL,SAAS,EACT,OAAO,EACP,QAAQ,EACR,aAAa,EACb,YAAY,EACb,MAAM,eAAe,CAAC;AAOvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAGlE;;;GAGG;AACH,oBAAY,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG,0BAA0B,CAAC;AAE3F;;;GAGG;AACH,oBAAY,oBAAoB,GAAG,aAAa,CAAC,uBAAuB,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACjE;;;;OAIG;gBACgB,OAAO,EAAE,oBAAoB;IA0BhD;;OAEG;IACI,kBAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAInF;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,MAAM,EAEf,KAAK,GAAE,QAAQ,GAAG,aAAsB,EACxC,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;IAIrB;;OAEG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI;IAiBtD;;OAEG;IACI,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAcxD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAKhG;;OAEG;IACH,OAAO,CAAC,cAAc;CAkBvB"}import type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types';
/**
 * This function creates an exception from a JavaScript Error
 */
export declare function exceptionFromError(stackParser: StackParser, ex: Error): Exception;
/**
 * @hidden
 */
export declare function eventFromPlainObject(stackParser: StackParser, exception: Record<string, unknown>, syntheticException?: Error, isUnhandledRejection?: boolean): Event;
/**
 * @hidden
 */
export declare function eventFromError(stackParser: StackParser, ex: Error): Event;
/** Parses stack frames from an error */
export declare function parseStackFrames(stackParser: StackParser, ex: Error & {
    framesToPop?: number;
    stacktrace?: string;
}): StackFrame[];
/**
 * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
 * @hidden
 */
export declare function eventFromException(stackParser: StackParser, exception: unknown, hint?: EventHint, attachStacktrace?: boolean): PromiseLike<Event>;
/**
 * Builds and Event from a Message
 * @hidden
 */
export declare function eventFromMessage(stackParser: StackParser, message: string, level?: Severity | SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): PromiseLike<Event>;
/**
 * @hidden
 */
export declare function eventFromUnknownInput(stackParser: StackParser, exception: unknown, syntheticException?: Error, attachStacktrace?: boolean, isUnhandledRejection?: boolean): Event;
/**
 * @hidden
 */
export declare function eventFromString(stackParser: StackParser, input: string, syntheticException?: Error, attachStacktrace?: boolean): Event;
//# sourceMappingURL=eventbuilder.d.ts.map{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../../../src/eventbuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAenH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,GAAG,SAAS,CAkBjF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClC,kBAAkB,CAAC,EAAE,KAAK,EAC1B,oBAAoB,CAAC,EAAE,OAAO,GAC7B,KAAK,CA8BP;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,GAAG,KAAK,CAMzE;AAED,wCAAwC;AACxC,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,KAAK,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACxD,UAAU,EAAE,CAed;AAmCD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,SAAS,EAChB,gBAAgB,CAAC,EAAE,OAAO,GACzB,WAAW,CAAC,KAAK,CAAC,CASpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EAEf,KAAK,GAAE,QAAQ,GAAG,aAAsB,EACxC,IAAI,CAAC,EAAE,SAAS,EAChB,gBAAgB,CAAC,EAAE,OAAO,GACzB,WAAW,CAAC,KAAK,CAAC,CAQpB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,OAAO,EAClB,kBAAkB,CAAC,EAAE,KAAK,EAC1B,gBAAgB,CAAC,EAAE,OAAO,EAC1B,oBAAoB,CAAC,EAAE,OAAO,GAC7B,KAAK,CAiEP;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,MAAM,EACb,kBAAkB,CAAC,EAAE,KAAK,EAC1B,gBAAgB,CAAC,EAAE,OAAO,GACzB,KAAK,CAeP"}export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, Transaction, User, Session, } from '@sentry/types';
export type { BrowserOptions } from './client';
export type { ReportDialogOptions } from './helpers';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export { WINDOW } from './helpers';
export { BrowserClient } from './client';
export { makeFetchTransport, makeXHRTransport } from './transports';
export { defaultStackParser, defaultStackLineParsers, chromeStackLineParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser, } from './stack-parsers';
export { eventFromException, eventFromMessage } from './eventbuilder';
export { createUserFeedbackEnvelope } from './userfeedback';
export { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap, captureUserFeedback, } from './sdk';
export { GlobalHandlers, TryCatch, Breadcrumbs, LinkedErrors, HttpContext, Dedupe } from './integrations';
//# sourceMappingURL=exports.d.ts.map{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EAET,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACX,IAAI,EACJ,OAAO,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EACnB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,KAAK,EACL,IAAI,EACJ,mBAAmB,GACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC"}import type { DsnLike, Mechanism, WrappedFunction } from '@sentry/types';
export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
/**
 * @hidden
 */
export declare function shouldIgnoreOnError(): boolean;
/**
 * @hidden
 */
export declare function ignoreNextOnError(): void;
/**
 * Instruments the given function and sends an event to Sentry every time the
 * function throws an exception.
 *
 * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always
 * has a correct `this` context.
 * @returns The wrapped function.
 * @hidden
 */
export declare function wrap(fn: WrappedFunction, options?: {
    mechanism?: Mechanism;
}, before?: WrappedFunction): any;
/**
 * All properties the report dialog supports
 */
export interface ReportDialogOptions {
    [key: string]: any;
    eventId?: string;
    dsn?: DsnLike;
    user?: {
        email?: string;
        name?: string;
    };
    lang?: string;
    title?: string;
    subtitle?: string;
    subtitle2?: string;
    labelName?: string;
    labelEmail?: string;
    labelComments?: string;
    labelClose?: string;
    labelSubmit?: string;
    errorGeneric?: string;
    errorFormEntry?: string;
    successMessage?: string;
    /** Callback after reportDialog showed up */
    onLoad?(this: void): void;
}
//# sourceMappingURL=helpers.d.ts.map{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAwB,SAAS,EAAS,eAAe,EAAE,MAAM,eAAe,CAAC;AAUtG,eAAO,MAAM,MAAM,iDAA2C,CAAC;AAI/D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAClB,EAAE,EAAE,eAAe,EACnB,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,SAAS,CAAC;CAClB,EACN,MAAM,CAAC,EAAE,eAAe,GAEvB,GAAG,CAyGL;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAElC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3B"}export * from './exports';
import type { Integration } from '@sentry/types';
declare const INTEGRATIONS: Record<string, new (...args: any[]) => Integration>;
export { INTEGRATIONS as Integrations };
//# sourceMappingURL=index.bundle.base.d.ts.map{"version":3,"file":"index.bundle.base.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.base.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAG1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAajD,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,WAAW,CAIrE,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC"}import { addTracingExtensions, BrowserTracing, Replay } from '@sentry-internal/integration-shims';
export * from './index.bundle.base';
export { BrowserTracing, addTracingExtensions, Replay };
//# sourceMappingURL=index.bundle.d.ts.map{"version":3,"file":"index.bundle.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AASlG,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,CAAC"}import { addTracingExtensions, BrowserTracing } from '@sentry-internal/integration-shims';
import { Replay } from '@sentry/replay';
export * from './index.bundle.base';
export { BrowserTracing, addTracingExtensions, Replay };
//# sourceMappingURL=index.bundle.replay.d.ts.map{"version":3,"file":"index.bundle.replay.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.replay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AASxC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,EAAE,CAAC"}import { Replay } from '@sentry-internal/integration-shims';
import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing';
export { Replay, BrowserTracing, Span, addExtensionMethods };
export * from './index.bundle.base';
//# sourceMappingURL=index.bundle.tracing.d.ts.map{"version":3,"file":"index.bundle.tracing.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAcrF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;AAC7D,cAAc,qBAAqB,CAAC"}import { addExtensionMethods, BrowserTracing, Span } from '@sentry-internal/tracing';
import { Replay } from '@sentry/replay';
export { Replay, BrowserTracing, Span, addExtensionMethods };
export * from './index.bundle.base';
//# sourceMappingURL=index.bundle.tracing.replay.d.ts.map{"version":3,"file":"index.bundle.tracing.replay.d.ts","sourceRoot":"","sources":["../../../src/index.bundle.tracing.replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAcxC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;AAC7D,cAAc,qBAAqB,CAAC"}export * from './exports';
import { Integrations as CoreIntegrations } from '@sentry/core';
import * as BrowserIntegrations from './integrations';
declare const INTEGRATIONS: {
    GlobalHandlers: typeof BrowserIntegrations.GlobalHandlers;
    TryCatch: typeof BrowserIntegrations.TryCatch;
    Breadcrumbs: typeof BrowserIntegrations.Breadcrumbs;
    LinkedErrors: typeof BrowserIntegrations.LinkedErrors;
    HttpContext: typeof BrowserIntegrations.HttpContext;
    Dedupe: typeof BrowserIntegrations.Dedupe;
    FunctionToString: typeof CoreIntegrations.FunctionToString;
    InboundFilters: typeof CoreIntegrations.InboundFilters;
};
export { INTEGRATIONS as Integrations };
export { Replay } from '@sentry/replay';
export { BrowserTracing, defaultRequestInstrumentationOptions, instrumentOutgoingRequests, } from '@sentry-internal/tracing';
export type { RequestInstrumentationOptions } from '@sentry-internal/tracing';
export { addTracingExtensions, extractTraceparentData, getActiveTransaction, spanStatusfromHttpCode, trace, } from '@sentry/core';
export type { SpanStatusType } from '@sentry/core';
export type { Span } from '@sentry/types';
export { makeBrowserOfflineTransport } from './transports/offline';
export { onProfilingStartRouteTransaction } from './profiling/hubextensions';
export { BrowserProfilingIntegration } from './profiling/integration';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhE,OAAO,KAAK,mBAAmB,MAAM,gBAAgB,CAAC;AAStD,QAAA,MAAM,YAAY;;;;;;;;;CAIjB,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EACL,cAAc,EACd,oCAAoC,EACpC,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC"}import type { Event as SentryEvent, Integration } from '@sentry/types';
/** JSDoc */
interface BreadcrumbsOptions {
    console: boolean;
    dom: boolean | {
        serializeAttribute?: string | string[];
        maxStringLength?: number;
    };
    fetch: boolean;
    history: boolean;
    sentry: boolean;
    xhr: boolean;
}
export declare const BREADCRUMB_INTEGRATION_ID = "Breadcrumbs";
/**
 * Default Breadcrumbs instrumentations
 * TODO: Deprecated - with v6, this will be renamed to `Instrument`
 */
export declare class Breadcrumbs implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Options of the breadcrumbs integration.
     */
    readonly options: Readonly<BreadcrumbsOptions>;
    /**
     * @inheritDoc
     */
    constructor(options?: Partial<BreadcrumbsOptions>);
    /**
     * Instrument browser built-ins w/ breadcrumb capturing
     *  - Console API
     *  - DOM API (click/typing)
     *  - XMLHttpRequest API
     *  - Fetch API
     *  - History API
     */
    setupOnce(): void;
    /**
     * Adds a breadcrumb for Sentry events or transactions if this option is enabled.
     */
    addSentryBreadcrumb(event: SentryEvent): void;
}
export {};
//# sourceMappingURL=breadcrumbs.d.ts.map{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/integrations/breadcrumbs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAoC,WAAW,EAAE,MAAM,eAAe,CAAC;AAsBzG,YAAY;AACZ,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EACC,OAAO,GACP;QACE,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACvC,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACN,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,OAAO,CAAC;CACd;AAKD,eAAO,MAAM,yBAAyB,gBAAgB,CAAC;AAEvD;;;GAGG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAA6B;IAErD;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;OAEG;IAEH,SAAgB,OAAO,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAEtD;;OAEG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC;IAYxD;;;;;;;OAOG;IACI,SAAS,IAAI,IAAI;IAkBxB;;OAEG;IACI,mBAAmB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAerD"}import type { EventProcessor, Hub, Integration } from '@sentry/types';
/** Deduplication filter */
export declare class Dedupe implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    private _previousEvent?;
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
//# sourceMappingURL=dedupe.d.ts.map{"version":3,"file":"dedupe.d.ts","sourceRoot":"","sources":["../../../../src/integrations/dedupe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,cAAc,EAAa,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AAGpG,2BAA2B;AAC3B,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC;;OAEG;IACH,OAAO,CAAC,cAAc,CAAC,CAAQ;IAE/B;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA4B9G"}import type { Integration } from '@sentry/types';
declare type GlobalHandlersIntegrationsOptionKeys = 'onerror' | 'onunhandledrejection';
/** JSDoc */
declare type GlobalHandlersIntegrations = Record<GlobalHandlersIntegrationsOptionKeys, boolean>;
/** Global handlers */
export declare class GlobalHandlers implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /** JSDoc */
    private readonly _options;
    /**
     * Stores references functions to installing handlers. Will set to undefined
     * after they have been run so that they are not used twice.
     */
    private _installFunc;
    /** JSDoc */
    constructor(options?: GlobalHandlersIntegrations);
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=globalhandlers.d.ts.map{"version":3,"file":"globalhandlers.d.ts","sourceRoot":"","sources":["../../../../src/integrations/globalhandlers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,WAAW,EAA0B,MAAM,eAAe,CAAC;AAehG,aAAK,oCAAoC,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE/E,YAAY;AACZ,aAAK,0BAA0B,GAAG,MAAM,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;AAExF,sBAAsB;AACtB,qBAAa,cAAe,YAAW,WAAW;IAChD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAqB;IAExC,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD;;;OAGG;IACH,OAAO,CAAC,YAAY,CAGlB;IAEF,YAAY;gBACO,OAAO,CAAC,EAAE,0BAA0B;IAOvD;;OAEG;IACI,SAAS,IAAI,IAAI;CAgBzB"}import type { Integration } from '@sentry/types';
/** HttpContext integration collects information about HTTP request headers */
export declare class HttpContext implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
//# sourceMappingURL=httpcontext.d.ts.map{"version":3,"file":"httpcontext.d.ts","sourceRoot":"","sources":["../../../../src/integrations/httpcontext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAIxD,8EAA8E;AAC9E,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;OAEG;IACI,SAAS,IAAI,IAAI;CAyBzB"}export { GlobalHandlers } from './globalhandlers';
export { TryCatch } from './trycatch';
export { Breadcrumbs } from './breadcrumbs';
export { LinkedErrors } from './linkederrors';
export { HttpContext } from './httpcontext';
export { Dedupe } from './dedupe';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}import type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';
interface LinkedErrorsOptions {
    key: string;
    limit: number;
}
/** Adds SDK info to an event. */
export declare class LinkedErrors implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    readonly name: string;
    /**
     * @inheritDoc
     */
    private readonly _key;
    /**
     * @inheritDoc
     */
    private readonly _limit;
    /**
     * @inheritDoc
     */
    constructor(options?: Partial<LinkedErrorsOptions>);
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
/**
 * @inheritDoc
 */
export declare function _handler(parser: StackParser, key: string, limit: number, event: Event, hint?: EventHint): Event | null;
/**
 * JSDOC
 */
export declare function _walkErrorTree(parser: StackParser, limit: number, error: ExtendedError, key: string, stack?: Exception[]): Exception[];
export {};
//# sourceMappingURL=linkederrors.d.ts.map{"version":3,"file":"linkederrors.d.ts","sourceRoot":"","sources":["../../../../src/integrations/linkederrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS1G,UAAU,mBAAmB;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iCAAiC;AACjC,qBAAa,YAAa,YAAW,WAAW;IAC9C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAmB;IAE/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAElD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA+B;IAEtD;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM;IAK7D;;OAEG;IACI,SAAS,IAAI,IAAI;CAUzB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,EACZ,IAAI,CAAC,EAAE,SAAS,GACf,KAAK,GAAG,IAAI,CAOd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,SAAS,EAAO,GACtB,SAAS,EAAE,CAMb"}import type { Integration } from '@sentry/types';
/** JSDoc */
interface TryCatchOptions {
    setTimeout: boolean;
    setInterval: boolean;
    requestAnimationFrame: boolean;
    XMLHttpRequest: boolean;
    eventTarget: boolean | string[];
}
/** Wrap timer functions and event targets to catch errors and provide better meta data */
export declare class TryCatch implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /** JSDoc */
    private readonly _options;
    /**
     * @inheritDoc
     */
    constructor(options?: Partial<TryCatchOptions>);
    /**
     * Wrap timer functions and event targets to catch errors
     * and provide better metadata.
     */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=trycatch.d.ts.map{"version":3,"file":"trycatch.d.ts","sourceRoot":"","sources":["../../../../src/integrations/trycatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAuClE,YAAY;AACZ,UAAU,eAAe;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;CACjC;AAED,0FAA0F;AAC1F,qBAAa,QAAS,YAAW,WAAW;IAC1C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAc;IAEtC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAe;IAElC,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C;;OAEG;gBACgB,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAWrD;;;OAGG;IACI,SAAS,IAAI,IAAI;CAuBzB"}import type { Event } from '@sentry/types';
/**
 * Creates a cache that evicts keys in fifo order
 * @param size {Number}
 */
export declare function makeProfilingCache<Key extends string, Value extends Event>(size: number): {
    get: (key: Key) => Value | undefined;
    add: (key: Key, value: Value) => void;
    delete: (key: Key) => boolean;
    clear: () => void;
    size: () => number;
};
export declare const PROFILING_EVENT_CACHE: {
    get: (key: string) => Event | undefined;
    add: (key: string, value: Event) => void;
    delete: (key: string) => boolean;
    clear: () => void;
    size: () => number;
};
//# sourceMappingURL=cache.d.ts.map{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../src/profiling/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,SAAS,MAAM,EAAE,KAAK,SAAS,KAAK,EACxE,IAAI,EAAE,MAAM,GACX;IACD,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,KAAK,GAAG,SAAS,CAAC;IACrC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,MAAM,CAAC;CACpB,CAuDA;AAED,eAAO,MAAM,qBAAqB;;;;;;CAAwC,CAAC"}import type { Transaction } from '@sentry/types';
/**
 * Safety wrapper for startTransaction for the unlikely case that transaction starts before tracing is imported -
 * if that happens we want to avoid throwing an error from profiling code.
 * see https://github.com/getsentry/sentry-javascript/issues/4731.
 *
 * @experimental
 */
export declare function onProfilingStartRouteTransaction(transaction: Transaction | undefined): Transaction | undefined;
/**
 * Patches startTransaction and stopTransaction with profiling logic.
 */
export declare function addProfilingExtensionMethods(): void;
//# sourceMappingURL=hubextensions.d.ts.map{"version":3,"file":"hubextensions.d.ts","sourceRoot":"","sources":["../../../../src/profiling/hubextensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8B,WAAW,EAAsB,MAAM,eAAe,CAAC;AAiCjG;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAS9G;AA6ND;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CA2BnD"}import type { Event, EventProcessor, Integration } from '@sentry/types';
/**
 * Browser profiling integration. Stores any event that has contexts["profile"]["profile_id"]
 * This exists because we do not want to await async profiler.stop calls as transaction.finish is called
 * in a synchronous context. Instead, we handle sending the profile async from the promise callback and
 * rely on being able to pull the event from the cache when we need to construct the envelope. This makes the
 * integration less reliable as we might be dropping profiles when the cache is full.
 *
 * @experimental
 */
export declare class BrowserProfilingIntegration implements Integration {
    readonly name: string;
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
    /**
     * @inheritDoc
     */
    handleGlobalEvent(event: Event): Event;
}
//# sourceMappingURL=integration.d.ts.map{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../../src/profiling/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMxE;;;;;;;;GAQG;AACH,qBAAa,2BAA4B,YAAW,WAAW;IAC7D,SAAgB,IAAI,EAAE,MAAM,CAAiC;IAE7D;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAWnF;;OAEG;IACI,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;CAY9C"}declare type JSSelfProfileSampleMarker = 'script' | 'gc' | 'style' | 'layout' | 'paint' | 'other';
export declare type JSSelfProfileSample = {
    timestamp: number;
    stackId?: number;
    marker?: JSSelfProfileSampleMarker;
};
export declare type JSSelfProfileStack = {
    frameId: number;
    parentId?: number;
};
export declare type JSSelfProfileFrame = {
    name: string;
    resourceId?: number;
    line?: number;
    column?: number;
};
export declare type JSSelfProfile = {
    resources: string[];
    frames: JSSelfProfileFrame[];
    stacks: JSSelfProfileStack[];
    samples: JSSelfProfileSample[];
};
export interface ProcessedJSSelfProfile extends JSSelfProfile {
    profile_id: string;
}
declare type BufferFullCallback = (trace: JSSelfProfile) => void;
export interface JSSelfProfiler {
    sampleInterval: number;
    stopped: boolean;
    stop: () => Promise<JSSelfProfile>;
    addEventListener(event: 'samplebufferfull', callback: BufferFullCallback): void;
}
export declare const JSSelfProfilerConstructor: {
    new (options: {
        sampleInterval: number;
        maxBufferSize: number;
    }): JSSelfProfiler;
};
declare global {
    interface Window {
        Profiler: typeof JSSelfProfilerConstructor | undefined;
    }
}
export interface RawThreadCpuProfile extends JSSelfProfile {
    profile_id: string;
}
export interface ThreadCpuProfile {
    samples: {
        stack_id: number;
        thread_id: string;
        elapsed_since_start_ns: string;
    }[];
    stacks: number[][];
    frames: {
        function: string;
        file: string | undefined;
        line: number | undefined;
        column: number | undefined;
    }[];
    thread_metadata: Record<string, {
        name?: string;
        priority?: number;
    }>;
    queue_metadata?: Record<string, {
        label: string;
    }>;
}
export interface SentryProfile {
    event_id: string;
    version: string;
    os: {
        name: string;
        version: string;
        build_number: string;
    };
    runtime: {
        name: string;
        version: string;
    };
    device: {
        architecture: string;
        is_emulator: boolean;
        locale: string;
        manufacturer: string;
        model: string;
    };
    timestamp: string;
    release: string;
    environment: string;
    platform: string;
    profile: ThreadCpuProfile;
    debug_meta?: {
        images: {
            debug_id: string;
            image_addr: string;
            code_file: string;
            type: string;
            image_size: number;
            image_vmaddr: string;
        }[];
    };
    transactions: {
        name: string;
        trace_id: string;
        id: string;
        active_thread_id: string;
        relative_start_ns: string;
        relative_end_ns: string;
    }[];
}
export {};
//# sourceMappingURL=jsSelfProfiling.d.ts.map{"version":3,"file":"jsSelfProfiling.d.ts","sourceRoot":"","sources":["../../../../src/profiling/jsSelfProfiling.ts"],"names":[],"mappings":"AACA,aAAK,yBAAyB,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1F,oBAAY,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,a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,EAAE,MAAM,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,gBAAgB,EAAE,MAAM,CAAC;QACzB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;KACzB,EAAE,CAAC;CACL"}import type { ProcessedJSSelfProfile } from './jsSelfProfiling';
/**
 * Performs lookup in the event cache and sends the profile to Sentry.
 * If the profiled transaction event is found, we use the profiled transaction event and profile
 * to construct a profile type envelope and send it to Sentry.
 */
export declare function sendProfile(profileId: string, profile: ProcessedJSSelfProfile): void;
//# sourceMappingURL=sendProfile.d.ts.map{"version":3,"file":"sendProfile.d.ts","sourceRoot":"","sources":["../../../../src/profiling/sendProfile.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGhE;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,IAAI,CA4EpF"}import type { DsnComponents, Event, EventEnvelope, SdkMetadata } from '@sentry/types';
import type { JSSelfProfile, RawThreadCpuProfile, ThreadCpuProfile } from './jsSelfProfiling';
/**
 *
 */
export declare function enrichWithThreadInformation(profile: ThreadCpuProfile | RawThreadCpuProfile): ThreadCpuProfile;
export interface ProfiledEvent extends Event {
    sdkProcessingMetadata: {
        profile?: RawThreadCpuProfile;
    };
}
/**
 * Creates a profiling event envelope from a Sentry event. If profile does not pass
 * validation, returns null.
 * @param event
 * @param dsn
 * @param metadata
 * @param tunnel
 * @returns {EventEnvelope | null}
 */
/**
 * Creates a profiling event envelope from a Sentry event.
 */
export declare function createProfilingEventEnvelope(event: ProfiledEvent, dsn: DsnComponents, metadata?: SdkMetadata, tunnel?: string): EventEnvelope | null;
/**
 *
 */
export declare function isProfiledTransactionEvent(event: Event): event is ProfiledEvent;
/**
 *
 */
export declare function maybeRemoveProfileFromSdkMetadata(event: Event | ProfiledEvent): Event;
/**
 * Converts a JSSelfProfile to a our sampled format.
 * Does not currently perform stack indexing.
 */
export declare function convertJSSelfProfileToSampledFormat(input: JSSelfProfile): ThreadCpuProfile;
//# sourceMappingURL=utils.d.ts.map{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/profiling/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EAEb,KAAK,EACL,aAAa,EAIb,WAAW,EACZ,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,EACV,aAAa,EAEb,mBAAmB,EAEnB,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAgE3B;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,GAAG,gBAAgB,CAM7G;AAID,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,qBAAqB,EAAE;QACrB,OAAO,CAAC,EAAE,mBAAmB,CAAC;KAC/B,CAAC;CACH;AA+DD;;;;;;;;GAQG;AAEH;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,aAAa,EACpB,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,WAAW,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,aAAa,GAAG,IAAI,CAkFtB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAE/E;AAKD;;GAEG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,GAAG,KAAK,CAOrF;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,aAAa,GAAG,gBAAgB,CA8E1F"}import type { Hub } from '@sentry/core';
import { Integrations as CoreIntegrations } from '@sentry/core';
import type { UserFeedback } from '@sentry/types';
import type { BrowserOptions } from './client';
import type { ReportDialogOptions } from './helpers';
import { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations';
export declare const defaultIntegrations: (GlobalHandlers | TryCatch | Breadcrumbs | LinkedErrors | HttpContext | Dedupe | CoreIntegrations.InboundFilters | CoreIntegrations.FunctionToString)[];
/**
 * The Sentry Browser SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible when
 * loading the web page. To set context information or send manual events, use
 * the provided methods.
 *
 * @example
 *
 * ```
 *
 * import { init } from '@sentry/browser';
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { configureScope } from '@sentry/browser';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * import { addBreadcrumb } from '@sentry/browser';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 *
 * ```
 *
 * import * as Sentry from '@sentry/browser';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link BrowserOptions} for documentation on configuration options.
 */
export declare function init(options?: BrowserOptions): void;
/**
 * Present the user with a report dialog.
 *
 * @param options Everything is optional, we try to fetch all info need from the global scope.
 */
export declare function showReportDialog(options?: ReportDialogOptions, hub?: Hub): void;
/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
export declare function lastEventId(): string | undefined;
/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
export declare function forceLoad(): void;
/**
 * This function is here to be API compatible with the loader.
 * @hidden
 */
export declare function onLoad(callback: () => void): void;
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function flush(timeout?: number): PromiseLike<boolean>;
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function close(timeout?: number): PromiseLike<boolean>;
/**
 * Wrap code within a try/catch block so the SDK is able to capture errors.
 *
 * @param fn A function to wrap.
 *
 * @returns The result of wrapped function call.
 */
export declare function wrap(fn: (...args: any) => any): any;
/**
 * Captures user feedback and sends it to Sentry.
 */
export declare function captureUserFeedback(feedback: UserFeedback): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAKL,YAAY,IAAI,gBAAgB,EACjC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AASlD,OAAO,KAAK,EAAwB,cAAc,EAAE,MAAM,UAAU,CAAC;AAErE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1G,eAAO,MAAM,mBAAmB,yJAS/B,CAAC;AAOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAkCvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,mBAAwB,EAAE,GAAG,GAAE,GAAqB,GAAG,IAAI,CAuCpG;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAEjD;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAO5D;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAO5D;AAED;;;;;;GAMG;AAEH,wBAAgB,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,GAAG,CAEnD;AA4CD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAKhE"}import type { StackLineParser } from '@sentry/types';
export declare const chromeStackLineParser: StackLineParser;
export declare const geckoStackLineParser: StackLineParser;
export declare const winjsStackLineParser: StackLineParser;
export declare const opera10StackLineParser: StackLineParser;
export declare const opera11StackLineParser: StackLineParser;
export declare const defaultStackLineParsers: StackLineParser[];
export declare const defaultStackParser: import("@sentry/types").StackParser;
//# sourceMappingURL=stack-parsers.d.ts.map{"version":3,"file":"stack-parsers.d.ts","sourceRoot":"","sources":["../../../src/stack-parsers.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAc,eAAe,EAAqB,MAAM,eAAe,CAAC;AA8DpF,eAAO,MAAM,qBAAqB,EAAE,eAA2C,CAAC;AAoChF,eAAO,MAAM,oBAAoB,EAAE,eAAyC,CAAC;AAa7E,eAAO,MAAM,oBAAoB,EAAE,eAAyC,CAAC;AAS7E,eAAO,MAAM,sBAAsB,EAAE,eAA6C,CAAC;AAUnF,eAAO,MAAM,sBAAsB,EAAE,eAA6C,CAAC;AAEnF,eAAO,MAAM,uBAAuB,mBAAsE,CAAC;AAE3G,eAAO,MAAM,kBAAkB,qCAAgD,CAAC"}import type { Transport } from '@sentry/types';
import type { BrowserTransportOptions } from './types';
import type { FetchImpl } from './utils';
/**
 * Creates a Transport that uses the Fetch API to send events to Sentry.
 */
export declare function makeFetchTransport(options: BrowserTransportOptions, nativeFetch?: FetchImpl): Transport;
//# sourceMappingURL=fetch.d.ts.map{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/transports/fetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAG/F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,uBAAuB,EAChC,WAAW,GAAE,SAA0C,GACtD,SAAS,CAkDX"}export { makeFetchTransport } from './fetch';
export { makeXHRTransport } from './xhr';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC"}import type { OfflineTransportOptions } from '@sentry/core';
import type { InternalBaseTransportOptions, Transport } from '@sentry/types';
import type { TextDecoderInternal } from '@sentry/utils';
declare type Store = <T>(callback: (store: IDBObjectStore) => T | PromiseLike<T>) => Promise<T>;
/** Create or open an IndexedDb store */
export declare function createStore(dbName: string, storeName: string): Store;
/** Insert into the store */
export declare function insert(store: Store, value: Uint8Array | string, maxQueueSize: number): Promise<void>;
/** Pop the oldest value from the store */
export declare function pop(store: Store): Promise<Uint8Array | string | undefined>;
export interface BrowserOfflineTransportOptions extends OfflineTransportOptions {
    /**
     * Name of indexedDb database to store envelopes in
     * Default: 'sentry-offline'
     */
    dbName?: string;
    /**
     * Name of indexedDb object store to store envelopes in
     * Default: 'queue'
     */
    storeName?: string;
    /**
     * Maximum number of envelopes to store
     * Default: 30
     */
    maxQueueSize?: number;
    /**
     * Only required for testing on node.js
     * @ignore
     */
    textDecoder?: TextDecoderInternal;
}
/**
 * Creates a transport that uses IndexedDb to store events when offline.
 */
export declare function makeBrowserOfflineTransport<T extends InternalBaseTransportOptions>(createTransport: (options: T) => Transport): (options: T & BrowserOfflineTransportOptions) => Transport;
export {};
//# sourceMappingURL=offline.d.ts.map{"version":3,"file":"offline.d.ts","sourceRoot":"","sources":["../../../../src/transports/offline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE1E,OAAO,KAAK,EAAY,4BAA4B,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAuBzD,aAAK,KAAK,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAWxF,wCAAwC;AACxC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAMpE;AAMD,4BAA4B;AAC5B,wBAAgB,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpG;AAED,0CAA0C;AAC1C,wBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,CAa1E;AAED,MAAM,WAAW,8BAA+B,SAAQ,uBAAuB;IAC7E;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAgDD;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,4BAA4B,EAChF,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,SAAS,GACzC,CAAC,OAAO,EAAE,CAAC,GAAG,8BAA8B,KAAK,SAAS,CAE5D"}import type { BaseTransportOptions } from '@sentry/types';
import type { BrowserOfflineTransportOptions } from './offline';
declare type BaseTransportAndOfflineTransportOptions = BaseTransportOptions & BrowserOfflineTransportOptions;
export interface BrowserTransportOptions extends BaseTransportAndOfflineTransportOptions {
    /** Fetch API init parameters. Used by the FetchTransport */
    fetchOptions?: RequestInit;
    /** Custom headers for the transport. Used by the XHRTransport and FetchTransport */
    headers?: {
        [key: string]: string;
    };
}
export {};
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/transports/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAEhE,aAAK,uCAAuC,GAAG,oBAAoB,GAAG,8BAA8B,CAAC;AAErG,MAAM,WAAW,uBAAwB,SAAQ,uCAAuC;IACtF,4DAA4D;IAC5D,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,oFAAoF;IACpF,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrC"}export declare type FetchImpl = typeof fetch;
/**
 * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
 * Whenever someone wraps the Fetch API and returns the wrong promise chain,
 * this chain becomes orphaned and there is no possible way to capture it's rejections
 * other than allowing it bubble up to this very handler. eg.
 *
 * const f = window.fetch;
 * window.fetch = function () {
 *   const p = f.apply(this, arguments);
 *
 *   p.then(function() {
 *     console.log('hi.');
 *   });
 *
 *   return p;
 * }
 *
 * `p.then(function () { ... })` is producing a completely separate promise chain,
 * however, what's returned is `p` - the result of original `fetch` call.
 *
 * This mean, that whenever we use the Fetch API to send our own requests, _and_
 * some ad-blocker blocks it, this orphaned chain will _always_ reject,
 * effectively causing another event to be captured.
 * This makes a whole process become an infinite loop, which we need to somehow
 * deal with, and break it in one way or another.
 *
 * To deal with this issue, we are making sure that we _always_ use the real
 * browser Fetch API, instead of relying on what `window.fetch` exposes.
 * The only downside to this would be missing our own requests as breadcrumbs,
 * but because we are already not doing this, it should be just fine.
 *
 * Possible failed fetch error messages per-browser:
 *
 * Chrome:  Failed to fetch
 * Edge:    Failed to Fetch
 * Firefox: NetworkError when attempting to fetch resource
 * Safari:  resource blocked by content blocker
 */
export declare function getNativeFetchImplementation(): FetchImpl;
/** Clears cached fetch impl */
export declare function clearCachedFetchImplementation(): void;
//# sourceMappingURL=utils.d.ts.map{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/transports/utils.ts"],"names":[],"mappings":"AAMA,oBAAY,SAAS,GAAG,OAAO,KAAK,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,4BAA4B,IAAI,SAAS,CAiCxD;AAED,+BAA+B;AAC/B,wBAAgB,8BAA8B,IAAI,IAAI,CAErD"}import type { Transport } from '@sentry/types';
import type { BrowserTransportOptions } from './types';
/**
 * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.
 */
export declare function makeXHRTransport(options: BrowserTransportOptions): Transport;
//# sourceMappingURL=xhr.d.ts.map{"version":3,"file":"xhr.d.ts","sourceRoot":"","sources":["../../../../src/transports/xhr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAG/F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAYvD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,SAAS,CAgC5E"}import type { DsnComponents, EventEnvelope, SdkMetadata, UserFeedback } from '@sentry/types';
/**
 * Creates an envelope from a user feedback.
 */
export declare function createUserFeedbackEnvelope(feedback: UserFeedback, { metadata, tunnel, dsn, }: {
    metadata: SdkMetadata | undefined;
    tunnel: string | undefined;
    dsn: DsnComponents | undefined;
}): EventEnvelope;
//# sourceMappingURL=userfeedback.d.ts.map{"version":3,"file":"userfeedback.d.ts","sourceRoot":"","sources":["../../../src/userfeedback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,eAAe,CAAC;AAG/G;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,YAAY,EACtB,EACE,QAAQ,EACR,MAAM,EACN,GAAG,GACJ,EAAE;IACD,QAAQ,EAAE,WAAW,GAAG,SAAS,CAAC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAC;CAChC,GACA,aAAa,CAgBf"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const SENTRY_API_VERSION = '7';

/** Returns the prefix to construct Sentry ingestion API endpoints. */
function getBaseApiEndpoint(dsn) {
  const protocol = dsn.protocol ? `${dsn.protocol}:` : '';
  const port = dsn.port ? `:${dsn.port}` : '';
  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;
}

/** Returns the ingest API endpoint for target. */
function _getIngestEndpoint(dsn) {
  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;
}

/** Returns a URL-encoded string with auth config suitable for a query string. */
function _encodedAuth(dsn, sdkInfo) {
  return utils.urlEncode({
    // We send only the minimum set of required information. See
    // https://github.com/getsentry/sentry-javascript/issues/2572.
    sentry_key: dsn.publicKey,
    sentry_version: SENTRY_API_VERSION,
    ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),
  });
}

/**
 * Returns the envelope endpoint URL with auth in the query string.
 *
 * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
 */
function getEnvelopeEndpointWithUrlEncodedAuth(
  dsn,
  // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below
  // options: ClientOptions = {} as ClientOptions,
  tunnelOrOptions = {} ,
) {
  // TODO (v8): Use this code instead
  // const { tunnel, _metadata = {} } = options;
  // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;

  const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;
  const sdkInfo =
    typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;

  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
}

/** Returns the url to the report dialog endpoint. */
function getReportDialogEndpoint(
  dsnLike,
  dialogOptions

,
) {
  const dsn = utils.makeDsn(dsnLike);
  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;

  let encodedOptions = `dsn=${utils.dsnToString(dsn)}`;
  for (const key in dialogOptions) {
    if (key === 'dsn') {
      continue;
    }

    if (key === 'user') {
      const user = dialogOptions.user;
      if (!user) {
        continue;
      }
      if (user.name) {
        encodedOptions += `&name=${encodeURIComponent(user.name)}`;
      }
      if (user.email) {
        encodedOptions += `&email=${encodeURIComponent(user.email)}`;
      }
    } else {
      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`;
    }
  }

  return `${endpoint}?${encodedOptions}`;
}

exports.getEnvelopeEndpointWithUrlEncodedAuth = getEnvelopeEndpointWithUrlEncodedAuth;
exports.getReportDialogEndpoint = getReportDialogEndpoint;
//# sourceMappingURL=api.js.map
{"version":3,"file":"api.js","sources":["../../src/api.ts"],"sourcesContent":["import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n  const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n  const port = dsn.port ? `:${dsn.port}` : '';\n  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n  return urlEncode({\n    // We send only the minimum set of required information. See\n    // https://github.com/getsentry/sentry-javascript/issues/2572.\n    sentry_key: dsn.publicKey,\n    sentry_version: SENTRY_API_VERSION,\n    ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n  });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n  dsn: DsnComponents,\n  // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n  // options: ClientOptions = {} as ClientOptions,\n  tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n  // TODO (v8): Use this code instead\n  // const { tunnel, _metadata = {} } = options;\n  // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n  const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n  const sdkInfo =\n    typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n  dsnLike: DsnLike,\n  dialogOptions: {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    [key: string]: any;\n    user?: { name?: string; email?: string };\n  },\n): string {\n  const dsn = makeDsn(dsnLike);\n  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n  let encodedOptions = `dsn=${dsnToString(dsn)}`;\n  for (const key in dialogOptions) {\n    if (key === 'dsn') {\n      continue;\n    }\n\n    if (key === 'user') {\n      const user = dialogOptions.user;\n      if (!user) {\n        continue;\n      }\n      if (user.name) {\n        encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n      }\n      if (user.email) {\n        encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n      }\n    } else {\n      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n    }\n  }\n\n  return `${endpoint}?${encodedOptions}`;\n}\n"],"names":["urlEncode","makeDsn","dsnToString"],"mappings":";;;;AAGA,MAAA,kBAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,GAAA,CAAA,QAAA,GAAA,CAAA,EAAA,GAAA,CAAA,QAAA,CAAA,CAAA,CAAA,GAAA,EAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,GAAA,CAAA,IAAA,GAAA,CAAA,CAAA,EAAA,GAAA,CAAA,IAAA,CAAA,CAAA,GAAA,EAAA,CAAA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,CAAA,EAAA,EAAA,GAAA,CAAA,IAAA,CAAA,EAAA,IAAA,CAAA,EAAA,GAAA,CAAA,IAAA,GAAA,CAAA,CAAA,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AAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,iBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,cAAA,GAAA,CAAA,IAAA,EAAAC,iBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,KAAA,MAAA,GAAA,IAAA,aAAA,EAAA;AACA,IAAA,IAAA,GAAA,KAAA,KAAA,EAAA;AACA,MAAA,SAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,GAAA,KAAA,MAAA,EAAA;AACA,MAAA,MAAA,IAAA,GAAA,aAAA,CAAA,IAAA,CAAA;AACA,MAAA,IAAA,CAAA,IAAA,EAAA;AACA,QAAA,SAAA;AACA,OAAA;AACA,MAAA,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,QAAA,cAAA,IAAA,CAAA,MAAA,EAAA,kBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,IAAA,IAAA,CAAA,KAAA,EAAA;AACA,QAAA,cAAA,IAAA,CAAA,OAAA,EAAA,kBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA,MAAA;AACA,MAAA,cAAA,IAAA,CAAA,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,kBAAA,CAAA,aAAA,CAAA,GAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,CAAA,CAAA,EAAA,cAAA,CAAA,CAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const api = require('./api.js');
const envelope = require('./envelope.js');
const integration = require('./integration.js');
const session = require('./session.js');
const prepareEvent = require('./utils/prepareEvent.js');

const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";

/**
 * Base implementation for all JavaScript SDK clients.
 *
 * Call the constructor with the corresponding options
 * specific to the client subclass. To access these options later, use
 * {@link Client.getOptions}.
 *
 * If a Dsn is specified in the options, it will be parsed and stored. Use
 * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
 * invalid, the constructor will throw a {@link SentryException}. Note that
 * without a valid Dsn, the SDK will not send any events to Sentry.
 *
 * Before sending an event, it is passed through
 * {@link BaseClient._prepareEvent} to add SDK information and scope data
 * (breadcrumbs and context). To add more custom information, override this
 * method and extend the resulting prepared event.
 *
 * To issue automatically created events (e.g. via instrumentation), use
 * {@link Client.captureEvent}. It will prepare the event and pass it through
 * the callback lifecycle. To issue auto-breadcrumbs, use
 * {@link Client.addBreadcrumb}.
 *
 * @example
 * class NodeClient extends BaseClient<NodeOptions> {
 *   public constructor(options: NodeOptions) {
 *     super(options);
 *   }
 *
 *   // ...
 * }
 */
class BaseClient {
  /** Options passed to the SDK. */

  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */

  /** Array of set up integrations. */
   __init() {this._integrations = {};}

  /** Indicates whether this client's integrations have been set up. */
   __init2() {this._integrationsInitialized = false;}

  /** Number of calls being processed */
   __init3() {this._numProcessing = 0;}

  /** Holds flushable  */
   __init4() {this._outcomes = {};}

  // eslint-disable-next-line @typescript-eslint/ban-types
   __init5() {this._hooks = {};}

  /**
   * Initializes this client instance.
   *
   * @param options Options for the client.
   */
   constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this);BaseClient.prototype.__init5.call(this);
    this._options = options;
    if (options.dsn) {
      this._dsn = utils.makeDsn(options.dsn);
      const url = api.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);
      this._transport = options.transport({
        recordDroppedEvent: this.recordDroppedEvent.bind(this),
        ...options.transportOptions,
        url,
      });
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('No DSN provided, client will not do anything.');
    }
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   captureException(exception, hint, scope) {
    // ensure we haven't captured this very object before
    if (utils.checkOrSetAlreadyCaught(exception)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(ALREADY_SEEN_ERROR);
      return;
    }

    let eventId = hint && hint.event_id;

    this._process(
      this.eventFromException(exception, hint)
        .then(event => this._captureEvent(event, hint, scope))
        .then(result => {
          eventId = result;
        }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level,
    hint,
    scope,
  ) {
    let eventId = hint && hint.event_id;

    const promisedEvent = utils.isPrimitive(message)
      ? this.eventFromMessage(String(message), level, hint)
      : this.eventFromException(message, hint);

    this._process(
      promisedEvent
        .then(event => this._captureEvent(event, hint, scope))
        .then(result => {
          eventId = result;
        }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint, scope) {
    // ensure we haven't captured this very object before
    if (hint && hint.originalException && utils.checkOrSetAlreadyCaught(hint.originalException)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(ALREADY_SEEN_ERROR);
      return;
    }

    let eventId = hint && hint.event_id;

    this._process(
      this._captureEvent(event, hint, scope).then(result => {
        eventId = result;
      }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureSession(session$1) {
    if (!this._isEnabled()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('SDK not enabled, will not capture session.');
      return;
    }

    if (!(typeof session$1.release === 'string')) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Discarded session because of missing or non-string release');
    } else {
      this.sendSession(session$1);
      // After sending, we set init false to indicate it's not the first occurrence
      session.updateSession(session$1, { init: false });
    }
  }

  /**
   * @inheritDoc
   */
   getDsn() {
    return this._dsn;
  }

  /**
   * @inheritDoc
   */
   getOptions() {
    return this._options;
  }

  /**
   * @see SdkMetadata in @sentry/types
   *
   * @return The metadata of the SDK
   */
   getSdkMetadata() {
    return this._options._metadata;
  }

  /**
   * @inheritDoc
   */
   getTransport() {
    return this._transport;
  }

  /**
   * @inheritDoc
   */
   flush(timeout) {
    const transport = this._transport;
    if (transport) {
      return this._isClientDoneProcessing(timeout).then(clientFinished => {
        return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);
      });
    } else {
      return utils.resolvedSyncPromise(true);
    }
  }

  /**
   * @inheritDoc
   */
   close(timeout) {
    return this.flush(timeout).then(result => {
      this.getOptions().enabled = false;
      return result;
    });
  }

  /**
   * Sets up the integrations
   */
   setupIntegrations() {
    if (this._isEnabled() && !this._integrationsInitialized) {
      this._integrations = integration.setupIntegrations(this._options.integrations);
      this._integrationsInitialized = true;
    }
  }

  /**
   * Gets an installed integration by its `id`.
   *
   * @returns The installed integration or `undefined` if no integration with that `id` was installed.
   */
   getIntegrationById(integrationId) {
    return this._integrations[integrationId];
  }

  /**
   * @inheritDoc
   */
   getIntegration(integration) {
    try {
      return (this._integrations[integration.id] ) || null;
    } catch (_oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);
      return null;
    }
  }

  /**
   * @inheritDoc
   */
   addIntegration(integration$1) {
    integration.setupIntegration(integration$1, this._integrations);
  }

  /**
   * @inheritDoc
   */
   sendEvent(event, hint = {}) {
    if (this._dsn) {
      let env = envelope.createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);

      for (const attachment of hint.attachments || []) {
        env = utils.addItemToEnvelope(
          env,
          utils.createAttachmentEnvelopeItem(
            attachment,
            this._options.transportOptions && this._options.transportOptions.textEncoder,
          ),
        );
      }

      const promise = this._sendEnvelope(env);
      if (promise) {
        promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);
      }
    }
  }

  /**
   * @inheritDoc
   */
   sendSession(session) {
    if (this._dsn) {
      const env = envelope.createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);
      void this._sendEnvelope(env);
    }
  }

  /**
   * @inheritDoc
   */
   recordDroppedEvent(reason, category, _event) {
    // Note: we use `event` in replay, where we overwrite this hook.

    if (this._options.sendClientReports) {
      // We want to track each category (error, transaction, session, replay_event) separately
      // but still keep the distinction between different type of outcomes.
      // We could use nested maps, but it's much easier to read and type this way.
      // A correct type for map-based implementation if we want to go that route
      // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
      // With typescript 4.1 we could even use template literal types
      const key = `${reason}:${category}`;
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`Adding outcome: "${key}"`);

      // The following works because undefined + 1 === NaN and NaN is falsy
      this._outcomes[key] = this._outcomes[key] + 1 || 1;
    }
  }

  // Keep on() & emit() signatures in sync with types' client.ts interface

  /** @inheritdoc */

  /** @inheritdoc */
   on(hook, callback) {
    if (!this._hooks[hook]) {
      this._hooks[hook] = [];
    }

    // @ts-ignore We assue the types are correct
    this._hooks[hook].push(callback);
  }

  /** @inheritdoc */

  /** @inheritdoc */
   emit(hook, ...rest) {
    if (this._hooks[hook]) {
      // @ts-ignore we cannot enforce the callback to match the hook
      this._hooks[hook].forEach(callback => callback(...rest));
    }
  }

  /** Updates existing session based on the provided event */
   _updateSessionFromEvent(session$1, event) {
    let crashed = false;
    let errored = false;
    const exceptions = event.exception && event.exception.values;

    if (exceptions) {
      errored = true;

      for (const ex of exceptions) {
        const mechanism = ex.mechanism;
        if (mechanism && mechanism.handled === false) {
          crashed = true;
          break;
        }
      }
    }

    // A session is updated and that session update is sent in only one of the two following scenarios:
    // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update
    // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update
    const sessionNonTerminal = session$1.status === 'ok';
    const shouldUpdateAndSend = (sessionNonTerminal && session$1.errors === 0) || (sessionNonTerminal && crashed);

    if (shouldUpdateAndSend) {
      session.updateSession(session$1, {
        ...(crashed && { status: 'crashed' }),
        errors: session$1.errors || Number(errored || crashed),
      });
      this.captureSession(session$1);
    }
  }

  /**
   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
   * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
   *
   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
   * `true`.
   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
   * `false` otherwise
   */
   _isClientDoneProcessing(timeout) {
    return new utils.SyncPromise(resolve => {
      let ticked = 0;
      const tick = 1;

      const interval = setInterval(() => {
        if (this._numProcessing == 0) {
          clearInterval(interval);
          resolve(true);
        } else {
          ticked += tick;
          if (timeout && ticked >= timeout) {
            clearInterval(interval);
            resolve(false);
          }
        }
      }, tick);
    });
  }

  /** Determines whether this SDK is enabled and a valid Dsn is present. */
   _isEnabled() {
    return this.getOptions().enabled !== false && this._dsn !== undefined;
  }

  /**
   * Adds common information to events.
   *
   * The information includes release and environment from `options`,
   * breadcrumbs and context (extra, tags and user) from the scope.
   *
   * Information that is already present in the event is never overwritten. For
   * nested objects, such as the context, keys are merged.
   *
   * @param event The original event.
   * @param hint May contain additional information about the original exception.
   * @param scope A scope containing event metadata.
   * @returns A new event with more information.
   */
   _prepareEvent(event, hint, scope) {
    const options = this.getOptions();
    const integrations = Object.keys(this._integrations);
    if (!hint.integrations && integrations.length > 0) {
      hint.integrations = integrations;
    }
    return prepareEvent.prepareEvent(options, event, hint, scope);
  }

  /**
   * Processes the event and logs an error in case of rejection
   * @param event
   * @param hint
   * @param scope
   */
   _captureEvent(event, hint = {}, scope) {
    return this._processEvent(event, hint, scope).then(
      finalEvent => {
        return finalEvent.event_id;
      },
      reason => {
        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for
          // control flow, log just the message (no stack) as a log-level log.
          const sentryError = reason ;
          if (sentryError.logLevel === 'log') {
            utils.logger.log(sentryError.message);
          } else {
            utils.logger.warn(sentryError);
          }
        }
        return undefined;
      },
    );
  }

  /**
   * Processes an event (either error or message) and sends it to Sentry.
   *
   * This also adds breadcrumbs and context information to the event. However,
   * platform specific meta data (such as the User's IP address) must be added
   * by the SDK implementor.
   *
   *
   * @param event The event to send to Sentry.
   * @param hint May contain additional information about the original exception.
   * @param scope A scope containing event metadata.
   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
   */
   _processEvent(event, hint, scope) {
    const options = this.getOptions();
    const { sampleRate } = options;

    if (!this._isEnabled()) {
      return utils.rejectedSyncPromise(new utils.SentryError('SDK not enabled, will not capture event.', 'log'));
    }

    const isTransaction = isTransactionEvent(event);
    const isError = isErrorEvent(event);
    const eventType = event.type || 'error';
    const beforeSendLabel = `before send for type \`${eventType}\``;

    // 1.0 === 100% events are sent
    // 0.0 === 0% events are sent
    // Sampling for transaction happens somewhere else
    if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {
      this.recordDroppedEvent('sample_rate', 'error', event);
      return utils.rejectedSyncPromise(
        new utils.SentryError(
          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,
          'log',
        ),
      );
    }

    const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;

    return this._prepareEvent(event, hint, scope)
      .then(prepared => {
        if (prepared === null) {
          this.recordDroppedEvent('event_processor', dataCategory, event);
          throw new utils.SentryError('An event processor returned `null`, will not send event.', 'log');
        }

        const isInternalException = hint.data && (hint.data ).__sentry__ === true;
        if (isInternalException) {
          return prepared;
        }

        const result = processBeforeSend(options, prepared, hint);
        return _validateBeforeSendResult(result, beforeSendLabel);
      })
      .then(processedEvent => {
        if (processedEvent === null) {
          this.recordDroppedEvent('before_send', dataCategory, event);
          throw new utils.SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log');
        }

        const session = scope && scope.getSession();
        if (!isTransaction && session) {
          this._updateSessionFromEvent(session, processedEvent);
        }

        // None of the Sentry built event processor will update transaction name,
        // so if the transaction name has been changed by an event processor, we know
        // it has to come from custom event processor added by a user
        const transactionInfo = processedEvent.transaction_info;
        if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {
          const source = 'custom';
          processedEvent.transaction_info = {
            ...transactionInfo,
            source,
          };
        }

        this.sendEvent(processedEvent, hint);
        return processedEvent;
      })
      .then(null, reason => {
        if (reason instanceof utils.SentryError) {
          throw reason;
        }

        this.captureException(reason, {
          data: {
            __sentry__: true,
          },
          originalException: reason,
        });
        throw new utils.SentryError(
          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`,
        );
      });
  }

  /**
   * Occupies the client with processing and event
   */
   _process(promise) {
    this._numProcessing++;
    void promise.then(
      value => {
        this._numProcessing--;
        return value;
      },
      reason => {
        this._numProcessing--;
        return reason;
      },
    );
  }

  /**
   * @inheritdoc
   */
   _sendEnvelope(envelope) {
    if (this._transport && this._dsn) {
      this.emit('beforeEnvelope', envelope);

      return this._transport.send(envelope).then(null, reason => {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Error while sending event:', reason);
      });
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Transport disabled');
    }
  }

  /**
   * Clears outcomes on this client and returns them.
   */
   _clearOutcomes() {
    const outcomes = this._outcomes;
    this._outcomes = {};
    return Object.keys(outcomes).map(key => {
      const [reason, category] = key.split(':') ;
      return {
        reason,
        category,
        quantity: outcomes[key],
      };
    });
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types

}

/**
 * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.
 */
function _validateBeforeSendResult(
  beforeSendResult,
  beforeSendLabel,
) {
  const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`;
  if (utils.isThenable(beforeSendResult)) {
    return beforeSendResult.then(
      event => {
        if (!utils.isPlainObject(event) && event !== null) {
          throw new utils.SentryError(invalidValueError);
        }
        return event;
      },
      e => {
        throw new utils.SentryError(`${beforeSendLabel} rejected with ${e}`);
      },
    );
  } else if (!utils.isPlainObject(beforeSendResult) && beforeSendResult !== null) {
    throw new utils.SentryError(invalidValueError);
  }
  return beforeSendResult;
}

/**
 * Process the matching `beforeSendXXX` callback.
 */
function processBeforeSend(
  options,
  event,
  hint,
) {
  const { beforeSend, beforeSendTransaction } = options;

  if (isErrorEvent(event) && beforeSend) {
    return beforeSend(event, hint);
  }

  if (isTransactionEvent(event) && beforeSendTransaction) {
    return beforeSendTransaction(event, hint);
  }

  return event;
}

function isErrorEvent(event) {
  return event.type === undefined;
}

function isTransactionEvent(event) {
  return event.type === 'transaction';
}

exports.BaseClient = BaseClient;
//# sourceMappingURL=baseclient.js.map
{"version":3,"file":"baseclient.js","sources":["../../src/baseclient.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  ClientOptions,\n  DataCategory,\n  DsnComponents,\n  DynamicSamplingContext,\n  Envelope,\n  ErrorEvent,\n  Event,\n  EventDropReason,\n  EventHint,\n  Integration,\n  IntegrationClass,\n  Outcome,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionEvent,\n  Transport,\n  TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n  addItemToEnvelope,\n  checkOrSetAlreadyCaught,\n  createAttachmentEnvelopeItem,\n  isPlainObject,\n  isPrimitive,\n  isThenable,\n  logger,\n  makeDsn,\n  rejectedSyncPromise,\n  resolvedSyncPromise,\n  SentryError,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport type { IntegrationIndex } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n *   public constructor(options: NodeOptions) {\n *     super(options);\n *   }\n *\n *   // ...\n * }\n */\nexport abstract class BaseClient<O extends ClientOptions> implements Client<O> {\n  /** Options passed to the SDK. */\n  protected readonly _options: O;\n\n  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n  protected readonly _dsn?: DsnComponents;\n\n  protected readonly _transport?: Transport;\n\n  /** Array of set up integrations. */\n  protected _integrations: IntegrationIndex = {};\n\n  /** Indicates whether this client's integrations have been set up. */\n  protected _integrationsInitialized: boolean = false;\n\n  /** Number of calls being processed */\n  protected _numProcessing: number = 0;\n\n  /** Holds flushable  */\n  private _outcomes: { [key: string]: number } = {};\n\n  // eslint-disable-next-line @typescript-eslint/ban-types\n  private _hooks: Record<string, Function[]> = {};\n\n  /**\n   * Initializes this client instance.\n   *\n   * @param options Options for the client.\n   */\n  protected constructor(options: O) {\n    this._options = options;\n    if (options.dsn) {\n      this._dsn = makeDsn(options.dsn);\n      const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n      this._transport = options.transport({\n        recordDroppedEvent: this.recordDroppedEvent.bind(this),\n        ...options.transportOptions,\n        url,\n      });\n    } else {\n      __DEBUG_BUILD__ && logger.warn('No DSN provided, client will not do anything.');\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (checkOrSetAlreadyCaught(exception)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this.eventFromException(exception, hint)\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n    scope?: Scope,\n  ): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    const promisedEvent = isPrimitive(message)\n      ? this.eventFromMessage(String(message), level, hint)\n      : this.eventFromException(message, hint);\n\n    this._process(\n      promisedEvent\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this._captureEvent(event, hint, scope).then(result => {\n        eventId = result;\n      }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(session: Session): void {\n    if (!this._isEnabled()) {\n      __DEBUG_BUILD__ && logger.warn('SDK not enabled, will not capture session.');\n      return;\n    }\n\n    if (!(typeof session.release === 'string')) {\n      __DEBUG_BUILD__ && logger.warn('Discarded session because of missing or non-string release');\n    } else {\n      this.sendSession(session);\n      // After sending, we set init false to indicate it's not the first occurrence\n      updateSession(session, { init: false });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getDsn(): DsnComponents | undefined {\n    return this._dsn;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getOptions(): O {\n    return this._options;\n  }\n\n  /**\n   * @see SdkMetadata in @sentry/types\n   *\n   * @return The metadata of the SDK\n   */\n  public getSdkMetadata(): SdkMetadata | undefined {\n    return this._options._metadata;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransport(): Transport | undefined {\n    return this._transport;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public flush(timeout?: number): PromiseLike<boolean> {\n    const transport = this._transport;\n    if (transport) {\n      return this._isClientDoneProcessing(timeout).then(clientFinished => {\n        return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n      });\n    } else {\n      return resolvedSyncPromise(true);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    return this.flush(timeout).then(result => {\n      this.getOptions().enabled = false;\n      return result;\n    });\n  }\n\n  /**\n   * Sets up the integrations\n   */\n  public setupIntegrations(): void {\n    if (this._isEnabled() && !this._integrationsInitialized) {\n      this._integrations = setupIntegrations(this._options.integrations);\n      this._integrationsInitialized = true;\n    }\n  }\n\n  /**\n   * Gets an installed integration by its `id`.\n   *\n   * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n   */\n  public getIntegrationById(integrationId: string): Integration | undefined {\n    return this._integrations[integrationId];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    try {\n      return (this._integrations[integration.id] as T) || null;\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addIntegration(integration: Integration): void {\n    setupIntegration(integration, this._integrations);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event, hint: EventHint = {}): void {\n    if (this._dsn) {\n      let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n      for (const attachment of hint.attachments || []) {\n        env = addItemToEnvelope(\n          env,\n          createAttachmentEnvelopeItem(\n            attachment,\n            this._options.transportOptions && this._options.transportOptions.textEncoder,\n          ),\n        );\n      }\n\n      const promise = this._sendEnvelope(env);\n      if (promise) {\n        promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n      }\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session | SessionAggregates): void {\n    if (this._dsn) {\n      const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n      void this._sendEnvelope(env);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void {\n    // Note: we use `event` in replay, where we overwrite this hook.\n\n    if (this._options.sendClientReports) {\n      // We want to track each category (error, transaction, session, replay_event) separately\n      // but still keep the distinction between different type of outcomes.\n      // We could use nested maps, but it's much easier to read and type this way.\n      // A correct type for map-based implementation if we want to go that route\n      // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n      // With typescript 4.1 we could even use template literal types\n      const key = `${reason}:${category}`;\n      __DEBUG_BUILD__ && logger.log(`Adding outcome: \"${key}\"`);\n\n      // The following works because undefined + 1 === NaN and NaN is falsy\n      this._outcomes[key] = this._outcomes[key] + 1 || 1;\n    }\n  }\n\n  // Keep on() & emit() signatures in sync with types' client.ts interface\n\n  /** @inheritdoc */\n  public on(hook: 'startTransaction' | 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n  /** @inheritdoc */\n  public on(\n    hook: 'afterSendEvent',\n    callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n  ): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: string, callback: unknown): void {\n    if (!this._hooks[hook]) {\n      this._hooks[hook] = [];\n    }\n\n    // @ts-ignore We assue the types are correct\n    this._hooks[hook].push(callback);\n  }\n\n  /** @inheritdoc */\n  public emit(hook: 'startTransaction' | 'finishTransaction', transaction: Transaction): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n  /** @inheritdoc */\n  public emit(hook: string, ...rest: unknown[]): void {\n    if (this._hooks[hook]) {\n      // @ts-ignore we cannot enforce the callback to match the hook\n      this._hooks[hook].forEach(callback => callback(...rest));\n    }\n  }\n\n  /** Updates existing session based on the provided event */\n  protected _updateSessionFromEvent(session: Session, event: Event): void {\n    let crashed = false;\n    let errored = false;\n    const exceptions = event.exception && event.exception.values;\n\n    if (exceptions) {\n      errored = true;\n\n      for (const ex of exceptions) {\n        const mechanism = ex.mechanism;\n        if (mechanism && mechanism.handled === false) {\n          crashed = true;\n          break;\n        }\n      }\n    }\n\n    // A session is updated and that session update is sent in only one of the two following scenarios:\n    // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n    // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n    const sessionNonTerminal = session.status === 'ok';\n    const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n    if (shouldUpdateAndSend) {\n      updateSession(session, {\n        ...(crashed && { status: 'crashed' }),\n        errors: session.errors || Number(errored || crashed),\n      });\n      this.captureSession(session);\n    }\n  }\n\n  /**\n   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n   * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n   * `false` otherwise\n   */\n  protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise(resolve => {\n      let ticked: number = 0;\n      const tick: number = 1;\n\n      const interval = setInterval(() => {\n        if (this._numProcessing == 0) {\n          clearInterval(interval);\n          resolve(true);\n        } else {\n          ticked += tick;\n          if (timeout && ticked >= timeout) {\n            clearInterval(interval);\n            resolve(false);\n          }\n        }\n      }, tick);\n    });\n  }\n\n  /** Determines whether this SDK is enabled and a valid Dsn is present. */\n  protected _isEnabled(): boolean {\n    return this.getOptions().enabled !== false && this._dsn !== undefined;\n  }\n\n  /**\n   * Adds common information to events.\n   *\n   * The information includes release and environment from `options`,\n   * breadcrumbs and context (extra, tags and user) from the scope.\n   *\n   * Information that is already present in the event is never overwritten. For\n   * nested objects, such as the context, keys are merged.\n   *\n   * @param event The original event.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A new event with more information.\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    const options = this.getOptions();\n    const integrations = Object.keys(this._integrations);\n    if (!hint.integrations && integrations.length > 0) {\n      hint.integrations = integrations;\n    }\n    return prepareEvent(options, event, hint, scope);\n  }\n\n  /**\n   * Processes the event and logs an error in case of rejection\n   * @param event\n   * @param hint\n   * @param scope\n   */\n  protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike<string | undefined> {\n    return this._processEvent(event, hint, scope).then(\n      finalEvent => {\n        return finalEvent.event_id;\n      },\n      reason => {\n        if (__DEBUG_BUILD__) {\n          // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n          // control flow, log just the message (no stack) as a log-level log.\n          const sentryError = reason as SentryError;\n          if (sentryError.logLevel === 'log') {\n            logger.log(sentryError.message);\n          } else {\n            logger.warn(sentryError);\n          }\n        }\n        return undefined;\n      },\n    );\n  }\n\n  /**\n   * Processes an event (either error or message) and sends it to Sentry.\n   *\n   * This also adds breadcrumbs and context information to the event. However,\n   * platform specific meta data (such as the User's IP address) must be added\n   * by the SDK implementor.\n   *\n   *\n   * @param event The event to send to Sentry.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n   */\n  protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event> {\n    const options = this.getOptions();\n    const { sampleRate } = options;\n\n    if (!this._isEnabled()) {\n      return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.', 'log'));\n    }\n\n    const isTransaction = isTransactionEvent(event);\n    const isError = isErrorEvent(event);\n    const eventType = event.type || 'error';\n    const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n    // 1.0 === 100% events are sent\n    // 0.0 === 0% events are sent\n    // Sampling for transaction happens somewhere else\n    if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n      this.recordDroppedEvent('sample_rate', 'error', event);\n      return rejectedSyncPromise(\n        new SentryError(\n          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n          'log',\n        ),\n      );\n    }\n\n    const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n    return this._prepareEvent(event, hint, scope)\n      .then(prepared => {\n        if (prepared === null) {\n          this.recordDroppedEvent('event_processor', dataCategory, event);\n          throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n        }\n\n        const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n        if (isInternalException) {\n          return prepared;\n        }\n\n        const result = processBeforeSend(options, prepared, hint);\n        return _validateBeforeSendResult(result, beforeSendLabel);\n      })\n      .then(processedEvent => {\n        if (processedEvent === null) {\n          this.recordDroppedEvent('before_send', dataCategory, event);\n          throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n        }\n\n        const session = scope && scope.getSession();\n        if (!isTransaction && session) {\n          this._updateSessionFromEvent(session, processedEvent);\n        }\n\n        // None of the Sentry built event processor will update transaction name,\n        // so if the transaction name has been changed by an event processor, we know\n        // it has to come from custom event processor added by a user\n        const transactionInfo = processedEvent.transaction_info;\n        if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n          const source = 'custom';\n          processedEvent.transaction_info = {\n            ...transactionInfo,\n            source,\n          };\n        }\n\n        this.sendEvent(processedEvent, hint);\n        return processedEvent;\n      })\n      .then(null, reason => {\n        if (reason instanceof SentryError) {\n          throw reason;\n        }\n\n        this.captureException(reason, {\n          data: {\n            __sentry__: true,\n          },\n          originalException: reason,\n        });\n        throw new SentryError(\n          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n        );\n      });\n  }\n\n  /**\n   * Occupies the client with processing and event\n   */\n  protected _process<T>(promise: PromiseLike<T>): void {\n    this._numProcessing++;\n    void promise.then(\n      value => {\n        this._numProcessing--;\n        return value;\n      },\n      reason => {\n        this._numProcessing--;\n        return reason;\n      },\n    );\n  }\n\n  /**\n   * @inheritdoc\n   */\n  protected _sendEnvelope(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> | void {\n    if (this._transport && this._dsn) {\n      this.emit('beforeEnvelope', envelope);\n\n      return this._transport.send(envelope).then(null, reason => {\n        __DEBUG_BUILD__ && logger.error('Error while sending event:', reason);\n      });\n    } else {\n      __DEBUG_BUILD__ && logger.error('Transport disabled');\n    }\n  }\n\n  /**\n   * Clears outcomes on this client and returns them.\n   */\n  protected _clearOutcomes(): Outcome[] {\n    const outcomes = this._outcomes;\n    this._outcomes = {};\n    return Object.keys(outcomes).map(key => {\n      const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n      return {\n        reason,\n        category,\n        quantity: outcomes[key],\n      };\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;\n\n  /**\n   * @inheritDoc\n   */\n  public abstract eventFromMessage(\n    _message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    _level?: Severity | SeverityLevel,\n    _hint?: EventHint,\n  ): PromiseLike<Event>;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n  beforeSendResult: PromiseLike<Event | null> | Event | null,\n  beforeSendLabel: string,\n): PromiseLike<Event | null> | Event | null {\n  const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n  if (isThenable(beforeSendResult)) {\n    return beforeSendResult.then(\n      event => {\n        if (!isPlainObject(event) && event !== null) {\n          throw new SentryError(invalidValueError);\n        }\n        return event;\n      },\n      e => {\n        throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n      },\n    );\n  } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n    throw new SentryError(invalidValueError);\n  }\n  return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n): PromiseLike<Event | null> | Event | null {\n  const { beforeSend, beforeSendTransaction } = options;\n\n  if (isErrorEvent(event) && beforeSend) {\n    return beforeSend(event, hint);\n  }\n\n  if (isTransactionEvent(event) && beforeSendTransaction) {\n    return beforeSendTransaction(event, hint);\n  }\n\n  return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n  return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n"],"names":["makeDsn","getEnvelopeEndpointWithUrlEncodedAuth","logger","checkOrSetAlreadyCaught","isPrimitive","session","updateSession","resolvedSyncPromise","setupIntegrations","integration","setupIntegration","createEventEnvelope","addItemToEnvelope","createAttachmentEnvelopeItem","createSessionEnvelope","SyncPromise","prepareEvent","rejectedSyncPromise","SentryError","isThenable","isPlainObject"],"mappings":";;;;;;;;;AAkDA,MAAA,kBAAA,GAAA,6DAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,UAAA,CAAA;AACA;;AAGA;;AAKA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,aAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,wBAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,SAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,MAA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A,CAAA;AACA,SAAA;AACA,QAAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA;AACA,QAAA,MAAA,IAAAA,iBAAA,CAAA,CAAA,EAAA,eAAA,CAAA,eAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA,MAAA,IAAA,CAAAE,mBAAA,CAAA,gBAAA,CAAA,IAAA,gBAAA,KAAA,IAAA,EAAA;AACA,IAAA,MAAA,IAAAF,iBAAA,CAAA,iBAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,gBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA;AACA,EAAA,OAAA;AACA,EAAA,KAAA;AACA,EAAA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,IAAA,YAAA,CAAA,KAAA,CAAA,IAAA,UAAA,EAAA;AACA,IAAA,OAAA,UAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA,KAAA,CAAA,IAAA,qBAAA,EAAA;AACA,IAAA,OAAA,qBAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,YAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,IAAA,KAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,IAAA,KAAA,aAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const DEFAULT_ENVIRONMENT = 'production';

exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT;
//# sourceMappingURL=constants.js.map
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const DEFAULT_ENVIRONMENT = 'production';\n"],"names":[],"mappings":";;AAAA,MAAA,mBAAA,GAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

/**
 * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
 * Merge with existing data if any.
 **/
function enhanceEventWithSdkInfo(event, sdkInfo) {
  if (!sdkInfo) {
    return event;
  }
  event.sdk = event.sdk || {};
  event.sdk.name = event.sdk.name || sdkInfo.name;
  event.sdk.version = event.sdk.version || sdkInfo.version;
  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];
  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];
  return event;
}

/** Creates an envelope from a Session */
function createSessionEnvelope(
  session,
  dsn,
  metadata,
  tunnel,
) {
  const sdkInfo = utils.getSdkMetadataForEnvelopeHeader(metadata);
  const envelopeHeaders = {
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: utils.dsnToString(dsn) }),
  };

  const envelopeItem =
    'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session];

  return utils.createEnvelope(envelopeHeaders, [envelopeItem]);
}

/**
 * Create an Envelope from an event.
 */
function createEventEnvelope(
  event,
  dsn,
  metadata,
  tunnel,
) {
  const sdkInfo = utils.getSdkMetadataForEnvelopeHeader(metadata);

  /*
    Note: Due to TS, event.type may be `replay_event`, theoretically.
    In practice, we never call `createEventEnvelope` with `replay_event` type,
    and we'd have to adjut a looot of types to make this work properly.
    We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)
    So the safe choice is to really guard against the replay_event type here.
  */
  const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';

  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);

  const envelopeHeaders = utils.createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);

  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to
  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may
  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid
  // of this `delete`, lest we miss putting it back in the next time the property is in use.)
  delete event.sdkProcessingMetadata;

  const eventItem = [{ type: eventType }, event];
  return utils.createEnvelope(envelopeHeaders, [eventItem]);
}

exports.createEventEnvelope = createEventEnvelope;
exports.createSessionEnvelope = createSessionEnvelope;
//# sourceMappingURL=envelope.js.map
{"version":3,"file":"envelope.js","sources":["../../src/envelope.ts"],"sourcesContent":["import type {\n  DsnComponents,\n  Event,\n  EventEnvelope,\n  EventItem,\n  SdkInfo,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  SessionEnvelope,\n  SessionItem,\n} from '@sentry/types';\nimport {\n  createEnvelope,\n  createEventEnvelopeHeaders,\n  dsnToString,\n  getSdkMetadataForEnvelopeHeader,\n} from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n  if (!sdkInfo) {\n    return event;\n  }\n  event.sdk = event.sdk || {};\n  event.sdk.name = event.sdk.name || sdkInfo.name;\n  event.sdk.version = event.sdk.version || sdkInfo.version;\n  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n  return event;\n}\n\n/** Creates an envelope from a Session */\nexport function createSessionEnvelope(\n  session: Session | SessionAggregates,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): SessionEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  const envelopeHeaders = {\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n  };\n\n  const envelopeItem: SessionItem =\n    'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session];\n\n  return createEnvelope<SessionEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nexport function createEventEnvelope(\n  event: Event,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): EventEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n  /*\n    Note: Due to TS, event.type may be `replay_event`, theoretically.\n    In practice, we never call `createEventEnvelope` with `replay_event` type,\n    and we'd have to adjut a looot of types to make this work properly.\n    We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n    So the safe choice is to really guard against the replay_event type here.\n  */\n  const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n  // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n  delete event.sdkProcessingMetadata;\n\n  const eventItem: EventItem = [{ type: eventType }, event];\n  return createEnvelope<EventEnvelope>(envelopeHeaders, [eventItem]);\n}\n"],"names":["getSdkMetadataForEnvelopeHeader","dsnToString","createEnvelope","createEventEnvelopeHeaders"],"mappings":";;;;AAmBA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,KAAA,EAAA,OAAA,EAAA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,EAAA,KAAA,CAAA,GAAA,GAAA,KAAA,CAAA,GAAA,IAAA,EAAA,CAAA;AACA,EAAA,KAAA,CAAA,GAAA,CAAA,IAAA,GAAA,KAAA,CAAA,GAAA,C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;AACA;AACA;AACA;AACA,SAAA,mBAAA;AACA,EAAA,KAAA;AACA,EAAA,GAAA;AACA,EAAA,QAAA;AACA,EAAA,MAAA;AACA,EAAA;AACA,EAAA,MAAA,OAAA,GAAAF,qCAAA,CAAA,QAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,KAAA,CAAA,IAAA,IAAA,KAAA,CAAA,IAAA,KAAA,cAAA,GAAA,KAAA,CAAA,IAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,uBAAA,CAAA,KAAA,EAAA,QAAA,IAAA,QAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAAG,gCAAA,CAAA,KAAA,EAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAA,KAAA,CAAA,qBAAA,CAAA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,CAAA,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,KAAA,CAAA,CAAA;AACA,EAAA,OAAAD,oBAAA,CAAA,eAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const hub = require('./hub.js');

// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,
// where HUB_FUNCTION is some method on the Hub class.
//
// This is done to make sure the top level SDK methods stay in sync with the hub methods.
// Although every method here has an explicit return type, some of them (that map to void returns) do not
// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.

/**
 * Captures an exception event and sends it to Sentry.
 *
 * @param exception An exception-like object.
 * @param captureContext Additional scope data to apply to exception event.
 * @returns The generated eventId.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
function captureException(exception, captureContext) {
  return hub.getCurrentHub().captureException(exception, { captureContext });
}

/**
 * Captures a message event and sends it to Sentry.
 *
 * @param message The message to send to Sentry.
 * @param Severity Define the level of the message.
 * @returns The generated eventId.
 */
function captureMessage(
  message,
  // eslint-disable-next-line deprecation/deprecation
  captureContext,
) {
  // This is necessary to provide explicit scopes upgrade, without changing the original
  // arity of the `captureMessage(message, level)` method.
  const level = typeof captureContext === 'string' ? captureContext : undefined;
  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;
  return hub.getCurrentHub().captureMessage(message, level, context);
}

/**
 * Captures a manually created event and sends it to Sentry.
 *
 * @param event The event to send to Sentry.
 * @returns The generated eventId.
 */
function captureEvent(event, hint) {
  return hub.getCurrentHub().captureEvent(event, hint);
}

/**
 * Callback to set context information onto the scope.
 * @param callback Callback function that receives Scope.
 */
function configureScope(callback) {
  hub.getCurrentHub().configureScope(callback);
}

/**
 * Records a new breadcrumb which will be attached to future events.
 *
 * Breadcrumbs will be added to subsequent events to provide more context on
 * user's actions prior to an error or crash.
 *
 * @param breadcrumb The breadcrumb to record.
 */
function addBreadcrumb(breadcrumb) {
  hub.getCurrentHub().addBreadcrumb(breadcrumb);
}

/**
 * Sets context data with the given name.
 * @param name of the context
 * @param context Any kind of data. This data will be normalized.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setContext(name, context) {
  hub.getCurrentHub().setContext(name, context);
}

/**
 * Set an object that will be merged sent as extra data with the event.
 * @param extras Extras object to merge into current context.
 */
function setExtras(extras) {
  hub.getCurrentHub().setExtras(extras);
}

/**
 * Set key:value that will be sent as extra data with the event.
 * @param key String of extra
 * @param extra Any kind of data. This data will be normalized.
 */
function setExtra(key, extra) {
  hub.getCurrentHub().setExtra(key, extra);
}

/**
 * Set an object that will be merged sent as tags data with the event.
 * @param tags Tags context object to merge into current context.
 */
function setTags(tags) {
  hub.getCurrentHub().setTags(tags);
}

/**
 * Set key:value that will be sent as tags data with the event.
 *
 * Can also be used to unset a tag, by passing `undefined`.
 *
 * @param key String key of tag
 * @param value Value of tag
 */
function setTag(key, value) {
  hub.getCurrentHub().setTag(key, value);
}

/**
 * Updates user context information for future events.
 *
 * @param user User context object to be set in the current context. Pass `null` to unset the user.
 */
function setUser(user) {
  hub.getCurrentHub().setUser(user);
}

/**
 * Creates a new scope with and executes the given operation within.
 * The scope is automatically removed once the operation
 * finishes or throws.
 *
 * This is essentially a convenience function for:
 *
 *     pushScope();
 *     callback();
 *     popScope();
 *
 * @param callback that will be enclosed into push/popScope.
 */
function withScope(callback) {
  hub.getCurrentHub().withScope(callback);
}

/**
 * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
 *
 * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
 * new child span within the transaction or any span, call the respective `.startChild()` method.
 *
 * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
 *
 * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
 * finished child spans will be sent to Sentry.
 *
 * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call
 * `startTransaction` directly on the hub.
 *
 * @param context Properties of the new `Transaction`.
 * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
 * default values). See {@link Options.tracesSampler}.
 *
 * @returns The transaction which was just started
 */
function startTransaction(
  context,
  customSamplingContext,
) {
  return hub.getCurrentHub().startTransaction({ ...context }, customSamplingContext);
}

exports.addBreadcrumb = addBreadcrumb;
exports.captureEvent = captureEvent;
exports.captureException = captureException;
exports.captureMessage = captureMessage;
exports.configureScope = configureScope;
exports.setContext = setContext;
exports.setExtra = setExtra;
exports.setExtras = setExtras;
exports.setTag = setTag;
exports.setTags = setTags;
exports.setUser = setUser;
exports.startTransaction = startTransaction;
exports.withScope = withScope;
//# sourceMappingURL=exports.js.map
{"version":3,"file":"exports.js","sources":["../../src/exports.ts"],"sourcesContent":["import type {\n  Breadcrumb,\n  CaptureContext,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Primitive,\n  Severity,\n  SeverityLevel,\n  TransactionContext,\n  User,\n} from '@sentry/types';\n\nimport type { Hub } from './hub';\nimport { getCurrentHub } from './hub';\nimport type { Scope } from './scope';\n\n// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,\n// where HUB_FUNCTION is some method on the Hub class.\n//\n// This is done to make sure the top level SDK methods stay in sync with the hub methods.\n// Although every method here has an explicit return type, some of them (that map to void returns) do not\n// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @param captureContext Additional scope data to apply to exception event.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function captureException(exception: any, captureContext?: CaptureContext): ReturnType<Hub['captureException']> {\n  return getCurrentHub().captureException(exception, { captureContext });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param Severity Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  captureContext?: CaptureContext | Severity | SeverityLevel,\n): ReturnType<Hub['captureMessage']> {\n  // This is necessary to provide explicit scopes upgrade, without changing the original\n  // arity of the `captureMessage(message, level)` method.\n  const level = typeof captureContext === 'string' ? captureContext : undefined;\n  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n  return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event, hint?: EventHint): ReturnType<Hub['captureEvent']> {\n  return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n  getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {\n  getCurrentHub().addBreadcrumb(breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {\n  getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {\n  getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {\n  getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {\n  getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {\n  getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): ReturnType<Hub['setUser']> {\n  getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n *     pushScope();\n *     callback();\n *     popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n  getCurrentHub().withScope(callback);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\nexport function startTransaction(\n  context: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): ReturnType<Hub['startTransaction']> {\n  return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n"],"names":["getCurrentHub"],"mappings":";;;;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,SAAA,EAAA,cAAA,EAAA;AACA,EAAA,OAAAA,iBAAA,EAAA,CAAA,gBAAA,CAAA,SAAA,EAAA,EAAA,cAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA;AACA,EAAA,OAAA;AACA;AACA,EAAA,cAAA;AACA,EAAA;AACA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,cAAA,KAAA,QAAA,GAAA,cAAA,GAAA,SAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,OAAA,cAAA,KAAA,QAAA,GAAA,EAAA,cAAA,EAAA,GAAA,SAAA,CAAA;AACA,EAAA,OAAAA,iBAAA,EAAA,CAAA,cAAA,CAAA,OAAA,EAAA,KAAA,EAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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A,IAAA,EAAA;AACA,EAAAA,iBAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,QAAA,EAAA;AACA,EAAAA,iBAAA,EAAA,CAAA,SAAA,CAAA,QAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA;AACA,EAAA,OAAA;AACA,EAAA,qBAAA;AACA,EAAA;AACA,EAAA,OAAAA,iBAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,GAAA,OAAA,EAAA,EAAA,qBAAA,CAAA,CAAA;AACA;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const constants = require('./constants.js');
const scope = require('./scope.js');
const session = require('./session.js');

/**
 * API compatibility version of this hub.
 *
 * WARNING: This number should only be increased when the global interface
 * changes and new methods are introduced.
 *
 * @hidden
 */
const API_VERSION = 4;

/**
 * Default maximum number of breadcrumbs added to an event. Can be overwritten
 * with {@link Options.maxBreadcrumbs}.
 */
const DEFAULT_BREADCRUMBS = 100;

/**
 * @inheritDoc
 */
class Hub  {
  /** Is a {@link Layer}[] containing the client and scope */

  /** Contains the last event id of a captured event.  */

  /**
   * Creates a new instance of the hub, will push one {@link Layer} into the
   * internal stack on creation.
   *
   * @param client bound to the hub.
   * @param scope bound to the hub.
   * @param version number, higher number means higher priority.
   */
   constructor(client, scope$1 = new scope.Scope(),   _version = API_VERSION) {this._version = _version;
    this._stack = [{ scope: scope$1 }];
    if (client) {
      this.bindClient(client);
    }
  }

  /**
   * @inheritDoc
   */
   isOlderThan(version) {
    return this._version < version;
  }

  /**
   * @inheritDoc
   */
   bindClient(client) {
    const top = this.getStackTop();
    top.client = client;
    if (client && client.setupIntegrations) {
      client.setupIntegrations();
    }
  }

  /**
   * @inheritDoc
   */
   pushScope() {
    // We want to clone the content of prev scope
    const scope$1 = scope.Scope.clone(this.getScope());
    this.getStack().push({
      client: this.getClient(),
      scope: scope$1,
    });
    return scope$1;
  }

  /**
   * @inheritDoc
   */
   popScope() {
    if (this.getStack().length <= 1) return false;
    return !!this.getStack().pop();
  }

  /**
   * @inheritDoc
   */
   withScope(callback) {
    const scope = this.pushScope();
    try {
      callback(scope);
    } finally {
      this.popScope();
    }
  }

  /**
   * @inheritDoc
   */
   getClient() {
    return this.getStackTop().client ;
  }

  /** Returns the scope of the top stack. */
   getScope() {
    return this.getStackTop().scope;
  }

  /** Returns the scope stack for domains or the process. */
   getStack() {
    return this._stack;
  }

  /** Returns the topmost scope layer in the order domain > local > process. */
   getStackTop() {
    return this._stack[this._stack.length - 1];
  }

  /**
   * @inheritDoc
   */
   captureException(exception, hint) {
    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : utils.uuid4());
    const syntheticException = new Error('Sentry syntheticException');
    this._withClient((client, scope) => {
      client.captureException(
        exception,
        {
          originalException: exception,
          syntheticException,
          ...hint,
          event_id: eventId,
        },
        scope,
      );
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level,
    hint,
  ) {
    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : utils.uuid4());
    const syntheticException = new Error(message);
    this._withClient((client, scope) => {
      client.captureMessage(
        message,
        level,
        {
          originalException: message,
          syntheticException,
          ...hint,
          event_id: eventId,
        },
        scope,
      );
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint) {
    const eventId = hint && hint.event_id ? hint.event_id : utils.uuid4();
    if (!event.type) {
      this._lastEventId = eventId;
    }

    this._withClient((client, scope) => {
      client.captureEvent(event, { ...hint, event_id: eventId }, scope);
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   lastEventId() {
    return this._lastEventId;
  }

  /**
   * @inheritDoc
   */
   addBreadcrumb(breadcrumb, hint) {
    const { scope, client } = this.getStackTop();

    if (!client) return;

    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =
      (client.getOptions && client.getOptions()) || {};

    if (maxBreadcrumbs <= 0) return;

    const timestamp = utils.dateTimestampInSeconds();
    const mergedBreadcrumb = { timestamp, ...breadcrumb };
    const finalBreadcrumb = beforeBreadcrumb
      ? (utils.consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )
      : mergedBreadcrumb;

    if (finalBreadcrumb === null) return;

    if (client.emit) {
      client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);
    }

    scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);
  }

  /**
   * @inheritDoc
   */
   setUser(user) {
    this.getScope().setUser(user);
  }

  /**
   * @inheritDoc
   */
   setTags(tags) {
    this.getScope().setTags(tags);
  }

  /**
   * @inheritDoc
   */
   setExtras(extras) {
    this.getScope().setExtras(extras);
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this.getScope().setTag(key, value);
  }

  /**
   * @inheritDoc
   */
   setExtra(key, extra) {
    this.getScope().setExtra(key, extra);
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   setContext(name, context) {
    this.getScope().setContext(name, context);
  }

  /**
   * @inheritDoc
   */
   configureScope(callback) {
    const { scope, client } = this.getStackTop();
    if (client) {
      callback(scope);
    }
  }

  /**
   * @inheritDoc
   */
   run(callback) {
    const oldHub = makeMain(this);
    try {
      callback(this);
    } finally {
      makeMain(oldHub);
    }
  }

  /**
   * @inheritDoc
   */
   getIntegration(integration) {
    const client = this.getClient();
    if (!client) return null;
    try {
      return client.getIntegration(integration);
    } catch (_oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
      return null;
    }
  }

  /**
   * @inheritDoc
   */
   startTransaction(context, customSamplingContext) {
    const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && !result) {
      // eslint-disable-next-line no-console
      console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`);
    }

    return result;
  }

  /**
   * @inheritDoc
   */
   traceHeaders() {
    return this._callExtensionMethod('traceHeaders');
  }

  /**
   * @inheritDoc
   */
   captureSession(endSession = false) {
    // both send the update and pull the session from the scope
    if (endSession) {
      return this.endSession();
    }

    // only send the update
    this._sendSessionUpdate();
  }

  /**
   * @inheritDoc
   */
   endSession() {
    const layer = this.getStackTop();
    const scope = layer.scope;
    const session$1 = scope.getSession();
    if (session$1) {
      session.closeSession(session$1);
    }
    this._sendSessionUpdate();

    // the session is over; take it off of the scope
    scope.setSession();
  }

  /**
   * @inheritDoc
   */
   startSession(context) {
    const { scope, client } = this.getStackTop();
    const { release, environment = constants.DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};

    // Will fetch userAgent if called from browser sdk
    const { userAgent } = utils.GLOBAL_OBJ.navigator || {};

    const session$1 = session.makeSession({
      release,
      environment,
      user: scope.getUser(),
      ...(userAgent && { userAgent }),
      ...context,
    });

    // End existing session if there's one
    const currentSession = scope.getSession && scope.getSession();
    if (currentSession && currentSession.status === 'ok') {
      session.updateSession(currentSession, { status: 'exited' });
    }
    this.endSession();

    // Afterwards we set the new session on the scope
    scope.setSession(session$1);

    return session$1;
  }

  /**
   * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
   * when Tracing is used.
   */
   shouldSendDefaultPii() {
    const client = this.getClient();
    const options = client && client.getOptions();
    return Boolean(options && options.sendDefaultPii);
  }

  /**
   * Sends the current Session on the scope
   */
   _sendSessionUpdate() {
    const { scope, client } = this.getStackTop();

    const session = scope.getSession();
    if (session && client && client.captureSession) {
      client.captureSession(session);
    }
  }

  /**
   * Internal helper function to call a method on the top client if it exists.
   *
   * @param method The method to call on the client.
   * @param args Arguments to pass to the client function.
   */
   _withClient(callback) {
    const { scope, client } = this.getStackTop();
    if (client) {
      callback(client, scope);
    }
  }

  /**
   * Calls global extension method and binding current instance to the function call
   */
  // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   _callExtensionMethod(method, ...args) {
    const carrier = getMainCarrier();
    const sentry = carrier.__SENTRY__;
    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
      return sentry.extensions[method].apply(this, args);
    }
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);
  }
}

/**
 * Returns the global shim registry.
 *
 * FIXME: This function is problematic, because despite always returning a valid Carrier,
 * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
 * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
 **/
function getMainCarrier() {
  utils.GLOBAL_OBJ.__SENTRY__ = utils.GLOBAL_OBJ.__SENTRY__ || {
    extensions: {},
    hub: undefined,
  };
  return utils.GLOBAL_OBJ;
}

/**
 * Replaces the current main hub with the passed one on the global object
 *
 * @returns The old replaced hub
 */
function makeMain(hub) {
  const registry = getMainCarrier();
  const oldHub = getHubFromCarrier(registry);
  setHubOnCarrier(registry, hub);
  return oldHub;
}

/**
 * Returns the default hub instance.
 *
 * If a hub is already registered in the global carrier but this module
 * contains a more recent version, it replaces the registered version.
 * Otherwise, the currently registered hub will be returned.
 */
function getCurrentHub() {
  // Get main carrier (global for every environment)
  const registry = getMainCarrier();

  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {
    const hub = registry.__SENTRY__.acs.getCurrentHub();

    if (hub) {
      return hub;
    }
  }

  // Return hub that lives on a global object
  return getGlobalHub(registry);
}

function getGlobalHub(registry = getMainCarrier()) {
  // If there's no hub, or its an old API, assign a new one
  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {
    setHubOnCarrier(registry, new Hub());
  }

  // Return hub that lives on a global object
  return getHubFromCarrier(registry);
}

/**
 * @private Private API with no semver guarantees!
 *
 * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.
 */
function ensureHubOnCarrier(carrier, parent = getGlobalHub()) {
  // If there's no hub on current domain, or it's an old API, assign a new one
  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {
    const globalHubTopStack = parent.getStackTop();
    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, scope.Scope.clone(globalHubTopStack.scope)));
  }
}

/**
 * @private Private API with no semver guarantees!
 *
 * Sets the global async context strategy
 */
function setAsyncContextStrategy(strategy) {
  // Get main carrier (global for every environment)
  const registry = getMainCarrier();
  registry.__SENTRY__ = registry.__SENTRY__ || {};
  registry.__SENTRY__.acs = strategy;
}

/**
 * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.
 *
 * @param callback The callback to run in its own async context
 * @param options Options to pass to the async context strategy
 * @returns The result of the callback
 */
function runWithAsyncContext(callback, options = {}) {
  const registry = getMainCarrier();

  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {
    return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);
  }

  // if there was no strategy, fallback to just calling the callback
  return callback();
}

/**
 * This will tell whether a carrier has a hub on it or not
 * @param carrier object
 */
function hasHubOnCarrier(carrier) {
  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);
}

/**
 * This will create a new {@link Hub} and add to the passed object on
 * __SENTRY__.hub.
 * @param carrier object
 * @hidden
 */
function getHubFromCarrier(carrier) {
  return utils.getGlobalSingleton('hub', () => new Hub(), carrier);
}

/**
 * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
 * @param carrier object
 * @param hub Hub
 * @returns A boolean indicating success or failure
 */
function setHubOnCarrier(carrier, hub) {
  if (!carrier) return false;
  const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});
  __SENTRY__.hub = hub;
  return true;
}

exports.API_VERSION = API_VERSION;
exports.Hub = Hub;
exports.ensureHubOnCarrier = ensureHubOnCarrier;
exports.getCurrentHub = getCurrentHub;
exports.getHubFromCarrier = getHubFromCarrier;
exports.getMainCarrier = getMainCarrier;
exports.makeMain = makeMain;
exports.runWithAsyncContext = runWithAsyncContext;
exports.setAsyncContextStrategy = setAsyncContextStrategy;
exports.setHubOnCarrier = setHubOnCarrier;
//# sourceMappingURL=hub.js.map
{"version":3,"file":"hub.js","sources":["../../src/hub.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Hub as HubInterface,\n  Integration,\n  IntegrationClass,\n  Primitive,\n  Session,\n  SessionContext,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionContext,\n  User,\n} from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalSingleton, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 4;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n  /** Whether to reuse an existing async context if one exists. Defaults to false. */\n  reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n  /**\n   * Gets the current async context. Returns undefined if there is no current async context.\n   */\n  getCurrentHub: () => Hub | undefined;\n  /**\n   * Runs the supplied callback in its own async context.\n   */\n  runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n  client?: Client;\n  scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n  __SENTRY__?: {\n    hub?: Hub;\n    acs?: AsyncContextStrategy;\n    /**\n     * Extra Hub properties injected by various SDKs\n     */\n    integrations?: Integration[];\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n  /** Is a {@link Layer}[] containing the client and scope */\n  private readonly _stack: Layer[];\n\n  /** Contains the last event id of a captured event.  */\n  private _lastEventId?: string;\n\n  /**\n   * Creates a new instance of the hub, will push one {@link Layer} into the\n   * internal stack on creation.\n   *\n   * @param client bound to the hub.\n   * @param scope bound to the hub.\n   * @param version number, higher number means higher priority.\n   */\n  public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n    this._stack = [{ scope }];\n    if (client) {\n      this.bindClient(client);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isOlderThan(version: number): boolean {\n    return this._version < version;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public bindClient(client?: Client): void {\n    const top = this.getStackTop();\n    top.client = client;\n    if (client && client.setupIntegrations) {\n      client.setupIntegrations();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public pushScope(): Scope {\n    // We want to clone the content of prev scope\n    const scope = Scope.clone(this.getScope());\n    this.getStack().push({\n      client: this.getClient(),\n      scope,\n    });\n    return scope;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public popScope(): boolean {\n    if (this.getStack().length <= 1) return false;\n    return !!this.getStack().pop();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public withScope(callback: (scope: Scope) => void): void {\n    const scope = this.pushScope();\n    try {\n      callback(scope);\n    } finally {\n      this.popScope();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getClient<C extends Client>(): C | undefined {\n    return this.getStackTop().client as C;\n  }\n\n  /** Returns the scope of the top stack. */\n  public getScope(): Scope {\n    return this.getStackTop().scope;\n  }\n\n  /** Returns the scope stack for domains or the process. */\n  public getStack(): Layer[] {\n    return this._stack;\n  }\n\n  /** Returns the topmost scope layer in the order domain > local > process. */\n  public getStackTop(): Layer {\n    return this._stack[this._stack.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureException(exception: unknown, hint?: EventHint): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error('Sentry syntheticException');\n    this._withClient((client, scope) => {\n      client.captureException(\n        exception,\n        {\n          originalException: exception,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n  ): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error(message);\n    this._withClient((client, scope) => {\n      client.captureMessage(\n        message,\n        level,\n        {\n          originalException: message,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint): string {\n    const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n    if (!event.type) {\n      this._lastEventId = eventId;\n    }\n\n    this._withClient((client, scope) => {\n      client.captureEvent(event, { ...hint, event_id: eventId }, scope);\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public lastEventId(): string | undefined {\n    return this._lastEventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n    const { scope, client } = this.getStackTop();\n\n    if (!client) return;\n\n    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n      (client.getOptions && client.getOptions()) || {};\n\n    if (maxBreadcrumbs <= 0) return;\n\n    const timestamp = dateTimestampInSeconds();\n    const mergedBreadcrumb = { timestamp, ...breadcrumb };\n    const finalBreadcrumb = beforeBreadcrumb\n      ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n      : mergedBreadcrumb;\n\n    if (finalBreadcrumb === null) return;\n\n    if (client.emit) {\n      client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n    }\n\n    scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): void {\n    this.getScope().setUser(user);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): void {\n    this.getScope().setTags(tags);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): void {\n    this.getScope().setExtras(extras);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): void {\n    this.getScope().setTag(key, value);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): void {\n    this.getScope().setExtra(key, extra);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public setContext(name: string, context: { [key: string]: any } | null): void {\n    this.getScope().setContext(name, context);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public configureScope(callback: (scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(scope);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public run(callback: (hub: Hub) => void): void {\n    const oldHub = makeMain(this);\n    try {\n      callback(this);\n    } finally {\n      makeMain(oldHub);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    const client = this.getClient();\n    if (!client) return null;\n    try {\n      return client.getIntegration(integration);\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n    const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);\n\n    if (__DEBUG_BUILD__ && !result) {\n      // eslint-disable-next-line no-console\n      console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n    }\n\n    return result;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public traceHeaders(): { [key: string]: string } {\n    return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(endSession: boolean = false): void {\n    // both send the update and pull the session from the scope\n    if (endSession) {\n      return this.endSession();\n    }\n\n    // only send the update\n    this._sendSessionUpdate();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public endSession(): void {\n    const layer = this.getStackTop();\n    const scope = layer.scope;\n    const session = scope.getSession();\n    if (session) {\n      closeSession(session);\n    }\n    this._sendSessionUpdate();\n\n    // the session is over; take it off of the scope\n    scope.setSession();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startSession(context?: SessionContext): Session {\n    const { scope, client } = this.getStackTop();\n    const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n    // Will fetch userAgent if called from browser sdk\n    const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n    const session = makeSession({\n      release,\n      environment,\n      user: scope.getUser(),\n      ...(userAgent && { userAgent }),\n      ...context,\n    });\n\n    // End existing session if there's one\n    const currentSession = scope.getSession && scope.getSession();\n    if (currentSession && currentSession.status === 'ok') {\n      updateSession(currentSession, { status: 'exited' });\n    }\n    this.endSession();\n\n    // Afterwards we set the new session on the scope\n    scope.setSession(session);\n\n    return session;\n  }\n\n  /**\n   * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n   * when Tracing is used.\n   */\n  public shouldSendDefaultPii(): boolean {\n    const client = this.getClient();\n    const options = client && client.getOptions();\n    return Boolean(options && options.sendDefaultPii);\n  }\n\n  /**\n   * Sends the current Session on the scope\n   */\n  private _sendSessionUpdate(): void {\n    const { scope, client } = this.getStackTop();\n\n    const session = scope.getSession();\n    if (session && client && client.captureSession) {\n      client.captureSession(session);\n    }\n  }\n\n  /**\n   * Internal helper function to call a method on the top client if it exists.\n   *\n   * @param method The method to call on the client.\n   * @param args Arguments to pass to the client function.\n   */\n  private _withClient(callback: (client: Client, scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(client, scope);\n    }\n  }\n\n  /**\n   * Calls global extension method and binding current instance to the function call\n   */\n  // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _callExtensionMethod<T>(method: string, ...args: any[]): T {\n    const carrier = getMainCarrier();\n    const sentry = carrier.__SENTRY__;\n    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n      return sentry.extensions[method].apply(this, args);\n    }\n    __DEBUG_BUILD__ && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n  }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n  GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n    extensions: {},\n    hub: undefined,\n  };\n  return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n  const registry = getMainCarrier();\n  const oldHub = getHubFromCarrier(registry);\n  setHubOnCarrier(registry, hub);\n  return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n    if (hub) {\n      return hub;\n    }\n  }\n\n  // Return hub that lives on a global object\n  return getGlobalHub(registry);\n}\n\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n  // If there's no hub, or its an old API, assign a new one\n  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n    setHubOnCarrier(registry, new Hub());\n  }\n\n  // Return hub that lives on a global object\n  return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n  // If there's no hub on current domain, or it's an old API, assign a new one\n  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {\n    const globalHubTopStack = parent.getStackTop();\n    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, Scope.clone(globalHubTopStack.scope)));\n  }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n  registry.__SENTRY__ = registry.__SENTRY__ || {};\n  registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n  }\n\n  // if there was no strategy, fallback to just calling the callback\n  return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n  return getGlobalSingleton<Hub>('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n  if (!carrier) return false;\n  const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n  __SENTRY__.hub = hub;\n  return true;\n}\n"],"names":["scope","Scope","uuid4","dateTimestampInSeconds","consoleSandbox","logger","session","closeSession","DEFAULT_ENVIRONMENT","GLOBAL_OBJ","makeSession","updateSession","getGlobalSingleton"],"mappings":";;;;;;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,WAAA,GAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,GAAA,CAAA;;AAoDA;AACA;AACA;AACA,MAAA,GAAA,EAAA;AACA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,MAAA,EAAAA,OAAA,GAAA,IAAAC,WAAA,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ACA;AACA;AACA,EAAA,OAAA,QAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,CAAA,EAAA,OAAA,IAAA,OAAA,CAAA,UAAA,IAAA,OAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAAW,wBAAA,CAAA,KAAA,EAAA,MAAA,IAAA,GAAA,EAAA,EAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,OAAA,EAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA,OAAA,KAAA,CAAA;AACA,EAAA,MAAA,UAAA,IAAA,OAAA,CAAA,UAAA,GAAA,OAAA,CAAA,UAAA,IAAA,EAAA,CAAA,CAAA;AACA,EAAA,UAAA,CAAA,GAAA,GAAA,GAAA,CAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const hubextensions = require('./tracing/hubextensions.js');
const idletransaction = require('./tracing/idletransaction.js');
const span = require('./tracing/span.js');
const transaction = require('./tracing/transaction.js');
const utils$1 = require('./tracing/utils.js');
const spanstatus = require('./tracing/spanstatus.js');
const trace = require('./tracing/trace.js');
const exports$1 = require('./exports.js');
const hub = require('./hub.js');
const session = require('./session.js');
const sessionflusher = require('./sessionflusher.js');
const scope = require('./scope.js');
const api = require('./api.js');
const baseclient = require('./baseclient.js');
const sdk = require('./sdk.js');
const base = require('./transports/base.js');
const offline = require('./transports/offline.js');
const version = require('./version.js');
const integration = require('./integration.js');
const index = require('./integrations/index.js');
const prepareEvent = require('./utils/prepareEvent.js');
const hasTracingEnabled = require('./utils/hasTracingEnabled.js');
const constants = require('./constants.js');
const functiontostring = require('./integrations/functiontostring.js');
const inboundfilters = require('./integrations/inboundfilters.js');
const utils = require('@sentry/utils');



exports.addTracingExtensions = hubextensions.addTracingExtensions;
exports.startIdleTransaction = hubextensions.startIdleTransaction;
exports.IdleTransaction = idletransaction.IdleTransaction;
exports.TRACING_DEFAULTS = idletransaction.TRACING_DEFAULTS;
exports.Span = span.Span;
exports.spanStatusfromHttpCode = span.spanStatusfromHttpCode;
exports.Transaction = transaction.Transaction;
exports.getActiveTransaction = utils$1.getActiveTransaction;
Object.defineProperty(exports, 'SpanStatus', {
  enumerable: true,
  get: () => spanstatus.SpanStatus
});
exports.trace = trace.trace;
exports.addBreadcrumb = exports$1.addBreadcrumb;
exports.captureEvent = exports$1.captureEvent;
exports.captureException = exports$1.captureException;
exports.captureMessage = exports$1.captureMessage;
exports.configureScope = exports$1.configureScope;
exports.setContext = exports$1.setContext;
exports.setExtra = exports$1.setExtra;
exports.setExtras = exports$1.setExtras;
exports.setTag = exports$1.setTag;
exports.setTags = exports$1.setTags;
exports.setUser = exports$1.setUser;
exports.startTransaction = exports$1.startTransaction;
exports.withScope = exports$1.withScope;
exports.Hub = hub.Hub;
exports.ensureHubOnCarrier = hub.ensureHubOnCarrier;
exports.getCurrentHub = hub.getCurrentHub;
exports.getHubFromCarrier = hub.getHubFromCarrier;
exports.getMainCarrier = hub.getMainCarrier;
exports.makeMain = hub.makeMain;
exports.runWithAsyncContext = hub.runWithAsyncContext;
exports.setAsyncContextStrategy = hub.setAsyncContextStrategy;
exports.setHubOnCarrier = hub.setHubOnCarrier;
exports.closeSession = session.closeSession;
exports.makeSession = session.makeSession;
exports.updateSession = session.updateSession;
exports.SessionFlusher = sessionflusher.SessionFlusher;
exports.Scope = scope.Scope;
exports.addGlobalEventProcessor = scope.addGlobalEventProcessor;
exports.getEnvelopeEndpointWithUrlEncodedAuth = api.getEnvelopeEndpointWithUrlEncodedAuth;
exports.getReportDialogEndpoint = api.getReportDialogEndpoint;
exports.BaseClient = baseclient.BaseClient;
exports.initAndBind = sdk.initAndBind;
exports.createTransport = base.createTransport;
exports.makeOfflineTransport = offline.makeOfflineTransport;
exports.SDK_VERSION = version.SDK_VERSION;
exports.getIntegrationsToSetup = integration.getIntegrationsToSetup;
exports.Integrations = index;
exports.prepareEvent = prepareEvent.prepareEvent;
exports.hasTracingEnabled = hasTracingEnabled.hasTracingEnabled;
exports.DEFAULT_ENVIRONMENT = constants.DEFAULT_ENVIRONMENT;
exports.FunctionToString = functiontostring.FunctionToString;
exports.InboundFilters = inboundfilters.InboundFilters;
exports.extractTraceparentData = utils.extractTraceparentData;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const hub = require('./hub.js');
const scope = require('./scope.js');

const installedIntegrations = [];

/** Map of integrations assigned to a client */

/**
 * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to
 * preseve the order of integrations in the array.
 *
 * @private
 */
function filterDuplicates(integrations) {
  const integrationsByName = {};

  integrations.forEach(currentInstance => {
    const { name } = currentInstance;

    const existingInstance = integrationsByName[name];

    // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a
    // default instance to overwrite an existing user instance
    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {
      return;
    }

    integrationsByName[name] = currentInstance;
  });

  return Object.keys(integrationsByName).map(k => integrationsByName[k]);
}

/** Gets integrations to install */
function getIntegrationsToSetup(options) {
  const defaultIntegrations = options.defaultIntegrations || [];
  const userIntegrations = options.integrations;

  // We flag default instances, so that later we can tell them apart from any user-created instances of the same class
  defaultIntegrations.forEach(integration => {
    integration.isDefaultInstance = true;
  });

  let integrations;

  if (Array.isArray(userIntegrations)) {
    integrations = [...defaultIntegrations, ...userIntegrations];
  } else if (typeof userIntegrations === 'function') {
    integrations = utils.arrayify(userIntegrations(defaultIntegrations));
  } else {
    integrations = defaultIntegrations;
  }

  const finalIntegrations = filterDuplicates(integrations);

  // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or
  // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event
  // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore
  // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.
  const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');
  if (debugIndex !== -1) {
    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);
    finalIntegrations.push(debugInstance);
  }

  return finalIntegrations;
}

/**
 * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
 * integrations are added unless they were already provided before.
 * @param integrations array of integration instances
 * @param withDefault should enable default integrations
 */
function setupIntegrations(integrations) {
  const integrationIndex = {};

  integrations.forEach(integration => {
    // guard against empty provided integrations
    if (integration) {
      setupIntegration(integration, integrationIndex);
    }
  });

  return integrationIndex;
}

/** Setup a single integration.  */
function setupIntegration(integration, integrationIndex) {
  integrationIndex[integration.name] = integration;

  if (installedIntegrations.indexOf(integration.name) === -1) {
    integration.setupOnce(scope.addGlobalEventProcessor, hub.getCurrentHub);
    installedIntegrations.push(integration.name);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`Integration installed: ${integration.name}`);
  }
}

// Polyfill for Array.findIndex(), which is not supported in ES5
function findIndex(arr, callback) {
  for (let i = 0; i < arr.length; i++) {
    if (callback(arr[i]) === true) {
      return i;
    }
  }

  return -1;
}

exports.getIntegrationsToSetup = getIntegrationsToSetup;
exports.installedIntegrations = installedIntegrations;
exports.setupIntegration = setupIntegration;
exports.setupIntegrations = setupIntegrations;
//# sourceMappingURL=integration.js.map
{"version":3,"file":"integration.js","sources":["../../src/integration.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\nimport { addGlobalEventProcessor } from './scope';\n\ndeclare module '@sentry/types' {\n  interface Integration {\n    isDefaultInstance?: boolean;\n  }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n  [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n  const integrationsByName: { [key: string]: Integration } = {};\n\n  integrations.forEach(currentInstance => {\n    const { name } = currentInstance;\n\n    const existingInstance = integrationsByName[name];\n\n    // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n    // default instance to overwrite an existing user instance\n    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n      return;\n    }\n\n    integrationsByName[name] = currentInstance;\n  });\n\n  return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n  const defaultIntegrations = options.defaultIntegrations || [];\n  const userIntegrations = options.integrations;\n\n  // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n  defaultIntegrations.forEach(integration => {\n    integration.isDefaultInstance = true;\n  });\n\n  let integrations: Integration[];\n\n  if (Array.isArray(userIntegrations)) {\n    integrations = [...defaultIntegrations, ...userIntegrations];\n  } else if (typeof userIntegrations === 'function') {\n    integrations = arrayify(userIntegrations(defaultIntegrations));\n  } else {\n    integrations = defaultIntegrations;\n  }\n\n  const finalIntegrations = filterDuplicates(integrations);\n\n  // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n  // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n  // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n  // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n  const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n  if (debugIndex !== -1) {\n    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n    finalIntegrations.push(debugInstance);\n  }\n\n  return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(integrations: Integration[]): IntegrationIndex {\n  const integrationIndex: IntegrationIndex = {};\n\n  integrations.forEach(integration => {\n    // guard against empty provided integrations\n    if (integration) {\n      setupIntegration(integration, integrationIndex);\n    }\n  });\n\n  return integrationIndex;\n}\n\n/** Setup a single integration.  */\nexport function setupIntegration(integration: Integration, integrationIndex: IntegrationIndex): void {\n  integrationIndex[integration.name] = integration;\n\n  if (installedIntegrations.indexOf(integration.name) === -1) {\n    integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n    installedIntegrations.push(integration.name);\n    __DEBUG_BUILD__ && logger.log(`Integration installed: ${integration.name}`);\n  }\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex<T>(arr: T[], callback: (item: T) => boolean): number {\n  for (let i = 0; i < arr.length; i++) {\n    if (callback(arr[i]) === true) {\n      return i;\n    }\n  }\n\n  return -1;\n}\n"],"names":["arrayify","addGlobalEventProcessor","getCurrentHub","logger"],"mappings":";;;;;;AAYA,MAAA,qBAAA,GAAA,GAAA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,YAAA,EAAA;AACA,EAAA,MAAA,kBAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,YAAA,CAAA,OAAA,CAAA,eAAA,IAAA;AACA,IAAA,MAAA,EAAA,IAAA,EAAA,GAAA,eAAA,CAAA;AACA;AACA,IAAA,MAAA,gBAAA,GAAA,kBAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,gBAAA,IAAA,CAAA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AAA,CAAA,CAAA,CAAA,KAAA,IAAA,EAAA;AACA,MAAA,OAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

let originalFunctionToString;

/** Patch toString calls to return proper name for wrapped functions */
class FunctionToString  {constructor() { FunctionToString.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'FunctionToString';}

  /**
   * @inheritDoc
   */
   __init() {this.name = FunctionToString.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    // eslint-disable-next-line @typescript-eslint/unbound-method
    originalFunctionToString = Function.prototype.toString;

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    Function.prototype.toString = function ( ...args) {
      const context = utils.getOriginalFunction(this) || this;
      return originalFunctionToString.apply(context, args);
    };
  }
} FunctionToString.__initStatic();

exports.FunctionToString = FunctionToString;
//# sourceMappingURL=functiontostring.js.map
{"version":3,"file":"functiontostring.js","sources":["../../../src/integrations/functiontostring.ts"],"sourcesContent":["import type { Integration, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'FunctionToString';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = FunctionToString.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    originalFunctionToString = Function.prototype.toString;\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n      const context = getOriginalFunction(this) || this;\n      return originalFunctionToString.apply(context, args);\n    };\n  }\n}\n"],"names":["getOriginalFunction"],"mappings":";;;;AAGA,IAAA,wBAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,EAAA,CAAA,WAAA,GAAA,EAAA,gBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,mBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,gBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA;AACA,IAAA,wBAAA,GAAA,QAAA,CAAA,SAAA,CAAA,QAAA,CAAA;AACA;AACA;AACA,IAAA,QAAA,CAAA,SAAA,CAAA,QAAA,GAAA,WAAA,GAAA,IAAA,EAAA;AACA,MAAA,MAAA,OAAA,GAAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,IAAA,CAAA;AACA,MAAA,OAAA,wBAAA,CAAA,KAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,gBAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

// "Script error." is hard coded into browsers for errors that it can't read.
// this is the result of a script being pulled in from an external domain and CORS.
const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];

/** Options for the InboundFilters integration */

/** Inbound filters configurable by the user */
class InboundFilters  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'InboundFilters';}

  /**
   * @inheritDoc
   */
   __init() {this.name = InboundFilters.id;}

   constructor(  _options = {}) {this._options = _options;InboundFilters.prototype.__init.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    const eventProcess = (event) => {
      const hub = getCurrentHub();
      if (hub) {
        const self = hub.getIntegration(InboundFilters);
        if (self) {
          const client = hub.getClient();
          const clientOptions = client ? client.getOptions() : {};
          const options = _mergeOptions(self._options, clientOptions);
          return _shouldDropEvent(event, options) ? null : event;
        }
      }
      return event;
    };

    eventProcess.id = this.name;
    addGlobalEventProcessor(eventProcess);
  }
} InboundFilters.__initStatic();

/** JSDoc */
function _mergeOptions(
  internalOptions = {},
  clientOptions = {},
) {
  return {
    allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],
    denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],
    ignoreErrors: [
      ...(internalOptions.ignoreErrors || []),
      ...(clientOptions.ignoreErrors || []),
      ...DEFAULT_IGNORE_ERRORS,
    ],
    ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],
    ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,
  };
}

/** JSDoc */
function _shouldDropEvent(event, options) {
  if (options.ignoreInternal && _isSentryError(event)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${utils.getEventDescription(event)}`);
    return true;
  }
  if (_isIgnoredError(event, options.ignoreErrors)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(
        `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${utils.getEventDescription(event)}`,
      );
    return true;
  }
  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(
        `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${utils.getEventDescription(event)}`,
      );
    return true;
  }
  if (_isDeniedUrl(event, options.denyUrls)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(
        `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${utils.getEventDescription(
          event,
        )}.\nUrl: ${_getEventFilterUrl(event)}`,
      );
    return true;
  }
  if (!_isAllowedUrl(event, options.allowUrls)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(
        `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${utils.getEventDescription(
          event,
        )}.\nUrl: ${_getEventFilterUrl(event)}`,
      );
    return true;
  }
  return false;
}

function _isIgnoredError(event, ignoreErrors) {
  // If event.type, this is not an error
  if (event.type || !ignoreErrors || !ignoreErrors.length) {
    return false;
  }

  return _getPossibleEventMessages(event).some(message => utils.stringMatchesSomePattern(message, ignoreErrors));
}

function _isIgnoredTransaction(event, ignoreTransactions) {
  if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {
    return false;
  }

  const name = event.transaction;
  return name ? utils.stringMatchesSomePattern(name, ignoreTransactions) : false;
}

function _isDeniedUrl(event, denyUrls) {
  // TODO: Use Glob instead?
  if (!denyUrls || !denyUrls.length) {
    return false;
  }
  const url = _getEventFilterUrl(event);
  return !url ? false : utils.stringMatchesSomePattern(url, denyUrls);
}

function _isAllowedUrl(event, allowUrls) {
  // TODO: Use Glob instead?
  if (!allowUrls || !allowUrls.length) {
    return true;
  }
  const url = _getEventFilterUrl(event);
  return !url ? true : utils.stringMatchesSomePattern(url, allowUrls);
}

function _getPossibleEventMessages(event) {
  if (event.message) {
    return [event.message];
  }
  if (event.exception) {
    try {
      const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};
      return [`${value}`, `${type}: ${value}`];
    } catch (oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(`Cannot extract message for event ${utils.getEventDescription(event)}`);
      return [];
    }
  }
  return [];
}

function _isSentryError(event) {
  try {
    // @ts-ignore can't be a sentry error if undefined
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    return event.exception.values[0].type === 'SentryError';
  } catch (e) {
    // ignore
  }
  return false;
}

function _getLastValidUrl(frames = []) {
  for (let i = frames.length - 1; i >= 0; i--) {
    const frame = frames[i];

    if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {
      return frame.filename || null;
    }
  }

  return null;
}

function _getEventFilterUrl(event) {
  try {
    let frames;
    try {
      // @ts-ignore we only care about frames if the whole thing here is defined
      frames = event.exception.values[0].stacktrace.frames;
    } catch (e) {
      // ignore
    }
    return frames ? _getLastValidUrl(frames) : null;
  } catch (oO) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(`Cannot extract url for event ${utils.getEventDescription(event)}`);
    return null;
  }
}

exports.InboundFilters = InboundFilters;
exports._mergeOptions = _mergeOptions;
exports._shouldDropEvent = _shouldDropEvent;
//# sourceMappingURL=inboundfilters.js.map
{"version":3,"file":"inboundfilters.js","sources":["../../../src/integrations/inboundfilters.ts"],"sourcesContent":["import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n  allowUrls: Array<string | RegExp>;\n  denyUrls: Array<string | RegExp>;\n  ignoreErrors: Array<string | RegExp>;\n  ignoreTransactions: Array<string | RegExp>;\n  ignoreInternal: boolean;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'InboundFilters';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = InboundFilters.id;\n\n  public constructor(private readonly _options: Partial<InboundFiltersOptions> = {}) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (processor: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const eventProcess: EventProcessor = (event: Event) => {\n      const hub = getCurrentHub();\n      if (hub) {\n        const self = hub.getIntegration(InboundFilters);\n        if (self) {\n          const client = hub.getClient();\n          const clientOptions = client ? client.getOptions() : {};\n          const options = _mergeOptions(self._options, clientOptions);\n          return _shouldDropEvent(event, options) ? null : event;\n        }\n      }\n      return event;\n    };\n\n    eventProcess.id = this.name;\n    addGlobalEventProcessor(eventProcess);\n  }\n}\n\n/** JSDoc */\nexport function _mergeOptions(\n  internalOptions: Partial<InboundFiltersOptions> = {},\n  clientOptions: Partial<InboundFiltersOptions> = {},\n): Partial<InboundFiltersOptions> {\n  return {\n    allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n    denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n    ignoreErrors: [\n      ...(internalOptions.ignoreErrors || []),\n      ...(clientOptions.ignoreErrors || []),\n      ...DEFAULT_IGNORE_ERRORS,\n    ],\n    ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],\n    ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n  };\n}\n\n/** JSDoc */\nexport function _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n  if (options.ignoreInternal && _isSentryError(event)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n    return true;\n  }\n  if (_isIgnoredError(event, options.ignoreErrors)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isDeniedUrl(event, options.denyUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  if (!_isAllowedUrl(event, options.allowUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array<string | RegExp>): boolean {\n  // If event.type, this is not an error\n  if (event.type || !ignoreErrors || !ignoreErrors.length) {\n    return false;\n  }\n\n  return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string | RegExp>): boolean {\n  if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n    return false;\n  }\n\n  const name = event.transaction;\n  return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!denyUrls || !denyUrls.length) {\n    return false;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!allowUrls || !allowUrls.length) {\n    return true;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n  if (event.message) {\n    return [event.message];\n  }\n  if (event.exception) {\n    try {\n      const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};\n      return [`${value}`, `${type}: ${value}`];\n    } catch (oO) {\n      __DEBUG_BUILD__ && logger.error(`Cannot extract message for event ${getEventDescription(event)}`);\n      return [];\n    }\n  }\n  return [];\n}\n\nfunction _isSentryError(event: Event): boolean {\n  try {\n    // @ts-ignore can't be a sentry error if undefined\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return event.exception.values[0].type === 'SentryError';\n  } catch (e) {\n    // ignore\n  }\n  return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n  for (let i = frames.length - 1; i >= 0; i--) {\n    const frame = frames[i];\n\n    if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {\n      return frame.filename || null;\n    }\n  }\n\n  return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n  try {\n    let frames;\n    try {\n      // @ts-ignore we only care about frames if the whole thing here is defined\n      frames = event.exception.values[0].stacktrace.frames;\n    } catch (e) {\n      // ignore\n    }\n    return frames ? _getLastValidUrl(frames) : null;\n  } catch (oO) {\n    __DEBUG_BUILD__ && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n    return null;\n  }\n}\n"],"names":["logger","getEventDescription","stringMatchesSomePattern"],"mappings":";;;;AAGA;AACA;AACA,MAAA,qBAAA,GAAA,CAAA,mBAAA,EAAA,+CAAA,CAAA,CAAA;AACA;AACA;;AASA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,cAAA,CAAA,GAAA,CAAA;AACA;AACA,GAAA,WAAA,GAAA,QAAA,GAAA,EAAA,EAAA,CAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA,aAAA,EAAA;AACA,IAAA,MA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AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,KAAA;AACA,IAAA,OAAA,MAAA,GAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,EAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAD,YAAA,CAAA,KAAA,CAAA,CAAA,6BAAA,EAAAC,yBAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const functiontostring = require('./functiontostring.js');
const inboundfilters = require('./inboundfilters.js');



exports.FunctionToString = functiontostring.FunctionToString;
exports.InboundFilters = inboundfilters.InboundFilters;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const session = require('./session.js');

/**
 * Default value for maximum number of breadcrumbs added to an event.
 */
const DEFAULT_MAX_BREADCRUMBS = 100;

/**
 * Holds additional event information. {@link Scope.applyToEvent} will be
 * called by the client before an event will be sent.
 */
class Scope  {
  /** Flag if notifying is happening. */

  /** Callback for client to receive scope changes. */

  /** Callback list that will be called after {@link applyToEvent}. */

  /** Array of breadcrumbs. */

  /** User */

  /** Tags */

  /** Extra */

  /** Contexts */

  /** Attachments */

  /**
   * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
   * sent to Sentry
   */

  /** Fingerprint */

  /** Severity */
  // eslint-disable-next-line deprecation/deprecation

  /** Transaction Name */

  /** Span */

  /** Session */

  /** Request Mode Session Status */

  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.

   constructor() {
    this._notifyingListeners = false;
    this._scopeListeners = [];
    this._eventProcessors = [];
    this._breadcrumbs = [];
    this._attachments = [];
    this._user = {};
    this._tags = {};
    this._extra = {};
    this._contexts = {};
    this._sdkProcessingMetadata = {};
  }

  /**
   * Inherit values from the parent scope.
   * @param scope to clone.
   */
   static clone(scope) {
    const newScope = new Scope();
    if (scope) {
      newScope._breadcrumbs = [...scope._breadcrumbs];
      newScope._tags = { ...scope._tags };
      newScope._extra = { ...scope._extra };
      newScope._contexts = { ...scope._contexts };
      newScope._user = scope._user;
      newScope._level = scope._level;
      newScope._span = scope._span;
      newScope._session = scope._session;
      newScope._transactionName = scope._transactionName;
      newScope._fingerprint = scope._fingerprint;
      newScope._eventProcessors = [...scope._eventProcessors];
      newScope._requestSession = scope._requestSession;
      newScope._attachments = [...scope._attachments];
      newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };
    }
    return newScope;
  }

  /**
   * Add internal on change listener. Used for sub SDKs that need to store the scope.
   * @hidden
   */
   addScopeListener(callback) {
    this._scopeListeners.push(callback);
  }

  /**
   * @inheritDoc
   */
   addEventProcessor(callback) {
    this._eventProcessors.push(callback);
    return this;
  }

  /**
   * @inheritDoc
   */
   setUser(user) {
    this._user = user || {};
    if (this._session) {
      session.updateSession(this._session, { user });
    }
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getUser() {
    return this._user;
  }

  /**
   * @inheritDoc
   */
   getRequestSession() {
    return this._requestSession;
  }

  /**
   * @inheritDoc
   */
   setRequestSession(requestSession) {
    this._requestSession = requestSession;
    return this;
  }

  /**
   * @inheritDoc
   */
   setTags(tags) {
    this._tags = {
      ...this._tags,
      ...tags,
    };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this._tags = { ...this._tags, [key]: value };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setExtras(extras) {
    this._extra = {
      ...this._extra,
      ...extras,
    };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setExtra(key, extra) {
    this._extra = { ...this._extra, [key]: extra };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setFingerprint(fingerprint) {
    this._fingerprint = fingerprint;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setLevel(
    // eslint-disable-next-line deprecation/deprecation
    level,
  ) {
    this._level = level;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setTransactionName(name) {
    this._transactionName = name;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setContext(key, context) {
    if (context === null) {
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this._contexts[key];
    } else {
      this._contexts[key] = context;
    }

    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setSpan(span) {
    this._span = span;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getSpan() {
    return this._span;
  }

  /**
   * @inheritDoc
   */
   getTransaction() {
    // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will
    // have a pointer to the currently-active transaction.
    const span = this.getSpan();
    return span && span.transaction;
  }

  /**
   * @inheritDoc
   */
   setSession(session) {
    if (!session) {
      delete this._session;
    } else {
      this._session = session;
    }
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getSession() {
    return this._session;
  }

  /**
   * @inheritDoc
   */
   update(captureContext) {
    if (!captureContext) {
      return this;
    }

    if (typeof captureContext === 'function') {
      const updatedScope = (captureContext )(this);
      return updatedScope instanceof Scope ? updatedScope : this;
    }

    if (captureContext instanceof Scope) {
      this._tags = { ...this._tags, ...captureContext._tags };
      this._extra = { ...this._extra, ...captureContext._extra };
      this._contexts = { ...this._contexts, ...captureContext._contexts };
      if (captureContext._user && Object.keys(captureContext._user).length) {
        this._user = captureContext._user;
      }
      if (captureContext._level) {
        this._level = captureContext._level;
      }
      if (captureContext._fingerprint) {
        this._fingerprint = captureContext._fingerprint;
      }
      if (captureContext._requestSession) {
        this._requestSession = captureContext._requestSession;
      }
    } else if (utils.isPlainObject(captureContext)) {
      // eslint-disable-next-line no-param-reassign
      captureContext = captureContext ;
      this._tags = { ...this._tags, ...captureContext.tags };
      this._extra = { ...this._extra, ...captureContext.extra };
      this._contexts = { ...this._contexts, ...captureContext.contexts };
      if (captureContext.user) {
        this._user = captureContext.user;
      }
      if (captureContext.level) {
        this._level = captureContext.level;
      }
      if (captureContext.fingerprint) {
        this._fingerprint = captureContext.fingerprint;
      }
      if (captureContext.requestSession) {
        this._requestSession = captureContext.requestSession;
      }
    }

    return this;
  }

  /**
   * @inheritDoc
   */
   clear() {
    this._breadcrumbs = [];
    this._tags = {};
    this._extra = {};
    this._user = {};
    this._contexts = {};
    this._level = undefined;
    this._transactionName = undefined;
    this._fingerprint = undefined;
    this._requestSession = undefined;
    this._span = undefined;
    this._session = undefined;
    this._notifyScopeListeners();
    this._attachments = [];
    return this;
  }

  /**
   * @inheritDoc
   */
   addBreadcrumb(breadcrumb, maxBreadcrumbs) {
    const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;

    // No data has been changed, so don't notify scope listeners
    if (maxCrumbs <= 0) {
      return this;
    }

    const mergedBreadcrumb = {
      timestamp: utils.dateTimestampInSeconds(),
      ...breadcrumb,
    };
    this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs);
    this._notifyScopeListeners();

    return this;
  }

  /**
   * @inheritDoc
   */
   getLastBreadcrumb() {
    return this._breadcrumbs[this._breadcrumbs.length - 1];
  }

  /**
   * @inheritDoc
   */
   clearBreadcrumbs() {
    this._breadcrumbs = [];
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   addAttachment(attachment) {
    this._attachments.push(attachment);
    return this;
  }

  /**
   * @inheritDoc
   */
   getAttachments() {
    return this._attachments;
  }

  /**
   * @inheritDoc
   */
   clearAttachments() {
    this._attachments = [];
    return this;
  }

  /**
   * Applies data from the scope to the event and runs all event processors on it.
   *
   * @param event Event
   * @param hint Object containing additional information about the original exception, for use by the event processors.
   * @hidden
   */
   applyToEvent(event, hint = {}) {
    if (this._extra && Object.keys(this._extra).length) {
      event.extra = { ...this._extra, ...event.extra };
    }
    if (this._tags && Object.keys(this._tags).length) {
      event.tags = { ...this._tags, ...event.tags };
    }
    if (this._user && Object.keys(this._user).length) {
      event.user = { ...this._user, ...event.user };
    }
    if (this._contexts && Object.keys(this._contexts).length) {
      event.contexts = { ...this._contexts, ...event.contexts };
    }
    if (this._level) {
      event.level = this._level;
    }
    if (this._transactionName) {
      event.transaction = this._transactionName;
    }

    // We want to set the trace context for normal events only if there isn't already
    // a trace context on the event. There is a product feature in place where we link
    // errors with transaction and it relies on that.
    if (this._span) {
      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };
      const transaction = this._span.transaction;
      if (transaction) {
        event.sdkProcessingMetadata = {
          dynamicSamplingContext: transaction.getDynamicSamplingContext(),
          ...event.sdkProcessingMetadata,
        };
        const transactionName = transaction.name;
        if (transactionName) {
          event.tags = { transaction: transactionName, ...event.tags };
        }
      }
    }

    this._applyFingerprint(event);

    event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];
    event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;

    event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata };

    return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);
  }

  /**
   * Add data which will be accessible during event processing but won't get sent to Sentry
   */
   setSDKProcessingMetadata(newData) {
    this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };

    return this;
  }

  /**
   * This will be called after {@link applyToEvent} is finished.
   */
   _notifyEventProcessors(
    processors,
    event,
    hint,
    index = 0,
  ) {
    return new utils.SyncPromise((resolve, reject) => {
      const processor = processors[index];
      if (event === null || typeof processor !== 'function') {
        resolve(event);
      } else {
        const result = processor({ ...event }, hint) ;

        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          processor.id &&
          result === null &&
          utils.logger.log(`Event processor "${processor.id}" dropped event`);

        if (utils.isThenable(result)) {
          void result
            .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))
            .then(null, reject);
        } else {
          void this._notifyEventProcessors(processors, result, hint, index + 1)
            .then(resolve)
            .then(null, reject);
        }
      }
    });
  }

  /**
   * This will be called on every set call.
   */
   _notifyScopeListeners() {
    // We need this check for this._notifyingListeners to be able to work on scope during updates
    // If this check is not here we'll produce endless recursion when something is done with the scope
    // during the callback.
    if (!this._notifyingListeners) {
      this._notifyingListeners = true;
      this._scopeListeners.forEach(callback => {
        callback(this);
      });
      this._notifyingListeners = false;
    }
  }

  /**
   * Applies fingerprint from the scope to the event if there's one,
   * uses message if there's one instead or get rid of empty fingerprint
   */
   _applyFingerprint(event) {
    // Make sure it's an array first and we actually have something in place
    event.fingerprint = event.fingerprint ? utils.arrayify(event.fingerprint) : [];

    // If we have something on the scope, then merge it with event
    if (this._fingerprint) {
      event.fingerprint = event.fingerprint.concat(this._fingerprint);
    }

    // If we have no data at all, remove empty array default
    if (event.fingerprint && !event.fingerprint.length) {
      delete event.fingerprint;
    }
  }
}

/**
 * Returns the global event processors.
 */
function getGlobalEventProcessors() {
  return utils.getGlobalSingleton('globalEventProcessors', () => []);
}

/**
 * Add a EventProcessor to be kept globally.
 * @param callback EventProcessor to add
 */
function addGlobalEventProcessor(callback) {
  getGlobalEventProcessors().push(callback);
}

exports.Scope = Scope;
exports.addGlobalEventProcessor = addGlobalEventProcessor;
//# sourceMappingURL=scope.js.map
{"version":3,"file":"scope.js","sources":["../../src/scope.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Attachment,\n  Breadcrumb,\n  CaptureContext,\n  Context,\n  Contexts,\n  Event,\n  EventHint,\n  EventProcessor,\n  Extra,\n  Extras,\n  Primitive,\n  RequestSession,\n  Scope as ScopeInterface,\n  ScopeContext,\n  Session,\n  Severity,\n  SeverityLevel,\n  Span,\n  Transaction,\n  User,\n} from '@sentry/types';\nimport {\n  arrayify,\n  dateTimestampInSeconds,\n  getGlobalSingleton,\n  isPlainObject,\n  isThenable,\n  logger,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { updateSession } from './session';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n  /** Flag if notifying is happening. */\n  protected _notifyingListeners: boolean;\n\n  /** Callback for client to receive scope changes. */\n  protected _scopeListeners: Array<(scope: Scope) => void>;\n\n  /** Callback list that will be called after {@link applyToEvent}. */\n  protected _eventProcessors: EventProcessor[];\n\n  /** Array of breadcrumbs. */\n  protected _breadcrumbs: Breadcrumb[];\n\n  /** User */\n  protected _user: User;\n\n  /** Tags */\n  protected _tags: { [key: string]: Primitive };\n\n  /** Extra */\n  protected _extra: Extras;\n\n  /** Contexts */\n  protected _contexts: Contexts;\n\n  /** Attachments */\n  protected _attachments: Attachment[];\n\n  /**\n   * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n   * sent to Sentry\n   */\n  protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n  /** Fingerprint */\n  protected _fingerprint?: string[];\n\n  /** Severity */\n  // eslint-disable-next-line deprecation/deprecation\n  protected _level?: Severity | SeverityLevel;\n\n  /** Transaction Name */\n  protected _transactionName?: string;\n\n  /** Span */\n  protected _span?: Span;\n\n  /** Session */\n  protected _session?: Session;\n\n  /** Request Mode Session Status */\n  protected _requestSession?: RequestSession;\n\n  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n  public constructor() {\n    this._notifyingListeners = false;\n    this._scopeListeners = [];\n    this._eventProcessors = [];\n    this._breadcrumbs = [];\n    this._attachments = [];\n    this._user = {};\n    this._tags = {};\n    this._extra = {};\n    this._contexts = {};\n    this._sdkProcessingMetadata = {};\n  }\n\n  /**\n   * Inherit values from the parent scope.\n   * @param scope to clone.\n   */\n  public static clone(scope?: Scope): Scope {\n    const newScope = new Scope();\n    if (scope) {\n      newScope._breadcrumbs = [...scope._breadcrumbs];\n      newScope._tags = { ...scope._tags };\n      newScope._extra = { ...scope._extra };\n      newScope._contexts = { ...scope._contexts };\n      newScope._user = scope._user;\n      newScope._level = scope._level;\n      newScope._span = scope._span;\n      newScope._session = scope._session;\n      newScope._transactionName = scope._transactionName;\n      newScope._fingerprint = scope._fingerprint;\n      newScope._eventProcessors = [...scope._eventProcessors];\n      newScope._requestSession = scope._requestSession;\n      newScope._attachments = [...scope._attachments];\n      newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };\n    }\n    return newScope;\n  }\n\n  /**\n   * Add internal on change listener. Used for sub SDKs that need to store the scope.\n   * @hidden\n   */\n  public addScopeListener(callback: (scope: Scope) => void): void {\n    this._scopeListeners.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addEventProcessor(callback: EventProcessor): this {\n    this._eventProcessors.push(callback);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): this {\n    this._user = user || {};\n    if (this._session) {\n      updateSession(this._session, { user });\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getUser(): User | undefined {\n    return this._user;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getRequestSession(): RequestSession | undefined {\n    return this._requestSession;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setRequestSession(requestSession?: RequestSession): this {\n    this._requestSession = requestSession;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): this {\n    this._tags = {\n      ...this._tags,\n      ...tags,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this._tags = { ...this._tags, [key]: value };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): this {\n    this._extra = {\n      ...this._extra,\n      ...extras,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): this {\n    this._extra = { ...this._extra, [key]: extra };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setFingerprint(fingerprint: string[]): this {\n    this._fingerprint = fingerprint;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setLevel(\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel,\n  ): this {\n    this._level = level;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTransactionName(name?: string): this {\n    this._transactionName = name;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): this {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSpan(span?: Span): this {\n    this._span = span;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSpan(): Span | undefined {\n    return this._span;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransaction(): Transaction | undefined {\n    // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n    // have a pointer to the currently-active transaction.\n    const span = this.getSpan();\n    return span && span.transaction;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSession(session?: Session): this {\n    if (!session) {\n      delete this._session;\n    } else {\n      this._session = session;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSession(): Session | undefined {\n    return this._session;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public update(captureContext?: CaptureContext): this {\n    if (!captureContext) {\n      return this;\n    }\n\n    if (typeof captureContext === 'function') {\n      const updatedScope = (captureContext as <T>(scope: T) => T)(this);\n      return updatedScope instanceof Scope ? updatedScope : this;\n    }\n\n    if (captureContext instanceof Scope) {\n      this._tags = { ...this._tags, ...captureContext._tags };\n      this._extra = { ...this._extra, ...captureContext._extra };\n      this._contexts = { ...this._contexts, ...captureContext._contexts };\n      if (captureContext._user && Object.keys(captureContext._user).length) {\n        this._user = captureContext._user;\n      }\n      if (captureContext._level) {\n        this._level = captureContext._level;\n      }\n      if (captureContext._fingerprint) {\n        this._fingerprint = captureContext._fingerprint;\n      }\n      if (captureContext._requestSession) {\n        this._requestSession = captureContext._requestSession;\n      }\n    } else if (isPlainObject(captureContext)) {\n      // eslint-disable-next-line no-param-reassign\n      captureContext = captureContext as ScopeContext;\n      this._tags = { ...this._tags, ...captureContext.tags };\n      this._extra = { ...this._extra, ...captureContext.extra };\n      this._contexts = { ...this._contexts, ...captureContext.contexts };\n      if (captureContext.user) {\n        this._user = captureContext.user;\n      }\n      if (captureContext.level) {\n        this._level = captureContext.level;\n      }\n      if (captureContext.fingerprint) {\n        this._fingerprint = captureContext.fingerprint;\n      }\n      if (captureContext.requestSession) {\n        this._requestSession = captureContext.requestSession;\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clear(): this {\n    this._breadcrumbs = [];\n    this._tags = {};\n    this._extra = {};\n    this._user = {};\n    this._contexts = {};\n    this._level = undefined;\n    this._transactionName = undefined;\n    this._fingerprint = undefined;\n    this._requestSession = undefined;\n    this._span = undefined;\n    this._session = undefined;\n    this._notifyScopeListeners();\n    this._attachments = [];\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n    const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n    // No data has been changed, so don't notify scope listeners\n    if (maxCrumbs <= 0) {\n      return this;\n    }\n\n    const mergedBreadcrumb = {\n      timestamp: dateTimestampInSeconds(),\n      ...breadcrumb,\n    };\n    this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs);\n    this._notifyScopeListeners();\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getLastBreadcrumb(): Breadcrumb | undefined {\n    return this._breadcrumbs[this._breadcrumbs.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearBreadcrumbs(): this {\n    this._breadcrumbs = [];\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addAttachment(attachment: Attachment): this {\n    this._attachments.push(attachment);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getAttachments(): Attachment[] {\n    return this._attachments;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearAttachments(): this {\n    this._attachments = [];\n    return this;\n  }\n\n  /**\n   * Applies data from the scope to the event and runs all event processors on it.\n   *\n   * @param event Event\n   * @param hint Object containing additional information about the original exception, for use by the event processors.\n   * @hidden\n   */\n  public applyToEvent(event: Event, hint: EventHint = {}): PromiseLike<Event | null> {\n    if (this._extra && Object.keys(this._extra).length) {\n      event.extra = { ...this._extra, ...event.extra };\n    }\n    if (this._tags && Object.keys(this._tags).length) {\n      event.tags = { ...this._tags, ...event.tags };\n    }\n    if (this._user && Object.keys(this._user).length) {\n      event.user = { ...this._user, ...event.user };\n    }\n    if (this._contexts && Object.keys(this._contexts).length) {\n      event.contexts = { ...this._contexts, ...event.contexts };\n    }\n    if (this._level) {\n      event.level = this._level;\n    }\n    if (this._transactionName) {\n      event.transaction = this._transactionName;\n    }\n\n    // We want to set the trace context for normal events only if there isn't already\n    // a trace context on the event. There is a product feature in place where we link\n    // errors with transaction and it relies on that.\n    if (this._span) {\n      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n      const transaction = this._span.transaction;\n      if (transaction) {\n        event.sdkProcessingMetadata = {\n          dynamicSamplingContext: transaction.getDynamicSamplingContext(),\n          ...event.sdkProcessingMetadata,\n        };\n        const transactionName = transaction.name;\n        if (transactionName) {\n          event.tags = { transaction: transactionName, ...event.tags };\n        }\n      }\n    }\n\n    this._applyFingerprint(event);\n\n    event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];\n    event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n\n    event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata };\n\n    return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);\n  }\n\n  /**\n   * Add data which will be accessible during event processing but won't get sent to Sentry\n   */\n  public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n    this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n    return this;\n  }\n\n  /**\n   * This will be called after {@link applyToEvent} is finished.\n   */\n  protected _notifyEventProcessors(\n    processors: EventProcessor[],\n    event: Event | null,\n    hint: EventHint,\n    index: number = 0,\n  ): PromiseLike<Event | null> {\n    return new SyncPromise<Event | null>((resolve, reject) => {\n      const processor = processors[index];\n      if (event === null || typeof processor !== 'function') {\n        resolve(event);\n      } else {\n        const result = processor({ ...event }, hint) as Event | null;\n\n        __DEBUG_BUILD__ &&\n          processor.id &&\n          result === null &&\n          logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n        if (isThenable(result)) {\n          void result\n            .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n            .then(null, reject);\n        } else {\n          void this._notifyEventProcessors(processors, result, hint, index + 1)\n            .then(resolve)\n            .then(null, reject);\n        }\n      }\n    });\n  }\n\n  /**\n   * This will be called on every set call.\n   */\n  protected _notifyScopeListeners(): void {\n    // We need this check for this._notifyingListeners to be able to work on scope during updates\n    // If this check is not here we'll produce endless recursion when something is done with the scope\n    // during the callback.\n    if (!this._notifyingListeners) {\n      this._notifyingListeners = true;\n      this._scopeListeners.forEach(callback => {\n        callback(this);\n      });\n      this._notifyingListeners = false;\n    }\n  }\n\n  /**\n   * Applies fingerprint from the scope to the event if there's one,\n   * uses message if there's one instead or get rid of empty fingerprint\n   */\n  private _applyFingerprint(event: Event): void {\n    // Make sure it's an array first and we actually have something in place\n    event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n    // If we have something on the scope, then merge it with event\n    if (this._fingerprint) {\n      event.fingerprint = event.fingerprint.concat(this._fingerprint);\n    }\n\n    // If we have no data at all, remove empty array default\n    if (event.fingerprint && !event.fingerprint.length) {\n      delete event.fingerprint;\n    }\n  }\n}\n\n/**\n * Returns the global event processors.\n */\nfunction getGlobalEventProcessors(): EventProcessor[] {\n  return getGlobalSingleton<EventProcessor[]>('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n  getGlobalEventProcessors().push(callback);\n}\n"],"names":["updateSession","isPlainObject","dateTimestampInSeconds","SyncPromise","logger","isThenable","arrayify","getGlobalSingleton"],"mappings":";;;;;AAmCA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,EAAA;AACA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;AACA;AACA;AACA;;AAGA;;AAGA;AACA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;AACA;AACA,GAAA,WAAA,GAAA;AACA,IAAA,IAAA,CAAA,mBAAA,GAAA,KAAA,CAAA;AACA,IAAA,IAAA,CAAA,eAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,gBAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,EAAA,CAAA;AACA,IAAA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A,GAAAC,cAAA,CAAA,KAAA,CAAA,WAAA,CAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,YAAA,EAAA;AACA,MAAA,KAAA,CAAA,WAAA,GAAA,KAAA,CAAA,WAAA,CAAA,MAAA,CAAA,IAAA,CAAA,YAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAA,KAAA,CAAA,WAAA,IAAA,CAAA,KAAA,CAAA,WAAA,CAAA,MAAA,EAAA;AACA,MAAA,OAAA,KAAA,CAAA,WAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,GAAA;AACA,EAAA,OAAAC,wBAAA,CAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,QAAA,EAAA;AACA,EAAA,wBAAA,EAAA,CAAA,IAAA,CAAA,QAAA,CAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const hub = require('./hub.js');

/** A class object that can instantiate Client objects. */

/**
 * Internal function to create a new SDK client instance. The client is
 * installed and then bound to the current scope.
 *
 * @param clientClass The client class to instantiate.
 * @param options Options to pass to the client.
 */
function initAndBind(
  clientClass,
  options,
) {
  if (options.debug === true) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      utils.logger.enable();
    } else {
      // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
      // eslint-disable-next-line no-console
      console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
    }
  }
  const hub$1 = hub.getCurrentHub();
  const scope = hub$1.getScope();
  scope.update(options.initialScope);

  const client = new clientClass(options);
  hub$1.bindClient(client);
}

exports.initAndBind = initAndBind;
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Client, ClientOptions } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends ClientOptions>(\n  clientClass: ClientClass<F, O>,\n  options: O,\n): void {\n  if (options.debug === true) {\n    if (__DEBUG_BUILD__) {\n      logger.enable();\n    } else {\n      // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n      // eslint-disable-next-line no-console\n      console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n    }\n  }\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  scope.update(options.initialScope);\n\n  const client = new clientClass(options);\n  hub.bindClient(client);\n}\n"],"names":["logger","hub","getCurrentHub"],"mappings":";;;;;AAKA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA;AACA,EAAA,WAAA;AACA,EAAA,OAAA;AACA,EAAA;AACA,EAAA,IAAA,OAAA,CAAA,KAAA,KAAA,IAAA,EAAA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAAA,YAAA,CAAA,MAAA,EAAA,CAAA;AACA,KAAA,MAAA;AACA;AACA;AACA,MAAA,OAAA,CAAA,IAAA,CAAA,8EAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,MAAAC,KAAA,GAAAC,iBAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAAD,KAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,KAAA,CAAA,MAAA,CAAA,OAAA,CAAA,YAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,IAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAAA,KAAA,CAAA,UAAA,CAAA,MAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

/**
 * Creates a new `Session` object by setting certain default parameters. If optional @param context
 * is passed, the passed properties are applied to the session object.
 *
 * @param context (optional) additional properties to be applied to the returned session object
 *
 * @returns a new `Session` object
 */
function makeSession(context) {
  // Both timestamp and started are in seconds since the UNIX epoch.
  const startingTime = utils.timestampInSeconds();

  const session = {
    sid: utils.uuid4(),
    init: true,
    timestamp: startingTime,
    started: startingTime,
    duration: 0,
    status: 'ok',
    errors: 0,
    ignoreDuration: false,
    toJSON: () => sessionToJSON(session),
  };

  if (context) {
    updateSession(session, context);
  }

  return session;
}

/**
 * Updates a session object with the properties passed in the context.
 *
 * Note that this function mutates the passed object and returns void.
 * (Had to do this instead of returning a new and updated session because closing and sending a session
 * makes an update to the session after it was passed to the sending logic.
 * @see BaseClient.captureSession )
 *
 * @param session the `Session` to update
 * @param context the `SessionContext` holding the properties that should be updated in @param session
 */
// eslint-disable-next-line complexity
function updateSession(session, context = {}) {
  if (context.user) {
    if (!session.ipAddress && context.user.ip_address) {
      session.ipAddress = context.user.ip_address;
    }

    if (!session.did && !context.did) {
      session.did = context.user.id || context.user.email || context.user.username;
    }
  }

  session.timestamp = context.timestamp || utils.timestampInSeconds();

  if (context.ignoreDuration) {
    session.ignoreDuration = context.ignoreDuration;
  }
  if (context.sid) {
    // Good enough uuid validation. — Kamil
    session.sid = context.sid.length === 32 ? context.sid : utils.uuid4();
  }
  if (context.init !== undefined) {
    session.init = context.init;
  }
  if (!session.did && context.did) {
    session.did = `${context.did}`;
  }
  if (typeof context.started === 'number') {
    session.started = context.started;
  }
  if (session.ignoreDuration) {
    session.duration = undefined;
  } else if (typeof context.duration === 'number') {
    session.duration = context.duration;
  } else {
    const duration = session.timestamp - session.started;
    session.duration = duration >= 0 ? duration : 0;
  }
  if (context.release) {
    session.release = context.release;
  }
  if (context.environment) {
    session.environment = context.environment;
  }
  if (!session.ipAddress && context.ipAddress) {
    session.ipAddress = context.ipAddress;
  }
  if (!session.userAgent && context.userAgent) {
    session.userAgent = context.userAgent;
  }
  if (typeof context.errors === 'number') {
    session.errors = context.errors;
  }
  if (context.status) {
    session.status = context.status;
  }
}

/**
 * Closes a session by setting its status and updating the session object with it.
 * Internally calls `updateSession` to update the passed session object.
 *
 * Note that this function mutates the passed session (@see updateSession for explanation).
 *
 * @param session the `Session` object to be closed
 * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,
 *               this function will keep the previously set status, unless it was `'ok'` in which case
 *               it is changed to `'exited'`.
 */
function closeSession(session, status) {
  let context = {};
  if (status) {
    context = { status };
  } else if (session.status === 'ok') {
    context = { status: 'exited' };
  }

  updateSession(session, context);
}

/**
 * Serializes a passed session object to a JSON object with a slightly different structure.
 * This is necessary because the Sentry backend requires a slightly different schema of a session
 * than the one the JS SDKs use internally.
 *
 * @param session the session to be converted
 *
 * @returns a JSON object of the passed session
 */
function sessionToJSON(session) {
  return utils.dropUndefinedKeys({
    sid: `${session.sid}`,
    init: session.init,
    // Make sure that sec is converted to ms for date constructor
    started: new Date(session.started * 1000).toISOString(),
    timestamp: new Date(session.timestamp * 1000).toISOString(),
    status: session.status,
    errors: session.errors,
    did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,
    duration: session.duration,
    attrs: {
      release: session.release,
      environment: session.environment,
      ip_address: session.ipAddress,
      user_agent: session.userAgent,
    },
  });
}

exports.closeSession = closeSession;
exports.makeSession = makeSession;
exports.updateSession = updateSession;
//# sourceMappingURL=session.js.map
{"version":3,"file":"session.js","sources":["../../src/session.ts"],"sourcesContent":["import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session {\n  // Both timestamp and started are in seconds since the UNIX epoch.\n  const startingTime = timestampInSeconds();\n\n  const session: Session = {\n    sid: uuid4(),\n    init: true,\n    timestamp: startingTime,\n    started: startingTime,\n    duration: 0,\n    status: 'ok',\n    errors: 0,\n    ignoreDuration: false,\n    toJSON: () => sessionToJSON(session),\n  };\n\n  if (context) {\n    updateSession(session, context);\n  }\n\n  return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n  if (context.user) {\n    if (!session.ipAddress && context.user.ip_address) {\n      session.ipAddress = context.user.ip_address;\n    }\n\n    if (!session.did && !context.did) {\n      session.did = context.user.id || context.user.email || context.user.username;\n    }\n  }\n\n  session.timestamp = context.timestamp || timestampInSeconds();\n\n  if (context.ignoreDuration) {\n    session.ignoreDuration = context.ignoreDuration;\n  }\n  if (context.sid) {\n    // Good enough uuid validation. — Kamil\n    session.sid = context.sid.length === 32 ? context.sid : uuid4();\n  }\n  if (context.init !== undefined) {\n    session.init = context.init;\n  }\n  if (!session.did && context.did) {\n    session.did = `${context.did}`;\n  }\n  if (typeof context.started === 'number') {\n    session.started = context.started;\n  }\n  if (session.ignoreDuration) {\n    session.duration = undefined;\n  } else if (typeof context.duration === 'number') {\n    session.duration = context.duration;\n  } else {\n    const duration = session.timestamp - session.started;\n    session.duration = duration >= 0 ? duration : 0;\n  }\n  if (context.release) {\n    session.release = context.release;\n  }\n  if (context.environment) {\n    session.environment = context.environment;\n  }\n  if (!session.ipAddress && context.ipAddress) {\n    session.ipAddress = context.ipAddress;\n  }\n  if (!session.userAgent && context.userAgent) {\n    session.userAgent = context.userAgent;\n  }\n  if (typeof context.errors === 'number') {\n    session.errors = context.errors;\n  }\n  if (context.status) {\n    session.status = context.status;\n  }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n *               this function will keep the previously set status, unless it was `'ok'` in which case\n *               it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {\n  let context = {};\n  if (status) {\n    context = { status };\n  } else if (session.status === 'ok') {\n    context = { status: 'exited' };\n  }\n\n  updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n  return dropUndefinedKeys({\n    sid: `${session.sid}`,\n    init: session.init,\n    // Make sure that sec is converted to ms for date constructor\n    started: new Date(session.started * 1000).toISOString(),\n    timestamp: new Date(session.timestamp * 1000).toISOString(),\n    status: session.status,\n    errors: session.errors,\n    did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n    duration: session.duration,\n    attrs: {\n      release: session.release,\n      environment: session.environment,\n      ip_address: session.ipAddress,\n      user_agent: session.userAgent,\n    },\n  });\n}\n"],"names":["timestampInSeconds","uuid4","dropUndefinedKeys"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,OAAA,EAAA;AACA;AACA,EAAA,MAAA,YAAA,GAAAA,wBAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA;AACA,IAAA,GAAA,EAAAC,WAAA,EAAA;AACA,IAAA,IA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AA,CAAA,OAAA,CAAA,SAAA,GAAA,IAAA,CAAA,CAAA,WAAA,EAAA;AACA,IAAA,MAAA,EAAA,OAAA,CAAA,MAAA;AACA,IAAA,MAAA,EAAA,OAAA,CAAA,MAAA;AACA,IAAA,GAAA,EAAA,OAAA,OAAA,CAAA,GAAA,KAAA,QAAA,IAAA,OAAA,OAAA,CAAA,GAAA,KAAA,QAAA,GAAA,CAAA,EAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AACA,IAAA,QAAA,EAAA,OAAA,CAAA,QAAA;AACA,IAAA,KAAA,EAAA;AACA,MAAA,OAAA,EAAA,OAAA,CAAA,OAAA;AACA,MAAA,WAAA,EAAA,OAAA,CAAA,WAAA;AACA,MAAA,UAAA,EAAA,OAAA,CAAA,SAAA;AACA,MAAA,UAAA,EAAA,OAAA,CAAA,SAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const hub = require('./hub.js');

/**
 * @inheritdoc
 */
class SessionFlusher  {
    __init() {this.flushTimeout = 60;}
   __init2() {this._pendingAggregates = {};}

   __init3() {this._isEnabled = true;}

   constructor(client, attrs) {SessionFlusher.prototype.__init.call(this);SessionFlusher.prototype.__init2.call(this);SessionFlusher.prototype.__init3.call(this);
    this._client = client;
    // Call to setInterval, so that flush is called every 60 seconds
    this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000);
    this._sessionAttrs = attrs;
  }

  /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */
   flush() {
    const sessionAggregates = this.getSessionAggregates();
    if (sessionAggregates.aggregates.length === 0) {
      return;
    }
    this._pendingAggregates = {};
    this._client.sendSession(sessionAggregates);
  }

  /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
   getSessionAggregates() {
    const aggregates = Object.keys(this._pendingAggregates).map((key) => {
      return this._pendingAggregates[parseInt(key)];
    });

    const sessionAggregates = {
      attrs: this._sessionAttrs,
      aggregates,
    };
    return utils.dropUndefinedKeys(sessionAggregates);
  }

  /** JSDoc */
   close() {
    clearInterval(this._intervalId);
    this._isEnabled = false;
    this.flush();
  }

  /**
   * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
   * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
   * `_incrementSessionStatusCount` along with the start date
   */
   incrementSessionStatusCount() {
    if (!this._isEnabled) {
      return;
    }
    const scope = hub.getCurrentHub().getScope();
    const requestSession = scope.getRequestSession();

    if (requestSession && requestSession.status) {
      this._incrementSessionStatusCount(requestSession.status, new Date());
      // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in
      // case captureRequestSession is called more than once to prevent double count
      scope.setRequestSession(undefined);
      /* eslint-enable @typescript-eslint/no-unsafe-member-access */
    }
  }

  /**
   * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
   * the session received
   */
   _incrementSessionStatusCount(status, date) {
    // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys
    const sessionStartedTrunc = new Date(date).setSeconds(0, 0);
    this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};

    // corresponds to aggregated sessions in one specific minute bucket
    // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1}
    const aggregationCounts = this._pendingAggregates[sessionStartedTrunc];
    if (!aggregationCounts.started) {
      aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();
    }

    switch (status) {
      case 'errored':
        aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;
        return aggregationCounts.errored;
      case 'ok':
        aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;
        return aggregationCounts.exited;
      default:
        aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;
        return aggregationCounts.crashed;
    }
  }
}

exports.SessionFlusher = SessionFlusher;
//# sourceMappingURL=sessionflusher.js.map
{"version":3,"file":"sessionflusher.js","sources":["../../src/sessionflusher.ts"],"sourcesContent":["import type {\n  AggregationCounts,\n  Client,\n  RequestSessionStatus,\n  SessionAggregates,\n  SessionFlusherLike,\n} from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\n\ntype ReleaseHealthAttributes = {\n  environment?: string;\n  release: string;\n};\n\n/**\n * @inheritdoc\n */\nexport class SessionFlusher implements SessionFlusherLike {\n  public readonly flushTimeout: number = 60;\n  private _pendingAggregates: Record<number, AggregationCounts> = {};\n  private _sessionAttrs: ReleaseHealthAttributes;\n  private _intervalId: ReturnType<typeof setInterval>;\n  private _isEnabled: boolean = true;\n  private _client: Client;\n\n  public constructor(client: Client, attrs: ReleaseHealthAttributes) {\n    this._client = client;\n    // Call to setInterval, so that flush is called every 60 seconds\n    this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000);\n    this._sessionAttrs = attrs;\n  }\n\n  /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */\n  public flush(): void {\n    const sessionAggregates = this.getSessionAggregates();\n    if (sessionAggregates.aggregates.length === 0) {\n      return;\n    }\n    this._pendingAggregates = {};\n    this._client.sendSession(sessionAggregates);\n  }\n\n  /** Massages the entries in `pendingAggregates` and returns aggregated sessions */\n  public getSessionAggregates(): SessionAggregates {\n    const aggregates: AggregationCounts[] = Object.keys(this._pendingAggregates).map((key: string) => {\n      return this._pendingAggregates[parseInt(key)];\n    });\n\n    const sessionAggregates: SessionAggregates = {\n      attrs: this._sessionAttrs,\n      aggregates,\n    };\n    return dropUndefinedKeys(sessionAggregates);\n  }\n\n  /** JSDoc */\n  public close(): void {\n    clearInterval(this._intervalId);\n    this._isEnabled = false;\n    this.flush();\n  }\n\n  /**\n   * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then\n   * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to\n   * `_incrementSessionStatusCount` along with the start date\n   */\n  public incrementSessionStatusCount(): void {\n    if (!this._isEnabled) {\n      return;\n    }\n    const scope = getCurrentHub().getScope();\n    const requestSession = scope.getRequestSession();\n\n    if (requestSession && requestSession.status) {\n      this._incrementSessionStatusCount(requestSession.status, new Date());\n      // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in\n      // case captureRequestSession is called more than once to prevent double count\n      scope.setRequestSession(undefined);\n      /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n    }\n  }\n\n  /**\n   * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of\n   * the session received\n   */\n  private _incrementSessionStatusCount(status: RequestSessionStatus, date: Date): number {\n    // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys\n    const sessionStartedTrunc = new Date(date).setSeconds(0, 0);\n    this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};\n\n    // corresponds to aggregated sessions in one specific minute bucket\n    // for example, {\"started\":\"2021-03-16T08:00:00.000Z\",\"exited\":4, \"errored\": 1}\n    const aggregationCounts: AggregationCounts = this._pendingAggregates[sessionStartedTrunc];\n    if (!aggregationCounts.started) {\n      aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();\n    }\n\n    switch (status) {\n      case 'errored':\n        aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;\n        return aggregationCounts.errored;\n      case 'ok':\n        aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;\n        return aggregationCounts.exited;\n      default:\n        aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;\n        return aggregationCounts.crashed;\n    }\n  }\n}\n"],"names":["dropUndefinedKeys","getCurrentHub"],"mappings":";;;;;AAgBA;AACA;AACA;AACA,MAAA,cAAA,EAAA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,YAAA,GAAA,GAAA,CAAA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,kBAAA,GAAA,GAAA,CAAA;;AAGA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,UAAA,GAAA,KAAA,CAAA;;AAGA,GAAA,WAAA,CAAA,MA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AAA,iBAAA,CAAA,OAAA,GAAA,CAAA,iBAAA,CAAA,OAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,QAAA,OAAA,iBAAA,CAAA,OAAA,CAAA;AACA,MAAA,KAAA,IAAA;AACA,QAAA,iBAAA,CAAA,MAAA,GAAA,CAAA,iBAAA,CAAA,MAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,QAAA,OAAA,iBAAA,CAAA,MAAA,CAAA;AACA,MAAA;AACA,QAAA,iBAAA,CAAA,OAAA,GAAA,CAAA,iBAAA,CAAA,OAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,QAAA,OAAA,iBAAA,CAAA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const utils$1 = require('./utils.js');

let errorsInstrumented = false;

/**
 * Configures global error listeners
 */
function registerErrorInstrumentation() {
  if (errorsInstrumented) {
    return;
  }

  errorsInstrumented = true;
  utils.addInstrumentationHandler('error', errorCallback);
  utils.addInstrumentationHandler('unhandledrejection', errorCallback);
}

/**
 * If an error or unhandled promise occurs, we mark the active transaction as failed
 */
function errorCallback() {
  const activeTransaction = utils$1.getActiveTransaction();
  if (activeTransaction) {
    const status = 'internal_error';
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);
    activeTransaction.setStatus(status);
  }
}

// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the
// node.js default exit behaviour
errorCallback.tag = 'sentry_tracingErrorCallback';

exports.registerErrorInstrumentation = registerErrorInstrumentation;
//# sourceMappingURL=errors.js.map
{"version":3,"file":"errors.js","sources":["../../../src/tracing/errors.ts"],"sourcesContent":["import { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { SpanStatusType } from './span';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n  if (errorsInstrumented) {\n    return;\n  }\n\n  errorsInstrumented = true;\n  addInstrumentationHandler('error', errorCallback);\n  addInstrumentationHandler('unhandledrejection', errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n  const activeTransaction = getActiveTransaction();\n  if (activeTransaction) {\n    const status: SpanStatusType = 'internal_error';\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n    activeTransaction.setStatus(status);\n  }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n"],"names":["addInstrumentationHandler","getActiveTransaction","logger"],"mappings":";;;;;AAKA,IAAA,kBAAA,GAAA,KAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,GAAA;AACA,EAAA,IAAA,kBAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,kBAAA,GAAA,IAAA,CAAA;AACA,EAAAA,+BAAA,CAAA,OAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAAA,+BAAA,CAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,GAAA;AACA,EAAA,MAAA,iBAAA,GAAAC,4BAAA,EAAA,CAAA;AACA,EAAA,IAAA,iBAAA,EAAA;AACA,IAAA,MAAA,MAAA,GAAA,gBAAA,CAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAC,YAAA,CAAA,GAAA,CAAA,CAAA,uBAAA,EAAA,MAAA,CAAA,wBAAA,CAAA,CAAA,CAAA;AACA,IAAA,iBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA,aAAA,CAAA,GAAA,GAAA,6BAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const hub = require('../hub.js');
const hasTracingEnabled = require('../utils/hasTracingEnabled.js');
const errors = require('./errors.js');
const idletransaction = require('./idletransaction.js');
const transaction = require('./transaction.js');

/** Returns all trace headers that are currently on the top scope. */
function traceHeaders() {
  const scope = this.getScope();
  const span = scope.getSpan();

  return span
    ? {
        'sentry-trace': span.toTraceparent(),
      }
    : {};
}

/**
 * Makes a sampling decision for the given transaction and stores it on the transaction.
 *
 * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be
 * sent to Sentry.
 *
 * @param transaction: The transaction needing a sampling decision
 * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`
 * @param samplingContext: Default and user-provided data which may be used to help make the decision
 *
 * @returns The given transaction with its `sampled` value set
 */
function sample(
  transaction,
  options,
  samplingContext,
) {
  // nothing to do if tracing is not enabled
  if (!hasTracingEnabled.hasTracingEnabled(options)) {
    transaction.sampled = false;
    return transaction;
  }

  // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
  if (transaction.sampled !== undefined) {
    transaction.setMetadata({
      sampleRate: Number(transaction.sampled),
    });
    return transaction;
  }

  // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should
  // work; prefer the hook if so
  let sampleRate;
  if (typeof options.tracesSampler === 'function') {
    sampleRate = options.tracesSampler(samplingContext);
    transaction.setMetadata({
      sampleRate: Number(sampleRate),
    });
  } else if (samplingContext.parentSampled !== undefined) {
    sampleRate = samplingContext.parentSampled;
  } else if (typeof options.tracesSampleRate !== 'undefined') {
    sampleRate = options.tracesSampleRate;
    transaction.setMetadata({
      sampleRate: Number(sampleRate),
    });
  } else {
    // When `enableTracing === true`, we use a sample rate of 100%
    sampleRate = 1;
    transaction.setMetadata({
      sampleRate,
    });
  }

  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The
  // only valid values are booleans or numbers between 0 and 1.)
  if (!isValidSampleRate(sampleRate)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');
    transaction.sampled = false;
    return transaction;
  }

  // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped
  if (!sampleRate) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.log(
        `[Tracing] Discarding transaction because ${
          typeof options.tracesSampler === 'function'
            ? 'tracesSampler returned 0 or false'
            : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'
        }`,
      );
    transaction.sampled = false;
    return transaction;
  }

  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is
  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.
  transaction.sampled = Math.random() < (sampleRate );

  // if we're not going to keep it, we're done
  if (!transaction.sampled) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.log(
        `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(
          sampleRate,
        )})`,
      );
    return transaction;
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);
  return transaction;
}

/**
 * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).
 */
function isValidSampleRate(rate) {
  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  if (utils.isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(
        `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
          rate,
        )} of type ${JSON.stringify(typeof rate)}.`,
      );
    return false;
  }

  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false
  if (rate < 0 || rate > 1) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);
    return false;
  }
  return true;
}

/**
 * Creates a new transaction and adds a sampling decision if it doesn't yet have one.
 *
 * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if
 * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an
 * "extension method."
 *
 * @param this: The Hub starting the transaction
 * @param transactionContext: Data used to configure the transaction
 * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)
 *
 * @returns The new transaction
 *
 * @see {@link Hub.startTransaction}
 */
function _startTransaction(

  transactionContext,
  customSamplingContext,
) {
  const client = this.getClient();
  const options = (client && client.getOptions()) || {};

  const configInstrumenter = options.instrumenter || 'sentry';
  const transactionInstrumenter = transactionContext.instrumenter || 'sentry';

  if (configInstrumenter !== transactionInstrumenter) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      utils.logger.error(
        `A transaction was started with instrumenter=\`${transactionInstrumenter}\`, but the SDK is configured with the \`${configInstrumenter}\` instrumenter.
The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,
      );

    transactionContext.sampled = false;
  }

  let transaction$1 = new transaction.Transaction(transactionContext, this);
  transaction$1 = sample(transaction$1, options, {
    parentSampled: transactionContext.parentSampled,
    transactionContext,
    ...customSamplingContext,
  });
  if (transaction$1.sampled) {
    transaction$1.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));
  }
  if (client && client.emit) {
    client.emit('startTransaction', transaction$1);
  }
  return transaction$1;
}

/**
 * Create new idle transaction.
 */
function startIdleTransaction(
  hub,
  transactionContext,
  idleTimeout,
  finalTimeout,
  onScope,
  customSamplingContext,
  heartbeatInterval,
) {
  const client = hub.getClient();
  const options = (client && client.getOptions()) || {};

  let transaction = new idletransaction.IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);
  transaction = sample(transaction, options, {
    parentSampled: transactionContext.parentSampled,
    transactionContext,
    ...customSamplingContext,
  });
  if (transaction.sampled) {
    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));
  }
  if (client && client.emit) {
    client.emit('startTransaction', transaction);
  }
  return transaction;
}

/**
 * Adds tracing extensions to the global hub.
 */
function addTracingExtensions() {
  const carrier = hub.getMainCarrier();
  if (!carrier.__SENTRY__) {
    return;
  }
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
  if (!carrier.__SENTRY__.extensions.startTransaction) {
    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;
  }
  if (!carrier.__SENTRY__.extensions.traceHeaders) {
    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
  }

  errors.registerErrorInstrumentation();
}

exports.addTracingExtensions = addTracingExtensions;
exports.startIdleTransaction = startIdleTransaction;
//# sourceMappingURL=hubextensions.js.map
{"version":3,"file":"hubextensions.js","sources":["../../../src/tracing/hubextensions.ts"],"sourcesContent":["import type { ClientOptions, CustomSamplingContext, Options, SamplingContext, TransactionContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n  const scope = this.getScope();\n  const span = scope.getSpan();\n\n  return span\n    ? {\n        'sentry-trace': span.toTraceparent(),\n      }\n    : {};\n}\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * @param transaction: The transaction needing a sampling decision\n * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`\n * @param samplingContext: Default and user-provided data which may be used to help make the decision\n *\n * @returns The given transaction with its `sampled` value set\n */\nfunction sample<T extends Transaction>(\n  transaction: T,\n  options: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'>,\n  samplingContext: SamplingContext,\n): T {\n  // nothing to do if tracing is not enabled\n  if (!hasTracingEnabled(options)) {\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n  if (transaction.sampled !== undefined) {\n    transaction.setMetadata({\n      sampleRate: Number(transaction.sampled),\n    });\n    return transaction;\n  }\n\n  // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n  // work; prefer the hook if so\n  let sampleRate;\n  if (typeof options.tracesSampler === 'function') {\n    sampleRate = options.tracesSampler(samplingContext);\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else if (samplingContext.parentSampled !== undefined) {\n    sampleRate = samplingContext.parentSampled;\n  } else if (typeof options.tracesSampleRate !== 'undefined') {\n    sampleRate = options.tracesSampleRate;\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else {\n    // When `enableTracing === true`, we use a sample rate of 100%\n    sampleRate = 1;\n    transaction.setMetadata({\n      sampleRate,\n    });\n  }\n\n  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n  // only valid values are booleans or numbers between 0 and 1.)\n  if (!isValidSampleRate(sampleRate)) {\n    __DEBUG_BUILD__ && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n  if (!sampleRate) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because ${\n          typeof options.tracesSampler === 'function'\n            ? 'tracesSampler returned 0 or false'\n            : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n        }`,\n      );\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n  transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n  // if we're not going to keep it, we're done\n  if (!transaction.sampled) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n          sampleRate,\n        )})`,\n      );\n    return transaction;\n  }\n\n  __DEBUG_BUILD__ && logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);\n  return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate: unknown): boolean {\n  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n          rate,\n        )} of type ${JSON.stringify(typeof rate)}.`,\n      );\n    return false;\n  }\n\n  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n  if (rate < 0 || rate > 1) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n    return false;\n  }\n  return true;\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n  this: Hub,\n  transactionContext: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): Transaction {\n  const client = this.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  const configInstrumenter = options.instrumenter || 'sentry';\n  const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n  if (configInstrumenter !== transactionInstrumenter) {\n    __DEBUG_BUILD__ &&\n      logger.error(\n        `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n      );\n\n    transactionContext.sampled = false;\n  }\n\n  let transaction = new Transaction(transactionContext, this);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n  hub: Hub,\n  transactionContext: TransactionContext,\n  idleTimeout: number,\n  finalTimeout: number,\n  onScope?: boolean,\n  customSamplingContext?: CustomSamplingContext,\n  heartbeatInterval?: number,\n): IdleTransaction {\n  const client = hub.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    return;\n  }\n  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n  if (!carrier.__SENTRY__.extensions.startTransaction) {\n    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n  }\n  if (!carrier.__SENTRY__.extensions.traceHeaders) {\n    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n  }\n\n  registerErrorInstrumentation();\n}\n"],"names":["hasTracingEnabled","logger","isNaN","transaction","Transaction","IdleTransaction","getMainCarrier","registerErrorInstrumentation"],"mappings":";;;;;;;;;AAUA;AACA,SAAA,YAAA,GAAA;AACA,EAAA,MAAA,KAAA,GAAA,IAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,KAAA,CAAA,OAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,IAAA;AACA,MAAA;AACA,QAAA,cAAA,EAAA,IAAA,CAAA,aAAA,EAAA;AACA,OAAA;AACA,MAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,MAAA;AACA,EAAA,WAAA;AACA,EAAA,OAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA;AACA,EAAA,IAAA,CAAAA,mCAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,WAAA,CAAA,OAAA,GAAA,KAAA,CAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,WAAA,CAAA,OAAA,KAAA,SAAA,EAAA;AACA,IAAA,WAAA,CAAA,WAAA,CAAA;AACA,MAAA,UAAA,EAAA,MAAA,CAAA,WAAA,CAAA,OAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,UA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A,EAAA,OAAA,WAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,MAAA,OAAA,GAAAC,kBAAA,EAAA,CAAA;AACA,EAAA,IAAA,CAAA,OAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA,EAAA,OAAA,CAAA,UAAA,CAAA,UAAA,GAAA,OAAA,CAAA,UAAA,CAAA,UAAA,IAAA,EAAA,CAAA;AACA,EAAA,IAAA,CAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,gBAAA,EAAA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,gBAAA,GAAA,iBAAA,CAAA;AACA,GAAA;AACA,EAAA,IAAA,CAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,YAAA,EAAA;AACA,IAAA,OAAA,CAAA,UAAA,CAAA,UAAA,CAAA,YAAA,GAAA,YAAA,CAAA;AACA,GAAA;AACA;AACA,EAAAC,mCAAA,EAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const span = require('./span.js');
const transaction = require('./transaction.js');

const TRACING_DEFAULTS = {
  idleTimeout: 1000,
  finalTimeout: 30000,
  heartbeatInterval: 5000,
};

const FINISH_REASON_TAG = 'finishReason';

const IDLE_TRANSACTION_FINISH_REASONS = [
  'heartbeatFailed',
  'idleTimeout',
  'documentHidden',
  'finalTimeout',
  'externalFinish',
  'cancelled',
];

/**
 * @inheritDoc
 */
class IdleTransactionSpanRecorder extends span.SpanRecorder {
   constructor(
      _pushActivity,
      _popActivity,
     transactionSpanId,
    maxlen,
  ) {
    super(maxlen);this._pushActivity = _pushActivity;this._popActivity = _popActivity;this.transactionSpanId = transactionSpanId;  }

  /**
   * @inheritDoc
   */
   add(span) {
    // We should make sure we do not push and pop activities for
    // the transaction that this span recorder belongs to.
    if (span.spanId !== this.transactionSpanId) {
      // We patch span.finish() to pop an activity after setting an endTimestamp.
      span.finish = (endTimestamp) => {
        span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : utils.timestampWithMs();
        this._popActivity(span.spanId);
      };

      // We should only push new activities if the span does not have an end timestamp.
      if (span.endTimestamp === undefined) {
        this._pushActivity(span.spanId);
      }
    }

    super.add(span);
  }
}

/**
 * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.
 * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will
 * put itself on the scope on creation.
 */
class IdleTransaction extends transaction.Transaction {
  // Activities store a list of active spans
   __init() {this.activities = {};}

  // Track state of activities in previous heartbeat

  // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.
   __init2() {this._heartbeatCounter = 0;}

  // We should not use heartbeat if we finished a transaction
   __init3() {this._finished = false;}

  // Idle timeout was canceled and we should finish the transaction with the last span end.
   __init4() {this._idleTimeoutCanceledPermanently = false;}

    __init5() {this._beforeFinishCallbacks = [];}

  /**
   * Timer that tracks Transaction idleTimeout
   */

   __init6() {this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];}

   constructor(
    transactionContext,
      _idleHub,
    /**
     * The time to wait in ms until the idle transaction will be finished. This timer is started each time
     * there are no active spans on this transaction.
     */
      _idleTimeout = TRACING_DEFAULTS.idleTimeout,
    /**
     * The final value in ms that a transaction cannot exceed
     */
      _finalTimeout = TRACING_DEFAULTS.finalTimeout,
      _heartbeatInterval = TRACING_DEFAULTS.heartbeatInterval,
    // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends
      _onScope = false,
  ) {
    super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);IdleTransaction.prototype.__init5.call(this);IdleTransaction.prototype.__init6.call(this);
    if (_onScope) {
      // We set the transaction here on the scope so error events pick up the trace
      // context and attach it to the error.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);
      _idleHub.configureScope(scope => scope.setSpan(this));
    }

    this._restartIdleTimeout();
    setTimeout(() => {
      if (!this._finished) {
        this.setStatus('deadline_exceeded');
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];
        this.finish();
      }
    }, this._finalTimeout);
  }

  /** {@inheritDoc} */
   finish(endTimestamp = utils.timestampWithMs()) {
    this._finished = true;
    this.activities = {};

    if (this.op === 'ui.action.click') {
      this.setTag(FINISH_REASON_TAG, this._finishReason);
    }

    if (this.spanRecorder) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);

      for (const callback of this._beforeFinishCallbacks) {
        callback(this, endTimestamp);
      }

      this.spanRecorder.spans = this.spanRecorder.spans.filter((span) => {
        // If we are dealing with the transaction itself, we just return it
        if (span.spanId === this.spanId) {
          return true;
        }

        // We cancel all pending spans with status "cancelled" to indicate the idle transaction was finished early
        if (!span.endTimestamp) {
          span.endTimestamp = endTimestamp;
          span.setStatus('cancelled');
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            utils.logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));
        }

        const keepSpan = span.startTimestamp < endTimestamp;
        if (!keepSpan) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            utils.logger.log(
              '[Tracing] discarding Span since it happened after Transaction was finished',
              JSON.stringify(span, undefined, 2),
            );
        }
        return keepSpan;
      });

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] flushing IdleTransaction');
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] No active IdleTransaction');
    }

    // if `this._onScope` is `true`, the transaction put itself on the scope when it started
    if (this._onScope) {
      const scope = this._idleHub.getScope();
      if (scope.getTransaction() === this) {
        scope.setSpan(undefined);
      }
    }

    return super.finish(endTimestamp);
  }

  /**
   * Register a callback function that gets excecuted before the transaction finishes.
   * Useful for cleanup or if you want to add any additional spans based on current context.
   *
   * This is exposed because users have no other way of running something before an idle transaction
   * finishes.
   */
   registerBeforeFinishCallback(callback) {
    this._beforeFinishCallbacks.push(callback);
  }

  /**
   * @inheritDoc
   */
   initSpanRecorder(maxlen) {
    if (!this.spanRecorder) {
      const pushActivity = (id) => {
        if (this._finished) {
          return;
        }
        this._pushActivity(id);
      };
      const popActivity = (id) => {
        if (this._finished) {
          return;
        }
        this._popActivity(id);
      };

      this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);

      // Start heartbeat so that transactions do not run forever.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('Starting heartbeat');
      this._pingHeartbeat();
    }
    this.spanRecorder.add(this);
  }

  /**
   * Cancels the existing idle timeout, if there is one.
   * @param restartOnChildSpanChange Default is `true`.
   *                                 If set to false the transaction will end
   *                                 with the last child span.
   */
   cancelIdleTimeout(
    endTimestamp,
    {
      restartOnChildSpanChange,
    }

 = {
      restartOnChildSpanChange: true,
    },
  ) {
    this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;
    if (this._idleTimeoutID) {
      clearTimeout(this._idleTimeoutID);
      this._idleTimeoutID = undefined;

      if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];
        this.finish(endTimestamp);
      }
    }
  }

  /**
   * Temporary method used to externally set the transaction's `finishReason`
   *
   * ** WARNING**
   * This is for the purpose of experimentation only and will be removed in the near future, do not use!
   *
   * @internal
   *
   */
   setFinishReason(reason) {
    this._finishReason = reason;
  }

  /**
   * Restarts idle timeout, if there is no running idle timeout it will start one.
   */
   _restartIdleTimeout(endTimestamp) {
    this.cancelIdleTimeout();
    this._idleTimeoutID = setTimeout(() => {
      if (!this._finished && Object.keys(this.activities).length === 0) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];
        this.finish(endTimestamp);
      }
    }, this._idleTimeout);
  }

  /**
   * Start tracking a specific activity.
   * @param spanId The span id that represents the activity
   */
   _pushActivity(spanId) {
    this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] pushActivity: ${spanId}`);
    this.activities[spanId] = true;
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] new activities count', Object.keys(this.activities).length);
  }

  /**
   * Remove an activity from usage
   * @param spanId The span id that represents the activity
   */
   _popActivity(spanId) {
    if (this.activities[spanId]) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] popActivity ${spanId}`);
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this.activities[spanId];
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] new activities count', Object.keys(this.activities).length);
    }

    if (Object.keys(this.activities).length === 0) {
      const endTimestamp = utils.timestampWithMs();
      if (this._idleTimeoutCanceledPermanently) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];
        this.finish(endTimestamp);
      } else {
        // We need to add the timeout here to have the real endtimestamp of the transaction
        // Remember timestampWithMs is in seconds, timeout is in ms
        this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);
      }
    }
  }

  /**
   * Checks when entries of this.activities are not changing for 3 beats.
   * If this occurs we finish the transaction.
   */
   _beat() {
    // We should not be running heartbeat if the idle transaction is finished.
    if (this._finished) {
      return;
    }

    const heartbeatString = Object.keys(this.activities).join('');

    if (heartbeatString === this._prevHeartbeatString) {
      this._heartbeatCounter++;
    } else {
      this._heartbeatCounter = 1;
    }

    this._prevHeartbeatString = heartbeatString;

    if (this._heartbeatCounter >= 3) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');
      this.setStatus('deadline_exceeded');
      this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];
      this.finish();
    } else {
      this._pingHeartbeat();
    }
  }

  /**
   * Pings the heartbeat
   */
   _pingHeartbeat() {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);
    setTimeout(() => {
      this._beat();
    }, this._heartbeatInterval);
  }
}

exports.IdleTransaction = IdleTransaction;
exports.IdleTransactionSpanRecorder = IdleTransactionSpanRecorder;
exports.TRACING_DEFAULTS = TRACING_DEFAULTS;
//# sourceMappingURL=idletransaction.js.map
{"version":3,"file":"idletransaction.js","sources":["../../../src/tracing/idletransaction.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { TransactionContext } from '@sentry/types';\nimport { logger, timestampWithMs } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n  idleTimeout: 1000,\n  finalTimeout: 30000,\n  heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n  'heartbeatFailed',\n  'idleTimeout',\n  'documentHidden',\n  'finalTimeout',\n  'externalFinish',\n  'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n  public constructor(\n    private readonly _pushActivity: (id: string) => void,\n    private readonly _popActivity: (id: string) => void,\n    public transactionSpanId: string,\n    maxlen?: number,\n  ) {\n    super(maxlen);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public add(span: Span): void {\n    // We should make sure we do not push and pop activities for\n    // the transaction that this span recorder belongs to.\n    if (span.spanId !== this.transactionSpanId) {\n      // We patch span.finish() to pop an activity after setting an endTimestamp.\n      span.finish = (endTimestamp?: number) => {\n        span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n        this._popActivity(span.spanId);\n      };\n\n      // We should only push new activities if the span does not have an end timestamp.\n      if (span.endTimestamp === undefined) {\n        this._pushActivity(span.spanId);\n      }\n    }\n\n    super.add(span);\n  }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n  // Activities store a list of active spans\n  public activities: Record<string, boolean> = {};\n\n  // Track state of activities in previous heartbeat\n  private _prevHeartbeatString: string | undefined;\n\n  // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n  private _heartbeatCounter: number = 0;\n\n  // We should not use heartbeat if we finished a transaction\n  private _finished: boolean = false;\n\n  // Idle timeout was canceled and we should finish the transaction with the last span end.\n  private _idleTimeoutCanceledPermanently: boolean = false;\n\n  private readonly _beforeFinishCallbacks: BeforeFinishCallback[] = [];\n\n  /**\n   * Timer that tracks Transaction idleTimeout\n   */\n  private _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n  private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number] = IDLE_TRANSACTION_FINISH_REASONS[4];\n\n  public constructor(\n    transactionContext: TransactionContext,\n    private readonly _idleHub: Hub,\n    /**\n     * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n     * there are no active spans on this transaction.\n     */\n    private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n    /**\n     * The final value in ms that a transaction cannot exceed\n     */\n    private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n    private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n    // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n    private readonly _onScope: boolean = false,\n  ) {\n    super(transactionContext, _idleHub);\n\n    if (_onScope) {\n      // We set the transaction here on the scope so error events pick up the trace\n      // context and attach it to the error.\n      __DEBUG_BUILD__ && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n      _idleHub.configureScope(scope => scope.setSpan(this));\n    }\n\n    this._restartIdleTimeout();\n    setTimeout(() => {\n      if (!this._finished) {\n        this.setStatus('deadline_exceeded');\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n        this.finish();\n      }\n    }, this._finalTimeout);\n  }\n\n  /** {@inheritDoc} */\n  public finish(endTimestamp: number = timestampWithMs()): string | undefined {\n    this._finished = true;\n    this.activities = {};\n\n    if (this.op === 'ui.action.click') {\n      this.setTag(FINISH_REASON_TAG, this._finishReason);\n    }\n\n    if (this.spanRecorder) {\n      __DEBUG_BUILD__ &&\n        logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);\n\n      for (const callback of this._beforeFinishCallbacks) {\n        callback(this, endTimestamp);\n      }\n\n      this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n        // If we are dealing with the transaction itself, we just return it\n        if (span.spanId === this.spanId) {\n          return true;\n        }\n\n        // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n        if (!span.endTimestamp) {\n          span.endTimestamp = endTimestamp;\n          span.setStatus('cancelled');\n          __DEBUG_BUILD__ &&\n            logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n        }\n\n        const keepSpan = span.startTimestamp < endTimestamp;\n        if (!keepSpan) {\n          __DEBUG_BUILD__ &&\n            logger.log(\n              '[Tracing] discarding Span since it happened after Transaction was finished',\n              JSON.stringify(span, undefined, 2),\n            );\n        }\n        return keepSpan;\n      });\n\n      __DEBUG_BUILD__ && logger.log('[Tracing] flushing IdleTransaction');\n    } else {\n      __DEBUG_BUILD__ && logger.log('[Tracing] No active IdleTransaction');\n    }\n\n    // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n    if (this._onScope) {\n      const scope = this._idleHub.getScope();\n      if (scope.getTransaction() === this) {\n        scope.setSpan(undefined);\n      }\n    }\n\n    return super.finish(endTimestamp);\n  }\n\n  /**\n   * Register a callback function that gets excecuted before the transaction finishes.\n   * Useful for cleanup or if you want to add any additional spans based on current context.\n   *\n   * This is exposed because users have no other way of running something before an idle transaction\n   * finishes.\n   */\n  public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n    this._beforeFinishCallbacks.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public initSpanRecorder(maxlen?: number): void {\n    if (!this.spanRecorder) {\n      const pushActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._pushActivity(id);\n      };\n      const popActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._popActivity(id);\n      };\n\n      this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);\n\n      // Start heartbeat so that transactions do not run forever.\n      __DEBUG_BUILD__ && logger.log('Starting heartbeat');\n      this._pingHeartbeat();\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * Cancels the existing idle timeout, if there is one.\n   * @param restartOnChildSpanChange Default is `true`.\n   *                                 If set to false the transaction will end\n   *                                 with the last child span.\n   */\n  public cancelIdleTimeout(\n    endTimestamp?: Parameters<IdleTransaction['finish']>[0],\n    {\n      restartOnChildSpanChange,\n    }: {\n      restartOnChildSpanChange?: boolean;\n    } = {\n      restartOnChildSpanChange: true,\n    },\n  ): void {\n    this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n    if (this._idleTimeoutID) {\n      clearTimeout(this._idleTimeoutID);\n      this._idleTimeoutID = undefined;\n\n      if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      }\n    }\n  }\n\n  /**\n   * Temporary method used to externally set the transaction's `finishReason`\n   *\n   * ** WARNING**\n   * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n   *\n   * @internal\n   *\n   */\n  public setFinishReason(reason: string): void {\n    this._finishReason = reason;\n  }\n\n  /**\n   * Restarts idle timeout, if there is no running idle timeout it will start one.\n   */\n  private _restartIdleTimeout(endTimestamp?: Parameters<IdleTransaction['finish']>[0]): void {\n    this.cancelIdleTimeout();\n    this._idleTimeoutID = setTimeout(() => {\n      if (!this._finished && Object.keys(this.activities).length === 0) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n        this.finish(endTimestamp);\n      }\n    }, this._idleTimeout);\n  }\n\n  /**\n   * Start tracking a specific activity.\n   * @param spanId The span id that represents the activity\n   */\n  private _pushActivity(spanId: string): void {\n    this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n    __DEBUG_BUILD__ && logger.log(`[Tracing] pushActivity: ${spanId}`);\n    this.activities[spanId] = true;\n    __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n  }\n\n  /**\n   * Remove an activity from usage\n   * @param spanId The span id that represents the activity\n   */\n  private _popActivity(spanId: string): void {\n    if (this.activities[spanId]) {\n      __DEBUG_BUILD__ && logger.log(`[Tracing] popActivity ${spanId}`);\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this.activities[spanId];\n      __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n    }\n\n    if (Object.keys(this.activities).length === 0) {\n      const endTimestamp = timestampWithMs();\n      if (this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      } else {\n        // We need to add the timeout here to have the real endtimestamp of the transaction\n        // Remember timestampWithMs is in seconds, timeout is in ms\n        this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n      }\n    }\n  }\n\n  /**\n   * Checks when entries of this.activities are not changing for 3 beats.\n   * If this occurs we finish the transaction.\n   */\n  private _beat(): void {\n    // We should not be running heartbeat if the idle transaction is finished.\n    if (this._finished) {\n      return;\n    }\n\n    const heartbeatString = Object.keys(this.activities).join('');\n\n    if (heartbeatString === this._prevHeartbeatString) {\n      this._heartbeatCounter++;\n    } else {\n      this._heartbeatCounter = 1;\n    }\n\n    this._prevHeartbeatString = heartbeatString;\n\n    if (this._heartbeatCounter >= 3) {\n      __DEBUG_BUILD__ && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n      this.setStatus('deadline_exceeded');\n      this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n      this.finish();\n    } else {\n      this._pingHeartbeat();\n    }\n  }\n\n  /**\n   * Pings the heartbeat\n   */\n  private _pingHeartbeat(): void {\n    __DEBUG_BUILD__ && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n    setTimeout(() => {\n      this._beat();\n    }, this._heartbeatInterval);\n  }\n}\n"],"names":["SpanRecorder","timestampWithMs","Transaction","logger"],"mappings":";;;;;;AASA,MAAA,gBAAA,GAAA;AACA,EAAA,WAAA,EAAA,IAAA;AACA,EAAA,YAAA,EAAA,KAAA;AACA,EAAA,iBAAA,EAAA,IAAA;AACA,EAAA;AACA;AACA,MAAA,iBAAA,GAAA,cAAA,CAAA;AACA;AACA,MAAA,+BAAA,GAAA;AACA,EAAA,iBAAA;AACA,EAAA,aAAA;AACA,EAAA,gBAAA;AACA,EAAA,cAAA;AACA,EAAA,gBAAA;AACA,EAAA,WAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,MAAA,2BAAA,SAAAA,iBAAA,CAAA;AACA,GAAA,WA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AAA,kBAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

/**
 * Keeps track of finished spans for a given transaction
 * @internal
 * @hideconstructor
 * @hidden
 */
class SpanRecorder {
   __init() {this.spans = [];}

   constructor(maxlen = 1000) {SpanRecorder.prototype.__init.call(this);
    this._maxlen = maxlen;
  }

  /**
   * This is just so that we don't run out of memory while recording a lot
   * of spans. At some point we just stop and flush out the start of the
   * trace tree (i.e.the first n spans with the smallest
   * start_timestamp).
   */
   add(span) {
    if (this.spans.length > this._maxlen) {
      span.spanRecorder = undefined;
    } else {
      this.spans.push(span);
    }
  }
}

/**
 * Span contains all data about a span
 */
class Span  {
  /**
   * @inheritDoc
   */
   __init2() {this.traceId = utils.uuid4();}

  /**
   * @inheritDoc
   */
   __init3() {this.spanId = utils.uuid4().substring(16);}

  /**
   * @inheritDoc
   */

  /**
   * Internal keeper of the status
   */

  /**
   * @inheritDoc
   */

  /**
   * Timestamp in seconds when the span was created.
   */
   __init4() {this.startTimestamp = utils.timestampWithMs();}

  /**
   * Timestamp in seconds when the span ended.
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   __init5() {this.tags = {};}

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   __init6() {this.data = {};}

  /**
   * List of spans that were finalized
   */

  /**
   * @inheritDoc
   */

  /**
   * The instrumenter that created this span.
   */
   __init7() {this.instrumenter = 'sentry';}

  /**
   * You should never call the constructor manually, always use `Sentry.startTransaction()`
   * or call `startChild()` on an existing span.
   * @internal
   * @hideconstructor
   * @hidden
   */
   constructor(spanContext) {Span.prototype.__init2.call(this);Span.prototype.__init3.call(this);Span.prototype.__init4.call(this);Span.prototype.__init5.call(this);Span.prototype.__init6.call(this);Span.prototype.__init7.call(this);
    if (!spanContext) {
      return this;
    }
    if (spanContext.traceId) {
      this.traceId = spanContext.traceId;
    }
    if (spanContext.spanId) {
      this.spanId = spanContext.spanId;
    }
    if (spanContext.parentSpanId) {
      this.parentSpanId = spanContext.parentSpanId;
    }
    // We want to include booleans as well here
    if ('sampled' in spanContext) {
      this.sampled = spanContext.sampled;
    }
    if (spanContext.op) {
      this.op = spanContext.op;
    }
    if (spanContext.description) {
      this.description = spanContext.description;
    }
    if (spanContext.data) {
      this.data = spanContext.data;
    }
    if (spanContext.tags) {
      this.tags = spanContext.tags;
    }
    if (spanContext.status) {
      this.status = spanContext.status;
    }
    if (spanContext.startTimestamp) {
      this.startTimestamp = spanContext.startTimestamp;
    }
    if (spanContext.endTimestamp) {
      this.endTimestamp = spanContext.endTimestamp;
    }
    if (spanContext.instrumenter) {
      this.instrumenter = spanContext.instrumenter;
    }
  }

  /**
   * @inheritDoc
   */
   startChild(
    spanContext,
  ) {
    const childSpan = new Span({
      ...spanContext,
      parentSpanId: this.spanId,
      sampled: this.sampled,
      traceId: this.traceId,
    });

    childSpan.spanRecorder = this.spanRecorder;
    if (childSpan.spanRecorder) {
      childSpan.spanRecorder.add(childSpan);
    }

    childSpan.transaction = this.transaction;

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && childSpan.transaction) {
      const opStr = (spanContext && spanContext.op) || '< unknown op >';
      const nameStr = childSpan.transaction.name || '< unknown name >';
      const idStr = childSpan.transaction.spanId;

      const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;
      childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };
      utils.logger.log(logMessage);
    }

    return childSpan;
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this.tags = { ...this.tags, [key]: value };
    return this;
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   setData(key, value) {
    this.data = { ...this.data, [key]: value };
    return this;
  }

  /**
   * @inheritDoc
   */
   setStatus(value) {
    this.status = value;
    return this;
  }

  /**
   * @inheritDoc
   */
   setHttpStatus(httpStatus) {
    this.setTag('http.status_code', String(httpStatus));
    const spanStatus = spanStatusfromHttpCode(httpStatus);
    if (spanStatus !== 'unknown_error') {
      this.setStatus(spanStatus);
    }
    return this;
  }

  /**
   * @inheritDoc
   */
   isSuccess() {
    return this.status === 'ok';
  }

  /**
   * @inheritDoc
   */
   finish(endTimestamp) {
    if (
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      // Don't call this for transactions
      this.transaction &&
      this.transaction.spanId !== this.spanId
    ) {
      const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];
      if (logMessage) {
        utils.logger.log((logMessage ).replace('Starting', 'Finishing'));
      }
    }

    this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : utils.timestampWithMs();
  }

  /**
   * @inheritDoc
   */
   toTraceparent() {
    let sampledString = '';
    if (this.sampled !== undefined) {
      sampledString = this.sampled ? '-1' : '-0';
    }
    return `${this.traceId}-${this.spanId}${sampledString}`;
  }

  /**
   * @inheritDoc
   */
   toContext() {
    return utils.dropUndefinedKeys({
      data: this.data,
      description: this.description,
      endTimestamp: this.endTimestamp,
      op: this.op,
      parentSpanId: this.parentSpanId,
      sampled: this.sampled,
      spanId: this.spanId,
      startTimestamp: this.startTimestamp,
      status: this.status,
      tags: this.tags,
      traceId: this.traceId,
    });
  }

  /**
   * @inheritDoc
   */
   updateWithContext(spanContext) {
    this.data = spanContext.data || {};
    this.description = spanContext.description;
    this.endTimestamp = spanContext.endTimestamp;
    this.op = spanContext.op;
    this.parentSpanId = spanContext.parentSpanId;
    this.sampled = spanContext.sampled;
    this.spanId = spanContext.spanId || this.spanId;
    this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;
    this.status = spanContext.status;
    this.tags = spanContext.tags || {};
    this.traceId = spanContext.traceId || this.traceId;

    return this;
  }

  /**
   * @inheritDoc
   */
   getTraceContext() {
    return utils.dropUndefinedKeys({
      data: Object.keys(this.data).length > 0 ? this.data : undefined,
      description: this.description,
      op: this.op,
      parent_span_id: this.parentSpanId,
      span_id: this.spanId,
      status: this.status,
      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
      trace_id: this.traceId,
    });
  }

  /**
   * @inheritDoc
   */
   toJSON()

 {
    return utils.dropUndefinedKeys({
      data: Object.keys(this.data).length > 0 ? this.data : undefined,
      description: this.description,
      op: this.op,
      parent_span_id: this.parentSpanId,
      span_id: this.spanId,
      start_timestamp: this.startTimestamp,
      status: this.status,
      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
      timestamp: this.endTimestamp,
      trace_id: this.traceId,
    });
  }
}

/**
 * Converts a HTTP status code into a {@link SpanStatusType}.
 *
 * @param httpStatus The HTTP response status code.
 * @returns The span status or unknown_error.
 */
function spanStatusfromHttpCode(httpStatus) {
  if (httpStatus < 400 && httpStatus >= 100) {
    return 'ok';
  }

  if (httpStatus >= 400 && httpStatus < 500) {
    switch (httpStatus) {
      case 401:
        return 'unauthenticated';
      case 403:
        return 'permission_denied';
      case 404:
        return 'not_found';
      case 409:
        return 'already_exists';
      case 413:
        return 'failed_precondition';
      case 429:
        return 'resource_exhausted';
      default:
        return 'invalid_argument';
    }
  }

  if (httpStatus >= 500 && httpStatus < 600) {
    switch (httpStatus) {
      case 501:
        return 'unimplemented';
      case 503:
        return 'unavailable';
      case 504:
        return 'deadline_exceeded';
      default:
        return 'internal_error';
    }
  }

  return 'unknown_error';
}

exports.Span = Span;
exports.SpanRecorder = SpanRecorder;
exports.spanStatusfromHttpCode = spanStatusfromHttpCode;
//# sourceMappingURL=span.js.map
{"version":3,"file":"span.js","sources":["../../../src/tracing/span.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Instrumenter,\n  Primitive,\n  Span as SpanInterface,\n  SpanContext,\n  TraceContext,\n  Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampWithMs, uuid4 } from '@sentry/utils';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n  public spans: Span[] = [];\n\n  private readonly _maxlen: number;\n\n  public constructor(maxlen: number = 1000) {\n    this._maxlen = maxlen;\n  }\n\n  /**\n   * This is just so that we don't run out of memory while recording a lot\n   * of spans. At some point we just stop and flush out the start of the\n   * trace tree (i.e.the first n spans with the smallest\n   * start_timestamp).\n   */\n  public add(span: Span): void {\n    if (this.spans.length > this._maxlen) {\n      span.spanRecorder = undefined;\n    } else {\n      this.spans.push(span);\n    }\n  }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n  /**\n   * @inheritDoc\n   */\n  public traceId: string = uuid4();\n\n  /**\n   * @inheritDoc\n   */\n  public spanId: string = uuid4().substring(16);\n\n  /**\n   * @inheritDoc\n   */\n  public parentSpanId?: string;\n\n  /**\n   * Internal keeper of the status\n   */\n  public status?: SpanStatusType | string;\n\n  /**\n   * @inheritDoc\n   */\n  public sampled?: boolean;\n\n  /**\n   * Timestamp in seconds when the span was created.\n   */\n  public startTimestamp: number = timestampWithMs();\n\n  /**\n   * Timestamp in seconds when the span ended.\n   */\n  public endTimestamp?: number;\n\n  /**\n   * @inheritDoc\n   */\n  public op?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public description?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public tags: { [key: string]: Primitive } = {};\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public data: { [key: string]: any } = {};\n\n  /**\n   * List of spans that were finalized\n   */\n  public spanRecorder?: SpanRecorder;\n\n  /**\n   * @inheritDoc\n   */\n  public transaction?: Transaction;\n\n  /**\n   * The instrumenter that created this span.\n   */\n  public instrumenter: Instrumenter = 'sentry';\n\n  /**\n   * You should never call the constructor manually, always use `Sentry.startTransaction()`\n   * or call `startChild()` on an existing span.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(spanContext?: SpanContext) {\n    if (!spanContext) {\n      return this;\n    }\n    if (spanContext.traceId) {\n      this.traceId = spanContext.traceId;\n    }\n    if (spanContext.spanId) {\n      this.spanId = spanContext.spanId;\n    }\n    if (spanContext.parentSpanId) {\n      this.parentSpanId = spanContext.parentSpanId;\n    }\n    // We want to include booleans as well here\n    if ('sampled' in spanContext) {\n      this.sampled = spanContext.sampled;\n    }\n    if (spanContext.op) {\n      this.op = spanContext.op;\n    }\n    if (spanContext.description) {\n      this.description = spanContext.description;\n    }\n    if (spanContext.data) {\n      this.data = spanContext.data;\n    }\n    if (spanContext.tags) {\n      this.tags = spanContext.tags;\n    }\n    if (spanContext.status) {\n      this.status = spanContext.status;\n    }\n    if (spanContext.startTimestamp) {\n      this.startTimestamp = spanContext.startTimestamp;\n    }\n    if (spanContext.endTimestamp) {\n      this.endTimestamp = spanContext.endTimestamp;\n    }\n    if (spanContext.instrumenter) {\n      this.instrumenter = spanContext.instrumenter;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startChild(\n    spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n  ): Span {\n    const childSpan = new Span({\n      ...spanContext,\n      parentSpanId: this.spanId,\n      sampled: this.sampled,\n      traceId: this.traceId,\n    });\n\n    childSpan.spanRecorder = this.spanRecorder;\n    if (childSpan.spanRecorder) {\n      childSpan.spanRecorder.add(childSpan);\n    }\n\n    childSpan.transaction = this.transaction;\n\n    if (__DEBUG_BUILD__ && childSpan.transaction) {\n      const opStr = (spanContext && spanContext.op) || '< unknown op >';\n      const nameStr = childSpan.transaction.name || '< unknown name >';\n      const idStr = childSpan.transaction.spanId;\n\n      const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n      childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };\n      logger.log(logMessage);\n    }\n\n    return childSpan;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this.tags = { ...this.tags, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public setData(key: string, value: any): this {\n    this.data = { ...this.data, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setStatus(value: SpanStatusType): this {\n    this.status = value;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setHttpStatus(httpStatus: number): this {\n    this.setTag('http.status_code', String(httpStatus));\n    const spanStatus = spanStatusfromHttpCode(httpStatus);\n    if (spanStatus !== 'unknown_error') {\n      this.setStatus(spanStatus);\n    }\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isSuccess(): boolean {\n    return this.status === 'ok';\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): void {\n    if (\n      __DEBUG_BUILD__ &&\n      // Don't call this for transactions\n      this.transaction &&\n      this.transaction.spanId !== this.spanId\n    ) {\n      const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];\n      if (logMessage) {\n        logger.log((logMessage as string).replace('Starting', 'Finishing'));\n      }\n    }\n\n    this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toTraceparent(): string {\n    let sampledString = '';\n    if (this.sampled !== undefined) {\n      sampledString = this.sampled ? '-1' : '-0';\n    }\n    return `${this.traceId}-${this.spanId}${sampledString}`;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): SpanContext {\n    return dropUndefinedKeys({\n      data: this.data,\n      description: this.description,\n      endTimestamp: this.endTimestamp,\n      op: this.op,\n      parentSpanId: this.parentSpanId,\n      sampled: this.sampled,\n      spanId: this.spanId,\n      startTimestamp: this.startTimestamp,\n      status: this.status,\n      tags: this.tags,\n      traceId: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(spanContext: SpanContext): this {\n    this.data = spanContext.data || {};\n    this.description = spanContext.description;\n    this.endTimestamp = spanContext.endTimestamp;\n    this.op = spanContext.op;\n    this.parentSpanId = spanContext.parentSpanId;\n    this.sampled = spanContext.sampled;\n    this.spanId = spanContext.spanId || this.spanId;\n    this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;\n    this.status = spanContext.status;\n    this.tags = spanContext.tags || {};\n    this.traceId = spanContext.traceId || this.traceId;\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTraceContext(): TraceContext {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      trace_id: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toJSON(): {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    data?: { [key: string]: any };\n    description?: string;\n    op?: string;\n    parent_span_id?: string;\n    span_id: string;\n    start_timestamp: number;\n    status?: string;\n    tags?: { [key: string]: Primitive };\n    timestamp?: number;\n    trace_id: string;\n  } {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      start_timestamp: this.startTimestamp,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      timestamp: this.endTimestamp,\n      trace_id: this.traceId,\n    });\n  }\n}\n\nexport type SpanStatusType =\n  /** The operation completed successfully. */\n  | 'ok'\n  /** Deadline expired before operation could complete. */\n  | 'deadline_exceeded'\n  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n  | 'unauthenticated'\n  /** 403 Forbidden */\n  | 'permission_denied'\n  /** 404 Not Found. Some requested entity (file or directory) was not found. */\n  | 'not_found'\n  /** 429 Too Many Requests */\n  | 'resource_exhausted'\n  /** Client specified an invalid argument. 4xx. */\n  | 'invalid_argument'\n  /** 501 Not Implemented */\n  | 'unimplemented'\n  /** 503 Service Unavailable */\n  | 'unavailable'\n  /** Other/generic 5xx. */\n  | 'internal_error'\n  /** Unknown. Any non-standard HTTP status code. */\n  | 'unknown_error'\n  /** The operation was cancelled (typically by the user). */\n  | 'cancelled'\n  /** Already exists (409) */\n  | 'already_exists'\n  /** Operation was rejected because the system is not in a state required for the operation's */\n  | 'failed_precondition'\n  /** The operation was aborted, typically due to a concurrency issue. */\n  | 'aborted'\n  /** Operation was attempted past the valid range. */\n  | 'out_of_range'\n  /** Unrecoverable data loss or corruption */\n  | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function spanStatusfromHttpCode(httpStatus: number): SpanStatusType {\n  if (httpStatus < 400 && httpStatus >= 100) {\n    return 'ok';\n  }\n\n  if (httpStatus >= 400 && httpStatus < 500) {\n    switch (httpStatus) {\n      case 401:\n        return 'unauthenticated';\n      case 403:\n        return 'permission_denied';\n      case 404:\n        return 'not_found';\n      case 409:\n        return 'already_exists';\n      case 413:\n        return 'failed_precondition';\n      case 429:\n        return 'resource_exhausted';\n      default:\n        return 'invalid_argument';\n    }\n  }\n\n  if (httpStatus >= 500 && httpStatus < 600) {\n    switch (httpStatus) {\n      case 501:\n        return 'unimplemented';\n      case 503:\n        return 'unavailable';\n      case 504:\n        return 'deadline_exceeded';\n      default:\n        return 'internal_error';\n    }\n  }\n\n  return 'unknown_error';\n}\n"],"names":["uuid4","timestampWithMs","logger","dropUndefinedKeys"],"mappings":";;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,YAAA,CAAA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,KAAA,GAAA,GAAA,CAAA;;AAIA,GAAA,WAAA,CAAA,MAAA,GAAA,IAAA,EAAA,CAAA,YAAA,CAAA,SAAA,CAAA,M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AACA,QAAA,OAAA,gBAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,eAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/** The status of an Span.
 *
 * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type
 */
// eslint-disable-next-line import/export
exports.SpanStatus = void 0; (function (SpanStatus) {
  /** The operation completed successfully. */
  const Ok = 'ok'; SpanStatus["Ok"] = Ok;
  /** Deadline expired before operation could complete. */
  const DeadlineExceeded = 'deadline_exceeded'; SpanStatus["DeadlineExceeded"] = DeadlineExceeded;
  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
  const Unauthenticated = 'unauthenticated'; SpanStatus["Unauthenticated"] = Unauthenticated;
  /** 403 Forbidden */
  const PermissionDenied = 'permission_denied'; SpanStatus["PermissionDenied"] = PermissionDenied;
  /** 404 Not Found. Some requested entity (file or directory) was not found. */
  const NotFound = 'not_found'; SpanStatus["NotFound"] = NotFound;
  /** 429 Too Many Requests */
  const ResourceExhausted = 'resource_exhausted'; SpanStatus["ResourceExhausted"] = ResourceExhausted;
  /** Client specified an invalid argument. 4xx. */
  const InvalidArgument = 'invalid_argument'; SpanStatus["InvalidArgument"] = InvalidArgument;
  /** 501 Not Implemented */
  const Unimplemented = 'unimplemented'; SpanStatus["Unimplemented"] = Unimplemented;
  /** 503 Service Unavailable */
  const Unavailable = 'unavailable'; SpanStatus["Unavailable"] = Unavailable;
  /** Other/generic 5xx. */
  const InternalError = 'internal_error'; SpanStatus["InternalError"] = InternalError;
  /** Unknown. Any non-standard HTTP status code. */
  const UnknownError = 'unknown_error'; SpanStatus["UnknownError"] = UnknownError;
  /** The operation was cancelled (typically by the user). */
  const Cancelled = 'cancelled'; SpanStatus["Cancelled"] = Cancelled;
  /** Already exists (409) */
  const AlreadyExists = 'already_exists'; SpanStatus["AlreadyExists"] = AlreadyExists;
  /** Operation was rejected because the system is not in a state required for the operation's */
  const FailedPrecondition = 'failed_precondition'; SpanStatus["FailedPrecondition"] = FailedPrecondition;
  /** The operation was aborted, typically due to a concurrency issue. */
  const Aborted = 'aborted'; SpanStatus["Aborted"] = Aborted;
  /** Operation was attempted past the valid range. */
  const OutOfRange = 'out_of_range'; SpanStatus["OutOfRange"] = OutOfRange;
  /** Unrecoverable data loss or corruption */
  const DataLoss = 'data_loss'; SpanStatus["DataLoss"] = DataLoss;
})(exports.SpanStatus || (exports.SpanStatus = {}));
//# sourceMappingURL=spanstatus.js.map
{"version":3,"file":"spanstatus.js","sources":["../../../src/tracing/spanstatus.ts"],"sourcesContent":["/** The status of an Span.\n *\n * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type\n */\n// eslint-disable-next-line import/export\nexport enum SpanStatus {\n  /** The operation completed successfully. */\n  Ok = 'ok',\n  /** Deadline expired before operation could complete. */\n  DeadlineExceeded = 'deadline_exceeded',\n  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n  Unauthenticated = 'unauthenticated',\n  /** 403 Forbidden */\n  PermissionDenied = 'permission_denied',\n  /** 404 Not Found. Some requested entity (file or directory) was not found. */\n  NotFound = 'not_found',\n  /** 429 Too Many Requests */\n  ResourceExhausted = 'resource_exhausted',\n  /** Client specified an invalid argument. 4xx. */\n  InvalidArgument = 'invalid_argument',\n  /** 501 Not Implemented */\n  Unimplemented = 'unimplemented',\n  /** 503 Service Unavailable */\n  Unavailable = 'unavailable',\n  /** Other/generic 5xx. */\n  InternalError = 'internal_error',\n  /** Unknown. Any non-standard HTTP status code. */\n  UnknownError = 'unknown_error',\n  /** The operation was cancelled (typically by the user). */\n  Cancelled = 'cancelled',\n  /** Already exists (409) */\n  AlreadyExists = 'already_exists',\n  /** Operation was rejected because the system is not in a state required for the operation's */\n  FailedPrecondition = 'failed_precondition',\n  /** The operation was aborted, typically due to a concurrency issue. */\n  Aborted = 'aborted',\n  /** Operation was attempted past the valid range. */\n  OutOfRange = 'out_of_range',\n  /** Unrecoverable data loss or corruption */\n  DataLoss = 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AA,GAAA,SAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,gBAAA,CAAA,CAAA,UAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA;AACA,EAAA,MAAA,kBAAA,GAAA,qBAAA,CAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,GAAA,kBAAA,CAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,SAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,cAAA,CAAA,CAAA,UAAA,CAAA,YAAA,CAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,WAAA,CAAA,CAAA,UAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA;AACA,CAAA,EAAAA,kBAAA,KAAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const hub = require('../hub.js');

/**
 * Wraps a function with a transaction/span and finishes the span after the function is done.
 *
 * Note that if you have not enabled tracing extensions via `addTracingExtensions`, this function
 * will not generate spans, and the `span` returned from the callback may be undefined.
 *
 * This function is meant to be used internally and may break at any time. Use at your own risk.
 *
 * @internal
 * @private
 */
function trace(
  context,
  callback,
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  onError = () => {},
) {
  const ctx = { ...context };
  // If a name is set and a description is not, set the description to the name.
  if (ctx.name !== undefined && ctx.description === undefined) {
    ctx.description = ctx.name;
  }

  const hub$1 = hub.getCurrentHub();
  const scope = hub$1.getScope();

  const parentSpan = scope.getSpan();
  const activeSpan = parentSpan ? parentSpan.startChild(ctx) : hub$1.startTransaction(ctx);
  scope.setSpan(activeSpan);

  function finishAndSetSpan() {
    activeSpan && activeSpan.finish();
    hub$1.getScope().setSpan(parentSpan);
  }

  let maybePromiseResult;
  try {
    maybePromiseResult = callback(activeSpan);
  } catch (e) {
    activeSpan && activeSpan.setStatus('internal_error');
    onError(e);
    finishAndSetSpan();
    throw e;
  }

  if (utils.isThenable(maybePromiseResult)) {
    Promise.resolve(maybePromiseResult).then(
      () => {
        finishAndSetSpan();
      },
      e => {
        activeSpan && activeSpan.setStatus('internal_error');
        onError(e);
        finishAndSetSpan();
      },
    );
  } else {
    finishAndSetSpan();
  }

  return maybePromiseResult;
}

exports.trace = trace;
//# sourceMappingURL=trace.js.map
{"version":3,"file":"trace.js","sources":["../../../src/tracing/trace.ts"],"sourcesContent":["import type { TransactionContext } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport { getCurrentHub } from '../hub';\nimport type { Span } from './span';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`, this function\n * will not generate spans, and the `span` returned from the callback may be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n */\nexport function trace<T>(\n  context: TransactionContext,\n  callback: (span?: Span) => T,\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  onError: (error: unknown) => void = () => {},\n): T {\n  const ctx = { ...context };\n  // If a name is set and a description is not, set the description to the name.\n  if (ctx.name !== undefined && ctx.description === undefined) {\n    ctx.description = ctx.name;\n  }\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n\n  const parentSpan = scope.getSpan();\n  const activeSpan = parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);\n  scope.setSpan(activeSpan);\n\n  function finishAndSetSpan(): void {\n    activeSpan && activeSpan.finish();\n    hub.getScope().setSpan(parentSpan);\n  }\n\n  let maybePromiseResult: T;\n  try {\n    maybePromiseResult = callback(activeSpan);\n  } catch (e) {\n    activeSpan && activeSpan.setStatus('internal_error');\n    onError(e);\n    finishAndSetSpan();\n    throw e;\n  }\n\n  if (isThenable(maybePromiseResult)) {\n    Promise.resolve(maybePromiseResult).then(\n      () => {\n        finishAndSetSpan();\n      },\n      e => {\n        activeSpan && activeSpan.setStatus('internal_error');\n        onError(e);\n        finishAndSetSpan();\n      },\n    );\n  } else {\n    finishAndSetSpan();\n  }\n\n  return maybePromiseResult;\n}\n"],"names":["hub","getCurrentHub","isThenable"],"mappings":";;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,QAAA;AACA;AACA,EAAA,OAAA,GAAA,MAAA,EAAA;AACA,EAAA;AACA,EAAA,MAAA,GAAA,GAAA,EAAA,GAAA,OAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,GAAA,CAAA,IAAA,KAAA,SAAA,IAAA,GAAA,CAAA,WAAA,KAAA,SAAA,EAAA;AACA,IAAA,GAAA,CAAA,WAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAAA,KAAA,GAAAC,iBAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAAD,KAAA,CAAA,QAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,KAAA,CAAA,OAAA,EAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,UAAA,GAAA,UAAA,CAAA,UAAA,CAAA,GAAA,CAAA,GAAAA,KAAA,CAAA,gBAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,KAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AACA;AACA,EAAA,SAAA,gBAAA,GAAA;AACA,IAAA,UAAA,IAAA,UAAA,CAAA,MAAA,EAAA,CAAA;AACA,IAAAA,KAAA,CAAA,QAAA,EAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA;AACA,EAAA,IAAA;AACA,IAAA,kBAAA,GAAA,QAAA,CAAA,UAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,UAAA,IAAA,UAAA,CAAA,SAAA,CAAA,gBAAA,CAAA,CAAA;AACA,IAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,gBAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAAE,gBAAA,CAAA,kBAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,CAAA,IAAA;AACA,MAAA,MAAA;AACA,QAAA,gBAAA,EAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA;AACA,QAAA,UAAA,IAAA,UAAA,CAAA,SAAA,CAAA,gBAAA,CAAA,CAAA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,gBAAA,EAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,gBAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const constants = require('../constants.js');
const hub = require('../hub.js');
const span = require('./span.js');

/** JSDoc */
class Transaction extends span.Span  {

  /**
   * The reference to the current hub.
   */

   __init() {this._measurements = {};}

   __init2() {this._contexts = {};}

   __init3() {this._frozenDynamicSamplingContext = undefined;}

  /**
   * This constructor should never be called manually. Those instrumenting tracing should use
   * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.
   * @internal
   * @hideconstructor
   * @hidden
   */
   constructor(transactionContext, hub$1) {
    super(transactionContext);Transaction.prototype.__init.call(this);Transaction.prototype.__init2.call(this);Transaction.prototype.__init3.call(this);
    this._hub = hub$1 || hub.getCurrentHub();

    this._name = transactionContext.name || '';

    this.metadata = {
      source: 'custom',
      ...transactionContext.metadata,
      spanMetadata: {},
    };

    this._trimEnd = transactionContext.trimEnd;

    // this is because transactions are also spans, and spans have a transaction pointer
    this.transaction = this;

    // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means
    // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)
    const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;
    if (incomingDynamicSamplingContext) {
      // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`
      this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };
    }
  }

  /** Getter for `name` property */
   get name() {
    return this._name;
  }

  /** Setter for `name` property, which also sets `source` as custom */
   set name(newName) {
    this.setName(newName);
  }

  /**
   * JSDoc
   */
   setName(name, source = 'custom') {
    this._name = name;
    this.metadata.source = source;
  }

  /**
   * Attaches SpanRecorder to the span itself
   * @param maxlen maximum number of spans that can be recorded
   */
   initSpanRecorder(maxlen = 1000) {
    if (!this.spanRecorder) {
      this.spanRecorder = new span.SpanRecorder(maxlen);
    }
    this.spanRecorder.add(this);
  }

  /**
   * @inheritDoc
   */
   setContext(key, context) {
    if (context === null) {
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this._contexts[key];
    } else {
      this._contexts[key] = context;
    }
  }

  /**
   * @inheritDoc
   */
   setMeasurement(name, value, unit = '') {
    this._measurements[name] = { value, unit };
  }

  /**
   * @inheritDoc
   */
   setMetadata(newMetadata) {
    this.metadata = { ...this.metadata, ...newMetadata };
  }

  /**
   * @inheritDoc
   */
   finish(endTimestamp) {
    // This transaction is already finished, so we should not flush it again.
    if (this.endTimestamp !== undefined) {
      return undefined;
    }

    if (!this.name) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');
      this.name = '<unlabeled transaction>';
    }

    // just sets the end timestamp
    super.finish(endTimestamp);

    const client = this._hub.getClient();
    if (client && client.emit) {
      client.emit('finishTransaction', this);
    }

    if (this.sampled !== true) {
      // At this point if `sampled !== true` we want to discard the transaction.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');

      if (client) {
        client.recordDroppedEvent('sample_rate', 'transaction');
      }

      return undefined;
    }

    const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];

    if (this._trimEnd && finishedSpans.length > 0) {
      this.endTimestamp = finishedSpans.reduce((prev, current) => {
        if (prev.endTimestamp && current.endTimestamp) {
          return prev.endTimestamp > current.endTimestamp ? prev : current;
        }
        return prev;
      }).endTimestamp;
    }

    const metadata = this.metadata;

    const transaction = {
      contexts: {
        ...this._contexts,
        // We don't want to override trace context
        trace: this.getTraceContext(),
      },
      spans: finishedSpans,
      start_timestamp: this.startTimestamp,
      tags: this.tags,
      timestamp: this.endTimestamp,
      transaction: this.name,
      type: 'transaction',
      sdkProcessingMetadata: {
        ...metadata,
        dynamicSamplingContext: this.getDynamicSamplingContext(),
      },
      ...(metadata.source && {
        transaction_info: {
          source: metadata.source,
        },
      }),
    };

    const hasMeasurements = Object.keys(this._measurements).length > 0;

    if (hasMeasurements) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.log(
          '[Measurements] Adding measurements to transaction',
          JSON.stringify(this._measurements, undefined, 2),
        );
      transaction.measurements = this._measurements;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);

    return this._hub.captureEvent(transaction);
  }

  /**
   * @inheritDoc
   */
   toContext() {
    const spanContext = super.toContext();

    return utils.dropUndefinedKeys({
      ...spanContext,
      name: this.name,
      trimEnd: this._trimEnd,
    });
  }

  /**
   * @inheritDoc
   */
   updateWithContext(transactionContext) {
    super.updateWithContext(transactionContext);

    this.name = transactionContext.name || '';

    this._trimEnd = transactionContext.trimEnd;

    return this;
  }

  /**
   * @inheritdoc
   *
   * @experimental
   */
   getDynamicSamplingContext() {
    if (this._frozenDynamicSamplingContext) {
      return this._frozenDynamicSamplingContext;
    }

    const hub$1 = this._hub || hub.getCurrentHub();
    const client = hub$1 && hub$1.getClient();

    if (!client) return {};

    const { environment, release } = client.getOptions() || {};
    const { publicKey: public_key } = client.getDsn() || {};

    const maybeSampleRate = this.metadata.sampleRate;
    const sample_rate = maybeSampleRate !== undefined ? maybeSampleRate.toString() : undefined;

    const { segment: user_segment } = hub$1.getScope().getUser() || {};

    const source = this.metadata.source;

    // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII
    const transaction = source && source !== 'url' ? this.name : undefined;

    const dsc = utils.dropUndefinedKeys({
      environment: environment || constants.DEFAULT_ENVIRONMENT,
      release,
      transaction,
      user_segment,
      public_key,
      trace_id: this.traceId,
      sample_rate,
    });

    // Uncomment if we want to make DSC immutable
    // this._frozenDynamicSamplingContext = dsc;

    client.emit && client.emit('createDsc', dsc);

    return dsc;
  }

  /**
   * Override the current hub with a new one.
   * Used if you want another hub to finish the transaction.
   *
   * @internal
   */
   setHub(hub) {
    this._hub = hub;
  }
}

exports.Transaction = Transaction;
//# sourceMappingURL=transaction.js.map
{"version":3,"file":"transaction.js","sources":["../../../src/tracing/transaction.ts"],"sourcesContent":["import type {\n  Context,\n  Contexts,\n  DynamicSamplingContext,\n  Event,\n  Measurements,\n  MeasurementUnit,\n  Transaction as TransactionInterface,\n  TransactionContext,\n  TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { Span as SpanClass, SpanRecorder } from './span';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n  public metadata: TransactionMetadata;\n\n  /**\n   * The reference to the current hub.\n   */\n  public _hub: Hub;\n\n  private _name: string;\n\n  private _measurements: Measurements = {};\n\n  private _contexts: Contexts = {};\n\n  private _trimEnd?: boolean;\n\n  private _frozenDynamicSamplingContext: Readonly<Partial<DynamicSamplingContext>> | undefined = undefined;\n\n  /**\n   * This constructor should never be called manually. Those instrumenting tracing should use\n   * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(transactionContext: TransactionContext, hub?: Hub) {\n    super(transactionContext);\n\n    this._hub = hub || getCurrentHub();\n\n    this._name = transactionContext.name || '';\n\n    this.metadata = {\n      source: 'custom',\n      ...transactionContext.metadata,\n      spanMetadata: {},\n    };\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    // this is because transactions are also spans, and spans have a transaction pointer\n    this.transaction = this;\n\n    // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n    // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n    const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;\n    if (incomingDynamicSamplingContext) {\n      // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n      this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n    }\n  }\n\n  /** Getter for `name` property */\n  public get name(): string {\n    return this._name;\n  }\n\n  /** Setter for `name` property, which also sets `source` as custom */\n  public set name(newName: string) {\n    this.setName(newName);\n  }\n\n  /**\n   * JSDoc\n   */\n  public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n    this._name = name;\n    this.metadata.source = source;\n  }\n\n  /**\n   * Attaches SpanRecorder to the span itself\n   * @param maxlen maximum number of spans that can be recorded\n   */\n  public initSpanRecorder(maxlen: number = 1000): void {\n    if (!this.spanRecorder) {\n      this.spanRecorder = new SpanRecorder(maxlen);\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): void {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n    this._measurements[name] = { value, unit };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMetadata(newMetadata: Partial<TransactionMetadata>): void {\n    this.metadata = { ...this.metadata, ...newMetadata };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): string | undefined {\n    // This transaction is already finished, so we should not flush it again.\n    if (this.endTimestamp !== undefined) {\n      return undefined;\n    }\n\n    if (!this.name) {\n      __DEBUG_BUILD__ && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');\n      this.name = '<unlabeled transaction>';\n    }\n\n    // just sets the end timestamp\n    super.finish(endTimestamp);\n\n    const client = this._hub.getClient();\n    if (client && client.emit) {\n      client.emit('finishTransaction', this);\n    }\n\n    if (this.sampled !== true) {\n      // At this point if `sampled !== true` we want to discard the transaction.\n      __DEBUG_BUILD__ && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n      if (client) {\n        client.recordDroppedEvent('sample_rate', 'transaction');\n      }\n\n      return undefined;\n    }\n\n    const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];\n\n    if (this._trimEnd && finishedSpans.length > 0) {\n      this.endTimestamp = finishedSpans.reduce((prev: SpanClass, current: SpanClass) => {\n        if (prev.endTimestamp && current.endTimestamp) {\n          return prev.endTimestamp > current.endTimestamp ? prev : current;\n        }\n        return prev;\n      }).endTimestamp;\n    }\n\n    const metadata = this.metadata;\n\n    const transaction: Event = {\n      contexts: {\n        ...this._contexts,\n        // We don't want to override trace context\n        trace: this.getTraceContext(),\n      },\n      spans: finishedSpans,\n      start_timestamp: this.startTimestamp,\n      tags: this.tags,\n      timestamp: this.endTimestamp,\n      transaction: this.name,\n      type: 'transaction',\n      sdkProcessingMetadata: {\n        ...metadata,\n        dynamicSamplingContext: this.getDynamicSamplingContext(),\n      },\n      ...(metadata.source && {\n        transaction_info: {\n          source: metadata.source,\n        },\n      }),\n    };\n\n    const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n    if (hasMeasurements) {\n      __DEBUG_BUILD__ &&\n        logger.log(\n          '[Measurements] Adding measurements to transaction',\n          JSON.stringify(this._measurements, undefined, 2),\n        );\n      transaction.measurements = this._measurements;\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);\n\n    return this._hub.captureEvent(transaction);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): TransactionContext {\n    const spanContext = super.toContext();\n\n    return dropUndefinedKeys({\n      ...spanContext,\n      name: this.name,\n      trimEnd: this._trimEnd,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(transactionContext: TransactionContext): this {\n    super.updateWithContext(transactionContext);\n\n    this.name = transactionContext.name || '';\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    return this;\n  }\n\n  /**\n   * @inheritdoc\n   *\n   * @experimental\n   */\n  public getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>> {\n    if (this._frozenDynamicSamplingContext) {\n      return this._frozenDynamicSamplingContext;\n    }\n\n    const hub: Hub = this._hub || getCurrentHub();\n    const client = hub && hub.getClient();\n\n    if (!client) return {};\n\n    const { environment, release } = client.getOptions() || {};\n    const { publicKey: public_key } = client.getDsn() || {};\n\n    const maybeSampleRate = this.metadata.sampleRate;\n    const sample_rate = maybeSampleRate !== undefined ? maybeSampleRate.toString() : undefined;\n\n    const { segment: user_segment } = hub.getScope().getUser() || {};\n\n    const source = this.metadata.source;\n\n    // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n    const transaction = source && source !== 'url' ? this.name : undefined;\n\n    const dsc = dropUndefinedKeys({\n      environment: environment || DEFAULT_ENVIRONMENT,\n      release,\n      transaction,\n      user_segment,\n      public_key,\n      trace_id: this.traceId,\n      sample_rate,\n    });\n\n    // Uncomment if we want to make DSC immutable\n    // this._frozenDynamicSamplingContext = dsc;\n\n    client.emit && client.emit('createDsc', dsc);\n\n    return dsc;\n  }\n\n  /**\n   * Override the current hub with a new one.\n   * Used if you want another hub to finish the transaction.\n   *\n   * @internal\n   */\n  public setHub(hub: Hub): void {\n    this._hub = hub;\n  }\n}\n"],"names":["SpanClass","hub","getCurrentHub","SpanRecorder","logger","dropUndefinedKeys","DEFAULT_ENVIRONMENT"],"mappings":";;;;;;;AAkBA;AACA,MAAA,WAAA,SAAAA,SAAA,EAAA;;AAGA;AACA;AACA;;AAKA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,aAAA,GAAA,GAAA,CAAA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,SAAA,GAAA,GAAA,CAAA;;AAIA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,6BAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,kBAAA,EAAAC,KAAA,EAAA;AACA,IAAA,KAAA,CAAA,kBAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CACA;AACA,IAAA,IAAA,CAAA,IAAA,GAAAA,KAAA,IAAAC,iBAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,kBAAA,CAAA,IAAA,IAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,MAAA,EAAA,QAAA;AACA,MAAA,GAAA,kBAAA,CAAA,QAAA;AACA,MAAA,YAAA,EAAA,EAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,kBAAA,CAAA,OAAA,CAAA;AACA;AACA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,MAA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AACA,MAAA,UAAA;AACA,MAAA,QAAA,EAAA,IAAA,CAAA,OAAA;AACA,MAAA,WAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,MAAA,CAAA,IAAA,IAAA,MAAA,CAAA,IAAA,CAAA,WAAA,EAAA,GAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,CAAA,GAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,GAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const hub = require('../hub.js');
const utils = require('@sentry/utils');

/** Grabs active transaction off scope, if any */
function getActiveTransaction(maybeHub) {
  const hub$1 = maybeHub || hub.getCurrentHub();
  const scope = hub$1.getScope();
  return scope.getTransaction() ;
}

exports.TRACEPARENT_REGEXP = utils.TRACEPARENT_REGEXP;
exports.extractTraceparentData = utils.extractTraceparentData;
exports.stripUrlQueryAndFragment = utils.stripUrlQueryAndFragment;
exports.getActiveTransaction = getActiveTransaction;
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../src/tracing/utils.ts"],"sourcesContent":["import type { Transaction } from '@sentry/types';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * TODO(v7): Reorganize these exports\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n */\nexport { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils';\n\n/** Grabs active transaction off scope, if any */\nexport function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined {\n  const hub = maybeHub || getCurrentHub();\n  const scope = hub.getScope();\n  return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n"],"names":["hub","getCurrentHub"],"mappings":";;;;;AAmBA;AACA,SAAA,oBAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAAA,KAAA,GAAA,QAAA,IAAAC,iBAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAAD,KAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,OAAA,KAAA,CAAA,cAAA,EAAA,EAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;

/**
 * Creates an instance of a Sentry `Transport`
 *
 * @param options
 * @param makeRequest
 */
function createTransport(
  options,
  makeRequest,
  buffer = utils.makePromiseBuffer(
    options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,
  ),
) {
  let rateLimits = {};
  const flush = (timeout) => buffer.drain(timeout);

  function send(envelope) {
    const filteredEnvelopeItems = [];

    // Drop rate limited items from envelope
    utils.forEachEnvelopeItem(envelope, (item, type) => {
      const envelopeItemDataCategory = utils.envelopeItemTypeToDataCategory(type);
      if (utils.isRateLimited(rateLimits, envelopeItemDataCategory)) {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);
      } else {
        filteredEnvelopeItems.push(item);
      }
    });

    // Skip sending if envelope is empty after filtering out rate limited events
    if (filteredEnvelopeItems.length === 0) {
      return utils.resolvedSyncPromise();
    }

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const filteredEnvelope = utils.createEnvelope(envelope[0], filteredEnvelopeItems );

    // Creates client report for each item in an envelope
    const recordEnvelopeLoss = (reason) => {
      utils.forEachEnvelopeItem(filteredEnvelope, (item, type) => {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent(reason, utils.envelopeItemTypeToDataCategory(type), event);
      });
    };

    const requestTask = () =>
      makeRequest({ body: utils.serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(
        response => {
          // We don't want to throw on NOK responses, but we want to at least log them
          if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
          }

          rateLimits = utils.updateRateLimits(rateLimits, response);
          return response;
        },
        error => {
          recordEnvelopeLoss('network_error');
          throw error;
        },
      );

    return buffer.add(requestTask).then(
      result => result,
      error => {
        if (error instanceof utils.SentryError) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('Skipped sending event because buffer is full.');
          recordEnvelopeLoss('queue_overflow');
          return utils.resolvedSyncPromise();
        } else {
          throw error;
        }
      },
    );
  }

  // We use this to identifify if the transport is the base transport
  // TODO (v8): Remove this again as we'll no longer need it
  send.__sentry__baseTransport__ = true;

  return {
    send,
    flush,
  };
}

function getEventForEnvelopeItem(item, type) {
  if (type !== 'event' && type !== 'transaction') {
    return undefined;
  }

  return Array.isArray(item) ? (item )[1] : undefined;
}

exports.DEFAULT_TRANSPORT_BUFFER_SIZE = DEFAULT_TRANSPORT_BUFFER_SIZE;
exports.createTransport = createTransport;
//# sourceMappingURL=base.js.map
{"version":3,"file":"base.js","sources":["../../../src/transports/base.ts"],"sourcesContent":["import type {\n  Envelope,\n  EnvelopeItem,\n  EnvelopeItemType,\n  Event,\n  EventDropReason,\n  EventItem,\n  InternalBaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n  createEnvelope,\n  envelopeItemTypeToDataCategory,\n  forEachEnvelopeItem,\n  isRateLimited,\n  logger,\n  makePromiseBuffer,\n  resolvedSyncPromise,\n  SentryError,\n  serializeEnvelope,\n  updateRateLimits,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n  options: InternalBaseTransportOptions,\n  makeRequest: TransportRequestExecutor,\n  buffer: PromiseBuffer<void | TransportMakeRequestResponse> = makePromiseBuffer(\n    options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n  ),\n): Transport {\n  let rateLimits: RateLimits = {};\n  const flush = (timeout?: number): PromiseLike<boolean> => buffer.drain(timeout);\n\n  function send(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> {\n    const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n    // Drop rate limited items from envelope\n    forEachEnvelopeItem(envelope, (item, type) => {\n      const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);\n      if (isRateLimited(rateLimits, envelopeItemDataCategory)) {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);\n      } else {\n        filteredEnvelopeItems.push(item);\n      }\n    });\n\n    // Skip sending if envelope is empty after filtering out rate limited events\n    if (filteredEnvelopeItems.length === 0) {\n      return resolvedSyncPromise();\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n    // Creates client report for each item in an envelope\n    const recordEnvelopeLoss = (reason: EventDropReason): void => {\n      forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n      });\n    };\n\n    const requestTask = (): PromiseLike<void | TransportMakeRequestResponse> =>\n      makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n        response => {\n          // We don't want to throw on NOK responses, but we want to at least log them\n          if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n            __DEBUG_BUILD__ && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n          }\n\n          rateLimits = updateRateLimits(rateLimits, response);\n          return response;\n        },\n        error => {\n          recordEnvelopeLoss('network_error');\n          throw error;\n        },\n      );\n\n    return buffer.add(requestTask).then(\n      result => result,\n      error => {\n        if (error instanceof SentryError) {\n          __DEBUG_BUILD__ && logger.error('Skipped sending event because buffer is full.');\n          recordEnvelopeLoss('queue_overflow');\n          return resolvedSyncPromise();\n        } else {\n          throw error;\n        }\n      },\n    );\n  }\n\n  // We use this to identifify if the transport is the base transport\n  // TODO (v8): Remove this again as we'll no longer need it\n  send.__sentry__baseTransport__ = true;\n\n  return {\n    send,\n    flush,\n  };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n  if (type !== 'event' && type !== 'transaction') {\n    return undefined;\n  }\n\n  return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n"],"names":["makePromiseBuffer","forEachEnvelopeItem","envelopeItemTypeToDataCategory","isRateLimited","resolvedSyncPromise","createEnvelope","serializeEnvelope","logger","updateRateLimits","SentryError"],"mappings":";;;;AA0BA,MAAA,6BAAA,GAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA;AACA,EAAA,OAAA;AACA,EAAA,WAAA;AACA,EAAA,MAAA,GAAAA,uBAAA;AACA,IAAA,OAAA,CAAA,UAAA,IAAA,6BAAA;AACA,GAAA;AACA,EAAA;AACA,EAAA,IAAA,UAAA,GAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,CAAA,OAAA,KAAA,MAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AACA;AACA,EAAA,SAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA,MAAA,qBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,IAAAC,yBAAA,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A;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const MIN_DELAY = 100; // 100 ms
const START_DELAY = 5000; // 5 seconds
const MAX_DELAY = 3.6e6; // 1 hour

function log(msg, error) {
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.info(`[Offline]: ${msg}`, error);
}

/**
 * Wraps a transport and stores and retries events when they fail to send.
 *
 * @param createTransport The transport to wrap.
 */
function makeOfflineTransport(
  createTransport,
) {
  return options => {
    const transport = createTransport(options);
    const store = options.createStore ? options.createStore(options) : undefined;

    let retryDelay = START_DELAY;
    let flushTimer;

    function shouldQueue(env, error, retryDelay) {
      // We don't queue Session Replay envelopes because they are:
      // - Ordered and Replay relies on the response status to know when they're successfully sent.
      // - Likely to fill the queue quickly and block other events from being sent.
      // We also want to drop client reports because they can be generated when we retry sending events while offline.
      if (utils.envelopeContainsItemType(env, ['replay_event', 'replay_recording', 'client_report'])) {
        return false;
      }

      if (options.shouldStore) {
        return options.shouldStore(env, error, retryDelay);
      }

      return true;
    }

    function flushIn(delay) {
      if (!store) {
        return;
      }

      if (flushTimer) {
        clearTimeout(flushTimer );
      }

      flushTimer = setTimeout(async () => {
        flushTimer = undefined;

        const found = await store.pop();
        if (found) {
          log('Attempting to send previously queued event');
          void send(found).catch(e => {
            log('Failed to retry sending', e);
          });
        }
      }, delay) ;

      // We need to unref the timer in node.js, otherwise the node process never exit.
      if (typeof flushTimer !== 'number' && flushTimer.unref) {
        flushTimer.unref();
      }
    }

    function flushWithBackOff() {
      if (flushTimer) {
        return;
      }

      flushIn(retryDelay);

      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);
    }

    async function send(envelope) {
      try {
        const result = await transport.send(envelope);

        let delay = MIN_DELAY;

        if (result) {
          // If there's a retry-after header, use that as the next delay.
          if (result.headers && result.headers['retry-after']) {
            delay = utils.parseRetryAfterHeader(result.headers['retry-after']);
          } // If we have a server error, return now so we don't flush the queue.
          else if ((result.statusCode || 0) >= 400) {
            return result;
          }
        }

        flushIn(delay);
        retryDelay = START_DELAY;
        return result;
      } catch (e) {
        if (store && (await shouldQueue(envelope, e, retryDelay))) {
          await store.insert(envelope);
          flushWithBackOff();
          log('Error sending. Event queued', e);
          return {};
        } else {
          throw e;
        }
      }
    }

    if (options.flushAtStartup) {
      flushWithBackOff();
    }

    return {
      send,
      flush: t => transport.flush(t),
    };
  };
}

exports.MIN_DELAY = MIN_DELAY;
exports.START_DELAY = START_DELAY;
exports.makeOfflineTransport = makeOfflineTransport;
//# sourceMappingURL=offline.js.map
{"version":3,"file":"offline.js","sources":["../../../src/transports/offline.ts"],"sourcesContent":["import type { Envelope, InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '@sentry/types';\nimport { envelopeContainsItemType, logger, parseRetryAfterHeader } from '@sentry/utils';\n\nexport const MIN_DELAY = 100; // 100 ms\nexport const START_DELAY = 5_000; // 5 seconds\nconst MAX_DELAY = 3.6e6; // 1 hour\n\nfunction log(msg: string, error?: Error): void {\n  __DEBUG_BUILD__ && logger.info(`[Offline]: ${msg}`, error);\n}\n\nexport interface OfflineStore {\n  insert(env: Envelope): Promise<void>;\n  pop(): Promise<Envelope | undefined>;\n}\n\nexport type CreateOfflineStore = (options: OfflineTransportOptions) => OfflineStore;\n\nexport interface OfflineTransportOptions extends InternalBaseTransportOptions {\n  /**\n   * A function that creates the offline store instance.\n   */\n  createStore?: CreateOfflineStore;\n\n  /**\n   * Flush the offline store shortly after startup.\n   *\n   * Defaults: false\n   */\n  flushAtStartup?: boolean;\n\n  /**\n   * Called before an event is stored.\n   *\n   * Return false to drop the envelope rather than store it.\n   *\n   * @param envelope The envelope that failed to send.\n   * @param error The error that occurred.\n   * @param retryDelay The current retry delay in milliseconds.\n   */\n  shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;\n}\n\ntype Timer = number | { unref?: () => void };\n\n/**\n * Wraps a transport and stores and retries events when they fail to send.\n *\n * @param createTransport The transport to wrap.\n */\nexport function makeOfflineTransport<TO>(\n  createTransport: (options: TO) => Transport,\n): (options: TO & OfflineTransportOptions) => Transport {\n  return options => {\n    const transport = createTransport(options);\n    const store = options.createStore ? options.createStore(options) : undefined;\n\n    let retryDelay = START_DELAY;\n    let flushTimer: Timer | undefined;\n\n    function shouldQueue(env: Envelope, error: Error, retryDelay: number): boolean | Promise<boolean> {\n      // We don't queue Session Replay envelopes because they are:\n      // - Ordered and Replay relies on the response status to know when they're successfully sent.\n      // - Likely to fill the queue quickly and block other events from being sent.\n      // We also want to drop client reports because they can be generated when we retry sending events while offline.\n      if (envelopeContainsItemType(env, ['replay_event', 'replay_recording', 'client_report'])) {\n        return false;\n      }\n\n      if (options.shouldStore) {\n        return options.shouldStore(env, error, retryDelay);\n      }\n\n      return true;\n    }\n\n    function flushIn(delay: number): void {\n      if (!store) {\n        return;\n      }\n\n      if (flushTimer) {\n        clearTimeout(flushTimer as ReturnType<typeof setTimeout>);\n      }\n\n      flushTimer = setTimeout(async () => {\n        flushTimer = undefined;\n\n        const found = await store.pop();\n        if (found) {\n          log('Attempting to send previously queued event');\n          void send(found).catch(e => {\n            log('Failed to retry sending', e);\n          });\n        }\n      }, delay) as Timer;\n\n      // We need to unref the timer in node.js, otherwise the node process never exit.\n      if (typeof flushTimer !== 'number' && flushTimer.unref) {\n        flushTimer.unref();\n      }\n    }\n\n    function flushWithBackOff(): void {\n      if (flushTimer) {\n        return;\n      }\n\n      flushIn(retryDelay);\n\n      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);\n    }\n\n    async function send(envelope: Envelope): Promise<void | TransportMakeRequestResponse> {\n      try {\n        const result = await transport.send(envelope);\n\n        let delay = MIN_DELAY;\n\n        if (result) {\n          // If there's a retry-after header, use that as the next delay.\n          if (result.headers && result.headers['retry-after']) {\n            delay = parseRetryAfterHeader(result.headers['retry-after']);\n          } // If we have a server error, return now so we don't flush the queue.\n          else if ((result.statusCode || 0) >= 400) {\n            return result;\n          }\n        }\n\n        flushIn(delay);\n        retryDelay = START_DELAY;\n        return result;\n      } catch (e) {\n        if (store && (await shouldQueue(envelope, e, retryDelay))) {\n          await store.insert(envelope);\n          flushWithBackOff();\n          log('Error sending. Event queued', e);\n          return {};\n        } else {\n          throw e;\n        }\n      }\n    }\n\n    if (options.flushAtStartup) {\n      flushWithBackOff();\n    }\n\n    return {\n      send,\n      flush: t => transport.flush(t),\n    };\n  };\n}\n"],"names":["logger","envelopeContainsItemType","parseRetryAfterHeader"],"mappings":";;;;AAGA,MAAA,SAAA,GAAA,IAAA;AACA,MAAA,WAAA,GAAA,KAAA;AACA,MAAA,SAAA,GAAA,KAAA,CAAA;AACA;AACA,SAAA,GAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA,EAAA,iEAAAA,YAAA,CAAA,IAAA,CAAA,CAAA,WAAA,EAAA,GAAA,CAAA,CAAA,EAAA,KAAA,CAAA,CAAA;AACA,CAAA;;AAoCA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA;AACA,EAAA,eAAA;AACA,EAAA;AACA,EAAA,OAAA,OAAA,IAAA;AACA,IAAA,MAAA,SAAA,GAAA,eAAA,CAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,OAAA,CAAA,WAAA,GAAA,OAAA,CAAA,WAAA,CAAA,OAAA,CAAA,GAAA,SAAA,CAAA;AACA;AACA,IAAA,IAAA,UAAA,GAAA,WAAA,CAAA;AACA,IAAA,IAAA,UAAA,CAAA;AACA;AACA,IAAA,SAAA,WAAA,CAAA,GAAA,EAAA,KAAA,EAAA,UAAA,EAAA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAAC,8BAAA,CAAA,GAAA,EAAA,CAAA,cAAA,EAAA,kBAAA,EAAA,eAAA,CAAA,CAAA,EAAA;AACA,QAAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,IAAA,OAAA,CAAA,WAAA,EAAA;AACA,QAAA,OAAA,OAAA,CAAA,WAAA,CA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A;AACA;AACA,QAAA,IAAA,KAAA,GAAA,SAAA,CAAA;AACA;AACA,QAAA,IAAA,MAAA,EAAA;AACA;AACA,UAAA,IAAA,MAAA,CAAA,OAAA,IAAA,MAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA;AACA,YAAA,KAAA,GAAAC,2BAAA,CAAA,MAAA,CAAA,OAAA,CAAA,aAAA,CAAA,CAAA,CAAA;AACA,WAAA;AACA,eAAA,IAAA,CAAA,MAAA,CAAA,UAAA,IAAA,CAAA,KAAA,GAAA,EAAA;AACA,YAAA,OAAA,MAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA;AACA,QAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AACA,QAAA,UAAA,GAAA,WAAA,CAAA;AACA,QAAA,OAAA,MAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,IAAA,KAAA,KAAA,MAAA,WAAA,CAAA,QAAA,EAAA,CAAA,EAAA,UAAA,CAAA,CAAA,EAAA;AACA,UAAA,MAAA,KAAA,CAAA,MAAA,CAAA,QAAA,CAAA,CAAA;AACA,UAAA,gBAAA,EAAA,CAAA;AACA,UAAA,GAAA,CAAA,6BAAA,EAAA,CAAA,CAAA,CAAA;AACA,UAAA,OAAA,EAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,MAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,OAAA,CAAA,cAAA,EAAA;AACA,MAAA,gBAAA,EAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA;AACA,MAAA,IAAA;AACA,MAAA,KAAA,EAAA,CAAA,IAAA,SAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const hub = require('../hub.js');

// Treeshakable guard to remove all code related to tracing

/**
 * Determines if tracing is currently enabled.
 *
 * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.
 */
function hasTracingEnabled(
  maybeOptions,
) {
  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
    return false;
  }

  const client = hub.getCurrentHub().getClient();
  const options = maybeOptions || (client && client.getOptions());
  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);
}

exports.hasTracingEnabled = hasTracingEnabled;
//# sourceMappingURL=hasTracingEnabled.js.map
{"version":3,"file":"hasTracingEnabled.js","sources":["../../../src/utils/hasTracingEnabled.ts"],"sourcesContent":["import type { Options } from '@sentry/types';\n\nimport { getCurrentHub } from '../hub';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n  maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined,\n): boolean {\n  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n    return false;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = maybeOptions || (client && client.getOptions());\n  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n"],"names":["getCurrentHub"],"mappings":";;;;AAIA;;AAGA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA;AACA,EAAA,YAAA;AACA,EAAA;AACA,EAAA,IAAA,OAAA,kBAAA,KAAA,SAAA,IAAA,CAAA,kBAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAAA,iBAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,YAAA,KAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,CAAA,OAAA,KAAA,OAAA,CAAA,aAAA,IAAA,kBAAA,IAAA,OAAA,IAAA,eAAA,IAAA,OAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const constants = require('../constants.js');
const scope = require('../scope.js');

/**
 * Adds common information to events.
 *
 * The information includes release and environment from `options`,
 * breadcrumbs and context (extra, tags and user) from the scope.
 *
 * Information that is already present in the event is never overwritten. For
 * nested objects, such as the context, keys are merged.
 *
 * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.
 *
 * @param event The original event.
 * @param hint May contain additional information about the original exception.
 * @param scope A scope containing event metadata.
 * @returns A new event with more information.
 * @hidden
 */
function prepareEvent(
  options,
  event,
  hint,
  scope$1,
) {
  const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;
  const prepared = {
    ...event,
    event_id: event.event_id || hint.event_id || utils.uuid4(),
    timestamp: event.timestamp || utils.dateTimestampInSeconds(),
  };
  const integrations = hint.integrations || options.integrations.map(i => i.name);

  applyClientOptions(prepared, options);
  applyIntegrationsMetadata(prepared, integrations);

  // Only apply debug metadata to error events.
  if (event.type === undefined) {
    applyDebugMetadata(prepared, options.stackParser);
  }

  // If we have scope given to us, use it as the base for further modifications.
  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
  let finalScope = scope$1;
  if (hint.captureContext) {
    finalScope = scope.Scope.clone(finalScope).update(hint.captureContext);
  }

  // We prepare the result here with a resolved Event.
  let result = utils.resolvedSyncPromise(prepared);

  // This should be the last thing called, since we want that
  // {@link Hub.addEventProcessor} gets the finished prepared event.
  //
  // We need to check for the existence of `finalScope.getAttachments`
  // because `getAttachments` can be undefined if users are using an older version
  // of `@sentry/core` that does not have the `getAttachments` method.
  // See: https://github.com/getsentry/sentry-javascript/issues/5229
  if (finalScope) {
    // Collect attachments from the hint and scope
    if (finalScope.getAttachments) {
      const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];

      if (attachments.length) {
        hint.attachments = attachments;
      }
    }

    // In case we have a hub we reassign it.
    result = finalScope.applyToEvent(prepared, hint);
  }

  return result.then(evt => {
    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
    }
    return evt;
  });
}

/**
 *  Enhances event using the client configuration.
 *  It takes care of all "static" values like environment, release and `dist`,
 *  as well as truncating overly long values.
 * @param event event instance to be enhanced
 */
function applyClientOptions(event, options) {
  const { environment, release, dist, maxValueLength = 250 } = options;

  if (!('environment' in event)) {
    event.environment = 'environment' in options ? environment : constants.DEFAULT_ENVIRONMENT;
  }

  if (event.release === undefined && release !== undefined) {
    event.release = release;
  }

  if (event.dist === undefined && dist !== undefined) {
    event.dist = dist;
  }

  if (event.message) {
    event.message = utils.truncate(event.message, maxValueLength);
  }

  const exception = event.exception && event.exception.values && event.exception.values[0];
  if (exception && exception.value) {
    exception.value = utils.truncate(exception.value, maxValueLength);
  }

  const request = event.request;
  if (request && request.url) {
    request.url = utils.truncate(request.url, maxValueLength);
  }
}

const debugIdStackParserCache = new WeakMap();

/**
 * Applies debug metadata images to the event in order to apply source maps by looking up their debug ID.
 */
function applyDebugMetadata(event, stackParser) {
  const debugIdMap = utils.GLOBAL_OBJ._sentryDebugIds;

  if (!debugIdMap) {
    return;
  }

  let debugIdStackFramesCache;
  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);
  if (cachedDebugIdStackFrameCache) {
    debugIdStackFramesCache = cachedDebugIdStackFrameCache;
  } else {
    debugIdStackFramesCache = new Map();
    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);
  }

  // Build a map of filename -> debug_id
  const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {
    let parsedStack;
    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);
    if (cachedParsedStack) {
      parsedStack = cachedParsedStack;
    } else {
      parsedStack = stackParser(debugIdStackTrace);
      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);
    }

    for (let i = parsedStack.length - 1; i >= 0; i--) {
      const stackFrame = parsedStack[i];
      if (stackFrame.filename) {
        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];
        break;
      }
    }
    return acc;
  }, {});

  // Get a Set of filenames in the stack trace
  const errorFileNames = new Set();
  try {
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
    event.exception.values.forEach(exception => {
      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
      exception.stacktrace.frames.forEach(frame => {
        if (frame.filename) {
          errorFileNames.add(frame.filename);
        }
      });
    });
  } catch (e) {
    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.
  }

  // Fill debug_meta information
  event.debug_meta = event.debug_meta || {};
  event.debug_meta.images = event.debug_meta.images || [];
  const images = event.debug_meta.images;
  errorFileNames.forEach(filename => {
    if (filenameDebugIdMap[filename]) {
      images.push({
        type: 'sourcemap',
        code_file: filename,
        debug_id: filenameDebugIdMap[filename],
      });
    }
  });
}

/**
 * This function adds all used integrations to the SDK info in the event.
 * @param event The event that will be filled with all integrations.
 */
function applyIntegrationsMetadata(event, integrationNames) {
  if (integrationNames.length > 0) {
    event.sdk = event.sdk || {};
    event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];
  }
}

/**
 * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
 * Normalized keys:
 * - `breadcrumbs.data`
 * - `user`
 * - `contexts`
 * - `extra`
 * @param event Event
 * @returns Normalized event
 */
function normalizeEvent(event, depth, maxBreadth) {
  if (!event) {
    return null;
  }

  const normalized = {
    ...event,
    ...(event.breadcrumbs && {
      breadcrumbs: event.breadcrumbs.map(b => ({
        ...b,
        ...(b.data && {
          data: utils.normalize(b.data, depth, maxBreadth),
        }),
      })),
    }),
    ...(event.user && {
      user: utils.normalize(event.user, depth, maxBreadth),
    }),
    ...(event.contexts && {
      contexts: utils.normalize(event.contexts, depth, maxBreadth),
    }),
    ...(event.extra && {
      extra: utils.normalize(event.extra, depth, maxBreadth),
    }),
  };

  // event.contexts.trace stores information about a Transaction. Similarly,
  // event.spans[] stores information about child Spans. Given that a
  // Transaction is conceptually a Span, normalization should apply to both
  // Transactions and Spans consistently.
  // For now the decision is to skip normalization of Transactions and Spans,
  // so this block overwrites the normalized event to add back the original
  // Transaction information prior to normalization.
  if (event.contexts && event.contexts.trace && normalized.contexts) {
    normalized.contexts.trace = event.contexts.trace;

    // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it
    if (event.contexts.trace.data) {
      normalized.contexts.trace.data = utils.normalize(event.contexts.trace.data, depth, maxBreadth);
    }
  }

  // event.spans[].data may contain circular/dangerous data so we need to normalize it
  if (event.spans) {
    normalized.spans = event.spans.map(span => {
      // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable
      if (span.data) {
        span.data = utils.normalize(span.data, depth, maxBreadth);
      }
      return span;
    });
  }

  return normalized;
}

exports.applyDebugMetadata = applyDebugMetadata;
exports.prepareEvent = prepareEvent;
//# sourceMappingURL=prepareEvent.js.map
{"version":3,"file":"prepareEvent.js","sources":["../../../src/utils/prepareEvent.ts"],"sourcesContent":["import type { ClientOptions, Event, EventHint, StackFrame, StackParser } from '@sentry/types';\nimport { dateTimestampInSeconds, GLOBAL_OBJ, normalize, resolvedSyncPromise, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { Scope } from '../scope';\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n  scope?: Scope,\n): PromiseLike<Event | null> {\n  const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n  const prepared: Event = {\n    ...event,\n    event_id: event.event_id || hint.event_id || uuid4(),\n    timestamp: event.timestamp || dateTimestampInSeconds(),\n  };\n  const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n  applyClientOptions(prepared, options);\n  applyIntegrationsMetadata(prepared, integrations);\n\n  // Only apply debug metadata to error events.\n  if (event.type === undefined) {\n    applyDebugMetadata(prepared, options.stackParser);\n  }\n\n  // If we have scope given to us, use it as the base for further modifications.\n  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n  let finalScope = scope;\n  if (hint.captureContext) {\n    finalScope = Scope.clone(finalScope).update(hint.captureContext);\n  }\n\n  // We prepare the result here with a resolved Event.\n  let result = resolvedSyncPromise<Event | null>(prepared);\n\n  // This should be the last thing called, since we want that\n  // {@link Hub.addEventProcessor} gets the finished prepared event.\n  //\n  // We need to check for the existence of `finalScope.getAttachments`\n  // because `getAttachments` can be undefined if users are using an older version\n  // of `@sentry/core` that does not have the `getAttachments` method.\n  // See: https://github.com/getsentry/sentry-javascript/issues/5229\n  if (finalScope) {\n    // Collect attachments from the hint and scope\n    if (finalScope.getAttachments) {\n      const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];\n\n      if (attachments.length) {\n        hint.attachments = attachments;\n      }\n    }\n\n    // In case we have a hub we reassign it.\n    result = finalScope.applyToEvent(prepared, hint);\n  }\n\n  return result.then(evt => {\n    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n    }\n    return evt;\n  });\n}\n\n/**\n *  Enhances event using the client configuration.\n *  It takes care of all \"static\" values like environment, release and `dist`,\n *  as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n  const { environment, release, dist, maxValueLength = 250 } = options;\n\n  if (!('environment' in event)) {\n    event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n  }\n\n  if (event.release === undefined && release !== undefined) {\n    event.release = release;\n  }\n\n  if (event.dist === undefined && dist !== undefined) {\n    event.dist = dist;\n  }\n\n  if (event.message) {\n    event.message = truncate(event.message, maxValueLength);\n  }\n\n  const exception = event.exception && event.exception.values && event.exception.values[0];\n  if (exception && exception.value) {\n    exception.value = truncate(exception.value, maxValueLength);\n  }\n\n  const request = event.request;\n  if (request && request.url) {\n    request.url = truncate(request.url, maxValueLength);\n  }\n}\n\nconst debugIdStackParserCache = new WeakMap<StackParser, Map<string, StackFrame[]>>();\n\n/**\n * Applies debug metadata images to the event in order to apply source maps by looking up their debug ID.\n */\nexport function applyDebugMetadata(event: Event, stackParser: StackParser): void {\n  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n  if (!debugIdMap) {\n    return;\n  }\n\n  let debugIdStackFramesCache: Map<string, StackFrame[]>;\n  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n  if (cachedDebugIdStackFrameCache) {\n    debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n  } else {\n    debugIdStackFramesCache = new Map<string, StackFrame[]>();\n    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n  }\n\n  // Build a map of filename -> debug_id\n  const filenameDebugIdMap = Object.keys(debugIdMap).reduce<Record<string, string>>((acc, debugIdStackTrace) => {\n    let parsedStack: StackFrame[];\n    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n    if (cachedParsedStack) {\n      parsedStack = cachedParsedStack;\n    } else {\n      parsedStack = stackParser(debugIdStackTrace);\n      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n    }\n\n    for (let i = parsedStack.length - 1; i >= 0; i--) {\n      const stackFrame = parsedStack[i];\n      if (stackFrame.filename) {\n        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n        break;\n      }\n    }\n    return acc;\n  }, {});\n\n  // Get a Set of filenames in the stack trace\n  const errorFileNames = new Set<string>();\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event!.exception!.values!.forEach(exception => {\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      exception.stacktrace!.frames!.forEach(frame => {\n        if (frame.filename) {\n          errorFileNames.add(frame.filename);\n        }\n      });\n    });\n  } catch (e) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n\n  // Fill debug_meta information\n  event.debug_meta = event.debug_meta || {};\n  event.debug_meta.images = event.debug_meta.images || [];\n  const images = event.debug_meta.images;\n  errorFileNames.forEach(filename => {\n    if (filenameDebugIdMap[filename]) {\n      images.push({\n        type: 'sourcemap',\n        code_file: filename,\n        debug_id: filenameDebugIdMap[filename],\n      });\n    }\n  });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n  if (integrationNames.length > 0) {\n    event.sdk = event.sdk || {};\n    event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n  }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n  if (!event) {\n    return null;\n  }\n\n  const normalized: Event = {\n    ...event,\n    ...(event.breadcrumbs && {\n      breadcrumbs: event.breadcrumbs.map(b => ({\n        ...b,\n        ...(b.data && {\n          data: normalize(b.data, depth, maxBreadth),\n        }),\n      })),\n    }),\n    ...(event.user && {\n      user: normalize(event.user, depth, maxBreadth),\n    }),\n    ...(event.contexts && {\n      contexts: normalize(event.contexts, depth, maxBreadth),\n    }),\n    ...(event.extra && {\n      extra: normalize(event.extra, depth, maxBreadth),\n    }),\n  };\n\n  // event.contexts.trace stores information about a Transaction. Similarly,\n  // event.spans[] stores information about child Spans. Given that a\n  // Transaction is conceptually a Span, normalization should apply to both\n  // Transactions and Spans consistently.\n  // For now the decision is to skip normalization of Transactions and Spans,\n  // so this block overwrites the normalized event to add back the original\n  // Transaction information prior to normalization.\n  if (event.contexts && event.contexts.trace && normalized.contexts) {\n    normalized.contexts.trace = event.contexts.trace;\n\n    // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n    if (event.contexts.trace.data) {\n      normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n    }\n  }\n\n  // event.spans[].data may contain circular/dangerous data so we need to normalize it\n  if (event.spans) {\n    normalized.spans = event.spans.map(span => {\n      // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable\n      if (span.data) {\n        span.data = normalize(span.data, depth, maxBreadth);\n      }\n      return span;\n    });\n  }\n\n  return normalized;\n}\n"],"names":["scope","uuid4","dateTimestampInSeconds","Scope","resolvedSyncPromise","DEFAULT_ENVIRONMENT","truncate","GLOBAL_OBJ","normalize"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA;AACA,EAAA,OAAA;AACA,EAAA,KAAA;AACA,EAAA,IAAA;AACA,EAAAA,OAAA;AACA,EAAA;AACA,EAAA,MAAA,EAAA,cAAA,GAAA,CAAA,EAAA,mBAAA,GAAA,IAAA,EAAA,GAAA,OAAA,CAAA;AACA,EAAA,MAAA,QAAA,GAAA;AACA,IAAA,GAAA,KAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,QAAA,IAAA,IAAA,CAAA,QAAA,IAAAC,WAAA,EAAA;AACA,IAAA,SAAA,EAAA,KAAA,CAAA,SAAA,IAAAC,4BAAA,EAAA;AACA,GAAA,CAAA;AACA,EAAA,MAAA,YAAA,GAAA,IAAA,CAAA,YAAA,IAAA,OAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,EAAA,kBAAA,CAAA,QAAA,EAAA,OAAA,C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,EAAAA,eAAA,CAAA,KAAA,CAAA,KAAA,EAAA,KAAA,EAAA,UAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,KAAA,CAAA,QAAA,IAAA,KAAA,CAAA,QAAA,CAAA,KAAA,IAAA,UAAA,CAAA,QAAA,EAAA;AACA,IAAA,UAAA,CAAA,QAAA,CAAA,KAAA,GAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA;AACA;AACA;AACA,IAAA,IAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,IAAA,EAAA;AACA,MAAA,UAAA,CAAA,QAAA,CAAA,KAAA,CAAA,IAAA,GAAAA,eAAA,CAAA,KAAA,CAAA,QAAA,CAAA,KAAA,CAAA,IAAA,EAAA,KAAA,EAAA,UAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,KAAA,CAAA,KAAA,EAAA;AACA,IAAA,UAAA,CAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,GAAA,CAAA,IAAA,IAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,QAAA,IAAA,CAAA,IAAA,GAAAA,eAAA,CAAA,IAAA,CAAA,IAAA,EAAA,KAAA,EAAA,UAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,UAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const SDK_VERSION = '7.48.0';

exports.SDK_VERSION = SDK_VERSION;
//# sourceMappingURL=version.js.map
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const SDK_VERSION = '7.48.0';\n"],"names":[],"mappings":";;AAAA,MAAA,WAAA,GAAA;;;;"}import { makeDsn, dsnToString, urlEncode } from '@sentry/utils';

const SENTRY_API_VERSION = '7';

/** Returns the prefix to construct Sentry ingestion API endpoints. */
function getBaseApiEndpoint(dsn) {
  const protocol = dsn.protocol ? `${dsn.protocol}:` : '';
  const port = dsn.port ? `:${dsn.port}` : '';
  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;
}

/** Returns the ingest API endpoint for target. */
function _getIngestEndpoint(dsn) {
  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;
}

/** Returns a URL-encoded string with auth config suitable for a query string. */
function _encodedAuth(dsn, sdkInfo) {
  return urlEncode({
    // We send only the minimum set of required information. See
    // https://github.com/getsentry/sentry-javascript/issues/2572.
    sentry_key: dsn.publicKey,
    sentry_version: SENTRY_API_VERSION,
    ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),
  });
}

/**
 * Returns the envelope endpoint URL with auth in the query string.
 *
 * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
 */
function getEnvelopeEndpointWithUrlEncodedAuth(
  dsn,
  // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below
  // options: ClientOptions = {} as ClientOptions,
  tunnelOrOptions = {} ,
) {
  // TODO (v8): Use this code instead
  // const { tunnel, _metadata = {} } = options;
  // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;

  const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;
  const sdkInfo =
    typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;

  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
}

/** Returns the url to the report dialog endpoint. */
function getReportDialogEndpoint(
  dsnLike,
  dialogOptions

,
) {
  const dsn = makeDsn(dsnLike);
  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;

  let encodedOptions = `dsn=${dsnToString(dsn)}`;
  for (const key in dialogOptions) {
    if (key === 'dsn') {
      continue;
    }

    if (key === 'user') {
      const user = dialogOptions.user;
      if (!user) {
        continue;
      }
      if (user.name) {
        encodedOptions += `&name=${encodeURIComponent(user.name)}`;
      }
      if (user.email) {
        encodedOptions += `&email=${encodeURIComponent(user.email)}`;
      }
    } else {
      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`;
    }
  }

  return `${endpoint}?${encodedOptions}`;
}

export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };
//# sourceMappingURL=api.js.map
{"version":3,"file":"api.js","sources":["../../src/api.ts"],"sourcesContent":["import type { ClientOptions, DsnComponents, DsnLike, SdkInfo } from '@sentry/types';\nimport { dsnToString, makeDsn, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn: DsnComponents): string {\n  const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n  const port = dsn.port ? `:${dsn.port}` : '';\n  return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn: DsnComponents): string {\n  return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn: DsnComponents, sdkInfo: SdkInfo | undefined): string {\n  return urlEncode({\n    // We send only the minimum set of required information. See\n    // https://github.com/getsentry/sentry-javascript/issues/2572.\n    sentry_key: dsn.publicKey,\n    sentry_version: SENTRY_API_VERSION,\n    ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n  });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nexport function getEnvelopeEndpointWithUrlEncodedAuth(\n  dsn: DsnComponents,\n  // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n  // options: ClientOptions = {} as ClientOptions,\n  tunnelOrOptions: string | ClientOptions = {} as ClientOptions,\n): string {\n  // TODO (v8): Use this code instead\n  // const { tunnel, _metadata = {} } = options;\n  // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n  const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n  const sdkInfo =\n    typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n  return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nexport function getReportDialogEndpoint(\n  dsnLike: DsnLike,\n  dialogOptions: {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    [key: string]: any;\n    user?: { name?: string; email?: string };\n  },\n): string {\n  const dsn = makeDsn(dsnLike);\n  const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n  let encodedOptions = `dsn=${dsnToString(dsn)}`;\n  for (const key in dialogOptions) {\n    if (key === 'dsn') {\n      continue;\n    }\n\n    if (key === 'user') {\n      const user = dialogOptions.user;\n      if (!user) {\n        continue;\n      }\n      if (user.name) {\n        encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n      }\n      if (user.email) {\n        encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n      }\n    } else {\n      encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] as string)}`;\n    }\n  }\n\n  return `${endpoint}?${encodedOptions}`;\n}\n"],"names":[],"mappings":";;AAGA,MAAA,kBAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,GAAA,CAAA,QAAA,GAAA,CAAA,EAAA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A,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,CAAA,CAAA,EAAA,cAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { makeDsn, logger, checkOrSetAlreadyCaught, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils';
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';
import { createEventEnvelope, createSessionEnvelope } from './envelope.js';
import { setupIntegrations, setupIntegration } from './integration.js';
import { updateSession } from './session.js';
import { prepareEvent } from './utils/prepareEvent.js';

const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";

/**
 * Base implementation for all JavaScript SDK clients.
 *
 * Call the constructor with the corresponding options
 * specific to the client subclass. To access these options later, use
 * {@link Client.getOptions}.
 *
 * If a Dsn is specified in the options, it will be parsed and stored. Use
 * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
 * invalid, the constructor will throw a {@link SentryException}. Note that
 * without a valid Dsn, the SDK will not send any events to Sentry.
 *
 * Before sending an event, it is passed through
 * {@link BaseClient._prepareEvent} to add SDK information and scope data
 * (breadcrumbs and context). To add more custom information, override this
 * method and extend the resulting prepared event.
 *
 * To issue automatically created events (e.g. via instrumentation), use
 * {@link Client.captureEvent}. It will prepare the event and pass it through
 * the callback lifecycle. To issue auto-breadcrumbs, use
 * {@link Client.addBreadcrumb}.
 *
 * @example
 * class NodeClient extends BaseClient<NodeOptions> {
 *   public constructor(options: NodeOptions) {
 *     super(options);
 *   }
 *
 *   // ...
 * }
 */
class BaseClient {
  /** Options passed to the SDK. */

  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */

  /** Array of set up integrations. */
   __init() {this._integrations = {};}

  /** Indicates whether this client's integrations have been set up. */
   __init2() {this._integrationsInitialized = false;}

  /** Number of calls being processed */
   __init3() {this._numProcessing = 0;}

  /** Holds flushable  */
   __init4() {this._outcomes = {};}

  // eslint-disable-next-line @typescript-eslint/ban-types
   __init5() {this._hooks = {};}

  /**
   * Initializes this client instance.
   *
   * @param options Options for the client.
   */
   constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this);BaseClient.prototype.__init5.call(this);
    this._options = options;
    if (options.dsn) {
      this._dsn = makeDsn(options.dsn);
      const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);
      this._transport = options.transport({
        recordDroppedEvent: this.recordDroppedEvent.bind(this),
        ...options.transportOptions,
        url,
      });
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No DSN provided, client will not do anything.');
    }
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   captureException(exception, hint, scope) {
    // ensure we haven't captured this very object before
    if (checkOrSetAlreadyCaught(exception)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(ALREADY_SEEN_ERROR);
      return;
    }

    let eventId = hint && hint.event_id;

    this._process(
      this.eventFromException(exception, hint)
        .then(event => this._captureEvent(event, hint, scope))
        .then(result => {
          eventId = result;
        }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level,
    hint,
    scope,
  ) {
    let eventId = hint && hint.event_id;

    const promisedEvent = isPrimitive(message)
      ? this.eventFromMessage(String(message), level, hint)
      : this.eventFromException(message, hint);

    this._process(
      promisedEvent
        .then(event => this._captureEvent(event, hint, scope))
        .then(result => {
          eventId = result;
        }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint, scope) {
    // ensure we haven't captured this very object before
    if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(ALREADY_SEEN_ERROR);
      return;
    }

    let eventId = hint && hint.event_id;

    this._process(
      this._captureEvent(event, hint, scope).then(result => {
        eventId = result;
      }),
    );

    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureSession(session) {
    if (!this._isEnabled()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('SDK not enabled, will not capture session.');
      return;
    }

    if (!(typeof session.release === 'string')) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Discarded session because of missing or non-string release');
    } else {
      this.sendSession(session);
      // After sending, we set init false to indicate it's not the first occurrence
      updateSession(session, { init: false });
    }
  }

  /**
   * @inheritDoc
   */
   getDsn() {
    return this._dsn;
  }

  /**
   * @inheritDoc
   */
   getOptions() {
    return this._options;
  }

  /**
   * @see SdkMetadata in @sentry/types
   *
   * @return The metadata of the SDK
   */
   getSdkMetadata() {
    return this._options._metadata;
  }

  /**
   * @inheritDoc
   */
   getTransport() {
    return this._transport;
  }

  /**
   * @inheritDoc
   */
   flush(timeout) {
    const transport = this._transport;
    if (transport) {
      return this._isClientDoneProcessing(timeout).then(clientFinished => {
        return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);
      });
    } else {
      return resolvedSyncPromise(true);
    }
  }

  /**
   * @inheritDoc
   */
   close(timeout) {
    return this.flush(timeout).then(result => {
      this.getOptions().enabled = false;
      return result;
    });
  }

  /**
   * Sets up the integrations
   */
   setupIntegrations() {
    if (this._isEnabled() && !this._integrationsInitialized) {
      this._integrations = setupIntegrations(this._options.integrations);
      this._integrationsInitialized = true;
    }
  }

  /**
   * Gets an installed integration by its `id`.
   *
   * @returns The installed integration or `undefined` if no integration with that `id` was installed.
   */
   getIntegrationById(integrationId) {
    return this._integrations[integrationId];
  }

  /**
   * @inheritDoc
   */
   getIntegration(integration) {
    try {
      return (this._integrations[integration.id] ) || null;
    } catch (_oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);
      return null;
    }
  }

  /**
   * @inheritDoc
   */
   addIntegration(integration) {
    setupIntegration(integration, this._integrations);
  }

  /**
   * @inheritDoc
   */
   sendEvent(event, hint = {}) {
    if (this._dsn) {
      let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);

      for (const attachment of hint.attachments || []) {
        env = addItemToEnvelope(
          env,
          createAttachmentEnvelopeItem(
            attachment,
            this._options.transportOptions && this._options.transportOptions.textEncoder,
          ),
        );
      }

      const promise = this._sendEnvelope(env);
      if (promise) {
        promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);
      }
    }
  }

  /**
   * @inheritDoc
   */
   sendSession(session) {
    if (this._dsn) {
      const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);
      void this._sendEnvelope(env);
    }
  }

  /**
   * @inheritDoc
   */
   recordDroppedEvent(reason, category, _event) {
    // Note: we use `event` in replay, where we overwrite this hook.

    if (this._options.sendClientReports) {
      // We want to track each category (error, transaction, session, replay_event) separately
      // but still keep the distinction between different type of outcomes.
      // We could use nested maps, but it's much easier to read and type this way.
      // A correct type for map-based implementation if we want to go that route
      // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
      // With typescript 4.1 we could even use template literal types
      const key = `${reason}:${category}`;
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Adding outcome: "${key}"`);

      // The following works because undefined + 1 === NaN and NaN is falsy
      this._outcomes[key] = this._outcomes[key] + 1 || 1;
    }
  }

  // Keep on() & emit() signatures in sync with types' client.ts interface

  /** @inheritdoc */

  /** @inheritdoc */
   on(hook, callback) {
    if (!this._hooks[hook]) {
      this._hooks[hook] = [];
    }

    // @ts-ignore We assue the types are correct
    this._hooks[hook].push(callback);
  }

  /** @inheritdoc */

  /** @inheritdoc */
   emit(hook, ...rest) {
    if (this._hooks[hook]) {
      // @ts-ignore we cannot enforce the callback to match the hook
      this._hooks[hook].forEach(callback => callback(...rest));
    }
  }

  /** Updates existing session based on the provided event */
   _updateSessionFromEvent(session, event) {
    let crashed = false;
    let errored = false;
    const exceptions = event.exception && event.exception.values;

    if (exceptions) {
      errored = true;

      for (const ex of exceptions) {
        const mechanism = ex.mechanism;
        if (mechanism && mechanism.handled === false) {
          crashed = true;
          break;
        }
      }
    }

    // A session is updated and that session update is sent in only one of the two following scenarios:
    // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update
    // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update
    const sessionNonTerminal = session.status === 'ok';
    const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);

    if (shouldUpdateAndSend) {
      updateSession(session, {
        ...(crashed && { status: 'crashed' }),
        errors: session.errors || Number(errored || crashed),
      });
      this.captureSession(session);
    }
  }

  /**
   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
   * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
   *
   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
   * `true`.
   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
   * `false` otherwise
   */
   _isClientDoneProcessing(timeout) {
    return new SyncPromise(resolve => {
      let ticked = 0;
      const tick = 1;

      const interval = setInterval(() => {
        if (this._numProcessing == 0) {
          clearInterval(interval);
          resolve(true);
        } else {
          ticked += tick;
          if (timeout && ticked >= timeout) {
            clearInterval(interval);
            resolve(false);
          }
        }
      }, tick);
    });
  }

  /** Determines whether this SDK is enabled and a valid Dsn is present. */
   _isEnabled() {
    return this.getOptions().enabled !== false && this._dsn !== undefined;
  }

  /**
   * Adds common information to events.
   *
   * The information includes release and environment from `options`,
   * breadcrumbs and context (extra, tags and user) from the scope.
   *
   * Information that is already present in the event is never overwritten. For
   * nested objects, such as the context, keys are merged.
   *
   * @param event The original event.
   * @param hint May contain additional information about the original exception.
   * @param scope A scope containing event metadata.
   * @returns A new event with more information.
   */
   _prepareEvent(event, hint, scope) {
    const options = this.getOptions();
    const integrations = Object.keys(this._integrations);
    if (!hint.integrations && integrations.length > 0) {
      hint.integrations = integrations;
    }
    return prepareEvent(options, event, hint, scope);
  }

  /**
   * Processes the event and logs an error in case of rejection
   * @param event
   * @param hint
   * @param scope
   */
   _captureEvent(event, hint = {}, scope) {
    return this._processEvent(event, hint, scope).then(
      finalEvent => {
        return finalEvent.event_id;
      },
      reason => {
        if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
          // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for
          // control flow, log just the message (no stack) as a log-level log.
          const sentryError = reason ;
          if (sentryError.logLevel === 'log') {
            logger.log(sentryError.message);
          } else {
            logger.warn(sentryError);
          }
        }
        return undefined;
      },
    );
  }

  /**
   * Processes an event (either error or message) and sends it to Sentry.
   *
   * This also adds breadcrumbs and context information to the event. However,
   * platform specific meta data (such as the User's IP address) must be added
   * by the SDK implementor.
   *
   *
   * @param event The event to send to Sentry.
   * @param hint May contain additional information about the original exception.
   * @param scope A scope containing event metadata.
   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
   */
   _processEvent(event, hint, scope) {
    const options = this.getOptions();
    const { sampleRate } = options;

    if (!this._isEnabled()) {
      return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.', 'log'));
    }

    const isTransaction = isTransactionEvent(event);
    const isError = isErrorEvent(event);
    const eventType = event.type || 'error';
    const beforeSendLabel = `before send for type \`${eventType}\``;

    // 1.0 === 100% events are sent
    // 0.0 === 0% events are sent
    // Sampling for transaction happens somewhere else
    if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {
      this.recordDroppedEvent('sample_rate', 'error', event);
      return rejectedSyncPromise(
        new SentryError(
          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,
          'log',
        ),
      );
    }

    const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;

    return this._prepareEvent(event, hint, scope)
      .then(prepared => {
        if (prepared === null) {
          this.recordDroppedEvent('event_processor', dataCategory, event);
          throw new SentryError('An event processor returned `null`, will not send event.', 'log');
        }

        const isInternalException = hint.data && (hint.data ).__sentry__ === true;
        if (isInternalException) {
          return prepared;
        }

        const result = processBeforeSend(options, prepared, hint);
        return _validateBeforeSendResult(result, beforeSendLabel);
      })
      .then(processedEvent => {
        if (processedEvent === null) {
          this.recordDroppedEvent('before_send', dataCategory, event);
          throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, 'log');
        }

        const session = scope && scope.getSession();
        if (!isTransaction && session) {
          this._updateSessionFromEvent(session, processedEvent);
        }

        // None of the Sentry built event processor will update transaction name,
        // so if the transaction name has been changed by an event processor, we know
        // it has to come from custom event processor added by a user
        const transactionInfo = processedEvent.transaction_info;
        if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {
          const source = 'custom';
          processedEvent.transaction_info = {
            ...transactionInfo,
            source,
          };
        }

        this.sendEvent(processedEvent, hint);
        return processedEvent;
      })
      .then(null, reason => {
        if (reason instanceof SentryError) {
          throw reason;
        }

        this.captureException(reason, {
          data: {
            __sentry__: true,
          },
          originalException: reason,
        });
        throw new SentryError(
          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${reason}`,
        );
      });
  }

  /**
   * Occupies the client with processing and event
   */
   _process(promise) {
    this._numProcessing++;
    void promise.then(
      value => {
        this._numProcessing--;
        return value;
      },
      reason => {
        this._numProcessing--;
        return reason;
      },
    );
  }

  /**
   * @inheritdoc
   */
   _sendEnvelope(envelope) {
    if (this._transport && this._dsn) {
      this.emit('beforeEnvelope', envelope);

      return this._transport.send(envelope).then(null, reason => {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Error while sending event:', reason);
      });
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Transport disabled');
    }
  }

  /**
   * Clears outcomes on this client and returns them.
   */
   _clearOutcomes() {
    const outcomes = this._outcomes;
    this._outcomes = {};
    return Object.keys(outcomes).map(key => {
      const [reason, category] = key.split(':') ;
      return {
        reason,
        category,
        quantity: outcomes[key],
      };
    });
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types

}

/**
 * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.
 */
function _validateBeforeSendResult(
  beforeSendResult,
  beforeSendLabel,
) {
  const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`;
  if (isThenable(beforeSendResult)) {
    return beforeSendResult.then(
      event => {
        if (!isPlainObject(event) && event !== null) {
          throw new SentryError(invalidValueError);
        }
        return event;
      },
      e => {
        throw new SentryError(`${beforeSendLabel} rejected with ${e}`);
      },
    );
  } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {
    throw new SentryError(invalidValueError);
  }
  return beforeSendResult;
}

/**
 * Process the matching `beforeSendXXX` callback.
 */
function processBeforeSend(
  options,
  event,
  hint,
) {
  const { beforeSend, beforeSendTransaction } = options;

  if (isErrorEvent(event) && beforeSend) {
    return beforeSend(event, hint);
  }

  if (isTransactionEvent(event) && beforeSendTransaction) {
    return beforeSendTransaction(event, hint);
  }

  return event;
}

function isErrorEvent(event) {
  return event.type === undefined;
}

function isTransactionEvent(event) {
  return event.type === 'transaction';
}

export { BaseClient };
//# sourceMappingURL=baseclient.js.map
{"version":3,"file":"baseclient.js","sources":["../../src/baseclient.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  ClientOptions,\n  DataCategory,\n  DsnComponents,\n  DynamicSamplingContext,\n  Envelope,\n  ErrorEvent,\n  Event,\n  EventDropReason,\n  EventHint,\n  Integration,\n  IntegrationClass,\n  Outcome,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionEvent,\n  Transport,\n  TransportMakeRequestResponse,\n} from '@sentry/types';\nimport {\n  addItemToEnvelope,\n  checkOrSetAlreadyCaught,\n  createAttachmentEnvelopeItem,\n  isPlainObject,\n  isPrimitive,\n  isThenable,\n  logger,\n  makeDsn,\n  rejectedSyncPromise,\n  resolvedSyncPromise,\n  SentryError,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope';\nimport type { IntegrationIndex } from './integration';\nimport { setupIntegration, setupIntegrations } from './integration';\nimport type { Scope } from './scope';\nimport { updateSession } from './session';\nimport { prepareEvent } from './utils/prepareEvent';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient<NodeOptions> {\n *   public constructor(options: NodeOptions) {\n *     super(options);\n *   }\n *\n *   // ...\n * }\n */\nexport abstract class BaseClient<O extends ClientOptions> implements Client<O> {\n  /** Options passed to the SDK. */\n  protected readonly _options: O;\n\n  /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n  protected readonly _dsn?: DsnComponents;\n\n  protected readonly _transport?: Transport;\n\n  /** Array of set up integrations. */\n  protected _integrations: IntegrationIndex = {};\n\n  /** Indicates whether this client's integrations have been set up. */\n  protected _integrationsInitialized: boolean = false;\n\n  /** Number of calls being processed */\n  protected _numProcessing: number = 0;\n\n  /** Holds flushable  */\n  private _outcomes: { [key: string]: number } = {};\n\n  // eslint-disable-next-line @typescript-eslint/ban-types\n  private _hooks: Record<string, Function[]> = {};\n\n  /**\n   * Initializes this client instance.\n   *\n   * @param options Options for the client.\n   */\n  protected constructor(options: O) {\n    this._options = options;\n    if (options.dsn) {\n      this._dsn = makeDsn(options.dsn);\n      const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n      this._transport = options.transport({\n        recordDroppedEvent: this.recordDroppedEvent.bind(this),\n        ...options.transportOptions,\n        url,\n      });\n    } else {\n      __DEBUG_BUILD__ && logger.warn('No DSN provided, client will not do anything.');\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (checkOrSetAlreadyCaught(exception)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this.eventFromException(exception, hint)\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n    scope?: Scope,\n  ): string | undefined {\n    let eventId: string | undefined = hint && hint.event_id;\n\n    const promisedEvent = isPrimitive(message)\n      ? this.eventFromMessage(String(message), level, hint)\n      : this.eventFromException(message, hint);\n\n    this._process(\n      promisedEvent\n        .then(event => this._captureEvent(event, hint, scope))\n        .then(result => {\n          eventId = result;\n        }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    // ensure we haven't captured this very object before\n    if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n      __DEBUG_BUILD__ && logger.log(ALREADY_SEEN_ERROR);\n      return;\n    }\n\n    let eventId: string | undefined = hint && hint.event_id;\n\n    this._process(\n      this._captureEvent(event, hint, scope).then(result => {\n        eventId = result;\n      }),\n    );\n\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(session: Session): void {\n    if (!this._isEnabled()) {\n      __DEBUG_BUILD__ && logger.warn('SDK not enabled, will not capture session.');\n      return;\n    }\n\n    if (!(typeof session.release === 'string')) {\n      __DEBUG_BUILD__ && logger.warn('Discarded session because of missing or non-string release');\n    } else {\n      this.sendSession(session);\n      // After sending, we set init false to indicate it's not the first occurrence\n      updateSession(session, { init: false });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getDsn(): DsnComponents | undefined {\n    return this._dsn;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getOptions(): O {\n    return this._options;\n  }\n\n  /**\n   * @see SdkMetadata in @sentry/types\n   *\n   * @return The metadata of the SDK\n   */\n  public getSdkMetadata(): SdkMetadata | undefined {\n    return this._options._metadata;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransport(): Transport | undefined {\n    return this._transport;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public flush(timeout?: number): PromiseLike<boolean> {\n    const transport = this._transport;\n    if (transport) {\n      return this._isClientDoneProcessing(timeout).then(clientFinished => {\n        return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n      });\n    } else {\n      return resolvedSyncPromise(true);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    return this.flush(timeout).then(result => {\n      this.getOptions().enabled = false;\n      return result;\n    });\n  }\n\n  /**\n   * Sets up the integrations\n   */\n  public setupIntegrations(): void {\n    if (this._isEnabled() && !this._integrationsInitialized) {\n      this._integrations = setupIntegrations(this._options.integrations);\n      this._integrationsInitialized = true;\n    }\n  }\n\n  /**\n   * Gets an installed integration by its `id`.\n   *\n   * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n   */\n  public getIntegrationById(integrationId: string): Integration | undefined {\n    return this._integrations[integrationId];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    try {\n      return (this._integrations[integration.id] as T) || null;\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addIntegration(integration: Integration): void {\n    setupIntegration(integration, this._integrations);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendEvent(event: Event, hint: EventHint = {}): void {\n    if (this._dsn) {\n      let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n      for (const attachment of hint.attachments || []) {\n        env = addItemToEnvelope(\n          env,\n          createAttachmentEnvelopeItem(\n            attachment,\n            this._options.transportOptions && this._options.transportOptions.textEncoder,\n          ),\n        );\n      }\n\n      const promise = this._sendEnvelope(env);\n      if (promise) {\n        promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n      }\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public sendSession(session: Session | SessionAggregates): void {\n    if (this._dsn) {\n      const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n      void this._sendEnvelope(env);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void {\n    // Note: we use `event` in replay, where we overwrite this hook.\n\n    if (this._options.sendClientReports) {\n      // We want to track each category (error, transaction, session, replay_event) separately\n      // but still keep the distinction between different type of outcomes.\n      // We could use nested maps, but it's much easier to read and type this way.\n      // A correct type for map-based implementation if we want to go that route\n      // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`\n      // With typescript 4.1 we could even use template literal types\n      const key = `${reason}:${category}`;\n      __DEBUG_BUILD__ && logger.log(`Adding outcome: \"${key}\"`);\n\n      // The following works because undefined + 1 === NaN and NaN is falsy\n      this._outcomes[key] = this._outcomes[key] + 1 || 1;\n    }\n  }\n\n  // Keep on() & emit() signatures in sync with types' client.ts interface\n\n  /** @inheritdoc */\n  public on(hook: 'startTransaction' | 'finishTransaction', callback: (transaction: Transaction) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;\n\n  /** @inheritdoc */\n  public on(\n    hook: 'afterSendEvent',\n    callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void,\n  ): void;\n\n  /** @inheritdoc */\n  public on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;\n\n  /** @inheritdoc */\n  public on(hook: string, callback: unknown): void {\n    if (!this._hooks[hook]) {\n      this._hooks[hook] = [];\n    }\n\n    // @ts-ignore We assue the types are correct\n    this._hooks[hook].push(callback);\n  }\n\n  /** @inheritdoc */\n  public emit(hook: 'startTransaction' | 'finishTransaction', transaction: Transaction): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeEnvelope', envelope: Envelope): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;\n\n  /** @inheritdoc */\n  public emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;\n\n  /** @inheritdoc */\n  public emit(hook: string, ...rest: unknown[]): void {\n    if (this._hooks[hook]) {\n      // @ts-ignore we cannot enforce the callback to match the hook\n      this._hooks[hook].forEach(callback => callback(...rest));\n    }\n  }\n\n  /** Updates existing session based on the provided event */\n  protected _updateSessionFromEvent(session: Session, event: Event): void {\n    let crashed = false;\n    let errored = false;\n    const exceptions = event.exception && event.exception.values;\n\n    if (exceptions) {\n      errored = true;\n\n      for (const ex of exceptions) {\n        const mechanism = ex.mechanism;\n        if (mechanism && mechanism.handled === false) {\n          crashed = true;\n          break;\n        }\n      }\n    }\n\n    // A session is updated and that session update is sent in only one of the two following scenarios:\n    // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n    // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n    const sessionNonTerminal = session.status === 'ok';\n    const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n    if (shouldUpdateAndSend) {\n      updateSession(session, {\n        ...(crashed && { status: 'crashed' }),\n        errors: session.errors || Number(errored || crashed),\n      });\n      this.captureSession(session);\n    }\n  }\n\n  /**\n   * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n   * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n   * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n   * `false` otherwise\n   */\n  protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise(resolve => {\n      let ticked: number = 0;\n      const tick: number = 1;\n\n      const interval = setInterval(() => {\n        if (this._numProcessing == 0) {\n          clearInterval(interval);\n          resolve(true);\n        } else {\n          ticked += tick;\n          if (timeout && ticked >= timeout) {\n            clearInterval(interval);\n            resolve(false);\n          }\n        }\n      }, tick);\n    });\n  }\n\n  /** Determines whether this SDK is enabled and a valid Dsn is present. */\n  protected _isEnabled(): boolean {\n    return this.getOptions().enabled !== false && this._dsn !== undefined;\n  }\n\n  /**\n   * Adds common information to events.\n   *\n   * The information includes release and environment from `options`,\n   * breadcrumbs and context (extra, tags and user) from the scope.\n   *\n   * Information that is already present in the event is never overwritten. For\n   * nested objects, such as the context, keys are merged.\n   *\n   * @param event The original event.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A new event with more information.\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    const options = this.getOptions();\n    const integrations = Object.keys(this._integrations);\n    if (!hint.integrations && integrations.length > 0) {\n      hint.integrations = integrations;\n    }\n    return prepareEvent(options, event, hint, scope);\n  }\n\n  /**\n   * Processes the event and logs an error in case of rejection\n   * @param event\n   * @param hint\n   * @param scope\n   */\n  protected _captureEvent(event: Event, hint: EventHint = {}, scope?: Scope): PromiseLike<string | undefined> {\n    return this._processEvent(event, hint, scope).then(\n      finalEvent => {\n        return finalEvent.event_id;\n      },\n      reason => {\n        if (__DEBUG_BUILD__) {\n          // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n          // control flow, log just the message (no stack) as a log-level log.\n          const sentryError = reason as SentryError;\n          if (sentryError.logLevel === 'log') {\n            logger.log(sentryError.message);\n          } else {\n            logger.warn(sentryError);\n          }\n        }\n        return undefined;\n      },\n    );\n  }\n\n  /**\n   * Processes an event (either error or message) and sends it to Sentry.\n   *\n   * This also adds breadcrumbs and context information to the event. However,\n   * platform specific meta data (such as the User's IP address) must be added\n   * by the SDK implementor.\n   *\n   *\n   * @param event The event to send to Sentry.\n   * @param hint May contain additional information about the original exception.\n   * @param scope A scope containing event metadata.\n   * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n   */\n  protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event> {\n    const options = this.getOptions();\n    const { sampleRate } = options;\n\n    if (!this._isEnabled()) {\n      return rejectedSyncPromise(new SentryError('SDK not enabled, will not capture event.', 'log'));\n    }\n\n    const isTransaction = isTransactionEvent(event);\n    const isError = isErrorEvent(event);\n    const eventType = event.type || 'error';\n    const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n    // 1.0 === 100% events are sent\n    // 0.0 === 0% events are sent\n    // Sampling for transaction happens somewhere else\n    if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n      this.recordDroppedEvent('sample_rate', 'error', event);\n      return rejectedSyncPromise(\n        new SentryError(\n          `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n          'log',\n        ),\n      );\n    }\n\n    const dataCategory: DataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n    return this._prepareEvent(event, hint, scope)\n      .then(prepared => {\n        if (prepared === null) {\n          this.recordDroppedEvent('event_processor', dataCategory, event);\n          throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n        }\n\n        const isInternalException = hint.data && (hint.data as { __sentry__: boolean }).__sentry__ === true;\n        if (isInternalException) {\n          return prepared;\n        }\n\n        const result = processBeforeSend(options, prepared, hint);\n        return _validateBeforeSendResult(result, beforeSendLabel);\n      })\n      .then(processedEvent => {\n        if (processedEvent === null) {\n          this.recordDroppedEvent('before_send', dataCategory, event);\n          throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n        }\n\n        const session = scope && scope.getSession();\n        if (!isTransaction && session) {\n          this._updateSessionFromEvent(session, processedEvent);\n        }\n\n        // None of the Sentry built event processor will update transaction name,\n        // so if the transaction name has been changed by an event processor, we know\n        // it has to come from custom event processor added by a user\n        const transactionInfo = processedEvent.transaction_info;\n        if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n          const source = 'custom';\n          processedEvent.transaction_info = {\n            ...transactionInfo,\n            source,\n          };\n        }\n\n        this.sendEvent(processedEvent, hint);\n        return processedEvent;\n      })\n      .then(null, reason => {\n        if (reason instanceof SentryError) {\n          throw reason;\n        }\n\n        this.captureException(reason, {\n          data: {\n            __sentry__: true,\n          },\n          originalException: reason,\n        });\n        throw new SentryError(\n          `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n        );\n      });\n  }\n\n  /**\n   * Occupies the client with processing and event\n   */\n  protected _process<T>(promise: PromiseLike<T>): void {\n    this._numProcessing++;\n    void promise.then(\n      value => {\n        this._numProcessing--;\n        return value;\n      },\n      reason => {\n        this._numProcessing--;\n        return reason;\n      },\n    );\n  }\n\n  /**\n   * @inheritdoc\n   */\n  protected _sendEnvelope(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> | void {\n    if (this._transport && this._dsn) {\n      this.emit('beforeEnvelope', envelope);\n\n      return this._transport.send(envelope).then(null, reason => {\n        __DEBUG_BUILD__ && logger.error('Error while sending event:', reason);\n      });\n    } else {\n      __DEBUG_BUILD__ && logger.error('Transport disabled');\n    }\n  }\n\n  /**\n   * Clears outcomes on this client and returns them.\n   */\n  protected _clearOutcomes(): Outcome[] {\n    const outcomes = this._outcomes;\n    this._outcomes = {};\n    return Object.keys(outcomes).map(key => {\n      const [reason, category] = key.split(':') as [EventDropReason, DataCategory];\n      return {\n        reason,\n        category,\n        quantity: outcomes[key],\n      };\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;\n\n  /**\n   * @inheritDoc\n   */\n  public abstract eventFromMessage(\n    _message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    _level?: Severity | SeverityLevel,\n    _hint?: EventHint,\n  ): PromiseLike<Event>;\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n  beforeSendResult: PromiseLike<Event | null> | Event | null,\n  beforeSendLabel: string,\n): PromiseLike<Event | null> | Event | null {\n  const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n  if (isThenable(beforeSendResult)) {\n    return beforeSendResult.then(\n      event => {\n        if (!isPlainObject(event) && event !== null) {\n          throw new SentryError(invalidValueError);\n        }\n        return event;\n      },\n      e => {\n        throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n      },\n    );\n  } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n    throw new SentryError(invalidValueError);\n  }\n  return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n): PromiseLike<Event | null> | Event | null {\n  const { beforeSend, beforeSendTransaction } = options;\n\n  if (isErrorEvent(event) && beforeSend) {\n    return beforeSend(event, hint);\n  }\n\n  if (isTransactionEvent(event) && beforeSendTransaction) {\n    return beforeSendTransaction(event, hint);\n  }\n\n  return event;\n}\n\nfunction isErrorEvent(event: Event): event is ErrorEvent {\n  return event.type === undefined;\n}\n\nfunction isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n"],"names":[],"mappings":";;;;;;;AAkDA,MAAA,kBAAA,GAAA,6DAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,UAAA,CAAA;AACA;;AAGA;;AAKA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,aAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,wBAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,cAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,SAAA,GAAA,GAAA,CAAA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AAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA;AACA,QAAA,MAAA,IAAA,WAAA,CAAA,CAAA,EAAA,eAAA,CAAA,eAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA,MAAA,IAAA,CAAA,aAAA,CAAA,gBAAA,CAAA,IAAA,gBAAA,KAAA,IAAA,EAAA;AACA,IAAA,MAAA,IAAA,WAAA,CAAA,iBAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,gBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA;AACA,EAAA,OAAA;AACA,EAAA,KAAA;AACA,EAAA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,IAAA,YAAA,CAAA,KAAA,CAAA,IAAA,UAAA,EAAA;AACA,IAAA,OAAA,UAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA,KAAA,CAAA,IAAA,qBAAA,EAAA;AACA,IAAA,OAAA,qBAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,YAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,IAAA,KAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,IAAA,KAAA,aAAA,CAAA;AACA;;;;"}const DEFAULT_ENVIRONMENT = 'production';

export { DEFAULT_ENVIRONMENT };
//# sourceMappingURL=constants.js.map
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const DEFAULT_ENVIRONMENT = 'production';\n"],"names":[],"mappings":"AAAA,MAAA,mBAAA,GAAA;;;;"}import { getSdkMetadataForEnvelopeHeader, dsnToString, createEnvelope, createEventEnvelopeHeaders } from '@sentry/utils';

/**
 * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.
 * Merge with existing data if any.
 **/
function enhanceEventWithSdkInfo(event, sdkInfo) {
  if (!sdkInfo) {
    return event;
  }
  event.sdk = event.sdk || {};
  event.sdk.name = event.sdk.name || sdkInfo.name;
  event.sdk.version = event.sdk.version || sdkInfo.version;
  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];
  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];
  return event;
}

/** Creates an envelope from a Session */
function createSessionEnvelope(
  session,
  dsn,
  metadata,
  tunnel,
) {
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
  const envelopeHeaders = {
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: dsnToString(dsn) }),
  };

  const envelopeItem =
    'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session];

  return createEnvelope(envelopeHeaders, [envelopeItem]);
}

/**
 * Create an Envelope from an event.
 */
function createEventEnvelope(
  event,
  dsn,
  metadata,
  tunnel,
) {
  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);

  /*
    Note: Due to TS, event.type may be `replay_event`, theoretically.
    In practice, we never call `createEventEnvelope` with `replay_event` type,
    and we'd have to adjut a looot of types to make this work properly.
    We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)
    So the safe choice is to really guard against the replay_event type here.
  */
  const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';

  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);

  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);

  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to
  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may
  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid
  // of this `delete`, lest we miss putting it back in the next time the property is in use.)
  delete event.sdkProcessingMetadata;

  const eventItem = [{ type: eventType }, event];
  return createEnvelope(envelopeHeaders, [eventItem]);
}

export { createEventEnvelope, createSessionEnvelope };
//# sourceMappingURL=envelope.js.map
{"version":3,"file":"envelope.js","sources":["../../src/envelope.ts"],"sourcesContent":["import type {\n  DsnComponents,\n  Event,\n  EventEnvelope,\n  EventItem,\n  SdkInfo,\n  SdkMetadata,\n  Session,\n  SessionAggregates,\n  SessionEnvelope,\n  SessionItem,\n} from '@sentry/types';\nimport {\n  createEnvelope,\n  createEventEnvelopeHeaders,\n  dsnToString,\n  getSdkMetadataForEnvelopeHeader,\n} from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event: Event, sdkInfo?: SdkInfo): Event {\n  if (!sdkInfo) {\n    return event;\n  }\n  event.sdk = event.sdk || {};\n  event.sdk.name = event.sdk.name || sdkInfo.name;\n  event.sdk.version = event.sdk.version || sdkInfo.version;\n  event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n  event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n  return event;\n}\n\n/** Creates an envelope from a Session */\nexport function createSessionEnvelope(\n  session: Session | SessionAggregates,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): SessionEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n  const envelopeHeaders = {\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n  };\n\n  const envelopeItem: SessionItem =\n    'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session];\n\n  return createEnvelope<SessionEnvelope>(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nexport function createEventEnvelope(\n  event: Event,\n  dsn: DsnComponents,\n  metadata?: SdkMetadata,\n  tunnel?: string,\n): EventEnvelope {\n  const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n  /*\n    Note: Due to TS, event.type may be `replay_event`, theoretically.\n    In practice, we never call `createEventEnvelope` with `replay_event` type,\n    and we'd have to adjut a looot of types to make this work properly.\n    We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n    So the safe choice is to really guard against the replay_event type here.\n  */\n  const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n  enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n  const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n  // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n  // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n  // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n  // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n  delete event.sdkProcessingMetadata;\n\n  const eventItem: EventItem = [{ type: eventType }, event];\n  return createEnvelope<EventEnvelope>(envelopeHeaders, [eventItem]);\n}\n"],"names":[],"mappings":";;AAmBA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,KAAA,EAAA,OAAA,EAAA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,EAAA,KAAA,CAAA,GAAA,GAAA,KAAA,CAAA,GAAA,IAAA,EAAA,CAAA;AACA,EAAA,KAAA,CAAA,GAAA,CAAA,IAAA,GAAA,KAAA,CAAA,GAAA,CAAA,IAAA,IAAA,OAAA,CAAA,IAAA,CAAA;AACA,EAAA,KAAA,CAAA,GAAA,CAAA,OAAA,GAAA,KAAA,CAAA,GAAA,CAAA,OAAA,IAAA,OAAA,CAAA,OAAA,CAAA;AACA,EAAA,KAAA,CAA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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,KAAA,CAAA,IAAA,IAAA,KAAA,CAAA,IAAA,KAAA,cAAA,GAAA,KAAA,CAAA,IAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,uBAAA,CAAA,KAAA,EAAA,QAAA,IAAA,QAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA,0BAAA,CAAA,KAAA,EAAA,OAAA,EAAA,MAAA,EAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,OAAA,KAAA,CAAA,qBAAA,CAAA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,CAAA,EAAA,IAAA,EAAA,SAAA,EAAA,EAAA,KAAA,CAAA,CAAA;AACA,EAAA,OAAA,cAAA,CAAA,eAAA,EAAA,CAAA,SAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { getCurrentHub } from './hub.js';

// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,
// where HUB_FUNCTION is some method on the Hub class.
//
// This is done to make sure the top level SDK methods stay in sync with the hub methods.
// Although every method here has an explicit return type, some of them (that map to void returns) do not
// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.

/**
 * Captures an exception event and sends it to Sentry.
 *
 * @param exception An exception-like object.
 * @param captureContext Additional scope data to apply to exception event.
 * @returns The generated eventId.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
function captureException(exception, captureContext) {
  return getCurrentHub().captureException(exception, { captureContext });
}

/**
 * Captures a message event and sends it to Sentry.
 *
 * @param message The message to send to Sentry.
 * @param Severity Define the level of the message.
 * @returns The generated eventId.
 */
function captureMessage(
  message,
  // eslint-disable-next-line deprecation/deprecation
  captureContext,
) {
  // This is necessary to provide explicit scopes upgrade, without changing the original
  // arity of the `captureMessage(message, level)` method.
  const level = typeof captureContext === 'string' ? captureContext : undefined;
  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;
  return getCurrentHub().captureMessage(message, level, context);
}

/**
 * Captures a manually created event and sends it to Sentry.
 *
 * @param event The event to send to Sentry.
 * @returns The generated eventId.
 */
function captureEvent(event, hint) {
  return getCurrentHub().captureEvent(event, hint);
}

/**
 * Callback to set context information onto the scope.
 * @param callback Callback function that receives Scope.
 */
function configureScope(callback) {
  getCurrentHub().configureScope(callback);
}

/**
 * Records a new breadcrumb which will be attached to future events.
 *
 * Breadcrumbs will be added to subsequent events to provide more context on
 * user's actions prior to an error or crash.
 *
 * @param breadcrumb The breadcrumb to record.
 */
function addBreadcrumb(breadcrumb) {
  getCurrentHub().addBreadcrumb(breadcrumb);
}

/**
 * Sets context data with the given name.
 * @param name of the context
 * @param context Any kind of data. This data will be normalized.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setContext(name, context) {
  getCurrentHub().setContext(name, context);
}

/**
 * Set an object that will be merged sent as extra data with the event.
 * @param extras Extras object to merge into current context.
 */
function setExtras(extras) {
  getCurrentHub().setExtras(extras);
}

/**
 * Set key:value that will be sent as extra data with the event.
 * @param key String of extra
 * @param extra Any kind of data. This data will be normalized.
 */
function setExtra(key, extra) {
  getCurrentHub().setExtra(key, extra);
}

/**
 * Set an object that will be merged sent as tags data with the event.
 * @param tags Tags context object to merge into current context.
 */
function setTags(tags) {
  getCurrentHub().setTags(tags);
}

/**
 * Set key:value that will be sent as tags data with the event.
 *
 * Can also be used to unset a tag, by passing `undefined`.
 *
 * @param key String key of tag
 * @param value Value of tag
 */
function setTag(key, value) {
  getCurrentHub().setTag(key, value);
}

/**
 * Updates user context information for future events.
 *
 * @param user User context object to be set in the current context. Pass `null` to unset the user.
 */
function setUser(user) {
  getCurrentHub().setUser(user);
}

/**
 * Creates a new scope with and executes the given operation within.
 * The scope is automatically removed once the operation
 * finishes or throws.
 *
 * This is essentially a convenience function for:
 *
 *     pushScope();
 *     callback();
 *     popScope();
 *
 * @param callback that will be enclosed into push/popScope.
 */
function withScope(callback) {
  getCurrentHub().withScope(callback);
}

/**
 * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
 *
 * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
 * new child span within the transaction or any span, call the respective `.startChild()` method.
 *
 * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
 *
 * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
 * finished child spans will be sent to Sentry.
 *
 * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call
 * `startTransaction` directly on the hub.
 *
 * @param context Properties of the new `Transaction`.
 * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
 * default values). See {@link Options.tracesSampler}.
 *
 * @returns The transaction which was just started
 */
function startTransaction(
  context,
  customSamplingContext,
) {
  return getCurrentHub().startTransaction({ ...context }, customSamplingContext);
}

export { addBreadcrumb, captureEvent, captureException, captureMessage, configureScope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, withScope };
//# sourceMappingURL=exports.js.map
{"version":3,"file":"exports.js","sources":["../../src/exports.ts"],"sourcesContent":["import type {\n  Breadcrumb,\n  CaptureContext,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Primitive,\n  Severity,\n  SeverityLevel,\n  TransactionContext,\n  User,\n} from '@sentry/types';\n\nimport type { Hub } from './hub';\nimport { getCurrentHub } from './hub';\nimport type { Scope } from './scope';\n\n// Note: All functions in this file are typed with a return value of `ReturnType<Hub[HUB_FUNCTION]>`,\n// where HUB_FUNCTION is some method on the Hub class.\n//\n// This is done to make sure the top level SDK methods stay in sync with the hub methods.\n// Although every method here has an explicit return type, some of them (that map to void returns) do not\n// contain `return` keywords. This is done to save on bundle size, as `return` is not minifiable.\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception An exception-like object.\n * @param captureContext Additional scope data to apply to exception event.\n * @returns The generated eventId.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\nexport function captureException(exception: any, captureContext?: CaptureContext): ReturnType<Hub['captureException']> {\n  return getCurrentHub().captureException(exception, { captureContext });\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param message The message to send to Sentry.\n * @param Severity Define the level of the message.\n * @returns The generated eventId.\n */\nexport function captureMessage(\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  captureContext?: CaptureContext | Severity | SeverityLevel,\n): ReturnType<Hub['captureMessage']> {\n  // This is necessary to provide explicit scopes upgrade, without changing the original\n  // arity of the `captureMessage(message, level)` method.\n  const level = typeof captureContext === 'string' ? captureContext : undefined;\n  const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n  return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param event The event to send to Sentry.\n * @returns The generated eventId.\n */\nexport function captureEvent(event: Event, hint?: EventHint): ReturnType<Hub['captureEvent']> {\n  return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n */\nexport function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']> {\n  getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\nexport function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']> {\n  getCurrentHub().addBreadcrumb(breadcrumb);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function setContext(name: string, context: { [key: string]: any } | null): ReturnType<Hub['setContext']> {\n  getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\nexport function setExtras(extras: Extras): ReturnType<Hub['setExtras']> {\n  getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\nexport function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']> {\n  getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\nexport function setTags(tags: { [key: string]: Primitive }): ReturnType<Hub['setTags']> {\n  getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\nexport function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']> {\n  getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\nexport function setUser(user: User | null): ReturnType<Hub['setUser']> {\n  getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n *     pushScope();\n *     callback();\n *     popScope();\n *\n * @param callback that will be enclosed into push/popScope.\n */\nexport function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']> {\n  getCurrentHub().withScope(callback);\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n */\nexport function startTransaction(\n  context: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): ReturnType<Hub['startTransaction']> {\n  return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n"],"names":[],"mappings":";;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,SAAA,EAAA,cAAA,EAAA;AACA,EAAA,OAAA,aAAA,EAAA,CAAA,gBAAA,CAAA,SAAA,EAAA,EAAA,cAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA;AACA,EAAA,OAAA;AACA;AACA,EAAA,cAAA;AACA,EAAA;AACA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,cAAA,KAAA,QAAA,GAAA,cAAA,GAAA,SAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,OAAA,cAAA,KAAA,QAAA,GAAA,EAAA,cAAA,EAAA,GAAA,SAAA,CAAA;AACA,EAAA,OAAA,aAAA,EAAA,CAAA,cAAA,CAAA,OAAA,EAAA,KAAA,EAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,KAAA,EAAA,IAAA,EAAA;AACA,EAAA,OAAA,aAAA,EAAA,CAAA,YAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,QAAA,EAAA;AACA,EAAA,aAAA,EAAA,CAAA,cAAA,CAAA,QAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,UAAA,EAAA;AACA,EAAA,aAAA,EAAA,CAAA,aAAA,CAAA,UAAA,CAAA,CAAA;AAC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,EAAA,OAAA,aAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,GAAA,OAAA,EAAA,EAAA,qBAAA,CAAA,CAAA;AACA;;;;"}import { uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils';
import { DEFAULT_ENVIRONMENT } from './constants.js';
import { Scope } from './scope.js';
import { closeSession, makeSession, updateSession } from './session.js';

/**
 * API compatibility version of this hub.
 *
 * WARNING: This number should only be increased when the global interface
 * changes and new methods are introduced.
 *
 * @hidden
 */
const API_VERSION = 4;

/**
 * Default maximum number of breadcrumbs added to an event. Can be overwritten
 * with {@link Options.maxBreadcrumbs}.
 */
const DEFAULT_BREADCRUMBS = 100;

/**
 * @inheritDoc
 */
class Hub  {
  /** Is a {@link Layer}[] containing the client and scope */

  /** Contains the last event id of a captured event.  */

  /**
   * Creates a new instance of the hub, will push one {@link Layer} into the
   * internal stack on creation.
   *
   * @param client bound to the hub.
   * @param scope bound to the hub.
   * @param version number, higher number means higher priority.
   */
   constructor(client, scope = new Scope(),   _version = API_VERSION) {this._version = _version;
    this._stack = [{ scope }];
    if (client) {
      this.bindClient(client);
    }
  }

  /**
   * @inheritDoc
   */
   isOlderThan(version) {
    return this._version < version;
  }

  /**
   * @inheritDoc
   */
   bindClient(client) {
    const top = this.getStackTop();
    top.client = client;
    if (client && client.setupIntegrations) {
      client.setupIntegrations();
    }
  }

  /**
   * @inheritDoc
   */
   pushScope() {
    // We want to clone the content of prev scope
    const scope = Scope.clone(this.getScope());
    this.getStack().push({
      client: this.getClient(),
      scope,
    });
    return scope;
  }

  /**
   * @inheritDoc
   */
   popScope() {
    if (this.getStack().length <= 1) return false;
    return !!this.getStack().pop();
  }

  /**
   * @inheritDoc
   */
   withScope(callback) {
    const scope = this.pushScope();
    try {
      callback(scope);
    } finally {
      this.popScope();
    }
  }

  /**
   * @inheritDoc
   */
   getClient() {
    return this.getStackTop().client ;
  }

  /** Returns the scope of the top stack. */
   getScope() {
    return this.getStackTop().scope;
  }

  /** Returns the scope stack for domains or the process. */
   getStack() {
    return this._stack;
  }

  /** Returns the topmost scope layer in the order domain > local > process. */
   getStackTop() {
    return this._stack[this._stack.length - 1];
  }

  /**
   * @inheritDoc
   */
   captureException(exception, hint) {
    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
    const syntheticException = new Error('Sentry syntheticException');
    this._withClient((client, scope) => {
      client.captureException(
        exception,
        {
          originalException: exception,
          syntheticException,
          ...hint,
          event_id: eventId,
        },
        scope,
      );
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level,
    hint,
  ) {
    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
    const syntheticException = new Error(message);
    this._withClient((client, scope) => {
      client.captureMessage(
        message,
        level,
        {
          originalException: message,
          syntheticException,
          ...hint,
          event_id: eventId,
        },
        scope,
      );
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint) {
    const eventId = hint && hint.event_id ? hint.event_id : uuid4();
    if (!event.type) {
      this._lastEventId = eventId;
    }

    this._withClient((client, scope) => {
      client.captureEvent(event, { ...hint, event_id: eventId }, scope);
    });
    return eventId;
  }

  /**
   * @inheritDoc
   */
   lastEventId() {
    return this._lastEventId;
  }

  /**
   * @inheritDoc
   */
   addBreadcrumb(breadcrumb, hint) {
    const { scope, client } = this.getStackTop();

    if (!client) return;

    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =
      (client.getOptions && client.getOptions()) || {};

    if (maxBreadcrumbs <= 0) return;

    const timestamp = dateTimestampInSeconds();
    const mergedBreadcrumb = { timestamp, ...breadcrumb };
    const finalBreadcrumb = beforeBreadcrumb
      ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )
      : mergedBreadcrumb;

    if (finalBreadcrumb === null) return;

    if (client.emit) {
      client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);
    }

    scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);
  }

  /**
   * @inheritDoc
   */
   setUser(user) {
    this.getScope().setUser(user);
  }

  /**
   * @inheritDoc
   */
   setTags(tags) {
    this.getScope().setTags(tags);
  }

  /**
   * @inheritDoc
   */
   setExtras(extras) {
    this.getScope().setExtras(extras);
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this.getScope().setTag(key, value);
  }

  /**
   * @inheritDoc
   */
   setExtra(key, extra) {
    this.getScope().setExtra(key, extra);
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   setContext(name, context) {
    this.getScope().setContext(name, context);
  }

  /**
   * @inheritDoc
   */
   configureScope(callback) {
    const { scope, client } = this.getStackTop();
    if (client) {
      callback(scope);
    }
  }

  /**
   * @inheritDoc
   */
   run(callback) {
    const oldHub = makeMain(this);
    try {
      callback(this);
    } finally {
      makeMain(oldHub);
    }
  }

  /**
   * @inheritDoc
   */
   getIntegration(integration) {
    const client = this.getClient();
    if (!client) return null;
    try {
      return client.getIntegration(integration);
    } catch (_oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
      return null;
    }
  }

  /**
   * @inheritDoc
   */
   startTransaction(context, customSamplingContext) {
    const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && !result) {
      // eslint-disable-next-line no-console
      console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`);
    }

    return result;
  }

  /**
   * @inheritDoc
   */
   traceHeaders() {
    return this._callExtensionMethod('traceHeaders');
  }

  /**
   * @inheritDoc
   */
   captureSession(endSession = false) {
    // both send the update and pull the session from the scope
    if (endSession) {
      return this.endSession();
    }

    // only send the update
    this._sendSessionUpdate();
  }

  /**
   * @inheritDoc
   */
   endSession() {
    const layer = this.getStackTop();
    const scope = layer.scope;
    const session = scope.getSession();
    if (session) {
      closeSession(session);
    }
    this._sendSessionUpdate();

    // the session is over; take it off of the scope
    scope.setSession();
  }

  /**
   * @inheritDoc
   */
   startSession(context) {
    const { scope, client } = this.getStackTop();
    const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};

    // Will fetch userAgent if called from browser sdk
    const { userAgent } = GLOBAL_OBJ.navigator || {};

    const session = makeSession({
      release,
      environment,
      user: scope.getUser(),
      ...(userAgent && { userAgent }),
      ...context,
    });

    // End existing session if there's one
    const currentSession = scope.getSession && scope.getSession();
    if (currentSession && currentSession.status === 'ok') {
      updateSession(currentSession, { status: 'exited' });
    }
    this.endSession();

    // Afterwards we set the new session on the scope
    scope.setSession(session);

    return session;
  }

  /**
   * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
   * when Tracing is used.
   */
   shouldSendDefaultPii() {
    const client = this.getClient();
    const options = client && client.getOptions();
    return Boolean(options && options.sendDefaultPii);
  }

  /**
   * Sends the current Session on the scope
   */
   _sendSessionUpdate() {
    const { scope, client } = this.getStackTop();

    const session = scope.getSession();
    if (session && client && client.captureSession) {
      client.captureSession(session);
    }
  }

  /**
   * Internal helper function to call a method on the top client if it exists.
   *
   * @param method The method to call on the client.
   * @param args Arguments to pass to the client function.
   */
   _withClient(callback) {
    const { scope, client } = this.getStackTop();
    if (client) {
      callback(client, scope);
    }
  }

  /**
   * Calls global extension method and binding current instance to the function call
   */
  // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   _callExtensionMethod(method, ...args) {
    const carrier = getMainCarrier();
    const sentry = carrier.__SENTRY__;
    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
      return sentry.extensions[method].apply(this, args);
    }
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);
  }
}

/**
 * Returns the global shim registry.
 *
 * FIXME: This function is problematic, because despite always returning a valid Carrier,
 * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
 * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
 **/
function getMainCarrier() {
  GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {
    extensions: {},
    hub: undefined,
  };
  return GLOBAL_OBJ;
}

/**
 * Replaces the current main hub with the passed one on the global object
 *
 * @returns The old replaced hub
 */
function makeMain(hub) {
  const registry = getMainCarrier();
  const oldHub = getHubFromCarrier(registry);
  setHubOnCarrier(registry, hub);
  return oldHub;
}

/**
 * Returns the default hub instance.
 *
 * If a hub is already registered in the global carrier but this module
 * contains a more recent version, it replaces the registered version.
 * Otherwise, the currently registered hub will be returned.
 */
function getCurrentHub() {
  // Get main carrier (global for every environment)
  const registry = getMainCarrier();

  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {
    const hub = registry.__SENTRY__.acs.getCurrentHub();

    if (hub) {
      return hub;
    }
  }

  // Return hub that lives on a global object
  return getGlobalHub(registry);
}

function getGlobalHub(registry = getMainCarrier()) {
  // If there's no hub, or its an old API, assign a new one
  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {
    setHubOnCarrier(registry, new Hub());
  }

  // Return hub that lives on a global object
  return getHubFromCarrier(registry);
}

/**
 * @private Private API with no semver guarantees!
 *
 * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.
 */
function ensureHubOnCarrier(carrier, parent = getGlobalHub()) {
  // If there's no hub on current domain, or it's an old API, assign a new one
  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {
    const globalHubTopStack = parent.getStackTop();
    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, Scope.clone(globalHubTopStack.scope)));
  }
}

/**
 * @private Private API with no semver guarantees!
 *
 * Sets the global async context strategy
 */
function setAsyncContextStrategy(strategy) {
  // Get main carrier (global for every environment)
  const registry = getMainCarrier();
  registry.__SENTRY__ = registry.__SENTRY__ || {};
  registry.__SENTRY__.acs = strategy;
}

/**
 * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.
 *
 * @param callback The callback to run in its own async context
 * @param options Options to pass to the async context strategy
 * @returns The result of the callback
 */
function runWithAsyncContext(callback, options = {}) {
  const registry = getMainCarrier();

  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {
    return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);
  }

  // if there was no strategy, fallback to just calling the callback
  return callback();
}

/**
 * This will tell whether a carrier has a hub on it or not
 * @param carrier object
 */
function hasHubOnCarrier(carrier) {
  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);
}

/**
 * This will create a new {@link Hub} and add to the passed object on
 * __SENTRY__.hub.
 * @param carrier object
 * @hidden
 */
function getHubFromCarrier(carrier) {
  return getGlobalSingleton('hub', () => new Hub(), carrier);
}

/**
 * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
 * @param carrier object
 * @param hub Hub
 * @returns A boolean indicating success or failure
 */
function setHubOnCarrier(carrier, hub) {
  if (!carrier) return false;
  const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});
  __SENTRY__.hub = hub;
  return true;
}

export { API_VERSION, Hub, ensureHubOnCarrier, getCurrentHub, getHubFromCarrier, getMainCarrier, makeMain, runWithAsyncContext, setAsyncContextStrategy, setHubOnCarrier };
//# sourceMappingURL=hub.js.map
{"version":3,"file":"hub.js","sources":["../../src/hub.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Client,\n  CustomSamplingContext,\n  Event,\n  EventHint,\n  Extra,\n  Extras,\n  Hub as HubInterface,\n  Integration,\n  IntegrationClass,\n  Primitive,\n  Session,\n  SessionContext,\n  Severity,\n  SeverityLevel,\n  Transaction,\n  TransactionContext,\n  User,\n} from '@sentry/types';\nimport { consoleSandbox, dateTimestampInSeconds, getGlobalSingleton, GLOBAL_OBJ, logger, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from './constants';\nimport { Scope } from './scope';\nimport { closeSession, makeSession, updateSession } from './session';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nexport const API_VERSION = 4;\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\nexport interface RunWithAsyncContextOptions {\n  /** Whether to reuse an existing async context if one exists. Defaults to false. */\n  reuseExisting?: boolean;\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Strategy used to track async context.\n */\nexport interface AsyncContextStrategy {\n  /**\n   * Gets the current async context. Returns undefined if there is no current async context.\n   */\n  getCurrentHub: () => Hub | undefined;\n  /**\n   * Runs the supplied callback in its own async context.\n   */\n  runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T;\n}\n\n/**\n * A layer in the process stack.\n * @hidden\n */\nexport interface Layer {\n  client?: Client;\n  scope: Scope;\n}\n\n/**\n * An object that contains a hub and maintains a scope stack.\n * @hidden\n */\nexport interface Carrier {\n  __SENTRY__?: {\n    hub?: Hub;\n    acs?: AsyncContextStrategy;\n    /**\n     * Extra Hub properties injected by various SDKs\n     */\n    integrations?: Integration[];\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n/**\n * @inheritDoc\n */\nexport class Hub implements HubInterface {\n  /** Is a {@link Layer}[] containing the client and scope */\n  private readonly _stack: Layer[];\n\n  /** Contains the last event id of a captured event.  */\n  private _lastEventId?: string;\n\n  /**\n   * Creates a new instance of the hub, will push one {@link Layer} into the\n   * internal stack on creation.\n   *\n   * @param client bound to the hub.\n   * @param scope bound to the hub.\n   * @param version number, higher number means higher priority.\n   */\n  public constructor(client?: Client, scope: Scope = new Scope(), private readonly _version: number = API_VERSION) {\n    this._stack = [{ scope }];\n    if (client) {\n      this.bindClient(client);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isOlderThan(version: number): boolean {\n    return this._version < version;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public bindClient(client?: Client): void {\n    const top = this.getStackTop();\n    top.client = client;\n    if (client && client.setupIntegrations) {\n      client.setupIntegrations();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public pushScope(): Scope {\n    // We want to clone the content of prev scope\n    const scope = Scope.clone(this.getScope());\n    this.getStack().push({\n      client: this.getClient(),\n      scope,\n    });\n    return scope;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public popScope(): boolean {\n    if (this.getStack().length <= 1) return false;\n    return !!this.getStack().pop();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public withScope(callback: (scope: Scope) => void): void {\n    const scope = this.pushScope();\n    try {\n      callback(scope);\n    } finally {\n      this.popScope();\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getClient<C extends Client>(): C | undefined {\n    return this.getStackTop().client as C;\n  }\n\n  /** Returns the scope of the top stack. */\n  public getScope(): Scope {\n    return this.getStackTop().scope;\n  }\n\n  /** Returns the scope stack for domains or the process. */\n  public getStack(): Layer[] {\n    return this._stack;\n  }\n\n  /** Returns the topmost scope layer in the order domain > local > process. */\n  public getStackTop(): Layer {\n    return this._stack[this._stack.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureException(exception: unknown, hint?: EventHint): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error('Sentry syntheticException');\n    this._withClient((client, scope) => {\n      client.captureException(\n        exception,\n        {\n          originalException: exception,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level?: Severity | SeverityLevel,\n    hint?: EventHint,\n  ): string {\n    const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n    const syntheticException = new Error(message);\n    this._withClient((client, scope) => {\n      client.captureMessage(\n        message,\n        level,\n        {\n          originalException: message,\n          syntheticException,\n          ...hint,\n          event_id: eventId,\n        },\n        scope,\n      );\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint): string {\n    const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n    if (!event.type) {\n      this._lastEventId = eventId;\n    }\n\n    this._withClient((client, scope) => {\n      client.captureEvent(event, { ...hint, event_id: eventId }, scope);\n    });\n    return eventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public lastEventId(): string | undefined {\n    return this._lastEventId;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void {\n    const { scope, client } = this.getStackTop();\n\n    if (!client) return;\n\n    const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n      (client.getOptions && client.getOptions()) || {};\n\n    if (maxBreadcrumbs <= 0) return;\n\n    const timestamp = dateTimestampInSeconds();\n    const mergedBreadcrumb = { timestamp, ...breadcrumb };\n    const finalBreadcrumb = beforeBreadcrumb\n      ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) as Breadcrumb | null)\n      : mergedBreadcrumb;\n\n    if (finalBreadcrumb === null) return;\n\n    if (client.emit) {\n      client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n    }\n\n    scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): void {\n    this.getScope().setUser(user);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): void {\n    this.getScope().setTags(tags);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): void {\n    this.getScope().setExtras(extras);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): void {\n    this.getScope().setTag(key, value);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): void {\n    this.getScope().setExtra(key, extra);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public setContext(name: string, context: { [key: string]: any } | null): void {\n    this.getScope().setContext(name, context);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public configureScope(callback: (scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(scope);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public run(callback: (hub: Hub) => void): void {\n    const oldHub = makeMain(this);\n    try {\n      callback(this);\n    } finally {\n      makeMain(oldHub);\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null {\n    const client = this.getClient();\n    if (!client) return null;\n    try {\n      return client.getIntegration(integration);\n    } catch (_oO) {\n      __DEBUG_BUILD__ && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n      return null;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction {\n    const result = this._callExtensionMethod<Transaction>('startTransaction', context, customSamplingContext);\n\n    if (__DEBUG_BUILD__ && !result) {\n      // eslint-disable-next-line no-console\n      console.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n    }\n\n    return result;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public traceHeaders(): { [key: string]: string } {\n    return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureSession(endSession: boolean = false): void {\n    // both send the update and pull the session from the scope\n    if (endSession) {\n      return this.endSession();\n    }\n\n    // only send the update\n    this._sendSessionUpdate();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public endSession(): void {\n    const layer = this.getStackTop();\n    const scope = layer.scope;\n    const session = scope.getSession();\n    if (session) {\n      closeSession(session);\n    }\n    this._sendSessionUpdate();\n\n    // the session is over; take it off of the scope\n    scope.setSession();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startSession(context?: SessionContext): Session {\n    const { scope, client } = this.getStackTop();\n    const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n    // Will fetch userAgent if called from browser sdk\n    const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n    const session = makeSession({\n      release,\n      environment,\n      user: scope.getUser(),\n      ...(userAgent && { userAgent }),\n      ...context,\n    });\n\n    // End existing session if there's one\n    const currentSession = scope.getSession && scope.getSession();\n    if (currentSession && currentSession.status === 'ok') {\n      updateSession(currentSession, { status: 'exited' });\n    }\n    this.endSession();\n\n    // Afterwards we set the new session on the scope\n    scope.setSession(session);\n\n    return session;\n  }\n\n  /**\n   * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n   * when Tracing is used.\n   */\n  public shouldSendDefaultPii(): boolean {\n    const client = this.getClient();\n    const options = client && client.getOptions();\n    return Boolean(options && options.sendDefaultPii);\n  }\n\n  /**\n   * Sends the current Session on the scope\n   */\n  private _sendSessionUpdate(): void {\n    const { scope, client } = this.getStackTop();\n\n    const session = scope.getSession();\n    if (session && client && client.captureSession) {\n      client.captureSession(session);\n    }\n  }\n\n  /**\n   * Internal helper function to call a method on the top client if it exists.\n   *\n   * @param method The method to call on the client.\n   * @param args Arguments to pass to the client function.\n   */\n  private _withClient(callback: (client: Client, scope: Scope) => void): void {\n    const { scope, client } = this.getStackTop();\n    if (client) {\n      callback(client, scope);\n    }\n  }\n\n  /**\n   * Calls global extension method and binding current instance to the function call\n   */\n  // @ts-ignore Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _callExtensionMethod<T>(method: string, ...args: any[]): T {\n    const carrier = getMainCarrier();\n    const sentry = carrier.__SENTRY__;\n    if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n      return sentry.extensions[method].apply(this, args);\n    }\n    __DEBUG_BUILD__ && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n  }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nexport function getMainCarrier(): Carrier {\n  GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n    extensions: {},\n    hub: undefined,\n  };\n  return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n */\nexport function makeMain(hub: Hub): Hub {\n  const registry = getMainCarrier();\n  const oldHub = getHubFromCarrier(registry);\n  setHubOnCarrier(registry, hub);\n  return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n */\nexport function getCurrentHub(): Hub {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n    if (hub) {\n      return hub;\n    }\n  }\n\n  // Return hub that lives on a global object\n  return getGlobalHub(registry);\n}\n\nfunction getGlobalHub(registry: Carrier = getMainCarrier()): Hub {\n  // If there's no hub, or its an old API, assign a new one\n  if (!hasHubOnCarrier(registry) || getHubFromCarrier(registry).isOlderThan(API_VERSION)) {\n    setHubOnCarrier(registry, new Hub());\n  }\n\n  // Return hub that lives on a global object\n  return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\nexport function ensureHubOnCarrier(carrier: Carrier, parent: Hub = getGlobalHub()): void {\n  // If there's no hub on current domain, or it's an old API, assign a new one\n  if (!hasHubOnCarrier(carrier) || getHubFromCarrier(carrier).isOlderThan(API_VERSION)) {\n    const globalHubTopStack = parent.getStackTop();\n    setHubOnCarrier(carrier, new Hub(globalHubTopStack.client, Scope.clone(globalHubTopStack.scope)));\n  }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nexport function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void {\n  // Get main carrier (global for every environment)\n  const registry = getMainCarrier();\n  registry.__SENTRY__ = registry.__SENTRY__ || {};\n  registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nexport function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions = {}): T {\n  const registry = getMainCarrier();\n\n  if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n    return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n  }\n\n  // if there was no strategy, fallback to just calling the callback\n  return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier: Carrier): boolean {\n  return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\nexport function getHubFromCarrier(carrier: Carrier): Hub {\n  return getGlobalSingleton<Hub>('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\nexport function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean {\n  if (!carrier) return false;\n  const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n  __SENTRY__.hub = hub;\n  return true;\n}\n"],"names":[],"mappings":";;;;;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,WAAA,GAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,GAAA,CAAA;;AAoDA;AACA;AACA;AACA,MAAA,GAAA,EAAA;AACA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,MAAA,EAAA,KAAA,GAAA,IAAA,KAAA,EAAA,IAAA,QAAA,GAAA,WAAA,EAAA,CAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,CAAA,EAAA,KAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,MAAA,EAAA;AACA,MAAA,IAAA,CAAA,UAAA,CAAA,MAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,EAAA;AACA,IAAA,OAAA,IAAA,CAAA,QAAA,GAAA,OAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,UAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,GAAA,GAAA,IAAA,CAAA,WAAA,EAAA,CAAA;AACA,IAAA,GAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AACA,IAAA,IAAA,MAAA,IAAA,MAAA,CAAA,iBAAA,EAAA;AACA,MAAA,MAAA,CAAA,iBAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA;AACA,IAAA,MAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,IA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AA,CAAA,UAAA,IAAA,EAAA,CAAA;AACA,EAAA,QAAA,CAAA,UAAA,CAAA,GAAA,GAAA,QAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,QAAA,EAAA,OAAA,GAAA,EAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,cAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,CAAA,UAAA,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,EAAA;AACA,IAAA,OAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,mBAAA,CAAA,QAAA,EAAA,OAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,OAAA,QAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,CAAA,EAAA,OAAA,IAAA,OAAA,CAAA,UAAA,IAAA,OAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,kBAAA,CAAA,KAAA,EAAA,MAAA,IAAA,GAAA,EAAA,EAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,OAAA,EAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,OAAA,EAAA,OAAA,KAAA,CAAA;AACA,EAAA,MAAA,UAAA,IAAA,OAAA,CAAA,UAAA,GAAA,OAAA,CAAA,UAAA,IAAA,EAAA,CAAA,CAAA;AACA,EAAA,UAAA,CAAA,GAAA,GAAA,GAAA,CAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;"}export { addTracingExtensions, startIdleTransaction } from './tracing/hubextensions.js';
export { IdleTransaction, TRACING_DEFAULTS } from './tracing/idletransaction.js';
export { Span, spanStatusfromHttpCode } from './tracing/span.js';
export { Transaction } from './tracing/transaction.js';
export { getActiveTransaction } from './tracing/utils.js';
export { SpanStatus } from './tracing/spanstatus.js';
export { trace } from './tracing/trace.js';
export { addBreadcrumb, captureEvent, captureException, captureMessage, configureScope, setContext, setExtra, setExtras, setTag, setTags, setUser, startTransaction, withScope } from './exports.js';
export { Hub, ensureHubOnCarrier, getCurrentHub, getHubFromCarrier, getMainCarrier, makeMain, runWithAsyncContext, setAsyncContextStrategy, setHubOnCarrier } from './hub.js';
export { closeSession, makeSession, updateSession } from './session.js';
export { SessionFlusher } from './sessionflusher.js';
export { Scope, addGlobalEventProcessor } from './scope.js';
export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api.js';
export { BaseClient } from './baseclient.js';
export { initAndBind } from './sdk.js';
export { createTransport } from './transports/base.js';
export { makeOfflineTransport } from './transports/offline.js';
export { SDK_VERSION } from './version.js';
export { getIntegrationsToSetup } from './integration.js';
import * as index from './integrations/index.js';
export { index as Integrations };
export { prepareEvent } from './utils/prepareEvent.js';
export { hasTracingEnabled } from './utils/hasTracingEnabled.js';
export { DEFAULT_ENVIRONMENT } from './constants.js';
export { FunctionToString } from './integrations/functiontostring.js';
export { InboundFilters } from './integrations/inboundfilters.js';
export { extractTraceparentData } from '@sentry/utils';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}import { arrayify, logger } from '@sentry/utils';
import { getCurrentHub } from './hub.js';
import { addGlobalEventProcessor } from './scope.js';

const installedIntegrations = [];

/** Map of integrations assigned to a client */

/**
 * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to
 * preseve the order of integrations in the array.
 *
 * @private
 */
function filterDuplicates(integrations) {
  const integrationsByName = {};

  integrations.forEach(currentInstance => {
    const { name } = currentInstance;

    const existingInstance = integrationsByName[name];

    // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a
    // default instance to overwrite an existing user instance
    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {
      return;
    }

    integrationsByName[name] = currentInstance;
  });

  return Object.keys(integrationsByName).map(k => integrationsByName[k]);
}

/** Gets integrations to install */
function getIntegrationsToSetup(options) {
  const defaultIntegrations = options.defaultIntegrations || [];
  const userIntegrations = options.integrations;

  // We flag default instances, so that later we can tell them apart from any user-created instances of the same class
  defaultIntegrations.forEach(integration => {
    integration.isDefaultInstance = true;
  });

  let integrations;

  if (Array.isArray(userIntegrations)) {
    integrations = [...defaultIntegrations, ...userIntegrations];
  } else if (typeof userIntegrations === 'function') {
    integrations = arrayify(userIntegrations(defaultIntegrations));
  } else {
    integrations = defaultIntegrations;
  }

  const finalIntegrations = filterDuplicates(integrations);

  // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or
  // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event
  // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore
  // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.
  const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');
  if (debugIndex !== -1) {
    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);
    finalIntegrations.push(debugInstance);
  }

  return finalIntegrations;
}

/**
 * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
 * integrations are added unless they were already provided before.
 * @param integrations array of integration instances
 * @param withDefault should enable default integrations
 */
function setupIntegrations(integrations) {
  const integrationIndex = {};

  integrations.forEach(integration => {
    // guard against empty provided integrations
    if (integration) {
      setupIntegration(integration, integrationIndex);
    }
  });

  return integrationIndex;
}

/** Setup a single integration.  */
function setupIntegration(integration, integrationIndex) {
  integrationIndex[integration.name] = integration;

  if (installedIntegrations.indexOf(integration.name) === -1) {
    integration.setupOnce(addGlobalEventProcessor, getCurrentHub);
    installedIntegrations.push(integration.name);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Integration installed: ${integration.name}`);
  }
}

// Polyfill for Array.findIndex(), which is not supported in ES5
function findIndex(arr, callback) {
  for (let i = 0; i < arr.length; i++) {
    if (callback(arr[i]) === true) {
      return i;
    }
  }

  return -1;
}

export { getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };
//# sourceMappingURL=integration.js.map
{"version":3,"file":"integration.js","sources":["../../src/integration.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/types';\nimport { arrayify, logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\nimport { addGlobalEventProcessor } from './scope';\n\ndeclare module '@sentry/types' {\n  interface Integration {\n    isDefaultInstance?: boolean;\n  }\n}\n\nexport const installedIntegrations: string[] = [];\n\n/** Map of integrations assigned to a client */\nexport type IntegrationIndex = {\n  [key: string]: Integration;\n};\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations: Integration[]): Integration[] {\n  const integrationsByName: { [key: string]: Integration } = {};\n\n  integrations.forEach(currentInstance => {\n    const { name } = currentInstance;\n\n    const existingInstance = integrationsByName[name];\n\n    // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n    // default instance to overwrite an existing user instance\n    if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n      return;\n    }\n\n    integrationsByName[name] = currentInstance;\n  });\n\n  return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nexport function getIntegrationsToSetup(options: Options): Integration[] {\n  const defaultIntegrations = options.defaultIntegrations || [];\n  const userIntegrations = options.integrations;\n\n  // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n  defaultIntegrations.forEach(integration => {\n    integration.isDefaultInstance = true;\n  });\n\n  let integrations: Integration[];\n\n  if (Array.isArray(userIntegrations)) {\n    integrations = [...defaultIntegrations, ...userIntegrations];\n  } else if (typeof userIntegrations === 'function') {\n    integrations = arrayify(userIntegrations(defaultIntegrations));\n  } else {\n    integrations = defaultIntegrations;\n  }\n\n  const finalIntegrations = filterDuplicates(integrations);\n\n  // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n  // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n  // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n  // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n  const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n  if (debugIndex !== -1) {\n    const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n    finalIntegrations.push(debugInstance);\n  }\n\n  return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nexport function setupIntegrations(integrations: Integration[]): IntegrationIndex {\n  const integrationIndex: IntegrationIndex = {};\n\n  integrations.forEach(integration => {\n    // guard against empty provided integrations\n    if (integration) {\n      setupIntegration(integration, integrationIndex);\n    }\n  });\n\n  return integrationIndex;\n}\n\n/** Setup a single integration.  */\nexport function setupIntegration(integration: Integration, integrationIndex: IntegrationIndex): void {\n  integrationIndex[integration.name] = integration;\n\n  if (installedIntegrations.indexOf(integration.name) === -1) {\n    integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n    installedIntegrations.push(integration.name);\n    __DEBUG_BUILD__ && logger.log(`Integration installed: ${integration.name}`);\n  }\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex<T>(arr: T[], callback: (item: T) => boolean): number {\n  for (let i = 0; i < arr.length; i++) {\n    if (callback(arr[i]) === true) {\n      return i;\n    }\n  }\n\n  return -1;\n}\n"],"names":[],"mappings":";;;;AAYA,MAAA,qBAAA,GAAA,GAAA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA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AAA,uBAAA,EAAA,WAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,SAAA,CAAA,GAAA,EAAA,QAAA,EAAA;AACA,EAAA,KAAA,IAAA,CAAA,GAAA,CAAA,EAAA,CAAA,GAAA,GAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,IAAA,IAAA,QAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,KAAA,IAAA,EAAA;AACA,MAAA,OAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { getOriginalFunction } from '@sentry/utils';

let originalFunctionToString;

/** Patch toString calls to return proper name for wrapped functions */
class FunctionToString  {constructor() { FunctionToString.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'FunctionToString';}

  /**
   * @inheritDoc
   */
   __init() {this.name = FunctionToString.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    // eslint-disable-next-line @typescript-eslint/unbound-method
    originalFunctionToString = Function.prototype.toString;

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    Function.prototype.toString = function ( ...args) {
      const context = getOriginalFunction(this) || this;
      return originalFunctionToString.apply(context, args);
    };
  }
} FunctionToString.__initStatic();

export { FunctionToString };
//# sourceMappingURL=functiontostring.js.map
{"version":3,"file":"functiontostring.js","sources":["../../../src/integrations/functiontostring.ts"],"sourcesContent":["import type { Integration, WrappedFunction } from '@sentry/types';\nimport { getOriginalFunction } from '@sentry/utils';\n\nlet originalFunctionToString: () => void;\n\n/** Patch toString calls to return proper name for wrapped functions */\nexport class FunctionToString implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'FunctionToString';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = FunctionToString.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    // eslint-disable-next-line @typescript-eslint/unbound-method\n    originalFunctionToString = Function.prototype.toString;\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    Function.prototype.toString = function (this: WrappedFunction, ...args: any[]): string {\n      const context = getOriginalFunction(this) || this;\n      return originalFunctionToString.apply(context, args);\n    };\n  }\n}\n"],"names":[],"mappings":";;AAGA,IAAA,wBAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,EAAA,CAAA,WAAA,GAAA,EAAA,gBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,mBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,gBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA;AACA,IAAA,wBAAA,GAAA,QAAA,CAAA,SAAA,CAAA,QAAA,CAAA;AACA;AACA;AACA,IAAA,QAAA,CAAA,SAAA,CAAA,QAAA,GAAA,WAAA,GAAA,IAAA,EAAA;AACA,MAAA,MAAA,OAAA,GAAA,mBAAA,CAAA,IAAA,CAAA,IAAA,IAAA,CAAA;AACA,MAAA,OAAA,wBAAA,CAAA,KAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,gBAAA,CAAA,YAAA,EAAA;;;;"}import { logger, getEventDescription, stringMatchesSomePattern } from '@sentry/utils';

// "Script error." is hard coded into browsers for errors that it can't read.
// this is the result of a script being pulled in from an external domain and CORS.
const DEFAULT_IGNORE_ERRORS = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/];

/** Options for the InboundFilters integration */

/** Inbound filters configurable by the user */
class InboundFilters  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'InboundFilters';}

  /**
   * @inheritDoc
   */
   __init() {this.name = InboundFilters.id;}

   constructor(  _options = {}) {this._options = _options;InboundFilters.prototype.__init.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    const eventProcess = (event) => {
      const hub = getCurrentHub();
      if (hub) {
        const self = hub.getIntegration(InboundFilters);
        if (self) {
          const client = hub.getClient();
          const clientOptions = client ? client.getOptions() : {};
          const options = _mergeOptions(self._options, clientOptions);
          return _shouldDropEvent(event, options) ? null : event;
        }
      }
      return event;
    };

    eventProcess.id = this.name;
    addGlobalEventProcessor(eventProcess);
  }
} InboundFilters.__initStatic();

/** JSDoc */
function _mergeOptions(
  internalOptions = {},
  clientOptions = {},
) {
  return {
    allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],
    denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],
    ignoreErrors: [
      ...(internalOptions.ignoreErrors || []),
      ...(clientOptions.ignoreErrors || []),
      ...DEFAULT_IGNORE_ERRORS,
    ],
    ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],
    ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,
  };
}

/** JSDoc */
function _shouldDropEvent(event, options) {
  if (options.ignoreInternal && _isSentryError(event)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`);
    return true;
  }
  if (_isIgnoredError(event, options.ignoreErrors)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(
        `Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`,
      );
    return true;
  }
  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(
        `Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${getEventDescription(event)}`,
      );
    return true;
  }
  if (_isDeniedUrl(event, options.denyUrls)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(
        `Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription(
          event,
        )}.\nUrl: ${_getEventFilterUrl(event)}`,
      );
    return true;
  }
  if (!_isAllowedUrl(event, options.allowUrls)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(
        `Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription(
          event,
        )}.\nUrl: ${_getEventFilterUrl(event)}`,
      );
    return true;
  }
  return false;
}

function _isIgnoredError(event, ignoreErrors) {
  // If event.type, this is not an error
  if (event.type || !ignoreErrors || !ignoreErrors.length) {
    return false;
  }

  return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));
}

function _isIgnoredTransaction(event, ignoreTransactions) {
  if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {
    return false;
  }

  const name = event.transaction;
  return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;
}

function _isDeniedUrl(event, denyUrls) {
  // TODO: Use Glob instead?
  if (!denyUrls || !denyUrls.length) {
    return false;
  }
  const url = _getEventFilterUrl(event);
  return !url ? false : stringMatchesSomePattern(url, denyUrls);
}

function _isAllowedUrl(event, allowUrls) {
  // TODO: Use Glob instead?
  if (!allowUrls || !allowUrls.length) {
    return true;
  }
  const url = _getEventFilterUrl(event);
  return !url ? true : stringMatchesSomePattern(url, allowUrls);
}

function _getPossibleEventMessages(event) {
  if (event.message) {
    return [event.message];
  }
  if (event.exception) {
    try {
      const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};
      return [`${value}`, `${type}: ${value}`];
    } catch (oO) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Cannot extract message for event ${getEventDescription(event)}`);
      return [];
    }
  }
  return [];
}

function _isSentryError(event) {
  try {
    // @ts-ignore can't be a sentry error if undefined
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    return event.exception.values[0].type === 'SentryError';
  } catch (e) {
    // ignore
  }
  return false;
}

function _getLastValidUrl(frames = []) {
  for (let i = frames.length - 1; i >= 0; i--) {
    const frame = frames[i];

    if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {
      return frame.filename || null;
    }
  }

  return null;
}

function _getEventFilterUrl(event) {
  try {
    let frames;
    try {
      // @ts-ignore we only care about frames if the whole thing here is defined
      frames = event.exception.values[0].stacktrace.frames;
    } catch (e) {
      // ignore
    }
    return frames ? _getLastValidUrl(frames) : null;
  } catch (oO) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);
    return null;
  }
}

export { InboundFilters, _mergeOptions, _shouldDropEvent };
//# sourceMappingURL=inboundfilters.js.map
{"version":3,"file":"inboundfilters.js","sources":["../../../src/integrations/inboundfilters.ts"],"sourcesContent":["import type { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\nimport { getEventDescription, logger, stringMatchesSomePattern } from '@sentry/utils';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [/^Script error\\.?$/, /^Javascript error: Script error\\.? on line 0$/];\n\n/** Options for the InboundFilters integration */\nexport interface InboundFiltersOptions {\n  allowUrls: Array<string | RegExp>;\n  denyUrls: Array<string | RegExp>;\n  ignoreErrors: Array<string | RegExp>;\n  ignoreTransactions: Array<string | RegExp>;\n  ignoreInternal: boolean;\n}\n\n/** Inbound filters configurable by the user */\nexport class InboundFilters implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'InboundFilters';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = InboundFilters.id;\n\n  public constructor(private readonly _options: Partial<InboundFiltersOptions> = {}) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (processor: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    const eventProcess: EventProcessor = (event: Event) => {\n      const hub = getCurrentHub();\n      if (hub) {\n        const self = hub.getIntegration(InboundFilters);\n        if (self) {\n          const client = hub.getClient();\n          const clientOptions = client ? client.getOptions() : {};\n          const options = _mergeOptions(self._options, clientOptions);\n          return _shouldDropEvent(event, options) ? null : event;\n        }\n      }\n      return event;\n    };\n\n    eventProcess.id = this.name;\n    addGlobalEventProcessor(eventProcess);\n  }\n}\n\n/** JSDoc */\nexport function _mergeOptions(\n  internalOptions: Partial<InboundFiltersOptions> = {},\n  clientOptions: Partial<InboundFiltersOptions> = {},\n): Partial<InboundFiltersOptions> {\n  return {\n    allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n    denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n    ignoreErrors: [\n      ...(internalOptions.ignoreErrors || []),\n      ...(clientOptions.ignoreErrors || []),\n      ...DEFAULT_IGNORE_ERRORS,\n    ],\n    ignoreTransactions: [...(internalOptions.ignoreTransactions || []), ...(clientOptions.ignoreTransactions || [])],\n    ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n  };\n}\n\n/** JSDoc */\nexport function _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean {\n  if (options.ignoreInternal && _isSentryError(event)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n    return true;\n  }\n  if (_isIgnoredError(event, options.ignoreErrors)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n      );\n    return true;\n  }\n  if (_isDeniedUrl(event, options.denyUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  if (!_isAllowedUrl(event, options.allowUrls)) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n          event,\n        )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n      );\n    return true;\n  }\n  return false;\n}\n\nfunction _isIgnoredError(event: Event, ignoreErrors?: Array<string | RegExp>): boolean {\n  // If event.type, this is not an error\n  if (event.type || !ignoreErrors || !ignoreErrors.length) {\n    return false;\n  }\n\n  return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string | RegExp>): boolean {\n  if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n    return false;\n  }\n\n  const name = event.transaction;\n  return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!denyUrls || !denyUrls.length) {\n    return false;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event: Event, allowUrls?: Array<string | RegExp>): boolean {\n  // TODO: Use Glob instead?\n  if (!allowUrls || !allowUrls.length) {\n    return true;\n  }\n  const url = _getEventFilterUrl(event);\n  return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event: Event): string[] {\n  if (event.message) {\n    return [event.message];\n  }\n  if (event.exception) {\n    try {\n      const { type = '', value = '' } = (event.exception.values && event.exception.values[0]) || {};\n      return [`${value}`, `${type}: ${value}`];\n    } catch (oO) {\n      __DEBUG_BUILD__ && logger.error(`Cannot extract message for event ${getEventDescription(event)}`);\n      return [];\n    }\n  }\n  return [];\n}\n\nfunction _isSentryError(event: Event): boolean {\n  try {\n    // @ts-ignore can't be a sentry error if undefined\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    return event.exception.values[0].type === 'SentryError';\n  } catch (e) {\n    // ignore\n  }\n  return false;\n}\n\nfunction _getLastValidUrl(frames: StackFrame[] = []): string | null {\n  for (let i = frames.length - 1; i >= 0; i--) {\n    const frame = frames[i];\n\n    if (frame && frame.filename !== '<anonymous>' && frame.filename !== '[native code]') {\n      return frame.filename || null;\n    }\n  }\n\n  return null;\n}\n\nfunction _getEventFilterUrl(event: Event): string | null {\n  try {\n    let frames;\n    try {\n      // @ts-ignore we only care about frames if the whole thing here is defined\n      frames = event.exception.values[0].stacktrace.frames;\n    } catch (e) {\n      // ignore\n    }\n    return frames ? _getLastValidUrl(frames) : null;\n  } catch (oO) {\n    __DEBUG_BUILD__ && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n    return null;\n  }\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA,MAAA,qBAAA,GAAA,CAAA,mBAAA,EAAA,+CAAA,CAAA,CAAA;AACA;AACA;;AASA;AACA,MAAA,cAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,cAAA,CAAA,GAAA,CAAA;AACA;AACA,GAAA,WAAA,GAAA,QAAA,GAAA,EAAA,EAAA,CAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,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,SAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,MAAA,CAAA;AACA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,KAAA;AACA,IAAA,OAAA,MAAA,GAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,EAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,KAAA,CAAA,CAAA,6BAAA,EAAA,mBAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA;AACA;;;;"}export { FunctionToString } from './functiontostring.js';
export { InboundFilters } from './inboundfilters.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}import { isPlainObject, dateTimestampInSeconds, SyncPromise, logger, isThenable, arrayify, getGlobalSingleton } from '@sentry/utils';
import { updateSession } from './session.js';

/**
 * Default value for maximum number of breadcrumbs added to an event.
 */
const DEFAULT_MAX_BREADCRUMBS = 100;

/**
 * Holds additional event information. {@link Scope.applyToEvent} will be
 * called by the client before an event will be sent.
 */
class Scope  {
  /** Flag if notifying is happening. */

  /** Callback for client to receive scope changes. */

  /** Callback list that will be called after {@link applyToEvent}. */

  /** Array of breadcrumbs. */

  /** User */

  /** Tags */

  /** Extra */

  /** Contexts */

  /** Attachments */

  /**
   * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
   * sent to Sentry
   */

  /** Fingerprint */

  /** Severity */
  // eslint-disable-next-line deprecation/deprecation

  /** Transaction Name */

  /** Span */

  /** Session */

  /** Request Mode Session Status */

  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.

   constructor() {
    this._notifyingListeners = false;
    this._scopeListeners = [];
    this._eventProcessors = [];
    this._breadcrumbs = [];
    this._attachments = [];
    this._user = {};
    this._tags = {};
    this._extra = {};
    this._contexts = {};
    this._sdkProcessingMetadata = {};
  }

  /**
   * Inherit values from the parent scope.
   * @param scope to clone.
   */
   static clone(scope) {
    const newScope = new Scope();
    if (scope) {
      newScope._breadcrumbs = [...scope._breadcrumbs];
      newScope._tags = { ...scope._tags };
      newScope._extra = { ...scope._extra };
      newScope._contexts = { ...scope._contexts };
      newScope._user = scope._user;
      newScope._level = scope._level;
      newScope._span = scope._span;
      newScope._session = scope._session;
      newScope._transactionName = scope._transactionName;
      newScope._fingerprint = scope._fingerprint;
      newScope._eventProcessors = [...scope._eventProcessors];
      newScope._requestSession = scope._requestSession;
      newScope._attachments = [...scope._attachments];
      newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };
    }
    return newScope;
  }

  /**
   * Add internal on change listener. Used for sub SDKs that need to store the scope.
   * @hidden
   */
   addScopeListener(callback) {
    this._scopeListeners.push(callback);
  }

  /**
   * @inheritDoc
   */
   addEventProcessor(callback) {
    this._eventProcessors.push(callback);
    return this;
  }

  /**
   * @inheritDoc
   */
   setUser(user) {
    this._user = user || {};
    if (this._session) {
      updateSession(this._session, { user });
    }
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getUser() {
    return this._user;
  }

  /**
   * @inheritDoc
   */
   getRequestSession() {
    return this._requestSession;
  }

  /**
   * @inheritDoc
   */
   setRequestSession(requestSession) {
    this._requestSession = requestSession;
    return this;
  }

  /**
   * @inheritDoc
   */
   setTags(tags) {
    this._tags = {
      ...this._tags,
      ...tags,
    };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this._tags = { ...this._tags, [key]: value };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setExtras(extras) {
    this._extra = {
      ...this._extra,
      ...extras,
    };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setExtra(key, extra) {
    this._extra = { ...this._extra, [key]: extra };
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setFingerprint(fingerprint) {
    this._fingerprint = fingerprint;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setLevel(
    // eslint-disable-next-line deprecation/deprecation
    level,
  ) {
    this._level = level;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setTransactionName(name) {
    this._transactionName = name;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setContext(key, context) {
    if (context === null) {
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this._contexts[key];
    } else {
      this._contexts[key] = context;
    }

    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   setSpan(span) {
    this._span = span;
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getSpan() {
    return this._span;
  }

  /**
   * @inheritDoc
   */
   getTransaction() {
    // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will
    // have a pointer to the currently-active transaction.
    const span = this.getSpan();
    return span && span.transaction;
  }

  /**
   * @inheritDoc
   */
   setSession(session) {
    if (!session) {
      delete this._session;
    } else {
      this._session = session;
    }
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   getSession() {
    return this._session;
  }

  /**
   * @inheritDoc
   */
   update(captureContext) {
    if (!captureContext) {
      return this;
    }

    if (typeof captureContext === 'function') {
      const updatedScope = (captureContext )(this);
      return updatedScope instanceof Scope ? updatedScope : this;
    }

    if (captureContext instanceof Scope) {
      this._tags = { ...this._tags, ...captureContext._tags };
      this._extra = { ...this._extra, ...captureContext._extra };
      this._contexts = { ...this._contexts, ...captureContext._contexts };
      if (captureContext._user && Object.keys(captureContext._user).length) {
        this._user = captureContext._user;
      }
      if (captureContext._level) {
        this._level = captureContext._level;
      }
      if (captureContext._fingerprint) {
        this._fingerprint = captureContext._fingerprint;
      }
      if (captureContext._requestSession) {
        this._requestSession = captureContext._requestSession;
      }
    } else if (isPlainObject(captureContext)) {
      // eslint-disable-next-line no-param-reassign
      captureContext = captureContext ;
      this._tags = { ...this._tags, ...captureContext.tags };
      this._extra = { ...this._extra, ...captureContext.extra };
      this._contexts = { ...this._contexts, ...captureContext.contexts };
      if (captureContext.user) {
        this._user = captureContext.user;
      }
      if (captureContext.level) {
        this._level = captureContext.level;
      }
      if (captureContext.fingerprint) {
        this._fingerprint = captureContext.fingerprint;
      }
      if (captureContext.requestSession) {
        this._requestSession = captureContext.requestSession;
      }
    }

    return this;
  }

  /**
   * @inheritDoc
   */
   clear() {
    this._breadcrumbs = [];
    this._tags = {};
    this._extra = {};
    this._user = {};
    this._contexts = {};
    this._level = undefined;
    this._transactionName = undefined;
    this._fingerprint = undefined;
    this._requestSession = undefined;
    this._span = undefined;
    this._session = undefined;
    this._notifyScopeListeners();
    this._attachments = [];
    return this;
  }

  /**
   * @inheritDoc
   */
   addBreadcrumb(breadcrumb, maxBreadcrumbs) {
    const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;

    // No data has been changed, so don't notify scope listeners
    if (maxCrumbs <= 0) {
      return this;
    }

    const mergedBreadcrumb = {
      timestamp: dateTimestampInSeconds(),
      ...breadcrumb,
    };
    this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs);
    this._notifyScopeListeners();

    return this;
  }

  /**
   * @inheritDoc
   */
   getLastBreadcrumb() {
    return this._breadcrumbs[this._breadcrumbs.length - 1];
  }

  /**
   * @inheritDoc
   */
   clearBreadcrumbs() {
    this._breadcrumbs = [];
    this._notifyScopeListeners();
    return this;
  }

  /**
   * @inheritDoc
   */
   addAttachment(attachment) {
    this._attachments.push(attachment);
    return this;
  }

  /**
   * @inheritDoc
   */
   getAttachments() {
    return this._attachments;
  }

  /**
   * @inheritDoc
   */
   clearAttachments() {
    this._attachments = [];
    return this;
  }

  /**
   * Applies data from the scope to the event and runs all event processors on it.
   *
   * @param event Event
   * @param hint Object containing additional information about the original exception, for use by the event processors.
   * @hidden
   */
   applyToEvent(event, hint = {}) {
    if (this._extra && Object.keys(this._extra).length) {
      event.extra = { ...this._extra, ...event.extra };
    }
    if (this._tags && Object.keys(this._tags).length) {
      event.tags = { ...this._tags, ...event.tags };
    }
    if (this._user && Object.keys(this._user).length) {
      event.user = { ...this._user, ...event.user };
    }
    if (this._contexts && Object.keys(this._contexts).length) {
      event.contexts = { ...this._contexts, ...event.contexts };
    }
    if (this._level) {
      event.level = this._level;
    }
    if (this._transactionName) {
      event.transaction = this._transactionName;
    }

    // We want to set the trace context for normal events only if there isn't already
    // a trace context on the event. There is a product feature in place where we link
    // errors with transaction and it relies on that.
    if (this._span) {
      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };
      const transaction = this._span.transaction;
      if (transaction) {
        event.sdkProcessingMetadata = {
          dynamicSamplingContext: transaction.getDynamicSamplingContext(),
          ...event.sdkProcessingMetadata,
        };
        const transactionName = transaction.name;
        if (transactionName) {
          event.tags = { transaction: transactionName, ...event.tags };
        }
      }
    }

    this._applyFingerprint(event);

    event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];
    event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;

    event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata };

    return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);
  }

  /**
   * Add data which will be accessible during event processing but won't get sent to Sentry
   */
   setSDKProcessingMetadata(newData) {
    this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };

    return this;
  }

  /**
   * This will be called after {@link applyToEvent} is finished.
   */
   _notifyEventProcessors(
    processors,
    event,
    hint,
    index = 0,
  ) {
    return new SyncPromise((resolve, reject) => {
      const processor = processors[index];
      if (event === null || typeof processor !== 'function') {
        resolve(event);
      } else {
        const result = processor({ ...event }, hint) ;

        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
          processor.id &&
          result === null &&
          logger.log(`Event processor "${processor.id}" dropped event`);

        if (isThenable(result)) {
          void result
            .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))
            .then(null, reject);
        } else {
          void this._notifyEventProcessors(processors, result, hint, index + 1)
            .then(resolve)
            .then(null, reject);
        }
      }
    });
  }

  /**
   * This will be called on every set call.
   */
   _notifyScopeListeners() {
    // We need this check for this._notifyingListeners to be able to work on scope during updates
    // If this check is not here we'll produce endless recursion when something is done with the scope
    // during the callback.
    if (!this._notifyingListeners) {
      this._notifyingListeners = true;
      this._scopeListeners.forEach(callback => {
        callback(this);
      });
      this._notifyingListeners = false;
    }
  }

  /**
   * Applies fingerprint from the scope to the event if there's one,
   * uses message if there's one instead or get rid of empty fingerprint
   */
   _applyFingerprint(event) {
    // Make sure it's an array first and we actually have something in place
    event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];

    // If we have something on the scope, then merge it with event
    if (this._fingerprint) {
      event.fingerprint = event.fingerprint.concat(this._fingerprint);
    }

    // If we have no data at all, remove empty array default
    if (event.fingerprint && !event.fingerprint.length) {
      delete event.fingerprint;
    }
  }
}

/**
 * Returns the global event processors.
 */
function getGlobalEventProcessors() {
  return getGlobalSingleton('globalEventProcessors', () => []);
}

/**
 * Add a EventProcessor to be kept globally.
 * @param callback EventProcessor to add
 */
function addGlobalEventProcessor(callback) {
  getGlobalEventProcessors().push(callback);
}

export { Scope, addGlobalEventProcessor };
//# sourceMappingURL=scope.js.map
{"version":3,"file":"scope.js","sources":["../../src/scope.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Attachment,\n  Breadcrumb,\n  CaptureContext,\n  Context,\n  Contexts,\n  Event,\n  EventHint,\n  EventProcessor,\n  Extra,\n  Extras,\n  Primitive,\n  RequestSession,\n  Scope as ScopeInterface,\n  ScopeContext,\n  Session,\n  Severity,\n  SeverityLevel,\n  Span,\n  Transaction,\n  User,\n} from '@sentry/types';\nimport {\n  arrayify,\n  dateTimestampInSeconds,\n  getGlobalSingleton,\n  isPlainObject,\n  isThenable,\n  logger,\n  SyncPromise,\n} from '@sentry/utils';\n\nimport { updateSession } from './session';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nexport class Scope implements ScopeInterface {\n  /** Flag if notifying is happening. */\n  protected _notifyingListeners: boolean;\n\n  /** Callback for client to receive scope changes. */\n  protected _scopeListeners: Array<(scope: Scope) => void>;\n\n  /** Callback list that will be called after {@link applyToEvent}. */\n  protected _eventProcessors: EventProcessor[];\n\n  /** Array of breadcrumbs. */\n  protected _breadcrumbs: Breadcrumb[];\n\n  /** User */\n  protected _user: User;\n\n  /** Tags */\n  protected _tags: { [key: string]: Primitive };\n\n  /** Extra */\n  protected _extra: Extras;\n\n  /** Contexts */\n  protected _contexts: Contexts;\n\n  /** Attachments */\n  protected _attachments: Attachment[];\n\n  /**\n   * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n   * sent to Sentry\n   */\n  protected _sdkProcessingMetadata: { [key: string]: unknown };\n\n  /** Fingerprint */\n  protected _fingerprint?: string[];\n\n  /** Severity */\n  // eslint-disable-next-line deprecation/deprecation\n  protected _level?: Severity | SeverityLevel;\n\n  /** Transaction Name */\n  protected _transactionName?: string;\n\n  /** Span */\n  protected _span?: Span;\n\n  /** Session */\n  protected _session?: Session;\n\n  /** Request Mode Session Status */\n  protected _requestSession?: RequestSession;\n\n  // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n  public constructor() {\n    this._notifyingListeners = false;\n    this._scopeListeners = [];\n    this._eventProcessors = [];\n    this._breadcrumbs = [];\n    this._attachments = [];\n    this._user = {};\n    this._tags = {};\n    this._extra = {};\n    this._contexts = {};\n    this._sdkProcessingMetadata = {};\n  }\n\n  /**\n   * Inherit values from the parent scope.\n   * @param scope to clone.\n   */\n  public static clone(scope?: Scope): Scope {\n    const newScope = new Scope();\n    if (scope) {\n      newScope._breadcrumbs = [...scope._breadcrumbs];\n      newScope._tags = { ...scope._tags };\n      newScope._extra = { ...scope._extra };\n      newScope._contexts = { ...scope._contexts };\n      newScope._user = scope._user;\n      newScope._level = scope._level;\n      newScope._span = scope._span;\n      newScope._session = scope._session;\n      newScope._transactionName = scope._transactionName;\n      newScope._fingerprint = scope._fingerprint;\n      newScope._eventProcessors = [...scope._eventProcessors];\n      newScope._requestSession = scope._requestSession;\n      newScope._attachments = [...scope._attachments];\n      newScope._sdkProcessingMetadata = { ...scope._sdkProcessingMetadata };\n    }\n    return newScope;\n  }\n\n  /**\n   * Add internal on change listener. Used for sub SDKs that need to store the scope.\n   * @hidden\n   */\n  public addScopeListener(callback: (scope: Scope) => void): void {\n    this._scopeListeners.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addEventProcessor(callback: EventProcessor): this {\n    this._eventProcessors.push(callback);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setUser(user: User | null): this {\n    this._user = user || {};\n    if (this._session) {\n      updateSession(this._session, { user });\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getUser(): User | undefined {\n    return this._user;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getRequestSession(): RequestSession | undefined {\n    return this._requestSession;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setRequestSession(requestSession?: RequestSession): this {\n    this._requestSession = requestSession;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTags(tags: { [key: string]: Primitive }): this {\n    this._tags = {\n      ...this._tags,\n      ...tags,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this._tags = { ...this._tags, [key]: value };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtras(extras: Extras): this {\n    this._extra = {\n      ...this._extra,\n      ...extras,\n    };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setExtra(key: string, extra: Extra): this {\n    this._extra = { ...this._extra, [key]: extra };\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setFingerprint(fingerprint: string[]): this {\n    this._fingerprint = fingerprint;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setLevel(\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel,\n  ): this {\n    this._level = level;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTransactionName(name?: string): this {\n    this._transactionName = name;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): this {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSpan(span?: Span): this {\n    this._span = span;\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSpan(): Span | undefined {\n    return this._span;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTransaction(): Transaction | undefined {\n    // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n    // have a pointer to the currently-active transaction.\n    const span = this.getSpan();\n    return span && span.transaction;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setSession(session?: Session): this {\n    if (!session) {\n      delete this._session;\n    } else {\n      this._session = session;\n    }\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getSession(): Session | undefined {\n    return this._session;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public update(captureContext?: CaptureContext): this {\n    if (!captureContext) {\n      return this;\n    }\n\n    if (typeof captureContext === 'function') {\n      const updatedScope = (captureContext as <T>(scope: T) => T)(this);\n      return updatedScope instanceof Scope ? updatedScope : this;\n    }\n\n    if (captureContext instanceof Scope) {\n      this._tags = { ...this._tags, ...captureContext._tags };\n      this._extra = { ...this._extra, ...captureContext._extra };\n      this._contexts = { ...this._contexts, ...captureContext._contexts };\n      if (captureContext._user && Object.keys(captureContext._user).length) {\n        this._user = captureContext._user;\n      }\n      if (captureContext._level) {\n        this._level = captureContext._level;\n      }\n      if (captureContext._fingerprint) {\n        this._fingerprint = captureContext._fingerprint;\n      }\n      if (captureContext._requestSession) {\n        this._requestSession = captureContext._requestSession;\n      }\n    } else if (isPlainObject(captureContext)) {\n      // eslint-disable-next-line no-param-reassign\n      captureContext = captureContext as ScopeContext;\n      this._tags = { ...this._tags, ...captureContext.tags };\n      this._extra = { ...this._extra, ...captureContext.extra };\n      this._contexts = { ...this._contexts, ...captureContext.contexts };\n      if (captureContext.user) {\n        this._user = captureContext.user;\n      }\n      if (captureContext.level) {\n        this._level = captureContext.level;\n      }\n      if (captureContext.fingerprint) {\n        this._fingerprint = captureContext.fingerprint;\n      }\n      if (captureContext.requestSession) {\n        this._requestSession = captureContext.requestSession;\n      }\n    }\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clear(): this {\n    this._breadcrumbs = [];\n    this._tags = {};\n    this._extra = {};\n    this._user = {};\n    this._contexts = {};\n    this._level = undefined;\n    this._transactionName = undefined;\n    this._fingerprint = undefined;\n    this._requestSession = undefined;\n    this._span = undefined;\n    this._session = undefined;\n    this._notifyScopeListeners();\n    this._attachments = [];\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this {\n    const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n    // No data has been changed, so don't notify scope listeners\n    if (maxCrumbs <= 0) {\n      return this;\n    }\n\n    const mergedBreadcrumb = {\n      timestamp: dateTimestampInSeconds(),\n      ...breadcrumb,\n    };\n    this._breadcrumbs = [...this._breadcrumbs, mergedBreadcrumb].slice(-maxCrumbs);\n    this._notifyScopeListeners();\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getLastBreadcrumb(): Breadcrumb | undefined {\n    return this._breadcrumbs[this._breadcrumbs.length - 1];\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearBreadcrumbs(): this {\n    this._breadcrumbs = [];\n    this._notifyScopeListeners();\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public addAttachment(attachment: Attachment): this {\n    this._attachments.push(attachment);\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getAttachments(): Attachment[] {\n    return this._attachments;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public clearAttachments(): this {\n    this._attachments = [];\n    return this;\n  }\n\n  /**\n   * Applies data from the scope to the event and runs all event processors on it.\n   *\n   * @param event Event\n   * @param hint Object containing additional information about the original exception, for use by the event processors.\n   * @hidden\n   */\n  public applyToEvent(event: Event, hint: EventHint = {}): PromiseLike<Event | null> {\n    if (this._extra && Object.keys(this._extra).length) {\n      event.extra = { ...this._extra, ...event.extra };\n    }\n    if (this._tags && Object.keys(this._tags).length) {\n      event.tags = { ...this._tags, ...event.tags };\n    }\n    if (this._user && Object.keys(this._user).length) {\n      event.user = { ...this._user, ...event.user };\n    }\n    if (this._contexts && Object.keys(this._contexts).length) {\n      event.contexts = { ...this._contexts, ...event.contexts };\n    }\n    if (this._level) {\n      event.level = this._level;\n    }\n    if (this._transactionName) {\n      event.transaction = this._transactionName;\n    }\n\n    // We want to set the trace context for normal events only if there isn't already\n    // a trace context on the event. There is a product feature in place where we link\n    // errors with transaction and it relies on that.\n    if (this._span) {\n      event.contexts = { trace: this._span.getTraceContext(), ...event.contexts };\n      const transaction = this._span.transaction;\n      if (transaction) {\n        event.sdkProcessingMetadata = {\n          dynamicSamplingContext: transaction.getDynamicSamplingContext(),\n          ...event.sdkProcessingMetadata,\n        };\n        const transactionName = transaction.name;\n        if (transactionName) {\n          event.tags = { transaction: transactionName, ...event.tags };\n        }\n      }\n    }\n\n    this._applyFingerprint(event);\n\n    event.breadcrumbs = [...(event.breadcrumbs || []), ...this._breadcrumbs];\n    event.breadcrumbs = event.breadcrumbs.length > 0 ? event.breadcrumbs : undefined;\n\n    event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...this._sdkProcessingMetadata };\n\n    return this._notifyEventProcessors([...getGlobalEventProcessors(), ...this._eventProcessors], event, hint);\n  }\n\n  /**\n   * Add data which will be accessible during event processing but won't get sent to Sentry\n   */\n  public setSDKProcessingMetadata(newData: { [key: string]: unknown }): this {\n    this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n    return this;\n  }\n\n  /**\n   * This will be called after {@link applyToEvent} is finished.\n   */\n  protected _notifyEventProcessors(\n    processors: EventProcessor[],\n    event: Event | null,\n    hint: EventHint,\n    index: number = 0,\n  ): PromiseLike<Event | null> {\n    return new SyncPromise<Event | null>((resolve, reject) => {\n      const processor = processors[index];\n      if (event === null || typeof processor !== 'function') {\n        resolve(event);\n      } else {\n        const result = processor({ ...event }, hint) as Event | null;\n\n        __DEBUG_BUILD__ &&\n          processor.id &&\n          result === null &&\n          logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n        if (isThenable(result)) {\n          void result\n            .then(final => this._notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n            .then(null, reject);\n        } else {\n          void this._notifyEventProcessors(processors, result, hint, index + 1)\n            .then(resolve)\n            .then(null, reject);\n        }\n      }\n    });\n  }\n\n  /**\n   * This will be called on every set call.\n   */\n  protected _notifyScopeListeners(): void {\n    // We need this check for this._notifyingListeners to be able to work on scope during updates\n    // If this check is not here we'll produce endless recursion when something is done with the scope\n    // during the callback.\n    if (!this._notifyingListeners) {\n      this._notifyingListeners = true;\n      this._scopeListeners.forEach(callback => {\n        callback(this);\n      });\n      this._notifyingListeners = false;\n    }\n  }\n\n  /**\n   * Applies fingerprint from the scope to the event if there's one,\n   * uses message if there's one instead or get rid of empty fingerprint\n   */\n  private _applyFingerprint(event: Event): void {\n    // Make sure it's an array first and we actually have something in place\n    event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n    // If we have something on the scope, then merge it with event\n    if (this._fingerprint) {\n      event.fingerprint = event.fingerprint.concat(this._fingerprint);\n    }\n\n    // If we have no data at all, remove empty array default\n    if (event.fingerprint && !event.fingerprint.length) {\n      delete event.fingerprint;\n    }\n  }\n}\n\n/**\n * Returns the global event processors.\n */\nfunction getGlobalEventProcessors(): EventProcessor[] {\n  return getGlobalSingleton<EventProcessor[]>('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @param callback EventProcessor to add\n */\nexport function addGlobalEventProcessor(callback: EventProcessor): void {\n  getGlobalEventProcessors().push(callback);\n}\n"],"names":[],"mappings":";;;AAmCA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,KAAA,EAAA;AACA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;AACA;AACA;AACA;;AAGA;;AAGA;AACA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;AACA;AACA,GAAA,WAAA,GAAA;AACA,IAAA,IAAA,CAAA,mBAAA,GAAA,KAAA,CAAA;AACA,IAAA,IAAA,CAAA,eAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,gBAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,EA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A,WAAA,GAAA,KAAA,CAAA,WAAA,CAAA,MAAA,CAAA,IAAA,CAAA,YAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAA,KAAA,CAAA,WAAA,IAAA,CAAA,KAAA,CAAA,WAAA,CAAA,MAAA,EAAA;AACA,MAAA,OAAA,KAAA,CAAA,WAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,GAAA;AACA,EAAA,OAAA,kBAAA,CAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,QAAA,EAAA;AACA,EAAA,wBAAA,EAAA,CAAA,IAAA,CAAA,QAAA,CAAA,CAAA;AACA;;;;"}import { logger } from '@sentry/utils';
import { getCurrentHub } from './hub.js';

/** A class object that can instantiate Client objects. */

/**
 * Internal function to create a new SDK client instance. The client is
 * installed and then bound to the current scope.
 *
 * @param clientClass The client class to instantiate.
 * @param options Options to pass to the client.
 */
function initAndBind(
  clientClass,
  options,
) {
  if (options.debug === true) {
    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
      logger.enable();
    } else {
      // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
      // eslint-disable-next-line no-console
      console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
    }
  }
  const hub = getCurrentHub();
  const scope = hub.getScope();
  scope.update(options.initialScope);

  const client = new clientClass(options);
  hub.bindClient(client);
}

export { initAndBind };
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Client, ClientOptions } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\n\n/** A class object that can instantiate Client objects. */\nexport type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nexport function initAndBind<F extends Client, O extends ClientOptions>(\n  clientClass: ClientClass<F, O>,\n  options: O,\n): void {\n  if (options.debug === true) {\n    if (__DEBUG_BUILD__) {\n      logger.enable();\n    } else {\n      // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n      // eslint-disable-next-line no-console\n      console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n    }\n  }\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n  scope.update(options.initialScope);\n\n  const client = new clientClass(options);\n  hub.bindClient(client);\n}\n"],"names":[],"mappings":";;;AAKA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA;AACA,EAAA,WAAA;AACA,EAAA,OAAA;AACA,EAAA;AACA,EAAA,IAAA,OAAA,CAAA,KAAA,KAAA,IAAA,EAAA;AACA,IAAA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,MAAA,MAAA,CAAA,MAAA,EAAA,CAAA;AACA,KAAA,MAAA;AACA;AACA;AACA,MAAA,OAAA,CAAA,IAAA,CAAA,8EAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,MAAA,GAAA,GAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,GAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,KAAA,CAAA,MAAA,CAAA,OAAA,CAAA,YAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,IAAA,WAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA,GAAA,CAAA,UAAA,CAAA,MAAA,CAAA,CAAA;AACA;;;;"}import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';

/**
 * Creates a new `Session` object by setting certain default parameters. If optional @param context
 * is passed, the passed properties are applied to the session object.
 *
 * @param context (optional) additional properties to be applied to the returned session object
 *
 * @returns a new `Session` object
 */
function makeSession(context) {
  // Both timestamp and started are in seconds since the UNIX epoch.
  const startingTime = timestampInSeconds();

  const session = {
    sid: uuid4(),
    init: true,
    timestamp: startingTime,
    started: startingTime,
    duration: 0,
    status: 'ok',
    errors: 0,
    ignoreDuration: false,
    toJSON: () => sessionToJSON(session),
  };

  if (context) {
    updateSession(session, context);
  }

  return session;
}

/**
 * Updates a session object with the properties passed in the context.
 *
 * Note that this function mutates the passed object and returns void.
 * (Had to do this instead of returning a new and updated session because closing and sending a session
 * makes an update to the session after it was passed to the sending logic.
 * @see BaseClient.captureSession )
 *
 * @param session the `Session` to update
 * @param context the `SessionContext` holding the properties that should be updated in @param session
 */
// eslint-disable-next-line complexity
function updateSession(session, context = {}) {
  if (context.user) {
    if (!session.ipAddress && context.user.ip_address) {
      session.ipAddress = context.user.ip_address;
    }

    if (!session.did && !context.did) {
      session.did = context.user.id || context.user.email || context.user.username;
    }
  }

  session.timestamp = context.timestamp || timestampInSeconds();

  if (context.ignoreDuration) {
    session.ignoreDuration = context.ignoreDuration;
  }
  if (context.sid) {
    // Good enough uuid validation. — Kamil
    session.sid = context.sid.length === 32 ? context.sid : uuid4();
  }
  if (context.init !== undefined) {
    session.init = context.init;
  }
  if (!session.did && context.did) {
    session.did = `${context.did}`;
  }
  if (typeof context.started === 'number') {
    session.started = context.started;
  }
  if (session.ignoreDuration) {
    session.duration = undefined;
  } else if (typeof context.duration === 'number') {
    session.duration = context.duration;
  } else {
    const duration = session.timestamp - session.started;
    session.duration = duration >= 0 ? duration : 0;
  }
  if (context.release) {
    session.release = context.release;
  }
  if (context.environment) {
    session.environment = context.environment;
  }
  if (!session.ipAddress && context.ipAddress) {
    session.ipAddress = context.ipAddress;
  }
  if (!session.userAgent && context.userAgent) {
    session.userAgent = context.userAgent;
  }
  if (typeof context.errors === 'number') {
    session.errors = context.errors;
  }
  if (context.status) {
    session.status = context.status;
  }
}

/**
 * Closes a session by setting its status and updating the session object with it.
 * Internally calls `updateSession` to update the passed session object.
 *
 * Note that this function mutates the passed session (@see updateSession for explanation).
 *
 * @param session the `Session` object to be closed
 * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,
 *               this function will keep the previously set status, unless it was `'ok'` in which case
 *               it is changed to `'exited'`.
 */
function closeSession(session, status) {
  let context = {};
  if (status) {
    context = { status };
  } else if (session.status === 'ok') {
    context = { status: 'exited' };
  }

  updateSession(session, context);
}

/**
 * Serializes a passed session object to a JSON object with a slightly different structure.
 * This is necessary because the Sentry backend requires a slightly different schema of a session
 * than the one the JS SDKs use internally.
 *
 * @param session the session to be converted
 *
 * @returns a JSON object of the passed session
 */
function sessionToJSON(session) {
  return dropUndefinedKeys({
    sid: `${session.sid}`,
    init: session.init,
    // Make sure that sec is converted to ms for date constructor
    started: new Date(session.started * 1000).toISOString(),
    timestamp: new Date(session.timestamp * 1000).toISOString(),
    status: session.status,
    errors: session.errors,
    did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,
    duration: session.duration,
    attrs: {
      release: session.release,
      environment: session.environment,
      ip_address: session.ipAddress,
      user_agent: session.userAgent,
    },
  });
}

export { closeSession, makeSession, updateSession };
//# sourceMappingURL=session.js.map
{"version":3,"file":"session.js","sources":["../../src/session.ts"],"sourcesContent":["import type { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { dropUndefinedKeys, timestampInSeconds, uuid4 } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nexport function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session {\n  // Both timestamp and started are in seconds since the UNIX epoch.\n  const startingTime = timestampInSeconds();\n\n  const session: Session = {\n    sid: uuid4(),\n    init: true,\n    timestamp: startingTime,\n    started: startingTime,\n    duration: 0,\n    status: 'ok',\n    errors: 0,\n    ignoreDuration: false,\n    toJSON: () => sessionToJSON(session),\n  };\n\n  if (context) {\n    updateSession(session, context);\n  }\n\n  return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nexport function updateSession(session: Session, context: SessionContext = {}): void {\n  if (context.user) {\n    if (!session.ipAddress && context.user.ip_address) {\n      session.ipAddress = context.user.ip_address;\n    }\n\n    if (!session.did && !context.did) {\n      session.did = context.user.id || context.user.email || context.user.username;\n    }\n  }\n\n  session.timestamp = context.timestamp || timestampInSeconds();\n\n  if (context.ignoreDuration) {\n    session.ignoreDuration = context.ignoreDuration;\n  }\n  if (context.sid) {\n    // Good enough uuid validation. — Kamil\n    session.sid = context.sid.length === 32 ? context.sid : uuid4();\n  }\n  if (context.init !== undefined) {\n    session.init = context.init;\n  }\n  if (!session.did && context.did) {\n    session.did = `${context.did}`;\n  }\n  if (typeof context.started === 'number') {\n    session.started = context.started;\n  }\n  if (session.ignoreDuration) {\n    session.duration = undefined;\n  } else if (typeof context.duration === 'number') {\n    session.duration = context.duration;\n  } else {\n    const duration = session.timestamp - session.started;\n    session.duration = duration >= 0 ? duration : 0;\n  }\n  if (context.release) {\n    session.release = context.release;\n  }\n  if (context.environment) {\n    session.environment = context.environment;\n  }\n  if (!session.ipAddress && context.ipAddress) {\n    session.ipAddress = context.ipAddress;\n  }\n  if (!session.userAgent && context.userAgent) {\n    session.userAgent = context.userAgent;\n  }\n  if (typeof context.errors === 'number') {\n    session.errors = context.errors;\n  }\n  if (context.status) {\n    session.status = context.status;\n  }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n *               this function will keep the previously set status, unless it was `'ok'` in which case\n *               it is changed to `'exited'`.\n */\nexport function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void {\n  let context = {};\n  if (status) {\n    context = { status };\n  } else if (session.status === 'ok') {\n    context = { status: 'exited' };\n  }\n\n  updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session: Session): SerializedSession {\n  return dropUndefinedKeys({\n    sid: `${session.sid}`,\n    init: session.init,\n    // Make sure that sec is converted to ms for date constructor\n    started: new Date(session.started * 1000).toISOString(),\n    timestamp: new Date(session.timestamp * 1000).toISOString(),\n    status: session.status,\n    errors: session.errors,\n    did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n    duration: session.duration,\n    attrs: {\n      release: session.release,\n      environment: session.environment,\n      ip_address: session.ipAddress,\n      user_agent: session.userAgent,\n    },\n  });\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,OAAA,EAAA;AACA;AACA,EAAA,MAAA,YAAA,GAAA,kBAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA;AACA,IAAA,GAAA,EAAA,KAAA,EAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,SAAA,EAAA,YAAA;AACA,IAAA,OAAA,EAAA,YAAA;AACA,IAAA,QAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,CAAA;AACA,IAAA,cAAA,EAAA,KAAA;AACA,IAAA,MAAA,EAAA,MAAA,aAAA,CAAA,OAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,IAAA,OAAA,EAAA;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AAA,SAAA;AACA,IAAA,QAAA,EAAA,OAAA,CAAA,QAAA;AACA,IAAA,KAAA,EAAA;AACA,MAAA,OAAA,EAAA,OAAA,CAAA,OAAA;AACA,MAAA,WAAA,EAAA,OAAA,CAAA,WAAA;AACA,MAAA,UAAA,EAAA,OAAA,CAAA,SAAA;AACA,MAAA,UAAA,EAAA,OAAA,CAAA,SAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA;;;;"}import { dropUndefinedKeys } from '@sentry/utils';
import { getCurrentHub } from './hub.js';

/**
 * @inheritdoc
 */
class SessionFlusher  {
    __init() {this.flushTimeout = 60;}
   __init2() {this._pendingAggregates = {};}

   __init3() {this._isEnabled = true;}

   constructor(client, attrs) {SessionFlusher.prototype.__init.call(this);SessionFlusher.prototype.__init2.call(this);SessionFlusher.prototype.__init3.call(this);
    this._client = client;
    // Call to setInterval, so that flush is called every 60 seconds
    this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000);
    this._sessionAttrs = attrs;
  }

  /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */
   flush() {
    const sessionAggregates = this.getSessionAggregates();
    if (sessionAggregates.aggregates.length === 0) {
      return;
    }
    this._pendingAggregates = {};
    this._client.sendSession(sessionAggregates);
  }

  /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
   getSessionAggregates() {
    const aggregates = Object.keys(this._pendingAggregates).map((key) => {
      return this._pendingAggregates[parseInt(key)];
    });

    const sessionAggregates = {
      attrs: this._sessionAttrs,
      aggregates,
    };
    return dropUndefinedKeys(sessionAggregates);
  }

  /** JSDoc */
   close() {
    clearInterval(this._intervalId);
    this._isEnabled = false;
    this.flush();
  }

  /**
   * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
   * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
   * `_incrementSessionStatusCount` along with the start date
   */
   incrementSessionStatusCount() {
    if (!this._isEnabled) {
      return;
    }
    const scope = getCurrentHub().getScope();
    const requestSession = scope.getRequestSession();

    if (requestSession && requestSession.status) {
      this._incrementSessionStatusCount(requestSession.status, new Date());
      // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in
      // case captureRequestSession is called more than once to prevent double count
      scope.setRequestSession(undefined);
      /* eslint-enable @typescript-eslint/no-unsafe-member-access */
    }
  }

  /**
   * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
   * the session received
   */
   _incrementSessionStatusCount(status, date) {
    // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys
    const sessionStartedTrunc = new Date(date).setSeconds(0, 0);
    this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};

    // corresponds to aggregated sessions in one specific minute bucket
    // for example, {"started":"2021-03-16T08:00:00.000Z","exited":4, "errored": 1}
    const aggregationCounts = this._pendingAggregates[sessionStartedTrunc];
    if (!aggregationCounts.started) {
      aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();
    }

    switch (status) {
      case 'errored':
        aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;
        return aggregationCounts.errored;
      case 'ok':
        aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;
        return aggregationCounts.exited;
      default:
        aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;
        return aggregationCounts.crashed;
    }
  }
}

export { SessionFlusher };
//# sourceMappingURL=sessionflusher.js.map
{"version":3,"file":"sessionflusher.js","sources":["../../src/sessionflusher.ts"],"sourcesContent":["import type {\n  AggregationCounts,\n  Client,\n  RequestSessionStatus,\n  SessionAggregates,\n  SessionFlusherLike,\n} from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { getCurrentHub } from './hub';\n\ntype ReleaseHealthAttributes = {\n  environment?: string;\n  release: string;\n};\n\n/**\n * @inheritdoc\n */\nexport class SessionFlusher implements SessionFlusherLike {\n  public readonly flushTimeout: number = 60;\n  private _pendingAggregates: Record<number, AggregationCounts> = {};\n  private _sessionAttrs: ReleaseHealthAttributes;\n  private _intervalId: ReturnType<typeof setInterval>;\n  private _isEnabled: boolean = true;\n  private _client: Client;\n\n  public constructor(client: Client, attrs: ReleaseHealthAttributes) {\n    this._client = client;\n    // Call to setInterval, so that flush is called every 60 seconds\n    this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1000);\n    this._sessionAttrs = attrs;\n  }\n\n  /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */\n  public flush(): void {\n    const sessionAggregates = this.getSessionAggregates();\n    if (sessionAggregates.aggregates.length === 0) {\n      return;\n    }\n    this._pendingAggregates = {};\n    this._client.sendSession(sessionAggregates);\n  }\n\n  /** Massages the entries in `pendingAggregates` and returns aggregated sessions */\n  public getSessionAggregates(): SessionAggregates {\n    const aggregates: AggregationCounts[] = Object.keys(this._pendingAggregates).map((key: string) => {\n      return this._pendingAggregates[parseInt(key)];\n    });\n\n    const sessionAggregates: SessionAggregates = {\n      attrs: this._sessionAttrs,\n      aggregates,\n    };\n    return dropUndefinedKeys(sessionAggregates);\n  }\n\n  /** JSDoc */\n  public close(): void {\n    clearInterval(this._intervalId);\n    this._isEnabled = false;\n    this.flush();\n  }\n\n  /**\n   * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then\n   * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to\n   * `_incrementSessionStatusCount` along with the start date\n   */\n  public incrementSessionStatusCount(): void {\n    if (!this._isEnabled) {\n      return;\n    }\n    const scope = getCurrentHub().getScope();\n    const requestSession = scope.getRequestSession();\n\n    if (requestSession && requestSession.status) {\n      this._incrementSessionStatusCount(requestSession.status, new Date());\n      // This is not entirely necessarily but is added as a safe guard to indicate the bounds of a request and so in\n      // case captureRequestSession is called more than once to prevent double count\n      scope.setRequestSession(undefined);\n      /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n    }\n  }\n\n  /**\n   * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of\n   * the session received\n   */\n  private _incrementSessionStatusCount(status: RequestSessionStatus, date: Date): number {\n    // Truncate minutes and seconds on Session Started attribute to have one minute bucket keys\n    const sessionStartedTrunc = new Date(date).setSeconds(0, 0);\n    this._pendingAggregates[sessionStartedTrunc] = this._pendingAggregates[sessionStartedTrunc] || {};\n\n    // corresponds to aggregated sessions in one specific minute bucket\n    // for example, {\"started\":\"2021-03-16T08:00:00.000Z\",\"exited\":4, \"errored\": 1}\n    const aggregationCounts: AggregationCounts = this._pendingAggregates[sessionStartedTrunc];\n    if (!aggregationCounts.started) {\n      aggregationCounts.started = new Date(sessionStartedTrunc).toISOString();\n    }\n\n    switch (status) {\n      case 'errored':\n        aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;\n        return aggregationCounts.errored;\n      case 'ok':\n        aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;\n        return aggregationCounts.exited;\n      default:\n        aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;\n        return aggregationCounts.crashed;\n    }\n  }\n}\n"],"names":[],"mappings":";;;AAgBA;AACA;AACA;AACA,MAAA,cAAA,EAAA;AACA,IAAA,MAAA,GAAA,CAAA,IAAA,CAAA,YAAA,GAAA,GAAA,CAAA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,kBAAA,GAAA,GAAA,CAAA;;AAGA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,UAAA,GAAA,KAAA,CAAA;;AAGA,GAAA,WAAA,CAAA,MAAA,EAAA,KAAA,EAAA,CAAA,cAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,cAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,cAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,MAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA,CAAA,MAAA,IAAA,CAAA,KAAA,EAAA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AAA,CAAA,IAAA,CAAA,CAAA;AACA,QAAA,OAAA,iBAAA,CAAA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;;;;"}import { addInstrumentationHandler, logger } from '@sentry/utils';
import { getActiveTransaction } from './utils.js';

let errorsInstrumented = false;

/**
 * Configures global error listeners
 */
function registerErrorInstrumentation() {
  if (errorsInstrumented) {
    return;
  }

  errorsInstrumented = true;
  addInstrumentationHandler('error', errorCallback);
  addInstrumentationHandler('unhandledrejection', errorCallback);
}

/**
 * If an error or unhandled promise occurs, we mark the active transaction as failed
 */
function errorCallback() {
  const activeTransaction = getActiveTransaction();
  if (activeTransaction) {
    const status = 'internal_error';
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);
    activeTransaction.setStatus(status);
  }
}

// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the
// node.js default exit behaviour
errorCallback.tag = 'sentry_tracingErrorCallback';

export { registerErrorInstrumentation };
//# sourceMappingURL=errors.js.map
{"version":3,"file":"errors.js","sources":["../../../src/tracing/errors.ts"],"sourcesContent":["import { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { SpanStatusType } from './span';\nimport { getActiveTransaction } from './utils';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nexport function registerErrorInstrumentation(): void {\n  if (errorsInstrumented) {\n    return;\n  }\n\n  errorsInstrumented = true;\n  addInstrumentationHandler('error', errorCallback);\n  addInstrumentationHandler('unhandledrejection', errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback(): void {\n  const activeTransaction = getActiveTransaction();\n  if (activeTransaction) {\n    const status: SpanStatusType = 'internal_error';\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n    activeTransaction.setStatus(status);\n  }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n"],"names":[],"mappings":";;;AAKA,IAAA,kBAAA,GAAA,KAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,GAAA;AACA,EAAA,IAAA,kBAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,kBAAA,GAAA,IAAA,CAAA;AACA,EAAA,yBAAA,CAAA,OAAA,EAAA,aAAA,CAAA,CAAA;AACA,EAAA,yBAAA,CAAA,oBAAA,EAAA,aAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,GAAA;AACA,EAAA,MAAA,iBAAA,GAAA,oBAAA,EAAA,CAAA;AACA,EAAA,IAAA,iBAAA,EAAA;AACA,IAAA,MAAA,MAAA,GAAA,gBAAA,CAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,GAAA,CAAA,CAAA,uBAAA,EAAA,MAAA,CAAA,wBAAA,CAAA,CAAA,CAAA;AACA,IAAA,iBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA,aAAA,CAAA,GAAA,GAAA,6BAAA;;;;"}import { logger, isNaN } from '@sentry/utils';
import { getMainCarrier } from '../hub.js';
import { hasTracingEnabled } from '../utils/hasTracingEnabled.js';
import { registerErrorInstrumentation } from './errors.js';
import { IdleTransaction } from './idletransaction.js';
import { Transaction } from './transaction.js';

/** Returns all trace headers that are currently on the top scope. */
function traceHeaders() {
  const scope = this.getScope();
  const span = scope.getSpan();

  return span
    ? {
        'sentry-trace': span.toTraceparent(),
      }
    : {};
}

/**
 * Makes a sampling decision for the given transaction and stores it on the transaction.
 *
 * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be
 * sent to Sentry.
 *
 * @param transaction: The transaction needing a sampling decision
 * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`
 * @param samplingContext: Default and user-provided data which may be used to help make the decision
 *
 * @returns The given transaction with its `sampled` value set
 */
function sample(
  transaction,
  options,
  samplingContext,
) {
  // nothing to do if tracing is not enabled
  if (!hasTracingEnabled(options)) {
    transaction.sampled = false;
    return transaction;
  }

  // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that
  if (transaction.sampled !== undefined) {
    transaction.setMetadata({
      sampleRate: Number(transaction.sampled),
    });
    return transaction;
  }

  // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should
  // work; prefer the hook if so
  let sampleRate;
  if (typeof options.tracesSampler === 'function') {
    sampleRate = options.tracesSampler(samplingContext);
    transaction.setMetadata({
      sampleRate: Number(sampleRate),
    });
  } else if (samplingContext.parentSampled !== undefined) {
    sampleRate = samplingContext.parentSampled;
  } else if (typeof options.tracesSampleRate !== 'undefined') {
    sampleRate = options.tracesSampleRate;
    transaction.setMetadata({
      sampleRate: Number(sampleRate),
    });
  } else {
    // When `enableTracing === true`, we use a sample rate of 100%
    sampleRate = 1;
    transaction.setMetadata({
      sampleRate,
    });
  }

  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The
  // only valid values are booleans or numbers between 0 and 1.)
  if (!isValidSampleRate(sampleRate)) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');
    transaction.sampled = false;
    return transaction;
  }

  // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped
  if (!sampleRate) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.log(
        `[Tracing] Discarding transaction because ${
          typeof options.tracesSampler === 'function'
            ? 'tracesSampler returned 0 or false'
            : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'
        }`,
      );
    transaction.sampled = false;
    return transaction;
  }

  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is
  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.
  transaction.sampled = Math.random() < (sampleRate );

  // if we're not going to keep it, we're done
  if (!transaction.sampled) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.log(
        `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(
          sampleRate,
        )})`,
      );
    return transaction;
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);
  return transaction;
}

/**
 * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).
 */
function isValidSampleRate(rate) {
  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(
        `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
          rate,
        )} of type ${JSON.stringify(typeof rate)}.`,
      );
    return false;
  }

  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false
  if (rate < 0 || rate > 1) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);
    return false;
  }
  return true;
}

/**
 * Creates a new transaction and adds a sampling decision if it doesn't yet have one.
 *
 * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if
 * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an
 * "extension method."
 *
 * @param this: The Hub starting the transaction
 * @param transactionContext: Data used to configure the transaction
 * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)
 *
 * @returns The new transaction
 *
 * @see {@link Hub.startTransaction}
 */
function _startTransaction(

  transactionContext,
  customSamplingContext,
) {
  const client = this.getClient();
  const options = (client && client.getOptions()) || {};

  const configInstrumenter = options.instrumenter || 'sentry';
  const transactionInstrumenter = transactionContext.instrumenter || 'sentry';

  if (configInstrumenter !== transactionInstrumenter) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      logger.error(
        `A transaction was started with instrumenter=\`${transactionInstrumenter}\`, but the SDK is configured with the \`${configInstrumenter}\` instrumenter.
The transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,
      );

    transactionContext.sampled = false;
  }

  let transaction = new Transaction(transactionContext, this);
  transaction = sample(transaction, options, {
    parentSampled: transactionContext.parentSampled,
    transactionContext,
    ...customSamplingContext,
  });
  if (transaction.sampled) {
    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));
  }
  if (client && client.emit) {
    client.emit('startTransaction', transaction);
  }
  return transaction;
}

/**
 * Create new idle transaction.
 */
function startIdleTransaction(
  hub,
  transactionContext,
  idleTimeout,
  finalTimeout,
  onScope,
  customSamplingContext,
  heartbeatInterval,
) {
  const client = hub.getClient();
  const options = (client && client.getOptions()) || {};

  let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);
  transaction = sample(transaction, options, {
    parentSampled: transactionContext.parentSampled,
    transactionContext,
    ...customSamplingContext,
  });
  if (transaction.sampled) {
    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));
  }
  if (client && client.emit) {
    client.emit('startTransaction', transaction);
  }
  return transaction;
}

/**
 * Adds tracing extensions to the global hub.
 */
function addTracingExtensions() {
  const carrier = getMainCarrier();
  if (!carrier.__SENTRY__) {
    return;
  }
  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};
  if (!carrier.__SENTRY__.extensions.startTransaction) {
    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;
  }
  if (!carrier.__SENTRY__.extensions.traceHeaders) {
    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
  }

  registerErrorInstrumentation();
}

export { addTracingExtensions, startIdleTransaction };
//# sourceMappingURL=hubextensions.js.map
{"version":3,"file":"hubextensions.js","sources":["../../../src/tracing/hubextensions.ts"],"sourcesContent":["import type { ClientOptions, CustomSamplingContext, Options, SamplingContext, TransactionContext } from '@sentry/types';\nimport { isNaN, logger } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport { getMainCarrier } from '../hub';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled';\nimport { registerErrorInstrumentation } from './errors';\nimport { IdleTransaction } from './idletransaction';\nimport { Transaction } from './transaction';\n\n/** Returns all trace headers that are currently on the top scope. */\nfunction traceHeaders(this: Hub): { [key: string]: string } {\n  const scope = this.getScope();\n  const span = scope.getSpan();\n\n  return span\n    ? {\n        'sentry-trace': span.toTraceparent(),\n      }\n    : {};\n}\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * @param transaction: The transaction needing a sampling decision\n * @param options: The current client's options, so we can access `tracesSampleRate` and/or `tracesSampler`\n * @param samplingContext: Default and user-provided data which may be used to help make the decision\n *\n * @returns The given transaction with its `sampled` value set\n */\nfunction sample<T extends Transaction>(\n  transaction: T,\n  options: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'>,\n  samplingContext: SamplingContext,\n): T {\n  // nothing to do if tracing is not enabled\n  if (!hasTracingEnabled(options)) {\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n  if (transaction.sampled !== undefined) {\n    transaction.setMetadata({\n      sampleRate: Number(transaction.sampled),\n    });\n    return transaction;\n  }\n\n  // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n  // work; prefer the hook if so\n  let sampleRate;\n  if (typeof options.tracesSampler === 'function') {\n    sampleRate = options.tracesSampler(samplingContext);\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else if (samplingContext.parentSampled !== undefined) {\n    sampleRate = samplingContext.parentSampled;\n  } else if (typeof options.tracesSampleRate !== 'undefined') {\n    sampleRate = options.tracesSampleRate;\n    transaction.setMetadata({\n      sampleRate: Number(sampleRate),\n    });\n  } else {\n    // When `enableTracing === true`, we use a sample rate of 100%\n    sampleRate = 1;\n    transaction.setMetadata({\n      sampleRate,\n    });\n  }\n\n  // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n  // only valid values are booleans or numbers between 0 and 1.)\n  if (!isValidSampleRate(sampleRate)) {\n    __DEBUG_BUILD__ && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n  if (!sampleRate) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because ${\n          typeof options.tracesSampler === 'function'\n            ? 'tracesSampler returned 0 or false'\n            : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n        }`,\n      );\n    transaction.sampled = false;\n    return transaction;\n  }\n\n  // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n  // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n  transaction.sampled = Math.random() < (sampleRate as number | boolean);\n\n  // if we're not going to keep it, we're done\n  if (!transaction.sampled) {\n    __DEBUG_BUILD__ &&\n      logger.log(\n        `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n          sampleRate,\n        )})`,\n      );\n    return transaction;\n  }\n\n  __DEBUG_BUILD__ && logger.log(`[Tracing] starting ${transaction.op} transaction - ${transaction.name}`);\n  return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate: unknown): boolean {\n  // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n    __DEBUG_BUILD__ &&\n      logger.warn(\n        `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n          rate,\n        )} of type ${JSON.stringify(typeof rate)}.`,\n      );\n    return false;\n  }\n\n  // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n  if (rate < 0 || rate > 1) {\n    __DEBUG_BUILD__ &&\n      logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n    return false;\n  }\n  return true;\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n  this: Hub,\n  transactionContext: TransactionContext,\n  customSamplingContext?: CustomSamplingContext,\n): Transaction {\n  const client = this.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  const configInstrumenter = options.instrumenter || 'sentry';\n  const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n  if (configInstrumenter !== transactionInstrumenter) {\n    __DEBUG_BUILD__ &&\n      logger.error(\n        `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n      );\n\n    transactionContext.sampled = false;\n  }\n\n  let transaction = new Transaction(transactionContext, this);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nexport function startIdleTransaction(\n  hub: Hub,\n  transactionContext: TransactionContext,\n  idleTimeout: number,\n  finalTimeout: number,\n  onScope?: boolean,\n  customSamplingContext?: CustomSamplingContext,\n  heartbeatInterval?: number,\n): IdleTransaction {\n  const client = hub.getClient();\n  const options: Partial<ClientOptions> = (client && client.getOptions()) || {};\n\n  let transaction = new IdleTransaction(transactionContext, hub, idleTimeout, finalTimeout, heartbeatInterval, onScope);\n  transaction = sample(transaction, options, {\n    parentSampled: transactionContext.parentSampled,\n    transactionContext,\n    ...customSamplingContext,\n  });\n  if (transaction.sampled) {\n    transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans as number));\n  }\n  if (client && client.emit) {\n    client.emit('startTransaction', transaction);\n  }\n  return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nexport function addTracingExtensions(): void {\n  const carrier = getMainCarrier();\n  if (!carrier.__SENTRY__) {\n    return;\n  }\n  carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n  if (!carrier.__SENTRY__.extensions.startTransaction) {\n    carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n  }\n  if (!carrier.__SENTRY__.extensions.traceHeaders) {\n    carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n  }\n\n  registerErrorInstrumentation();\n}\n"],"names":[],"mappings":";;;;;;;AAUA;AACA,SAAA,YAAA,GAAA;AACA,EAAA,MAAA,KAAA,GAAA,IAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,KAAA,CAAA,OAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,IAAA;AACA,MAAA;AACA,QAAA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,CAAA;AACA;;;;"}import { logger, timestampWithMs } from '@sentry/utils';
import { SpanRecorder } from './span.js';
import { Transaction } from './transaction.js';

const TRACING_DEFAULTS = {
  idleTimeout: 1000,
  finalTimeout: 30000,
  heartbeatInterval: 5000,
};

const FINISH_REASON_TAG = 'finishReason';

const IDLE_TRANSACTION_FINISH_REASONS = [
  'heartbeatFailed',
  'idleTimeout',
  'documentHidden',
  'finalTimeout',
  'externalFinish',
  'cancelled',
];

/**
 * @inheritDoc
 */
class IdleTransactionSpanRecorder extends SpanRecorder {
   constructor(
      _pushActivity,
      _popActivity,
     transactionSpanId,
    maxlen,
  ) {
    super(maxlen);this._pushActivity = _pushActivity;this._popActivity = _popActivity;this.transactionSpanId = transactionSpanId;  }

  /**
   * @inheritDoc
   */
   add(span) {
    // We should make sure we do not push and pop activities for
    // the transaction that this span recorder belongs to.
    if (span.spanId !== this.transactionSpanId) {
      // We patch span.finish() to pop an activity after setting an endTimestamp.
      span.finish = (endTimestamp) => {
        span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();
        this._popActivity(span.spanId);
      };

      // We should only push new activities if the span does not have an end timestamp.
      if (span.endTimestamp === undefined) {
        this._pushActivity(span.spanId);
      }
    }

    super.add(span);
  }
}

/**
 * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.
 * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will
 * put itself on the scope on creation.
 */
class IdleTransaction extends Transaction {
  // Activities store a list of active spans
   __init() {this.activities = {};}

  // Track state of activities in previous heartbeat

  // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.
   __init2() {this._heartbeatCounter = 0;}

  // We should not use heartbeat if we finished a transaction
   __init3() {this._finished = false;}

  // Idle timeout was canceled and we should finish the transaction with the last span end.
   __init4() {this._idleTimeoutCanceledPermanently = false;}

    __init5() {this._beforeFinishCallbacks = [];}

  /**
   * Timer that tracks Transaction idleTimeout
   */

   __init6() {this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[4];}

   constructor(
    transactionContext,
      _idleHub,
    /**
     * The time to wait in ms until the idle transaction will be finished. This timer is started each time
     * there are no active spans on this transaction.
     */
      _idleTimeout = TRACING_DEFAULTS.idleTimeout,
    /**
     * The final value in ms that a transaction cannot exceed
     */
      _finalTimeout = TRACING_DEFAULTS.finalTimeout,
      _heartbeatInterval = TRACING_DEFAULTS.heartbeatInterval,
    // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends
      _onScope = false,
  ) {
    super(transactionContext, _idleHub);this._idleHub = _idleHub;this._idleTimeout = _idleTimeout;this._finalTimeout = _finalTimeout;this._heartbeatInterval = _heartbeatInterval;this._onScope = _onScope;IdleTransaction.prototype.__init.call(this);IdleTransaction.prototype.__init2.call(this);IdleTransaction.prototype.__init3.call(this);IdleTransaction.prototype.__init4.call(this);IdleTransaction.prototype.__init5.call(this);IdleTransaction.prototype.__init6.call(this);
    if (_onScope) {
      // We set the transaction here on the scope so error events pick up the trace
      // context and attach it to the error.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);
      _idleHub.configureScope(scope => scope.setSpan(this));
    }

    this._restartIdleTimeout();
    setTimeout(() => {
      if (!this._finished) {
        this.setStatus('deadline_exceeded');
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];
        this.finish();
      }
    }, this._finalTimeout);
  }

  /** {@inheritDoc} */
   finish(endTimestamp = timestampWithMs()) {
    this._finished = true;
    this.activities = {};

    if (this.op === 'ui.action.click') {
      this.setTag(FINISH_REASON_TAG, this._finishReason);
    }

    if (this.spanRecorder) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);

      for (const callback of this._beforeFinishCallbacks) {
        callback(this, endTimestamp);
      }

      this.spanRecorder.spans = this.spanRecorder.spans.filter((span) => {
        // If we are dealing with the transaction itself, we just return it
        if (span.spanId === this.spanId) {
          return true;
        }

        // We cancel all pending spans with status "cancelled" to indicate the idle transaction was finished early
        if (!span.endTimestamp) {
          span.endTimestamp = endTimestamp;
          span.setStatus('cancelled');
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));
        }

        const keepSpan = span.startTimestamp < endTimestamp;
        if (!keepSpan) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
            logger.log(
              '[Tracing] discarding Span since it happened after Transaction was finished',
              JSON.stringify(span, undefined, 2),
            );
        }
        return keepSpan;
      });

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] flushing IdleTransaction');
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] No active IdleTransaction');
    }

    // if `this._onScope` is `true`, the transaction put itself on the scope when it started
    if (this._onScope) {
      const scope = this._idleHub.getScope();
      if (scope.getTransaction() === this) {
        scope.setSpan(undefined);
      }
    }

    return super.finish(endTimestamp);
  }

  /**
   * Register a callback function that gets excecuted before the transaction finishes.
   * Useful for cleanup or if you want to add any additional spans based on current context.
   *
   * This is exposed because users have no other way of running something before an idle transaction
   * finishes.
   */
   registerBeforeFinishCallback(callback) {
    this._beforeFinishCallbacks.push(callback);
  }

  /**
   * @inheritDoc
   */
   initSpanRecorder(maxlen) {
    if (!this.spanRecorder) {
      const pushActivity = (id) => {
        if (this._finished) {
          return;
        }
        this._pushActivity(id);
      };
      const popActivity = (id) => {
        if (this._finished) {
          return;
        }
        this._popActivity(id);
      };

      this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);

      // Start heartbeat so that transactions do not run forever.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('Starting heartbeat');
      this._pingHeartbeat();
    }
    this.spanRecorder.add(this);
  }

  /**
   * Cancels the existing idle timeout, if there is one.
   * @param restartOnChildSpanChange Default is `true`.
   *                                 If set to false the transaction will end
   *                                 with the last child span.
   */
   cancelIdleTimeout(
    endTimestamp,
    {
      restartOnChildSpanChange,
    }

 = {
      restartOnChildSpanChange: true,
    },
  ) {
    this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;
    if (this._idleTimeoutID) {
      clearTimeout(this._idleTimeoutID);
      this._idleTimeoutID = undefined;

      if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];
        this.finish(endTimestamp);
      }
    }
  }

  /**
   * Temporary method used to externally set the transaction's `finishReason`
   *
   * ** WARNING**
   * This is for the purpose of experimentation only and will be removed in the near future, do not use!
   *
   * @internal
   *
   */
   setFinishReason(reason) {
    this._finishReason = reason;
  }

  /**
   * Restarts idle timeout, if there is no running idle timeout it will start one.
   */
   _restartIdleTimeout(endTimestamp) {
    this.cancelIdleTimeout();
    this._idleTimeoutID = setTimeout(() => {
      if (!this._finished && Object.keys(this.activities).length === 0) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];
        this.finish(endTimestamp);
      }
    }, this._idleTimeout);
  }

  /**
   * Start tracking a specific activity.
   * @param spanId The span id that represents the activity
   */
   _pushActivity(spanId) {
    this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] pushActivity: ${spanId}`);
    this.activities[spanId] = true;
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);
  }

  /**
   * Remove an activity from usage
   * @param spanId The span id that represents the activity
   */
   _popActivity(spanId) {
    if (this.activities[spanId]) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] popActivity ${spanId}`);
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this.activities[spanId];
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);
    }

    if (Object.keys(this.activities).length === 0) {
      const endTimestamp = timestampWithMs();
      if (this._idleTimeoutCanceledPermanently) {
        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];
        this.finish(endTimestamp);
      } else {
        // We need to add the timeout here to have the real endtimestamp of the transaction
        // Remember timestampWithMs is in seconds, timeout is in ms
        this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);
      }
    }
  }

  /**
   * Checks when entries of this.activities are not changing for 3 beats.
   * If this occurs we finish the transaction.
   */
   _beat() {
    // We should not be running heartbeat if the idle transaction is finished.
    if (this._finished) {
      return;
    }

    const heartbeatString = Object.keys(this.activities).join('');

    if (heartbeatString === this._prevHeartbeatString) {
      this._heartbeatCounter++;
    } else {
      this._heartbeatCounter = 1;
    }

    this._prevHeartbeatString = heartbeatString;

    if (this._heartbeatCounter >= 3) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');
      this.setStatus('deadline_exceeded');
      this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];
      this.finish();
    } else {
      this._pingHeartbeat();
    }
  }

  /**
   * Pings the heartbeat
   */
   _pingHeartbeat() {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);
    setTimeout(() => {
      this._beat();
    }, this._heartbeatInterval);
  }
}

export { IdleTransaction, IdleTransactionSpanRecorder, TRACING_DEFAULTS };
//# sourceMappingURL=idletransaction.js.map
{"version":3,"file":"idletransaction.js","sources":["../../../src/tracing/idletransaction.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type { TransactionContext } from '@sentry/types';\nimport { logger, timestampWithMs } from '@sentry/utils';\n\nimport type { Hub } from '../hub';\nimport type { Span } from './span';\nimport { SpanRecorder } from './span';\nimport { Transaction } from './transaction';\n\nexport const TRACING_DEFAULTS = {\n  idleTimeout: 1000,\n  finalTimeout: 30000,\n  heartbeatInterval: 5000,\n};\n\nconst FINISH_REASON_TAG = 'finishReason';\n\nconst IDLE_TRANSACTION_FINISH_REASONS = [\n  'heartbeatFailed',\n  'idleTimeout',\n  'documentHidden',\n  'finalTimeout',\n  'externalFinish',\n  'cancelled',\n];\n\n/**\n * @inheritDoc\n */\nexport class IdleTransactionSpanRecorder extends SpanRecorder {\n  public constructor(\n    private readonly _pushActivity: (id: string) => void,\n    private readonly _popActivity: (id: string) => void,\n    public transactionSpanId: string,\n    maxlen?: number,\n  ) {\n    super(maxlen);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public add(span: Span): void {\n    // We should make sure we do not push and pop activities for\n    // the transaction that this span recorder belongs to.\n    if (span.spanId !== this.transactionSpanId) {\n      // We patch span.finish() to pop an activity after setting an endTimestamp.\n      span.finish = (endTimestamp?: number) => {\n        span.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n        this._popActivity(span.spanId);\n      };\n\n      // We should only push new activities if the span does not have an end timestamp.\n      if (span.endTimestamp === undefined) {\n        this._pushActivity(span.spanId);\n      }\n    }\n\n    super.add(span);\n  }\n}\n\nexport type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;\n\n/**\n * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.\n * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will\n * put itself on the scope on creation.\n */\nexport class IdleTransaction extends Transaction {\n  // Activities store a list of active spans\n  public activities: Record<string, boolean> = {};\n\n  // Track state of activities in previous heartbeat\n  private _prevHeartbeatString: string | undefined;\n\n  // Amount of times heartbeat has counted. Will cause transaction to finish after 3 beats.\n  private _heartbeatCounter: number = 0;\n\n  // We should not use heartbeat if we finished a transaction\n  private _finished: boolean = false;\n\n  // Idle timeout was canceled and we should finish the transaction with the last span end.\n  private _idleTimeoutCanceledPermanently: boolean = false;\n\n  private readonly _beforeFinishCallbacks: BeforeFinishCallback[] = [];\n\n  /**\n   * Timer that tracks Transaction idleTimeout\n   */\n  private _idleTimeoutID: ReturnType<typeof setTimeout> | undefined;\n\n  private _finishReason: (typeof IDLE_TRANSACTION_FINISH_REASONS)[number] = IDLE_TRANSACTION_FINISH_REASONS[4];\n\n  public constructor(\n    transactionContext: TransactionContext,\n    private readonly _idleHub: Hub,\n    /**\n     * The time to wait in ms until the idle transaction will be finished. This timer is started each time\n     * there are no active spans on this transaction.\n     */\n    private readonly _idleTimeout: number = TRACING_DEFAULTS.idleTimeout,\n    /**\n     * The final value in ms that a transaction cannot exceed\n     */\n    private readonly _finalTimeout: number = TRACING_DEFAULTS.finalTimeout,\n    private readonly _heartbeatInterval: number = TRACING_DEFAULTS.heartbeatInterval,\n    // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends\n    private readonly _onScope: boolean = false,\n  ) {\n    super(transactionContext, _idleHub);\n\n    if (_onScope) {\n      // We set the transaction here on the scope so error events pick up the trace\n      // context and attach it to the error.\n      __DEBUG_BUILD__ && logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`);\n      _idleHub.configureScope(scope => scope.setSpan(this));\n    }\n\n    this._restartIdleTimeout();\n    setTimeout(() => {\n      if (!this._finished) {\n        this.setStatus('deadline_exceeded');\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[3];\n        this.finish();\n      }\n    }, this._finalTimeout);\n  }\n\n  /** {@inheritDoc} */\n  public finish(endTimestamp: number = timestampWithMs()): string | undefined {\n    this._finished = true;\n    this.activities = {};\n\n    if (this.op === 'ui.action.click') {\n      this.setTag(FINISH_REASON_TAG, this._finishReason);\n    }\n\n    if (this.spanRecorder) {\n      __DEBUG_BUILD__ &&\n        logger.log('[Tracing] finishing IdleTransaction', new Date(endTimestamp * 1000).toISOString(), this.op);\n\n      for (const callback of this._beforeFinishCallbacks) {\n        callback(this, endTimestamp);\n      }\n\n      this.spanRecorder.spans = this.spanRecorder.spans.filter((span: Span) => {\n        // If we are dealing with the transaction itself, we just return it\n        if (span.spanId === this.spanId) {\n          return true;\n        }\n\n        // We cancel all pending spans with status \"cancelled\" to indicate the idle transaction was finished early\n        if (!span.endTimestamp) {\n          span.endTimestamp = endTimestamp;\n          span.setStatus('cancelled');\n          __DEBUG_BUILD__ &&\n            logger.log('[Tracing] cancelling span since transaction ended early', JSON.stringify(span, undefined, 2));\n        }\n\n        const keepSpan = span.startTimestamp < endTimestamp;\n        if (!keepSpan) {\n          __DEBUG_BUILD__ &&\n            logger.log(\n              '[Tracing] discarding Span since it happened after Transaction was finished',\n              JSON.stringify(span, undefined, 2),\n            );\n        }\n        return keepSpan;\n      });\n\n      __DEBUG_BUILD__ && logger.log('[Tracing] flushing IdleTransaction');\n    } else {\n      __DEBUG_BUILD__ && logger.log('[Tracing] No active IdleTransaction');\n    }\n\n    // if `this._onScope` is `true`, the transaction put itself on the scope when it started\n    if (this._onScope) {\n      const scope = this._idleHub.getScope();\n      if (scope.getTransaction() === this) {\n        scope.setSpan(undefined);\n      }\n    }\n\n    return super.finish(endTimestamp);\n  }\n\n  /**\n   * Register a callback function that gets excecuted before the transaction finishes.\n   * Useful for cleanup or if you want to add any additional spans based on current context.\n   *\n   * This is exposed because users have no other way of running something before an idle transaction\n   * finishes.\n   */\n  public registerBeforeFinishCallback(callback: BeforeFinishCallback): void {\n    this._beforeFinishCallbacks.push(callback);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public initSpanRecorder(maxlen?: number): void {\n    if (!this.spanRecorder) {\n      const pushActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._pushActivity(id);\n      };\n      const popActivity = (id: string): void => {\n        if (this._finished) {\n          return;\n        }\n        this._popActivity(id);\n      };\n\n      this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);\n\n      // Start heartbeat so that transactions do not run forever.\n      __DEBUG_BUILD__ && logger.log('Starting heartbeat');\n      this._pingHeartbeat();\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * Cancels the existing idle timeout, if there is one.\n   * @param restartOnChildSpanChange Default is `true`.\n   *                                 If set to false the transaction will end\n   *                                 with the last child span.\n   */\n  public cancelIdleTimeout(\n    endTimestamp?: Parameters<IdleTransaction['finish']>[0],\n    {\n      restartOnChildSpanChange,\n    }: {\n      restartOnChildSpanChange?: boolean;\n    } = {\n      restartOnChildSpanChange: true,\n    },\n  ): void {\n    this._idleTimeoutCanceledPermanently = restartOnChildSpanChange === false;\n    if (this._idleTimeoutID) {\n      clearTimeout(this._idleTimeoutID);\n      this._idleTimeoutID = undefined;\n\n      if (Object.keys(this.activities).length === 0 && this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      }\n    }\n  }\n\n  /**\n   * Temporary method used to externally set the transaction's `finishReason`\n   *\n   * ** WARNING**\n   * This is for the purpose of experimentation only and will be removed in the near future, do not use!\n   *\n   * @internal\n   *\n   */\n  public setFinishReason(reason: string): void {\n    this._finishReason = reason;\n  }\n\n  /**\n   * Restarts idle timeout, if there is no running idle timeout it will start one.\n   */\n  private _restartIdleTimeout(endTimestamp?: Parameters<IdleTransaction['finish']>[0]): void {\n    this.cancelIdleTimeout();\n    this._idleTimeoutID = setTimeout(() => {\n      if (!this._finished && Object.keys(this.activities).length === 0) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[1];\n        this.finish(endTimestamp);\n      }\n    }, this._idleTimeout);\n  }\n\n  /**\n   * Start tracking a specific activity.\n   * @param spanId The span id that represents the activity\n   */\n  private _pushActivity(spanId: string): void {\n    this.cancelIdleTimeout(undefined, { restartOnChildSpanChange: !this._idleTimeoutCanceledPermanently });\n    __DEBUG_BUILD__ && logger.log(`[Tracing] pushActivity: ${spanId}`);\n    this.activities[spanId] = true;\n    __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n  }\n\n  /**\n   * Remove an activity from usage\n   * @param spanId The span id that represents the activity\n   */\n  private _popActivity(spanId: string): void {\n    if (this.activities[spanId]) {\n      __DEBUG_BUILD__ && logger.log(`[Tracing] popActivity ${spanId}`);\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this.activities[spanId];\n      __DEBUG_BUILD__ && logger.log('[Tracing] new activities count', Object.keys(this.activities).length);\n    }\n\n    if (Object.keys(this.activities).length === 0) {\n      const endTimestamp = timestampWithMs();\n      if (this._idleTimeoutCanceledPermanently) {\n        this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[5];\n        this.finish(endTimestamp);\n      } else {\n        // We need to add the timeout here to have the real endtimestamp of the transaction\n        // Remember timestampWithMs is in seconds, timeout is in ms\n        this._restartIdleTimeout(endTimestamp + this._idleTimeout / 1000);\n      }\n    }\n  }\n\n  /**\n   * Checks when entries of this.activities are not changing for 3 beats.\n   * If this occurs we finish the transaction.\n   */\n  private _beat(): void {\n    // We should not be running heartbeat if the idle transaction is finished.\n    if (this._finished) {\n      return;\n    }\n\n    const heartbeatString = Object.keys(this.activities).join('');\n\n    if (heartbeatString === this._prevHeartbeatString) {\n      this._heartbeatCounter++;\n    } else {\n      this._heartbeatCounter = 1;\n    }\n\n    this._prevHeartbeatString = heartbeatString;\n\n    if (this._heartbeatCounter >= 3) {\n      __DEBUG_BUILD__ && logger.log('[Tracing] Transaction finished because of no change for 3 heart beats');\n      this.setStatus('deadline_exceeded');\n      this._finishReason = IDLE_TRANSACTION_FINISH_REASONS[0];\n      this.finish();\n    } else {\n      this._pingHeartbeat();\n    }\n  }\n\n  /**\n   * Pings the heartbeat\n   */\n  private _pingHeartbeat(): void {\n    __DEBUG_BUILD__ && logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);\n    setTimeout(() => {\n      this._beat();\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,aAAA,GAAA,+BAAA,CAAA,CAAA,CAAA,CAAA;AACA,MAAA,IAAA,CAAA,MAAA,EAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,IAAA,CAAA,cAAA,EAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,cAAA,GAAA;AACA,IAAA,iEAAA,MAAA,CAAA,GAAA,CAAA,CAAA,sCAAA,EAAA,IAAA,CAAA,iBAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,UAAA,CAAA,MAAA;AACA,MAAA,IAAA,CAAA,KAAA,EAAA,CAAA;AACA,KAAA,EAAA,IAAA,CAAA,kBAAA,CAAA,CAAA;AACA,GAAA;AACA;;;;"}import { uuid4, timestampWithMs, logger, dropUndefinedKeys } from '@sentry/utils';

/**
 * Keeps track of finished spans for a given transaction
 * @internal
 * @hideconstructor
 * @hidden
 */
class SpanRecorder {
   __init() {this.spans = [];}

   constructor(maxlen = 1000) {SpanRecorder.prototype.__init.call(this);
    this._maxlen = maxlen;
  }

  /**
   * This is just so that we don't run out of memory while recording a lot
   * of spans. At some point we just stop and flush out the start of the
   * trace tree (i.e.the first n spans with the smallest
   * start_timestamp).
   */
   add(span) {
    if (this.spans.length > this._maxlen) {
      span.spanRecorder = undefined;
    } else {
      this.spans.push(span);
    }
  }
}

/**
 * Span contains all data about a span
 */
class Span  {
  /**
   * @inheritDoc
   */
   __init2() {this.traceId = uuid4();}

  /**
   * @inheritDoc
   */
   __init3() {this.spanId = uuid4().substring(16);}

  /**
   * @inheritDoc
   */

  /**
   * Internal keeper of the status
   */

  /**
   * @inheritDoc
   */

  /**
   * Timestamp in seconds when the span was created.
   */
   __init4() {this.startTimestamp = timestampWithMs();}

  /**
   * Timestamp in seconds when the span ended.
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   __init5() {this.tags = {};}

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   __init6() {this.data = {};}

  /**
   * List of spans that were finalized
   */

  /**
   * @inheritDoc
   */

  /**
   * The instrumenter that created this span.
   */
   __init7() {this.instrumenter = 'sentry';}

  /**
   * You should never call the constructor manually, always use `Sentry.startTransaction()`
   * or call `startChild()` on an existing span.
   * @internal
   * @hideconstructor
   * @hidden
   */
   constructor(spanContext) {Span.prototype.__init2.call(this);Span.prototype.__init3.call(this);Span.prototype.__init4.call(this);Span.prototype.__init5.call(this);Span.prototype.__init6.call(this);Span.prototype.__init7.call(this);
    if (!spanContext) {
      return this;
    }
    if (spanContext.traceId) {
      this.traceId = spanContext.traceId;
    }
    if (spanContext.spanId) {
      this.spanId = spanContext.spanId;
    }
    if (spanContext.parentSpanId) {
      this.parentSpanId = spanContext.parentSpanId;
    }
    // We want to include booleans as well here
    if ('sampled' in spanContext) {
      this.sampled = spanContext.sampled;
    }
    if (spanContext.op) {
      this.op = spanContext.op;
    }
    if (spanContext.description) {
      this.description = spanContext.description;
    }
    if (spanContext.data) {
      this.data = spanContext.data;
    }
    if (spanContext.tags) {
      this.tags = spanContext.tags;
    }
    if (spanContext.status) {
      this.status = spanContext.status;
    }
    if (spanContext.startTimestamp) {
      this.startTimestamp = spanContext.startTimestamp;
    }
    if (spanContext.endTimestamp) {
      this.endTimestamp = spanContext.endTimestamp;
    }
    if (spanContext.instrumenter) {
      this.instrumenter = spanContext.instrumenter;
    }
  }

  /**
   * @inheritDoc
   */
   startChild(
    spanContext,
  ) {
    const childSpan = new Span({
      ...spanContext,
      parentSpanId: this.spanId,
      sampled: this.sampled,
      traceId: this.traceId,
    });

    childSpan.spanRecorder = this.spanRecorder;
    if (childSpan.spanRecorder) {
      childSpan.spanRecorder.add(childSpan);
    }

    childSpan.transaction = this.transaction;

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && childSpan.transaction) {
      const opStr = (spanContext && spanContext.op) || '< unknown op >';
      const nameStr = childSpan.transaction.name || '< unknown name >';
      const idStr = childSpan.transaction.spanId;

      const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;
      childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };
      logger.log(logMessage);
    }

    return childSpan;
  }

  /**
   * @inheritDoc
   */
   setTag(key, value) {
    this.tags = { ...this.tags, [key]: value };
    return this;
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   setData(key, value) {
    this.data = { ...this.data, [key]: value };
    return this;
  }

  /**
   * @inheritDoc
   */
   setStatus(value) {
    this.status = value;
    return this;
  }

  /**
   * @inheritDoc
   */
   setHttpStatus(httpStatus) {
    this.setTag('http.status_code', String(httpStatus));
    const spanStatus = spanStatusfromHttpCode(httpStatus);
    if (spanStatus !== 'unknown_error') {
      this.setStatus(spanStatus);
    }
    return this;
  }

  /**
   * @inheritDoc
   */
   isSuccess() {
    return this.status === 'ok';
  }

  /**
   * @inheritDoc
   */
   finish(endTimestamp) {
    if (
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
      // Don't call this for transactions
      this.transaction &&
      this.transaction.spanId !== this.spanId
    ) {
      const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];
      if (logMessage) {
        logger.log((logMessage ).replace('Starting', 'Finishing'));
      }
    }

    this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();
  }

  /**
   * @inheritDoc
   */
   toTraceparent() {
    let sampledString = '';
    if (this.sampled !== undefined) {
      sampledString = this.sampled ? '-1' : '-0';
    }
    return `${this.traceId}-${this.spanId}${sampledString}`;
  }

  /**
   * @inheritDoc
   */
   toContext() {
    return dropUndefinedKeys({
      data: this.data,
      description: this.description,
      endTimestamp: this.endTimestamp,
      op: this.op,
      parentSpanId: this.parentSpanId,
      sampled: this.sampled,
      spanId: this.spanId,
      startTimestamp: this.startTimestamp,
      status: this.status,
      tags: this.tags,
      traceId: this.traceId,
    });
  }

  /**
   * @inheritDoc
   */
   updateWithContext(spanContext) {
    this.data = spanContext.data || {};
    this.description = spanContext.description;
    this.endTimestamp = spanContext.endTimestamp;
    this.op = spanContext.op;
    this.parentSpanId = spanContext.parentSpanId;
    this.sampled = spanContext.sampled;
    this.spanId = spanContext.spanId || this.spanId;
    this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;
    this.status = spanContext.status;
    this.tags = spanContext.tags || {};
    this.traceId = spanContext.traceId || this.traceId;

    return this;
  }

  /**
   * @inheritDoc
   */
   getTraceContext() {
    return dropUndefinedKeys({
      data: Object.keys(this.data).length > 0 ? this.data : undefined,
      description: this.description,
      op: this.op,
      parent_span_id: this.parentSpanId,
      span_id: this.spanId,
      status: this.status,
      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
      trace_id: this.traceId,
    });
  }

  /**
   * @inheritDoc
   */
   toJSON()

 {
    return dropUndefinedKeys({
      data: Object.keys(this.data).length > 0 ? this.data : undefined,
      description: this.description,
      op: this.op,
      parent_span_id: this.parentSpanId,
      span_id: this.spanId,
      start_timestamp: this.startTimestamp,
      status: this.status,
      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,
      timestamp: this.endTimestamp,
      trace_id: this.traceId,
    });
  }
}

/**
 * Converts a HTTP status code into a {@link SpanStatusType}.
 *
 * @param httpStatus The HTTP response status code.
 * @returns The span status or unknown_error.
 */
function spanStatusfromHttpCode(httpStatus) {
  if (httpStatus < 400 && httpStatus >= 100) {
    return 'ok';
  }

  if (httpStatus >= 400 && httpStatus < 500) {
    switch (httpStatus) {
      case 401:
        return 'unauthenticated';
      case 403:
        return 'permission_denied';
      case 404:
        return 'not_found';
      case 409:
        return 'already_exists';
      case 413:
        return 'failed_precondition';
      case 429:
        return 'resource_exhausted';
      default:
        return 'invalid_argument';
    }
  }

  if (httpStatus >= 500 && httpStatus < 600) {
    switch (httpStatus) {
      case 501:
        return 'unimplemented';
      case 503:
        return 'unavailable';
      case 504:
        return 'deadline_exceeded';
      default:
        return 'internal_error';
    }
  }

  return 'unknown_error';
}

export { Span, SpanRecorder, spanStatusfromHttpCode };
//# sourceMappingURL=span.js.map
{"version":3,"file":"span.js","sources":["../../../src/tracing/span.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  Instrumenter,\n  Primitive,\n  Span as SpanInterface,\n  SpanContext,\n  TraceContext,\n  Transaction,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger, timestampWithMs, uuid4 } from '@sentry/utils';\n\n/**\n * Keeps track of finished spans for a given transaction\n * @internal\n * @hideconstructor\n * @hidden\n */\nexport class SpanRecorder {\n  public spans: Span[] = [];\n\n  private readonly _maxlen: number;\n\n  public constructor(maxlen: number = 1000) {\n    this._maxlen = maxlen;\n  }\n\n  /**\n   * This is just so that we don't run out of memory while recording a lot\n   * of spans. At some point we just stop and flush out the start of the\n   * trace tree (i.e.the first n spans with the smallest\n   * start_timestamp).\n   */\n  public add(span: Span): void {\n    if (this.spans.length > this._maxlen) {\n      span.spanRecorder = undefined;\n    } else {\n      this.spans.push(span);\n    }\n  }\n}\n\n/**\n * Span contains all data about a span\n */\nexport class Span implements SpanInterface {\n  /**\n   * @inheritDoc\n   */\n  public traceId: string = uuid4();\n\n  /**\n   * @inheritDoc\n   */\n  public spanId: string = uuid4().substring(16);\n\n  /**\n   * @inheritDoc\n   */\n  public parentSpanId?: string;\n\n  /**\n   * Internal keeper of the status\n   */\n  public status?: SpanStatusType | string;\n\n  /**\n   * @inheritDoc\n   */\n  public sampled?: boolean;\n\n  /**\n   * Timestamp in seconds when the span was created.\n   */\n  public startTimestamp: number = timestampWithMs();\n\n  /**\n   * Timestamp in seconds when the span ended.\n   */\n  public endTimestamp?: number;\n\n  /**\n   * @inheritDoc\n   */\n  public op?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public description?: string;\n\n  /**\n   * @inheritDoc\n   */\n  public tags: { [key: string]: Primitive } = {};\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  public data: { [key: string]: any } = {};\n\n  /**\n   * List of spans that were finalized\n   */\n  public spanRecorder?: SpanRecorder;\n\n  /**\n   * @inheritDoc\n   */\n  public transaction?: Transaction;\n\n  /**\n   * The instrumenter that created this span.\n   */\n  public instrumenter: Instrumenter = 'sentry';\n\n  /**\n   * You should never call the constructor manually, always use `Sentry.startTransaction()`\n   * or call `startChild()` on an existing span.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(spanContext?: SpanContext) {\n    if (!spanContext) {\n      return this;\n    }\n    if (spanContext.traceId) {\n      this.traceId = spanContext.traceId;\n    }\n    if (spanContext.spanId) {\n      this.spanId = spanContext.spanId;\n    }\n    if (spanContext.parentSpanId) {\n      this.parentSpanId = spanContext.parentSpanId;\n    }\n    // We want to include booleans as well here\n    if ('sampled' in spanContext) {\n      this.sampled = spanContext.sampled;\n    }\n    if (spanContext.op) {\n      this.op = spanContext.op;\n    }\n    if (spanContext.description) {\n      this.description = spanContext.description;\n    }\n    if (spanContext.data) {\n      this.data = spanContext.data;\n    }\n    if (spanContext.tags) {\n      this.tags = spanContext.tags;\n    }\n    if (spanContext.status) {\n      this.status = spanContext.status;\n    }\n    if (spanContext.startTimestamp) {\n      this.startTimestamp = spanContext.startTimestamp;\n    }\n    if (spanContext.endTimestamp) {\n      this.endTimestamp = spanContext.endTimestamp;\n    }\n    if (spanContext.instrumenter) {\n      this.instrumenter = spanContext.instrumenter;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public startChild(\n    spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>,\n  ): Span {\n    const childSpan = new Span({\n      ...spanContext,\n      parentSpanId: this.spanId,\n      sampled: this.sampled,\n      traceId: this.traceId,\n    });\n\n    childSpan.spanRecorder = this.spanRecorder;\n    if (childSpan.spanRecorder) {\n      childSpan.spanRecorder.add(childSpan);\n    }\n\n    childSpan.transaction = this.transaction;\n\n    if (__DEBUG_BUILD__ && childSpan.transaction) {\n      const opStr = (spanContext && spanContext.op) || '< unknown op >';\n      const nameStr = childSpan.transaction.name || '< unknown name >';\n      const idStr = childSpan.transaction.spanId;\n\n      const logMessage = `[Tracing] Starting '${opStr}' span on transaction '${nameStr}' (${idStr}).`;\n      childSpan.transaction.metadata.spanMetadata[childSpan.spanId] = { logMessage };\n      logger.log(logMessage);\n    }\n\n    return childSpan;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setTag(key: string, value: Primitive): this {\n    this.tags = { ...this.tags, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public setData(key: string, value: any): this {\n    this.data = { ...this.data, [key]: value };\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setStatus(value: SpanStatusType): this {\n    this.status = value;\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setHttpStatus(httpStatus: number): this {\n    this.setTag('http.status_code', String(httpStatus));\n    const spanStatus = spanStatusfromHttpCode(httpStatus);\n    if (spanStatus !== 'unknown_error') {\n      this.setStatus(spanStatus);\n    }\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public isSuccess(): boolean {\n    return this.status === 'ok';\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): void {\n    if (\n      __DEBUG_BUILD__ &&\n      // Don't call this for transactions\n      this.transaction &&\n      this.transaction.spanId !== this.spanId\n    ) {\n      const { logMessage } = this.transaction.metadata.spanMetadata[this.spanId];\n      if (logMessage) {\n        logger.log((logMessage as string).replace('Starting', 'Finishing'));\n      }\n    }\n\n    this.endTimestamp = typeof endTimestamp === 'number' ? endTimestamp : timestampWithMs();\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toTraceparent(): string {\n    let sampledString = '';\n    if (this.sampled !== undefined) {\n      sampledString = this.sampled ? '-1' : '-0';\n    }\n    return `${this.traceId}-${this.spanId}${sampledString}`;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): SpanContext {\n    return dropUndefinedKeys({\n      data: this.data,\n      description: this.description,\n      endTimestamp: this.endTimestamp,\n      op: this.op,\n      parentSpanId: this.parentSpanId,\n      sampled: this.sampled,\n      spanId: this.spanId,\n      startTimestamp: this.startTimestamp,\n      status: this.status,\n      tags: this.tags,\n      traceId: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(spanContext: SpanContext): this {\n    this.data = spanContext.data || {};\n    this.description = spanContext.description;\n    this.endTimestamp = spanContext.endTimestamp;\n    this.op = spanContext.op;\n    this.parentSpanId = spanContext.parentSpanId;\n    this.sampled = spanContext.sampled;\n    this.spanId = spanContext.spanId || this.spanId;\n    this.startTimestamp = spanContext.startTimestamp || this.startTimestamp;\n    this.status = spanContext.status;\n    this.tags = spanContext.tags || {};\n    this.traceId = spanContext.traceId || this.traceId;\n\n    return this;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public getTraceContext(): TraceContext {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      trace_id: this.traceId,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toJSON(): {\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    data?: { [key: string]: any };\n    description?: string;\n    op?: string;\n    parent_span_id?: string;\n    span_id: string;\n    start_timestamp: number;\n    status?: string;\n    tags?: { [key: string]: Primitive };\n    timestamp?: number;\n    trace_id: string;\n  } {\n    return dropUndefinedKeys({\n      data: Object.keys(this.data).length > 0 ? this.data : undefined,\n      description: this.description,\n      op: this.op,\n      parent_span_id: this.parentSpanId,\n      span_id: this.spanId,\n      start_timestamp: this.startTimestamp,\n      status: this.status,\n      tags: Object.keys(this.tags).length > 0 ? this.tags : undefined,\n      timestamp: this.endTimestamp,\n      trace_id: this.traceId,\n    });\n  }\n}\n\nexport type SpanStatusType =\n  /** The operation completed successfully. */\n  | 'ok'\n  /** Deadline expired before operation could complete. */\n  | 'deadline_exceeded'\n  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n  | 'unauthenticated'\n  /** 403 Forbidden */\n  | 'permission_denied'\n  /** 404 Not Found. Some requested entity (file or directory) was not found. */\n  | 'not_found'\n  /** 429 Too Many Requests */\n  | 'resource_exhausted'\n  /** Client specified an invalid argument. 4xx. */\n  | 'invalid_argument'\n  /** 501 Not Implemented */\n  | 'unimplemented'\n  /** 503 Service Unavailable */\n  | 'unavailable'\n  /** Other/generic 5xx. */\n  | 'internal_error'\n  /** Unknown. Any non-standard HTTP status code. */\n  | 'unknown_error'\n  /** The operation was cancelled (typically by the user). */\n  | 'cancelled'\n  /** Already exists (409) */\n  | 'already_exists'\n  /** Operation was rejected because the system is not in a state required for the operation's */\n  | 'failed_precondition'\n  /** The operation was aborted, typically due to a concurrency issue. */\n  | 'aborted'\n  /** Operation was attempted past the valid range. */\n  | 'out_of_range'\n  /** Unrecoverable data loss or corruption */\n  | 'data_loss';\n\n/**\n * Converts a HTTP status code into a {@link SpanStatusType}.\n *\n * @param httpStatus The HTTP response status code.\n * @returns The span status or unknown_error.\n */\nexport function spanStatusfromHttpCode(httpStatus: number): SpanStatusType {\n  if (httpStatus < 400 && httpStatus >= 100) {\n    return 'ok';\n  }\n\n  if (httpStatus >= 400 && httpStatus < 500) {\n    switch (httpStatus) {\n      case 401:\n        return 'unauthenticated';\n      case 403:\n        return 'permission_denied';\n      case 404:\n        return 'not_found';\n      case 409:\n        return 'already_exists';\n      case 413:\n        return 'failed_precondition';\n      case 429:\n        return 'resource_exhausted';\n      default:\n        return 'invalid_argument';\n    }\n  }\n\n  if (httpStatus >= 500 && httpStatus < 600) {\n    switch (httpStatus) {\n      case 501:\n        return 'unimplemented';\n      case 503:\n        return 'unavailable';\n      case 504:\n        return 'deadline_exceeded';\n      default:\n        return 'internal_error';\n    }\n  }\n\n  return 'unknown_error';\n}\n"],"names":[],"mappings":";;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,YAAA,CAAA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,KAAA,GAAA,GAAA,CAAA;;AAIA,GAAA,WAAA,CAAA,MAAA,GAAA,IAAA,EAAA,CAAA,YAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,MAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,GAAA,CAAA,IAAA,EAAA;AACA,IAAA,IAAA,IAAA,CAAA,KAAA,CAAA,MAAA,GAAA,IAAA,CAAA,OAAA,EAAA;AACA,MAAA,IAAA,CAAA,YAAA,GAAA,SAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,OAAA,GAAA,KAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,MAAA,GAAA,KAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,cAAA,GAAA,eAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,GAAA,CAAA;AACA;A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A;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,UAAA,IAAA,GAAA,IAAA,UAAA,GAAA,GAAA,EAAA;AACA,IAAA,QAAA,UAAA;AACA,MAAA,KAAA,GAAA;AACA,QAAA,OAAA,eAAA,CAAA;AACA,MAAA,KAAA,GAAA;AACA,QAAA,OAAA,aAAA,CAAA;AACA,MAAA,KAAA,GAAA;AACA,QAAA,OAAA,mBAAA,CAAA;AACA,MAAA;AACA,QAAA,OAAA,gBAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,eAAA,CAAA;AACA;;;;"}/** The status of an Span.
 *
 * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type
 */
// eslint-disable-next-line import/export
var SpanStatus; (function (SpanStatus) {
  /** The operation completed successfully. */
  const Ok = 'ok'; SpanStatus["Ok"] = Ok;
  /** Deadline expired before operation could complete. */
  const DeadlineExceeded = 'deadline_exceeded'; SpanStatus["DeadlineExceeded"] = DeadlineExceeded;
  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
  const Unauthenticated = 'unauthenticated'; SpanStatus["Unauthenticated"] = Unauthenticated;
  /** 403 Forbidden */
  const PermissionDenied = 'permission_denied'; SpanStatus["PermissionDenied"] = PermissionDenied;
  /** 404 Not Found. Some requested entity (file or directory) was not found. */
  const NotFound = 'not_found'; SpanStatus["NotFound"] = NotFound;
  /** 429 Too Many Requests */
  const ResourceExhausted = 'resource_exhausted'; SpanStatus["ResourceExhausted"] = ResourceExhausted;
  /** Client specified an invalid argument. 4xx. */
  const InvalidArgument = 'invalid_argument'; SpanStatus["InvalidArgument"] = InvalidArgument;
  /** 501 Not Implemented */
  const Unimplemented = 'unimplemented'; SpanStatus["Unimplemented"] = Unimplemented;
  /** 503 Service Unavailable */
  const Unavailable = 'unavailable'; SpanStatus["Unavailable"] = Unavailable;
  /** Other/generic 5xx. */
  const InternalError = 'internal_error'; SpanStatus["InternalError"] = InternalError;
  /** Unknown. Any non-standard HTTP status code. */
  const UnknownError = 'unknown_error'; SpanStatus["UnknownError"] = UnknownError;
  /** The operation was cancelled (typically by the user). */
  const Cancelled = 'cancelled'; SpanStatus["Cancelled"] = Cancelled;
  /** Already exists (409) */
  const AlreadyExists = 'already_exists'; SpanStatus["AlreadyExists"] = AlreadyExists;
  /** Operation was rejected because the system is not in a state required for the operation's */
  const FailedPrecondition = 'failed_precondition'; SpanStatus["FailedPrecondition"] = FailedPrecondition;
  /** The operation was aborted, typically due to a concurrency issue. */
  const Aborted = 'aborted'; SpanStatus["Aborted"] = Aborted;
  /** Operation was attempted past the valid range. */
  const OutOfRange = 'out_of_range'; SpanStatus["OutOfRange"] = OutOfRange;
  /** Unrecoverable data loss or corruption */
  const DataLoss = 'data_loss'; SpanStatus["DataLoss"] = DataLoss;
})(SpanStatus || (SpanStatus = {}));

export { SpanStatus };
//# sourceMappingURL=spanstatus.js.map
{"version":3,"file":"spanstatus.js","sources":["../../../src/tracing/spanstatus.ts"],"sourcesContent":["/** The status of an Span.\n *\n * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type\n */\n// eslint-disable-next-line import/export\nexport enum SpanStatus {\n  /** The operation completed successfully. */\n  Ok = 'ok',\n  /** Deadline expired before operation could complete. */\n  DeadlineExceeded = 'deadline_exceeded',\n  /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */\n  Unauthenticated = 'unauthenticated',\n  /** 403 Forbidden */\n  PermissionDenied = 'permission_denied',\n  /** 404 Not Found. Some requested entity (file or directory) was not found. */\n  NotFound = 'not_found',\n  /** 429 Too Many Requests */\n  ResourceExhausted = 'resource_exhausted',\n  /** Client specified an invalid argument. 4xx. */\n  InvalidArgument = 'invalid_argument',\n  /** 501 Not Implemented */\n  Unimplemented = 'unimplemented',\n  /** 503 Service Unavailable */\n  Unavailable = 'unavailable',\n  /** Other/generic 5xx. */\n  InternalError = 'internal_error',\n  /** Unknown. Any non-standard HTTP status code. */\n  UnknownError = 'unknown_error',\n  /** The operation was cancelled (typically by the user). */\n  Cancelled = 'cancelled',\n  /** Already exists (409) */\n  AlreadyExists = 'already_exists',\n  /** Operation was rejected because the system is not in a state required for the operation's */\n  FailedPrecondition = 'failed_precondition',\n  /** The operation was aborted, typically due to a concurrency issue. */\n  Aborted = 'aborted',\n  /** Operation was attempted past the valid range. */\n  OutOfRange = 'out_of_range',\n  /** Unrecoverable data loss or corruption */\n  DataLoss = 'data_loss',\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,IAAA,WAAA,CAAA,CAAA,UAAA,UAAA,EAAA;AACA;AACA,EAAA,MAAA,EAAA,GAAA,IAAA,CAAA,CAAA,UAAA,CAAA,IAAA,CAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,gBAAA,GAAA,mBAAA,CAAA,CAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,gBAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA,iBAAA,CAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,GAAA,eAAA,CAAA;AACA;AACA,EAAA,MAAA,gBAAA,GAAA,mBAAA,CAAA,CAAA,UAAA,CAAA,kBAAA,CAAA,GAAA,gBAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,WAAA,CAAA,CAAA,UAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA;AACA;AACA,EAAA,MAAA,iBAAA,GAAA,oBAAA,CAAA,CAAA,UAAA,CAAA,mBAAA,CAAA,GAAA,iBAAA,CAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA,kBAAA,CAAA,CAAA,UAAA,CAAA,iBAAA,CAAA,GAAA,eAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,eAAA,CAAA,CAAA,UAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA;AACA,EAAA,MAAA,WAAA,GAAA,aAAA,CAAA,CAAA,UAAA,CAAA,aAAA,CAAA,GAAA,WAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,gBAAA,CAAA,CAAA,UAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA;AACA,EAAA,MAAA,YAAA,GAAA,eAAA,CAAA,CAAA,UAAA,CAAA,cAAA,CAAA,GAAA,YAAA,CAAA;AACA;AACA,EAAA,MAAA,SAAA,GAAA,WAAA,CAAA,CAAA,UAAA,CAAA,WAAA,CAAA,GAAA,SAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,gBAAA,CAAA,CAAA,UAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA;AACA,EAAA,MAAA,kBAAA,GAAA,qBAAA,CAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,GAAA,kBAAA,CAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,SAAA,CAAA,CAAA,UAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,cAAA,CAAA,CAAA,UAAA,CAAA,YAAA,CAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,WAAA,CAAA,CAAA,UAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA;AACA,CAAA,EAAA,UAAA,KAAA,UAAA,GAAA,EAAA,CAAA,CAAA;;;;"}import { isThenable } from '@sentry/utils';
import { getCurrentHub } from '../hub.js';

/**
 * Wraps a function with a transaction/span and finishes the span after the function is done.
 *
 * Note that if you have not enabled tracing extensions via `addTracingExtensions`, this function
 * will not generate spans, and the `span` returned from the callback may be undefined.
 *
 * This function is meant to be used internally and may break at any time. Use at your own risk.
 *
 * @internal
 * @private
 */
function trace(
  context,
  callback,
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  onError = () => {},
) {
  const ctx = { ...context };
  // If a name is set and a description is not, set the description to the name.
  if (ctx.name !== undefined && ctx.description === undefined) {
    ctx.description = ctx.name;
  }

  const hub = getCurrentHub();
  const scope = hub.getScope();

  const parentSpan = scope.getSpan();
  const activeSpan = parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);
  scope.setSpan(activeSpan);

  function finishAndSetSpan() {
    activeSpan && activeSpan.finish();
    hub.getScope().setSpan(parentSpan);
  }

  let maybePromiseResult;
  try {
    maybePromiseResult = callback(activeSpan);
  } catch (e) {
    activeSpan && activeSpan.setStatus('internal_error');
    onError(e);
    finishAndSetSpan();
    throw e;
  }

  if (isThenable(maybePromiseResult)) {
    Promise.resolve(maybePromiseResult).then(
      () => {
        finishAndSetSpan();
      },
      e => {
        activeSpan && activeSpan.setStatus('internal_error');
        onError(e);
        finishAndSetSpan();
      },
    );
  } else {
    finishAndSetSpan();
  }

  return maybePromiseResult;
}

export { trace };
//# sourceMappingURL=trace.js.map
{"version":3,"file":"trace.js","sources":["../../../src/tracing/trace.ts"],"sourcesContent":["import type { TransactionContext } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport { getCurrentHub } from '../hub';\nimport type { Span } from './span';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`, this function\n * will not generate spans, and the `span` returned from the callback may be undefined.\n *\n * This function is meant to be used internally and may break at any time. Use at your own risk.\n *\n * @internal\n * @private\n */\nexport function trace<T>(\n  context: TransactionContext,\n  callback: (span?: Span) => T,\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  onError: (error: unknown) => void = () => {},\n): T {\n  const ctx = { ...context };\n  // If a name is set and a description is not, set the description to the name.\n  if (ctx.name !== undefined && ctx.description === undefined) {\n    ctx.description = ctx.name;\n  }\n\n  const hub = getCurrentHub();\n  const scope = hub.getScope();\n\n  const parentSpan = scope.getSpan();\n  const activeSpan = parentSpan ? parentSpan.startChild(ctx) : hub.startTransaction(ctx);\n  scope.setSpan(activeSpan);\n\n  function finishAndSetSpan(): void {\n    activeSpan && activeSpan.finish();\n    hub.getScope().setSpan(parentSpan);\n  }\n\n  let maybePromiseResult: T;\n  try {\n    maybePromiseResult = callback(activeSpan);\n  } catch (e) {\n    activeSpan && activeSpan.setStatus('internal_error');\n    onError(e);\n    finishAndSetSpan();\n    throw e;\n  }\n\n  if (isThenable(maybePromiseResult)) {\n    Promise.resolve(maybePromiseResult).then(\n      () => {\n        finishAndSetSpan();\n      },\n      e => {\n        activeSpan && activeSpan.setStatus('internal_error');\n        onError(e);\n        finishAndSetSpan();\n      },\n    );\n  } else {\n    finishAndSetSpan();\n  }\n\n  return maybePromiseResult;\n}\n"],"names":[],"mappings":";;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,QAAA;AACA;AACA,EAAA,OAAA,GAAA,MAAA,EAAA;AACA,EAAA;AACA,EAAA,MAAA,GAAA,GAAA,EAAA,GAAA,OAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,GAAA,CAAA,IAAA,KAAA,SAAA,IAAA,GAAA,CAAA,WAAA,KAAA,SAAA,EAAA;AACA,IAAA,GAAA,CAAA,WAAA,GAAA,GAAA,CAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,GAAA,GAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,GAAA,CAAA,QAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,KAAA,CAAA,OAAA,EAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,UAAA,GAAA,UAAA,CAAA,UAAA,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA,gBAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,KAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AACA;AACA,EAAA,SAAA,gBAAA,GAAA;AACA,IAAA,UAAA,IAAA,UAAA,CAAA,MAAA,EAAA,CAAA;AACA,IAAA,GAAA,CAAA,QAAA,EAAA,CAAA,OAAA,CAAA,UAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA;AACA,EAAA,IAAA;AACA,IAAA,kBAAA,GAAA,QAAA,CAAA,UAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,UAAA,IAAA,UAAA,CAAA,SAAA,CAAA,gBAAA,CAAA,CAAA;AACA,IAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,gBAAA,EAAA,CAAA;AACA,IAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,UAAA,CAAA,kBAAA,CAAA,EAAA;AACA,IAAA,OAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,CAAA,IAAA;AACA,MAAA,MAAA;AACA,QAAA,gBAAA,EAAA,CAAA;AACA,OAAA;AACA,MAAA,CAAA,IAAA;AACA,QAAA,UAAA,IAAA,UAAA,CAAA,SAAA,CAAA,gBAAA,CAAA,CAAA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA;AACA,QAAA,gBAAA,EAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,gBAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA;AACA;;;;"}import { logger, dropUndefinedKeys } from '@sentry/utils';
import { DEFAULT_ENVIRONMENT } from '../constants.js';
import { getCurrentHub } from '../hub.js';
import { Span, SpanRecorder } from './span.js';

/** JSDoc */
class Transaction extends Span  {

  /**
   * The reference to the current hub.
   */

   __init() {this._measurements = {};}

   __init2() {this._contexts = {};}

   __init3() {this._frozenDynamicSamplingContext = undefined;}

  /**
   * This constructor should never be called manually. Those instrumenting tracing should use
   * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.
   * @internal
   * @hideconstructor
   * @hidden
   */
   constructor(transactionContext, hub) {
    super(transactionContext);Transaction.prototype.__init.call(this);Transaction.prototype.__init2.call(this);Transaction.prototype.__init3.call(this);
    this._hub = hub || getCurrentHub();

    this._name = transactionContext.name || '';

    this.metadata = {
      source: 'custom',
      ...transactionContext.metadata,
      spanMetadata: {},
    };

    this._trimEnd = transactionContext.trimEnd;

    // this is because transactions are also spans, and spans have a transaction pointer
    this.transaction = this;

    // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means
    // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)
    const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;
    if (incomingDynamicSamplingContext) {
      // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`
      this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };
    }
  }

  /** Getter for `name` property */
   get name() {
    return this._name;
  }

  /** Setter for `name` property, which also sets `source` as custom */
   set name(newName) {
    this.setName(newName);
  }

  /**
   * JSDoc
   */
   setName(name, source = 'custom') {
    this._name = name;
    this.metadata.source = source;
  }

  /**
   * Attaches SpanRecorder to the span itself
   * @param maxlen maximum number of spans that can be recorded
   */
   initSpanRecorder(maxlen = 1000) {
    if (!this.spanRecorder) {
      this.spanRecorder = new SpanRecorder(maxlen);
    }
    this.spanRecorder.add(this);
  }

  /**
   * @inheritDoc
   */
   setContext(key, context) {
    if (context === null) {
      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
      delete this._contexts[key];
    } else {
      this._contexts[key] = context;
    }
  }

  /**
   * @inheritDoc
   */
   setMeasurement(name, value, unit = '') {
    this._measurements[name] = { value, unit };
  }

  /**
   * @inheritDoc
   */
   setMetadata(newMetadata) {
    this.metadata = { ...this.metadata, ...newMetadata };
  }

  /**
   * @inheritDoc
   */
   finish(endTimestamp) {
    // This transaction is already finished, so we should not flush it again.
    if (this.endTimestamp !== undefined) {
      return undefined;
    }

    if (!this.name) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');
      this.name = '<unlabeled transaction>';
    }

    // just sets the end timestamp
    super.finish(endTimestamp);

    const client = this._hub.getClient();
    if (client && client.emit) {
      client.emit('finishTransaction', this);
    }

    if (this.sampled !== true) {
      // At this point if `sampled !== true` we want to discard the transaction.
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');

      if (client) {
        client.recordDroppedEvent('sample_rate', 'transaction');
      }

      return undefined;
    }

    const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];

    if (this._trimEnd && finishedSpans.length > 0) {
      this.endTimestamp = finishedSpans.reduce((prev, current) => {
        if (prev.endTimestamp && current.endTimestamp) {
          return prev.endTimestamp > current.endTimestamp ? prev : current;
        }
        return prev;
      }).endTimestamp;
    }

    const metadata = this.metadata;

    const transaction = {
      contexts: {
        ...this._contexts,
        // We don't want to override trace context
        trace: this.getTraceContext(),
      },
      spans: finishedSpans,
      start_timestamp: this.startTimestamp,
      tags: this.tags,
      timestamp: this.endTimestamp,
      transaction: this.name,
      type: 'transaction',
      sdkProcessingMetadata: {
        ...metadata,
        dynamicSamplingContext: this.getDynamicSamplingContext(),
      },
      ...(metadata.source && {
        transaction_info: {
          source: metadata.source,
        },
      }),
    };

    const hasMeasurements = Object.keys(this._measurements).length > 0;

    if (hasMeasurements) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.log(
          '[Measurements] Adding measurements to transaction',
          JSON.stringify(this._measurements, undefined, 2),
        );
      transaction.measurements = this._measurements;
    }

    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);

    return this._hub.captureEvent(transaction);
  }

  /**
   * @inheritDoc
   */
   toContext() {
    const spanContext = super.toContext();

    return dropUndefinedKeys({
      ...spanContext,
      name: this.name,
      trimEnd: this._trimEnd,
    });
  }

  /**
   * @inheritDoc
   */
   updateWithContext(transactionContext) {
    super.updateWithContext(transactionContext);

    this.name = transactionContext.name || '';

    this._trimEnd = transactionContext.trimEnd;

    return this;
  }

  /**
   * @inheritdoc
   *
   * @experimental
   */
   getDynamicSamplingContext() {
    if (this._frozenDynamicSamplingContext) {
      return this._frozenDynamicSamplingContext;
    }

    const hub = this._hub || getCurrentHub();
    const client = hub && hub.getClient();

    if (!client) return {};

    const { environment, release } = client.getOptions() || {};
    const { publicKey: public_key } = client.getDsn() || {};

    const maybeSampleRate = this.metadata.sampleRate;
    const sample_rate = maybeSampleRate !== undefined ? maybeSampleRate.toString() : undefined;

    const { segment: user_segment } = hub.getScope().getUser() || {};

    const source = this.metadata.source;

    // We don't want to have a transaction name in the DSC if the source is "url" because URLs might contain PII
    const transaction = source && source !== 'url' ? this.name : undefined;

    const dsc = dropUndefinedKeys({
      environment: environment || DEFAULT_ENVIRONMENT,
      release,
      transaction,
      user_segment,
      public_key,
      trace_id: this.traceId,
      sample_rate,
    });

    // Uncomment if we want to make DSC immutable
    // this._frozenDynamicSamplingContext = dsc;

    client.emit && client.emit('createDsc', dsc);

    return dsc;
  }

  /**
   * Override the current hub with a new one.
   * Used if you want another hub to finish the transaction.
   *
   * @internal
   */
   setHub(hub) {
    this._hub = hub;
  }
}

export { Transaction };
//# sourceMappingURL=transaction.js.map
{"version":3,"file":"transaction.js","sources":["../../../src/tracing/transaction.ts"],"sourcesContent":["import type {\n  Context,\n  Contexts,\n  DynamicSamplingContext,\n  Event,\n  Measurements,\n  MeasurementUnit,\n  Transaction as TransactionInterface,\n  TransactionContext,\n  TransactionMetadata,\n} from '@sentry/types';\nimport { dropUndefinedKeys, logger } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\nimport { Span as SpanClass, SpanRecorder } from './span';\n\n/** JSDoc */\nexport class Transaction extends SpanClass implements TransactionInterface {\n  public metadata: TransactionMetadata;\n\n  /**\n   * The reference to the current hub.\n   */\n  public _hub: Hub;\n\n  private _name: string;\n\n  private _measurements: Measurements = {};\n\n  private _contexts: Contexts = {};\n\n  private _trimEnd?: boolean;\n\n  private _frozenDynamicSamplingContext: Readonly<Partial<DynamicSamplingContext>> | undefined = undefined;\n\n  /**\n   * This constructor should never be called manually. Those instrumenting tracing should use\n   * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.\n   * @internal\n   * @hideconstructor\n   * @hidden\n   */\n  public constructor(transactionContext: TransactionContext, hub?: Hub) {\n    super(transactionContext);\n\n    this._hub = hub || getCurrentHub();\n\n    this._name = transactionContext.name || '';\n\n    this.metadata = {\n      source: 'custom',\n      ...transactionContext.metadata,\n      spanMetadata: {},\n    };\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    // this is because transactions are also spans, and spans have a transaction pointer\n    this.transaction = this;\n\n    // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means\n    // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)\n    const incomingDynamicSamplingContext = this.metadata.dynamicSamplingContext;\n    if (incomingDynamicSamplingContext) {\n      // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`\n      this._frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext };\n    }\n  }\n\n  /** Getter for `name` property */\n  public get name(): string {\n    return this._name;\n  }\n\n  /** Setter for `name` property, which also sets `source` as custom */\n  public set name(newName: string) {\n    this.setName(newName);\n  }\n\n  /**\n   * JSDoc\n   */\n  public setName(name: string, source: TransactionMetadata['source'] = 'custom'): void {\n    this._name = name;\n    this.metadata.source = source;\n  }\n\n  /**\n   * Attaches SpanRecorder to the span itself\n   * @param maxlen maximum number of spans that can be recorded\n   */\n  public initSpanRecorder(maxlen: number = 1000): void {\n    if (!this.spanRecorder) {\n      this.spanRecorder = new SpanRecorder(maxlen);\n    }\n    this.spanRecorder.add(this);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setContext(key: string, context: Context | null): void {\n    if (context === null) {\n      // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n      delete this._contexts[key];\n    } else {\n      this._contexts[key] = context;\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMeasurement(name: string, value: number, unit: MeasurementUnit = ''): void {\n    this._measurements[name] = { value, unit };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setMetadata(newMetadata: Partial<TransactionMetadata>): void {\n    this.metadata = { ...this.metadata, ...newMetadata };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public finish(endTimestamp?: number): string | undefined {\n    // This transaction is already finished, so we should not flush it again.\n    if (this.endTimestamp !== undefined) {\n      return undefined;\n    }\n\n    if (!this.name) {\n      __DEBUG_BUILD__ && logger.warn('Transaction has no name, falling back to `<unlabeled transaction>`.');\n      this.name = '<unlabeled transaction>';\n    }\n\n    // just sets the end timestamp\n    super.finish(endTimestamp);\n\n    const client = this._hub.getClient();\n    if (client && client.emit) {\n      client.emit('finishTransaction', this);\n    }\n\n    if (this.sampled !== true) {\n      // At this point if `sampled !== true` we want to discard the transaction.\n      __DEBUG_BUILD__ && logger.log('[Tracing] Discarding transaction because its trace was not chosen to be sampled.');\n\n      if (client) {\n        client.recordDroppedEvent('sample_rate', 'transaction');\n      }\n\n      return undefined;\n    }\n\n    const finishedSpans = this.spanRecorder ? this.spanRecorder.spans.filter(s => s !== this && s.endTimestamp) : [];\n\n    if (this._trimEnd && finishedSpans.length > 0) {\n      this.endTimestamp = finishedSpans.reduce((prev: SpanClass, current: SpanClass) => {\n        if (prev.endTimestamp && current.endTimestamp) {\n          return prev.endTimestamp > current.endTimestamp ? prev : current;\n        }\n        return prev;\n      }).endTimestamp;\n    }\n\n    const metadata = this.metadata;\n\n    const transaction: Event = {\n      contexts: {\n        ...this._contexts,\n        // We don't want to override trace context\n        trace: this.getTraceContext(),\n      },\n      spans: finishedSpans,\n      start_timestamp: this.startTimestamp,\n      tags: this.tags,\n      timestamp: this.endTimestamp,\n      transaction: this.name,\n      type: 'transaction',\n      sdkProcessingMetadata: {\n        ...metadata,\n        dynamicSamplingContext: this.getDynamicSamplingContext(),\n      },\n      ...(metadata.source && {\n        transaction_info: {\n          source: metadata.source,\n        },\n      }),\n    };\n\n    const hasMeasurements = Object.keys(this._measurements).length > 0;\n\n    if (hasMeasurements) {\n      __DEBUG_BUILD__ &&\n        logger.log(\n          '[Measurements] Adding measurements to transaction',\n          JSON.stringify(this._measurements, undefined, 2),\n        );\n      transaction.measurements = this._measurements;\n    }\n\n    __DEBUG_BUILD__ && logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`);\n\n    return this._hub.captureEvent(transaction);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public toContext(): TransactionContext {\n    const spanContext = super.toContext();\n\n    return dropUndefinedKeys({\n      ...spanContext,\n      name: this.name,\n      trimEnd: this._trimEnd,\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public updateWithContext(transactionContext: TransactionContext): this {\n    super.updateWithContext(transactionContext);\n\n    this.name = transactionContext.name || '';\n\n    this._trimEnd = transactionContext.trimEnd;\n\n    return this;\n  }\n\n  /**\n   * @inheritdoc\n   *\n   * @experimental\n   */\n  public getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>> {\n    if (this._frozenDynamicSamplingContext) {\n      return this._frozenDynamicSamplingContext;\n    }\n\n    const hub: Hub = this._hub || getCurrentHub();\n    const client = hub && hub.getClient();\n\n    if (!client) return {};\n\n    const { environment, release } = client.getOptions() || {};\n    const { publicKey: public_key } = client.getDsn() || {};\n\n    const maybeSampleRate = this.metadata.sampleRate;\n    const sample_rate = maybeSampleRate !== undefined ? maybeSampleRate.toString() : undefined;\n\n    const { segment: user_segment } = hub.getScope().getUser() || {};\n\n    const source = this.metadata.source;\n\n    // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n    const transaction = source && source !== 'url' ? this.name : undefined;\n\n    const dsc = dropUndefinedKeys({\n      environment: environment || DEFAULT_ENVIRONMENT,\n      release,\n      transaction,\n      user_segment,\n      public_key,\n      trace_id: this.traceId,\n      sample_rate,\n    });\n\n    // Uncomment if we want to make DSC immutable\n    // this._frozenDynamicSamplingContext = dsc;\n\n    client.emit && client.emit('createDsc', dsc);\n\n    return dsc;\n  }\n\n  /**\n   * Override the current hub with a new one.\n   * Used if you want another hub to finish the transaction.\n   *\n   * @internal\n   */\n  public setHub(hub: Hub): void {\n    this._hub = hub;\n  }\n}\n"],"names":["SpanClass"],"mappings":";;;;;AAkBA;AACA,MAAA,WAAA,SAAAA,IAAA,EAAA;;AAGA;AACA;AACA;;AAKA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,aAAA,GAAA,GAAA,CAAA;AACA;AACA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,SAAA,GAAA,GAAA,CAAA;;AAIA,GAAA,OAAA,GAAA,CAAA,IAAA,CAAA,6BAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA,CAAA,kBAAA,EAAA,GAAA,EAAA;AACA,IAAA,KAAA,CAAA,kBAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,WAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CACA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,GAAA,IAAA,aAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,kBAAA,CAAA,IAAA,IAAA,EAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,MAAA,EAAA,QAAA;AACA,MAAA,GAAA,kBAAA,CAAA,QAAA;AACA,MAAA,YAAA,EAAA,EAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,kBAAA,CAAA,OAAA,CAAA;AACA;AACA;AACA,IAAA,IAA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A,OAAA;AACA,MAAA,WAAA;AACA,MAAA,YAAA;AACA,MAAA,UAAA;AACA,MAAA,QAAA,EAAA,IAAA,CAAA,OAAA;AACA,MAAA,WAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,MAAA,CAAA,IAAA,IAAA,MAAA,CAAA,IAAA,CAAA,WAAA,EAAA,GAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,CAAA,GAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,GAAA,CAAA;AACA,GAAA;AACA;;;;"}import { getCurrentHub } from '../hub.js';
export { TRACEPARENT_REGEXP, extractTraceparentData, stripUrlQueryAndFragment } from '@sentry/utils';

/** Grabs active transaction off scope, if any */
function getActiveTransaction(maybeHub) {
  const hub = maybeHub || getCurrentHub();
  const scope = hub.getScope();
  return scope.getTransaction() ;
}

export { getActiveTransaction };
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../../src/tracing/utils.ts"],"sourcesContent":["import type { Transaction } from '@sentry/types';\n\nimport type { Hub } from '../hub';\nimport { getCurrentHub } from '../hub';\n\n/**\n * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used\n * to be declared in this file. It was later moved into `@sentry/utils` as part of a\n * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`\n * is the only tracing function used by `@sentry/node`).\n *\n * These exports are kept here for backwards compatability's sake.\n *\n * TODO(v7): Reorganize these exports\n *\n * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.\n */\nexport { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils';\n\n/** Grabs active transaction off scope, if any */\nexport function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined {\n  const hub = maybeHub || getCurrentHub();\n  const scope = hub.getScope();\n  return scope.getTransaction() as T | undefined;\n}\n\n// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils\nexport { stripUrlQueryAndFragment } from '@sentry/utils';\n"],"names":[],"mappings":";;;AAmBA;AACA,SAAA,oBAAA,CAAA,QAAA,EAAA;AACA,EAAA,MAAA,GAAA,GAAA,QAAA,IAAA,aAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,GAAA,CAAA,QAAA,EAAA,CAAA;AACA,EAAA,OAAA,KAAA,CAAA,cAAA,EAAA,EAAA;AACA;;;;"}import { makePromiseBuffer, forEachEnvelopeItem, envelopeItemTypeToDataCategory, isRateLimited, resolvedSyncPromise, createEnvelope, SentryError, logger, serializeEnvelope, updateRateLimits } from '@sentry/utils';

const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;

/**
 * Creates an instance of a Sentry `Transport`
 *
 * @param options
 * @param makeRequest
 */
function createTransport(
  options,
  makeRequest,
  buffer = makePromiseBuffer(
    options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,
  ),
) {
  let rateLimits = {};
  const flush = (timeout) => buffer.drain(timeout);

  function send(envelope) {
    const filteredEnvelopeItems = [];

    // Drop rate limited items from envelope
    forEachEnvelopeItem(envelope, (item, type) => {
      const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);
      if (isRateLimited(rateLimits, envelopeItemDataCategory)) {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);
      } else {
        filteredEnvelopeItems.push(item);
      }
    });

    // Skip sending if envelope is empty after filtering out rate limited events
    if (filteredEnvelopeItems.length === 0) {
      return resolvedSyncPromise();
    }

    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems );

    // Creates client report for each item in an envelope
    const recordEnvelopeLoss = (reason) => {
      forEachEnvelopeItem(filteredEnvelope, (item, type) => {
        const event = getEventForEnvelopeItem(item, type);
        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);
      });
    };

    const requestTask = () =>
      makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(
        response => {
          // We don't want to throw on NOK responses, but we want to at least log them
          if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
          }

          rateLimits = updateRateLimits(rateLimits, response);
          return response;
        },
        error => {
          recordEnvelopeLoss('network_error');
          throw error;
        },
      );

    return buffer.add(requestTask).then(
      result => result,
      error => {
        if (error instanceof SentryError) {
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('Skipped sending event because buffer is full.');
          recordEnvelopeLoss('queue_overflow');
          return resolvedSyncPromise();
        } else {
          throw error;
        }
      },
    );
  }

  // We use this to identifify if the transport is the base transport
  // TODO (v8): Remove this again as we'll no longer need it
  send.__sentry__baseTransport__ = true;

  return {
    send,
    flush,
  };
}

function getEventForEnvelopeItem(item, type) {
  if (type !== 'event' && type !== 'transaction') {
    return undefined;
  }

  return Array.isArray(item) ? (item )[1] : undefined;
}

export { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };
//# sourceMappingURL=base.js.map
{"version":3,"file":"base.js","sources":["../../../src/transports/base.ts"],"sourcesContent":["import type {\n  Envelope,\n  EnvelopeItem,\n  EnvelopeItemType,\n  Event,\n  EventDropReason,\n  EventItem,\n  InternalBaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport type { PromiseBuffer, RateLimits } from '@sentry/utils';\nimport {\n  createEnvelope,\n  envelopeItemTypeToDataCategory,\n  forEachEnvelopeItem,\n  isRateLimited,\n  logger,\n  makePromiseBuffer,\n  resolvedSyncPromise,\n  SentryError,\n  serializeEnvelope,\n  updateRateLimits,\n} from '@sentry/utils';\n\nexport const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nexport function createTransport(\n  options: InternalBaseTransportOptions,\n  makeRequest: TransportRequestExecutor,\n  buffer: PromiseBuffer<void | TransportMakeRequestResponse> = makePromiseBuffer(\n    options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n  ),\n): Transport {\n  let rateLimits: RateLimits = {};\n  const flush = (timeout?: number): PromiseLike<boolean> => buffer.drain(timeout);\n\n  function send(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> {\n    const filteredEnvelopeItems: EnvelopeItem[] = [];\n\n    // Drop rate limited items from envelope\n    forEachEnvelopeItem(envelope, (item, type) => {\n      const envelopeItemDataCategory = envelopeItemTypeToDataCategory(type);\n      if (isRateLimited(rateLimits, envelopeItemDataCategory)) {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent('ratelimit_backoff', envelopeItemDataCategory, event);\n      } else {\n        filteredEnvelopeItems.push(item);\n      }\n    });\n\n    // Skip sending if envelope is empty after filtering out rate limited events\n    if (filteredEnvelopeItems.length === 0) {\n      return resolvedSyncPromise();\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const filteredEnvelope: Envelope = createEnvelope(envelope[0], filteredEnvelopeItems as any);\n\n    // Creates client report for each item in an envelope\n    const recordEnvelopeLoss = (reason: EventDropReason): void => {\n      forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n        const event: Event | undefined = getEventForEnvelopeItem(item, type);\n        options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n      });\n    };\n\n    const requestTask = (): PromiseLike<void | TransportMakeRequestResponse> =>\n      makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n        response => {\n          // We don't want to throw on NOK responses, but we want to at least log them\n          if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n            __DEBUG_BUILD__ && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n          }\n\n          rateLimits = updateRateLimits(rateLimits, response);\n          return response;\n        },\n        error => {\n          recordEnvelopeLoss('network_error');\n          throw error;\n        },\n      );\n\n    return buffer.add(requestTask).then(\n      result => result,\n      error => {\n        if (error instanceof SentryError) {\n          __DEBUG_BUILD__ && logger.error('Skipped sending event because buffer is full.');\n          recordEnvelopeLoss('queue_overflow');\n          return resolvedSyncPromise();\n        } else {\n          throw error;\n        }\n      },\n    );\n  }\n\n  // We use this to identifify if the transport is the base transport\n  // TODO (v8): Remove this again as we'll no longer need it\n  send.__sentry__baseTransport__ = true;\n\n  return {\n    send,\n    flush,\n  };\n}\n\nfunction getEventForEnvelopeItem(item: Envelope[1][number], type: EnvelopeItemType): Event | undefined {\n  if (type !== 'event' && type !== 'transaction') {\n    return undefined;\n  }\n\n  return Array.isArray(item) ? (item as EventItem)[1] : undefined;\n}\n"],"names":[],"mappings":";;AA0BA,MAAA,6BAAA,GAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA;AACA,EAAA,OAAA;AACA,EAAA,WAAA;AACA,EAAA,MAAA,GAAA,iBAAA;AACA,IAAA,OAAA,CAAA,UAAA,IAAA,6BAAA;AACA,GAAA;AACA,EAAA;AACA,EAAA,IAAA,UAAA,GAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,CAAA,OAAA,KAAA,MAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA;AACA;AACA,EAAA,SAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA,MAAA,qBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,IAAA,mBAAA,CAAA,QAAA,EAAA,CAAA,IAAA,EAAA,IAAA,KAAA;AACA,MAAA,MAAA,wBAAA,GAAA,8BAAA,CAAA,IAAA,CAAA,CAAA;AACA,MAAA,IAAA,aAAA,CAAA,UAAA,EAAA,wBAAA,CAAA,EAAA;AACA,QAAA,MAAA,KAAA,GAAA,uBAAA,CAAA,IAAA,EAAA,IAAA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CAAA,CAAA;AACA,UAAA,OAAA,QAAA,CAAA;AACA,SAAA;AACA,QAAA,KAAA,IAAA;AACA,UAAA,kBAAA,CAAA,eAAA,CAAA,CAAA;AACA,UAAA,MAAA,KAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA;AACA,IAAA,OAAA,MAAA,CAAA,GAAA,CAAA,WAAA,CAAA,CAAA,IAAA;AACA,MAAA,MAAA,IAAA,MAAA;AACA,MAAA,KAAA,IAAA;AACA,QAAA,IAAA,KAAA,YAAA,WAAA,EAAA;AACA,UAAA,iEAAA,MAAA,CAAA,KAAA,CAAA,+CAAA,CAAA,CAAA;AACA,UAAA,kBAAA,CAAA,gBAAA,CAAA,CAAA;AACA,UAAA,OAAA,mBAAA,EAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,MAAA,KAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,CAAA,yBAAA,GAAA,IAAA,CAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,IAAA;AACA,IAAA,KAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,uBAAA,CAAA,IAAA,EAAA,IAAA,EAAA;AACA,EAAA,IAAA,IAAA,KAAA,OAAA,IAAA,IAAA,KAAA,aAAA,EAAA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA,OAAA,CAAA,IAAA,CAAA,GAAA,CAAA,IAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA;AACA;;;;"}import { parseRetryAfterHeader, logger, envelopeContainsItemType } from '@sentry/utils';

const MIN_DELAY = 100; // 100 ms
const START_DELAY = 5000; // 5 seconds
const MAX_DELAY = 3.6e6; // 1 hour

function log(msg, error) {
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.info(`[Offline]: ${msg}`, error);
}

/**
 * Wraps a transport and stores and retries events when they fail to send.
 *
 * @param createTransport The transport to wrap.
 */
function makeOfflineTransport(
  createTransport,
) {
  return options => {
    const transport = createTransport(options);
    const store = options.createStore ? options.createStore(options) : undefined;

    let retryDelay = START_DELAY;
    let flushTimer;

    function shouldQueue(env, error, retryDelay) {
      // We don't queue Session Replay envelopes because they are:
      // - Ordered and Replay relies on the response status to know when they're successfully sent.
      // - Likely to fill the queue quickly and block other events from being sent.
      // We also want to drop client reports because they can be generated when we retry sending events while offline.
      if (envelopeContainsItemType(env, ['replay_event', 'replay_recording', 'client_report'])) {
        return false;
      }

      if (options.shouldStore) {
        return options.shouldStore(env, error, retryDelay);
      }

      return true;
    }

    function flushIn(delay) {
      if (!store) {
        return;
      }

      if (flushTimer) {
        clearTimeout(flushTimer );
      }

      flushTimer = setTimeout(async () => {
        flushTimer = undefined;

        const found = await store.pop();
        if (found) {
          log('Attempting to send previously queued event');
          void send(found).catch(e => {
            log('Failed to retry sending', e);
          });
        }
      }, delay) ;

      // We need to unref the timer in node.js, otherwise the node process never exit.
      if (typeof flushTimer !== 'number' && flushTimer.unref) {
        flushTimer.unref();
      }
    }

    function flushWithBackOff() {
      if (flushTimer) {
        return;
      }

      flushIn(retryDelay);

      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);
    }

    async function send(envelope) {
      try {
        const result = await transport.send(envelope);

        let delay = MIN_DELAY;

        if (result) {
          // If there's a retry-after header, use that as the next delay.
          if (result.headers && result.headers['retry-after']) {
            delay = parseRetryAfterHeader(result.headers['retry-after']);
          } // If we have a server error, return now so we don't flush the queue.
          else if ((result.statusCode || 0) >= 400) {
            return result;
          }
        }

        flushIn(delay);
        retryDelay = START_DELAY;
        return result;
      } catch (e) {
        if (store && (await shouldQueue(envelope, e, retryDelay))) {
          await store.insert(envelope);
          flushWithBackOff();
          log('Error sending. Event queued', e);
          return {};
        } else {
          throw e;
        }
      }
    }

    if (options.flushAtStartup) {
      flushWithBackOff();
    }

    return {
      send,
      flush: t => transport.flush(t),
    };
  };
}

export { MIN_DELAY, START_DELAY, makeOfflineTransport };
//# sourceMappingURL=offline.js.map
{"version":3,"file":"offline.js","sources":["../../../src/transports/offline.ts"],"sourcesContent":["import type { Envelope, InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '@sentry/types';\nimport { envelopeContainsItemType, logger, parseRetryAfterHeader } from '@sentry/utils';\n\nexport const MIN_DELAY = 100; // 100 ms\nexport const START_DELAY = 5_000; // 5 seconds\nconst MAX_DELAY = 3.6e6; // 1 hour\n\nfunction log(msg: string, error?: Error): void {\n  __DEBUG_BUILD__ && logger.info(`[Offline]: ${msg}`, error);\n}\n\nexport interface OfflineStore {\n  insert(env: Envelope): Promise<void>;\n  pop(): Promise<Envelope | undefined>;\n}\n\nexport type CreateOfflineStore = (options: OfflineTransportOptions) => OfflineStore;\n\nexport interface OfflineTransportOptions extends InternalBaseTransportOptions {\n  /**\n   * A function that creates the offline store instance.\n   */\n  createStore?: CreateOfflineStore;\n\n  /**\n   * Flush the offline store shortly after startup.\n   *\n   * Defaults: false\n   */\n  flushAtStartup?: boolean;\n\n  /**\n   * Called before an event is stored.\n   *\n   * Return false to drop the envelope rather than store it.\n   *\n   * @param envelope The envelope that failed to send.\n   * @param error The error that occurred.\n   * @param retryDelay The current retry delay in milliseconds.\n   */\n  shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;\n}\n\ntype Timer = number | { unref?: () => void };\n\n/**\n * Wraps a transport and stores and retries events when they fail to send.\n *\n * @param createTransport The transport to wrap.\n */\nexport function makeOfflineTransport<TO>(\n  createTransport: (options: TO) => Transport,\n): (options: TO & OfflineTransportOptions) => Transport {\n  return options => {\n    const transport = createTransport(options);\n    const store = options.createStore ? options.createStore(options) : undefined;\n\n    let retryDelay = START_DELAY;\n    let flushTimer: Timer | undefined;\n\n    function shouldQueue(env: Envelope, error: Error, retryDelay: number): boolean | Promise<boolean> {\n      // We don't queue Session Replay envelopes because they are:\n      // - Ordered and Replay relies on the response status to know when they're successfully sent.\n      // - Likely to fill the queue quickly and block other events from being sent.\n      // We also want to drop client reports because they can be generated when we retry sending events while offline.\n      if (envelopeContainsItemType(env, ['replay_event', 'replay_recording', 'client_report'])) {\n        return false;\n      }\n\n      if (options.shouldStore) {\n        return options.shouldStore(env, error, retryDelay);\n      }\n\n      return true;\n    }\n\n    function flushIn(delay: number): void {\n      if (!store) {\n        return;\n      }\n\n      if (flushTimer) {\n        clearTimeout(flushTimer as ReturnType<typeof setTimeout>);\n      }\n\n      flushTimer = setTimeout(async () => {\n        flushTimer = undefined;\n\n        const found = await store.pop();\n        if (found) {\n          log('Attempting to send previously queued event');\n          void send(found).catch(e => {\n            log('Failed to retry sending', e);\n          });\n        }\n      }, delay) as Timer;\n\n      // We need to unref the timer in node.js, otherwise the node process never exit.\n      if (typeof flushTimer !== 'number' && flushTimer.unref) {\n        flushTimer.unref();\n      }\n    }\n\n    function flushWithBackOff(): void {\n      if (flushTimer) {\n        return;\n      }\n\n      flushIn(retryDelay);\n\n      retryDelay = Math.min(retryDelay * 2, MAX_DELAY);\n    }\n\n    async function send(envelope: Envelope): Promise<void | TransportMakeRequestResponse> {\n      try {\n        const result = await transport.send(envelope);\n\n        let delay = MIN_DELAY;\n\n        if (result) {\n          // If there's a retry-after header, use that as the next delay.\n          if (result.headers && result.headers['retry-after']) {\n            delay = parseRetryAfterHeader(result.headers['retry-after']);\n          } // If we have a server error, return now so we don't flush the queue.\n          else if ((result.statusCode || 0) >= 400) {\n            return result;\n          }\n        }\n\n        flushIn(delay);\n        retryDelay = START_DELAY;\n        return result;\n      } catch (e) {\n        if (store && (await shouldQueue(envelope, e, retryDelay))) {\n          await store.insert(envelope);\n          flushWithBackOff();\n          log('Error sending. Event queued', e);\n          return {};\n        } else {\n          throw e;\n        }\n      }\n    }\n\n    if (options.flushAtStartup) {\n      flushWithBackOff();\n    }\n\n    return {\n      send,\n      flush: t => transport.flush(t),\n    };\n  };\n}\n"],"names":[],"mappings":";;AAGA,MAAA,SAAA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A,YAAA,OAAA,MAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA;AACA,QAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AACA,QAAA,UAAA,GAAA,WAAA,CAAA;AACA,QAAA,OAAA,MAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,IAAA,KAAA,KAAA,MAAA,WAAA,CAAA,QAAA,EAAA,CAAA,EAAA,UAAA,CAAA,CAAA,EAAA;AACA,UAAA,MAAA,KAAA,CAAA,MAAA,CAAA,QAAA,CAAA,CAAA;AACA,UAAA,gBAAA,EAAA,CAAA;AACA,UAAA,GAAA,CAAA,6BAAA,EAAA,CAAA,CAAA,CAAA;AACA,UAAA,OAAA,EAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,MAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,OAAA,CAAA,cAAA,EAAA;AACA,MAAA,gBAAA,EAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA;AACA,MAAA,IAAA;AACA,MAAA,KAAA,EAAA,CAAA,IAAA,SAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}import { getCurrentHub } from '../hub.js';

// Treeshakable guard to remove all code related to tracing

/**
 * Determines if tracing is currently enabled.
 *
 * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.
 */
function hasTracingEnabled(
  maybeOptions,
) {
  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
    return false;
  }

  const client = getCurrentHub().getClient();
  const options = maybeOptions || (client && client.getOptions());
  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);
}

export { hasTracingEnabled };
//# sourceMappingURL=hasTracingEnabled.js.map
{"version":3,"file":"hasTracingEnabled.js","sources":["../../../src/utils/hasTracingEnabled.ts"],"sourcesContent":["import type { Options } from '@sentry/types';\n\nimport { getCurrentHub } from '../hub';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if tracing is currently enabled.\n *\n * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.\n */\nexport function hasTracingEnabled(\n  maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined,\n): boolean {\n  if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n    return false;\n  }\n\n  const client = getCurrentHub().getClient();\n  const options = maybeOptions || (client && client.getOptions());\n  return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);\n}\n"],"names":[],"mappings":";;AAIA;;AAGA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA;AACA,EAAA,YAAA;AACA,EAAA;AACA,EAAA,IAAA,OAAA,kBAAA,KAAA,SAAA,IAAA,CAAA,kBAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,aAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA,GAAA,YAAA,KAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,CAAA,OAAA,KAAA,OAAA,CAAA,aAAA,IAAA,kBAAA,IAAA,OAAA,IAAA,eAAA,IAAA,OAAA,CAAA,CAAA;AACA;;;;"}import { uuid4, dateTimestampInSeconds, resolvedSyncPromise, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';
import { DEFAULT_ENVIRONMENT } from '../constants.js';
import { Scope } from '../scope.js';

/**
 * Adds common information to events.
 *
 * The information includes release and environment from `options`,
 * breadcrumbs and context (extra, tags and user) from the scope.
 *
 * Information that is already present in the event is never overwritten. For
 * nested objects, such as the context, keys are merged.
 *
 * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.
 *
 * @param event The original event.
 * @param hint May contain additional information about the original exception.
 * @param scope A scope containing event metadata.
 * @returns A new event with more information.
 * @hidden
 */
function prepareEvent(
  options,
  event,
  hint,
  scope,
) {
  const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;
  const prepared = {
    ...event,
    event_id: event.event_id || hint.event_id || uuid4(),
    timestamp: event.timestamp || dateTimestampInSeconds(),
  };
  const integrations = hint.integrations || options.integrations.map(i => i.name);

  applyClientOptions(prepared, options);
  applyIntegrationsMetadata(prepared, integrations);

  // Only apply debug metadata to error events.
  if (event.type === undefined) {
    applyDebugMetadata(prepared, options.stackParser);
  }

  // If we have scope given to us, use it as the base for further modifications.
  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.
  let finalScope = scope;
  if (hint.captureContext) {
    finalScope = Scope.clone(finalScope).update(hint.captureContext);
  }

  // We prepare the result here with a resolved Event.
  let result = resolvedSyncPromise(prepared);

  // This should be the last thing called, since we want that
  // {@link Hub.addEventProcessor} gets the finished prepared event.
  //
  // We need to check for the existence of `finalScope.getAttachments`
  // because `getAttachments` can be undefined if users are using an older version
  // of `@sentry/core` that does not have the `getAttachments` method.
  // See: https://github.com/getsentry/sentry-javascript/issues/5229
  if (finalScope) {
    // Collect attachments from the hint and scope
    if (finalScope.getAttachments) {
      const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];

      if (attachments.length) {
        hint.attachments = attachments;
      }
    }

    // In case we have a hub we reassign it.
    result = finalScope.applyToEvent(prepared, hint);
  }

  return result.then(evt => {
    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
    }
    return evt;
  });
}

/**
 *  Enhances event using the client configuration.
 *  It takes care of all "static" values like environment, release and `dist`,
 *  as well as truncating overly long values.
 * @param event event instance to be enhanced
 */
function applyClientOptions(event, options) {
  const { environment, release, dist, maxValueLength = 250 } = options;

  if (!('environment' in event)) {
    event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;
  }

  if (event.release === undefined && release !== undefined) {
    event.release = release;
  }

  if (event.dist === undefined && dist !== undefined) {
    event.dist = dist;
  }

  if (event.message) {
    event.message = truncate(event.message, maxValueLength);
  }

  const exception = event.exception && event.exception.values && event.exception.values[0];
  if (exception && exception.value) {
    exception.value = truncate(exception.value, maxValueLength);
  }

  const request = event.request;
  if (request && request.url) {
    request.url = truncate(request.url, maxValueLength);
  }
}

const debugIdStackParserCache = new WeakMap();

/**
 * Applies debug metadata images to the event in order to apply source maps by looking up their debug ID.
 */
function applyDebugMetadata(event, stackParser) {
  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;

  if (!debugIdMap) {
    return;
  }

  let debugIdStackFramesCache;
  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);
  if (cachedDebugIdStackFrameCache) {
    debugIdStackFramesCache = cachedDebugIdStackFrameCache;
  } else {
    debugIdStackFramesCache = new Map();
    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);
  }

  // Build a map of filename -> debug_id
  const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {
    let parsedStack;
    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);
    if (cachedParsedStack) {
      parsedStack = cachedParsedStack;
    } else {
      parsedStack = stackParser(debugIdStackTrace);
      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);
    }

    for (let i = parsedStack.length - 1; i >= 0; i--) {
      const stackFrame = parsedStack[i];
      if (stackFrame.filename) {
        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];
        break;
      }
    }
    return acc;
  }, {});

  // Get a Set of filenames in the stack trace
  const errorFileNames = new Set();
  try {
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
    event.exception.values.forEach(exception => {
      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
      exception.stacktrace.frames.forEach(frame => {
        if (frame.filename) {
          errorFileNames.add(frame.filename);
        }
      });
    });
  } catch (e) {
    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.
  }

  // Fill debug_meta information
  event.debug_meta = event.debug_meta || {};
  event.debug_meta.images = event.debug_meta.images || [];
  const images = event.debug_meta.images;
  errorFileNames.forEach(filename => {
    if (filenameDebugIdMap[filename]) {
      images.push({
        type: 'sourcemap',
        code_file: filename,
        debug_id: filenameDebugIdMap[filename],
      });
    }
  });
}

/**
 * This function adds all used integrations to the SDK info in the event.
 * @param event The event that will be filled with all integrations.
 */
function applyIntegrationsMetadata(event, integrationNames) {
  if (integrationNames.length > 0) {
    event.sdk = event.sdk || {};
    event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];
  }
}

/**
 * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.
 * Normalized keys:
 * - `breadcrumbs.data`
 * - `user`
 * - `contexts`
 * - `extra`
 * @param event Event
 * @returns Normalized event
 */
function normalizeEvent(event, depth, maxBreadth) {
  if (!event) {
    return null;
  }

  const normalized = {
    ...event,
    ...(event.breadcrumbs && {
      breadcrumbs: event.breadcrumbs.map(b => ({
        ...b,
        ...(b.data && {
          data: normalize(b.data, depth, maxBreadth),
        }),
      })),
    }),
    ...(event.user && {
      user: normalize(event.user, depth, maxBreadth),
    }),
    ...(event.contexts && {
      contexts: normalize(event.contexts, depth, maxBreadth),
    }),
    ...(event.extra && {
      extra: normalize(event.extra, depth, maxBreadth),
    }),
  };

  // event.contexts.trace stores information about a Transaction. Similarly,
  // event.spans[] stores information about child Spans. Given that a
  // Transaction is conceptually a Span, normalization should apply to both
  // Transactions and Spans consistently.
  // For now the decision is to skip normalization of Transactions and Spans,
  // so this block overwrites the normalized event to add back the original
  // Transaction information prior to normalization.
  if (event.contexts && event.contexts.trace && normalized.contexts) {
    normalized.contexts.trace = event.contexts.trace;

    // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it
    if (event.contexts.trace.data) {
      normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);
    }
  }

  // event.spans[].data may contain circular/dangerous data so we need to normalize it
  if (event.spans) {
    normalized.spans = event.spans.map(span => {
      // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable
      if (span.data) {
        span.data = normalize(span.data, depth, maxBreadth);
      }
      return span;
    });
  }

  return normalized;
}

export { applyDebugMetadata, prepareEvent };
//# sourceMappingURL=prepareEvent.js.map
{"version":3,"file":"prepareEvent.js","sources":["../../../src/utils/prepareEvent.ts"],"sourcesContent":["import type { ClientOptions, Event, EventHint, StackFrame, StackParser } from '@sentry/types';\nimport { dateTimestampInSeconds, GLOBAL_OBJ, normalize, resolvedSyncPromise, truncate, uuid4 } from '@sentry/utils';\n\nimport { DEFAULT_ENVIRONMENT } from '../constants';\nimport { Scope } from '../scope';\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nexport function prepareEvent(\n  options: ClientOptions,\n  event: Event,\n  hint: EventHint,\n  scope?: Scope,\n): PromiseLike<Event | null> {\n  const { normalizeDepth = 3, normalizeMaxBreadth = 1_000 } = options;\n  const prepared: Event = {\n    ...event,\n    event_id: event.event_id || hint.event_id || uuid4(),\n    timestamp: event.timestamp || dateTimestampInSeconds(),\n  };\n  const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n  applyClientOptions(prepared, options);\n  applyIntegrationsMetadata(prepared, integrations);\n\n  // Only apply debug metadata to error events.\n  if (event.type === undefined) {\n    applyDebugMetadata(prepared, options.stackParser);\n  }\n\n  // If we have scope given to us, use it as the base for further modifications.\n  // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n  let finalScope = scope;\n  if (hint.captureContext) {\n    finalScope = Scope.clone(finalScope).update(hint.captureContext);\n  }\n\n  // We prepare the result here with a resolved Event.\n  let result = resolvedSyncPromise<Event | null>(prepared);\n\n  // This should be the last thing called, since we want that\n  // {@link Hub.addEventProcessor} gets the finished prepared event.\n  //\n  // We need to check for the existence of `finalScope.getAttachments`\n  // because `getAttachments` can be undefined if users are using an older version\n  // of `@sentry/core` that does not have the `getAttachments` method.\n  // See: https://github.com/getsentry/sentry-javascript/issues/5229\n  if (finalScope) {\n    // Collect attachments from the hint and scope\n    if (finalScope.getAttachments) {\n      const attachments = [...(hint.attachments || []), ...finalScope.getAttachments()];\n\n      if (attachments.length) {\n        hint.attachments = attachments;\n      }\n    }\n\n    // In case we have a hub we reassign it.\n    result = finalScope.applyToEvent(prepared, hint);\n  }\n\n  return result.then(evt => {\n    if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n      return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n    }\n    return evt;\n  });\n}\n\n/**\n *  Enhances event using the client configuration.\n *  It takes care of all \"static\" values like environment, release and `dist`,\n *  as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event: Event, options: ClientOptions): void {\n  const { environment, release, dist, maxValueLength = 250 } = options;\n\n  if (!('environment' in event)) {\n    event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n  }\n\n  if (event.release === undefined && release !== undefined) {\n    event.release = release;\n  }\n\n  if (event.dist === undefined && dist !== undefined) {\n    event.dist = dist;\n  }\n\n  if (event.message) {\n    event.message = truncate(event.message, maxValueLength);\n  }\n\n  const exception = event.exception && event.exception.values && event.exception.values[0];\n  if (exception && exception.value) {\n    exception.value = truncate(exception.value, maxValueLength);\n  }\n\n  const request = event.request;\n  if (request && request.url) {\n    request.url = truncate(request.url, maxValueLength);\n  }\n}\n\nconst debugIdStackParserCache = new WeakMap<StackParser, Map<string, StackFrame[]>>();\n\n/**\n * Applies debug metadata images to the event in order to apply source maps by looking up their debug ID.\n */\nexport function applyDebugMetadata(event: Event, stackParser: StackParser): void {\n  const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n  if (!debugIdMap) {\n    return;\n  }\n\n  let debugIdStackFramesCache: Map<string, StackFrame[]>;\n  const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n  if (cachedDebugIdStackFrameCache) {\n    debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n  } else {\n    debugIdStackFramesCache = new Map<string, StackFrame[]>();\n    debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n  }\n\n  // Build a map of filename -> debug_id\n  const filenameDebugIdMap = Object.keys(debugIdMap).reduce<Record<string, string>>((acc, debugIdStackTrace) => {\n    let parsedStack: StackFrame[];\n    const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n    if (cachedParsedStack) {\n      parsedStack = cachedParsedStack;\n    } else {\n      parsedStack = stackParser(debugIdStackTrace);\n      debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n    }\n\n    for (let i = parsedStack.length - 1; i >= 0; i--) {\n      const stackFrame = parsedStack[i];\n      if (stackFrame.filename) {\n        acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n        break;\n      }\n    }\n    return acc;\n  }, {});\n\n  // Get a Set of filenames in the stack trace\n  const errorFileNames = new Set<string>();\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    event!.exception!.values!.forEach(exception => {\n      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n      exception.stacktrace!.frames!.forEach(frame => {\n        if (frame.filename) {\n          errorFileNames.add(frame.filename);\n        }\n      });\n    });\n  } catch (e) {\n    // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n  }\n\n  // Fill debug_meta information\n  event.debug_meta = event.debug_meta || {};\n  event.debug_meta.images = event.debug_meta.images || [];\n  const images = event.debug_meta.images;\n  errorFileNames.forEach(filename => {\n    if (filenameDebugIdMap[filename]) {\n      images.push({\n        type: 'sourcemap',\n        code_file: filename,\n        debug_id: filenameDebugIdMap[filename],\n      });\n    }\n  });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event: Event, integrationNames: string[]): void {\n  if (integrationNames.length > 0) {\n    event.sdk = event.sdk || {};\n    event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n  }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event: Event | null, depth: number, maxBreadth: number): Event | null {\n  if (!event) {\n    return null;\n  }\n\n  const normalized: Event = {\n    ...event,\n    ...(event.breadcrumbs && {\n      breadcrumbs: event.breadcrumbs.map(b => ({\n        ...b,\n        ...(b.data && {\n          data: normalize(b.data, depth, maxBreadth),\n        }),\n      })),\n    }),\n    ...(event.user && {\n      user: normalize(event.user, depth, maxBreadth),\n    }),\n    ...(event.contexts && {\n      contexts: normalize(event.contexts, depth, maxBreadth),\n    }),\n    ...(event.extra && {\n      extra: normalize(event.extra, depth, maxBreadth),\n    }),\n  };\n\n  // event.contexts.trace stores information about a Transaction. Similarly,\n  // event.spans[] stores information about child Spans. Given that a\n  // Transaction is conceptually a Span, normalization should apply to both\n  // Transactions and Spans consistently.\n  // For now the decision is to skip normalization of Transactions and Spans,\n  // so this block overwrites the normalized event to add back the original\n  // Transaction information prior to normalization.\n  if (event.contexts && event.contexts.trace && normalized.contexts) {\n    normalized.contexts.trace = event.contexts.trace;\n\n    // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n    if (event.contexts.trace.data) {\n      normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n    }\n  }\n\n  // event.spans[].data may contain circular/dangerous data so we need to normalize it\n  if (event.spans) {\n    normalized.spans = event.spans.map(span => {\n      // We cannot use the spread operator here because `toJSON` on `span` is non-enumerable\n      if (span.data) {\n        span.data = normalize(span.data, depth, maxBreadth);\n      }\n      return span;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,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,IAAA,KAAA,CAAA,KAAA,EAAA;AACA,IAAA,UAAA,CAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,GAAA,CAAA,IAAA,IAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,IAAA,EAAA;AACA,QAAA,IAAA,CAAA,IAAA,GAAA,SAAA,CAAA,IAAA,CAAA,IAAA,EAAA,KAAA,EAAA,UAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,UAAA,CAAA;AACA;;;;"}const SDK_VERSION = '7.48.0';

export { SDK_VERSION };
//# sourceMappingURL=version.js.map
{"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const SDK_VERSION = '7.48.0';\n"],"names":[],"mappings":"AAAA,MAAA,WAAA,GAAA;;;;"}Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/core",
  "version": "7.48.0",
  "description": "Base implementation for all Sentry JavaScript SDKs",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0",
    "tslib": "^1.9.3"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Sentry JavaScript SDK Core

[![npm version](https://img.shields.io/npm/v/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core)
[![npm dm](https://img.shields.io/npm/dm/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core)
[![npm dt](https://img.shields.io/npm/dt/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

## General

This package contains interface definitions, base classes and utilities for building Sentry JavaScript SDKs, like
`@sentry/node` or `@sentry/browser`.

Please consider all classes and exported functions and interfaces `internal`.
import type { ClientOptions, DsnComponents, DsnLike } from '@sentry/types';
/**
 * Returns the envelope endpoint URL with auth in the query string.
 *
 * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.
 */
export declare function getEnvelopeEndpointWithUrlEncodedAuth(dsn: DsnComponents, tunnelOrOptions?: string | ClientOptions): string;
/** Returns the url to the report dialog endpoint. */
export declare function getReportDialogEndpoint(dsnLike: DsnLike, dialogOptions: {
    [key: string]: any;
    user?: {
        name?: string;
        email?: string;
    };
}): string;
//# sourceMappingURL=api.d.ts.map{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAW,MAAM,eAAe,CAAC;AA4BpF;;;;GAIG;AACH,wBAAgB,qCAAqC,CACnD,GAAG,EAAE,aAAa,EAGlB,eAAe,GAAE,MAAM,GAAG,aAAmC,GAC5D,MAAM,CAUR;AAED,qDAAqD;AACrD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE;IAEb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C,GACA,MAAM,CA2BR"}import type { Breadcrumb, BreadcrumbHint, Client, ClientOptions, DataCategory, DsnComponents, DynamicSamplingContext, Envelope, Event, EventDropReason, EventHint, Integration, IntegrationClass, Outcome, SdkMetadata, Session, SessionAggregates, Severity, SeverityLevel, Transaction, Transport, TransportMakeRequestResponse } from '@sentry/types';
import type { IntegrationIndex } from './integration';
import type { Scope } from './scope';
/**
 * Base implementation for all JavaScript SDK clients.
 *
 * Call the constructor with the corresponding options
 * specific to the client subclass. To access these options later, use
 * {@link Client.getOptions}.
 *
 * If a Dsn is specified in the options, it will be parsed and stored. Use
 * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is
 * invalid, the constructor will throw a {@link SentryException}. Note that
 * without a valid Dsn, the SDK will not send any events to Sentry.
 *
 * Before sending an event, it is passed through
 * {@link BaseClient._prepareEvent} to add SDK information and scope data
 * (breadcrumbs and context). To add more custom information, override this
 * method and extend the resulting prepared event.
 *
 * To issue automatically created events (e.g. via instrumentation), use
 * {@link Client.captureEvent}. It will prepare the event and pass it through
 * the callback lifecycle. To issue auto-breadcrumbs, use
 * {@link Client.addBreadcrumb}.
 *
 * @example
 * class NodeClient extends BaseClient<NodeOptions> {
 *   public constructor(options: NodeOptions) {
 *     super(options);
 *   }
 *
 *   // ...
 * }
 */
export declare abstract class BaseClient<O extends ClientOptions> implements Client<O> {
    /** Options passed to the SDK. */
    protected readonly _options: O;
    /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
    protected readonly _dsn?: DsnComponents;
    protected readonly _transport?: Transport;
    /** Array of set up integrations. */
    protected _integrations: IntegrationIndex;
    /** Indicates whether this client's integrations have been set up. */
    protected _integrationsInitialized: boolean;
    /** Number of calls being processed */
    protected _numProcessing: number;
    /** Holds flushable  */
    private _outcomes;
    private _hooks;
    /**
     * Initializes this client instance.
     *
     * @param options Options for the client.
     */
    protected constructor(options: O);
    /**
     * @inheritDoc
     */
    captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * @inheritDoc
     */
    captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * @inheritDoc
     */
    captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * @inheritDoc
     */
    captureSession(session: Session): void;
    /**
     * @inheritDoc
     */
    getDsn(): DsnComponents | undefined;
    /**
     * @inheritDoc
     */
    getOptions(): O;
    /**
     * @see SdkMetadata in @sentry/types
     *
     * @return The metadata of the SDK
     */
    getSdkMetadata(): SdkMetadata | undefined;
    /**
     * @inheritDoc
     */
    getTransport(): Transport | undefined;
    /**
     * @inheritDoc
     */
    flush(timeout?: number): PromiseLike<boolean>;
    /**
     * @inheritDoc
     */
    close(timeout?: number): PromiseLike<boolean>;
    /**
     * Sets up the integrations
     */
    setupIntegrations(): void;
    /**
     * Gets an installed integration by its `id`.
     *
     * @returns The installed integration or `undefined` if no integration with that `id` was installed.
     */
    getIntegrationById(integrationId: string): Integration | undefined;
    /**
     * @inheritDoc
     */
    getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
    /**
     * @inheritDoc
     */
    addIntegration(integration: Integration): void;
    /**
     * @inheritDoc
     */
    sendEvent(event: Event, hint?: EventHint): void;
    /**
     * @inheritDoc
     */
    sendSession(session: Session | SessionAggregates): void;
    /**
     * @inheritDoc
     */
    recordDroppedEvent(reason: EventDropReason, category: DataCategory, _event?: Event): void;
    /** @inheritdoc */
    on(hook: 'startTransaction' | 'finishTransaction', callback: (transaction: Transaction) => void): void;
    /** @inheritdoc */
    on(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;
    /** @inheritdoc */
    on(hook: 'afterSendEvent', callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void): void;
    /** @inheritdoc */
    on(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;
    /** @inheritdoc */
    on(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;
    /** @inheritdoc */
    emit(hook: 'startTransaction' | 'finishTransaction', transaction: Transaction): void;
    /** @inheritdoc */
    emit(hook: 'beforeEnvelope', envelope: Envelope): void;
    /** @inheritdoc */
    emit(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;
    /** @inheritdoc */
    emit(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
    /** @inheritdoc */
    emit(hook: 'createDsc', dsc: DynamicSamplingContext): void;
    /** Updates existing session based on the provided event */
    protected _updateSessionFromEvent(session: Session, event: Event): void;
    /**
     * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
     * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
     *
     * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
     * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
     * `true`.
     * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
     * `false` otherwise
     */
    protected _isClientDoneProcessing(timeout?: number): PromiseLike<boolean>;
    /** Determines whether this SDK is enabled and a valid Dsn is present. */
    protected _isEnabled(): boolean;
    /**
     * Adds common information to events.
     *
     * The information includes release and environment from `options`,
     * breadcrumbs and context (extra, tags and user) from the scope.
     *
     * Information that is already present in the event is never overwritten. For
     * nested objects, such as the context, keys are merged.
     *
     * @param event The original event.
     * @param hint May contain additional information about the original exception.
     * @param scope A scope containing event metadata.
     * @returns A new event with more information.
     */
    protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
    /**
     * Processes the event and logs an error in case of rejection
     * @param event
     * @param hint
     * @param scope
     */
    protected _captureEvent(event: Event, hint?: EventHint, scope?: Scope): PromiseLike<string | undefined>;
    /**
     * Processes an event (either error or message) and sends it to Sentry.
     *
     * This also adds breadcrumbs and context information to the event. However,
     * platform specific meta data (such as the User's IP address) must be added
     * by the SDK implementor.
     *
     *
     * @param event The event to send to Sentry.
     * @param hint May contain additional information about the original exception.
     * @param scope A scope containing event metadata.
     * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
     */
    protected _processEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event>;
    /**
     * Occupies the client with processing and event
     */
    protected _process<T>(promise: PromiseLike<T>): void;
    /**
     * @inheritdoc
     */
    protected _sendEnvelope(envelope: Envelope): PromiseLike<void | TransportMakeRequestResponse> | void;
    /**
     * Clears outcomes on this client and returns them.
     */
    protected _clearOutcomes(): Outcome[];
    /**
     * @inheritDoc
     */
    abstract eventFromException(_exception: any, _hint?: EventHint): PromiseLike<Event>;
    /**
     * @inheritDoc
     */
    abstract eventFromMessage(_message: string, _level?: Severity | SeverityLevel, _hint?: EventHint): PromiseLike<Event>;
}
//# sourceMappingURL=baseclient.d.ts.map{"version":3,"file":"baseclient.d.ts","sourceRoot":"","sources":["../../src/baseclient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,MAAM,EACN,aAAa,EACb,YAAY,EACZ,aAAa,EACb,sBAAsB,EACtB,QAAQ,EAER,KAAK,EACL,eAAe,EACf,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,OAAO,EACP,iBAAiB,E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,WAAW,CAAC,OAAO,CAAC;IAoBzE,yEAAyE;IACzE,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAShG;;;;;OAKG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,GAAE,SAAc,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC;IAqB3G;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAsFzF;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;IAcpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAAC,IAAI,GAAG,4BAA4B,CAAC,GAAG,IAAI;IAYpG;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,OAAO,EAAE;IAarC;;OAEG;aAEa,kBAAkB,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAE1F;;OAEG;aACa,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAEhB,MAAM,CAAC,EAAE,QAAQ,GAAG,aAAa,EACjC,KAAK,CAAC,EAAE,SAAS,GAChB,WAAW,CAAC,KAAK,CAAC;CACtB"}export declare const DEFAULT_ENVIRONMENT = "production";
//# sourceMappingURL=constants.d.ts.map{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,eAAe,CAAC"}import type { DsnComponents, Event, EventEnvelope, SdkMetadata, Session, SessionAggregates, SessionEnvelope } from '@sentry/types';
/** Creates an envelope from a Session */
export declare function createSessionEnvelope(session: Session | SessionAggregates, dsn: DsnComponents, metadata?: SdkMetadata, tunnel?: string): SessionEnvelope;
/**
 * Create an Envelope from an event.
 */
export declare function createEventEnvelope(event: Event, dsn: DsnComponents, metadata?: SdkMetadata, tunnel?: string): EventEnvelope;
//# sourceMappingURL=envelope.d.ts.map{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,KAAK,EACL,aAAa,EAGb,WAAW,EACX,OAAO,EACP,iBAAiB,EACjB,eAAe,EAEhB,MAAM,eAAe,CAAC;AAwBvB,yCAAyC;AACzC,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,GAAG,iBAAiB,EACpC,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,WAAW,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,eAAe,CAYjB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,WAAW,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,aAAa,CAwBf"}import type { Breadcrumb, CaptureContext, CustomSamplingContext, Event, EventHint, Extra, Extras, Primitive, Severity, SeverityLevel, TransactionContext, User } from '@sentry/types';
import type { Hub } from './hub';
import type { Scope } from './scope';
/**
 * Captures an exception event and sends it to Sentry.
 *
 * @param exception An exception-like object.
 * @param captureContext Additional scope data to apply to exception event.
 * @returns The generated eventId.
 */
export declare function captureException(exception: any, captureContext?: CaptureContext): ReturnType<Hub['captureException']>;
/**
 * Captures a message event and sends it to Sentry.
 *
 * @param message The message to send to Sentry.
 * @param Severity Define the level of the message.
 * @returns The generated eventId.
 */
export declare function captureMessage(message: string, captureContext?: CaptureContext | Severity | SeverityLevel): ReturnType<Hub['captureMessage']>;
/**
 * Captures a manually created event and sends it to Sentry.
 *
 * @param event The event to send to Sentry.
 * @returns The generated eventId.
 */
export declare function captureEvent(event: Event, hint?: EventHint): ReturnType<Hub['captureEvent']>;
/**
 * Callback to set context information onto the scope.
 * @param callback Callback function that receives Scope.
 */
export declare function configureScope(callback: (scope: Scope) => void): ReturnType<Hub['configureScope']>;
/**
 * Records a new breadcrumb which will be attached to future events.
 *
 * Breadcrumbs will be added to subsequent events to provide more context on
 * user's actions prior to an error or crash.
 *
 * @param breadcrumb The breadcrumb to record.
 */
export declare function addBreadcrumb(breadcrumb: Breadcrumb): ReturnType<Hub['addBreadcrumb']>;
/**
 * Sets context data with the given name.
 * @param name of the context
 * @param context Any kind of data. This data will be normalized.
 */
export declare function setContext(name: string, context: {
    [key: string]: any;
} | null): ReturnType<Hub['setContext']>;
/**
 * Set an object that will be merged sent as extra data with the event.
 * @param extras Extras object to merge into current context.
 */
export declare function setExtras(extras: Extras): ReturnType<Hub['setExtras']>;
/**
 * Set key:value that will be sent as extra data with the event.
 * @param key String of extra
 * @param extra Any kind of data. This data will be normalized.
 */
export declare function setExtra(key: string, extra: Extra): ReturnType<Hub['setExtra']>;
/**
 * Set an object that will be merged sent as tags data with the event.
 * @param tags Tags context object to merge into current context.
 */
export declare function setTags(tags: {
    [key: string]: Primitive;
}): ReturnType<Hub['setTags']>;
/**
 * Set key:value that will be sent as tags data with the event.
 *
 * Can also be used to unset a tag, by passing `undefined`.
 *
 * @param key String key of tag
 * @param value Value of tag
 */
export declare function setTag(key: string, value: Primitive): ReturnType<Hub['setTag']>;
/**
 * Updates user context information for future events.
 *
 * @param user User context object to be set in the current context. Pass `null` to unset the user.
 */
export declare function setUser(user: User | null): ReturnType<Hub['setUser']>;
/**
 * Creates a new scope with and executes the given operation within.
 * The scope is automatically removed once the operation
 * finishes or throws.
 *
 * This is essentially a convenience function for:
 *
 *     pushScope();
 *     callback();
 *     popScope();
 *
 * @param callback that will be enclosed into push/popScope.
 */
export declare function withScope(callback: (scope: Scope) => void): ReturnType<Hub['withScope']>;
/**
 * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
 *
 * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
 * new child span within the transaction or any span, call the respective `.startChild()` method.
 *
 * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
 *
 * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
 * finished child spans will be sent to Sentry.
 *
 * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call
 * `startTransaction` directly on the hub.
 *
 * @param context Properties of the new `Transaction`.
 * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
 * default values). See {@link Options.tracesSampler}.
 *
 * @returns The transaction which was just started
 */
export declare function startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): ReturnType<Hub['startTransaction']>;
//# sourceMappingURL=exports.d.ts.map{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/exports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,qBAAqB,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,IAAI,EACL,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AASrC;;;;;;GAMG;AAEH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAErH;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EAEf,cAAc,CAAC,EAAE,cAAc,GAAG,Q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AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAErE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAExF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,kBAAkB,EAC3B,qBAAqB,CAAC,EAAE,qBAAqB,GAC5C,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAErC"}import type { Breadcrumb, BreadcrumbHint, Client, CustomSamplingContext, Event, EventHint, Extra, Extras, Hub as HubInterface, Integration, IntegrationClass, Primitive, Session, SessionContext, Severity, SeverityLevel, Transaction, TransactionContext, User } from '@sentry/types';
import { Scope } from './scope';
/**
 * API compatibility version of this hub.
 *
 * WARNING: This number should only be increased when the global interface
 * changes and new methods are introduced.
 *
 * @hidden
 */
export declare const API_VERSION = 4;
export interface RunWithAsyncContextOptions {
    /** Whether to reuse an existing async context if one exists. Defaults to false. */
    reuseExisting?: boolean;
}
/**
 * @private Private API with no semver guarantees!
 *
 * Strategy used to track async context.
 */
export interface AsyncContextStrategy {
    /**
     * Gets the current async context. Returns undefined if there is no current async context.
     */
    getCurrentHub: () => Hub | undefined;
    /**
     * Runs the supplied callback in its own async context.
     */
    runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T;
}
/**
 * A layer in the process stack.
 * @hidden
 */
export interface Layer {
    client?: Client;
    scope: Scope;
}
/**
 * An object that contains a hub and maintains a scope stack.
 * @hidden
 */
export interface Carrier {
    __SENTRY__?: {
        hub?: Hub;
        acs?: AsyncContextStrategy;
        /**
         * Extra Hub properties injected by various SDKs
         */
        integrations?: Integration[];
        extensions?: {
            /** Extension methods for the hub, which are bound to the current Hub instance */
            [key: string]: Function;
        };
    };
}
/**
 * @inheritDoc
 */
export declare class Hub implements HubInterface {
    private readonly _version;
    /** Is a {@link Layer}[] containing the client and scope */
    private readonly _stack;
    /** Contains the last event id of a captured event.  */
    private _lastEventId?;
    /**
     * Creates a new instance of the hub, will push one {@link Layer} into the
     * internal stack on creation.
     *
     * @param client bound to the hub.
     * @param scope bound to the hub.
     * @param version number, higher number means higher priority.
     */
    constructor(client?: Client, scope?: Scope, _version?: number);
    /**
     * @inheritDoc
     */
    isOlderThan(version: number): boolean;
    /**
     * @inheritDoc
     */
    bindClient(client?: Client): void;
    /**
     * @inheritDoc
     */
    pushScope(): Scope;
    /**
     * @inheritDoc
     */
    popScope(): boolean;
    /**
     * @inheritDoc
     */
    withScope(callback: (scope: Scope) => void): void;
    /**
     * @inheritDoc
     */
    getClient<C extends Client>(): C | undefined;
    /** Returns the scope of the top stack. */
    getScope(): Scope;
    /** Returns the scope stack for domains or the process. */
    getStack(): Layer[];
    /** Returns the topmost scope layer in the order domain > local > process. */
    getStackTop(): Layer;
    /**
     * @inheritDoc
     */
    captureException(exception: unknown, hint?: EventHint): string;
    /**
     * @inheritDoc
     */
    captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;
    /**
     * @inheritDoc
     */
    captureEvent(event: Event, hint?: EventHint): string;
    /**
     * @inheritDoc
     */
    lastEventId(): string | undefined;
    /**
     * @inheritDoc
     */
    addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
    /**
     * @inheritDoc
     */
    setUser(user: User | null): void;
    /**
     * @inheritDoc
     */
    setTags(tags: {
        [key: string]: Primitive;
    }): void;
    /**
     * @inheritDoc
     */
    setExtras(extras: Extras): void;
    /**
     * @inheritDoc
     */
    setTag(key: string, value: Primitive): void;
    /**
     * @inheritDoc
     */
    setExtra(key: string, extra: Extra): void;
    /**
     * @inheritDoc
     */
    setContext(name: string, context: {
        [key: string]: any;
    } | null): void;
    /**
     * @inheritDoc
     */
    configureScope(callback: (scope: Scope) => void): void;
    /**
     * @inheritDoc
     */
    run(callback: (hub: Hub) => void): void;
    /**
     * @inheritDoc
     */
    getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
    /**
     * @inheritDoc
     */
    startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction;
    /**
     * @inheritDoc
     */
    traceHeaders(): {
        [key: string]: string;
    };
    /**
     * @inheritDoc
     */
    captureSession(endSession?: boolean): void;
    /**
     * @inheritDoc
     */
    endSession(): void;
    /**
     * @inheritDoc
     */
    startSession(context?: SessionContext): Session;
    /**
     * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
     * when Tracing is used.
     */
    shouldSendDefaultPii(): boolean;
    /**
     * Sends the current Session on the scope
     */
    private _sendSessionUpdate;
    /**
     * Internal helper function to call a method on the top client if it exists.
     *
     * @param method The method to call on the client.
     * @param args Arguments to pass to the client function.
     */
    private _withClient;
    /**
     * Calls global extension method and binding current instance to the function call
     */
    private _callExtensionMethod;
}
/**
 * Returns the global shim registry.
 *
 * FIXME: This function is problematic, because despite always returning a valid Carrier,
 * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check
 * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.
 **/
export declare function getMainCarrier(): Carrier;
/**
 * Replaces the current main hub with the passed one on the global object
 *
 * @returns The old replaced hub
 */
export declare function makeMain(hub: Hub): Hub;
/**
 * Returns the default hub instance.
 *
 * If a hub is already registered in the global carrier but this module
 * contains a more recent version, it replaces the registered version.
 * Otherwise, the currently registered hub will be returned.
 */
export declare function getCurrentHub(): Hub;
/**
 * @private Private API with no semver guarantees!
 *
 * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.
 */
export declare function ensureHubOnCarrier(carrier: Carrier, parent?: Hub): void;
/**
 * @private Private API with no semver guarantees!
 *
 * Sets the global async context strategy
 */
export declare function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void;
/**
 * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.
 *
 * @param callback The callback to run in its own async context
 * @param options Options to pass to the async context strategy
 * @returns The result of the callback
 */
export declare function runWithAsyncContext<T>(callback: () => T, options?: RunWithAsyncContextOptions): T;
/**
 * This will create a new {@link Hub} and add to the passed object on
 * __SENTRY__.hub.
 * @param carrier object
 * @hidden
 */
export declare function getHubFromCarrier(carrier: Carrier): Hub;
/**
 * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
 * @param carrier object
 * @param hub Hub
 * @returns A boolean indicating success or failure
 */
export declare function setHubOnCarrier(carrier: Carrier, hub: Hub): boolean;
//# sourceMappingURL=hub.d.ts.map{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../src/hub.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,MAAM,EACN,qBAAqB,EACrB,KAAK,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,IAAI,YAAY,EACnB,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,cAAc,EACd,QAAQ,EACR,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,IAAI,EACL,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,IAAI,CAAC;AAQ7B,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC;IACrC;;OAEG;IACH,mBAAmB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,0BAA0B,GAAG,CAAC,CAAC;CACnF;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,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';
export type { AsyncContextStrategy, Carrier, Layer, RunWithAsyncContextOptions } from './hub';
export type { OfflineStore, OfflineTransportOptions } from './transports/offline';
export * from './tracing';
export { addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, } from './exports';
export { getCurrentHub, getHubFromCarrier, Hub, makeMain, getMainCarrier, runWithAsyncContext, setHubOnCarrier, ensureHubOnCarrier, setAsyncContextStrategy, } from './hub';
export { makeSession, closeSession, updateSession } from './session';
export { SessionFlusher } from './sessionflusher';
export { addGlobalEventProcessor, Scope } from './scope';
export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';
export { BaseClient } from './baseclient';
export { initAndBind } from './sdk';
export { createTransport } from './transports/base';
export { makeOfflineTransport } from './transports/offline';
export { SDK_VERSION } from './version';
export { getIntegrationsToSetup } from './integration';
export { FunctionToString, InboundFilters } from './integrations';
export { prepareEvent } from './utils/prepareEvent';
export { hasTracingEnabled } from './utils/hasTracingEnabled';
export { DEFAULT_ENVIRONMENT } from './constants';
import * as Integrations from './integrations';
export { Integrations };
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAC9F,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAElF,cAAc,WAAW,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,GAAG,EACH,QAAQ,EACR,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,CAAC"}import type { Integration, Options } from '@sentry/types';
declare module '@sentry/types' {
    interface Integration {
        isDefaultInstance?: boolean;
    }
}
export declare const installedIntegrations: string[];
/** Map of integrations assigned to a client */
export declare type IntegrationIndex = {
    [key: string]: Integration;
};
/** Gets integrations to install */
export declare function getIntegrationsToSetup(options: Options): Integration[];
/**
 * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default
 * integrations are added unless they were already provided before.
 * @param integrations array of integration instances
 * @param withDefault should enable default integrations
 */
export declare function setupIntegrations(integrations: Integration[]): IntegrationIndex;
/** Setup a single integration.  */
export declare function setupIntegration(integration: Integration, integrationIndex: IntegrationIndex): void;
//# sourceMappingURL=integration.d.ts.map{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAM1D,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,WAAW;QACnB,iBAAiB,CAAC,EAAE,OAAO,CAAC;KAC7B;CACF;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,EAAO,CAAC;AAElD,+CAA+C;AAC/C,oBAAY,gBAAgB,GAAG;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CAC5B,CAAC;AA4BF,mCAAmC;AACnC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAgCtE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,gBAAgB,CAW/E;AAED,mCAAmC;AACnC,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAQnG"}import type { Integration } from '@sentry/types';
/** Patch toString calls to return proper name for wrapped functions */
export declare class FunctionToString implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
//# sourceMappingURL=functiontostring.d.ts.map{"version":3,"file":"functiontostring.d.ts","sourceRoot":"","sources":["../../../src/integrations/functiontostring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAKlE,uEAAuE;AACvE,qBAAa,gBAAiB,YAAW,WAAW;IAClD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAuB;IAE1C;;OAEG;IACI,SAAS,IAAI,IAAI;CAUzB"}import type { Event, EventProcessor, Hub, Integration } from '@sentry/types';
/** Options for the InboundFilters integration */
export interface InboundFiltersOptions {
    allowUrls: Array<string | RegExp>;
    denyUrls: Array<string | RegExp>;
    ignoreErrors: Array<string | RegExp>;
    ignoreTransactions: Array<string | RegExp>;
    ignoreInternal: boolean;
}
/** Inbound filters configurable by the user */
export declare class InboundFilters implements Integration {
    private readonly _options;
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    constructor(_options?: Partial<InboundFiltersOptions>);
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (processor: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
/** JSDoc */
export declare function _mergeOptions(internalOptions?: Partial<InboundFiltersOptions>, clientOptions?: Partial<InboundFiltersOptions>): Partial<InboundFiltersOptions>;
/** JSDoc */
export declare function _shouldDropEvent(event: Event, options: Partial<InboundFiltersOptions>): boolean;
//# sourceMappingURL=inboundfilters.d.ts.map{"version":3,"file":"inboundfilters.d.ts","sourceRoot":"","sources":["../../../src/integrations/inboundfilters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AAOzF,iDAAiD;AACjD,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACjC,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,kBAAkB,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC3C,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,+CAA+C;AAC/C,qBAAa,cAAe,YAAW,WAAW;IAW7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAqB;gBAEJ,QAAQ,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAEjF;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CAkB/G;AAED,YAAY;AACZ,wBAAgB,aAAa,CAC3B,eAAe,GAAE,OAAO,CAAC,qBAAqB,CAAM,EACpD,aAAa,GAAE,OAAO,CAAC,qBAAqB,CAAM,GACjD,OAAO,CAAC,qBAAqB,CAAC,CAYhC;AAED,YAAY;AACZ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAuC/F"}export { FunctionToString } from './functiontostring';
export { InboundFilters } from './inboundfilters';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}import type { Attachment, Breadcrumb, CaptureContext, Context, Contexts, Event, EventHint, EventProcessor, Extra, Extras, Primitive, RequestSession, Scope as ScopeInterface, Session, Severity, SeverityLevel, Span, Transaction, User } from '@sentry/types';
/**
 * Holds additional event information. {@link Scope.applyToEvent} will be
 * called by the client before an event will be sent.
 */
export declare class Scope implements ScopeInterface {
    /** Flag if notifying is happening. */
    protected _notifyingListeners: boolean;
    /** Callback for client to receive scope changes. */
    protected _scopeListeners: Array<(scope: Scope) => void>;
    /** Callback list that will be called after {@link applyToEvent}. */
    protected _eventProcessors: EventProcessor[];
    /** Array of breadcrumbs. */
    protected _breadcrumbs: Breadcrumb[];
    /** User */
    protected _user: User;
    /** Tags */
    protected _tags: {
        [key: string]: Primitive;
    };
    /** Extra */
    protected _extra: Extras;
    /** Contexts */
    protected _contexts: Contexts;
    /** Attachments */
    protected _attachments: Attachment[];
    /**
     * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
     * sent to Sentry
     */
    protected _sdkProcessingMetadata: {
        [key: string]: unknown;
    };
    /** Fingerprint */
    protected _fingerprint?: string[];
    /** Severity */
    protected _level?: Severity | SeverityLevel;
    /** Transaction Name */
    protected _transactionName?: string;
    /** Span */
    protected _span?: Span;
    /** Session */
    protected _session?: Session;
    /** Request Mode Session Status */
    protected _requestSession?: RequestSession;
    constructor();
    /**
     * Inherit values from the parent scope.
     * @param scope to clone.
     */
    static clone(scope?: Scope): Scope;
    /**
     * Add internal on change listener. Used for sub SDKs that need to store the scope.
     * @hidden
     */
    addScopeListener(callback: (scope: Scope) => void): void;
    /**
     * @inheritDoc
     */
    addEventProcessor(callback: EventProcessor): this;
    /**
     * @inheritDoc
     */
    setUser(user: User | null): this;
    /**
     * @inheritDoc
     */
    getUser(): User | undefined;
    /**
     * @inheritDoc
     */
    getRequestSession(): RequestSession | undefined;
    /**
     * @inheritDoc
     */
    setRequestSession(requestSession?: RequestSession): this;
    /**
     * @inheritDoc
     */
    setTags(tags: {
        [key: string]: Primitive;
    }): this;
    /**
     * @inheritDoc
     */
    setTag(key: string, value: Primitive): this;
    /**
     * @inheritDoc
     */
    setExtras(extras: Extras): this;
    /**
     * @inheritDoc
     */
    setExtra(key: string, extra: Extra): this;
    /**
     * @inheritDoc
     */
    setFingerprint(fingerprint: string[]): this;
    /**
     * @inheritDoc
     */
    setLevel(level: Severity | SeverityLevel): this;
    /**
     * @inheritDoc
     */
    setTransactionName(name?: string): this;
    /**
     * @inheritDoc
     */
    setContext(key: string, context: Context | null): this;
    /**
     * @inheritDoc
     */
    setSpan(span?: Span): this;
    /**
     * @inheritDoc
     */
    getSpan(): Span | undefined;
    /**
     * @inheritDoc
     */
    getTransaction(): Transaction | undefined;
    /**
     * @inheritDoc
     */
    setSession(session?: Session): this;
    /**
     * @inheritDoc
     */
    getSession(): Session | undefined;
    /**
     * @inheritDoc
     */
    update(captureContext?: CaptureContext): this;
    /**
     * @inheritDoc
     */
    clear(): this;
    /**
     * @inheritDoc
     */
    addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
    /**
     * @inheritDoc
     */
    getLastBreadcrumb(): Breadcrumb | undefined;
    /**
     * @inheritDoc
     */
    clearBreadcrumbs(): this;
    /**
     * @inheritDoc
     */
    addAttachment(attachment: Attachment): this;
    /**
     * @inheritDoc
     */
    getAttachments(): Attachment[];
    /**
     * @inheritDoc
     */
    clearAttachments(): this;
    /**
     * Applies data from the scope to the event and runs all event processors on it.
     *
     * @param event Event
     * @param hint Object containing additional information about the original exception, for use by the event processors.
     * @hidden
     */
    applyToEvent(event: Event, hint?: EventHint): PromiseLike<Event | null>;
    /**
     * Add data which will be accessible during event processing but won't get sent to Sentry
     */
    setSDKProcessingMetadata(newData: {
        [key: string]: unknown;
    }): this;
    /**
     * This will be called after {@link applyToEvent} is finished.
     */
    protected _notifyEventProcessors(processors: EventProcessor[], event: Event | null, hint: EventHint, index?: number): PromiseLike<Event | null>;
    /**
     * This will be called on every set call.
     */
    protected _notifyScopeListeners(): void;
    /**
     * Applies fingerprint from the scope to the event if there's one,
     * uses message if there's one instead or get rid of empty fingerprint
     */
    private _applyFingerprint;
}
/**
 * Add a EventProcessor to be kept globally.
 * @param callback EventProcessor to add
 */
export declare function addGlobalEventProcessor(callback: EventProcessor): void;
//# sourceMappingURL=scope.d.ts.map{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/scope.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,cAAc,EACd,KAAK,EAC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ASD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAEtE"}import type { Client, ClientOptions } from '@sentry/types';
/** A class object that can instantiate Client objects. */
export declare type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;
/**
 * Internal function to create a new SDK client instance. The client is
 * installed and then bound to the current scope.
 *
 * @param clientClass The client class to instantiate.
 * @param options Options to pass to the client.
 */
export declare function initAndBind<F extends Client, O extends ClientOptions>(clientClass: ClientClass<F, O>, options: O): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK3D,0DAA0D;AAC1D,oBAAY,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,aAAa,IAAI,KAAK,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,aAAa,EACnE,WAAW,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAC9B,OAAO,EAAE,CAAC,GACT,IAAI,CAgBN"}import type { Session, SessionContext, SessionStatus } from '@sentry/types';
/**
 * Creates a new `Session` object by setting certain default parameters. If optional @param context
 * is passed, the passed properties are applied to the session object.
 *
 * @param context (optional) additional properties to be applied to the returned session object
 *
 * @returns a new `Session` object
 */
export declare function makeSession(context?: Omit<SessionContext, 'started' | 'status'>): Session;
/**
 * Updates a session object with the properties passed in the context.
 *
 * Note that this function mutates the passed object and returns void.
 * (Had to do this instead of returning a new and updated session because closing and sending a session
 * makes an update to the session after it was passed to the sending logic.
 * @see BaseClient.captureSession )
 *
 * @param session the `Session` to update
 * @param context the `SessionContext` holding the properties that should be updated in @param session
 */
export declare function updateSession(session: Session, context?: SessionContext): void;
/**
 * Closes a session by setting its status and updating the session object with it.
 * Internally calls `updateSession` to update the passed session object.
 *
 * Note that this function mutates the passed session (@see updateSession for explanation).
 *
 * @param session the `Session` object to be closed
 * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,
 *               this function will keep the previously set status, unless it was `'ok'` in which case
 *               it is changed to `'exited'`.
 */
export declare function closeSession(session: Session, status?: Exclude<SessionStatus, 'ok'>): void;
//# sourceMappingURL=session.d.ts.map{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG/F;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,CAAC,GAAG,OAAO,CAqBzF;AAED;;;;;;;;;;GAUG;AAEH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,IAAI,CAuDlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,IAAI,CAS1F"}import type { Client, SessionAggregates, SessionFlusherLike } from '@sentry/types';
declare type ReleaseHealthAttributes = {
    environment?: string;
    release: string;
};
/**
 * @inheritdoc
 */
export declare class SessionFlusher implements SessionFlusherLike {
    readonly flushTimeout: number;
    private _pendingAggregates;
    private _sessionAttrs;
    private _intervalId;
    private _isEnabled;
    private _client;
    constructor(client: Client, attrs: ReleaseHealthAttributes);
    /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */
    flush(): void;
    /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
    getSessionAggregates(): SessionAggregates;
    /** JSDoc */
    close(): void;
    /**
     * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
     * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
     * `_incrementSessionStatusCount` along with the start date
     */
    incrementSessionStatusCount(): void;
    /**
     * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
     * the session received
     */
    private _incrementSessionStatusCount;
}
export {};
//# sourceMappingURL=sessionflusher.d.ts.map{"version":3,"file":"sessionflusher.d.ts","sourceRoot":"","sources":["../../src/sessionflusher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EAEN,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AAKvB,aAAK,uBAAuB,GAAG;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,qBAAa,cAAe,YAAW,kBAAkB;IACvD,SAAgB,YAAY,EAAE,MAAM,CAAM;IAC1C,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,aAAa,CAA0B;IAC/C,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,OAAO,CAAS;gBAEL,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB;IAOjE,sGAAsG;IAC/F,KAAK,IAAI,IAAI;IASpB,kFAAkF;IAC3E,oBAAoB,IAAI,iBAAiB;IAYhD,YAAY;IACL,KAAK,IAAI,IAAI;IAMpB;;;;OAIG;IACI,2BAA2B,IAAI,IAAI;IAgB1C;;;OAGG;IACH,OAAO,CAAC,4BAA4B;CAwBrC"}/**
 * Configures global error listeners
 */
export declare function registerErrorInstrumentation(): void;
//# sourceMappingURL=errors.d.ts.map{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/tracing/errors.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAQnD"}import type { CustomSamplingContext, TransactionContext } from '@sentry/types';
import type { Hub } from '../hub';
import { IdleTransaction } from './idletransaction';
/**
 * Create new idle transaction.
 */
export declare function startIdleTransaction(hub: Hub, transactionContext: TransactionContext, idleTimeout: number, finalTimeout: number, onScope?: boolean, customSamplingContext?: CustomSamplingContext, heartbeatInterval?: number): IdleTransaction;
/**
 * Adds tracing extensions to the global hub.
 */
export declare function addTracingExtensions(): void;
//# sourceMappingURL=hubextensions.d.ts.map{"version":3,"file":"hubextensions.d.ts","sourceRoot":"","sources":["../../../src/tracing/hubextensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,qBAAqB,EAA4B,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAIlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA0LpD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,GAAG,EACR,kBAAkB,EAAE,kBAAkB,EACtC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,OAAO,EACjB,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,iBAAiB,CAAC,EAAE,MAAM,GACzB,eAAe,CAiBjB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAc3C"}import type { TransactionContext } from '@sentry/types';
import type { Hub } from '../hub';
import type { Span } from './span';
import { SpanRecorder } from './span';
import { Transaction } from './transaction';
export declare const TRACING_DEFAULTS: {
    idleTimeout: number;
    finalTimeout: number;
    heartbeatInterval: number;
};
/**
 * @inheritDoc
 */
export declare class IdleTransactionSpanRecorder extends SpanRecorder {
    private readonly _pushActivity;
    private readonly _popActivity;
    transactionSpanId: string;
    constructor(_pushActivity: (id: string) => void, _popActivity: (id: string) => void, transactionSpanId: string, maxlen?: number);
    /**
     * @inheritDoc
     */
    add(span: Span): void;
}
export declare type BeforeFinishCallback = (transactionSpan: IdleTransaction, endTimestamp: number) => void;
/**
 * An IdleTransaction is a transaction that automatically finishes. It does this by tracking child spans as activities.
 * You can have multiple IdleTransactions active, but if the `onScope` option is specified, the idle transaction will
 * put itself on the scope on creation.
 */
export declare class IdleTransaction extends Transaction {
    private readonly _idleHub;
    /**
     * The time to wait in ms until the idle transaction will be finished. This timer is started each time
     * there are no active spans on this transaction.
     */
    private readonly _idleTimeout;
    /**
     * The final value in ms that a transaction cannot exceed
     */
    private readonly _finalTimeout;
    private readonly _heartbeatInterval;
    private readonly _onScope;
    activities: Record<string, boolean>;
    private _prevHeartbeatString;
    private _heartbeatCounter;
    private _finished;
    private _idleTimeoutCanceledPermanently;
    private readonly _beforeFinishCallbacks;
    /**
     * Timer that tracks Transaction idleTimeout
     */
    private _idleTimeoutID;
    private _finishReason;
    constructor(transactionContext: TransactionContext, _idleHub: Hub, 
    /**
     * The time to wait in ms until the idle transaction will be finished. This timer is started each time
     * there are no active spans on this transaction.
     */
    _idleTimeout?: number, 
    /**
     * The final value in ms that a transaction cannot exceed
     */
    _finalTimeout?: number, _heartbeatInterval?: number, _onScope?: boolean);
    /** {@inheritDoc} */
    finish(endTimestamp?: number): string | undefined;
    /**
     * Register a callback function that gets excecuted before the transaction finishes.
     * Useful for cleanup or if you want to add any additional spans based on current context.
     *
     * This is exposed because users have no other way of running something before an idle transaction
     * finishes.
     */
    registerBeforeFinishCallback(callback: BeforeFinishCallback): void;
    /**
     * @inheritDoc
     */
    initSpanRecorder(maxlen?: number): void;
    /**
     * Cancels the existing idle timeout, if there is one.
     * @param restartOnChildSpanChange Default is `true`.
     *                                 If set to false the transaction will end
     *                                 with the last child span.
     */
    cancelIdleTimeout(endTimestamp?: Parameters<IdleTransaction['finish']>[0], { restartOnChildSpanChange, }?: {
        restartOnChildSpanChange?: boolean;
    }): void;
    /**
     * Temporary method used to externally set the transaction's `finishReason`
     *
     * ** WARNING**
     * This is for the purpose of experimentation only and will be removed in the near future, do not use!
     *
     * @internal
     *
     */
    setFinishReason(reason: string): void;
    /**
     * Restarts idle timeout, if there is no running idle timeout it will start one.
     */
    private _restartIdleTimeout;
    /**
     * Start tracking a specific activity.
     * @param spanId The span id that represents the activity
     */
    private _pushActivity;
    /**
     * Remove an activity from usage
     * @param spanId The span id that represents the activity
     */
    private _popActivity;
    /**
     * Checks when entries of this.activities are not changing for 3 beats.
     * If this occurs we finish the transaction.
     */
    private _beat;
    /**
     * Pings the heartbeat
     */
    private _pingHeartbeat;
}
//# sourceMappingURL=idletransaction.d.ts.map{"version":3,"file":"idletransaction.d.ts","sourceRoot":"","sources":["../../../src/tracing/idletransaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC;AAaF;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,YAAY;IAEzD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IACtB,iBAAiB,EAAE,MAAM;gBAFf,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EACnC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,EAC5C,iBAAiB,EAAE,MAAM,EAChC,MAAM,CAAC,EAAE,MAAM;IAKjB;;OAEG;IACI,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;CAkB7B;AAED,oBAAY,oBAAoB,GAAG,CAAC,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;AAEpG;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IA2B5C,OAAO,CAAC,QAAQ,CAAC,QA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;;;OAGG;IACH,OAAO,CAAC,aAAa;IAOrB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAqBpB;;;OAGG;IACH,OAAO,CAAC,KAAK;IA0Bb;;OAEG;IACH,OAAO,CAAC,cAAc;CAMvB"}export { startIdleTransaction, addTracingExtensions } from './hubextensions';
export { IdleTransaction, TRACING_DEFAULTS } from './idletransaction';
export { Span, spanStatusfromHttpCode } from './span';
export { Transaction } from './transaction';
export { extractTraceparentData, getActiveTransaction } from './utils';
export { SpanStatus } from './spanstatus';
export type { SpanStatusType } from './span';
export { trace } from './trace';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}import type { Instrumenter, Primitive, Span as SpanInterface, SpanContext, TraceContext, Transaction } from '@sentry/types';
/**
 * Keeps track of finished spans for a given transaction
 * @internal
 * @hideconstructor
 * @hidden
 */
export declare class SpanRecorder {
    spans: Span[];
    private readonly _maxlen;
    constructor(maxlen?: number);
    /**
     * This is just so that we don't run out of memory while recording a lot
     * of spans. At some point we just stop and flush out the start of the
     * trace tree (i.e.the first n spans with the smallest
     * start_timestamp).
     */
    add(span: Span): void;
}
/**
 * Span contains all data about a span
 */
export declare class Span implements SpanInterface {
    /**
     * @inheritDoc
     */
    traceId: string;
    /**
     * @inheritDoc
     */
    spanId: string;
    /**
     * @inheritDoc
     */
    parentSpanId?: string;
    /**
     * Internal keeper of the status
     */
    status?: SpanStatusType | string;
    /**
     * @inheritDoc
     */
    sampled?: boolean;
    /**
     * Timestamp in seconds when the span was created.
     */
    startTimestamp: number;
    /**
     * Timestamp in seconds when the span ended.
     */
    endTimestamp?: number;
    /**
     * @inheritDoc
     */
    op?: string;
    /**
     * @inheritDoc
     */
    description?: string;
    /**
     * @inheritDoc
     */
    tags: {
        [key: string]: Primitive;
    };
    /**
     * @inheritDoc
     */
    data: {
        [key: string]: any;
    };
    /**
     * List of spans that were finalized
     */
    spanRecorder?: SpanRecorder;
    /**
     * @inheritDoc
     */
    transaction?: Transaction;
    /**
     * The instrumenter that created this span.
     */
    instrumenter: Instrumenter;
    /**
     * You should never call the constructor manually, always use `Sentry.startTransaction()`
     * or call `startChild()` on an existing span.
     * @internal
     * @hideconstructor
     * @hidden
     */
    constructor(spanContext?: SpanContext);
    /**
     * @inheritDoc
     */
    startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
    /**
     * @inheritDoc
     */
    setTag(key: string, value: Primitive): this;
    /**
     * @inheritDoc
     */
    setData(key: string, value: any): this;
    /**
     * @inheritDoc
     */
    setStatus(value: SpanStatusType): this;
    /**
     * @inheritDoc
     */
    setHttpStatus(httpStatus: number): this;
    /**
     * @inheritDoc
     */
    isSuccess(): boolean;
    /**
     * @inheritDoc
     */
    finish(endTimestamp?: number): void;
    /**
     * @inheritDoc
     */
    toTraceparent(): string;
    /**
     * @inheritDoc
     */
    toContext(): SpanContext;
    /**
     * @inheritDoc
     */
    updateWithContext(spanContext: SpanContext): this;
    /**
     * @inheritDoc
     */
    getTraceContext(): TraceContext;
    /**
     * @inheritDoc
     */
    toJSON(): {
        data?: {
            [key: string]: any;
        };
        description?: string;
        op?: string;
        parent_span_id?: string;
        span_id: string;
        start_timestamp: number;
        status?: string;
        tags?: {
            [key: string]: Primitive;
        };
        timestamp?: number;
        trace_id: string;
    };
}
export declare type SpanStatusType = 
/** The operation completed successfully. */
'ok'
/** Deadline expired before operation could complete. */
 | 'deadline_exceeded'
/** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
 | 'unauthenticated'
/** 403 Forbidden */
 | 'permission_denied'
/** 404 Not Found. Some requested entity (file or directory) was not found. */
 | 'not_found'
/** 429 Too Many Requests */
 | 'resource_exhausted'
/** Client specified an invalid argument. 4xx. */
 | 'invalid_argument'
/** 501 Not Implemented */
 | 'unimplemented'
/** 503 Service Unavailable */
 | 'unavailable'
/** Other/generic 5xx. */
 | 'internal_error'
/** Unknown. Any non-standard HTTP status code. */
 | 'unknown_error'
/** The operation was cancelled (typically by the user). */
 | 'cancelled'
/** Already exists (409) */
 | 'already_exists'
/** Operation was rejected because the system is not in a state required for the operation's */
 | 'failed_precondition'
/** The operation was aborted, typically due to a concurrency issue. */
 | 'aborted'
/** Operation was attempted past the valid range. */
 | 'out_of_range'
/** Unrecoverable data loss or corruption */
 | 'data_loss';
/**
 * Converts a HTTP status code into a {@link SpanStatusType}.
 *
 * @param httpStatus The HTTP response status code.
 * @returns The span status or unknown_error.
 */
export declare function spanStatusfromHttpCode(httpStatus: number): SpanStatusType;
//# sourceMappingURL=span.d.ts.map{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../../src/tracing/span.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,IAAI,IAAI,aAAa,EACrB,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,eAAe,CAAC;AAGvB;;;;;GAKG;AACH,qBAAa,YAAY;IAChB,KAAK,EAAE,IAAI,EAAE,CAAM;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAEd,MAAM,GAAE,MAAa;IAIxC;;;;;OAKG;IACI,GAAG,CAAC,IAAI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b,2BAA2B;GACzB,gBAAgB;AAClB,+FAA+F;GAC7F,qBAAqB;AACvB,uEAAuE;GACrE,SAAS;AACX,oDAAoD;GAClD,cAAc;AAChB,4CAA4C;GAC1C,WAAW,CAAC;AAEhB;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,cAAc,CAsCzE"}/** The status of an Span.
 *
 * @deprecated Use string literals - if you require type casting, cast to SpanStatusType type
 */
export declare enum SpanStatus {
    /** The operation completed successfully. */
    Ok = "ok",
    /** Deadline expired before operation could complete. */
    DeadlineExceeded = "deadline_exceeded",
    /** 401 Unauthorized (actually does mean unauthenticated according to RFC 7235) */
    Unauthenticated = "unauthenticated",
    /** 403 Forbidden */
    PermissionDenied = "permission_denied",
    /** 404 Not Found. Some requested entity (file or directory) was not found. */
    NotFound = "not_found",
    /** 429 Too Many Requests */
    ResourceExhausted = "resource_exhausted",
    /** Client specified an invalid argument. 4xx. */
    InvalidArgument = "invalid_argument",
    /** 501 Not Implemented */
    Unimplemented = "unimplemented",
    /** 503 Service Unavailable */
    Unavailable = "unavailable",
    /** Other/generic 5xx. */
    InternalError = "internal_error",
    /** Unknown. Any non-standard HTTP status code. */
    UnknownError = "unknown_error",
    /** The operation was cancelled (typically by the user). */
    Cancelled = "cancelled",
    /** Already exists (409) */
    AlreadyExists = "already_exists",
    /** Operation was rejected because the system is not in a state required for the operation's */
    FailedPrecondition = "failed_precondition",
    /** The operation was aborted, typically due to a concurrency issue. */
    Aborted = "aborted",
    /** Operation was attempted past the valid range. */
    OutOfRange = "out_of_range",
    /** Unrecoverable data loss or corruption */
    DataLoss = "data_loss"
}
//# sourceMappingURL=spanstatus.d.ts.map{"version":3,"file":"spanstatus.d.ts","sourceRoot":"","sources":["../../../src/tracing/spanstatus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,UAAU;IACpB,4CAA4C;IAC5C,EAAE,OAAO;IACT,wDAAwD;IACxD,gBAAgB,sBAAsB;IACtC,kFAAkF;IAClF,eAAe,oBAAoB;IACnC,oBAAoB;IACpB,gBAAgB,sBAAsB;IACtC,8EAA8E;IAC9E,QAAQ,cAAc;IACtB,4BAA4B;IAC5B,iBAAiB,uBAAuB;IACxC,iDAAiD;IACjD,eAAe,qBAAqB;IACpC,0BAA0B;IAC1B,aAAa,kBAAkB;IAC/B,8BAA8B;IAC9B,WAAW,gBAAgB;IAC3B,yBAAyB;IACzB,aAAa,mBAAmB;IAChC,kDAAkD;IAClD,YAAY,kBAAkB;IAC9B,2DAA2D;IAC3D,SAAS,cAAc;IACvB,2BAA2B;IAC3B,aAAa,mBAAmB;IAChC,+FAA+F;IAC/F,kBAAkB,wBAAwB;IAC1C,uEAAuE;IACvE,OAAO,YAAY;IACnB,oDAAoD;IACpD,UAAU,iBAAiB;IAC3B,4CAA4C;IAC5C,QAAQ,cAAc;CACvB"}import type { TransactionContext } from '@sentry/types';
import type { Span } from './span';
/**
 * Wraps a function with a transaction/span and finishes the span after the function is done.
 *
 * Note that if you have not enabled tracing extensions via `addTracingExtensions`, this function
 * will not generate spans, and the `span` returned from the callback may be undefined.
 *
 * This function is meant to be used internally and may break at any time. Use at your own risk.
 *
 * @internal
 * @private
 */
export declare function trace<T>(context: TransactionContext, callback: (span?: Span) => T, onError?: (error: unknown) => void): T;
//# sourceMappingURL=trace.d.ts.map{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/tracing/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,EACrB,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,CAAC,EAE5B,OAAO,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAe,GAC3C,CAAC,CA6CH"}import type { Context, DynamicSamplingContext, MeasurementUnit, Transaction as TransactionInterface, TransactionContext, TransactionMetadata } from '@sentry/types';
import type { Hub } from '../hub';
import { Span as SpanClass } from './span';
/** JSDoc */
export declare class Transaction extends SpanClass implements TransactionInterface {
    metadata: TransactionMetadata;
    /**
     * The reference to the current hub.
     */
    _hub: Hub;
    private _name;
    private _measurements;
    private _contexts;
    private _trimEnd?;
    private _frozenDynamicSamplingContext;
    /**
     * This constructor should never be called manually. Those instrumenting tracing should use
     * `Sentry.startTransaction()`, and internal methods should use `hub.startTransaction()`.
     * @internal
     * @hideconstructor
     * @hidden
     */
    constructor(transactionContext: TransactionContext, hub?: Hub);
    /** Getter for `name` property */
    get name(): string;
    /** Setter for `name` property, which also sets `source` as custom */
    set name(newName: string);
    /**
     * JSDoc
     */
    setName(name: string, source?: TransactionMetadata['source']): void;
    /**
     * Attaches SpanRecorder to the span itself
     * @param maxlen maximum number of spans that can be recorded
     */
    initSpanRecorder(maxlen?: number): void;
    /**
     * @inheritDoc
     */
    setContext(key: string, context: Context | null): void;
    /**
     * @inheritDoc
     */
    setMeasurement(name: string, value: number, unit?: MeasurementUnit): void;
    /**
     * @inheritDoc
     */
    setMetadata(newMetadata: Partial<TransactionMetadata>): void;
    /**
     * @inheritDoc
     */
    finish(endTimestamp?: number): string | undefined;
    /**
     * @inheritDoc
     */
    toContext(): TransactionContext;
    /**
     * @inheritDoc
     */
    updateWithContext(transactionContext: TransactionContext): this;
    /**
     * @inheritdoc
     *
     * @experimental
     */
    getDynamicSamplingContext(): Readonly<Partial<DynamicSamplingContext>>;
    /**
     * Override the current hub with a new one.
     * Used if you want another hub to finish the transaction.
     *
     * @internal
     */
    setHub(hub: Hub): void;
}
//# sourceMappingURL=transaction.d.ts.map{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/tracing/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAEP,sBAAsB,EAGtB,eAAe,EACf,WAAW,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;;OAEG;IACI,SAAS,IAAI,kBAAkB;IAUtC;;OAEG;IACI,iBAAiB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAUtE;;;;OAIG;IACI,yBAAyB,IAAI,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAyC7E;;;;;OAKG;IACI,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI;CAG9B"}import type { Transaction } from '@sentry/types';
import type { Hub } from '../hub';
/**
 * The `extractTraceparentData` function and `TRACEPARENT_REGEXP` constant used
 * to be declared in this file. It was later moved into `@sentry/utils` as part of a
 * move to remove `@sentry/tracing` dependencies from `@sentry/node` (`extractTraceparentData`
 * is the only tracing function used by `@sentry/node`).
 *
 * These exports are kept here for backwards compatability's sake.
 *
 * TODO(v7): Reorganize these exports
 *
 * See https://github.com/getsentry/sentry-javascript/issues/4642 for more details.
 */
export { TRACEPARENT_REGEXP, extractTraceparentData } from '@sentry/utils';
/** Grabs active transaction off scope, if any */
export declare function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined;
export { stripUrlQueryAndFragment } from '@sentry/utils';
//# sourceMappingURL=utils.d.ts.map{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tracing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAGlC;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAE3E,iDAAiD;AACjD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,SAAS,CAIzF;AAGD,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC"}import type { InternalBaseTransportOptions, Transport, TransportMakeRequestResponse, TransportRequestExecutor } from '@sentry/types';
import type { PromiseBuffer } from '@sentry/utils';
export declare const DEFAULT_TRANSPORT_BUFFER_SIZE = 30;
/**
 * Creates an instance of a Sentry `Transport`
 *
 * @param options
 * @param makeRequest
 */
export declare function createTransport(options: InternalBaseTransportOptions, makeRequest: TransportRequestExecutor, buffer?: PromiseBuffer<void | TransportMakeRequestResponse>): Transport;
//# sourceMappingURL=base.d.ts.map{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/transports/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAOV,4BAA4B,EAC5B,SAAS,EACT,4BAA4B,EAC5B,wBAAwB,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,eAAe,CAAC;AAc/D,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,4BAA4B,EACrC,WAAW,EAAE,wBAAwB,EACrC,MAAM,GAAE,aAAa,CAAC,IAAI,GAAG,4BAA4B,CAExD,GACA,SAAS,CAyEX"}import type { Envelope, InternalBaseTransportOptions, Transport } from '@sentry/types';
export declare const MIN_DELAY = 100;
export declare const START_DELAY = 5000;
export interface OfflineStore {
    insert(env: Envelope): Promise<void>;
    pop(): Promise<Envelope | undefined>;
}
export declare type CreateOfflineStore = (options: OfflineTransportOptions) => OfflineStore;
export interface OfflineTransportOptions extends InternalBaseTransportOptions {
    /**
     * A function that creates the offline store instance.
     */
    createStore?: CreateOfflineStore;
    /**
     * Flush the offline store shortly after startup.
     *
     * Defaults: false
     */
    flushAtStartup?: boolean;
    /**
     * Called before an event is stored.
     *
     * Return false to drop the envelope rather than store it.
     *
     * @param envelope The envelope that failed to send.
     * @param error The error that occurred.
     * @param retryDelay The current retry delay in milliseconds.
     */
    shouldStore?: (envelope: Envelope, error: Error, retryDelay: number) => boolean | Promise<boolean>;
}
/**
 * Wraps a transport and stores and retries events when they fail to send.
 *
 * @param createTransport The transport to wrap.
 */
export declare function makeOfflineTransport<TO>(createTransport: (options: TO) => Transport): (options: TO & OfflineTransportOptions) => Transport;
//# sourceMappingURL=offline.d.ts.map{"version":3,"file":"offline.d.ts","sourceRoot":"","sources":["../../../src/transports/offline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,4BAA4B,EAAE,SAAS,EAAgC,MAAM,eAAe,CAAC;AAGrH,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,WAAW,OAAQ,CAAC;AAOjC,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,IAAI,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;CACtC;AAED,oBAAY,kBAAkB,GAAG,CAAC,OAAO,EAAE,uBAAuB,KAAK,YAAY,CAAC;AAEpF,MAAM,WAAW,uBAAwB,SAAQ,4BAA4B;IAC3E;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAEjC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpG;AAID;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EACrC,eAAe,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,SAAS,GAC1C,CAAC,OAAO,EAAE,EAAE,GAAG,uBAAuB,KAAK,SAAS,CAqGtD"}import type { Options } from '@sentry/types';
/**
 * Determines if tracing is currently enabled.
 *
 * Tracing is enabled when at least one of `tracesSampleRate` and `tracesSampler` is defined in the SDK config.
 */
export declare function hasTracingEnabled(maybeOptions?: Pick<Options, 'tracesSampleRate' | 'tracesSampler' | 'enableTracing'> | undefined): boolean;
//# sourceMappingURL=hasTracingEnabled.d.ts.map{"version":3,"file":"hasTracingEnabled.d.ts","sourceRoot":"","sources":["../../../src/utils/hasTracingEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAO7C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,kBAAkB,GAAG,eAAe,GAAG,eAAe,CAAC,GAAG,SAAS,GAC/F,OAAO,CAQT"}import type { ClientOptions, Event, EventHint, StackParser } from '@sentry/types';
import { Scope } from '../scope';
/**
 * Adds common information to events.
 *
 * The information includes release and environment from `options`,
 * breadcrumbs and context (extra, tags and user) from the scope.
 *
 * Information that is already present in the event is never overwritten. For
 * nested objects, such as the context, keys are merged.
 *
 * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.
 *
 * @param event The original event.
 * @param hint May contain additional information about the original exception.
 * @param scope A scope containing event metadata.
 * @returns A new event with more information.
 * @hidden
 */
export declare function prepareEvent(options: ClientOptions, event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
/**
 * Applies debug metadata images to the event in order to apply source maps by looking up their debug ID.
 */
export declare function applyDebugMetadata(event: Event, stackParser: StackParser): void;
//# sourceMappingURL=prepareEvent.d.ts.map{"version":3,"file":"prepareEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/prepareEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAc,WAAW,EAAE,MAAM,eAAe,CAAC;AAI9F,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,KAAK,GACZ,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,CAsD3B;AAwCD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAkE/E"}export declare const SDK_VERSION = "7.48.0";
//# sourceMappingURL=version.d.ts.map{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,WAAW,CAAC"}# Changelog

## Unreleased

## 4.5.0
- feat: Update to [v7.48.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.48.0) of JavaScript SDKs
  (#662)
- fix: IPC protocol should be registered as secure (#664)

## 4.4.0

- feat: Update to [v7.46.0](https://github.com/getsentry/sentry-javascript/releases/tag/7.46.0) of JavaScript SDKs (#657)

## 4.3.0

- fix: Add 2 second timeout to session flushing (#644)
- feat: Update dependencies (#640)
- feat: Update Sentry SDKs to 7.37.1 (#636)
- fix: Replay should be re-exported (#633)

## 4.2.0

- feat: Update JavaScript SDKs to 7.30.0 and add support for Replay in renderers (#618)
- feat: Use a transport to send events to main process rather than via integration (#610)
- test: Add test to ensure window titles don't end up in breadcrumbs when disabled (#594)
- fix: Use POST for main process ping so it does not result in fetch breadcrumb (#612)
- CI: Use volta-cli/action to use the correct node version (#609)
- CI: Auto-generate PRs for JavaScript SDK updates (#608)

## 4.1.2

- fix: Ensure the scope writes do not beat the initial async scope read (#593)
- fix: Also check crashpad pending directory on macOS when renderer process exits (#592)

## 4.1.1

- feat: Add additional options and queue status callback to offline transport (#580)
- fix: Change parameter name to give more useful TypeScript error on SDK version mismatch (#584)
- fix: Attempt to send minidumps for all process gone reasons (#586)

## 4.1.0

- feat: Support passing JavaScript framework specific SDK init as second init parameter (#575)
- feat: Update JavaScript SDKs to 7.15.0 (#572)
- fix: Include `sentry_key` in IPC Ping URL so it does not create breadcrumbs (#576)

## 4.0.3

- fix: `ElectronMainOptions` type should be a union with `NodeOptions`

## 4.0.2

This patch contains no changes. It has been made to make sure the `4.x` set of versions have the `latest` tag on npm.

## 4.0.1

- fix: Page titles in breadcrumbs should not change (#551)
- feat: Update to v7.12.1 of JavaScript SDKs (#548)
- fix: Pass attachments from renderer to main (#536)

## 4.0.0

Updating the underlying Sentry JavaScript SDK's to v7 forces a major version bump due to minor breaking changes in user
facing APIs. Be sure to check out the [migration doc](./MIGRATION.md).

Upgrading to v7.8.1 of the Sentry JavaScript SDKs (#471 and #527):

- Minor internal changes due to API changes and deprecations
- Rewrite transports to use new functional API
- Simplify minidump submission since the underlying SDK now supports attachments

Other additions and fixes:

- feat: Add ability to explicitly control offline mode (#489)
- feat: Allow closing of SDK (#467)
- feat: Optionally attach screenshots (#510)
  - **Disabled by default - Screenshots may contain PII**
- fix: Ensure environment is overridden for minidumps (#497)
- fix: Pass correct event to beforeSend (#481)
- fix: Correctly parse mixed Chrome/node stack traces in the renderer (#509)
- fix: Check for absolute paths for preload scripts (#516)
- fix: Allow async `beforeSend` in offline transport (#514)

## 4.0.0-beta.1

Upgrading to v7 of the Sentry JavaScript SDKs (#471):

- Minor internal changes due to API changes and deprecations
- Rewrite transports to use new functional API
- Simplify minidump submission since the underlying SDK now supports attachments

Other additions and fixes:

- feat: Add ability to explicitly control offline mode (#489)
- feat: Allow closing of SDK (#467)
- feat: Optionally attach screenshots (#510)
  - **Disabled by default - Screenshots may contain PII**
- fix: Ensure environment is overridden for minidumps (#497)
- fix: Pass correct event to beforeSend (#481)
- fix: Correctly parse mixed Chrome/node stack traces in the renderer (#509)

## 3.0.7

- fix: export map and sideEffects (#464)
- fix: Don't capture window titles by default (#463)
- fix: Don't throw on HTTP errors (#458)
- fix: Throw error if main process code is loaded in renderer (#457)
- fix: Don't exit if preventDefault used in will-quit event (#451)

## 3.0.6

- fix: Update Sentry SDKs to `6.19.2`
- fix: Make `getSessions` and `ipcMode` on `ElectronMainOptions` optional (#448)
- fix: Webpack issue with `electron-react-boilerplate` (#446)

## 3.0.5

- fix: Limit retryDelay to avoid integer overflows in setTimeout (#441)

## 3.0.5

- fix: Issue where transport errors can prevent app exit

## 3.0.4

- fix: Use esModuleInterop for deepmerge (#432)
- fix: Lazily initialise IPC in renderer (#428)

## 3.0.3

- fix: Don't add empty breadcrumbs (#425)
- fix: Delete sdk metadata from event before sending (#424)
- fix: Improve error messages for incorrectly bundled code (#423)

## 3.0.2

- fix: Fix broken serialization of node transaction spans (#419)

## 3.0.1

- fix: Fixes a potential issue on macOS where the window URL is not accessible after crash (#417)

## 3.0.0

A large refactor and simplification of the SDK moving most of the functionality into integrations used with
`@sentry/browser` and `@sentry/node`.

- Session tracking data sent by default. See our
  [release health docs for more details](https://docs.sentry.io/product/releases/health/). You can opt out of this
  behaviour by setting `autoSessionTracking: false` during SDK initialization.
- Performance monitoring of renderer instances using the `BrowserTracing` integration from `@sentry/tracing`
- Preload script no longer required [for most scenarios](https://github.com/getsentry/sentry-electron/issues/376)
- Optional relative imports for main/renderer/preload entry points to help with bundlers
- Offline support for the default transport
- Additional device context (cpu, screen, memory, language details)
- Minidumps for GPU crashes

Major breaking changes:

- See [`MIGRATION.md`](./MIGRATION.md)

## 3.0.0-beta.4

- feat: Adds `ElectronOfflineNetTransport` and makes it the default transport
- feat: Adds `AdditionalContext` integration that includes additional device and enables it by default (#390)
- feat: Renames `ElectronEvents ` to `ElectronBreadcrumbs` and allows more complex configuration
- fix: Fixes bundling of preload code (#396)
- feat: Adds breadcrumbs and tracing for the Electron `net` module (#395)
- feat: Breadcrumbs and events for child processes (#398)
- feat: Capture minidumps for GPU crashes with `SentryMinidump` integration (#398)

## 3.0.0-beta.3

- fix: Enable CORS for custom protocol

## 3.0.0-beta.2

- fix: Correctly handle previously crashed/abnormal sessions (#379)
- feat: Remove the need for preload script in most cases by falling back to custom protocol (#377)
- fix: Fix issues with incorrect environment (#378)
- test: Refactor tests and examples into self contained apps (#373)
- fix: Fixed a number of issues with incorrect context (#373)

## 3.0.0-beta.1

Check out [the migration guide](https://github.com/getsentry/sentry-electron/issues/370).

New Features:

- Session tracking enabled by default
- Improved bundler support
- Browser Tracing compatible

Breaking changes:

- Preload script now required
- Native crashes now consider `sampleRate` and `beforeSend`
- Configuration through integrations rather than options

## 2.5.4

- fix: Improve compatibility with bundlers

## 2.5.3

- fix: Possible race condition with `initialScope` over IPC

## 2.5.2

- fix: Add `release` and `environment` to electron uploader `initialScope`

## 2.5.1

- feat: Context and breadcrumbs sent via Crashpad for native crashes in main process when `useCrashpadMinidumpUploader`
  enabled
- fix: Handle net response error event

## 2.5.0

- feat: Update to latest Sentry SDKs (6.7.1) (#332 + #342)
- fix: IPC breadcrumb serialization issue (#330)
- fix: Improve error text when `init` has not been called in the main process (#222)
- fix: Ensure `maxBreadcrumbs` is passed to `addBreadcrumb` to ensure number of breadcrumbs is limited
- fix: Stop capturing `app.remote-` events to breadcrumbs because they are too verbose
- fix: Delete Crashpad metadata file to fix errors (#341)
- feat: Add `initialScope` to `globalExtra` (#340)
- fix: Correctly handle Breakpad multipart dmp format (#343)

## 2.4.1

- fix: Missing scope updates from isolated renderer (#322)
- fix: Limit IPC serialization depth to 50 (#263)
- fix: Check for require with typeof (#319)

## 2.4.0

- feat: Add support for Electron 12

## 2.3.0

- feat: Support for `contextIsolation` (#280)

## 2.2.0

- feat: Do not start crash reporter in renderer (#290)

## 2.1.0

- feat: Compress minidump uploads (#286)

## 2.0.4

- fix: Remember stored scope & bump dependencies (#274)

## 2.0.3

- ref: Don't call `beforeSend` for internal minidump (#273)

## 2.0.2

- fix: Add guard for phantom event (#271)

## 2.0.1

- fix: The default version is now correctly sent with an `@` seperator e.g: `name@version` (#260)
- fix: Set `compress: true` for crash reporter (#260)

## 2.0.0

**Breaking Change**: This version uses the [envelope endpoint](https://develop.sentry.dev/sdk/envelopes/). If you are
using an on-premise installation it requires Sentry version `>= v20.6.0` to work. If you are using
[sentry.io](https://sentry.io) nothing will change and no action is needed.

- ref: Decrease bundle size by removing dependencies (#252)
- ref: Use envelope endpoint (#252)
- feat: Export NetTransport (#252)
- feat: Export `flush` & `close` (#252)
- feat: Bump `@sentry/*` `~5.21.1`
- feat: Bump `typescript` `3.9.7`

## v1.5.2

- fix: Cirular refs (#253)

## v1.5.1

- fix: Rate limit status check (#251)

## v1.5.0

- fix: Add `tslib` dependency
- feat: Bump `@sentry/*` `~5.19.1`
- feat: Provide `esm` build for better treeshakeability

## v1.4.0

- feat: Add rate limiting to net transport (#245)
- fix: Expose `browser` & `module` field in `package.json` for bundlers (#241)
- feat: Bump `@sentry/*` `~5.19.1`
- fix: Don't persist scope data across starts (#242)
- feat: New options `useCrashpadMinidumpUploader` and `useSentryMinidumpUploader` (#244)

## v1.4.0-beta.0

- fix: Expose `browser` & `module` field in `package.json` for bundlers (#241)

## v1.3.2

- fix: Create error object in case we cant detect it (#240)

## v1.3.1

- fix: Add test for electron.net module (#235)
- fix: getCrashesDirectory is documented as API now (#234)
- fix: check if contents is destroyed before hooking for breadcrumbs (#230)
- perf: dont double serialize IPC messages (#232)

## v1.3.0

- feat: Bump `@sentry/*` `~5.13.2`

## v1.2.1

- Add Support for Electron 8

## v1.2.0

- meta: Update dependencies
- fix: Fixed location for win-ca write path
- feat: Allow usage without remote module
- ref: Use electron-fetch again
- fix: Add try/catch for decode

## v1.1.0

- meta: Update dependencies
- feat: Support electron 7

## v1.1.0-beta.0

- meta: Update dependencies
- fix: Use crashpad logic for Electron >= v6 on Windows
- fix: Use node-fetch rather than electron-fetch
- feat: Use win-ca to load Windows root CA's to give same behaviour as electron-fetch
- meta: Use Sentry logger to trace some caught exceptions

## v1.0.0

A lot of internal changes making use of the latest `5.x` relesase of the Browser/Node SDK.

**Breaking**: We persist scope data to disk in case of a native crash. Since the internal scope data changed, existing
scope data is not compatible with the new format. When upgrading to `1.x.x`, existing scope data will be wiped on disk.
This only affects your app if the update occurs immediately after a crash, in which case this single event will not have
scope data attached.

- Feat: Bump `@sentry/*` `~5.7.1`

## v0.17.4

- meta: Empty release for latest npm tag

## v0.17.3

- Fix: Remove `webpack:/` part of base path in normalize

## v0.17.2

- Fix: Add `device.family` and `browser.name` context
- Fix: `undefined` event_id #171

## v0.17.1

- Fix electron-fetch dependency/ fixing windows crash reports #165

## v0.17.0

- Add new option to define the renderer name: `getRendererName?(contents: Electron.WebContents): string | undefined;`
- Fixed a bug where native crashes wouldn't be sent.
- Trim all whitespaces from release.

## v0.16.0

- Bump deps to use `@sentry/*` `4.6.2 || ~4.6.4`
- Escape base path (#153)
- Only show dialog if there are no uncaughtException handlers (#147)

## v0.15.0

- Bump deps to use `@sentry/*` `~4.5.0`
- Remove dynamic app name loading from package.json for release name. Release now only is the version number of the app.

## v0.14.0

- Bump deps to use `@sentry/*` `~4.3.4`
- Fixed #139

## v0.13.0

- Bump deps to use `@sentry/*` `~4.2.3`
- Fixed #131
- Fixed #132

## v0.12.1

- Bump deps to use `@sentry/utils` `~4.1.1`
- Bump deps to use `@sentry/types` `~4.1.0`

## v0.12.0

- Bump deps to use `@sentry/*` `~4.1.1`
- Move `normalizeEvent` to `prepareEvent`
- Fix `unresponsive` electron event

## v0.11.0

- Expose `showReportDialog`

**Breaking Changes**:

- Removed `getCurrentFrontend()` function, you can achieve the same with `getCurrentHub().getClient()`

## v0.10.1

- Fix exports, `withScope` is now available

## v0.10.0

- Updated deps to use `@sentry/*` `^4.0.0`

## v0.9.0

- Updated deps to use `@sentry/*` `4.0.0-rc.1`
- Fixed #109
- Fixes #106
- Fixes #94
- `captureMessage` now accepts `level` as a second parameter.

## v0.8.1

- Updated deps to use `@sentry/*` `4.0.0-beta.12`

## v0.8.0

- Updated deps to use `@sentry/*` `4.0.0-beta.11`
- Send new SDK identifier `sentry.javascript.electron`
- Expose `getIntegrations()` to retrieve all Integrations

## v0.7.0

**Breaking Changes**:

- We no longer exit your app by default. Before `0.7.0` we would call `process.exit(1)` after we caught and uncaught
  error. As of version `0.7.0` we no longer change electrons default behavior which is showing a dialog with the error
  and keep the app alive. If you want to exit the app or do something else if a global uncaught error happens you have
  to set the `onFatalError` option in init like (we will send the error to Sentry before this is called):

  ```javascript
  init({
    dsn: 'DSN',
    onFatalError: (error) => {
      // I really want to crash
      process.exit(1);
    },
  });
  ```

## v0.6.0

**Breaking Changes**:

- We removed `set___Context` functions, now you can configure the context with:

```
Sentry.configureScope(scope => {
  scope.setExtra('battery', 0.7);
  scope.setTag('user_mode', 'admin');
  scope.setUser({ id: '4711' });
  // scope.clear();
});
```

## v0.5.5

- Add official support for sandbox mode (#84)
- Fix Webpack use and add instructions to documentation (#84)
- Fix detection of Linux distributions (#80)

## v0.5.4

- Support Windows proxy configuration (#76)
- Invoke `shouldSend`, `beforeSend` and `afterSend` for native crashes (#78)
- Improve the SDK structure and reduce load times in renderers (#78)

## v0.5.3

- Add breadcrumbs for renderer crashes (#71)

## v0.5.2

- Fix a startup error in Electron 1.7 and earlier (#66)
- Disable native crash handling in MAS builds (#67)

## v0.5.1

- Added default values for `release` and `environment`
- Added an `event_type` tag to distinguish native from javascript errors
- Send runtime information along with events: Electron, Chrome and Node versions
- Send app meta data, such as the application name and version

## v0.5.0

**Breaking Changes**:

- All functions like `captureException` are now direct named exports
- Most functions are now sync, and the async ones take a callback parameter
- The SDK is now initialized via `init()` (was `create` before)

See the readme for full usage instructions, as well as the
[@sentry/next tracking issue](https://github.com/getsentry/raven-js/issues/1281) for details on this change.

**Other Changes**:

- Set the default number of breadcrumbs to `30`
- Fix an issue with paths containing spaces

## v0.4.2

- Fix adding breadcrumbs in the renderer process
- Fix setting context in the renderer process
- Fix a crash during startup when trying to load breadcrumbs
- Handle `onFatalError` correctly

## v0.4.1

- Support for JavaScript errors and native crashes (Electron `CrashReporter`)
- Record breadcrumbs and context information across renderers and the main process
- Device and event information is included in every event
- Buffer crash reports and events as long as the device is offline
export * from './ipc';
export * from './normalize';
export * from './merge';
export * from './mode';
export * from './process';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./ipc"), exports);
tslib_1.__exportStar(require("./normalize"), exports);
tslib_1.__exportStar(require("./merge"), exports);
tslib_1.__exportStar(require("./mode"), exports);
tslib_1.__exportStar(require("./process"), exports);
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/common/index.ts"],"names":[],"mappings":";;AAAA,gDAAsB;AACtB,sDAA4B;AAC5B,kDAAwB;AACxB,iDAAuB;AACvB,oDAA0B","sourcesContent":["export * from './ipc';\nexport * from './normalize';\nexport * from './merge';\nexport * from './mode';\nexport * from './process';\n"]}export declare const PROTOCOL_SCHEME = "sentry-ipc";
export declare enum IPCChannel {
    /** IPC to check main process is listening */
    PING = "sentry-electron.ping",
    /** IPC to send a captured event to Sentry. */
    EVENT = "sentry-electron.event",
    /** IPC to pass scope changes to main process. */
    SCOPE = "sentry-electron.scope",
    /** IPC to pass envelopes to the main process. */
    ENVELOPE = "sentry-electron.envelope"
}
export interface IPCInterface {
    sendScope: (scope: string) => void;
    sendEvent: (event: string) => void;
    sendEnvelope: (evn: Uint8Array | string) => void;
}
/**
 * We store the IPC interface on window so it's the same for both regular and isolated contexts
 */
declare global {
    interface Window {
        __SENTRY_IPC__?: IPCInterface;
        __SENTRY__RENDERER_INIT__?: boolean;
    }
}
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../src/common/ipc.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,oBAAY,UAAU;IACpB,6CAA6C;IAC7C,IAAI,yBAAyB;IAC7B,8CAA8C;IAC9C,KAAK,0BAA0B;IAC/B,iDAAiD;IACjD,KAAK,0BAA0B;IAC/B,iDAAiD;IACjD,QAAQ,6BAA6B;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,CAAC,EAAE,YAAY,CAAC;QAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC;CACF"}Object.defineProperty(exports, "__esModule", { value: true });
exports.IPCChannel = exports.PROTOCOL_SCHEME = void 0;
exports.PROTOCOL_SCHEME = 'sentry-ipc';
var IPCChannel;
(function (IPCChannel) {
    /** IPC to check main process is listening */
    IPCChannel["PING"] = "sentry-electron.ping";
    /** IPC to send a captured event to Sentry. */
    IPCChannel["EVENT"] = "sentry-electron.event";
    /** IPC to pass scope changes to main process. */
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    /** IPC to pass envelopes to the main process. */
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel = exports.IPCChannel || (exports.IPCChannel = {}));
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../src/common/ipc.ts"],"names":[],"mappings":";;AAAa,QAAA,eAAe,GAAG,YAAY,CAAC;AAE5C,IAAY,UASX;AATD,WAAY,UAAU;IACpB,6CAA6C;IAC7C,2CAA6B,CAAA;IAC7B,8CAA8C;IAC9C,6CAA+B,CAAA;IAC/B,iDAAiD;IACjD,6CAA+B,CAAA;IAC/B,iDAAiD;IACjD,mDAAqC,CAAA;AACvC,CAAC,EATW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QASrB","sourcesContent":["export const PROTOCOL_SCHEME = 'sentry-ipc';\n\nexport enum IPCChannel {\n  /** IPC to check main process is listening */\n  PING = 'sentry-electron.ping',\n  /** IPC to send a captured event to Sentry. */\n  EVENT = 'sentry-electron.event',\n  /** IPC to pass scope changes to main process. */\n  SCOPE = 'sentry-electron.scope',\n  /** IPC to pass envelopes to the main process. */\n  ENVELOPE = 'sentry-electron.envelope',\n}\n\nexport interface IPCInterface {\n  sendScope: (scope: string) => void;\n  sendEvent: (event: string) => void;\n  sendEnvelope: (evn: Uint8Array | string) => void;\n}\n\n/**\n * We store the IPC interface on window so it's the same for both regular and isolated contexts\n */\ndeclare global {\n  interface Window {\n    __SENTRY_IPC__?: IPCInterface;\n    __SENTRY__RENDERER_INIT__?: boolean;\n  }\n}\n"]}import { Event } from '@sentry/types';
/** Merges Events with defaults */
export declare function mergeEvents(defaults: Event, event: Event): Event;
//# sourceMappingURL=merge.d.ts.map{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../src/common/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAYtC,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAsBhE"}Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeEvents = void 0;
const tslib_1 = require("tslib");
const deepmerge_1 = tslib_1.__importDefault(require("deepmerge"));
/** Removes private properties from event before merging */
function removePrivateProperties(event) {
    for (const span of event.spans || []) {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        delete span.spanRecorder;
        delete span.transaction;
    }
}
/** Merges Events with defaults */
function mergeEvents(defaults, event) {
    removePrivateProperties(event);
    const newEvent = (0, deepmerge_1.default)(defaults, event);
    // We need to copy spans across manually
    //
    // Spans contain a custom toJSON function for serialization and without
    // this they are serialised with camelCase properties rather than the
    // snake_case required by the Sentry API.
    if (event.spans || defaults.spans) {
        newEvent.spans = event.spans || defaults.spans;
    }
    // We don't want packages array in sdk to get merged with duplicates
    return Object.assign(Object.assign({}, newEvent), { sdk: Object.assign(Object.assign({}, defaults.sdk), event.sdk) });
}
exports.mergeEvents = mergeEvents;
//# sourceMappingURL=merge.js.map{"version":3,"file":"merge.js","sourceRoot":"","sources":["../src/common/merge.ts"],"names":[],"mappings":";;;AACA,kEAAkC;AAElC,2DAA2D;AAC3D,SAAS,uBAAuB,CAAC,KAAY;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;QACpC,sEAAsE;QACtE,OAAQ,IAAY,CAAC,YAAY,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC;KACzB;AACH,CAAC;AAED,kCAAkC;AAClC,SAAgB,WAAW,CAAC,QAAe,EAAE,KAAY;IACvD,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,QAAQ,GAAU,IAAA,mBAAS,EAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEnD,wCAAwC;IACxC,EAAE;IACF,uEAAuE;IACvE,qEAAqE;IACrE,yCAAyC;IACzC,IAAI,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAE;QACjC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC;KAChD;IAED,oEAAoE;IACpE,uCACK,QAAQ,KACX,GAAG,kCACE,QAAQ,CAAC,GAAG,GACZ,KAAK,CAAC,GAAG,KAEd;AACJ,CAAC;AAtBD,kCAsBC","sourcesContent":["import { Event } from '@sentry/types';\nimport deepMerge from 'deepmerge';\n\n/** Removes private properties from event before merging */\nfunction removePrivateProperties(event: Event): void {\n  for (const span of event.spans || []) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    delete (span as any).spanRecorder;\n    delete span.transaction;\n  }\n}\n\n/** Merges Events with defaults */\nexport function mergeEvents(defaults: Event, event: Event): Event {\n  removePrivateProperties(event);\n\n  const newEvent: Event = deepMerge(defaults, event);\n\n  // We need to copy spans across manually\n  //\n  // Spans contain a custom toJSON function for serialization and without\n  // this they are serialised with camelCase properties rather than the\n  // snake_case required by the Sentry API.\n  if (event.spans || defaults.spans) {\n    newEvent.spans = event.spans || defaults.spans;\n  }\n\n  // We don't want packages array in sdk to get merged with duplicates\n  return {\n    ...newEvent,\n    sdk: {\n      ...defaults.sdk,\n      ...event.sdk,\n    },\n  };\n}\n"]}/** Ways to communicate between the renderer and main process  */
export declare enum IPCMode {
    /** Configures Electron IPC to receive messages from renderers */
    Classic = 1,
    /** Configures Electron protocol module to receive messages from renderers */
    Protocol = 2,
    /**
     * Configures both methods for best compatibility.
     *
     * Renderers favour IPC but fall back to protocol if IPC has not
     * been configured in a preload script
     */
    Both = 3
}
//# sourceMappingURL=mode.d.ts.map{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../src/common/mode.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,OAAO;IACjB,iEAAiE;IACjE,OAAO,IAAI;IACX,6EAA6E;IAC7E,QAAQ,IAAI;IACZ;;;;;OAKG;IACH,IAAI,IAAI;CACT"}Object.defineProperty(exports, "__esModule", { value: true });
exports.IPCMode = void 0;
/** Ways to communicate between the renderer and main process  */
var IPCMode;
(function (IPCMode) {
    /** Configures Electron IPC to receive messages from renderers */
    IPCMode[IPCMode["Classic"] = 1] = "Classic";
    /** Configures Electron protocol module to receive messages from renderers */
    IPCMode[IPCMode["Protocol"] = 2] = "Protocol";
    /**
     * Configures both methods for best compatibility.
     *
     * Renderers favour IPC but fall back to protocol if IPC has not
     * been configured in a preload script
     */
    IPCMode[IPCMode["Both"] = 3] = "Both";
})(IPCMode = exports.IPCMode || (exports.IPCMode = {}));
//# sourceMappingURL=mode.js.map{"version":3,"file":"mode.js","sourceRoot":"","sources":["../src/common/mode.ts"],"names":[],"mappings":";;AAAA,iEAAiE;AACjE,IAAY,OAYX;AAZD,WAAY,OAAO;IACjB,iEAAiE;IACjE,2CAAW,CAAA;IACX,6EAA6E;IAC7E,6CAAY,CAAA;IACZ;;;;;OAKG;IACH,qCAAQ,CAAA;AACV,CAAC,EAZW,OAAO,GAAP,eAAO,KAAP,eAAO,QAYlB","sourcesContent":["/** Ways to communicate between the renderer and main process  */\nexport enum IPCMode {\n  /** Configures Electron IPC to receive messages from renderers */\n  Classic = 1,\n  /** Configures Electron protocol module to receive messages from renderers */\n  Protocol = 2,\n  /**\n   * Configures both methods for best compatibility.\n   *\n   * Renderers favour IPC but fall back to protocol if IPC has not\n   * been configured in a preload script\n   */\n  Both = 3,\n}\n"]}/** An async mutex that queues up tasks for a shared resource */
export declare class Mutex {
    private _entries;
    private _waiters;
    private _value;
    /** Run a task when all pending tasks are complete */
    runExclusive<T>(task: () => Promise<T> | T): Promise<T>;
    /** Gets a promise that resolves when all pending tasks are complete */
    private _acquire;
    /** Releases after a task is complete */
    private _release;
    /** Dispatches pending tasks */
    private _dispatch;
    /** Creates a new releaser */
    private _newReleaser;
    /** Drain unlock waiters */
    private _drainUnlockWaiters;
}
//# sourceMappingURL=mutex.d.ts.map{"version":3,"file":"mutex.d.ts","sourceRoot":"","sources":["../src/common/mutex.ts"],"names":[],"mappings":"AAmCA,gEAAgE;AAChE,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,MAAM,CAAa;IAE3B,qDAAqD;IACxC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAUpE,uEAAuE;IACvE,OAAO,CAAC,QAAQ;IAQhB,wCAAwC;IACxC,OAAO,CAAC,QAAQ;IAKhB,+BAA+B;IAC/B,OAAO,CAAC,SAAS;IAcjB,6BAA6B;IAC7B,OAAO,CAAC,YAAY;IAWpB,2BAA2B;IAC3B,OAAO,CAAC,mBAAmB;CAQ5B"}// This code was originally copied from  https://github.com/DirtyHairy/async-mutex
// before being significantly simplified for our usage
//
// Copied at commit: 3d2d987e60799d0fa222f1df8f99fc90ed570bfd
// Original licence:
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mutex = void 0;
const tslib_1 = require("tslib");
/** An async mutex that queues up tasks for a shared resource */
class Mutex {
    constructor() {
        this._entries = [];
        this._waiters = [];
        this._value = 1;
    }
    /** Run a task when all pending tasks are complete */
    runExclusive(task) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const release = yield this._acquire();
            try {
                return yield task();
            }
            finally {
                release();
            }
        });
    }
    /** Gets a promise that resolves when all pending tasks are complete */
    _acquire() {
        return new Promise((resolve, reject) => {
            this._entries.push({ resolve, reject });
            this._dispatch();
        });
    }
    /** Releases after a task is complete */
    _release() {
        this._value += 1;
        this._dispatch();
    }
    /** Dispatches pending tasks */
    _dispatch() {
        var _a;
        for (let weight = this._value; weight > 0; weight--) {
            const queueEntry = (_a = this._entries) === null || _a === void 0 ? void 0 : _a.shift();
            if (!queueEntry)
                continue;
            this._value -= weight;
            weight = this._value + 1;
            queueEntry.resolve(this._newReleaser());
        }
        this._drainUnlockWaiters();
    }
    /** Creates a new releaser */
    _newReleaser() {
        let called = false;
        return () => {
            if (called)
                return;
            called = true;
            this._release();
        };
    }
    /** Drain unlock waiters */
    _drainUnlockWaiters() {
        for (let weight = this._value; weight > 0; weight--) {
            if (!this._waiters[weight - 1])
                continue;
            this._waiters.forEach((waiter) => waiter());
            this._waiters = [];
        }
    }
}
exports.Mutex = Mutex;
//# sourceMappingURL=mutex.js.map{"version":3,"file":"mutex.js","sourceRoot":"","sources":["../src/common/mutex.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,sDAAsD;AACtD,EAAE;AACF,6DAA6D;AAC7D,oBAAoB;;;;AA+BpB,gEAAgE;AAChE,MAAa,KAAK;IAAlB;QACU,aAAQ,GAAsB,EAAE,CAAC;QACjC,aAAQ,GAAoB,EAAE,CAAC;QAC/B,WAAM,GAAW,CAAC,CAAC;IAgE7B,CAAC;IA9DC,qDAAqD;IACxC,YAAY,CAAI,IAA0B;;YACrD,MAAM,OAAO,GAAG,MAAM,IAAI,CA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AC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;YACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;gBAAE,SAAS;YAEzC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;IACH,CAAC;CACF;AAnED,sBAmEC","sourcesContent":["// This code was originally copied from  https://github.com/DirtyHairy/async-mutex\n// before being significantly simplified for our usage\n//\n// Copied at commit: 3d2d987e60799d0fa222f1df8f99fc90ed570bfd\n// Original licence:\n\n// The MIT License (MIT)\n//\n// Copyright (c) 2016 Christian Speckner <cnspeckn@googlemail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\ntype Releaser = () => void;\n\ninterface QueueEntry {\n  resolve(result: Releaser): void;\n  reject(error: unknown): void;\n}\n\n/** An async mutex that queues up tasks for a shared resource */\nexport class Mutex {\n  private _entries: Array<QueueEntry> = [];\n  private _waiters: Array<Releaser> = [];\n  private _value: number = 1;\n\n  /** Run a task when all pending tasks are complete */\n  public async runExclusive<T>(task: () => Promise<T> | T): Promise<T> {\n    const release = await this._acquire();\n\n    try {\n      return await task();\n    } finally {\n      release();\n    }\n  }\n\n  /** Gets a promise that resolves when all pending tasks are complete */\n  private _acquire(): Promise<Releaser> {\n    return new Promise((resolve, reject) => {\n      this._entries.push({ resolve, reject });\n\n      this._dispatch();\n    });\n  }\n\n  /** Releases after a task is complete */\n  private _release(): void {\n    this._value += 1;\n    this._dispatch();\n  }\n\n  /** Dispatches pending tasks */\n  private _dispatch(): void {\n    for (let weight = this._value; weight > 0; weight--) {\n      const queueEntry = this._entries?.shift();\n      if (!queueEntry) continue;\n\n      this._value -= weight;\n      weight = this._value + 1;\n\n      queueEntry.resolve(this._newReleaser());\n    }\n\n    this._drainUnlockWaiters();\n  }\n\n  /** Creates a new releaser */\n  private _newReleaser(): Releaser {\n    let called = false;\n\n    return () => {\n      if (called) return;\n      called = true;\n\n      this._release();\n    };\n  }\n\n  /** Drain unlock waiters */\n  private _drainUnlockWaiters(): void {\n    for (let weight = this._value; weight > 0; weight--) {\n      if (!this._waiters[weight - 1]) continue;\n\n      this._waiters.forEach((waiter) => waiter());\n      this._waiters = [];\n    }\n  }\n}\n"]}import { Envelope, Event } from '@sentry/types';
/**
 * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint
 * across platforms.
 *
 * @param url The URL to be normalized.
 * @param basePath The application base path.
 * @returns The normalized URL.
 */
export declare function normalizeUrl(url: string, basePath: string): string;
/**
 * Normalizes all URLs in an event. See {@link normalizeUrl} for more
 * information. Mutates the passed in event.
 *
 * @param event The event to normalize.
 */
export declare function normalizeEvent(event: Event, basePath: string): Event;
/** Normalizes URLs in any replay_event items found in an envelope */
export declare function normalizeUrlsInReplayEnvelope(envelope: Envelope, basePath: string): Envelope;
//# sourceMappingURL=normalize.d.ts.map{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/common/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AAG7D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBlE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAyCpE;AAED,qEAAqE;AACrE,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAyB5F"}Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeUrlsInReplayEnvelope = exports.normalizeEvent = exports.normalizeUrl = void 0;
const utils_1 = require("@sentry/utils");
/**
 * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint
 * across platforms.
 *
 * @param url The URL to be normalized.
 * @param basePath The application base path.
 * @returns The normalized URL.
 */
function normalizeUrl(url, basePath) {
    const escapedBase = basePath
        // Backslash to forward
        .replace(/\\/g, '/')
        // Escape RegExp special characters
        .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
    let newUrl = url;
    try {
        newUrl = decodeURI(url);
    }
    catch (_Oo) {
        // Sometime this breaks
    }
    return newUrl
        .replace(/\\/g, '/')
        .replace(/webpack:\/?/g, '') // Remove intermediate base path
        .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///');
}
exports.normalizeUrl = normalizeUrl;
/**
 * Normalizes all URLs in an event. See {@link normalizeUrl} for more
 * information. Mutates the passed in event.
 *
 * @param event The event to normalize.
 */
function normalizeEvent(event, basePath) {
    var _a, _b;
    // Retrieve stack traces and normalize their paths. Without this, grouping
    // would not work due to usernames in file paths.
    for (const exception of ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || []) {
        for (const frame of ((_b = exception.stacktrace) === null || _b === void 0 ? void 0 : _b.frames) || []) {
            if (frame.filename) {
                frame.filename = normalizeUrl(frame.filename, basePath);
            }
        }
    }
    if (event.transaction) {
        event.transaction = normalizeUrl(event.transaction, basePath);
    }
    const { request = {} } = event;
    if (request.url) {
        request.url = normalizeUrl(request.url, basePath);
    }
    event.contexts = Object.assign(Object.assign({}, event.contexts), { runtime: {
            name: 'Electron',
            version: process.versions.electron,
        } });
    // The user agent is parsed by Sentry and would overwrite certain context
    // information, which we don't want. Generally remove it, since we know that
    // we are browsing with Chrome.
    if (request.headers) {
        delete request.headers['User-Agent'];
    }
    // The Node SDK includes server_name, which contains the machine name of the computer running Electron.
    // In this case this is likely to include PII.
    const { tags = {} } = event;
    delete tags.server_name;
    delete event.server_name;
    return event;
}
exports.normalizeEvent = normalizeEvent;
/** Normalizes URLs in any replay_event items found in an envelope */
function normalizeUrlsInReplayEnvelope(envelope, basePath) {
    let modifiedEnvelope = (0, utils_1.createEnvelope)(envelope[0]);
    let isReplay = false;
    (0, utils_1.forEachEnvelopeItem)(envelope, (item, type) => {
        var _a;
        if (type === 'replay_event') {
            isReplay = true;
            const [headers, event] = item;
            if (Array.isArray(event.urls)) {
                event.urls = event.urls.map((url) => normalizeUrl(url, basePath));
            }
            if ((_a = event === null || event === void 0 ? void 0 : event.request) === null || _a === void 0 ? void 0 : _a.url) {
                event.request.url = normalizeUrl(event.request.url, basePath);
            }
            modifiedEnvelope = (0, utils_1.addItemToEnvelope)(modifiedEnvelope, [headers, event]);
        }
        else if (type === 'replay_recording') {
            modifiedEnvelope = (0, utils_1.addItemToEnvelope)(modifiedEnvelope, item);
        }
    });
    return isReplay ? modifiedEnvelope : envelope;
}
exports.normalizeUrlsInReplayEnvelope = normalizeUrlsInReplayEnvelope;
//# sourceMappingURL=normalize.js.map{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../src/common/normalize.ts"],"names":[],"mappings":";;AACA,yCAAuF;AAEvF;;;;;;;GAOG;AACH,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KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,GAAG,EAAE;gBACvB,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;aAC/D;YAED,gBAAgB,GAAG,IAAA,yBAAiB,EAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SAC1E;aAAM,IAAI,IAAI,KAAK,kBAAkB,EAAE;YACtC,gBAAgB,GAAG,IAAA,yBAAiB,EAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;SAC9D;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChD,CAAC;AAzBD,sEAyBC","sourcesContent":["import { Envelope, Event, ReplayEvent } from '@sentry/types';\nimport { addItemToEnvelope, createEnvelope, forEachEnvelopeItem } from '@sentry/utils';\n\n/**\n * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint\n * across platforms.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nexport function normalizeUrl(url: string, basePath: string): string {\n  const escapedBase = basePath\n    // Backslash to forward\n    .replace(/\\\\/g, '/')\n    // Escape RegExp special characters\n    .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n  let newUrl = url;\n  try {\n    newUrl = decodeURI(url);\n  } catch (_Oo) {\n    // Sometime this breaks\n  }\n  return newUrl\n    .replace(/\\\\/g, '/')\n    .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n    .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///');\n}\n\n/**\n * Normalizes all URLs in an event. See {@link normalizeUrl} for more\n * information. Mutates the passed in event.\n *\n * @param event The event to normalize.\n */\nexport function normalizeEvent(event: Event, basePath: string): Event {\n  // Retrieve stack traces and normalize their paths. Without this, grouping\n  // would not work due to usernames in file paths.\n  for (const exception of event.exception?.values || []) {\n    for (const frame of exception.stacktrace?.frames || []) {\n      if (frame.filename) {\n        frame.filename = normalizeUrl(frame.filename, basePath);\n      }\n    }\n  }\n\n  if (event.transaction) {\n    event.transaction = normalizeUrl(event.transaction, basePath);\n  }\n\n  const { request = {} } = event;\n  if (request.url) {\n    request.url = normalizeUrl(request.url, basePath);\n  }\n\n  event.contexts = {\n    ...event.contexts,\n    runtime: {\n      name: 'Electron',\n      version: process.versions.electron,\n    },\n  };\n\n  // The user agent is parsed by Sentry and would overwrite certain context\n  // information, which we don't want. Generally remove it, since we know that\n  // we are browsing with Chrome.\n  if (request.headers) {\n    delete request.headers['User-Agent'];\n  }\n\n  // The Node SDK includes server_name, which contains the machine name of the computer running Electron.\n  // In this case this is likely to include PII.\n  const { tags = {} } = event;\n  delete tags.server_name;\n  delete event.server_name;\n  return event;\n}\n\n/** Normalizes URLs in any replay_event items found in an envelope */\nexport function normalizeUrlsInReplayEnvelope(envelope: Envelope, basePath: string): Envelope {\n  let modifiedEnvelope = createEnvelope(envelope[0]);\n\n  let isReplay = false;\n\n  forEachEnvelopeItem(envelope, (item, type) => {\n    if (type === 'replay_event') {\n      isReplay = true;\n      const [headers, event] = item as [{ type: 'replay_event' }, ReplayEvent];\n\n      if (Array.isArray(event.urls)) {\n        event.urls = event.urls.map((url) => normalizeUrl(url, basePath));\n      }\n\n      if (event?.request?.url) {\n        event.request.url = normalizeUrl(event.request.url, basePath);\n      }\n\n      modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, [headers, event]);\n    } else if (type === 'replay_recording') {\n      modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, item);\n    }\n  });\n\n  return isReplay ? modifiedEnvelope : envelope;\n}\n"]}/** Checks that code is running in the correct process */
export declare function ensureProcess(expected: 'main' | 'renderer'): void;
//# sourceMappingURL=process.d.ts.map{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../src/common/process.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAWjE"}Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureProcess = void 0;
/** Checks that code is running in the correct process */
function ensureProcess(expected) {
    // eslint-disable-next-line no-restricted-globals
    const current = typeof window !== 'undefined' ? 'renderer' : 'main';
    if (current !== expected) {
        throw new Error(`This code is intended to run in the Electron ${expected} process but is currently running in the ${current} process.
This can occur if a bundler picks the wrong entry point.

You can work around this by using a relative import:
import * as Sentry from '@sentry/electron/${current}';`);
    }
}
exports.ensureProcess = ensureProcess;
//# sourceMappingURL=process.js.map{"version":3,"file":"process.js","sourceRoot":"","sources":["../src/common/process.ts"],"names":[],"mappings":";;AAAA,yDAAyD;AACzD,SAAgB,aAAa,CAAC,QAA6B;IACzD,iDAAiD;IACjD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;IAEpE,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,gDAAgD,QAAQ,4CAA4C,OAAO;;;;4CAInF,OAAO,IAAI,CAAC,CAAC;KACtD;AACH,CAAC;AAXD,sCAWC","sourcesContent":["/** Checks that code is running in the correct process */\nexport function ensureProcess(expected: 'main' | 'renderer'): void {\n  // eslint-disable-next-line no-restricted-globals\n  const current = typeof window !== 'undefined' ? 'renderer' : 'main';\n\n  if (current !== expected) {\n    throw new Error(`This code is intended to run in the Electron ${expected} process but is currently running in the ${current} process.\nThis can occur if a bundler picks the wrong entry point.\n\nYou can work around this by using a relative import:\nimport * as Sentry from '@sentry/electron/${current}';`);\n  }\n}\n"]}export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type OrBool<T> = {
    [P in keyof T]: T[P] | boolean;
};
export type OrFalse<T> = {
    [P in keyof T]: T[P] | false;
};
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;CAC/B,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;KACtB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAC7B,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/common/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type OrBool<T> = {\n  [P in keyof T]: T[P] | boolean;\n};\n\nexport type OrFalse<T> = {\n  [P in keyof T]: T[P] | false;\n};\n"]}export * from './ipc';
export * from './normalize';
export * from './merge';
export * from './mode';
export * from './process';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC"}export * from './ipc';
export * from './normalize';
export * from './merge';
export * from './mode';
export * from './process';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC","sourcesContent":["export * from './ipc';\nexport * from './normalize';\nexport * from './merge';\nexport * from './mode';\nexport * from './process';\n"]}export declare const PROTOCOL_SCHEME = "sentry-ipc";
export declare enum IPCChannel {
    /** IPC to check main process is listening */
    PING = "sentry-electron.ping",
    /** IPC to send a captured event to Sentry. */
    EVENT = "sentry-electron.event",
    /** IPC to pass scope changes to main process. */
    SCOPE = "sentry-electron.scope",
    /** IPC to pass envelopes to the main process. */
    ENVELOPE = "sentry-electron.envelope"
}
export interface IPCInterface {
    sendScope: (scope: string) => void;
    sendEvent: (event: string) => void;
    sendEnvelope: (evn: Uint8Array | string) => void;
}
/**
 * We store the IPC interface on window so it's the same for both regular and isolated contexts
 */
declare global {
    interface Window {
        __SENTRY_IPC__?: IPCInterface;
        __SENTRY__RENDERER_INIT__?: boolean;
    }
}
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../../src/common/ipc.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,eAAe,CAAC;AAE5C,oBAAY,UAAU;IACpB,6CAA6C;IAC7C,IAAI,yBAAyB;IAC7B,8CAA8C;IAC9C,KAAK,0BAA0B;IAC/B,iDAAiD;IACjD,KAAK,0BAA0B;IAC/B,iDAAiD;IACjD,QAAQ,6BAA6B;CACtC;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;CAClD;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,CAAC,EAAE,YAAY,CAAC;QAC9B,yBAAyB,CAAC,EAAE,OAAO,CAAC;KACrC;CACF"}export const PROTOCOL_SCHEME = 'sentry-ipc';
export var IPCChannel;
(function (IPCChannel) {
    /** IPC to check main process is listening */
    IPCChannel["PING"] = "sentry-electron.ping";
    /** IPC to send a captured event to Sentry. */
    IPCChannel["EVENT"] = "sentry-electron.event";
    /** IPC to pass scope changes to main process. */
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    /** IPC to pass envelopes to the main process. */
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel || (IPCChannel = {}));
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../../src/common/ipc.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAE5C,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,6CAA6C;IAC7C,2CAA6B,CAAA;IAC7B,8CAA8C;IAC9C,6CAA+B,CAAA;IAC/B,iDAAiD;IACjD,6CAA+B,CAAA;IAC/B,iDAAiD;IACjD,mDAAqC,CAAA;AACvC,CAAC,EATW,UAAU,KAAV,UAAU,QASrB","sourcesContent":["export const PROTOCOL_SCHEME = 'sentry-ipc';\n\nexport enum IPCChannel {\n  /** IPC to check main process is listening */\n  PING = 'sentry-electron.ping',\n  /** IPC to send a captured event to Sentry. */\n  EVENT = 'sentry-electron.event',\n  /** IPC to pass scope changes to main process. */\n  SCOPE = 'sentry-electron.scope',\n  /** IPC to pass envelopes to the main process. */\n  ENVELOPE = 'sentry-electron.envelope',\n}\n\nexport interface IPCInterface {\n  sendScope: (scope: string) => void;\n  sendEvent: (event: string) => void;\n  sendEnvelope: (evn: Uint8Array | string) => void;\n}\n\n/**\n * We store the IPC interface on window so it's the same for both regular and isolated contexts\n */\ndeclare global {\n  interface Window {\n    __SENTRY_IPC__?: IPCInterface;\n    __SENTRY__RENDERER_INIT__?: boolean;\n  }\n}\n"]}import { Event } from '@sentry/types';
/** Merges Events with defaults */
export declare function mergeEvents(defaults: Event, event: Event): Event;
//# sourceMappingURL=merge.d.ts.map{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/common/merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAYtC,kCAAkC;AAClC,wBAAgB,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CAsBhE"}import deepMerge from 'deepmerge';
/** Removes private properties from event before merging */
function removePrivateProperties(event) {
    for (const span of event.spans || []) {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        delete span.spanRecorder;
        delete span.transaction;
    }
}
/** Merges Events with defaults */
export function mergeEvents(defaults, event) {
    removePrivateProperties(event);
    const newEvent = deepMerge(defaults, event);
    // We need to copy spans across manually
    //
    // Spans contain a custom toJSON function for serialization and without
    // this they are serialised with camelCase properties rather than the
    // snake_case required by the Sentry API.
    if (event.spans || defaults.spans) {
        newEvent.spans = event.spans || defaults.spans;
    }
    // We don't want packages array in sdk to get merged with duplicates
    return Object.assign(Object.assign({}, newEvent), { sdk: Object.assign(Object.assign({}, defaults.sdk), event.sdk) });
}
//# sourceMappingURL=merge.js.map{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../src/common/merge.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,2DAA2D;AAC3D,SAAS,uBAAuB,CAAC,KAAY;IAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE;QACpC,sEAAsE;QACtE,OAAQ,IAAY,CAAC,YAAY,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC;KACzB;AACH,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,WAAW,CAAC,QAAe,EAAE,KAAY;IACvD,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAE/B,MAAM,QAAQ,GAAU,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEnD,wCAAwC;IACxC,EAAE;IACF,uEAAuE;IACvE,qEAAqE;IACrE,yCAAyC;IACzC,IAAI,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAE;QACjC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,CAAC;KAChD;IAED,oEAAoE;IACpE,uCACK,QAAQ,KACX,GAAG,kCACE,QAAQ,CAAC,GAAG,GACZ,KAAK,CAAC,GAAG,KAEd;AACJ,CAAC","sourcesContent":["import { Event } from '@sentry/types';\nimport deepMerge from 'deepmerge';\n\n/** Removes private properties from event before merging */\nfunction removePrivateProperties(event: Event): void {\n  for (const span of event.spans || []) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    delete (span as any).spanRecorder;\n    delete span.transaction;\n  }\n}\n\n/** Merges Events with defaults */\nexport function mergeEvents(defaults: Event, event: Event): Event {\n  removePrivateProperties(event);\n\n  const newEvent: Event = deepMerge(defaults, event);\n\n  // We need to copy spans across manually\n  //\n  // Spans contain a custom toJSON function for serialization and without\n  // this they are serialised with camelCase properties rather than the\n  // snake_case required by the Sentry API.\n  if (event.spans || defaults.spans) {\n    newEvent.spans = event.spans || defaults.spans;\n  }\n\n  // We don't want packages array in sdk to get merged with duplicates\n  return {\n    ...newEvent,\n    sdk: {\n      ...defaults.sdk,\n      ...event.sdk,\n    },\n  };\n}\n"]}/** Ways to communicate between the renderer and main process  */
export declare enum IPCMode {
    /** Configures Electron IPC to receive messages from renderers */
    Classic = 1,
    /** Configures Electron protocol module to receive messages from renderers */
    Protocol = 2,
    /**
     * Configures both methods for best compatibility.
     *
     * Renderers favour IPC but fall back to protocol if IPC has not
     * been configured in a preload script
     */
    Both = 3
}
//# sourceMappingURL=mode.d.ts.map{"version":3,"file":"mode.d.ts","sourceRoot":"","sources":["../../src/common/mode.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,OAAO;IACjB,iEAAiE;IACjE,OAAO,IAAI;IACX,6EAA6E;IAC7E,QAAQ,IAAI;IACZ;;;;;OAKG;IACH,IAAI,IAAI;CACT"}/** Ways to communicate between the renderer and main process  */
export var IPCMode;
(function (IPCMode) {
    /** Configures Electron IPC to receive messages from renderers */
    IPCMode[IPCMode["Classic"] = 1] = "Classic";
    /** Configures Electron protocol module to receive messages from renderers */
    IPCMode[IPCMode["Protocol"] = 2] = "Protocol";
    /**
     * Configures both methods for best compatibility.
     *
     * Renderers favour IPC but fall back to protocol if IPC has not
     * been configured in a preload script
     */
    IPCMode[IPCMode["Both"] = 3] = "Both";
})(IPCMode || (IPCMode = {}));
//# sourceMappingURL=mode.js.map{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../src/common/mode.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,CAAN,IAAY,OAYX;AAZD,WAAY,OAAO;IACjB,iEAAiE;IACjE,2CAAW,CAAA;IACX,6EAA6E;IAC7E,6CAAY,CAAA;IACZ;;;;;OAKG;IACH,qCAAQ,CAAA;AACV,CAAC,EAZW,OAAO,KAAP,OAAO,QAYlB","sourcesContent":["/** Ways to communicate between the renderer and main process  */\nexport enum IPCMode {\n  /** Configures Electron IPC to receive messages from renderers */\n  Classic = 1,\n  /** Configures Electron protocol module to receive messages from renderers */\n  Protocol = 2,\n  /**\n   * Configures both methods for best compatibility.\n   *\n   * Renderers favour IPC but fall back to protocol if IPC has not\n   * been configured in a preload script\n   */\n  Both = 3,\n}\n"]}/** An async mutex that queues up tasks for a shared resource */
export declare class Mutex {
    private _entries;
    private _waiters;
    private _value;
    /** Run a task when all pending tasks are complete */
    runExclusive<T>(task: () => Promise<T> | T): Promise<T>;
    /** Gets a promise that resolves when all pending tasks are complete */
    private _acquire;
    /** Releases after a task is complete */
    private _release;
    /** Dispatches pending tasks */
    private _dispatch;
    /** Creates a new releaser */
    private _newReleaser;
    /** Drain unlock waiters */
    private _drainUnlockWaiters;
}
//# sourceMappingURL=mutex.d.ts.map{"version":3,"file":"mutex.d.ts","sourceRoot":"","sources":["../../src/common/mutex.ts"],"names":[],"mappings":"AAmCA,gEAAgE;AAChE,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,MAAM,CAAa;IAE3B,qDAAqD;IACxC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAUpE,uEAAuE;IACvE,OAAO,CAAC,QAAQ;IAQhB,wCAAwC;IACxC,OAAO,CAAC,QAAQ;IAKhB,+BAA+B;IAC/B,OAAO,CAAC,SAAS;IAcjB,6BAA6B;IAC7B,OAAO,CAAC,YAAY;IAWpB,2BAA2B;IAC3B,OAAO,CAAC,mBAAmB;CAQ5B"}// This code was originally copied from  https://github.com/DirtyHairy/async-mutex
// before being significantly simplified for our usage
//
// Copied at commit: 3d2d987e60799d0fa222f1df8f99fc90ed570bfd
// Original licence:
import { __awaiter } from "tslib";
/** An async mutex that queues up tasks for a shared resource */
export class Mutex {
    constructor() {
        this._entries = [];
        this._waiters = [];
        this._value = 1;
    }
    /** Run a task when all pending tasks are complete */
    runExclusive(task) {
        return __awaiter(this, void 0, void 0, function* () {
            const release = yield this._acquire();
            try {
                return yield task();
            }
            finally {
                release();
            }
        });
    }
    /** Gets a promise that resolves when all pending tasks are complete */
    _acquire() {
        return new Promise((resolve, reject) => {
            this._entries.push({ resolve, reject });
            this._dispatch();
        });
    }
    /** Releases after a task is complete */
    _release() {
        this._value += 1;
        this._dispatch();
    }
    /** Dispatches pending tasks */
    _dispatch() {
        var _a;
        for (let weight = this._value; weight > 0; weight--) {
            const queueEntry = (_a = this._entries) === null || _a === void 0 ? void 0 : _a.shift();
            if (!queueEntry)
                continue;
            this._value -= weight;
            weight = this._value + 1;
            queueEntry.resolve(this._newReleaser());
        }
        this._drainUnlockWaiters();
    }
    /** Creates a new releaser */
    _newReleaser() {
        let called = false;
        return () => {
            if (called)
                return;
            called = true;
            this._release();
        };
    }
    /** Drain unlock waiters */
    _drainUnlockWaiters() {
        for (let weight = this._value; weight > 0; weight--) {
            if (!this._waiters[weight - 1])
                continue;
            this._waiters.forEach((waiter) => waiter());
            this._waiters = [];
        }
    }
}
//# sourceMappingURL=mutex.js.map{"version":3,"file":"mutex.js","sourceRoot":"","sources":["../../src/common/mutex.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,sDAAsD;AACtD,EAAE;AACF,6DAA6D;AAC7D,oBAAoB;;AA+BpB,gEAAgE;AAChE,MAAM,OAAO,KAAK;IAAlB;QACU,aAAQ,GAAsB,EAAE,CAAC;QACjC,aAAQ,GAAoB,EAAE,CAAC;QAC/B,WAAM,GAAW,CAAC,CAAC;IAgE7B,CAAC;IA9DC,qDAAqD;IACxC,YAAY,CAAI,IAA0B;;YACrD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;YAEtC,IAAI;gBACF,OAAO,MAAM,IAAI,EAAE,CAAC;aACrB;oBAAS;gBACR,OAAO,EAAE,CAAC;aACX;QACH,CAAC;KAAA;IAED,uEAAuE;IAC/D,QAAQ;QACd,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;YAExC,IAAI,CAAC,SAAS,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,wCAAwC;IAChC,QAAQ;QACd,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,+BAA+B;IACvB,SAAS;;QACf,KAAK,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;YACnD,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,EAAE,CAAC;YAC1C,IAAI,CAAC,UAAU;gBAAE,SAAS;YAE1B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;YAEzB,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;SACzC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED,6BAA6B;IACrB,YAAY;QAClB,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,IAAI,MAAM;gBAAE,OAAO;YACnB,MAAM,GAAG,IAAI,CAAC;YAEd,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,CAAC,CAAC;IACJ,CAAC;IAED,2BAA2B;IACnB,mBAAmB;QACzB,KAAK,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE;YACnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;gBAAE,SAAS;YAEzC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC;YAC5C,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;IACH,CAAC;CACF","sourcesContent":["// This code was originally copied from  https://github.com/DirtyHairy/async-mutex\n// before being significantly simplified for our usage\n//\n// Copied at commit: 3d2d987e60799d0fa222f1df8f99fc90ed570bfd\n// Original licence:\n\n// The MIT License (MIT)\n//\n// Copyright (c) 2016 Christian Speckner <cnspeckn@googlemail.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\ntype Releaser = () => void;\n\ninterface QueueEntry {\n  resolve(result: Releaser): void;\n  reject(error: unknown): void;\n}\n\n/** An async mutex that queues up tasks for a shared resource */\nexport class Mutex {\n  private _entries: Array<QueueEntry> = [];\n  private _waiters: Array<Releaser> = [];\n  private _value: number = 1;\n\n  /** Run a task when all pending tasks are complete */\n  public async runExclusive<T>(task: () => Promise<T> | T): Promise<T> {\n    const release = await this._acquire();\n\n    try {\n      return await task();\n    } finally {\n      release();\n    }\n  }\n\n  /** Gets a promise that resolves when all pending tasks are complete */\n  private _acquire(): Promise<Releaser> {\n    return new Promise((resolve, reject) => {\n      this._entries.push({ resolve, reject });\n\n      this._dispatch();\n    });\n  }\n\n  /** Releases after a task is complete */\n  private _release(): void {\n    this._value += 1;\n    this._dispatch();\n  }\n\n  /** Dispatches pending tasks */\n  private _dispatch(): void {\n    for (let weight = this._value; weight > 0; weight--) {\n      const queueEntry = this._entries?.shift();\n      if (!queueEntry) continue;\n\n      this._value -= weight;\n      weight = this._value + 1;\n\n      queueEntry.resolve(this._newReleaser());\n    }\n\n    this._drainUnlockWaiters();\n  }\n\n  /** Creates a new releaser */\n  private _newReleaser(): Releaser {\n    let called = false;\n\n    return () => {\n      if (called) return;\n      called = true;\n\n      this._release();\n    };\n  }\n\n  /** Drain unlock waiters */\n  private _drainUnlockWaiters(): void {\n    for (let weight = this._value; weight > 0; weight--) {\n      if (!this._waiters[weight - 1]) continue;\n\n      this._waiters.forEach((waiter) => waiter());\n      this._waiters = [];\n    }\n  }\n}\n"]}import { Envelope, Event } from '@sentry/types';
/**
 * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint
 * across platforms.
 *
 * @param url The URL to be normalized.
 * @param basePath The application base path.
 * @returns The normalized URL.
 */
export declare function normalizeUrl(url: string, basePath: string): string;
/**
 * Normalizes all URLs in an event. See {@link normalizeUrl} for more
 * information. Mutates the passed in event.
 *
 * @param event The event to normalize.
 */
export declare function normalizeEvent(event: Event, basePath: string): Event;
/** Normalizes URLs in any replay_event items found in an envelope */
export declare function normalizeUrlsInReplayEnvelope(envelope: Envelope, basePath: string): Envelope;
//# sourceMappingURL=normalize.d.ts.map{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/common/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAe,MAAM,eAAe,CAAC;AAG7D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBlE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAyCpE;AAED,qEAAqE;AACrE,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAyB5F"}import { addItemToEnvelope, createEnvelope, forEachEnvelopeItem } from '@sentry/utils';
/**
 * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint
 * across platforms.
 *
 * @param url The URL to be normalized.
 * @param basePath The application base path.
 * @returns The normalized URL.
 */
export function normalizeUrl(url, basePath) {
    const escapedBase = basePath
        // Backslash to forward
        .replace(/\\/g, '/')
        // Escape RegExp special characters
        .replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
    let newUrl = url;
    try {
        newUrl = decodeURI(url);
    }
    catch (_Oo) {
        // Sometime this breaks
    }
    return newUrl
        .replace(/\\/g, '/')
        .replace(/webpack:\/?/g, '') // Remove intermediate base path
        .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///');
}
/**
 * Normalizes all URLs in an event. See {@link normalizeUrl} for more
 * information. Mutates the passed in event.
 *
 * @param event The event to normalize.
 */
export function normalizeEvent(event, basePath) {
    var _a, _b;
    // Retrieve stack traces and normalize their paths. Without this, grouping
    // would not work due to usernames in file paths.
    for (const exception of ((_a = event.exception) === null || _a === void 0 ? void 0 : _a.values) || []) {
        for (const frame of ((_b = exception.stacktrace) === null || _b === void 0 ? void 0 : _b.frames) || []) {
            if (frame.filename) {
                frame.filename = normalizeUrl(frame.filename, basePath);
            }
        }
    }
    if (event.transaction) {
        event.transaction = normalizeUrl(event.transaction, basePath);
    }
    const { request = {} } = event;
    if (request.url) {
        request.url = normalizeUrl(request.url, basePath);
    }
    event.contexts = Object.assign(Object.assign({}, event.contexts), { runtime: {
            name: 'Electron',
            version: process.versions.electron,
        } });
    // The user agent is parsed by Sentry and would overwrite certain context
    // information, which we don't want. Generally remove it, since we know that
    // we are browsing with Chrome.
    if (request.headers) {
        delete request.headers['User-Agent'];
    }
    // The Node SDK includes server_name, which contains the machine name of the computer running Electron.
    // In this case this is likely to include PII.
    const { tags = {} } = event;
    delete tags.server_name;
    delete event.server_name;
    return event;
}
/** Normalizes URLs in any replay_event items found in an envelope */
export function normalizeUrlsInReplayEnvelope(envelope, basePath) {
    let modifiedEnvelope = createEnvelope(envelope[0]);
    let isReplay = false;
    forEachEnvelopeItem(envelope, (item, type) => {
        var _a;
        if (type === 'replay_event') {
            isReplay = true;
            const [headers, event] = item;
            if (Array.isArray(event.urls)) {
                event.urls = event.urls.map((url) => normalizeUrl(url, basePath));
            }
            if ((_a = event === null || event === void 0 ? void 0 : event.request) === null || _a === void 0 ? void 0 : _a.url) {
                event.request.url = normalizeUrl(event.request.url, basePath);
            }
            modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, [headers, event]);
        }
        else if (type === 'replay_recording') {
            modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, item);
        }
    });
    return isReplay ? modifiedEnvelope : envelope;
}
//# sourceMappingURL=normalize.js.map{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/common/normalize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEvF;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,QAAgB;IACxD,MAAM,WAAW,GAAG,QAAQ;QAC1B,uBAAuB;SACtB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;QACpB,mCAAmC;SAClC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAE1C,IAAI,MAAM,GAAG,GAAG,CAAC;IACjB,IAAI;QACF,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;KACzB;IAAC,OAAO,GAAG,EAAE;QACZ,uBAAuB;KACxB;IACD,OAAO,MAAM;SACV,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,gCAAgC;SAC5D,OAAO,CAAC,IAAI,MAAM,CAAC,eAAe,WAAW,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAY,EAAE,QAAgB;;IAC3D,0EAA0E;IAC1E,iDAAiD;IACjD,KAAK,MAAM,SAAS,IAAI,CAAA,MAAA,KAAK,CAAC,SAAS,0CAAE,MAAM,KAAI,EAAE,EAAE;QACrD,KAAK,MAAM,KAAK,IAAI,CAAA,MAAA,SAAS,CAAC,UAAU,0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;;QAC3C,IAAI,IAAI,KAAK,cAAc,EAAE;YAC3B,QAAQ,GAAG,IAAI,CAAC;YAChB,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,IAA+C,CAAC;YAEzE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;gBAC7B,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;aACnE;YAED,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,GAAG,EAAE;gBACvB,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;aAC/D;YAED,gBAAgB,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SAC1E;aAAM,IAAI,IAAI,KAAK,kBAAkB,EAAE;YACtC,gBAAgB,GAAG,iBAAiB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;SAC9D;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChD,CAAC","sourcesContent":["import { Envelope, Event, ReplayEvent } from '@sentry/types';\nimport { addItemToEnvelope, createEnvelope, forEachEnvelopeItem } from '@sentry/utils';\n\n/**\n * Normalizes URLs in exceptions and stacktraces so Sentry can fingerprint\n * across platforms.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nexport function normalizeUrl(url: string, basePath: string): string {\n  const escapedBase = basePath\n    // Backslash to forward\n    .replace(/\\\\/g, '/')\n    // Escape RegExp special characters\n    .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n  let newUrl = url;\n  try {\n    newUrl = decodeURI(url);\n  } catch (_Oo) {\n    // Sometime this breaks\n  }\n  return newUrl\n    .replace(/\\\\/g, '/')\n    .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n    .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///');\n}\n\n/**\n * Normalizes all URLs in an event. See {@link normalizeUrl} for more\n * information. Mutates the passed in event.\n *\n * @param event The event to normalize.\n */\nexport function normalizeEvent(event: Event, basePath: string): Event {\n  // Retrieve stack traces and normalize their paths. Without this, grouping\n  // would not work due to usernames in file paths.\n  for (const exception of event.exception?.values || []) {\n    for (const frame of exception.stacktrace?.frames || []) {\n      if (frame.filename) {\n        frame.filename = normalizeUrl(frame.filename, basePath);\n      }\n    }\n  }\n\n  if (event.transaction) {\n    event.transaction = normalizeUrl(event.transaction, basePath);\n  }\n\n  const { request = {} } = event;\n  if (request.url) {\n    request.url = normalizeUrl(request.url, basePath);\n  }\n\n  event.contexts = {\n    ...event.contexts,\n    runtime: {\n      name: 'Electron',\n      version: process.versions.electron,\n    },\n  };\n\n  // The user agent is parsed by Sentry and would overwrite certain context\n  // information, which we don't want. Generally remove it, since we know that\n  // we are browsing with Chrome.\n  if (request.headers) {\n    delete request.headers['User-Agent'];\n  }\n\n  // The Node SDK includes server_name, which contains the machine name of the computer running Electron.\n  // In this case this is likely to include PII.\n  const { tags = {} } = event;\n  delete tags.server_name;\n  delete event.server_name;\n  return event;\n}\n\n/** Normalizes URLs in any replay_event items found in an envelope */\nexport function normalizeUrlsInReplayEnvelope(envelope: Envelope, basePath: string): Envelope {\n  let modifiedEnvelope = createEnvelope(envelope[0]);\n\n  let isReplay = false;\n\n  forEachEnvelopeItem(envelope, (item, type) => {\n    if (type === 'replay_event') {\n      isReplay = true;\n      const [headers, event] = item as [{ type: 'replay_event' }, ReplayEvent];\n\n      if (Array.isArray(event.urls)) {\n        event.urls = event.urls.map((url) => normalizeUrl(url, basePath));\n      }\n\n      if (event?.request?.url) {\n        event.request.url = normalizeUrl(event.request.url, basePath);\n      }\n\n      modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, [headers, event]);\n    } else if (type === 'replay_recording') {\n      modifiedEnvelope = addItemToEnvelope(modifiedEnvelope, item);\n    }\n  });\n\n  return isReplay ? modifiedEnvelope : envelope;\n}\n"]}/** Checks that code is running in the correct process */
export declare function ensureProcess(expected: 'main' | 'renderer'): void;
//# sourceMappingURL=process.d.ts.map{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../src/common/process.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAWjE"}/** Checks that code is running in the correct process */
export function ensureProcess(expected) {
    // eslint-disable-next-line no-restricted-globals
    const current = typeof window !== 'undefined' ? 'renderer' : 'main';
    if (current !== expected) {
        throw new Error(`This code is intended to run in the Electron ${expected} process but is currently running in the ${current} process.
This can occur if a bundler picks the wrong entry point.

You can work around this by using a relative import:
import * as Sentry from '@sentry/electron/${current}';`);
    }
}
//# sourceMappingURL=process.js.map{"version":3,"file":"process.js","sourceRoot":"","sources":["../../src/common/process.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,QAA6B;IACzD,iDAAiD;IACjD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;IAEpE,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,gDAAgD,QAAQ,4CAA4C,OAAO;;;;4CAInF,OAAO,IAAI,CAAC,CAAC;KACtD;AACH,CAAC","sourcesContent":["/** Checks that code is running in the correct process */\nexport function ensureProcess(expected: 'main' | 'renderer'): void {\n  // eslint-disable-next-line no-restricted-globals\n  const current = typeof window !== 'undefined' ? 'renderer' : 'main';\n\n  if (current !== expected) {\n    throw new Error(`This code is intended to run in the Electron ${expected} process but is currently running in the ${current} process.\nThis can occur if a bundler picks the wrong entry point.\n\nYou can work around this by using a relative import:\nimport * as Sentry from '@sentry/electron/${current}';`);\n  }\n}\n"]}export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type OrBool<T> = {
    [P in keyof T]: T[P] | boolean;
};
export type OrFalse<T> = {
    [P in keyof T]: T[P] | false;
};
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9E,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;CAC/B,CAAC;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;KACtB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAC7B,CAAC"}export {};
//# sourceMappingURL=types.js.map{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"","sourcesContent":["export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;\n\nexport type OrBool<T> = {\n  [P in keyof T]: T[P] | boolean;\n};\n\nexport type OrFalse<T> = {\n  [P in keyof T]: T[P] | false;\n};\n"]}import { ElectronMainOptions } from './main';
import { BrowserOptions } from './renderer';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getActiveTransaction, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, trace, } from '@sentry/core';
export declare const Integrations: import("./integrations").Integrations;
export interface ElectronOptions extends ElectronMainOptions, Omit<BrowserOptions, 'transportOptions' | 'transport'> {
}
export { IPCMode } from './common';
/**
 * The Sentry Electron SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * entry modules. This applies to the main process as well as all renderer
 * processes or further sub processes you spawn. To set context information or
 * send manual events, use the provided methods.
 *
 * @example
 * const { init } = require('@sentry/electron');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 *
 * @example
 * import { configureScope } from '@sentry/electron';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTags({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 *
 * @example
 * import { addBreadcrumb } from '@sentry/electron';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 *
 * @example
 * import * as Sentry from '@sentry/electron';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 *
 * @see ElectronOptions for documentation on configuration options.
 */
export declare function init(options: Partial<ElectronOptions>): void;
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function close(timeout?: number): Promise<boolean>;
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function flush(timeout?: number): Promise<boolean>;
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,YAAY,uCAAoB,CAAC;AAG9C,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,WAAW,CAAC;CAEnH;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAuBnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAK5D;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9D;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9D"}import { __awaiter } from "tslib";
import { dynamicRequire } from '@sentry/utils';
import { getIntegrations, removeEmptyIntegrations } from './integrations';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getActiveTransaction, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, trace, } from '@sentry/core';
export const Integrations = getIntegrations();
export { IPCMode } from './common';
/** Fetches the SDK entry point for the current process */
function getEntryPoint() {
    try {
        return process.type === 'browser' ? dynamicRequire(module, './main') : require('./renderer');
    }
    catch (e) {
        throw new Error(`Failed to automatically detect correct SDK entry point.

In the Electron main process you should import via:
import * as Sentry from '@sentry/electron/main';

In the Electron renderer process you should import via:
import * as Sentry from '@sentry/electron/renderer';`);
    }
}
/**
 * The Sentry Electron SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * entry modules. This applies to the main process as well as all renderer
 * processes or further sub processes you spawn. To set context information or
 * send manual events, use the provided methods.
 *
 * @example
 * const { init } = require('@sentry/electron');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 *
 * @example
 * import { configureScope } from '@sentry/electron';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTags({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 *
 * @example
 * import { addBreadcrumb } from '@sentry/electron';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 *
 * @example
 * import * as Sentry from '@sentry/electron';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 *
 * @see ElectronOptions for documentation on configuration options.
 */
export function init(options) {
    // Filter out any EmptyIntegrations
    removeEmptyIntegrations(options);
    getEntryPoint().init(options);
}
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export function close(timeout) {
    return __awaiter(this, void 0, void 0, function* () {
        const entryPoint = getEntryPoint();
        if (entryPoint.close) {
            return entryPoint.close(timeout);
        }
        throw new Error('The Electron SDK should be closed from the main process');
    });
}
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export function flush(timeout) {
    return __awaiter(this, void 0, void 0, function* () {
        const entryPoint = getEntryPoint();
        if (entryPoint.flush) {
            return entryPoint.flush(timeout);
        }
        throw new Error('The Electron SDK should be flushed from the main process');
    });
}
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAsB1E,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,iBAA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,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAClC;QAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;CAAA","sourcesContent":["import { dynamicRequire } from '@sentry/utils';\n\nimport { getIntegrations, removeEmptyIntegrations } from './integrations';\nimport { ElectronMainOptions } from './main';\nimport { BrowserOptions } from './renderer';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getActiveTransaction,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n  trace,\n} from '@sentry/core';\n\nexport const Integrations = getIntegrations();\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ElectronOptions extends ElectronMainOptions, Omit<BrowserOptions, 'transportOptions' | 'transport'> {\n  //\n}\n\nexport { IPCMode } from './common';\n\ninterface ProcessEntryPoint {\n  init: (options: Partial<ElectronOptions>) => void;\n  close?: (timeout?: number) => Promise<boolean>;\n  flush?: (timeout?: number) => Promise<boolean>;\n}\n\n/** Fetches the SDK entry point for the current process */\nfunction getEntryPoint(): ProcessEntryPoint {\n  try {\n    return process.type === 'browser' ? dynamicRequire(module, './main') : require('./renderer');\n  } catch (e) {\n    throw new Error(`Failed to automatically detect correct SDK entry point.\n\nIn the Electron main process you should import via:\nimport * as Sentry from '@sentry/electron/main';\n\nIn the Electron renderer process you should import via:\nimport * as Sentry from '@sentry/electron/renderer';`);\n  }\n}\n\n/**\n * The Sentry Electron SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible in the\n * entry modules. This applies to the main process as well as all renderer\n * processes or further sub processes you spawn. To set context information or\n * send manual events, use the provided methods.\n *\n * @example\n * const { init } = require('@sentry/electron');\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n *\n * @example\n * import { configureScope } from '@sentry/electron';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTags({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n *\n * @example\n * import { addBreadcrumb } from '@sentry/electron';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n *\n * @example\n * import * as Sentry from '@sentry/electron';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n *\n * @see ElectronOptions for documentation on configuration options.\n */\nexport function init(options: Partial<ElectronOptions>): void {\n  // Filter out any EmptyIntegrations\n  removeEmptyIntegrations(options);\n\n  getEntryPoint().init(options);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n  const entryPoint = getEntryPoint();\n\n  if (entryPoint.close) {\n    return entryPoint.close(timeout);\n  }\n\n  throw new Error('The Electron SDK should be closed from the main process');\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n  const entryPoint = getEntryPoint();\n\n  if (entryPoint.flush) {\n    return entryPoint.flush(timeout);\n  }\n\n  throw new Error('The Electron SDK should be flushed from the main process');\n}\n"]}import { ElectronOptions } from './';
import { AdditionalContext, ChildProcess, ElectronBreadcrumbs, ElectronMinidump, MainContext, MainProcessSession, OnUncaughtException, PreloadInjection, Screenshots, SentryMinidump } from './main/integrations';
import { EventToMain, ScopeToMain } from './renderer/integrations';
/** Convenience interface used to expose Integrations */
export interface Integrations {
    SentryMinidump: SentryMinidump;
    ElectronMinidump: ElectronMinidump;
    ElectronBreadcrumbs: ElectronBreadcrumbs;
    MainContext: MainContext;
    OnUncaughtExcept: OnUncaughtException;
    PreloadInjection: PreloadInjection;
    MainProcessSession: MainProcessSession;
    AdditionalContext: AdditionalContext;
    ChildProcess: ChildProcess;
    Screenshots: Screenshots;
    ScopeToMain: ScopeToMain;
    EventToMain: EventToMain;
}
/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */
export declare function getIntegrations(): Integrations;
/** Filters out any EmptyIntegrations that are found */
export declare function removeEmptyIntegrations(options: Partial<ElectronOptions>): void;
//# sourceMappingURL=integrations.d.ts.map{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAE3B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IAEzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,IAAI,YAAY,CAsB9C;AA6BD,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAW/E"}import { dynamicRequire } from '@sentry/utils';
/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */
export function getIntegrations() {
    return process.type === 'browser'
        ? Object.assign(Object.assign({}, dynamicRequire(module, './main').Integrations), { ScopeToMain: EmptyIntegration, EventToMain: EmptyIntegration }) : Object.assign(Object.assign({}, dynamicRequire(module, './renderer').Integrations), { SentryMinidump: EmptyIntegration, ElectronMinidump: EmptyIntegration, ElectronBreadcrumbs: EmptyIntegration, MainContext: EmptyIntegration, OnUncaughtExcept: EmptyIntegration, PreloadInjection: EmptyIntegration, MainProcessSession: EmptyIntegration, AdditionalContext: EmptyIntegration, ChildProcess: EmptyIntegration, Screenshots: EmptyIntegration });
}
/**
 * The EmptyIntegration gets loaded when the requested integration cannot be used in the current Electron process
 *
 * This allows you to call the same code from both Electron processes and not have to conditionally compile
 *
 * ```
 * const { init, Integrations } = require('@sentry/electron');
 *
 * init({
 *   dsn: process.env.DSN,
 *   integrations: [new Integrations.ElectronMinidump()],
 * });
 *
 */
class EmptyIntegration {
    constructor() {
        /** @inheritDoc */
        this.name = EmptyIntegration.id;
    }
    /** @inheritDoc */
    setupOnce() {
        //
    }
}
/** @inheritDoc */
EmptyIntegration.id = 'EmptyIntegration';
/** Filters out any EmptyIntegrations that are found */
export function removeEmptyIntegrations(options) {
    if (Array.isArray(options.integrations)) {
        options.integrations = options.integrations.filter((i) => i.name !== EmptyIntegration.id);
    }
    else if (typeof options.integrations === 'function') {
        const originalFn = options.integrations;
        options.integrations = (integrations) => {
            const userIntegrations = originalFn(integrations);
            return userIntegrations.filter((integration) => integration.name !== EmptyIntegration.id);
        };
    }
}
//# sourceMappingURL=integrations.js.map{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../src/integrations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAmC/C,2GAA2G;AAC3G,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS;QAC/B,CAAC,iCAEM,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,YAAY,KAChD,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,gBAAgB,IAEjC,CAAC,iCAEM,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,YAAY,KACpD,cAAc,EAAE,gBAAgB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,gBAAgB,EACrC,WAAW,EAAE,gBAAgB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,gBAAgB,EACpC,iBAAiB,EAAE,gBAAgB,EACnC,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,gBAAgB,GAC9B,CAAC;AACR,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,gBAAgB;IAAtB;QAIE,kBAAkB;QACX,SAAI,GAAW,gBAAgB,CAAC,EAAE,CAAC;IAM5C,CAAC;IAJC,kBAAkB;IACX,SAAS;QACd,EAAE;IACJ,CAAC;;AATD,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC;AAWhD,uDAAuD;AACvD,MAAM,UAAU,uBAAuB,CAAC,OAAiC;IACvE,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,EAAE,CAAC,CAAC;KAC3F;SAAM,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;QACrD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;QAExC,OAAO,CAAC,YAAY,GAAG,CAAC,YAAY,EAAE,EAAE;YACtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;YAClD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC,CAAC;KACH;AACH,CAAC","sourcesContent":["import { Integration } from '@sentry/types';\nimport { dynamicRequire } from '@sentry/utils';\n\nimport { ElectronOptions } from './';\nimport {\n  AdditionalContext,\n  ChildProcess,\n  ElectronBreadcrumbs,\n  ElectronMinidump,\n  MainContext,\n  MainProcessSession,\n  OnUncaughtException,\n  PreloadInjection,\n  Screenshots,\n  SentryMinidump,\n} from './main/integrations';\nimport { EventToMain, ScopeToMain } from './renderer/integrations';\n\n/** Convenience interface used to expose Integrations */\nexport interface Integrations {\n  // For main process\n  SentryMinidump: SentryMinidump;\n  ElectronMinidump: ElectronMinidump;\n  ElectronBreadcrumbs: ElectronBreadcrumbs;\n  MainContext: MainContext;\n  OnUncaughtExcept: OnUncaughtException;\n  PreloadInjection: PreloadInjection;\n  MainProcessSession: MainProcessSession;\n  AdditionalContext: AdditionalContext;\n  ChildProcess: ChildProcess;\n  Screenshots: Screenshots;\n  // For renderer process\n  ScopeToMain: ScopeToMain;\n  EventToMain: EventToMain;\n}\n\n/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */\nexport function getIntegrations(): Integrations {\n  return process.type === 'browser'\n    ? {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        ...dynamicRequire(module, './main').Integrations,\n        ScopeToMain: EmptyIntegration,\n        EventToMain: EmptyIntegration,\n      }\n    : {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        ...dynamicRequire(module, './renderer').Integrations,\n        SentryMinidump: EmptyIntegration,\n        ElectronMinidump: EmptyIntegration,\n        ElectronBreadcrumbs: EmptyIntegration,\n        MainContext: EmptyIntegration,\n        OnUncaughtExcept: EmptyIntegration,\n        PreloadInjection: EmptyIntegration,\n        MainProcessSession: EmptyIntegration,\n        AdditionalContext: EmptyIntegration,\n        ChildProcess: EmptyIntegration,\n        Screenshots: EmptyIntegration,\n      };\n}\n\n/**\n * The EmptyIntegration gets loaded when the requested integration cannot be used in the current Electron process\n *\n * This allows you to call the same code from both Electron processes and not have to conditionally compile\n *\n * ```\n * const { init, Integrations } = require('@sentry/electron');\n *\n * init({\n *   dsn: process.env.DSN,\n *   integrations: [new Integrations.ElectronMinidump()],\n * });\n *\n */\nclass EmptyIntegration implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'EmptyIntegration';\n\n  /** @inheritDoc */\n  public name: string = EmptyIntegration.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    //\n  }\n}\n\n/** Filters out any EmptyIntegrations that are found */\nexport function removeEmptyIntegrations(options: Partial<ElectronOptions>): void {\n  if (Array.isArray(options.integrations)) {\n    options.integrations = options.integrations.filter((i) => i.name !== EmptyIntegration.id);\n  } else if (typeof options.integrations === 'function') {\n    const originalFn = options.integrations;\n\n    options.integrations = (integrations) => {\n      const userIntegrations = originalFn(integrations);\n      return userIntegrations.filter((integration) => integration.name !== EmptyIntegration.id);\n    };\n  }\n}\n"]}import { Event, SdkInfo } from '@sentry/types';
export declare const SDK_NAME = "sentry.javascript.electron";
/** Gets SDK info */
export declare function getSdkInfo(): SdkInfo;
/** Gets the default release name */
export declare function getDefaultReleaseName(): string;
/** Gets the default environment */
export declare function getDefaultEnvironment(): string;
/**
 * Computes and caches Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
export declare function getEventDefaults(release?: string, environment?: string): Promise<Event>;
//# sourceMappingURL=context.d.ts.map{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/main/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAUzD,eAAO,MAAM,QAAQ,+BAA+B,CAAC;AA4MrD,oBAAoB;AACpB,wBAAgB,UAAU,IAAI,OAAO,CAWpC;AAoDD,oCAAoC;AACpC,wBAAgB,qBAAqB,IAAI,MAAM,CAG9C;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AA6BD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAS7F"}import { __awaiter } from "tslib";
import * as child from 'child_process';
import { app } from 'electron';
import { platform, release } from 'os';
import { join } from 'path';
import { isPackaged } from './electron-normalize';
import { readDirAsync, readFileAsync } from './fs';
import { SDK_VERSION } from './version';
export const SDK_NAME = 'sentry.javascript.electron';
/** Mapping of Node's platform names to actual OS names. */
const PLATFORM_NAMES = {
    aix: 'IBM AIX',
    freebsd: 'FreeBSD',
    openbsd: 'OpenBSD',
    sunos: 'SunOS',
    win32: 'Windows',
};
/** Mapping of linux release files located in /etc to distributions. */
const LINUX_DISTROS = [
    { name: 'fedora-release', distros: ['Fedora'] },
    { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },
    { name: 'redhat_version', distros: ['Red Hat Linux'] },
    { name: 'SuSE-release', distros: ['SUSE Linux'] },
    { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },
    { name: 'debian_version', distros: ['Debian'] },
    { name: 'debian_release', distros: ['Debian'] },
    { name: 'arch-release', distros: ['Arch Linux'] },
    { name: 'gentoo-release', distros: ['Gentoo Linux'] },
    { name: 'novell-release', distros: ['SUSE Linux'] },
    { name: 'alpine-release', distros: ['Alpine Linux'] },
];
/** Functions to extract the OS version from Linux release files. */
const LINUX_VERSIONS = {
    alpine: (content) => content,
    arch: (content) => matchFirst(/distrib_release=(.*)/, content),
    centos: (content) => matchFirst(/release ([^ ]+)/, content),
    debian: (content) => content,
    fedora: (content) => matchFirst(/release (..)/, content),
    mint: (content) => matchFirst(/distrib_release=(.*)/, content),
    red: (content) => matchFirst(/release ([^ ]+)/, content),
    suse: (content) => matchFirst(/VERSION = (.*)\n/, content),
    ubuntu: (content) => matchFirst(/distrib_release=(.*)/, content),
};
/**
 * Executes a regular expression with one capture group.
 *
 * @param regex A regular expression to execute.
 * @param text Content to execute the RegEx on.
 * @returns The captured string if matched; otherwise undefined.
 */
function matchFirst(regex, text) {
    const match = regex.exec(text);
    return match ? match[1] : undefined;
}
/** Loads the macOS operating system context. */
function getDarwinInfo() {
    return __awaiter(this, void 0, void 0, function* () {
        // Default values that will be used in case no operating system information
        // can be loaded. The default version is computed via heuristics from the
        // kernel version, but the build ID is missing.
        const darwinInfo = {
            kernel_version: release(),
            name: 'Mac OS X',
            version: `10.${Number(release().split('.')[0]) - 4}`,
        };
        try {
            // We try to load the actual macOS version by executing the `sw_vers` tool.
            // This tool should be available on every standard macOS installation. In
            // case this fails, we stick with the values computed above.
            const output = yield new Promise((resolve, reject) => {
                child.execFile('/usr/bin/sw_vers', (error, stdout) => {
                    if (error) {
                        reject(error);
                        return;
                    }
                    resolve(stdout);
                });
            });
            darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
            darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
            darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
        }
        catch (e) {
            // ignore
        }
        return darwinInfo;
    });
}
/** Returns a distribution identifier to look up version callbacks. */
function getLinuxDistroId(name) {
    return name.split(' ')[0].toLowerCase();
}
/** Loads the Linux operating system context. */
function getLinuxInfo() {
    return __awaiter(this, void 0, void 0, function* () {
        // By default, we cannot assume anything about the distribution or Linux
        // version. `os.release()` returns the kernel version and we assume a generic
        // "Linux" name, which will be replaced down below.
        const linuxInfo = {
            kernel_version: release(),
            name: 'Linux',
        };
        try {
            // We start guessing the distribution by listing files in the /etc
            // directory. This is were most Linux distributions (except Knoppix) store
            // release files with certain distribution-dependent meta data. We search
            // for exactly one known file defined in `LINUX_DISTROS` and exit if none
            // are found. In case there are more than one file, we just stick with the
            // first one.
            const etcFiles = yield readDirAsync('/etc');
            const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name));
            if (!distroFile) {
                return linuxInfo;
            }
            // Once that file is known, load its contents. To make searching in those
            // files easier, we lowercase the file contents. Since these files are
            // usually quite small, this should not allocate too much memory and we only
            // hold on to it for a very short amount of time.
            const distroPath = join('/etc', distroFile.name);
            const contents = (yield readFileAsync(distroPath, { encoding: 'utf-8' })).toLowerCase();
            // Some Linux distributions store their release information in the same file
            // (e.g. RHEL and Centos). In those cases, we scan the file for an
            // identifier, that basically consists of the first word of the linux
            // distribution name (e.g. "red" for Red Hat). In case there is no match, we
            // just assume the first distribution in our list.
            const { distros } = distroFile;
            linuxInfo.name = distros.find((d) => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];
            // Based on the found distribution, we can now compute the actual version
            // number. This is different for every distribution, so several strategies
            // are computed in `LINUX_VERSIONS`.
            const id = getLinuxDistroId(linuxInfo.name);
            linuxInfo.version = LINUX_VERSIONS[id](contents);
        }
        catch (e) {
            // ignore
        }
        return linuxInfo;
    });
}
/**
 * Returns the operating system context.
 *
 * Based on the current platform, this uses a different strategy to provide the
 * most accurate OS information. Since this might involve spawning subprocesses
 * or accessing the file system, this should only be executed lazily and cached.
 *
 *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context
 *    has a `name`, `version`, `build` and `kernel_version` set.
 *  - On Linux, this will try to load a distribution release from `/etc` and set
 *    the `name`, `version` and `kernel_version` fields.
 *  - On all other platforms, only a `name` and `version` will be returned. Note
 *    that `version` might actually be the kernel version.
 */
function getOsContext() {
    return __awaiter(this, void 0, void 0, function* () {
        const platformId = platform();
        switch (platformId) {
            case 'darwin':
                return getDarwinInfo();
            case 'linux':
                return getLinuxInfo();
            default:
                return {
                    name: PLATFORM_NAMES[platformId] || platformId,
                    version: release(),
                };
        }
    });
}
/** Gets SDK info */
export function getSdkInfo() {
    return {
        name: SDK_NAME,
        packages: [
            {
                name: 'npm:@sentry/electron',
                version: SDK_VERSION,
            },
        ],
        version: SDK_VERSION,
    };
}
/** Gets the app context */
function getAppContext() {
    const appCtx = {
        app_name: app.name || app.getName(),
        app_version: app.getVersion(),
        app_start_time: new Date(Date.now() - process.uptime() * 1000).toISOString(),
    };
    if (process.mas) {
        appCtx.build_type = 'app-store';
    }
    if (process.windowsStore) {
        appCtx.build_type = 'windows-store';
    }
    return appCtx;
}
/** Gets the app contexts */
function getContexts() {
    return __awaiter(this, void 0, void 0, function* () {
        const contexts = {
            app: getAppContext(),
            os: (yield getOsContext()),
            browser: {
                name: 'Chrome',
            },
            chrome: {
                name: 'Chrome',
                type: 'runtime',
                version: process.versions.chrome,
            },
            device: {
                arch: process.arch,
                family: 'Desktop',
            },
            node: {
                name: 'Node',
                type: 'runtime',
                version: process.versions.node,
            },
            runtime: {
                name: 'Electron',
                version: process.versions.electron,
            },
        };
        return contexts;
    });
}
/** Gets the default release name */
export function getDefaultReleaseName() {
    const app_name = app.name || app.getName();
    return `${app_name.replace(/\W/g, '-')}@${app.getVersion()}`;
}
/** Gets the default environment */
export function getDefaultEnvironment() {
    return isPackaged ? 'production' : 'development';
}
/**
 * Computes Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
function _getEventDefaults(release, environment) {
    return __awaiter(this, void 0, void 0, function* () {
        return {
            sdk: getSdkInfo(),
            contexts: yield getContexts(),
            environment: environment || getDefaultEnvironment(),
            release: release || getDefaultReleaseName(),
            user: { ip_address: '{{auto}}' },
            tags: {
                'event.origin': 'electron',
                'event.environment': 'javascript',
                'event.process': 'browser',
                // Legacy way of filtering native vs JavaScript events
                event_type: 'javascript',
            },
        };
    });
}
/** Cached event prototype with default values. */
let cachedDefaultsPromise;
/**
 * Computes and caches Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
export function getEventDefaults(release, environment) {
    return __awaiter(this, void 0, void 0, function* () {
        // The event defaults are cached as long as the app is running. We create the
        // promise here synchronously to avoid multiple events computing them at the
        // same time.
        if (!cachedDefaultsPromise) {
            cachedDefaultsPromise = _getEventDefaults(release, environment);
        }
        return yield cachedDefaultsPromise;
    });
}
//# sourceMappingURL=context.js.map{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/main/context.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,4BAA4B,CAAC;AAkCrD,2DAA2D;AAC3D,MAAM,cAAc,GAAmC;IACrD,GAAG,EAAE,SAAS;IACd,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,SA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_process';\nimport { app } from 'electron';\nimport { platform, release } from 'os';\nimport { join } from 'path';\n\nimport { isPackaged } from './electron-normalize';\nimport { readDirAsync, readFileAsync } from './fs';\nimport { SDK_VERSION } from './version';\n\nexport const SDK_NAME = 'sentry.javascript.electron';\n\n/** App context information. */\ninterface AppContext {\n  /** The name of the app. */\n  app_name: string;\n  /** The app version. */\n  app_version: string;\n  /** app start time */\n  app_start_time: string;\n  /** app build type */\n  build_type?: string;\n}\n\n/** Operating system context information. */\ninterface OsContext {\n  /** The name of the operating system. */\n  name?: string;\n  /** The operating system version. */\n  version?: string;\n  /** Operating system specific build identifier */\n  build?: string;\n  /** Version-independent kernel version. */\n  kernel_version?: string;\n}\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n  /** The file name, located in `/etc`. */\n  name: string;\n  /** Potential distributions to check. */\n  distros: string[];\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n  aix: 'IBM AIX',\n  freebsd: 'FreeBSD',\n  openbsd: 'OpenBSD',\n  sunos: 'SunOS',\n  win32: 'Windows',\n};\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n  { name: 'fedora-release', distros: ['Fedora'] },\n  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n  { name: 'redhat_version', distros: ['Red Hat Linux'] },\n  { name: 'SuSE-release', distros: ['SUSE Linux'] },\n  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n  { name: 'debian_version', distros: ['Debian'] },\n  { name: 'debian_release', distros: ['Debian'] },\n  { name: 'arch-release', distros: ['Arch Linux'] },\n  { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n  { name: 'novell-release', distros: ['SUSE Linux'] },\n  { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n  [identifier: string]: (content: string) => string | undefined;\n} = {\n  alpine: (content) => content,\n  arch: (content) => matchFirst(/distrib_release=(.*)/, content),\n  centos: (content) => matchFirst(/release ([^ ]+)/, content),\n  debian: (content) => content,\n  fedora: (content) => matchFirst(/release (..)/, content),\n  mint: (content) => matchFirst(/distrib_release=(.*)/, content),\n  red: (content) => matchFirst(/release ([^ ]+)/, content),\n  suse: (content) => matchFirst(/VERSION = (.*)\\n/, content),\n  ubuntu: (content) => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n  const match = regex.exec(text);\n  return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n  // Default values that will be used in case no operating system information\n  // can be loaded. The default version is computed via heuristics from the\n  // kernel version, but the build ID is missing.\n  const darwinInfo: OsContext = {\n    kernel_version: release(),\n    name: 'Mac OS X',\n    version: `10.${Number(release().split('.')[0]) - 4}`,\n  };\n\n  try {\n    // We try to load the actual macOS version by executing the `sw_vers` tool.\n    // This tool should be available on every standard macOS installation. In\n    // case this fails, we stick with the values computed above.\n\n    const output = await new Promise<string>((resolve, reject) => {\n      child.execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve(stdout);\n      });\n    });\n    darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n    darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n    darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n  } catch (e) {\n    // ignore\n  }\n\n  return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n  return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n  // By default, we cannot assume anything about the distribution or Linux\n  // version. `os.release()` returns the kernel version and we assume a generic\n  // \"Linux\" name, which will be replaced down below.\n  const linuxInfo: OsContext = {\n    kernel_version: release(),\n    name: 'Linux',\n  };\n\n  try {\n    // We start guessing the distribution by listing files in the /etc\n    // directory. This is were most Linux distributions (except Knoppix) store\n    // release files with certain distribution-dependent meta data. We search\n    // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n    // are found. In case there are more than one file, we just stick with the\n    // first one.\n    const etcFiles = await readDirAsync('/etc');\n    const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name));\n    if (!distroFile) {\n      return linuxInfo;\n    }\n\n    // Once that file is known, load its contents. To make searching in those\n    // files easier, we lowercase the file contents. Since these files are\n    // usually quite small, this should not allocate too much memory and we only\n    // hold on to it for a very short amount of time.\n    const distroPath = join('/etc', distroFile.name);\n    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) as string).toLowerCase();\n\n    // Some Linux distributions store their release information in the same file\n    // (e.g. RHEL and Centos). In those cases, we scan the file for an\n    // identifier, that basically consists of the first word of the linux\n    // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n    // just assume the first distribution in our list.\n    const { distros } = distroFile;\n    linuxInfo.name = distros.find((d) => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n    // Based on the found distribution, we can now compute the actual version\n    // number. This is different for every distribution, so several strategies\n    // are computed in `LINUX_VERSIONS`.\n    const id = getLinuxDistroId(linuxInfo.name);\n    linuxInfo.version = LINUX_VERSIONS[id](contents);\n  } catch (e) {\n    // ignore\n  }\n\n  return linuxInfo;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n *    has a `name`, `version`, `build` and `kernel_version` set.\n *  - On Linux, this will try to load a distribution release from `/etc` and set\n *    the `name`, `version` and `kernel_version` fields.\n *  - On all other platforms, only a `name` and `version` will be returned. Note\n *    that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n  const platformId = platform();\n  switch (platformId) {\n    case 'darwin':\n      return getDarwinInfo();\n    case 'linux':\n      return getLinuxInfo();\n    default:\n      return {\n        name: PLATFORM_NAMES[platformId] || platformId,\n        version: release(),\n      };\n  }\n}\n\n/** Gets SDK info */\nexport function getSdkInfo(): SdkInfo {\n  return {\n    name: SDK_NAME,\n    packages: [\n      {\n        name: 'npm:@sentry/electron',\n        version: SDK_VERSION,\n      },\n    ],\n    version: SDK_VERSION,\n  };\n}\n\n/** Gets the app context */\nfunction getAppContext(): AppContext {\n  const appCtx: AppContext = {\n    app_name: app.name || app.getName(),\n    app_version: app.getVersion(),\n    app_start_time: new Date(Date.now() - process.uptime() * 1_000).toISOString(),\n  };\n\n  if (process.mas) {\n    appCtx.build_type = 'app-store';\n  }\n\n  if (process.windowsStore) {\n    appCtx.build_type = 'windows-store';\n  }\n\n  return appCtx;\n}\n\n/** Gets the app contexts */\nasync function getContexts(): Promise<Contexts> {\n  const contexts: Contexts = {\n    app: getAppContext() as Record<string, any>,\n    os: (await getOsContext()) as Record<string, any>,\n    browser: {\n      name: 'Chrome',\n    },\n    chrome: {\n      name: 'Chrome',\n      type: 'runtime',\n      version: process.versions.chrome,\n    },\n    device: {\n      arch: process.arch,\n      family: 'Desktop',\n    },\n    node: {\n      name: 'Node',\n      type: 'runtime',\n      version: process.versions.node,\n    },\n    runtime: {\n      name: 'Electron',\n      version: process.versions.electron,\n    },\n  };\n\n  return contexts;\n}\n\n/** Gets the default release name */\nexport function getDefaultReleaseName(): string {\n  const app_name = app.name || app.getName();\n  return `${app_name.replace(/\\W/g, '-')}@${app.getVersion()}`;\n}\n\n/** Gets the default environment */\nexport function getDefaultEnvironment(): string {\n  return isPackaged ? 'production' : 'development';\n}\n\n/**\n * Computes Electron-specific default fields for events.\n *\n * The event defaults include contexts for the Electron, Node and Chrome\n * runtimes, limited device information, operating system context and defaults\n * for the release and environment.\n */\nasync function _getEventDefaults(release?: string, environment?: string): Promise<Event> {\n  return {\n    sdk: getSdkInfo(),\n    contexts: await getContexts(),\n    environment: environment || getDefaultEnvironment(),\n    release: release || getDefaultReleaseName(),\n    user: { ip_address: '{{auto}}' },\n    tags: {\n      'event.origin': 'electron',\n      'event.environment': 'javascript',\n      'event.process': 'browser',\n      // Legacy way of filtering native vs JavaScript events\n      event_type: 'javascript',\n    },\n  };\n}\n\n/** Cached event prototype with default values. */\nlet cachedDefaultsPromise: Promise<Event>;\n\n/**\n * Computes and caches Electron-specific default fields for events.\n *\n * The event defaults include contexts for the Electron, Node and Chrome\n * runtimes, limited device information, operating system context and defaults\n * for the release and environment.\n */\nexport async function getEventDefaults(release?: string, environment?: string): Promise<Event> {\n  // The event defaults are cached as long as the app is running. We create the\n  // promise here synchronously to avoid multiple events computing them at the\n  // same time.\n  if (!cachedDefaultsPromise) {\n    cachedDefaultsPromise = _getEventDefaults(release, environment);\n  }\n\n  return await cachedDefaultsPromise;\n}\n"]}import { BrowserWindow, NativeImage, WebContents } from 'electron';
import { Optional } from '../common/types';
/** Returns if the app is packaged. Copied from Electron to support < v3 */
export declare const isPackaged: boolean;
/** A promise that is resolved when the app is ready */
export declare const whenAppReady: Promise<void>;
/**
 * Electron >= 5 support full protocol API
 */
export declare function supportsFullProtocol(): boolean;
export declare const EXIT_REASONS: readonly ["clean-exit", "abnormal-exit", "killed", "crashed", "oom", "launch-failed", "integrity-failure"];
export type ExitReason = (typeof EXIT_REASONS)[number];
export declare const CRASH_REASONS: Readonly<ExitReason[]>;
/** Same as the Electron interface but with optional exitCode */
type RenderProcessGoneDetails = Optional<Electron.RenderProcessGoneDetails, 'exitCode'>;
/**
 * Implements 'render-process-gone' event across Electron versions
 */
export declare function onRendererProcessGone(reasons: Readonly<ExitReason[]>, callback: (contents: WebContents, details: RenderProcessGoneDetails) => void): void;
type Details = Optional<Electron.Details, 'exitCode'>;
/**
 * Calls callback on child process crash if Electron version support 'child-process-gone' event
 */
export declare function onChildProcessGone(reasons: Readonly<ExitReason[]>, callback: (details: Details) => void): void;
/** Calls callback when BrowserWindow are created */
export declare function onBrowserWindowCreated(callback: (window: BrowserWindow) => void): void;
/** Calls callback when WebContents are created */
export declare function onWebContentsCreated(callback: (window: WebContents) => void): void;
/**
 * Electron < 9 requires `crashReporter.start()` in the renderer
 */
export declare function rendererRequiresCrashReporterStart(): boolean;
/** Is using Crashpad */
export declare function usesCrashpad(): boolean;
/**
 * Electron >= 9 uses `app.getPath('crashDumps')` rather than
 * `crashReporter.getCrashesDirectory()`
 */
export declare function getCrashesDirectory(): string;
/** Captures a NativeImage from a BrowserWindow */
export declare function capturePage(window: BrowserWindow): Promise<NativeImage>;
export {};
//# sourceMappingURL=electron-normalize.d.ts.map{"version":3,"file":"electron-normalize.d.ts","sourceRoot":"","sources":["../../src/main/electron-normalize.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,aAAa,EAAiB,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,2EAA2E;AAC3E,eAAO,MAAM,UAAU,SAMnB,CAAC;AAEL,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,IAAI,CAQnC,CAAC;AAEL;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,eAAO,MAAM,YAAY,4GAQf,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,UAAU,EAAE,CAA+B,CAAC;AAEjF,gEAAgE;AAChE,KAAK,wBAAwB,GAAG,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAExF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,EAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAC3E,IAAI,CAsBN;AAED,KAAK,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAEtD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAiB9G;AAED,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI,CAgBtF;AAED,kDAAkD;AAClD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgBlF;AAED;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,OAAO,CAM5D;AAmBD,wBAAwB;AACxB,wBAAgB,YAAY,IAAI,OAAO,CAMtC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAK5C;AAMD,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CASvE"}import { parseSemver } from '@sentry/utils';
import { app, crashReporter } from 'electron';
import { basename } from 'path';
const parsed = parseSemver(process.versions.electron);
const version = { major: parsed.major || 0, minor: parsed.minor || 0, patch: parsed.patch || 0 };
/** Returns if the app is packaged. Copied from Electron to support < v3 */
export const isPackaged = (() => {
    const execFile = basename(process.execPath).toLowerCase();
    if (process.platform === 'win32') {
        return execFile !== 'electron.exe';
    }
    return execFile !== 'electron';
})();
/** A promise that is resolved when the app is ready */
export const whenAppReady = (() => {
    return app.isReady()
        ? Promise.resolve()
        : new Promise((resolve) => {
            app.once('ready', () => {
                resolve();
            });
        });
})();
/**
 * Electron >= 5 support full protocol API
 */
export function supportsFullProtocol() {
    return version.major >= 5;
}
export const EXIT_REASONS = [
    'clean-exit',
    'abnormal-exit',
    'killed',
    'crashed',
    'oom',
    'launch-failed',
    'integrity-failure',
];
export const CRASH_REASONS = ['crashed', 'oom'];
/**
 * Implements 'render-process-gone' event across Electron versions
 */
export function onRendererProcessGone(reasons, callback) {
    const supportsRenderProcessGone = version.major >= 10 || (version.major === 9 && version.minor >= 1) || (version.major === 8 && version.minor >= 4);
    if (supportsRenderProcessGone) {
        app.on('render-process-gone', (_, contents, details) => {
            if (reasons.includes(details.reason)) {
                callback(contents, details);
            }
        });
    }
    else {
        onWebContentsCreated((contents) => {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            contents.on('crashed', (__, killed) => {
                // When using Breakpad, crashes are incorrectly reported as killed
                const reason = usesCrashpad() && killed ? 'killed' : 'crashed';
                if (reasons.includes(reason)) {
                    callback(contents, { reason });
                }
            });
        });
    }
}
/**
 * Calls callback on child process crash if Electron version support 'child-process-gone' event
 */
export function onChildProcessGone(reasons, callback) {
    if (version.major >= 11) {
        app.on('child-process-gone', (_, details) => {
            if (reasons.includes(details.reason)) {
                callback(details);
            }
        });
    }
    else {
        // eslint-disable-next-line deprecation/deprecation
        app.on('gpu-process-crashed', (_, killed) => {
            const reason = killed ? 'killed' : 'crashed';
            if (reasons.includes(reason)) {
                callback({ type: 'GPU', reason });
            }
        });
    }
}
/** Calls callback when BrowserWindow are created */
export function onBrowserWindowCreated(callback) {
    app.on('browser-window-created', (_, window) => {
        // SetImmediate is required for window.id to be correct in older versions of Electron
        // https://github.com/electron/electron/issues/12036
        if (version.major >= 3) {
            callback(window);
        }
        else {
            setImmediate(() => {
                if (window.isDestroyed()) {
                    return;
                }
                callback(window);
            });
        }
    });
}
/** Calls callback when WebContents are created */
export function onWebContentsCreated(callback) {
    app.on('web-contents-created', (_, contents) => {
        // SetImmediate is required for contents.id to be correct in older versions of Electron
        // https://github.com/electron/electron/issues/12036
        if (version.major >= 3) {
            callback(contents);
        }
        else {
            setImmediate(() => {
                if (contents.isDestroyed()) {
                    return;
                }
                callback(contents);
            });
        }
    });
}
/**
 * Electron < 9 requires `crashReporter.start()` in the renderer
 */
export function rendererRequiresCrashReporterStart() {
    if (process.platform === 'darwin') {
        return false;
    }
    return version.major < 9;
}
/**
 * Uses Crashpad on Linux
 * https://github.com/electron/electron/issues/27859
 */
function crashpadLinux() {
    if (version.major >= 16) {
        return true;
    }
    if (version.major < 15) {
        return false;
    }
    // Crashpad Linux for v15 is behind a switch
    return app.commandLine.hasSwitch('enable-crashpad');
}
/** Is using Crashpad */
export function usesCrashpad() {
    return (process.platform === 'darwin' ||
        (process.platform === 'win32' && version.major >= 6) ||
        (process.platform === 'linux' && crashpadLinux()));
}
/**
 * Electron >= 9 uses `app.getPath('crashDumps')` rather than
 * `crashReporter.getCrashesDirectory()`
 */
export function getCrashesDirectory() {
    return version.major >= 9
        ? app.getPath('crashDumps')
        : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            crashReporter.getCrashesDirectory();
}
/** Captures a NativeImage from a BrowserWindow */
export function capturePage(window) {
    // Pre-Electron 5, BrowserWindow.capturePage() uses callbacks
    if (version.major < 5) {
        return new Promise((resolve) => {
            window.capturePage(resolve);
        });
    }
    return window.capturePage();
}
//# sourceMappingURL=electron-normalize.js.map{"version":3,"file":"electron-normalize.js","sourceRoot":"","sources":["../../src/main/electron-normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAiB,aAAa,EAA4B,MAAM,UAAU,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAIhC,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtD,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,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tD,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["import { parseSemver } from '@sentry/utils';\nimport { app, BrowserWindow, crashReporter, NativeImage, WebContents } from 'electron';\nimport { basename } from 'path';\n\nimport { Optional } from '../common/types';\n\nconst parsed = parseSemver(process.versions.electron);\nconst version = { major: parsed.major || 0, minor: parsed.minor || 0, patch: parsed.patch || 0 };\n\n/** Returns if the app is packaged. Copied from Electron to support < v3 */\nexport const isPackaged = (() => {\n  const execFile = basename(process.execPath).toLowerCase();\n  if (process.platform === 'win32') {\n    return execFile !== 'electron.exe';\n  }\n  return execFile !== 'electron';\n})();\n\n/** A promise that is resolved when the app is ready */\nexport const whenAppReady: Promise<void> = (() => {\n  return app.isReady()\n    ? Promise.resolve()\n    : new Promise<void>((resolve) => {\n        app.once('ready', () => {\n          resolve();\n        });\n      });\n})();\n\n/**\n * Electron >= 5 support full protocol API\n */\nexport function supportsFullProtocol(): boolean {\n  return version.major >= 5;\n}\n\nexport const EXIT_REASONS = [\n  'clean-exit',\n  'abnormal-exit',\n  'killed',\n  'crashed',\n  'oom',\n  'launch-failed',\n  'integrity-failure',\n] as const;\nexport type ExitReason = (typeof EXIT_REASONS)[number];\nexport const CRASH_REASONS: Readonly<ExitReason[]> = ['crashed', 'oom'] as const;\n\n/** Same as the Electron interface but with optional exitCode */\ntype RenderProcessGoneDetails = Optional<Electron.RenderProcessGoneDetails, 'exitCode'>;\n\n/**\n * Implements 'render-process-gone' event across Electron versions\n */\nexport function onRendererProcessGone(\n  reasons: Readonly<ExitReason[]>,\n  callback: (contents: WebContents, details: RenderProcessGoneDetails) => void,\n): void {\n  const supportsRenderProcessGone =\n    version.major >= 10 || (version.major === 9 && version.minor >= 1) || (version.major === 8 && version.minor >= 4);\n  if (supportsRenderProcessGone) {\n    app.on('render-process-gone', (_, contents, details) => {\n      if (reasons.includes(details.reason)) {\n        callback(contents, details);\n      }\n    });\n  } else {\n    onWebContentsCreated((contents) => {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      (contents as any).on('crashed', (__: Electron.Event, killed: boolean) => {\n        // When using Breakpad, crashes are incorrectly reported as killed\n        const reason: ExitReason = usesCrashpad() && killed ? 'killed' : 'crashed';\n\n        if (reasons.includes(reason)) {\n          callback(contents, { reason });\n        }\n      });\n    });\n  }\n}\n\ntype Details = Optional<Electron.Details, 'exitCode'>;\n\n/**\n * Calls callback on child process crash if Electron version support 'child-process-gone' event\n */\nexport function onChildProcessGone(reasons: Readonly<ExitReason[]>, callback: (details: Details) => void): void {\n  if (version.major >= 11) {\n    app.on('child-process-gone', (_, details) => {\n      if (reasons.includes(details.reason)) {\n        callback(details);\n      }\n    });\n  } else {\n    // eslint-disable-next-line deprecation/deprecation\n    app.on('gpu-process-crashed', (_, killed) => {\n      const reason: ExitReason = killed ? 'killed' : 'crashed';\n\n      if (reasons.includes(reason)) {\n        callback({ type: 'GPU', reason });\n      }\n    });\n  }\n}\n\n/** Calls callback when BrowserWindow are created */\nexport function onBrowserWindowCreated(callback: (window: BrowserWindow) => void): void {\n  app.on('browser-window-created', (_, window) => {\n    // SetImmediate is required for window.id to be correct in older versions of Electron\n    // https://github.com/electron/electron/issues/12036\n    if (version.major >= 3) {\n      callback(window);\n    } else {\n      setImmediate(() => {\n        if (window.isDestroyed()) {\n          return;\n        }\n\n        callback(window);\n      });\n    }\n  });\n}\n\n/** Calls callback when WebContents are created */\nexport function onWebContentsCreated(callback: (window: WebContents) => void): void {\n  app.on('web-contents-created', (_, contents) => {\n    // SetImmediate is required for contents.id to be correct in older versions of Electron\n    // https://github.com/electron/electron/issues/12036\n    if (version.major >= 3) {\n      callback(contents);\n    } else {\n      setImmediate(() => {\n        if (contents.isDestroyed()) {\n          return;\n        }\n\n        callback(contents);\n      });\n    }\n  });\n}\n\n/**\n * Electron < 9 requires `crashReporter.start()` in the renderer\n */\nexport function rendererRequiresCrashReporterStart(): boolean {\n  if (process.platform === 'darwin') {\n    return false;\n  }\n\n  return version.major < 9;\n}\n\n/**\n * Uses Crashpad on Linux\n * https://github.com/electron/electron/issues/27859\n */\nfunction crashpadLinux(): boolean {\n  if (version.major >= 16) {\n    return true;\n  }\n\n  if (version.major < 15) {\n    return false;\n  }\n\n  // Crashpad Linux for v15 is behind a switch\n  return app.commandLine.hasSwitch('enable-crashpad');\n}\n\n/** Is using Crashpad */\nexport function usesCrashpad(): boolean {\n  return (\n    process.platform === 'darwin' ||\n    (process.platform === 'win32' && version.major >= 6) ||\n    (process.platform === 'linux' && crashpadLinux())\n  );\n}\n\n/**\n * Electron >= 9 uses `app.getPath('crashDumps')` rather than\n * `crashReporter.getCrashesDirectory()`\n */\nexport function getCrashesDirectory(): string {\n  return version.major >= 9\n    ? app.getPath('crashDumps')\n    : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      (crashReporter as any).getCrashesDirectory();\n}\n\ninterface OlderBrowserWindow extends Omit<BrowserWindow, 'capturePage'> {\n  capturePage(callback?: (i: NativeImage) => void): void;\n}\n\n/** Captures a NativeImage from a BrowserWindow */\nexport function capturePage(window: BrowserWindow): Promise<NativeImage> {\n  // Pre-Electron 5, BrowserWindow.capturePage() uses callbacks\n  if (version.major < 5) {\n    return new Promise<NativeImage>((resolve) => {\n      (window as OlderBrowserWindow).capturePage(resolve);\n    });\n  }\n\n  return window.capturePage();\n}\n"]}/// <reference types="node" />
import { mkdir, readdir, readFile, rename, stat, unlink, writeFile } from 'fs';
export declare const sentryCachePath: string;
export declare const writeFileAsync: typeof writeFile.__promisify__;
export declare const readFileAsync: typeof readFile.__promisify__;
export declare const mkdirAsync: typeof mkdir.__promisify__;
export declare const statAsync: typeof stat.__promisify__;
export declare const unlinkAsync: typeof unlink.__promisify__;
export declare const readDirAsync: typeof readdir.__promisify__;
export declare const renameAsync: typeof rename.__promisify__;
/**
 * Recursively creates the given path.
 *
 * @param path A relative or absolute path to create.
 * @returns A Promise that resolves when the path has been created.
 */
export declare function mkdirp(path: string): Promise<void>;
//# sourceMappingURL=fs.d.ts.map{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/main/fs.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAY,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAIzF,eAAO,MAAM,eAAe,QAA0C,CAAC;AAEvE,eAAO,MAAM,cAAc,gCAAuB,CAAC;AACnD,eAAO,MAAM,aAAa,+BAAsB,CAAC;AACjD,eAAO,MAAM,UAAU,4BAAmB,CAAC;AAC3C,eAAO,MAAM,SAAS,2BAAkB,CAAC;AACzC,eAAO,MAAM,WAAW,6BAAoB,CAAC;AAC7C,eAAO,MAAM,YAAY,8BAAqB,CAAC;AAC/C,eAAO,MAAM,WAAW,6BAAoB,CAAC;AAI7C;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBxD"}import { __awaiter } from "tslib";
import { app } from 'electron';
import { mkdir, readdir, readFile, rename, stat, statSync, unlink, writeFile } from 'fs';
import { dirname, join, resolve } from 'path';
import { promisify } from 'util';
export const sentryCachePath = join(app.getPath('userData'), 'sentry');
export const writeFileAsync = promisify(writeFile);
export const readFileAsync = promisify(readFile);
export const mkdirAsync = promisify(mkdir);
export const statAsync = promisify(stat);
export const unlinkAsync = promisify(unlink);
export const readDirAsync = promisify(readdir);
export const renameAsync = promisify(rename);
// mkdir with recursive was only added in Node 10+
/**
 * Recursively creates the given path.
 *
 * @param path A relative or absolute path to create.
 * @returns A Promise that resolves when the path has been created.
 */
export function mkdirp(path) {
    return __awaiter(this, void 0, void 0, function* () {
        // eslint-disable-next-line no-bitwise
        const realPath = resolve(path);
        try {
            yield mkdirAsync(realPath, 0o777);
        }
        catch (err) {
            const error = err;
            if (error && error.code === 'ENOENT') {
                yield mkdirp(dirname(realPath));
                yield mkdirAsync(realPath, 0o777);
            }
            try {
                if (!statSync(realPath).isDirectory()) {
                    throw err;
                }
            }
            catch (_) {
                throw err;
            }
        }
    });
}
//# sourceMappingURL=fs.js.map{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/main/fs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AAC3C,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAE7C,kDAAkD;AAElD;;;;;GAKG;AACH,MAAM,UAAgB,MAAM,CAAC,IAAY;;QACvC,sCAAsC;QACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI;YACF,MAAM,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;SACnC;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,KAAK,GAAG,GAAuB,CAAC;YACtC,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpC,MAAM,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAChC,MAAM,UAAU,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;aACnC;YAED,IAAI;gBACF,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,EAAE;oBACrC,MAAM,GAAG,CAAC;iBACX;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,GAAG,CAAC;aACX;SACF;IACH,CAAC;CAAA","sourcesContent":["import { app } from 'electron';\nimport { mkdir, readdir, readFile, rename, stat, statSync, unlink, writeFile } from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport { promisify } from 'util';\n\nexport const sentryCachePath = join(app.getPath('userData'), 'sentry');\n\nexport const writeFileAsync = promisify(writeFile);\nexport const readFileAsync = promisify(readFile);\nexport const mkdirAsync = promisify(mkdir);\nexport const statAsync = promisify(stat);\nexport const unlinkAsync = promisify(unlink);\nexport const readDirAsync = promisify(readdir);\nexport const renameAsync = promisify(rename);\n\n// mkdir with recursive was only added in Node 10+\n\n/**\n * Recursively creates the given path.\n *\n * @param path A relative or absolute path to create.\n * @returns A Promise that resolves when the path has been created.\n */\nexport async function mkdirp(path: string): Promise<void> {\n  // eslint-disable-next-line no-bitwise\n  const realPath = resolve(path);\n\n  try {\n    await mkdirAsync(realPath, 0o777);\n  } catch (err) {\n    const error = err as { code: string };\n    if (error && error.code === 'ENOENT') {\n      await mkdirp(dirname(realPath));\n      await mkdirAsync(realPath, 0o777);\n    }\n\n    try {\n      if (!statSync(realPath).isDirectory()) {\n        throw err;\n      }\n    } catch (_) {\n      throw err;\n    }\n  }\n}\n"]}import * as ElectronMainIntegrations from './integrations';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export type { NodeOptions } from '@sentry/node';
export { flush, close, NodeClient, lastEventId } from '@sentry/node';
export { makeElectronTransport } from './transports/electron-net';
export { makeElectronOfflineTransport } from './transports/electron-offline-net';
export declare const Integrations: {
    Apollo: typeof import("@sentry-internal/tracing").Apollo;
    Express: typeof import("@sentry-internal/tracing").Express;
    GraphQL: typeof import("@sentry-internal/tracing").GraphQL;
    Mongo: typeof import("@sentry-internal/tracing").Mongo;
    Mysql: typeof import("@sentry-internal/tracing").Mysql;
    Postgres: typeof import("@sentry-internal/tracing").Postgres;
    Prisma: typeof import("@sentry-internal/tracing").Prisma;
    Console: typeof import("@sentry/node/types/integrations").Console;
    Http: typeof import("@sentry/node/types/integrations").Http;
    OnUncaughtException: typeof import("@sentry/node/types/integrations").OnUncaughtException;
    OnUnhandledRejection: typeof import("@sentry/node/types/integrations").OnUnhandledRejection;
    LinkedErrors: typeof import("@sentry/node/types/integrations").LinkedErrors;
    Modules: typeof import("@sentry/node/types/integrations").Modules;
    ContextLines: typeof import("@sentry/node/types/integrations").ContextLines;
    Context: typeof import("@sentry/node/types/integrations").Context;
    RequestData: typeof import("@sentry/node/types/integrations").RequestData;
    LocalVariables: typeof import("@sentry/node/types/integrations").LocalVariables;
    Undici: typeof import("@sentry/node/types/integrations").Undici;
    FunctionToString: typeof import("@sentry/core").FunctionToString;
    InboundFilters: typeof import("@sentry/core").InboundFilters;
    ElectronBreadcrumbs: typeof ElectronMainIntegrations.ElectronBreadcrumbs;
    MainContext: typeof ElectronMainIntegrations.MainContext;
    SentryMinidump: typeof ElectronMainIntegrations.SentryMinidump;
    ElectronMinidump: typeof ElectronMainIntegrations.ElectronMinidump;
    PreloadInjection: typeof ElectronMainIntegrations.PreloadInjection;
    MainProcessSession: typeof ElectronMainIntegrations.MainProcessSession;
    AdditionalContext: typeof ElectronMainIntegrations.AdditionalContext;
    Net: typeof ElectronMainIntegrations.Net;
    ChildProcess: typeof ElectronMainIntegrations.ChildProcess;
    Screenshots: typeof ElectronMainIntegrations.Screenshots;
};
export type { ElectronMainOptions } from './sdk';
export { init, defaultIntegrations } from './sdk';
export { IPCMode } from '../common';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,wBAAwB,MAAM,gBAAgB,CAAC;AAE3D,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuD,CAAC;AAEjF,YAAY,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}import { ensureProcess } from '../common';
ensureProcess('main');
import { Integrations as NodeIntegrations } from '@sentry/node';
import * as ElectronMainIntegrations from './integrations';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export { flush, close, NodeClient, lastEventId } from '@sentry/node';
export { makeElectronTransport } from './transports/electron-net';
export { makeElectronOfflineTransport } from './transports/electron-offline-net';
export const Integrations = Object.assign(Object.assign({}, ElectronMainIntegrations), NodeIntegrations);
export { init, defaultIntegrations } from './sdk';
export { IPCMode } from '../common';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtB,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,wBAAwB,MAAM,gBAAgB,CAAC;AAoB3D,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,MAAM,CAAC,MAAM,YAAY,mCAAQ,wBAAwB,GAAK,gBAAgB,CAAE,CAAC;AAGjF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import { ensureProcess } from '../common';\nensureProcess('main');\n\nimport { Integrations as NodeIntegrations } from '@sentry/node';\n\nimport * as ElectronMainIntegrations from './integrations';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n} from '@sentry/core';\n\nexport type { NodeOptions } from '@sentry/node';\nexport { flush, close, NodeClient, lastEventId } from '@sentry/node';\n\nexport { makeElectronTransport } from './transports/electron-net';\nexport { makeElectronOfflineTransport } from './transports/electron-offline-net';\nexport const Integrations = { ...ElectronMainIntegrations, ...NodeIntegrations };\n\nexport type { ElectronMainOptions } from './sdk';\nexport { init, defaultIntegrations } from './sdk';\nexport { IPCMode } from '../common';\n"]}import { EventProcessor, Integration } from '@sentry/types';
export interface AdditionalContextOptions {
    cpu: boolean;
    screen: boolean;
    memory: boolean;
    language: boolean;
}
/** Adds Electron context to events and normalises paths. */
export declare class AdditionalContext implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    private _lazyDeviceContext;
    constructor(options?: Partial<AdditionalContextOptions>);
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
    /** Adds additional context to event */
    private _addAdditionalContext;
    /** Sets the display info */
    private _setPrimaryDisplayInfo;
}
//# sourceMappingURL=additional-context.d.ts.map{"version":3,"file":"additional-context.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/additional-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOlF,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AASD,4DAA4D;AAC5D,qBAAa,iBAAkB,YAAW,WAAW;IACnD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAuB;IAE/C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAwB;IAE3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,kBAAkB,CAAqB;gBAE5B,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM;IAOlE,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAqBnF,uCAAuC;IACvC,OAAO,CAAC,qBAAqB;IA6B7B,4BAA4B;IAC5B,OAAO,CAAC,sBAAsB;CAO/B"}import { __awaiter } from "tslib";
import { app, screen as electronScreen } from 'electron';
import { cpus } from 'os';
import { mergeEvents } from '../../common';
import { whenAppReady } from '../electron-normalize';
const DEFAULT_OPTIONS = {
    cpu: true,
    screen: true,
    memory: true,
    language: true,
};
/** Adds Electron context to events and normalises paths. */
export class AdditionalContext {
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = AdditionalContext.id;
        this._lazyDeviceContext = {};
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () { return this._addAdditionalContext(event); }));
        // Some metrics are only available after app ready so we lazily load them
        void whenAppReady.then(() => {
            const { language, screen } = this._options;
            if (language) {
                this._lazyDeviceContext.language = app.getLocale();
            }
            if (screen) {
                this._setPrimaryDisplayInfo();
                electronScreen.on('display-metrics-changed', () => {
                    this._setPrimaryDisplayInfo();
                });
            }
        });
    }
    /** Adds additional context to event */
    _addAdditionalContext(event) {
        const device = this._lazyDeviceContext;
        const { memory, cpu } = this._options;
        if (memory) {
            const { total, free } = process.getSystemMemoryInfo();
            device.memory_size = total * 1024;
            device.free_memory = free * 1024;
        }
        if (cpu) {
            const cpuInfo = cpus();
            if (cpuInfo && cpuInfo.length) {
                const firstCpu = cpuInfo[0];
                device.processor_count = cpuInfo.length;
                device.cpu_description = firstCpu.model;
                device.processor_frequency = firstCpu.speed;
                if (app.runningUnderARM64Translation) {
                    device.machine_arch = 'arm64';
                }
            }
        }
        return mergeEvents(event, { contexts: { device } });
    }
    /** Sets the display info */
    _setPrimaryDisplayInfo() {
        const display = electronScreen.getPrimaryDisplay();
        const width = Math.floor(display.size.width * display.scaleFactor);
        const height = Math.floor(display.size.height * display.scaleFactor);
        this._lazyDeviceContext.screen_density = display.scaleFactor;
        this._lazyDeviceContext.screen_resolution = `${width}x${height}`;
    }
}
/** @inheritDoc */
AdditionalContext.id = 'AdditionalContext';
//# sourceMappingURL=additional-context.js.map{"version":3,"file":"additional-context.js","sourceRoot":"","sources":["../../../src/main/integrations/additional-context.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,cAA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GAAG,OAAO,CAAC,WAAW,CAAC;QAC7D,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;IACnE,CAAC;;AA3ED,kBAAkB;AACJ,oBAAE,GAAW,mBAAmB,CAAC","sourcesContent":["import { DeviceContext, Event, EventProcessor, Integration } from '@sentry/types';\nimport { app, screen as electronScreen } from 'electron';\nimport { CpuInfo, cpus } from 'os';\n\nimport { mergeEvents } from '../../common';\nimport { whenAppReady } from '../electron-normalize';\n\nexport interface AdditionalContextOptions {\n  cpu: boolean;\n  screen: boolean;\n  memory: boolean;\n  language: boolean;\n}\n\nconst DEFAULT_OPTIONS: AdditionalContextOptions = {\n  cpu: true,\n  screen: true,\n  memory: true,\n  language: true,\n};\n\n/** Adds Electron context to events and normalises paths. */\nexport class AdditionalContext implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'AdditionalContext';\n\n  /** @inheritDoc */\n  public name: string = AdditionalContext.id;\n\n  private readonly _options: AdditionalContextOptions;\n  private _lazyDeviceContext: DeviceContext = {};\n\n  public constructor(options: Partial<AdditionalContextOptions> = {}) {\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...options,\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(async (event: Event) => this._addAdditionalContext(event));\n\n    // Some metrics are only available after app ready so we lazily load them\n    void whenAppReady.then(() => {\n      const { language, screen } = this._options;\n\n      if (language) {\n        this._lazyDeviceContext.language = app.getLocale();\n      }\n\n      if (screen) {\n        this._setPrimaryDisplayInfo();\n\n        electronScreen.on('display-metrics-changed', () => {\n          this._setPrimaryDisplayInfo();\n        });\n      }\n    });\n  }\n\n  /** Adds additional context to event */\n  private _addAdditionalContext(event: Event): Event {\n    const device: DeviceContext = this._lazyDeviceContext;\n\n    const { memory, cpu } = this._options;\n\n    if (memory) {\n      const { total, free } = process.getSystemMemoryInfo();\n      device.memory_size = total * 1024;\n      device.free_memory = free * 1024;\n    }\n\n    if (cpu) {\n      const cpuInfo: CpuInfo[] | undefined = cpus();\n      if (cpuInfo && cpuInfo.length) {\n        const firstCpu = cpuInfo[0];\n\n        device.processor_count = cpuInfo.length;\n        device.cpu_description = firstCpu.model;\n        device.processor_frequency = firstCpu.speed;\n\n        if (app.runningUnderARM64Translation) {\n          device.machine_arch = 'arm64';\n        }\n      }\n    }\n\n    return mergeEvents(event, { contexts: { device } });\n  }\n\n  /** Sets the display info */\n  private _setPrimaryDisplayInfo(): void {\n    const display = electronScreen.getPrimaryDisplay();\n    const width = Math.floor(display.size.width * display.scaleFactor);\n    const height = Math.floor(display.size.height * display.scaleFactor);\n    this._lazyDeviceContext.screen_density = display.scaleFactor;\n    this._lazyDeviceContext.screen_resolution = `${width}x${height}`;\n  }\n}\n"]}import { Integration } from '@sentry/types';
import { OrBool } from '../../common/types';
import { ExitReason } from '../electron-normalize';
interface ChildProcessOptions {
    /** Child process events that generate breadcrumbs */
    breadcrumbs: Readonly<ExitReason[]>;
    /** Child process events that generate Sentry events */
    events: Readonly<ExitReason[]>;
}
/** Adds breadcrumbs for Electron events. */
export declare class ChildProcess implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /**
     * @param _options Integration options
     */
    constructor(options?: Partial<OrBool<ChildProcessOptions>>);
    /** @inheritDoc */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=child-process.d.ts.map{"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/child-process.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAgB,UAAU,EAA6C,MAAM,uBAAuB,CAAC;AAG5G,UAAU,mBAAmB;IAC3B,qDAAqD;IACrD,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACpC,uDAAuD;IACvD,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;CAChC;AAyBD,4CAA4C;AAC5C,qBAAa,YAAa,YAAW,WAAW;IAC9C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAmB;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAM;IAQrE,kBAAkB;IACX,SAAS,IAAI,IAAI;CAkDzB"}import { addBreadcrumb, captureMessage, getCurrentHub } from '@sentry/core';
import { EXIT_REASONS, onChildProcessGone, onRendererProcessGone } from '../electron-normalize';
const DEFAULT_OPTIONS = {
    breadcrumbs: EXIT_REASONS,
    events: ['abnormal-exit', 'launch-failed', 'integrity-failure'],
};
/** Gets message and severity */
function getMessageAndSeverity(reason, proc) {
    const message = `'${proc}' process exited with '${reason}'`;
    switch (reason) {
        case 'abnormal-exit':
        case 'killed':
            return { message, level: 'warning' };
        case 'crashed':
        case 'oom':
        case 'launch-failed':
        case 'integrity-failure':
            return { message, level: 'fatal' };
        default:
            return { message, level: 'debug' };
    }
}
/** Adds breadcrumbs for Electron events. */
export class ChildProcess {
    /**
     * @param _options Integration options
     */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = ChildProcess.id;
        const { breadcrumbs, events } = options;
        this._options = {
            breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : breadcrumbs == false ? [] : DEFAULT_OPTIONS.breadcrumbs,
            events: Array.isArray(events) ? events : events == false ? [] : DEFAULT_OPTIONS.events,
        };
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const { breadcrumbs, events } = this._options;
        const allReasons = Array.from(new Set([...breadcrumbs, ...events]));
        // only hook these events if we're after more than just the unresponsive event
        if (allReasons.length > 0) {
            const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
            onChildProcessGone(allReasons, (details) => {
                const { reason } = details;
                // Capture message first
                if (events.includes(reason)) {
                    const { message, level } = getMessageAndSeverity(details.reason, details.type);
                    captureMessage(message, { level, tags: { 'event.process': details.type } });
                }
                // And then add breadcrumbs for subsequent events
                if (breadcrumbs.includes(reason)) {
                    addBreadcrumb(Object.assign(Object.assign({ type: 'process', category: 'child-process' }, getMessageAndSeverity(details.reason, details.type)), { data: details }));
                }
            });
            onRendererProcessGone(allReasons, (contents, details) => {
                var _a;
                const { reason } = details;
                const name = ((_a = options === null || options === void 0 ? void 0 : options.getRendererName) === null || _a === void 0 ? void 0 : _a.call(options, contents)) || 'renderer';
                // Capture message first
                if (events.includes(reason)) {
                    const { message, level } = getMessageAndSeverity(details.reason, name);
                    captureMessage(message, level);
                }
                // And then add breadcrumbs for subsequent events
                if (breadcrumbs.includes(reason)) {
                    addBreadcrumb(Object.assign(Object.assign({ type: 'process', category: 'child-process' }, getMessageAndSeverity(details.reason, name)), { data: details }));
                }
            });
        }
    }
}
/** @inheritDoc */
ChildProcess.id = 'ChildProcess';
//# sourceMappingURL=child-process.js.map{"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../../src/main/integrations/child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAK5E,OAAO,EAAE,YAAY,EAAc,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAU5G,MAAM,eAAe,GAAwB;IAC3C,WAAW,EAAE,YAAY;IACzB,MAAM,EAAE,CAAC,eAAe,EAAE,eAAe,EAAE,mBAAmB,CAAC;CAChE,CAAC;AAEF,gCAAgC;AAChC,SAAS,qBAAqB,CAAC,MAAkB,EAAE,IAAa;IAC9D,MAAM,OAAO,GAAG,IAAI,IAAI,0BAA0B,MAAM,GAAG,CAAC;IAE5D,QAAQ,MAAM,EAAE;QACd,KAAK,e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BAChC;gBAED,iDAAiD;gBACjD,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;oBAChC,aAAa,+BACX,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,eAAe,IACtB,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,KAC9C,IAAI,EAAE,OAAO,IACb,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;;AArED,kBAAkB;AACJ,eAAE,GAAW,cAAc,CAAC","sourcesContent":["import { addBreadcrumb, captureMessage, getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Integration, SeverityLevel } from '@sentry/types';\n\nimport { OrBool } from '../../common/types';\nimport { EXIT_REASONS, ExitReason, onChildProcessGone, onRendererProcessGone } from '../electron-normalize';\nimport { ElectronMainOptions } from '../sdk';\n\ninterface ChildProcessOptions {\n  /** Child process events that generate breadcrumbs */\n  breadcrumbs: Readonly<ExitReason[]>;\n  /** Child process events that generate Sentry events */\n  events: Readonly<ExitReason[]>;\n}\n\nconst DEFAULT_OPTIONS: ChildProcessOptions = {\n  breadcrumbs: EXIT_REASONS,\n  events: ['abnormal-exit', 'launch-failed', 'integrity-failure'],\n};\n\n/** Gets message and severity */\nfunction getMessageAndSeverity(reason: ExitReason, proc?: string): { message: string; level: SeverityLevel } {\n  const message = `'${proc}' process exited with '${reason}'`;\n\n  switch (reason) {\n    case 'abnormal-exit':\n    case 'killed':\n      return { message, level: 'warning' };\n    case 'crashed':\n    case 'oom':\n    case 'launch-failed':\n    case 'integrity-failure':\n      return { message, level: 'fatal' };\n    default:\n      return { message, level: 'debug' };\n  }\n}\n\n/** Adds breadcrumbs for Electron events. */\nexport class ChildProcess implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ChildProcess';\n\n  /** @inheritDoc */\n  public name: string = ChildProcess.id;\n\n  private readonly _options: ChildProcessOptions;\n\n  /**\n   * @param _options Integration options\n   */\n  public constructor(options: Partial<OrBool<ChildProcessOptions>> = {}) {\n    const { breadcrumbs, events } = options;\n    this._options = {\n      breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : breadcrumbs == false ? [] : DEFAULT_OPTIONS.breadcrumbs,\n      events: Array.isArray(events) ? events : events == false ? [] : DEFAULT_OPTIONS.events,\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const { breadcrumbs, events } = this._options;\n    const allReasons = Array.from(new Set([...breadcrumbs, ...events]));\n\n    // only hook these events if we're after more than just the unresponsive event\n    if (allReasons.length > 0) {\n      const options = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptions | undefined;\n\n      onChildProcessGone(allReasons, (details) => {\n        const { reason } = details;\n\n        // Capture message first\n        if (events.includes(reason)) {\n          const { message, level } = getMessageAndSeverity(details.reason, details.type);\n          captureMessage(message, { level, tags: { 'event.process': details.type } });\n        }\n\n        // And then add breadcrumbs for subsequent events\n        if (breadcrumbs.includes(reason)) {\n          addBreadcrumb({\n            type: 'process',\n            category: 'child-process',\n            ...getMessageAndSeverity(details.reason, details.type),\n            data: details,\n          });\n        }\n      });\n\n      onRendererProcessGone(allReasons, (contents, details) => {\n        const { reason } = details;\n        const name = options?.getRendererName?.(contents) || 'renderer';\n\n        // Capture message first\n        if (events.includes(reason)) {\n          const { message, level } = getMessageAndSeverity(details.reason, name);\n          captureMessage(message, level);\n        }\n\n        // And then add breadcrumbs for subsequent events\n        if (breadcrumbs.includes(reason)) {\n          addBreadcrumb({\n            type: 'process',\n            category: 'child-process',\n            ...getMessageAndSeverity(details.reason, name),\n            data: details,\n          });\n        }\n      });\n    }\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** A function that returns true if the named event should create breadcrumbs */
type EventFunction = (name: string) => boolean;
type EventTypes = boolean | string[] | EventFunction | undefined;
interface ElectronBreadcrumbsOptions<T> {
    /**
     * app events
     *
     * default: (name) => !name.startsWith('remote-')
     */
    app: T;
    /**
     * autoUpdater events
     *
     * default: all
     */
    autoUpdater: T;
    /**
     * webContents events
     * default: ['dom-ready', 'context-menu', 'load-url', 'destroyed']
     */
    webContents: T;
    /**
     * BrowserWindow events
     *
     * default: ['closed', 'close', 'unresponsive', 'responsive', 'show', 'blur', 'focus', 'hide',
     *            'maximize', 'minimize', 'restore', 'enter-full-screen', 'leave-full-screen' ]
     */
    browserWindow: T;
    /**
     * screen events
     *
     * default: all
     */
    screen: T;
    /**
     * powerMonitor events
     *
     * default: all
     */
    powerMonitor: T;
    /**
     * Whether to capture window titles with webContents/browserWindow breadcrumbs
     *
     * default: false
     */
    captureWindowTitles: boolean;
}
/** Converts all user supplied options to function | false */
export declare function normalizeOptions(options: Partial<ElectronBreadcrumbsOptions<EventTypes>>): Partial<ElectronBreadcrumbsOptions<EventFunction | false>>;
/** Adds breadcrumbs for Electron events. */
export declare class ElectronBreadcrumbs implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /**
     * @param _options Integration options
     */
    constructor(options?: Partial<ElectronBreadcrumbsOptions<EventTypes>>);
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈
     */
    private _patchEventEmitter;
}
export {};
//# sourceMappingURL=electron-breadcrumbs.d.ts.map{"version":3,"file":"electron-breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/electron-breadcrumbs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,eAAe,CAAC;AAOxD,gFAAgF;AAChF,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAC/C,KAAK,UAAU,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,aAAa,GAAG,SAAS,CAAC;AAEjE,UAAU,0BAA0B,CAAC,CAAC;IACpC;;;;OAIG;IACH,GAAG,EAAE,CAAC,CAAC;IACP;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC;IACf;;;;;OAKG;IACH,aAAa,EAAE,CAAC,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC;IACV;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC;IAEhB;;;;OAIG;IACH,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AA4BD,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,GACvD,OAAO,CAAC,0BAA0B,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,CAe5D;AAED,4CAA4C;AAC5C,qBAAa,mBAAoB,YAAW,WAAW;IACrD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAyB;IAEjD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAA0B;IAE7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;IAE7E;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAM;IAIhF,kBAAkB;IACX,SAAS,IAAI,IAAI;IAyCxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CA+B3B"}import { addBreadcrumb, getCurrentHub } from '@sentry/core';
import { app, autoUpdater, powerMonitor, screen } from 'electron';
import { onBrowserWindowCreated, onWebContentsCreated, whenAppReady } from '../electron-normalize';
import { getRendererProperties, trackRendererProperties } from '../renderers';
const DEFAULT_OPTIONS = {
    // We exclude events starting with remote as they can be quite verbose
    app: (name) => !name.startsWith('remote-'),
    autoUpdater: () => true,
    webContents: (name) => ['dom-ready', 'context-menu', 'load-url', 'destroyed'].includes(name),
    browserWindow: (name) => [
        'closed',
        'close',
        'unresponsive',
        'responsive',
        'show',
        'blur',
        'focus',
        'hide',
        'maximize',
        'minimize',
        'restore',
        'enter-full-screen',
        'leave-full-screen',
    ].includes(name),
    screen: () => true,
    powerMonitor: () => true,
    captureWindowTitles: false,
};
/** Converts all user supplied options to function | false */
export function normalizeOptions(options) {
    return Object.keys(options).reduce((obj, k) => {
        if (k === 'captureWindowTitles') {
            obj[k] = !!options[k];
        }
        else {
            const val = options[k];
            if (Array.isArray(val)) {
                obj[k] = (name) => val.includes(name);
            }
            else if (typeof val === 'function' || val === false) {
                obj[k] = val;
            }
        }
        return obj;
    }, {});
}
/** Adds breadcrumbs for Electron events. */
export class ElectronBreadcrumbs {
    /**
     * @param _options Integration options
     */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = ElectronBreadcrumbs.id;
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), normalizeOptions(options));
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const initOptions = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        trackRendererProperties();
        void whenAppReady.then(() => {
            // We can't access these until app 'ready'
            if (this._options.screen) {
                this._patchEventEmitter(screen, 'screen', this._options.screen);
            }
            if (this._options.powerMonitor) {
                this._patchEventEmitter(powerMonitor, 'powerMonitor', this._options.powerMonitor);
            }
        });
        if (this._options.app) {
            this._patchEventEmitter(app, 'app', this._options.app);
        }
        if (this._options.autoUpdater) {
            this._patchEventEmitter(autoUpdater, 'autoUpdater', this._options.autoUpdater);
        }
        if (this._options.browserWindow) {
            onBrowserWindowCreated((window) => {
                var _a;
                const id = window.webContents.id;
                const windowName = ((_a = initOptions === null || initOptions === void 0 ? void 0 : initOptions.getRendererName) === null || _a === void 0 ? void 0 : _a.call(initOptions, window.webContents)) || 'window';
                this._patchEventEmitter(window, windowName, this._options.browserWindow, id);
            });
        }
        if (this._options.webContents) {
            onWebContentsCreated((contents) => {
                var _a;
                const id = contents.id;
                const webContentsName = ((_a = initOptions === null || initOptions === void 0 ? void 0 : initOptions.getRendererName) === null || _a === void 0 ? void 0 : _a.call(initOptions, contents)) || 'renderer';
                this._patchEventEmitter(contents, webContentsName, this._options.webContents, id);
            });
        }
    }
    /**
     * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈
     */
    _patchEventEmitter(emitter, category, shouldCapture, id) {
        const emit = emitter.emit.bind(emitter);
        emitter.emit = (event, ...args) => {
            var _a, _b;
            if (shouldCapture && shouldCapture(event)) {
                const breadcrumb = {
                    category: 'electron',
                    message: `${category}.${event}`,
                    timestamp: new Date().getTime() / 1000,
                    type: 'ui',
                };
                if (id) {
                    breadcrumb.data = Object.assign({}, getRendererProperties(id));
                    if (!this._options.captureWindowTitles && ((_a = breadcrumb.data) === null || _a === void 0 ? void 0 : _a.title)) {
                        (_b = breadcrumb.data) === null || _b === void 0 ? true : delete _b.title;
                    }
                }
                addBreadcrumb(breadcrumb);
            }
            return emit(event, ...args);
        };
    }
}
/** @inheritDoc */
ElectronBreadcrumbs.id = 'ElectronBreadcrumbs';
//# sourceMappingURL=electron-breadcrumbs.js.map{"version":3,"file":"electron-breadcrumbs.js","sourceRoot":"","sources":["../../../src/main/integrations/electron-breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG5D,OAAO,EAAE,GAAG,EAAE,WAAW,EAAiB,YAAY,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAE9F,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAqD9E,MAAM,eAAe,GAA8C;IACjE,sEAAsE;IACtE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;IAC1C,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI;IACvB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5F,aAAa,EAAE,CAAC,IAAI,E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AA,UAAU,CAAC,IAAI,+CAAE,KAAK,CAAC;qBAC/B;iBACF;gBAED,aAAa,CAAC,UAAU,CAAC,CAAC;aAC3B;YAED,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC;;AA1FD,kBAAkB;AACJ,sBAAE,GAAW,qBAAqB,CAAC","sourcesContent":["import { addBreadcrumb, getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Breadcrumb, Integration } from '@sentry/types';\nimport { app, autoUpdater, BrowserWindow, powerMonitor, screen, WebContents } from 'electron';\n\nimport { onBrowserWindowCreated, onWebContentsCreated, whenAppReady } from '../electron-normalize';\nimport { getRendererProperties, trackRendererProperties } from '../renderers';\nimport { ElectronMainOptions } from '../sdk';\n\n/** A function that returns true if the named event should create breadcrumbs */\ntype EventFunction = (name: string) => boolean;\ntype EventTypes = boolean | string[] | EventFunction | undefined;\n\ninterface ElectronBreadcrumbsOptions<T> {\n  /**\n   * app events\n   *\n   * default: (name) => !name.startsWith('remote-')\n   */\n  app: T;\n  /**\n   * autoUpdater events\n   *\n   * default: all\n   */\n  autoUpdater: T;\n  /**\n   * webContents events\n   * default: ['dom-ready', 'context-menu', 'load-url', 'destroyed']\n   */\n  webContents: T;\n  /**\n   * BrowserWindow events\n   *\n   * default: ['closed', 'close', 'unresponsive', 'responsive', 'show', 'blur', 'focus', 'hide',\n   *            'maximize', 'minimize', 'restore', 'enter-full-screen', 'leave-full-screen' ]\n   */\n  browserWindow: T;\n  /**\n   * screen events\n   *\n   * default: all\n   */\n  screen: T;\n  /**\n   * powerMonitor events\n   *\n   * default: all\n   */\n  powerMonitor: T;\n\n  /**\n   * Whether to capture window titles with webContents/browserWindow breadcrumbs\n   *\n   * default: false\n   */\n  captureWindowTitles: boolean;\n}\n\nconst DEFAULT_OPTIONS: ElectronBreadcrumbsOptions<EventFunction> = {\n  // We exclude events starting with remote as they can be quite verbose\n  app: (name) => !name.startsWith('remote-'),\n  autoUpdater: () => true,\n  webContents: (name) => ['dom-ready', 'context-menu', 'load-url', 'destroyed'].includes(name),\n  browserWindow: (name) =>\n    [\n      'closed',\n      'close',\n      'unresponsive',\n      'responsive',\n      'show',\n      'blur',\n      'focus',\n      'hide',\n      'maximize',\n      'minimize',\n      'restore',\n      'enter-full-screen',\n      'leave-full-screen',\n    ].includes(name),\n  screen: () => true,\n  powerMonitor: () => true,\n  captureWindowTitles: false,\n};\n\n/** Converts all user supplied options to function | false */\nexport function normalizeOptions(\n  options: Partial<ElectronBreadcrumbsOptions<EventTypes>>,\n): Partial<ElectronBreadcrumbsOptions<EventFunction | false>> {\n  return (Object.keys(options) as (keyof ElectronBreadcrumbsOptions<EventTypes>)[]).reduce((obj, k) => {\n    if (k === 'captureWindowTitles') {\n      obj[k] = !!options[k];\n    } else {\n      const val: EventTypes = options[k];\n      if (Array.isArray(val)) {\n        obj[k] = (name) => val.includes(name);\n      } else if (typeof val === 'function' || val === false) {\n        obj[k] = val;\n      }\n    }\n\n    return obj;\n  }, {} as Partial<ElectronBreadcrumbsOptions<EventFunction | false>>);\n}\n\n/** Adds breadcrumbs for Electron events. */\nexport class ElectronBreadcrumbs implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ElectronBreadcrumbs';\n\n  /** @inheritDoc */\n  public name: string = ElectronBreadcrumbs.id;\n\n  private readonly _options: ElectronBreadcrumbsOptions<EventFunction | false>;\n\n  /**\n   * @param _options Integration options\n   */\n  public constructor(options: Partial<ElectronBreadcrumbsOptions<EventTypes>> = {}) {\n    this._options = { ...DEFAULT_OPTIONS, ...normalizeOptions(options) };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const initOptions = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptions | undefined;\n\n    trackRendererProperties();\n\n    void whenAppReady.then(() => {\n      // We can't access these until app 'ready'\n      if (this._options.screen) {\n        this._patchEventEmitter(screen, 'screen', this._options.screen);\n      }\n\n      if (this._options.powerMonitor) {\n        this._patchEventEmitter(powerMonitor, 'powerMonitor', this._options.powerMonitor);\n      }\n    });\n\n    if (this._options.app) {\n      this._patchEventEmitter(app, 'app', this._options.app);\n    }\n\n    if (this._options.autoUpdater) {\n      this._patchEventEmitter(autoUpdater, 'autoUpdater', this._options.autoUpdater);\n    }\n\n    if (this._options.browserWindow) {\n      onBrowserWindowCreated((window) => {\n        const id = window.webContents.id;\n        const windowName = initOptions?.getRendererName?.(window.webContents) || 'window';\n        this._patchEventEmitter(window, windowName, this._options.browserWindow, id);\n      });\n    }\n\n    if (this._options.webContents) {\n      onWebContentsCreated((contents) => {\n        const id = contents.id;\n        const webContentsName = initOptions?.getRendererName?.(contents) || 'renderer';\n        this._patchEventEmitter(contents, webContentsName, this._options.webContents, id);\n      });\n    }\n  }\n\n  /**\n   * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈\n   */\n  private _patchEventEmitter(\n    emitter: NodeJS.EventEmitter | WebContents | BrowserWindow,\n    category: string,\n    shouldCapture: EventFunction | undefined | false,\n    id?: number | undefined,\n  ): void {\n    const emit = emitter.emit.bind(emitter) as (event: string, ...args: unknown[]) => boolean;\n\n    emitter.emit = (event: string, ...args: unknown[]) => {\n      if (shouldCapture && shouldCapture(event)) {\n        const breadcrumb: Breadcrumb = {\n          category: 'electron',\n          message: `${category}.${event}`,\n          timestamp: new Date().getTime() / 1_000,\n          type: 'ui',\n        };\n\n        if (id) {\n          breadcrumb.data = { ...getRendererProperties(id) };\n\n          if (!this._options.captureWindowTitles && breadcrumb.data?.title) {\n            delete breadcrumb.data?.title;\n          }\n        }\n\n        addBreadcrumb(breadcrumb);\n      }\n\n      return emit(event, ...args);\n    };\n  }\n}\n"]}import { Integration } from '@sentry/types';
/**
 * Returns the minidump endpoint in Sentry
 * @param dsn Dsn
 */
export declare function minidumpUrlFromDsn(dsn: string): string;
/** Sends minidumps via the Electron built-in uploader. */
export declare class ElectronMinidump implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** Counter used to ensure no race condition when updating extra params */
    private _updateEpoch;
    private _customRelease;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Starts the native crash reporter
     */
    private _startCrashReporter;
    /**
     * Adds a scope listener to persist changes to disk.
     */
    private _setupScopeListener;
    /** Updates Electron uploader extra params */
    private _updateExtraParams;
    /** Builds up an event to send with the native Electron uploader */
    private _getNativeUploaderEvent;
    /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader
     *
     * Returns chunks with keys and values:
     * {
     *    sentry__1: '{ json...',
     *    sentry__2: 'more json...',
     *    sentry__x: 'end json }',
     * }
     */
    private _getNativeUploaderExtraParams;
}
//# sourceMappingURL=electron-minidump.d.ts.map{"version":3,"file":"electron-minidump.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/electron-minidump.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAsCnD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED,0DAA0D;AAC1D,qBAAa,gBAAiB,YAAW,WAAW;IAClD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAuB;IAE1C,0EAA0E;IAC1E,OAAO,CAAC,YAAY,CAAa;IAEjC,OAAO,CAAC,cAAc,CAAqB;IAE3C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAuCxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAe3B,6CAA6C;IAC7C,OAAO,CAAC,kBAAkB;IAiB1B,mEAAmE;YACrD,uBAAuB;IAgBrC;;;;;;;;OAQG;IACH,OAAO,CAAC,6BAA6B;CA8BtC"}import { __awaiter } from "tslib";
import { getCurrentHub, Scope } from '@sentry/core';
import { logger, makeDsn, SentryError } from '@sentry/utils';
import { app, crashReporter } from 'electron';
import { mergeEvents, normalizeEvent } from '../../common';
import { getEventDefaults } from '../context';
import { CRASH_REASONS, onRendererProcessGone, rendererRequiresCrashReporterStart, usesCrashpad, } from '../electron-normalize';
import { checkPreviousSession, sessionCrashed, unreportedDuringLastSession } from '../sessions';
/** Is object defined and has keys */
function hasKeys(obj) {
    return obj != undefined && Object.keys(obj).length > 0;
}
/** Gets a Scope object with user, tags and extra */
function getScope(options) {
    const scope = getCurrentHub().getScope();
    if (!scope) {
        return {};
    }
    return Object.assign(Object.assign(Object.assign({ release: options.release, environment: options.environment }, (hasKeys(scope._user) && { user: scope._user })), (hasKeys(scope._tags) && { tags: scope._tags })), (hasKeys(scope._extra) && { extra: scope._extra }));
}
/**
 * Returns the minidump endpoint in Sentry
 * @param dsn Dsn
 */
export function minidumpUrlFromDsn(dsn) {
    const { host, path, projectId, port, protocol, publicKey } = makeDsn(dsn);
    return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${path !== '' ? `/${path}` : ''}/api/${projectId}/minidump/?sentry_key=${publicKey}`;
}
/** Sends minidumps via the Electron built-in uploader. */
export class ElectronMinidump {
    constructor() {
        /** @inheritDoc */
        this.name = ElectronMinidump.id;
        /** Counter used to ensure no race condition when updating extra params */
        this._updateEpoch = 0;
    }
    /** @inheritDoc */
    setupOnce() {
        var _a, _b;
        // Mac AppStore builds cannot run the crash reporter due to the sandboxing
        // requirements. In this case, we prevent enabling native crashes entirely.
        // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build
        if (process.mas) {
            return;
        }
        if (rendererRequiresCrashReporterStart()) {
            throw new SentryError(`The '${this.name}' integration is only supported with Electron >= v9`);
        }
        const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        if (!(options === null || options === void 0 ? void 0 : options.dsn)) {
            throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');
        }
        this._customRelease = options.release;
        this._startCrashReporter(options);
        // If a renderer process crashes, mark any existing session as crashed
        onRendererProcessGone(CRASH_REASONS, (_, __) => {
            sessionCrashed();
        });
        // If we're using the Crashpad minidump uploader, we set extra parameters whenever the scope updates
        if (usesCrashpad()) {
            this._setupScopeListener();
        }
        // Check if last crash report was likely to have been unreported in the last session
        void unreportedDuringLastSession((_b = crashReporter.getLastCrashReport()) === null || _b === void 0 ? void 0 : _b.date).then((crashed) => {
            // Check if a previous session was not closed
            checkPreviousSession(crashed).catch((error) => logger.error(error));
        });
    }
    /**
     * Starts the native crash reporter
     */
    _startCrashReporter(options) {
        // We don't add globalExtra when Breakpad is in use because it doesn't support JSON like strings:
        // https://github.com/electron/electron/issues/29711
        const globalExtra = usesCrashpad() ? { sentry___initialScope: JSON.stringify(getScope(options)) } : undefined;
        logger.log('Starting Electron crashReporter');
        crashReporter.start({
            companyName: '',
            ignoreSystemCrashHandler: true,
            productName: app.name || app.getName(),
            submitURL: minidumpUrlFromDsn(options.dsn || ''),
            uploadToServer: true,
            compress: true,
            globalExtra,
        });
    }
    /**
     * Adds a scope listener to persist changes to disk.
     */
    _setupScopeListener() {
        const hubScope = getCurrentHub().getScope();
        if (hubScope) {
            hubScope.addScopeListener((updatedScope) => {
                const scope = Scope.clone(updatedScope);
                /* eslint-disable @typescript-eslint/no-unsafe-member-access */
                scope._eventProcessors = [];
                scope._scopeListeners = [];
                /* eslint-enable @typescript-eslint/no-unsafe-member-access */
                this._updateExtraParams(scope);
            });
        }
    }
    /** Updates Electron uploader extra params */
    _updateExtraParams(scope) {
        this._updateEpoch += 1;
        const currentEpoch = this._updateEpoch;
        this._getNativeUploaderEvent(scope)
            .then((event) => {
            if (currentEpoch !== this._updateEpoch)
                return;
            // Update the extra parameters in the main process
            const mainParams = this._getNativeUploaderExtraParams(event);
            for (const key of Object.keys(mainParams)) {
                crashReporter.addExtraParameter(key, mainParams[key]);
            }
        })
            .catch((error) => logger.error(error));
    }
    /** Builds up an event to send with the native Electron uploader */
    _getNativeUploaderEvent(scope) {
        return __awaiter(this, void 0, void 0, function* () {
            const event = mergeEvents(yield getEventDefaults(this._customRelease), {
                level: 'fatal',
                platform: 'native',
                tags: { 'event.environment': 'native', event_type: 'native' },
            });
            // Apply the scope to the event
            yield scope.applyToEvent(event);
            delete event.sdkProcessingMetadata;
            // Normalise paths
            return normalizeEvent(event, app.getAppPath());
        });
    }
    /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader
     *
     * Returns chunks with keys and values:
     * {
     *    sentry__1: '{ json...',
     *    sentry__2: 'more json...',
     *    sentry__x: 'end json }',
     * }
     */
    _getNativeUploaderExtraParams(event) {
        const maxBytes = 20300;
        /** Max chunk sizes are in bytes so we can't chunk by characters or UTF8 could bite us.
         *
         * We attempt to split by space (32) and double quote characters (34) as there are plenty in JSON
         * and they are guaranteed to not be the first byte of a multi-byte UTF8 character.
         */
        let buf = Buffer.from(JSON.stringify(event));
        const chunks = [];
        while (buf.length) {
            // Find last '"'
            let i = buf.lastIndexOf(34, maxBytes + 1);
            // Or find last ' '
            if (i < 0)
                i = buf.lastIndexOf(32, maxBytes + 1);
            // Or find first '"'
            if (i < 0)
                i = buf.indexOf(34, maxBytes);
            // Or find first ' '
            if (i < 0)
                i = buf.indexOf(32, maxBytes);
            // We couldn't find any space or quote chars so split at maxBytes and hope for the best 🤷‍♂️
            if (i < 0)
                i = maxBytes;
            chunks.push(buf.subarray(0, i + 1).toString());
            buf = buf.subarray(i + 1);
        }
        return chunks.reduce((acc, cur, i) => {
            acc[`sentry__${i + 1}`] = cur;
            return acc;
        }, {});
    }
}
/** @inheritDoc */
ElectronMinidump.id = 'ElectronMinidump';
//# sourceMappingURL=electron-minidump.js.map{"version":3,"file":"electron-minidump.js","sourceRoot":"","sources":["../../../src/main/integrations/electron-minidump.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OA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AC;QACb,CAAC,EAAE,EAA+B,CAAC,CAAC;IACtC,CAAC;;AAnKD,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC","sourcesContent":["import { getCurrentHub, Scope } from '@sentry/core';\nimport { NodeClient, NodeOptions } from '@sentry/node';\nimport { Event, Integration } from '@sentry/types';\nimport { logger, makeDsn, SentryError } from '@sentry/utils';\nimport { app, crashReporter } from 'electron';\n\nimport { mergeEvents, normalizeEvent } from '../../common';\nimport { getEventDefaults } from '../context';\nimport {\n  CRASH_REASONS,\n  onRendererProcessGone,\n  rendererRequiresCrashReporterStart,\n  usesCrashpad,\n} from '../electron-normalize';\nimport { checkPreviousSession, sessionCrashed, unreportedDuringLastSession } from '../sessions';\n\n/** Is object defined and has keys */\nfunction hasKeys(obj: any): boolean {\n  return obj != undefined && Object.keys(obj).length > 0;\n}\n\n/** Gets a Scope object with user, tags and extra */\nfunction getScope(options: NodeOptions): Event {\n  const scope = getCurrentHub().getScope() as any | undefined;\n\n  if (!scope) {\n    return {};\n  }\n\n  return {\n    release: options.release,\n    environment: options.environment,\n    /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n    ...(hasKeys(scope._user) && { user: scope._user }),\n    ...(hasKeys(scope._tags) && { tags: scope._tags }),\n    ...(hasKeys(scope._extra) && { extra: scope._extra }),\n    /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  };\n}\n\n/**\n * Returns the minidump endpoint in Sentry\n * @param dsn Dsn\n */\nexport function minidumpUrlFromDsn(dsn: string): string {\n  const { host, path, projectId, port, protocol, publicKey } = makeDsn(dsn);\n  return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${\n    path !== '' ? `/${path}` : ''\n  }/api/${projectId}/minidump/?sentry_key=${publicKey}`;\n}\n\n/** Sends minidumps via the Electron built-in uploader. */\nexport class ElectronMinidump implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ElectronMinidump';\n\n  /** @inheritDoc */\n  public name: string = ElectronMinidump.id;\n\n  /** Counter used to ensure no race condition when updating extra params */\n  private _updateEpoch: number = 0;\n\n  private _customRelease: string | undefined;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // Mac AppStore builds cannot run the crash reporter due to the sandboxing\n    // requirements. In this case, we prevent enabling native crashes entirely.\n    // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build\n    if (process.mas) {\n      return;\n    }\n\n    if (rendererRequiresCrashReporterStart()) {\n      throw new SentryError(`The '${this.name}' integration is only supported with Electron >= v9`);\n    }\n\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    if (!options?.dsn) {\n      throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');\n    }\n\n    this._customRelease = options.release;\n\n    this._startCrashReporter(options);\n\n    // If a renderer process crashes, mark any existing session as crashed\n    onRendererProcessGone(CRASH_REASONS, (_, __) => {\n      sessionCrashed();\n    });\n\n    // If we're using the Crashpad minidump uploader, we set extra parameters whenever the scope updates\n    if (usesCrashpad()) {\n      this._setupScopeListener();\n    }\n\n    // Check if last crash report was likely to have been unreported in the last session\n    void unreportedDuringLastSession(crashReporter.getLastCrashReport()?.date).then((crashed) => {\n      // Check if a previous session was not closed\n      checkPreviousSession(crashed).catch((error) => logger.error(error));\n    });\n  }\n\n  /**\n   * Starts the native crash reporter\n   */\n  private _startCrashReporter(options: NodeOptions): void {\n    // We don't add globalExtra when Breakpad is in use because it doesn't support JSON like strings:\n    // https://github.com/electron/electron/issues/29711\n    const globalExtra = usesCrashpad() ? { sentry___initialScope: JSON.stringify(getScope(options)) } : undefined;\n\n    logger.log('Starting Electron crashReporter');\n\n    crashReporter.start({\n      companyName: '',\n      ignoreSystemCrashHandler: true,\n      productName: app.name || app.getName(),\n      submitURL: minidumpUrlFromDsn(options.dsn || ''),\n      uploadToServer: true,\n      compress: true,\n      globalExtra,\n    });\n  }\n\n  /**\n   * Adds a scope listener to persist changes to disk.\n   */\n  private _setupScopeListener(): void {\n    const hubScope = getCurrentHub().getScope();\n    if (hubScope) {\n      hubScope.addScopeListener((updatedScope) => {\n        const scope = Scope.clone(updatedScope);\n        /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n        (scope as any)._eventProcessors = [];\n        (scope as any)._scopeListeners = [];\n        /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n        this._updateExtraParams(scope);\n      });\n    }\n  }\n\n  /** Updates Electron uploader extra params */\n  private _updateExtraParams(scope: Scope): void {\n    this._updateEpoch += 1;\n    const currentEpoch = this._updateEpoch;\n\n    this._getNativeUploaderEvent(scope)\n      .then((event) => {\n        if (currentEpoch !== this._updateEpoch) return;\n\n        // Update the extra parameters in the main process\n        const mainParams = this._getNativeUploaderExtraParams(event);\n        for (const key of Object.keys(mainParams)) {\n          crashReporter.addExtraParameter(key, mainParams[key]);\n        }\n      })\n      .catch((error) => logger.error(error));\n  }\n\n  /** Builds up an event to send with the native Electron uploader */\n  private async _getNativeUploaderEvent(scope: Scope): Promise<Event> {\n    const event = mergeEvents(await getEventDefaults(this._customRelease), {\n      level: 'fatal',\n      platform: 'native',\n      tags: { 'event.environment': 'native', event_type: 'native' },\n    });\n\n    // Apply the scope to the event\n    await scope.applyToEvent(event);\n\n    delete event.sdkProcessingMetadata;\n\n    // Normalise paths\n    return normalizeEvent(event, app.getAppPath());\n  }\n\n  /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader\n   *\n   * Returns chunks with keys and values:\n   * {\n   *    sentry__1: '{ json...',\n   *    sentry__2: 'more json...',\n   *    sentry__x: 'end json }',\n   * }\n   */\n  private _getNativeUploaderExtraParams(event: Event): { [key: string]: string } {\n    const maxBytes = 20300;\n\n    /** Max chunk sizes are in bytes so we can't chunk by characters or UTF8 could bite us.\n     *\n     * We attempt to split by space (32) and double quote characters (34) as there are plenty in JSON\n     * and they are guaranteed to not be the first byte of a multi-byte UTF8 character.\n     */\n    let buf = Buffer.from(JSON.stringify(event));\n    const chunks = [];\n    while (buf.length) {\n      // Find last '\"'\n      let i = buf.lastIndexOf(34, maxBytes + 1);\n      // Or find last ' '\n      if (i < 0) i = buf.lastIndexOf(32, maxBytes + 1);\n      // Or find first '\"'\n      if (i < 0) i = buf.indexOf(34, maxBytes);\n      // Or find first ' '\n      if (i < 0) i = buf.indexOf(32, maxBytes);\n      // We couldn't find any space or quote chars so split at maxBytes and hope for the best 🤷‍♂️\n      if (i < 0) i = maxBytes;\n      chunks.push(buf.subarray(0, i + 1).toString());\n      buf = buf.subarray(i + 1);\n    }\n\n    return chunks.reduce((acc, cur, i) => {\n      acc[`sentry__${i + 1}`] = cur;\n      return acc;\n    }, {} as { [key: string]: string });\n  }\n}\n"]}export { ElectronBreadcrumbs } from './electron-breadcrumbs';
export { OnUncaughtException } from './onuncaughtexception';
export { MainContext } from './main-context';
export { SentryMinidump } from './sentry-minidump';
export { ElectronMinidump } from './electron-minidump';
export { PreloadInjection } from './preload-injection';
export { MainProcessSession } from './main-process-session';
export { AdditionalContext } from './additional-context';
export { Net } from './net-breadcrumbs';
export { ChildProcess } from './child-process';
export { Screenshots } from './screenshots';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}export { ElectronBreadcrumbs } from './electron-breadcrumbs';
export { OnUncaughtException } from './onuncaughtexception';
export { MainContext } from './main-context';
export { SentryMinidump } from './sentry-minidump';
export { ElectronMinidump } from './electron-minidump';
export { PreloadInjection } from './preload-injection';
export { MainProcessSession } from './main-process-session';
export { AdditionalContext } from './additional-context';
export { Net } from './net-breadcrumbs';
export { ChildProcess } from './child-process';
export { Screenshots } from './screenshots';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/main/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { ElectronBreadcrumbs } from './electron-breadcrumbs';\nexport { OnUncaughtException } from './onuncaughtexception';\nexport { MainContext } from './main-context';\nexport { SentryMinidump } from './sentry-minidump';\nexport { ElectronMinidump } from './electron-minidump';\nexport { PreloadInjection } from './preload-injection';\nexport { MainProcessSession } from './main-process-session';\nexport { AdditionalContext } from './additional-context';\nexport { Net } from './net-breadcrumbs';\nexport { ChildProcess } from './child-process';\nexport { Screenshots } from './screenshots';\n"]}import { EventProcessor, Integration } from '@sentry/types';
/** Adds Electron context to events and normalises paths. */
export declare class MainContext implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=main-context.d.ts.map{"version":3,"file":"main-context.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/main-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMnE,4DAA4D;AAC5D,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CASpF"}import { __awaiter } from "tslib";
import { getCurrentHub } from '@sentry/core';
import { app } from 'electron';
import { mergeEvents, normalizeEvent } from '../../common';
import { getEventDefaults } from '../context';
/** Adds Electron context to events and normalises paths. */
export class MainContext {
    constructor() {
        /** @inheritDoc */
        this.name = MainContext.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        var _a;
        const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        addGlobalEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
            const normalized = normalizeEvent(event, app.getAppPath());
            const defaults = yield getEventDefaults(options === null || options === void 0 ? void 0 : options.release, options === null || options === void 0 ? void 0 : options.environment);
            return mergeEvents(defaults, normalized);
        }));
    }
}
/** @inheritDoc */
MainContext.id = 'MainContext';
//# sourceMappingURL=main-context.js.map{"version":3,"file":"main-context.js","sourceRoot":"","sources":["../../../src/main/integrations/main-context.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,4DAA4D;AAC5D,MAAM,OAAO,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAYvC,CAAC;IAVC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;;QAC1E,MAAM,OAAO,GAAG,MAAA,aAAa,EAAE,CAAC,SAAS,EAAc,0CAAE,UAAU,EAAE,CAAC;QAEtE,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;YAC7C,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;YAC3D,MAAM,QAAQ,GAAG,MAAM,gBAAgB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC;YAChF,OAAO,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC3C,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAfD,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Event, EventProcessor, Integration } from '@sentry/types';\nimport { app } from 'electron';\n\nimport { mergeEvents, normalizeEvent } from '../../common';\nimport { getEventDefaults } from '../context';\n\n/** Adds Electron context to events and normalises paths. */\nexport class MainContext implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'MainContext';\n\n  /** @inheritDoc */\n  public name: string = MainContext.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    addGlobalEventProcessor(async (event: Event) => {\n      const normalized = normalizeEvent(event, app.getAppPath());\n      const defaults = await getEventDefaults(options?.release, options?.environment);\n      return mergeEvents(defaults, normalized);\n    });\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** Tracks sessions as the main process lifetime. */
export declare class MainProcessSession implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Hooks 'will-quit' and ensures the handler is always last
     */
    private _ensureExitHandlerLast;
    /** Handles the exit */
    private _exitHandler;
}
//# sourceMappingURL=main-process-session.d.ts.map{"version":3,"file":"main-process-session.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/main-process-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,oDAAoD;AACpD,qBAAa,kBAAmB,YAAW,WAAW;IACpD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAwB;IAEhD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAyB;IAE5C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAgBxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAmBlB;CACH"}import { __awaiter } from "tslib";
import { logger } from '@sentry/utils';
import { app } from 'electron';
import { endSession, startSession } from '../sessions';
/** Tracks sessions as the main process lifetime. */
export class MainProcessSession {
    constructor() {
        /** @inheritDoc */
        this.name = MainProcessSession.id;
        /** Handles the exit */
        this._exitHandler = (event) => __awaiter(this, void 0, void 0, function* () {
            if (event.defaultPrevented) {
                return;
            }
            logger.log('[MainProcessSession] Exit Handler');
            // Stop the exit so we have time to send the session
            event.preventDefault();
            try {
                // End the session
                yield endSession();
            }
            catch (e) {
                // Ignore and log any errors which would prevent app exit
                logger.warn('[MainProcessSession] Error ending session:', e);
            }
            app.exit();
        });
    }
    /** @inheritDoc */
    setupOnce() {
        void startSession();
        // We track sessions via the 'will-quit' event which is the last event emitted before close.
        //
        // We need to be the last 'will-quit' listener so as not to interfere with any user defined listeners which may
        // call `event.preventDefault()`.
        this._ensureExitHandlerLast();
        // 'before-quit' is always called before 'will-quit' so we listen there and ensure our 'will-quit' handler is still
        // the last listener
        app.on('before-quit', () => {
            this._ensureExitHandlerLast();
        });
    }
    /**
     * Hooks 'will-quit' and ensures the handler is always last
     */
    _ensureExitHandlerLast() {
        app.removeListener('will-quit', this._exitHandler);
        app.on('will-quit', this._exitHandler);
    }
}
/** @inheritDoc */
MainProcessSession.id = 'MainProcessSession';
//# sourceMappingURL=main-process-session.js.map{"version":3,"file":"main-process-session.js","sourceRoot":"","sources":["../../../src/main/integrations/main-process-session.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvD,oDAAoD;AACpD,MAAM,OAAO,kBAAkB;IAA/B;QAIE,kBAAkB;QACX,SAAI,GAAW,kBAAkB,CAAC,EAAE,CAAC;QA2B5C,uBAAuB;QACf,iBAAY,GAA6C,CAAO,KAAqB,EAAE,EAAE;YAC/F,IAAI,KAAK,CAAC,gBAAgB,EAAE;gBAC1B,OAAO;aACR;YAED,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;YAEhD,oDAAoD;YACpD,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvB,IAAI;gBACF,kBAAkB;gBAClB,MAAM,UAAU,EAAE,CAAC;aACpB;YAAC,OAAO,CAAC,EAAE;gBACV,yDAAyD;gBACzD,MAAM,CAAC,IAAI,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAC;aAC9D;YAED,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,CAAC,CAAA,CAAC;IACJ,CAAC;IA9CC,kBAAkB;IACX,SAAS;QACd,KAAK,YAAY,EAAE,CAAC;QAEpB,4FAA4F;QAC5F,EAAE;QACF,+GAA+G;QAC/G,iCAAiC;QACjC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAE9B,mHAAmH;QACnH,oBAAoB;QACpB,GAAG,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;YACzB,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,sBAAsB;QAC5B,GAAG,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACnD,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;;AA7BD,kBAAkB;AACJ,qBAAE,GAAW,oBAAoB,CAAC","sourcesContent":["import { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { app } from 'electron';\n\nimport { endSession, startSession } from '../sessions';\n\n/** Tracks sessions as the main process lifetime. */\nexport class MainProcessSession implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'MainProcessSession';\n\n  /** @inheritDoc */\n  public name: string = MainProcessSession.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    void startSession();\n\n    // We track sessions via the 'will-quit' event which is the last event emitted before close.\n    //\n    // We need to be the last 'will-quit' listener so as not to interfere with any user defined listeners which may\n    // call `event.preventDefault()`.\n    this._ensureExitHandlerLast();\n\n    // 'before-quit' is always called before 'will-quit' so we listen there and ensure our 'will-quit' handler is still\n    // the last listener\n    app.on('before-quit', () => {\n      this._ensureExitHandlerLast();\n    });\n  }\n\n  /**\n   * Hooks 'will-quit' and ensures the handler is always last\n   */\n  private _ensureExitHandlerLast(): void {\n    app.removeListener('will-quit', this._exitHandler);\n    app.on('will-quit', this._exitHandler);\n  }\n\n  /** Handles the exit */\n  private _exitHandler: (event: Electron.Event) => Promise<void> = async (event: Electron.Event) => {\n    if (event.defaultPrevented) {\n      return;\n    }\n\n    logger.log('[MainProcessSession] Exit Handler');\n\n    // Stop the exit so we have time to send the session\n    event.preventDefault();\n\n    try {\n      // End the session\n      await endSession();\n    } catch (e) {\n      // Ignore and log any errors which would prevent app exit\n      logger.warn('[MainProcessSession] Error ending session:', e);\n    }\n\n    app.exit();\n  };\n}\n"]}import { Integration } from '@sentry/types';
import { OrBool, OrFalse } from '../../common/types';
type ShouldTraceFn = (method: string, url: string) => boolean;
interface NetOptions {
    /**
     * Whether breadcrumbs should be captured for net requests
     *
     * Defaults to: true
     */
    breadcrumbs: boolean;
    /**
     * Whether to capture transaction spans for net requests
     *
     * true | false | (method: string, url: string) => boolean
     * Defaults to: true
     */
    tracing: ShouldTraceFn;
    /**
     * Whether to add 'sentry-trace' headers to outgoing requests
     *
     * true | false | (method: string, url: string) => boolean
     * Defaults to: true
     */
    tracingOrigins: ShouldTraceFn;
}
/** Converts all user supplied options to T | false */
export declare function normalizeOptions(options: Partial<OrBool<NetOptions>>): Partial<OrFalse<NetOptions>>;
/** http module integration */
export declare class Net implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /** @inheritDoc */
    constructor(options?: Partial<OrBool<NetOptions>>);
    /** @inheritDoc */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=net-breadcrumbs.d.ts.map{"version":3,"file":"net-breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/net-breadcrumbs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAC;AAKlD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAE9D,UAAU,UAAU;IAClB;;;;OAIG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;OAKG;IACH,cAAc,EAAE,aAAa,CAAC;CAC/B;AAQD,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAOnG;AAED,8BAA8B;AAC9B,qBAAa,GAAI,YAAW,WAAW;IACrC,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAS;IAEjC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAU;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C,kBAAkB;gBACC,OAAO,GAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAM;IAO5D,kBAAkB;IACX,SAAS,IAAI,IAAI;CAMzB"}/* eslint-disable deprecation/deprecation */
import { getCurrentHub } from '@sentry/core';
import { fill } from '@sentry/utils';
import { net } from 'electron';
import * as urlModule from 'url';
const DEFAULT_OPTIONS = {
    breadcrumbs: true,
    tracing: (_method, _url) => true,
    tracingOrigins: (_method, _url) => true,
};
/** Converts all user supplied options to T | false */
export function normalizeOptions(options) {
    return Object.keys(options).reduce((obj, k) => {
        if (typeof options[k] === 'function' || options[k] === false) {
            obj[k] = options[k];
        }
        return obj;
    }, {});
}
/** http module integration */
export class Net {
    /** @inheritDoc */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = Net.id;
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), normalizeOptions(options));
    }
    /** @inheritDoc */
    setupOnce() {
        // No need to instrument if we don't want to track anything
        if (this._options.breadcrumbs || this._options.tracing) {
            fill(net, 'request', createWrappedRequestFactory(this._options));
        }
    }
}
/** @inheritDoc */
Net.id = 'Net';
/**
 * Trimmed down version of the code from Electron here:
 * https://github.com/electron/electron/blob/f3df76dbdc58cb704637b89357e1400791c92cfe/lib/browser/api/net.ts#L209-L269
 *
 * We want to match the final URL that Electron uses
 */
function parseOptions(optionsIn) {
    const { method, options } = typeof optionsIn === 'string'
        ? { method: 'GET', options: urlModule.parse(optionsIn) }
        : { method: (optionsIn.method || 'GET').toUpperCase(), options: optionsIn };
    let url = 'url' in options ? options.url : undefined;
    if (!url) {
        const urlObj = {};
        urlObj.protocol = options.protocol || 'http:';
        if (options.host) {
            urlObj.host = options.host;
        }
        else {
            if (options.hostname) {
                urlObj.hostname = options.hostname;
            }
            else {
                urlObj.hostname = 'localhost';
            }
            if (options.port) {
                urlObj.port = options.port;
            }
        }
        const pathObj = urlModule.parse(options.path || '/');
        urlObj.pathname = pathObj.pathname;
        urlObj.search = pathObj.search;
        urlObj.hash = pathObj.hash;
        url = urlModule.format(urlObj);
    }
    return {
        method,
        url,
    };
}
/** */
function createWrappedRequestFactory(options) {
    return function wrappedRequestMethodFactory(originalRequestMethod) {
        return function requestMethod(reqOptions) {
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const netModule = this;
            const { url, method } = parseOptions(reqOptions);
            const request = originalRequestMethod.apply(netModule, [reqOptions]);
            if (url.match(/sentry_key/) || request.getHeader('x-sentry-auth')) {
                return request;
            }
            let span;
            const scope = getCurrentHub().getScope();
            if (scope && options.tracing && options.tracing(method, url)) {
                const parentSpan = scope.getSpan();
                if (parentSpan) {
                    span = parentSpan.startChild({
                        description: `${method} ${url}`,
                        op: 'http.client',
                    });
                    if (options.tracingOrigins && options.tracingOrigins(method, url)) {
                        request.setHeader('sentry-trace', span.toTraceparent());
                    }
                }
            }
            return request
                .once('response', function (res) {
                // eslint-disable-next-line @typescript-eslint/no-this-alias
                const req = this;
                if (options.breadcrumbs) {
                    addRequestBreadcrumb('response', method, url, req, res);
                }
                if (span) {
                    if (res.statusCode) {
                        span.setHttpStatus(res.statusCode);
                    }
                    span.finish();
                }
            })
                .once('error', function (_error) {
                // eslint-disable-next-line @typescript-eslint/no-this-alias
                const req = this;
                if (options.breadcrumbs) {
                    addRequestBreadcrumb('error', method, url, req, undefined);
                }
                if (span) {
                    span.setHttpStatus(500);
                    span.finish();
                }
            });
        };
    };
}
/**
 * Captures Breadcrumb based on provided request/response pair
 */
function addRequestBreadcrumb(event, method, url, req, res) {
    getCurrentHub().addBreadcrumb({
        type: 'http',
        category: 'electron.net',
        data: {
            url,
            method: method,
            status_code: res && res.statusCode,
        },
    }, {
        event,
        request: req,
        response: res,
    });
}
//# sourceMappingURL=net-breadcrumbs.js.map{"version":3,"file":"net-breadcrumbs.js","sourceRoot":"","sources":["../../../src/main/integrations/net-breadcrumbs.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAmE,GAAG,EAAE,MAAM,UAAU,CAAC;AAChG,OAAO,KAAK,SAAS,MAAM,KAAK,CAAC;AA6BjC,MAAM,eAAe,GAAe;IAClC,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;IAChC,cAAc,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;CACxC,CAAC;AAEF,sDAAsD;AACtD,MAAM,UAAU,gBAAgB,CAAC,OAAoC;IACnE,OAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAA0B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACtE,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YAC5D,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAsC,CAAC;SAC1D;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAkC,CAAC,CAAC;AACzC,CAAC;AAED,8BAA8B;AAC9B,MAAM,OAAO,GAAG;IASd,kBAAkB;IAClB,YAAmB,UAAuC,E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AC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAC3B,KAAa,EACb,MAAc,EACd,GAAW,EACX,GAAkB,EAClB,GAAqB;IAErB,aAAa,EAAE,CAAC,aAAa,CAC3B;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,cAAc;QACxB,IAAI,EAAE;YACJ,GAAG;YACH,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,GAAG,IAAI,GAAG,CAAC,UAAU;SACnC;KACF,EACD;QACE,KAAK;QACL,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,GAAG;KACd,CACF,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { getCurrentHub } from '@sentry/core';\nimport { Integration, Span } from '@sentry/types';\nimport { fill } from '@sentry/utils';\nimport { ClientRequest, ClientRequestConstructorOptions, IncomingMessage, net } from 'electron';\nimport * as urlModule from 'url';\n\nimport { OrBool, OrFalse } from '../../common/types';\n\ntype ShouldTraceFn = (method: string, url: string) => boolean;\n\ninterface NetOptions {\n  /**\n   * Whether breadcrumbs should be captured for net requests\n   *\n   * Defaults to: true\n   */\n  breadcrumbs: boolean;\n  /**\n   * Whether to capture transaction spans for net requests\n   *\n   * true | false | (method: string, url: string) => boolean\n   * Defaults to: true\n   */\n  tracing: ShouldTraceFn;\n  /**\n   * Whether to add 'sentry-trace' headers to outgoing requests\n   *\n   * true | false | (method: string, url: string) => boolean\n   * Defaults to: true\n   */\n  tracingOrigins: ShouldTraceFn;\n}\n\nconst DEFAULT_OPTIONS: NetOptions = {\n  breadcrumbs: true,\n  tracing: (_method, _url) => true,\n  tracingOrigins: (_method, _url) => true,\n};\n\n/** Converts all user supplied options to T | false */\nexport function normalizeOptions(options: Partial<OrBool<NetOptions>>): Partial<OrFalse<NetOptions>> {\n  return (Object.keys(options) as (keyof NetOptions)[]).reduce((obj, k) => {\n    if (typeof options[k] === 'function' || options[k] === false) {\n      obj[k] = options[k] as boolean & (false | ShouldTraceFn);\n    }\n    return obj;\n  }, {} as Partial<OrFalse<NetOptions>>);\n}\n\n/** http module integration */\nexport class Net implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'Net';\n\n  /** @inheritDoc */\n  public name: string = Net.id;\n\n  private readonly _options: OrFalse<NetOptions>;\n\n  /** @inheritDoc */\n  public constructor(options: Partial<OrBool<NetOptions>> = {}) {\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...normalizeOptions(options),\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // No need to instrument if we don't want to track anything\n    if (this._options.breadcrumbs || this._options.tracing) {\n      fill(net, 'request', createWrappedRequestFactory(this._options));\n    }\n  }\n}\n\n/**\n * Trimmed down version of the code from Electron here:\n * https://github.com/electron/electron/blob/f3df76dbdc58cb704637b89357e1400791c92cfe/lib/browser/api/net.ts#L209-L269\n *\n * We want to match the final URL that Electron uses\n */\nfunction parseOptions(optionsIn: ClientRequestConstructorOptions | string): { method: string; url: string } {\n  const { method, options } =\n    typeof optionsIn === 'string'\n      ? { method: 'GET', options: urlModule.parse(optionsIn) }\n      : { method: (optionsIn.method || 'GET').toUpperCase(), options: optionsIn };\n\n  let url = 'url' in options ? options.url : undefined;\n\n  if (!url) {\n    const urlObj: urlModule.UrlObject = {};\n    urlObj.protocol = options.protocol || 'http:';\n\n    if (options.host) {\n      urlObj.host = options.host;\n    } else {\n      if (options.hostname) {\n        urlObj.hostname = options.hostname;\n      } else {\n        urlObj.hostname = 'localhost';\n      }\n\n      if (options.port) {\n        urlObj.port = options.port;\n      }\n    }\n\n    const pathObj = urlModule.parse(options.path || '/');\n    urlObj.pathname = pathObj.pathname;\n    urlObj.search = pathObj.search;\n    urlObj.hash = pathObj.hash;\n    url = urlModule.format(urlObj);\n  }\n\n  return {\n    method,\n    url,\n  };\n}\n\ntype RequestOptions = string | ClientRequestConstructorOptions;\ntype RequestMethod = (opt: RequestOptions) => ClientRequest;\ntype WrappedRequestMethodFactory = (original: RequestMethod) => RequestMethod;\n\n/** */\nfunction createWrappedRequestFactory(options: OrFalse<NetOptions>): WrappedRequestMethodFactory {\n  return function wrappedRequestMethodFactory(originalRequestMethod: RequestMethod): RequestMethod {\n    return function requestMethod(this: typeof net, reqOptions: RequestOptions): ClientRequest {\n      // eslint-disable-next-line @typescript-eslint/no-this-alias\n      const netModule = this;\n\n      const { url, method } = parseOptions(reqOptions);\n      const request = originalRequestMethod.apply(netModule, [reqOptions]) as ClientRequest;\n\n      if (url.match(/sentry_key/) || request.getHeader('x-sentry-auth')) {\n        return request;\n      }\n\n      let span: Span | undefined;\n\n      const scope = getCurrentHub().getScope();\n      if (scope && options.tracing && options.tracing(method, url)) {\n        const parentSpan = scope.getSpan();\n\n        if (parentSpan) {\n          span = parentSpan.startChild({\n            description: `${method} ${url}`,\n            op: 'http.client',\n          });\n\n          if (options.tracingOrigins && options.tracingOrigins(method, url)) {\n            request.setHeader('sentry-trace', span.toTraceparent());\n          }\n        }\n      }\n\n      return request\n        .once('response', function (this: ClientRequest, res: IncomingMessage): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n          if (options.breadcrumbs) {\n            addRequestBreadcrumb('response', method, url, req, res);\n          }\n          if (span) {\n            if (res.statusCode) {\n              span.setHttpStatus(res.statusCode);\n            }\n            span.finish();\n          }\n        })\n        .once('error', function (this: ClientRequest, _error: Error): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n\n          if (options.breadcrumbs) {\n            addRequestBreadcrumb('error', method, url, req, undefined);\n          }\n          if (span) {\n            span.setHttpStatus(500);\n            span.finish();\n          }\n        });\n    };\n  };\n}\n\n/**\n * Captures Breadcrumb based on provided request/response pair\n */\nfunction addRequestBreadcrumb(\n  event: string,\n  method: string,\n  url: string,\n  req: ClientRequest,\n  res?: IncomingMessage,\n): void {\n  getCurrentHub().addBreadcrumb(\n    {\n      type: 'http',\n      category: 'electron.net',\n      data: {\n        url,\n        method: method,\n        status_code: res && res.statusCode,\n      },\n    },\n    {\n      event,\n      request: req,\n      response: res,\n    },\n  );\n}\n"]}import { Integration } from '@sentry/types';
/** Capture unhandled errors. */
export declare class OnUncaughtException implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
//# sourceMappingURL=onuncaughtexception.d.ts.map{"version":3,"file":"onuncaughtexception.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/onuncaughtexception.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAGnD,gCAAgC;AAChC,qBAAa,mBAAoB,YAAW,WAAW;IACrD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAyB;IAEjD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAA0B;IAE7C;;OAEG;IACI,SAAS,IAAI,IAAI;CAkCzB"}import { __awaiter } from "tslib";
import { getCurrentHub } from '@sentry/core';
import { dialog } from 'electron';
/** Capture unhandled errors. */
export class OnUncaughtException {
    constructor() {
        /** @inheritDoc */
        this.name = OnUncaughtException.id;
    }
    /**
     * @inheritDoc
     */
    setupOnce() {
        var _a;
        const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        global.process.on('uncaughtException', (error) => {
            const self = getCurrentHub().getIntegration(OnUncaughtException);
            if (self) {
                getCurrentHub().withScope((scope) => __awaiter(this, void 0, void 0, function* () {
                    scope.addEventProcessor((event) => __awaiter(this, void 0, void 0, function* () {
                        return (Object.assign(Object.assign({}, event), { level: 'fatal' }));
                    }));
                    const nodeClient = getCurrentHub().getClient();
                    nodeClient.captureException(error, { originalException: error }, getCurrentHub().getScope());
                    yield nodeClient.flush(nodeClient.getOptions().shutdownTimeout || 2000);
                    if (options === null || options === void 0 ? void 0 : options.onFatalError) {
                        options.onFatalError(error);
                    }
                    else if (global.process.listenerCount('uncaughtException') <= 2) {
                        // In addition to this handler there is always one in Electron
                        // The dialog is only shown if there are no other handlers
                        // eslint-disable-next-line no-console
                        console.error('Uncaught Exception:');
                        // eslint-disable-next-line no-console
                        console.error(error);
                        const ref = error.stack;
                        const stack = ref !== undefined ? ref : `${error.name}: ${error.message}`;
                        const message = `Uncaught Exception:\n${stack}`;
                        dialog.showErrorBox('A JavaScript error occurred in the main process', message);
                    }
                }));
            }
        });
    }
}
/** @inheritDoc */
OnUncaughtException.id = 'OnUncaughtException';
//# sourceMappingURL=onuncaughtexception.js.map{"version":3,"file":"onuncaughtexception.js","sourceRoot":"","sources":["../../../src/main/integrations/onuncaughtexception.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,gCAAgC;AAChC,MAAM,OAAO,mBAAmB;IAAhC;QAIE,kBAAkB;QACX,SAAI,GAAW,mBAAmB,CAAC,EAAE,CAAC;IAuC/C,CAAC;IArCC;;OAEG;IACI,SAAS;;QACd,MAAM,OAAO,GAAG,MAAA,aAAa,EAAE,CAAC,SAAS,EAAc,0CAAE,UAAU,EAAE,CAAC;QAEtE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAY,EAAE,EAAE;YACtD,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;YACjE,IAAI,IAAI,EAAE;gBACR,aAAa,EAAE,CAAC,SAAS,CAAC,CAAO,KAAK,EAAE,EAAE;oBACxC,KAAK,CAAC,iBAAiB,CAAC,CAAO,KAAY,EAAE,EAAE;wBAAC,OAAA,iCAC3C,KAAK,KACR,KAAK,EAAE,OAAO,IACd,CAAA;sBAAA,CAAC,CAAC;oBAEJ,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC,SAAS,EAAgB,CAAC;oBAC7D,UAAU,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;oBAC7F,MAAM,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC;oBAExE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAE;wBACzB,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;qBAC7B;yBAAM,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE;wBACjE,8DAA8D;wBAC9D,0DAA0D;wBAC1D,sCAAsC;wBACtC,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;wBACrC,sCAAsC;wBACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;wBACrB,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC;wBACxB,MAAM,KAAK,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;wBAC1E,MAAM,OAAO,GAAG,wBAAwB,KAAK,EAAE,CAAC;wBAChD,MAAM,CAAC,YAAY,CAAC,iDAAiD,EAAE,OAAO,CAAC,CAAC;qBACjF;gBACH,CAAC,CAAA,CAAC,CAAC;aACJ;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AA1CD,kBAAkB;AACJ,sBAAE,GAAW,qBAAqB,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Event, Integration } from '@sentry/types';\nimport { dialog } from 'electron';\n\n/** Capture unhandled errors. */\nexport class OnUncaughtException implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'OnUncaughtException';\n\n  /** @inheritDoc */\n  public name: string = OnUncaughtException.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    global.process.on('uncaughtException', (error: Error) => {\n      const self = getCurrentHub().getIntegration(OnUncaughtException);\n      if (self) {\n        getCurrentHub().withScope(async (scope) => {\n          scope.addEventProcessor(async (event: Event) => ({\n            ...event,\n            level: 'fatal',\n          }));\n\n          const nodeClient = getCurrentHub().getClient() as NodeClient;\n          nodeClient.captureException(error, { originalException: error }, getCurrentHub().getScope());\n          await nodeClient.flush(nodeClient.getOptions().shutdownTimeout || 2000);\n\n          if (options?.onFatalError) {\n            options.onFatalError(error);\n          } else if (global.process.listenerCount('uncaughtException') <= 2) {\n            // In addition to this handler there is always one in Electron\n            // The dialog is only shown if there are no other handlers\n            // eslint-disable-next-line no-console\n            console.error('Uncaught Exception:');\n            // eslint-disable-next-line no-console\n            console.error(error);\n            const ref = error.stack;\n            const stack = ref !== undefined ? ref : `${error.name}: ${error.message}`;\n            const message = `Uncaught Exception:\\n${stack}`;\n            dialog.showErrorBox('A JavaScript error occurred in the main process', message);\n          }\n        });\n      }\n    });\n  }\n}\n"]}import { Integration } from '@sentry/types';
/**
 * Injects the preload script into the provided sessions.
 *
 * Defaults to injecting into the defaultSession
 */
export declare class PreloadInjection implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Attempts to add the preload script the the provided sessions
     */
    private _addPreloadToSessions;
}
//# sourceMappingURL=preload-injection.d.ts.map{"version":3,"file":"preload-injection.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/preload-injection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAuB;IAE1C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAcxB;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAsB9B"}import { getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';
import { app } from 'electron';
import { existsSync } from 'fs';
import { isAbsolute } from 'path';
import { IPCMode } from '../../common';
import { rendererRequiresCrashReporterStart } from '../electron-normalize';
/**
 * Injects the preload script into the provided sessions.
 *
 * Defaults to injecting into the defaultSession
 */
export class PreloadInjection {
    constructor() {
        /** @inheritDoc */
        this.name = PreloadInjection.id;
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const options = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        // If classic IPC mode is disabled, we shouldn't attempt to inject preload scripts
        // eslint-disable-next-line no-bitwise
        if ((options.ipcMode & IPCMode.Classic) == 0) {
            return;
        }
        app.once('ready', () => {
            this._addPreloadToSessions(options);
        });
    }
    /**
     * Attempts to add the preload script the the provided sessions
     */
    _addPreloadToSessions(options) {
        let path = undefined;
        try {
            path = rendererRequiresCrashReporterStart()
                ? require.resolve('../../preload/legacy.js')
                : require.resolve('../../preload/index.js');
        }
        catch (_) {
            //
        }
        if (path && typeof path === 'string' && isAbsolute(path) && existsSync(path)) {
            for (const sesh of options.getSessions()) {
                // Fetch any existing preloads so we don't overwrite them
                const existing = sesh.getPreloads();
                sesh.setPreloads([path, ...existing]);
            }
        }
        else {
            logger.log('The preload script could not be injected automatically. This is most likely caused by bundling of the main process');
        }
    }
}
/** @inheritDoc */
PreloadInjection.id = 'PreloadInjection';
//# sourceMappingURL=preload-injection.js.map{"version":3,"file":"preload-injection.js","sourceRoot":"","sources":["../../../src/main/integrations/preload-injection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,UAA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AC,CAAC,CAAC;aACvC;SACF;aAAM;YACL,MAAM,CAAC,GAAG,CACR,oHAAoH,CACrH,CAAC;SACH;IACH,CAAC;;AA7CD,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { app } from 'electron';\nimport { existsSync } from 'fs';\nimport { isAbsolute } from 'path';\n\nimport { IPCMode } from '../../common';\nimport { rendererRequiresCrashReporterStart } from '../electron-normalize';\nimport { ElectronMainOptionsInternal } from '../sdk';\n\n/**\n * Injects the preload script into the provided sessions.\n *\n * Defaults to injecting into the defaultSession\n */\nexport class PreloadInjection implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'PreloadInjection';\n\n  /** @inheritDoc */\n  public name: string = PreloadInjection.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptionsInternal;\n\n    // If classic IPC mode is disabled, we shouldn't attempt to inject preload scripts\n    // eslint-disable-next-line no-bitwise\n    if ((options.ipcMode & IPCMode.Classic) == 0) {\n      return;\n    }\n\n    app.once('ready', () => {\n      this._addPreloadToSessions(options);\n    });\n  }\n\n  /**\n   * Attempts to add the preload script the the provided sessions\n   */\n  private _addPreloadToSessions(options: ElectronMainOptionsInternal): void {\n    let path = undefined;\n    try {\n      path = rendererRequiresCrashReporterStart()\n        ? require.resolve('../../preload/legacy.js')\n        : require.resolve('../../preload/index.js');\n    } catch (_) {\n      //\n    }\n\n    if (path && typeof path === 'string' && isAbsolute(path) && existsSync(path)) {\n      for (const sesh of options.getSessions()) {\n        // Fetch any existing preloads so we don't overwrite them\n        const existing = sesh.getPreloads();\n        sesh.setPreloads([path, ...existing]);\n      }\n    } else {\n      logger.log(\n        'The preload script could not be injected automatically. This is most likely caused by bundling of the main process',\n      );\n    }\n  }\n}\n"]}import { EventProcessor, Integration } from '@sentry/types';
/** Adds Screenshots to events */
export declare class Screenshots implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=screenshots.d.ts.map{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/screenshots.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO9E,iCAAiC;AACjC,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAkCpF"}import { __awaiter } from "tslib";
import { getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';
import { BrowserWindow } from 'electron';
import { capturePage } from '../electron-normalize';
/** Adds Screenshots to events */
export class Screenshots {
    constructor() {
        /** @inheritDoc */
        this.name = Screenshots.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        var _a;
        const attachScreenshot = !!((_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions()).attachScreenshot;
        if (attachScreenshot) {
            addGlobalEventProcessor((event, hint) => __awaiter(this, void 0, void 0, function* () {
                // We don't capture screenshots for transactions or native crashes
                if (!event.transaction && event.platform !== 'native') {
                    let count = 1;
                    for (const window of BrowserWindow.getAllWindows()) {
                        if (!hint.attachments) {
                            hint.attachments = [];
                        }
                        try {
                            if (!window.isDestroyed() && window.isVisible()) {
                                const filename = count === 1 ? 'screenshot.png' : `screenshot-${count}.png`;
                                const image = yield capturePage(window);
                                hint.attachments.push({ filename, data: image.toPNG(), contentType: 'image/png' });
                                count += 1;
                            }
                        }
                        catch (e) {
                            // Catch all errors so we don't break event submission if something goes wrong
                            logger.error('Error capturing screenshot', e);
                        }
                    }
                }
                return event;
            }));
        }
    }
}
/** @inheritDoc */
Screenshots.id = 'Screenshots';
//# sourceMappingURL=screenshots.js.map{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../src/main/integrations/screenshots.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,iCAAiC;AACjC,MAAM,OAAO,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAqCvC,CAAC;IAnCC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;;QAC1E,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,MAAA,aAAa,EAAE,CAAC,SAAS,EAAE,0CAAE,UAAU,EAA0B,CAAA,CAAC,gBAAgB,CAAC;QAE/G,IAAI,gBAAgB,EAAE;YACpB,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAe,EAAE,EAAE;gBAC9D,kEAAkE;gBAClE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;oBACrD,IAAI,KAAK,GAAG,CAAC,CAAC;oBAEd,KAAK,MAAM,MAAM,IAAI,aAAa,CAAC,aAAa,EAAE,EAAE;wBAClD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;4BACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;yBACvB;wBAED,IAAI;4BACF,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;gCAC/C,MAAM,QAAQ,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,KAAK,MAAM,CAAC;gCAC5E,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC;gCAExC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;gCAEnF,KAAK,IAAI,CAAC,CAAC;6BACZ;yBACF;wBAAC,OAAO,CAAC,EAAE;4BACV,8EAA8E;4BAC9E,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;yBAC/C;qBACF;iBACF;gBAED,OAAO,KAAK,CAAC;YACf,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AAxCD,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { BrowserWindow } from 'electron';\n\nimport { capturePage } from '../electron-normalize';\nimport { ElectronMainOptions } from '../sdk';\n\n/** Adds Screenshots to events */\nexport class Screenshots implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'Screenshots';\n\n  /** @inheritDoc */\n  public name: string = Screenshots.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const attachScreenshot = !!(getCurrentHub().getClient()?.getOptions() as ElectronMainOptions).attachScreenshot;\n\n    if (attachScreenshot) {\n      addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n        // We don't capture screenshots for transactions or native crashes\n        if (!event.transaction && event.platform !== 'native') {\n          let count = 1;\n\n          for (const window of BrowserWindow.getAllWindows()) {\n            if (!hint.attachments) {\n              hint.attachments = [];\n            }\n\n            try {\n              if (!window.isDestroyed() && window.isVisible()) {\n                const filename = count === 1 ? 'screenshot.png' : `screenshot-${count}.png`;\n                const image = await capturePage(window);\n\n                hint.attachments.push({ filename, data: image.toPNG(), contentType: 'image/png' });\n\n                count += 1;\n              }\n            } catch (e) {\n              // Catch all errors so we don't break event submission if something goes wrong\n              logger.error('Error capturing screenshot', e);\n            }\n          }\n        }\n\n        return event;\n      });\n    }\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** Sends minidumps via the Sentry uploader */
export declare class SentryMinidump implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** Store to persist context information beyond application crashes. */
    private _scopeStore?;
    /** Temp store for the scope of last run */
    private _scopeLastRun?;
    private _minidumpLoader?;
    /** @inheritDoc */
    setupOnce(): void;
    /** Starts the native crash reporter */
    private _startCrashReporter;
    /**
     * Helper function for sending renderer crashes
     */
    private _sendRendererCrash;
    /**
     * Helper function for sending child process crashes
     */
    private _sendChildProcessCrash;
    /**
     * Adds a scope listener to persist changes to disk.
     */
    private _setupScopeListener;
    /**
     * Loads new native crashes from disk and sends them to Sentry.
     *
     * Returns true if one or more minidumps were found
     */
    private _sendNativeCrashes;
}
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/main/integrations/sentry-minidump/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAcnD,8CAA8C;AAC9C,qBAAa,cAAe,YAAW,WAAW;IAChD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAqB;IAExC,uEAAuE;IACvE,OAAO,CAAC,WAAW,CAAC,CAA4B;IAEhD,2CAA2C;IAC3C,OAAO,CAAC,aAAa,CAAC,CAAiB;IAEvC,OAAO,CAAC,eAAe,CAAC,CAAiB;IAEzC,kBAAkB;IACX,SAAS,IAAI,IAAI;IAiDxB,uCAAuC;IACvC,OAAO,CAAC,mBAAmB;IAc3B;;OAEG;YACW,kBAAkB;IAmChC;;OAEG;YACW,sBAAsB;IA8BpC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B;;;;OAIG;YACW,kBAAkB;CA2EjC"}import { __awaiter } from "tslib";
import { captureEvent, getCurrentHub, Scope } from '@sentry/core';
import { basename, logger, SentryError } from '@sentry/utils';
import { app, crashReporter } from 'electron';
import { mergeEvents } from '../../../common';
import { getEventDefaults } from '../../context';
import { EXIT_REASONS, onChildProcessGone, onRendererProcessGone } from '../../electron-normalize';
import { sentryCachePath } from '../../fs';
import { getRendererProperties, trackRendererProperties } from '../../renderers';
import { checkPreviousSession, sessionCrashed } from '../../sessions';
import { BufferedWriteStore } from '../../store';
import { deleteMinidump, getMinidumpLoader } from './minidump-loader';
/** Sends minidumps via the Sentry uploader */
export class SentryMinidump {
    constructor() {
        /** @inheritDoc */
        this.name = SentryMinidump.id;
    }
    /** @inheritDoc */
    setupOnce() {
        // Mac AppStore builds cannot run the crash reporter due to the sandboxing
        // requirements. In this case, we prevent enabling native crashes entirely.
        // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build
        if (process.mas) {
            return;
        }
        this._startCrashReporter();
        this._scopeStore = new BufferedWriteStore(sentryCachePath, 'scope_v2', new Scope());
        // We need to store the scope in a variable here so it can be attached to minidumps
        this._scopeLastRun = this._scopeStore.get();
        this._setupScopeListener();
        const client = getCurrentHub().getClient();
        const options = client === null || client === void 0 ? void 0 : client.getOptions();
        if (!(options === null || options === void 0 ? void 0 : options.dsn)) {
            throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');
        }
        trackRendererProperties();
        this._minidumpLoader = getMinidumpLoader();
        onRendererProcessGone(EXIT_REASONS, (contents, details) => this._sendRendererCrash(options, contents, details));
        onChildProcessGone(EXIT_REASONS, (details) => this._sendChildProcessCrash(options, details));
        // Start to submit recent minidump crashes. This will load breadcrumbs and
        // context information that was cached on disk prior to the crash.
        this._sendNativeCrashes({
            level: 'fatal',
            platform: 'native',
            tags: {
                'event.environment': 'native',
                'event.process': 'browser',
                event_type: 'native',
            },
        })
            .then((minidumpsFound) => 
        // Check for previous uncompleted session. If a previous session exists
        // and no minidumps were found, its likely an abnormal exit
        checkPreviousSession(minidumpsFound))
            .catch((error) => logger.error(error));
    }
    /** Starts the native crash reporter */
    _startCrashReporter() {
        logger.log('Starting Electron crashReporter');
        crashReporter.start({
            companyName: '',
            ignoreSystemCrashHandler: true,
            productName: app.name || app.getName(),
            // Empty string doesn't work for Linux Crashpad and no submitURL doesn't work for older versions of Electron
            submitURL: 'https://f.a.k/e',
            uploadToServer: false,
            compress: true,
        });
    }
    /**
     * Helper function for sending renderer crashes
     */
    _sendRendererCrash(options, contents, details) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            const { getRendererName, release, environment } = options;
            const crashedProcess = (getRendererName === null || getRendererName === void 0 ? void 0 : getRendererName(contents)) || 'renderer';
            logger.log(`'${crashedProcess}' process '${details.reason}'`);
            const event = mergeEvents(yield getEventDefaults(release, environment), {
                contexts: {
                    electron: {
                        crashed_url: ((_a = getRendererProperties(contents.id)) === null || _a === void 0 ? void 0 : _a.url) || 'unknown',
                        details,
                    },
                },
                level: 'fatal',
                // The default is javascript
                platform: 'native',
                tags: {
                    'event.environment': 'native',
                    'event.process': crashedProcess,
                    'exit.reason': details.reason,
                    event_type: 'native',
                },
            });
            const found = yield this._sendNativeCrashes(event);
            if (found) {
                sessionCrashed();
            }
        });
    }
    /**
     * Helper function for sending child process crashes
     */
    _sendChildProcessCrash(options, details) {
        return __awaiter(this, void 0, void 0, function* () {
            logger.log(`${details.type} process has ${details.reason}`);
            const { release, environment } = options;
            const event = mergeEvents(yield getEventDefaults(release, environment), {
                contexts: {
                    electron: { details },
                },
                level: 'fatal',
                // The default is javascript
                platform: 'native',
                tags: {
                    'event.environment': 'native',
                    'event.process': details.type,
                    'exit.reason': details.reason,
                    event_type: 'native',
                },
            });
            const found = yield this._sendNativeCrashes(event);
            if (found) {
                sessionCrashed();
            }
        });
    }
    /**
     * Adds a scope listener to persist changes to disk.
     */
    _setupScopeListener() {
        const hubScope = getCurrentHub().getScope();
        if (hubScope) {
            hubScope.addScopeListener((updatedScope) => {
                const scope = Scope.clone(updatedScope);
                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
                scope._eventProcessors = [];
                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
                scope._scopeListeners = [];
                // Since the initial scope read is async, we need to ensure that any writes do not beat that
                // https://github.com/getsentry/sentry-electron/issues/585
                setImmediate(() => {
                    var _a;
                    void ((_a = this._scopeStore) === null || _a === void 0 ? void 0 : _a.set(scope));
                });
            });
        }
    }
    /**
     * Loads new native crashes from disk and sends them to Sentry.
     *
     * Returns true if one or more minidumps were found
     */
    _sendNativeCrashes(event) {
        return __awaiter(this, void 0, void 0, function* () {
            // Whenever we are called, assume that the crashes we are going to load down
            // below have occurred recently. This means, we can use the same event data
            // for all minidumps that we load now. There are two conditions:
            //
            //  1. The application crashed and we are just starting up. The stored
            //     breadcrumbs and context reflect the state during the application
            //     crash.
            //
            //  2. A renderer process crashed recently and we have just been notified
            //     about it. Just use the breadcrumbs and context information we have
            //     right now and hope that the delay was not too long.
            if (this._minidumpLoader === undefined) {
                throw new SentryError('Invariant violation: Native crashes not enabled');
            }
            try {
                const minidumps = yield this._minidumpLoader();
                if (minidumps.length > 0) {
                    const hub = getCurrentHub();
                    const client = hub.getClient();
                    if (!client) {
                        return true;
                    }
                    const enabled = client.getOptions().enabled;
                    // If the SDK is not enabled, we delete the minidump files so they
                    // dont accumulate and/or get sent later
                    if (enabled === false) {
                        minidumps.forEach(deleteMinidump);
                        return false;
                    }
                    const storedScope = Scope.clone(yield this._scopeLastRun);
                    let newEvent = yield storedScope.applyToEvent(event);
                    const hubScope = hub.getScope();
                    newEvent = hubScope ? yield hubScope.applyToEvent(event) : event;
                    if (!newEvent) {
                        return false;
                    }
                    for (const minidump of minidumps) {
                        const data = yield minidump.load();
                        if (data) {
                            captureEvent(newEvent, {
                                attachments: [
                                    {
                                        attachmentType: 'event.minidump',
                                        filename: basename(minidump.path),
                                        data,
                                    },
                                ],
                            });
                        }
                        void deleteMinidump(minidump);
                    }
                    // Unset to recover memory
                    this._scopeLastRun = undefined;
                    return true;
                }
            }
            catch (_oO) {
                logger.error('Error while sending native crash.');
            }
            return false;
        });
    }
}
/** @inheritDoc */
SentryMinidump.id = 'SentryMinidump';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/main/integrations/sentry-minidump/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAkB,MAAM,mBAAmB,CAAC;AAEtF,8CAA8C;AAC9C,MAAM,OAAO,cAAc;IAA3B;QAIE,kBAAkB;QACX,SAAI,GAAW,cAAc,CAAC,EAAE,CAAC;IAwP1C,CAAC;IA9OC,kBAAkB;IACX,SAAS;QACd,0EAA0E;QAC1E,2EAA2E;QAC3E,+FAA+F;QAC/F,IAAI,OAAO,CAAC,GAA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,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;oBAErD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;oBAChC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;oBAEjE,IAAI,CAAC,QAAQ,EAAE;wBACb,OAAO,KAAK,CAAC;qBACd;oBAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;wBAChC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;wBAEnC,IAAI,IAAI,EAAE;4BACR,YAAY,CAAC,QAAQ,EAAE;gCACrB,WAAW,EAAE;oCACX;wCACE,cAAc,EAAE,gBAAgB;wCAChC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;wCACjC,IAAI;qCACL;iCACF;6BACF,CAAC,CAAC;yBACJ;wBAED,KAAK,cAAc,CAAC,QAAQ,CAAC,CAAC;qBAC/B;oBAED,0BAA0B;oBAC1B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;oBAC/B,OAAO,IAAI,CAAC;iBACb;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;aACnD;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;;AA3PD,kBAAkB;AACJ,iBAAE,GAAW,gBAAgB,CAAC","sourcesContent":["import { captureEvent, getCurrentHub, Scope } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Event, Integration } from '@sentry/types';\nimport { basename, logger, SentryError } from '@sentry/utils';\nimport { app, crashReporter } from 'electron';\n\nimport { mergeEvents } from '../../../common';\nimport { getEventDefaults } from '../../context';\nimport { EXIT_REASONS, onChildProcessGone, onRendererProcessGone } from '../../electron-normalize';\nimport { sentryCachePath } from '../../fs';\nimport { getRendererProperties, trackRendererProperties } from '../../renderers';\nimport { ElectronMainOptions } from '../../sdk';\nimport { checkPreviousSession, sessionCrashed } from '../../sessions';\nimport { BufferedWriteStore } from '../../store';\nimport { deleteMinidump, getMinidumpLoader, MinidumpLoader } from './minidump-loader';\n\n/** Sends minidumps via the Sentry uploader */\nexport class SentryMinidump implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'SentryMinidump';\n\n  /** @inheritDoc */\n  public name: string = SentryMinidump.id;\n\n  /** Store to persist context information beyond application crashes. */\n  private _scopeStore?: BufferedWriteStore<Scope>;\n\n  /** Temp store for the scope of last run */\n  private _scopeLastRun?: Promise<Scope>;\n\n  private _minidumpLoader?: MinidumpLoader;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // Mac AppStore builds cannot run the crash reporter due to the sandboxing\n    // requirements. In this case, we prevent enabling native crashes entirely.\n    // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build\n    if (process.mas) {\n      return;\n    }\n\n    this._startCrashReporter();\n\n    this._scopeStore = new BufferedWriteStore<Scope>(sentryCachePath, 'scope_v2', new Scope());\n    // We need to store the scope in a variable here so it can be attached to minidumps\n    this._scopeLastRun = this._scopeStore.get();\n\n    this._setupScopeListener();\n\n    const client = getCurrentHub().getClient<NodeClient>();\n    const options = client?.getOptions() as ElectronMainOptions;\n\n    if (!options?.dsn) {\n      throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');\n    }\n\n    trackRendererProperties();\n\n    this._minidumpLoader = getMinidumpLoader();\n\n    onRendererProcessGone(EXIT_REASONS, (contents, details) => this._sendRendererCrash(options, contents, details));\n    onChildProcessGone(EXIT_REASONS, (details) => this._sendChildProcessCrash(options, details));\n\n    // Start to submit recent minidump crashes. This will load breadcrumbs and\n    // context information that was cached on disk prior to the crash.\n    this._sendNativeCrashes({\n      level: 'fatal',\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': 'browser',\n        event_type: 'native',\n      },\n    })\n      .then((minidumpsFound) =>\n        // Check for previous uncompleted session. If a previous session exists\n        // and no minidumps were found, its likely an abnormal exit\n        checkPreviousSession(minidumpsFound),\n      )\n      .catch((error) => logger.error(error));\n  }\n\n  /** Starts the native crash reporter */\n  private _startCrashReporter(): void {\n    logger.log('Starting Electron crashReporter');\n\n    crashReporter.start({\n      companyName: '',\n      ignoreSystemCrashHandler: true,\n      productName: app.name || app.getName(),\n      // Empty string doesn't work for Linux Crashpad and no submitURL doesn't work for older versions of Electron\n      submitURL: 'https://f.a.k/e',\n      uploadToServer: false,\n      compress: true,\n    });\n  }\n\n  /**\n   * Helper function for sending renderer crashes\n   */\n  private async _sendRendererCrash(\n    options: ElectronMainOptions,\n    contents: Electron.WebContents,\n    details: Partial<Electron.RenderProcessGoneDetails>,\n  ): Promise<void> {\n    const { getRendererName, release, environment } = options;\n    const crashedProcess = getRendererName?.(contents) || 'renderer';\n\n    logger.log(`'${crashedProcess}' process '${details.reason}'`);\n\n    const event = mergeEvents(await getEventDefaults(release, environment), {\n      contexts: {\n        electron: {\n          crashed_url: getRendererProperties(contents.id)?.url || 'unknown',\n          details,\n        },\n      },\n      level: 'fatal',\n      // The default is javascript\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': crashedProcess,\n        'exit.reason': details.reason,\n        event_type: 'native',\n      },\n    });\n\n    const found = await this._sendNativeCrashes(event);\n\n    if (found) {\n      sessionCrashed();\n    }\n  }\n\n  /**\n   * Helper function for sending child process crashes\n   */\n  private async _sendChildProcessCrash(\n    options: ElectronMainOptions,\n    details: Omit<Electron.Details, 'exitCode'>,\n  ): Promise<void> {\n    logger.log(`${details.type} process has ${details.reason}`);\n\n    const { release, environment } = options;\n\n    const event = mergeEvents(await getEventDefaults(release, environment), {\n      contexts: {\n        electron: { details },\n      },\n      level: 'fatal',\n      // The default is javascript\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': details.type,\n        'exit.reason': details.reason,\n        event_type: 'native',\n      },\n    });\n\n    const found = await this._sendNativeCrashes(event);\n\n    if (found) {\n      sessionCrashed();\n    }\n  }\n\n  /**\n   * Adds a scope listener to persist changes to disk.\n   */\n  private _setupScopeListener(): void {\n    const hubScope = getCurrentHub().getScope();\n    if (hubScope) {\n      hubScope.addScopeListener((updatedScope) => {\n        const scope = Scope.clone(updatedScope);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (scope as any)._eventProcessors = [];\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (scope as any)._scopeListeners = [];\n\n        // Since the initial scope read is async, we need to ensure that any writes do not beat that\n        // https://github.com/getsentry/sentry-electron/issues/585\n        setImmediate(() => {\n          void this._scopeStore?.set(scope);\n        });\n      });\n    }\n  }\n\n  /**\n   * Loads new native crashes from disk and sends them to Sentry.\n   *\n   * Returns true if one or more minidumps were found\n   */\n  private async _sendNativeCrashes(event: Event): Promise<boolean> {\n    // Whenever we are called, assume that the crashes we are going to load down\n    // below have occurred recently. This means, we can use the same event data\n    // for all minidumps that we load now. There are two conditions:\n    //\n    //  1. The application crashed and we are just starting up. The stored\n    //     breadcrumbs and context reflect the state during the application\n    //     crash.\n    //\n    //  2. A renderer process crashed recently and we have just been notified\n    //     about it. Just use the breadcrumbs and context information we have\n    //     right now and hope that the delay was not too long.\n\n    if (this._minidumpLoader === undefined) {\n      throw new SentryError('Invariant violation: Native crashes not enabled');\n    }\n\n    try {\n      const minidumps = await this._minidumpLoader();\n\n      if (minidumps.length > 0) {\n        const hub = getCurrentHub();\n        const client = hub.getClient();\n\n        if (!client) {\n          return true;\n        }\n\n        const enabled = client.getOptions().enabled;\n\n        // If the SDK is not enabled, we delete the minidump files so they\n        // dont accumulate and/or get sent later\n        if (enabled === false) {\n          minidumps.forEach(deleteMinidump);\n          return false;\n        }\n\n        const storedScope = Scope.clone(await this._scopeLastRun);\n        let newEvent = await storedScope.applyToEvent(event);\n\n        const hubScope = hub.getScope();\n        newEvent = hubScope ? await hubScope.applyToEvent(event) : event;\n\n        if (!newEvent) {\n          return false;\n        }\n\n        for (const minidump of minidumps) {\n          const data = await minidump.load();\n\n          if (data) {\n            captureEvent(newEvent, {\n              attachments: [\n                {\n                  attachmentType: 'event.minidump',\n                  filename: basename(minidump.path),\n                  data,\n                },\n              ],\n            });\n          }\n\n          void deleteMinidump(minidump);\n        }\n\n        // Unset to recover memory\n        this._scopeLastRun = undefined;\n        return true;\n      }\n    } catch (_oO) {\n      logger.error('Error while sending native crash.');\n    }\n\n    return false;\n  }\n}\n"]}export interface MinidumpFile {
    path: string;
    load(): Promise<Uint8Array | undefined>;
}
export type MinidumpLoader = () => Promise<MinidumpFile[]>;
/** Deletes a minidump */
export declare function deleteMinidump(dump: MinidumpFile): Promise<void>;
/**
 * Gets the minidump loader
 */
export declare function getMinidumpLoader(): MinidumpLoader;
//# sourceMappingURL=minidump-loader.d.ts.map{"version":3,"file":"minidump-loader.d.ts","sourceRoot":"","sources":["../../../../src/main/integrations/sentry-minidump/minidump-loader.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;AAW3D,yBAAyB;AACzB,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtE;AAwJD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}import { __awaiter } from "tslib";
import { logger } from '@sentry/utils';
import { join } from 'path';
import { getCrashesDirectory, usesCrashpad } from '../../electron-normalize';
import { readDirAsync, readFileAsync, statAsync, unlinkAsync } from '../../fs';
/** Maximum number of days to keep a minidump before deleting it. */
const MAX_AGE = 30;
function filterAsync(array, predicate, thisArg) {
    return __awaiter(this, void 0, void 0, function* () {
        const verdicts = yield Promise.all(array.map(predicate, thisArg));
        return array.filter((_, index) => verdicts[index]);
    });
}
/** Deletes a minidump */
export function deleteMinidump(dump) {
    return __awaiter(this, void 0, void 0, function* () {
        try {
            yield unlinkAsync(dump.path);
        }
        catch (e) {
            logger.warn('Could not delete', dump.path);
        }
    });
}
function createMinidumpLoader(fetchMinidumpsImpl) {
    const knownPaths = [];
    return () => __awaiter(this, void 0, void 0, function* () {
        const minidumps = yield fetchMinidumpsImpl();
        logger.log(`Found ${minidumps.length} minidumps`);
        const oldestMs = new Date().getTime() - MAX_AGE * 24 * 3600 * 1000;
        return filterAsync(minidumps, (dump) => __awaiter(this, void 0, void 0, function* () {
            // Skip files that we have seen before
            if (knownPaths.indexOf(dump.path) >= 0) {
                return false;
            }
            // Lock this minidump until we have uploaded it or an error occurs and we
            // remove it from the file system.
            knownPaths.push(dump.path);
            // We do not want to upload minidumps that have been generated before a
            // certain threshold. Those old files can be deleted immediately.
            const stats = yield statAsync(dump.path);
            if (stats.birthtimeMs < oldestMs) {
                yield deleteMinidump(dump);
                knownPaths.splice(knownPaths.indexOf(dump.path), 1);
                return false;
            }
            return true;
        }));
    });
}
/** Attempts to remove the metadata file so Crashpad doesn't output `failed to stat report` errors to the console */
function deleteCrashpadMetadataFile(crashesDirectory, waitMs = 100) {
    return __awaiter(this, void 0, void 0, function* () {
        if (waitMs > 2000) {
            return;
        }
        const metadataPath = join(crashesDirectory, 'metadata');
        try {
            yield unlinkAsync(metadataPath);
            logger.log('Deleted Crashpad metadata file', metadataPath);
        }
        catch (e) {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            if (e.code && e.code == 'EBUSY') {
                // Since Crashpad probably still has the metadata file open, we make a few attempts to delete it, backing
                // off and waiting longer each time.
                setTimeout(() => __awaiter(this, void 0, void 0, function* () {
                    yield deleteCrashpadMetadataFile(crashesDirectory, waitMs * 2);
                }), waitMs);
            }
        }
    });
}
function readDirsAsync(paths) {
    return __awaiter(this, void 0, void 0, function* () {
        const found = [];
        for (const path of paths) {
            try {
                const files = yield readDirAsync(path);
                found.push(...files.map((file) => join(path, file)));
            }
            catch (_) {
                //
            }
        }
        return found;
    });
}
function crashpadMinidumpLoader() {
    const crashesDirectory = getCrashesDirectory();
    const crashpadSubDirectory = process.platform === 'win32' ? 'reports' : 'completed';
    const dumpDirectories = [join(crashesDirectory, crashpadSubDirectory)];
    if (process.platform === 'darwin') {
        dumpDirectories.push(join(crashesDirectory, 'pending'));
    }
    return createMinidumpLoader(() => __awaiter(this, void 0, void 0, function* () {
        yield deleteCrashpadMetadataFile(crashesDirectory).catch((error) => logger.error(error));
        const files = yield readDirsAsync(dumpDirectories);
        return files
            .filter((file) => file.endsWith('.dmp'))
            .map((path) => {
            return {
                path,
                load: () => readFileAsync(path),
            };
        });
    }));
}
/** Crudely parses the minidump from the Breakpad multipart file */
function minidumpFromBreakpadMultipart(file) {
    const binaryStart = file.lastIndexOf('Content-Type: application/octet-stream');
    if (binaryStart > 0) {
        const dumpStart = file.indexOf('MDMP', binaryStart);
        const dumpEnd = file.lastIndexOf('----------------------------');
        if (dumpStart > 0 && dumpEnd > 0 && dumpEnd > dumpStart) {
            return file.subarray(dumpStart, dumpEnd);
        }
    }
    return undefined;
}
function removeBreakpadMetadata(crashesDirectory, paths) {
    // Remove all metadata files and forget about them.
    void Promise.all(paths
        .filter((file) => file.endsWith('.txt') && !file.endsWith('log.txt'))
        .map((file) => __awaiter(this, void 0, void 0, function* () {
        const path = join(crashesDirectory, file);
        try {
            yield unlinkAsync(path);
        }
        catch (e) {
            logger.warn('Could not delete', path);
        }
    })));
}
function breakpadMinidumpLoader() {
    const crashesDirectory = getCrashesDirectory();
    return createMinidumpLoader(() => __awaiter(this, void 0, void 0, function* () {
        // Breakpad stores all minidump files along with a metadata file directly in
        // the crashes directory.
        const files = yield readDirAsync(crashesDirectory);
        removeBreakpadMetadata(crashesDirectory, files);
        return files
            .filter((file) => file.endsWith('.dmp'))
            .map((file) => {
            const path = join(crashesDirectory, file);
            return {
                path,
                load: () => __awaiter(this, void 0, void 0, function* () {
                    const file = yield readFileAsync(path);
                    return minidumpFromBreakpadMultipart(file) || file;
                }),
            };
        })
            .filter((m) => !!m);
    }));
}
/**
 * Gets the minidump loader
 */
export function getMinidumpLoader() {
    return usesCrashpad() ? crashpadMinidumpLoader() : breakpadMinidumpLoader();
}
//# sourceMappingURL=minidump-loader.js.map{"version":3,"file":"minidump-loader.js","sourceRoot":"","sources":["../../../../src/main/integrations/sentry-minidump/minidump-loader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE/E,oEAAoE;AACpE,MAAM,OAAO,GAAG,EAAE,CAAC;AASnB,SAAe,WAAW,CACxB,KAAU,EACV,SAAkD,EAClD,OAAa;;QAEb,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;CAAA;AAED,yBAAyB;AACzB,MAAM,UAAgB,cAAc,CAAC,IAAkB;;QACrD,IAAI;YACF,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC9B;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;SAC5C;IACH,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,kBAAkC;IAC9D,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,OAAO,GAAS,EAAE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CAAC","sourcesContent":["import { logger } from '@sentry/utils';\nimport { join } from 'path';\n\nimport { getCrashesDirectory, usesCrashpad } from '../../electron-normalize';\nimport { readDirAsync, readFileAsync, statAsync, unlinkAsync } from '../../fs';\n\n/** Maximum number of days to keep a minidump before deleting it. */\nconst MAX_AGE = 30;\n\nexport interface MinidumpFile {\n  path: string;\n  load(): Promise<Uint8Array | undefined>;\n}\n\nexport type MinidumpLoader = () => Promise<MinidumpFile[]>;\n\nasync function filterAsync<T>(\n  array: T[],\n  predicate: (item: T) => Promise<boolean> | boolean,\n  thisArg?: any,\n): Promise<T[]> {\n  const verdicts = await Promise.all(array.map(predicate, thisArg));\n  return array.filter((_, index) => verdicts[index]);\n}\n\n/** Deletes a minidump */\nexport async function deleteMinidump(dump: MinidumpFile): Promise<void> {\n  try {\n    await unlinkAsync(dump.path);\n  } catch (e) {\n    logger.warn('Could not delete', dump.path);\n  }\n}\n\nfunction createMinidumpLoader(fetchMinidumpsImpl: MinidumpLoader): MinidumpLoader {\n  const knownPaths: string[] = [];\n\n  return async () => {\n    const minidumps = await fetchMinidumpsImpl();\n    logger.log(`Found ${minidumps.length} minidumps`);\n\n    const oldestMs = new Date().getTime() - MAX_AGE * 24 * 3_600 * 1_000;\n    return filterAsync(minidumps, async (dump) => {\n      // Skip files that we have seen before\n      if (knownPaths.indexOf(dump.path) >= 0) {\n        return false;\n      }\n\n      // Lock this minidump until we have uploaded it or an error occurs and we\n      // remove it from the file system.\n      knownPaths.push(dump.path);\n\n      // We do not want to upload minidumps that have been generated before a\n      // certain threshold. Those old files can be deleted immediately.\n      const stats = await statAsync(dump.path);\n      if (stats.birthtimeMs < oldestMs) {\n        await deleteMinidump(dump);\n        knownPaths.splice(knownPaths.indexOf(dump.path), 1);\n        return false;\n      }\n\n      return true;\n    });\n  };\n}\n\n/** Attempts to remove the metadata file so Crashpad doesn't output `failed to stat report` errors to the console */\nasync function deleteCrashpadMetadataFile(crashesDirectory: string, waitMs: number = 100): Promise<void> {\n  if (waitMs > 2_000) {\n    return;\n  }\n\n  const metadataPath = join(crashesDirectory, 'metadata');\n  try {\n    await unlinkAsync(metadataPath);\n    logger.log('Deleted Crashpad metadata file', metadataPath);\n  } catch (e: any) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    if (e.code && e.code == 'EBUSY') {\n      // Since Crashpad probably still has the metadata file open, we make a few attempts to delete it, backing\n      // off and waiting longer each time.\n      setTimeout(async () => {\n        await deleteCrashpadMetadataFile(crashesDirectory, waitMs * 2);\n      }, waitMs);\n    }\n  }\n}\n\nasync function readDirsAsync(paths: string[]): Promise<string[]> {\n  const found: string[] = [];\n  for (const path of paths) {\n    try {\n      const files = await readDirAsync(path);\n      found.push(...files.map((file) => join(path, file)));\n    } catch (_) {\n      //\n    }\n  }\n  return found;\n}\n\nfunction crashpadMinidumpLoader(): MinidumpLoader {\n  const crashesDirectory: string = getCrashesDirectory();\n  const crashpadSubDirectory = process.platform === 'win32' ? 'reports' : 'completed';\n\n  const dumpDirectories = [join(crashesDirectory, crashpadSubDirectory)];\n\n  if (process.platform === 'darwin') {\n    dumpDirectories.push(join(crashesDirectory, 'pending'));\n  }\n\n  return createMinidumpLoader(async () => {\n    await deleteCrashpadMetadataFile(crashesDirectory).catch((error) => logger.error(error));\n\n    const files = await readDirsAsync(dumpDirectories);\n    return files\n      .filter((file) => file.endsWith('.dmp'))\n      .map((path) => {\n        return {\n          path,\n          load: () => readFileAsync(path),\n        };\n      });\n  });\n}\n\n/** Crudely parses the minidump from the Breakpad multipart file */\nfunction minidumpFromBreakpadMultipart(file: Buffer): Buffer | undefined {\n  const binaryStart = file.lastIndexOf('Content-Type: application/octet-stream');\n  if (binaryStart > 0) {\n    const dumpStart = file.indexOf('MDMP', binaryStart);\n    const dumpEnd = file.lastIndexOf('----------------------------');\n\n    if (dumpStart > 0 && dumpEnd > 0 && dumpEnd > dumpStart) {\n      return file.subarray(dumpStart, dumpEnd);\n    }\n  }\n\n  return undefined;\n}\n\nfunction removeBreakpadMetadata(crashesDirectory: string, paths: string[]): void {\n  // Remove all metadata files and forget about them.\n  void Promise.all(\n    paths\n      .filter((file) => file.endsWith('.txt') && !file.endsWith('log.txt'))\n      .map(async (file) => {\n        const path = join(crashesDirectory, file);\n        try {\n          await unlinkAsync(path);\n        } catch (e) {\n          logger.warn('Could not delete', path);\n        }\n      }),\n  );\n}\n\nfunction breakpadMinidumpLoader(): MinidumpLoader {\n  const crashesDirectory: string = getCrashesDirectory();\n\n  return createMinidumpLoader(async () => {\n    // Breakpad stores all minidump files along with a metadata file directly in\n    // the crashes directory.\n    const files = await readDirAsync(crashesDirectory);\n\n    removeBreakpadMetadata(crashesDirectory, files);\n\n    return files\n      .filter((file) => file.endsWith('.dmp'))\n      .map((file) => {\n        const path = join(crashesDirectory, file);\n\n        return {\n          path,\n          load: async () => {\n            const file = await readFileAsync(path);\n            return minidumpFromBreakpadMultipart(file) || file;\n          },\n        };\n      })\n      .filter((m) => !!m);\n  });\n}\n\n/**\n * Gets the minidump loader\n */\nexport function getMinidumpLoader(): MinidumpLoader {\n  return usesCrashpad() ? crashpadMinidumpLoader() : breakpadMinidumpLoader();\n}\n"]}import { ElectronMainOptionsInternal } from './sdk';
/** Sets up communication channels with the renderer */
export declare function configureIPC(options: ElectronMainOptionsInternal): void;
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../../src/main/ipc.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AA+JpD,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAcvE"}import { captureEvent, configureScope, getCurrentHub, Scope } from '@sentry/core';
import { forEachEnvelopeItem, logger, parseEnvelope, SentryError } from '@sentry/utils';
import { app, ipcMain, protocol } from 'electron';
import { TextDecoder, TextEncoder } from 'util';
import { IPCChannel, IPCMode, mergeEvents, normalizeUrlsInReplayEnvelope, PROTOCOL_SCHEME } from '../common';
import { supportsFullProtocol, whenAppReady } from './electron-normalize';
function captureEventFromRenderer(options, event, attachments, contents) {
    var _a, _b, _c, _d;
    const process = contents ? ((_a = options === null || options === void 0 ? void 0 : options.getRendererName) === null || _a === void 0 ? void 0 : _a.call(options, contents)) || 'renderer' : 'renderer';
    // Ensure breadcrumbs are empty as they sent via scope updates
    event.breadcrumbs = event.breadcrumbs || [];
    // Remove the environment as it defaults to 'production' and overwrites the main process environment
    delete event.environment;
    // Remove the SDK info as we want the Electron SDK to be the one reporting the event
    (_b = event.sdk) === null || _b === void 0 ? true : delete _b.name;
    (_c = event.sdk) === null || _c === void 0 ? true : delete _c.version;
    (_d = event.sdk) === null || _d === void 0 ? true : delete _d.packages;
    captureEvent(mergeEvents(event, { tags: { 'event.process': process } }), { attachments });
}
function handleEvent(options, jsonEvent, contents) {
    let event;
    try {
        event = JSON.parse(jsonEvent);
    }
    catch (_a) {
        logger.warn('sentry-electron received an invalid event message');
        return;
    }
    captureEventFromRenderer(options, event, [], contents);
}
function eventFromEnvelope(envelope) {
    let event;
    const attachments = [];
    forEachEnvelopeItem(envelope, (item, type) => {
        if (type === 'event' || type === 'transaction') {
            event = Array.isArray(item) ? item[1] : undefined;
        }
        else if (type === 'attachment') {
            const [headers, data] = item;
            attachments.push({
                filename: headers.filename,
                attachmentType: headers.attachment_type,
                contentType: headers.content_type,
                data,
            });
        }
    });
    return event ? [event, attachments] : undefined;
}
function handleEnvelope(options, env, contents) {
    var _a, _b;
    const envelope = parseEnvelope(env, new TextEncoder(), new TextDecoder());
    const eventAndAttachments = eventFromEnvelope(envelope);
    if (eventAndAttachments) {
        const [event, attachments] = eventAndAttachments;
        captureEventFromRenderer(options, event, attachments, contents);
    }
    else {
        const normalizedEnvelope = normalizeUrlsInReplayEnvelope(envelope, app.getAppPath());
        // Pass other types of envelope straight to the transport
        void ((_b = (_a = getCurrentHub().getClient()) === null || _a === void 0 ? void 0 : _a.getTransport()) === null || _b === void 0 ? void 0 : _b.send(normalizedEnvelope));
    }
}
/** Is object defined and has keys */
function hasKeys(obj) {
    return obj != undefined && Object.keys(obj).length > 0;
}
/**
 * Handle scope updates from renderer processes
 */
function handleScope(options, jsonScope) {
    let rendererScope;
    try {
        rendererScope = JSON.parse(jsonScope);
    }
    catch (_a) {
        logger.warn('sentry-electron received an invalid scope message');
        return;
    }
    const sentScope = Scope.clone(rendererScope);
    /* eslint-disable @typescript-eslint/no-unsafe-member-access */
    configureScope((scope) => {
        if (hasKeys(sentScope._user)) {
            scope.setUser(sentScope._user);
        }
        if (hasKeys(sentScope._tags)) {
            scope.setTags(sentScope._tags);
        }
        if (hasKeys(sentScope._extra)) {
            scope.setExtras(sentScope._extra);
        }
        for (const attachment of sentScope._attachments || []) {
            scope.addAttachment(attachment);
        }
        const breadcrumb = sentScope._breadcrumbs.pop();
        if (breadcrumb) {
            scope.addBreadcrumb(breadcrumb, (options === null || options === void 0 ? void 0 : options.maxBreadcrumbs) || 100);
        }
    });
    /* eslint-enable @typescript-eslint/no-unsafe-member-access */
}
/** Enables Electron protocol handling */
function configureProtocol(options) {
    if (app.isReady()) {
        throw new SentryError("Sentry SDK should be initialized before the Electron app 'ready' event is fired");
    }
    protocol.registerSchemesAsPrivileged([
        {
            scheme: PROTOCOL_SCHEME,
            privileges: { bypassCSP: true, corsEnabled: true, supportFetchAPI: true, secure: true },
        },
    ]);
    whenAppReady
        .then(() => {
        for (const sesh of options.getSessions()) {
            sesh.protocol.registerStringProtocol(PROTOCOL_SCHEME, (request, callback) => {
                var _a, _b;
                const data = (_b = (_a = request.uploadData) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.bytes;
                if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}`) && data) {
                    handleEvent(options, data.toString());
                }
                else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}`) && data) {
                    handleScope(options, data.toString());
                }
                else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}`) && data) {
                    handleEnvelope(options, data);
                }
                callback('');
            });
        }
    })
        .catch((error) => logger.error(error));
}
/**
 * Hooks IPC for communication with the renderer processes
 */
function configureClassic(options) {
    ipcMain.on(IPCChannel.EVENT, ({ sender }, jsonEvent) => handleEvent(options, jsonEvent, sender));
    ipcMain.on(IPCChannel.SCOPE, (_, jsonScope) => handleScope(options, jsonScope));
    ipcMain.on(IPCChannel.ENVELOPE, ({ sender }, env) => handleEnvelope(options, env, sender));
}
/** Sets up communication channels with the renderer */
export function configureIPC(options) {
    if (!supportsFullProtocol() && options.ipcMode === IPCMode.Protocol) {
        throw new SentryError('IPCMode.Protocol is only supported in Electron >= v5');
    }
    // eslint-disable-next-line no-bitwise
    if (supportsFullProtocol() && (options.ipcMode & IPCMode.Protocol) > 0) {
        configureProtocol(options);
    }
    // eslint-disable-next-line no-bitwise
    if ((options.ipcMode & IPCMode.Classic) > 0) {
        configureClassic(options);
    }
}
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../../src/main/ipc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAe,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG1E,SAAS,wBAAwB,CAC/B,OAAoC,EACpC,KAAY,EACZ,WAAyB,EACzB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, Envelope, Event, EventItem } from '@sentry/types';\nimport { forEachEnvelopeItem, logger, parseEnvelope, SentryError } from '@sentry/utils';\nimport { app, ipcMain, protocol, WebContents } from 'electron';\nimport { TextDecoder, TextEncoder } from 'util';\n\nimport { IPCChannel, IPCMode, mergeEvents, normalizeUrlsInReplayEnvelope, PROTOCOL_SCHEME } from '../common';\nimport { supportsFullProtocol, whenAppReady } from './electron-normalize';\nimport { ElectronMainOptionsInternal } from './sdk';\n\nfunction captureEventFromRenderer(\n  options: ElectronMainOptionsInternal,\n  event: Event,\n  attachments: Attachment[],\n  contents?: WebContents,\n): void {\n  const process = contents ? options?.getRendererName?.(contents) || 'renderer' : 'renderer';\n\n  // Ensure breadcrumbs are empty as they sent via scope updates\n  event.breadcrumbs = event.breadcrumbs || [];\n\n  // Remove the environment as it defaults to 'production' and overwrites the main process environment\n  delete event.environment;\n\n  // Remove the SDK info as we want the Electron SDK to be the one reporting the event\n  delete event.sdk?.name;\n  delete event.sdk?.version;\n  delete event.sdk?.packages;\n\n  captureEvent(mergeEvents(event, { tags: { 'event.process': process } }), { attachments });\n}\n\nfunction handleEvent(options: ElectronMainOptionsInternal, jsonEvent: string, contents?: WebContents): void {\n  let event: Event;\n  try {\n    event = JSON.parse(jsonEvent) as Event;\n  } catch {\n    logger.warn('sentry-electron received an invalid event message');\n    return;\n  }\n\n  captureEventFromRenderer(options, event, [], contents);\n}\n\nfunction eventFromEnvelope(envelope: Envelope): [Event, Attachment[]] | undefined {\n  let event: Event | undefined;\n  const attachments: Attachment[] = [];\n\n  forEachEnvelopeItem(envelope, (item, type) => {\n    if (type === 'event' || type === 'transaction') {\n      event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n    } else if (type === 'attachment') {\n      const [headers, data] = item as AttachmentItem;\n\n      attachments.push({\n        filename: headers.filename,\n        attachmentType: headers.attachment_type,\n        contentType: headers.content_type,\n        data,\n      });\n    }\n  });\n\n  return event ? [event, attachments] : undefined;\n}\n\nfunction handleEnvelope(options: ElectronMainOptionsInternal, env: Uint8Array | string, contents?: WebContents): void {\n  const envelope = parseEnvelope(env, new TextEncoder(), new TextDecoder());\n\n  const eventAndAttachments = eventFromEnvelope(envelope);\n  if (eventAndAttachments) {\n    const [event, attachments] = eventAndAttachments;\n    captureEventFromRenderer(options, event, attachments, contents);\n  } else {\n    const normalizedEnvelope = normalizeUrlsInReplayEnvelope(envelope, app.getAppPath());\n    // Pass other types of envelope straight to the transport\n    void getCurrentHub().getClient()?.getTransport()?.send(normalizedEnvelope);\n  }\n}\n\n/** Is object defined and has keys */\nfunction hasKeys(obj: any): boolean {\n  return obj != undefined && Object.keys(obj).length > 0;\n}\n\n/**\n * Handle scope updates from renderer processes\n */\nfunction handleScope(options: ElectronMainOptionsInternal, jsonScope: string): void {\n  let rendererScope: Scope;\n  try {\n    rendererScope = JSON.parse(jsonScope) as Scope;\n  } catch {\n    logger.warn('sentry-electron received an invalid scope message');\n    return;\n  }\n\n  const sentScope = Scope.clone(rendererScope) as any;\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  configureScope((scope) => {\n    if (hasKeys(sentScope._user)) {\n      scope.setUser(sentScope._user);\n    }\n\n    if (hasKeys(sentScope._tags)) {\n      scope.setTags(sentScope._tags);\n    }\n\n    if (hasKeys(sentScope._extra)) {\n      scope.setExtras(sentScope._extra);\n    }\n\n    for (const attachment of sentScope._attachments || []) {\n      scope.addAttachment(attachment);\n    }\n\n    const breadcrumb = sentScope._breadcrumbs.pop();\n    if (breadcrumb) {\n      scope.addBreadcrumb(breadcrumb, options?.maxBreadcrumbs || 100);\n    }\n  });\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n}\n\n/** Enables Electron protocol handling */\nfunction configureProtocol(options: ElectronMainOptionsInternal): void {\n  if (app.isReady()) {\n    throw new SentryError(\"Sentry SDK should be initialized before the Electron app 'ready' event is fired\");\n  }\n\n  protocol.registerSchemesAsPrivileged([\n    {\n      scheme: PROTOCOL_SCHEME,\n      privileges: { bypassCSP: true, corsEnabled: true, supportFetchAPI: true, secure: true },\n    },\n  ]);\n\n  whenAppReady\n    .then(() => {\n      for (const sesh of options.getSessions()) {\n        sesh.protocol.registerStringProtocol(PROTOCOL_SCHEME, (request, callback) => {\n          const data = request.uploadData?.[0]?.bytes;\n\n          if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}`) && data) {\n            handleEvent(options, data.toString());\n          } else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}`) && data) {\n            handleScope(options, data.toString());\n          } else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}`) && data) {\n            handleEnvelope(options, data);\n          }\n\n          callback('');\n        });\n      }\n    })\n    .catch((error) => logger.error(error));\n}\n\n/**\n * Hooks IPC for communication with the renderer processes\n */\nfunction configureClassic(options: ElectronMainOptionsInternal): void {\n  ipcMain.on(IPCChannel.EVENT, ({ sender }, jsonEvent: string) => handleEvent(options, jsonEvent, sender));\n  ipcMain.on(IPCChannel.SCOPE, (_, jsonScope: string) => handleScope(options, jsonScope));\n  ipcMain.on(IPCChannel.ENVELOPE, ({ sender }, env: Uint8Array | string) => handleEnvelope(options, env, sender));\n}\n\n/** Sets up communication channels with the renderer */\nexport function configureIPC(options: ElectronMainOptionsInternal): void {\n  if (!supportsFullProtocol() && options.ipcMode === IPCMode.Protocol) {\n    throw new SentryError('IPCMode.Protocol is only supported in Electron >= v5');\n  }\n\n  // eslint-disable-next-line no-bitwise\n  if (supportsFullProtocol() && (options.ipcMode & IPCMode.Protocol) > 0) {\n    configureProtocol(options);\n  }\n\n  // eslint-disable-next-line no-bitwise\n  if ((options.ipcMode & IPCMode.Classic) > 0) {\n    configureClassic(options);\n  }\n}\n"]}interface Renderer {
    id: number;
    url?: string;
    title?: string;
}
/**
 * Enable tracking of renderer properties via events
 *
 * This allows us to get the last known state of a renderer even if it's been destroyed
 **/
export declare function trackRendererProperties(): void;
/** Gets the properties for a renderer */
export declare function getRendererProperties(id: number): Renderer | undefined;
export {};
//# sourceMappingURL=renderers.d.ts.map{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../../src/main/renderers.ts"],"names":[],"mappings":"AAKA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;IAII;AACJ,wBAAgB,uBAAuB,IAAI,IAAI,CAkC9C;AAED,yCAAyC;AACzC,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAEtE"}import { app } from 'electron';
import { normalizeUrl } from '../common';
import { onWebContentsCreated } from './electron-normalize';
let RENDERERS;
/**
 * Enable tracking of renderer properties via events
 *
 * This allows us to get the last known state of a renderer even if it's been destroyed
 **/
export function trackRendererProperties() {
    if (RENDERERS) {
        return;
    }
    const renderers = (RENDERERS = new Map());
    function updateUrl(id, url) {
        const state = renderers.get(id) || { id };
        state.url = normalizeUrl(url, app.getAppPath());
        renderers.set(id, state);
    }
    function updateTitle(id, title) {
        const state = renderers.get(id) || { id };
        state.title = title;
        renderers.set(id, state);
    }
    onWebContentsCreated((contents) => {
        const id = contents.id;
        contents.on('did-navigate', (_, url) => updateUrl(id, url));
        contents.on('did-navigate-in-page', (_, url) => updateUrl(id, url));
        contents.on('page-title-updated', (_, title) => updateTitle(id, title));
        contents.on('destroyed', () => {
            // We need to delay since consumers of this API sometimes need to
            // access the state shortly after a renderer is destroyed
            setTimeout(() => {
                renderers.delete(id);
            }, 5000);
        });
    });
}
/** Gets the properties for a renderer */
export function getRendererProperties(id) {
    return RENDERERS === null || RENDERERS === void 0 ? void 0 : RENDERERS.get(id);
}
//# sourceMappingURL=renderers.js.map{"version":3,"file":"renderers.js","sourceRoot":"","sources":["../../src/main/renderers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,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AC,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAExE,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,iEAAiE;YACjE,yDAAyD;YACzD,UAAU,CAAC,GAAG,EAAE;gBACd,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvB,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,yCAAyC;AACzC,MAAM,UAAU,qBAAqB,CAAC,EAAU;IAC9C,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC","sourcesContent":["import { app } from 'electron';\n\nimport { normalizeUrl } from '../common';\nimport { onWebContentsCreated } from './electron-normalize';\n\ninterface Renderer {\n  id: number;\n  url?: string;\n  title?: string;\n}\n\nlet RENDERERS: Map<number, Renderer> | undefined;\n\n/**\n * Enable tracking of renderer properties via events\n *\n * This allows us to get the last known state of a renderer even if it's been destroyed\n **/\nexport function trackRendererProperties(): void {\n  if (RENDERERS) {\n    return;\n  }\n\n  const renderers = (RENDERERS = new Map<number, Renderer>());\n\n  function updateUrl(id: number, url: string): void {\n    const state = renderers.get(id) || { id };\n    state.url = normalizeUrl(url, app.getAppPath());\n    renderers.set(id, state);\n  }\n\n  function updateTitle(id: number, title: string): void {\n    const state = renderers.get(id) || { id };\n    state.title = title;\n    renderers.set(id, state);\n  }\n\n  onWebContentsCreated((contents) => {\n    const id = contents.id;\n\n    contents.on('did-navigate', (_, url) => updateUrl(id, url));\n    contents.on('did-navigate-in-page', (_, url) => updateUrl(id, url));\n    contents.on('page-title-updated', (_, title) => updateTitle(id, title));\n\n    contents.on('destroyed', () => {\n      // We need to delay since consumers of this API sometimes need to\n      // access the state shortly after a renderer is destroyed\n      setTimeout(() => {\n        renderers.delete(id);\n      }, 5000);\n    });\n  });\n}\n\n/** Gets the properties for a renderer */\nexport function getRendererProperties(id: number): Renderer | undefined {\n  return RENDERERS?.get(id);\n}\n"]}import { IPCMode } from '../common';
import { NodeOptions } from '@sentry/node';
import { Integration, Options } from '@sentry/types';
import { Session, WebContents } from 'electron';
import { ElectronOfflineTransportOptions } from './transports/electron-offline-net';
export declare const defaultIntegrations: Integration[];
export interface ElectronMainOptionsInternal extends Options<ElectronOfflineTransportOptions> {
    /**
     * Inter-process communication mode to receive event and scope from renderers
     *
     * IPCMode.Classic - Configures Electron IPC
     * IPCMode.Protocol - Configures a custom protocol
     * IPCMode.Both - Configures both IPC and custom protocol
     *
     * defaults to IPCMode.Both for maximum compatibility
     */
    ipcMode: IPCMode;
    /**
     * A function that returns an array of Electron session objects
     *
     * These sessions are used to configure communication between the Electron
     * main and renderer processes.
     *
     * Defaults to () => [session.defaultSession]
     */
    getSessions: () => Session[];
    /**
     * Callback to allow custom naming of renderer processes.
     *
     * If the callback is not set, or it returns `undefined`, the default naming
     * scheme is used.
     */
    getRendererName?: (contents: WebContents) => string | undefined;
    /**
     * Screenshots may contain PII and is an opt-in feature
     *
     * If set to true, screenshots will be captured and included with all JavaScript events.
     * Screenshots are not included for native crashes since it's not possible to capture images of crashed Electron
     * renderers.
     */
    attachScreenshot?: boolean;
}
export type ElectronMainOptions = Pick<Partial<ElectronMainOptionsInternal>, 'getSessions' | 'ipcMode'> & Omit<ElectronMainOptionsInternal, 'getSessions' | 'ipcMode'> & NodeOptions;
/**
 * Initialize Sentry in the Electron main process
 */
export declare function init(userOptions: ElectronMainOptions): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/main/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,OAAO,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EAAoE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAW,WAAW,EAAE,MAAM,UAAU,CAAC;AAgBzD,OAAO,EAAE,+BAA+B,EAAgC,MAAM,mCAAmC,CAAC;AAGlH,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAa5C,CAAC;AAEF,MAAM,WAAW,2BAA4B,SAAQ,OAAO,CAAC,+BAA+B,CAAC;IAC3F;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,OAAO,EAAE,CAAC;IAE7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,MAAM,GAAG,SAAS,CAAC;IAEhE;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAGD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,GACrG,IAAI,CAAC,2BAA2B,EAAE,aAAa,GAAG,SAAS,CAAC,GAC5D,WAAW,CAAC;AAQd;;GAEG;AACH,wBAAgB,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,IAAI,CA8B3D"}import { ensureProcess, IPCMode } from '../common';
ensureProcess('main');
import { defaultIntegrations as defaultNodeIntegrations, init as nodeInit } from '@sentry/node';
import { session } from 'electron';
import { getDefaultEnvironment, getDefaultReleaseName } from './context';
import { AdditionalContext, ChildProcess, ElectronBreadcrumbs, MainContext, MainProcessSession, Net, OnUncaughtException, PreloadInjection, Screenshots, SentryMinidump, } from './integrations';
import { configureIPC } from './ipc';
import { makeElectronOfflineTransport } from './transports/electron-offline-net';
import { SDK_VERSION } from './version';
export const defaultIntegrations = [
    new SentryMinidump(),
    new ElectronBreadcrumbs(),
    new Net(),
    new MainContext(),
    new ChildProcess(),
    new OnUncaughtException(),
    new PreloadInjection(),
    new AdditionalContext(),
    new Screenshots(),
    ...defaultNodeIntegrations.filter((integration) => integration.name !== 'OnUncaughtException' && integration.name !== 'Context'),
];
const defaultOptions = {
    _metadata: { sdk: { name: 'sentry.javascript.electron', version: SDK_VERSION } },
    ipcMode: IPCMode.Both,
    getSessions: () => [session.defaultSession],
};
/**
 * Initialize Sentry in the Electron main process
 */
export function init(userOptions) {
    const options = Object.assign(defaultOptions, userOptions);
    const defaults = defaultIntegrations;
    // If we don't set a release, @sentry/node will automatically fetch from environment variables
    if (options.release === undefined) {
        options.release = getDefaultReleaseName();
    }
    // If we don't set an environment, @sentry/core defaults to production
    if (options.environment === undefined) {
        options.environment = getDefaultEnvironment();
    }
    // Unless autoSessionTracking is specifically disabled, we track sessions as the
    // lifetime of the Electron main process
    if (options.autoSessionTracking !== false) {
        defaults.push(new MainProcessSession());
        // We don't want nodejs autoSessionTracking
        options.autoSessionTracking = false;
    }
    setDefaultIntegrations(defaults, options);
    if (options.dsn && options.transport === undefined) {
        options.transport = makeElectronOfflineTransport;
    }
    configureIPC(options);
    nodeInit(options);
}
/** Sets the default integrations and ensures that multiple minidump integrations are not enabled */
function setDefaultIntegrations(defaults, options) {
    if (options.defaultIntegrations === undefined) {
        // If ElectronMinidump has been included, automatically remove SentryMinidump
        if (Array.isArray(options.integrations) && options.integrations.some((i) => i.name === 'ElectronMinidump')) {
            options.defaultIntegrations = defaults.filter((integration) => integration.name !== 'SentryMinidump');
            return;
        }
        else if (typeof options.integrations === 'function') {
            const originalFn = options.integrations;
            options.integrations = (integrations) => {
                const userIntegrations = originalFn(integrations);
                return userIntegrations.some((i) => i.name === 'ElectronMinidump')
                    ? userIntegrations.filter((integration) => integration.name !== 'SentryMinidump')
                    : userIntegrations;
            };
        }
        options.defaultIntegrations = defaults;
    }
}
//# sourceMappingURL=sdk.js.map{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/main/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,aAAa,CAA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AE,CAAC,WAAW,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;YACtG,OAAO;SACR;aAAM,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;YACrD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;YAExC,OAAO,CAAC,YAAY,GAAG,CAAC,YAAY,EAAE,EAAE;gBACtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;gBAClD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC;oBAChE,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,gBAAgB,CAAC;oBACjF,CAAC,CAAC,gBAAgB,CAAC;YACvB,CAAC,CAAC;SACH;QAED,OAAO,CAAC,mBAAmB,GAAG,QAAQ,CAAC;KACxC;AACH,CAAC","sourcesContent":["import { ensureProcess, IPCMode } from '../common';\nensureProcess('main');\n\nimport { defaultIntegrations as defaultNodeIntegrations, init as nodeInit, NodeOptions } from '@sentry/node';\nimport { Integration, Options } from '@sentry/types';\nimport { Session, session, WebContents } from 'electron';\n\nimport { getDefaultEnvironment, getDefaultReleaseName } from './context';\nimport {\n  AdditionalContext,\n  ChildProcess,\n  ElectronBreadcrumbs,\n  MainContext,\n  MainProcessSession,\n  Net,\n  OnUncaughtException,\n  PreloadInjection,\n  Screenshots,\n  SentryMinidump,\n} from './integrations';\nimport { configureIPC } from './ipc';\nimport { ElectronOfflineTransportOptions, makeElectronOfflineTransport } from './transports/electron-offline-net';\nimport { SDK_VERSION } from './version';\n\nexport const defaultIntegrations: Integration[] = [\n  new SentryMinidump(),\n  new ElectronBreadcrumbs(),\n  new Net(),\n  new MainContext(),\n  new ChildProcess(),\n  new OnUncaughtException(),\n  new PreloadInjection(),\n  new AdditionalContext(),\n  new Screenshots(),\n  ...defaultNodeIntegrations.filter(\n    (integration) => integration.name !== 'OnUncaughtException' && integration.name !== 'Context',\n  ),\n];\n\nexport interface ElectronMainOptionsInternal extends Options<ElectronOfflineTransportOptions> {\n  /**\n   * Inter-process communication mode to receive event and scope from renderers\n   *\n   * IPCMode.Classic - Configures Electron IPC\n   * IPCMode.Protocol - Configures a custom protocol\n   * IPCMode.Both - Configures both IPC and custom protocol\n   *\n   * defaults to IPCMode.Both for maximum compatibility\n   */\n  ipcMode: IPCMode;\n\n  /**\n   * A function that returns an array of Electron session objects\n   *\n   * These sessions are used to configure communication between the Electron\n   * main and renderer processes.\n   *\n   * Defaults to () => [session.defaultSession]\n   */\n  getSessions: () => Session[];\n\n  /**\n   * Callback to allow custom naming of renderer processes.\n   *\n   * If the callback is not set, or it returns `undefined`, the default naming\n   * scheme is used.\n   */\n  getRendererName?: (contents: WebContents) => string | undefined;\n\n  /**\n   * Screenshots may contain PII and is an opt-in feature\n   *\n   * If set to true, screenshots will be captured and included with all JavaScript events.\n   * Screenshots are not included for native crashes since it's not possible to capture images of crashed Electron\n   * renderers.\n   */\n  attachScreenshot?: boolean;\n}\n\n// getSessions and ipcMode properties are optional because they have defaults\nexport type ElectronMainOptions = Pick<Partial<ElectronMainOptionsInternal>, 'getSessions' | 'ipcMode'> &\n  Omit<ElectronMainOptionsInternal, 'getSessions' | 'ipcMode'> &\n  NodeOptions;\n\nconst defaultOptions: ElectronMainOptionsInternal = {\n  _metadata: { sdk: { name: 'sentry.javascript.electron', version: SDK_VERSION } },\n  ipcMode: IPCMode.Both,\n  getSessions: () => [session.defaultSession],\n};\n\n/**\n * Initialize Sentry in the Electron main process\n */\nexport function init(userOptions: ElectronMainOptions): void {\n  const options: ElectronMainOptionsInternal = Object.assign(defaultOptions, userOptions);\n  const defaults = defaultIntegrations;\n\n  // If we don't set a release, @sentry/node will automatically fetch from environment variables\n  if (options.release === undefined) {\n    options.release = getDefaultReleaseName();\n  }\n\n  // If we don't set an environment, @sentry/core defaults to production\n  if (options.environment === undefined) {\n    options.environment = getDefaultEnvironment();\n  }\n\n  // Unless autoSessionTracking is specifically disabled, we track sessions as the\n  // lifetime of the Electron main process\n  if (options.autoSessionTracking !== false) {\n    defaults.push(new MainProcessSession());\n    // We don't want nodejs autoSessionTracking\n    options.autoSessionTracking = false;\n  }\n\n  setDefaultIntegrations(defaults, options);\n\n  if (options.dsn && options.transport === undefined) {\n    options.transport = makeElectronOfflineTransport;\n  }\n\n  configureIPC(options);\n  nodeInit(options);\n}\n\n/** Sets the default integrations and ensures that multiple minidump integrations are not enabled */\nfunction setDefaultIntegrations(defaults: Integration[], options: ElectronMainOptions): void {\n  if (options.defaultIntegrations === undefined) {\n    // If ElectronMinidump has been included, automatically remove SentryMinidump\n    if (Array.isArray(options.integrations) && options.integrations.some((i) => i.name === 'ElectronMinidump')) {\n      options.defaultIntegrations = defaults.filter((integration) => integration.name !== 'SentryMinidump');\n      return;\n    } else if (typeof options.integrations === 'function') {\n      const originalFn = options.integrations;\n\n      options.integrations = (integrations) => {\n        const userIntegrations = originalFn(integrations);\n        return userIntegrations.some((i) => i.name === 'ElectronMinidump')\n          ? userIntegrations.filter((integration) => integration.name !== 'SentryMinidump')\n          : userIntegrations;\n      };\n    }\n\n    options.defaultIntegrations = defaults;\n  }\n}\n"]}/** Starts a session */
export declare function startSession(): Promise<void>;
/** Cleanly ends a session */
export declare function endSession(): Promise<void>;
/** Determines if a Date is likely to have occurred in the previous uncompleted session */
export declare function unreportedDuringLastSession(crashDate: Date | undefined): Promise<boolean>;
/** Checks if the previous session needs sending as crashed or abnormal  */
export declare function checkPreviousSession(crashed: boolean): Promise<void>;
/** Sets the current session as crashed */
export declare function sessionCrashed(): void;
//# sourceMappingURL=sessions.d.ts.map{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/main/sessions.ts"],"names":[],"mappings":"AAkBA,uBAAuB;AACvB,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAYlD;AAED,6BAA6B;AAC7B,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAuBhD;AAED,0FAA0F;AAC1F,wBAAsB,2BAA2B,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB/F;AAED,2EAA2E;AAC3E,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B1E;AAED,0CAA0C;AAC1C,wBAAgB,cAAc,IAAI,IAAI,CAuBrC"}import { __awaiter } from "tslib";
import { getCurrentHub, makeSession, updateSession } from '@sentry/core';
import { flush } from '@sentry/node';
import { logger } from '@sentry/utils';
import { sentryCachePath } from './fs';
import { Store } from './store';
const PERSIST_INTERVAL_MS = 60000;
/** Stores the app session in case of termination due to main process crash or app killed */
const sessionStore = new Store(sentryCachePath, 'session', undefined);
/** Previous session that did not exit cleanly */
let previousSession = sessionStore.get();
let persistTimer;
/** Starts a session */
export function startSession() {
    return __awaiter(this, void 0, void 0, function* () {
        const hub = getCurrentHub();
        yield sessionStore.set(hub.startSession());
        // Every PERSIST_INTERVAL, write the session to disk
        persistTimer = setInterval(() => __awaiter(this, void 0, void 0, function* () {
            var _a;
            const currentSession = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
            // Only bother saving if it hasn't already ended
            if (currentSession && currentSession.status === 'ok') {
                yield sessionStore.set(currentSession);
            }
        }), PERSIST_INTERVAL_MS);
    });
}
/** Cleanly ends a session */
export function endSession() {
    var _a;
    return __awaiter(this, void 0, void 0, function* () {
        // Once the session had ended there is no point persisting it
        if (persistTimer) {
            clearInterval(persistTimer);
        }
        const hub = getCurrentHub();
        const session = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
        if (session) {
            if (session.status === 'ok') {
                logger.log('Ending session');
                hub.endSession();
            }
            else {
                logger.log('Session was already ended');
            }
        }
        else {
            logger.log('No session');
        }
        yield sessionStore.clear();
        yield flush(2000);
    });
}
/** Determines if a Date is likely to have occurred in the previous uncompleted session */
export function unreportedDuringLastSession(crashDate) {
    return __awaiter(this, void 0, void 0, function* () {
        if (!crashDate) {
            return false;
        }
        const previousSessionModified = yield sessionStore.getModifiedDate();
        // There is no previous session
        if (previousSessionModified == undefined) {
            return false;
        }
        const previousSessionModifiedTime = previousSessionModified.getTime();
        const crashTime = crashDate.getTime();
        // Session could have run until modified time + persist interval
        const prevSessionEnd = previousSessionModifiedTime + PERSIST_INTERVAL_MS;
        // Event cannot have occurred before last persist time, We add a 2 second overlap to be sure
        const lastPersist = previousSessionModifiedTime - 2000;
        // If the crash occurred between the last persist and estimated end of session
        return crashTime > lastPersist && crashTime < prevSessionEnd;
    });
}
/** Checks if the previous session needs sending as crashed or abnormal  */
export function checkPreviousSession(crashed) {
    var _a, _b;
    return __awaiter(this, void 0, void 0, function* () {
        const client = getCurrentHub().getClient();
        const previous = yield previousSession;
        if (previous && client) {
            // Ignore if the previous session is already ended
            if (previous.status !== 'ok') {
                previousSession = undefined;
                return;
            }
            const status = crashed ? 'crashed' : 'abnormal';
            logger.log(`Found previous ${status} session`);
            const sesh = makeSession(previous);
            updateSession(sesh, {
                status,
                errors: (sesh.errors || 0) + 1,
                release: (_a = previous.attrs) === null || _a === void 0 ? void 0 : _a.release,
                environment: (_b = previous.attrs) === null || _b === void 0 ? void 0 : _b.environment,
            });
            yield client.sendSession(sesh);
            previousSession = undefined;
        }
    });
}
/** Sets the current session as crashed */
export function sessionCrashed() {
    var _a;
    // stop persisting session
    if (persistTimer) {
        clearInterval(persistTimer);
    }
    logger.log('Session Crashed');
    const hub = getCurrentHub();
    const session = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
    if (!session) {
        logger.log('No session to update');
        return;
    }
    if (session.status === 'ok') {
        logger.log('Setting session as crashed');
        updateSession(session, { status: 'crashed', errors: (session.errors += 1) });
    }
    else {
        logger.log('Session already ended');
    }
    hub.captureSession();
}
//# sourceMappingURL=sessions.js.map{"version":3,"file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EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;KAC9E;SAAM;QACL,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;KACrC;IAED,GAAG,CAAC,cAAc,EAAE,CAAC;AACvB,CAAC","sourcesContent":["import { getCurrentHub, makeSession, updateSession } from '@sentry/core';\nimport { flush, NodeClient } from '@sentry/node';\nimport { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { sentryCachePath } from './fs';\nimport { Store } from './store';\n\nconst PERSIST_INTERVAL_MS = 60_000;\n\n/** Stores the app session in case of termination due to main process crash or app killed */\nconst sessionStore = new Store<SessionContext | undefined>(sentryCachePath, 'session', undefined);\n\n/** Previous session that did not exit cleanly */\nlet previousSession: Promise<Partial<Session> | undefined> | undefined = sessionStore.get();\n\nlet persistTimer: NodeJS.Timer | undefined;\n\n/** Starts a session */\nexport async function startSession(): Promise<void> {\n  const hub = getCurrentHub();\n  await sessionStore.set(hub.startSession());\n\n  // Every PERSIST_INTERVAL, write the session to disk\n  persistTimer = setInterval(async () => {\n    const currentSession = hub.getScope()?.getSession();\n    // Only bother saving if it hasn't already ended\n    if (currentSession && currentSession.status === 'ok') {\n      await sessionStore.set(currentSession);\n    }\n  }, PERSIST_INTERVAL_MS);\n}\n\n/** Cleanly ends a session */\nexport async function endSession(): Promise<void> {\n  // Once the session had ended there is no point persisting it\n  if (persistTimer) {\n    clearInterval(persistTimer);\n  }\n\n  const hub = getCurrentHub();\n  const session = hub.getScope()?.getSession();\n\n  if (session) {\n    if (session.status === 'ok') {\n      logger.log('Ending session');\n      hub.endSession();\n    } else {\n      logger.log('Session was already ended');\n    }\n  } else {\n    logger.log('No session');\n  }\n\n  await sessionStore.clear();\n\n  await flush(2_000);\n}\n\n/** Determines if a Date is likely to have occurred in the previous uncompleted session */\nexport async function unreportedDuringLastSession(crashDate: Date | undefined): Promise<boolean> {\n  if (!crashDate) {\n    return false;\n  }\n\n  const previousSessionModified = await sessionStore.getModifiedDate();\n  // There is no previous session\n  if (previousSessionModified == undefined) {\n    return false;\n  }\n\n  const previousSessionModifiedTime = previousSessionModified.getTime();\n  const crashTime = crashDate.getTime();\n\n  // Session could have run until modified time + persist interval\n  const prevSessionEnd = previousSessionModifiedTime + PERSIST_INTERVAL_MS;\n\n  // Event cannot have occurred before last persist time, We add a 2 second overlap to be sure\n  const lastPersist = previousSessionModifiedTime - 2_000;\n\n  // If the crash occurred between the last persist and estimated end of session\n  return crashTime > lastPersist && crashTime < prevSessionEnd;\n}\n\n/** Checks if the previous session needs sending as crashed or abnormal  */\nexport async function checkPreviousSession(crashed: boolean): Promise<void> {\n  const client = getCurrentHub().getClient<NodeClient>();\n\n  const previous = await previousSession;\n\n  if (previous && client) {\n    // Ignore if the previous session is already ended\n    if (previous.status !== 'ok') {\n      previousSession = undefined;\n      return;\n    }\n\n    const status: SessionStatus = crashed ? 'crashed' : 'abnormal';\n\n    logger.log(`Found previous ${status} session`);\n\n    const sesh = makeSession(previous);\n\n    updateSession(sesh, {\n      status,\n      errors: (sesh.errors || 0) + 1,\n      release: (previous as unknown as SerializedSession).attrs?.release,\n      environment: (previous as unknown as SerializedSession).attrs?.environment,\n    });\n\n    await client.sendSession(sesh);\n\n    previousSession = undefined;\n  }\n}\n\n/** Sets the current session as crashed */\nexport function sessionCrashed(): void {\n  // stop persisting session\n  if (persistTimer) {\n    clearInterval(persistTimer);\n  }\n\n  logger.log('Session Crashed');\n  const hub = getCurrentHub();\n  const session = hub.getScope()?.getSession();\n\n  if (!session) {\n    logger.log('No session to update');\n    return;\n  }\n\n  if (session.status === 'ok') {\n    logger.log('Setting session as crashed');\n    updateSession(session, { status: 'crashed', errors: (session.errors += 1) });\n  } else {\n    logger.log('Session already ended');\n  }\n\n  hub.captureSession();\n}\n"]}/**
 * Stores data serialized to a JSON file.
 */
export declare class Store<T> {
    /** Current state of the data. */
    protected _data?: T;
    /** Internal path for JSON file. */
    private readonly _path;
    /** Value used to initialize data for the first time. */
    private readonly _initial;
    /** A mutex to ensure that there aren't races while reading and writing files */
    private _lock;
    /**
     * Creates a new store.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     */
    constructor(path: string, id: string, initial: T);
    /**
     * Updates data by replacing it with the given value.
     * @param data New data to replace the previous one.
     */
    set(data: T): Promise<void>;
    /**
     * Returns the current data.
     *
     * When invoked for the first time, it will try to load previously stored data
     * from disk. If the file does not exist, the initial value provided to the
     * constructor is used.
     */
    get(): Promise<T>;
    /**
     * Updates data by passing it through the given function.
     * @param fn A function receiving the current data and returning new one.
     */
    update(fn: (current: T) => T): Promise<void>;
    /** Returns store to its initial state */
    clear(): Promise<void>;
    /** Gets the Date that the file was last modified */
    getModifiedDate(): Promise<Date | undefined>;
}
/**
 * Extends Store to throttle writes.
 */
export declare class BufferedWriteStore<T> extends Store<T> {
    /** The minimum time between writes */
    private readonly _throttleTime?;
    /** A write that hasn't been written to disk yet */
    private _pendingWrite;
    /**
     * Creates a new ThrottledStore.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     * @param throttleTime The minimum time between writes
     */
    constructor(path: string, id: string, initial: T, throttleTime?: number);
    /** @inheritdoc */
    set(data: T): Promise<void>;
    /** Writes the pending write to disk */
    private _writePending;
}
//# sourceMappingURL=store.d.ts.map{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/main/store.ts"],"names":[],"mappings":"AAiBA;;GAEG;AACH,qBAAa,KAAK,CAAC,CAAC;IAClB,iCAAiC;IACjC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAEpB,mCAAmC;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,wDAAwD;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAI;IAC7B,gFAAgF;IAChF,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;;;;OAMG;gBACgB,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAKvD;;;OAGG;IACU,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBxC;;;;;;OAMG;IACU,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC;IAc9B;;;OAGG;IACU,MAAM,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD,yCAAyC;IAC5B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC,oDAAoD;IACvC,eAAe,IAAI,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;CAO1D;AAED;;GAEG;AACH,qBAAa,kBAAkB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACjD,sCAAsC;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAS;IACxC,mDAAmD;IACnD,OAAO,CAAC,aAAa,CAAmD;IAExE;;;;;;;OAOG;gBACgB,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,YAAY,GAAE,MAAY;IAKnF,kBAAkB;IACI,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjD,uCAAuC;IACvC,OAAO,CAAC,aAAa;CAQtB"}import { __awaiter } from "tslib";
import { logger } from '@sentry/utils';
import { dirname, join } from 'path';
import { Mutex } from '../common/mutex';
import { mkdirp, readFileAsync, statAsync, unlinkAsync, writeFileAsync } from './fs';
const dateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.*\d{0,10}Z$/;
/** JSON revive function to enable de-serialization of Date objects */
function dateReviver(_, value) {
    if (typeof value === 'string' && dateFormat.test(value)) {
        return new Date(value);
    }
    return value;
}
/**
 * Stores data serialized to a JSON file.
 */
export class Store {
    /**
     * Creates a new store.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     */
    constructor(path, id, initial) {
        /** A mutex to ensure that there aren't races while reading and writing files */
        this._lock = new Mutex();
        this._path = join(path, `${id}.json`);
        this._initial = initial;
    }
    /**
     * Updates data by replacing it with the given value.
     * @param data New data to replace the previous one.
     */
    set(data) {
        return __awaiter(this, void 0, void 0, function* () {
            yield this._lock.runExclusive(() => __awaiter(this, void 0, void 0, function* () {
                this._data = data;
                try {
                    if (data === undefined) {
                        try {
                            yield unlinkAsync(this._path);
                        }
                        catch (_) {
                            //
                        }
                    }
                    else {
                        yield mkdirp(dirname(this._path));
                        yield writeFileAsync(this._path, JSON.stringify(data));
                    }
                }
                catch (e) {
                    logger.warn('Failed to write to store', e);
                    // This usually fails due to anti virus scanners, issues in the file
                    // system, or problems with network drives. We cannot fix or handle this
                    // issue and must resume gracefully. Thus, we have to ignore this error.
                }
            }));
        });
    }
    /**
     * Returns the current data.
     *
     * When invoked for the first time, it will try to load previously stored data
     * from disk. If the file does not exist, the initial value provided to the
     * constructor is used.
     */
    get() {
        return __awaiter(this, void 0, void 0, function* () {
            return yield this._lock.runExclusive(() => __awaiter(this, void 0, void 0, function* () {
                if (this._data === undefined) {
                    try {
                        this._data = JSON.parse(yield readFileAsync(this._path, 'utf8'), dateReviver);
                    }
                    catch (e) {
                        this._data = this._initial;
                    }
                }
                return this._data;
            }));
        });
    }
    /**
     * Updates data by passing it through the given function.
     * @param fn A function receiving the current data and returning new one.
     */
    update(fn) {
        return __awaiter(this, void 0, void 0, function* () {
            yield this.set(fn(yield this.get()));
        });
    }
    /** Returns store to its initial state */
    clear() {
        return __awaiter(this, void 0, void 0, function* () {
            yield this.set(this._initial);
        });
    }
    /** Gets the Date that the file was last modified */
    getModifiedDate() {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            try {
                return (_a = (yield statAsync(this._path))) === null || _a === void 0 ? void 0 : _a.mtime;
            }
            catch (_) {
                return undefined;
            }
        });
    }
}
/**
 * Extends Store to throttle writes.
 */
export class BufferedWriteStore extends Store {
    /**
     * Creates a new ThrottledStore.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     * @param throttleTime The minimum time between writes
     */
    constructor(path, id, initial, throttleTime = 500) {
        super(path, id, initial);
        this._throttleTime = throttleTime;
    }
    /** @inheritdoc */
    set(data) {
        var _a;
        return __awaiter(this, void 0, void 0, function* () {
            this._data = data;
            this._pendingWrite = {
                // We overwrite the data for the pending write so that the latest data is written in the next flush
                data,
                // If there is already a pending timeout, we keep that rather than starting the timeout again
                timeout: ((_a = this._pendingWrite) === null || _a === void 0 ? void 0 : _a.timeout) || setTimeout(() => this._writePending(), this._throttleTime),
            };
        });
    }
    /** Writes the pending write to disk */
    _writePending() {
        if (this._pendingWrite) {
            const data = this._pendingWrite.data;
            // Clear the pending write immediately so that subsequent writes can be queued
            this._pendingWrite = undefined;
            void super.set(data);
        }
    }
}
//# sourceMappingURL=store.js.map{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/main/store.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAErF,MAAM,UAAU,GAAG,mDAAmD,CAAC;AAEvE,sEAAsE;AACtE,SAAS,WAAW,CAAC,CAAS,EAAE,KAAU;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACvD,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC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GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC;aACnG,CAAC;;KACH;IAED,uCAAuC;IAC/B,aAAa;QACnB,IAAI,IAAI,CAAC,aAAa,EAAE;YACtB,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACrC,8EAA8E;YAC9E,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;YAC/B,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACtB;IACH,CAAC;CACF","sourcesContent":["import { logger } from '@sentry/utils';\nimport { dirname, join } from 'path';\n\nimport { Mutex } from '../common/mutex';\nimport { mkdirp, readFileAsync, statAsync, unlinkAsync, writeFileAsync } from './fs';\n\nconst dateFormat = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.*\\d{0,10}Z$/;\n\n/** JSON revive function to enable de-serialization of Date objects */\nfunction dateReviver(_: string, value: any): any {\n  if (typeof value === 'string' && dateFormat.test(value)) {\n    return new Date(value);\n  }\n\n  return value;\n}\n\n/**\n * Stores data serialized to a JSON file.\n */\nexport class Store<T> {\n  /** Current state of the data. */\n  protected _data?: T;\n\n  /** Internal path for JSON file. */\n  private readonly _path: string;\n  /** Value used to initialize data for the first time. */\n  private readonly _initial: T;\n  /** A mutex to ensure that there aren't races while reading and writing files */\n  private _lock: Mutex = new Mutex();\n\n  /**\n   * Creates a new store.\n   *\n   * @param path A unique filename to store this data.\n   * @param id A unique filename to store this data.\n   * @param initial An initial value to initialize data with.\n   */\n  public constructor(path: string, id: string, initial: T) {\n    this._path = join(path, `${id}.json`);\n    this._initial = initial;\n  }\n\n  /**\n   * Updates data by replacing it with the given value.\n   * @param data New data to replace the previous one.\n   */\n  public async set(data: T): Promise<void> {\n    await this._lock.runExclusive(async () => {\n      this._data = data;\n\n      try {\n        if (data === undefined) {\n          try {\n            await unlinkAsync(this._path);\n          } catch (_) {\n            //\n          }\n        } else {\n          await mkdirp(dirname(this._path));\n          await writeFileAsync(this._path, JSON.stringify(data));\n        }\n      } catch (e) {\n        logger.warn('Failed to write to store', e);\n        // This usually fails due to anti virus scanners, issues in the file\n        // system, or problems with network drives. We cannot fix or handle this\n        // issue and must resume gracefully. Thus, we have to ignore this error.\n      }\n    });\n  }\n\n  /**\n   * Returns the current data.\n   *\n   * When invoked for the first time, it will try to load previously stored data\n   * from disk. If the file does not exist, the initial value provided to the\n   * constructor is used.\n   */\n  public async get(): Promise<T> {\n    return await this._lock.runExclusive(async () => {\n      if (this._data === undefined) {\n        try {\n          this._data = JSON.parse(await readFileAsync(this._path, 'utf8'), dateReviver) as T;\n        } catch (e) {\n          this._data = this._initial;\n        }\n      }\n\n      return this._data;\n    });\n  }\n\n  /**\n   * Updates data by passing it through the given function.\n   * @param fn A function receiving the current data and returning new one.\n   */\n  public async update(fn: (current: T) => T): Promise<void> {\n    await this.set(fn(await this.get()));\n  }\n\n  /** Returns store to its initial state */\n  public async clear(): Promise<void> {\n    await this.set(this._initial);\n  }\n\n  /** Gets the Date that the file was last modified */\n  public async getModifiedDate(): Promise<Date | undefined> {\n    try {\n      return (await statAsync(this._path))?.mtime;\n    } catch (_) {\n      return undefined;\n    }\n  }\n}\n\n/**\n * Extends Store to throttle writes.\n */\nexport class BufferedWriteStore<T> extends Store<T> {\n  /** The minimum time between writes */\n  private readonly _throttleTime?: number;\n  /** A write that hasn't been written to disk yet */\n  private _pendingWrite: { data: T; timeout: NodeJS.Timeout } | undefined;\n\n  /**\n   * Creates a new ThrottledStore.\n   *\n   * @param path A unique filename to store this data.\n   * @param id A unique filename to store this data.\n   * @param initial An initial value to initialize data with.\n   * @param throttleTime The minimum time between writes\n   */\n  public constructor(path: string, id: string, initial: T, throttleTime: number = 500) {\n    super(path, id, initial);\n    this._throttleTime = throttleTime;\n  }\n\n  /** @inheritdoc */\n  public override async set(data: T): Promise<void> {\n    this._data = data;\n\n    this._pendingWrite = {\n      // We overwrite the data for the pending write so that the latest data is written in the next flush\n      data,\n      // If there is already a pending timeout, we keep that rather than starting the timeout again\n      timeout: this._pendingWrite?.timeout || setTimeout(() => this._writePending(), this._throttleTime),\n    };\n  }\n\n  /** Writes the pending write to disk */\n  private _writePending(): void {\n    if (this._pendingWrite) {\n      const data = this._pendingWrite.data;\n      // Clear the pending write immediately so that subsequent writes can be queued\n      this._pendingWrite = undefined;\n      void super.set(data);\n    }\n  }\n}\n"]}import { BaseTransportOptions, Transport, TransportRequestExecutor } from '@sentry/types';
export interface ElectronNetTransportOptions extends BaseTransportOptions {
    /** Define custom headers */
    headers?: Record<string, string>;
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry.
 */
export declare function makeElectronTransport(options: ElectronNetTransportOptions): Transport;
/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
export declare function createElectronNetRequestExecutor(url: string, baseHeaders: Record<string, string>): TransportRequestExecutor;
//# sourceMappingURL=electron-net.d.ts.map{"version":3,"file":"electron-net.d.ts","sourceRoot":"","sources":["../../../src/main/transports/electron-net.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGT,wBAAwB,EACzB,MAAM,eAAe,CAAC;AASvB,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AA8BD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,2BAA2B,GAAG,SAAS,CAErF;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,wBAAwB,CAqD1B"}import { createTransport } from '@sentry/core';
import { dropUndefinedKeys } from '@sentry/utils';
import { net } from 'electron';
import { Readable } from 'stream';
import { URL } from 'url';
import { createGzip } from 'zlib';
import { whenAppReady } from '../electron-normalize';
// Estimated maximum size for reasonable standalone event
const GZIP_THRESHOLD = 1024 * 32;
/**
 * Gets a stream from a Buffer or string
 * We don't have Readable.from in earlier versions of node
 */
function streamFromBody(body) {
    return new Readable({
        read() {
            this.push(body);
            this.push(null);
        },
    });
}
function getRequestOptions(url) {
    const { hostname, pathname, port, protocol, search } = new URL(url);
    return {
        method: 'POST',
        hostname,
        path: `${pathname}${search}`,
        port: parseInt(port, 10),
        protocol,
    };
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry.
 */
export function makeElectronTransport(options) {
    return createTransport(options, createElectronNetRequestExecutor(options.url, options.headers || {}));
}
/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
export function createElectronNetRequestExecutor(url, baseHeaders) {
    baseHeaders['Content-Type'] = 'application/x-sentry-envelope';
    return function makeRequest(request) {
        return whenAppReady.then(() => new Promise((resolve, reject) => {
            let bodyStream = streamFromBody(request.body);
            const headers = Object.assign({}, baseHeaders);
            if (request.body.length > GZIP_THRESHOLD) {
                headers['content-encoding'] = 'gzip';
                bodyStream = bodyStream.pipe(createGzip());
            }
            const req = net.request(getRequestOptions(url));
            for (const header of Object.keys(headers)) {
                req.setHeader(header, headers[header]);
            }
            req.on('response', (res) => {
                var _a, _b;
                res.on('error', reject);
                res.on('data', () => {
                    // Drain socket
                });
                res.on('end', () => {
                    // Drain socket
                });
                // "Key-value pairs of header names and values. Header names are lower-cased."
                // https://nodejs.org/api/http.html#http_message_headers
                const retryAfterHeader = (_a = res.headers['retry-after']) !== null && _a !== void 0 ? _a : undefined;
                const rateLimitsHeader = (_b = res.headers['x-sentry-rate-limits']) !== null && _b !== void 0 ? _b : undefined;
                resolve({
                    headers: dropUndefinedKeys({
                        'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] : retryAfterHeader,
                        'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,
                    }),
                });
            });
            req.on('error', reject);
            // The docs say that ClientRequest is Writable but the types don't match exactly
            bodyStream.pipe(req);
        }));
    };
}
//# sourceMappingURL=electron-net.js.map{"version":3,"file":"electron-net.js","sourceRoot":"","sources":["../../../src/main/transports/electron-net.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAY,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAOrD,yDAAyD;AACzD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AAEjC;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAyB;IAC/C,OAAO,IAAI,QAAQ,CAAC;QAClB,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAEpE,OAAO;QACL,MAAM,EAAE,MAAM;QACd,QAAQ;QACR,IAAI,EAAE,GAAG,QAAQ,GAAG,MAAM,EAAE;QAC5B,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;QACxB,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAoC;IACxE,OAAO,eAAe,CAAC,OAAO,EAAE,gCAAgC,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC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AA,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,SAAS,CAAC;gBACjE,MAAM,gBAAgB,GAAG,MAAA,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,mCAAI,SAAS,CAAC;gBAE1E,OAAO,CAAC;oBACN,OAAO,EAAE,iBAAiB,CAAC;wBACzB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;wBACvF,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;qBACjG,CAAC;iBACH,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAExB,gFAAgF;YAChF,UAAU,CAAC,IAAI,CAAC,GAA0B,CAAC,CAAC;QAC9C,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport {\n  BaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequest,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { net } from 'electron';\nimport { Readable, Writable } from 'stream';\nimport { URL } from 'url';\nimport { createGzip } from 'zlib';\n\nimport { whenAppReady } from '../electron-normalize';\n\nexport interface ElectronNetTransportOptions extends BaseTransportOptions {\n  /** Define custom headers */\n  headers?: Record<string, string>;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Buffer or string\n * We don't have Readable.from in earlier versions of node\n */\nfunction streamFromBody(body: string | Uint8Array): Readable {\n  return new Readable({\n    read() {\n      this.push(body);\n      this.push(null);\n    },\n  });\n}\n\nfunction getRequestOptions(url: string): Electron.ClientRequestConstructorOptions {\n  const { hostname, pathname, port, protocol, search } = new URL(url);\n\n  return {\n    method: 'POST',\n    hostname,\n    path: `${pathname}${search}`,\n    port: parseInt(port, 10),\n    protocol,\n  };\n}\n\n/**\n * Creates a Transport that uses Electrons net module to send events to Sentry.\n */\nexport function makeElectronTransport(options: ElectronNetTransportOptions): Transport {\n  return createTransport(options, createElectronNetRequestExecutor(options.url, options.headers || {}));\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nexport function createElectronNetRequestExecutor(\n  url: string,\n  baseHeaders: Record<string, string>,\n): TransportRequestExecutor {\n  baseHeaders['Content-Type'] = 'application/x-sentry-envelope';\n\n  return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    return whenAppReady.then(\n      () =>\n        new Promise((resolve, reject) => {\n          let bodyStream = streamFromBody(request.body);\n\n          const headers = { ...baseHeaders };\n\n          if (request.body.length > GZIP_THRESHOLD) {\n            headers['content-encoding'] = 'gzip';\n            bodyStream = bodyStream.pipe(createGzip());\n          }\n\n          const req = net.request(getRequestOptions(url));\n\n          for (const header of Object.keys(headers)) {\n            req.setHeader(header, headers[header]);\n          }\n\n          req.on('response', (res) => {\n            res.on('error', reject);\n\n            res.on('data', () => {\n              // Drain socket\n            });\n\n            res.on('end', () => {\n              // Drain socket\n            });\n\n            // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n            // https://nodejs.org/api/http.html#http_message_headers\n            const retryAfterHeader = res.headers['retry-after'] ?? undefined;\n            const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? undefined;\n\n            resolve({\n              headers: dropUndefinedKeys({\n                'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] : retryAfterHeader,\n                'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,\n              }),\n            });\n          });\n\n          req.on('error', reject);\n\n          // The docs say that ClientRequest is Writable but the types don't match exactly\n          bodyStream.pipe(req as unknown as Writable);\n        }),\n    );\n  };\n}\n"]}import { Transport, TransportRequest } from '@sentry/types';
import { ElectronNetTransportOptions } from './electron-net';
type BeforeSendResponse = 'send' | 'queue' | 'drop';
export interface ElectronOfflineTransportOptions extends ElectronNetTransportOptions {
    /**
     * The maximum number of days to keep an event in the queue.
     */
    maxQueueAgeDays?: number;
    /**
     * The maximum number of events to keep in the queue.
     */
    maxQueueCount?: number;
    /**
     * Called every time the number of requests in the queue changes.
     */
    queuedLengthChanged?: (length: number) => void;
    /**
     * Called before attempting to send an event to Sentry.
     *
     * Return 'send' to attempt to send the event.
     * Return 'queue' to queue and persist the event for sending later.
     * Return 'drop' to drop the event.
     */
    beforeSend?: (request: TransportRequest) => BeforeSendResponse | Promise<BeforeSendResponse>;
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are
 * persisted to disk and sent later
 */
export declare function makeElectronOfflineTransport(options: ElectronOfflineTransportOptions): Transport;
export {};
//# sourceMappingURL=electron-offline-net.d.ts.map{"version":3,"file":"electron-offline-net.d.ts","sourceRoot":"","sources":["../../../src/main/transports/electron-offline-net.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgC,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAM1F,OAAO,EAAoC,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAG/F,KAAK,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,+BAAgC,SAAQ,2BAA2B;IAClF;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/C;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC9F;AAkBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,+BAA+B,GAAG,SAAS,CA8FhG"}import { __awaiter } from "tslib";
import { createTransport } from '@sentry/core';
import { logger } from '@sentry/utils';
import { net } from 'electron';
import { join } from 'path';
import { sentryCachePath } from '../fs';
import { createElectronNetRequestExecutor } from './electron-net';
import { PersistedRequestQueue } from './queue';
const START_DELAY = 5000;
const MAX_DELAY = 2000000000;
/** Returns true is there's a chance we're online */
function maybeOnline() {
    return !('online' in net) || net.online === true;
}
function defaultBeforeSend(_) {
    return maybeOnline() ? 'send' : 'queue';
}
function isRateLimited(result) {
    return !!(result.headers && 'x-sentry-rate-limits' in result.headers);
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are
 * persisted to disk and sent later
 */
export function makeElectronOfflineTransport(options) {
    const netMakeRequest = createElectronNetRequestExecutor(options.url, options.headers || {});
    const queue = new PersistedRequestQueue(join(sentryCachePath, 'queue'), options.maxQueueAgeDays, options.maxQueueCount);
    const beforeSend = options.beforeSend || defaultBeforeSend;
    let retryDelay = START_DELAY;
    let lastQueueLength = -1;
    function queueLengthChanged(queuedEvents) {
        if (options.queuedLengthChanged && queuedEvents !== lastQueueLength) {
            lastQueueLength = queuedEvents;
            options.queuedLengthChanged(queuedEvents);
        }
    }
    function flushQueue() {
        queue
            .pop()
            .then((found) => {
            if (found) {
                // We have pendingCount plus found.request
                queueLengthChanged(found.pendingCount + 1);
                logger.log('Found a request in the queue');
                makeRequest(found.request).catch((e) => logger.error(e));
            }
            else {
                queueLengthChanged(0);
            }
        })
            .catch((e) => logger.error(e));
    }
    function queueRequest(request) {
        return __awaiter(this, void 0, void 0, function* () {
            logger.log('Queuing request');
            queueLengthChanged(yield queue.add(request));
            setTimeout(() => {
                flushQueue();
            }, retryDelay);
            retryDelay *= 3;
            // If the delay is bigger than 2^31 (max signed 32-bit int), setTimeout throws
            // an error and falls back to 1 which can cause a huge number of requests.
            if (retryDelay > MAX_DELAY) {
                retryDelay = MAX_DELAY;
            }
            return {};
        });
    }
    function makeRequest(request) {
        return __awaiter(this, void 0, void 0, function* () {
            let action = beforeSend(request);
            if (action instanceof Promise) {
                action = yield action;
            }
            if (action === 'send') {
                try {
                    const result = yield netMakeRequest(request);
                    if (!isRateLimited(result)) {
                        logger.log('Successfully sent');
                        // Reset the retry delay
                        retryDelay = START_DELAY;
                        // We were successful so check the queue
                        flushQueue();
                        return result;
                    }
                    else {
                        logger.log('Rate limited', result.headers);
                    }
                }
                catch (error) {
                    logger.log('Error sending:', error);
                }
                action = 'queue';
            }
            if (action == 'queue') {
                return yield queueRequest(request);
            }
            logger.log('Dropping request');
            return {};
        });
    }
    flushQueue();
    return createTransport(options, makeRequest);
}
//# sourceMappingURL=electron-offline-net.js.map{"version":3,"file":"electron-offline-net.js","sourceRoot":"","sources":["../../../src/main/transports/electron-offline-net.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,gCAAgC,EAA+B,MAAM,gBAAgB,CAAC;AAC/F,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8BhD,MAAM,WAAW,GAAG,IAAK,CAAC;AAC1B,MAAM,SAAS,GAAG,UAAa,CAAC;AAEhC,oDAAoD;AACpD,SAAS,WAAW;IAClB,OAAO,CAAC,CAAC,QAAQ,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC;AACnD,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAmB;IAC5C,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,MAA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C,gBAAgB,EAAE,KAAK,CAAC,CAAC;iBACrC;gBAED,MAAM,GAAG,OAAO,CAAC;aAClB;YAED,IAAI,MAAM,IAAI,OAAO,EAAE;gBACrB,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;aACpC;YAED,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC/B,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;IAED,UAAU,EAAE,CAAC;IAEb,OAAO,eAAe,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { net } from 'electron';\nimport { join } from 'path';\n\nimport { sentryCachePath } from '../fs';\nimport { createElectronNetRequestExecutor, ElectronNetTransportOptions } from './electron-net';\nimport { PersistedRequestQueue } from './queue';\n\ntype BeforeSendResponse = 'send' | 'queue' | 'drop';\n\nexport interface ElectronOfflineTransportOptions extends ElectronNetTransportOptions {\n  /**\n   * The maximum number of days to keep an event in the queue.\n   */\n  maxQueueAgeDays?: number;\n\n  /**\n   * The maximum number of events to keep in the queue.\n   */\n  maxQueueCount?: number;\n\n  /**\n   * Called every time the number of requests in the queue changes.\n   */\n  queuedLengthChanged?: (length: number) => void;\n\n  /**\n   * Called before attempting to send an event to Sentry.\n   *\n   * Return 'send' to attempt to send the event.\n   * Return 'queue' to queue and persist the event for sending later.\n   * Return 'drop' to drop the event.\n   */\n  beforeSend?: (request: TransportRequest) => BeforeSendResponse | Promise<BeforeSendResponse>;\n}\n\nconst START_DELAY = 5_000;\nconst MAX_DELAY = 2_000_000_000;\n\n/** Returns true is there's a chance we're online */\nfunction maybeOnline(): boolean {\n  return !('online' in net) || net.online === true;\n}\n\nfunction defaultBeforeSend(_: TransportRequest): BeforeSendResponse {\n  return maybeOnline() ? 'send' : 'queue';\n}\n\nfunction isRateLimited(result: TransportMakeRequestResponse): boolean {\n  return !!(result.headers && 'x-sentry-rate-limits' in result.headers);\n}\n\n/**\n * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are\n * persisted to disk and sent later\n */\nexport function makeElectronOfflineTransport(options: ElectronOfflineTransportOptions): Transport {\n  const netMakeRequest = createElectronNetRequestExecutor(options.url, options.headers || {});\n  const queue: PersistedRequestQueue = new PersistedRequestQueue(\n    join(sentryCachePath, 'queue'),\n    options.maxQueueAgeDays,\n    options.maxQueueCount,\n  );\n\n  const beforeSend = options.beforeSend || defaultBeforeSend;\n\n  let retryDelay: number = START_DELAY;\n  let lastQueueLength = -1;\n\n  function queueLengthChanged(queuedEvents: number): void {\n    if (options.queuedLengthChanged && queuedEvents !== lastQueueLength) {\n      lastQueueLength = queuedEvents;\n      options.queuedLengthChanged(queuedEvents);\n    }\n  }\n\n  function flushQueue(): void {\n    queue\n      .pop()\n      .then((found) => {\n        if (found) {\n          // We have pendingCount plus found.request\n          queueLengthChanged(found.pendingCount + 1);\n          logger.log('Found a request in the queue');\n          makeRequest(found.request).catch((e) => logger.error(e));\n        } else {\n          queueLengthChanged(0);\n        }\n      })\n      .catch((e) => logger.error(e));\n  }\n\n  async function queueRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    logger.log('Queuing request');\n    queueLengthChanged(await queue.add(request));\n\n    setTimeout(() => {\n      flushQueue();\n    }, retryDelay);\n\n    retryDelay *= 3;\n\n    // If the delay is bigger than 2^31 (max signed 32-bit int), setTimeout throws\n    // an error and falls back to 1 which can cause a huge number of requests.\n    if (retryDelay > MAX_DELAY) {\n      retryDelay = MAX_DELAY;\n    }\n\n    return {};\n  }\n\n  async function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    let action = beforeSend(request);\n\n    if (action instanceof Promise) {\n      action = await action;\n    }\n\n    if (action === 'send') {\n      try {\n        const result = await netMakeRequest(request);\n\n        if (!isRateLimited(result)) {\n          logger.log('Successfully sent');\n          // Reset the retry delay\n          retryDelay = START_DELAY;\n          // We were successful so check the queue\n          flushQueue();\n          return result;\n        } else {\n          logger.log('Rate limited', result.headers);\n        }\n      } catch (error) {\n        logger.log('Error sending:', error);\n      }\n\n      action = 'queue';\n    }\n\n    if (action == 'queue') {\n      return await queueRequest(request);\n    }\n\n    logger.log('Dropping request');\n    return {};\n  }\n\n  flushQueue();\n\n  return createTransport(options, makeRequest);\n}\n"]}import { TransportRequest } from '@sentry/types';
interface PopResult {
    request: QueuedTransportRequest;
    pendingCount: number;
}
export interface QueuedTransportRequest extends TransportRequest {
    date?: Date;
}
/** A request queue that is persisted to disk to survive app restarts */
export declare class PersistedRequestQueue {
    private readonly _queuePath;
    private readonly _maxAgeDays;
    private readonly _maxCount;
    private readonly _queue;
    constructor(_queuePath: string, _maxAgeDays?: number, _maxCount?: number);
    /** Adds a request to the queue */
    add(request: QueuedTransportRequest): Promise<number>;
    /** Pops the oldest event from the queue */
    pop(): Promise<PopResult | undefined>;
    /** Removes the body of the request */
    private _removeBody;
}
export {};
//# sourceMappingURL=queue.d.ts.map{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../../src/main/transports/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAiBjD,UAAU,SAAS;IACjB,OAAO,EAAE,sBAAsB,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,wEAAwE;AACxE,qBAAa,qBAAqB;IAQ9B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAIrB;gBAGiB,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,MAAW,EACxB,SAAS,GAAE,MAAW;IAGzC,kCAAkC;IACrB,GAAG,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA8BlE,2CAA2C;IAC9B,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAwClD,sCAAsC;YACxB,WAAW;CAO1B"}import { __awaiter } from "tslib";
import { logger, uuid4 } from '@sentry/utils';
import { join } from 'path';
import { readFileAsync, unlinkAsync, writeFileAsync } from '../fs';
import { BufferedWriteStore } from '../store';
const MILLISECONDS_PER_DAY = 86400000;
/** A request queue that is persisted to disk to survive app restarts */
export class PersistedRequestQueue {
    constructor(_queuePath, _maxAgeDays = 30, _maxCount = 30) {
        this._queuePath = _queuePath;
        this._maxAgeDays = _maxAgeDays;
        this._maxCount = _maxCount;
        this._queue = new BufferedWriteStore(this._queuePath, 'queue', []);
    }
    /** Adds a request to the queue */
    add(request) {
        return __awaiter(this, void 0, void 0, function* () {
            const bodyPath = uuid4();
            let queuedEvents = 0;
            yield this._queue.update((queue) => {
                queue.push({
                    bodyPath,
                    date: request.date || new Date(),
                });
                while (queue.length > this._maxCount) {
                    const removed = queue.shift();
                    if (removed) {
                        void this._removeBody(removed.bodyPath);
                    }
                }
                queuedEvents = queue.length;
                return queue;
            });
            try {
                yield writeFileAsync(join(this._queuePath, bodyPath), request.body);
            }
            catch (_) {
                //
            }
            return queuedEvents;
        });
    }
    /** Pops the oldest event from the queue */
    pop() {
        return __awaiter(this, void 0, void 0, function* () {
            let found;
            let pendingCount = 0;
            const cutOff = Date.now() - MILLISECONDS_PER_DAY * this._maxAgeDays;
            yield this._queue.update((queue) => {
                while ((found = queue.shift())) {
                    // We drop events created in v3 of the SDK or before the cut-off
                    if ('type' in found || found.date.getTime() < cutOff) {
                        // we're dropping this event so delete the body
                        void this._removeBody(found.bodyPath);
                        found = undefined;
                    }
                    else {
                        pendingCount = queue.length;
                        break;
                    }
                }
                return queue;
            });
            if (found) {
                try {
                    const body = yield readFileAsync(join(this._queuePath, found.bodyPath));
                    void this._removeBody(found.bodyPath);
                    return {
                        request: {
                            body,
                            date: found.date || new Date(),
                        },
                        pendingCount,
                    };
                }
                catch (e) {
                    logger.warn('Filed to read queued request body', e);
                }
            }
            return undefined;
        });
    }
    /** Removes the body of the request */
    _removeBody(bodyPath) {
        return __awaiter(this, void 0, void 0, function* () {
            try {
                yield unlinkAsync(join(this._queuePath, bodyPath));
            }
            catch (_) {
                //
            }
        });
    }
}
//# sourceMappingURL=queue.js.map{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../../src/main/transports/queue.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,oBAAoB,GAAG,QAAU,CAAC;AAmBxC,wEAAwE;AACxE,MAAM,OAAO,qBAAqB;IAOhC,YACmB,UAAkB,EAClB,cAAsB,EAAE,EACxB,YAAoB,EAAE;QAFtB,eAAU,GAAV,UAAU,CAAQ;QAClB,gBAAW,GAAX,WAAW,CAAa;QACxB,cAAS,GAAT,SAAS,CAAa;QATxB,WAAM,GAA2C,IAAI,kBAAkB,CACtF,IAAI,CAAC,UAAU,EACf,OAAO,EACP,EAAE,CACH,CAAC;IAMC,CAAC;IAEJ,kCAAkC;IACrB,GAAG,CAAC,OAA+B;;YAC9C,MAAM,QAAQ,GAAG,KAAK,EAAE,CAAC;YACzB,IAAI,YAAY,GAAG,CAAC,CAAC;YAErB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;gBACjC,KAAK,CAAC,IAAI,CAAC;oBACT,QAAQ;oBACR,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,EAAE;iBACjC,CAAC,CAAC;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AAI;oBACF,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACxE,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAEtC,OAAO;wBACL,OAAO,EAAE;4BACP,IAAI;4BACJ,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI,IAAI,EAAE;yBAC/B;wBACD,YAAY;qBACb,CAAC;iBACH;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;iBACrD;aACF;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAED,sCAAsC;IACxB,WAAW,CAAC,QAAgB;;YACxC,IAAI;gBACF,MAAM,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;aACpD;YAAC,OAAO,CAAC,EAAE;gBACV,EAAE;aACH;QACH,CAAC;KAAA;CACF","sourcesContent":["import { TransportRequest } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\nimport { join } from 'path';\n\nimport { readFileAsync, unlinkAsync, writeFileAsync } from '../fs';\nimport { BufferedWriteStore } from '../store';\n\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\ninterface PersistedRequest {\n  bodyPath: string;\n  date: Date;\n  // Envelopes were persisted in a different format in v3\n  // If this property exists, we discard this event\n  type?: unknown;\n}\n\ninterface PopResult {\n  request: QueuedTransportRequest;\n  pendingCount: number;\n}\n\nexport interface QueuedTransportRequest extends TransportRequest {\n  date?: Date;\n}\n\n/** A request queue that is persisted to disk to survive app restarts */\nexport class PersistedRequestQueue {\n  private readonly _queue: BufferedWriteStore<PersistedRequest[]> = new BufferedWriteStore(\n    this._queuePath,\n    'queue',\n    [],\n  );\n\n  public constructor(\n    private readonly _queuePath: string,\n    private readonly _maxAgeDays: number = 30,\n    private readonly _maxCount: number = 30,\n  ) {}\n\n  /** Adds a request to the queue */\n  public async add(request: QueuedTransportRequest): Promise<number> {\n    const bodyPath = uuid4();\n    let queuedEvents = 0;\n\n    await this._queue.update((queue) => {\n      queue.push({\n        bodyPath,\n        date: request.date || new Date(),\n      });\n\n      while (queue.length > this._maxCount) {\n        const removed = queue.shift();\n        if (removed) {\n          void this._removeBody(removed.bodyPath);\n        }\n      }\n\n      queuedEvents = queue.length;\n      return queue;\n    });\n\n    try {\n      await writeFileAsync(join(this._queuePath, bodyPath), request.body);\n    } catch (_) {\n      //\n    }\n\n    return queuedEvents;\n  }\n\n  /** Pops the oldest event from the queue */\n  public async pop(): Promise<PopResult | undefined> {\n    let found: PersistedRequest | undefined;\n    let pendingCount = 0;\n    const cutOff = Date.now() - MILLISECONDS_PER_DAY * this._maxAgeDays;\n\n    await this._queue.update((queue) => {\n      while ((found = queue.shift())) {\n        // We drop events created in v3 of the SDK or before the cut-off\n        if ('type' in found || found.date.getTime() < cutOff) {\n          // we're dropping this event so delete the body\n          void this._removeBody(found.bodyPath);\n          found = undefined;\n        } else {\n          pendingCount = queue.length;\n          break;\n        }\n      }\n      return queue;\n    });\n\n    if (found) {\n      try {\n        const body = await readFileAsync(join(this._queuePath, found.bodyPath));\n        void this._removeBody(found.bodyPath);\n\n        return {\n          request: {\n            body,\n            date: found.date || new Date(),\n          },\n          pendingCount,\n        };\n      } catch (e) {\n        logger.warn('Filed to read queued request body', e);\n      }\n    }\n\n    return undefined;\n  }\n\n  /** Removes the body of the request */\n  private async _removeBody(bodyPath: string): Promise<void> {\n    try {\n      await unlinkAsync(join(this._queuePath, bodyPath));\n    } catch (_) {\n      //\n    }\n  }\n}\n"]}export declare const SDK_VERSION = "4.5.0";
//# sourceMappingURL=version.d.ts.map{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/main/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAU,CAAC"}export const SDK_VERSION = '4.5.0';
//# sourceMappingURL=version.js.map{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/main/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_VERSION = '4.5.0';\n"]}import { contextBridge, ipcRenderer } from 'electron';
var PROTOCOL_SCHEME = 'sentry-ipc';
var IPCChannel;
(function (IPCChannel) {
    IPCChannel["PING"] = "sentry-electron.ping";
    IPCChannel["EVENT"] = "sentry-electron.event";
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel || (IPCChannel = {}));
;
if (window.__SENTRY_IPC__) {
    console.log('Sentry Electron preload has already been run');
}
else {
    var ipcObject = {
        sendScope: function (scopeJson) { return ipcRenderer.send(IPCChannel.SCOPE, scopeJson); },
        sendEvent: function (eventJson) { return ipcRenderer.send(IPCChannel.EVENT, eventJson); },
        sendEnvelope: function (envelope) { return ipcRenderer.send(IPCChannel.ENVELOPE, envelope); },
    };
    window.__SENTRY_IPC__ = ipcObject;
    if (contextBridge) {
        try {
            contextBridge.exposeInMainWorld('__SENTRY_IPC__', ipcObject);
        }
        catch (e) {
        }
    }
}
import { contextBridge, crashReporter, ipcRenderer } from 'electron';
import * as electron from 'electron';
var PROTOCOL_SCHEME = 'sentry-ipc';
var IPCChannel;
(function (IPCChannel) {
    IPCChannel["PING"] = "sentry-electron.ping";
    IPCChannel["EVENT"] = "sentry-electron.event";
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel || (IPCChannel = {}));
;
if (window.__SENTRY_IPC__) {
    console.log('Sentry Electron preload has already been run');
}
else {
    crashReporter.start({
        companyName: '',
        ignoreSystemCrashHandler: true,
        productName: electron.remote.app.name || electron.remote.app.getName(),
        submitURL: '',
        uploadToServer: false,
    });
    var ipcObject = {
        sendScope: function (scopeJson) { return ipcRenderer.send(IPCChannel.SCOPE, scopeJson); },
        sendEvent: function (eventJson) { return ipcRenderer.send(IPCChannel.EVENT, eventJson); },
        sendEnvelope: function (envelope) { return ipcRenderer.send(IPCChannel.ENVELOPE, envelope); },
    };
    window.__SENTRY_IPC__ = ipcObject;
    if (contextBridge) {
        try {
            contextBridge.exposeInMainWorld('__SENTRY_IPC__', ipcObject);
        }
        catch (e) {
        }
    }
}
import * as ElectronRendererIntegrations from './integrations';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export { BrowserClient, BrowserTracing, lastEventId, showReportDialog, Replay } from '@sentry/browser';
export type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';
export declare const Integrations: {
    GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
    TryCatch: typeof import("@sentry/browser").TryCatch;
    Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
    LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
    HttpContext: typeof import("@sentry/browser").HttpContext;
    Dedupe: typeof import("@sentry/browser").Dedupe;
    FunctionToString: typeof import("@sentry/browser").FunctionToString;
    InboundFilters: typeof import("@sentry/browser").InboundFilters;
    ScopeToMain: typeof ElectronRendererIntegrations.ScopeToMain;
    EventToMain: typeof ElectronRendererIntegrations.EventToMain;
};
export { init, defaultIntegrations } from './sdk';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,4BAA4B,MAAM,gBAAgB,CAAC;AAE/D,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvG,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,eAAO,MAAM,YAAY;;;;;;;;;;;CAA8D,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC"}import { Integrations as BrowserIntegrations } from '@sentry/browser';
import * as ElectronRendererIntegrations from './integrations';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export { BrowserClient, BrowserTracing, lastEventId, showReportDialog, Replay } from '@sentry/browser';
export const Integrations = Object.assign(Object.assign({}, ElectronRendererIntegrations), BrowserIntegrations);
export { init, defaultIntegrations } from './sdk';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,KAAK,4BAA4B,MAAM,gBAAgB,CAAC;AAoB/D,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGvG,MAAM,CAAC,MAAM,YAAY,mCAAQ,4BAA4B,GAAK,mBAAmB,CAAE,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["import { Integrations as BrowserIntegrations } from '@sentry/browser';\n\nimport * as ElectronRendererIntegrations from './integrations';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n} from '@sentry/core';\n\nexport { BrowserClient, BrowserTracing, lastEventId, showReportDialog, Replay } from '@sentry/browser';\nexport type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';\n\nexport const Integrations = { ...ElectronRendererIntegrations, ...BrowserIntegrations };\nexport { init, defaultIntegrations } from './sdk';\n"]}import { EventProcessor, Integration } from '@sentry/types';
/**
 * Passes events to the main process.
 */
export declare class EventToMain implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=event-to-main.d.ts.map{"version":3,"file":"event-to-main.d.ts","sourceRoot":"","sources":["../../../src/renderer/integrations/event-to-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKnE;;GAEG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAepF"}import { normalize } from '@sentry/utils';
import { getIPC } from '../ipc';
/**
 * Passes events to the main process.
 */
export class EventToMain {
    constructor() {
        /** @inheritDoc */
        this.name = EventToMain.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        const ipc = getIPC();
        addGlobalEventProcessor((event) => {
            // Ensure breadcrumbs is not `undefined` as `walk` translates it into a string
            event.breadcrumbs = event.breadcrumbs || [];
            // Remove the environment as it defaults to 'production' and overwrites the main process environment
            delete event.environment;
            ipc.sendEvent(JSON.stringify(normalize(event, 20, 2000)));
            // Events are handled and sent from the main process so we return null here so nothing is sent from the renderer
            return null;
        });
    }
}
/** @inheritDoc */
EventToMain.id = 'EventToMain';
//# sourceMappingURL=event-to-main.js.map{"version":3,"file":"event-to-main.js","sourceRoot":"","sources":["../../../src/renderer/integrations/event-to-main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,OAAO,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAkBvC,CAAC;IAhBC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;QAC1E,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;QAErB,uBAAuB,CAAC,CAAC,KAAY,EAAE,EAAE;YACvC,8EAA8E;YAC9E,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;YAE5C,oGAAoG;YACpG,OAAO,KAAK,CAAC,WAAW,CAAC;YAEzB,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,IAAK,CAAC,CAAC,CAAC,CAAC;YAC3D,gHAAgH;YAChH,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;;AArBD,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { Event, EventProcessor, Integration } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { getIPC } from '../ipc';\n\n/**\n * Passes events to the main process.\n */\nexport class EventToMain implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'EventToMain';\n\n  /** @inheritDoc */\n  public name: string = EventToMain.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const ipc = getIPC();\n\n    addGlobalEventProcessor((event: Event) => {\n      // Ensure breadcrumbs is not `undefined` as `walk` translates it into a string\n      event.breadcrumbs = event.breadcrumbs || [];\n\n      // Remove the environment as it defaults to 'production' and overwrites the main process environment\n      delete event.environment;\n\n      ipc.sendEvent(JSON.stringify(normalize(event, 20, 2_000)));\n      // Events are handled and sent from the main process so we return null here so nothing is sent from the renderer\n      return null;\n    });\n  }\n}\n"]}export { ScopeToMain } from './scope-to-main';
export { EventToMain } from './event-to-main';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderer/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}export { ScopeToMain } from './scope-to-main';
export { EventToMain } from './event-to-main';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/renderer/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { ScopeToMain } from './scope-to-main';\nexport { EventToMain } from './event-to-main';\n"]}import { Integration } from '@sentry/types';
/**
 * Passes scope changes to the main process.
 */
export declare class ScopeToMain implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Sends the scope to the main process when it updates.
     */
    private _setupScopeListener;
}
//# sourceMappingURL=scope-to-main.d.ts.map{"version":3,"file":"scope-to-main.d.ts","sourceRoot":"","sources":["../../../src/renderer/integrations/scope-to-main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;GAEG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,IAAI,IAAI;IAIxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAY5B"}import { getCurrentHub } from '@sentry/core';
import { normalize } from '@sentry/utils';
import { getIPC } from '../ipc';
/**
 * Passes scope changes to the main process.
 */
export class ScopeToMain {
    constructor() {
        /** @inheritDoc */
        this.name = ScopeToMain.id;
    }
    /** @inheritDoc */
    setupOnce() {
        this._setupScopeListener();
    }
    /**
     * Sends the scope to the main process when it updates.
     */
    _setupScopeListener() {
        const scope = getCurrentHub().getScope();
        if (scope) {
            const ipc = getIPC();
            scope.addScopeListener((updatedScope) => {
                ipc.sendScope(JSON.stringify(normalize(updatedScope, 20, 2000)));
                scope.clearBreadcrumbs();
                scope.clearAttachments();
            });
        }
    }
}
/** @inheritDoc */
ScopeToMain.id = 'ScopeToMain';
//# sourceMappingURL=scope-to-main.js.map{"version":3,"file":"scope-to-main.js","sourceRoot":"","sources":["../../../src/renderer/integrations/scope-to-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,OAAO,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAsBvC,CAAC;IApBC,kBAAkB;IACX,SAAS;QACd,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,MAAM,KAAK,GAAG,aAAa,EAAE,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,KAAK,EAAE;YACT,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;YAErB,KAAK,CAAC,gBAAgB,CAAC,CAAC,YAAY,EAAE,EAAE;gBACtC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,EAAE,IAAK,CAAC,CAAC,CAAC,CAAC;gBAClE,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBACzB,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;;AAzBD,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Integration } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { getIPC } from '../ipc';\n\n/**\n * Passes scope changes to the main process.\n */\nexport class ScopeToMain implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ScopeToMain';\n\n  /** @inheritDoc */\n  public name: string = ScopeToMain.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    this._setupScopeListener();\n  }\n\n  /**\n   * Sends the scope to the main process when it updates.\n   */\n  private _setupScopeListener(): void {\n    const scope = getCurrentHub().getScope();\n    if (scope) {\n      const ipc = getIPC();\n\n      scope.addScopeListener((updatedScope) => {\n        ipc.sendScope(JSON.stringify(normalize(updatedScope, 20, 2_000)));\n        scope.clearBreadcrumbs();\n        scope.clearAttachments();\n      });\n    }\n  }\n}\n"]}import { IPCInterface } from '../common';
/**
 * Renderer IPC interface
 *
 * Favours IPC if its been exposed via a preload script but will
 * fallback to custom protocol and fetch if IPC is not available
 */
export declare function getIPC(): IPCInterface;
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../../src/renderer/ipc.ts"],"names":[],"mappings":"AAIA,OAAO,EAAc,YAAY,EAAmB,MAAM,WAAW,CAAC;AAyCtE;;;;;GAKG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAMrC"}/* eslint-disable no-restricted-globals */
/* eslint-disable no-console */
import { logger } from '@sentry/utils';
import { IPCChannel, PROTOCOL_SCHEME } from '../common';
/** Gets the available IPC implementation */
function getImplementation() {
    // Favour IPC if it's been exposed by a preload script
    if (window.__SENTRY_IPC__) {
        return window.__SENTRY_IPC__;
    }
    logger.log('IPC was not configured in preload script, falling back to custom protocol and fetch');
    fetch(`${PROTOCOL_SCHEME}://${IPCChannel.PING}/sentry_key`, { method: 'POST', body: '' }).catch(() => console.error(`Sentry SDK failed to establish connection with the Electron main process.
 - Ensure you have initialized the SDK in the main process
 - If your renderers use custom sessions, be sure to set 'getSessions' in the main process options
 - If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`));
    // We include sentry_key in the URL so these dont end up in fetch breadcrumbs
    // https://github.com/getsentry/sentry-javascript/blob/a3f70d8869121183bec037571a3ee78efaf26b0b/packages/browser/src/integrations/breadcrumbs.ts#L240
    return {
        sendScope: (body) => {
            fetch(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
        sendEvent: (body) => {
            fetch(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
        sendEnvelope: (body) => {
            fetch(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
    };
}
let cachedInterface;
/**
 * Renderer IPC interface
 *
 * Favours IPC if its been exposed via a preload script but will
 * fallback to custom protocol and fetch if IPC is not available
 */
export function getIPC() {
    if (!cachedInterface) {
        cachedInterface = getImplementation();
    }
    return cachedInterface;
}
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../../src/renderer/ipc.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAgB,eAAe,EAAE,MAAM,WAAW,CAAC;AAEtE,4CAA4C;AAC5C,SAAS,iBAAiB;IACxB,sDAAsD;IACtD,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,MAAM,CAAC,cAAc,CAAC;KAC9B;IAED,MAAM,CAAC,GAAG,CAAC,qFAAqF,CAAC,CAAC;IAElG,KAAK,CAAC,GAAG,eAAe,MAAM,UAAU,CAAC,IAAI,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CACnG,OAAO,CAAC,KAAK,CAAC;;;0HAGwG,CAAC,CACxH,CAAC;IAEF,6EAA6E;IAC7E,qJAAqJ;IACrJ,OAAO;QACL,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,KAAK,CAAC,GAAG,eAAe,MAAM,UAAU,CAAC,KAAK,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;QACD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,KAAK,CAAC,GAAG,eAAe,MAAM,UAAU,CAAC,KAAK,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;QACD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;YACrB,KAAK,CAAC,GAAG,eAAe,MAAM,UAAU,CAAC,QAAQ,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACnG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,IAAI,eAAyC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,MAAM;IACpB,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,iBAAiB,EAAE,CAAC;KACvC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["/* eslint-disable no-restricted-globals */\n/* eslint-disable no-console */\nimport { logger } from '@sentry/utils';\n\nimport { IPCChannel, IPCInterface, PROTOCOL_SCHEME } from '../common';\n\n/** Gets the available IPC implementation */\nfunction getImplementation(): IPCInterface {\n  // Favour IPC if it's been exposed by a preload script\n  if (window.__SENTRY_IPC__) {\n    return window.__SENTRY_IPC__;\n  }\n\n  logger.log('IPC was not configured in preload script, falling back to custom protocol and fetch');\n\n  fetch(`${PROTOCOL_SCHEME}://${IPCChannel.PING}/sentry_key`, { method: 'POST', body: '' }).catch(() =>\n    console.error(`Sentry SDK failed to establish connection with the Electron main process.\n - Ensure you have initialized the SDK in the main process\n - If your renderers use custom sessions, be sure to set 'getSessions' in the main process options\n - If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`),\n  );\n\n  // We include sentry_key in the URL so these dont end up in fetch breadcrumbs\n  // https://github.com/getsentry/sentry-javascript/blob/a3f70d8869121183bec037571a3ee78efaf26b0b/packages/browser/src/integrations/breadcrumbs.ts#L240\n  return {\n    sendScope: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n    sendEvent: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n    sendEnvelope: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n  };\n}\n\nlet cachedInterface: IPCInterface | undefined;\n\n/**\n * Renderer IPC interface\n *\n * Favours IPC if its been exposed via a preload script but will\n * fallback to custom protocol and fetch if IPC is not available\n */\nexport function getIPC(): IPCInterface {\n  if (!cachedInterface) {\n    cachedInterface = getImplementation();\n  }\n\n  return cachedInterface;\n}\n"]}import { BrowserOptions } from '@sentry/browser';
import { ScopeToMain } from './integrations';
export declare const defaultIntegrations: (import("@sentry/browser").InboundFilters | import("@sentry/browser").FunctionToString | ScopeToMain | import("@sentry/browser").GlobalHandlers | import("@sentry/browser").TryCatch | import("@sentry/browser").Breadcrumbs | import("@sentry/browser").LinkedErrors | import("@sentry/browser").HttpContext | import("@sentry/browser").Dedupe)[];
/**
 * Initialize Sentry in the Electron renderer process
 * @param options SDK options
 * @param originalInit Optional init function for a specific framework SDK
 * @returns
 */
export declare function init<O extends BrowserOptions>(options?: BrowserOptions & O, originalInit?: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_48_0: O) => void): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/renderer/sdk.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EAGf,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,eAAO,MAAM,mBAAmB,qVAAqD,CAAC;AAEtF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAC3C,OAAO,GAAE,cAAc,GAAG,CAA4B,EAEtD,YAAY,GAAE,CAAC,6DAA6D,EAAE,CAAC,KAAK,IAAkB,GACrG,IAAI,CA2CN"}/* eslint-disable no-restricted-globals */
import { defaultIntegrations as defaultBrowserIntegrations, init as browserInit, } from '@sentry/browser';
import { logger } from '@sentry/utils';
import { ensureProcess } from '../common';
import { ScopeToMain } from './integrations';
import { electronRendererStackParser } from './stack-parse';
import { makeRendererTransport } from './transport';
export const defaultIntegrations = [...defaultBrowserIntegrations, new ScopeToMain()];
/**
 * Initialize Sentry in the Electron renderer process
 * @param options SDK options
 * @param originalInit Optional init function for a specific framework SDK
 * @returns
 */
export function init(options = {}, 
// This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches
originalInit = browserInit) {
    ensureProcess('renderer');
    // Ensure the browser SDK is only init'ed once.
    if (window === null || window === void 0 ? void 0 : window.__SENTRY__RENDERER_INIT__) {
        logger.warn(`The browser SDK has already been initialized.
If init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);
        return;
    }
    window.__SENTRY__RENDERER_INIT__ = true;
    // We don't want browser session tracking enabled by default because we already have Electron
    // specific session tracking
    if (options.autoSessionTracking === undefined) {
        options.autoSessionTracking = false;
    }
    // Disable client reports for renderer as the sdk should only send
    // events using the main process.
    options.sendClientReports = false;
    if (options.defaultIntegrations === undefined) {
        options.defaultIntegrations = defaultIntegrations;
    }
    if (options.stackParser === undefined) {
        options.stackParser = electronRendererStackParser;
    }
    if (options.dsn === undefined) {
        // Events are sent via the main process but browser SDK wont start without dsn
        options.dsn = 'https://12345@dummy.dsn/12345';
    }
    if (options.transport === undefined) {
        options.transport = makeRendererTransport;
    }
    // We only handle initialScope in the main process otherwise it can cause race conditions over IPC
    delete options.initialScope;
    originalInit(options);
}
//# sourceMappingURL=sdk.js.map{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/renderer/sdk.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,OAAO,EAEL,mBAAmB,IAAI,0BAA0B,EACjD,IAAI,IAAI,WAAW,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAG,0BAA0B,EAAE,IAAI,WAAW,EAAE,CAAC,CAAC;AAEtF;;;;;GAKG;AACH,MAAM,UAAU,IAAI,CAClB,UAA8B,EAAwB;AACtD,8GAA8G;AAC9G,eAA2F,WAAW;IAEtG,aAAa,CAAC,UAAU,CAAC,CAAC;IAE1B,+CAA+C;IAC/C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,yBAAyB,EAAE;QACrC,MAAM,CAAC,IAAI,CAAC;sHACsG,CAAC,CAAC;QACpH,OAAO;KACR;IAED,MAAM,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAExC,6FAA6F;IAC7F,4BAA4B;IAC5B,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QAC7C,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;KACrC;IAED,kEAAkE;IAClE,iCAAiC;IACjC,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC;IAElC,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QAC7C,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;KACnD;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;QACrC,OAAO,CAAC,WAAW,GAAG,2BAA2B,CAAC;KACnD;IAED,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE;QAC7B,8EAA8E;QAC9E,OAAO,CAAC,GAAG,GAAG,+BAA+B,CAAC;KAC/C;IAED,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;QACnC,OAAO,CAAC,SAAS,GAAG,qBAAqB,CAAC;KAC3C;IAED,kGAAkG;IAClG,OAAO,OAAO,CAAC,YAAY,CAAC;IAE5B,YAAY,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n  BrowserOptions,\n  defaultIntegrations as defaultBrowserIntegrations,\n  init as browserInit,\n} from '@sentry/browser';\nimport { logger } from '@sentry/utils';\n\nimport { ensureProcess } from '../common';\nimport { ScopeToMain } from './integrations';\nimport { electronRendererStackParser } from './stack-parse';\nimport { makeRendererTransport } from './transport';\n\nexport const defaultIntegrations = [...defaultBrowserIntegrations, new ScopeToMain()];\n\n/**\n * Initialize Sentry in the Electron renderer process\n * @param options SDK options\n * @param originalInit Optional init function for a specific framework SDK\n * @returns\n */\nexport function init<O extends BrowserOptions>(\n  options: BrowserOptions & O = {} as BrowserOptions & O,\n  // This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches\n  originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_48_0: O) => void = browserInit,\n): void {\n  ensureProcess('renderer');\n\n  // Ensure the browser SDK is only init'ed once.\n  if (window?.__SENTRY__RENDERER_INIT__) {\n    logger.warn(`The browser SDK has already been initialized.\nIf init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);\n    return;\n  }\n\n  window.__SENTRY__RENDERER_INIT__ = true;\n\n  // We don't want browser session tracking enabled by default because we already have Electron\n  // specific session tracking\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = false;\n  }\n\n  // Disable client reports for renderer as the sdk should only send\n  // events using the main process.\n  options.sendClientReports = false;\n\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n\n  if (options.stackParser === undefined) {\n    options.stackParser = electronRendererStackParser;\n  }\n\n  if (options.dsn === undefined) {\n    // Events are sent via the main process but browser SDK wont start without dsn\n    options.dsn = 'https://12345@dummy.dsn/12345';\n  }\n\n  if (options.transport === undefined) {\n    options.transport = makeRendererTransport;\n  }\n\n  // We only handle initialScope in the main process otherwise it can cause race conditions over IPC\n  delete options.initialScope;\n\n  originalInit(options);\n}\n"]}import { StackParser } from '@sentry/types';
/**
 * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true
 */
export declare const electronRendererStackParser: StackParser;
//# sourceMappingURL=stack-parse.d.ts.map{"version":3,"file":"stack-parse.d.ts","sourceRoot":"","sources":["../../src/renderer/stack-parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,MAAM,eAAe,CAAC;AAQxD;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAoBzC,CAAC"}import { chromeStackLineParser } from '@sentry/browser';
import { dropUndefinedKeys, nodeStackLineParser, stripSentryFramesAndReverse } from '@sentry/utils';
const STACKTRACE_FRAME_LIMIT = 50;
const [, chrome] = chromeStackLineParser;
const [, node] = nodeStackLineParser();
/**
 * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true
 */
export const electronRendererStackParser = (stack, skipFirst = 0) => {
    const frames = [];
    for (const line of stack.split('\n').slice(skipFirst)) {
        const chromeFrame = chrome(line);
        const nodeFrame = node(line);
        // We favour the chrome parser unless in_app == false
        if (chromeFrame && (nodeFrame === null || nodeFrame === void 0 ? void 0 : nodeFrame.in_app) !== false) {
            frames.push(chromeFrame);
        }
        else if (nodeFrame) {
            frames.push(dropUndefinedKeys(nodeFrame));
        }
        if (frames.length >= STACKTRACE_FRAME_LIMIT) {
            break;
        }
    }
    return stripSentryFramesAndReverse(frames);
};
//# sourceMappingURL=stack-parse.js.map{"version":3,"file":"stack-parse.js","sourceRoot":"","sources":["../../src/renderer/stack-parse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEpG,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC;AACzC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,mBAAmB,EAAE,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgB,CAAC,KAAa,EAAE,YAAoB,CAAC,EAAgB,EAAE;IAC7G,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QACrD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAE7B,qDAAqD;QACrD,IAAI,WAAW,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,MAAK,KAAK,EAAE;YAC9C,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC1B;aAAM,IAAI,SAAS,EAAE;YACpB,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;SAC3C;QAED,IAAI,MAAM,CAAC,MAAM,IAAI,sBAAsB,EAAE;YAC3C,MAAM;SACP;KACF;IAED,OAAO,2BAA2B,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import { chromeStackLineParser } from '@sentry/browser';\nimport { StackFrame, StackParser } from '@sentry/types';\nimport { dropUndefinedKeys, nodeStackLineParser, stripSentryFramesAndReverse } from '@sentry/utils';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n\nconst [, chrome] = chromeStackLineParser;\nconst [, node] = nodeStackLineParser();\n\n/**\n * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true\n */\nexport const electronRendererStackParser: StackParser = (stack: string, skipFirst: number = 0): StackFrame[] => {\n  const frames: StackFrame[] = [];\n\n  for (const line of stack.split('\\n').slice(skipFirst)) {\n    const chromeFrame = chrome(line);\n    const nodeFrame = node(line);\n\n    // We favour the chrome parser unless in_app == false\n    if (chromeFrame && nodeFrame?.in_app !== false) {\n      frames.push(chromeFrame);\n    } else if (nodeFrame) {\n      frames.push(dropUndefinedKeys(nodeFrame));\n    }\n\n    if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n      break;\n    }\n  }\n\n  return stripSentryFramesAndReverse(frames);\n};\n"]}import { BaseTransportOptions, Transport } from '@sentry/types';
/**
 * Creates a Transport that passes envelopes to the Electron main process.
 */
export declare function makeRendererTransport(options: BaseTransportOptions): Transport;
//# sourceMappingURL=transport.d.ts.map{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/renderer/transport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAIhH;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAQ9E"}import { __awaiter } from "tslib";
import { createTransport } from '@sentry/core';
import { getIPC } from './ipc';
/**
 * Creates a Transport that passes envelopes to the Electron main process.
 */
export function makeRendererTransport(options) {
    const ipc = getIPC();
    return createTransport(options, (request) => __awaiter(this, void 0, void 0, function* () {
        ipc.sendEnvelope(request.body);
        // Since the main process handles sending of envelopes and rate limiting, we always return 200 OK to the renderers.
        return { statusCode: 200 };
    }));
}
//# sourceMappingURL=transport.js.map{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/renderer/transport.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA6B;IACjE,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,OAAO,eAAe,CAAC,OAAO,EAAE,CAAO,OAAyB,EAAyC,EAAE;QACzG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,mHAAmH;QACnH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport { BaseTransportOptions, Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\n\nimport { getIPC } from './ipc';\n\n/**\n * Creates a Transport that passes envelopes to the Electron main process.\n */\nexport function makeRendererTransport(options: BaseTransportOptions): Transport {\n  const ipc = getIPC();\n\n  return createTransport(options, async (request: TransportRequest): Promise<TransportMakeRequestResponse> => {\n    ipc.sendEnvelope(request.body);\n    // Since the main process handles sending of envelopes and rate limiting, we always return 200 OK to the renderers.\n    return { statusCode: 200 };\n  });\n}\n"]}import { ElectronMainOptions } from './main';
import { BrowserOptions } from './renderer';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getActiveTransaction, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, trace, } from '@sentry/core';
export declare const Integrations: import("./integrations").Integrations;
export interface ElectronOptions extends ElectronMainOptions, Omit<BrowserOptions, 'transportOptions' | 'transport'> {
}
export { IPCMode } from './common';
/**
 * The Sentry Electron SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * entry modules. This applies to the main process as well as all renderer
 * processes or further sub processes you spawn. To set context information or
 * send manual events, use the provided methods.
 *
 * @example
 * const { init } = require('@sentry/electron');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 *
 * @example
 * import { configureScope } from '@sentry/electron';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTags({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 *
 * @example
 * import { addBreadcrumb } from '@sentry/electron';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 *
 * @example
 * import * as Sentry from '@sentry/electron';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 *
 * @see ElectronOptions for documentation on configuration options.
 */
export declare function init(options: Partial<ElectronOptions>): void;
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function close(timeout?: number): Promise<boolean>;
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function flush(timeout?: number): Promise<boolean>;
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,KAAK,GACN,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,YAAY,uCAAoB,CAAC;AAG9C,MAAM,WAAW,eAAgB,SAAQ,mBAAmB,EAAE,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,WAAW,CAAC;CAEnH;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAuBnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAK5D;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9D;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9D"}Object.defineProperty(exports, "__esModule", { value: true });
exports.flush = exports.close = exports.init = exports.IPCMode = exports.Integrations = exports.trace = exports.InboundFilters = exports.FunctionToString = exports.withScope = exports.setUser = exports.setTags = exports.setTag = exports.setExtras = exports.setExtra = exports.setContext = exports.startTransaction = exports.Scope = exports.makeMain = exports.Hub = exports.getCurrentHub = exports.getHubFromCarrier = exports.getActiveTransaction = exports.createTransport = exports.configureScope = exports.captureMessage = exports.captureEvent = exports.captureException = exports.addBreadcrumb = exports.addGlobalEventProcessor = void 0;
const tslib_1 = require("tslib");
const utils_1 = require("@sentry/utils");
const integrations_1 = require("./integrations");
var core_1 = require("@sentry/core");
Object.defineProperty(exports, "addGlobalEventProcessor", { enumerable: true, get: function () { return core_1.addGlobalEventProcessor; } });
Object.defineProperty(exports, "addBreadcrumb", { enumerable: true, get: function () { return core_1.addBreadcrumb; } });
Object.defineProperty(exports, "captureException", { enumerable: true, get: function () { return core_1.captureException; } });
Object.defineProperty(exports, "captureEvent", { enumerable: true, get: function () { return core_1.captureEvent; } });
Object.defineProperty(exports, "captureMessage", { enumerable: true, get: function () { return core_1.captureMessage; } });
Object.defineProperty(exports, "configureScope", { enumerable: true, get: function () { return core_1.configureScope; } });
Object.defineProperty(exports, "createTransport", { enumerable: true, get: function () { return core_1.createTransport; } });
Object.defineProperty(exports, "getActiveTransaction", { enumerable: true, get: function () { return core_1.getActiveTransaction; } });
Object.defineProperty(exports, "getHubFromCarrier", { enumerable: true, get: function () { return core_1.getHubFromCarrier; } });
Object.defineProperty(exports, "getCurrentHub", { enumerable: true, get: function () { return core_1.getCurrentHub; } });
Object.defineProperty(exports, "Hub", { enumerable: true, get: function () { return core_1.Hub; } });
Object.defineProperty(exports, "makeMain", { enumerable: true, get: function () { return core_1.makeMain; } });
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return core_1.Scope; } });
Object.defineProperty(exports, "startTransaction", { enumerable: true, get: function () { return core_1.startTransaction; } });
Object.defineProperty(exports, "setContext", { enumerable: true, get: function () { return core_1.setContext; } });
Object.defineProperty(exports, "setExtra", { enumerable: true, get: function () { return core_1.setExtra; } });
Object.defineProperty(exports, "setExtras", { enumerable: true, get: function () { return core_1.setExtras; } });
Object.defineProperty(exports, "setTag", { enumerable: true, get: function () { return core_1.setTag; } });
Object.defineProperty(exports, "setTags", { enumerable: true, get: function () { return core_1.setTags; } });
Object.defineProperty(exports, "setUser", { enumerable: true, get: function () { return core_1.setUser; } });
Object.defineProperty(exports, "withScope", { enumerable: true, get: function () { return core_1.withScope; } });
Object.defineProperty(exports, "FunctionToString", { enumerable: true, get: function () { return core_1.FunctionToString; } });
Object.defineProperty(exports, "InboundFilters", { enumerable: true, get: function () { return core_1.InboundFilters; } });
Object.defineProperty(exports, "trace", { enumerable: true, get: function () { return core_1.trace; } });
exports.Integrations = (0, integrations_1.getIntegrations)();
var common_1 = require("./common");
Object.defineProperty(exports, "IPCMode", { enumerable: true, get: function () { return common_1.IPCMode; } });
/** Fetches the SDK entry point for the current process */
function getEntryPoint() {
    try {
        return process.type === 'browser' ? (0, utils_1.dynamicRequire)(module, './main') : require('./renderer');
    }
    catch (e) {
        throw new Error(`Failed to automatically detect correct SDK entry point.

In the Electron main process you should import via:
import * as Sentry from '@sentry/electron/main';

In the Electron renderer process you should import via:
import * as Sentry from '@sentry/electron/renderer';`);
    }
}
/**
 * The Sentry Electron SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * entry modules. This applies to the main process as well as all renderer
 * processes or further sub processes you spawn. To set context information or
 * send manual events, use the provided methods.
 *
 * @example
 * const { init } = require('@sentry/electron');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 *
 * @example
 * import { configureScope } from '@sentry/electron';
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTags({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 *
 * @example
 * import { addBreadcrumb } from '@sentry/electron';
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 *
 * @example
 * import * as Sentry from '@sentry/electron';
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 *
 * @see ElectronOptions for documentation on configuration options.
 */
function init(options) {
    // Filter out any EmptyIntegrations
    (0, integrations_1.removeEmptyIntegrations)(options);
    getEntryPoint().init(options);
}
exports.init = init;
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function close(timeout) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const entryPoint = getEntryPoint();
        if (entryPoint.close) {
            return entryPoint.close(timeout);
        }
        throw new Error('The Electron SDK should be closed from the main process');
    });
}
exports.close = close;
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
function flush(timeout) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const entryPoint = getEntryPoint();
        if (entryPoint.flush) {
            return entryPoint.flush(timeout);
        }
        throw new Error('The Electron SDK should be flushed from the main process');
    });
}
exports.flush = flush;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA+C;AAE/C,iDAA0E;AAsB1E,qCAyBsB;AAxBpB,+GAAA,uBAAuB,OAA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B,KAAK,CAAC,OAAgB;;QAC1C,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QAEnC,IAAI,UAAU,CAAC,KAAK,EAAE;YACpB,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAClC;QAED,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;CAAA;AARD,sBAQC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAC,OAAgB;;QAC1C,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;QAEnC,IAAI,UAAU,CAAC,KAAK,EAAE;YACpB,OAAO,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAClC;QAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;CAAA;AARD,sBAQC","sourcesContent":["import { dynamicRequire } from '@sentry/utils';\n\nimport { getIntegrations, removeEmptyIntegrations } from './integrations';\nimport { ElectronMainOptions } from './main';\nimport { BrowserOptions } from './renderer';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getActiveTransaction,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n  trace,\n} from '@sentry/core';\n\nexport const Integrations = getIntegrations();\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ElectronOptions extends ElectronMainOptions, Omit<BrowserOptions, 'transportOptions' | 'transport'> {\n  //\n}\n\nexport { IPCMode } from './common';\n\ninterface ProcessEntryPoint {\n  init: (options: Partial<ElectronOptions>) => void;\n  close?: (timeout?: number) => Promise<boolean>;\n  flush?: (timeout?: number) => Promise<boolean>;\n}\n\n/** Fetches the SDK entry point for the current process */\nfunction getEntryPoint(): ProcessEntryPoint {\n  try {\n    return process.type === 'browser' ? dynamicRequire(module, './main') : require('./renderer');\n  } catch (e) {\n    throw new Error(`Failed to automatically detect correct SDK entry point.\n\nIn the Electron main process you should import via:\nimport * as Sentry from '@sentry/electron/main';\n\nIn the Electron renderer process you should import via:\nimport * as Sentry from '@sentry/electron/renderer';`);\n  }\n}\n\n/**\n * The Sentry Electron SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible in the\n * entry modules. This applies to the main process as well as all renderer\n * processes or further sub processes you spawn. To set context information or\n * send manual events, use the provided methods.\n *\n * @example\n * const { init } = require('@sentry/electron');\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n *\n * @example\n * import { configureScope } from '@sentry/electron';\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTags({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n *\n * @example\n * import { addBreadcrumb } from '@sentry/electron';\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n *\n * @example\n * import * as Sentry from '@sentry/electron';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n *\n * @see ElectronOptions for documentation on configuration options.\n */\nexport function init(options: Partial<ElectronOptions>): void {\n  // Filter out any EmptyIntegrations\n  removeEmptyIntegrations(options);\n\n  getEntryPoint().init(options);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n  const entryPoint = getEntryPoint();\n\n  if (entryPoint.close) {\n    return entryPoint.close(timeout);\n  }\n\n  throw new Error('The Electron SDK should be closed from the main process');\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n  const entryPoint = getEntryPoint();\n\n  if (entryPoint.flush) {\n    return entryPoint.flush(timeout);\n  }\n\n  throw new Error('The Electron SDK should be flushed from the main process');\n}\n"]}import { ElectronOptions } from './';
import { AdditionalContext, ChildProcess, ElectronBreadcrumbs, ElectronMinidump, MainContext, MainProcessSession, OnUncaughtException, PreloadInjection, Screenshots, SentryMinidump } from './main/integrations';
import { EventToMain, ScopeToMain } from './renderer/integrations';
/** Convenience interface used to expose Integrations */
export interface Integrations {
    SentryMinidump: SentryMinidump;
    ElectronMinidump: ElectronMinidump;
    ElectronBreadcrumbs: ElectronBreadcrumbs;
    MainContext: MainContext;
    OnUncaughtExcept: OnUncaughtException;
    PreloadInjection: PreloadInjection;
    MainProcessSession: MainProcessSession;
    AdditionalContext: AdditionalContext;
    ChildProcess: ChildProcess;
    Screenshots: Screenshots;
    ScopeToMain: ScopeToMain;
    EventToMain: EventToMain;
}
/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */
export declare function getIntegrations(): Integrations;
/** Filters out any EmptyIntegrations that are found */
export declare function removeEmptyIntegrations(options: Partial<ElectronOptions>): void;
//# sourceMappingURL=integrations.d.ts.map{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["src/integrations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAE3B,cAAc,EAAE,cAAc,CAAC;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IAEzB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,2GAA2G;AAC3G,wBAAgB,eAAe,IAAI,YAAY,CAsB9C;AA6BD,uDAAuD;AACvD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAW/E"}Object.defineProperty(exports, "__esModule", { value: true });
exports.removeEmptyIntegrations = exports.getIntegrations = void 0;
const utils_1 = require("@sentry/utils");
/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */
function getIntegrations() {
    return process.type === 'browser'
        ? Object.assign(Object.assign({}, (0, utils_1.dynamicRequire)(module, './main').Integrations), { ScopeToMain: EmptyIntegration, EventToMain: EmptyIntegration }) : Object.assign(Object.assign({}, (0, utils_1.dynamicRequire)(module, './renderer').Integrations), { SentryMinidump: EmptyIntegration, ElectronMinidump: EmptyIntegration, ElectronBreadcrumbs: EmptyIntegration, MainContext: EmptyIntegration, OnUncaughtExcept: EmptyIntegration, PreloadInjection: EmptyIntegration, MainProcessSession: EmptyIntegration, AdditionalContext: EmptyIntegration, ChildProcess: EmptyIntegration, Screenshots: EmptyIntegration });
}
exports.getIntegrations = getIntegrations;
/**
 * The EmptyIntegration gets loaded when the requested integration cannot be used in the current Electron process
 *
 * This allows you to call the same code from both Electron processes and not have to conditionally compile
 *
 * ```
 * const { init, Integrations } = require('@sentry/electron');
 *
 * init({
 *   dsn: process.env.DSN,
 *   integrations: [new Integrations.ElectronMinidump()],
 * });
 *
 */
class EmptyIntegration {
    constructor() {
        /** @inheritDoc */
        this.name = EmptyIntegration.id;
    }
    /** @inheritDoc */
    setupOnce() {
        //
    }
}
/** @inheritDoc */
EmptyIntegration.id = 'EmptyIntegration';
/** Filters out any EmptyIntegrations that are found */
function removeEmptyIntegrations(options) {
    if (Array.isArray(options.integrations)) {
        options.integrations = options.integrations.filter((i) => i.name !== EmptyIntegration.id);
    }
    else if (typeof options.integrations === 'function') {
        const originalFn = options.integrations;
        options.integrations = (integrations) => {
            const userIntegrations = originalFn(integrations);
            return userIntegrations.filter((integration) => integration.name !== EmptyIntegration.id);
        };
    }
}
exports.removeEmptyIntegrations = removeEmptyIntegrations;
//# sourceMappingURL=integrations.js.map{"version":3,"file":"integrations.js","sourceRoot":"","sources":["src/integrations.ts"],"names":[],"mappings":";;AACA,yCAA+C;AAmC/C,2GAA2G;AAC3G,SAAgB,eAAe;IAC7B,OAAO,OAAO,CAAC,IAAI,KAAK,SAAS;QAC/B,CAAC,iCAEM,IAAA,sBAAc,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,YAAY,KAChD,WAAW,EAAE,gBAAgB,EAC7B,WAAW,EAAE,gBAAgB,IAEjC,CAAC,iCAEM,IAAA,sBAAc,EAAC,MAAM,EAAE,YAAY,CAAC,CAAC,YAAY,KACpD,cAAc,EAAE,gBAAgB,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,gBAAgB,EACrC,WAAW,EAAE,gBAAgB,EAC7B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,gBAAgB,EACpC,iBAAiB,EAAE,gBAAgB,EACnC,YAAY,EAAE,gBAAgB,EAC9B,WAAW,EAAE,gBAAgB,GAC9B,CAAC;AACR,CAAC;AAtBD,0CAsBC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,gBAAgB;IAAtB;QAIE,kBAAkB;QACX,SAAI,GAAW,gBAAgB,CAAC,EAAE,CAAC;IAM5C,CAAC;IAJC,kBAAkB;IACX,SAAS;QACd,EAAE;IACJ,CAAC;;AATD,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC;AAWhD,uDAAuD;AACvD,SAAgB,uBAAuB,CAAC,OAAiC;IACvE,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACvC,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,EAAE,CAAC,CAAC;KAC3F;SAAM,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;QACrD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;QAExC,OAAO,CAAC,YAAY,GAAG,CAAC,YAAY,EAAE,EAAE;YACtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;YAClD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,gBAAgB,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC,CAAC;KACH;AACH,CAAC;AAXD,0DAWC","sourcesContent":["import { Integration } from '@sentry/types';\nimport { dynamicRequire } from '@sentry/utils';\n\nimport { ElectronOptions } from './';\nimport {\n  AdditionalContext,\n  ChildProcess,\n  ElectronBreadcrumbs,\n  ElectronMinidump,\n  MainContext,\n  MainProcessSession,\n  OnUncaughtException,\n  PreloadInjection,\n  Screenshots,\n  SentryMinidump,\n} from './main/integrations';\nimport { EventToMain, ScopeToMain } from './renderer/integrations';\n\n/** Convenience interface used to expose Integrations */\nexport interface Integrations {\n  // For main process\n  SentryMinidump: SentryMinidump;\n  ElectronMinidump: ElectronMinidump;\n  ElectronBreadcrumbs: ElectronBreadcrumbs;\n  MainContext: MainContext;\n  OnUncaughtExcept: OnUncaughtException;\n  PreloadInjection: PreloadInjection;\n  MainProcessSession: MainProcessSession;\n  AdditionalContext: AdditionalContext;\n  ChildProcess: ChildProcess;\n  Screenshots: Screenshots;\n  // For renderer process\n  ScopeToMain: ScopeToMain;\n  EventToMain: EventToMain;\n}\n\n/** Return all Electron integrations and add EmptyIntegrations for integrations missing in this process. */\nexport function getIntegrations(): Integrations {\n  return process.type === 'browser'\n    ? {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        ...dynamicRequire(module, './main').Integrations,\n        ScopeToMain: EmptyIntegration,\n        EventToMain: EmptyIntegration,\n      }\n    : {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        ...dynamicRequire(module, './renderer').Integrations,\n        SentryMinidump: EmptyIntegration,\n        ElectronMinidump: EmptyIntegration,\n        ElectronBreadcrumbs: EmptyIntegration,\n        MainContext: EmptyIntegration,\n        OnUncaughtExcept: EmptyIntegration,\n        PreloadInjection: EmptyIntegration,\n        MainProcessSession: EmptyIntegration,\n        AdditionalContext: EmptyIntegration,\n        ChildProcess: EmptyIntegration,\n        Screenshots: EmptyIntegration,\n      };\n}\n\n/**\n * The EmptyIntegration gets loaded when the requested integration cannot be used in the current Electron process\n *\n * This allows you to call the same code from both Electron processes and not have to conditionally compile\n *\n * ```\n * const { init, Integrations } = require('@sentry/electron');\n *\n * init({\n *   dsn: process.env.DSN,\n *   integrations: [new Integrations.ElectronMinidump()],\n * });\n *\n */\nclass EmptyIntegration implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'EmptyIntegration';\n\n  /** @inheritDoc */\n  public name: string = EmptyIntegration.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    //\n  }\n}\n\n/** Filters out any EmptyIntegrations that are found */\nexport function removeEmptyIntegrations(options: Partial<ElectronOptions>): void {\n  if (Array.isArray(options.integrations)) {\n    options.integrations = options.integrations.filter((i) => i.name !== EmptyIntegration.id);\n  } else if (typeof options.integrations === 'function') {\n    const originalFn = options.integrations;\n\n    options.integrations = (integrations) => {\n      const userIntegrations = originalFn(integrations);\n      return userIntegrations.filter((integration) => integration.name !== EmptyIntegration.id);\n    };\n  }\n}\n"]}MIT License

Copyright (c) 2018 Sentry (https://sentry.io/) and individual contributors.
Copyright (c) 2017 Tim Fish

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
import { Event, SdkInfo } from '@sentry/types';
export declare const SDK_NAME = "sentry.javascript.electron";
/** Gets SDK info */
export declare function getSdkInfo(): SdkInfo;
/** Gets the default release name */
export declare function getDefaultReleaseName(): string;
/** Gets the default environment */
export declare function getDefaultEnvironment(): string;
/**
 * Computes and caches Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
export declare function getEventDefaults(release?: string, environment?: string): Promise<Event>;
//# sourceMappingURL=context.d.ts.map{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/main/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAUzD,eAAO,MAAM,QAAQ,+BAA+B,CAAC;AA4MrD,oBAAoB;AACpB,wBAAgB,UAAU,IAAI,OAAO,CAWpC;AAoDD,oCAAoC;AACpC,wBAAgB,qBAAqB,IAAI,MAAM,CAG9C;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AA6BD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAS7F"}Object.defineProperty(exports, "__esModule", { value: true });
exports.getEventDefaults = exports.getDefaultEnvironment = exports.getDefaultReleaseName = exports.getSdkInfo = exports.SDK_NAME = void 0;
const tslib_1 = require("tslib");
const child = tslib_1.__importStar(require("child_process"));
const electron_1 = require("electron");
const os_1 = require("os");
const path_1 = require("path");
const electron_normalize_1 = require("./electron-normalize");
const fs_1 = require("./fs");
const version_1 = require("./version");
exports.SDK_NAME = 'sentry.javascript.electron';
/** Mapping of Node's platform names to actual OS names. */
const PLATFORM_NAMES = {
    aix: 'IBM AIX',
    freebsd: 'FreeBSD',
    openbsd: 'OpenBSD',
    sunos: 'SunOS',
    win32: 'Windows',
};
/** Mapping of linux release files located in /etc to distributions. */
const LINUX_DISTROS = [
    { name: 'fedora-release', distros: ['Fedora'] },
    { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },
    { name: 'redhat_version', distros: ['Red Hat Linux'] },
    { name: 'SuSE-release', distros: ['SUSE Linux'] },
    { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },
    { name: 'debian_version', distros: ['Debian'] },
    { name: 'debian_release', distros: ['Debian'] },
    { name: 'arch-release', distros: ['Arch Linux'] },
    { name: 'gentoo-release', distros: ['Gentoo Linux'] },
    { name: 'novell-release', distros: ['SUSE Linux'] },
    { name: 'alpine-release', distros: ['Alpine Linux'] },
];
/** Functions to extract the OS version from Linux release files. */
const LINUX_VERSIONS = {
    alpine: (content) => content,
    arch: (content) => matchFirst(/distrib_release=(.*)/, content),
    centos: (content) => matchFirst(/release ([^ ]+)/, content),
    debian: (content) => content,
    fedora: (content) => matchFirst(/release (..)/, content),
    mint: (content) => matchFirst(/distrib_release=(.*)/, content),
    red: (content) => matchFirst(/release ([^ ]+)/, content),
    suse: (content) => matchFirst(/VERSION = (.*)\n/, content),
    ubuntu: (content) => matchFirst(/distrib_release=(.*)/, content),
};
/**
 * Executes a regular expression with one capture group.
 *
 * @param regex A regular expression to execute.
 * @param text Content to execute the RegEx on.
 * @returns The captured string if matched; otherwise undefined.
 */
function matchFirst(regex, text) {
    const match = regex.exec(text);
    return match ? match[1] : undefined;
}
/** Loads the macOS operating system context. */
function getDarwinInfo() {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        // Default values that will be used in case no operating system information
        // can be loaded. The default version is computed via heuristics from the
        // kernel version, but the build ID is missing.
        const darwinInfo = {
            kernel_version: (0, os_1.release)(),
            name: 'Mac OS X',
            version: `10.${Number((0, os_1.release)().split('.')[0]) - 4}`,
        };
        try {
            // We try to load the actual macOS version by executing the `sw_vers` tool.
            // This tool should be available on every standard macOS installation. In
            // case this fails, we stick with the values computed above.
            const output = yield new Promise((resolve, reject) => {
                child.execFile('/usr/bin/sw_vers', (error, stdout) => {
                    if (error) {
                        reject(error);
                        return;
                    }
                    resolve(stdout);
                });
            });
            darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
            darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
            darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
        }
        catch (e) {
            // ignore
        }
        return darwinInfo;
    });
}
/** Returns a distribution identifier to look up version callbacks. */
function getLinuxDistroId(name) {
    return name.split(' ')[0].toLowerCase();
}
/** Loads the Linux operating system context. */
function getLinuxInfo() {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        // By default, we cannot assume anything about the distribution or Linux
        // version. `os.release()` returns the kernel version and we assume a generic
        // "Linux" name, which will be replaced down below.
        const linuxInfo = {
            kernel_version: (0, os_1.release)(),
            name: 'Linux',
        };
        try {
            // We start guessing the distribution by listing files in the /etc
            // directory. This is were most Linux distributions (except Knoppix) store
            // release files with certain distribution-dependent meta data. We search
            // for exactly one known file defined in `LINUX_DISTROS` and exit if none
            // are found. In case there are more than one file, we just stick with the
            // first one.
            const etcFiles = yield (0, fs_1.readDirAsync)('/etc');
            const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name));
            if (!distroFile) {
                return linuxInfo;
            }
            // Once that file is known, load its contents. To make searching in those
            // files easier, we lowercase the file contents. Since these files are
            // usually quite small, this should not allocate too much memory and we only
            // hold on to it for a very short amount of time.
            const distroPath = (0, path_1.join)('/etc', distroFile.name);
            const contents = (yield (0, fs_1.readFileAsync)(distroPath, { encoding: 'utf-8' })).toLowerCase();
            // Some Linux distributions store their release information in the same file
            // (e.g. RHEL and Centos). In those cases, we scan the file for an
            // identifier, that basically consists of the first word of the linux
            // distribution name (e.g. "red" for Red Hat). In case there is no match, we
            // just assume the first distribution in our list.
            const { distros } = distroFile;
            linuxInfo.name = distros.find((d) => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];
            // Based on the found distribution, we can now compute the actual version
            // number. This is different for every distribution, so several strategies
            // are computed in `LINUX_VERSIONS`.
            const id = getLinuxDistroId(linuxInfo.name);
            linuxInfo.version = LINUX_VERSIONS[id](contents);
        }
        catch (e) {
            // ignore
        }
        return linuxInfo;
    });
}
/**
 * Returns the operating system context.
 *
 * Based on the current platform, this uses a different strategy to provide the
 * most accurate OS information. Since this might involve spawning subprocesses
 * or accessing the file system, this should only be executed lazily and cached.
 *
 *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context
 *    has a `name`, `version`, `build` and `kernel_version` set.
 *  - On Linux, this will try to load a distribution release from `/etc` and set
 *    the `name`, `version` and `kernel_version` fields.
 *  - On all other platforms, only a `name` and `version` will be returned. Note
 *    that `version` might actually be the kernel version.
 */
function getOsContext() {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const platformId = (0, os_1.platform)();
        switch (platformId) {
            case 'darwin':
                return getDarwinInfo();
            case 'linux':
                return getLinuxInfo();
            default:
                return {
                    name: PLATFORM_NAMES[platformId] || platformId,
                    version: (0, os_1.release)(),
                };
        }
    });
}
/** Gets SDK info */
function getSdkInfo() {
    return {
        name: exports.SDK_NAME,
        packages: [
            {
                name: 'npm:@sentry/electron',
                version: version_1.SDK_VERSION,
            },
        ],
        version: version_1.SDK_VERSION,
    };
}
exports.getSdkInfo = getSdkInfo;
/** Gets the app context */
function getAppContext() {
    const appCtx = {
        app_name: electron_1.app.name || electron_1.app.getName(),
        app_version: electron_1.app.getVersion(),
        app_start_time: new Date(Date.now() - process.uptime() * 1000).toISOString(),
    };
    if (process.mas) {
        appCtx.build_type = 'app-store';
    }
    if (process.windowsStore) {
        appCtx.build_type = 'windows-store';
    }
    return appCtx;
}
/** Gets the app contexts */
function getContexts() {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const contexts = {
            app: getAppContext(),
            os: (yield getOsContext()),
            browser: {
                name: 'Chrome',
            },
            chrome: {
                name: 'Chrome',
                type: 'runtime',
                version: process.versions.chrome,
            },
            device: {
                arch: process.arch,
                family: 'Desktop',
            },
            node: {
                name: 'Node',
                type: 'runtime',
                version: process.versions.node,
            },
            runtime: {
                name: 'Electron',
                version: process.versions.electron,
            },
        };
        return contexts;
    });
}
/** Gets the default release name */
function getDefaultReleaseName() {
    const app_name = electron_1.app.name || electron_1.app.getName();
    return `${app_name.replace(/\W/g, '-')}@${electron_1.app.getVersion()}`;
}
exports.getDefaultReleaseName = getDefaultReleaseName;
/** Gets the default environment */
function getDefaultEnvironment() {
    return electron_normalize_1.isPackaged ? 'production' : 'development';
}
exports.getDefaultEnvironment = getDefaultEnvironment;
/**
 * Computes Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
function _getEventDefaults(release, environment) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        return {
            sdk: getSdkInfo(),
            contexts: yield getContexts(),
            environment: environment || getDefaultEnvironment(),
            release: release || getDefaultReleaseName(),
            user: { ip_address: '{{auto}}' },
            tags: {
                'event.origin': 'electron',
                'event.environment': 'javascript',
                'event.process': 'browser',
                // Legacy way of filtering native vs JavaScript events
                event_type: 'javascript',
            },
        };
    });
}
/** Cached event prototype with default values. */
let cachedDefaultsPromise;
/**
 * Computes and caches Electron-specific default fields for events.
 *
 * The event defaults include contexts for the Electron, Node and Chrome
 * runtimes, limited device information, operating system context and defaults
 * for the release and environment.
 */
function getEventDefaults(release, environment) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        // The event defaults are cached as long as the app is running. We create the
        // promise here synchronously to avoid multiple events computing them at the
        // same time.
        if (!cachedDefaultsPromise) {
            cachedDefaultsPromise = _getEventDefaults(release, environment);
        }
        return yield cachedDefaultsPromise;
    });
}
exports.getEventDefaults = getEventDefaults;
//# sourceMappingURL=context.js.map{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/main/context.ts"],"names":[],"mappings":";;;AAEA,6DAAuC;AACvC,uCAA+B;AAC/B,2BAAuC;AACvC,+BAA4B;AAE5B,6DAAkD;AAClD,6BAAmD;AACnD,uCAAwC;AAE3B,QAAA,QAAQ,GAAG,4BAA4B,CAAC;AAkCrD,2DAA2D;AAC3D,MAAM,cAAc,GAAmC;IACrD,GAAG,EAAE,SAAS;IACd,OA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AAO,EAAE,WAAW,CAAC,CAAC;SACjE;QAED,OAAO,MAAM,qBAAqB,CAAC;IACrC,CAAC;CAAA;AATD,4CASC","sourcesContent":["/* eslint-disable max-lines */\nimport { Contexts, Event, SdkInfo } from '@sentry/types';\nimport * as child from 'child_process';\nimport { app } from 'electron';\nimport { platform, release } from 'os';\nimport { join } from 'path';\n\nimport { isPackaged } from './electron-normalize';\nimport { readDirAsync, readFileAsync } from './fs';\nimport { SDK_VERSION } from './version';\n\nexport const SDK_NAME = 'sentry.javascript.electron';\n\n/** App context information. */\ninterface AppContext {\n  /** The name of the app. */\n  app_name: string;\n  /** The app version. */\n  app_version: string;\n  /** app start time */\n  app_start_time: string;\n  /** app build type */\n  build_type?: string;\n}\n\n/** Operating system context information. */\ninterface OsContext {\n  /** The name of the operating system. */\n  name?: string;\n  /** The operating system version. */\n  version?: string;\n  /** Operating system specific build identifier */\n  build?: string;\n  /** Version-independent kernel version. */\n  kernel_version?: string;\n}\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n  /** The file name, located in `/etc`. */\n  name: string;\n  /** Potential distributions to check. */\n  distros: string[];\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n  aix: 'IBM AIX',\n  freebsd: 'FreeBSD',\n  openbsd: 'OpenBSD',\n  sunos: 'SunOS',\n  win32: 'Windows',\n};\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n  { name: 'fedora-release', distros: ['Fedora'] },\n  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n  { name: 'redhat_version', distros: ['Red Hat Linux'] },\n  { name: 'SuSE-release', distros: ['SUSE Linux'] },\n  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n  { name: 'debian_version', distros: ['Debian'] },\n  { name: 'debian_release', distros: ['Debian'] },\n  { name: 'arch-release', distros: ['Arch Linux'] },\n  { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n  { name: 'novell-release', distros: ['SUSE Linux'] },\n  { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n  [identifier: string]: (content: string) => string | undefined;\n} = {\n  alpine: (content) => content,\n  arch: (content) => matchFirst(/distrib_release=(.*)/, content),\n  centos: (content) => matchFirst(/release ([^ ]+)/, content),\n  debian: (content) => content,\n  fedora: (content) => matchFirst(/release (..)/, content),\n  mint: (content) => matchFirst(/distrib_release=(.*)/, content),\n  red: (content) => matchFirst(/release ([^ ]+)/, content),\n  suse: (content) => matchFirst(/VERSION = (.*)\\n/, content),\n  ubuntu: (content) => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n  const match = regex.exec(text);\n  return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n  // Default values that will be used in case no operating system information\n  // can be loaded. The default version is computed via heuristics from the\n  // kernel version, but the build ID is missing.\n  const darwinInfo: OsContext = {\n    kernel_version: release(),\n    name: 'Mac OS X',\n    version: `10.${Number(release().split('.')[0]) - 4}`,\n  };\n\n  try {\n    // We try to load the actual macOS version by executing the `sw_vers` tool.\n    // This tool should be available on every standard macOS installation. In\n    // case this fails, we stick with the values computed above.\n\n    const output = await new Promise<string>((resolve, reject) => {\n      child.execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve(stdout);\n      });\n    });\n    darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n    darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n    darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n  } catch (e) {\n    // ignore\n  }\n\n  return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n  return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n  // By default, we cannot assume anything about the distribution or Linux\n  // version. `os.release()` returns the kernel version and we assume a generic\n  // \"Linux\" name, which will be replaced down below.\n  const linuxInfo: OsContext = {\n    kernel_version: release(),\n    name: 'Linux',\n  };\n\n  try {\n    // We start guessing the distribution by listing files in the /etc\n    // directory. This is were most Linux distributions (except Knoppix) store\n    // release files with certain distribution-dependent meta data. We search\n    // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n    // are found. In case there are more than one file, we just stick with the\n    // first one.\n    const etcFiles = await readDirAsync('/etc');\n    const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name));\n    if (!distroFile) {\n      return linuxInfo;\n    }\n\n    // Once that file is known, load its contents. To make searching in those\n    // files easier, we lowercase the file contents. Since these files are\n    // usually quite small, this should not allocate too much memory and we only\n    // hold on to it for a very short amount of time.\n    const distroPath = join('/etc', distroFile.name);\n    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) as string).toLowerCase();\n\n    // Some Linux distributions store their release information in the same file\n    // (e.g. RHEL and Centos). In those cases, we scan the file for an\n    // identifier, that basically consists of the first word of the linux\n    // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n    // just assume the first distribution in our list.\n    const { distros } = distroFile;\n    linuxInfo.name = distros.find((d) => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n    // Based on the found distribution, we can now compute the actual version\n    // number. This is different for every distribution, so several strategies\n    // are computed in `LINUX_VERSIONS`.\n    const id = getLinuxDistroId(linuxInfo.name);\n    linuxInfo.version = LINUX_VERSIONS[id](contents);\n  } catch (e) {\n    // ignore\n  }\n\n  return linuxInfo;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n *    has a `name`, `version`, `build` and `kernel_version` set.\n *  - On Linux, this will try to load a distribution release from `/etc` and set\n *    the `name`, `version` and `kernel_version` fields.\n *  - On all other platforms, only a `name` and `version` will be returned. Note\n *    that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n  const platformId = platform();\n  switch (platformId) {\n    case 'darwin':\n      return getDarwinInfo();\n    case 'linux':\n      return getLinuxInfo();\n    default:\n      return {\n        name: PLATFORM_NAMES[platformId] || platformId,\n        version: release(),\n      };\n  }\n}\n\n/** Gets SDK info */\nexport function getSdkInfo(): SdkInfo {\n  return {\n    name: SDK_NAME,\n    packages: [\n      {\n        name: 'npm:@sentry/electron',\n        version: SDK_VERSION,\n      },\n    ],\n    version: SDK_VERSION,\n  };\n}\n\n/** Gets the app context */\nfunction getAppContext(): AppContext {\n  const appCtx: AppContext = {\n    app_name: app.name || app.getName(),\n    app_version: app.getVersion(),\n    app_start_time: new Date(Date.now() - process.uptime() * 1_000).toISOString(),\n  };\n\n  if (process.mas) {\n    appCtx.build_type = 'app-store';\n  }\n\n  if (process.windowsStore) {\n    appCtx.build_type = 'windows-store';\n  }\n\n  return appCtx;\n}\n\n/** Gets the app contexts */\nasync function getContexts(): Promise<Contexts> {\n  const contexts: Contexts = {\n    app: getAppContext() as Record<string, any>,\n    os: (await getOsContext()) as Record<string, any>,\n    browser: {\n      name: 'Chrome',\n    },\n    chrome: {\n      name: 'Chrome',\n      type: 'runtime',\n      version: process.versions.chrome,\n    },\n    device: {\n      arch: process.arch,\n      family: 'Desktop',\n    },\n    node: {\n      name: 'Node',\n      type: 'runtime',\n      version: process.versions.node,\n    },\n    runtime: {\n      name: 'Electron',\n      version: process.versions.electron,\n    },\n  };\n\n  return contexts;\n}\n\n/** Gets the default release name */\nexport function getDefaultReleaseName(): string {\n  const app_name = app.name || app.getName();\n  return `${app_name.replace(/\\W/g, '-')}@${app.getVersion()}`;\n}\n\n/** Gets the default environment */\nexport function getDefaultEnvironment(): string {\n  return isPackaged ? 'production' : 'development';\n}\n\n/**\n * Computes Electron-specific default fields for events.\n *\n * The event defaults include contexts for the Electron, Node and Chrome\n * runtimes, limited device information, operating system context and defaults\n * for the release and environment.\n */\nasync function _getEventDefaults(release?: string, environment?: string): Promise<Event> {\n  return {\n    sdk: getSdkInfo(),\n    contexts: await getContexts(),\n    environment: environment || getDefaultEnvironment(),\n    release: release || getDefaultReleaseName(),\n    user: { ip_address: '{{auto}}' },\n    tags: {\n      'event.origin': 'electron',\n      'event.environment': 'javascript',\n      'event.process': 'browser',\n      // Legacy way of filtering native vs JavaScript events\n      event_type: 'javascript',\n    },\n  };\n}\n\n/** Cached event prototype with default values. */\nlet cachedDefaultsPromise: Promise<Event>;\n\n/**\n * Computes and caches Electron-specific default fields for events.\n *\n * The event defaults include contexts for the Electron, Node and Chrome\n * runtimes, limited device information, operating system context and defaults\n * for the release and environment.\n */\nexport async function getEventDefaults(release?: string, environment?: string): Promise<Event> {\n  // The event defaults are cached as long as the app is running. We create the\n  // promise here synchronously to avoid multiple events computing them at the\n  // same time.\n  if (!cachedDefaultsPromise) {\n    cachedDefaultsPromise = _getEventDefaults(release, environment);\n  }\n\n  return await cachedDefaultsPromise;\n}\n"]}import { BrowserWindow, NativeImage, WebContents } from 'electron';
import { Optional } from '../common/types';
/** Returns if the app is packaged. Copied from Electron to support < v3 */
export declare const isPackaged: boolean;
/** A promise that is resolved when the app is ready */
export declare const whenAppReady: Promise<void>;
/**
 * Electron >= 5 support full protocol API
 */
export declare function supportsFullProtocol(): boolean;
export declare const EXIT_REASONS: readonly ["clean-exit", "abnormal-exit", "killed", "crashed", "oom", "launch-failed", "integrity-failure"];
export type ExitReason = (typeof EXIT_REASONS)[number];
export declare const CRASH_REASONS: Readonly<ExitReason[]>;
/** Same as the Electron interface but with optional exitCode */
type RenderProcessGoneDetails = Optional<Electron.RenderProcessGoneDetails, 'exitCode'>;
/**
 * Implements 'render-process-gone' event across Electron versions
 */
export declare function onRendererProcessGone(reasons: Readonly<ExitReason[]>, callback: (contents: WebContents, details: RenderProcessGoneDetails) => void): void;
type Details = Optional<Electron.Details, 'exitCode'>;
/**
 * Calls callback on child process crash if Electron version support 'child-process-gone' event
 */
export declare function onChildProcessGone(reasons: Readonly<ExitReason[]>, callback: (details: Details) => void): void;
/** Calls callback when BrowserWindow are created */
export declare function onBrowserWindowCreated(callback: (window: BrowserWindow) => void): void;
/** Calls callback when WebContents are created */
export declare function onWebContentsCreated(callback: (window: WebContents) => void): void;
/**
 * Electron < 9 requires `crashReporter.start()` in the renderer
 */
export declare function rendererRequiresCrashReporterStart(): boolean;
/** Is using Crashpad */
export declare function usesCrashpad(): boolean;
/**
 * Electron >= 9 uses `app.getPath('crashDumps')` rather than
 * `crashReporter.getCrashesDirectory()`
 */
export declare function getCrashesDirectory(): string;
/** Captures a NativeImage from a BrowserWindow */
export declare function capturePage(window: BrowserWindow): Promise<NativeImage>;
export {};
//# sourceMappingURL=electron-normalize.d.ts.map{"version":3,"file":"electron-normalize.d.ts","sourceRoot":"","sources":["../src/main/electron-normalize.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,aAAa,EAAiB,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAK3C,2EAA2E;AAC3E,eAAO,MAAM,UAAU,SAMnB,CAAC;AAEL,uDAAuD;AACvD,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,IAAI,CAQnC,CAAC;AAEL;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,eAAO,MAAM,YAAY,4GAQf,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,UAAU,EAAE,CAA+B,CAAC;AAEjF,gEAAgE;AAChE,KAAK,wBAAwB,GAAG,QAAQ,CAAC,QAAQ,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAC;AAExF;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,EAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,wBAAwB,KAAK,IAAI,GAC3E,IAAI,CAsBN;AAED,KAAK,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAEtD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAiB9G;AAED,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI,CAgBtF;AAED,kDAAkD;AAClD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgBlF;AAED;;GAEG;AACH,wBAAgB,kCAAkC,IAAI,OAAO,CAM5D;AAmBD,wBAAwB;AACxB,wBAAgB,YAAY,IAAI,OAAO,CAMtC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAK5C;AAMD,kDAAkD;AAClD,wBAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CASvE"}Object.defineProperty(exports, "__esModule", { value: true });
exports.capturePage = exports.getCrashesDirectory = exports.usesCrashpad = exports.rendererRequiresCrashReporterStart = exports.onWebContentsCreated = exports.onBrowserWindowCreated = exports.onChildProcessGone = exports.onRendererProcessGone = exports.CRASH_REASONS = exports.EXIT_REASONS = exports.supportsFullProtocol = exports.whenAppReady = exports.isPackaged = void 0;
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const path_1 = require("path");
const parsed = (0, utils_1.parseSemver)(process.versions.electron);
const version = { major: parsed.major || 0, minor: parsed.minor || 0, patch: parsed.patch || 0 };
/** Returns if the app is packaged. Copied from Electron to support < v3 */
exports.isPackaged = (() => {
    const execFile = (0, path_1.basename)(process.execPath).toLowerCase();
    if (process.platform === 'win32') {
        return execFile !== 'electron.exe';
    }
    return execFile !== 'electron';
})();
/** A promise that is resolved when the app is ready */
exports.whenAppReady = (() => {
    return electron_1.app.isReady()
        ? Promise.resolve()
        : new Promise((resolve) => {
            electron_1.app.once('ready', () => {
                resolve();
            });
        });
})();
/**
 * Electron >= 5 support full protocol API
 */
function supportsFullProtocol() {
    return version.major >= 5;
}
exports.supportsFullProtocol = supportsFullProtocol;
exports.EXIT_REASONS = [
    'clean-exit',
    'abnormal-exit',
    'killed',
    'crashed',
    'oom',
    'launch-failed',
    'integrity-failure',
];
exports.CRASH_REASONS = ['crashed', 'oom'];
/**
 * Implements 'render-process-gone' event across Electron versions
 */
function onRendererProcessGone(reasons, callback) {
    const supportsRenderProcessGone = version.major >= 10 || (version.major === 9 && version.minor >= 1) || (version.major === 8 && version.minor >= 4);
    if (supportsRenderProcessGone) {
        electron_1.app.on('render-process-gone', (_, contents, details) => {
            if (reasons.includes(details.reason)) {
                callback(contents, details);
            }
        });
    }
    else {
        onWebContentsCreated((contents) => {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            contents.on('crashed', (__, killed) => {
                // When using Breakpad, crashes are incorrectly reported as killed
                const reason = usesCrashpad() && killed ? 'killed' : 'crashed';
                if (reasons.includes(reason)) {
                    callback(contents, { reason });
                }
            });
        });
    }
}
exports.onRendererProcessGone = onRendererProcessGone;
/**
 * Calls callback on child process crash if Electron version support 'child-process-gone' event
 */
function onChildProcessGone(reasons, callback) {
    if (version.major >= 11) {
        electron_1.app.on('child-process-gone', (_, details) => {
            if (reasons.includes(details.reason)) {
                callback(details);
            }
        });
    }
    else {
        // eslint-disable-next-line deprecation/deprecation
        electron_1.app.on('gpu-process-crashed', (_, killed) => {
            const reason = killed ? 'killed' : 'crashed';
            if (reasons.includes(reason)) {
                callback({ type: 'GPU', reason });
            }
        });
    }
}
exports.onChildProcessGone = onChildProcessGone;
/** Calls callback when BrowserWindow are created */
function onBrowserWindowCreated(callback) {
    electron_1.app.on('browser-window-created', (_, window) => {
        // SetImmediate is required for window.id to be correct in older versions of Electron
        // https://github.com/electron/electron/issues/12036
        if (version.major >= 3) {
            callback(window);
        }
        else {
            setImmediate(() => {
                if (window.isDestroyed()) {
                    return;
                }
                callback(window);
            });
        }
    });
}
exports.onBrowserWindowCreated = onBrowserWindowCreated;
/** Calls callback when WebContents are created */
function onWebContentsCreated(callback) {
    electron_1.app.on('web-contents-created', (_, contents) => {
        // SetImmediate is required for contents.id to be correct in older versions of Electron
        // https://github.com/electron/electron/issues/12036
        if (version.major >= 3) {
            callback(contents);
        }
        else {
            setImmediate(() => {
                if (contents.isDestroyed()) {
                    return;
                }
                callback(contents);
            });
        }
    });
}
exports.onWebContentsCreated = onWebContentsCreated;
/**
 * Electron < 9 requires `crashReporter.start()` in the renderer
 */
function rendererRequiresCrashReporterStart() {
    if (process.platform === 'darwin') {
        return false;
    }
    return version.major < 9;
}
exports.rendererRequiresCrashReporterStart = rendererRequiresCrashReporterStart;
/**
 * Uses Crashpad on Linux
 * https://github.com/electron/electron/issues/27859
 */
function crashpadLinux() {
    if (version.major >= 16) {
        return true;
    }
    if (version.major < 15) {
        return false;
    }
    // Crashpad Linux for v15 is behind a switch
    return electron_1.app.commandLine.hasSwitch('enable-crashpad');
}
/** Is using Crashpad */
function usesCrashpad() {
    return (process.platform === 'darwin' ||
        (process.platform === 'win32' && version.major >= 6) ||
        (process.platform === 'linux' && crashpadLinux()));
}
exports.usesCrashpad = usesCrashpad;
/**
 * Electron >= 9 uses `app.getPath('crashDumps')` rather than
 * `crashReporter.getCrashesDirectory()`
 */
function getCrashesDirectory() {
    return version.major >= 9
        ? electron_1.app.getPath('crashDumps')
        : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            electron_1.crashReporter.getCrashesDirectory();
}
exports.getCrashesDirectory = getCrashesDirectory;
/** Captures a NativeImage from a BrowserWindow */
function capturePage(window) {
    // Pre-Electron 5, BrowserWindow.capturePage() uses callbacks
    if (version.major < 5) {
        return new Promise((resolve) => {
            window.capturePage(resolve);
        });
    }
    return window.capturePage();
}
exports.capturePage = capturePage;
//# sourceMappingURL=electron-normalize.js.map{"version":3,"file":"electron-normalize.js","sourceRoot":"","sources":["../src/main/electron-normalize.ts"],"names":[],"mappings":";;AAAA,yCAA4C;AAC5C,uCAAuF;AACvF,+BAAgC;AAIhC,MAAM,MAAM,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACtD,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;AAEjG,2EAA2E;AAC9D,QAAA,UAAU,GAAG,CAAC,GAAG,EAAE;IAC9B,MAAM,QAAQ,GAAG,IAAA,eAAQ,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1D,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QAChC,OAAO,QAAQ,KAAK,cAAc,CAAC;KACpC;IACD,OAAO,QAAQ,KAAK,UAAU,CAAC;AACjC,CAAC,CAAC,EAAE,CAAC;AAEL,uDAAuD;AAC1C,QAAA,YAAY,GAAkB,CAAC,GAAG,EAAE;IAC/C,OAAO,cAAG,CAAC,OAAO,EAAE;QAClB,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE;QACnB,CAAC,CAAC,IAAI,OAAO,C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,KAAK,QAAQ;QAC7B,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;QACpD,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,aAAa,EAAE,CAAC,CAClD,CAAC;AACJ,CAAC;AAND,oCAMC;AAED;;;GAGG;AACH,SAAgB,mBAAmB;IACjC,OAAO,OAAO,CAAC,KAAK,IAAI,CAAC;QACvB,CAAC,CAAC,cAAG,CAAC,OAAO,CAAC,YAAY,CAAC;QAC3B,CAAC,CAAC,sEAAsE;YACrE,wBAAqB,CAAC,mBAAmB,EAAE,CAAC;AACnD,CAAC;AALD,kDAKC;AAMD,kDAAkD;AAClD,SAAgB,WAAW,CAAC,MAAqB;IAC/C,6DAA6D;IAC7D,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE;QACrB,OAAO,IAAI,OAAO,CAAc,CAAC,OAAO,EAAE,EAAE;YACzC,MAA6B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;AAC9B,CAAC;AATD,kCASC","sourcesContent":["import { parseSemver } from '@sentry/utils';\nimport { app, BrowserWindow, crashReporter, NativeImage, WebContents } from 'electron';\nimport { basename } from 'path';\n\nimport { Optional } from '../common/types';\n\nconst parsed = parseSemver(process.versions.electron);\nconst version = { major: parsed.major || 0, minor: parsed.minor || 0, patch: parsed.patch || 0 };\n\n/** Returns if the app is packaged. Copied from Electron to support < v3 */\nexport const isPackaged = (() => {\n  const execFile = basename(process.execPath).toLowerCase();\n  if (process.platform === 'win32') {\n    return execFile !== 'electron.exe';\n  }\n  return execFile !== 'electron';\n})();\n\n/** A promise that is resolved when the app is ready */\nexport const whenAppReady: Promise<void> = (() => {\n  return app.isReady()\n    ? Promise.resolve()\n    : new Promise<void>((resolve) => {\n        app.once('ready', () => {\n          resolve();\n        });\n      });\n})();\n\n/**\n * Electron >= 5 support full protocol API\n */\nexport function supportsFullProtocol(): boolean {\n  return version.major >= 5;\n}\n\nexport const EXIT_REASONS = [\n  'clean-exit',\n  'abnormal-exit',\n  'killed',\n  'crashed',\n  'oom',\n  'launch-failed',\n  'integrity-failure',\n] as const;\nexport type ExitReason = (typeof EXIT_REASONS)[number];\nexport const CRASH_REASONS: Readonly<ExitReason[]> = ['crashed', 'oom'] as const;\n\n/** Same as the Electron interface but with optional exitCode */\ntype RenderProcessGoneDetails = Optional<Electron.RenderProcessGoneDetails, 'exitCode'>;\n\n/**\n * Implements 'render-process-gone' event across Electron versions\n */\nexport function onRendererProcessGone(\n  reasons: Readonly<ExitReason[]>,\n  callback: (contents: WebContents, details: RenderProcessGoneDetails) => void,\n): void {\n  const supportsRenderProcessGone =\n    version.major >= 10 || (version.major === 9 && version.minor >= 1) || (version.major === 8 && version.minor >= 4);\n  if (supportsRenderProcessGone) {\n    app.on('render-process-gone', (_, contents, details) => {\n      if (reasons.includes(details.reason)) {\n        callback(contents, details);\n      }\n    });\n  } else {\n    onWebContentsCreated((contents) => {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      (contents as any).on('crashed', (__: Electron.Event, killed: boolean) => {\n        // When using Breakpad, crashes are incorrectly reported as killed\n        const reason: ExitReason = usesCrashpad() && killed ? 'killed' : 'crashed';\n\n        if (reasons.includes(reason)) {\n          callback(contents, { reason });\n        }\n      });\n    });\n  }\n}\n\ntype Details = Optional<Electron.Details, 'exitCode'>;\n\n/**\n * Calls callback on child process crash if Electron version support 'child-process-gone' event\n */\nexport function onChildProcessGone(reasons: Readonly<ExitReason[]>, callback: (details: Details) => void): void {\n  if (version.major >= 11) {\n    app.on('child-process-gone', (_, details) => {\n      if (reasons.includes(details.reason)) {\n        callback(details);\n      }\n    });\n  } else {\n    // eslint-disable-next-line deprecation/deprecation\n    app.on('gpu-process-crashed', (_, killed) => {\n      const reason: ExitReason = killed ? 'killed' : 'crashed';\n\n      if (reasons.includes(reason)) {\n        callback({ type: 'GPU', reason });\n      }\n    });\n  }\n}\n\n/** Calls callback when BrowserWindow are created */\nexport function onBrowserWindowCreated(callback: (window: BrowserWindow) => void): void {\n  app.on('browser-window-created', (_, window) => {\n    // SetImmediate is required for window.id to be correct in older versions of Electron\n    // https://github.com/electron/electron/issues/12036\n    if (version.major >= 3) {\n      callback(window);\n    } else {\n      setImmediate(() => {\n        if (window.isDestroyed()) {\n          return;\n        }\n\n        callback(window);\n      });\n    }\n  });\n}\n\n/** Calls callback when WebContents are created */\nexport function onWebContentsCreated(callback: (window: WebContents) => void): void {\n  app.on('web-contents-created', (_, contents) => {\n    // SetImmediate is required for contents.id to be correct in older versions of Electron\n    // https://github.com/electron/electron/issues/12036\n    if (version.major >= 3) {\n      callback(contents);\n    } else {\n      setImmediate(() => {\n        if (contents.isDestroyed()) {\n          return;\n        }\n\n        callback(contents);\n      });\n    }\n  });\n}\n\n/**\n * Electron < 9 requires `crashReporter.start()` in the renderer\n */\nexport function rendererRequiresCrashReporterStart(): boolean {\n  if (process.platform === 'darwin') {\n    return false;\n  }\n\n  return version.major < 9;\n}\n\n/**\n * Uses Crashpad on Linux\n * https://github.com/electron/electron/issues/27859\n */\nfunction crashpadLinux(): boolean {\n  if (version.major >= 16) {\n    return true;\n  }\n\n  if (version.major < 15) {\n    return false;\n  }\n\n  // Crashpad Linux for v15 is behind a switch\n  return app.commandLine.hasSwitch('enable-crashpad');\n}\n\n/** Is using Crashpad */\nexport function usesCrashpad(): boolean {\n  return (\n    process.platform === 'darwin' ||\n    (process.platform === 'win32' && version.major >= 6) ||\n    (process.platform === 'linux' && crashpadLinux())\n  );\n}\n\n/**\n * Electron >= 9 uses `app.getPath('crashDumps')` rather than\n * `crashReporter.getCrashesDirectory()`\n */\nexport function getCrashesDirectory(): string {\n  return version.major >= 9\n    ? app.getPath('crashDumps')\n    : // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      (crashReporter as any).getCrashesDirectory();\n}\n\ninterface OlderBrowserWindow extends Omit<BrowserWindow, 'capturePage'> {\n  capturePage(callback?: (i: NativeImage) => void): void;\n}\n\n/** Captures a NativeImage from a BrowserWindow */\nexport function capturePage(window: BrowserWindow): Promise<NativeImage> {\n  // Pre-Electron 5, BrowserWindow.capturePage() uses callbacks\n  if (version.major < 5) {\n    return new Promise<NativeImage>((resolve) => {\n      (window as OlderBrowserWindow).capturePage(resolve);\n    });\n  }\n\n  return window.capturePage();\n}\n"]}/// <reference types="node" />
import { mkdir, readdir, readFile, rename, stat, unlink, writeFile } from 'fs';
export declare const sentryCachePath: string;
export declare const writeFileAsync: typeof writeFile.__promisify__;
export declare const readFileAsync: typeof readFile.__promisify__;
export declare const mkdirAsync: typeof mkdir.__promisify__;
export declare const statAsync: typeof stat.__promisify__;
export declare const unlinkAsync: typeof unlink.__promisify__;
export declare const readDirAsync: typeof readdir.__promisify__;
export declare const renameAsync: typeof rename.__promisify__;
/**
 * Recursively creates the given path.
 *
 * @param path A relative or absolute path to create.
 * @returns A Promise that resolves when the path has been created.
 */
export declare function mkdirp(path: string): Promise<void>;
//# sourceMappingURL=fs.d.ts.map{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/main/fs.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAY,MAAM,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAIzF,eAAO,MAAM,eAAe,QAA0C,CAAC;AAEvE,eAAO,MAAM,cAAc,gCAAuB,CAAC;AACnD,eAAO,MAAM,aAAa,+BAAsB,CAAC;AACjD,eAAO,MAAM,UAAU,4BAAmB,CAAC;AAC3C,eAAO,MAAM,SAAS,2BAAkB,CAAC;AACzC,eAAO,MAAM,WAAW,6BAAoB,CAAC;AAC7C,eAAO,MAAM,YAAY,8BAAqB,CAAC;AAC/C,eAAO,MAAM,WAAW,6BAAoB,CAAC;AAI7C;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBxD"}Object.defineProperty(exports, "__esModule", { value: true });
exports.mkdirp = exports.renameAsync = exports.readDirAsync = exports.unlinkAsync = exports.statAsync = exports.mkdirAsync = exports.readFileAsync = exports.writeFileAsync = exports.sentryCachePath = void 0;
const tslib_1 = require("tslib");
const electron_1 = require("electron");
const fs_1 = require("fs");
const path_1 = require("path");
const util_1 = require("util");
exports.sentryCachePath = (0, path_1.join)(electron_1.app.getPath('userData'), 'sentry');
exports.writeFileAsync = (0, util_1.promisify)(fs_1.writeFile);
exports.readFileAsync = (0, util_1.promisify)(fs_1.readFile);
exports.mkdirAsync = (0, util_1.promisify)(fs_1.mkdir);
exports.statAsync = (0, util_1.promisify)(fs_1.stat);
exports.unlinkAsync = (0, util_1.promisify)(fs_1.unlink);
exports.readDirAsync = (0, util_1.promisify)(fs_1.readdir);
exports.renameAsync = (0, util_1.promisify)(fs_1.rename);
// mkdir with recursive was only added in Node 10+
/**
 * Recursively creates the given path.
 *
 * @param path A relative or absolute path to create.
 * @returns A Promise that resolves when the path has been created.
 */
function mkdirp(path) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        // eslint-disable-next-line no-bitwise
        const realPath = (0, path_1.resolve)(path);
        try {
            yield (0, exports.mkdirAsync)(realPath, 0o777);
        }
        catch (err) {
            const error = err;
            if (error && error.code === 'ENOENT') {
                yield mkdirp((0, path_1.dirname)(realPath));
                yield (0, exports.mkdirAsync)(realPath, 0o777);
            }
            try {
                if (!(0, fs_1.statSync)(realPath).isDirectory()) {
                    throw err;
                }
            }
            catch (_) {
                throw err;
            }
        }
    });
}
exports.mkdirp = mkdirp;
//# sourceMappingURL=fs.js.map{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/main/fs.ts"],"names":[],"mappings":";;;AAAA,uCAA+B;AAC/B,2BAAyF;AACzF,+BAA8C;AAC9C,+BAAiC;AAEpB,QAAA,eAAe,GAAG,IAAA,WAAI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, readFile, rename, stat, statSync, unlink, writeFile } from 'fs';\nimport { dirname, join, resolve } from 'path';\nimport { promisify } from 'util';\n\nexport const sentryCachePath = join(app.getPath('userData'), 'sentry');\n\nexport const writeFileAsync = promisify(writeFile);\nexport const readFileAsync = promisify(readFile);\nexport const mkdirAsync = promisify(mkdir);\nexport const statAsync = promisify(stat);\nexport const unlinkAsync = promisify(unlink);\nexport const readDirAsync = promisify(readdir);\nexport const renameAsync = promisify(rename);\n\n// mkdir with recursive was only added in Node 10+\n\n/**\n * Recursively creates the given path.\n *\n * @param path A relative or absolute path to create.\n * @returns A Promise that resolves when the path has been created.\n */\nexport async function mkdirp(path: string): Promise<void> {\n  // eslint-disable-next-line no-bitwise\n  const realPath = resolve(path);\n\n  try {\n    await mkdirAsync(realPath, 0o777);\n  } catch (err) {\n    const error = err as { code: string };\n    if (error && error.code === 'ENOENT') {\n      await mkdirp(dirname(realPath));\n      await mkdirAsync(realPath, 0o777);\n    }\n\n    try {\n      if (!statSync(realPath).isDirectory()) {\n        throw err;\n      }\n    } catch (_) {\n      throw err;\n    }\n  }\n}\n"]}import * as ElectronMainIntegrations from './integrations';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export type { NodeOptions } from '@sentry/node';
export { flush, close, NodeClient, lastEventId } from '@sentry/node';
export { makeElectronTransport } from './transports/electron-net';
export { makeElectronOfflineTransport } from './transports/electron-offline-net';
export declare const Integrations: {
    Apollo: typeof import("@sentry-internal/tracing").Apollo;
    Express: typeof import("@sentry-internal/tracing").Express;
    GraphQL: typeof import("@sentry-internal/tracing").GraphQL;
    Mongo: typeof import("@sentry-internal/tracing").Mongo;
    Mysql: typeof import("@sentry-internal/tracing").Mysql;
    Postgres: typeof import("@sentry-internal/tracing").Postgres;
    Prisma: typeof import("@sentry-internal/tracing").Prisma;
    Console: typeof import("@sentry/node/types/integrations").Console;
    Http: typeof import("@sentry/node/types/integrations").Http;
    OnUncaughtException: typeof import("@sentry/node/types/integrations").OnUncaughtException;
    OnUnhandledRejection: typeof import("@sentry/node/types/integrations").OnUnhandledRejection;
    LinkedErrors: typeof import("@sentry/node/types/integrations").LinkedErrors;
    Modules: typeof import("@sentry/node/types/integrations").Modules;
    ContextLines: typeof import("@sentry/node/types/integrations").ContextLines;
    Context: typeof import("@sentry/node/types/integrations").Context;
    RequestData: typeof import("@sentry/node/types/integrations").RequestData;
    LocalVariables: typeof import("@sentry/node/types/integrations").LocalVariables;
    Undici: typeof import("@sentry/node/types/integrations").Undici;
    FunctionToString: typeof import("@sentry/core").FunctionToString;
    InboundFilters: typeof import("@sentry/core").InboundFilters;
    ElectronBreadcrumbs: typeof ElectronMainIntegrations.ElectronBreadcrumbs;
    MainContext: typeof ElectronMainIntegrations.MainContext;
    SentryMinidump: typeof ElectronMainIntegrations.SentryMinidump;
    ElectronMinidump: typeof ElectronMainIntegrations.ElectronMinidump;
    PreloadInjection: typeof ElectronMainIntegrations.PreloadInjection;
    MainProcessSession: typeof ElectronMainIntegrations.MainProcessSession;
    AdditionalContext: typeof ElectronMainIntegrations.AdditionalContext;
    Net: typeof ElectronMainIntegrations.Net;
    ChildProcess: typeof ElectronMainIntegrations.ChildProcess;
    Screenshots: typeof ElectronMainIntegrations.Screenshots;
};
export type { ElectronMainOptions } from './sdk';
export { init, defaultIntegrations } from './sdk';
export { IPCMode } from '../common';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,wBAAwB,MAAM,gBAAgB,CAAC;AAE3D,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuD,CAAC;AAEjF,YAAY,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.IPCMode = exports.defaultIntegrations = exports.init = exports.Integrations = exports.makeElectronOfflineTransport = exports.makeElectronTransport = exports.lastEventId = exports.NodeClient = exports.close = exports.flush = exports.InboundFilters = exports.FunctionToString = exports.withScope = exports.setUser = exports.setTags = exports.setTag = exports.setExtras = exports.setExtra = exports.setContext = exports.startTransaction = exports.Scope = exports.makeMain = exports.Hub = exports.getCurrentHub = exports.getHubFromCarrier = exports.createTransport = exports.configureScope = exports.captureMessage = exports.captureEvent = exports.captureException = exports.addBreadcrumb = exports.addGlobalEventProcessor = void 0;
const tslib_1 = require("tslib");
const common_1 = require("../common");
(0, common_1.ensureProcess)('main');
const node_1 = require("@sentry/node");
const ElectronMainIntegrations = tslib_1.__importStar(require("./integrations"));
var core_1 = require("@sentry/core");
Object.defineProperty(exports, "addGlobalEventProcessor", { enumerable: true, get: function () { return core_1.addGlobalEventProcessor; } });
Object.defineProperty(exports, "addBreadcrumb", { enumerable: true, get: function () { return core_1.addBreadcrumb; } });
Object.defineProperty(exports, "captureException", { enumerable: true, get: function () { return core_1.captureException; } });
Object.defineProperty(exports, "captureEvent", { enumerable: true, get: function () { return core_1.captureEvent; } });
Object.defineProperty(exports, "captureMessage", { enumerable: true, get: function () { return core_1.captureMessage; } });
Object.defineProperty(exports, "configureScope", { enumerable: true, get: function () { return core_1.configureScope; } });
Object.defineProperty(exports, "createTransport", { enumerable: true, get: function () { return core_1.createTransport; } });
Object.defineProperty(exports, "getHubFromCarrier", { enumerable: true, get: function () { return core_1.getHubFromCarrier; } });
Object.defineProperty(exports, "getCurrentHub", { enumerable: true, get: function () { return core_1.getCurrentHub; } });
Object.defineProperty(exports, "Hub", { enumerable: true, get: function () { return core_1.Hub; } });
Object.defineProperty(exports, "makeMain", { enumerable: true, get: function () { return core_1.makeMain; } });
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return core_1.Scope; } });
Object.defineProperty(exports, "startTransaction", { enumerable: true, get: function () { return core_1.startTransaction; } });
Object.defineProperty(exports, "setContext", { enumerable: true, get: function () { return core_1.setContext; } });
Object.defineProperty(exports, "setExtra", { enumerable: true, get: function () { return core_1.setExtra; } });
Object.defineProperty(exports, "setExtras", { enumerable: true, get: function () { return core_1.setExtras; } });
Object.defineProperty(exports, "setTag", { enumerable: true, get: function () { return core_1.setTag; } });
Object.defineProperty(exports, "setTags", { enumerable: true, get: function () { return core_1.setTags; } });
Object.defineProperty(exports, "setUser", { enumerable: true, get: function () { return core_1.setUser; } });
Object.defineProperty(exports, "withScope", { enumerable: true, get: function () { return core_1.withScope; } });
Object.defineProperty(exports, "FunctionToString", { enumerable: true, get: function () { return core_1.FunctionToString; } });
Object.defineProperty(exports, "InboundFilters", { enumerable: true, get: function () { return core_1.InboundFilters; } });
var node_2 = require("@sentry/node");
Object.defineProperty(exports, "flush", { enumerable: true, get: function () { return node_2.flush; } });
Object.defineProperty(exports, "close", { enumerable: true, get: function () { return node_2.close; } });
Object.defineProperty(exports, "NodeClient", { enumerable: true, get: function () { return node_2.NodeClient; } });
Object.defineProperty(exports, "lastEventId", { enumerable: true, get: function () { return node_2.lastEventId; } });
var electron_net_1 = require("./transports/electron-net");
Object.defineProperty(exports, "makeElectronTransport", { enumerable: true, get: function () { return electron_net_1.makeElectronTransport; } });
var electron_offline_net_1 = require("./transports/electron-offline-net");
Object.defineProperty(exports, "makeElectronOfflineTransport", { enumerable: true, get: function () { return electron_offline_net_1.makeElectronOfflineTransport; } });
exports.Integrations = Object.assign(Object.assign({}, ElectronMainIntegrations), node_1.Integrations);
var sdk_1 = require("./sdk");
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return sdk_1.init; } });
Object.defineProperty(exports, "defaultIntegrations", { enumerable: true, get: function () { return sdk_1.defaultIntegrations; } });
var common_2 = require("../common");
Object.defineProperty(exports, "IPCMode", { enumerable: true, get: function () { return common_2.IPCMode; } });
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":";;;AAAA,sCAA0C;AAC1C,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;AAEtB,uCAAgE;AAEhE,iFAA2D;AAoB3D,qCAuBsB;AAtBpB,+GAAA,uBAAuB,OAAA;AACvB,qGAAA,aAAa,OAAA;AACb,wGAAA,gBAAgB,OAAA;AAChB,oGAAA,YAAY,OAAA;AACZ,sGAAA,cAAc,OAAA;AACd,sGAAA,cAAc,OAAA;AACd,uGAAA,eAAe,OAAA;AACf,yGAAA,iBAAiB,OAAA;AACjB,qGAAA,aAAa,OAAA;AACb,2FAAA,GAAG,OAAA;AACH,gGAAA,QAAQ,OAAA;AACR,6FAAA,KAAK,OAAA;AACL,wGAAA,gBAAgB,OAAA;AAChB,kGAAA,UAAU,OAAA;AACV,gGAAA,QAAQ,OAAA;AACR,iGAAA,SAAS,OAAA;AACT,8FAAA,MAAM,OAAA;AACN,+FAAA,OAAO,OAAA;AACP,+FAAA,OAAO,OAAA;AACP,iGAAA,SAAS,OAAA;AACT,wGAAA,gBAAgB,OAAA;AAChB,sGAAA,cAAc,OAAA;AAIhB,qCAAqE;AAA5D,6FAAA,KAAK,OAAA;AAAE,6FAAA,KAAK,OAAA;AAAE,kGAAA,UAAU,OAAA;AAAE,mGAAA,WAAW,OAAA;AAE9C,0DAAkE;AAAzD,qHAAA,qBAAqB,OAAA;AAC9B,0EAAiF;AAAxE,oIAAA,4BAA4B,OAAA;AACxB,QAAA,YAAY,mCAAQ,wBAAwB,GAAK,mBAAgB,EAAG;AAGjF,6BAAkD;AAAzC,2FAAA,IAAI,OAAA;AAAE,0GAAA,mBAAmB,OAAA;AAClC,oCAAoC;AAA3B,iGAAA,OAAO,OAAA","sourcesContent":["import { ensureProcess } from '../common';\nensureProcess('main');\n\nimport { Integrations as NodeIntegrations } from '@sentry/node';\n\nimport * as ElectronMainIntegrations from './integrations';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n} from '@sentry/core';\n\nexport type { NodeOptions } from '@sentry/node';\nexport { flush, close, NodeClient, lastEventId } from '@sentry/node';\n\nexport { makeElectronTransport } from './transports/electron-net';\nexport { makeElectronOfflineTransport } from './transports/electron-offline-net';\nexport const Integrations = { ...ElectronMainIntegrations, ...NodeIntegrations };\n\nexport type { ElectronMainOptions } from './sdk';\nexport { init, defaultIntegrations } from './sdk';\nexport { IPCMode } from '../common';\n"]}import { EventProcessor, Integration } from '@sentry/types';
export interface AdditionalContextOptions {
    cpu: boolean;
    screen: boolean;
    memory: boolean;
    language: boolean;
}
/** Adds Electron context to events and normalises paths. */
export declare class AdditionalContext implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    private _lazyDeviceContext;
    constructor(options?: Partial<AdditionalContextOptions>);
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
    /** Adds additional context to event */
    private _addAdditionalContext;
    /** Sets the display info */
    private _setPrimaryDisplayInfo;
}
//# sourceMappingURL=additional-context.d.ts.map{"version":3,"file":"additional-context.d.ts","sourceRoot":"","sources":["../../src/main/integrations/additional-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOlF,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AASD,4DAA4D;AAC5D,qBAAa,iBAAkB,YAAW,WAAW;IACnD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAuB;IAE/C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAwB;IAE3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,kBAAkB,CAAqB;gBAE5B,OAAO,GAAE,OAAO,CAAC,wBAAwB,CAAM;IAOlE,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAqBnF,uCAAuC;IACvC,OAAO,CAAC,qBAAqB;IA6B7B,4BAA4B;IAC5B,OAAO,CAAC,sBAAsB;CAO/B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.AdditionalContext = void 0;
const tslib_1 = require("tslib");
const electron_1 = require("electron");
const os_1 = require("os");
const common_1 = require("../../common");
const electron_normalize_1 = require("../electron-normalize");
const DEFAULT_OPTIONS = {
    cpu: true,
    screen: true,
    memory: true,
    language: true,
};
/** Adds Electron context to events and normalises paths. */
class AdditionalContext {
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = AdditionalContext.id;
        this._lazyDeviceContext = {};
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), options);
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        addGlobalEventProcessor((event) => tslib_1.__awaiter(this, void 0, void 0, function* () { return this._addAdditionalContext(event); }));
        // Some metrics are only available after app ready so we lazily load them
        void electron_normalize_1.whenAppReady.then(() => {
            const { language, screen } = this._options;
            if (language) {
                this._lazyDeviceContext.language = electron_1.app.getLocale();
            }
            if (screen) {
                this._setPrimaryDisplayInfo();
                electron_1.screen.on('display-metrics-changed', () => {
                    this._setPrimaryDisplayInfo();
                });
            }
        });
    }
    /** Adds additional context to event */
    _addAdditionalContext(event) {
        const device = this._lazyDeviceContext;
        const { memory, cpu } = this._options;
        if (memory) {
            const { total, free } = process.getSystemMemoryInfo();
            device.memory_size = total * 1024;
            device.free_memory = free * 1024;
        }
        if (cpu) {
            const cpuInfo = (0, os_1.cpus)();
            if (cpuInfo && cpuInfo.length) {
                const firstCpu = cpuInfo[0];
                device.processor_count = cpuInfo.length;
                device.cpu_description = firstCpu.model;
                device.processor_frequency = firstCpu.speed;
                if (electron_1.app.runningUnderARM64Translation) {
                    device.machine_arch = 'arm64';
                }
            }
        }
        return (0, common_1.mergeEvents)(event, { contexts: { device } });
    }
    /** Sets the display info */
    _setPrimaryDisplayInfo() {
        const display = electron_1.screen.getPrimaryDisplay();
        const width = Math.floor(display.size.width * display.scaleFactor);
        const height = Math.floor(display.size.height * display.scaleFactor);
        this._lazyDeviceContext.screen_density = display.scaleFactor;
        this._lazyDeviceContext.screen_resolution = `${width}x${height}`;
    }
}
exports.AdditionalContext = AdditionalContext;
/** @inheritDoc */
AdditionalContext.id = 'AdditionalContext';
//# sourceMappingURL=additional-context.js.map{"version":3,"file":"additional-context.js","sourceRoot":"","sources":["../../src/main/integrations/additional-context.ts"],"names":[],"mappings":";;;AACA,uCAAyD;AACzD,2BAAmC;AAEnC,yCAA2C;AAC3C,8DAAqD;AASrD,MAAM,eAAe,GAA6B;IAChD,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,4DAA4D;AAC5D,MAAa,iBAAiB;IAU5B,YAAmB,UAA6C,EAAE;QANlE,kBAAkB;QACX,SAAI,GAAW,iBAAiB,CAAC,EAAE,CAAC;QAGnC,uBAAkB,GAAkB,EAAE,CAAC;QAG7C,IAAI,CAAC,QAAQ,mCACR,eAAe,GACf,OAAO,CACX,CAAC;IACJ,CAAC;IAED,kBAAkB;IACX,SAAS,CAAC,uBAA2D;QAC1E,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE,wDAAC,OAAA,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA,GAAA,CAAC,CAAC;QAEnF,yEAAyE;QACzE,KAAK,iCAAY,CAAC,IAAI,CAAC,GAAG,EAAE;YAC1B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YAE3C,IAAI,QAAQ,EAAE;gBACZ,IAAI,CAAC,kBAAkB,CAAC,QAAQ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ACpB,sBAAsB;QAC5B,MAAM,OAAO,GAAG,iBAAc,CAAC,iBAAiB,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,kBAAkB,CAAC,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;QAC7D,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;IACnE,CAAC;;AA5EH,8CA6EC;AA5EC,kBAAkB;AACJ,oBAAE,GAAW,mBAAmB,CAAC","sourcesContent":["import { DeviceContext, Event, EventProcessor, Integration } from '@sentry/types';\nimport { app, screen as electronScreen } from 'electron';\nimport { CpuInfo, cpus } from 'os';\n\nimport { mergeEvents } from '../../common';\nimport { whenAppReady } from '../electron-normalize';\n\nexport interface AdditionalContextOptions {\n  cpu: boolean;\n  screen: boolean;\n  memory: boolean;\n  language: boolean;\n}\n\nconst DEFAULT_OPTIONS: AdditionalContextOptions = {\n  cpu: true,\n  screen: true,\n  memory: true,\n  language: true,\n};\n\n/** Adds Electron context to events and normalises paths. */\nexport class AdditionalContext implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'AdditionalContext';\n\n  /** @inheritDoc */\n  public name: string = AdditionalContext.id;\n\n  private readonly _options: AdditionalContextOptions;\n  private _lazyDeviceContext: DeviceContext = {};\n\n  public constructor(options: Partial<AdditionalContextOptions> = {}) {\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...options,\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(async (event: Event) => this._addAdditionalContext(event));\n\n    // Some metrics are only available after app ready so we lazily load them\n    void whenAppReady.then(() => {\n      const { language, screen } = this._options;\n\n      if (language) {\n        this._lazyDeviceContext.language = app.getLocale();\n      }\n\n      if (screen) {\n        this._setPrimaryDisplayInfo();\n\n        electronScreen.on('display-metrics-changed', () => {\n          this._setPrimaryDisplayInfo();\n        });\n      }\n    });\n  }\n\n  /** Adds additional context to event */\n  private _addAdditionalContext(event: Event): Event {\n    const device: DeviceContext = this._lazyDeviceContext;\n\n    const { memory, cpu } = this._options;\n\n    if (memory) {\n      const { total, free } = process.getSystemMemoryInfo();\n      device.memory_size = total * 1024;\n      device.free_memory = free * 1024;\n    }\n\n    if (cpu) {\n      const cpuInfo: CpuInfo[] | undefined = cpus();\n      if (cpuInfo && cpuInfo.length) {\n        const firstCpu = cpuInfo[0];\n\n        device.processor_count = cpuInfo.length;\n        device.cpu_description = firstCpu.model;\n        device.processor_frequency = firstCpu.speed;\n\n        if (app.runningUnderARM64Translation) {\n          device.machine_arch = 'arm64';\n        }\n      }\n    }\n\n    return mergeEvents(event, { contexts: { device } });\n  }\n\n  /** Sets the display info */\n  private _setPrimaryDisplayInfo(): void {\n    const display = electronScreen.getPrimaryDisplay();\n    const width = Math.floor(display.size.width * display.scaleFactor);\n    const height = Math.floor(display.size.height * display.scaleFactor);\n    this._lazyDeviceContext.screen_density = display.scaleFactor;\n    this._lazyDeviceContext.screen_resolution = `${width}x${height}`;\n  }\n}\n"]}import { Integration } from '@sentry/types';
import { OrBool } from '../../common/types';
import { ExitReason } from '../electron-normalize';
interface ChildProcessOptions {
    /** Child process events that generate breadcrumbs */
    breadcrumbs: Readonly<ExitReason[]>;
    /** Child process events that generate Sentry events */
    events: Readonly<ExitReason[]>;
}
/** Adds breadcrumbs for Electron events. */
export declare class ChildProcess implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /**
     * @param _options Integration options
     */
    constructor(options?: Partial<OrBool<ChildProcessOptions>>);
    /** @inheritDoc */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=child-process.d.ts.map{"version":3,"file":"child-process.d.ts","sourceRoot":"","sources":["../../src/main/integrations/child-process.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAgB,UAAU,EAA6C,MAAM,uBAAuB,CAAC;AAG5G,UAAU,mBAAmB;IAC3B,qDAAqD;IACrD,WAAW,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACpC,uDAAuD;IACvD,MAAM,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;CAChC;AAyBD,4CAA4C;AAC5C,qBAAa,YAAa,YAAW,WAAW;IAC9C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAmB;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAM;IAQrE,kBAAkB;IACX,SAAS,IAAI,IAAI;CAkDzB"}Object.defineProperty(exports, "__esModule", { value: true });
exports.ChildProcess = void 0;
const core_1 = require("@sentry/core");
const electron_normalize_1 = require("../electron-normalize");
const DEFAULT_OPTIONS = {
    breadcrumbs: electron_normalize_1.EXIT_REASONS,
    events: ['abnormal-exit', 'launch-failed', 'integrity-failure'],
};
/** Gets message and severity */
function getMessageAndSeverity(reason, proc) {
    const message = `'${proc}' process exited with '${reason}'`;
    switch (reason) {
        case 'abnormal-exit':
        case 'killed':
            return { message, level: 'warning' };
        case 'crashed':
        case 'oom':
        case 'launch-failed':
        case 'integrity-failure':
            return { message, level: 'fatal' };
        default:
            return { message, level: 'debug' };
    }
}
/** Adds breadcrumbs for Electron events. */
class ChildProcess {
    /**
     * @param _options Integration options
     */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = ChildProcess.id;
        const { breadcrumbs, events } = options;
        this._options = {
            breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : breadcrumbs == false ? [] : DEFAULT_OPTIONS.breadcrumbs,
            events: Array.isArray(events) ? events : events == false ? [] : DEFAULT_OPTIONS.events,
        };
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const { breadcrumbs, events } = this._options;
        const allReasons = Array.from(new Set([...breadcrumbs, ...events]));
        // only hook these events if we're after more than just the unresponsive event
        if (allReasons.length > 0) {
            const options = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
            (0, electron_normalize_1.onChildProcessGone)(allReasons, (details) => {
                const { reason } = details;
                // Capture message first
                if (events.includes(reason)) {
                    const { message, level } = getMessageAndSeverity(details.reason, details.type);
                    (0, core_1.captureMessage)(message, { level, tags: { 'event.process': details.type } });
                }
                // And then add breadcrumbs for subsequent events
                if (breadcrumbs.includes(reason)) {
                    (0, core_1.addBreadcrumb)(Object.assign(Object.assign({ type: 'process', category: 'child-process' }, getMessageAndSeverity(details.reason, details.type)), { data: details }));
                }
            });
            (0, electron_normalize_1.onRendererProcessGone)(allReasons, (contents, details) => {
                var _a;
                const { reason } = details;
                const name = ((_a = options === null || options === void 0 ? void 0 : options.getRendererName) === null || _a === void 0 ? void 0 : _a.call(options, contents)) || 'renderer';
                // Capture message first
                if (events.includes(reason)) {
                    const { message, level } = getMessageAndSeverity(details.reason, name);
                    (0, core_1.captureMessage)(message, level);
                }
                // And then add breadcrumbs for subsequent events
                if (breadcrumbs.includes(reason)) {
                    (0, core_1.addBreadcrumb)(Object.assign(Object.assign({ type: 'process', category: 'child-process' }, getMessageAndSeverity(details.reason, name)), { data: details }));
                }
            });
        }
    }
}
exports.ChildProcess = ChildProcess;
/** @inheritDoc */
ChildProcess.id = 'ChildProcess';
//# sourceMappingURL=child-process.js.map{"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/main/integrations/child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,GAAG,OAAO,CAAC;gBAC3B,MAAM,IAAI,GAAG,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,wDAAG,QAAQ,CAAC,KAAI,UAAU,CAAC;gBAEhE,wBAAwB;gBACxB,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;oBAC3B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;oBACvE,IAAA,qBAAc,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBAChC;gBAED,iDAAiD;gBACjD,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;oBAChC,IAAA,oBAAa,gCACX,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,eAAe,IACtB,qBAAqB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,KAC9C,IAAI,EAAE,OAAO,IACb,CAAC;iBACJ;YACH,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;;AAtEH,oCAuEC;AAtEC,kBAAkB;AACJ,eAAE,GAAW,cAAc,CAAC","sourcesContent":["import { addBreadcrumb, captureMessage, getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Integration, SeverityLevel } from '@sentry/types';\n\nimport { OrBool } from '../../common/types';\nimport { EXIT_REASONS, ExitReason, onChildProcessGone, onRendererProcessGone } from '../electron-normalize';\nimport { ElectronMainOptions } from '../sdk';\n\ninterface ChildProcessOptions {\n  /** Child process events that generate breadcrumbs */\n  breadcrumbs: Readonly<ExitReason[]>;\n  /** Child process events that generate Sentry events */\n  events: Readonly<ExitReason[]>;\n}\n\nconst DEFAULT_OPTIONS: ChildProcessOptions = {\n  breadcrumbs: EXIT_REASONS,\n  events: ['abnormal-exit', 'launch-failed', 'integrity-failure'],\n};\n\n/** Gets message and severity */\nfunction getMessageAndSeverity(reason: ExitReason, proc?: string): { message: string; level: SeverityLevel } {\n  const message = `'${proc}' process exited with '${reason}'`;\n\n  switch (reason) {\n    case 'abnormal-exit':\n    case 'killed':\n      return { message, level: 'warning' };\n    case 'crashed':\n    case 'oom':\n    case 'launch-failed':\n    case 'integrity-failure':\n      return { message, level: 'fatal' };\n    default:\n      return { message, level: 'debug' };\n  }\n}\n\n/** Adds breadcrumbs for Electron events. */\nexport class ChildProcess implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ChildProcess';\n\n  /** @inheritDoc */\n  public name: string = ChildProcess.id;\n\n  private readonly _options: ChildProcessOptions;\n\n  /**\n   * @param _options Integration options\n   */\n  public constructor(options: Partial<OrBool<ChildProcessOptions>> = {}) {\n    const { breadcrumbs, events } = options;\n    this._options = {\n      breadcrumbs: Array.isArray(breadcrumbs) ? breadcrumbs : breadcrumbs == false ? [] : DEFAULT_OPTIONS.breadcrumbs,\n      events: Array.isArray(events) ? events : events == false ? [] : DEFAULT_OPTIONS.events,\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const { breadcrumbs, events } = this._options;\n    const allReasons = Array.from(new Set([...breadcrumbs, ...events]));\n\n    // only hook these events if we're after more than just the unresponsive event\n    if (allReasons.length > 0) {\n      const options = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptions | undefined;\n\n      onChildProcessGone(allReasons, (details) => {\n        const { reason } = details;\n\n        // Capture message first\n        if (events.includes(reason)) {\n          const { message, level } = getMessageAndSeverity(details.reason, details.type);\n          captureMessage(message, { level, tags: { 'event.process': details.type } });\n        }\n\n        // And then add breadcrumbs for subsequent events\n        if (breadcrumbs.includes(reason)) {\n          addBreadcrumb({\n            type: 'process',\n            category: 'child-process',\n            ...getMessageAndSeverity(details.reason, details.type),\n            data: details,\n          });\n        }\n      });\n\n      onRendererProcessGone(allReasons, (contents, details) => {\n        const { reason } = details;\n        const name = options?.getRendererName?.(contents) || 'renderer';\n\n        // Capture message first\n        if (events.includes(reason)) {\n          const { message, level } = getMessageAndSeverity(details.reason, name);\n          captureMessage(message, level);\n        }\n\n        // And then add breadcrumbs for subsequent events\n        if (breadcrumbs.includes(reason)) {\n          addBreadcrumb({\n            type: 'process',\n            category: 'child-process',\n            ...getMessageAndSeverity(details.reason, name),\n            data: details,\n          });\n        }\n      });\n    }\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** A function that returns true if the named event should create breadcrumbs */
type EventFunction = (name: string) => boolean;
type EventTypes = boolean | string[] | EventFunction | undefined;
interface ElectronBreadcrumbsOptions<T> {
    /**
     * app events
     *
     * default: (name) => !name.startsWith('remote-')
     */
    app: T;
    /**
     * autoUpdater events
     *
     * default: all
     */
    autoUpdater: T;
    /**
     * webContents events
     * default: ['dom-ready', 'context-menu', 'load-url', 'destroyed']
     */
    webContents: T;
    /**
     * BrowserWindow events
     *
     * default: ['closed', 'close', 'unresponsive', 'responsive', 'show', 'blur', 'focus', 'hide',
     *            'maximize', 'minimize', 'restore', 'enter-full-screen', 'leave-full-screen' ]
     */
    browserWindow: T;
    /**
     * screen events
     *
     * default: all
     */
    screen: T;
    /**
     * powerMonitor events
     *
     * default: all
     */
    powerMonitor: T;
    /**
     * Whether to capture window titles with webContents/browserWindow breadcrumbs
     *
     * default: false
     */
    captureWindowTitles: boolean;
}
/** Converts all user supplied options to function | false */
export declare function normalizeOptions(options: Partial<ElectronBreadcrumbsOptions<EventTypes>>): Partial<ElectronBreadcrumbsOptions<EventFunction | false>>;
/** Adds breadcrumbs for Electron events. */
export declare class ElectronBreadcrumbs implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /**
     * @param _options Integration options
     */
    constructor(options?: Partial<ElectronBreadcrumbsOptions<EventTypes>>);
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈
     */
    private _patchEventEmitter;
}
export {};
//# sourceMappingURL=electron-breadcrumbs.d.ts.map{"version":3,"file":"electron-breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/main/integrations/electron-breadcrumbs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,WAAW,EAAE,MAAM,eAAe,CAAC;AAOxD,gFAAgF;AAChF,KAAK,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAC/C,KAAK,UAAU,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,aAAa,GAAG,SAAS,CAAC;AAEjE,UAAU,0BAA0B,CAAC,CAAC;IACpC;;;;OAIG;IACH,GAAG,EAAE,CAAC,CAAC;IACP;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC;IACf;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC;IACf;;;;;OAKG;IACH,aAAa,EAAE,CAAC,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,CAAC,CAAC;IACV;;;;OAIG;IACH,YAAY,EAAE,CAAC,CAAC;IAEhB;;;;OAIG;IACH,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AA4BD,6DAA6D;AAC7D,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,GACvD,OAAO,CAAC,0BAA0B,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,CAe5D;AAED,4CAA4C;AAC5C,qBAAa,mBAAoB,YAAW,WAAW;IACrD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAyB;IAEjD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAA0B;IAE7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoD;IAE7E;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAM;IAIhF,kBAAkB;IACX,SAAS,IAAI,IAAI;IAyCxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CA+B3B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.ElectronBreadcrumbs = exports.normalizeOptions = void 0;
const core_1 = require("@sentry/core");
const electron_1 = require("electron");
const electron_normalize_1 = require("../electron-normalize");
const renderers_1 = require("../renderers");
const DEFAULT_OPTIONS = {
    // We exclude events starting with remote as they can be quite verbose
    app: (name) => !name.startsWith('remote-'),
    autoUpdater: () => true,
    webContents: (name) => ['dom-ready', 'context-menu', 'load-url', 'destroyed'].includes(name),
    browserWindow: (name) => [
        'closed',
        'close',
        'unresponsive',
        'responsive',
        'show',
        'blur',
        'focus',
        'hide',
        'maximize',
        'minimize',
        'restore',
        'enter-full-screen',
        'leave-full-screen',
    ].includes(name),
    screen: () => true,
    powerMonitor: () => true,
    captureWindowTitles: false,
};
/** Converts all user supplied options to function | false */
function normalizeOptions(options) {
    return Object.keys(options).reduce((obj, k) => {
        if (k === 'captureWindowTitles') {
            obj[k] = !!options[k];
        }
        else {
            const val = options[k];
            if (Array.isArray(val)) {
                obj[k] = (name) => val.includes(name);
            }
            else if (typeof val === 'function' || val === false) {
                obj[k] = val;
            }
        }
        return obj;
    }, {});
}
exports.normalizeOptions = normalizeOptions;
/** Adds breadcrumbs for Electron events. */
class ElectronBreadcrumbs {
    /**
     * @param _options Integration options
     */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = ElectronBreadcrumbs.id;
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), normalizeOptions(options));
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const initOptions = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        (0, renderers_1.trackRendererProperties)();
        void electron_normalize_1.whenAppReady.then(() => {
            // We can't access these until app 'ready'
            if (this._options.screen) {
                this._patchEventEmitter(electron_1.screen, 'screen', this._options.screen);
            }
            if (this._options.powerMonitor) {
                this._patchEventEmitter(electron_1.powerMonitor, 'powerMonitor', this._options.powerMonitor);
            }
        });
        if (this._options.app) {
            this._patchEventEmitter(electron_1.app, 'app', this._options.app);
        }
        if (this._options.autoUpdater) {
            this._patchEventEmitter(electron_1.autoUpdater, 'autoUpdater', this._options.autoUpdater);
        }
        if (this._options.browserWindow) {
            (0, electron_normalize_1.onBrowserWindowCreated)((window) => {
                var _a;
                const id = window.webContents.id;
                const windowName = ((_a = initOptions === null || initOptions === void 0 ? void 0 : initOptions.getRendererName) === null || _a === void 0 ? void 0 : _a.call(initOptions, window.webContents)) || 'window';
                this._patchEventEmitter(window, windowName, this._options.browserWindow, id);
            });
        }
        if (this._options.webContents) {
            (0, electron_normalize_1.onWebContentsCreated)((contents) => {
                var _a;
                const id = contents.id;
                const webContentsName = ((_a = initOptions === null || initOptions === void 0 ? void 0 : initOptions.getRendererName) === null || _a === void 0 ? void 0 : _a.call(initOptions, contents)) || 'renderer';
                this._patchEventEmitter(contents, webContentsName, this._options.webContents, id);
            });
        }
    }
    /**
     * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈
     */
    _patchEventEmitter(emitter, category, shouldCapture, id) {
        const emit = emitter.emit.bind(emitter);
        emitter.emit = (event, ...args) => {
            var _a, _b;
            if (shouldCapture && shouldCapture(event)) {
                const breadcrumb = {
                    category: 'electron',
                    message: `${category}.${event}`,
                    timestamp: new Date().getTime() / 1000,
                    type: 'ui',
                };
                if (id) {
                    breadcrumb.data = Object.assign({}, (0, renderers_1.getRendererProperties)(id));
                    if (!this._options.captureWindowTitles && ((_a = breadcrumb.data) === null || _a === void 0 ? void 0 : _a.title)) {
                        (_b = breadcrumb.data) === null || _b === void 0 ? true : delete _b.title;
                    }
                }
                (0, core_1.addBreadcrumb)(breadcrumb);
            }
            return emit(event, ...args);
        };
    }
}
exports.ElectronBreadcrumbs = ElectronBreadcrumbs;
/** @inheritDoc */
ElectronBreadcrumbs.id = 'ElectronBreadcrumbs';
//# sourceMappingURL=electron-breadcrumbs.js.map{"version":3,"file":"electron-breadcrumbs.js","sourceRoot":"","sources":["../../src/main/integrations/electron-breadcrumbs.ts"],"names":[],"mappings":";;AAAA,uCAA4D;AAG5D,uCAA8F;AAE9F,8DAAmG;AACnG,4CAA8E;AAqD9E,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pB,OAAO,EAAE,GAAG,QAAQ,IAAI,KAAK,EAAE;oBAC/B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAK;oBACvC,IAAI,EAAE,IAAI;iBACX,CAAC;gBAEF,IAAI,EAAE,EAAE;oBACN,UAAU,CAAC,IAAI,qBAAQ,IAAA,iCAAqB,EAAC,EAAE,CAAC,CAAE,CAAC;oBAEnD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,KAAI,MAAA,UAAU,CAAC,IAAI,0CAAE,KAAK,CAAA,EAAE;wBACzD,MAAA,UAAU,CAAC,IAAI,+CAAE,KAAK,CAAC;qBAC/B;iBACF;gBAED,IAAA,oBAAa,EAAC,UAAU,CAAC,CAAC;aAC3B;YAED,OAAO,IAAI,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;QAC9B,CAAC,CAAC;IACJ,CAAC;;AA3FH,kDA4FC;AA3FC,kBAAkB;AACJ,sBAAE,GAAW,qBAAqB,CAAC","sourcesContent":["import { addBreadcrumb, getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Breadcrumb, Integration } from '@sentry/types';\nimport { app, autoUpdater, BrowserWindow, powerMonitor, screen, WebContents } from 'electron';\n\nimport { onBrowserWindowCreated, onWebContentsCreated, whenAppReady } from '../electron-normalize';\nimport { getRendererProperties, trackRendererProperties } from '../renderers';\nimport { ElectronMainOptions } from '../sdk';\n\n/** A function that returns true if the named event should create breadcrumbs */\ntype EventFunction = (name: string) => boolean;\ntype EventTypes = boolean | string[] | EventFunction | undefined;\n\ninterface ElectronBreadcrumbsOptions<T> {\n  /**\n   * app events\n   *\n   * default: (name) => !name.startsWith('remote-')\n   */\n  app: T;\n  /**\n   * autoUpdater events\n   *\n   * default: all\n   */\n  autoUpdater: T;\n  /**\n   * webContents events\n   * default: ['dom-ready', 'context-menu', 'load-url', 'destroyed']\n   */\n  webContents: T;\n  /**\n   * BrowserWindow events\n   *\n   * default: ['closed', 'close', 'unresponsive', 'responsive', 'show', 'blur', 'focus', 'hide',\n   *            'maximize', 'minimize', 'restore', 'enter-full-screen', 'leave-full-screen' ]\n   */\n  browserWindow: T;\n  /**\n   * screen events\n   *\n   * default: all\n   */\n  screen: T;\n  /**\n   * powerMonitor events\n   *\n   * default: all\n   */\n  powerMonitor: T;\n\n  /**\n   * Whether to capture window titles with webContents/browserWindow breadcrumbs\n   *\n   * default: false\n   */\n  captureWindowTitles: boolean;\n}\n\nconst DEFAULT_OPTIONS: ElectronBreadcrumbsOptions<EventFunction> = {\n  // We exclude events starting with remote as they can be quite verbose\n  app: (name) => !name.startsWith('remote-'),\n  autoUpdater: () => true,\n  webContents: (name) => ['dom-ready', 'context-menu', 'load-url', 'destroyed'].includes(name),\n  browserWindow: (name) =>\n    [\n      'closed',\n      'close',\n      'unresponsive',\n      'responsive',\n      'show',\n      'blur',\n      'focus',\n      'hide',\n      'maximize',\n      'minimize',\n      'restore',\n      'enter-full-screen',\n      'leave-full-screen',\n    ].includes(name),\n  screen: () => true,\n  powerMonitor: () => true,\n  captureWindowTitles: false,\n};\n\n/** Converts all user supplied options to function | false */\nexport function normalizeOptions(\n  options: Partial<ElectronBreadcrumbsOptions<EventTypes>>,\n): Partial<ElectronBreadcrumbsOptions<EventFunction | false>> {\n  return (Object.keys(options) as (keyof ElectronBreadcrumbsOptions<EventTypes>)[]).reduce((obj, k) => {\n    if (k === 'captureWindowTitles') {\n      obj[k] = !!options[k];\n    } else {\n      const val: EventTypes = options[k];\n      if (Array.isArray(val)) {\n        obj[k] = (name) => val.includes(name);\n      } else if (typeof val === 'function' || val === false) {\n        obj[k] = val;\n      }\n    }\n\n    return obj;\n  }, {} as Partial<ElectronBreadcrumbsOptions<EventFunction | false>>);\n}\n\n/** Adds breadcrumbs for Electron events. */\nexport class ElectronBreadcrumbs implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ElectronBreadcrumbs';\n\n  /** @inheritDoc */\n  public name: string = ElectronBreadcrumbs.id;\n\n  private readonly _options: ElectronBreadcrumbsOptions<EventFunction | false>;\n\n  /**\n   * @param _options Integration options\n   */\n  public constructor(options: Partial<ElectronBreadcrumbsOptions<EventTypes>> = {}) {\n    this._options = { ...DEFAULT_OPTIONS, ...normalizeOptions(options) };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const initOptions = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptions | undefined;\n\n    trackRendererProperties();\n\n    void whenAppReady.then(() => {\n      // We can't access these until app 'ready'\n      if (this._options.screen) {\n        this._patchEventEmitter(screen, 'screen', this._options.screen);\n      }\n\n      if (this._options.powerMonitor) {\n        this._patchEventEmitter(powerMonitor, 'powerMonitor', this._options.powerMonitor);\n      }\n    });\n\n    if (this._options.app) {\n      this._patchEventEmitter(app, 'app', this._options.app);\n    }\n\n    if (this._options.autoUpdater) {\n      this._patchEventEmitter(autoUpdater, 'autoUpdater', this._options.autoUpdater);\n    }\n\n    if (this._options.browserWindow) {\n      onBrowserWindowCreated((window) => {\n        const id = window.webContents.id;\n        const windowName = initOptions?.getRendererName?.(window.webContents) || 'window';\n        this._patchEventEmitter(window, windowName, this._options.browserWindow, id);\n      });\n    }\n\n    if (this._options.webContents) {\n      onWebContentsCreated((contents) => {\n        const id = contents.id;\n        const webContentsName = initOptions?.getRendererName?.(contents) || 'renderer';\n        this._patchEventEmitter(contents, webContentsName, this._options.webContents, id);\n      });\n    }\n  }\n\n  /**\n   * Monkey patches the EventEmitter to capture breadcrumbs for the specified events. 🙈\n   */\n  private _patchEventEmitter(\n    emitter: NodeJS.EventEmitter | WebContents | BrowserWindow,\n    category: string,\n    shouldCapture: EventFunction | undefined | false,\n    id?: number | undefined,\n  ): void {\n    const emit = emitter.emit.bind(emitter) as (event: string, ...args: unknown[]) => boolean;\n\n    emitter.emit = (event: string, ...args: unknown[]) => {\n      if (shouldCapture && shouldCapture(event)) {\n        const breadcrumb: Breadcrumb = {\n          category: 'electron',\n          message: `${category}.${event}`,\n          timestamp: new Date().getTime() / 1_000,\n          type: 'ui',\n        };\n\n        if (id) {\n          breadcrumb.data = { ...getRendererProperties(id) };\n\n          if (!this._options.captureWindowTitles && breadcrumb.data?.title) {\n            delete breadcrumb.data?.title;\n          }\n        }\n\n        addBreadcrumb(breadcrumb);\n      }\n\n      return emit(event, ...args);\n    };\n  }\n}\n"]}import { Integration } from '@sentry/types';
/**
 * Returns the minidump endpoint in Sentry
 * @param dsn Dsn
 */
export declare function minidumpUrlFromDsn(dsn: string): string;
/** Sends minidumps via the Electron built-in uploader. */
export declare class ElectronMinidump implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** Counter used to ensure no race condition when updating extra params */
    private _updateEpoch;
    private _customRelease;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Starts the native crash reporter
     */
    private _startCrashReporter;
    /**
     * Adds a scope listener to persist changes to disk.
     */
    private _setupScopeListener;
    /** Updates Electron uploader extra params */
    private _updateExtraParams;
    /** Builds up an event to send with the native Electron uploader */
    private _getNativeUploaderEvent;
    /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader
     *
     * Returns chunks with keys and values:
     * {
     *    sentry__1: '{ json...',
     *    sentry__2: 'more json...',
     *    sentry__x: 'end json }',
     * }
     */
    private _getNativeUploaderExtraParams;
}
//# sourceMappingURL=electron-minidump.d.ts.map{"version":3,"file":"electron-minidump.d.ts","sourceRoot":"","sources":["../../src/main/integrations/electron-minidump.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAsCnD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKtD;AAED,0DAA0D;AAC1D,qBAAa,gBAAiB,YAAW,WAAW;IAClD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAuB;IAE1C,0EAA0E;IAC1E,OAAO,CAAC,YAAY,CAAa;IAEjC,OAAO,CAAC,cAAc,CAAqB;IAE3C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAuCxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAe3B,6CAA6C;IAC7C,OAAO,CAAC,kBAAkB;IAiB1B,mEAAmE;YACrD,uBAAuB;IAgBrC;;;;;;;;OAQG;IACH,OAAO,CAAC,6BAA6B;CA8BtC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.ElectronMinidump = exports.minidumpUrlFromDsn = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const common_1 = require("../../common");
const context_1 = require("../context");
const electron_normalize_1 = require("../electron-normalize");
const sessions_1 = require("../sessions");
/** Is object defined and has keys */
function hasKeys(obj) {
    return obj != undefined && Object.keys(obj).length > 0;
}
/** Gets a Scope object with user, tags and extra */
function getScope(options) {
    const scope = (0, core_1.getCurrentHub)().getScope();
    if (!scope) {
        return {};
    }
    return Object.assign(Object.assign(Object.assign({ release: options.release, environment: options.environment }, (hasKeys(scope._user) && { user: scope._user })), (hasKeys(scope._tags) && { tags: scope._tags })), (hasKeys(scope._extra) && { extra: scope._extra }));
}
/**
 * Returns the minidump endpoint in Sentry
 * @param dsn Dsn
 */
function minidumpUrlFromDsn(dsn) {
    const { host, path, projectId, port, protocol, publicKey } = (0, utils_1.makeDsn)(dsn);
    return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${path !== '' ? `/${path}` : ''}/api/${projectId}/minidump/?sentry_key=${publicKey}`;
}
exports.minidumpUrlFromDsn = minidumpUrlFromDsn;
/** Sends minidumps via the Electron built-in uploader. */
class ElectronMinidump {
    constructor() {
        /** @inheritDoc */
        this.name = ElectronMinidump.id;
        /** Counter used to ensure no race condition when updating extra params */
        this._updateEpoch = 0;
    }
    /** @inheritDoc */
    setupOnce() {
        var _a, _b;
        // Mac AppStore builds cannot run the crash reporter due to the sandboxing
        // requirements. In this case, we prevent enabling native crashes entirely.
        // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build
        if (process.mas) {
            return;
        }
        if ((0, electron_normalize_1.rendererRequiresCrashReporterStart)()) {
            throw new utils_1.SentryError(`The '${this.name}' integration is only supported with Electron >= v9`);
        }
        const options = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        if (!(options === null || options === void 0 ? void 0 : options.dsn)) {
            throw new utils_1.SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');
        }
        this._customRelease = options.release;
        this._startCrashReporter(options);
        // If a renderer process crashes, mark any existing session as crashed
        (0, electron_normalize_1.onRendererProcessGone)(electron_normalize_1.CRASH_REASONS, (_, __) => {
            (0, sessions_1.sessionCrashed)();
        });
        // If we're using the Crashpad minidump uploader, we set extra parameters whenever the scope updates
        if ((0, electron_normalize_1.usesCrashpad)()) {
            this._setupScopeListener();
        }
        // Check if last crash report was likely to have been unreported in the last session
        void (0, sessions_1.unreportedDuringLastSession)((_b = electron_1.crashReporter.getLastCrashReport()) === null || _b === void 0 ? void 0 : _b.date).then((crashed) => {
            // Check if a previous session was not closed
            (0, sessions_1.checkPreviousSession)(crashed).catch((error) => utils_1.logger.error(error));
        });
    }
    /**
     * Starts the native crash reporter
     */
    _startCrashReporter(options) {
        // We don't add globalExtra when Breakpad is in use because it doesn't support JSON like strings:
        // https://github.com/electron/electron/issues/29711
        const globalExtra = (0, electron_normalize_1.usesCrashpad)() ? { sentry___initialScope: JSON.stringify(getScope(options)) } : undefined;
        utils_1.logger.log('Starting Electron crashReporter');
        electron_1.crashReporter.start({
            companyName: '',
            ignoreSystemCrashHandler: true,
            productName: electron_1.app.name || electron_1.app.getName(),
            submitURL: minidumpUrlFromDsn(options.dsn || ''),
            uploadToServer: true,
            compress: true,
            globalExtra,
        });
    }
    /**
     * Adds a scope listener to persist changes to disk.
     */
    _setupScopeListener() {
        const hubScope = (0, core_1.getCurrentHub)().getScope();
        if (hubScope) {
            hubScope.addScopeListener((updatedScope) => {
                const scope = core_1.Scope.clone(updatedScope);
                /* eslint-disable @typescript-eslint/no-unsafe-member-access */
                scope._eventProcessors = [];
                scope._scopeListeners = [];
                /* eslint-enable @typescript-eslint/no-unsafe-member-access */
                this._updateExtraParams(scope);
            });
        }
    }
    /** Updates Electron uploader extra params */
    _updateExtraParams(scope) {
        this._updateEpoch += 1;
        const currentEpoch = this._updateEpoch;
        this._getNativeUploaderEvent(scope)
            .then((event) => {
            if (currentEpoch !== this._updateEpoch)
                return;
            // Update the extra parameters in the main process
            const mainParams = this._getNativeUploaderExtraParams(event);
            for (const key of Object.keys(mainParams)) {
                electron_1.crashReporter.addExtraParameter(key, mainParams[key]);
            }
        })
            .catch((error) => utils_1.logger.error(error));
    }
    /** Builds up an event to send with the native Electron uploader */
    _getNativeUploaderEvent(scope) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const event = (0, common_1.mergeEvents)(yield (0, context_1.getEventDefaults)(this._customRelease), {
                level: 'fatal',
                platform: 'native',
                tags: { 'event.environment': 'native', event_type: 'native' },
            });
            // Apply the scope to the event
            yield scope.applyToEvent(event);
            delete event.sdkProcessingMetadata;
            // Normalise paths
            return (0, common_1.normalizeEvent)(event, electron_1.app.getAppPath());
        });
    }
    /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader
     *
     * Returns chunks with keys and values:
     * {
     *    sentry__1: '{ json...',
     *    sentry__2: 'more json...',
     *    sentry__x: 'end json }',
     * }
     */
    _getNativeUploaderExtraParams(event) {
        const maxBytes = 20300;
        /** Max chunk sizes are in bytes so we can't chunk by characters or UTF8 could bite us.
         *
         * We attempt to split by space (32) and double quote characters (34) as there are plenty in JSON
         * and they are guaranteed to not be the first byte of a multi-byte UTF8 character.
         */
        let buf = Buffer.from(JSON.stringify(event));
        const chunks = [];
        while (buf.length) {
            // Find last '"'
            let i = buf.lastIndexOf(34, maxBytes + 1);
            // Or find last ' '
            if (i < 0)
                i = buf.lastIndexOf(32, maxBytes + 1);
            // Or find first '"'
            if (i < 0)
                i = buf.indexOf(34, maxBytes);
            // Or find first ' '
            if (i < 0)
                i = buf.indexOf(32, maxBytes);
            // We couldn't find any space or quote chars so split at maxBytes and hope for the best 🤷‍♂️
            if (i < 0)
                i = maxBytes;
            chunks.push(buf.subarray(0, i + 1).toString());
            buf = buf.subarray(i + 1);
        }
        return chunks.reduce((acc, cur, i) => {
            acc[`sentry__${i + 1}`] = cur;
            return acc;
        }, {});
    }
}
exports.ElectronMinidump = ElectronMinidump;
/** @inheritDoc */
ElectronMinidump.id = 'ElectronMinidump';
//# sourceMappingURL=electron-minidump.js.map{"version":3,"file":"electron-minidump.js","sourceRoot":"","sources":["../../src/main/integrations/electron-minidump.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAGpD,yCAA6D;AAC7D,uCAA8C;AAE9C,yCAA2D;AAC3D,wCAA8C;AAC9C,8DAK+B;AAC/B,0CAAgG;AAEhG,qCAAqC;AACrC,SAAS,OAAO,CAAC,GAAQ;IACvB,OAAO,GAAG,IAAI,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACzD,CAAC;AAED,oDAAoD;AACpD,SAAS,QAAQ,CAAC,OAAoB;IACpC,MAAM,KAAK,GAAG,IAAA,oBAAa,GAAE,CAAC,QAAQ,EAAqB,CAAC;IAE5D,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,EAAE,CAAC;KACX;IAED,mDACE,OAAO,EAAE,OAAO,CAAC,OAAO,EACxB,WAAW,EAAE,OAAO,CAAC,WAAW,IAE7B,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,GAC/C,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAA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C,GAAG,QAAQ,CAAC;YACxB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC/C,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3B;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE;YACnC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;YAC9B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAA+B,CAAC,CAAC;IACtC,CAAC;;AApKH,4CAqKC;AApKC,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC","sourcesContent":["import { getCurrentHub, Scope } from '@sentry/core';\nimport { NodeClient, NodeOptions } from '@sentry/node';\nimport { Event, Integration } from '@sentry/types';\nimport { logger, makeDsn, SentryError } from '@sentry/utils';\nimport { app, crashReporter } from 'electron';\n\nimport { mergeEvents, normalizeEvent } from '../../common';\nimport { getEventDefaults } from '../context';\nimport {\n  CRASH_REASONS,\n  onRendererProcessGone,\n  rendererRequiresCrashReporterStart,\n  usesCrashpad,\n} from '../electron-normalize';\nimport { checkPreviousSession, sessionCrashed, unreportedDuringLastSession } from '../sessions';\n\n/** Is object defined and has keys */\nfunction hasKeys(obj: any): boolean {\n  return obj != undefined && Object.keys(obj).length > 0;\n}\n\n/** Gets a Scope object with user, tags and extra */\nfunction getScope(options: NodeOptions): Event {\n  const scope = getCurrentHub().getScope() as any | undefined;\n\n  if (!scope) {\n    return {};\n  }\n\n  return {\n    release: options.release,\n    environment: options.environment,\n    /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n    ...(hasKeys(scope._user) && { user: scope._user }),\n    ...(hasKeys(scope._tags) && { tags: scope._tags }),\n    ...(hasKeys(scope._extra) && { extra: scope._extra }),\n    /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  };\n}\n\n/**\n * Returns the minidump endpoint in Sentry\n * @param dsn Dsn\n */\nexport function minidumpUrlFromDsn(dsn: string): string {\n  const { host, path, projectId, port, protocol, publicKey } = makeDsn(dsn);\n  return `${protocol}://${host}${port !== '' ? `:${port}` : ''}${\n    path !== '' ? `/${path}` : ''\n  }/api/${projectId}/minidump/?sentry_key=${publicKey}`;\n}\n\n/** Sends minidumps via the Electron built-in uploader. */\nexport class ElectronMinidump implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ElectronMinidump';\n\n  /** @inheritDoc */\n  public name: string = ElectronMinidump.id;\n\n  /** Counter used to ensure no race condition when updating extra params */\n  private _updateEpoch: number = 0;\n\n  private _customRelease: string | undefined;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // Mac AppStore builds cannot run the crash reporter due to the sandboxing\n    // requirements. In this case, we prevent enabling native crashes entirely.\n    // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build\n    if (process.mas) {\n      return;\n    }\n\n    if (rendererRequiresCrashReporterStart()) {\n      throw new SentryError(`The '${this.name}' integration is only supported with Electron >= v9`);\n    }\n\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    if (!options?.dsn) {\n      throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');\n    }\n\n    this._customRelease = options.release;\n\n    this._startCrashReporter(options);\n\n    // If a renderer process crashes, mark any existing session as crashed\n    onRendererProcessGone(CRASH_REASONS, (_, __) => {\n      sessionCrashed();\n    });\n\n    // If we're using the Crashpad minidump uploader, we set extra parameters whenever the scope updates\n    if (usesCrashpad()) {\n      this._setupScopeListener();\n    }\n\n    // Check if last crash report was likely to have been unreported in the last session\n    void unreportedDuringLastSession(crashReporter.getLastCrashReport()?.date).then((crashed) => {\n      // Check if a previous session was not closed\n      checkPreviousSession(crashed).catch((error) => logger.error(error));\n    });\n  }\n\n  /**\n   * Starts the native crash reporter\n   */\n  private _startCrashReporter(options: NodeOptions): void {\n    // We don't add globalExtra when Breakpad is in use because it doesn't support JSON like strings:\n    // https://github.com/electron/electron/issues/29711\n    const globalExtra = usesCrashpad() ? { sentry___initialScope: JSON.stringify(getScope(options)) } : undefined;\n\n    logger.log('Starting Electron crashReporter');\n\n    crashReporter.start({\n      companyName: '',\n      ignoreSystemCrashHandler: true,\n      productName: app.name || app.getName(),\n      submitURL: minidumpUrlFromDsn(options.dsn || ''),\n      uploadToServer: true,\n      compress: true,\n      globalExtra,\n    });\n  }\n\n  /**\n   * Adds a scope listener to persist changes to disk.\n   */\n  private _setupScopeListener(): void {\n    const hubScope = getCurrentHub().getScope();\n    if (hubScope) {\n      hubScope.addScopeListener((updatedScope) => {\n        const scope = Scope.clone(updatedScope);\n        /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n        (scope as any)._eventProcessors = [];\n        (scope as any)._scopeListeners = [];\n        /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n\n        this._updateExtraParams(scope);\n      });\n    }\n  }\n\n  /** Updates Electron uploader extra params */\n  private _updateExtraParams(scope: Scope): void {\n    this._updateEpoch += 1;\n    const currentEpoch = this._updateEpoch;\n\n    this._getNativeUploaderEvent(scope)\n      .then((event) => {\n        if (currentEpoch !== this._updateEpoch) return;\n\n        // Update the extra parameters in the main process\n        const mainParams = this._getNativeUploaderExtraParams(event);\n        for (const key of Object.keys(mainParams)) {\n          crashReporter.addExtraParameter(key, mainParams[key]);\n        }\n      })\n      .catch((error) => logger.error(error));\n  }\n\n  /** Builds up an event to send with the native Electron uploader */\n  private async _getNativeUploaderEvent(scope: Scope): Promise<Event> {\n    const event = mergeEvents(await getEventDefaults(this._customRelease), {\n      level: 'fatal',\n      platform: 'native',\n      tags: { 'event.environment': 'native', event_type: 'native' },\n    });\n\n    // Apply the scope to the event\n    await scope.applyToEvent(event);\n\n    delete event.sdkProcessingMetadata;\n\n    // Normalise paths\n    return normalizeEvent(event, app.getAppPath());\n  }\n\n  /** Chunks up event JSON into 1 or more parameters for use with the native Electron uploader\n   *\n   * Returns chunks with keys and values:\n   * {\n   *    sentry__1: '{ json...',\n   *    sentry__2: 'more json...',\n   *    sentry__x: 'end json }',\n   * }\n   */\n  private _getNativeUploaderExtraParams(event: Event): { [key: string]: string } {\n    const maxBytes = 20300;\n\n    /** Max chunk sizes are in bytes so we can't chunk by characters or UTF8 could bite us.\n     *\n     * We attempt to split by space (32) and double quote characters (34) as there are plenty in JSON\n     * and they are guaranteed to not be the first byte of a multi-byte UTF8 character.\n     */\n    let buf = Buffer.from(JSON.stringify(event));\n    const chunks = [];\n    while (buf.length) {\n      // Find last '\"'\n      let i = buf.lastIndexOf(34, maxBytes + 1);\n      // Or find last ' '\n      if (i < 0) i = buf.lastIndexOf(32, maxBytes + 1);\n      // Or find first '\"'\n      if (i < 0) i = buf.indexOf(34, maxBytes);\n      // Or find first ' '\n      if (i < 0) i = buf.indexOf(32, maxBytes);\n      // We couldn't find any space or quote chars so split at maxBytes and hope for the best 🤷‍♂️\n      if (i < 0) i = maxBytes;\n      chunks.push(buf.subarray(0, i + 1).toString());\n      buf = buf.subarray(i + 1);\n    }\n\n    return chunks.reduce((acc, cur, i) => {\n      acc[`sentry__${i + 1}`] = cur;\n      return acc;\n    }, {} as { [key: string]: string });\n  }\n}\n"]}export { ElectronBreadcrumbs } from './electron-breadcrumbs';
export { OnUncaughtException } from './onuncaughtexception';
export { MainContext } from './main-context';
export { SentryMinidump } from './sentry-minidump';
export { ElectronMinidump } from './electron-minidump';
export { PreloadInjection } from './preload-injection';
export { MainProcessSession } from './main-process-session';
export { AdditionalContext } from './additional-context';
export { Net } from './net-breadcrumbs';
export { ChildProcess } from './child-process';
export { Screenshots } from './screenshots';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/main/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.Screenshots = exports.ChildProcess = exports.Net = exports.AdditionalContext = exports.MainProcessSession = exports.PreloadInjection = exports.ElectronMinidump = exports.SentryMinidump = exports.MainContext = exports.OnUncaughtException = exports.ElectronBreadcrumbs = void 0;
var electron_breadcrumbs_1 = require("./electron-breadcrumbs");
Object.defineProperty(exports, "ElectronBreadcrumbs", { enumerable: true, get: function () { return electron_breadcrumbs_1.ElectronBreadcrumbs; } });
var onuncaughtexception_1 = require("./onuncaughtexception");
Object.defineProperty(exports, "OnUncaughtException", { enumerable: true, get: function () { return onuncaughtexception_1.OnUncaughtException; } });
var main_context_1 = require("./main-context");
Object.defineProperty(exports, "MainContext", { enumerable: true, get: function () { return main_context_1.MainContext; } });
var sentry_minidump_1 = require("./sentry-minidump");
Object.defineProperty(exports, "SentryMinidump", { enumerable: true, get: function () { return sentry_minidump_1.SentryMinidump; } });
var electron_minidump_1 = require("./electron-minidump");
Object.defineProperty(exports, "ElectronMinidump", { enumerable: true, get: function () { return electron_minidump_1.ElectronMinidump; } });
var preload_injection_1 = require("./preload-injection");
Object.defineProperty(exports, "PreloadInjection", { enumerable: true, get: function () { return preload_injection_1.PreloadInjection; } });
var main_process_session_1 = require("./main-process-session");
Object.defineProperty(exports, "MainProcessSession", { enumerable: true, get: function () { return main_process_session_1.MainProcessSession; } });
var additional_context_1 = require("./additional-context");
Object.defineProperty(exports, "AdditionalContext", { enumerable: true, get: function () { return additional_context_1.AdditionalContext; } });
var net_breadcrumbs_1 = require("./net-breadcrumbs");
Object.defineProperty(exports, "Net", { enumerable: true, get: function () { return net_breadcrumbs_1.Net; } });
var child_process_1 = require("./child-process");
Object.defineProperty(exports, "ChildProcess", { enumerable: true, get: function () { return child_process_1.ChildProcess; } });
var screenshots_1 = require("./screenshots");
Object.defineProperty(exports, "Screenshots", { enumerable: true, get: function () { return screenshots_1.Screenshots; } });
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/main/integrations/index.ts"],"names":[],"mappings":";;AAAA,+DAA6D;AAApD,2HAAA,mBAAmB,OAAA;AAC5B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,qDAAwC;AAA/B,sGAAA,GAAG,OAAA;AACZ,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AACrB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA","sourcesContent":["export { ElectronBreadcrumbs } from './electron-breadcrumbs';\nexport { OnUncaughtException } from './onuncaughtexception';\nexport { MainContext } from './main-context';\nexport { SentryMinidump } from './sentry-minidump';\nexport { ElectronMinidump } from './electron-minidump';\nexport { PreloadInjection } from './preload-injection';\nexport { MainProcessSession } from './main-process-session';\nexport { AdditionalContext } from './additional-context';\nexport { Net } from './net-breadcrumbs';\nexport { ChildProcess } from './child-process';\nexport { Screenshots } from './screenshots';\n"]}import { EventProcessor, Integration } from '@sentry/types';
/** Adds Electron context to events and normalises paths. */
export declare class MainContext implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=main-context.d.ts.map{"version":3,"file":"main-context.d.ts","sourceRoot":"","sources":["../../src/main/integrations/main-context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMnE,4DAA4D;AAC5D,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CASpF"}Object.defineProperty(exports, "__esModule", { value: true });
exports.MainContext = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const electron_1 = require("electron");
const common_1 = require("../../common");
const context_1 = require("../context");
/** Adds Electron context to events and normalises paths. */
class MainContext {
    constructor() {
        /** @inheritDoc */
        this.name = MainContext.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        var _a;
        const options = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        addGlobalEventProcessor((event) => tslib_1.__awaiter(this, void 0, void 0, function* () {
            const normalized = (0, common_1.normalizeEvent)(event, electron_1.app.getAppPath());
            const defaults = yield (0, context_1.getEventDefaults)(options === null || options === void 0 ? void 0 : options.release, options === null || options === void 0 ? void 0 : options.environment);
            return (0, common_1.mergeEvents)(defaults, normalized);
        }));
    }
}
exports.MainContext = MainContext;
/** @inheritDoc */
MainContext.id = 'MainContext';
//# sourceMappingURL=main-context.js.map{"version":3,"file":"main-context.js","sourceRoot":"","sources":["../../src/main/integrations/main-context.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAG7C,uCAA+B;AAE/B,yCAA2D;AAC3D,wCAA8C;AAE9C,4DAA4D;AAC5D,MAAa,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAYvC,CAAC;IAVC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;;QAC1E,MAAM,OAAO,GAAG,MAAA,IAAA,oBAAa,GAAE,CAAC,SAAS,EAAc,0CAAE,UAAU,EAAE,CAAC;QAEtE,uBAAuB,CAAC,CAAO,KAAY,EAAE,EAAE;YAC7C,MAAM,UAAU,GAAG,IAAA,uBAAc,EAAC,KAAK,EAAE,cAAG,CAAC,UAAU,EAAE,CAAC,CAAC;YAC3D,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAgB,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,CAAC;YAChF,OAAO,IAAA,oBAAW,EAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC3C,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;;AAhBH,kCAiBC;AAhBC,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Event, EventProcessor, Integration } from '@sentry/types';\nimport { app } from 'electron';\n\nimport { mergeEvents, normalizeEvent } from '../../common';\nimport { getEventDefaults } from '../context';\n\n/** Adds Electron context to events and normalises paths. */\nexport class MainContext implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'MainContext';\n\n  /** @inheritDoc */\n  public name: string = MainContext.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    addGlobalEventProcessor(async (event: Event) => {\n      const normalized = normalizeEvent(event, app.getAppPath());\n      const defaults = await getEventDefaults(options?.release, options?.environment);\n      return mergeEvents(defaults, normalized);\n    });\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** Tracks sessions as the main process lifetime. */
export declare class MainProcessSession implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Hooks 'will-quit' and ensures the handler is always last
     */
    private _ensureExitHandlerLast;
    /** Handles the exit */
    private _exitHandler;
}
//# sourceMappingURL=main-process-session.d.ts.map{"version":3,"file":"main-process-session.d.ts","sourceRoot":"","sources":["../../src/main/integrations/main-process-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,oDAAoD;AACpD,qBAAa,kBAAmB,YAAW,WAAW;IACpD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAwB;IAEhD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAyB;IAE5C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAgBxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAK9B,uBAAuB;IACvB,OAAO,CAAC,YAAY,CAmBlB;CACH"}Object.defineProperty(exports, "__esModule", { value: true });
exports.MainProcessSession = void 0;
const tslib_1 = require("tslib");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const sessions_1 = require("../sessions");
/** Tracks sessions as the main process lifetime. */
class MainProcessSession {
    constructor() {
        /** @inheritDoc */
        this.name = MainProcessSession.id;
        /** Handles the exit */
        this._exitHandler = (event) => tslib_1.__awaiter(this, void 0, void 0, function* () {
            if (event.defaultPrevented) {
                return;
            }
            utils_1.logger.log('[MainProcessSession] Exit Handler');
            // Stop the exit so we have time to send the session
            event.preventDefault();
            try {
                // End the session
                yield (0, sessions_1.endSession)();
            }
            catch (e) {
                // Ignore and log any errors which would prevent app exit
                utils_1.logger.warn('[MainProcessSession] Error ending session:', e);
            }
            electron_1.app.exit();
        });
    }
    /** @inheritDoc */
    setupOnce() {
        void (0, sessions_1.startSession)();
        // We track sessions via the 'will-quit' event which is the last event emitted before close.
        //
        // We need to be the last 'will-quit' listener so as not to interfere with any user defined listeners which may
        // call `event.preventDefault()`.
        this._ensureExitHandlerLast();
        // 'before-quit' is always called before 'will-quit' so we listen there and ensure our 'will-quit' handler is still
        // the last listener
        electron_1.app.on('before-quit', () => {
            this._ensureExitHandlerLast();
        });
    }
    /**
     * Hooks 'will-quit' and ensures the handler is always last
     */
    _ensureExitHandlerLast() {
        electron_1.app.removeListener('will-quit', this._exitHandler);
        electron_1.app.on('will-quit', this._exitHandler);
    }
}
exports.MainProcessSession = MainProcessSession;
/** @inheritDoc */
MainProcessSession.id = 'MainProcessSession';
//# sourceMappingURL=main-process-session.js.map{"version":3,"file":"main-process-session.js","sourceRoot":"","sources":["../../src/main/integrations/main-process-session.ts"],"names":[],"mappings":";;;AACA,yCAAuC;AACvC,uCAA+B;AAE/B,0CAAuD;AAEvD,oDAAoD;AACpD,MAAa,kBAAkB;IAA/B;QAIE,kBAAkB;QACX,SAAI,GAAW,kBAAkB,CAAC,EAAE,CAAC;QA2B5C,uBAAuB;QACf,iBAAY,GAA6C,CAAO,KAAqB,EAAE,EAAE;YAC/F,IAAI,KAAK,CAAC,gBAAgB,EAAE;gBAC1B,OAAO;aACR;YAED,cAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;YAEhD,oDAAoD;YACpD,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvB,IAAI;gBACF,kBAAkB;gBAClB,MAAM,IAAA,qBAAU,GAAE,CAAC;aACpB;YAAC,OAAO,CAAC,EAAE;gBACV,yDAAyD;gBACzD,cAAM,CAAC,IAAI,CAAC,4CAA4C,EAAE,CAAC,CAAC,CAAC;aAC9D;YAED,cAAG,CAAC,IAAI,EAAE,CAAC;QACb,CAAC,CAAA,CAAC;IACJ,CAAC;IA9CC,kBAAkB;IACX,SAAS;QACd,KAAK,IAAA,uBAAY,GAAE,CAAC;QAEpB,4FAA4F;QAC5F,EAAE;QACF,+GAA+G;QAC/G,iCAAiC;QACjC,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAE9B,mHAAmH;QACnH,oBAAoB;QACpB,cAAG,CAAC,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;YACzB,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,sBAAsB;QAC5B,cAAG,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACnD,cAAG,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;;AA9BH,gDAqDC;AApDC,kBAAkB;AACJ,qBAAE,GAAW,oBAAoB,CAAC","sourcesContent":["import { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { app } from 'electron';\n\nimport { endSession, startSession } from '../sessions';\n\n/** Tracks sessions as the main process lifetime. */\nexport class MainProcessSession implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'MainProcessSession';\n\n  /** @inheritDoc */\n  public name: string = MainProcessSession.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    void startSession();\n\n    // We track sessions via the 'will-quit' event which is the last event emitted before close.\n    //\n    // We need to be the last 'will-quit' listener so as not to interfere with any user defined listeners which may\n    // call `event.preventDefault()`.\n    this._ensureExitHandlerLast();\n\n    // 'before-quit' is always called before 'will-quit' so we listen there and ensure our 'will-quit' handler is still\n    // the last listener\n    app.on('before-quit', () => {\n      this._ensureExitHandlerLast();\n    });\n  }\n\n  /**\n   * Hooks 'will-quit' and ensures the handler is always last\n   */\n  private _ensureExitHandlerLast(): void {\n    app.removeListener('will-quit', this._exitHandler);\n    app.on('will-quit', this._exitHandler);\n  }\n\n  /** Handles the exit */\n  private _exitHandler: (event: Electron.Event) => Promise<void> = async (event: Electron.Event) => {\n    if (event.defaultPrevented) {\n      return;\n    }\n\n    logger.log('[MainProcessSession] Exit Handler');\n\n    // Stop the exit so we have time to send the session\n    event.preventDefault();\n\n    try {\n      // End the session\n      await endSession();\n    } catch (e) {\n      // Ignore and log any errors which would prevent app exit\n      logger.warn('[MainProcessSession] Error ending session:', e);\n    }\n\n    app.exit();\n  };\n}\n"]}import { Integration } from '@sentry/types';
import { OrBool, OrFalse } from '../../common/types';
type ShouldTraceFn = (method: string, url: string) => boolean;
interface NetOptions {
    /**
     * Whether breadcrumbs should be captured for net requests
     *
     * Defaults to: true
     */
    breadcrumbs: boolean;
    /**
     * Whether to capture transaction spans for net requests
     *
     * true | false | (method: string, url: string) => boolean
     * Defaults to: true
     */
    tracing: ShouldTraceFn;
    /**
     * Whether to add 'sentry-trace' headers to outgoing requests
     *
     * true | false | (method: string, url: string) => boolean
     * Defaults to: true
     */
    tracingOrigins: ShouldTraceFn;
}
/** Converts all user supplied options to T | false */
export declare function normalizeOptions(options: Partial<OrBool<NetOptions>>): Partial<OrFalse<NetOptions>>;
/** http module integration */
export declare class Net implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    private readonly _options;
    /** @inheritDoc */
    constructor(options?: Partial<OrBool<NetOptions>>);
    /** @inheritDoc */
    setupOnce(): void;
}
export {};
//# sourceMappingURL=net-breadcrumbs.d.ts.map{"version":3,"file":"net-breadcrumbs.d.ts","sourceRoot":"","sources":["../../src/main/integrations/net-breadcrumbs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAQ,MAAM,eAAe,CAAC;AAKlD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAE9D,UAAU,UAAU;IAClB;;;;OAIG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;OAKG;IACH,cAAc,EAAE,aAAa,CAAC;CAC/B;AAQD,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAOnG;AAED,8BAA8B;AAC9B,qBAAa,GAAI,YAAW,WAAW;IACrC,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAS;IAEjC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAU;IAE7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C,kBAAkB;gBACC,OAAO,GAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAM;IAO5D,kBAAkB;IACX,SAAS,IAAI,IAAI;CAMzB"}Object.defineProperty(exports, "__esModule", { value: true });
exports.Net = exports.normalizeOptions = void 0;
const tslib_1 = require("tslib");
/* eslint-disable deprecation/deprecation */
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const urlModule = tslib_1.__importStar(require("url"));
const DEFAULT_OPTIONS = {
    breadcrumbs: true,
    tracing: (_method, _url) => true,
    tracingOrigins: (_method, _url) => true,
};
/** Converts all user supplied options to T | false */
function normalizeOptions(options) {
    return Object.keys(options).reduce((obj, k) => {
        if (typeof options[k] === 'function' || options[k] === false) {
            obj[k] = options[k];
        }
        return obj;
    }, {});
}
exports.normalizeOptions = normalizeOptions;
/** http module integration */
class Net {
    /** @inheritDoc */
    constructor(options = {}) {
        /** @inheritDoc */
        this.name = Net.id;
        this._options = Object.assign(Object.assign({}, DEFAULT_OPTIONS), normalizeOptions(options));
    }
    /** @inheritDoc */
    setupOnce() {
        // No need to instrument if we don't want to track anything
        if (this._options.breadcrumbs || this._options.tracing) {
            (0, utils_1.fill)(electron_1.net, 'request', createWrappedRequestFactory(this._options));
        }
    }
}
exports.Net = Net;
/** @inheritDoc */
Net.id = 'Net';
/**
 * Trimmed down version of the code from Electron here:
 * https://github.com/electron/electron/blob/f3df76dbdc58cb704637b89357e1400791c92cfe/lib/browser/api/net.ts#L209-L269
 *
 * We want to match the final URL that Electron uses
 */
function parseOptions(optionsIn) {
    const { method, options } = typeof optionsIn === 'string'
        ? { method: 'GET', options: urlModule.parse(optionsIn) }
        : { method: (optionsIn.method || 'GET').toUpperCase(), options: optionsIn };
    let url = 'url' in options ? options.url : undefined;
    if (!url) {
        const urlObj = {};
        urlObj.protocol = options.protocol || 'http:';
        if (options.host) {
            urlObj.host = options.host;
        }
        else {
            if (options.hostname) {
                urlObj.hostname = options.hostname;
            }
            else {
                urlObj.hostname = 'localhost';
            }
            if (options.port) {
                urlObj.port = options.port;
            }
        }
        const pathObj = urlModule.parse(options.path || '/');
        urlObj.pathname = pathObj.pathname;
        urlObj.search = pathObj.search;
        urlObj.hash = pathObj.hash;
        url = urlModule.format(urlObj);
    }
    return {
        method,
        url,
    };
}
/** */
function createWrappedRequestFactory(options) {
    return function wrappedRequestMethodFactory(originalRequestMethod) {
        return function requestMethod(reqOptions) {
            // eslint-disable-next-line @typescript-eslint/no-this-alias
            const netModule = this;
            const { url, method } = parseOptions(reqOptions);
            const request = originalRequestMethod.apply(netModule, [reqOptions]);
            if (url.match(/sentry_key/) || request.getHeader('x-sentry-auth')) {
                return request;
            }
            let span;
            const scope = (0, core_1.getCurrentHub)().getScope();
            if (scope && options.tracing && options.tracing(method, url)) {
                const parentSpan = scope.getSpan();
                if (parentSpan) {
                    span = parentSpan.startChild({
                        description: `${method} ${url}`,
                        op: 'http.client',
                    });
                    if (options.tracingOrigins && options.tracingOrigins(method, url)) {
                        request.setHeader('sentry-trace', span.toTraceparent());
                    }
                }
            }
            return request
                .once('response', function (res) {
                // eslint-disable-next-line @typescript-eslint/no-this-alias
                const req = this;
                if (options.breadcrumbs) {
                    addRequestBreadcrumb('response', method, url, req, res);
                }
                if (span) {
                    if (res.statusCode) {
                        span.setHttpStatus(res.statusCode);
                    }
                    span.finish();
                }
            })
                .once('error', function (_error) {
                // eslint-disable-next-line @typescript-eslint/no-this-alias
                const req = this;
                if (options.breadcrumbs) {
                    addRequestBreadcrumb('error', method, url, req, undefined);
                }
                if (span) {
                    span.setHttpStatus(500);
                    span.finish();
                }
            });
        };
    };
}
/**
 * Captures Breadcrumb based on provided request/response pair
 */
function addRequestBreadcrumb(event, method, url, req, res) {
    (0, core_1.getCurrentHub)().addBreadcrumb({
        type: 'http',
        category: 'electron.net',
        data: {
            url,
            method: method,
            status_code: res && res.statusCode,
        },
    }, {
        event,
        request: req,
        response: res,
    });
}
//# sourceMappingURL=net-breadcrumbs.js.map{"version":3,"file":"net-breadcrumbs.js","sourceRoot":"","sources":["../../src/main/integrations/net-breadcrumbs.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,uCAA6C;AAE7C,yCAAqC;AACrC,uCAAgG;AAChG,uDAAiC;AA6BjC,MAAM,eAAe,GAAe;IAClC,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;IAChC,cAAc,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI;CACxC,CAAC;AAEF,sDAAsD;AACtD,SAAgB,gBAAgB,CAAC,OAAoC;IACnE,OAAQ,MAAM,CAAC,IAAI,CAAC,OAAO,CAA0B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACtE,IAAI,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;YAC5D,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAsC,CAAC;SAC1D;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAkC,CAAC,CAAC;AACzC,CAAC;AAPD,4CAOC;AAED,8BAA8B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IAAI,CAAC,MAAM,EAAE,CAAC;iBACf;YACH,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAC3B,KAAa,EACb,MAAc,EACd,GAAW,EACX,GAAkB,EAClB,GAAqB;IAErB,IAAA,oBAAa,GAAE,CAAC,aAAa,CAC3B;QACE,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,cAAc;QACxB,IAAI,EAAE;YACJ,GAAG;YACH,MAAM,EAAE,MAAM;YACd,WAAW,EAAE,GAAG,IAAI,GAAG,CAAC,UAAU;SACnC;KACF,EACD;QACE,KAAK;QACL,OAAO,EAAE,GAAG;QACZ,QAAQ,EAAE,GAAG;KACd,CACF,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { getCurrentHub } from '@sentry/core';\nimport { Integration, Span } from '@sentry/types';\nimport { fill } from '@sentry/utils';\nimport { ClientRequest, ClientRequestConstructorOptions, IncomingMessage, net } from 'electron';\nimport * as urlModule from 'url';\n\nimport { OrBool, OrFalse } from '../../common/types';\n\ntype ShouldTraceFn = (method: string, url: string) => boolean;\n\ninterface NetOptions {\n  /**\n   * Whether breadcrumbs should be captured for net requests\n   *\n   * Defaults to: true\n   */\n  breadcrumbs: boolean;\n  /**\n   * Whether to capture transaction spans for net requests\n   *\n   * true | false | (method: string, url: string) => boolean\n   * Defaults to: true\n   */\n  tracing: ShouldTraceFn;\n  /**\n   * Whether to add 'sentry-trace' headers to outgoing requests\n   *\n   * true | false | (method: string, url: string) => boolean\n   * Defaults to: true\n   */\n  tracingOrigins: ShouldTraceFn;\n}\n\nconst DEFAULT_OPTIONS: NetOptions = {\n  breadcrumbs: true,\n  tracing: (_method, _url) => true,\n  tracingOrigins: (_method, _url) => true,\n};\n\n/** Converts all user supplied options to T | false */\nexport function normalizeOptions(options: Partial<OrBool<NetOptions>>): Partial<OrFalse<NetOptions>> {\n  return (Object.keys(options) as (keyof NetOptions)[]).reduce((obj, k) => {\n    if (typeof options[k] === 'function' || options[k] === false) {\n      obj[k] = options[k] as boolean & (false | ShouldTraceFn);\n    }\n    return obj;\n  }, {} as Partial<OrFalse<NetOptions>>);\n}\n\n/** http module integration */\nexport class Net implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'Net';\n\n  /** @inheritDoc */\n  public name: string = Net.id;\n\n  private readonly _options: OrFalse<NetOptions>;\n\n  /** @inheritDoc */\n  public constructor(options: Partial<OrBool<NetOptions>> = {}) {\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...normalizeOptions(options),\n    };\n  }\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // No need to instrument if we don't want to track anything\n    if (this._options.breadcrumbs || this._options.tracing) {\n      fill(net, 'request', createWrappedRequestFactory(this._options));\n    }\n  }\n}\n\n/**\n * Trimmed down version of the code from Electron here:\n * https://github.com/electron/electron/blob/f3df76dbdc58cb704637b89357e1400791c92cfe/lib/browser/api/net.ts#L209-L269\n *\n * We want to match the final URL that Electron uses\n */\nfunction parseOptions(optionsIn: ClientRequestConstructorOptions | string): { method: string; url: string } {\n  const { method, options } =\n    typeof optionsIn === 'string'\n      ? { method: 'GET', options: urlModule.parse(optionsIn) }\n      : { method: (optionsIn.method || 'GET').toUpperCase(), options: optionsIn };\n\n  let url = 'url' in options ? options.url : undefined;\n\n  if (!url) {\n    const urlObj: urlModule.UrlObject = {};\n    urlObj.protocol = options.protocol || 'http:';\n\n    if (options.host) {\n      urlObj.host = options.host;\n    } else {\n      if (options.hostname) {\n        urlObj.hostname = options.hostname;\n      } else {\n        urlObj.hostname = 'localhost';\n      }\n\n      if (options.port) {\n        urlObj.port = options.port;\n      }\n    }\n\n    const pathObj = urlModule.parse(options.path || '/');\n    urlObj.pathname = pathObj.pathname;\n    urlObj.search = pathObj.search;\n    urlObj.hash = pathObj.hash;\n    url = urlModule.format(urlObj);\n  }\n\n  return {\n    method,\n    url,\n  };\n}\n\ntype RequestOptions = string | ClientRequestConstructorOptions;\ntype RequestMethod = (opt: RequestOptions) => ClientRequest;\ntype WrappedRequestMethodFactory = (original: RequestMethod) => RequestMethod;\n\n/** */\nfunction createWrappedRequestFactory(options: OrFalse<NetOptions>): WrappedRequestMethodFactory {\n  return function wrappedRequestMethodFactory(originalRequestMethod: RequestMethod): RequestMethod {\n    return function requestMethod(this: typeof net, reqOptions: RequestOptions): ClientRequest {\n      // eslint-disable-next-line @typescript-eslint/no-this-alias\n      const netModule = this;\n\n      const { url, method } = parseOptions(reqOptions);\n      const request = originalRequestMethod.apply(netModule, [reqOptions]) as ClientRequest;\n\n      if (url.match(/sentry_key/) || request.getHeader('x-sentry-auth')) {\n        return request;\n      }\n\n      let span: Span | undefined;\n\n      const scope = getCurrentHub().getScope();\n      if (scope && options.tracing && options.tracing(method, url)) {\n        const parentSpan = scope.getSpan();\n\n        if (parentSpan) {\n          span = parentSpan.startChild({\n            description: `${method} ${url}`,\n            op: 'http.client',\n          });\n\n          if (options.tracingOrigins && options.tracingOrigins(method, url)) {\n            request.setHeader('sentry-trace', span.toTraceparent());\n          }\n        }\n      }\n\n      return request\n        .once('response', function (this: ClientRequest, res: IncomingMessage): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n          if (options.breadcrumbs) {\n            addRequestBreadcrumb('response', method, url, req, res);\n          }\n          if (span) {\n            if (res.statusCode) {\n              span.setHttpStatus(res.statusCode);\n            }\n            span.finish();\n          }\n        })\n        .once('error', function (this: ClientRequest, _error: Error): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n\n          if (options.breadcrumbs) {\n            addRequestBreadcrumb('error', method, url, req, undefined);\n          }\n          if (span) {\n            span.setHttpStatus(500);\n            span.finish();\n          }\n        });\n    };\n  };\n}\n\n/**\n * Captures Breadcrumb based on provided request/response pair\n */\nfunction addRequestBreadcrumb(\n  event: string,\n  method: string,\n  url: string,\n  req: ClientRequest,\n  res?: IncomingMessage,\n): void {\n  getCurrentHub().addBreadcrumb(\n    {\n      type: 'http',\n      category: 'electron.net',\n      data: {\n        url,\n        method: method,\n        status_code: res && res.statusCode,\n      },\n    },\n    {\n      event,\n      request: req,\n      response: res,\n    },\n  );\n}\n"]}import { Integration } from '@sentry/types';
/** Capture unhandled errors. */
export declare class OnUncaughtException implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
//# sourceMappingURL=onuncaughtexception.d.ts.map{"version":3,"file":"onuncaughtexception.d.ts","sourceRoot":"","sources":["../../src/main/integrations/onuncaughtexception.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAGnD,gCAAgC;AAChC,qBAAa,mBAAoB,YAAW,WAAW;IACrD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAyB;IAEjD,kBAAkB;IACX,IAAI,EAAE,MAAM,CAA0B;IAE7C;;OAEG;IACI,SAAS,IAAI,IAAI;CAkCzB"}Object.defineProperty(exports, "__esModule", { value: true });
exports.OnUncaughtException = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const electron_1 = require("electron");
/** Capture unhandled errors. */
class OnUncaughtException {
    constructor() {
        /** @inheritDoc */
        this.name = OnUncaughtException.id;
    }
    /**
     * @inheritDoc
     */
    setupOnce() {
        var _a;
        const options = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        global.process.on('uncaughtException', (error) => {
            const self = (0, core_1.getCurrentHub)().getIntegration(OnUncaughtException);
            if (self) {
                (0, core_1.getCurrentHub)().withScope((scope) => tslib_1.__awaiter(this, void 0, void 0, function* () {
                    scope.addEventProcessor((event) => tslib_1.__awaiter(this, void 0, void 0, function* () {
                        return (Object.assign(Object.assign({}, event), { level: 'fatal' }));
                    }));
                    const nodeClient = (0, core_1.getCurrentHub)().getClient();
                    nodeClient.captureException(error, { originalException: error }, (0, core_1.getCurrentHub)().getScope());
                    yield nodeClient.flush(nodeClient.getOptions().shutdownTimeout || 2000);
                    if (options === null || options === void 0 ? void 0 : options.onFatalError) {
                        options.onFatalError(error);
                    }
                    else if (global.process.listenerCount('uncaughtException') <= 2) {
                        // In addition to this handler there is always one in Electron
                        // The dialog is only shown if there are no other handlers
                        // eslint-disable-next-line no-console
                        console.error('Uncaught Exception:');
                        // eslint-disable-next-line no-console
                        console.error(error);
                        const ref = error.stack;
                        const stack = ref !== undefined ? ref : `${error.name}: ${error.message}`;
                        const message = `Uncaught Exception:\n${stack}`;
                        electron_1.dialog.showErrorBox('A JavaScript error occurred in the main process', message);
                    }
                }));
            }
        });
    }
}
exports.OnUncaughtException = OnUncaughtException;
/** @inheritDoc */
OnUncaughtException.id = 'OnUncaughtException';
//# sourceMappingURL=onuncaughtexception.js.map{"version":3,"file":"onuncaughtexception.js","sourceRoot":"","sources":["../../src/main/integrations/onuncaughtexception.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAG7C,uCAAkC;AAElC,gCAAgC;AAChC,MAAa,mBAAmB;IAAhC;QAIE,kBAAkB;QACX,SAAI,GAAW,mBAAmB,CAAC,EAAE,CAAC;IAuC/C,CAAC;IArCC;;OAEG;IACI,SAAS;;QACd,MAAM,OAAO,GAAG,MAAA,IAAA,oBAAa,GAAE,CAAC,SAAS,EAAc,0CAAE,UAAU,EAAE,CAAC;QAEtE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAY,EAAE,EAAE;YACtD,MAAM,IAAI,GAAG,IAAA,oBAAa,GAAE,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;YACjE,IAAI,IAAI,EAAE;gBACR,IAAA,oBAAa,GAAE,CAAC,SAAS,CAAC,CAAO,KAAK,EAAE,EAAE;oBACxC,KAAK,CAAC,iBAAiB,CAAC,CAAO,KAAY,EAAE,EAAE;wBAAC,OAAA,iCAC3C,KAAK,KACR,KAAK,EAAE,OAAO,IAC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sentry/types';\nimport { dialog } from 'electron';\n\n/** Capture unhandled errors. */\nexport class OnUncaughtException implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'OnUncaughtException';\n\n  /** @inheritDoc */\n  public name: string = OnUncaughtException.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    global.process.on('uncaughtException', (error: Error) => {\n      const self = getCurrentHub().getIntegration(OnUncaughtException);\n      if (self) {\n        getCurrentHub().withScope(async (scope) => {\n          scope.addEventProcessor(async (event: Event) => ({\n            ...event,\n            level: 'fatal',\n          }));\n\n          const nodeClient = getCurrentHub().getClient() as NodeClient;\n          nodeClient.captureException(error, { originalException: error }, getCurrentHub().getScope());\n          await nodeClient.flush(nodeClient.getOptions().shutdownTimeout || 2000);\n\n          if (options?.onFatalError) {\n            options.onFatalError(error);\n          } else if (global.process.listenerCount('uncaughtException') <= 2) {\n            // In addition to this handler there is always one in Electron\n            // The dialog is only shown if there are no other handlers\n            // eslint-disable-next-line no-console\n            console.error('Uncaught Exception:');\n            // eslint-disable-next-line no-console\n            console.error(error);\n            const ref = error.stack;\n            const stack = ref !== undefined ? ref : `${error.name}: ${error.message}`;\n            const message = `Uncaught Exception:\\n${stack}`;\n            dialog.showErrorBox('A JavaScript error occurred in the main process', message);\n          }\n        });\n      }\n    });\n  }\n}\n"]}import { Integration } from '@sentry/types';
/**
 * Injects the preload script into the provided sessions.
 *
 * Defaults to injecting into the defaultSession
 */
export declare class PreloadInjection implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Attempts to add the preload script the the provided sessions
     */
    private _addPreloadToSessions;
}
//# sourceMappingURL=preload-injection.d.ts.map{"version":3,"file":"preload-injection.d.ts","sourceRoot":"","sources":["../../src/main/integrations/preload-injection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAsB;IAE9C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAuB;IAE1C,kBAAkB;IACX,SAAS,IAAI,IAAI;IAcxB;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAsB9B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.PreloadInjection = void 0;
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const fs_1 = require("fs");
const path_1 = require("path");
const common_1 = require("../../common");
const electron_normalize_1 = require("../electron-normalize");
/**
 * Injects the preload script into the provided sessions.
 *
 * Defaults to injecting into the defaultSession
 */
class PreloadInjection {
    constructor() {
        /** @inheritDoc */
        this.name = PreloadInjection.id;
    }
    /** @inheritDoc */
    setupOnce() {
        var _a;
        const options = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions();
        // If classic IPC mode is disabled, we shouldn't attempt to inject preload scripts
        // eslint-disable-next-line no-bitwise
        if ((options.ipcMode & common_1.IPCMode.Classic) == 0) {
            return;
        }
        electron_1.app.once('ready', () => {
            this._addPreloadToSessions(options);
        });
    }
    /**
     * Attempts to add the preload script the the provided sessions
     */
    _addPreloadToSessions(options) {
        let path = undefined;
        try {
            path = (0, electron_normalize_1.rendererRequiresCrashReporterStart)()
                ? require.resolve('../../preload/legacy.js')
                : require.resolve('../../preload/index.js');
        }
        catch (_) {
            //
        }
        if (path && typeof path === 'string' && (0, path_1.isAbsolute)(path) && (0, fs_1.existsSync)(path)) {
            for (const sesh of options.getSessions()) {
                // Fetch any existing preloads so we don't overwrite them
                const existing = sesh.getPreloads();
                sesh.setPreloads([path, ...existing]);
            }
        }
        else {
            utils_1.logger.log('The preload script could not be injected automatically. This is most likely caused by bundling of the main process');
        }
    }
}
exports.PreloadInjection = PreloadInjection;
/** @inheritDoc */
PreloadInjection.id = 'PreloadInjection';
//# sourceMappingURL=preload-injection.js.map{"version":3,"file":"preload-injection.js","sourceRoot":"","sources":["../../src/main/integrations/preload-injection.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAG7C,yCAAuC;AACvC,uCAA+B;AAC/B,2BAAgC;AAChC,+BAAkC;AAElC,yCAAuC;AACvC,8DAA2E;AAG3E;;;;GAIG;AACH,MAAa,gBAAgB;IAA7B;QAIE,kBAAkB;QACX,SAAI,GAAW,gBAAgB,CAAC,EAAE,CAAC;IA0C5C,CAAC;IAxCC,kBAAkB;IACX,SAAS;;QACd,MAAM,OAAO,GAAG,MAAA,IAAA,oBAAa,GAAE,CAAC,SAAS,EAAc,0CAAE,UAAU,EAAiC,CAAC;QAErG,kFAAkF;QAClF,sCAAsC;QACtC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,gBAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC5C,OAAO;SACR;QAED,cAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;YACrB,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,OAAoC;QAChE,IAAI,IAAI,GAAG,SAAS,CAAC;QACrB,IAAI;YACF,IAAI,GAAG,IAAA,uDAAkC,GAAE;gBACzC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC;gBAC5C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;SAC/C;QAAC,OAAO,CAAC,EAAE;YACV,EAAE;SACH;QAED,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAA,iBAAU,EAAC,IAAI,CAAC,IAAI,IAAA,eAAU,EAAC,IAAI,CAAC,EAAE;YAC5E,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE;gBACxC,yDAAyD;gBACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;gBACpC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC;aACvC;SACF;aAAM;YACL,cAAM,CAAC,GAAG,CACR,oHAAoH,CACrH,CAAC;SACH;IACH,CAAC;;AA9CH,4CA+CC;AA9CC,kBAAkB;AACJ,mBAAE,GAAW,kBAAkB,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { app } from 'electron';\nimport { existsSync } from 'fs';\nimport { isAbsolute } from 'path';\n\nimport { IPCMode } from '../../common';\nimport { rendererRequiresCrashReporterStart } from '../electron-normalize';\nimport { ElectronMainOptionsInternal } from '../sdk';\n\n/**\n * Injects the preload script into the provided sessions.\n *\n * Defaults to injecting into the defaultSession\n */\nexport class PreloadInjection implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'PreloadInjection';\n\n  /** @inheritDoc */\n  public name: string = PreloadInjection.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    const options = getCurrentHub().getClient<NodeClient>()?.getOptions() as ElectronMainOptionsInternal;\n\n    // If classic IPC mode is disabled, we shouldn't attempt to inject preload scripts\n    // eslint-disable-next-line no-bitwise\n    if ((options.ipcMode & IPCMode.Classic) == 0) {\n      return;\n    }\n\n    app.once('ready', () => {\n      this._addPreloadToSessions(options);\n    });\n  }\n\n  /**\n   * Attempts to add the preload script the the provided sessions\n   */\n  private _addPreloadToSessions(options: ElectronMainOptionsInternal): void {\n    let path = undefined;\n    try {\n      path = rendererRequiresCrashReporterStart()\n        ? require.resolve('../../preload/legacy.js')\n        : require.resolve('../../preload/index.js');\n    } catch (_) {\n      //\n    }\n\n    if (path && typeof path === 'string' && isAbsolute(path) && existsSync(path)) {\n      for (const sesh of options.getSessions()) {\n        // Fetch any existing preloads so we don't overwrite them\n        const existing = sesh.getPreloads();\n        sesh.setPreloads([path, ...existing]);\n      }\n    } else {\n      logger.log(\n        'The preload script could not be injected automatically. This is most likely caused by bundling of the main process',\n      );\n    }\n  }\n}\n"]}import { EventProcessor, Integration } from '@sentry/types';
/** Adds Screenshots to events */
export declare class Screenshots implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=screenshots.d.ts.map{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../src/main/integrations/screenshots.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAO9E,iCAAiC;AACjC,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAkCpF"}Object.defineProperty(exports, "__esModule", { value: true });
exports.Screenshots = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const electron_normalize_1 = require("../electron-normalize");
/** Adds Screenshots to events */
class Screenshots {
    constructor() {
        /** @inheritDoc */
        this.name = Screenshots.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        var _a;
        const attachScreenshot = !!((_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getOptions()).attachScreenshot;
        if (attachScreenshot) {
            addGlobalEventProcessor((event, hint) => tslib_1.__awaiter(this, void 0, void 0, function* () {
                // We don't capture screenshots for transactions or native crashes
                if (!event.transaction && event.platform !== 'native') {
                    let count = 1;
                    for (const window of electron_1.BrowserWindow.getAllWindows()) {
                        if (!hint.attachments) {
                            hint.attachments = [];
                        }
                        try {
                            if (!window.isDestroyed() && window.isVisible()) {
                                const filename = count === 1 ? 'screenshot.png' : `screenshot-${count}.png`;
                                const image = yield (0, electron_normalize_1.capturePage)(window);
                                hint.attachments.push({ filename, data: image.toPNG(), contentType: 'image/png' });
                                count += 1;
                            }
                        }
                        catch (e) {
                            // Catch all errors so we don't break event submission if something goes wrong
                            utils_1.logger.error('Error capturing screenshot', e);
                        }
                    }
                }
                return event;
            }));
        }
    }
}
exports.Screenshots = Screenshots;
/** @inheritDoc */
Screenshots.id = 'Screenshots';
//# sourceMappingURL=screenshots.js.map{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../src/main/integrations/screenshots.ts"],"names":[],"mappings":";;;AAAA,uCAA6C;AAE7C,yCAAuC;AACvC,uCAAyC;AAEzC,8DAAoD;AAGpD,iCAAiC;AACjC,MAAa,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAqCvC,CAAC;IAnCC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;;QAC1E,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,MAAA,IAAA,oBAAa,GAAE,CAAC,SAAS,EAAE,0CAAE,UAAU,EAA0B,CAAA,CAAC,gBAAgB,CAAC;QAE/G,IAAI,gBAAgB,EAAE;YACpB,uBAAuB,CAAC,CAAO,KAAY,EAAE,IAAe,EAAE,EAAE;gBAC9D,kEAAkE;gBAClE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,EAAE;oBACrD,IAAI,KAAK,GAAG,CAAC,CAAC;oBAEd,KAAK,MAAM,MAAM,IAAI,wBAAa,CAAC,aAAa,EAAE,EAAE;wBAClD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;4BACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;yBACvB;wBAED,IAAI;4BACF,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE;gCAC/C,MAAM,QAAQ,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,KAAK,MAAM,CAAC;gCAC5E,MAAM,KAAK,GAAG,MAAM,IAAA,gCAAW,EAAC,MAAM,CAAC,CAAC;gCAExC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;gCAEnF,KAAK,IAAI,CAAC,CAAC;6BACZ;yBACF;wBAAC,OAAO,CAAC,EAAE;4BACV,8EAA8E;4BAC9E,cAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;yBAC/C;qBACF;iBACF;gBAED,OAAO,KAAK,CAAC;YACf,CAAC,CAAA,CAAC,CAAC;SACJ;IACH,CAAC;;AAzCH,kCA0CC;AAzCC,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Event, EventHint, EventProcessor, Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { BrowserWindow } from 'electron';\n\nimport { capturePage } from '../electron-normalize';\nimport { ElectronMainOptions } from '../sdk';\n\n/** Adds Screenshots to events */\nexport class Screenshots implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'Screenshots';\n\n  /** @inheritDoc */\n  public name: string = Screenshots.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const attachScreenshot = !!(getCurrentHub().getClient()?.getOptions() as ElectronMainOptions).attachScreenshot;\n\n    if (attachScreenshot) {\n      addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n        // We don't capture screenshots for transactions or native crashes\n        if (!event.transaction && event.platform !== 'native') {\n          let count = 1;\n\n          for (const window of BrowserWindow.getAllWindows()) {\n            if (!hint.attachments) {\n              hint.attachments = [];\n            }\n\n            try {\n              if (!window.isDestroyed() && window.isVisible()) {\n                const filename = count === 1 ? 'screenshot.png' : `screenshot-${count}.png`;\n                const image = await capturePage(window);\n\n                hint.attachments.push({ filename, data: image.toPNG(), contentType: 'image/png' });\n\n                count += 1;\n              }\n            } catch (e) {\n              // Catch all errors so we don't break event submission if something goes wrong\n              logger.error('Error capturing screenshot', e);\n            }\n          }\n        }\n\n        return event;\n      });\n    }\n  }\n}\n"]}import { Integration } from '@sentry/types';
/** Sends minidumps via the Sentry uploader */
export declare class SentryMinidump implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** Store to persist context information beyond application crashes. */
    private _scopeStore?;
    /** Temp store for the scope of last run */
    private _scopeLastRun?;
    private _minidumpLoader?;
    /** @inheritDoc */
    setupOnce(): void;
    /** Starts the native crash reporter */
    private _startCrashReporter;
    /**
     * Helper function for sending renderer crashes
     */
    private _sendRendererCrash;
    /**
     * Helper function for sending child process crashes
     */
    private _sendChildProcessCrash;
    /**
     * Adds a scope listener to persist changes to disk.
     */
    private _setupScopeListener;
    /**
     * Loads new native crashes from disk and sends them to Sentry.
     *
     * Returns true if one or more minidumps were found
     */
    private _sendNativeCrashes;
}
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/sentry-minidump/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAS,WAAW,EAAE,MAAM,eAAe,CAAC;AAcnD,8CAA8C;AAC9C,qBAAa,cAAe,YAAW,WAAW;IAChD,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAqB;IAExC,uEAAuE;IACvE,OAAO,CAAC,WAAW,CAAC,CAA4B;IAEhD,2CAA2C;IAC3C,OAAO,CAAC,aAAa,CAAC,CAAiB;IAEvC,OAAO,CAAC,eAAe,CAAC,CAAiB;IAEzC,kBAAkB;IACX,SAAS,IAAI,IAAI;IAiDxB,uCAAuC;IACvC,OAAO,CAAC,mBAAmB;IAc3B;;OAEG;YACW,kBAAkB;IAmChC;;OAEG;YACW,sBAAsB;IA8BpC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAmB3B;;;;OAIG;YACW,kBAAkB;CA2EjC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.SentryMinidump = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const common_1 = require("../../../common");
const context_1 = require("../../context");
const electron_normalize_1 = require("../../electron-normalize");
const fs_1 = require("../../fs");
const renderers_1 = require("../../renderers");
const sessions_1 = require("../../sessions");
const store_1 = require("../../store");
const minidump_loader_1 = require("./minidump-loader");
/** Sends minidumps via the Sentry uploader */
class SentryMinidump {
    constructor() {
        /** @inheritDoc */
        this.name = SentryMinidump.id;
    }
    /** @inheritDoc */
    setupOnce() {
        // Mac AppStore builds cannot run the crash reporter due to the sandboxing
        // requirements. In this case, we prevent enabling native crashes entirely.
        // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build
        if (process.mas) {
            return;
        }
        this._startCrashReporter();
        this._scopeStore = new store_1.BufferedWriteStore(fs_1.sentryCachePath, 'scope_v2', new core_1.Scope());
        // We need to store the scope in a variable here so it can be attached to minidumps
        this._scopeLastRun = this._scopeStore.get();
        this._setupScopeListener();
        const client = (0, core_1.getCurrentHub)().getClient();
        const options = client === null || client === void 0 ? void 0 : client.getOptions();
        if (!(options === null || options === void 0 ? void 0 : options.dsn)) {
            throw new utils_1.SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');
        }
        (0, renderers_1.trackRendererProperties)();
        this._minidumpLoader = (0, minidump_loader_1.getMinidumpLoader)();
        (0, electron_normalize_1.onRendererProcessGone)(electron_normalize_1.EXIT_REASONS, (contents, details) => this._sendRendererCrash(options, contents, details));
        (0, electron_normalize_1.onChildProcessGone)(electron_normalize_1.EXIT_REASONS, (details) => this._sendChildProcessCrash(options, details));
        // Start to submit recent minidump crashes. This will load breadcrumbs and
        // context information that was cached on disk prior to the crash.
        this._sendNativeCrashes({
            level: 'fatal',
            platform: 'native',
            tags: {
                'event.environment': 'native',
                'event.process': 'browser',
                event_type: 'native',
            },
        })
            .then((minidumpsFound) => 
        // Check for previous uncompleted session. If a previous session exists
        // and no minidumps were found, its likely an abnormal exit
        (0, sessions_1.checkPreviousSession)(minidumpsFound))
            .catch((error) => utils_1.logger.error(error));
    }
    /** Starts the native crash reporter */
    _startCrashReporter() {
        utils_1.logger.log('Starting Electron crashReporter');
        electron_1.crashReporter.start({
            companyName: '',
            ignoreSystemCrashHandler: true,
            productName: electron_1.app.name || electron_1.app.getName(),
            // Empty string doesn't work for Linux Crashpad and no submitURL doesn't work for older versions of Electron
            submitURL: 'https://f.a.k/e',
            uploadToServer: false,
            compress: true,
        });
    }
    /**
     * Helper function for sending renderer crashes
     */
    _sendRendererCrash(options, contents, details) {
        var _a;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const { getRendererName, release, environment } = options;
            const crashedProcess = (getRendererName === null || getRendererName === void 0 ? void 0 : getRendererName(contents)) || 'renderer';
            utils_1.logger.log(`'${crashedProcess}' process '${details.reason}'`);
            const event = (0, common_1.mergeEvents)(yield (0, context_1.getEventDefaults)(release, environment), {
                contexts: {
                    electron: {
                        crashed_url: ((_a = (0, renderers_1.getRendererProperties)(contents.id)) === null || _a === void 0 ? void 0 : _a.url) || 'unknown',
                        details,
                    },
                },
                level: 'fatal',
                // The default is javascript
                platform: 'native',
                tags: {
                    'event.environment': 'native',
                    'event.process': crashedProcess,
                    'exit.reason': details.reason,
                    event_type: 'native',
                },
            });
            const found = yield this._sendNativeCrashes(event);
            if (found) {
                (0, sessions_1.sessionCrashed)();
            }
        });
    }
    /**
     * Helper function for sending child process crashes
     */
    _sendChildProcessCrash(options, details) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            utils_1.logger.log(`${details.type} process has ${details.reason}`);
            const { release, environment } = options;
            const event = (0, common_1.mergeEvents)(yield (0, context_1.getEventDefaults)(release, environment), {
                contexts: {
                    electron: { details },
                },
                level: 'fatal',
                // The default is javascript
                platform: 'native',
                tags: {
                    'event.environment': 'native',
                    'event.process': details.type,
                    'exit.reason': details.reason,
                    event_type: 'native',
                },
            });
            const found = yield this._sendNativeCrashes(event);
            if (found) {
                (0, sessions_1.sessionCrashed)();
            }
        });
    }
    /**
     * Adds a scope listener to persist changes to disk.
     */
    _setupScopeListener() {
        const hubScope = (0, core_1.getCurrentHub)().getScope();
        if (hubScope) {
            hubScope.addScopeListener((updatedScope) => {
                const scope = core_1.Scope.clone(updatedScope);
                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
                scope._eventProcessors = [];
                // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
                scope._scopeListeners = [];
                // Since the initial scope read is async, we need to ensure that any writes do not beat that
                // https://github.com/getsentry/sentry-electron/issues/585
                setImmediate(() => {
                    var _a;
                    void ((_a = this._scopeStore) === null || _a === void 0 ? void 0 : _a.set(scope));
                });
            });
        }
    }
    /**
     * Loads new native crashes from disk and sends them to Sentry.
     *
     * Returns true if one or more minidumps were found
     */
    _sendNativeCrashes(event) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            // Whenever we are called, assume that the crashes we are going to load down
            // below have occurred recently. This means, we can use the same event data
            // for all minidumps that we load now. There are two conditions:
            //
            //  1. The application crashed and we are just starting up. The stored
            //     breadcrumbs and context reflect the state during the application
            //     crash.
            //
            //  2. A renderer process crashed recently and we have just been notified
            //     about it. Just use the breadcrumbs and context information we have
            //     right now and hope that the delay was not too long.
            if (this._minidumpLoader === undefined) {
                throw new utils_1.SentryError('Invariant violation: Native crashes not enabled');
            }
            try {
                const minidumps = yield this._minidumpLoader();
                if (minidumps.length > 0) {
                    const hub = (0, core_1.getCurrentHub)();
                    const client = hub.getClient();
                    if (!client) {
                        return true;
                    }
                    const enabled = client.getOptions().enabled;
                    // If the SDK is not enabled, we delete the minidump files so they
                    // dont accumulate and/or get sent later
                    if (enabled === false) {
                        minidumps.forEach(minidump_loader_1.deleteMinidump);
                        return false;
                    }
                    const storedScope = core_1.Scope.clone(yield this._scopeLastRun);
                    let newEvent = yield storedScope.applyToEvent(event);
                    const hubScope = hub.getScope();
                    newEvent = hubScope ? yield hubScope.applyToEvent(event) : event;
                    if (!newEvent) {
                        return false;
                    }
                    for (const minidump of minidumps) {
                        const data = yield minidump.load();
                        if (data) {
                            (0, core_1.captureEvent)(newEvent, {
                                attachments: [
                                    {
                                        attachmentType: 'event.minidump',
                                        filename: (0, utils_1.basename)(minidump.path),
                                        data,
                                    },
                                ],
                            });
                        }
                        void (0, minidump_loader_1.deleteMinidump)(minidump);
                    }
                    // Unset to recover memory
                    this._scopeLastRun = undefined;
                    return true;
                }
            }
            catch (_oO) {
                utils_1.logger.error('Error while sending native crash.');
            }
            return false;
        });
    }
}
exports.SentryMinidump = SentryMinidump;
/** @inheritDoc */
SentryMinidump.id = 'SentryMinidump';
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/main/integrations/sentry-minidump/index.ts"],"names":[],"mappings":";;;AAAA,uCAAkE;AAGlE,yCAA8D;AAC9D,uCAA8C;AAE9C,4CAA8C;AAC9C,2CAAiD;AACjD,iEAAmG;AACnG,iCAA2C;AAC3C,+CAAiF;AAEjF,6CAAsE;AACtE,uCAAiD;AACjD,uDAAsF;AAEtF,8CAA8C;AAC9C,MAAa,cAAc;IAA3B;QAIE,kBAAkB;QACX,SAAI,GAAW,cAAc,CAAC,EAAE,CAAC;IAwP1C,CAAC;IA9OC,kBAAkB;IACX,SAAS;QACd,0EAA0E;QAC1E,2EAA2E;QAC3E,+FAA+F;QAC/F,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,OAAO;SACR;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAE3B,IAAI,CAAC,WAAW,GAAG,IAAI,0BA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MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;oBAErD,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;oBAChC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;oBAEjE,IAAI,CAAC,QAAQ,EAAE;wBACb,OAAO,KAAK,CAAC;qBACd;oBAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;wBAChC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;wBAEnC,IAAI,IAAI,EAAE;4BACR,IAAA,mBAAY,EAAC,QAAQ,EAAE;gCACrB,WAAW,EAAE;oCACX;wCACE,cAAc,EAAE,gBAAgB;wCAChC,QAAQ,EAAE,IAAA,gBAAQ,EAAC,QAAQ,CAAC,IAAI,CAAC;wCACjC,IAAI;qCACL;iCACF;6BACF,CAAC,CAAC;yBACJ;wBAED,KAAK,IAAA,gCAAc,EAAC,QAAQ,CAAC,CAAC;qBAC/B;oBAED,0BAA0B;oBAC1B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;oBAC/B,OAAO,IAAI,CAAC;iBACb;aACF;YAAC,OAAO,GAAG,EAAE;gBACZ,cAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;aACnD;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;;AA5PH,wCA6PC;AA5PC,kBAAkB;AACJ,iBAAE,GAAW,gBAAgB,CAAC","sourcesContent":["import { captureEvent, getCurrentHub, Scope } from '@sentry/core';\nimport { NodeClient } from '@sentry/node';\nimport { Event, Integration } from '@sentry/types';\nimport { basename, logger, SentryError } from '@sentry/utils';\nimport { app, crashReporter } from 'electron';\n\nimport { mergeEvents } from '../../../common';\nimport { getEventDefaults } from '../../context';\nimport { EXIT_REASONS, onChildProcessGone, onRendererProcessGone } from '../../electron-normalize';\nimport { sentryCachePath } from '../../fs';\nimport { getRendererProperties, trackRendererProperties } from '../../renderers';\nimport { ElectronMainOptions } from '../../sdk';\nimport { checkPreviousSession, sessionCrashed } from '../../sessions';\nimport { BufferedWriteStore } from '../../store';\nimport { deleteMinidump, getMinidumpLoader, MinidumpLoader } from './minidump-loader';\n\n/** Sends minidumps via the Sentry uploader */\nexport class SentryMinidump implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'SentryMinidump';\n\n  /** @inheritDoc */\n  public name: string = SentryMinidump.id;\n\n  /** Store to persist context information beyond application crashes. */\n  private _scopeStore?: BufferedWriteStore<Scope>;\n\n  /** Temp store for the scope of last run */\n  private _scopeLastRun?: Promise<Scope>;\n\n  private _minidumpLoader?: MinidumpLoader;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    // Mac AppStore builds cannot run the crash reporter due to the sandboxing\n    // requirements. In this case, we prevent enabling native crashes entirely.\n    // https://electronjs.org/docs/tutorial/mac-app-store-submission-guide#limitations-of-mas-build\n    if (process.mas) {\n      return;\n    }\n\n    this._startCrashReporter();\n\n    this._scopeStore = new BufferedWriteStore<Scope>(sentryCachePath, 'scope_v2', new Scope());\n    // We need to store the scope in a variable here so it can be attached to minidumps\n    this._scopeLastRun = this._scopeStore.get();\n\n    this._setupScopeListener();\n\n    const client = getCurrentHub().getClient<NodeClient>();\n    const options = client?.getOptions() as ElectronMainOptions;\n\n    if (!options?.dsn) {\n      throw new SentryError('Attempted to enable Electron native crash reporter but no DSN was supplied');\n    }\n\n    trackRendererProperties();\n\n    this._minidumpLoader = getMinidumpLoader();\n\n    onRendererProcessGone(EXIT_REASONS, (contents, details) => this._sendRendererCrash(options, contents, details));\n    onChildProcessGone(EXIT_REASONS, (details) => this._sendChildProcessCrash(options, details));\n\n    // Start to submit recent minidump crashes. This will load breadcrumbs and\n    // context information that was cached on disk prior to the crash.\n    this._sendNativeCrashes({\n      level: 'fatal',\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': 'browser',\n        event_type: 'native',\n      },\n    })\n      .then((minidumpsFound) =>\n        // Check for previous uncompleted session. If a previous session exists\n        // and no minidumps were found, its likely an abnormal exit\n        checkPreviousSession(minidumpsFound),\n      )\n      .catch((error) => logger.error(error));\n  }\n\n  /** Starts the native crash reporter */\n  private _startCrashReporter(): void {\n    logger.log('Starting Electron crashReporter');\n\n    crashReporter.start({\n      companyName: '',\n      ignoreSystemCrashHandler: true,\n      productName: app.name || app.getName(),\n      // Empty string doesn't work for Linux Crashpad and no submitURL doesn't work for older versions of Electron\n      submitURL: 'https://f.a.k/e',\n      uploadToServer: false,\n      compress: true,\n    });\n  }\n\n  /**\n   * Helper function for sending renderer crashes\n   */\n  private async _sendRendererCrash(\n    options: ElectronMainOptions,\n    contents: Electron.WebContents,\n    details: Partial<Electron.RenderProcessGoneDetails>,\n  ): Promise<void> {\n    const { getRendererName, release, environment } = options;\n    const crashedProcess = getRendererName?.(contents) || 'renderer';\n\n    logger.log(`'${crashedProcess}' process '${details.reason}'`);\n\n    const event = mergeEvents(await getEventDefaults(release, environment), {\n      contexts: {\n        electron: {\n          crashed_url: getRendererProperties(contents.id)?.url || 'unknown',\n          details,\n        },\n      },\n      level: 'fatal',\n      // The default is javascript\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': crashedProcess,\n        'exit.reason': details.reason,\n        event_type: 'native',\n      },\n    });\n\n    const found = await this._sendNativeCrashes(event);\n\n    if (found) {\n      sessionCrashed();\n    }\n  }\n\n  /**\n   * Helper function for sending child process crashes\n   */\n  private async _sendChildProcessCrash(\n    options: ElectronMainOptions,\n    details: Omit<Electron.Details, 'exitCode'>,\n  ): Promise<void> {\n    logger.log(`${details.type} process has ${details.reason}`);\n\n    const { release, environment } = options;\n\n    const event = mergeEvents(await getEventDefaults(release, environment), {\n      contexts: {\n        electron: { details },\n      },\n      level: 'fatal',\n      // The default is javascript\n      platform: 'native',\n      tags: {\n        'event.environment': 'native',\n        'event.process': details.type,\n        'exit.reason': details.reason,\n        event_type: 'native',\n      },\n    });\n\n    const found = await this._sendNativeCrashes(event);\n\n    if (found) {\n      sessionCrashed();\n    }\n  }\n\n  /**\n   * Adds a scope listener to persist changes to disk.\n   */\n  private _setupScopeListener(): void {\n    const hubScope = getCurrentHub().getScope();\n    if (hubScope) {\n      hubScope.addScopeListener((updatedScope) => {\n        const scope = Scope.clone(updatedScope);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (scope as any)._eventProcessors = [];\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (scope as any)._scopeListeners = [];\n\n        // Since the initial scope read is async, we need to ensure that any writes do not beat that\n        // https://github.com/getsentry/sentry-electron/issues/585\n        setImmediate(() => {\n          void this._scopeStore?.set(scope);\n        });\n      });\n    }\n  }\n\n  /**\n   * Loads new native crashes from disk and sends them to Sentry.\n   *\n   * Returns true if one or more minidumps were found\n   */\n  private async _sendNativeCrashes(event: Event): Promise<boolean> {\n    // Whenever we are called, assume that the crashes we are going to load down\n    // below have occurred recently. This means, we can use the same event data\n    // for all minidumps that we load now. There are two conditions:\n    //\n    //  1. The application crashed and we are just starting up. The stored\n    //     breadcrumbs and context reflect the state during the application\n    //     crash.\n    //\n    //  2. A renderer process crashed recently and we have just been notified\n    //     about it. Just use the breadcrumbs and context information we have\n    //     right now and hope that the delay was not too long.\n\n    if (this._minidumpLoader === undefined) {\n      throw new SentryError('Invariant violation: Native crashes not enabled');\n    }\n\n    try {\n      const minidumps = await this._minidumpLoader();\n\n      if (minidumps.length > 0) {\n        const hub = getCurrentHub();\n        const client = hub.getClient();\n\n        if (!client) {\n          return true;\n        }\n\n        const enabled = client.getOptions().enabled;\n\n        // If the SDK is not enabled, we delete the minidump files so they\n        // dont accumulate and/or get sent later\n        if (enabled === false) {\n          minidumps.forEach(deleteMinidump);\n          return false;\n        }\n\n        const storedScope = Scope.clone(await this._scopeLastRun);\n        let newEvent = await storedScope.applyToEvent(event);\n\n        const hubScope = hub.getScope();\n        newEvent = hubScope ? await hubScope.applyToEvent(event) : event;\n\n        if (!newEvent) {\n          return false;\n        }\n\n        for (const minidump of minidumps) {\n          const data = await minidump.load();\n\n          if (data) {\n            captureEvent(newEvent, {\n              attachments: [\n                {\n                  attachmentType: 'event.minidump',\n                  filename: basename(minidump.path),\n                  data,\n                },\n              ],\n            });\n          }\n\n          void deleteMinidump(minidump);\n        }\n\n        // Unset to recover memory\n        this._scopeLastRun = undefined;\n        return true;\n      }\n    } catch (_oO) {\n      logger.error('Error while sending native crash.');\n    }\n\n    return false;\n  }\n}\n"]}export interface MinidumpFile {
    path: string;
    load(): Promise<Uint8Array | undefined>;
}
export type MinidumpLoader = () => Promise<MinidumpFile[]>;
/** Deletes a minidump */
export declare function deleteMinidump(dump: MinidumpFile): Promise<void>;
/**
 * Gets the minidump loader
 */
export declare function getMinidumpLoader(): MinidumpLoader;
//# sourceMappingURL=minidump-loader.d.ts.map{"version":3,"file":"minidump-loader.d.ts","sourceRoot":"","sources":["../../../src/main/integrations/sentry-minidump/minidump-loader.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,IAAI,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;AAW3D,yBAAyB;AACzB,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtE;AAwJD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAElD"}Object.defineProperty(exports, "__esModule", { value: true });
exports.getMinidumpLoader = exports.deleteMinidump = void 0;
const tslib_1 = require("tslib");
const utils_1 = require("@sentry/utils");
const path_1 = require("path");
const electron_normalize_1 = require("../../electron-normalize");
const fs_1 = require("../../fs");
/** Maximum number of days to keep a minidump before deleting it. */
const MAX_AGE = 30;
function filterAsync(array, predicate, thisArg) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const verdicts = yield Promise.all(array.map(predicate, thisArg));
        return array.filter((_, index) => verdicts[index]);
    });
}
/** Deletes a minidump */
function deleteMinidump(dump) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        try {
            yield (0, fs_1.unlinkAsync)(dump.path);
        }
        catch (e) {
            utils_1.logger.warn('Could not delete', dump.path);
        }
    });
}
exports.deleteMinidump = deleteMinidump;
function createMinidumpLoader(fetchMinidumpsImpl) {
    const knownPaths = [];
    return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
        const minidumps = yield fetchMinidumpsImpl();
        utils_1.logger.log(`Found ${minidumps.length} minidumps`);
        const oldestMs = new Date().getTime() - MAX_AGE * 24 * 3600 * 1000;
        return filterAsync(minidumps, (dump) => tslib_1.__awaiter(this, void 0, void 0, function* () {
            // Skip files that we have seen before
            if (knownPaths.indexOf(dump.path) >= 0) {
                return false;
            }
            // Lock this minidump until we have uploaded it or an error occurs and we
            // remove it from the file system.
            knownPaths.push(dump.path);
            // We do not want to upload minidumps that have been generated before a
            // certain threshold. Those old files can be deleted immediately.
            const stats = yield (0, fs_1.statAsync)(dump.path);
            if (stats.birthtimeMs < oldestMs) {
                yield deleteMinidump(dump);
                knownPaths.splice(knownPaths.indexOf(dump.path), 1);
                return false;
            }
            return true;
        }));
    });
}
/** Attempts to remove the metadata file so Crashpad doesn't output `failed to stat report` errors to the console */
function deleteCrashpadMetadataFile(crashesDirectory, waitMs = 100) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        if (waitMs > 2000) {
            return;
        }
        const metadataPath = (0, path_1.join)(crashesDirectory, 'metadata');
        try {
            yield (0, fs_1.unlinkAsync)(metadataPath);
            utils_1.logger.log('Deleted Crashpad metadata file', metadataPath);
        }
        catch (e) {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            if (e.code && e.code == 'EBUSY') {
                // Since Crashpad probably still has the metadata file open, we make a few attempts to delete it, backing
                // off and waiting longer each time.
                setTimeout(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
                    yield deleteCrashpadMetadataFile(crashesDirectory, waitMs * 2);
                }), waitMs);
            }
        }
    });
}
function readDirsAsync(paths) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const found = [];
        for (const path of paths) {
            try {
                const files = yield (0, fs_1.readDirAsync)(path);
                found.push(...files.map((file) => (0, path_1.join)(path, file)));
            }
            catch (_) {
                //
            }
        }
        return found;
    });
}
function crashpadMinidumpLoader() {
    const crashesDirectory = (0, electron_normalize_1.getCrashesDirectory)();
    const crashpadSubDirectory = process.platform === 'win32' ? 'reports' : 'completed';
    const dumpDirectories = [(0, path_1.join)(crashesDirectory, crashpadSubDirectory)];
    if (process.platform === 'darwin') {
        dumpDirectories.push((0, path_1.join)(crashesDirectory, 'pending'));
    }
    return createMinidumpLoader(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
        yield deleteCrashpadMetadataFile(crashesDirectory).catch((error) => utils_1.logger.error(error));
        const files = yield readDirsAsync(dumpDirectories);
        return files
            .filter((file) => file.endsWith('.dmp'))
            .map((path) => {
            return {
                path,
                load: () => (0, fs_1.readFileAsync)(path),
            };
        });
    }));
}
/** Crudely parses the minidump from the Breakpad multipart file */
function minidumpFromBreakpadMultipart(file) {
    const binaryStart = file.lastIndexOf('Content-Type: application/octet-stream');
    if (binaryStart > 0) {
        const dumpStart = file.indexOf('MDMP', binaryStart);
        const dumpEnd = file.lastIndexOf('----------------------------');
        if (dumpStart > 0 && dumpEnd > 0 && dumpEnd > dumpStart) {
            return file.subarray(dumpStart, dumpEnd);
        }
    }
    return undefined;
}
function removeBreakpadMetadata(crashesDirectory, paths) {
    // Remove all metadata files and forget about them.
    void Promise.all(paths
        .filter((file) => file.endsWith('.txt') && !file.endsWith('log.txt'))
        .map((file) => tslib_1.__awaiter(this, void 0, void 0, function* () {
        const path = (0, path_1.join)(crashesDirectory, file);
        try {
            yield (0, fs_1.unlinkAsync)(path);
        }
        catch (e) {
            utils_1.logger.warn('Could not delete', path);
        }
    })));
}
function breakpadMinidumpLoader() {
    const crashesDirectory = (0, electron_normalize_1.getCrashesDirectory)();
    return createMinidumpLoader(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
        // Breakpad stores all minidump files along with a metadata file directly in
        // the crashes directory.
        const files = yield (0, fs_1.readDirAsync)(crashesDirectory);
        removeBreakpadMetadata(crashesDirectory, files);
        return files
            .filter((file) => file.endsWith('.dmp'))
            .map((file) => {
            const path = (0, path_1.join)(crashesDirectory, file);
            return {
                path,
                load: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
                    const file = yield (0, fs_1.readFileAsync)(path);
                    return minidumpFromBreakpadMultipart(file) || file;
                }),
            };
        })
            .filter((m) => !!m);
    }));
}
/**
 * Gets the minidump loader
 */
function getMinidumpLoader() {
    return (0, electron_normalize_1.usesCrashpad)() ? crashpadMinidumpLoader() : breakpadMinidumpLoader();
}
exports.getMinidumpLoader = getMinidumpLoader;
//# sourceMappingURL=minidump-loader.js.map{"version":3,"file":"minidump-loader.js","sourceRoot":"","sources":["../../../src/main/integrations/sentry-minidump/minidump-loader.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AACvC,+BAA4B;AAE5B,iEAA6E;AAC7E,iCAA+E;AAE/E,oEAAoE;AACpE,MAAM,OAAO,GAAG,EAAE,CAAC;AASnB,SAAe,WAAW,CACxB,KAAU,EACV,SAAkD,EAClD,OAAa;;QAEb,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC;CAAA;AAED,yBAAyB;AACzB,SAAsB,cAAc,CAAC,IAAkB;;QACrD,IAAI;YACF,MAAM,IAAA,gBAAW,EAAC,IAAI,CAAC,IAAI,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B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;gBACrD,CAAC,CAAA;aACF,CAAC;QACJ,CAAC,CAAC;aACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAA,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,IAAA,iCAAY,GAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,sBAAsB,EAAE,CAAC;AAC9E,CAAC;AAFD,8CAEC","sourcesContent":["import { logger } from '@sentry/utils';\nimport { join } from 'path';\n\nimport { getCrashesDirectory, usesCrashpad } from '../../electron-normalize';\nimport { readDirAsync, readFileAsync, statAsync, unlinkAsync } from '../../fs';\n\n/** Maximum number of days to keep a minidump before deleting it. */\nconst MAX_AGE = 30;\n\nexport interface MinidumpFile {\n  path: string;\n  load(): Promise<Uint8Array | undefined>;\n}\n\nexport type MinidumpLoader = () => Promise<MinidumpFile[]>;\n\nasync function filterAsync<T>(\n  array: T[],\n  predicate: (item: T) => Promise<boolean> | boolean,\n  thisArg?: any,\n): Promise<T[]> {\n  const verdicts = await Promise.all(array.map(predicate, thisArg));\n  return array.filter((_, index) => verdicts[index]);\n}\n\n/** Deletes a minidump */\nexport async function deleteMinidump(dump: MinidumpFile): Promise<void> {\n  try {\n    await unlinkAsync(dump.path);\n  } catch (e) {\n    logger.warn('Could not delete', dump.path);\n  }\n}\n\nfunction createMinidumpLoader(fetchMinidumpsImpl: MinidumpLoader): MinidumpLoader {\n  const knownPaths: string[] = [];\n\n  return async () => {\n    const minidumps = await fetchMinidumpsImpl();\n    logger.log(`Found ${minidumps.length} minidumps`);\n\n    const oldestMs = new Date().getTime() - MAX_AGE * 24 * 3_600 * 1_000;\n    return filterAsync(minidumps, async (dump) => {\n      // Skip files that we have seen before\n      if (knownPaths.indexOf(dump.path) >= 0) {\n        return false;\n      }\n\n      // Lock this minidump until we have uploaded it or an error occurs and we\n      // remove it from the file system.\n      knownPaths.push(dump.path);\n\n      // We do not want to upload minidumps that have been generated before a\n      // certain threshold. Those old files can be deleted immediately.\n      const stats = await statAsync(dump.path);\n      if (stats.birthtimeMs < oldestMs) {\n        await deleteMinidump(dump);\n        knownPaths.splice(knownPaths.indexOf(dump.path), 1);\n        return false;\n      }\n\n      return true;\n    });\n  };\n}\n\n/** Attempts to remove the metadata file so Crashpad doesn't output `failed to stat report` errors to the console */\nasync function deleteCrashpadMetadataFile(crashesDirectory: string, waitMs: number = 100): Promise<void> {\n  if (waitMs > 2_000) {\n    return;\n  }\n\n  const metadataPath = join(crashesDirectory, 'metadata');\n  try {\n    await unlinkAsync(metadataPath);\n    logger.log('Deleted Crashpad metadata file', metadataPath);\n  } catch (e: any) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    if (e.code && e.code == 'EBUSY') {\n      // Since Crashpad probably still has the metadata file open, we make a few attempts to delete it, backing\n      // off and waiting longer each time.\n      setTimeout(async () => {\n        await deleteCrashpadMetadataFile(crashesDirectory, waitMs * 2);\n      }, waitMs);\n    }\n  }\n}\n\nasync function readDirsAsync(paths: string[]): Promise<string[]> {\n  const found: string[] = [];\n  for (const path of paths) {\n    try {\n      const files = await readDirAsync(path);\n      found.push(...files.map((file) => join(path, file)));\n    } catch (_) {\n      //\n    }\n  }\n  return found;\n}\n\nfunction crashpadMinidumpLoader(): MinidumpLoader {\n  const crashesDirectory: string = getCrashesDirectory();\n  const crashpadSubDirectory = process.platform === 'win32' ? 'reports' : 'completed';\n\n  const dumpDirectories = [join(crashesDirectory, crashpadSubDirectory)];\n\n  if (process.platform === 'darwin') {\n    dumpDirectories.push(join(crashesDirectory, 'pending'));\n  }\n\n  return createMinidumpLoader(async () => {\n    await deleteCrashpadMetadataFile(crashesDirectory).catch((error) => logger.error(error));\n\n    const files = await readDirsAsync(dumpDirectories);\n    return files\n      .filter((file) => file.endsWith('.dmp'))\n      .map((path) => {\n        return {\n          path,\n          load: () => readFileAsync(path),\n        };\n      });\n  });\n}\n\n/** Crudely parses the minidump from the Breakpad multipart file */\nfunction minidumpFromBreakpadMultipart(file: Buffer): Buffer | undefined {\n  const binaryStart = file.lastIndexOf('Content-Type: application/octet-stream');\n  if (binaryStart > 0) {\n    const dumpStart = file.indexOf('MDMP', binaryStart);\n    const dumpEnd = file.lastIndexOf('----------------------------');\n\n    if (dumpStart > 0 && dumpEnd > 0 && dumpEnd > dumpStart) {\n      return file.subarray(dumpStart, dumpEnd);\n    }\n  }\n\n  return undefined;\n}\n\nfunction removeBreakpadMetadata(crashesDirectory: string, paths: string[]): void {\n  // Remove all metadata files and forget about them.\n  void Promise.all(\n    paths\n      .filter((file) => file.endsWith('.txt') && !file.endsWith('log.txt'))\n      .map(async (file) => {\n        const path = join(crashesDirectory, file);\n        try {\n          await unlinkAsync(path);\n        } catch (e) {\n          logger.warn('Could not delete', path);\n        }\n      }),\n  );\n}\n\nfunction breakpadMinidumpLoader(): MinidumpLoader {\n  const crashesDirectory: string = getCrashesDirectory();\n\n  return createMinidumpLoader(async () => {\n    // Breakpad stores all minidump files along with a metadata file directly in\n    // the crashes directory.\n    const files = await readDirAsync(crashesDirectory);\n\n    removeBreakpadMetadata(crashesDirectory, files);\n\n    return files\n      .filter((file) => file.endsWith('.dmp'))\n      .map((file) => {\n        const path = join(crashesDirectory, file);\n\n        return {\n          path,\n          load: async () => {\n            const file = await readFileAsync(path);\n            return minidumpFromBreakpadMultipart(file) || file;\n          },\n        };\n      })\n      .filter((m) => !!m);\n  });\n}\n\n/**\n * Gets the minidump loader\n */\nexport function getMinidumpLoader(): MinidumpLoader {\n  return usesCrashpad() ? crashpadMinidumpLoader() : breakpadMinidumpLoader();\n}\n"]}import { ElectronMainOptionsInternal } from './sdk';
/** Sets up communication channels with the renderer */
export declare function configureIPC(options: ElectronMainOptionsInternal): void;
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../src/main/ipc.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,2BAA2B,EAAE,MAAM,OAAO,CAAC;AA+JpD,uDAAuD;AACvD,wBAAgB,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAcvE"}Object.defineProperty(exports, "__esModule", { value: true });
exports.configureIPC = void 0;
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const util_1 = require("util");
const common_1 = require("../common");
const electron_normalize_1 = require("./electron-normalize");
function captureEventFromRenderer(options, event, attachments, contents) {
    var _a, _b, _c, _d;
    const process = contents ? ((_a = options === null || options === void 0 ? void 0 : options.getRendererName) === null || _a === void 0 ? void 0 : _a.call(options, contents)) || 'renderer' : 'renderer';
    // Ensure breadcrumbs are empty as they sent via scope updates
    event.breadcrumbs = event.breadcrumbs || [];
    // Remove the environment as it defaults to 'production' and overwrites the main process environment
    delete event.environment;
    // Remove the SDK info as we want the Electron SDK to be the one reporting the event
    (_b = event.sdk) === null || _b === void 0 ? true : delete _b.name;
    (_c = event.sdk) === null || _c === void 0 ? true : delete _c.version;
    (_d = event.sdk) === null || _d === void 0 ? true : delete _d.packages;
    (0, core_1.captureEvent)((0, common_1.mergeEvents)(event, { tags: { 'event.process': process } }), { attachments });
}
function handleEvent(options, jsonEvent, contents) {
    let event;
    try {
        event = JSON.parse(jsonEvent);
    }
    catch (_a) {
        utils_1.logger.warn('sentry-electron received an invalid event message');
        return;
    }
    captureEventFromRenderer(options, event, [], contents);
}
function eventFromEnvelope(envelope) {
    let event;
    const attachments = [];
    (0, utils_1.forEachEnvelopeItem)(envelope, (item, type) => {
        if (type === 'event' || type === 'transaction') {
            event = Array.isArray(item) ? item[1] : undefined;
        }
        else if (type === 'attachment') {
            const [headers, data] = item;
            attachments.push({
                filename: headers.filename,
                attachmentType: headers.attachment_type,
                contentType: headers.content_type,
                data,
            });
        }
    });
    return event ? [event, attachments] : undefined;
}
function handleEnvelope(options, env, contents) {
    var _a, _b;
    const envelope = (0, utils_1.parseEnvelope)(env, new util_1.TextEncoder(), new util_1.TextDecoder());
    const eventAndAttachments = eventFromEnvelope(envelope);
    if (eventAndAttachments) {
        const [event, attachments] = eventAndAttachments;
        captureEventFromRenderer(options, event, attachments, contents);
    }
    else {
        const normalizedEnvelope = (0, common_1.normalizeUrlsInReplayEnvelope)(envelope, electron_1.app.getAppPath());
        // Pass other types of envelope straight to the transport
        void ((_b = (_a = (0, core_1.getCurrentHub)().getClient()) === null || _a === void 0 ? void 0 : _a.getTransport()) === null || _b === void 0 ? void 0 : _b.send(normalizedEnvelope));
    }
}
/** Is object defined and has keys */
function hasKeys(obj) {
    return obj != undefined && Object.keys(obj).length > 0;
}
/**
 * Handle scope updates from renderer processes
 */
function handleScope(options, jsonScope) {
    let rendererScope;
    try {
        rendererScope = JSON.parse(jsonScope);
    }
    catch (_a) {
        utils_1.logger.warn('sentry-electron received an invalid scope message');
        return;
    }
    const sentScope = core_1.Scope.clone(rendererScope);
    /* eslint-disable @typescript-eslint/no-unsafe-member-access */
    (0, core_1.configureScope)((scope) => {
        if (hasKeys(sentScope._user)) {
            scope.setUser(sentScope._user);
        }
        if (hasKeys(sentScope._tags)) {
            scope.setTags(sentScope._tags);
        }
        if (hasKeys(sentScope._extra)) {
            scope.setExtras(sentScope._extra);
        }
        for (const attachment of sentScope._attachments || []) {
            scope.addAttachment(attachment);
        }
        const breadcrumb = sentScope._breadcrumbs.pop();
        if (breadcrumb) {
            scope.addBreadcrumb(breadcrumb, (options === null || options === void 0 ? void 0 : options.maxBreadcrumbs) || 100);
        }
    });
    /* eslint-enable @typescript-eslint/no-unsafe-member-access */
}
/** Enables Electron protocol handling */
function configureProtocol(options) {
    if (electron_1.app.isReady()) {
        throw new utils_1.SentryError("Sentry SDK should be initialized before the Electron app 'ready' event is fired");
    }
    electron_1.protocol.registerSchemesAsPrivileged([
        {
            scheme: common_1.PROTOCOL_SCHEME,
            privileges: { bypassCSP: true, corsEnabled: true, supportFetchAPI: true, secure: true },
        },
    ]);
    electron_normalize_1.whenAppReady
        .then(() => {
        for (const sesh of options.getSessions()) {
            sesh.protocol.registerStringProtocol(common_1.PROTOCOL_SCHEME, (request, callback) => {
                var _a, _b;
                const data = (_b = (_a = request.uploadData) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.bytes;
                if (request.url.startsWith(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.EVENT}`) && data) {
                    handleEvent(options, data.toString());
                }
                else if (request.url.startsWith(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.SCOPE}`) && data) {
                    handleScope(options, data.toString());
                }
                else if (request.url.startsWith(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.ENVELOPE}`) && data) {
                    handleEnvelope(options, data);
                }
                callback('');
            });
        }
    })
        .catch((error) => utils_1.logger.error(error));
}
/**
 * Hooks IPC for communication with the renderer processes
 */
function configureClassic(options) {
    electron_1.ipcMain.on(common_1.IPCChannel.EVENT, ({ sender }, jsonEvent) => handleEvent(options, jsonEvent, sender));
    electron_1.ipcMain.on(common_1.IPCChannel.SCOPE, (_, jsonScope) => handleScope(options, jsonScope));
    electron_1.ipcMain.on(common_1.IPCChannel.ENVELOPE, ({ sender }, env) => handleEnvelope(options, env, sender));
}
/** Sets up communication channels with the renderer */
function configureIPC(options) {
    if (!(0, electron_normalize_1.supportsFullProtocol)() && options.ipcMode === common_1.IPCMode.Protocol) {
        throw new utils_1.SentryError('IPCMode.Protocol is only supported in Electron >= v5');
    }
    // eslint-disable-next-line no-bitwise
    if ((0, electron_normalize_1.supportsFullProtocol)() && (options.ipcMode & common_1.IPCMode.Protocol) > 0) {
        configureProtocol(options);
    }
    // eslint-disable-next-line no-bitwise
    if ((options.ipcMode & common_1.IPCMode.Classic) > 0) {
        configureClassic(options);
    }
}
exports.configureIPC = configureIPC;
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../src/main/ipc.ts"],"names":[],"mapp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AC,CAAC;KAC5B;IAED,sCAAsC;IACtC,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,gBAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC3C,gBAAgB,CAAC,OAAO,CAAC,CAAC;KAC3B;AACH,CAAC;AAdD,oCAcC","sourcesContent":["import { captureEvent, configureScope, getCurrentHub, Scope } from '@sentry/core';\nimport { Attachment, AttachmentItem, Envelope, Event, EventItem } from '@sentry/types';\nimport { forEachEnvelopeItem, logger, parseEnvelope, SentryError } from '@sentry/utils';\nimport { app, ipcMain, protocol, WebContents } from 'electron';\nimport { TextDecoder, TextEncoder } from 'util';\n\nimport { IPCChannel, IPCMode, mergeEvents, normalizeUrlsInReplayEnvelope, PROTOCOL_SCHEME } from '../common';\nimport { supportsFullProtocol, whenAppReady } from './electron-normalize';\nimport { ElectronMainOptionsInternal } from './sdk';\n\nfunction captureEventFromRenderer(\n  options: ElectronMainOptionsInternal,\n  event: Event,\n  attachments: Attachment[],\n  contents?: WebContents,\n): void {\n  const process = contents ? options?.getRendererName?.(contents) || 'renderer' : 'renderer';\n\n  // Ensure breadcrumbs are empty as they sent via scope updates\n  event.breadcrumbs = event.breadcrumbs || [];\n\n  // Remove the environment as it defaults to 'production' and overwrites the main process environment\n  delete event.environment;\n\n  // Remove the SDK info as we want the Electron SDK to be the one reporting the event\n  delete event.sdk?.name;\n  delete event.sdk?.version;\n  delete event.sdk?.packages;\n\n  captureEvent(mergeEvents(event, { tags: { 'event.process': process } }), { attachments });\n}\n\nfunction handleEvent(options: ElectronMainOptionsInternal, jsonEvent: string, contents?: WebContents): void {\n  let event: Event;\n  try {\n    event = JSON.parse(jsonEvent) as Event;\n  } catch {\n    logger.warn('sentry-electron received an invalid event message');\n    return;\n  }\n\n  captureEventFromRenderer(options, event, [], contents);\n}\n\nfunction eventFromEnvelope(envelope: Envelope): [Event, Attachment[]] | undefined {\n  let event: Event | undefined;\n  const attachments: Attachment[] = [];\n\n  forEachEnvelopeItem(envelope, (item, type) => {\n    if (type === 'event' || type === 'transaction') {\n      event = Array.isArray(item) ? (item as EventItem)[1] : undefined;\n    } else if (type === 'attachment') {\n      const [headers, data] = item as AttachmentItem;\n\n      attachments.push({\n        filename: headers.filename,\n        attachmentType: headers.attachment_type,\n        contentType: headers.content_type,\n        data,\n      });\n    }\n  });\n\n  return event ? [event, attachments] : undefined;\n}\n\nfunction handleEnvelope(options: ElectronMainOptionsInternal, env: Uint8Array | string, contents?: WebContents): void {\n  const envelope = parseEnvelope(env, new TextEncoder(), new TextDecoder());\n\n  const eventAndAttachments = eventFromEnvelope(envelope);\n  if (eventAndAttachments) {\n    const [event, attachments] = eventAndAttachments;\n    captureEventFromRenderer(options, event, attachments, contents);\n  } else {\n    const normalizedEnvelope = normalizeUrlsInReplayEnvelope(envelope, app.getAppPath());\n    // Pass other types of envelope straight to the transport\n    void getCurrentHub().getClient()?.getTransport()?.send(normalizedEnvelope);\n  }\n}\n\n/** Is object defined and has keys */\nfunction hasKeys(obj: any): boolean {\n  return obj != undefined && Object.keys(obj).length > 0;\n}\n\n/**\n * Handle scope updates from renderer processes\n */\nfunction handleScope(options: ElectronMainOptionsInternal, jsonScope: string): void {\n  let rendererScope: Scope;\n  try {\n    rendererScope = JSON.parse(jsonScope) as Scope;\n  } catch {\n    logger.warn('sentry-electron received an invalid scope message');\n    return;\n  }\n\n  const sentScope = Scope.clone(rendererScope) as any;\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  configureScope((scope) => {\n    if (hasKeys(sentScope._user)) {\n      scope.setUser(sentScope._user);\n    }\n\n    if (hasKeys(sentScope._tags)) {\n      scope.setTags(sentScope._tags);\n    }\n\n    if (hasKeys(sentScope._extra)) {\n      scope.setExtras(sentScope._extra);\n    }\n\n    for (const attachment of sentScope._attachments || []) {\n      scope.addAttachment(attachment);\n    }\n\n    const breadcrumb = sentScope._breadcrumbs.pop();\n    if (breadcrumb) {\n      scope.addBreadcrumb(breadcrumb, options?.maxBreadcrumbs || 100);\n    }\n  });\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n}\n\n/** Enables Electron protocol handling */\nfunction configureProtocol(options: ElectronMainOptionsInternal): void {\n  if (app.isReady()) {\n    throw new SentryError(\"Sentry SDK should be initialized before the Electron app 'ready' event is fired\");\n  }\n\n  protocol.registerSchemesAsPrivileged([\n    {\n      scheme: PROTOCOL_SCHEME,\n      privileges: { bypassCSP: true, corsEnabled: true, supportFetchAPI: true, secure: true },\n    },\n  ]);\n\n  whenAppReady\n    .then(() => {\n      for (const sesh of options.getSessions()) {\n        sesh.protocol.registerStringProtocol(PROTOCOL_SCHEME, (request, callback) => {\n          const data = request.uploadData?.[0]?.bytes;\n\n          if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}`) && data) {\n            handleEvent(options, data.toString());\n          } else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}`) && data) {\n            handleScope(options, data.toString());\n          } else if (request.url.startsWith(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}`) && data) {\n            handleEnvelope(options, data);\n          }\n\n          callback('');\n        });\n      }\n    })\n    .catch((error) => logger.error(error));\n}\n\n/**\n * Hooks IPC for communication with the renderer processes\n */\nfunction configureClassic(options: ElectronMainOptionsInternal): void {\n  ipcMain.on(IPCChannel.EVENT, ({ sender }, jsonEvent: string) => handleEvent(options, jsonEvent, sender));\n  ipcMain.on(IPCChannel.SCOPE, (_, jsonScope: string) => handleScope(options, jsonScope));\n  ipcMain.on(IPCChannel.ENVELOPE, ({ sender }, env: Uint8Array | string) => handleEnvelope(options, env, sender));\n}\n\n/** Sets up communication channels with the renderer */\nexport function configureIPC(options: ElectronMainOptionsInternal): void {\n  if (!supportsFullProtocol() && options.ipcMode === IPCMode.Protocol) {\n    throw new SentryError('IPCMode.Protocol is only supported in Electron >= v5');\n  }\n\n  // eslint-disable-next-line no-bitwise\n  if (supportsFullProtocol() && (options.ipcMode & IPCMode.Protocol) > 0) {\n    configureProtocol(options);\n  }\n\n  // eslint-disable-next-line no-bitwise\n  if ((options.ipcMode & IPCMode.Classic) > 0) {\n    configureClassic(options);\n  }\n}\n"]}interface Renderer {
    id: number;
    url?: string;
    title?: string;
}
/**
 * Enable tracking of renderer properties via events
 *
 * This allows us to get the last known state of a renderer even if it's been destroyed
 **/
export declare function trackRendererProperties(): void;
/** Gets the properties for a renderer */
export declare function getRendererProperties(id: number): Renderer | undefined;
export {};
//# sourceMappingURL=renderers.d.ts.map{"version":3,"file":"renderers.d.ts","sourceRoot":"","sources":["../src/main/renderers.ts"],"names":[],"mappings":"AAKA,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;IAII;AACJ,wBAAgB,uBAAuB,IAAI,IAAI,CAkC9C;AAED,yCAAyC;AACzC,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAEtE"}Object.defineProperty(exports, "__esModule", { value: true });
exports.getRendererProperties = exports.trackRendererProperties = void 0;
const electron_1 = require("electron");
const common_1 = require("../common");
const electron_normalize_1 = require("./electron-normalize");
let RENDERERS;
/**
 * Enable tracking of renderer properties via events
 *
 * This allows us to get the last known state of a renderer even if it's been destroyed
 **/
function trackRendererProperties() {
    if (RENDERERS) {
        return;
    }
    const renderers = (RENDERERS = new Map());
    function updateUrl(id, url) {
        const state = renderers.get(id) || { id };
        state.url = (0, common_1.normalizeUrl)(url, electron_1.app.getAppPath());
        renderers.set(id, state);
    }
    function updateTitle(id, title) {
        const state = renderers.get(id) || { id };
        state.title = title;
        renderers.set(id, state);
    }
    (0, electron_normalize_1.onWebContentsCreated)((contents) => {
        const id = contents.id;
        contents.on('did-navigate', (_, url) => updateUrl(id, url));
        contents.on('did-navigate-in-page', (_, url) => updateUrl(id, url));
        contents.on('page-title-updated', (_, title) => updateTitle(id, title));
        contents.on('destroyed', () => {
            // We need to delay since consumers of this API sometimes need to
            // access the state shortly after a renderer is destroyed
            setTimeout(() => {
                renderers.delete(id);
            }, 5000);
        });
    });
}
exports.trackRendererProperties = trackRendererProperties;
/** Gets the properties for a renderer */
function getRendererProperties(id) {
    return RENDERERS === null || RENDERERS === void 0 ? void 0 : RENDERERS.get(id);
}
exports.getRendererProperties = getRendererProperties;
//# sourceMappingURL=renderers.js.map{"version":3,"file":"renderers.js","sourceRoot":"","sources":["../src/main/renderers.ts"],"names":[],"mappings":";;AAAA,uCAA+B;AAE/B,sCAAyC;AACzC,6DAA4D;AAQ5D,IAAI,SAA4C,CAAC;AAEjD;;;;IAII;AACJ,SAAgB,uBAAuB;IACrC,IAAI,SAAS,EAAE;QACb,OAAO;KACR;IAED,MAAM,SAAS,GAAG,CAAC,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC,CAAC;IAE5D,SAAS,SAAS,CAAC,EAAU,EAAE,GAAW;QACxC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,GAAG,GAAG,IAAA,qBAAY,EAAC,GAAG,EAAE,cAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAChD,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS,WAAW,CAAC,EAAU,EAAE,KAAa;QAC5C,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;QAC1C,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;QACpB,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,IAAA,yCAAoB,EAAC,CAAC,QAAQ,EAAE,EAAE;QAChC,MAAM,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;QAEvB,QAAQ,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5D,QAAQ,CAAC,EAAE,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACpE,QAAQ,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAExE,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YAC5B,iEAAiE;YACjE,yDAAyD;YACzD,UAAU,CAAC,GAAG,EAAE;gBACd,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvB,CAAC,EAAE,IAAI,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAlCD,0DAkCC;AAED,yCAAyC;AACzC,SAAgB,qBAAqB,CAAC,EAAU;IAC9C,OAAO,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC;AAFD,sDAEC","sourcesContent":["import { app } from 'electron';\n\nimport { normalizeUrl } from '../common';\nimport { onWebContentsCreated } from './electron-normalize';\n\ninterface Renderer {\n  id: number;\n  url?: string;\n  title?: string;\n}\n\nlet RENDERERS: Map<number, Renderer> | undefined;\n\n/**\n * Enable tracking of renderer properties via events\n *\n * This allows us to get the last known state of a renderer even if it's been destroyed\n **/\nexport function trackRendererProperties(): void {\n  if (RENDERERS) {\n    return;\n  }\n\n  const renderers = (RENDERERS = new Map<number, Renderer>());\n\n  function updateUrl(id: number, url: string): void {\n    const state = renderers.get(id) || { id };\n    state.url = normalizeUrl(url, app.getAppPath());\n    renderers.set(id, state);\n  }\n\n  function updateTitle(id: number, title: string): void {\n    const state = renderers.get(id) || { id };\n    state.title = title;\n    renderers.set(id, state);\n  }\n\n  onWebContentsCreated((contents) => {\n    const id = contents.id;\n\n    contents.on('did-navigate', (_, url) => updateUrl(id, url));\n    contents.on('did-navigate-in-page', (_, url) => updateUrl(id, url));\n    contents.on('page-title-updated', (_, title) => updateTitle(id, title));\n\n    contents.on('destroyed', () => {\n      // We need to delay since consumers of this API sometimes need to\n      // access the state shortly after a renderer is destroyed\n      setTimeout(() => {\n        renderers.delete(id);\n      }, 5000);\n    });\n  });\n}\n\n/** Gets the properties for a renderer */\nexport function getRendererProperties(id: number): Renderer | undefined {\n  return RENDERERS?.get(id);\n}\n"]}import { IPCMode } from '../common';
import { NodeOptions } from '@sentry/node';
import { Integration, Options } from '@sentry/types';
import { Session, WebContents } from 'electron';
import { ElectronOfflineTransportOptions } from './transports/electron-offline-net';
export declare const defaultIntegrations: Integration[];
export interface ElectronMainOptionsInternal extends Options<ElectronOfflineTransportOptions> {
    /**
     * Inter-process communication mode to receive event and scope from renderers
     *
     * IPCMode.Classic - Configures Electron IPC
     * IPCMode.Protocol - Configures a custom protocol
     * IPCMode.Both - Configures both IPC and custom protocol
     *
     * defaults to IPCMode.Both for maximum compatibility
     */
    ipcMode: IPCMode;
    /**
     * A function that returns an array of Electron session objects
     *
     * These sessions are used to configure communication between the Electron
     * main and renderer processes.
     *
     * Defaults to () => [session.defaultSession]
     */
    getSessions: () => Session[];
    /**
     * Callback to allow custom naming of renderer processes.
     *
     * If the callback is not set, or it returns `undefined`, the default naming
     * scheme is used.
     */
    getRendererName?: (contents: WebContents) => string | undefined;
    /**
     * Screenshots may contain PII and is an opt-in feature
     *
     * If set to true, screenshots will be captured and included with all JavaScript events.
     * Screenshots are not included for native crashes since it's not possible to capture images of crashed Electron
     * renderers.
     */
    attachScreenshot?: boolean;
}
export type ElectronMainOptions = Pick<Partial<ElectronMainOptionsInternal>, 'getSessions' | 'ipcMode'> & Omit<ElectronMainOptionsInternal, 'getSessions' | 'ipcMode'> & NodeOptions;
/**
 * Initialize Sentry in the Electron main process
 */
export declare function init(userOptions: ElectronMainOptions): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/main/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,OAAO,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EAAoE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC7G,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,EAAW,WAAW,EAAE,MAAM,UAAU,CAAC;AAgBzD,OAAO,EAAE,+BAA+B,EAAgC,MAAM,mCAAmC,CAAC;AAGlH,eAAO,MAAM,mBAAmB,EAAE,WAAW,EAa5C,CAAC;AAEF,MAAM,WAAW,2BAA4B,SAAQ,OAAO,CAAC,+BAA+B,CAAC;IAC3F;;;;;;;;OAQG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;;;;;OAOG;IACH,WAAW,EAAE,MAAM,OAAO,EAAE,CAAC;IAE7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,MAAM,GAAG,SAAS,CAAC;IAEhE;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAGD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,GACrG,IAAI,CAAC,2BAA2B,EAAE,aAAa,GAAG,SAAS,CAAC,GAC5D,WAAW,CAAC;AAQd;;GAEG;AACH,wBAAgB,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,IAAI,CA8B3D"}Object.defineProperty(exports, "__esModule", { value: true });
exports.init = exports.defaultIntegrations = void 0;
const common_1 = require("../common");
(0, common_1.ensureProcess)('main');
const node_1 = require("@sentry/node");
const electron_1 = require("electron");
const context_1 = require("./context");
const integrations_1 = require("./integrations");
const ipc_1 = require("./ipc");
const electron_offline_net_1 = require("./transports/electron-offline-net");
const version_1 = require("./version");
exports.defaultIntegrations = [
    new integrations_1.SentryMinidump(),
    new integrations_1.ElectronBreadcrumbs(),
    new integrations_1.Net(),
    new integrations_1.MainContext(),
    new integrations_1.ChildProcess(),
    new integrations_1.OnUncaughtException(),
    new integrations_1.PreloadInjection(),
    new integrations_1.AdditionalContext(),
    new integrations_1.Screenshots(),
    ...node_1.defaultIntegrations.filter((integration) => integration.name !== 'OnUncaughtException' && integration.name !== 'Context'),
];
const defaultOptions = {
    _metadata: { sdk: { name: 'sentry.javascript.electron', version: version_1.SDK_VERSION } },
    ipcMode: common_1.IPCMode.Both,
    getSessions: () => [electron_1.session.defaultSession],
};
/**
 * Initialize Sentry in the Electron main process
 */
function init(userOptions) {
    const options = Object.assign(defaultOptions, userOptions);
    const defaults = exports.defaultIntegrations;
    // If we don't set a release, @sentry/node will automatically fetch from environment variables
    if (options.release === undefined) {
        options.release = (0, context_1.getDefaultReleaseName)();
    }
    // If we don't set an environment, @sentry/core defaults to production
    if (options.environment === undefined) {
        options.environment = (0, context_1.getDefaultEnvironment)();
    }
    // Unless autoSessionTracking is specifically disabled, we track sessions as the
    // lifetime of the Electron main process
    if (options.autoSessionTracking !== false) {
        defaults.push(new integrations_1.MainProcessSession());
        // We don't want nodejs autoSessionTracking
        options.autoSessionTracking = false;
    }
    setDefaultIntegrations(defaults, options);
    if (options.dsn && options.transport === undefined) {
        options.transport = electron_offline_net_1.makeElectronOfflineTransport;
    }
    (0, ipc_1.configureIPC)(options);
    (0, node_1.init)(options);
}
exports.init = init;
/** Sets the default integrations and ensures that multiple minidump integrations are not enabled */
function setDefaultIntegrations(defaults, options) {
    if (options.defaultIntegrations === undefined) {
        // If ElectronMinidump has been included, automatically remove SentryMinidump
        if (Array.isArray(options.integrations) && options.integrations.some((i) => i.name === 'ElectronMinidump')) {
            options.defaultIntegrations = defaults.filter((integration) => integration.name !== 'SentryMinidump');
            return;
        }
        else if (typeof options.integrations === 'function') {
            const originalFn = options.integrations;
            options.integrations = (integrations) => {
                const userIntegrations = originalFn(integrations);
                return userIntegrations.some((i) => i.name === 'ElectronMinidump')
                    ? userIntegrations.filter((integration) => integration.name !== 'SentryMinidump')
                    : userIntegrations;
            };
        }
        options.defaultIntegrations = defaults;
    }
}
//# sourceMappingURL=sdk.js.map{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/main/sdk.ts"],"names":[],"mappings":";;AAAA,sCAAmD;AACnD,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC;AAEtB,uCAA6G;AAE7G,uCAAyD;AAEzD,uCAAyE;AACzE,iDAWwB;AACxB,+BAAqC;AACrC,4EAAkH;AAClH,uCAAwC;AAE3B,QAAA,mBAAmB,GAAkB;IAChD,IAAI,6BAAc,EAAE;IACpB,IAAI,kCAAmB,EAAE;IACzB,IAAI,kBAAG,EAAE;IACT,IAAI,0BAAW,EAAE;IACjB,IAAI,2BAAY,EAAE;IAClB,IAAI,kCAAmB,EAAE;IACzB,IAAI,+BAAgB,EAAE;IACtB,IAAI,gCAAiB,EAAE;IACvB,IAAI,0BAAW,EAAE;IACjB,GAAG,0BAAuB,CAAC,MAAM,CAC/B,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,qBAAqB,IAAI,WAAW,CAAC,IAAI,KAAK,SAAS,CAC9F;CACF,CAAC;AA+CF,MAAM,cAAc,GAAgC;IAClD,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,OAAO,EAAE,qBAAW,EAAE,EAAE;IAChF,OAAO,EAAE,gBAAO,CAAC,IAAI;IACrB,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,kBAAO,CAAC,cAAc,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,SAAgB,IAAI,CAAC,WAAgC;IACnD,MAAM,OAAO,GAAgC,MAAM,CAAC,MAAM,CAAC,cA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,gBAAgB,CAAC,CAAC;YACtG,OAAO;SACR;aAAM,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,UAAU,EAAE;YACrD,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC;YAExC,OAAO,CAAC,YAAY,GAAG,CAAC,YAAY,EAAE,EAAE;gBACtC,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;gBAClD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC;oBAChE,CAAC,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,gBAAgB,CAAC;oBACjF,CAAC,CAAC,gBAAgB,CAAC;YACvB,CAAC,CAAC;SACH;QAED,OAAO,CAAC,mBAAmB,GAAG,QAAQ,CAAC;KACxC;AACH,CAAC","sourcesContent":["import { ensureProcess, IPCMode } from '../common';\nensureProcess('main');\n\nimport { defaultIntegrations as defaultNodeIntegrations, init as nodeInit, NodeOptions } from '@sentry/node';\nimport { Integration, Options } from '@sentry/types';\nimport { Session, session, WebContents } from 'electron';\n\nimport { getDefaultEnvironment, getDefaultReleaseName } from './context';\nimport {\n  AdditionalContext,\n  ChildProcess,\n  ElectronBreadcrumbs,\n  MainContext,\n  MainProcessSession,\n  Net,\n  OnUncaughtException,\n  PreloadInjection,\n  Screenshots,\n  SentryMinidump,\n} from './integrations';\nimport { configureIPC } from './ipc';\nimport { ElectronOfflineTransportOptions, makeElectronOfflineTransport } from './transports/electron-offline-net';\nimport { SDK_VERSION } from './version';\n\nexport const defaultIntegrations: Integration[] = [\n  new SentryMinidump(),\n  new ElectronBreadcrumbs(),\n  new Net(),\n  new MainContext(),\n  new ChildProcess(),\n  new OnUncaughtException(),\n  new PreloadInjection(),\n  new AdditionalContext(),\n  new Screenshots(),\n  ...defaultNodeIntegrations.filter(\n    (integration) => integration.name !== 'OnUncaughtException' && integration.name !== 'Context',\n  ),\n];\n\nexport interface ElectronMainOptionsInternal extends Options<ElectronOfflineTransportOptions> {\n  /**\n   * Inter-process communication mode to receive event and scope from renderers\n   *\n   * IPCMode.Classic - Configures Electron IPC\n   * IPCMode.Protocol - Configures a custom protocol\n   * IPCMode.Both - Configures both IPC and custom protocol\n   *\n   * defaults to IPCMode.Both for maximum compatibility\n   */\n  ipcMode: IPCMode;\n\n  /**\n   * A function that returns an array of Electron session objects\n   *\n   * These sessions are used to configure communication between the Electron\n   * main and renderer processes.\n   *\n   * Defaults to () => [session.defaultSession]\n   */\n  getSessions: () => Session[];\n\n  /**\n   * Callback to allow custom naming of renderer processes.\n   *\n   * If the callback is not set, or it returns `undefined`, the default naming\n   * scheme is used.\n   */\n  getRendererName?: (contents: WebContents) => string | undefined;\n\n  /**\n   * Screenshots may contain PII and is an opt-in feature\n   *\n   * If set to true, screenshots will be captured and included with all JavaScript events.\n   * Screenshots are not included for native crashes since it's not possible to capture images of crashed Electron\n   * renderers.\n   */\n  attachScreenshot?: boolean;\n}\n\n// getSessions and ipcMode properties are optional because they have defaults\nexport type ElectronMainOptions = Pick<Partial<ElectronMainOptionsInternal>, 'getSessions' | 'ipcMode'> &\n  Omit<ElectronMainOptionsInternal, 'getSessions' | 'ipcMode'> &\n  NodeOptions;\n\nconst defaultOptions: ElectronMainOptionsInternal = {\n  _metadata: { sdk: { name: 'sentry.javascript.electron', version: SDK_VERSION } },\n  ipcMode: IPCMode.Both,\n  getSessions: () => [session.defaultSession],\n};\n\n/**\n * Initialize Sentry in the Electron main process\n */\nexport function init(userOptions: ElectronMainOptions): void {\n  const options: ElectronMainOptionsInternal = Object.assign(defaultOptions, userOptions);\n  const defaults = defaultIntegrations;\n\n  // If we don't set a release, @sentry/node will automatically fetch from environment variables\n  if (options.release === undefined) {\n    options.release = getDefaultReleaseName();\n  }\n\n  // If we don't set an environment, @sentry/core defaults to production\n  if (options.environment === undefined) {\n    options.environment = getDefaultEnvironment();\n  }\n\n  // Unless autoSessionTracking is specifically disabled, we track sessions as the\n  // lifetime of the Electron main process\n  if (options.autoSessionTracking !== false) {\n    defaults.push(new MainProcessSession());\n    // We don't want nodejs autoSessionTracking\n    options.autoSessionTracking = false;\n  }\n\n  setDefaultIntegrations(defaults, options);\n\n  if (options.dsn && options.transport === undefined) {\n    options.transport = makeElectronOfflineTransport;\n  }\n\n  configureIPC(options);\n  nodeInit(options);\n}\n\n/** Sets the default integrations and ensures that multiple minidump integrations are not enabled */\nfunction setDefaultIntegrations(defaults: Integration[], options: ElectronMainOptions): void {\n  if (options.defaultIntegrations === undefined) {\n    // If ElectronMinidump has been included, automatically remove SentryMinidump\n    if (Array.isArray(options.integrations) && options.integrations.some((i) => i.name === 'ElectronMinidump')) {\n      options.defaultIntegrations = defaults.filter((integration) => integration.name !== 'SentryMinidump');\n      return;\n    } else if (typeof options.integrations === 'function') {\n      const originalFn = options.integrations;\n\n      options.integrations = (integrations) => {\n        const userIntegrations = originalFn(integrations);\n        return userIntegrations.some((i) => i.name === 'ElectronMinidump')\n          ? userIntegrations.filter((integration) => integration.name !== 'SentryMinidump')\n          : userIntegrations;\n      };\n    }\n\n    options.defaultIntegrations = defaults;\n  }\n}\n"]}/** Starts a session */
export declare function startSession(): Promise<void>;
/** Cleanly ends a session */
export declare function endSession(): Promise<void>;
/** Determines if a Date is likely to have occurred in the previous uncompleted session */
export declare function unreportedDuringLastSession(crashDate: Date | undefined): Promise<boolean>;
/** Checks if the previous session needs sending as crashed or abnormal  */
export declare function checkPreviousSession(crashed: boolean): Promise<void>;
/** Sets the current session as crashed */
export declare function sessionCrashed(): void;
//# sourceMappingURL=sessions.d.ts.map{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/main/sessions.ts"],"names":[],"mappings":"AAkBA,uBAAuB;AACvB,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAYlD;AAED,6BAA6B;AAC7B,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAuBhD;AAED,0FAA0F;AAC1F,wBAAsB,2BAA2B,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB/F;AAED,2EAA2E;AAC3E,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B1E;AAED,0CAA0C;AAC1C,wBAAgB,cAAc,IAAI,IAAI,CAuBrC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.sessionCrashed = exports.checkPreviousSession = exports.unreportedDuringLastSession = exports.endSession = exports.startSession = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const node_1 = require("@sentry/node");
const utils_1 = require("@sentry/utils");
const fs_1 = require("./fs");
const store_1 = require("./store");
const PERSIST_INTERVAL_MS = 60000;
/** Stores the app session in case of termination due to main process crash or app killed */
const sessionStore = new store_1.Store(fs_1.sentryCachePath, 'session', undefined);
/** Previous session that did not exit cleanly */
let previousSession = sessionStore.get();
let persistTimer;
/** Starts a session */
function startSession() {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const hub = (0, core_1.getCurrentHub)();
        yield sessionStore.set(hub.startSession());
        // Every PERSIST_INTERVAL, write the session to disk
        persistTimer = setInterval(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
            var _a;
            const currentSession = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
            // Only bother saving if it hasn't already ended
            if (currentSession && currentSession.status === 'ok') {
                yield sessionStore.set(currentSession);
            }
        }), PERSIST_INTERVAL_MS);
    });
}
exports.startSession = startSession;
/** Cleanly ends a session */
function endSession() {
    var _a;
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        // Once the session had ended there is no point persisting it
        if (persistTimer) {
            clearInterval(persistTimer);
        }
        const hub = (0, core_1.getCurrentHub)();
        const session = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
        if (session) {
            if (session.status === 'ok') {
                utils_1.logger.log('Ending session');
                hub.endSession();
            }
            else {
                utils_1.logger.log('Session was already ended');
            }
        }
        else {
            utils_1.logger.log('No session');
        }
        yield sessionStore.clear();
        yield (0, node_1.flush)(2000);
    });
}
exports.endSession = endSession;
/** Determines if a Date is likely to have occurred in the previous uncompleted session */
function unreportedDuringLastSession(crashDate) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        if (!crashDate) {
            return false;
        }
        const previousSessionModified = yield sessionStore.getModifiedDate();
        // There is no previous session
        if (previousSessionModified == undefined) {
            return false;
        }
        const previousSessionModifiedTime = previousSessionModified.getTime();
        const crashTime = crashDate.getTime();
        // Session could have run until modified time + persist interval
        const prevSessionEnd = previousSessionModifiedTime + PERSIST_INTERVAL_MS;
        // Event cannot have occurred before last persist time, We add a 2 second overlap to be sure
        const lastPersist = previousSessionModifiedTime - 2000;
        // If the crash occurred between the last persist and estimated end of session
        return crashTime > lastPersist && crashTime < prevSessionEnd;
    });
}
exports.unreportedDuringLastSession = unreportedDuringLastSession;
/** Checks if the previous session needs sending as crashed or abnormal  */
function checkPreviousSession(crashed) {
    var _a, _b;
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        const client = (0, core_1.getCurrentHub)().getClient();
        const previous = yield previousSession;
        if (previous && client) {
            // Ignore if the previous session is already ended
            if (previous.status !== 'ok') {
                previousSession = undefined;
                return;
            }
            const status = crashed ? 'crashed' : 'abnormal';
            utils_1.logger.log(`Found previous ${status} session`);
            const sesh = (0, core_1.makeSession)(previous);
            (0, core_1.updateSession)(sesh, {
                status,
                errors: (sesh.errors || 0) + 1,
                release: (_a = previous.attrs) === null || _a === void 0 ? void 0 : _a.release,
                environment: (_b = previous.attrs) === null || _b === void 0 ? void 0 : _b.environment,
            });
            yield client.sendSession(sesh);
            previousSession = undefined;
        }
    });
}
exports.checkPreviousSession = checkPreviousSession;
/** Sets the current session as crashed */
function sessionCrashed() {
    var _a;
    // stop persisting session
    if (persistTimer) {
        clearInterval(persistTimer);
    }
    utils_1.logger.log('Session Crashed');
    const hub = (0, core_1.getCurrentHub)();
    const session = (_a = hub.getScope()) === null || _a === void 0 ? void 0 : _a.getSession();
    if (!session) {
        utils_1.logger.log('No session to update');
        return;
    }
    if (session.status === 'ok') {
        utils_1.logger.log('Setting session as crashed');
        (0, core_1.updateSession)(session, { status: 'crashed', errors: (session.errors += 1) });
    }
    else {
        utils_1.logger.log('Session already ended');
    }
    hub.captureSession();
}
exports.sessionCrashed = sessionCrashed;
//# sourceMappingURL=sessions.js.map{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../src/main/sessions.ts"],"names":[],"mappings":";;;AAAA,uCAAyE;AACzE,uCAAiD;AAEjD,yCAAuC;AAEvC,6BAAuC;AACvC,mCAAgC;AAEhC,MAAM,mBAAmB,GAAG,KAAM,CAAC;AAEnC,4FAA4F;AAC5F,MAAM,YAAY,GAAG,IAAI,aAAK,CAA6B,oBAAe,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAElG,iDAAiD;AACjD,IAAI,eAAe,GAAsD,YAAY,CAAC,GAAG,EAAE,CAAC;AAE5F,IAAI,YAAsC,CAAC;AAE3C,uBAAuB;AACvB,SAAsB,YAAY;;QAChC,MAAM,GAAG,GAAG,IAAA,oBAAa,GAAE,CAAC;QAC5B,MAAM,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;QAE3C,oDAAoD;QACpD,YAAY,GAAG,WAAW,CAAC,GAAS,EAAE;;YACpC,MAAM,cAAc,GAAG,MAAA,GAAG,CAAC,QAAQ,EAAE,0CAAE,UAAU,EAAE,CAAC;YACpD,gDAAgD;YAChD,IAAI,cAAc,IAAI,cAAc,CAAC,MAAM,KAAK,IAAI,EAAE;gBACpD,MAAM,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;aACxC;QACH,CAAC,CAAA,EAAE,mBAAmB,CAAC,CAAC;IAC1B,CAAC;CAAA;AAZD,oCAYC;AAED,6BAA6B;AAC7B,S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IAAI,CAAC,OAAO,EAAE;QACZ,cAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACnC,OAAO;KACR;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,EAAE;QAC3B,cAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QACzC,IAAA,oBAAa,EAAC,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;KAC9E;SAAM;QACL,cAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;KACrC;IAED,GAAG,CAAC,cAAc,EAAE,CAAC;AACvB,CAAC;AAvBD,wCAuBC","sourcesContent":["import { getCurrentHub, makeSession, updateSession } from '@sentry/core';\nimport { flush, NodeClient } from '@sentry/node';\nimport { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { sentryCachePath } from './fs';\nimport { Store } from './store';\n\nconst PERSIST_INTERVAL_MS = 60_000;\n\n/** Stores the app session in case of termination due to main process crash or app killed */\nconst sessionStore = new Store<SessionContext | undefined>(sentryCachePath, 'session', undefined);\n\n/** Previous session that did not exit cleanly */\nlet previousSession: Promise<Partial<Session> | undefined> | undefined = sessionStore.get();\n\nlet persistTimer: NodeJS.Timer | undefined;\n\n/** Starts a session */\nexport async function startSession(): Promise<void> {\n  const hub = getCurrentHub();\n  await sessionStore.set(hub.startSession());\n\n  // Every PERSIST_INTERVAL, write the session to disk\n  persistTimer = setInterval(async () => {\n    const currentSession = hub.getScope()?.getSession();\n    // Only bother saving if it hasn't already ended\n    if (currentSession && currentSession.status === 'ok') {\n      await sessionStore.set(currentSession);\n    }\n  }, PERSIST_INTERVAL_MS);\n}\n\n/** Cleanly ends a session */\nexport async function endSession(): Promise<void> {\n  // Once the session had ended there is no point persisting it\n  if (persistTimer) {\n    clearInterval(persistTimer);\n  }\n\n  const hub = getCurrentHub();\n  const session = hub.getScope()?.getSession();\n\n  if (session) {\n    if (session.status === 'ok') {\n      logger.log('Ending session');\n      hub.endSession();\n    } else {\n      logger.log('Session was already ended');\n    }\n  } else {\n    logger.log('No session');\n  }\n\n  await sessionStore.clear();\n\n  await flush(2_000);\n}\n\n/** Determines if a Date is likely to have occurred in the previous uncompleted session */\nexport async function unreportedDuringLastSession(crashDate: Date | undefined): Promise<boolean> {\n  if (!crashDate) {\n    return false;\n  }\n\n  const previousSessionModified = await sessionStore.getModifiedDate();\n  // There is no previous session\n  if (previousSessionModified == undefined) {\n    return false;\n  }\n\n  const previousSessionModifiedTime = previousSessionModified.getTime();\n  const crashTime = crashDate.getTime();\n\n  // Session could have run until modified time + persist interval\n  const prevSessionEnd = previousSessionModifiedTime + PERSIST_INTERVAL_MS;\n\n  // Event cannot have occurred before last persist time, We add a 2 second overlap to be sure\n  const lastPersist = previousSessionModifiedTime - 2_000;\n\n  // If the crash occurred between the last persist and estimated end of session\n  return crashTime > lastPersist && crashTime < prevSessionEnd;\n}\n\n/** Checks if the previous session needs sending as crashed or abnormal  */\nexport async function checkPreviousSession(crashed: boolean): Promise<void> {\n  const client = getCurrentHub().getClient<NodeClient>();\n\n  const previous = await previousSession;\n\n  if (previous && client) {\n    // Ignore if the previous session is already ended\n    if (previous.status !== 'ok') {\n      previousSession = undefined;\n      return;\n    }\n\n    const status: SessionStatus = crashed ? 'crashed' : 'abnormal';\n\n    logger.log(`Found previous ${status} session`);\n\n    const sesh = makeSession(previous);\n\n    updateSession(sesh, {\n      status,\n      errors: (sesh.errors || 0) + 1,\n      release: (previous as unknown as SerializedSession).attrs?.release,\n      environment: (previous as unknown as SerializedSession).attrs?.environment,\n    });\n\n    await client.sendSession(sesh);\n\n    previousSession = undefined;\n  }\n}\n\n/** Sets the current session as crashed */\nexport function sessionCrashed(): void {\n  // stop persisting session\n  if (persistTimer) {\n    clearInterval(persistTimer);\n  }\n\n  logger.log('Session Crashed');\n  const hub = getCurrentHub();\n  const session = hub.getScope()?.getSession();\n\n  if (!session) {\n    logger.log('No session to update');\n    return;\n  }\n\n  if (session.status === 'ok') {\n    logger.log('Setting session as crashed');\n    updateSession(session, { status: 'crashed', errors: (session.errors += 1) });\n  } else {\n    logger.log('Session already ended');\n  }\n\n  hub.captureSession();\n}\n"]}/**
 * Stores data serialized to a JSON file.
 */
export declare class Store<T> {
    /** Current state of the data. */
    protected _data?: T;
    /** Internal path for JSON file. */
    private readonly _path;
    /** Value used to initialize data for the first time. */
    private readonly _initial;
    /** A mutex to ensure that there aren't races while reading and writing files */
    private _lock;
    /**
     * Creates a new store.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     */
    constructor(path: string, id: string, initial: T);
    /**
     * Updates data by replacing it with the given value.
     * @param data New data to replace the previous one.
     */
    set(data: T): Promise<void>;
    /**
     * Returns the current data.
     *
     * When invoked for the first time, it will try to load previously stored data
     * from disk. If the file does not exist, the initial value provided to the
     * constructor is used.
     */
    get(): Promise<T>;
    /**
     * Updates data by passing it through the given function.
     * @param fn A function receiving the current data and returning new one.
     */
    update(fn: (current: T) => T): Promise<void>;
    /** Returns store to its initial state */
    clear(): Promise<void>;
    /** Gets the Date that the file was last modified */
    getModifiedDate(): Promise<Date | undefined>;
}
/**
 * Extends Store to throttle writes.
 */
export declare class BufferedWriteStore<T> extends Store<T> {
    /** The minimum time between writes */
    private readonly _throttleTime?;
    /** A write that hasn't been written to disk yet */
    private _pendingWrite;
    /**
     * Creates a new ThrottledStore.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     * @param throttleTime The minimum time between writes
     */
    constructor(path: string, id: string, initial: T, throttleTime?: number);
    /** @inheritdoc */
    set(data: T): Promise<void>;
    /** Writes the pending write to disk */
    private _writePending;
}
//# sourceMappingURL=store.d.ts.map{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/main/store.ts"],"names":[],"mappings":"AAiBA;;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= void 0;
const tslib_1 = require("tslib");
const utils_1 = require("@sentry/utils");
const path_1 = require("path");
const mutex_1 = require("../common/mutex");
const fs_1 = require("./fs");
const dateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.*\d{0,10}Z$/;
/** JSON revive function to enable de-serialization of Date objects */
function dateReviver(_, value) {
    if (typeof value === 'string' && dateFormat.test(value)) {
        return new Date(value);
    }
    return value;
}
/**
 * Stores data serialized to a JSON file.
 */
class Store {
    /**
     * Creates a new store.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     */
    constructor(path, id, initial) {
        /** A mutex to ensure that there aren't races while reading and writing files */
        this._lock = new mutex_1.Mutex();
        this._path = (0, path_1.join)(path, `${id}.json`);
        this._initial = initial;
    }
    /**
     * Updates data by replacing it with the given value.
     * @param data New data to replace the previous one.
     */
    set(data) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            yield this._lock.runExclusive(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
                this._data = data;
                try {
                    if (data === undefined) {
                        try {
                            yield (0, fs_1.unlinkAsync)(this._path);
                        }
                        catch (_) {
                            //
                        }
                    }
                    else {
                        yield (0, fs_1.mkdirp)((0, path_1.dirname)(this._path));
                        yield (0, fs_1.writeFileAsync)(this._path, JSON.stringify(data));
                    }
                }
                catch (e) {
                    utils_1.logger.warn('Failed to write to store', e);
                    // This usually fails due to anti virus scanners, issues in the file
                    // system, or problems with network drives. We cannot fix or handle this
                    // issue and must resume gracefully. Thus, we have to ignore this error.
                }
            }));
        });
    }
    /**
     * Returns the current data.
     *
     * When invoked for the first time, it will try to load previously stored data
     * from disk. If the file does not exist, the initial value provided to the
     * constructor is used.
     */
    get() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            return yield this._lock.runExclusive(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
                if (this._data === undefined) {
                    try {
                        this._data = JSON.parse(yield (0, fs_1.readFileAsync)(this._path, 'utf8'), dateReviver);
                    }
                    catch (e) {
                        this._data = this._initial;
                    }
                }
                return this._data;
            }));
        });
    }
    /**
     * Updates data by passing it through the given function.
     * @param fn A function receiving the current data and returning new one.
     */
    update(fn) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            yield this.set(fn(yield this.get()));
        });
    }
    /** Returns store to its initial state */
    clear() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            yield this.set(this._initial);
        });
    }
    /** Gets the Date that the file was last modified */
    getModifiedDate() {
        var _a;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            try {
                return (_a = (yield (0, fs_1.statAsync)(this._path))) === null || _a === void 0 ? void 0 : _a.mtime;
            }
            catch (_) {
                return undefined;
            }
        });
    }
}
exports.Store = Store;
/**
 * Extends Store to throttle writes.
 */
class BufferedWriteStore extends Store {
    /**
     * Creates a new ThrottledStore.
     *
     * @param path A unique filename to store this data.
     * @param id A unique filename to store this data.
     * @param initial An initial value to initialize data with.
     * @param throttleTime The minimum time between writes
     */
    constructor(path, id, initial, throttleTime = 500) {
        super(path, id, initial);
        this._throttleTime = throttleTime;
    }
    /** @inheritdoc */
    set(data) {
        var _a;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            this._data = data;
            this._pendingWrite = {
                // We overwrite the data for the pending write so that the latest data is written in the next flush
                data,
                // If there is already a pending timeout, we keep that rather than starting the timeout again
                timeout: ((_a = this._pendingWrite) === null || _a === void 0 ? void 0 : _a.timeout) || setTimeout(() => this._writePending(), this._throttleTime),
            };
        });
    }
    /** Writes the pending write to disk */
    _writePending() {
        if (this._pendingWrite) {
            const data = this._pendingWrite.data;
            // Clear the pending write immediately so that subsequent writes can be queued
            this._pendingWrite = undefined;
            void super.set(data);
        }
    }
}
exports.BufferedWriteStore = BufferedWriteStore;
//# sourceMappingURL=store.js.map{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/main/store.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AACvC,+BAAqC;AAErC,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C,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAED,kBAAkB;IACI,GAAG,CAAC,IAAO;;;YAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAElB,IAAI,CAAC,aAAa,GAAG;gBACnB,mGAAmG;gBACnG,IAAI;gBACJ,6FAA6F;gBAC7F,OAAO,EAAE,CAAA,MAAA,IAAI,CAAC,aAAa,0CAAE,OAAO,KAAI,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC;aACnG,CAAC;;KACH;IAED,uCAAuC;IAC/B,aAAa;QACnB,IAAI,IAAI,CAAC,aAAa,EAAE;YACtB,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YACrC,8EAA8E;YAC9E,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;YAC/B,KAAK,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACtB;IACH,CAAC;CACF;AAxCD,gDAwCC","sourcesContent":["import { logger } from '@sentry/utils';\nimport { dirname, join } from 'path';\n\nimport { Mutex } from '../common/mutex';\nimport { mkdirp, readFileAsync, statAsync, unlinkAsync, writeFileAsync } from './fs';\n\nconst dateFormat = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.*\\d{0,10}Z$/;\n\n/** JSON revive function to enable de-serialization of Date objects */\nfunction dateReviver(_: string, value: any): any {\n  if (typeof value === 'string' && dateFormat.test(value)) {\n    return new Date(value);\n  }\n\n  return value;\n}\n\n/**\n * Stores data serialized to a JSON file.\n */\nexport class Store<T> {\n  /** Current state of the data. */\n  protected _data?: T;\n\n  /** Internal path for JSON file. */\n  private readonly _path: string;\n  /** Value used to initialize data for the first time. */\n  private readonly _initial: T;\n  /** A mutex to ensure that there aren't races while reading and writing files */\n  private _lock: Mutex = new Mutex();\n\n  /**\n   * Creates a new store.\n   *\n   * @param path A unique filename to store this data.\n   * @param id A unique filename to store this data.\n   * @param initial An initial value to initialize data with.\n   */\n  public constructor(path: string, id: string, initial: T) {\n    this._path = join(path, `${id}.json`);\n    this._initial = initial;\n  }\n\n  /**\n   * Updates data by replacing it with the given value.\n   * @param data New data to replace the previous one.\n   */\n  public async set(data: T): Promise<void> {\n    await this._lock.runExclusive(async () => {\n      this._data = data;\n\n      try {\n        if (data === undefined) {\n          try {\n            await unlinkAsync(this._path);\n          } catch (_) {\n            //\n          }\n        } else {\n          await mkdirp(dirname(this._path));\n          await writeFileAsync(this._path, JSON.stringify(data));\n        }\n      } catch (e) {\n        logger.warn('Failed to write to store', e);\n        // This usually fails due to anti virus scanners, issues in the file\n        // system, or problems with network drives. We cannot fix or handle this\n        // issue and must resume gracefully. Thus, we have to ignore this error.\n      }\n    });\n  }\n\n  /**\n   * Returns the current data.\n   *\n   * When invoked for the first time, it will try to load previously stored data\n   * from disk. If the file does not exist, the initial value provided to the\n   * constructor is used.\n   */\n  public async get(): Promise<T> {\n    return await this._lock.runExclusive(async () => {\n      if (this._data === undefined) {\n        try {\n          this._data = JSON.parse(await readFileAsync(this._path, 'utf8'), dateReviver) as T;\n        } catch (e) {\n          this._data = this._initial;\n        }\n      }\n\n      return this._data;\n    });\n  }\n\n  /**\n   * Updates data by passing it through the given function.\n   * @param fn A function receiving the current data and returning new one.\n   */\n  public async update(fn: (current: T) => T): Promise<void> {\n    await this.set(fn(await this.get()));\n  }\n\n  /** Returns store to its initial state */\n  public async clear(): Promise<void> {\n    await this.set(this._initial);\n  }\n\n  /** Gets the Date that the file was last modified */\n  public async getModifiedDate(): Promise<Date | undefined> {\n    try {\n      return (await statAsync(this._path))?.mtime;\n    } catch (_) {\n      return undefined;\n    }\n  }\n}\n\n/**\n * Extends Store to throttle writes.\n */\nexport class BufferedWriteStore<T> extends Store<T> {\n  /** The minimum time between writes */\n  private readonly _throttleTime?: number;\n  /** A write that hasn't been written to disk yet */\n  private _pendingWrite: { data: T; timeout: NodeJS.Timeout } | undefined;\n\n  /**\n   * Creates a new ThrottledStore.\n   *\n   * @param path A unique filename to store this data.\n   * @param id A unique filename to store this data.\n   * @param initial An initial value to initialize data with.\n   * @param throttleTime The minimum time between writes\n   */\n  public constructor(path: string, id: string, initial: T, throttleTime: number = 500) {\n    super(path, id, initial);\n    this._throttleTime = throttleTime;\n  }\n\n  /** @inheritdoc */\n  public override async set(data: T): Promise<void> {\n    this._data = data;\n\n    this._pendingWrite = {\n      // We overwrite the data for the pending write so that the latest data is written in the next flush\n      data,\n      // If there is already a pending timeout, we keep that rather than starting the timeout again\n      timeout: this._pendingWrite?.timeout || setTimeout(() => this._writePending(), this._throttleTime),\n    };\n  }\n\n  /** Writes the pending write to disk */\n  private _writePending(): void {\n    if (this._pendingWrite) {\n      const data = this._pendingWrite.data;\n      // Clear the pending write immediately so that subsequent writes can be queued\n      this._pendingWrite = undefined;\n      void super.set(data);\n    }\n  }\n}\n"]}import { BaseTransportOptions, Transport, TransportRequestExecutor } from '@sentry/types';
export interface ElectronNetTransportOptions extends BaseTransportOptions {
    /** Define custom headers */
    headers?: Record<string, string>;
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry.
 */
export declare function makeElectronTransport(options: ElectronNetTransportOptions): Transport;
/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
export declare function createElectronNetRequestExecutor(url: string, baseHeaders: Record<string, string>): TransportRequestExecutor;
//# sourceMappingURL=electron-net.d.ts.map{"version":3,"file":"electron-net.d.ts","sourceRoot":"","sources":["../../src/main/transports/electron-net.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,SAAS,EAGT,wBAAwB,EACzB,MAAM,eAAe,CAAC;AASvB,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AA8BD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,2BAA2B,GAAG,SAAS,CAErF;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAClC,wBAAwB,CAqD1B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.createElectronNetRequestExecutor = exports.makeElectronTransport = void 0;
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const stream_1 = require("stream");
const url_1 = require("url");
const zlib_1 = require("zlib");
const electron_normalize_1 = require("../electron-normalize");
// Estimated maximum size for reasonable standalone event
const GZIP_THRESHOLD = 1024 * 32;
/**
 * Gets a stream from a Buffer or string
 * We don't have Readable.from in earlier versions of node
 */
function streamFromBody(body) {
    return new stream_1.Readable({
        read() {
            this.push(body);
            this.push(null);
        },
    });
}
function getRequestOptions(url) {
    const { hostname, pathname, port, protocol, search } = new url_1.URL(url);
    return {
        method: 'POST',
        hostname,
        path: `${pathname}${search}`,
        port: parseInt(port, 10),
        protocol,
    };
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry.
 */
function makeElectronTransport(options) {
    return (0, core_1.createTransport)(options, createElectronNetRequestExecutor(options.url, options.headers || {}));
}
exports.makeElectronTransport = makeElectronTransport;
/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
function createElectronNetRequestExecutor(url, baseHeaders) {
    baseHeaders['Content-Type'] = 'application/x-sentry-envelope';
    return function makeRequest(request) {
        return electron_normalize_1.whenAppReady.then(() => new Promise((resolve, reject) => {
            let bodyStream = streamFromBody(request.body);
            const headers = Object.assign({}, baseHeaders);
            if (request.body.length > GZIP_THRESHOLD) {
                headers['content-encoding'] = 'gzip';
                bodyStream = bodyStream.pipe((0, zlib_1.createGzip)());
            }
            const req = electron_1.net.request(getRequestOptions(url));
            for (const header of Object.keys(headers)) {
                req.setHeader(header, headers[header]);
            }
            req.on('response', (res) => {
                var _a, _b;
                res.on('error', reject);
                res.on('data', () => {
                    // Drain socket
                });
                res.on('end', () => {
                    // Drain socket
                });
                // "Key-value pairs of header names and values. Header names are lower-cased."
                // https://nodejs.org/api/http.html#http_message_headers
                const retryAfterHeader = (_a = res.headers['retry-after']) !== null && _a !== void 0 ? _a : undefined;
                const rateLimitsHeader = (_b = res.headers['x-sentry-rate-limits']) !== null && _b !== void 0 ? _b : undefined;
                resolve({
                    headers: (0, utils_1.dropUndefinedKeys)({
                        'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] : retryAfterHeader,
                        'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,
                    }),
                });
            });
            req.on('error', reject);
            // The docs say that ClientRequest is Writable but the types don't match exactly
            bodyStream.pipe(req);
        }));
    };
}
exports.createElectronNetRequestExecutor = createElectronNetRequestExecutor;
//# sourceMappingURL=electron-net.js.map{"version":3,"file":"electron-net.js","sourceRoot":"","sources":["../../src/main/transports/electron-net.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAQ/C,yCAAkD;AAClD,uCAA+B;AAC/B,mCAA4C;AAC5C,6BAA0B;AAC1B,+BAAkC;AAElC,8DAAqD;AAOrD,yDAAyD;AACzD,MAAM,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;AAEjC;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAyB;IAC/C,OAAO,IAAI,iBAAQ,CAAC;QAClB,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,SAAG,CAAC,GAAG,CAAC,CAAC;IAEpE,OAAO;QACL,MAAM,EAAE,MAAM;QACd,QAAQ;QACR,IAAI,EAAE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OAAO,EAAE,MAAM,CAAC,CAAC;gBAExB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;oBAClB,eAAe;gBACjB,CAAC,CAAC,CAAC;gBAEH,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;oBACjB,eAAe;gBACjB,CAAC,CAAC,CAAC;gBAEH,8EAA8E;gBAC9E,wDAAwD;gBACxD,MAAM,gBAAgB,GAAG,MAAA,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,mCAAI,SAAS,CAAC;gBACjE,MAAM,gBAAgB,GAAG,MAAA,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,mCAAI,SAAS,CAAC;gBAE1E,OAAO,CAAC;oBACN,OAAO,EAAE,IAAA,yBAAiB,EAAC;wBACzB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;wBACvF,sBAAsB,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB;qBACjG,CAAC;iBACH,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAExB,gFAAgF;YAChF,UAAU,CAAC,IAAI,CAAC,GAA0B,CAAC,CAAC;QAC9C,CAAC,CAAC,CACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxDD,4EAwDC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport {\n  BaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequest,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\nimport { net } from 'electron';\nimport { Readable, Writable } from 'stream';\nimport { URL } from 'url';\nimport { createGzip } from 'zlib';\n\nimport { whenAppReady } from '../electron-normalize';\n\nexport interface ElectronNetTransportOptions extends BaseTransportOptions {\n  /** Define custom headers */\n  headers?: Record<string, string>;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Buffer or string\n * We don't have Readable.from in earlier versions of node\n */\nfunction streamFromBody(body: string | Uint8Array): Readable {\n  return new Readable({\n    read() {\n      this.push(body);\n      this.push(null);\n    },\n  });\n}\n\nfunction getRequestOptions(url: string): Electron.ClientRequestConstructorOptions {\n  const { hostname, pathname, port, protocol, search } = new URL(url);\n\n  return {\n    method: 'POST',\n    hostname,\n    path: `${pathname}${search}`,\n    port: parseInt(port, 10),\n    protocol,\n  };\n}\n\n/**\n * Creates a Transport that uses Electrons net module to send events to Sentry.\n */\nexport function makeElectronTransport(options: ElectronNetTransportOptions): Transport {\n  return createTransport(options, createElectronNetRequestExecutor(options.url, options.headers || {}));\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nexport function createElectronNetRequestExecutor(\n  url: string,\n  baseHeaders: Record<string, string>,\n): TransportRequestExecutor {\n  baseHeaders['Content-Type'] = 'application/x-sentry-envelope';\n\n  return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    return whenAppReady.then(\n      () =>\n        new Promise((resolve, reject) => {\n          let bodyStream = streamFromBody(request.body);\n\n          const headers = { ...baseHeaders };\n\n          if (request.body.length > GZIP_THRESHOLD) {\n            headers['content-encoding'] = 'gzip';\n            bodyStream = bodyStream.pipe(createGzip());\n          }\n\n          const req = net.request(getRequestOptions(url));\n\n          for (const header of Object.keys(headers)) {\n            req.setHeader(header, headers[header]);\n          }\n\n          req.on('response', (res) => {\n            res.on('error', reject);\n\n            res.on('data', () => {\n              // Drain socket\n            });\n\n            res.on('end', () => {\n              // Drain socket\n            });\n\n            // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n            // https://nodejs.org/api/http.html#http_message_headers\n            const retryAfterHeader = res.headers['retry-after'] ?? undefined;\n            const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? undefined;\n\n            resolve({\n              headers: dropUndefinedKeys({\n                'retry-after': Array.isArray(retryAfterHeader) ? retryAfterHeader[0] : retryAfterHeader,\n                'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,\n              }),\n            });\n          });\n\n          req.on('error', reject);\n\n          // The docs say that ClientRequest is Writable but the types don't match exactly\n          bodyStream.pipe(req as unknown as Writable);\n        }),\n    );\n  };\n}\n"]}import { Transport, TransportRequest } from '@sentry/types';
import { ElectronNetTransportOptions } from './electron-net';
type BeforeSendResponse = 'send' | 'queue' | 'drop';
export interface ElectronOfflineTransportOptions extends ElectronNetTransportOptions {
    /**
     * The maximum number of days to keep an event in the queue.
     */
    maxQueueAgeDays?: number;
    /**
     * The maximum number of events to keep in the queue.
     */
    maxQueueCount?: number;
    /**
     * Called every time the number of requests in the queue changes.
     */
    queuedLengthChanged?: (length: number) => void;
    /**
     * Called before attempting to send an event to Sentry.
     *
     * Return 'send' to attempt to send the event.
     * Return 'queue' to queue and persist the event for sending later.
     * Return 'drop' to drop the event.
     */
    beforeSend?: (request: TransportRequest) => BeforeSendResponse | Promise<BeforeSendResponse>;
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are
 * persisted to disk and sent later
 */
export declare function makeElectronOfflineTransport(options: ElectronOfflineTransportOptions): Transport;
export {};
//# sourceMappingURL=electron-offline-net.d.ts.map{"version":3,"file":"electron-offline-net.d.ts","sourceRoot":"","sources":["../../src/main/transports/electron-offline-net.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAgC,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAM1F,OAAO,EAAoC,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAG/F,KAAK,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpD,MAAM,WAAW,+BAAgC,SAAQ,2BAA2B;IAClF;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/C;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC9F;AAkBD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,+BAA+B,GAAG,SAAS,CA8FhG"}Object.defineProperty(exports, "__esModule", { value: true });
exports.makeElectronOfflineTransport = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const electron_1 = require("electron");
const path_1 = require("path");
const fs_1 = require("../fs");
const electron_net_1 = require("./electron-net");
const queue_1 = require("./queue");
const START_DELAY = 5000;
const MAX_DELAY = 2000000000;
/** Returns true is there's a chance we're online */
function maybeOnline() {
    return !('online' in electron_1.net) || electron_1.net.online === true;
}
function defaultBeforeSend(_) {
    return maybeOnline() ? 'send' : 'queue';
}
function isRateLimited(result) {
    return !!(result.headers && 'x-sentry-rate-limits' in result.headers);
}
/**
 * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are
 * persisted to disk and sent later
 */
function makeElectronOfflineTransport(options) {
    const netMakeRequest = (0, electron_net_1.createElectronNetRequestExecutor)(options.url, options.headers || {});
    const queue = new queue_1.PersistedRequestQueue((0, path_1.join)(fs_1.sentryCachePath, 'queue'), options.maxQueueAgeDays, options.maxQueueCount);
    const beforeSend = options.beforeSend || defaultBeforeSend;
    let retryDelay = START_DELAY;
    let lastQueueLength = -1;
    function queueLengthChanged(queuedEvents) {
        if (options.queuedLengthChanged && queuedEvents !== lastQueueLength) {
            lastQueueLength = queuedEvents;
            options.queuedLengthChanged(queuedEvents);
        }
    }
    function flushQueue() {
        queue
            .pop()
            .then((found) => {
            if (found) {
                // We have pendingCount plus found.request
                queueLengthChanged(found.pendingCount + 1);
                utils_1.logger.log('Found a request in the queue');
                makeRequest(found.request).catch((e) => utils_1.logger.error(e));
            }
            else {
                queueLengthChanged(0);
            }
        })
            .catch((e) => utils_1.logger.error(e));
    }
    function queueRequest(request) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            utils_1.logger.log('Queuing request');
            queueLengthChanged(yield queue.add(request));
            setTimeout(() => {
                flushQueue();
            }, retryDelay);
            retryDelay *= 3;
            // If the delay is bigger than 2^31 (max signed 32-bit int), setTimeout throws
            // an error and falls back to 1 which can cause a huge number of requests.
            if (retryDelay > MAX_DELAY) {
                retryDelay = MAX_DELAY;
            }
            return {};
        });
    }
    function makeRequest(request) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            let action = beforeSend(request);
            if (action instanceof Promise) {
                action = yield action;
            }
            if (action === 'send') {
                try {
                    const result = yield netMakeRequest(request);
                    if (!isRateLimited(result)) {
                        utils_1.logger.log('Successfully sent');
                        // Reset the retry delay
                        retryDelay = START_DELAY;
                        // We were successful so check the queue
                        flushQueue();
                        return result;
                    }
                    else {
                        utils_1.logger.log('Rate limited', result.headers);
                    }
                }
                catch (error) {
                    utils_1.logger.log('Error sending:', error);
                }
                action = 'queue';
            }
            if (action == 'queue') {
                return yield queueRequest(request);
            }
            utils_1.logger.log('Dropping request');
            return {};
        });
    }
    flushQueue();
    return (0, core_1.createTransport)(options, makeRequest);
}
exports.makeElectronOfflineTransport = makeElectronOfflineTransport;
//# sourceMappingURL=electron-offline-net.js.map{"version":3,"file":"electron-offline-net.js","sourceRoot":"","sources":["../../src/main/transports/electron-offline-net.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAE/C,yCAAuC;AACvC,uCAA+B;AAC/B,+BAA4B;AAE5B,8BAAwC;AACxC,iDAA+F;AAC/F,mCAAgD;AA8BhD,MAAM,WAAW,GAAG,IAAK,CAAC;A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ChC,wBAAwB;wBACxB,UAAU,GAAG,WAAW,CAAC;wBACzB,wCAAwC;wBACxC,UAAU,EAAE,CAAC;wBACb,OAAO,MAAM,CAAC;qBACf;yBAAM;wBACL,cAAM,CAAC,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;qBAC5C;iBACF;gBAAC,OAAO,KAAK,EAAE;oBACd,cAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;iBACrC;gBAED,MAAM,GAAG,OAAO,CAAC;aAClB;YAED,IAAI,MAAM,IAAI,OAAO,EAAE;gBACrB,OAAO,MAAM,YAAY,CAAC,OAAO,CAAC,CAAC;aACpC;YAED,cAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAC/B,OAAO,EAAE,CAAC;QACZ,CAAC;KAAA;IAED,UAAU,EAAE,CAAC;IAEb,OAAO,IAAA,sBAAe,EAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC;AA9FD,oEA8FC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { net } from 'electron';\nimport { join } from 'path';\n\nimport { sentryCachePath } from '../fs';\nimport { createElectronNetRequestExecutor, ElectronNetTransportOptions } from './electron-net';\nimport { PersistedRequestQueue } from './queue';\n\ntype BeforeSendResponse = 'send' | 'queue' | 'drop';\n\nexport interface ElectronOfflineTransportOptions extends ElectronNetTransportOptions {\n  /**\n   * The maximum number of days to keep an event in the queue.\n   */\n  maxQueueAgeDays?: number;\n\n  /**\n   * The maximum number of events to keep in the queue.\n   */\n  maxQueueCount?: number;\n\n  /**\n   * Called every time the number of requests in the queue changes.\n   */\n  queuedLengthChanged?: (length: number) => void;\n\n  /**\n   * Called before attempting to send an event to Sentry.\n   *\n   * Return 'send' to attempt to send the event.\n   * Return 'queue' to queue and persist the event for sending later.\n   * Return 'drop' to drop the event.\n   */\n  beforeSend?: (request: TransportRequest) => BeforeSendResponse | Promise<BeforeSendResponse>;\n}\n\nconst START_DELAY = 5_000;\nconst MAX_DELAY = 2_000_000_000;\n\n/** Returns true is there's a chance we're online */\nfunction maybeOnline(): boolean {\n  return !('online' in net) || net.online === true;\n}\n\nfunction defaultBeforeSend(_: TransportRequest): BeforeSendResponse {\n  return maybeOnline() ? 'send' : 'queue';\n}\n\nfunction isRateLimited(result: TransportMakeRequestResponse): boolean {\n  return !!(result.headers && 'x-sentry-rate-limits' in result.headers);\n}\n\n/**\n * Creates a Transport that uses Electrons net module to send events to Sentry. When they fail to send they are\n * persisted to disk and sent later\n */\nexport function makeElectronOfflineTransport(options: ElectronOfflineTransportOptions): Transport {\n  const netMakeRequest = createElectronNetRequestExecutor(options.url, options.headers || {});\n  const queue: PersistedRequestQueue = new PersistedRequestQueue(\n    join(sentryCachePath, 'queue'),\n    options.maxQueueAgeDays,\n    options.maxQueueCount,\n  );\n\n  const beforeSend = options.beforeSend || defaultBeforeSend;\n\n  let retryDelay: number = START_DELAY;\n  let lastQueueLength = -1;\n\n  function queueLengthChanged(queuedEvents: number): void {\n    if (options.queuedLengthChanged && queuedEvents !== lastQueueLength) {\n      lastQueueLength = queuedEvents;\n      options.queuedLengthChanged(queuedEvents);\n    }\n  }\n\n  function flushQueue(): void {\n    queue\n      .pop()\n      .then((found) => {\n        if (found) {\n          // We have pendingCount plus found.request\n          queueLengthChanged(found.pendingCount + 1);\n          logger.log('Found a request in the queue');\n          makeRequest(found.request).catch((e) => logger.error(e));\n        } else {\n          queueLengthChanged(0);\n        }\n      })\n      .catch((e) => logger.error(e));\n  }\n\n  async function queueRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    logger.log('Queuing request');\n    queueLengthChanged(await queue.add(request));\n\n    setTimeout(() => {\n      flushQueue();\n    }, retryDelay);\n\n    retryDelay *= 3;\n\n    // If the delay is bigger than 2^31 (max signed 32-bit int), setTimeout throws\n    // an error and falls back to 1 which can cause a huge number of requests.\n    if (retryDelay > MAX_DELAY) {\n      retryDelay = MAX_DELAY;\n    }\n\n    return {};\n  }\n\n  async function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    let action = beforeSend(request);\n\n    if (action instanceof Promise) {\n      action = await action;\n    }\n\n    if (action === 'send') {\n      try {\n        const result = await netMakeRequest(request);\n\n        if (!isRateLimited(result)) {\n          logger.log('Successfully sent');\n          // Reset the retry delay\n          retryDelay = START_DELAY;\n          // We were successful so check the queue\n          flushQueue();\n          return result;\n        } else {\n          logger.log('Rate limited', result.headers);\n        }\n      } catch (error) {\n        logger.log('Error sending:', error);\n      }\n\n      action = 'queue';\n    }\n\n    if (action == 'queue') {\n      return await queueRequest(request);\n    }\n\n    logger.log('Dropping request');\n    return {};\n  }\n\n  flushQueue();\n\n  return createTransport(options, makeRequest);\n}\n"]}import { TransportRequest } from '@sentry/types';
interface PopResult {
    request: QueuedTransportRequest;
    pendingCount: number;
}
export interface QueuedTransportRequest extends TransportRequest {
    date?: Date;
}
/** A request queue that is persisted to disk to survive app restarts */
export declare class PersistedRequestQueue {
    private readonly _queuePath;
    private readonly _maxAgeDays;
    private readonly _maxCount;
    private readonly _queue;
    constructor(_queuePath: string, _maxAgeDays?: number, _maxCount?: number);
    /** Adds a request to the queue */
    add(request: QueuedTransportRequest): Promise<number>;
    /** Pops the oldest event from the queue */
    pop(): Promise<PopResult | undefined>;
    /** Removes the body of the request */
    private _removeBody;
}
export {};
//# sourceMappingURL=queue.d.ts.map{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/main/transports/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAiBjD,UAAU,SAAS;IACjB,OAAO,EAAE,sBAAsB,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,IAAI,CAAC,EAAE,IAAI,CAAC;CACb;AAED,wEAAwE;AACxE,qBAAa,qBAAqB;IAQ9B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAT5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAIrB;gBAGiB,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,MAAW,EACxB,SAAS,GAAE,MAAW;IAGzC,kCAAkC;IACrB,GAAG,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IA8BlE,2CAA2C;IAC9B,GAAG,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAwClD,sCAAsC;YACxB,WAAW;CAO1B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.PersistedRequestQueue = void 0;
const tslib_1 = require("tslib");
const utils_1 = require("@sentry/utils");
const path_1 = require("path");
const fs_1 = require("../fs");
const store_1 = require("../store");
const MILLISECONDS_PER_DAY = 86400000;
/** A request queue that is persisted to disk to survive app restarts */
class PersistedRequestQueue {
    constructor(_queuePath, _maxAgeDays = 30, _maxCount = 30) {
        this._queuePath = _queuePath;
        this._maxAgeDays = _maxAgeDays;
        this._maxCount = _maxCount;
        this._queue = new store_1.BufferedWriteStore(this._queuePath, 'queue', []);
    }
    /** Adds a request to the queue */
    add(request) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const bodyPath = (0, utils_1.uuid4)();
            let queuedEvents = 0;
            yield this._queue.update((queue) => {
                queue.push({
                    bodyPath,
                    date: request.date || new Date(),
                });
                while (queue.length > this._maxCount) {
                    const removed = queue.shift();
                    if (removed) {
                        void this._removeBody(removed.bodyPath);
                    }
                }
                queuedEvents = queue.length;
                return queue;
            });
            try {
                yield (0, fs_1.writeFileAsync)((0, path_1.join)(this._queuePath, bodyPath), request.body);
            }
            catch (_) {
                //
            }
            return queuedEvents;
        });
    }
    /** Pops the oldest event from the queue */
    pop() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            let found;
            let pendingCount = 0;
            const cutOff = Date.now() - MILLISECONDS_PER_DAY * this._maxAgeDays;
            yield this._queue.update((queue) => {
                while ((found = queue.shift())) {
                    // We drop events created in v3 of the SDK or before the cut-off
                    if ('type' in found || found.date.getTime() < cutOff) {
                        // we're dropping this event so delete the body
                        void this._removeBody(found.bodyPath);
                        found = undefined;
                    }
                    else {
                        pendingCount = queue.length;
                        break;
                    }
                }
                return queue;
            });
            if (found) {
                try {
                    const body = yield (0, fs_1.readFileAsync)((0, path_1.join)(this._queuePath, found.bodyPath));
                    void this._removeBody(found.bodyPath);
                    return {
                        request: {
                            body,
                            date: found.date || new Date(),
                        },
                        pendingCount,
                    };
                }
                catch (e) {
                    utils_1.logger.warn('Filed to read queued request body', e);
                }
            }
            return undefined;
        });
    }
    /** Removes the body of the request */
    _removeBody(bodyPath) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            try {
                yield (0, fs_1.unlinkAsync)((0, path_1.join)(this._queuePath, bodyPath));
            }
            catch (_) {
                //
            }
        });
    }
}
exports.PersistedRequestQueue = PersistedRequestQueue;
//# sourceMappingURL=queue.js.map{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/main/transports/queue.ts"],"names":[],"mappings":";;;AACA,yCAA8C;AAC9C,+BAA4B;AAE5B,8BAAmE;AACnE,oCAA8C;AAE9C,MAAM,oBAAoB,GAAG,QAAU,CAAC;AAmBxC,wEAAwE;AACxE,MAAa,qBAAqB;IAOhC,YACmB,UAAkB,EAClB,cAAsB,EAAE,EACxB,YAAoB,EAAE;QAFtB,eAAU,GAAV,UAAU,CAAQ;QAClB,gBAAW,GAAX,WAAW,CAAa;QACxB,cAAS,GAAT,SAAS,CAAa;QATxB,WAAM,GAA2C,IAAI,0BAAkB,CACtF,IAAI,CAAC,UAAU,EACf,OAAO,EACP,EAAE,CACH,CAAC;IAMC,CAAC;IAEJ,kCAAkC;IACrB,GAAG,CAAC,OAA+B;;YAC9C,MAAM,QAAQ,G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pD,+CAA+C;wBAC/C,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;wBACtC,KAAK,GAAG,SAAS,CAAC;qBACnB;yBAAM;wBACL,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC;wBAC5B,MAAM;qBACP;iBACF;gBACD,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;YAEH,IAAI,KAAK,EAAE;gBACT,IAAI;oBACF,MAAM,IAAI,GAAG,MAAM,IAAA,kBAAa,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACxE,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBAEtC,OAAO;wBACL,OAAO,EAAE;4BACP,IAAI;4BACJ,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,IAAI,IAAI,EAAE;yBAC/B;wBACD,YAAY;qBACb,CAAC;iBACH;gBAAC,OAAO,CAAC,EAAE;oBACV,cAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;iBACrD;aACF;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;IAED,sCAAsC;IACxB,WAAW,CAAC,QAAgB;;YACxC,IAAI;gBACF,MAAM,IAAA,gBAAW,EAAC,IAAA,WAAI,EAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;aACpD;YAAC,OAAO,CAAC,EAAE;gBACV,EAAE;aACH;QACH,CAAC;KAAA;CACF;AA7FD,sDA6FC","sourcesContent":["import { TransportRequest } from '@sentry/types';\nimport { logger, uuid4 } from '@sentry/utils';\nimport { join } from 'path';\n\nimport { readFileAsync, unlinkAsync, writeFileAsync } from '../fs';\nimport { BufferedWriteStore } from '../store';\n\nconst MILLISECONDS_PER_DAY = 86_400_000;\n\ninterface PersistedRequest {\n  bodyPath: string;\n  date: Date;\n  // Envelopes were persisted in a different format in v3\n  // If this property exists, we discard this event\n  type?: unknown;\n}\n\ninterface PopResult {\n  request: QueuedTransportRequest;\n  pendingCount: number;\n}\n\nexport interface QueuedTransportRequest extends TransportRequest {\n  date?: Date;\n}\n\n/** A request queue that is persisted to disk to survive app restarts */\nexport class PersistedRequestQueue {\n  private readonly _queue: BufferedWriteStore<PersistedRequest[]> = new BufferedWriteStore(\n    this._queuePath,\n    'queue',\n    [],\n  );\n\n  public constructor(\n    private readonly _queuePath: string,\n    private readonly _maxAgeDays: number = 30,\n    private readonly _maxCount: number = 30,\n  ) {}\n\n  /** Adds a request to the queue */\n  public async add(request: QueuedTransportRequest): Promise<number> {\n    const bodyPath = uuid4();\n    let queuedEvents = 0;\n\n    await this._queue.update((queue) => {\n      queue.push({\n        bodyPath,\n        date: request.date || new Date(),\n      });\n\n      while (queue.length > this._maxCount) {\n        const removed = queue.shift();\n        if (removed) {\n          void this._removeBody(removed.bodyPath);\n        }\n      }\n\n      queuedEvents = queue.length;\n      return queue;\n    });\n\n    try {\n      await writeFileAsync(join(this._queuePath, bodyPath), request.body);\n    } catch (_) {\n      //\n    }\n\n    return queuedEvents;\n  }\n\n  /** Pops the oldest event from the queue */\n  public async pop(): Promise<PopResult | undefined> {\n    let found: PersistedRequest | undefined;\n    let pendingCount = 0;\n    const cutOff = Date.now() - MILLISECONDS_PER_DAY * this._maxAgeDays;\n\n    await this._queue.update((queue) => {\n      while ((found = queue.shift())) {\n        // We drop events created in v3 of the SDK or before the cut-off\n        if ('type' in found || found.date.getTime() < cutOff) {\n          // we're dropping this event so delete the body\n          void this._removeBody(found.bodyPath);\n          found = undefined;\n        } else {\n          pendingCount = queue.length;\n          break;\n        }\n      }\n      return queue;\n    });\n\n    if (found) {\n      try {\n        const body = await readFileAsync(join(this._queuePath, found.bodyPath));\n        void this._removeBody(found.bodyPath);\n\n        return {\n          request: {\n            body,\n            date: found.date || new Date(),\n          },\n          pendingCount,\n        };\n      } catch (e) {\n        logger.warn('Filed to read queued request body', e);\n      }\n    }\n\n    return undefined;\n  }\n\n  /** Removes the body of the request */\n  private async _removeBody(bodyPath: string): Promise<void> {\n    try {\n      await unlinkAsync(join(this._queuePath, bodyPath));\n    } catch (_) {\n      //\n    }\n  }\n}\n"]}export declare const SDK_VERSION = "4.5.0";
//# sourceMappingURL=version.d.ts.map{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/main/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,UAAU,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.SDK_VERSION = void 0;
exports.SDK_VERSION = '4.5.0';
//# sourceMappingURL=version.js.map{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/main/version.ts"],"names":[],"mappings":";;AAAa,QAAA,WAAW,GAAG,OAAO,CAAC","sourcesContent":["export const SDK_VERSION = '4.5.0';\n"]}/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.// Note: named reexports are used instead of `export *` because
// TypeScript itself doesn't resolve the `export *` when checking
// if a particular helper exists.
export {
  __extends,
  __assign,
  __rest,
  __decorate,
  __param,
  __esDecorate,
  __runInitializers,
  __propKey,
  __setFunctionName,
  __metadata,
  __awaiter,
  __generator,
  __exportStar,
  __values,
  __read,
  __spread,
  __spreadArrays,
  __spreadArray,
  __await,
  __asyncGenerator,
  __asyncDelegator,
  __asyncValues,
  __makeTemplateObject,
  __importStar,
  __importDefault,
  __classPrivateFieldGet,
  __classPrivateFieldSet,
  __classPrivateFieldIn,
  __createBinding,
  __addDisposableResource,
  __disposeResources,
  __rewriteRelativeImportExtension,
} from '../tslib.js';
export * as default from '../tslib.js';
import tslib from '../tslib.js';
const {
    __extends,
    __assign,
    __rest,
    __decorate,
    __param,
    __esDecorate,
    __runInitializers,
    __propKey,
    __setFunctionName,
    __metadata,
    __awaiter,
    __generator,
    __exportStar,
    __createBinding,
    __values,
    __read,
    __spread,
    __spreadArrays,
    __spreadArray,
    __await,
    __asyncGenerator,
    __asyncDelegator,
    __asyncValues,
    __makeTemplateObject,
    __importStar,
    __importDefault,
    __classPrivateFieldGet,
    __classPrivateFieldSet,
    __classPrivateFieldIn,
    __addDisposableResource,
    __disposeResources,
    __rewriteRelativeImportExtension,
} = tslib;
export {
    __extends,
    __assign,
    __rest,
    __decorate,
    __param,
    __esDecorate,
    __runInitializers,
    __propKey,
    __setFunctionName,
    __metadata,
    __awaiter,
    __generator,
    __exportStar,
    __createBinding,
    __values,
    __read,
    __spread,
    __spreadArrays,
    __spreadArray,
    __await,
    __asyncGenerator,
    __asyncDelegator,
    __asyncValues,
    __makeTemplateObject,
    __importStar,
    __importDefault,
    __classPrivateFieldGet,
    __classPrivateFieldSet,
    __classPrivateFieldIn,
    __addDisposableResource,
    __disposeResources,
    __rewriteRelativeImportExtension,
};
export default tslib;
{
    "type": "module"
}{
    "name": "tslib",
    "author": "Microsoft Corp.",
    "homepage": "https://www.typescriptlang.org/",
    "version": "2.8.1",
    "license": "0BSD",
    "description": "Runtime library for TypeScript helper functions",
    "keywords": [
        "TypeScript",
        "Microsoft",
        "compiler",
        "language",
        "javascript",
        "tslib",
        "runtime"
    ],
    "bugs": {
        "url": "https://github.com/Microsoft/TypeScript/issues"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/Microsoft/tslib.git"
    },
    "main": "tslib.js",
    "module": "tslib.es6.js",
    "jsnext:main": "tslib.es6.js",
    "typings": "tslib.d.ts",
    "sideEffects": false,
    "exports": {
        ".": {
            "module": {
                "types": "./modules/index.d.ts",
                "default": "./tslib.es6.mjs"
            },
            "import": {
                "node": "./modules/index.js",
                "default": {
                    "types": "./modules/index.d.ts",
                    "default": "./tslib.es6.mjs"
                }
            },
            "default": "./tslib.js"
        },
        "./*": "./*",
        "./": "./"
    }
}
# tslib

This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.

This library is primarily used by the `--importHelpers` flag in TypeScript.
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:

```ts
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
exports.x = {};
exports.y = __assign({}, exports.x);

```

will instead be emitted as something like the following:

```ts
var tslib_1 = require("tslib");
exports.x = {};
exports.y = tslib_1.__assign({}, exports.x);
```

Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.

# Installing

For the latest stable version, run:

## npm

```sh
# TypeScript 3.9.2 or later
npm install tslib

# TypeScript 3.8.4 or earlier
npm install tslib@^1

# TypeScript 2.3.2 or earlier
npm install tslib@1.6.1
```

## yarn

```sh
# TypeScript 3.9.2 or later
yarn add tslib

# TypeScript 3.8.4 or earlier
yarn add tslib@^1

# TypeScript 2.3.2 or earlier
yarn add tslib@1.6.1
```

## bower

```sh
# TypeScript 3.9.2 or later
bower install tslib

# TypeScript 3.8.4 or earlier
bower install tslib@^1

# TypeScript 2.3.2 or earlier
bower install tslib@1.6.1
```

## JSPM

```sh
# TypeScript 3.9.2 or later
jspm install tslib

# TypeScript 3.8.4 or earlier
jspm install tslib@^1

# TypeScript 2.3.2 or earlier
jspm install tslib@1.6.1
```

# Usage

Set the `importHelpers` compiler option on the command line:

```
tsc --importHelpers file.ts
```

or in your tsconfig.json:

```json
{
    "compilerOptions": {
        "importHelpers": true
    }
}
```

#### For bower and JSPM users

You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:

```json
{
    "compilerOptions": {
        "module": "amd",
        "importHelpers": true,
        "baseUrl": "./",
        "paths": {
            "tslib" : ["bower_components/tslib/tslib.d.ts"]
        }
    }
}
```

For JSPM users:

```json
{
    "compilerOptions": {
        "module": "system",
        "importHelpers": true,
        "baseUrl": "./",
        "paths": {
            "tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
        }
    }
}
```

## Deployment

- Choose your new version number
- Set it in `package.json` and `bower.json`
- Create a tag: `git tag [version]`
- Push the tag: `git push --tags`
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow

Done.

# Contribute

There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.

* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).

# Documentation

* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
* [Programming handbook](http://www.typescriptlang.org/Handbook)
* [Homepage](http://www.typescriptlang.org/)
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
  * Full paths of source file(s) related to the manifestation of the issue
  * The location of the affected source code (tag/branch/commit or direct URL)
  * Any special configuration required to reproduce the issue
  * Step-by-step instructions to reproduce the issue
  * Proof-of-concept or exploit code (if possible)
  * Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/**
 * Used to shim class extends.
 *
 * @param d The derived class.
 * @param b The base class.
 */
export declare function __extends(d: Function, b: Function): void;

/**
 * Copy the values of all of the enumerable own properties from one or more source objects to a
 * target object. Returns the target object.
 *
 * @param t The target object to copy to.
 * @param sources One or more source objects from which to copy properties
 */
export declare function __assign(t: any, ...sources: any[]): any;

/**
 * Performs a rest spread on an object.
 *
 * @param t The source value.
 * @param propertyNames The property names excluded from the rest spread.
 */
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;

/**
 * Applies decorators to a target object
 *
 * @param decorators The set of decorators to apply.
 * @param target The target object.
 * @param key If specified, the own property to apply the decorators to.
 * @param desc The property descriptor, defaults to fetching the descriptor from the target object.
 * @experimental
 */
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;

/**
 * Creates an observing function decorator from a parameter decorator.
 *
 * @param paramIndex The parameter index to apply the decorator to.
 * @param decorator The parameter decorator to apply. Note that the return value is ignored.
 * @experimental
 */
export declare function __param(paramIndex: number, decorator: Function): Function;

/**
 * Applies decorators to a class or class member, following the native ECMAScript decorator specification.
 * @param ctor For non-field class members, the class constructor. Otherwise, `null`.
 * @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`.
 * @param decorators The decorators to apply
 * @param contextIn The `DecoratorContext` to clone for each decorator application.
 * @param initializers An array of field initializer mutation functions into which new initializers are written.
 * @param extraInitializers An array of extra initializer functions into which new initializers are written.
 */
export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void;

/**
 * Runs field initializers or extra initializers generated by `__esDecorate`.
 * @param thisArg The `this` argument to use.
 * @param initializers The array of initializers to evaluate.
 * @param value The initial value to pass to the initializers.
 */
export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any;

/**
 * Converts a computed property name into a `string` or `symbol` value.
 */
export declare function __propKey(x: any): string | symbol;

/**
 * Assigns the name of a function derived from the left-hand side of an assignment.
 * @param f The function to rename.
 * @param name The new name for the function.
 * @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name.
 */
export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function;

/**
 * Creates a decorator that sets metadata.
 *
 * @param metadataKey The metadata key
 * @param metadataValue The metadata value
 * @experimental
 */
export declare function __metadata(metadataKey: any, metadataValue: any): Function;

/**
 * Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`.
 *
 * @param thisArg The reference to use as the `this` value in the generator function
 * @param _arguments The optional arguments array
 * @param P The optional promise constructor argument, defaults to the `Promise` property of the global object.
 * @param generator The generator function
 */
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;

/**
 * Creates an Iterator object using the body as the implementation.
 *
 * @param thisArg The reference to use as the `this` value in the function
 * @param body The generator state-machine based implementation.
 *
 * @see [./docs/generator.md]
 */
export declare function __generator(thisArg: any, body: Function): any;

/**
 * Creates bindings for all enumerable properties of `m` on `exports`
 *
 * @param m The source object
 * @param o The `exports` object.
 */
export declare function __exportStar(m: any, o: any): void;

/**
 * Creates a value iterator from an `Iterable` or `ArrayLike` object.
 *
 * @param o The object.
 * @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`.
 */
export declare function __values(o: any): any;

/**
 * Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array.
 *
 * @param o The object to read from.
 * @param n The maximum number of arguments to read, defaults to `Infinity`.
 */
export declare function __read(o: any, n?: number): any[];

/**
 * Creates an array from iterable spread.
 *
 * @param args The Iterable objects to spread.
 * @deprecated since TypeScript 4.2 - Use `__spreadArray`
 */
export declare function __spread(...args: any[][]): any[];

/**
 * Creates an array from array spread.
 *
 * @param args The ArrayLikes to spread into the resulting array.
 * @deprecated since TypeScript 4.2 - Use `__spreadArray`
 */
export declare function __spreadArrays(...args: any[][]): any[];

/**
 * Spreads the `from` array into the `to` array.
 *
 * @param pack Replace empty elements with `undefined`.
 */
export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[];

/**
 * Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded,
 * and instead should be awaited and the resulting value passed back to the generator.
 *
 * @param v The value to await.
 */
export declare function __await(v: any): any;

/**
 * Converts a generator function into an async generator function, by using `yield __await`
 * in place of normal `await`.
 *
 * @param thisArg The reference to use as the `this` value in the generator function
 * @param _arguments The optional arguments array
 * @param generator The generator function
 */
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;

/**
 * Used to wrap a potentially async iterator in such a way so that it wraps the result
 * of calling iterator methods of `o` in `__await` instances, and then yields the awaited values.
 *
 * @param o The potentially async iterator.
 * @returns A synchronous iterator yielding `__await` instances on every odd invocation
 *          and returning the awaited `IteratorResult` passed to `next` every even invocation.
 */
export declare function __asyncDelegator(o: any): any;

/**
 * Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object.
 *
 * @param o The object.
 * @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`.
 */
export declare function __asyncValues(o: any): any;

/**
 * Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays.
 *
 * @param cooked The cooked possibly-sparse array.
 * @param raw The raw string content.
 */
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;

/**
 * Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS.
 *
 * ```js
 * import Default, { Named, Other } from "mod";
 * // or
 * import { default as Default, Named, Other } from "mod";
 * ```
 *
 * @param mod The CommonJS module exports object.
 */
export declare function __importStar<T>(mod: T): T;

/**
 * Used to shim default imports in ECMAScript Modules transpiled to CommonJS.
 *
 * ```js
 * import Default from "mod";
 * ```
 *
 * @param mod The CommonJS module exports object.
 */
export declare function __importDefault<T>(mod: T): T | { default: T };

/**
 * Emulates reading a private instance field.
 *
 * @param receiver The instance from which to read the private field.
 * @param state A WeakMap containing the private field value for an instance.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 *
 * @throws {TypeError} If `state` doesn't have an entry for `receiver`.
 */
export declare function __classPrivateFieldGet<T extends object, V>(
    receiver: T,
    state: { has(o: T): boolean, get(o: T): V | undefined },
    kind?: "f"
): V;

/**
 * Emulates reading a private static field.
 *
 * @param receiver The object from which to read the private static field.
 * @param state The class constructor containing the definition of the static field.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The descriptor that holds the static field value.
 *
 * @throws {TypeError} If `receiver` is not `state`.
 */
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
    receiver: T,
    state: T,
    kind: "f",
    f: { value: V }
): V;

/**
 * Emulates evaluating a private instance "get" accessor.
 *
 * @param receiver The instance on which to evaluate the private "get" accessor.
 * @param state A WeakSet used to verify an instance supports the private "get" accessor.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The "get" accessor function to evaluate.
 *
 * @throws {TypeError} If `state` doesn't have an entry for `receiver`.
 */
export declare function __classPrivateFieldGet<T extends object, V>(
    receiver: T,
    state: { has(o: T): boolean },
    kind: "a",
    f: () => V
): V;

/**
 * Emulates evaluating a private static "get" accessor.
 *
 * @param receiver The object on which to evaluate the private static "get" accessor.
 * @param state The class constructor containing the definition of the static "get" accessor.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The "get" accessor function to evaluate.
 *
 * @throws {TypeError} If `receiver` is not `state`.
 */
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
    receiver: T,
    state: T,
    kind: "a",
    f: () => V
): V;

/**
 * Emulates reading a private instance method.
 *
 * @param receiver The instance from which to read a private method.
 * @param state A WeakSet used to verify an instance supports the private method.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The function to return as the private instance method.
 *
 * @throws {TypeError} If `state` doesn't have an entry for `receiver`.
 */
export declare function __classPrivateFieldGet<T extends object, V extends (...args: any[]) => unknown>(
    receiver: T,
    state: { has(o: T): boolean },
    kind: "m",
    f: V
): V;

/**
 * Emulates reading a private static method.
 *
 * @param receiver The object from which to read the private static method.
 * @param state The class constructor containing the definition of the static method.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The function to return as the private static method.
 *
 * @throws {TypeError} If `receiver` is not `state`.
 */
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V extends (...args: any[]) => unknown>(
    receiver: T,
    state: T,
    kind: "m",
    f: V
): V;

/**
 * Emulates writing to a private instance field.
 *
 * @param receiver The instance on which to set a private field value.
 * @param state A WeakMap used to store the private field value for an instance.
 * @param value The value to store in the private field.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 *
 * @throws {TypeError} If `state` doesn't have an entry for `receiver`.
 */
export declare function __classPrivateFieldSet<T extends object, V>(
    receiver: T,
    state: { has(o: T): boolean, set(o: T, value: V): unknown },
    value: V,
    kind?: "f"
): V;

/**
 * Emulates writing to a private static field.
 *
 * @param receiver The object on which to set the private static field.
 * @param state The class constructor containing the definition of the private static field.
 * @param value The value to store in the private field.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The descriptor that holds the static field value.
 *
 * @throws {TypeError} If `receiver` is not `state`.
 */
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
    receiver: T,
    state: T,
    value: V,
    kind: "f",
    f: { value: V }
): V;

/**
 * Emulates writing to a private instance "set" accessor.
 *
 * @param receiver The instance on which to evaluate the private instance "set" accessor.
 * @param state A WeakSet used to verify an instance supports the private "set" accessor.
 * @param value The value to store in the private accessor.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The "set" accessor function to evaluate.
 *
 * @throws {TypeError} If `state` doesn't have an entry for `receiver`.
 */
export declare function __classPrivateFieldSet<T extends object, V>(
    receiver: T,
    state: { has(o: T): boolean },
    value: V,
    kind: "a",
    f: (v: V) => void
): V;

/**
 * Emulates writing to a private static "set" accessor.
 *
 * @param receiver The object on which to evaluate the private static "set" accessor.
 * @param state The class constructor containing the definition of the static "set" accessor.
 * @param value The value to store in the private field.
 * @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
 * @param f The "set" accessor function to evaluate.
 *
 * @throws {TypeError} If `receiver` is not `state`.
 */
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
    receiver: T,
    state: T,
    value: V,
    kind: "a",
    f: (v: V) => void
): V;

/**
 * Checks for the existence of a private field/method/accessor.
 *
 * @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member.
 * @param receiver The object for which to test the presence of the private member.
 */
export declare function __classPrivateFieldIn(
    state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
    receiver: unknown,
): boolean;

/**
 * Creates a re-export binding on `object` with key `objectKey` that references `target[key]`.
 *
 * @param object The local `exports` object.
 * @param target The object to re-export from.
 * @param key The property key of `target` to re-export.
 * @param objectKey The property key to re-export as. Defaults to `key`.
 */
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;

/**
 * Adds a disposable resource to a resource-tracking environment object.
 * @param env A resource-tracking environment object.
 * @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`.
 * @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added.
 * @returns The {@link value} argument.
 *
 * @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not
 * defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method.
 */
export declare function __addDisposableResource<T>(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T;

/**
 * Disposes all resources in a resource-tracking environment object.
 * @param env A resource-tracking environment object.
 * @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`.
 *
 * @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the
 * error recorded in the resource-tracking environment object.
 * @seealso {@link __addDisposableResource}
 */
export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any;

/**
 * Transforms a relative import specifier ending in a non-declaration TypeScript file extension to its JavaScript file extension counterpart.
 * @param path The import specifier.
 * @param preserveJsx Causes '*.tsx' to transform to '*.jsx' instead of '*.js'. Should be true when `--jsx` is set to `preserve`.
 */
export declare function __rewriteRelativeImportExtension(path: string, preserveJsx?: boolean): string;<script src="tslib.es6.js"></script>/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

export function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

export var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

export function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

export function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

export function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};

export function __runInitializers(thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};

export function __propKey(x) {
    return typeof x === "symbol" ? x : "".concat(x);
};

export function __setFunctionName(f, name, prefix) {
    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

export function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

export function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

export function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (g && (g = 0, op[0] && (_ = 0)), _) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

export var __createBinding = Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
        desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
});

export function __exportStar(m, o) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

export function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

export function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

/** @deprecated */
export function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

/** @deprecated */
export function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
}

export function __spreadArray(to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
}

export function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

export function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

export function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

export function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

export function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
};

var ownKeys = function(o) {
    ownKeys = Object.getOwnPropertyNames || function (o) {
        var ar = [];
        for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
        return ar;
    };
    return ownKeys(o);
};

export function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
    __setModuleDefault(result, mod);
    return result;
}

export function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

export function __classPrivateFieldGet(receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

export function __classPrivateFieldSet(receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

export function __classPrivateFieldIn(state, receiver) {
    if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof state === "function" ? receiver === state : state.has(receiver);
}

export function __addDisposableResource(env, value, async) {
    if (value !== null && value !== void 0) {
        if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
        var dispose, inner;
        if (async) {
            if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
            dispose = value[Symbol.asyncDispose];
        }
        if (dispose === void 0) {
            if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
            dispose = value[Symbol.dispose];
            if (async) inner = dispose;
        }
        if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
        if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
        env.stack.push({ value: value, dispose: dispose, async: async });
    }
    else if (async) {
        env.stack.push({ async: true });
    }
    return value;

}

var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
    var e = new Error(message);
    return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

export function __disposeResources(env) {
    function fail(e) {
        env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
        env.hasError = true;
    }
    var r, s = 0;
    function next() {
        while (r = env.stack.pop()) {
            try {
                if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
                if (r.dispose) {
                    var result = r.dispose.call(r.value);
                    if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
                }
                else s |= 1;
            }
            catch (e) {
                fail(e);
            }
        }
        if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
        if (env.hasError) throw env.error;
    }
    return next();
}

export function __rewriteRelativeImportExtension(path, preserveJsx) {
    if (typeof path === "string" && /^\.\.?\//.test(path)) {
        return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
            return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
        });
    }
    return path;
}

export default {
    __extends: __extends,
    __assign: __assign,
    __rest: __rest,
    __decorate: __decorate,
    __param: __param,
    __esDecorate: __esDecorate,
    __runInitializers: __runInitializers,
    __propKey: __propKey,
    __setFunctionName: __setFunctionName,
    __metadata: __metadata,
    __awaiter: __awaiter,
    __generator: __generator,
    __createBinding: __createBinding,
    __exportStar: __exportStar,
    __values: __values,
    __read: __read,
    __spread: __spread,
    __spreadArrays: __spreadArrays,
    __spreadArray: __spreadArray,
    __await: __await,
    __asyncGenerator: __asyncGenerator,
    __asyncDelegator: __asyncDelegator,
    __asyncValues: __asyncValues,
    __makeTemplateObject: __makeTemplateObject,
    __importStar: __importStar,
    __importDefault: __importDefault,
    __classPrivateFieldGet: __classPrivateFieldGet,
    __classPrivateFieldSet: __classPrivateFieldSet,
    __classPrivateFieldIn: __classPrivateFieldIn,
    __addDisposableResource: __addDisposableResource,
    __disposeResources: __disposeResources,
    __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
};
/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */

var extendStatics = function(d, b) {
  extendStatics = Object.setPrototypeOf ||
      ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
      function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  return extendStatics(d, b);
};

export function __extends(d, b) {
  if (typeof b !== "function" && b !== null)
      throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  extendStatics(d, b);
  function __() { this.constructor = d; }
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

export var __assign = function() {
  __assign = Object.assign || function __assign(t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
          s = arguments[i];
          for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
      }
      return t;
  }
  return __assign.apply(this, arguments);
}

export function __rest(s, e) {
  var t = {};
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
      t[p] = s[p];
  if (s != null && typeof Object.getOwnPropertySymbols === "function")
      for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
          if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
              t[p[i]] = s[p[i]];
      }
  return t;
}

export function __decorate(decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
}

export function __param(paramIndex, decorator) {
  return function (target, key) { decorator(target, key, paramIndex); }
}

export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
  function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
  var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
  var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
  var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
  var _, done = false;
  for (var i = decorators.length - 1; i >= 0; i--) {
      var context = {};
      for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
      for (var p in contextIn.access) context.access[p] = contextIn.access[p];
      context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
      var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
      if (kind === "accessor") {
          if (result === void 0) continue;
          if (result === null || typeof result !== "object") throw new TypeError("Object expected");
          if (_ = accept(result.get)) descriptor.get = _;
          if (_ = accept(result.set)) descriptor.set = _;
          if (_ = accept(result.init)) initializers.unshift(_);
      }
      else if (_ = accept(result)) {
          if (kind === "field") initializers.unshift(_);
          else descriptor[key] = _;
      }
  }
  if (target) Object.defineProperty(target, contextIn.name, descriptor);
  done = true;
};

export function __runInitializers(thisArg, initializers, value) {
  var useValue = arguments.length > 2;
  for (var i = 0; i < initializers.length; i++) {
      value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
  }
  return useValue ? value : void 0;
};

export function __propKey(x) {
  return typeof x === "symbol" ? x : "".concat(x);
};

export function __setFunctionName(f, name, prefix) {
  if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
  return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};

export function __metadata(metadataKey, metadataValue) {
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

export function __awaiter(thisArg, _arguments, P, generator) {
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  return new (P || (P = Promise))(function (resolve, reject) {
      function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
      function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
      function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
      step((generator = generator.apply(thisArg, _arguments || [])).next());
  });
}

export function __generator(thisArg, body) {
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
  return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  function verb(n) { return function (v) { return step([n, v]); }; }
  function step(op) {
      if (f) throw new TypeError("Generator is already executing.");
      while (g && (g = 0, op[0] && (_ = 0)), _) try {
          if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
          if (y = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
              case 0: case 1: t = op; break;
              case 4: _.label++; return { value: op[1], done: false };
              case 5: _.label++; y = op[1]; op = [0]; continue;
              case 7: op = _.ops.pop(); _.trys.pop(); continue;
              default:
                  if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                  if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                  if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                  if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                  if (t[2]) _.ops.pop();
                  _.trys.pop(); continue;
          }
          op = body.call(thisArg, _);
      } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
      if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  }
}

export var __createBinding = Object.create ? (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  var desc = Object.getOwnPropertyDescriptor(m, k);
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
  }
  Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
  if (k2 === undefined) k2 = k;
  o[k2] = m[k];
});

export function __exportStar(m, o) {
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}

export function __values(o) {
  var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  if (m) return m.call(o);
  if (o && typeof o.length === "number") return {
      next: function () {
          if (o && i >= o.length) o = void 0;
          return { value: o && o[i++], done: !o };
      }
  };
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

export function __read(o, n) {
  var m = typeof Symbol === "function" && o[Symbol.iterator];
  if (!m) return o;
  var i = m.call(o), r, ar = [], e;
  try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  }
  catch (error) { e = { error: error }; }
  finally {
      try {
          if (r && !r.done && (m = i["return"])) m.call(i);
      }
      finally { if (e) throw e.error; }
  }
  return ar;
}

/** @deprecated */
export function __spread() {
  for (var ar = [], i = 0; i < arguments.length; i++)
      ar = ar.concat(__read(arguments[i]));
  return ar;
}

/** @deprecated */
export function __spreadArrays() {
  for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
  for (var r = Array(s), k = 0, i = 0; i < il; i++)
      for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
          r[k] = a[j];
  return r;
}

export function __spreadArray(to, from, pack) {
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
      if (ar || !(i in from)) {
          if (!ar) ar = Array.prototype.slice.call(from, 0, i);
          ar[i] = from[i];
      }
  }
  return to.concat(ar || Array.prototype.slice.call(from));
}

export function __await(v) {
  return this instanceof __await ? (this.v = v, this) : new __await(v);
}

export function __asyncGenerator(thisArg, _arguments, generator) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var g = generator.apply(thisArg, _arguments || []), i, q = [];
  return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
  function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
  function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
  function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  function fulfill(value) { resume("next", value); }
  function reject(value) { resume("throw", value); }
  function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

export function __asyncDelegator(o) {
  var i, p;
  return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}

export function __asyncValues(o) {
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  var m = o[Symbol.asyncIterator], i;
  return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
  function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

export function __makeTemplateObject(cooked, raw) {
  if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  return cooked;
};

var __setModuleDefault = Object.create ? (function(o, v) {
  Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
  o["default"] = v;
};

var ownKeys = function(o) {
  ownKeys = Object.getOwnPropertyNames || function (o) {
    var ar = [];
    for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
    return ar;
  };
  return ownKeys(o);
};

export function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
  __setModuleDefault(result, mod);
  return result;
}

export function __importDefault(mod) {
  return (mod && mod.__esModule) ? mod : { default: mod };
}

export function __classPrivateFieldGet(receiver, state, kind, f) {
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}

export function __classPrivateFieldSet(receiver, state, value, kind, f) {
  if (kind === "m") throw new TypeError("Private method is not writable");
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}

export function __classPrivateFieldIn(state, receiver) {
  if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
  return typeof state === "function" ? receiver === state : state.has(receiver);
}

export function __addDisposableResource(env, value, async) {
  if (value !== null && value !== void 0) {
    if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
    var dispose, inner;
    if (async) {
      if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
      dispose = value[Symbol.asyncDispose];
    }
    if (dispose === void 0) {
      if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
      dispose = value[Symbol.dispose];
      if (async) inner = dispose;
    }
    if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
    if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
    env.stack.push({ value: value, dispose: dispose, async: async });
  }
  else if (async) {
    env.stack.push({ async: true });
  }
  return value;
}

var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
  var e = new Error(message);
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};

export function __disposeResources(env) {
  function fail(e) {
    env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
    env.hasError = true;
  }
  var r, s = 0;
  function next() {
    while (r = env.stack.pop()) {
      try {
        if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
        if (r.dispose) {
          var result = r.dispose.call(r.value);
          if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
        }
        else s |= 1;
      }
      catch (e) {
        fail(e);
      }
    }
    if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
    if (env.hasError) throw env.error;
  }
  return next();
}

export function __rewriteRelativeImportExtension(path, preserveJsx) {
  if (typeof path === "string" && /^\.\.?\//.test(path)) {
      return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
          return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
      });
  }
  return path;
}

export default {
  __extends,
  __assign,
  __rest,
  __decorate,
  __param,
  __esDecorate,
  __runInitializers,
  __propKey,
  __setFunctionName,
  __metadata,
  __awaiter,
  __generator,
  __createBinding,
  __exportStar,
  __values,
  __read,
  __spread,
  __spreadArrays,
  __spreadArray,
  __await,
  __asyncGenerator,
  __asyncDelegator,
  __asyncValues,
  __makeTemplateObject,
  __importStar,
  __importDefault,
  __classPrivateFieldGet,
  __classPrivateFieldSet,
  __classPrivateFieldIn,
  __addDisposableResource,
  __disposeResources,
  __rewriteRelativeImportExtension,
};
<script src="tslib.js"></script>/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __esDecorate;
var __runInitializers;
var __propKey;
var __setFunctionName;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __spreadArrays;
var __spreadArray;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
var __classPrivateFieldGet;
var __classPrivateFieldSet;
var __classPrivateFieldIn;
var __createBinding;
var __addDisposableResource;
var __disposeResources;
var __rewriteRelativeImportExtension;
(function (factory) {
    var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
    if (typeof define === "function" && define.amd) {
        define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
    }
    else if (typeof module === "object" && typeof module.exports === "object") {
        factory(createExporter(root, createExporter(module.exports)));
    }
    else {
        factory(createExporter(root));
    }
    function createExporter(exports, previous) {
        if (exports !== root) {
            if (typeof Object.create === "function") {
                Object.defineProperty(exports, "__esModule", { value: true });
            }
            else {
                exports.__esModule = true;
            }
        }
        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
    }
})
(function (exporter) {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };

    __extends = function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };

    __assign = Object.assign || function (t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    };

    __rest = function (s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    };

    __decorate = function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };

    __param = function (paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    };

    __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
        function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
        var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
        var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
        var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
        var _, done = false;
        for (var i = decorators.length - 1; i >= 0; i--) {
            var context = {};
            for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
            for (var p in contextIn.access) context.access[p] = contextIn.access[p];
            context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
            var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
            if (kind === "accessor") {
                if (result === void 0) continue;
                if (result === null || typeof result !== "object") throw new TypeError("Object expected");
                if (_ = accept(result.get)) descriptor.get = _;
                if (_ = accept(result.set)) descriptor.set = _;
                if (_ = accept(result.init)) initializers.unshift(_);
            }
            else if (_ = accept(result)) {
                if (kind === "field") initializers.unshift(_);
                else descriptor[key] = _;
            }
        }
        if (target) Object.defineProperty(target, contextIn.name, descriptor);
        done = true;
    };

    __runInitializers = function (thisArg, initializers, value) {
        var useValue = arguments.length > 2;
        for (var i = 0; i < initializers.length; i++) {
            value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
        }
        return useValue ? value : void 0;
    };

    __propKey = function (x) {
        return typeof x === "symbol" ? x : "".concat(x);
    };

    __setFunctionName = function (f, name, prefix) {
        if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
        return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
    };

    __metadata = function (metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    };

    __awaiter = function (thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    };

    __generator = function (thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
        return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (g && (g = 0, op[0] && (_ = 0)), _) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    };

    __exportStar = function(m, o) {
        for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
    };

    __createBinding = Object.create ? (function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        var desc = Object.getOwnPropertyDescriptor(m, k);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
            desc = { enumerable: true, get: function() { return m[k]; } };
        }
        Object.defineProperty(o, k2, desc);
    }) : (function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
    });

    __values = function (o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };

    __read = function (o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    };

    /** @deprecated */
    __spread = function () {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    };

    /** @deprecated */
    __spreadArrays = function () {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    __spreadArray = function (to, from, pack) {
        if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
            if (ar || !(i in from)) {
                if (!ar) ar = Array.prototype.slice.call(from, 0, i);
                ar[i] = from[i];
            }
        }
        return to.concat(ar || Array.prototype.slice.call(from));
    };

    __await = function (v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    };

    __asyncGenerator = function (thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
        function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
        function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    };

    __asyncDelegator = function (o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
    };

    __asyncValues = function (o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    };

    __makeTemplateObject = function (cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    var __setModuleDefault = Object.create ? (function(o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function(o, v) {
        o["default"] = v;
    };

    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };

    __importStar = function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };

    __importDefault = function (mod) {
        return (mod && mod.__esModule) ? mod : { "default": mod };
    };

    __classPrivateFieldGet = function (receiver, state, kind, f) {
        if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
        return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
    };

    __classPrivateFieldSet = function (receiver, state, value, kind, f) {
        if (kind === "m") throw new TypeError("Private method is not writable");
        if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
        return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
    };

    __classPrivateFieldIn = function (state, receiver) {
        if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
        return typeof state === "function" ? receiver === state : state.has(receiver);
    };

    __addDisposableResource = function (env, value, async) {
        if (value !== null && value !== void 0) {
            if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
            var dispose, inner;
            if (async) {
                if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
                dispose = value[Symbol.asyncDispose];
            }
            if (dispose === void 0) {
                if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
                dispose = value[Symbol.dispose];
                if (async) inner = dispose;
            }
            if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
            if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
            env.stack.push({ value: value, dispose: dispose, async: async });
        }
        else if (async) {
            env.stack.push({ async: true });
        }
        return value;
    };

    var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
        var e = new Error(message);
        return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
    };

    __disposeResources = function (env) {
        function fail(e) {
            env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
            env.hasError = true;
        }
        var r, s = 0;
        function next() {
            while (r = env.stack.pop()) {
                try {
                    if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
                    if (r.dispose) {
                        var result = r.dispose.call(r.value);
                        if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
                    }
                    else s |= 1;
                }
                catch (e) {
                    fail(e);
                }
            }
            if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
            if (env.hasError) throw env.error;
        }
        return next();
    };

    __rewriteRelativeImportExtension = function (path, preserveJsx) {
        if (typeof path === "string" && /^\.\.?\//.test(path)) {
            return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
                return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
            });
        }
        return path;
    };

    exporter("__extends", __extends);
    exporter("__assign", __assign);
    exporter("__rest", __rest);
    exporter("__decorate", __decorate);
    exporter("__param", __param);
    exporter("__esDecorate", __esDecorate);
    exporter("__runInitializers", __runInitializers);
    exporter("__propKey", __propKey);
    exporter("__setFunctionName", __setFunctionName);
    exporter("__metadata", __metadata);
    exporter("__awaiter", __awaiter);
    exporter("__generator", __generator);
    exporter("__exportStar", __exportStar);
    exporter("__createBinding", __createBinding);
    exporter("__values", __values);
    exporter("__read", __read);
    exporter("__spread", __spread);
    exporter("__spreadArrays", __spreadArrays);
    exporter("__spreadArray", __spreadArray);
    exporter("__await", __await);
    exporter("__asyncGenerator", __asyncGenerator);
    exporter("__asyncDelegator", __asyncDelegator);
    exporter("__asyncValues", __asyncValues);
    exporter("__makeTemplateObject", __makeTemplateObject);
    exporter("__importStar", __importStar);
    exporter("__importDefault", __importDefault);
    exporter("__classPrivateFieldGet", __classPrivateFieldGet);
    exporter("__classPrivateFieldSet", __classPrivateFieldSet);
    exporter("__classPrivateFieldIn", __classPrivateFieldIn);
    exporter("__addDisposableResource", __addDisposableResource);
    exporter("__disposeResources", __disposeResources);
    exporter("__rewriteRelativeImportExtension", __rewriteRelativeImportExtension);
});

0 && (module.exports = {
    __extends: __extends,
    __assign: __assign,
    __rest: __rest,
    __decorate: __decorate,
    __param: __param,
    __esDecorate: __esDecorate,
    __runInitializers: __runInitializers,
    __propKey: __propKey,
    __setFunctionName: __setFunctionName,
    __metadata: __metadata,
    __awaiter: __awaiter,
    __generator: __generator,
    __exportStar: __exportStar,
    __createBinding: __createBinding,
    __values: __values,
    __read: __read,
    __spread: __spread,
    __spreadArrays: __spreadArrays,
    __spreadArray: __spreadArray,
    __await: __await,
    __asyncGenerator: __asyncGenerator,
    __asyncDelegator: __asyncDelegator,
    __asyncValues: __asyncValues,
    __makeTemplateObject: __makeTemplateObject,
    __importStar: __importStar,
    __importDefault: __importDefault,
    __classPrivateFieldGet: __classPrivateFieldGet,
    __classPrivateFieldSet: __classPrivateFieldSet,
    __classPrivateFieldIn: __classPrivateFieldIn,
    __addDisposableResource: __addDisposableResource,
    __disposeResources: __disposeResources,
    __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,
});
{
  "name": "@sentry/electron",
  "description": "Official Sentry SDK for Electron",
  "version": "4.5.0",
  "main": "./index.js",
  "module": "./esm/main/index.js",
  "browser": "./esm/renderer/index.js",
  "exports": {
    ".": {
      "node": {
        "require": "./index.js",
        "import": "./esm/main/index.js"
      },
      "default": "./esm/renderer/index.js"
    },
    "./main": {
      "require": "./main/index.js",
      "import": "./esm/main/index.js"
    },
    "./renderer": {
      "require": "./renderer/index.js",
      "import": "./esm/renderer/index.js"
    },
    "./preload": "./preload/index.js"
  },
  "repository": "https://github.com/getsentry/sentry-electron.git",
  "author": "Sentry",
  "contributors": [
    "Tim Fish"
  ],
  "license": "MIT",
  "types": "./index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "scripts": {
    "prebuild": "yarn clean && node scripts/update-version.js",
    "build": "run-p build:es6 build:esm build:preload",
    "build:es6": "tsc -p tsconfig.build.json",
    "build:esm": "tsc -p tsconfig.esm.json",
    "build:preload": "node scripts/build-preload.js",
    "build:watch": "run-p build:watch:es6 build:watch:esm",
    "build:watch:es6": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
    "build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
    "clean": "rimraf coverage esm main preload renderer index.* integrations.* ipc.* sentry-electron*.tgz",
    "prelint": "node scripts/update-version.js",
    "update-electron-versions": "electron-latest-versions --start 2 > ./test/e2e/versions.json",
    "update-sdk-versions": "node ./scripts/update-sdk-versions.mjs",
    "lint": "run-s lint:prettier lint:eslint",
    "lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
    "lint:eslint": "eslint . --cache --format stylish",
    "fix": "run-s fix:eslint fix:prettier",
    "fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
    "fix:eslint": "eslint . --format stylish --fix",
    "pretest": "yarn build",
    "test": "cross-env TS_NODE_PROJECT=tsconfig.json xvfb-maybe electron-mocha --require ts-node/register/transpile-only --timeout 120000 ./test/unit/**/*.ts",
    "pree2e": "rimraf test/e2e/dist/**/node_modules/@sentry/** test/e2e/dist/**/yarn.lock && node scripts/clean-cache.js && yarn build && npm pack",
    "e2e": "cross-env TS_NODE_PROJECT=tsconfig.json xvfb-maybe mocha --require ts-node/register/transpile-only --retries 3 ./test/e2e/*.ts"
  },
  "dependencies": {
    "@sentry/browser": "7.48.0",
    "@sentry/core": "7.48.0",
    "@sentry/node": "7.48.0",
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0",
    "deepmerge": "4.3.0",
    "tslib": "^2.5.0"
  },
  "devDependencies": {
    "@sentry-internal/eslint-config-sdk": "7.48.0",
    "@sentry-internal/typescript": "7.48.0",
    "@types/busboy": "^0.2.3",
    "@types/chai": "^4.2.10",
    "@types/chai-as-promised": "^7.1.5",
    "@types/chai-subset": "^1.3.3",
    "@types/form-data": "^2.5.0",
    "@types/koa": "^2.0.52",
    "@types/koa-bodyparser": "^4.3.0",
    "@types/mocha": "^9.0.0",
    "@types/tmp": "^0.2.2",
    "busboy": "^0.3.1",
    "chai": "^4.3.7",
    "chai-as-promised": "^7.1.1",
    "chai-subset": "^1.6.0",
    "cross-env": "^7.0.3",
    "electron": "23.0.0",
    "electron-latest-versions": "^0.2.0",
    "electron-mocha": "^11.0.2",
    "eslint": "7.32.0",
    "extract-zip": "^2.0.1",
    "koa": "^2.14.1",
    "koa-bodyparser": "^4.3.0",
    "koa-tree-router": "^0.12.1",
    "latest-version": "^7.0.0",
    "mocha": "^10.2.0",
    "npm-run-all": "^4.1.5",
    "prettier": "^2.8.4",
    "rimraf": "^3.0.2",
    "tmp": "^0.2.1",
    "ts-node": "^10.9.1",
    "typescript": "^4.9.5",
    "xvfb-maybe": "^0.2.1",
    "yaml": "^2.2.1"
  },
  "volta": {
    "node": "18.12.1",
    "yarn": "1.22.19"
  }
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var electron_1 = require("electron");
var PROTOCOL_SCHEME = 'sentry-ipc';
var IPCChannel;
(function (IPCChannel) {
    IPCChannel["PING"] = "sentry-electron.ping";
    IPCChannel["EVENT"] = "sentry-electron.event";
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel || (IPCChannel = {}));
;
if (window.__SENTRY_IPC__) {
    console.log('Sentry Electron preload has already been run');
}
else {
    var ipcObject = {
        sendScope: function (scopeJson) { return electron_1.ipcRenderer.send(IPCChannel.SCOPE, scopeJson); },
        sendEvent: function (eventJson) { return electron_1.ipcRenderer.send(IPCChannel.EVENT, eventJson); },
        sendEnvelope: function (envelope) { return electron_1.ipcRenderer.send(IPCChannel.ENVELOPE, envelope); },
    };
    window.__SENTRY_IPC__ = ipcObject;
    if (electron_1.contextBridge) {
        try {
            electron_1.contextBridge.exposeInMainWorld('__SENTRY_IPC__', ipcObject);
        }
        catch (e) {
        }
    }
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var electron_1 = require("electron");
var electron = require("electron");
var PROTOCOL_SCHEME = 'sentry-ipc';
var IPCChannel;
(function (IPCChannel) {
    IPCChannel["PING"] = "sentry-electron.ping";
    IPCChannel["EVENT"] = "sentry-electron.event";
    IPCChannel["SCOPE"] = "sentry-electron.scope";
    IPCChannel["ENVELOPE"] = "sentry-electron.envelope";
})(IPCChannel || (IPCChannel = {}));
;
if (window.__SENTRY_IPC__) {
    console.log('Sentry Electron preload has already been run');
}
else {
    electron_1.crashReporter.start({
        companyName: '',
        ignoreSystemCrashHandler: true,
        productName: electron.remote.app.name || electron.remote.app.getName(),
        submitURL: '',
        uploadToServer: false,
    });
    var ipcObject = {
        sendScope: function (scopeJson) { return electron_1.ipcRenderer.send(IPCChannel.SCOPE, scopeJson); },
        sendEvent: function (eventJson) { return electron_1.ipcRenderer.send(IPCChannel.EVENT, eventJson); },
        sendEnvelope: function (envelope) { return electron_1.ipcRenderer.send(IPCChannel.ENVELOPE, envelope); },
    };
    window.__SENTRY_IPC__ = ipcObject;
    if (electron_1.contextBridge) {
        try {
            electron_1.contextBridge.exposeInMainWorld('__SENTRY_IPC__', ipcObject);
        }
        catch (e) {
        }
    }
}
<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Official Sentry SDK for Electron

[![Build &
Test](https://github.com/getsentry/sentry-electron/actions/workflows/build.yml/badge.svg)](https://github.com/getsentry/sentry-electron/actions/workflows/build.yml)
[![Documentation](https://img.shields.io/badge/documentation-sentry.io-green.svg)](https://docs.sentry.io/platforms/javascript/electron/)
[![npm version](https://img.shields.io/npm/v/@sentry/electron.svg)](https://www.npmjs.com/package/@sentry/electron)
[![license](https://img.shields.io/github/license/getsentry/sentry-electron.svg)](https://github.com/getsentry/sentry-electron/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/SugnmRwkmV)

## Features

- Captures **Node errors** in the main process (using
  [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node))
- Captures **JavaScript errors** in renderer processes (using
  [`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser))
- Captures **native crashes** (Minidump crash reports) from renderers and the main process
- Collects **breadcrumbs and context** information along with events across renderers and the main process
- Supports `electron >= 2`

## Usage

To use this SDK, call `init(options)` as early as possible in the entry modules in the main process as well as all
renderer processes or further sub processes you spawn. This will initialize the SDK and hook into the environment.

```javascript
import { init } from '@sentry/electron';

init({
  dsn: '__DSN__',
  // ...
});
```
If you are using a JavaScript bundler, you may need to use the process specific imports to ensure the correct code is loaded for
each process:
```javascript
// In the Electron main process
import { init } from '@sentry/electron/main';

// In the Electron renderer processes
import { init } from '@sentry/electron/renderer';
```

If you are using a framework specific Sentry SDK, you can pass that `init` function as the second parameter in the
renderer and the two SDKs functionalities will be combined:
```javascript
import { init } from '@sentry/electron/renderer';
import { init as reactInit } from '@sentry/react';

init({ /* config */ }, reactInit);

```

To set context information or send manual events, use the exported functions of `@sentry/electron`. Note that these
functions will not perform any action before you have called `init()`:

```javascript
import * as Sentry from '@sentry/electron';

// Set user information, as well as tags and further extras
Sentry.configureScope((scope) => {
  scope.setExtra('battery', 0.7);
  scope.setTag('user_mode', 'admin');
  scope.setUser({ id: '4711' });
  // scope.clear();
});

// Add a breadcrumb for future events
Sentry.addBreadcrumb({
  message: 'My Breadcrumb',
  // ...
});

// Capture exceptions, messages or manual events
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
  message: 'Manual',
  stacktrace: [
    // ...
  ],
});
```
import * as ElectronRendererIntegrations from './integrations';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, StackFrame, Stacktrace, Thread, User, } from '@sentry/types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, getHubFromCarrier, getCurrentHub, Hub, makeMain, Scope, startTransaction, setContext, setExtra, setExtras, setTag, setTags, setUser, withScope, FunctionToString, InboundFilters, } from '@sentry/core';
export { BrowserClient, BrowserTracing, lastEventId, showReportDialog, Replay } from '@sentry/browser';
export type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';
export declare const Integrations: {
    GlobalHandlers: typeof import("@sentry/browser").GlobalHandlers;
    TryCatch: typeof import("@sentry/browser").TryCatch;
    Breadcrumbs: typeof import("@sentry/browser").Breadcrumbs;
    LinkedErrors: typeof import("@sentry/browser").LinkedErrors;
    HttpContext: typeof import("@sentry/browser").HttpContext;
    Dedupe: typeof import("@sentry/browser").Dedupe;
    FunctionToString: typeof import("@sentry/browser").FunctionToString;
    InboundFilters: typeof import("@sentry/browser").InboundFilters;
    ScopeToMain: typeof ElectronRendererIntegrations.ScopeToMain;
    EventToMain: typeof ElectronRendererIntegrations.EventToMain;
};
export { init, defaultIntegrations } from './sdk';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/renderer/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,4BAA4B,MAAM,gBAAgB,CAAC;AAE/D,YAAY,EACV,UAAU,EACV,cAAc,EACd,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,KAAK,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvG,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,eAAO,MAAM,YAAY;;;;;;;;;;;CAA8D,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultIntegrations = exports.init = exports.Integrations = exports.Replay = exports.showReportDialog = exports.lastEventId = exports.BrowserTracing = exports.BrowserClient = exports.InboundFilters = exports.FunctionToString = exports.withScope = exports.setUser = exports.setTags = exports.setTag = exports.setExtras = exports.setExtra = exports.setContext = exports.startTransaction = exports.Scope = exports.makeMain = exports.Hub = exports.getCurrentHub = exports.getHubFromCarrier = exports.createTransport = exports.configureScope = exports.captureMessage = exports.captureEvent = exports.captureException = exports.addBreadcrumb = exports.addGlobalEventProcessor = void 0;
const tslib_1 = require("tslib");
const browser_1 = require("@sentry/browser");
const ElectronRendererIntegrations = tslib_1.__importStar(require("./integrations"));
var core_1 = require("@sentry/core");
Object.defineProperty(exports, "addGlobalEventProcessor", { enumerable: true, get: function () { return core_1.addGlobalEventProcessor; } });
Object.defineProperty(exports, "addBreadcrumb", { enumerable: true, get: function () { return core_1.addBreadcrumb; } });
Object.defineProperty(exports, "captureException", { enumerable: true, get: function () { return core_1.captureException; } });
Object.defineProperty(exports, "captureEvent", { enumerable: true, get: function () { return core_1.captureEvent; } });
Object.defineProperty(exports, "captureMessage", { enumerable: true, get: function () { return core_1.captureMessage; } });
Object.defineProperty(exports, "configureScope", { enumerable: true, get: function () { return core_1.configureScope; } });
Object.defineProperty(exports, "createTransport", { enumerable: true, get: function () { return core_1.createTransport; } });
Object.defineProperty(exports, "getHubFromCarrier", { enumerable: true, get: function () { return core_1.getHubFromCarrier; } });
Object.defineProperty(exports, "getCurrentHub", { enumerable: true, get: function () { return core_1.getCurrentHub; } });
Object.defineProperty(exports, "Hub", { enumerable: true, get: function () { return core_1.Hub; } });
Object.defineProperty(exports, "makeMain", { enumerable: true, get: function () { return core_1.makeMain; } });
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return core_1.Scope; } });
Object.defineProperty(exports, "startTransaction", { enumerable: true, get: function () { return core_1.startTransaction; } });
Object.defineProperty(exports, "setContext", { enumerable: true, get: function () { return core_1.setContext; } });
Object.defineProperty(exports, "setExtra", { enumerable: true, get: function () { return core_1.setExtra; } });
Object.defineProperty(exports, "setExtras", { enumerable: true, get: function () { return core_1.setExtras; } });
Object.defineProperty(exports, "setTag", { enumerable: true, get: function () { return core_1.setTag; } });
Object.defineProperty(exports, "setTags", { enumerable: true, get: function () { return core_1.setTags; } });
Object.defineProperty(exports, "setUser", { enumerable: true, get: function () { return core_1.setUser; } });
Object.defineProperty(exports, "withScope", { enumerable: true, get: function () { return core_1.withScope; } });
Object.defineProperty(exports, "FunctionToString", { enumerable: true, get: function () { return core_1.FunctionToString; } });
Object.defineProperty(exports, "InboundFilters", { enumerable: true, get: function () { return core_1.InboundFilters; } });
var browser_2 = require("@sentry/browser");
Object.defineProperty(exports, "BrowserClient", { enumerable: true, get: function () { return browser_2.BrowserClient; } });
Object.defineProperty(exports, "BrowserTracing", { enumerable: true, get: function () { return browser_2.BrowserTracing; } });
Object.defineProperty(exports, "lastEventId", { enumerable: true, get: function () { return browser_2.lastEventId; } });
Object.defineProperty(exports, "showReportDialog", { enumerable: true, get: function () { return browser_2.showReportDialog; } });
Object.defineProperty(exports, "Replay", { enumerable: true, get: function () { return browser_2.Replay; } });
exports.Integrations = Object.assign(Object.assign({}, ElectronRendererIntegrations), browser_1.Integrations);
var sdk_1 = require("./sdk");
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return sdk_1.init; } });
Object.defineProperty(exports, "defaultIntegrations", { enumerable: true, get: function () { return sdk_1.defaultIntegrations; } });
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/renderer/index.ts"],"names":[],"mappings":";;;AAAA,6CAAsE;AAEtE,qFAA+D;AAoB/D,qCAuBsB;AAtBpB,+GAAA,uBAAuB,OAAA;AACvB,qGAAA,aAAa,OAAA;AACb,wGAAA,gBAAgB,OAAA;AAChB,oGAAA,YAAY,OAAA;AACZ,sGAAA,cAAc,OAAA;AACd,sGAAA,cAAc,OAAA;AACd,uGAAA,eAAe,OAAA;AACf,yGAAA,iBAAiB,OAAA;AACjB,qGAAA,aAAa,OAAA;AACb,2FAAA,GAAG,OAAA;AACH,gGAAA,QAAQ,OAAA;AACR,6FAAA,KAAK,OAAA;AACL,wGAAA,gBAAgB,OAAA;AAChB,kGAAA,UAAU,OAAA;AACV,gGAAA,QAAQ,OAAA;AACR,iGAAA,SAAS,OAAA;AACT,8FAAA,MAAM,OAAA;AACN,+FAAA,OAAO,OAAA;AACP,+FAAA,OAAO,OAAA;AACP,iGAAA,SAAS,OAAA;AACT,wGAAA,gBAAgB,OAAA;AAChB,sGAAA,cAAc,OAAA;AAGhB,2CAAuG;AAA9F,wGAAA,aAAa,OAAA;AAAE,yGAAA,cAAc,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,iGAAA,MAAM,OAAA;AAGhE,QAAA,YAAY,mCAAQ,4BAA4B,GAAK,sBAAmB,EAAG;AACxF,6BAAkD;AAAzC,2FAAA,IAAI,OAAA;AAAE,0GAAA,mBAAmB,OAAA","sourcesContent":["import { Integrations as BrowserIntegrations } from '@sentry/browser';\n\nimport * as ElectronRendererIntegrations from './integrations';\n\nexport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  User,\n} from '@sentry/types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  Scope,\n  startTransaction,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  withScope,\n  FunctionToString,\n  InboundFilters,\n} from '@sentry/core';\n\nexport { BrowserClient, BrowserTracing, lastEventId, showReportDialog, Replay } from '@sentry/browser';\nexport type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';\n\nexport const Integrations = { ...ElectronRendererIntegrations, ...BrowserIntegrations };\nexport { init, defaultIntegrations } from './sdk';\n"]}import { EventProcessor, Integration } from '@sentry/types';
/**
 * Passes events to the main process.
 */
export declare class EventToMain implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
}
//# sourceMappingURL=event-to-main.d.ts.map{"version":3,"file":"event-to-main.d.ts","sourceRoot":"","sources":["../../src/renderer/integrations/event-to-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKnE;;GAEG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAepF"}Object.defineProperty(exports, "__esModule", { value: true });
exports.EventToMain = void 0;
const utils_1 = require("@sentry/utils");
const ipc_1 = require("../ipc");
/**
 * Passes events to the main process.
 */
class EventToMain {
    constructor() {
        /** @inheritDoc */
        this.name = EventToMain.id;
    }
    /** @inheritDoc */
    setupOnce(addGlobalEventProcessor) {
        const ipc = (0, ipc_1.getIPC)();
        addGlobalEventProcessor((event) => {
            // Ensure breadcrumbs is not `undefined` as `walk` translates it into a string
            event.breadcrumbs = event.breadcrumbs || [];
            // Remove the environment as it defaults to 'production' and overwrites the main process environment
            delete event.environment;
            ipc.sendEvent(JSON.stringify((0, utils_1.normalize)(event, 20, 2000)));
            // Events are handled and sent from the main process so we return null here so nothing is sent from the renderer
            return null;
        });
    }
}
exports.EventToMain = EventToMain;
/** @inheritDoc */
EventToMain.id = 'EventToMain';
//# sourceMappingURL=event-to-main.js.map{"version":3,"file":"event-to-main.js","sourceRoot":"","sources":["../../src/renderer/integrations/event-to-main.ts"],"names":[],"mappings":";;AACA,yCAA0C;AAE1C,gCAAgC;AAEhC;;GAEG;AACH,MAAa,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAkBvC,CAAC;IAhBC,kBAAkB;IACX,SAAS,CAAC,uBAA2D;QAC1E,MAAM,GAAG,GAAG,IAAA,YAAM,GAAE,CAAC;QAErB,uBAAuB,CAAC,CAAC,KAAY,EAAE,EAAE;YACvC,8EAA8E;YAC9E,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;YAE5C,oGAAoG;YACpG,OAAO,KAAK,CAAC,WAAW,CAAC;YAEzB,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,iBAAS,EAAC,KAAK,EAAE,EAAE,EAAE,IAAK,CAAC,CAAC,CAAC,CAAC;YAC3D,gHAAgH;YAChH,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;;AAtBH,kCAuBC;AAtBC,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { Event, EventProcessor, Integration } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { getIPC } from '../ipc';\n\n/**\n * Passes events to the main process.\n */\nexport class EventToMain implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'EventToMain';\n\n  /** @inheritDoc */\n  public name: string = EventToMain.id;\n\n  /** @inheritDoc */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    const ipc = getIPC();\n\n    addGlobalEventProcessor((event: Event) => {\n      // Ensure breadcrumbs is not `undefined` as `walk` translates it into a string\n      event.breadcrumbs = event.breadcrumbs || [];\n\n      // Remove the environment as it defaults to 'production' and overwrites the main process environment\n      delete event.environment;\n\n      ipc.sendEvent(JSON.stringify(normalize(event, 20, 2_000)));\n      // Events are handled and sent from the main process so we return null here so nothing is sent from the renderer\n      return null;\n    });\n  }\n}\n"]}export { ScopeToMain } from './scope-to-main';
export { EventToMain } from './event-to-main';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.EventToMain = exports.ScopeToMain = void 0;
var scope_to_main_1 = require("./scope-to-main");
Object.defineProperty(exports, "ScopeToMain", { enumerable: true, get: function () { return scope_to_main_1.ScopeToMain; } });
var event_to_main_1 = require("./event-to-main");
Object.defineProperty(exports, "EventToMain", { enumerable: true, get: function () { return event_to_main_1.EventToMain; } });
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/renderer/integrations/index.ts"],"names":[],"mappings":";;AAAA,iDAA8C;AAArC,4GAAA,WAAW,OAAA;AACpB,iDAA8C;AAArC,4GAAA,WAAW,OAAA","sourcesContent":["export { ScopeToMain } from './scope-to-main';\nexport { EventToMain } from './event-to-main';\n"]}import { Integration } from '@sentry/types';
/**
 * Passes scope changes to the main process.
 */
export declare class ScopeToMain implements Integration {
    /** @inheritDoc */
    static id: string;
    /** @inheritDoc */
    name: string;
    /** @inheritDoc */
    setupOnce(): void;
    /**
     * Sends the scope to the main process when it updates.
     */
    private _setupScopeListener;
}
//# sourceMappingURL=scope-to-main.d.ts.map{"version":3,"file":"scope-to-main.d.ts","sourceRoot":"","sources":["../../src/renderer/integrations/scope-to-main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C;;GAEG;AACH,qBAAa,WAAY,YAAW,WAAW;IAC7C,kBAAkB;IAClB,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC,kBAAkB;IACX,IAAI,EAAE,MAAM,CAAkB;IAErC,kBAAkB;IACX,SAAS,IAAI,IAAI;IAIxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAY5B"}Object.defineProperty(exports, "__esModule", { value: true });
exports.ScopeToMain = void 0;
const core_1 = require("@sentry/core");
const utils_1 = require("@sentry/utils");
const ipc_1 = require("../ipc");
/**
 * Passes scope changes to the main process.
 */
class ScopeToMain {
    constructor() {
        /** @inheritDoc */
        this.name = ScopeToMain.id;
    }
    /** @inheritDoc */
    setupOnce() {
        this._setupScopeListener();
    }
    /**
     * Sends the scope to the main process when it updates.
     */
    _setupScopeListener() {
        const scope = (0, core_1.getCurrentHub)().getScope();
        if (scope) {
            const ipc = (0, ipc_1.getIPC)();
            scope.addScopeListener((updatedScope) => {
                ipc.sendScope(JSON.stringify((0, utils_1.normalize)(updatedScope, 20, 2000)));
                scope.clearBreadcrumbs();
                scope.clearAttachments();
            });
        }
    }
}
exports.ScopeToMain = ScopeToMain;
/** @inheritDoc */
ScopeToMain.id = 'ScopeToMain';
//# sourceMappingURL=scope-to-main.js.map{"version":3,"file":"scope-to-main.js","sourceRoot":"","sources":["../../src/renderer/integrations/scope-to-main.ts"],"names":[],"mappings":";;AAAA,uCAA6C;AAE7C,yCAA0C;AAE1C,gCAAgC;AAEhC;;GAEG;AACH,MAAa,WAAW;IAAxB;QAIE,kBAAkB;QACX,SAAI,GAAW,WAAW,CAAC,EAAE,CAAC;IAsBvC,CAAC;IApBC,kBAAkB;IACX,SAAS;QACd,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAED;;OAEG;IACK,mBAAmB;QACzB,MAAM,KAAK,GAAG,IAAA,oBAAa,GAAE,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,KAAK,EAAE;YACT,MAAM,GAAG,GAAG,IAAA,YAAM,GAAE,CAAC;YAErB,KAAK,CAAC,gBAAgB,CAAC,CAAC,YAAY,EAAE,EAAE;gBACtC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,iBAAS,EAAC,YAAY,EAAE,EAAE,EAAE,IAAK,CAAC,CAAC,CAAC,CAAC;gBAClE,KAAK,CAAC,gBAAgB,EAAE,CAAC;gBACzB,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;;AA1BH,kCA2BC;AA1BC,kBAAkB;AACJ,cAAE,GAAW,aAAa,CAAC","sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { Integration } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport { getIPC } from '../ipc';\n\n/**\n * Passes scope changes to the main process.\n */\nexport class ScopeToMain implements Integration {\n  /** @inheritDoc */\n  public static id: string = 'ScopeToMain';\n\n  /** @inheritDoc */\n  public name: string = ScopeToMain.id;\n\n  /** @inheritDoc */\n  public setupOnce(): void {\n    this._setupScopeListener();\n  }\n\n  /**\n   * Sends the scope to the main process when it updates.\n   */\n  private _setupScopeListener(): void {\n    const scope = getCurrentHub().getScope();\n    if (scope) {\n      const ipc = getIPC();\n\n      scope.addScopeListener((updatedScope) => {\n        ipc.sendScope(JSON.stringify(normalize(updatedScope, 20, 2_000)));\n        scope.clearBreadcrumbs();\n        scope.clearAttachments();\n      });\n    }\n  }\n}\n"]}import { IPCInterface } from '../common';
/**
 * Renderer IPC interface
 *
 * Favours IPC if its been exposed via a preload script but will
 * fallback to custom protocol and fetch if IPC is not available
 */
export declare function getIPC(): IPCInterface;
//# sourceMappingURL=ipc.d.ts.map{"version":3,"file":"ipc.d.ts","sourceRoot":"","sources":["../src/renderer/ipc.ts"],"names":[],"mappings":"AAIA,OAAO,EAAc,YAAY,EAAmB,MAAM,WAAW,CAAC;AAyCtE;;;;;GAKG;AACH,wBAAgB,MAAM,IAAI,YAAY,CAMrC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.getIPC = void 0;
/* eslint-disable no-restricted-globals */
/* eslint-disable no-console */
const utils_1 = require("@sentry/utils");
const common_1 = require("../common");
/** Gets the available IPC implementation */
function getImplementation() {
    // Favour IPC if it's been exposed by a preload script
    if (window.__SENTRY_IPC__) {
        return window.__SENTRY_IPC__;
    }
    utils_1.logger.log('IPC was not configured in preload script, falling back to custom protocol and fetch');
    fetch(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.PING}/sentry_key`, { method: 'POST', body: '' }).catch(() => console.error(`Sentry SDK failed to establish connection with the Electron main process.
 - Ensure you have initialized the SDK in the main process
 - If your renderers use custom sessions, be sure to set 'getSessions' in the main process options
 - If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`));
    // We include sentry_key in the URL so these dont end up in fetch breadcrumbs
    // https://github.com/getsentry/sentry-javascript/blob/a3f70d8869121183bec037571a3ee78efaf26b0b/packages/browser/src/integrations/breadcrumbs.ts#L240
    return {
        sendScope: (body) => {
            fetch(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.SCOPE}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
        sendEvent: (body) => {
            fetch(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.EVENT}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
        sendEnvelope: (body) => {
            fetch(`${common_1.PROTOCOL_SCHEME}://${common_1.IPCChannel.ENVELOPE}/sentry_key`, { method: 'POST', body }).catch(() => {
                // ignore
            });
        },
    };
}
let cachedInterface;
/**
 * Renderer IPC interface
 *
 * Favours IPC if its been exposed via a preload script but will
 * fallback to custom protocol and fetch if IPC is not available
 */
function getIPC() {
    if (!cachedInterface) {
        cachedInterface = getImplementation();
    }
    return cachedInterface;
}
exports.getIPC = getIPC;
//# sourceMappingURL=ipc.js.map{"version":3,"file":"ipc.js","sourceRoot":"","sources":["../src/renderer/ipc.ts"],"names":[],"mappings":";;AAAA,0CAA0C;AAC1C,+BAA+B;AAC/B,yCAAuC;AAEvC,sCAAsE;AAEtE,4CAA4C;AAC5C,SAAS,iBAAiB;IACxB,sDAAsD;IACtD,IAAI,MAAM,CAAC,cAAc,EAAE;QACzB,OAAO,MAAM,CAAC,cAAc,CAAC;KAC9B;IAED,cAAM,CAAC,GAAG,CAAC,qFAAqF,CAAC,CAAC;IAElG,KAAK,CAAC,GAAG,wBAAe,MAAM,mBAAU,CAAC,IAAI,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CACnG,OAAO,CAAC,KAAK,CAAC;;;0HAGwG,CAAC,CACxH,CAAC;IAEF,6EAA6E;IAC7E,qJAAqJ;IACrJ,OAAO;QACL,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,KAAK,CAAC,GAAG,wBAAe,MAAM,mBAAU,CAAC,KAAK,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;QACD,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAClB,KAAK,CAAC,GAAG,wBAAe,MAAM,mBAAU,CAAC,KAAK,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBAChG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;QACD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;YACrB,KAAK,CAAC,GAAG,wBAAe,MAAM,mBAAU,CAAC,QAAQ,aAAa,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;gBACnG,SAAS;YACX,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAED,IAAI,eAAyC,CAAC;AAE9C;;;;;GAKG;AACH,SAAgB,MAAM;IACpB,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,iBAAiB,EAAE,CAAC;KACvC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAND,wBAMC","sourcesContent":["/* eslint-disable no-restricted-globals */\n/* eslint-disable no-console */\nimport { logger } from '@sentry/utils';\n\nimport { IPCChannel, IPCInterface, PROTOCOL_SCHEME } from '../common';\n\n/** Gets the available IPC implementation */\nfunction getImplementation(): IPCInterface {\n  // Favour IPC if it's been exposed by a preload script\n  if (window.__SENTRY_IPC__) {\n    return window.__SENTRY_IPC__;\n  }\n\n  logger.log('IPC was not configured in preload script, falling back to custom protocol and fetch');\n\n  fetch(`${PROTOCOL_SCHEME}://${IPCChannel.PING}/sentry_key`, { method: 'POST', body: '' }).catch(() =>\n    console.error(`Sentry SDK failed to establish connection with the Electron main process.\n - Ensure you have initialized the SDK in the main process\n - If your renderers use custom sessions, be sure to set 'getSessions' in the main process options\n - If you are bundling your main process code and using Electron < v5, you'll need to manually configure a preload script`),\n  );\n\n  // We include sentry_key in the URL so these dont end up in fetch breadcrumbs\n  // https://github.com/getsentry/sentry-javascript/blob/a3f70d8869121183bec037571a3ee78efaf26b0b/packages/browser/src/integrations/breadcrumbs.ts#L240\n  return {\n    sendScope: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.SCOPE}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n    sendEvent: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.EVENT}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n    sendEnvelope: (body) => {\n      fetch(`${PROTOCOL_SCHEME}://${IPCChannel.ENVELOPE}/sentry_key`, { method: 'POST', body }).catch(() => {\n        // ignore\n      });\n    },\n  };\n}\n\nlet cachedInterface: IPCInterface | undefined;\n\n/**\n * Renderer IPC interface\n *\n * Favours IPC if its been exposed via a preload script but will\n * fallback to custom protocol and fetch if IPC is not available\n */\nexport function getIPC(): IPCInterface {\n  if (!cachedInterface) {\n    cachedInterface = getImplementation();\n  }\n\n  return cachedInterface;\n}\n"]}import { BrowserOptions } from '@sentry/browser';
import { ScopeToMain } from './integrations';
export declare const defaultIntegrations: (import("@sentry/browser").InboundFilters | import("@sentry/browser").FunctionToString | ScopeToMain | import("@sentry/browser").GlobalHandlers | import("@sentry/browser").TryCatch | import("@sentry/browser").Breadcrumbs | import("@sentry/browser").LinkedErrors | import("@sentry/browser").HttpContext | import("@sentry/browser").Dedupe)[];
/**
 * Initialize Sentry in the Electron renderer process
 * @param options SDK options
 * @param originalInit Optional init function for a specific framework SDK
 * @returns
 */
export declare function init<O extends BrowserOptions>(options?: BrowserOptions & O, originalInit?: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_48_0: O) => void): void;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/renderer/sdk.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EAGf,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI7C,eAAO,MAAM,mBAAmB,qVAAqD,CAAC;AAEtF;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,cAAc,EAC3C,OAAO,GAAE,cAAc,GAAG,CAA4B,EAEtD,YAAY,GAAE,CAAC,6DAA6D,EAAE,CAAC,KAAK,IAAkB,GACrG,IAAI,CA2CN"}Object.defineProperty(exports, "__esModule", { value: true });
exports.init = exports.defaultIntegrations = void 0;
/* eslint-disable no-restricted-globals */
const browser_1 = require("@sentry/browser");
const utils_1 = require("@sentry/utils");
const common_1 = require("../common");
const integrations_1 = require("./integrations");
const stack_parse_1 = require("./stack-parse");
const transport_1 = require("./transport");
exports.defaultIntegrations = [...browser_1.defaultIntegrations, new integrations_1.ScopeToMain()];
/**
 * Initialize Sentry in the Electron renderer process
 * @param options SDK options
 * @param originalInit Optional init function for a specific framework SDK
 * @returns
 */
function init(options = {}, 
// This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches
originalInit = browser_1.init) {
    (0, common_1.ensureProcess)('renderer');
    // Ensure the browser SDK is only init'ed once.
    if (window === null || window === void 0 ? void 0 : window.__SENTRY__RENDERER_INIT__) {
        utils_1.logger.warn(`The browser SDK has already been initialized.
If init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);
        return;
    }
    window.__SENTRY__RENDERER_INIT__ = true;
    // We don't want browser session tracking enabled by default because we already have Electron
    // specific session tracking
    if (options.autoSessionTracking === undefined) {
        options.autoSessionTracking = false;
    }
    // Disable client reports for renderer as the sdk should only send
    // events using the main process.
    options.sendClientReports = false;
    if (options.defaultIntegrations === undefined) {
        options.defaultIntegrations = exports.defaultIntegrations;
    }
    if (options.stackParser === undefined) {
        options.stackParser = stack_parse_1.electronRendererStackParser;
    }
    if (options.dsn === undefined) {
        // Events are sent via the main process but browser SDK wont start without dsn
        options.dsn = 'https://12345@dummy.dsn/12345';
    }
    if (options.transport === undefined) {
        options.transport = transport_1.makeRendererTransport;
    }
    // We only handle initialScope in the main process otherwise it can cause race conditions over IPC
    delete options.initialScope;
    originalInit(options);
}
exports.init = init;
//# sourceMappingURL=sdk.js.map{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/renderer/sdk.ts"],"names":[],"mappings":";;AAAA,0CAA0C;AAC1C,6CAIyB;AACzB,yCAAuC;AAEvC,sCAA0C;AAC1C,iDAA6C;AAC7C,+CAA4D;AAC5D,2CAAoD;AAEvC,QAAA,mBAAmB,GAAG,CAAC,GAAG,6BAA0B,EAAE,IAAI,0BAAW,EAAE,CAAC,CAAC;AAEtF;;;;;GAKG;AACH,SAAgB,IAAI,CAClB,UAA8B,EAAwB;AACtD,8GAA8G;AAC9G,eAA2F,cAAW;IAEtG,IAAA,sBAAa,EAAC,UAAU,CAAC,CAAC;IAE1B,+CAA+C;IAC/C,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,yBAAyB,EAAE;QACrC,cAAM,CAAC,IAAI,CAAC;sHACsG,CAAC,CAAC;QACpH,OAAO;KACR;IAED,MAAM,CAAC,yBAAyB,GAAG,IAAI,CAAC;IAExC,6FAA6F;IAC7F,4BAA4B;IAC5B,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QAC7C,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;KACrC;IAED,kEAAkE;IAClE,iCAAiC;IACjC,OAAO,CAAC,iBAAiB,GAAG,KAAK,CAAC;IAElC,IAAI,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QAC7C,OAAO,CAAC,mBAAmB,GAAG,2BAAmB,CAAC;KACnD;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;QACrC,OAAO,CAAC,WAAW,GAAG,yCAA2B,CAAC;KACnD;IAED,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE;QAC7B,8EAA8E;QAC9E,OAAO,CAAC,GAAG,GAAG,+BAA+B,CAAC;KAC/C;IAED,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;QACnC,OAAO,CAAC,SAAS,GAAG,iCAAqB,CAAC;KAC3C;IAED,kGAAkG;IAClG,OAAO,OAAO,CAAC,YAAY,CAAC;IAE5B,YAAY,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;AA/CD,oBA+CC","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n  BrowserOptions,\n  defaultIntegrations as defaultBrowserIntegrations,\n  init as browserInit,\n} from '@sentry/browser';\nimport { logger } from '@sentry/utils';\n\nimport { ensureProcess } from '../common';\nimport { ScopeToMain } from './integrations';\nimport { electronRendererStackParser } from './stack-parse';\nimport { makeRendererTransport } from './transport';\n\nexport const defaultIntegrations = [...defaultBrowserIntegrations, new ScopeToMain()];\n\n/**\n * Initialize Sentry in the Electron renderer process\n * @param options SDK options\n * @param originalInit Optional init function for a specific framework SDK\n * @returns\n */\nexport function init<O extends BrowserOptions>(\n  options: BrowserOptions & O = {} as BrowserOptions & O,\n  // This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches\n  originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v7_48_0: O) => void = browserInit,\n): void {\n  ensureProcess('renderer');\n\n  // Ensure the browser SDK is only init'ed once.\n  if (window?.__SENTRY__RENDERER_INIT__) {\n    logger.warn(`The browser SDK has already been initialized.\nIf init has been called in the preload and contextIsolation is disabled, is not required to call init in the renderer`);\n    return;\n  }\n\n  window.__SENTRY__RENDERER_INIT__ = true;\n\n  // We don't want browser session tracking enabled by default because we already have Electron\n  // specific session tracking\n  if (options.autoSessionTracking === undefined) {\n    options.autoSessionTracking = false;\n  }\n\n  // Disable client reports for renderer as the sdk should only send\n  // events using the main process.\n  options.sendClientReports = false;\n\n  if (options.defaultIntegrations === undefined) {\n    options.defaultIntegrations = defaultIntegrations;\n  }\n\n  if (options.stackParser === undefined) {\n    options.stackParser = electronRendererStackParser;\n  }\n\n  if (options.dsn === undefined) {\n    // Events are sent via the main process but browser SDK wont start without dsn\n    options.dsn = 'https://12345@dummy.dsn/12345';\n  }\n\n  if (options.transport === undefined) {\n    options.transport = makeRendererTransport;\n  }\n\n  // We only handle initialScope in the main process otherwise it can cause race conditions over IPC\n  delete options.initialScope;\n\n  originalInit(options);\n}\n"]}import { StackParser } from '@sentry/types';
/**
 * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true
 */
export declare const electronRendererStackParser: StackParser;
//# sourceMappingURL=stack-parse.d.ts.map{"version":3,"file":"stack-parse.d.ts","sourceRoot":"","sources":["../src/renderer/stack-parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,MAAM,eAAe,CAAC;AAQxD;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,WAoBzC,CAAC"}Object.defineProperty(exports, "__esModule", { value: true });
exports.electronRendererStackParser = void 0;
const browser_1 = require("@sentry/browser");
const utils_1 = require("@sentry/utils");
const STACKTRACE_FRAME_LIMIT = 50;
const [, chrome] = browser_1.chromeStackLineParser;
const [, node] = (0, utils_1.nodeStackLineParser)();
/**
 * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true
 */
const electronRendererStackParser = (stack, skipFirst = 0) => {
    const frames = [];
    for (const line of stack.split('\n').slice(skipFirst)) {
        const chromeFrame = chrome(line);
        const nodeFrame = node(line);
        // We favour the chrome parser unless in_app == false
        if (chromeFrame && (nodeFrame === null || nodeFrame === void 0 ? void 0 : nodeFrame.in_app) !== false) {
            frames.push(chromeFrame);
        }
        else if (nodeFrame) {
            frames.push((0, utils_1.dropUndefinedKeys)(nodeFrame));
        }
        if (frames.length >= STACKTRACE_FRAME_LIMIT) {
            break;
        }
    }
    return (0, utils_1.stripSentryFramesAndReverse)(frames);
};
exports.electronRendererStackParser = electronRendererStackParser;
//# sourceMappingURL=stack-parse.js.map{"version":3,"file":"stack-parse.js","sourceRoot":"","sources":["../src/renderer/stack-parse.ts"],"names":[],"mappings":";;AAAA,6CAAwD;AAExD,yCAAoG;AAEpG,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,+BAAqB,CAAC;AACzC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,IAAA,2BAAmB,GAAE,CAAC;AAEvC;;GAEG;AACI,MAAM,2BAA2B,GAAgB,CAAC,KAAa,EAAE,YAAoB,CAAC,EAAgB,EAAE;IAC7G,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QACrD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAE7B,qDAAqD;QACrD,IAAI,WAAW,IAAI,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,MAAK,KAAK,EAAE;YAC9C,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC1B;aAAM,IAAI,SAAS,EAAE;YACpB,MAAM,CAAC,IAAI,CAAC,IAAA,yBAAiB,EAAC,SAAS,CAAC,CAAC,CAAC;SAC3C;QAED,IAAI,MAAM,CAAC,MAAM,IAAI,sBAAsB,EAAE;YAC3C,MAAM;SACP;KACF;IAED,OAAO,IAAA,mCAA2B,EAAC,MAAM,CAAC,CAAC;AAC7C,CAAC,CAAC;AApBW,QAAA,2BAA2B,+BAoBtC","sourcesContent":["import { chromeStackLineParser } from '@sentry/browser';\nimport { StackFrame, StackParser } from '@sentry/types';\nimport { dropUndefinedKeys, nodeStackLineParser, stripSentryFramesAndReverse } from '@sentry/utils';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n\nconst [, chrome] = chromeStackLineParser;\nconst [, node] = nodeStackLineParser();\n\n/**\n * A stack parser than combines Chrome and node.js parsers to give the best results even when nodeIntegration = true\n */\nexport const electronRendererStackParser: StackParser = (stack: string, skipFirst: number = 0): StackFrame[] => {\n  const frames: StackFrame[] = [];\n\n  for (const line of stack.split('\\n').slice(skipFirst)) {\n    const chromeFrame = chrome(line);\n    const nodeFrame = node(line);\n\n    // We favour the chrome parser unless in_app == false\n    if (chromeFrame && nodeFrame?.in_app !== false) {\n      frames.push(chromeFrame);\n    } else if (nodeFrame) {\n      frames.push(dropUndefinedKeys(nodeFrame));\n    }\n\n    if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n      break;\n    }\n  }\n\n  return stripSentryFramesAndReverse(frames);\n};\n"]}import { BaseTransportOptions, Transport } from '@sentry/types';
/**
 * Creates a Transport that passes envelopes to the Electron main process.
 */
export declare function makeRendererTransport(options: BaseTransportOptions): Transport;
//# sourceMappingURL=transport.d.ts.map{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/renderer/transport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAkD,MAAM,eAAe,CAAC;AAIhH;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAQ9E"}Object.defineProperty(exports, "__esModule", { value: true });
exports.makeRendererTransport = void 0;
const tslib_1 = require("tslib");
const core_1 = require("@sentry/core");
const ipc_1 = require("./ipc");
/**
 * Creates a Transport that passes envelopes to the Electron main process.
 */
function makeRendererTransport(options) {
    const ipc = (0, ipc_1.getIPC)();
    return (0, core_1.createTransport)(options, (request) => tslib_1.__awaiter(this, void 0, void 0, function* () {
        ipc.sendEnvelope(request.body);
        // Since the main process handles sending of envelopes and rate limiting, we always return 200 OK to the renderers.
        return { statusCode: 200 };
    }));
}
exports.makeRendererTransport = makeRendererTransport;
//# sourceMappingURL=transport.js.map{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/renderer/transport.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAG/C,+BAA+B;AAE/B;;GAEG;AACH,SAAgB,qBAAqB,CAAC,OAA6B;IACjE,MAAM,GAAG,GAAG,IAAA,YAAM,GAAE,CAAC;IAErB,OAAO,IAAA,sBAAe,EAAC,OAAO,EAAE,CAAO,OAAyB,EAAyC,EAAE;QACzG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,mHAAmH;QACnH,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;AACL,CAAC;AARD,sDAQC","sourcesContent":["import { createTransport } from '@sentry/core';\nimport { BaseTransportOptions, Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/types';\n\nimport { getIPC } from './ipc';\n\n/**\n * Creates a Transport that passes envelopes to the Electron main process.\n */\nexport function makeRendererTransport(options: BaseTransportOptions): Transport {\n  const ipc = getIPC();\n\n  return createTransport(options, async (request: TransportRequest): Promise<TransportMakeRequestResponse> => {\n    ipc.sendEnvelope(request.body);\n    // Since the main process handles sending of envelopes and rate limiting, we always return 200 OK to the renderers.\n    return { statusCode: 200 };\n  });\n}\n"]}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const domain = require('domain');

function getActiveDomain() {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
  return (domain ).active ;
}

function getCurrentHub() {
  const activeDomain = getActiveDomain();

  // If there's no active domain, just return undefined and the global hub will be used
  if (!activeDomain) {
    return undefined;
  }

  core.ensureHubOnCarrier(activeDomain);

  return core.getHubFromCarrier(activeDomain);
}

function createNewHub(parent) {
  const carrier = {};
  core.ensureHubOnCarrier(carrier, parent);
  return core.getHubFromCarrier(carrier);
}

function runWithAsyncContext(callback, options) {
  const activeDomain = getActiveDomain();

  if (activeDomain && _optionalChain([options, 'optionalAccess', _ => _.reuseExisting])) {
    // We're already in a domain, so we don't need to create a new one, just call the callback with the current hub
    return callback();
  }

  const local = domain.create() ;

  const parentHub = activeDomain ? core.getHubFromCarrier(activeDomain) : undefined;
  const newHub = createNewHub(parentHub);
  core.setHubOnCarrier(local, newHub);

  return local.bind(() => {
    return callback();
  })();
}

/**
 * Sets the async context strategy to use Node.js domains.
 */
function setDomainAsyncContextStrategy() {
  core.setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });
}

exports.setDomainAsyncContextStrategy = setDomainAsyncContextStrategy;
//# sourceMappingURL=domain.js.map
{"version":3,"file":"domain.js","sources":["../../../src/async/domain.ts"],"sourcesContent":["import type { Carrier, Hub, RunWithAsyncContextOptions } from '@sentry/core';\nimport { ensureHubOnCarrier, getHubFromCarrier, setAsyncContextStrategy, setHubOnCarrier } from '@sentry/core';\nimport * as domain from 'domain';\n\nfunction getActiveDomain<T>(): T | undefined {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n  return (domain as any).active as T | undefined;\n}\n\nfunction getCurrentHub(): Hub | undefined {\n  const activeDomain = getActiveDomain<Carrier>();\n\n  // If there's no active domain, just return undefined and the global hub will be used\n  if (!activeDomain) {\n    return undefined;\n  }\n\n  ensureHubOnCarrier(activeDomain);\n\n  return getHubFromCarrier(activeDomain);\n}\n\nfunction createNewHub(parent: Hub | undefined): Hub {\n  const carrier: Carrier = {};\n  ensureHubOnCarrier(carrier, parent);\n  return getHubFromCarrier(carrier);\n}\n\nfunction runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T {\n  const activeDomain = getActiveDomain<domain.Domain & Carrier>();\n\n  if (activeDomain && options?.reuseExisting) {\n    // We're already in a domain, so we don't need to create a new one, just call the callback with the current hub\n    return callback();\n  }\n\n  const local = domain.create() as domain.Domain & Carrier;\n\n  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : undefined;\n  const newHub = createNewHub(parentHub);\n  setHubOnCarrier(local, newHub);\n\n  return local.bind(() => {\n    return callback();\n  })();\n}\n\n/**\n * Sets the async context strategy to use Node.js domains.\n */\nexport function setDomainAsyncContextStrategy(): void {\n  setAsyncCont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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const async_hooks = require('async_hooks');

/**
 * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.
 */
function setHooksAsyncContextStrategy() {
  const asyncStorage = new (async_hooks ).AsyncLocalStorage();

  function getCurrentHub() {
    return asyncStorage.getStore();
  }

  function createNewHub(parent) {
    const carrier = {};
    core.ensureHubOnCarrier(carrier, parent);
    return core.getHubFromCarrier(carrier);
  }

  function runWithAsyncContext(callback, options) {
    const existingHub = getCurrentHub();

    if (existingHub && _optionalChain([options, 'optionalAccess', _ => _.reuseExisting])) {
      // We're already in an async context, so we don't need to create a new one
      // just call the callback with the current hub
      return callback();
    }

    const newHub = createNewHub(existingHub);

    return asyncStorage.run(newHub, () => {
      return callback();
    });
  }

  core.setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });
}

exports.setHooksAsyncContextStrategy = setHooksAsyncContextStrategy;
//# sourceMappingURL=hooks.js.map
{"version":3,"file":"hooks.js","sources":["../../../src/async/hooks.ts"],"sourcesContent":["import type { Carrier, Hub, RunWithAsyncContextOptions } from '@sentry/core';\nimport { ensureHubOnCarrier, getHubFromCarrier, setAsyncContextStrategy } from '@sentry/core';\nimport * as async_hooks from 'async_hooks';\n\ninterface AsyncLocalStorage<T> {\n  getStore(): T | undefined;\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;\n}\n\ntype AsyncLocalStorageConstructor = { new <T>(): AsyncLocalStorage<T> };\n// AsyncLocalStorage only exists in async_hook after Node v12.17.0 or v13.10.0\ntype NewerAsyncHooks = typeof async_hooks & { AsyncLocalStorage: AsyncLocalStorageConstructor };\n\n/**\n * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.\n */\nexport function setHooksAsyncContextStrategy(): void {\n  const asyncStorage = new (async_hooks as NewerAsyncHooks).AsyncLocalStorage<Hub>();\n\n  function getCurrentHub(): Hub | undefined {\n    return asyncStorage.getStore();\n  }\n\n  function createNewHub(parent: Hub | undefined): Hub {\n    const carrier: Carrier = {};\n    ensureHubOnCarrier(carrier, parent);\n    return getHubFromCarrier(carrier);\n  }\n\n  function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T {\n    const existingHub = getCurrentHub();\n\n    if (existingHub && options?.reuseExisting) {\n      // We're already in an async context, so we don't need to create a new one\n      // just call the callback with the current hub\n      return callback();\n    }\n\n    const newHub = createNewHub(existingHub);\n\n    return asyncStorage.run(newHub, () => {\n      return callback();\n    });\n  }\n\n  setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });\n}\n"],"names":["ensureHubOnCarrier","getHubFromCarrier","setAsyncContextStrategy"],"mappings":";;;;;;;;;AAcA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CA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AAA,CAAA;AACA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const nodeVersion = require('../nodeVersion.js');
const domain = require('./domain.js');
const hooks = require('./hooks.js');

/**
 * Sets the correct async context strategy for Node.js
 *
 * Node.js >= 14 uses AsyncLocalStorage
 * Node.js < 14 uses domains
 */
function setNodeAsyncContextStrategy() {
  if (nodeVersion.NODE_VERSION.major && nodeVersion.NODE_VERSION.major >= 14) {
    hooks.setHooksAsyncContextStrategy();
  } else {
    domain.setDomainAsyncContextStrategy();
  }
}

exports.setNodeAsyncContextStrategy = setNodeAsyncContextStrategy;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/async/index.ts"],"sourcesContent":["import { NODE_VERSION } from '../nodeVersion';\nimport { setDomainAsyncContextStrategy } from './domain';\nimport { setHooksAsyncContextStrategy } from './hooks';\n\n/**\n * Sets the correct async context strategy for Node.js\n *\n * Node.js >= 14 uses AsyncLocalStorage\n * Node.js < 14 uses domains\n */\nexport function setNodeAsyncContextStrategy(): void {\n  if (NODE_VERSION.major && NODE_VERSION.major >= 14) {\n    setHooksAsyncContextStrategy();\n  } else {\n    setDomainAsyncContextStrategy();\n  }\n}\n"],"names":["NODE_VERSION","setHooksAsyncContextStrategy","setDomainAsyncContextStrategy"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,2BAAA,GAAA;AACA,EAAA,IAAAA,wBAAA,CAAA,KAAA,IAAAA,wBAAA,CAAA,KAAA,IAAA,EAAA,EAAA;AACA,IAAAC,kCAAA,EAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAAC,oCAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const os = require('os');
const util = require('util');
const eventbuilder = require('./eventbuilder.js');

/**
 * The Sentry Node SDK Client.
 *
 * @see NodeClientOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
class NodeClient extends core.BaseClient {

  /**
   * Creates a new Node SDK instance.
   * @param options Configuration options for this SDK.
   */
   constructor(options) {
    options._metadata = options._metadata || {};
    options._metadata.sdk = options._metadata.sdk || {
      name: 'sentry.javascript.node',
      packages: [
        {
          name: 'npm:@sentry/node',
          version: core.SDK_VERSION,
        },
      ],
      version: core.SDK_VERSION,
    };

    // Until node supports global TextEncoder in all versions we support, we are forced to pass it from util
    options.transportOptions = {
      textEncoder: new util.TextEncoder(),
      ...options.transportOptions,
    };

    // The Node client always supports tracing
    core.addTracingExtensions();

    super(options);
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   captureException(exception, hint, scope) {
    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only
    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload
    // sent to the Server only when the `requestHandler` middleware is used
    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
      const requestSession = scope.getRequestSession();

      // Necessary checks to ensure this is code block is executed only within a request
      // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage
      if (requestSession && requestSession.status === 'ok') {
        requestSession.status = 'errored';
      }
    }

    return super.captureException(exception, hint, scope);
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint, scope) {
    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only
    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload
    // sent to the Server only when the `requestHandler` middleware is used
    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
      const eventType = event.type || 'exception';
      const isException =
        eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0;

      // If the event is of type Exception, then a request session should be captured
      if (isException) {
        const requestSession = scope.getRequestSession();

        // Ensure that this is happening within the bounds of a request, and make sure not to override
        // Session Status if Errored / Crashed
        if (requestSession && requestSession.status === 'ok') {
          requestSession.status = 'errored';
        }
      }
    }

    return super.captureEvent(event, hint, scope);
  }

  /**
   *
   * @inheritdoc
   */
   close(timeout) {
    _optionalChain([this, 'access', _ => _._sessionFlusher, 'optionalAccess', _2 => _2.close, 'call', _3 => _3()]);
    return super.close(timeout);
  }

  /** Method that initialises an instance of SessionFlusher on Client */
   initSessionFlusher() {
    const { release, environment } = this._options;
    if (!release) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!');
    } else {
      this._sessionFlusher = new core.SessionFlusher(this, {
        release,
        environment,
      });
    }
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   eventFromException(exception, hint) {
    return utils.resolvedSyncPromise(eventbuilder.eventFromUnknownInput(this._options.stackParser, exception, hint));
  }

  /**
   * @inheritDoc
   */
   eventFromMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level = 'info',
    hint,
  ) {
    return utils.resolvedSyncPromise(
      eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace),
    );
  }

  /**
   * @inheritDoc
   */
   _prepareEvent(event, hint, scope) {
    event.platform = event.platform || 'node';
    event.contexts = {
      ...event.contexts,
      runtime: _optionalChain([event, 'access', _4 => _4.contexts, 'optionalAccess', _5 => _5.runtime]) || {
        name: 'node',
        version: global.process.version,
      },
    };
    event.server_name =
      event.server_name || this.getOptions().serverName || global.process.env.SENTRY_NAME || os.hostname();
    return super._prepareEvent(event, hint, scope);
  }

  /**
   * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment
   * appropriate session aggregates bucket
   */
   _captureRequestSession() {
    if (!this._sessionFlusher) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Discarded request mode session because autoSessionTracking option was disabled');
    } else {
      this._sessionFlusher.incrementSessionStatusCount();
    }
  }
}

exports.NodeClient = NodeClient;
//# sourceMappingURL=client.js.map
{"version":3,"file":"client.js","sources":["../../src/client.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addTracingExtensions, BaseClient, SDK_VERSION, SessionFlusher } from '@sentry/core';\nimport type { Event, EventHint, Severity, SeverityLevel } from '@sentry/types';\nimport { logger, resolvedSyncPromise } from '@sentry/utils';\nimport * as os from 'os';\nimport { TextEncoder } from 'util';\n\nimport { eventFromMessage, eventFromUnknownInput } from './eventbuilder';\nimport type { NodeClientOptions } from './types';\n\n/**\n * The Sentry Node SDK Client.\n *\n * @see NodeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class NodeClient extends BaseClient<NodeClientOptions> {\n  protected _sessionFlusher: SessionFlusher | undefined;\n\n  /**\n   * Creates a new Node SDK instance.\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: NodeClientOptions) {\n    options._metadata = options._metadata || {};\n    options._metadata.sdk = options._metadata.sdk || {\n      name: 'sentry.javascript.node',\n      packages: [\n        {\n          name: 'npm:@sentry/node',\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    // Until node supports global TextEncoder in all versions we support, we are forced to pass it from util\n    options.transportOptions = {\n      textEncoder: new TextEncoder(),\n      ...options.transportOptions,\n    };\n\n    // The Node client always supports tracing\n    addTracingExtensions();\n\n    super(options);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n    // sent to the Server only when the `requestHandler` middleware is used\n    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {\n      const requestSession = scope.getRequestSession();\n\n      // Necessary checks to ensure this is code block is executed only within a request\n      // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage\n      if (requestSession && requestSession.status === 'ok') {\n        requestSession.status = 'errored';\n      }\n    }\n\n    return super.captureException(exception, hint, scope);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n    // sent to the Server only when the `requestHandler` middleware is used\n    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {\n      const eventType = event.type || 'exception';\n      const isException =\n        eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0;\n\n      // If the event is of type Exception, then a request session should be captured\n      if (isException) {\n        const requestSession = scope.getRequestSession();\n\n        // Ensure that this is happening within the bounds of a request, and make sure not to override\n        // Session Status if Errored / Crashed\n        if (requestSession && requestSession.status === 'ok') {\n          requestSession.status = 'errored';\n        }\n      }\n    }\n\n    return super.captureEvent(event, hint, scope);\n  }\n\n  /**\n   *\n   * @inheritdoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    this._sessionFlusher?.close();\n    return super.close(timeout);\n  }\n\n  /** Method that initialises an instance of SessionFlusher on Client */\n  public initSessionFlusher(): void {\n    const { release, environment } = this._options;\n    if (!release) {\n      __DEBUG_BUILD__ && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!');\n    } else {\n      this._sessionFlusher = new SessionFlusher(this, {\n        release,\n        environment,\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public eventFromException(exception: any, hint?: EventHint): PromiseLike<Event> {\n    return resolvedSyncPromise(eventFromUnknownInput(this._options.stackParser, exception, hint));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return resolvedSyncPromise(\n      eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace),\n    );\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    event.platform = event.platform || 'node';\n    event.contexts = {\n      ...event.contexts,\n      runtime: event.contexts?.runtime || {\n        name: 'node',\n        version: global.process.version,\n      },\n    };\n    event.server_name =\n      event.server_name || this.getOptions().serverName || global.process.env.SENTRY_NAME || os.hostname();\n    return super._prepareEvent(event, hint, scope);\n  }\n\n  /**\n   * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment\n   * appropriate session aggregates bucket\n   */\n  protected _captureRequestSession(): void {\n    if (!this._sessionFlusher) {\n      __DEBUG_BUILD__ && logger.warn('Discarded request mode session because autoSessionTracking option was disabled');\n    } else {\n      this._sessionFlusher.incrementSessionStatusCount();\n    }\n  }\n}\n"],"names":["BaseClient","SDK_VERSION","TextEncoder","addTracingExtensions","logger","SessionFlusher","resolvedSyncPromise","eventFromUnknownInput","eventFromMessage"],"mappings":";;;;;;;;;;;;AAUA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA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A,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAAJ,CAAAA,EAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,EAAA,CAAA,CAAA,CAAA,EAAA;MACA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;IACA;EACA;AACA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

/**
 * Extracts stack frames from the error.stack string
 */
function parseStackFrames(stackParser, error) {
  return stackParser(error.stack || '', 1);
}

/**
 * Extracts stack frames from the error and builds a Sentry Exception
 */
function exceptionFromError(stackParser, error) {
  const exception = {
    type: error.name || error.constructor.name,
    value: error.message,
  };

  const frames = parseStackFrames(stackParser, error);
  if (frames.length) {
    exception.stacktrace = { frames };
  }

  return exception;
}

/**
 * Builds and Event from a Exception
 * @hidden
 */
function eventFromUnknownInput(stackParser, exception, hint) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  let ex = exception;
  const providedMechanism =
    hint && hint.data && (hint.data ).mechanism;
  const mechanism = providedMechanism || {
    handled: true,
    type: 'generic',
  };

  if (!utils.isError(exception)) {
    if (utils.isPlainObject(exception)) {
      // This will allow us to group events based on top-level keys
      // which is much better than creating new group when any key/value change
      const message = `Non-Error exception captured with keys: ${utils.extractExceptionKeysForMessage(exception)}`;

      const hub = core.getCurrentHub();
      const client = hub.getClient();
      const normalizeDepth = client && client.getOptions().normalizeDepth;
      hub.configureScope(scope => {
        scope.setExtra('__serialized__', utils.normalizeToSize(exception, normalizeDepth));
      });

      ex = (hint && hint.syntheticException) || new Error(message);
      (ex ).message = message;
    } else {
      // This handles when someone does: `throw "something awesome";`
      // We use synthesized Error here so we can extract a (rough) stack trace.
      ex = (hint && hint.syntheticException) || new Error(exception );
      (ex ).message = exception ;
    }
    mechanism.synthetic = true;
  }

  const event = {
    exception: {
      values: [exceptionFromError(stackParser, ex )],
    },
  };

  utils.addExceptionTypeValue(event, undefined, undefined);
  utils.addExceptionMechanism(event, mechanism);

  return {
    ...event,
    event_id: hint && hint.event_id,
  };
}

/**
 * Builds and Event from a Message
 * @hidden
 */
function eventFromMessage(
  stackParser,
  message,
  // eslint-disable-next-line deprecation/deprecation
  level = 'info',
  hint,
  attachStacktrace,
) {
  const event = {
    event_id: hint && hint.event_id,
    level,
    message,
  };

  if (attachStacktrace && hint && hint.syntheticException) {
    const frames = parseStackFrames(stackParser, hint.syntheticException);
    if (frames.length) {
      event.exception = {
        values: [
          {
            value: message,
            stacktrace: { frames },
          },
        ],
      };
    }
  }

  return event;
}

exports.eventFromMessage = eventFromMessage;
exports.eventFromUnknownInput = eventFromUnknownInput;
exports.exceptionFromError = exceptionFromError;
exports.parseStackFrames = parseStackFrames;
//# sourceMappingURL=eventbuilder.js.map
{"version":3,"file":"eventbuilder.js","sources":["../../src/eventbuilder.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type {\n  Event,\n  EventHint,\n  Exception,\n  Mechanism,\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  StackParser,\n} from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  extractExceptionKeysForMessage,\n  isError,\n  isPlainObject,\n  normalizeToSize,\n} from '@sentry/utils';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nexport function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[] {\n  return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nexport function exceptionFromError(stackParser: StackParser, error: Error): Exception {\n  const exception: Exception = {\n    type: error.name || error.constructor.name,\n    value: error.message,\n  };\n\n  const frames = parseStackFrames(stackParser, error);\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  return exception;\n}\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromUnknownInput(stackParser: StackParser, exception: unknown, hint?: EventHint): Event {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  let ex: unknown = exception;\n  const providedMechanism: Mechanism | undefined =\n    hint && hint.data && (hint.data as { mechanism: Mechanism }).mechanism;\n  const mechanism: Mechanism = providedMechanism || {\n    handled: true,\n    type: 'generic',\n  };\n\n  if (!isError(exception)) {\n    if (isPlainObject(exception)) {\n      // This will allow us to group events based on top-level keys\n      // which is much better than creating new group when any key/value change\n      const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;\n\n      const hub = getCurrentHub();\n      const client = hub.getClient();\n      const normalizeDepth = client && client.getOptions().normalizeDepth;\n      hub.configureScope(scope => {\n        scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));\n      });\n\n      ex = (hint && hint.syntheticException) || new Error(message);\n      (ex as Error).message = message;\n    } else {\n      // This handles when someone does: `throw \"something awesome\";`\n      // We use synthesized Error here so we can extract a (rough) stack trace.\n      ex = (hint && hint.syntheticException) || new Error(exception as string);\n      (ex as Error).message = exception as string;\n    }\n    mechanism.synthetic = true;\n  }\n\n  const event = {\n    exception: {\n      values: [exceptionFromError(stackParser, ex as Error)],\n    },\n  };\n\n  addExceptionTypeValue(event, undefined, undefined);\n  addExceptionMechanism(event, mechanism);\n\n  return {\n    ...event,\n    event_id: hint && hint.event_id,\n  };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    event_id: hint && hint.event_id,\n    level,\n    message,\n  };\n\n  if (attachStacktrace && hint && hint.syntheticException) {\n    const frames = parseStackFrames(stackParser, hint.syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [\n          {\n            value: message,\n            stacktrace: { frames },\n          },\n        ],\n      };\n    }\n  }\n\n  return event;\n}\n"],"names":["isError","isPlainObject","extractExceptionKeysForMessage","getCurrentHub","normalizeToSize","addExceptionTypeValue","addExceptionMechanism"],"mappings":";;;;;AAoBA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA,EAAA,OAAA,WAAA,CAAA,KAAA,CAAA,KAAA,IAAA,EAAA,EAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA;AACA,IAAA,IAAA,EAAA,KAAA,CAAA,IAAA,IAAA,KAAA,CAAA,WAAA,CAAA,IAAA;AACA,IAAA,KAAA,EAAA,KAAA,CAAA,OAAA;AACA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AA,CAAA,MAAA,EAAA;AACA,MAAA,KAAA,CAAA,SAAA,GAAA;AACA,QAAA,MAAA,EAAA;AACA,UAAA;AACA,YAAA,KAAA,EAAA,OAAA;AACA,YAAA,UAAA,EAAA,EAAA,MAAA,EAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA;;;;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const requestdata = require('./requestdata.js');
const sdk = require('./sdk.js');
const requestDataDeprecated = require('./requestDataDeprecated.js');

/* eslint-disable @typescript-eslint/no-explicit-any */

/**
 * Express-compatible tracing handler.
 * @see Exposed as `Handlers.tracingHandler`
 */
function tracingHandler()

 {
  return function sentryTracingMiddleware(
    req,
    res,
    next,
  ) {
    const hub = core.getCurrentHub();
    const options = _optionalChain([hub, 'access', _ => _.getClient, 'call', _2 => _2(), 'optionalAccess', _3 => _3.getOptions, 'call', _4 => _4()]);

    if (
      !options ||
      options.instrumenter !== 'sentry' ||
      _optionalChain([req, 'access', _5 => _5.method, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]) === 'OPTIONS' ||
      _optionalChain([req, 'access', _8 => _8.method, 'optionalAccess', _9 => _9.toUpperCase, 'call', _10 => _10()]) === 'HEAD'
    ) {
      return next();
    }

    if (!core.hasTracingEnabled(options)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        utils.logger.warn(
          'Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting ' +
            'either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options.',
        );
      return next();
    }

    // If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision)
    const traceparentData =
      req.headers && utils.isString(req.headers['sentry-trace']) && utils.extractTraceparentData(req.headers['sentry-trace']);
    const incomingBaggageHeaders = _optionalChain([req, 'access', _11 => _11.headers, 'optionalAccess', _12 => _12.baggage]);
    const dynamicSamplingContext = utils.baggageHeaderToDynamicSamplingContext(incomingBaggageHeaders);

    const [name, source] = utils.extractPathForTransaction(req, { path: true, method: true });
    const transaction = core.startTransaction(
      {
        name,
        op: 'http.server',
        ...traceparentData,
        metadata: {
          dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,
          // The request should already have been stored in `scope.sdkProcessingMetadata` (which will become
          // `event.sdkProcessingMetadata` the same way the metadata here will) by `sentryRequestMiddleware`, but on the
          // off chance someone is using `sentryTracingMiddleware` without `sentryRequestMiddleware`, it doesn't hurt to
          // be sure
          request: req,
          source,
        },
      },
      // extra context passed to the tracesSampler
      { request: requestdata.extractRequestData(req) },
    );

    // We put the transaction on the scope so users can attach children to it
    hub.configureScope(scope => {
      scope.setSpan(transaction);
    });

    // We also set __sentry_transaction on the response so people can grab the transaction there to add
    // spans to it later.
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    (res ).__sentry_transaction = transaction;

    res.once('finish', () => {
      // Push `transaction.finish` to the next event loop so open spans have a chance to finish before the transaction
      // closes
      setImmediate(() => {
        utils.addRequestDataToTransaction(transaction, req);
        transaction.setHttpStatus(res.statusCode);
        transaction.finish();
      });
    });

    next();
  };
}

/**
 * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the
 * `AddRequestDataToEventOptions` interface.
 *
 * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`.
 */
function convertReqHandlerOptsToAddReqDataOpts(
  reqHandlerOptions = {},
) {
  let addRequestDataOptions;

  if ('include' in reqHandlerOptions) {
    addRequestDataOptions = { include: reqHandlerOptions.include };
  } else {
    // eslint-disable-next-line deprecation/deprecation
    const { ip, request, transaction, user } = reqHandlerOptions ;

    if (ip || request || transaction || user) {
      addRequestDataOptions = { include: utils.dropUndefinedKeys({ ip, request, transaction, user }) };
    }
  }

  return addRequestDataOptions;
}

/**
 * Express compatible request handler.
 * @see Exposed as `Handlers.requestHandler`
 */
function requestHandler(
  options,
) {
  // TODO (v8): Get rid of this
  const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts(options);

  const currentHub = core.getCurrentHub();
  const client = currentHub.getClient();
  // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the
  // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode
  if (client && sdk.isAutoSessionTrackingEnabled(client)) {
    client.initSessionFlusher();

    // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode
    const scope = currentHub.getScope();
    if (scope && scope.getSession()) {
      scope.setSession();
    }
  }

  return function sentryRequestMiddleware(
    req,
    res,
    next,
  ) {
    if (options && options.flushTimeout && options.flushTimeout > 0) {
      // eslint-disable-next-line @typescript-eslint/unbound-method
      const _end = res.end;
      res.end = function (chunk, encoding, cb) {
        void sdk.flush(options.flushTimeout)
          .then(() => {
            _end.call(this, chunk, encoding, cb);
          })
          .then(null, e => {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(e);
            _end.call(this, chunk, encoding, cb);
          });
      };
    }
    core.runWithAsyncContext(() => {
      const currentHub = core.getCurrentHub();
      currentHub.configureScope(scope => {
        scope.setSDKProcessingMetadata({
          request: req,
          // TODO (v8): Stop passing this
          requestDataOptionsFromExpressHandler: requestDataOptions,
        });

        const client = currentHub.getClient();
        if (sdk.isAutoSessionTrackingEnabled(client)) {
          const scope = currentHub.getScope();
          if (scope) {
            // Set `status` of `RequestSession` to Ok, at the beginning of the request
            scope.setRequestSession({ status: 'ok' });
          }
        }
      });

      res.once('finish', () => {
        const client = currentHub.getClient();
        if (sdk.isAutoSessionTrackingEnabled(client)) {
          setImmediate(() => {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            if (client && (client )._captureRequestSession) {
              // Calling _captureRequestSession to capture request session at the end of the request by incrementing
              // the correct SessionAggregates bucket i.e. crashed, errored or exited
              // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
              (client )._captureRequestSession();
            }
          });
        }
      });
      next();
    });
  };
}

/** JSDoc */

/** JSDoc */
function getStatusCodeFromResponse(error) {
  const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);
  return statusCode ? parseInt(statusCode , 10) : 500;
}

/** Returns true if response code is internal server error */
function defaultShouldHandleError(error) {
  const status = getStatusCodeFromResponse(error);
  return status >= 500;
}

/**
 * Express compatible error handler.
 * @see Exposed as `Handlers.errorHandler`
 */
function errorHandler(options

)

 {
  return function sentryErrorMiddleware(
    error,
    _req,
    res,
    next,
  ) {
    const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError;

    if (shouldHandleError(error)) {
      core.withScope(_scope => {
        // The request should already have been stored in `scope.sdkProcessingMetadata` by `sentryRequestMiddleware`,
        // but on the off chance someone is using `sentryErrorMiddleware` without `sentryRequestMiddleware`, it doesn't
        // hurt to be sure
        _scope.setSDKProcessingMetadata({ request: _req });

        // For some reason we need to set the transaction on the scope again
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        const transaction = (res ).__sentry_transaction ;
        if (transaction && _scope.getSpan() === undefined) {
          _scope.setSpan(transaction);
        }

        const client = core.getCurrentHub().getClient();
        if (client && sdk.isAutoSessionTrackingEnabled(client)) {
          // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the
          // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only
          // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be
          // running in SessionAggregates mode
          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
          const isSessionAggregatesMode = (client )._sessionFlusher !== undefined;
          if (isSessionAggregatesMode) {
            const requestSession = _scope.getRequestSession();
            // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a
            // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within
            // the bounds of a request, and if so the status is updated
            if (requestSession && requestSession.status !== undefined) {
              requestSession.status = 'crashed';
            }
          }
        }

        const eventId = core.captureException(error);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        (res ).sentry = eventId;
        next(error);
      });

      return;
    }

    next(error);
  };
}

/**
 * Sentry tRPC middleware that names the handling transaction after the called procedure.
 *
 * Use the Sentry tRPC middleware in combination with the Sentry server integration,
 * e.g. Express Request Handlers or Next.js SDK.
 */
function trpcMiddleware(options = {}) {
  return function ({ path, type, next, rawInput }) {
    const hub = core.getCurrentHub();
    const clientOptions = _optionalChain([hub, 'access', _13 => _13.getClient, 'call', _14 => _14(), 'optionalAccess', _15 => _15.getOptions, 'call', _16 => _16()]);
    const sentryTransaction = _optionalChain([hub, 'access', _17 => _17.getScope, 'call', _18 => _18(), 'optionalAccess', _19 => _19.getTransaction, 'call', _20 => _20()]);

    if (sentryTransaction) {
      sentryTransaction.setName(`trcp/${path}`, 'route');
      sentryTransaction.op = 'rpc.server';

      const trpcContext = {
        procedure_type: type,
      };

      if (options.attachRpcInput !== undefined ? options.attachRpcInput : _optionalChain([clientOptions, 'optionalAccess', _21 => _21.sendDefaultPii])) {
        trpcContext.input = utils.normalize(rawInput);
      }

      sentryTransaction.setContext('trpc', trpcContext);
    }

    return next();
  };
}

exports.extractRequestData = requestDataDeprecated.extractRequestData;
exports.parseRequest = requestDataDeprecated.parseRequest;
exports.errorHandler = errorHandler;
exports.requestHandler = requestHandler;
exports.tracingHandler = tracingHandler;
exports.trpcMiddleware = trpcMiddleware;
//# sourceMappingURL=handlers.js.map
{"version":3,"file":"handlers.js","sources":["../../src/handlers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n  captureException,\n  getCurrentHub,\n  hasTracingEnabled,\n  runWithAsyncContext,\n  startTransaction,\n  withScope,\n} from '@sentry/core';\nimport type { Span } from '@sentry/types';\nimport type { AddRequestDataToEventOptions } from '@sentry/utils';\nimport {\n  addRequestDataToTransaction,\n  baggageHeaderToDynamicSamplingContext,\n  dropUndefinedKeys,\n  extractPathForTransaction,\n  extractTraceparentData,\n  isString,\n  logger,\n  normalize,\n} from '@sentry/utils';\nimport type * as http from 'http';\n\nimport type { NodeClient } from './client';\nimport { extractRequestData } from './requestdata';\n// TODO (v8 / XXX) Remove this import\nimport type { ParseRequestOptions } from './requestDataDeprecated';\nimport { flush, isAutoSessionTrackingEnabled } from './sdk';\n\n/**\n * Express-compatible tracing handler.\n * @see Exposed as `Handlers.tracingHandler`\n */\nexport function tracingHandler(): (\n  req: http.IncomingMessage,\n  res: http.ServerResponse,\n  next: (error?: any) => void,\n) => void {\n  return function sentryTracingMiddleware(\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error?: any) => void,\n  ): void {\n    const hub = getCurrentHub();\n    const options = hub.getClient()?.getOptions();\n\n    if (\n      !options ||\n      options.instrumenter !== 'sentry' ||\n      req.method?.toUpperCase() === 'OPTIONS' ||\n      req.method?.toUpperCase() === 'HEAD'\n    ) {\n      return next();\n    }\n\n    if (!hasTracingEnabled(options)) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          'Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting ' +\n            'either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options.',\n        );\n      return next();\n    }\n\n    // If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision)\n    const traceparentData =\n      req.headers && isString(req.headers['sentry-trace']) && extractTraceparentData(req.headers['sentry-trace']);\n    const incomingBaggageHeaders = req.headers?.baggage;\n    const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(incomingBaggageHeaders);\n\n    const [name, source] = extractPathForTransaction(req, { path: true, method: true });\n    const transaction = startTransaction(\n      {\n        name,\n        op: 'http.server',\n        ...traceparentData,\n        metadata: {\n          dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n          // The request should already have been stored in `scope.sdkProcessingMetadata` (which will become\n          // `event.sdkProcessingMetadata` the same way the metadata here will) by `sentryRequestMiddleware`, but on the\n          // off chance someone is using `sentryTracingMiddleware` without `sentryRequestMiddleware`, it doesn't hurt to\n          // be sure\n          request: req,\n          source,\n        },\n      },\n      // extra context passed to the tracesSampler\n      { request: extractRequestData(req) },\n    );\n\n    // We put the transaction on the scope so users can attach children to it\n    hub.configureScope(scope => {\n      scope.setSpan(transaction);\n    });\n\n    // We also set __sentry_transaction on the response so people can grab the transaction there to add\n    // spans to it later.\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    (res as any).__sentry_transaction = transaction;\n\n    res.once('finish', () => {\n      // Push `transaction.finish` to the next event loop so open spans have a chance to finish before the transaction\n      // closes\n      setImmediate(() => {\n        addRequestDataToTransaction(transaction, req);\n        transaction.setHttpStatus(res.statusCode);\n        transaction.finish();\n      });\n    });\n\n    next();\n  };\n}\n\nexport type RequestHandlerOptions =\n  // TODO (v8 / XXX) Remove ParseRequestOptions type and eslint override\n  // eslint-disable-next-line deprecation/deprecation\n  | (ParseRequestOptions | AddRequestDataToEventOptions) & {\n      flushTimeout?: number;\n    };\n\n/**\n * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the\n * `AddRequestDataToEventOptions` interface.\n *\n * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`.\n */\nfunction convertReqHandlerOptsToAddReqDataOpts(\n  reqHandlerOptions: RequestHandlerOptions = {},\n): AddRequestDataToEventOptions | undefined {\n  let addRequestDataOptions: AddRequestDataToEventOptions | undefined;\n\n  if ('include' in reqHandlerOptions) {\n    addRequestDataOptions = { include: reqHandlerOptions.include };\n  } else {\n    // eslint-disable-next-line deprecation/deprecation\n    const { ip, request, transaction, user } = reqHandlerOptions as ParseRequestOptions;\n\n    if (ip || request || transaction || user) {\n      addRequestDataOptions = { include: dropUndefinedKeys({ ip, request, transaction, user }) };\n    }\n  }\n\n  return addRequestDataOptions;\n}\n\n/**\n * Express compatible request handler.\n * @see Exposed as `Handlers.requestHandler`\n */\nexport function requestHandler(\n  options?: RequestHandlerOptions,\n): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void {\n  // TODO (v8): Get rid of this\n  const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts(options);\n\n  const currentHub = getCurrentHub();\n  const client = currentHub.getClient<NodeClient>();\n  // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the\n  // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode\n  if (client && isAutoSessionTrackingEnabled(client)) {\n    client.initSessionFlusher();\n\n    // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode\n    const scope = currentHub.getScope();\n    if (scope && scope.getSession()) {\n      scope.setSession();\n    }\n  }\n\n  return function sentryRequestMiddleware(\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error?: any) => void,\n  ): void {\n    if (options && options.flushTimeout && options.flushTimeout > 0) {\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      const _end = res.end;\n      res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): void {\n        void flush(options.flushTimeout)\n          .then(() => {\n            _end.call(this, chunk, encoding, cb);\n          })\n          .then(null, e => {\n            __DEBUG_BUILD__ && logger.error(e);\n            _end.call(this, chunk, encoding, cb);\n          });\n      };\n    }\n    runWithAsyncContext(() => {\n      const currentHub = getCurrentHub();\n      currentHub.configureScope(scope => {\n        scope.setSDKProcessingMetadata({\n          request: req,\n          // TODO (v8): Stop passing this\n          requestDataOptionsFromExpressHandler: requestDataOptions,\n        });\n\n        const client = currentHub.getClient<NodeClient>();\n        if (isAutoSessionTrackingEnabled(client)) {\n          const scope = currentHub.getScope();\n          if (scope) {\n            // Set `status` of `RequestSession` to Ok, at the beginning of the request\n            scope.setRequestSession({ status: 'ok' });\n          }\n        }\n      });\n\n      res.once('finish', () => {\n        const client = currentHub.getClient<NodeClient>();\n        if (isAutoSessionTrackingEnabled(client)) {\n          setImmediate(() => {\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n            if (client && (client as any)._captureRequestSession) {\n              // Calling _captureRequestSession to capture request session at the end of the request by incrementing\n              // the correct SessionAggregates bucket i.e. crashed, errored or exited\n              // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n              (client as any)._captureRequestSession();\n            }\n          });\n        }\n      });\n      next();\n    });\n  };\n}\n\n/** JSDoc */\ninterface MiddlewareError extends Error {\n  status?: number | string;\n  statusCode?: number | string;\n  status_code?: number | string;\n  output?: {\n    statusCode?: number | string;\n  };\n}\n\n/** JSDoc */\nfunction getStatusCodeFromResponse(error: MiddlewareError): number {\n  const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);\n  return statusCode ? parseInt(statusCode as string, 10) : 500;\n}\n\n/** Returns true if response code is internal server error */\nfunction defaultShouldHandleError(error: MiddlewareError): boolean {\n  const status = getStatusCodeFromResponse(error);\n  return status >= 500;\n}\n\n/**\n * Express compatible error handler.\n * @see Exposed as `Handlers.errorHandler`\n */\nexport function errorHandler(options?: {\n  /**\n   * Callback method deciding whether error should be captured and sent to Sentry\n   * @param error Captured middleware error\n   */\n  shouldHandleError?(this: void, error: MiddlewareError): boolean;\n}): (\n  error: MiddlewareError,\n  req: http.IncomingMessage,\n  res: http.ServerResponse,\n  next: (error: MiddlewareError) => void,\n) => void {\n  return function sentryErrorMiddleware(\n    error: MiddlewareError,\n    _req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error: MiddlewareError) => void,\n  ): void {\n    const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError;\n\n    if (shouldHandleError(error)) {\n      withScope(_scope => {\n        // The request should already have been stored in `scope.sdkProcessingMetadata` by `sentryRequestMiddleware`,\n        // but on the off chance someone is using `sentryErrorMiddleware` without `sentryRequestMiddleware`, it doesn't\n        // hurt to be sure\n        _scope.setSDKProcessingMetadata({ request: _req });\n\n        // For some reason we need to set the transaction on the scope again\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        const transaction = (res as any).__sentry_transaction as Span;\n        if (transaction && _scope.getSpan() === undefined) {\n          _scope.setSpan(transaction);\n        }\n\n        const client = getCurrentHub().getClient<NodeClient>();\n        if (client && isAutoSessionTrackingEnabled(client)) {\n          // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the\n          // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only\n          // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be\n          // running in SessionAggregates mode\n          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n          const isSessionAggregatesMode = (client as any)._sessionFlusher !== undefined;\n          if (isSessionAggregatesMode) {\n            const requestSession = _scope.getRequestSession();\n            // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a\n            // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within\n            // the bounds of a request, and if so the status is updated\n            if (requestSession && requestSession.status !== undefined) {\n              requestSession.status = 'crashed';\n            }\n          }\n        }\n\n        const eventId = captureException(error);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (res as any).sentry = eventId;\n        next(error);\n      });\n\n      return;\n    }\n\n    next(error);\n  };\n}\n\ninterface SentryTrpcMiddlewareOptions {\n  /** Whether to include procedure inputs in reported events. Defaults to `false`. */\n  attachRpcInput?: boolean;\n}\n\ninterface TrpcMiddlewareArguments<T> {\n  path: string;\n  type: 'query' | 'mutation' | 'subscription';\n  next: () => T;\n  rawInput: unknown;\n}\n\n/**\n * Sentry tRPC middleware that names the handling transaction after the called procedure.\n *\n * Use the Sentry tRPC middleware in combination with the Sentry server integration,\n * e.g. Express Request Handlers or Next.js SDK.\n */\nexport function trpcMiddleware(options: SentryTrpcMiddlewareOptions = {}) {\n  return function <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>): T {\n    const hub = getCurrentHub();\n    const clientOptions = hub.getClient()?.getOptions();\n    const sentryTransaction = hub.getScope()?.getTransaction();\n\n    if (sentryTransaction) {\n      sentryTransaction.setName(`trcp/${path}`, 'route');\n      sentryTransaction.op = 'rpc.server';\n\n      const trpcContext: Record<string, unknown> = {\n        procedure_type: type,\n      };\n\n      if (options.attachRpcInput !== undefined ? options.attachRpcInput : clientOptions?.sendDefaultPii) {\n        trpcContext.input = normalize(rawInput);\n      }\n\n      sentryTransaction.setContext('trpc', trpcContext);\n    }\n\n    return next();\n  };\n}\n\n// TODO (v8 / #5257): Remove this\n// eslint-disable-next-line deprecation/deprecation\nexport type { ParseRequestOptions, ExpressRequest } from './requestDataDeprecated';\n// eslint-disable-next-line deprecation/deprecation\nexport { parseRequest, extractRequestData } from './requestDataDeprecated';\n"],"names":["getCurrentHub","hasTracingEnabled","logger","isString","extractTraceparentData","baggageHeaderToDynamicSamplingContext","extractPathForTransaction","startTransaction","extractRequestData","addRequestDataToTransaction","dropUndefinedKeys","isAutoSessionTrackingEnabled","flush","runWithAsyncContext","withScope","captureException","normalize"],"mappings":";;;;;;;;;;;;AAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;;AA6BA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAAgB,eAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA;;IAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const index = require('./tracing/index.js');
const client = require('./client.js');
const http = require('./transports/http.js');
const sdk = require('./sdk.js');
const requestdata = require('./requestdata.js');
const utils = require('./utils.js');
const handlers = require('./handlers.js');
const index$1 = require('./integrations/index.js');
const integrations = require('./tracing/integrations.js');

const INTEGRATIONS = {
  ...core.Integrations,
  ...index$1,
  ...integrations,
};

exports.Hub = core.Hub;
exports.SDK_VERSION = core.SDK_VERSION;
exports.Scope = core.Scope;
exports.addBreadcrumb = core.addBreadcrumb;
exports.addGlobalEventProcessor = core.addGlobalEventProcessor;
exports.captureEvent = core.captureEvent;
exports.captureException = core.captureException;
exports.captureMessage = core.captureMessage;
exports.configureScope = core.configureScope;
exports.createTransport = core.createTransport;
exports.extractTraceparentData = core.extractTraceparentData;
exports.getActiveTransaction = core.getActiveTransaction;
exports.getCurrentHub = core.getCurrentHub;
exports.getHubFromCarrier = core.getHubFromCarrier;
exports.makeMain = core.makeMain;
exports.runWithAsyncContext = core.runWithAsyncContext;
exports.setContext = core.setContext;
exports.setExtra = core.setExtra;
exports.setExtras = core.setExtras;
exports.setTag = core.setTag;
exports.setTags = core.setTags;
exports.setUser = core.setUser;
exports.spanStatusfromHttpCode = core.spanStatusfromHttpCode;
exports.startTransaction = core.startTransaction;
exports.trace = core.trace;
exports.withScope = core.withScope;
exports.autoDiscoverNodePerformanceMonitoringIntegrations = index.autoDiscoverNodePerformanceMonitoringIntegrations;
exports.NodeClient = client.NodeClient;
exports.makeNodeTransport = http.makeNodeTransport;
exports.close = sdk.close;
exports.defaultIntegrations = sdk.defaultIntegrations;
exports.defaultStackParser = sdk.defaultStackParser;
exports.flush = sdk.flush;
exports.getSentryRelease = sdk.getSentryRelease;
exports.init = sdk.init;
exports.lastEventId = sdk.lastEventId;
exports.DEFAULT_USER_INCLUDES = requestdata.DEFAULT_USER_INCLUDES;
exports.addRequestDataToEvent = requestdata.addRequestDataToEvent;
exports.extractRequestData = requestdata.extractRequestData;
exports.deepReadDirSync = utils.deepReadDirSync;
exports.Handlers = handlers;
exports.Integrations = INTEGRATIONS;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["export type {\n  Breadcrumb,\n  BreadcrumbHint,\n  PolymorphicRequest,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  Span,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  Transaction,\n  User,\n} from '@sentry/types';\nexport type { AddRequestDataToEventOptions } from '@sentry/utils';\n\nexport type { TransactionNamingScheme } from './requestdata';\nexport type { NodeOptions } from './types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  extractTraceparentData,\n  getActiveTransaction,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  runWithAsyncContext,\n  Scope,\n  startTransaction,\n  SDK_VERSION,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  spanStatusfromHttpCode,\n  trace,\n  withScope,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing';\n\nexport { NodeClient } from './client';\nexport { makeNodeTransport } from './transports';\nexport { defaultIntegrations, init, defaultStackParser, lastEventId, flush, close, getSentryRelease } from './sdk';\nexport { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from './requestdata';\nexport { deepReadDirSync } from './utils';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport * as Handlers from './handlers';\nimport * as NodeIntegrations from './integrations';\nimport * as TracingIntegrations from './tracing/integrations';\n\nconst INTEGRATIONS = {\n  ...CoreIntegrations,\n  ...NodeIntegrations,\n  ...TracingIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations, Handlers };\n"],"names":["CoreIntegrations","NodeIntegrations","TracingIntegrations"],"mappings":";;;;;;;;;;;;;AAoEA,MAAA,YAAA,GAAA;AACA,EAAA,GAAAA,iBAAA;AACA,EAAA,GAAAC,OAAA;AACA,EAAA,GAAAC,YAAA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const util = require('util');

/** Console module integration */
class Console  {constructor() { Console.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Console';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Console.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    for (const level of ['debug', 'info', 'warn', 'error', 'log']) {
      utils.fill(console, level, createConsoleWrapper(level));
    }
  }
} Console.__initStatic();

/**
 * Wrapper function that'll be used for every console level
 */
function createConsoleWrapper(level) {
  return function consoleWrapper(originalConsoleMethod) {
    const sentryLevel = utils.severityLevelFromString(level);

    /* eslint-disable prefer-rest-params */
    return function () {
      if (core.getCurrentHub().getIntegration(Console)) {
        core.getCurrentHub().addBreadcrumb(
          {
            category: 'console',
            level: sentryLevel,
            message: util.format.apply(undefined, arguments),
          },
          {
            input: [...arguments],
            level,
          },
        );
      }

      originalConsoleMethod.apply(this, arguments);
    };
    /* eslint-enable prefer-rest-params */
  };
}

exports.Console = Console;
//# sourceMappingURL=console.js.map
{"version":3,"file":"console.js","sources":["../../../src/integrations/console.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { fill, severityLevelFromString } from '@sentry/utils';\nimport * as util from 'util';\n\n/** Console module integration */\nexport class Console implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Console';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Console.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    for (const level of ['debug', 'info', 'warn', 'error', 'log']) {\n      fill(console, level, createConsoleWrapper(level));\n    }\n  }\n}\n\n/**\n * Wrapper function that'll be used for every console level\n */\nfunction createConsoleWrapper(level: string): (originalConsoleMethod: () => void) => void {\n  return function consoleWrapper(originalConsoleMethod: () => void): () => void {\n    const sentryLevel = severityLevelFromString(level);\n\n    /* eslint-disable prefer-rest-params */\n    return function (this: typeof console): void {\n      if (getCurrentHub().getIntegration(Console)) {\n        getCurrentHub().addBreadcrumb(\n          {\n            category: 'console',\n            level: sentryLevel,\n            message: util.format.apply(undefined, arguments),\n          },\n          {\n            input: [...arguments],\n            level,\n          },\n        );\n      }\n\n      originalConsoleMethod.apply(this, arguments);\n    };\n    /* eslint-enable prefer-rest-params */\n  };\n}\n"],"names":["fill","severityLevelFromString","getCurrentHub"],"mappings":";;;;;;AAKA;AACA,MAAA,OAAA,EAAA,CAAA,WAAA,GAAA,EAAA,OAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,OAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,KAAA,MAAA,KAAA,IAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,KAAA,CAAA,EAAA;AACA,MAAAA,UAAA,CAAA,OAAA,EAAA,KAAA,EAAA,oBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA,CAAA,OAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,SAAA,cAAA,CAAA,qBAAA,EAAA;AACA,IAAA,MAAA,WAAA,GAAAC,6BAAA,CAAA,KAAA,CAAA,CAAA;AACA;AACA;AACA,IAAA,OAAA,YAAA;AACA,MAAA,IAAAC,kBAAA,EAAA,CAAA,cAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAAA,kBAAA,EAAA,CAAA,aAAA;AACA,UAAA;AACA,YAAA,QAAA,EAAA,SAAA;AACA,YAAA,KAAA,EAAA,WAAA;AACA,YAAA,OAAA,EAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA,SAAA,EAAA,SAAA,CAAA;AACA,WAAA;AACA,UAAA;AACA,YAAA,KAAA,EAAA,CAAA,GAAA,SAAA,CAAA;AACA,YAAA,KAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,qBAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA,GAAA,CAAA;AACA;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const child_process = require('child_process');
const fs = require('fs');
const os = require('os');
const path = require('path');
const util = require('util');

// TODO: Required until we drop support for Node v8
const readFileAsync = util.promisify(fs.readFile);
const readDirAsync = util.promisify(fs.readdir);

/** Add node modules / packages to the event */
class Context  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Context';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Context.id;}

  /**
   * Caches context so it's only evaluated once
   */

   constructor(  _options = { app: true, os: true, device: true, culture: true }) {this._options = _options;Context.prototype.__init.call(this);
    //
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    addGlobalEventProcessor(event => this.addContext(event));
  }

  /** Processes an event and adds context */
   async addContext(event) {
    if (this._cachedContext === undefined) {
      this._cachedContext = this._getContexts();
    }

    const updatedContext = this._updateContext(await this._cachedContext);

    event.contexts = {
      ...event.contexts,
      app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) },
      os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) },
      device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) },
      culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) },
    };

    return event;
  }

  /**
   * Updates the context with dynamic values that can change
   */
   _updateContext(contexts) {
    // Only update properties if they exist
    if (_optionalChain([contexts, 'optionalAccess', _9 => _9.app, 'optionalAccess', _10 => _10.app_memory])) {
      contexts.app.app_memory = process.memoryUsage().rss;
    }

    if (_optionalChain([contexts, 'optionalAccess', _11 => _11.device, 'optionalAccess', _12 => _12.free_memory])) {
      contexts.device.free_memory = os.freemem();
    }

    return contexts;
  }

  /**
   * Gets the contexts for the current environment
   */
   async _getContexts() {
    const contexts = {};

    if (this._options.os) {
      contexts.os = await getOsContext();
    }

    if (this._options.app) {
      contexts.app = getAppContext();
    }

    if (this._options.device) {
      contexts.device = getDeviceContext(this._options.device);
    }

    if (this._options.culture) {
      const culture = getCultureContext();

      if (culture) {
        contexts.culture = culture;
      }
    }

    return contexts;
  }
}Context.__initStatic();

/**
 * Returns the operating system context.
 *
 * Based on the current platform, this uses a different strategy to provide the
 * most accurate OS information. Since this might involve spawning subprocesses
 * or accessing the file system, this should only be executed lazily and cached.
 *
 *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context
 *    has a `name`, `version`, `build` and `kernel_version` set.
 *  - On Linux, this will try to load a distribution release from `/etc` and set
 *    the `name`, `version` and `kernel_version` fields.
 *  - On all other platforms, only a `name` and `version` will be returned. Note
 *    that `version` might actually be the kernel version.
 */
async function getOsContext() {
  const platformId = os.platform();
  switch (platformId) {
    case 'darwin':
      return getDarwinInfo();
    case 'linux':
      return getLinuxInfo();
    default:
      return {
        name: PLATFORM_NAMES[platformId] || platformId,
        version: os.release(),
      };
  }
}

function getCultureContext() {
  try {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
    if (typeof (process.versions ).icu !== 'string') {
      // Node was built without ICU support
      return;
    }

    // Check that node was built with full Intl support. Its possible it was built without support for non-English
    // locales which will make resolvedOptions inaccurate
    //
    // https://nodejs.org/api/intl.html#detecting-internationalization-support
    const january = new Date(9e8);
    const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
    if (spanish.format(january) === 'enero') {
      const options = Intl.DateTimeFormat().resolvedOptions();

      return {
        locale: options.locale,
        timezone: options.timeZone,
      };
    }
  } catch (err) {
    //
  }

  return;
}

function getAppContext() {
  const app_memory = process.memoryUsage().rss;
  const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();

  return { app_start_time, app_memory };
}

/**
 * Gets device information from os
 */
function getDeviceContext(deviceOpt) {
  const device = {};

  // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).
  // Hence, we only set boot time, if we get a valid uptime value.
  // @see https://github.com/getsentry/sentry-javascript/issues/5856
  const uptime = os.uptime && os.uptime();
  if (typeof uptime === 'number') {
    device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();
  }

  device.arch = os.arch();

  if (deviceOpt === true || deviceOpt.memory) {
    device.memory_size = os.totalmem();
    device.free_memory = os.freemem();
  }

  if (deviceOpt === true || deviceOpt.cpu) {
    const cpuInfo = os.cpus();
    if (cpuInfo && cpuInfo.length) {
      const firstCpu = cpuInfo[0];

      device.processor_count = cpuInfo.length;
      device.cpu_description = firstCpu.model;
      device.processor_frequency = firstCpu.speed;
    }
  }

  return device;
}

/** Mapping of Node's platform names to actual OS names. */
const PLATFORM_NAMES = {
  aix: 'IBM AIX',
  freebsd: 'FreeBSD',
  openbsd: 'OpenBSD',
  sunos: 'SunOS',
  win32: 'Windows',
};

/** Linux version file to check for a distribution. */

/** Mapping of linux release files located in /etc to distributions. */
const LINUX_DISTROS = [
  { name: 'fedora-release', distros: ['Fedora'] },
  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },
  { name: 'redhat_version', distros: ['Red Hat Linux'] },
  { name: 'SuSE-release', distros: ['SUSE Linux'] },
  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },
  { name: 'debian_version', distros: ['Debian'] },
  { name: 'debian_release', distros: ['Debian'] },
  { name: 'arch-release', distros: ['Arch Linux'] },
  { name: 'gentoo-release', distros: ['Gentoo Linux'] },
  { name: 'novell-release', distros: ['SUSE Linux'] },
  { name: 'alpine-release', distros: ['Alpine Linux'] },
];

/** Functions to extract the OS version from Linux release files. */
const LINUX_VERSIONS

 = {
  alpine: content => content,
  arch: content => matchFirst(/distrib_release=(.*)/, content),
  centos: content => matchFirst(/release ([^ ]+)/, content),
  debian: content => content,
  fedora: content => matchFirst(/release (..)/, content),
  mint: content => matchFirst(/distrib_release=(.*)/, content),
  red: content => matchFirst(/release ([^ ]+)/, content),
  suse: content => matchFirst(/VERSION = (.*)\n/, content),
  ubuntu: content => matchFirst(/distrib_release=(.*)/, content),
};

/**
 * Executes a regular expression with one capture group.
 *
 * @param regex A regular expression to execute.
 * @param text Content to execute the RegEx on.
 * @returns The captured string if matched; otherwise undefined.
 */
function matchFirst(regex, text) {
  const match = regex.exec(text);
  return match ? match[1] : undefined;
}

/** Loads the macOS operating system context. */
async function getDarwinInfo() {
  // Default values that will be used in case no operating system information
  // can be loaded. The default version is computed via heuristics from the
  // kernel version, but the build ID is missing.
  const darwinInfo = {
    kernel_version: os.release(),
    name: 'Mac OS X',
    version: `10.${Number(os.release().split('.')[0]) - 4}`,
  };

  try {
    // We try to load the actual macOS version by executing the `sw_vers` tool.
    // This tool should be available on every standard macOS installation. In
    // case this fails, we stick with the values computed above.

    const output = await new Promise((resolve, reject) => {
      child_process.execFile('/usr/bin/sw_vers', (error, stdout) => {
        if (error) {
          reject(error);
          return;
        }
        resolve(stdout);
      });
    });

    darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
    darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
    darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
  } catch (e) {
    // ignore
  }

  return darwinInfo;
}

/** Returns a distribution identifier to look up version callbacks. */
function getLinuxDistroId(name) {
  return name.split(' ')[0].toLowerCase();
}

/** Loads the Linux operating system context. */
async function getLinuxInfo() {
  // By default, we cannot assume anything about the distribution or Linux
  // version. `os.release()` returns the kernel version and we assume a generic
  // "Linux" name, which will be replaced down below.
  const linuxInfo = {
    kernel_version: os.release(),
    name: 'Linux',
  };

  try {
    // We start guessing the distribution by listing files in the /etc
    // directory. This is were most Linux distributions (except Knoppix) store
    // release files with certain distribution-dependent meta data. We search
    // for exactly one known file defined in `LINUX_DISTROS` and exit if none
    // are found. In case there are more than one file, we just stick with the
    // first one.
    const etcFiles = await readDirAsync('/etc');
    const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));
    if (!distroFile) {
      return linuxInfo;
    }

    // Once that file is known, load its contents. To make searching in those
    // files easier, we lowercase the file contents. Since these files are
    // usually quite small, this should not allocate too much memory and we only
    // hold on to it for a very short amount of time.
    const distroPath = path.join('/etc', distroFile.name);
    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase();

    // Some Linux distributions store their release information in the same file
    // (e.g. RHEL and Centos). In those cases, we scan the file for an
    // identifier, that basically consists of the first word of the linux
    // distribution name (e.g. "red" for Red Hat). In case there is no match, we
    // just assume the first distribution in our list.
    const { distros } = distroFile;
    linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];

    // Based on the found distribution, we can now compute the actual version
    // number. This is different for every distribution, so several strategies
    // are computed in `LINUX_VERSIONS`.
    const id = getLinuxDistroId(linuxInfo.name);
    linuxInfo.version = LINUX_VERSIONS[id](contents);
  } catch (e) {
    // ignore
  }

  return linuxInfo;
}

exports.Context = Context;
exports.getDeviceContext = getDeviceContext;
exports.readDirAsync = readDirAsync;
exports.readFileAsync = readFileAsync;
//# sourceMappingURL=context.js.map
{"version":3,"file":"context.js","sources":["../../../src/integrations/context.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  AppContext,\n  Contexts,\n  CultureContext,\n  DeviceContext,\n  Event,\n  EventProcessor,\n  Integration,\n  OsContext,\n} from '@sentry/types';\nimport { execFile } from 'child_process';\nimport { readdir, readFile } from 'fs';\nimport * as os from 'os';\nimport { join } from 'path';\nimport { promisify } from 'util';\n\n// TODO: Required until we drop support for Node v8\nexport const readFileAsync = promisify(readFile);\nexport const readDirAsync = promisify(readdir);\n\ninterface DeviceContextOptions {\n  cpu?: boolean;\n  memory?: boolean;\n}\n\ninterface ContextOptions {\n  app?: boolean;\n  os?: boolean;\n  device?: DeviceContextOptions | boolean;\n  culture?: boolean;\n}\n\n/** Add node modules / packages to the event */\nexport class Context implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Context';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Context.id;\n\n  /**\n   * Caches context so it's only evaluated once\n   */\n  private _cachedContext: Promise<Contexts> | undefined;\n\n  public constructor(private readonly _options: ContextOptions = { app: true, os: true, device: true, culture: true }) {\n    //\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(event => this.addContext(event));\n  }\n\n  /** Processes an event and adds context */\n  public async addContext(event: Event): Promise<Event> {\n    if (this._cachedContext === undefined) {\n      this._cachedContext = this._getContexts();\n    }\n\n    const updatedContext = this._updateContext(await this._cachedContext);\n\n    event.contexts = {\n      ...event.contexts,\n      app: { ...updatedContext.app, ...event.contexts?.app },\n      os: { ...updatedContext.os, ...event.contexts?.os },\n      device: { ...updatedContext.device, ...event.contexts?.device },\n      culture: { ...updatedContext.culture, ...event.contexts?.culture },\n    };\n\n    return event;\n  }\n\n  /**\n   * Updates the context with dynamic values that can change\n   */\n  private _updateContext(contexts: Contexts): Contexts {\n    // Only update properties if they exist\n    if (contexts?.app?.app_memory) {\n      contexts.app.app_memory = process.memoryUsage().rss;\n    }\n\n    if (contexts?.device?.free_memory) {\n      contexts.device.free_memory = os.freemem();\n    }\n\n    return contexts;\n  }\n\n  /**\n   * Gets the contexts for the current environment\n   */\n  private async _getContexts(): Promise<Contexts> {\n    const contexts: Contexts = {};\n\n    if (this._options.os) {\n      contexts.os = await getOsContext();\n    }\n\n    if (this._options.app) {\n      contexts.app = getAppContext();\n    }\n\n    if (this._options.device) {\n      contexts.device = getDeviceContext(this._options.device);\n    }\n\n    if (this._options.culture) {\n      const culture = getCultureContext();\n\n      if (culture) {\n        contexts.culture = culture;\n      }\n    }\n\n    return contexts;\n  }\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n *    has a `name`, `version`, `build` and `kernel_version` set.\n *  - On Linux, this will try to load a distribution release from `/etc` and set\n *    the `name`, `version` and `kernel_version` fields.\n *  - On all other platforms, only a `name` and `version` will be returned. Note\n *    that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n  const platformId = os.platform();\n  switch (platformId) {\n    case 'darwin':\n      return getDarwinInfo();\n    case 'linux':\n      return getLinuxInfo();\n    default:\n      return {\n        name: PLATFORM_NAMES[platformId] || platformId,\n        version: os.release(),\n      };\n  }\n}\n\nfunction getCultureContext(): CultureContext | undefined {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n    if (typeof (process.versions as unknown as any).icu !== 'string') {\n      // Node was built without ICU support\n      return;\n    }\n\n    // Check that node was built with full Intl support. Its possible it was built without support for non-English\n    // locales which will make resolvedOptions inaccurate\n    //\n    // https://nodejs.org/api/intl.html#detecting-internationalization-support\n    const january = new Date(9e8);\n    const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n    if (spanish.format(january) === 'enero') {\n      const options = Intl.DateTimeFormat().resolvedOptions();\n\n      return {\n        locale: options.locale,\n        timezone: options.timeZone,\n      };\n    }\n  } catch (err) {\n    //\n  }\n\n  return;\n}\n\nfunction getAppContext(): AppContext {\n  const app_memory = process.memoryUsage().rss;\n  const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n\n  return { app_start_time, app_memory };\n}\n\n/**\n * Gets device information from os\n */\nexport function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext {\n  const device: DeviceContext = {};\n\n  // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n  // Hence, we only set boot time, if we get a valid uptime value.\n  // @see https://github.com/getsentry/sentry-javascript/issues/5856\n  const uptime = os.uptime && os.uptime();\n  if (typeof uptime === 'number') {\n    device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n  }\n\n  device.arch = os.arch();\n\n  if (deviceOpt === true || deviceOpt.memory) {\n    device.memory_size = os.totalmem();\n    device.free_memory = os.freemem();\n  }\n\n  if (deviceOpt === true || deviceOpt.cpu) {\n    const cpuInfo: os.CpuInfo[] | undefined = os.cpus();\n    if (cpuInfo && cpuInfo.length) {\n      const firstCpu = cpuInfo[0];\n\n      device.processor_count = cpuInfo.length;\n      device.cpu_description = firstCpu.model;\n      device.processor_frequency = firstCpu.speed;\n    }\n  }\n\n  return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n  aix: 'IBM AIX',\n  freebsd: 'FreeBSD',\n  openbsd: 'OpenBSD',\n  sunos: 'SunOS',\n  win32: 'Windows',\n};\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n  /** The file name, located in `/etc`. */\n  name: string;\n  /** Potential distributions to check. */\n  distros: string[];\n}\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n  { name: 'fedora-release', distros: ['Fedora'] },\n  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n  { name: 'redhat_version', distros: ['Red Hat Linux'] },\n  { name: 'SuSE-release', distros: ['SUSE Linux'] },\n  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n  { name: 'debian_version', distros: ['Debian'] },\n  { name: 'debian_release', distros: ['Debian'] },\n  { name: 'arch-release', distros: ['Arch Linux'] },\n  { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n  { name: 'novell-release', distros: ['SUSE Linux'] },\n  { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n  [identifier: string]: (content: string) => string | undefined;\n} = {\n  alpine: content => content,\n  arch: content => matchFirst(/distrib_release=(.*)/, content),\n  centos: content => matchFirst(/release ([^ ]+)/, content),\n  debian: content => content,\n  fedora: content => matchFirst(/release (..)/, content),\n  mint: content => matchFirst(/distrib_release=(.*)/, content),\n  red: content => matchFirst(/release ([^ ]+)/, content),\n  suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n  ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n  const match = regex.exec(text);\n  return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n  // Default values that will be used in case no operating system information\n  // can be loaded. The default version is computed via heuristics from the\n  // kernel version, but the build ID is missing.\n  const darwinInfo: OsContext = {\n    kernel_version: os.release(),\n    name: 'Mac OS X',\n    version: `10.${Number(os.release().split('.')[0]) - 4}`,\n  };\n\n  try {\n    // We try to load the actual macOS version by executing the `sw_vers` tool.\n    // This tool should be available on every standard macOS installation. In\n    // case this fails, we stick with the values computed above.\n\n    const output = await new Promise<string>((resolve, reject) => {\n      execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve(stdout);\n      });\n    });\n\n    darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n    darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n    darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n  } catch (e) {\n    // ignore\n  }\n\n  return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n  return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n  // By default, we cannot assume anything about the distribution or Linux\n  // version. `os.release()` returns the kernel version and we assume a generic\n  // \"Linux\" name, which will be replaced down below.\n  const linuxInfo: OsContext = {\n    kernel_version: os.release(),\n    name: 'Linux',\n  };\n\n  try {\n    // We start guessing the distribution by listing files in the /etc\n    // directory. This is were most Linux distributions (except Knoppix) store\n    // release files with certain distribution-dependent meta data. We search\n    // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n    // are found. In case there are more than one file, we just stick with the\n    // first one.\n    const etcFiles = await readDirAsync('/etc');\n    const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n    if (!distroFile) {\n      return linuxInfo;\n    }\n\n    // Once that file is known, load its contents. To make searching in those\n    // files easier, we lowercase the file contents. Since these files are\n    // usually quite small, this should not allocate too much memory and we only\n    // hold on to it for a very short amount of time.\n    const distroPath = join('/etc', distroFile.name);\n    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) as string).toLowerCase();\n\n    // Some Linux distributions store their release information in the same file\n    // (e.g. RHEL and Centos). In those cases, we scan the file for an\n    // identifier, that basically consists of the first word of the linux\n    // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n    // just assume the first distribution in our list.\n    const { distros } = distroFile;\n    linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n    // Based on the found distribution, we can now compute the actual version\n    // number. This is different for every distribution, so several strategies\n    // are computed in `LINUX_VERSIONS`.\n    const id = getLinuxDistroId(linuxInfo.name);\n    linuxInfo.version = LINUX_VERSIONS[id](contents);\n  } catch (e) {\n    // ignore\n  }\n\n  return linuxInfo;\n}\n"],"names":["promisify","readFile","readdir","execFile","join"],"mappings":";;;;;;;;;;;;AAiBA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,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AAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA;IACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,SAAA;AACA;;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const fs = require('fs');
const lru_map = require('lru_map');

const FILE_CONTENT_CACHE = new lru_map.LRUMap(100);
const DEFAULT_LINES_OF_CONTEXT = 7;

// TODO: Replace with promisify when minimum supported node >= v8
function readTextFileAsync(path) {
  return new Promise((resolve, reject) => {
    fs.readFile(path, 'utf8', (err, data) => {
      if (err) reject(err);
      else resolve(data);
    });
  });
}

/** Add node modules / packages to the event */
class ContextLines  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'ContextLines';}

  /**
   * @inheritDoc
   */
   __init() {this.name = ContextLines.id;}

   constructor(  _options = {}) {this._options = _options;ContextLines.prototype.__init.call(this);}

  /** Get's the number of context lines to add */
   get _contextLines() {
    return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    addGlobalEventProcessor(event => this.addSourceContext(event));
  }

  /** Processes an event and adds context lines */
   async addSourceContext(event) {
    // keep a lookup map of which files we've already enqueued to read,
    // so we don't enqueue the same file multiple times which would cause multiple i/o reads
    const enqueuedReadSourceFileTasks = {};
    const readSourceFileTasks = [];

    if (this._contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {
      for (const exception of event.exception.values) {
        if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {
          continue;
        }

        // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.
        // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.
        for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {
          const frame = exception.stacktrace.frames[i];
          // Call cache.get to bump the file to the top of the cache and ensure we have not already
          // enqueued a read operation for this filename
          if (
            frame.filename &&
            !enqueuedReadSourceFileTasks[frame.filename] &&
            !FILE_CONTENT_CACHE.get(frame.filename)
          ) {
            readSourceFileTasks.push(_readSourceFile(frame.filename));
            enqueuedReadSourceFileTasks[frame.filename] = 1;
          }
        }
      }
    }

    // check if files to read > 0, if so, await all of them to be read before adding source contexts.
    // Normally, Promise.all here could be short circuited if one of the promises rejects, but we
    // are guarding from that by wrapping the i/o read operation in a try/catch.
    if (readSourceFileTasks.length > 0) {
      await Promise.all(readSourceFileTasks);
    }

    // Perform the same loop as above, but this time we can assume all files are in the cache
    // and attempt to add source context to frames.
    if (this._contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {
      for (const exception of event.exception.values) {
        if (exception.stacktrace && exception.stacktrace.frames) {
          await this.addSourceContextToFrames(exception.stacktrace.frames);
        }
      }
    }

    return event;
  }

  /** Adds context lines to frames */
   addSourceContextToFrames(frames) {
    for (const frame of frames) {
      // Only add context if we have a filename and it hasn't already been added
      if (frame.filename && frame.context_line === undefined) {
        const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);

        if (sourceFileLines) {
          try {
            utils.addContextToFrame(sourceFileLines, frame, this._contextLines);
          } catch (e) {
            // anomaly, being defensive in case
            // unlikely to ever happen in practice but can definitely happen in theory
          }
        }
      }
    }
  }
}ContextLines.__initStatic();

/**
 * Reads file contents and caches them in a global LRU cache.
 * If reading fails, mark the file as null in the cache so we don't try again.
 *
 * @param filename filepath to read content from.
 */
async function _readSourceFile(filename) {
  const cachedFile = FILE_CONTENT_CACHE.get(filename);

  // We have already attempted to read this file and failed, do not try again
  if (cachedFile === null) {
    return null;
  }

  // We have a cache hit, return it
  if (cachedFile !== undefined) {
    return cachedFile;
  }

  // Guard from throwing if readFile fails, this enables us to use Promise.all and
  // not have it short circuiting if one of the promises rejects + since context lines are added
  // on a best effort basis, we want to throw here anyways.

  // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it
  let content = null;
  try {
    const rawFileContents = await readTextFileAsync(filename);
    content = rawFileContents.split('\n');
  } catch (_) {
    // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it
  }

  FILE_CONTENT_CACHE.set(filename, content);
  return content;
}

exports.ContextLines = ContextLines;
//# sourceMappingURL=contextlines.js.map
{"version":3,"file":"contextlines.js","sources":["../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types';\nimport { addContextToFrame } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { LRUMap } from 'lru_map';\n\nconst FILE_CONTENT_CACHE = new LRUMap<string, string[] | null>(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path: string): Promise<string> {\n  return new Promise((resolve, reject) => {\n    readFile(path, 'utf8', (err, data) => {\n      if (err) reject(err);\n      else resolve(data);\n    });\n  });\n}\n\n/**\n * Resets the file cache. Exists for testing purposes.\n * @hidden\n */\nexport function resetFileContentCache(): void {\n  FILE_CONTENT_CACHE.clear();\n}\n\ninterface ContextLinesOptions {\n  /**\n   * Sets the number of context lines for each frame when loading a file.\n   * Defaults to 7.\n   *\n   * Set to 0 to disable loading and inclusion of source files.\n   **/\n  frameContextLines?: number;\n}\n\n/** Add node modules / packages to the event */\nexport class ContextLines implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'ContextLines';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = ContextLines.id;\n\n  public constructor(private readonly _options: ContextLinesOptions = {}) {}\n\n  /** Get's the number of context lines to add */\n  private get _contextLines(): number {\n    return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(event => this.addSourceContext(event));\n  }\n\n  /** Processes an event and adds context lines */\n  public async addSourceContext(event: Event): Promise<Event> {\n    // keep a lookup map of which files we've already enqueued to read,\n    // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n    const enqueuedReadSourceFileTasks: Record<string, number> = {};\n    const readSourceFileTasks: Promise<string[] | null>[] = [];\n\n    if (this._contextLines > 0 && event.exception?.values) {\n      for (const exception of event.exception.values) {\n        if (!exception.stacktrace?.frames) {\n          continue;\n        }\n\n        // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n        // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n        for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n          const frame = exception.stacktrace.frames[i];\n          // Call cache.get to bump the file to the top of the cache and ensure we have not already\n          // enqueued a read operation for this filename\n          if (\n            frame.filename &&\n            !enqueuedReadSourceFileTasks[frame.filename] &&\n            !FILE_CONTENT_CACHE.get(frame.filename)\n          ) {\n            readSourceFileTasks.push(_readSourceFile(frame.filename));\n            enqueuedReadSourceFileTasks[frame.filename] = 1;\n          }\n        }\n      }\n    }\n\n    // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n    // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n    // are guarding from that by wrapping the i/o read operation in a try/catch.\n    if (readSourceFileTasks.length > 0) {\n      await Promise.all(readSourceFileTasks);\n    }\n\n    // Perform the same loop as above, but this time we can assume all files are in the cache\n    // and attempt to add source context to frames.\n    if (this._contextLines > 0 && event.exception?.values) {\n      for (const exception of event.exception.values) {\n        if (exception.stacktrace && exception.stacktrace.frames) {\n          await this.addSourceContextToFrames(exception.stacktrace.frames);\n        }\n      }\n    }\n\n    return event;\n  }\n\n  /** Adds context lines to frames */\n  public addSourceContextToFrames(frames: StackFrame[]): void {\n    for (const frame of frames) {\n      // Only add context if we have a filename and it hasn't already been added\n      if (frame.filename && frame.context_line === undefined) {\n        const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n        if (sourceFileLines) {\n          try {\n            addContextToFrame(sourceFileLines, frame, this._contextLines);\n          } catch (e) {\n            // anomaly, being defensive in case\n            // unlikely to ever happen in practice but can definitely happen in theory\n          }\n        }\n      }\n    }\n  }\n}\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename: string): Promise<string[] | null> {\n  const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n  // We have already attempted to read this file and failed, do not try again\n  if (cachedFile === null) {\n    return null;\n  }\n\n  // We have a cache hit, return it\n  if (cachedFile !== undefined) {\n    return cachedFile;\n  }\n\n  // Guard from throwing if readFile fails, this enables us to use Promise.all and\n  // not have it short circuiting if one of the promises rejects + since context lines are added\n  // on a best effort basis, we want to throw here anyways.\n\n  // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n  let content: string[] | null = null;\n  try {\n    const rawFileContents = await readTextFileAsync(filename);\n    content = rawFileContents.split('\\n');\n  } catch (_) {\n    // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n  }\n\n  FILE_CONTENT_CACHE.set(filename, content);\n  return content;\n}\n"],"names":["LRUMap","readFile","addContextToFrame"],"mappings":";;;;;;;;;;AAKA,CAAA,CAAA,CAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,CAAA,EAAAA,cAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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A,CAAA,CAAA,CAAA,EAAA,iBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA;IACA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;EACA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAA;AACA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const lru_map = require('lru_map');
const nodeVersion = require('../nodeVersion.js');
const http = require('./utils/http.js');

/**
 * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing
 * http requests and attaches trace data when tracing is enabled via its `tracing` option.
 */
class Http  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Http';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Http.id;}

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Http.prototype.__init.call(this);
    this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;
    this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;
  }

  /**
   * @inheritDoc
   */
   setupOnce(
    _addGlobalEventProcessor,
    setupOnceGetCurrentHub,
  ) {
    // No need to instrument if we don't want to track anything
    if (!this._breadcrumbs && !this._tracing) {
      return;
    }

    const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);

    // Do not auto-instrument for other instrumenter
    if (clientOptions && clientOptions.instrumenter !== 'sentry') {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('HTTP Integration is skipped because of instrumenter configuration.');
      return;
    }

    // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions
    // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.
    const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;

    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const httpModule = require('http');
    const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);
    utils.fill(httpModule, 'get', wrappedHttpHandlerMaker);
    utils.fill(httpModule, 'request', wrappedHttpHandlerMaker);

    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
    // If we do, we'd get double breadcrumbs and double spans for `https` calls.
    // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
    if (nodeVersion.NODE_VERSION.major && nodeVersion.NODE_VERSION.major > 8) {
      // eslint-disable-next-line @typescript-eslint/no-var-requires
      const httpsModule = require('https');
      const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(
        this._breadcrumbs,
        tracingOptions,
        httpsModule,
      );
      utils.fill(httpsModule, 'get', wrappedHttpsHandlerMaker);
      utils.fill(httpsModule, 'request', wrappedHttpsHandlerMaker);
    }
  }
}Http.__initStatic();

// for ease of reading below

/**
 * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`
 * and `https` modules. (NB: Not a typo - this is a creator^2!)
 *
 * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs
 * @param tracingEnabled Whether or not to record outgoing requests as tracing spans
 *
 * @returns A function which accepts the exiting handler and returns a wrapped handler
 */
function _createWrappedRequestMethodFactory(
  breadcrumbsEnabled,
  tracingOptions,
  httpModule,
) {
  // We're caching results so we don't have to recompute regexp every time we create a request.
  const createSpanUrlMap = new lru_map.LRUMap(100);
  const headersUrlMap = {};

  const shouldCreateSpan = (url) => {
    if (_optionalChain([tracingOptions, 'optionalAccess', _6 => _6.shouldCreateSpanForRequest]) === undefined) {
      return true;
    }

    const cachedDecision = createSpanUrlMap.get(url);
    if (cachedDecision !== undefined) {
      return cachedDecision;
    }

    const decision = tracingOptions.shouldCreateSpanForRequest(url);
    createSpanUrlMap.set(url, decision);
    return decision;
  };

  const shouldAttachTraceData = (url) => {
    if (_optionalChain([tracingOptions, 'optionalAccess', _7 => _7.tracePropagationTargets]) === undefined) {
      return true;
    }

    if (headersUrlMap[url]) {
      return headersUrlMap[url];
    }

    headersUrlMap[url] = utils.stringMatchesSomePattern(url, tracingOptions.tracePropagationTargets);

    return headersUrlMap[url];
  };

  return function wrappedRequestMethodFactory(originalRequestMethod) {
    return function wrappedMethod( ...args) {
      const requestArgs = http.normalizeRequestArgs(httpModule, args);
      const requestOptions = requestArgs[0];
      // eslint-disable-next-line deprecation/deprecation
      const rawRequestUrl = http.extractRawUrl(requestOptions);
      const requestUrl = http.extractUrl(requestOptions);

      // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method
      if (http.isSentryRequest(requestUrl)) {
        return originalRequestMethod.apply(httpModule, requestArgs);
      }

      let requestSpan;
      let parentSpan;

      const scope = core.getCurrentHub().getScope();

      const requestSpanData = {
        url: requestUrl,
        method: requestOptions.method || 'GET',
      };
      if (requestOptions.hash) {
        // strip leading "#"
        requestSpanData['http.fragment'] = requestOptions.hash.substring(1);
      }
      if (requestOptions.search) {
        // strip leading "?"
        requestSpanData['http.query'] = requestOptions.search.substring(1);
      }

      if (scope && tracingOptions && shouldCreateSpan(rawRequestUrl)) {
        parentSpan = scope.getSpan();

        if (parentSpan) {
          requestSpan = parentSpan.startChild({
            description: `${requestSpanData.method} ${requestSpanData.url}`,
            op: 'http.client',
            data: requestSpanData,
          });

          if (shouldAttachTraceData(rawRequestUrl)) {
            const sentryTraceHeader = requestSpan.toTraceparent();
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              utils.logger.log(
                `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to "${requestUrl}": `,
              );

            requestOptions.headers = {
              ...requestOptions.headers,
              'sentry-trace': sentryTraceHeader,
            };

            if (parentSpan.transaction) {
              const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext();
              const sentryBaggageHeader = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);

              let newBaggageHeaderField;
              if (!requestOptions.headers || !requestOptions.headers.baggage) {
                newBaggageHeaderField = sentryBaggageHeader;
              } else if (!sentryBaggageHeader) {
                newBaggageHeaderField = requestOptions.headers.baggage;
              } else if (Array.isArray(requestOptions.headers.baggage)) {
                newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader];
              } else {
                // Type-cast explanation:
                // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity
                // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.
                newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] ;
              }

              requestOptions.headers = {
                ...requestOptions.headers,
                // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined
                ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }),
              };
            }
          } else {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              utils.logger.log(
                `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,
              );
          }
        }
      }

      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      return originalRequestMethod
        .apply(httpModule, requestArgs)
        .once('response', function ( res) {
          // eslint-disable-next-line @typescript-eslint/no-this-alias
          const req = this;
          if (breadcrumbsEnabled) {
            addRequestBreadcrumb('response', requestSpanData, req, res);
          }
          if (requestSpan) {
            if (res.statusCode) {
              requestSpan.setHttpStatus(res.statusCode);
            }
            requestSpan.description = http.cleanSpanDescription(requestSpan.description, requestOptions, req);
            requestSpan.finish();
          }
        })
        .once('error', function () {
          // eslint-disable-next-line @typescript-eslint/no-this-alias
          const req = this;

          if (breadcrumbsEnabled) {
            addRequestBreadcrumb('error', requestSpanData, req);
          }
          if (requestSpan) {
            requestSpan.setHttpStatus(500);
            requestSpan.description = http.cleanSpanDescription(requestSpan.description, requestOptions, req);
            requestSpan.finish();
          }
        });
    };
  };
}

/**
 * Captures Breadcrumb based on provided request/response pair
 */
function addRequestBreadcrumb(
  event,
  requestSpanData,
  req,
  res,
) {
  if (!core.getCurrentHub().getIntegration(Http)) {
    return;
  }

  core.getCurrentHub().addBreadcrumb(
    {
      category: 'http',
      data: {
        status_code: res && res.statusCode,
        ...requestSpanData,
      },
      type: 'http',
    },
    {
      event,
      request: req,
      response: res,
    },
  );
}

exports.Http = Http;
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { EventProcessor, Integration, SanitizedRequestData, Span, TracePropagationTargets } from '@sentry/types';\nimport { dynamicSamplingContextToSentryBaggageHeader, fill, logger, stringMatchesSomePattern } from '@sentry/utils';\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport { LRUMap } from 'lru_map';\n\nimport type { NodeClient } from '../client';\nimport { NODE_VERSION } from '../nodeVersion';\nimport type { RequestMethod, RequestMethodArgs } from './utils/http';\nimport { cleanSpanDescription, extractRawUrl, extractUrl, isSentryRequest, normalizeRequestArgs } from './utils/http';\n\ninterface TracingOptions {\n  /**\n   * List of strings/regex controlling to which outgoing requests\n   * the SDK will attach tracing headers.\n   *\n   * By default the SDK will attach those headers to all outgoing\n   * requests. If this option is provided, the SDK will match the\n   * request URL of outgoing requests against the items in this\n   * array, and only attach tracing headers if a match was found.\n   */\n  tracePropagationTargets?: TracePropagationTargets;\n\n  /**\n   * Function determining whether or not to create spans to track outgoing requests to the given URL.\n   * By default, spans will be created for all outgoing requests.\n   */\n  shouldCreateSpanForRequest?: (url: string) => boolean;\n}\n\ninterface HttpOptions {\n  /**\n   * Whether breadcrumbs should be recorded for requests\n   * Defaults to true\n   */\n  breadcrumbs?: boolean;\n\n  /**\n   * Whether tracing spans should be created for requests\n   * Defaults to false\n   */\n  tracing?: TracingOptions | boolean;\n}\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n */\nexport class Http implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Http';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Http.id;\n\n  private readonly _breadcrumbs: boolean;\n  private readonly _tracing: TracingOptions | undefined;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: HttpOptions = {}) {\n    this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n    this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(\n    _addGlobalEventProcessor: (callback: EventProcessor) => void,\n    setupOnceGetCurrentHub: () => Hub,\n  ): void {\n    // No need to instrument if we don't want to track anything\n    if (!this._breadcrumbs && !this._tracing) {\n      return;\n    }\n\n    const clientOptions = setupOnceGetCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    // Do not auto-instrument for other instrumenter\n    if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n      __DEBUG_BUILD__ && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions\n    // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.\n    const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;\n\n    // eslint-disable-next-line @typescript-eslint/no-var-requires\n    const httpModule = require('http');\n    const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);\n    fill(httpModule, 'get', wrappedHttpHandlerMaker);\n    fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n    // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n    // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n    if (NODE_VERSION.major && NODE_VERSION.major > 8) {\n      // eslint-disable-next-line @typescript-eslint/no-var-requires\n      const httpsModule = require('https');\n      const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n        this._breadcrumbs,\n        tracingOptions,\n        httpsModule,\n      );\n      fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n      fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n    }\n  }\n}\n\n// for ease of reading below\ntype OriginalRequestMethod = RequestMethod;\ntype WrappedRequestMethod = RequestMethod;\ntype WrappedRequestMethodFactory = (original: OriginalRequestMethod) => WrappedRequestMethod;\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n  breadcrumbsEnabled: boolean,\n  tracingOptions: TracingOptions | undefined,\n  httpModule: typeof http | typeof https,\n): WrappedRequestMethodFactory {\n  // We're caching results so we don't have to recompute regexp every time we create a request.\n  const createSpanUrlMap = new LRUMap<string, boolean>(100);\n  const headersUrlMap: Record<string, boolean> = {};\n\n  const shouldCreateSpan = (url: string): boolean => {\n    if (tracingOptions?.shouldCreateSpanForRequest === undefined) {\n      return true;\n    }\n\n    const cachedDecision = createSpanUrlMap.get(url);\n    if (cachedDecision !== undefined) {\n      return cachedDecision;\n    }\n\n    const decision = tracingOptions.shouldCreateSpanForRequest(url);\n    createSpanUrlMap.set(url, decision);\n    return decision;\n  };\n\n  const shouldAttachTraceData = (url: string): boolean => {\n    if (tracingOptions?.tracePropagationTargets === undefined) {\n      return true;\n    }\n\n    if (headersUrlMap[url]) {\n      return headersUrlMap[url];\n    }\n\n    headersUrlMap[url] = stringMatchesSomePattern(url, tracingOptions.tracePropagationTargets);\n\n    return headersUrlMap[url];\n  };\n\n  return function wrappedRequestMethodFactory(originalRequestMethod: OriginalRequestMethod): WrappedRequestMethod {\n    return function wrappedMethod(this: unknown, ...args: RequestMethodArgs): http.ClientRequest {\n      const requestArgs = normalizeRequestArgs(httpModule, args);\n      const requestOptions = requestArgs[0];\n      // eslint-disable-next-line deprecation/deprecation\n      const rawRequestUrl = extractRawUrl(requestOptions);\n      const requestUrl = extractUrl(requestOptions);\n\n      // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n      if (isSentryRequest(requestUrl)) {\n        return originalRequestMethod.apply(httpModule, requestArgs);\n      }\n\n      let requestSpan: Span | undefined;\n      let parentSpan: Span | undefined;\n\n      const scope = getCurrentHub().getScope();\n\n      const requestSpanData: SanitizedRequestData = {\n        url: requestUrl,\n        method: requestOptions.method || 'GET',\n      };\n      if (requestOptions.hash) {\n        // strip leading \"#\"\n        requestSpanData['http.fragment'] = requestOptions.hash.substring(1);\n      }\n      if (requestOptions.search) {\n        // strip leading \"?\"\n        requestSpanData['http.query'] = requestOptions.search.substring(1);\n      }\n\n      if (scope && tracingOptions && shouldCreateSpan(rawRequestUrl)) {\n        parentSpan = scope.getSpan();\n\n        if (parentSpan) {\n          requestSpan = parentSpan.startChild({\n            description: `${requestSpanData.method} ${requestSpanData.url}`,\n            op: 'http.client',\n            data: requestSpanData,\n          });\n\n          if (shouldAttachTraceData(rawRequestUrl)) {\n            const sentryTraceHeader = requestSpan.toTraceparent();\n            __DEBUG_BUILD__ &&\n              logger.log(\n                `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `,\n              );\n\n            requestOptions.headers = {\n              ...requestOptions.headers,\n              'sentry-trace': sentryTraceHeader,\n            };\n\n            if (parentSpan.transaction) {\n              const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext();\n              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n              let newBaggageHeaderField;\n              if (!requestOptions.headers || !requestOptions.headers.baggage) {\n                newBaggageHeaderField = sentryBaggageHeader;\n              } else if (!sentryBaggageHeader) {\n                newBaggageHeaderField = requestOptions.headers.baggage;\n              } else if (Array.isArray(requestOptions.headers.baggage)) {\n                newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader];\n              } else {\n                // Type-cast explanation:\n                // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n                // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n                newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] as string[];\n              }\n\n              requestOptions.headers = {\n                ...requestOptions.headers,\n                // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined\n                ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }),\n              };\n            }\n          } else {\n            __DEBUG_BUILD__ &&\n              logger.log(\n                `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n              );\n          }\n        }\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalRequestMethod\n        .apply(httpModule, requestArgs)\n        .once('response', function (this: http.ClientRequest, res: http.IncomingMessage): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n          if (breadcrumbsEnabled) {\n            addRequestBreadcrumb('response', requestSpanData, req, res);\n          }\n          if (requestSpan) {\n            if (res.statusCode) {\n              requestSpan.setHttpStatus(res.statusCode);\n            }\n            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);\n            requestSpan.finish();\n          }\n        })\n        .once('error', function (this: http.ClientRequest): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n\n          if (breadcrumbsEnabled) {\n            addRequestBreadcrumb('error', requestSpanData, req);\n          }\n          if (requestSpan) {\n            requestSpan.setHttpStatus(500);\n            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);\n            requestSpan.finish();\n          }\n        });\n    };\n  };\n}\n\n/**\n * Captures Breadcrumb based on provided request/response pair\n */\nfunction addRequestBreadcrumb(\n  event: string,\n  requestSpanData: SanitizedRequestData,\n  req: http.ClientRequest,\n  res?: http.IncomingMessage,\n): void {\n  if (!getCurrentHub().getIntegration(Http)) {\n    return;\n  }\n\n  getCurrentHub().addBreadcrumb(\n    {\n      category: 'http',\n      data: {\n        status_code: res && res.statusCode,\n        ...requestSpanData,\n      },\n      type: 'http',\n    },\n    {\n      event,\n      request: req,\n      response: res,\n    },\n  );\n}\n"],"names":["logger","fill","NODE_VERSION","LRUMap","stringMatchesSomePattern","normalizeRequestArgs","extractRawUrl","extractUrl","isSentryRequest","getCurrentHub","dynamicSamplingContextToSentryBaggageHeader","cleanSpanDescription"],"mappings":";;;;;;;;;;;;AA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CAAA,CAAA;MACA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA;IACA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;IACA,CAAA;EACA,CAAA;AACA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const console = require('./console.js');
const http = require('./http.js');
const onuncaughtexception = require('./onuncaughtexception.js');
const onunhandledrejection = require('./onunhandledrejection.js');
const linkederrors = require('./linkederrors.js');
const modules = require('./modules.js');
const contextlines = require('./contextlines.js');
const context = require('./context.js');
const requestdata = require('./requestdata.js');
const localvariables = require('./localvariables.js');
const index = require('./undici/index.js');



exports.Console = console.Console;
exports.Http = http.Http;
exports.OnUncaughtException = onuncaughtexception.OnUncaughtException;
exports.OnUnhandledRejection = onunhandledrejection.OnUnhandledRejection;
exports.LinkedErrors = linkederrors.LinkedErrors;
exports.Modules = modules.Modules;
exports.ContextLines = contextlines.ContextLines;
exports.Context = context.Context;
exports.RequestData = requestdata.RequestData;
exports.LocalVariables = localvariables.LocalVariables;
exports.Undici = index.Undici;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const eventbuilder = require('../eventbuilder.js');
const contextlines = require('./contextlines.js');

const DEFAULT_KEY = 'cause';
const DEFAULT_LIMIT = 5;

/** Adds SDK info to an event. */
class LinkedErrors  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'LinkedErrors';}

  /**
   * @inheritDoc
   */
    __init() {this.name = LinkedErrors.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {LinkedErrors.prototype.__init.call(this);
    this._key = options.key || DEFAULT_KEY;
    this._limit = options.limit || DEFAULT_LIMIT;
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    core.addGlobalEventProcessor(async (event, hint) => {
      const hub = core.getCurrentHub();
      const self = hub.getIntegration(LinkedErrors);
      const client = hub.getClient();
      if (client && self && self._handler && typeof self._handler === 'function') {
        await self._handler(client.getOptions().stackParser, event, hint);
      }
      return event;
    });
  }

  /**
   * @inheritDoc
   */
   _handler(stackParser, event, hint) {
    if (!event.exception || !event.exception.values || !utils.isInstanceOf(hint.originalException, Error)) {
      return utils.resolvedSyncPromise(event);
    }

    return new utils.SyncPromise(resolve => {
      void this._walkErrorTree(stackParser, hint.originalException , this._key)
        .then((linkedErrors) => {
          if (event && event.exception && event.exception.values) {
            event.exception.values = [...linkedErrors, ...event.exception.values];
          }
          resolve(event);
        })
        .then(null, () => {
          resolve(event);
        });
    });
  }

  /**
   * @inheritDoc
   */
   async _walkErrorTree(
    stackParser,
    error,
    key,
    stack = [],
  ) {
    if (!utils.isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {
      return Promise.resolve(stack);
    }

    const exception = eventbuilder.exceptionFromError(stackParser, error[key]);

    // If the ContextLines integration is enabled, we add source code context to linked errors
    // because we can't guarantee the order that integrations are run.
    const contextLines = core.getCurrentHub().getIntegration(contextlines.ContextLines);
    if (contextLines && _optionalChain([exception, 'access', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames])) {
      await contextLines.addSourceContextToFrames(exception.stacktrace.frames);
    }

    return new Promise((resolve, reject) => {
      void this._walkErrorTree(stackParser, error[key], key, [exception, ...stack])
        .then(resolve)
        .then(null, () => {
          reject();
        });
    });
  }
}LinkedErrors.__initStatic();

exports.LinkedErrors = LinkedErrors;
//# sourceMappingURL=linkederrors.js.map
{"version":3,"file":"linkederrors.js","sources":["../../../src/integrations/linkederrors.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';\nimport { isInstanceOf, resolvedSyncPromise, SyncPromise } from '@sentry/utils';\n\nimport type { NodeClient } from '../client';\nimport { exceptionFromError } from '../eventbuilder';\nimport { ContextLines } from './contextlines';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = LinkedErrors.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: string;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: number;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { key?: string; limit?: number } = {}) {\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n      const hub = getCurrentHub();\n      const self = hub.getIntegration(LinkedErrors);\n      const client = hub.getClient<NodeClient>();\n      if (client && self && self._handler && typeof self._handler === 'function') {\n        await self._handler(client.getOptions().stackParser, event, hint);\n      }\n      return event;\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private _handler(stackParser: StackParser, event: Event, hint: EventHint): PromiseLike<Event> {\n    if (!event.exception || !event.exception.values || !isInstanceOf(hint.originalException, Error)) {\n      return resolvedSyncPromise(event);\n    }\n\n    return new SyncPromise<Event>(resolve => {\n      void this._walkErrorTree(stackParser, hint.originalException as Error, this._key)\n        .then((linkedErrors: Exception[]) => {\n          if (event && event.exception && event.exception.values) {\n            event.exception.values = [...linkedErrors, ...event.exception.values];\n          }\n          resolve(event);\n        })\n        .then(null, () => {\n          resolve(event);\n        });\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private async _walkErrorTree(\n    stackParser: StackParser,\n    error: ExtendedError,\n    key: string,\n    stack: Exception[] = [],\n  ): Promise<Exception[]> {\n    if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n      return Promise.resolve(stack);\n    }\n\n    const exception = exceptionFromError(stackParser, error[key]);\n\n    // If the ContextLines integration is enabled, we add source code context to linked errors\n    // because we can't guarantee the order that integrations are run.\n    const contextLines = getCurrentHub().getIntegration(ContextLines);\n    if (contextLines && exception.stacktrace?.frames) {\n      await contextLines.addSourceContextToFrames(exception.stacktrace.frames);\n    }\n\n    return new Promise<Exception[]>((resolve, reject) => {\n      void this._walkErrorTree(stackParser, error[key], key, [exception, ...stack])\n        .then(resolve)\n        .then(null, () => {\n          reject();\n        });\n    });\n  }\n}\n"],"names":["addGlobalEventProcessor","getCurrentHub","isInstanceOf","resolvedSyncPromise","SyncPromise","exceptionFromError","ContextLines"],"mappings":";;;;;;;;;;;AAQA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA;;AAEA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,cAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAA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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA;UACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;QACA,CAAA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const lru_map = require('lru_map');
const nodeVersion = require('../nodeVersion.js');

/** Creates a container for callbacks to be called sequentially */
function createCallbackList(complete) {
  // A collection of callbacks to be executed last to first
  let callbacks = [];

  let completedCalled = false;
  function checkedComplete(result) {
    callbacks = [];
    if (completedCalled) {
      return;
    }
    completedCalled = true;
    complete(result);
  }

  // complete should be called last
  callbacks.push(checkedComplete);

  function add(fn) {
    callbacks.push(fn);
  }

  function next(result) {
    const popped = callbacks.pop() || checkedComplete;

    try {
      popped(result);
    } catch (_) {
      // If there is an error, we still want to call the complete callback
      checkedComplete(result);
    }
  }

  return { add, next };
}

/**
 * Promise API is available as `Experimental` and in Node 19 only.
 *
 * Callback-based API is `Stable` since v14 and `Experimental` since v8.
 * Because of that, we are creating our own `AsyncSession` class.
 *
 * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api
 * https://nodejs.org/docs/latest-v14.x/api/inspector.html
 */
class AsyncSession  {

  /** Throws if inspector API is not available */
   constructor() {
    /*
    TODO: We really should get rid of this require statement below for a couple of reasons:
    1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`
       in SvelteKit server code (at least not by default).
    2. Throwing in a constructor is bad practice

    More context for a future attempt to fix this:
    We already tried replacing it with import but didn't get it to work because of async problems.
    We still called import in the constructor but assigned to a promise which we "awaited" in
    `configureAndConnect`. However, this broke the Node integration tests as no local variables
    were reported any more. We probably missed a place where we need to await the promise, too.
    */

    // Node can be built without inspector support so this can throw
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const { Session } = require('inspector');
    this._session = new Session();
  }

  /** @inheritdoc */
   configureAndConnect(onPause, captureAll) {
    this._session.connect();

    this._session.on('Debugger.paused', event => {
      onPause(event, () => {
        // After the pause work is complete, resume execution or the exception context memory is leaked
        this._session.post('Debugger.resume');
      });
    });

    this._session.post('Debugger.enable');
    this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });
  }

  /** @inheritdoc */
   getLocalVariables(objectId, complete) {
    this._getProperties(objectId, props => {
      const { add, next } = createCallbackList(complete);

      for (const prop of props) {
        if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {
          const id = prop.value.objectId;
          add(vars => this._unrollArray(id, prop.name, vars, next));
        } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {
          const id = prop.value.objectId;
          add(vars => this._unrollObject(id, prop.name, vars, next));
        } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description])) {
          add(vars => this._unrollOther(prop, vars, next));
        }
      }

      next({});
    });
  }

  /**
   * Gets all the PropertyDescriptors of an object
   */
   _getProperties(objectId, next) {
    this._session.post(
      'Runtime.getProperties',
      {
        objectId,
        ownProperties: true,
      },
      (err, params) => {
        if (err) {
          next([]);
        } else {
          next(params.result);
        }
      },
    );
  }

  /**
   * Unrolls an array property
   */
   _unrollArray(objectId, name, vars, next) {
    this._getProperties(objectId, props => {
      vars[name] = props
        .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))
        .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))
        .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));

      next(vars);
    });
  }

  /**
   * Unrolls an object property
   */
   _unrollObject(objectId, name, vars, next) {
    this._getProperties(objectId, props => {
      vars[name] = props
        .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])
        .reduce((obj, [key, val]) => {
          obj[key] = val;
          return obj;
        }, {} );

      next(vars);
    });
  }

  /**
   * Unrolls other properties
   */
   _unrollOther(prop, vars, next) {
    if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value])) {
      vars[prop.name] = prop.value.value;
    } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {
      vars[prop.name] = `<${prop.value.description}>`;
    }

    next(vars);
  }
}

/**
 * When using Vercel pkg, the inspector module is not available.
 * https://github.com/getsentry/sentry-javascript/issues/6769
 */
function tryNewAsyncSession() {
  try {
    return new AsyncSession();
  } catch (e) {
    return undefined;
  }
}

// Add types for the exception event data

/** Could this be an anonymous function? */
function isAnonymous(name) {
  return name !== undefined && ['', '?', '<anonymous>'].includes(name);
}

/** Do the function names appear to match? */
function functionNamesMatch(a, b) {
  return a === b || (isAnonymous(a) && isAnonymous(b));
}

/** Creates a unique hash from stack frames */
function hashFrames(frames) {
  if (frames === undefined) {
    return;
  }

  // Only hash the 10 most recent frames (ie. the last 10)
  return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');
}

/**
 * We use the stack parser to create a unique hash from the exception stack trace
 * This is used to lookup vars when the exception passes through the event processor
 */
function hashFromStack(stackParser, stack) {
  if (stack === undefined) {
    return undefined;
  }

  return hashFrames(stackParser(stack, 1));
}

/**
 * Adds local variables to exception frames
 */
class LocalVariables  {
   static __initStatic() {this.id = 'LocalVariables';}

    __init() {this.name = LocalVariables.id;}

    __init2() {this._cachedFrames = new lru_map.LRUMap(20);}

   constructor(
      _options = {},
      _session = tryNewAsyncSession(),
  ) {this._options = _options;this._session = _session;LocalVariables.prototype.__init.call(this);LocalVariables.prototype.__init2.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    this._setup(addGlobalEventProcessor, _optionalChain([getCurrentHub, 'call', _24 => _24(), 'access', _25 => _25.getClient, 'call', _26 => _26(), 'optionalAccess', _27 => _27.getOptions, 'call', _28 => _28()]));
  }

  /** Setup in a way that's easier to call from tests */
   _setup(
    addGlobalEventProcessor,
    clientOptions,
  ) {
    if (this._session && _optionalChain([clientOptions, 'optionalAccess', _29 => _29.includeLocalVariables])) {
      // Only setup this integration if the Node version is >= v18
      // https://github.com/getsentry/sentry-javascript/issues/7697
      const unsupportedNodeVersion = (nodeVersion.NODE_VERSION.major || 0) < 18;

      if (unsupportedNodeVersion) {
        utils.logger.log('The `LocalVariables` integration is only supported on Node >= v18.');
        return;
      }

      this._session.configureAndConnect(
        (ev, complete) =>
          this._handlePaused(clientOptions.stackParser, ev , complete),
        !!this._options.captureAllExceptions,
      );

      addGlobalEventProcessor(async event => this._addLocalVariables(event));
    }
  }

  /**
   * Handle the pause event
   */
   _handlePaused(
    stackParser,
    { params: { reason, data, callFrames } },
    complete,
  ) {
    if (reason !== 'exception' && reason !== 'promiseRejection') {
      complete();
      return;
    }

    // data.description contains the original error.stack
    const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _30 => _30.description]));

    if (exceptionHash == undefined) {
      complete();
      return;
    }

    const { add, next } = createCallbackList(frames => {
      this._cachedFrames.set(exceptionHash, frames);
      complete();
    });

    // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack
    // For this reason we only attempt to get local variables for the first 5 frames
    for (let i = 0; i < Math.min(callFrames.length, 5); i++) {
      const { scopeChain, functionName, this: obj } = callFrames[i];

      const localScope = scopeChain.find(scope => scope.type === 'local');

      // obj.className is undefined in ESM modules
      const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;

      if (_optionalChain([localScope, 'optionalAccess', _31 => _31.object, 'access', _32 => _32.objectId]) === undefined) {
        add(frames => {
          frames[i] = { function: fn };
          next(frames);
        });
      } else {
        const id = localScope.object.objectId;
        add(frames =>
          _optionalChain([this, 'access', _33 => _33._session, 'optionalAccess', _34 => _34.getLocalVariables, 'call', _35 => _35(id, vars => {
            frames[i] = { function: fn, vars };
            next(frames);
          })]),
        );
      }
    }

    next([]);
  }

  /**
   * Adds local variables event stack frames.
   */
   _addLocalVariables(event) {
    for (const exception of _optionalChain([event, 'optionalAccess', _36 => _36.exception, 'optionalAccess', _37 => _37.values]) || []) {
      this._addLocalVariablesToException(exception);
    }

    return event;
  }

  /**
   * Adds local variables to the exception stack frames.
   */
   _addLocalVariablesToException(exception) {
    const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _38 => _38.stacktrace, 'optionalAccess', _39 => _39.frames]));

    if (hash === undefined) {
      return;
    }

    // Check if we have local variables for an exception that matches the hash
    // delete is identical to get but also removes the entry from the cache
    const cachedFrames = this._cachedFrames.delete(hash);

    if (cachedFrames === undefined) {
      return;
    }

    const frameCount = _optionalChain([exception, 'access', _40 => _40.stacktrace, 'optionalAccess', _41 => _41.frames, 'optionalAccess', _42 => _42.length]) || 0;

    for (let i = 0; i < frameCount; i++) {
      // Sentry frames are in reverse order
      const frameIndex = frameCount - i - 1;

      // Drop out if we run out of frames to match up
      if (!_optionalChain([exception, 'optionalAccess', _43 => _43.stacktrace, 'optionalAccess', _44 => _44.frames, 'optionalAccess', _45 => _45[frameIndex]]) || !cachedFrames[i]) {
        break;
      }

      if (
        // We need to have vars to add
        cachedFrames[i].vars === undefined ||
        // We're not interested in frames that are not in_app because the vars are not relevant
        exception.stacktrace.frames[frameIndex].in_app === false ||
        // The function names need to match
        !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i].function)
      ) {
        continue;
      }

      exception.stacktrace.frames[frameIndex].vars = cachedFrames[i].vars;
    }
  }
}LocalVariables.__initStatic();

exports.LocalVariables = LocalVariables;
exports.createCallbackList = createCallbackList;
//# sourceMappingURL=localvariables.js.map
{"version":3,"file":"localvariables.js","sources":["../../../src/integrations/localvariables.ts"],"sourcesContent":["import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame, StackParser } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport type { Debugger, InspectorNotification, Runtime, Session } from 'inspector';\nimport { LRUMap } from 'lru_map';\n\nimport { NODE_VERSION } from '../nodeVersion';\nimport type { NodeClientOptions } from '../types';\n\ntype Variables = Record<string, unknown>;\ntype OnPauseEvent = InspectorNotification<Debugger.PausedEventDataType>;\nexport interface DebugSession {\n  /** Configures and connects to the debug session */\n  configureAndConnect(onPause: (message: OnPauseEvent, complete: () => void) => void, captureAll: boolean): void;\n  /** Gets local variables for an objectId */\n  getLocalVariables(objectId: string, callback: (vars: Variables) => void): void;\n}\n\ntype Next<T> = (result: T) => void;\ntype Add<T> = (fn: Next<T>) => void;\ntype CallbackWrapper<T> = { add: Add<T>; next: Next<T> };\n\n/** Creates a container for callbacks to be called sequentially */\nexport function createCallbackList<T>(complete: Next<T>): CallbackWrapper<T> {\n  // A collection of callbacks to be executed last to first\n  let callbacks: Next<T>[] = [];\n\n  let completedCalled = false;\n  function checkedComplete(result: T): void {\n    callbacks = [];\n    if (completedCalled) {\n      return;\n    }\n    completedCalled = true;\n    complete(result);\n  }\n\n  // complete should be called last\n  callbacks.push(checkedComplete);\n\n  function add(fn: Next<T>): void {\n    callbacks.push(fn);\n  }\n\n  function next(result: T): void {\n    const popped = callbacks.pop() || checkedComplete;\n\n    try {\n      popped(result);\n    } catch (_) {\n      // If there is an error, we still want to call the complete callback\n      checkedComplete(result);\n    }\n  }\n\n  return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession implements DebugSession {\n  private readonly _session: Session;\n\n  /** Throws if inspector API is not available */\n  public constructor() {\n    /*\n    TODO: We really should get rid of this require statement below for a couple of reasons:\n    1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n       in SvelteKit server code (at least not by default).\n    2. Throwing in a constructor is bad practice\n\n    More context for a future attempt to fix this:\n    We already tried replacing it with import but didn't get it to work because of async problems.\n    We still called import in the constructor but assigned to a promise which we \"awaited\" in\n    `configureAndConnect`. However, this broke the Node integration tests as no local variables\n    were reported any more. We probably missed a place where we need to await the promise, too.\n    */\n\n    // Node can be built without inspector support so this can throw\n    // eslint-disable-next-line @typescript-eslint/no-var-requires\n    const { Session } = require('inspector');\n    this._session = new Session();\n  }\n\n  /** @inheritdoc */\n  public configureAndConnect(onPause: (event: OnPauseEvent, complete: () => void) => void, captureAll: boolean): void {\n    this._session.connect();\n\n    this._session.on('Debugger.paused', event => {\n      onPause(event, () => {\n        // After the pause work is complete, resume execution or the exception context memory is leaked\n        this._session.post('Debugger.resume');\n      });\n    });\n\n    this._session.post('Debugger.enable');\n    this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n  }\n\n  /** @inheritdoc */\n  public getLocalVariables(objectId: string, complete: (vars: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      const { add, next } = createCallbackList<Variables>(complete);\n\n      for (const prop of props) {\n        if (prop?.value?.objectId && prop?.value.className === 'Array') {\n          const id = prop.value.objectId;\n          add(vars => this._unrollArray(id, prop.name, vars, next));\n        } else if (prop?.value?.objectId && prop?.value?.className === 'Object') {\n          const id = prop.value.objectId;\n          add(vars => this._unrollObject(id, prop.name, vars, next));\n        } else if (prop?.value?.value || prop?.value?.description) {\n          add(vars => this._unrollOther(prop, vars, next));\n        }\n      }\n\n      next({});\n    });\n  }\n\n  /**\n   * Gets all the PropertyDescriptors of an object\n   */\n  private _getProperties(objectId: string, next: (result: Runtime.PropertyDescriptor[]) => void): void {\n    this._session.post(\n      'Runtime.getProperties',\n      {\n        objectId,\n        ownProperties: true,\n      },\n      (err, params) => {\n        if (err) {\n          next([]);\n        } else {\n          next(params.result);\n        }\n      },\n    );\n  }\n\n  /**\n   * Unrolls an array property\n   */\n  private _unrollArray(objectId: string, name: string, vars: Variables, next: (vars: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      vars[name] = props\n        .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n        .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n        .map(v => v?.value?.value);\n\n      next(vars);\n    });\n  }\n\n  /**\n   * Unrolls an object property\n   */\n  private _unrollObject(objectId: string, name: string, vars: Variables, next: (obj: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      vars[name] = props\n        .map<[string, unknown]>(v => [v.name, v?.value?.value])\n        .reduce((obj, [key, val]) => {\n          obj[key] = val;\n          return obj;\n        }, {} as Variables);\n\n      next(vars);\n    });\n  }\n\n  /**\n   * Unrolls other properties\n   */\n  private _unrollOther(prop: Runtime.PropertyDescriptor, vars: Variables, next: (vars: Variables) => void): void {\n    if (prop?.value?.value) {\n      vars[prop.name] = prop.value.value;\n    } else if (prop?.value?.description && prop?.value?.type !== 'function') {\n      vars[prop.name] = `<${prop.value.description}>`;\n    }\n\n    next(vars);\n  }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession(): AsyncSession | undefined {\n  try {\n    return new AsyncSession();\n  } catch (e) {\n    return undefined;\n  }\n}\n\n// Add types for the exception event data\ntype PausedExceptionEvent = Debugger.PausedEventDataType & {\n  data: {\n    // This contains error.stack\n    description: string;\n  };\n};\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name: string | undefined): boolean {\n  return name !== undefined && ['', '?', '<anonymous>'].includes(name);\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a: string | undefined, b: string | undefined): boolean {\n  return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames: StackFrame[] | undefined): string | undefined {\n  if (frames === undefined) {\n    return;\n  }\n\n  // Only hash the 10 most recent frames (ie. the last 10)\n  return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser: StackParser, stack: string | undefined): string | undefined {\n  if (stack === undefined) {\n    return undefined;\n  }\n\n  return hashFrames(stackParser(stack, 1));\n}\n\nexport interface FrameVariables {\n  function: string;\n  vars?: Variables;\n}\n\n/** There are no options yet. This allows them to be added later without breaking changes */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Options {\n  /**\n   * Capture local variables for both handled and unhandled exceptions\n   *\n   * Default: false - Only captures local variables for uncaught exceptions\n   */\n  captureAllExceptions?: boolean;\n}\n\n/**\n * Adds local variables to exception frames\n */\nexport class LocalVariables implements Integration {\n  public static id: string = 'LocalVariables';\n\n  public readonly name: string = LocalVariables.id;\n\n  private readonly _cachedFrames: LRUMap<string, FrameVariables[]> = new LRUMap(20);\n\n  public constructor(\n    private readonly _options: Options = {},\n    private readonly _session: DebugSession | undefined = tryNewAsyncSession(),\n  ) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this._setup(addGlobalEventProcessor, getCurrentHub().getClient()?.getOptions());\n  }\n\n  /** Setup in a way that's easier to call from tests */\n  private _setup(\n    addGlobalEventProcessor: (callback: EventProcessor) => void,\n    clientOptions: NodeClientOptions | undefined,\n  ): void {\n    if (this._session && clientOptions?.includeLocalVariables) {\n      // Only setup this integration if the Node version is >= v18\n      // https://github.com/getsentry/sentry-javascript/issues/7697\n      const unsupportedNodeVersion = (NODE_VERSION.major || 0) < 18;\n\n      if (unsupportedNodeVersion) {\n        logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n        return;\n      }\n\n      this._session.configureAndConnect(\n        (ev, complete) =>\n          this._handlePaused(clientOptions.stackParser, ev as InspectorNotification<PausedExceptionEvent>, complete),\n        !!this._options.captureAllExceptions,\n      );\n\n      addGlobalEventProcessor(async event => this._addLocalVariables(event));\n    }\n  }\n\n  /**\n   * Handle the pause event\n   */\n  private _handlePaused(\n    stackParser: StackParser,\n    { params: { reason, data, callFrames } }: InspectorNotification<PausedExceptionEvent>,\n    complete: () => void,\n  ): void {\n    if (reason !== 'exception' && reason !== 'promiseRejection') {\n      complete();\n      return;\n    }\n\n    // data.description contains the original error.stack\n    const exceptionHash = hashFromStack(stackParser, data?.description);\n\n    if (exceptionHash == undefined) {\n      complete();\n      return;\n    }\n\n    const { add, next } = createCallbackList<FrameVariables[]>(frames => {\n      this._cachedFrames.set(exceptionHash, frames);\n      complete();\n    });\n\n    // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n    // For this reason we only attempt to get local variables for the first 5 frames\n    for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n      const { scopeChain, functionName, this: obj } = callFrames[i];\n\n      const localScope = scopeChain.find(scope => scope.type === 'local');\n\n      // obj.className is undefined in ESM modules\n      const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n      if (localScope?.object.objectId === undefined) {\n        add(frames => {\n          frames[i] = { function: fn };\n          next(frames);\n        });\n      } else {\n        const id = localScope.object.objectId;\n        add(frames =>\n          this._session?.getLocalVariables(id, vars => {\n            frames[i] = { function: fn, vars };\n            next(frames);\n          }),\n        );\n      }\n    }\n\n    next([]);\n  }\n\n  /**\n   * Adds local variables event stack frames.\n   */\n  private _addLocalVariables(event: Event): Event {\n    for (const exception of event?.exception?.values || []) {\n      this._addLocalVariablesToException(exception);\n    }\n\n    return event;\n  }\n\n  /**\n   * Adds local variables to the exception stack frames.\n   */\n  private _addLocalVariablesToException(exception: Exception): void {\n    const hash = hashFrames(exception?.stacktrace?.frames);\n\n    if (hash === undefined) {\n      return;\n    }\n\n    // Check if we have local variables for an exception that matches the hash\n    // delete is identical to get but also removes the entry from the cache\n    const cachedFrames = this._cachedFrames.delete(hash);\n\n    if (cachedFrames === undefined) {\n      return;\n    }\n\n    const frameCount = exception.stacktrace?.frames?.length || 0;\n\n    for (let i = 0; i < frameCount; i++) {\n      // Sentry frames are in reverse order\n      const frameIndex = frameCount - i - 1;\n\n      // Drop out if we run out of frames to match up\n      if (!exception?.stacktrace?.frames?.[frameIndex] || !cachedFrames[i]) {\n        break;\n      }\n\n      if (\n        // We need to have vars to add\n        cachedFrames[i].vars === undefined ||\n        // We're not interested in frames that are not in_app because the vars are not relevant\n        exception.stacktrace.frames[frameIndex].in_app === false ||\n        // The function names need to match\n        !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i].function)\n      ) {\n        continue;\n      }\n\n      exception.stacktrace.frames[frameIndex].vars = cachedFrames[i].vars;\n    }\n  }\n}\n"],"names":["LRUMap","NODE_VERSION","logger"],"mappings":";;;;;;;;;;AAqBA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA;MACA,EAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA;;MAEA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA;IACA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const fs = require('fs');
const path = require('path');

let moduleCache;

/** Extract information about paths */
function getPaths() {
  try {
    return require.cache ? Object.keys(require.cache ) : [];
  } catch (e) {
    return [];
  }
}

/** Extract information about package.json modules */
function collectModules()

 {
  const mainPaths = (require.main && require.main.paths) || [];
  const paths = getPaths();
  const infos

 = {};
  const seen

 = {};

  paths.forEach(path$1 => {
    let dir = path$1;

    /** Traverse directories upward in the search of package.json file */
    const updir = () => {
      const orig = dir;
      dir = path.dirname(orig);

      if (!dir || orig === dir || seen[orig]) {
        return undefined;
      }
      if (mainPaths.indexOf(dir) < 0) {
        return updir();
      }

      const pkgfile = path.join(orig, 'package.json');
      seen[orig] = true;

      if (!fs.existsSync(pkgfile)) {
        return updir();
      }

      try {
        const info = JSON.parse(fs.readFileSync(pkgfile, 'utf8'))

;
        infos[info.name] = info.version;
      } catch (_oO) {
        // no-empty
      }
    };

    updir();
  });

  return infos;
}

/** Add node modules / packages to the event */
class Modules  {constructor() { Modules.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Modules';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Modules.id;}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    addGlobalEventProcessor(event => {
      if (!getCurrentHub().getIntegration(Modules)) {
        return event;
      }
      return {
        ...event,
        modules: {
          ...event.modules,
          ...this._getModules(),
        },
      };
    });
  }

  /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
   _getModules() {
    if (!moduleCache) {
      moduleCache = collectModules();
    }
    return moduleCache;
  }
} Modules.__initStatic();

exports.Modules = Modules;
//# sourceMappingURL=modules.js.map
{"version":3,"file":"modules.js","sources":["../../../src/integrations/modules.ts"],"sourcesContent":["import type { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\n\nlet moduleCache: { [key: string]: string };\n\n/** Extract information about paths */\nfunction getPaths(): string[] {\n  try {\n    return require.cache ? Object.keys(require.cache as Record<string, unknown>) : [];\n  } catch (e) {\n    return [];\n  }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules(): {\n  [name: string]: string;\n} {\n  const mainPaths = (require.main && require.main.paths) || [];\n  const paths = getPaths();\n  const infos: {\n    [name: string]: string;\n  } = {};\n  const seen: {\n    [path: string]: boolean;\n  } = {};\n\n  paths.forEach(path => {\n    let dir = path;\n\n    /** Traverse directories upward in the search of package.json file */\n    const updir = (): void | (() => void) => {\n      const orig = dir;\n      dir = dirname(orig);\n\n      if (!dir || orig === dir || seen[orig]) {\n        return undefined;\n      }\n      if (mainPaths.indexOf(dir) < 0) {\n        return updir();\n      }\n\n      const pkgfile = join(orig, 'package.json');\n      seen[orig] = true;\n\n      if (!existsSync(pkgfile)) {\n        return updir();\n      }\n\n      try {\n        const info = JSON.parse(readFileSync(pkgfile, 'utf8')) as {\n          name: string;\n          version: string;\n        };\n        infos[info.name] = info.version;\n      } catch (_oO) {\n        // no-empty\n      }\n    };\n\n    updir();\n  });\n\n  return infos;\n}\n\n/** Add node modules / packages to the event */\nexport class Modules implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Modules';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Modules.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor(event => {\n      if (!getCurrentHub().getIntegration(Modules)) {\n        return event;\n      }\n      return {\n        ...event,\n        modules: {\n          ...event.modules,\n          ...this._getModules(),\n        },\n      };\n    });\n  }\n\n  /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\n  private _getModules(): { [key: string]: string } {\n    if (!moduleCache) {\n      moduleCache = collectModules();\n    }\n    return moduleCache;\n  }\n}\n"],"names":["path","dirname","join","existsSync","readFileSync"],"mappings":";;;;;AAIA,IAAA,WAAA,CAAA;AACA;AACA;AACA,SAAA,QAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,OAAA,CAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,EAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,cAAA;AACA;AACA,CAAA;AACA,EAAA,MAAA,SAAA,GAAA,CAAA,OAAA,CAAA,IAAA,IAAA,OAAA,CAAA,IAAA,CAAA,KAAA,KAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,QAAA,EAAA,CAAA;AACA,EAAA,MAAA,KAAA;AACA;AACA,GAAA,EAAA,CAAA;AACA,EAAA,MA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CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,OAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA,aAAA,EAAA;AACA,IAAA,uBAAA,CAAA,KAAA,IAAA;AACA,MAAA,IAAA,CAAA,aAAA,EAAA,CAAA,cAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA;AACA,QAAA,GAAA,KAAA;AACA,QAAA,OAAA,EAAA;AACA,UAAA,GAAA,KAAA,CAAA,OAAA;AACA,UAAA,GAAA,IAAA,CAAA,WAAA,EAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,GAAA,WAAA,GAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA;AACA,MAAA,WAAA,GAAA,cAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,OAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const errorhandling = require('./utils/errorhandling.js');

/** Global Exception handler */
class OnUncaughtException  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'OnUncaughtException';}

  /**
   * @inheritDoc
   */
   __init() {this.name = OnUncaughtException.id;}

  /**
   * @inheritDoc
   */
    __init2() {this.handler = this._makeErrorHandler();}

  // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`

  /**
   * @inheritDoc
   */
   constructor(options = {}) {OnUncaughtException.prototype.__init.call(this);OnUncaughtException.prototype.__init2.call(this);
    this._options = {
      exitEvenIfOtherHandlersAreRegistered: true,
      ...options,
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    global.process.on('uncaughtException', this.handler);
  }

  /**
   * @hidden
   */
   _makeErrorHandler() {
    const timeout = 2000;
    let caughtFirstError = false;
    let caughtSecondError = false;
    let calledFatalError = false;
    let firstError;

    return (error) => {
      let onFatalError = errorhandling.logAndExitProcess;
      const client = core.getCurrentHub().getClient();

      if (this._options.onFatalError) {
        onFatalError = this._options.onFatalError;
      } else if (client && client.getOptions().onFatalError) {
        onFatalError = client.getOptions().onFatalError ;
      }

      // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not
      // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust
      // exit behaviour of the SDK accordingly:
      // - If other listeners are attached, do not exit.
      // - If the only listener attached is ours, exit.
      const userProvidedListenersCount = (
        global.process.listeners('uncaughtException')
      ).reduce((acc, listener) => {
        if (
          // There are 3 listeners we ignore:
          listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself
          (listener.tag && listener.tag === 'sentry_tracingErrorCallback') || // the handler we register for tracing
          listener === this.handler // the handler we register in this integration
        ) {
          return acc;
        } else {
          return acc + 1;
        }
      }, 0);

      const processWouldExit = userProvidedListenersCount === 0;
      const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;

      if (!caughtFirstError) {
        const hub = core.getCurrentHub();

        // this is the first uncaught error and the ultimate reason for shutting down
        // we want to do absolutely everything possible to ensure it gets captured
        // also we want to make sure we don't go recursion crazy if more errors happen after this one
        firstError = error;
        caughtFirstError = true;

        if (hub.getIntegration(OnUncaughtException)) {
          hub.withScope((scope) => {
            scope.setLevel('fatal');
            hub.captureException(error, {
              originalException: error,
              data: { mechanism: { handled: false, type: 'onuncaughtexception' } },
            });
            if (!calledFatalError && shouldApplyFatalHandlingLogic) {
              calledFatalError = true;
              onFatalError(error);
            }
          });
        } else {
          if (!calledFatalError && shouldApplyFatalHandlingLogic) {
            calledFatalError = true;
            onFatalError(error);
          }
        }
      } else {
        if (shouldApplyFatalHandlingLogic) {
          if (calledFatalError) {
            // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              utils.logger.warn(
                'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',
              );
            errorhandling.logAndExitProcess(error);
          } else if (!caughtSecondError) {
            // two cases for how we can hit this branch:
            //   - capturing of first error blew up and we just caught the exception from that
            //     - quit trying to capture, proceed with shutdown
            //   - a second independent error happened while waiting for first error to capture
            //     - want to avoid causing premature shutdown before first error capture finishes
            // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff
            // so let's instead just delay a bit before we proceed with our action here
            // in case 1, we just wait a bit unnecessarily but ultimately do the same thing
            // in case 2, the delay hopefully made us wait long enough for the capture to finish
            // two potential nonideal outcomes:
            //   nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError
            //   nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error
            // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)
            //   we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish
            caughtSecondError = true;
            setTimeout(() => {
              if (!calledFatalError) {
                // it was probably case 1, let's treat err as the sendErr and call onFatalError
                calledFatalError = true;
                onFatalError(firstError, error);
              }
            }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc
          }
        }
      }
    };
  }
} OnUncaughtException.__initStatic();

exports.OnUncaughtException = OnUncaughtException;
//# sourceMappingURL=onuncaughtexception.js.map
{"version":3,"file":"onuncaughtexception.js","sources":["../../../src/integrations/onuncaughtexception.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { NodeClient } from '../client';\nimport { logAndExitProcess } from './utils/errorhandling';\n\ntype OnFatalErrorHandler = (firstError: Error, secondError?: Error) => void;\n\ntype TaggedListener = NodeJS.UncaughtExceptionListener & {\n  tag?: string;\n};\n\n// CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`\ninterface OnUncaughtExceptionOptions {\n  // TODO(v8): Evaluate whether we should switch the default behaviour here.\n  // Also, we can evaluate using https://nodejs.org/api/process.html#event-uncaughtexceptionmonitor per default, and\n  // falling back to current behaviour when that's not available.\n  /**\n   * Controls if the SDK should register a handler to exit the process on uncaught errors:\n   * - `true`: The SDK will exit the process on all uncaught errors.\n   * - `false`: The SDK will only exit the process when there are no other `uncaughtException` handlers attached.\n   *\n   * Default: `true`\n   */\n  exitEvenIfOtherHandlersAreRegistered: boolean;\n\n  /**\n   * This is called when an uncaught error would cause the process to exit.\n   *\n   * @param firstError Uncaught error causing the process to exit\n   * @param secondError Will be set if the handler was called multiple times. This can happen either because\n   * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`\n   * was running.\n   */\n  onFatalError?(this: void, firstError: Error, secondError?: Error): void;\n}\n\n/** Global Exception handler */\nexport class OnUncaughtException implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'OnUncaughtException';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = OnUncaughtException.id;\n\n  /**\n   * @inheritDoc\n   */\n  public readonly handler: (error: Error) => void = this._makeErrorHandler();\n\n  // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`\n  private readonly _options: OnUncaughtExceptionOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: Partial<OnUncaughtExceptionOptions> = {}) {\n    this._options = {\n      exitEvenIfOtherHandlersAreRegistered: true,\n      ...options,\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    global.process.on('uncaughtException', this.handler);\n  }\n\n  /**\n   * @hidden\n   */\n  private _makeErrorHandler(): (error: Error) => void {\n    const timeout = 2000;\n    let caughtFirstError: boolean = false;\n    let caughtSecondError: boolean = false;\n    let calledFatalError: boolean = false;\n    let firstError: Error;\n\n    return (error: Error): void => {\n      let onFatalError: OnFatalErrorHandler = logAndExitProcess;\n      const client = getCurrentHub().getClient<NodeClient>();\n\n      if (this._options.onFatalError) {\n        onFatalError = this._options.onFatalError;\n      } else if (client && client.getOptions().onFatalError) {\n        onFatalError = client.getOptions().onFatalError as OnFatalErrorHandler;\n      }\n\n      // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not\n      // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust\n      // exit behaviour of the SDK accordingly:\n      // - If other listeners are attached, do not exit.\n      // - If the only listener attached is ours, exit.\n      const userProvidedListenersCount = (\n        global.process.listeners('uncaughtException') as TaggedListener[]\n      ).reduce<number>((acc, listener) => {\n        if (\n          // There are 3 listeners we ignore:\n          listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself\n          (listener.tag && listener.tag === 'sentry_tracingErrorCallback') || // the handler we register for tracing\n          listener === this.handler // the handler we register in this integration\n        ) {\n          return acc;\n        } else {\n          return acc + 1;\n        }\n      }, 0);\n\n      const processWouldExit = userProvidedListenersCount === 0;\n      const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;\n\n      if (!caughtFirstError) {\n        const hub = getCurrentHub();\n\n        // this is the first uncaught error and the ultimate reason for shutting down\n        // we want to do absolutely everything possible to ensure it gets captured\n        // also we want to make sure we don't go recursion crazy if more errors happen after this one\n        firstError = error;\n        caughtFirstError = true;\n\n        if (hub.getIntegration(OnUncaughtException)) {\n          hub.withScope((scope: Scope) => {\n            scope.setLevel('fatal');\n            hub.captureException(error, {\n              originalException: error,\n              data: { mechanism: { handled: false, type: 'onuncaughtexception' } },\n            });\n            if (!calledFatalError && shouldApplyFatalHandlingLogic) {\n              calledFatalError = true;\n              onFatalError(error);\n            }\n          });\n        } else {\n          if (!calledFatalError && shouldApplyFatalHandlingLogic) {\n            calledFatalError = true;\n            onFatalError(error);\n          }\n        }\n      } else {\n        if (shouldApplyFatalHandlingLogic) {\n          if (calledFatalError) {\n            // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down\n            __DEBUG_BUILD__ &&\n              logger.warn(\n                'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',\n              );\n            logAndExitProcess(error);\n          } else if (!caughtSecondError) {\n            // two cases for how we can hit this branch:\n            //   - capturing of first error blew up and we just caught the exception from that\n            //     - quit trying to capture, proceed with shutdown\n            //   - a second independent error happened while waiting for first error to capture\n            //     - want to avoid causing premature shutdown before first error capture finishes\n            // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff\n            // so let's instead just delay a bit before we proceed with our action here\n            // in case 1, we just wait a bit unnecessarily but ultimately do the same thing\n            // in case 2, the delay hopefully made us wait long enough for the capture to finish\n            // two potential nonideal outcomes:\n            //   nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError\n            //   nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error\n            // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)\n            //   we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish\n            caughtSecondError = true;\n            setTimeout(() => {\n              if (!calledFatalError) {\n                // it was probably case 1, let's treat err as the sendErr and call onFatalError\n                calledFatalError = true;\n                onFatalError(firstError, error);\n              } else {\n                // it was probably case 2, our first error finished capturing while we waited, cool, do nothing\n              }\n            }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc\n          }\n        }\n      }\n    };\n  }\n}\n"],"names":["logAndExitProcess","getCurrentHub","logger"],"mappings":";;;;;;AAuCA;AACA,MAAA,mBAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OA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,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,qBAAA,EAAA,EAAA;AACA,aAAA,CAAA,CAAA;AACA,YAAA,IAAA,CAAA,gBAAA,IAAA,6BAAA,EAAA;AACA,cAAA,gBAAA,GAAA,IAAA,CAAA;AACA,cAAA,YAAA,CAAA,KAAA,CAAA,CAAA;AACA,aAAA;AACA,WAAA,CAAA,CAAA;AACA,SAAA,MAAA;AACA,UAAA,IAAA,CAAA,gBAAA,IAAA,6BAAA,EAAA;AACA,YAAA,gBAAA,GAAA,IAAA,CAAA;AACA,YAAA,YAAA,CAAA,KAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA,MAAA;AACA,QAAA,IAAA,6BAAA,EAAA;AACA,UAAA,IAAA,gBAAA,EAAA;AACA;AACA,YAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,cAAAC,YAAA,CAAA,IAAA;AACA,gBAAA,gGAAA;AACA,eAAA,CAAA;AACA,YAAAF,+BAAA,CAAA,KAAA,CAAA,CAAA;AACA,WAAA,MAAA,IAAA,CAAA,iBAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAA,iBAAA,GAAA,IAAA,CAAA;AACA,YAAA,UAAA,CAAA,MAAA;AACA,cAAA,IAAA,CAAA,gBAAA,EAAA;AACA;AACA,gBAAA,gBAAA,GAAA,IAAA,CAAA;AACA,gBAAA,YAAA,CAAA,UAAA,EAAA,KAAA,CAAA,CAAA;AACA,eAEA;AACA,aAAA,EAAA,OAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,mBAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const errorhandling = require('./utils/errorhandling.js');

/** Global Promise Rejection handler */
class OnUnhandledRejection  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'OnUnhandledRejection';}

  /**
   * @inheritDoc
   */
   __init() {this.name = OnUnhandledRejection.id;}

  /**
   * @inheritDoc
   */
   constructor(
      _options

 = { mode: 'warn' },
  ) {this._options = _options;OnUnhandledRejection.prototype.__init.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce() {
    global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this));
  }

  /**
   * Send an exception with reason
   * @param reason string
   * @param promise promise
   */
   sendUnhandledPromise(reason, promise) {
    const hub = core.getCurrentHub();
    if (hub.getIntegration(OnUnhandledRejection)) {
      hub.withScope((scope) => {
        scope.setExtra('unhandledPromiseRejection', true);
        hub.captureException(reason, {
          originalException: promise,
          data: { mechanism: { handled: false, type: 'onunhandledrejection' } },
        });
      });
    }
    this._handleRejection(reason);
  }

  /**
   * Handler for `mode` option
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   _handleRejection(reason) {
    // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240
    const rejectionWarning =
      'This error originated either by ' +
      'throwing inside of an async function without a catch block, ' +
      'or by rejecting a promise which was not handled with .catch().' +
      ' The promise rejected with the reason:';

    /* eslint-disable no-console */
    if (this._options.mode === 'warn') {
      utils.consoleSandbox(() => {
        console.warn(rejectionWarning);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        console.error(reason && reason.stack ? reason.stack : reason);
      });
    } else if (this._options.mode === 'strict') {
      utils.consoleSandbox(() => {
        console.warn(rejectionWarning);
      });
      errorhandling.logAndExitProcess(reason);
    }
    /* eslint-enable no-console */
  }
} OnUnhandledRejection.__initStatic();

exports.OnUnhandledRejection = OnUnhandledRejection;
//# sourceMappingURL=onunhandledrejection.js.map
{"version":3,"file":"onunhandledrejection.js","sources":["../../../src/integrations/onunhandledrejection.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\n\nimport { logAndExitProcess } from './utils/errorhandling';\n\ntype UnhandledRejectionMode = 'none' | 'warn' | 'strict';\n\n/** Global Promise Rejection handler */\nexport class OnUnhandledRejection implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'OnUnhandledRejection';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = OnUnhandledRejection.id;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(\n    private readonly _options: {\n      /**\n       * Option deciding what to do after capturing unhandledRejection,\n       * that mimicks behavior of node's --unhandled-rejection flag.\n       */\n      mode: UnhandledRejectionMode;\n    } = { mode: 'warn' },\n  ) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this));\n  }\n\n  /**\n   * Send an exception with reason\n   * @param reason string\n   * @param promise promise\n   */\n  public sendUnhandledPromise(reason: unknown, promise: unknown): void {\n    const hub = getCurrentHub();\n    if (hub.getIntegration(OnUnhandledRejection)) {\n      hub.withScope((scope: Scope) => {\n        scope.setExtra('unhandledPromiseRejection', true);\n        hub.captureException(reason, {\n          originalException: promise,\n          data: { mechanism: { handled: false, type: 'onunhandledrejection' } },\n        });\n      });\n    }\n    this._handleRejection(reason);\n  }\n\n  /**\n   * Handler for `mode` option\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _handleRejection(reason: any): void {\n    // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240\n    const rejectionWarning =\n      'This error originated either by ' +\n      'throwing inside of an async function without a catch block, ' +\n      'or by rejecting a promise which was not handled with .catch().' +\n      ' The promise rejected with the reason:';\n\n    /* eslint-disable no-console */\n    if (this._options.mode === 'warn') {\n      consoleSandbox(() => {\n        console.warn(rejectionWarning);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        console.error(reason && reason.stack ? reason.stack : reason);\n      });\n    } else if (this._options.mode === 'strict') {\n      consoleSandbox(() => {\n        console.warn(rejectionWarning);\n      });\n      logAndExitProcess(reason);\n    }\n    /* eslint-enable no-console */\n  }\n}\n"],"names":["getCurrentHub","consoleSandbox","logAndExitProcess"],"mappings":";;;;;;AASA;AACA,MAAA,oBAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,uBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,oBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA;AACA,MAAA,QAAA;;AAMA,GAAA,EAAA,IAAA,EAAA,MAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA,oBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,MAAA,CAAA,OAAA,CAAA,EAAA,CAAA,oBAAA,EAAA,IAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,oBAAA,CAAA,MAAA,EAAA,OAAA,EAAA;AACA,IAAA,MAAA,GAAA,GAAAA,kBAAA,EAAA,CAAA;AACA,IAAA,IAAA,GAAA,CAAA,cAAA,CAAA,oBAAA,CAAA,EAAA;AACA,MAAA,GAAA,CAAA,SAAA,CAAA,CAAA,KAAA,KAAA;AACA,QAAA,KAAA,CAAA,QAAA,CAAA,2BAAA,EAAA,IAAA,CAAA,CAAA;AACA,QAAA,GAAA,CAAA,gBAAA,CAAA,MAAA,EAAA;AACA,UAAA,iBAAA,EAAA,OAAA;AACA,UAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,EAAA;AACA,SAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,IAAA,CAAA,gBAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,gBAAA,CAAA,MAAA,EAAA;AACA;AACA,IAAA,MAAA,gBAAA;AACA,MAAA,kCAAA;AACA,MAAA,8DAAA;AACA,MAAA,gEAAA;AACA,MAAA,wCAAA,CAAA;AACA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,QAAA,CAAA,IAAA,KAAA,MAAA,EAAA;AACA,MAAAC,oBAAA,CAAA,MAAA;AACA,QAAA,OAAA,CAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AACA;AACA,QAAA,OAAA,CAAA,KAAA,CAAA,MAAA,IAAA,MAAA,CAAA,KAAA,GAAA,MAAA,CAAA,KAAA,GAAA,MAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,IAAA,CAAA,QAAA,CAAA,IAAA,KAAA,QAAA,EAAA;AACA,MAAAA,oBAAA,CAAA,MAAA;AACA,QAAA,OAAA,CAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,MAAAC,+BAAA,CAAA,MAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,GAAA;AACA,CAAA,CAAA,oBAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const requestdata = require('../requestdata.js');

const DEFAULT_OPTIONS = {
  include: {
    cookies: true,
    data: true,
    headers: true,
    ip: false,
    query_string: true,
    url: true,
    user: {
      id: true,
      username: true,
      email: true,
    },
  },
  transactionNamingScheme: 'methodPath',
};

/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`
 * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */
class RequestData  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'RequestData';}

  /**
   * @inheritDoc
   */
   __init() {this.name = RequestData.id;}

  /**
   * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
   * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use
   * something similar in browser-based SDKs in the future.
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {RequestData.prototype.__init.call(this);
    this._addRequestData = requestdata.addRequestDataToEvent;
    this._options = {
      ...DEFAULT_OPTIONS,
      ...options,
      include: {
        // @ts-ignore It's mad because `method` isn't a known `include` key. (It's only here and not set by default in
        // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)
        method: true,
        ...DEFAULT_OPTIONS.include,
        ...options.include,
        user:
          options.include && typeof options.include.user === 'boolean'
            ? options.include.user
            : {
                ...DEFAULT_OPTIONS.include.user,
                // Unclear why TS still thinks `options.include.user` could be a boolean at this point
                ...((options.include || {}).user ),
              },
      },
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    // Note: In the long run, most of the logic here should probably move into the request data utility functions. For
    // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.
    // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once
    // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)
    const { transactionNamingScheme } = this._options;

    addGlobalEventProcessor(event => {
      const hub = getCurrentHub();
      const self = hub.getIntegration(RequestData);

      const { sdkProcessingMetadata = {} } = event;
      const req = sdkProcessingMetadata.request;

      // If the globally installed instance of this integration isn't associated with the current hub, `self` will be
      // undefined
      if (!self || !req) {
        return event;
      }

      // The Express request handler takes a similar `include` option to that which can be passed to this integration.
      // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this
      // integration, so that all of this passing and conversion isn't necessary
      const addRequestDataOptions =
        sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||
        sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||
        convertReqDataIntegrationOptsToAddReqDataOpts(this._options);

      const processedEvent = this._addRequestData(event, req, addRequestDataOptions);

      // Transaction events already have the right `transaction` value
      if (event.type === 'transaction' || transactionNamingScheme === 'handler') {
        return processedEvent;
      }

      // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`
      // value with a high-quality one
      const reqWithTransaction = req ;
      const transaction = reqWithTransaction._sentryTransaction;
      if (transaction) {
        // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to
        // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential
        // to break things like alert rules.)
        const shouldIncludeMethodInTransactionName =
          getSDKName(hub) === 'sentry.javascript.nextjs'
            ? transaction.name.startsWith('/api')
            : transactionNamingScheme !== 'path';

        const [transactionValue] = utils.extractPathForTransaction(req, {
          path: true,
          method: shouldIncludeMethodInTransactionName,
          customRoute: transaction.name,
        });

        processedEvent.transaction = transactionValue;
      }

      return processedEvent;
    });
  }
} RequestData.__initStatic();

/** Convert this integration's options to match what `addRequestDataToEvent` expects */
/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */
function convertReqDataIntegrationOptsToAddReqDataOpts(
  integrationOptions,
) {
  const {
    transactionNamingScheme,
    include: { ip, user, ...requestOptions },
  } = integrationOptions;

  const requestIncludeKeys = [];
  for (const [key, value] of Object.entries(requestOptions)) {
    if (value) {
      requestIncludeKeys.push(key);
    }
  }

  let addReqDataUserOpt;
  if (user === undefined) {
    addReqDataUserOpt = true;
  } else if (typeof user === 'boolean') {
    addReqDataUserOpt = user;
  } else {
    const userIncludeKeys = [];
    for (const [key, value] of Object.entries(user)) {
      if (value) {
        userIncludeKeys.push(key);
      }
    }
    addReqDataUserOpt = userIncludeKeys;
  }

  return {
    include: {
      ip,
      user: addReqDataUserOpt,
      request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,
      transaction: transactionNamingScheme,
    },
  };
}

function getSDKName(hub) {
  try {
    // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to
    // write out a long chain of `a && a.b && a.b.c && ...`
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
    return hub.getClient().getOptions()._metadata.sdk.name;
  } catch (err) {
    // In theory we should never get here
    return undefined;
  }
}

exports.RequestData = RequestData;
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../../src/integrations/requestdata.ts"],"sourcesContent":["// TODO (v8 or v9): Whenever this becomes a default integration for `@sentry/browser`, move this to `@sentry/core`. For\n// now, we leave it in `@sentry/integrations` so that it doesn't contribute bytes to our CDN bundles.\n\nimport type { Event, EventProcessor, Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types';\nimport { extractPathForTransaction } from '@sentry/utils';\n\nimport type { AddRequestDataToEventOptions, TransactionNamingScheme } from '../requestdata';\nimport { addRequestDataToEvent } from '../requestdata';\n\nexport type RequestDataIntegrationOptions = {\n  /**\n   * Controls what data is pulled from the request and added to the event\n   */\n  include?: {\n    cookies?: boolean;\n    data?: boolean;\n    headers?: boolean;\n    ip?: boolean;\n    query_string?: boolean;\n    url?: boolean;\n    user?:\n      | boolean\n      | {\n          id?: boolean;\n          username?: boolean;\n          email?: boolean;\n        };\n  };\n\n  /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */\n  transactionNamingScheme?: TransactionNamingScheme;\n};\n\nconst DEFAULT_OPTIONS = {\n  include: {\n    cookies: true,\n    data: true,\n    headers: true,\n    ip: false,\n    query_string: true,\n    url: true,\n    user: {\n      id: true,\n      username: true,\n      email: true,\n    },\n  },\n  transactionNamingScheme: 'methodPath',\n};\n\n/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */\nexport class RequestData implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'RequestData';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = RequestData.id;\n\n  /**\n   * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but\n   * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use\n   * something similar in browser-based SDKs in the future.\n   */\n  protected _addRequestData: (event: Event, req: PolymorphicRequest, options?: { [key: string]: unknown }) => Event;\n\n  private _options: Required<RequestDataIntegrationOptions>;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: RequestDataIntegrationOptions = {}) {\n    this._addRequestData = addRequestDataToEvent;\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...options,\n      include: {\n        // @ts-ignore It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n        // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n        method: true,\n        ...DEFAULT_OPTIONS.include,\n        ...options.include,\n        user:\n          options.include && typeof options.include.user === 'boolean'\n            ? options.include.user\n            : {\n                ...DEFAULT_OPTIONS.include.user,\n                // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n                ...((options.include || {}).user as Record<string, boolean>),\n              },\n      },\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (eventProcessor: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n    // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n    // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n    // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n    const { transactionNamingScheme } = this._options;\n\n    addGlobalEventProcessor(event => {\n      const hub = getCurrentHub();\n      const self = hub.getIntegration(RequestData);\n\n      const { sdkProcessingMetadata = {} } = event;\n      const req = sdkProcessingMetadata.request;\n\n      // If the globally installed instance of this integration isn't associated with the current hub, `self` will be\n      // undefined\n      if (!self || !req) {\n        return event;\n      }\n\n      // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n      // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n      // integration, so that all of this passing and conversion isn't necessary\n      const addRequestDataOptions =\n        sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n        sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n        convertReqDataIntegrationOptsToAddReqDataOpts(this._options);\n\n      const processedEvent = this._addRequestData(event, req, addRequestDataOptions);\n\n      // Transaction events already have the right `transaction` value\n      if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n        return processedEvent;\n      }\n\n      // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n      // value with a high-quality one\n      const reqWithTransaction = req as { _sentryTransaction?: Transaction };\n      const transaction = reqWithTransaction._sentryTransaction;\n      if (transaction) {\n        // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n        // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n        // to break things like alert rules.)\n        const shouldIncludeMethodInTransactionName =\n          getSDKName(hub) === 'sentry.javascript.nextjs'\n            ? transaction.name.startsWith('/api')\n            : transactionNamingScheme !== 'path';\n\n        const [transactionValue] = extractPathForTransaction(req, {\n          path: true,\n          method: shouldIncludeMethodInTransactionName,\n          customRoute: transaction.name,\n        });\n\n        processedEvent.transaction = transactionValue;\n      }\n\n      return processedEvent;\n    });\n  }\n}\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n  integrationOptions: Required<RequestDataIntegrationOptions>,\n): AddRequestDataToEventOptions {\n  const {\n    transactionNamingScheme,\n    include: { ip, user, ...requestOptions },\n  } = integrationOptions;\n\n  const requestIncludeKeys: string[] = [];\n  for (const [key, value] of Object.entries(requestOptions)) {\n    if (value) {\n      requestIncludeKeys.push(key);\n    }\n  }\n\n  let addReqDataUserOpt;\n  if (user === undefined) {\n    addReqDataUserOpt = true;\n  } else if (typeof user === 'boolean') {\n    addReqDataUserOpt = user;\n  } else {\n    const userIncludeKeys: string[] = [];\n    for (const [key, value] of Object.entries(user)) {\n      if (value) {\n        userIncludeKeys.push(key);\n      }\n    }\n    addReqDataUserOpt = userIncludeKeys;\n  }\n\n  return {\n    include: {\n      ip,\n      user: addReqDataUserOpt,\n      request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n      transaction: transactionNamingScheme,\n    },\n  };\n}\n\nfunction getSDKName(hub: Hub): string | undefined {\n  try {\n    // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n    // write out a long chain of `a && a.b && a.b.c && ...`\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    return hub.getClient()!.getOptions()!._metadata!.sdk!.name;\n  } catch (err) {\n    // In theory we should never get here\n    return undefined;\n  }\n}\n"],"names":["addRequestDataToEvent","extractPathForTransaction"],"mappings":";;;;;AAiCA,MAAA,eAAA,GAAA;AACA,EAAA,OAAA,EAAA;AACA,IAAA,OAAA,EAAA,IAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,OAAA,EAAA,IAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,YAAA,EAAA,IAAA;AACA,IAAA,GAAA,EAAA,IAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,EAAA,EAAA,IAAA;AACA,MAAA,QAAA,EAAA,IAAA;AACA,MAAA,KAAA,EAAA,IAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,uBAAA,EAAA,YAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA,MAAA,WAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,cAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,WAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAK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AAA,CAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const nodeVersion = require('../../nodeVersion.js');
const http = require('../utils/http.js');

exports.ChannelName = void 0; (function (ChannelName) {
  // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md#undicirequestcreate
  const RequestCreate = 'undici:request:create'; ChannelName["RequestCreate"] = RequestCreate;
  const RequestEnd = 'undici:request:headers'; ChannelName["RequestEnd"] = RequestEnd;
  const RequestError = 'undici:request:error'; ChannelName["RequestError"] = RequestError;
})(exports.ChannelName || (exports.ChannelName = {}));

// Please note that you cannot use `console.log` to debug the callbacks registered to the `diagnostics_channel` API.
// To debug, you can use `writeFileSync` to write to a file:
// https://nodejs.org/api/async_hooks.html#printing-in-asynchook-callbacks

/**
 * Instruments outgoing HTTP requests made with the `undici` package via
 * Node's `diagnostics_channel` API.
 *
 * Supports Undici 4.7.0 or higher.
 *
 * Requires Node 16.17.0 or higher.
 */
class Undici  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Undici';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Undici.id;}

   constructor(_options = {}) {Undici.prototype.__init.call(this);
    this._options = {
      breadcrumbs: _options.breadcrumbs === undefined ? true : _options.breadcrumbs,
      shouldCreateSpanForRequest: _options.shouldCreateSpanForRequest || (() => true),
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce(_addGlobalEventProcessor, getCurrentHub) {
    // Requires Node 16+ to use the diagnostics_channel API.
    if (nodeVersion.NODE_VERSION.major && nodeVersion.NODE_VERSION.major < 16) {
      return;
    }

    let ds;
    try {
      // eslint-disable-next-line @typescript-eslint/no-var-requires
      ds = utils.dynamicRequire(module, 'diagnostics_channel') ;
    } catch (e) {
      // no-op
    }

    if (!ds || !ds.subscribe) {
      return;
    }

    // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md
    ds.subscribe(exports.ChannelName.RequestCreate, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (http.isSentryRequest(stringUrl) || request.__sentry__ !== undefined) {
        return;
      }

      const client = hub.getClient();
      const scope = hub.getScope();

      const activeSpan = scope.getSpan();

      if (activeSpan && client) {
        const clientOptions = client.getOptions();
        const shouldCreateSpan = this._options.shouldCreateSpanForRequest(stringUrl);

        if (shouldCreateSpan) {
          const data = {};
          const params = url.searchParams.toString();
          if (params) {
            data['http.query'] = `?${params}`;
          }
          if (url.hash) {
            data['http.fragment'] = url.hash;
          }

          const span = activeSpan.startChild({
            op: 'http.client',
            description: `${request.method || 'GET'} ${utils.stripUrlQueryAndFragment(stringUrl)}`,
            data,
          });
          request.__sentry__ = span;

          const shouldPropagate = clientOptions.tracePropagationTargets
            ? utils.stringMatchesSomePattern(stringUrl, clientOptions.tracePropagationTargets)
            : true;

          if (shouldPropagate) {
            request.addHeader('sentry-trace', span.toTraceparent());
            if (span.transaction) {
              const dynamicSamplingContext = span.transaction.getDynamicSamplingContext();
              const sentryBaggageHeader = utils.dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
              if (sentryBaggageHeader) {
                request.addHeader('baggage', sentryBaggageHeader);
              }
            }
          }
        }
      }
    });

    ds.subscribe(exports.ChannelName.RequestEnd, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request, response } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (http.isSentryRequest(stringUrl)) {
        return;
      }

      const span = request.__sentry__;
      if (span) {
        span.setHttpStatus(response.statusCode);
        span.finish();
      }

      if (this._options.breadcrumbs) {
        hub.addBreadcrumb(
          {
            category: 'http',
            data: {
              method: request.method,
              status_code: response.statusCode,
              url: stringUrl,
            },
            type: 'http',
          },
          {
            event: 'response',
            request,
            response,
          },
        );
      }
    });

    ds.subscribe(exports.ChannelName.RequestError, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (http.isSentryRequest(stringUrl)) {
        return;
      }

      const span = request.__sentry__;
      if (span) {
        span.setStatus('internal_error');
        span.finish();
      }

      if (this._options.breadcrumbs) {
        hub.addBreadcrumb(
          {
            category: 'http',
            data: {
              method: request.method,
              url: stringUrl,
            },
            level: 'error',
            type: 'http',
          },
          {
            event: 'error',
            request,
          },
        );
      }
    });
  }
} Undici.__initStatic();

exports.Undici = Undici;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../../src/integrations/undici/index.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor, Integration } from '@sentry/types';\nimport {\n  dynamicRequire,\n  dynamicSamplingContextToSentryBaggageHeader,\n  stringMatchesSomePattern,\n  stripUrlQueryAndFragment,\n} from '@sentry/utils';\n\nimport type { NodeClient } from '../../client';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport { isSentryRequest } from '../utils/http';\nimport type { DiagnosticsChannel, RequestCreateMessage, RequestEndMessage, RequestErrorMessage } from './types';\n\nexport enum ChannelName {\n  // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md#undicirequestcreate\n  RequestCreate = 'undici:request:create',\n  RequestEnd = 'undici:request:headers',\n  RequestError = 'undici:request:error',\n}\n\nexport interface UndiciOptions {\n  /**\n   * Whether breadcrumbs should be recorded for requests\n   * Defaults to true\n   */\n  breadcrumbs: boolean;\n  /**\n   * Function determining whether or not to create spans to track outgoing requests to the given URL.\n   * By default, spans will be created for all outgoing requests.\n   */\n  shouldCreateSpanForRequest: (url: string) => boolean;\n}\n\n// Please note that you cannot use `console.log` to debug the callbacks registered to the `diagnostics_channel` API.\n// To debug, you can use `writeFileSync` to write to a file:\n// https://nodejs.org/api/async_hooks.html#printing-in-asynchook-callbacks\n\n/**\n * Instruments outgoing HTTP requests made with the `undici` package via\n * Node's `diagnostics_channel` API.\n *\n * Supports Undici 4.7.0 or higher.\n *\n * Requires Node 16.17.0 or higher.\n */\nexport class Undici implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Undici';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Undici.id;\n\n  private readonly _options: UndiciOptions;\n\n  public constructor(_options: Partial<UndiciOptions> = {}) {\n    this._options = {\n      breadcrumbs: _options.breadcrumbs === undefined ? true : _options.breadcrumbs,\n      shouldCreateSpanForRequest: _options.shouldCreateSpanForRequest || (() => true),\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    // Requires Node 16+ to use the diagnostics_channel API.\n    if (NODE_VERSION.major && NODE_VERSION.major < 16) {\n      return;\n    }\n\n    let ds: DiagnosticsChannel | undefined;\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-var-requires\n      ds = dynamicRequire(module, 'diagnostics_channel') as DiagnosticsChannel;\n    } catch (e) {\n      // no-op\n    }\n\n    if (!ds || !ds.subscribe) {\n      return;\n    }\n\n    // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md\n    ds.subscribe(ChannelName.RequestCreate, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request } = message as RequestCreateMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl) || request.__sentry__ !== undefined) {\n        return;\n      }\n\n      const client = hub.getClient<NodeClient>();\n      const scope = hub.getScope();\n\n      const activeSpan = scope.getSpan();\n\n      if (activeSpan && client) {\n        const clientOptions = client.getOptions();\n        const shouldCreateSpan = this._options.shouldCreateSpanForRequest(stringUrl);\n\n        if (shouldCreateSpan) {\n          const data: Record<string, unknown> = {};\n          const params = url.searchParams.toString();\n          if (params) {\n            data['http.query'] = `?${params}`;\n          }\n          if (url.hash) {\n            data['http.fragment'] = url.hash;\n          }\n\n          const span = activeSpan.startChild({\n            op: 'http.client',\n            description: `${request.method || 'GET'} ${stripUrlQueryAndFragment(stringUrl)}`,\n            data,\n          });\n          request.__sentry__ = span;\n\n          const shouldPropagate = clientOptions.tracePropagationTargets\n            ? stringMatchesSomePattern(stringUrl, clientOptions.tracePropagationTargets)\n            : true;\n\n          if (shouldPropagate) {\n            request.addHeader('sentry-trace', span.toTraceparent());\n            if (span.transaction) {\n              const dynamicSamplingContext = span.transaction.getDynamicSamplingContext();\n              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n              if (sentryBaggageHeader) {\n                request.addHeader('baggage', sentryBaggageHeader);\n              }\n            }\n          }\n        }\n      }\n    });\n\n    ds.subscribe(ChannelName.RequestEnd, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request, response } = message as RequestEndMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl)) {\n        return;\n      }\n\n      const span = request.__sentry__;\n      if (span) {\n        span.setHttpStatus(response.statusCode);\n        span.finish();\n      }\n\n      if (this._options.breadcrumbs) {\n        hub.addBreadcrumb(\n          {\n            category: 'http',\n            data: {\n              method: request.method,\n              status_code: response.statusCode,\n              url: stringUrl,\n            },\n            type: 'http',\n          },\n          {\n            event: 'response',\n            request,\n            response,\n          },\n        );\n      }\n    });\n\n    ds.subscribe(ChannelName.RequestError, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request } = message as RequestErrorMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl)) {\n        return;\n      }\n\n      const span = request.__sentry__;\n      if (span) {\n        span.setStatus('internal_error');\n        span.finish();\n      }\n\n      if (this._options.breadcrumbs) {\n        hub.addBreadcrumb(\n          {\n            category: 'http',\n            data: {\n              method: request.method,\n              url: stringUrl,\n            },\n            level: 'error',\n            type: 'http',\n          },\n          {\n            event: 'error',\n            request,\n          },\n        );\n      }\n    });\n  }\n}\n"],"names":["ChannelName","NODE_VERSION","dynamicRequire","isSentryRequest","stripUrlQueryAndFragment","stringMatchesSomePattern","dynamicSamplingContextToSentryBaggageHeader"],"mappings":";;;;;;AAcAA,6BAAA,CAAA,CAAA,UAAA,WAAA,EAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,uBAAA,CAAA,CAAA,WAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,wBAAA,CAAA,CAAA,WAAA,CAAA,YAAA,CAAA,GAAA,UAAA,CAAA;AACA,EAAA,MAAA,YAAA,GAAA,sBAAA,CAAA,CAAA,WAAA,CAAA,cAAA,CAAA,GAAA,YAAA,CAAA;AACA,CAAA,EAAAA,mBAAA,KAAAA,mBAAA,GAAA,EAAA,CAAA,CAAA,CAAA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,MAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,MAAA,CAAA,GAAA,CAAA;;AAIA,GAAA,WAAA,CAAA,QAAA,GAAA,EAAA,EAAA,CAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,WAAA,E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,MAAA;AACA,cAAA,GAAA,EAAA,SAAA;AACA,aAAA;AACA,YAAA,KAAA,EAAA,OAAA;AACA,YAAA,IAAA,EAAA,MAAA;AACA,WAAA;AACA,UAAA;AACA,YAAA,KAAA,EAAA,OAAA;AACA,YAAA,OAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,MAAA,CAAA,YAAA,EAAA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

const DEFAULT_SHUTDOWN_TIMEOUT = 2000;

/**
 * @hidden
 */
function logAndExitProcess(error) {
  // eslint-disable-next-line no-console
  console.error(error && error.stack ? error.stack : error);

  const client = core.getCurrentHub().getClient();

  if (client === undefined) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('No NodeClient was defined, we are exiting the process now.');
    global.process.exit(1);
  }

  const options = client.getOptions();
  const timeout =
    (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||
    DEFAULT_SHUTDOWN_TIMEOUT;
  client.close(timeout).then(
    (result) => {
      if (!result) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
      }
      global.process.exit(1);
    },
    error => {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(error);
    },
  );
}

exports.logAndExitProcess = logAndExitProcess;
//# sourceMappingURL=errorhandling.js.map
{"version":3,"file":"errorhandling.js","sources":["../../../../src/integrations/utils/errorhandling.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport type { NodeClient } from '../../client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: Error): void {\n  // eslint-disable-next-line no-console\n  console.error(error && error.stack ? error.stack : error);\n\n  const client = getCurrentHub().getClient<NodeClient>();\n\n  if (client === undefined) {\n    __DEBUG_BUILD__ && logger.warn('No NodeClient was defined, we are exiting the process now.');\n    global.process.exit(1);\n  }\n\n  const options = client.getOptions();\n  const timeout =\n    (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||\n    DEFAULT_SHUTDOWN_TIMEOUT;\n  client.close(timeout).then(\n    (result: boolean) => {\n      if (!result) {\n        __DEBUG_BUILD__ && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n      }\n      global.process.exit(1);\n    },\n    error => {\n      __DEBUG_BUILD__ && logger.error(error);\n    },\n  );\n}\n"],"names":["getCurrentHub","logger"],"mappings":";;;;;AAKA,MAAA,wBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,KAAA,EAAA;AACA;AACA,EAAA,OAAA,CAAA,KAAA,CAAA,KAAA,IAAA,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAAA,kBAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,KAAA,SAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAC,YAAA,CAAA,IAAA,CAAA,4DAAA,CAAA,CAAA;AACA,IAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,CAAA,UAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA;AACA,IAAA,CAAA,OAAA,IAAA,OAAA,CAAA,eAAA,IAAA,OAAA,CAAA,eAAA,GAAA,CAAA,IAAA,OAAA,CAAA,eAAA;AACA,IAAA,wBAAA,CAAA;AACA,EAAA,MAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,IAAA;AACA,IAAA,CAAA,MAAA,KAAA;AACA,MAAA,IAAA,CAAA,MAAA,EAAA;AACA,QAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAA,YAAA,CAAA,IAAA,CAAA,4EAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,KAAA,IAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAAA,YAAA,CAAA,KAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const url = require('url');
const nodeVersion = require('../../nodeVersion.js');

/**
 * Checks whether given url points to Sentry server
 * @param url url to verify
 */
function isSentryRequest(url) {
  const dsn = _optionalChain([core.getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getDsn, 'call', _5 => _5()]);
  return dsn ? url.includes(dsn.host) : false;
}

/**
 * Assembles a URL that's passed to the users to filter on.
 * It can include raw (potentially PII containing) data, which we'll allow users to access to filter
 * but won't include in spans or breadcrumbs.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
// TODO (v8): This function should include auth, query and fragment (it's breaking, so we need to wait for v8)
function extractRawUrl(requestOptions) {
  const protocol = requestOptions.protocol || '';
  const hostname = requestOptions.hostname || requestOptions.host || '';
  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise
  const port =
    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;
  const path = requestOptions.path ? requestOptions.path : '/';
  return `${protocol}//${hostname}${port}${path}`;
}

/**
 * Assemble a URL to be used for breadcrumbs and spans.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
function extractUrl(requestOptions) {
  const protocol = requestOptions.protocol || '';
  const hostname = requestOptions.hostname || requestOptions.host || '';
  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise
  const port =
    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;
  // do not include search or hash in span descriptions, per https://develop.sentry.dev/sdk/data-handling/#structuring-data
  const path = requestOptions.pathname || '/';
  // always filter authority, see https://develop.sentry.dev/sdk/data-handling/#structuring-data
  const authority = requestOptions.auth ? redactAuthority(requestOptions.auth) : '';

  return `${protocol}//${authority}${hostname}${port}${path}`;
}

function redactAuthority(auth) {
  const [user, password] = auth.split(':');
  return `${user ? '[Filtered]' : ''}:${password ? '[Filtered]' : ''}@`;
}

/**
 * Handle various edge cases in the span description (for spans representing http(s) requests).
 *
 * @param description current `description` property of the span representing the request
 * @param requestOptions Configuration data for the request
 * @param Request Request object
 *
 * @returns The cleaned description
 */
function cleanSpanDescription(
  description,
  requestOptions,
  request,
) {
  // nothing to clean
  if (!description) {
    return description;
  }

  // eslint-disable-next-line prefer-const
  let [method, requestUrl] = description.split(' ');

  // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing,
  // we're likely dealing with an internal route and this doesn't apply)
  if (requestOptions.host && !requestOptions.protocol) {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
    requestOptions.protocol = _optionalChain([(request ), 'optionalAccess', _6 => _6.agent, 'optionalAccess', _7 => _7.protocol]); // worst comes to worst, this is undefined and nothing changes
    // This URL contains the filtered authority ([filtered]:[filtered]@example.com) but no fragment or query params
    requestUrl = extractUrl(requestOptions);
  }

  // internal routes can end up starting with a triple slash rather than a single one
  if (_optionalChain([requestUrl, 'optionalAccess', _8 => _8.startsWith, 'call', _9 => _9('///')])) {
    requestUrl = requestUrl.slice(2);
  }

  return `${method} ${requestUrl}`;
}

// the node types are missing a few properties which node's `urlToOptions` function spits out

/**
 * Convert a URL object into a RequestOptions object.
 *
 * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the
 * RequestOptions type above.
 *
 * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.
 */
function urlToOptions(url) {
  const options = {
    protocol: url.protocol,
    hostname:
      typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
    hash: url.hash,
    search: url.search,
    pathname: url.pathname,
    path: `${url.pathname || ''}${url.search || ''}`,
    href: url.href,
  };
  if (url.port !== '') {
    options.port = Number(url.port);
  }
  if (url.username || url.password) {
    options.auth = `${url.username}:${url.password}`;
  }
  return options;
}

/**
 * Normalize inputs to `http(s).request()` and `http(s).get()`.
 *
 * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:
 *     [ RequestOptions | string | URL ],
 *     [ RequestOptions | string | URL, RequestCallback ],
 *     [ string | URL, RequestOptions ], and
 *     [ string | URL, RequestOptions, RequestCallback ].
 *
 * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is
 * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact
 * with the args in a standard way.
 *
 * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.
 *
 * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].
 */
function normalizeRequestArgs(
  httpModule,
  requestArgs,
) {
  let callback, requestOptions;

  // pop off the callback, if there is one
  if (typeof requestArgs[requestArgs.length - 1] === 'function') {
    callback = requestArgs.pop() ;
  }

  // create a RequestOptions object of whatever's at index 0
  if (typeof requestArgs[0] === 'string') {
    requestOptions = urlToOptions(new url.URL(requestArgs[0]));
  } else if (requestArgs[0] instanceof url.URL) {
    requestOptions = urlToOptions(requestArgs[0]);
  } else {
    requestOptions = requestArgs[0];
  }

  // if the options were given separately from the URL, fold them in
  if (requestArgs.length === 2) {
    requestOptions = { ...requestOptions, ...requestArgs[1] };
  }

  // Figure out the protocol if it's currently missing
  if (requestOptions.protocol === undefined) {
    // Worst case we end up populating protocol with undefined, which it already is
    /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */

    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
    // Because of that, we cannot rely on `httpModule` to provide us with valid protocol,
    // as it will always return `http`, even when using `https` module.
    //
    // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.
    if (nodeVersion.NODE_VERSION.major && nodeVersion.NODE_VERSION.major > 8) {
      requestOptions.protocol =
        _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _10 => _10.globalAgent]) ), 'optionalAccess', _11 => _11.protocol]) ||
        _optionalChain([(requestOptions.agent ), 'optionalAccess', _12 => _12.protocol]) ||
        _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _13 => _13.protocol]);
    } else {
      requestOptions.protocol =
        _optionalChain([(requestOptions.agent ), 'optionalAccess', _14 => _14.protocol]) ||
        _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _15 => _15.protocol]) ||
        _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _16 => _16.globalAgent]) ), 'optionalAccess', _17 => _17.protocol]);
    }
    /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */
  }

  // return args in standardized form
  if (callback) {
    return [requestOptions, callback];
  } else {
    return [requestOptions];
  }
}

exports.cleanSpanDescription = cleanSpanDescription;
exports.extractRawUrl = extractRawUrl;
exports.extractUrl = extractUrl;
exports.isSentryRequest = isSentryRequest;
exports.normalizeRequestArgs = normalizeRequestArgs;
exports.urlToOptions = urlToOptions;
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../../src/integrations/utils/http.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport { URL } from 'url';\n\nimport { NODE_VERSION } from '../../nodeVersion';\n\n/**\n * Checks whether given url points to Sentry server\n * @param url url to verify\n */\nexport function isSentryRequest(url: string): boolean {\n  const dsn = getCurrentHub().getClient()?.getDsn();\n  return dsn ? url.includes(dsn.host) : false;\n}\n\n/**\n * Assembles a URL that's passed to the users to filter on.\n * It can include raw (potentially PII containing) data, which we'll allow users to access to filter\n * but won't include in spans or breadcrumbs.\n *\n * @param requestOptions RequestOptions object containing the component parts for a URL\n * @returns Fully-formed URL\n */\n// TODO (v8): This function should include auth, query and fragment (it's breaking, so we need to wait for v8)\nexport function extractRawUrl(requestOptions: RequestOptions): string {\n  const protocol = requestOptions.protocol || '';\n  const hostname = requestOptions.hostname || requestOptions.host || '';\n  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n  const port =\n    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;\n  const path = requestOptions.path ? requestOptions.path : '/';\n  return `${protocol}//${hostname}${port}${path}`;\n}\n\n/**\n * Assemble a URL to be used for breadcrumbs and spans.\n *\n * @param requestOptions RequestOptions object containing the component parts for a URL\n * @returns Fully-formed URL\n */\nexport function extractUrl(requestOptions: RequestOptions): string {\n  const protocol = requestOptions.protocol || '';\n  const hostname = requestOptions.hostname || requestOptions.host || '';\n  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n  const port =\n    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;\n  // do not include search or hash in span descriptions, per https://develop.sentry.dev/sdk/data-handling/#structuring-data\n  const path = requestOptions.pathname || '/';\n  // always filter authority, see https://develop.sentry.dev/sdk/data-handling/#structuring-data\n  const authority = requestOptions.auth ? redactAuthority(requestOptions.auth) : '';\n\n  return `${protocol}//${authority}${hostname}${port}${path}`;\n}\n\nfunction redactAuthority(auth: string): string {\n  const [user, password] = auth.split(':');\n  return `${user ? '[Filtered]' : ''}:${password ? '[Filtered]' : ''}@`;\n}\n\n/**\n * Handle various edge cases in the span description (for spans representing http(s) requests).\n *\n * @param description current `description` property of the span representing the request\n * @param requestOptions Configuration data for the request\n * @param Request Request object\n *\n * @returns The cleaned description\n */\nexport function cleanSpanDescription(\n  description: string | undefined,\n  requestOptions: RequestOptions,\n  request: http.ClientRequest,\n): string | undefined {\n  // nothing to clean\n  if (!description) {\n    return description;\n  }\n\n  // eslint-disable-next-line prefer-const\n  let [method, requestUrl] = description.split(' ');\n\n  // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing,\n  // we're likely dealing with an internal route and this doesn't apply)\n  if (requestOptions.host && !requestOptions.protocol) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n    requestOptions.protocol = (request as any)?.agent?.protocol; // worst comes to worst, this is undefined and nothing changes\n    // This URL contains the filtered authority ([filtered]:[filtered]@example.com) but no fragment or query params\n    requestUrl = extractUrl(requestOptions);\n  }\n\n  // internal routes can end up starting with a triple slash rather than a single one\n  if (requestUrl?.startsWith('///')) {\n    requestUrl = requestUrl.slice(2);\n  }\n\n  return `${method} ${requestUrl}`;\n}\n\n// the node types are missing a few properties which node's `urlToOptions` function spits out\nexport type RequestOptions = http.RequestOptions & { hash?: string; search?: string; pathname?: string; href?: string };\ntype RequestCallback = (response: http.IncomingMessage) => void;\nexport type RequestMethodArgs =\n  | [RequestOptions | string | URL, RequestCallback?]\n  | [string | URL, RequestOptions, RequestCallback?];\nexport type RequestMethod = (...args: RequestMethodArgs) => http.ClientRequest;\n\n/**\n * Convert a URL object into a RequestOptions object.\n *\n * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the\n * RequestOptions type above.\n *\n * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.\n */\nexport function urlToOptions(url: URL): RequestOptions {\n  const options: RequestOptions = {\n    protocol: url.protocol,\n    hostname:\n      typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,\n    hash: url.hash,\n    search: url.search,\n    pathname: url.pathname,\n    path: `${url.pathname || ''}${url.search || ''}`,\n    href: url.href,\n  };\n  if (url.port !== '') {\n    options.port = Number(url.port);\n  }\n  if (url.username || url.password) {\n    options.auth = `${url.username}:${url.password}`;\n  }\n  return options;\n}\n\n/**\n * Normalize inputs to `http(s).request()` and `http(s).get()`.\n *\n * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:\n *     [ RequestOptions | string | URL ],\n *     [ RequestOptions | string | URL, RequestCallback ],\n *     [ string | URL, RequestOptions ], and\n *     [ string | URL, RequestOptions, RequestCallback ].\n *\n * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is\n * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact\n * with the args in a standard way.\n *\n * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.\n *\n * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].\n */\nexport function normalizeRequestArgs(\n  httpModule: typeof http | typeof https,\n  requestArgs: RequestMethodArgs,\n): [RequestOptions] | [RequestOptions, RequestCallback] {\n  let callback, requestOptions;\n\n  // pop off the callback, if there is one\n  if (typeof requestArgs[requestArgs.length - 1] === 'function') {\n    callback = requestArgs.pop() as RequestCallback;\n  }\n\n  // create a RequestOptions object of whatever's at index 0\n  if (typeof requestArgs[0] === 'string') {\n    requestOptions = urlToOptions(new URL(requestArgs[0]));\n  } else if (requestArgs[0] instanceof URL) {\n    requestOptions = urlToOptions(requestArgs[0]);\n  } else {\n    requestOptions = requestArgs[0];\n  }\n\n  // if the options were given separately from the URL, fold them in\n  if (requestArgs.length === 2) {\n    requestOptions = { ...requestOptions, ...requestArgs[1] };\n  }\n\n  // Figure out the protocol if it's currently missing\n  if (requestOptions.protocol === undefined) {\n    // Worst case we end up populating protocol with undefined, which it already is\n    /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n\n    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n    // Because of that, we cannot rely on `httpModule` to provide us with valid protocol,\n    // as it will always return `http`, even when using `https` module.\n    //\n    // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.\n    if (NODE_VERSION.major && NODE_VERSION.major > 8) {\n      requestOptions.protocol =\n        (httpModule?.globalAgent as any)?.protocol ||\n        (requestOptions.agent as any)?.protocol ||\n        (requestOptions._defaultAgent as any)?.protocol;\n    } else {\n      requestOptions.protocol =\n        (requestOptions.agent as any)?.protocol ||\n        (requestOptions._defaultAgent as any)?.protocol ||\n        (httpModule?.globalAgent as any)?.protocol;\n    }\n    /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n  }\n\n  // return args in standardized form\n  if (callback) {\n    return [requestOptions, callback];\n  } else {\n    return [requestOptions];\n  }\n}\n"],"names":["getCurrentHub","URL","NODE_VERSION"],"mappings":";;;;;;;;;;AAOA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA,CAAA,CAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;EACA;;EAEA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;EACA,CAAA,EAAA,CAAA,QAAA,EAAA;IACA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,EAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const path = require('path');

const isWindowsPlatform = path.sep === '\\';

/** normalizes Windows paths */
function normalizeWindowsPath(path) {
  return path
    .replace(/^[A-Z]:/, '') // remove Windows-style prefix
    .replace(/\\/g, '/'); // replace all `\` instances with `/`
}

/** Gets the module from a filename */
function getModule(
  filename,
  normalizeWindowsPathSeparator = isWindowsPlatform,
) {
  if (!filename) {
    return;
  }

  const normalizedFilename = normalizeWindowsPathSeparator ? normalizeWindowsPath(filename) : filename;

  // eslint-disable-next-line prefer-const
  let { root, dir, base: basename, ext } = path.posix.parse(normalizedFilename);

  const base = (require && require.main && require.main.filename && dir) || global.process.cwd();

  const normalizedBase = `${base}/`;

  // It's specifically a module
  let file = basename;

  if (ext === '.js') {
    file = file.slice(0, file.length - '.js'.length);
  }

  if (!root && !dir) {
    // No dirname whatsoever
    dir = '.';
  }

  let n = dir.lastIndexOf('/node_modules/');
  if (n > -1) {
    // /node_modules/ is 14 chars
    return `${dir.slice(n + 14).replace(/\//g, '.')}:${file}`;
  }
  // Let's see if it's a part of the main module
  // To be a part of main module, it has to share the same base
  n = `${dir}/`.lastIndexOf(normalizedBase, 0);

  if (n === 0) {
    let moduleName = dir.slice(normalizedBase.length).replace(/\//g, '.');
    if (moduleName) {
      moduleName += ':';
    }
    moduleName += file;
    return moduleName;
  }
  return file;
}

exports.getModule = getModule;
//# sourceMappingURL=module.js.map
{"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import { posix, sep } from 'path';\n\nconst isWindowsPlatform = sep === '\\\\';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n  return path\n    .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n    .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Gets the module from a filename */\nexport function getModule(\n  filename: string | undefined,\n  normalizeWindowsPathSeparator: boolean = isWindowsPlatform,\n): string | undefined {\n  if (!filename) {\n    return;\n  }\n\n  const normalizedFilename = normalizeWindowsPathSeparator ? normalizeWindowsPath(filename) : filename;\n\n  // eslint-disable-next-line prefer-const\n  let { root, dir, base: basename, ext } = posix.parse(normalizedFilename);\n\n  const base = (require && require.main && require.main.filename && dir) || global.process.cwd();\n\n  const normalizedBase = `${base}/`;\n\n  // It's specifically a module\n  let file = basename;\n\n  if (ext === '.js') {\n    file = file.slice(0, file.length - '.js'.length);\n  }\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    dir = '.';\n  }\n\n  let n = dir.lastIndexOf('/node_modules/');\n  if (n > -1) {\n    // /node_modules/ is 14 chars\n    return `${dir.slice(n + 14).replace(/\\//g, '.')}:${file}`;\n  }\n  // Let's see if it's a part of the main module\n  // To be a part of main module, it has to share the same base\n  n = `${dir}/`.lastIndexOf(normalizedBase, 0);\n\n  if (n === 0) {\n    let moduleName = dir.slice(normalizedBase.length).replace(/\\//g, '.');\n    if (moduleName) {\n      moduleName += ':';\n    }\n    moduleName += file;\n    return moduleName;\n  }\n  return file;\n}\n"],"names":["sep","posix"],"mappings":";;;;AAEA,MAAA,iBAAA,GAAAA,QAAA,KAAA,IAAA,CAAA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,IAAA;AACA,KAAA,OAAA,CAAA,SAAA,EAAA,EAAA,CAAA;AACA,KAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,SAAA;AACA,EAAA,QAAA;AACA,EAAA,6BAAA,GAAA,iBAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,kBAAA,GAAA,6BAAA,GAAA,oBAAA,CAAA,QAAA,CAAA,GAAA,QAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,EAAA,IAAA,EAAA,GAAA,EAAA,IAAA,EAAA,QAAA,EAAA,GAAA,EAAA,GAAAC,UAAA,CAAA,KAAA,CAAA,kBAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,IAAA,GAAA,CAAA,OAAA,IAAA,OAAA,CAAA,IAAA,IAAA,OAAA,CAAA,IAAA,CAAA,QAAA,IAAA,GAAA,KAAA,MAAA,CAAA,OAAA,CAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,cAAA,GAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA,EAAA,IAAA,IAAA,GAAA,QAAA,CAAA;AACA;AACA,EAAA,IAAA,GAAA,KAAA,KAAA,EAAA;AACA,IAAA,IAAA,GAAA,IAAA,CAAA,KAAA,CAAA,CAAA,EAAA,IAAA,CAAA,MAAA,GAAA,KAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,CAAA,IAAA,IAAA,CAAA,GAAA,EAAA;AACA;AACA,IAAA,GAAA,GAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,CAAA,GAAA,GAAA,CAAA,WAAA,CAAA,gBAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA;AACA,IAAA,OAAA,CAAA,EAAA,GAAA,CAAA,KAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,CAAA,GAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,cAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,CAAA,EAAA;AACA,IAAA,IAAA,UAAA,GAAA,GAAA,CAAA,KAAA,CAAA,cAAA,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA;AACA,IAAA,IAAA,UAAA,EAAA;AACA,MAAA,UAAA,IAAA,GAAA,CAAA;AACA,KAAA;AACA,IAAA,UAAA,IAAA,IAAA,CAAA;AACA,IAAA,OAAA,UAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');

const NODE_VERSION = utils.parseSemver(process.versions.node);

exports.NODE_VERSION = NODE_VERSION;
//# sourceMappingURL=nodeVersion.js.map
{"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/utils';\n\nexport const NODE_VERSION: ReturnType<typeof parseSemver> = parseSemver(process.versions.node);\n"],"names":["parseSemver"],"mappings":";;;;AAEA,MAAA,YAAA,GAAAA,iBAAA,CAAA,OAAA,CAAA,QAAA,CAAA,IAAA;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const cookie = require('cookie');
const url = require('url');

const DEFAULT_INCLUDES = {
  ip: false,
  request: true,
  transaction: true,
  user: true,
};
const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];
const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];

/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
function extractPathForTransaction(
  req,
  options = {},
) {
  const method = req.method && req.method.toUpperCase();

  let path = '';
  let source = 'url';

  // Check to see if there's a parameterized route we can use (as there is in Express)
  if (options.customRoute || req.route) {
    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;
    source = 'route';
  }

  // Otherwise, just take the original URL
  else if (req.originalUrl || req.url) {
    path = utils.stripUrlQueryAndFragment(req.originalUrl || req.url || '');
  }

  let name = '';
  if (options.method && method) {
    name += method;
  }
  if (options.method && options.path) {
    name += ' ';
  }
  if (options.path && path) {
    name += path;
  }

  return [name, source];
}

/** JSDoc */
function extractTransaction(req, type) {
  switch (type) {
    case 'path': {
      return extractPathForTransaction(req, { path: true })[0];
    }
    case 'handler': {
      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';
    }
    case 'methodPath':
    default: {
      return extractPathForTransaction(req, { path: true, method: true })[0];
    }
  }
}

/** JSDoc */
function extractUserData(
  user

,
  keys,
) {
  const extractedUser = {};
  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;

  attributes.forEach(key => {
    if (user && key in user) {
      extractedUser[key] = user[key];
    }
  });

  return extractedUser;
}

/**
 * Normalize data from the request object
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 *
 * @returns An object containing normalized request data
 */
function extractRequestData(
  req,
  options

,
) {
  const { include = DEFAULT_REQUEST_INCLUDES } = options || {};
  const requestData = {};

  // headers:
  //   node, express, koa, nextjs: req.headers
  const headers = (req.headers || {})

;
  // method:
  //   node, express, koa, nextjs: req.method
  const method = req.method;
  // host:
  //   express: req.hostname in > 4 and req.host in < 4
  //   koa: req.host
  //   node, nextjs: req.headers.host
  const host = req.hostname || req.host || headers.host || '<no host>';
  // protocol:
  //   node, nextjs: <n/a>
  //   express, koa: req.protocol
  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  const originalUrl = req.originalUrl || req.url || '';
  // absolute url
  const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;
  include.forEach(key => {
    switch (key) {
      case 'headers': {
        requestData.headers = headers;

        // Remove the Cookie header in case cookie data should not be included in the event
        if (!include.includes('cookies')) {
          delete (requestData.headers ).cookie;
        }

        break;
      }
      case 'method': {
        requestData.method = method;
        break;
      }
      case 'url': {
        requestData.url = absoluteUrl;
        break;
      }
      case 'cookies': {
        // cookies:
        //   node, express, koa: req.headers.cookie
        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.cookies =
          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
          // come off in v8
          req.cookies || (headers.cookie && cookie.parse(headers.cookie)) || {};
        break;
      }
      case 'query_string': {
        // query string:
        //   node: req.url (raw)
        //   express, koa, nextjs: req.query
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.query_string = extractQueryParams(req);
        break;
      }
      case 'data': {
        if (method === 'GET' || method === 'HEAD') {
          break;
        }
        // body data:
        //   express, koa, nextjs: req.body
        //
        //   when using node by itself, you have to read the incoming stream(see
        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know
        //   where they're going to store the final result, so they'll have to capture this data themselves
        if (req.body !== undefined) {
          requestData.data = utils.isString(req.body) ? req.body : JSON.stringify(utils.normalize(req.body));
        }
        break;
      }
      default: {
        if ({}.hasOwnProperty.call(req, key)) {
          requestData[key] = (req )[key];
        }
      }
    }
  });

  return requestData;
}

/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 *
 * @returns The mutated `Event` object
 */
function addRequestDataToEvent(
  event,
  req,
  options,
) {
  const include = {
    ...DEFAULT_INCLUDES,
    ..._optionalChain([options, 'optionalAccess', _ => _.include]),
  };

  if (include.request) {
    const extractedRequestData = Array.isArray(include.request)
      ? extractRequestData(req, { include: include.request })
      : extractRequestData(req);

    event.request = {
      ...event.request,
      ...extractedRequestData,
    };
  }

  if (include.user) {
    const extractedUser = req.user && utils.isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};

    if (Object.keys(extractedUser).length) {
      event.user = {
        ...event.user,
        ...extractedUser,
      };
    }
  }

  // client ip:
  //   node, nextjs: req.socket.remoteAddress
  //   express, koa: req.ip
  if (include.ip) {
    const ip = req.ip || (req.socket && req.socket.remoteAddress);
    if (ip) {
      event.user = {
        ...event.user,
        ip_address: ip,
      };
    }
  }

  if (include.transaction && !event.transaction) {
    // TODO do we even need this anymore?
    // TODO make this work for nextjs
    event.transaction = extractTransaction(req, include.transaction);
  }

  return event;
}

function extractQueryParams(req) {
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  let originalUrl = req.originalUrl || req.url || '';

  if (!originalUrl) {
    return;
  }

  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and
  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.
  if (originalUrl.startsWith('/')) {
    originalUrl = `http://dogs.are.great${originalUrl}`;
  }

  return (
    req.query ||
    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||
    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
    url.parse(originalUrl).query ||
    undefined
  );
}

exports.DEFAULT_USER_INCLUDES = DEFAULT_USER_INCLUDES;
exports.addRequestDataToEvent = addRequestDataToEvent;
exports.extractPathForTransaction = extractPathForTransaction;
exports.extractRequestData = extractRequestData;
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../src/requestdata.ts"],"sourcesContent":["import type {\n  Event,\n  ExtractedNodeRequestData,\n  PolymorphicRequest,\n  Transaction,\n  TransactionSource,\n} from '@sentry/types';\nimport { isPlainObject, isString, normalize, stripUrlQueryAndFragment } from '@sentry/utils';\nimport * as cookie from 'cookie';\nimport * as url from 'url';\n\nconst DEFAULT_INCLUDES = {\n  ip: false,\n  request: true,\n  transaction: true,\n  user: true,\n};\nconst DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\nexport const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n */\nexport type AddRequestDataToEventOptions = {\n  /** Flags controlling whether each type of data should be added to the event */\n  include?: {\n    ip?: boolean;\n    request?: boolean | Array<(typeof DEFAULT_REQUEST_INCLUDES)[number]>;\n    transaction?: boolean | TransactionNamingScheme;\n    user?: boolean | Array<(typeof DEFAULT_USER_INCLUDES)[number]>;\n  };\n};\n\nexport type TransactionNamingScheme = 'path' | 'methodPath' | 'handler';\n\n/**\n * Sets parameterized route as transaction name e.g.: `GET /users/:id`\n * Also adds more context data on the transaction from the request\n */\nexport function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest): void {\n  if (!transaction) return;\n  if (!transaction.metadata.source || transaction.metadata.source === 'url') {\n    // Attempt to grab a parameterized route off of the request\n    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));\n  }\n  transaction.setData('url', req.originalUrl || req.url);\n  if (req.baseUrl) {\n    transaction.setData('baseUrl', req.baseUrl);\n  }\n  transaction.setData('query', extractQueryParams(req));\n}\n\n/**\n * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.\n * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.\n *\n * Additionally, this function determines and returns the transaction name source\n *\n * eg. GET /mountpoint/user/:id\n *\n * @param req A request object\n * @param options What to include in the transaction name (method, path, or a custom route name to be\n *                used instead of the request's route)\n *\n * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')\n */\nexport function extractPathForTransaction(\n  req: PolymorphicRequest,\n  options: { path?: boolean; method?: boolean; customRoute?: string } = {},\n): [string, TransactionSource] {\n  const method = req.method && req.method.toUpperCase();\n\n  let path = '';\n  let source: TransactionSource = 'url';\n\n  // Check to see if there's a parameterized route we can use (as there is in Express)\n  if (options.customRoute || req.route) {\n    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;\n    source = 'route';\n  }\n\n  // Otherwise, just take the original URL\n  else if (req.originalUrl || req.url) {\n    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n  }\n\n  let name = '';\n  if (options.method && method) {\n    name += method;\n  }\n  if (options.method && options.path) {\n    name += ' ';\n  }\n  if (options.path && path) {\n    name += path;\n  }\n\n  return [name, source];\n}\n\n/** JSDoc */\nfunction extractTransaction(req: PolymorphicRequest, type: boolean | TransactionNamingScheme): string {\n  switch (type) {\n    case 'path': {\n      return extractPathForTransaction(req, { path: true })[0];\n    }\n    case 'handler': {\n      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';\n    }\n    case 'methodPath':\n    default: {\n      return extractPathForTransaction(req, { path: true, method: true })[0];\n    }\n  }\n}\n\n/** JSDoc */\nfunction extractUserData(\n  user: {\n    [key: string]: unknown;\n  },\n  keys: boolean | string[],\n): { [key: string]: unknown } {\n  const extractedUser: { [key: string]: unknown } = {};\n  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;\n\n  attributes.forEach(key => {\n    if (user && key in user) {\n      extractedUser[key] = user[key];\n    }\n  });\n\n  return extractedUser;\n}\n\n/**\n * Normalize data from the request object\n *\n * @param req The request object from which to extract data\n * @param options.include An optional array of keys to include in the normalized data. Defaults to\n * DEFAULT_REQUEST_INCLUDES if not provided.\n * @param options.deps Injected, platform-specific dependencies\n *\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(\n  req: PolymorphicRequest,\n  options?: {\n    include?: string[];\n  },\n): ExtractedNodeRequestData {\n  const { include = DEFAULT_REQUEST_INCLUDES } = options || {};\n  const requestData: { [key: string]: unknown } = {};\n\n  // headers:\n  //   node, express, koa, nextjs: req.headers\n  const headers = (req.headers || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa, nextjs: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node, nextjs: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node, nextjs: <n/a>\n  //   express, koa: req.protocol\n  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  const originalUrl = req.originalUrl || req.url || '';\n  // absolute url\n  const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;\n  include.forEach(key => {\n    switch (key) {\n      case 'headers': {\n        requestData.headers = headers;\n\n        // Remove the Cookie header in case cookie data should not be included in the event\n        if (!include.includes('cookies')) {\n          delete (requestData.headers as { cookie?: string }).cookie;\n        }\n\n        break;\n      }\n      case 'method': {\n        requestData.method = method;\n        break;\n      }\n      case 'url': {\n        requestData.url = absoluteUrl;\n        break;\n      }\n      case 'cookies': {\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies =\n          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can\n          // come off in v8\n          req.cookies || (headers.cookie && cookie.parse(headers.cookie)) || {};\n        break;\n      }\n      case 'query_string': {\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa, nextjs: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = extractQueryParams(req);\n        break;\n      }\n      case 'data': {\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   express, koa, nextjs: req.body\n        //\n        //   when using node by itself, you have to read the incoming stream(see\n        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n        //   where they're going to store the final result, so they'll have to capture this data themselves\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      }\n      default: {\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: unknown })[key];\n        }\n      }\n    }\n  });\n\n  return requestData;\n}\n\n/**\n * Add data from the given request to the given event\n *\n * @param event The event to which the request data will be added\n * @param req Request object\n * @param options.include Flags to control what data is included\n *\n * @returns The mutated `Event` object\n */\nexport function addRequestDataToEvent(\n  event: Event,\n  req: PolymorphicRequest,\n  options?: AddRequestDataToEventOptions,\n): Event {\n  const include = {\n    ...DEFAULT_INCLUDES,\n    ...options?.include,\n  };\n\n  if (include.request) {\n    const extractedRequestData = Array.isArray(include.request)\n      ? extractRequestData(req, { include: include.request })\n      : extractRequestData(req);\n\n    event.request = {\n      ...event.request,\n      ...extractedRequestData,\n    };\n  }\n\n  if (include.user) {\n    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};\n\n    if (Object.keys(extractedUser).length) {\n      event.user = {\n        ...event.user,\n        ...extractedUser,\n      };\n    }\n  }\n\n  // client ip:\n  //   node, nextjs: req.socket.remoteAddress\n  //   express, koa: req.ip\n  if (include.ip) {\n    const ip = req.ip || (req.socket && req.socket.remoteAddress);\n    if (ip) {\n      event.user = {\n        ...event.user,\n        ip_address: ip,\n      };\n    }\n  }\n\n  if (include.transaction && !event.transaction) {\n    // TODO do we even need this anymore?\n    // TODO make this work for nextjs\n    event.transaction = extractTransaction(req, include.transaction);\n  }\n\n  return event;\n}\n\nfunction extractQueryParams(req: PolymorphicRequest): string | Record<string, unknown> | undefined {\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  let originalUrl = req.originalUrl || req.url || '';\n\n  if (!originalUrl) {\n    return;\n  }\n\n  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and\n  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.\n  if (originalUrl.startsWith('/')) {\n    originalUrl = `http://dogs.are.great${originalUrl}`;\n  }\n\n  return (\n    req.query ||\n    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||\n    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node\n    url.parse(originalUrl).query ||\n    undefined\n  );\n}\n"],"names":["stripUrlQueryAndFragment","isString","normalize","isPlainObject"],"mappings":";;;;;;;;;;AAWA,CAAA,CAAA,CAAA,CAAA,EAAA,iBAAA,EAAA;EACA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,C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value: true });

const requestdata = require('./requestdata.js');

/**
 * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead.
 */

/**
 * Normalizes data from the request object, accounting for framework differences.
 *
 * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead.
 *
 * @param req The request object from which to extract data
 * @param keys An optional array of keys to include in the normalized data.
 * @returns An object containing normalized request data
 */
function extractRequestData(req, keys) {
  return requestdata.extractRequestData(req, { include: keys });
}

/**
 * Options deciding what parts of the request to use when enhancing an event
 *
 * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use
 * `AddRequestDataToEventOptions` in `@sentry/utils` instead.
 */

/**
 * Enriches passed event with request data.
 *
 * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead.
 *
 * @param event Will be mutated and enriched with req data
 * @param req Request object
 * @param options object containing flags to enable functionality
 * @hidden
 */
function parseRequest(event, req, options = {}) {
  return requestdata.addRequestDataToEvent(event, req, { include: options });
}

exports.extractRequestData = extractRequestData;
exports.parseRequest = parseRequest;
//# sourceMappingURL=requestDataDeprecated.js.map
{"version":3,"file":"requestDataDeprecated.js","sources":["../../src/requestDataDeprecated.ts"],"sourcesContent":["/**\n * Deprecated functions which are slated for removal in v8. When the time comes, this entire file can be deleted.\n *\n * See https://github.com/getsentry/sentry-javascript/pull/5257.\n */\n\n/* eslint-disable deprecation/deprecation */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, ExtractedNodeRequestData, PolymorphicRequest } from '@sentry/types';\n\nimport type { AddRequestDataToEventOptions } from './requestdata';\nimport { addRequestDataToEvent, extractRequestData as _extractRequestData } from './requestdata';\n\n/**\n * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead.\n */\nexport type ExpressRequest = PolymorphicRequest;\n\n/**\n * Normalizes data from the request object, accounting for framework differences.\n *\n * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead.\n *\n * @param req The request object from which to extract data\n * @param keys An optional array of keys to include in the normalized data.\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(req: { [key: string]: any }, keys?: string[]): ExtractedNodeRequestData {\n  return _extractRequestData(req, { include: keys });\n}\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n *\n * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use\n * `AddRequestDataToEventOptions` in `@sentry/utils` instead.\n */\nexport type ParseRequestOptions = AddRequestDataToEventOptions['include'] & {\n  serverName?: boolean;\n  version?: boolean;\n};\n\n/**\n * Enriches passed event with request data.\n *\n * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead.\n *\n * @param event Will be mutated and enriched with req data\n * @param req Request object\n * @param options object containing flags to enable functionality\n * @hidden\n */\nexport function parseRequest(event: Event, req: ExpressRequest, options: ParseRequestOptions = {}): Event {\n  return addRequestDataToEvent(event, req, { include: options });\n}\n"],"names":["_extractRequestData","addRequestDataToEvent"],"mappings":";;;;AAaA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,GAAA,EAAA,IAAA,EAAA;AACA,EAAA,OAAAA,8BAAA,CAAA,GAAA,EAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,GAAA,EAAA,EAAA;AACA,EAAA,OAAAC,iCAAA,CAAA,KAAA,EAAA,GAAA,EAAA,EAAA,OAAA,EAAA,OAAA,EAAA,CAAA,CAAA;AACA;;;;;"}var {
  _optionalChain
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');
const index = require('./async/index.js');
const client = require('./client.js');
const console = require('./integrations/console.js');
const http = require('./integrations/http.js');
const onuncaughtexception = require('./integrations/onuncaughtexception.js');
const onunhandledrejection = require('./integrations/onunhandledrejection.js');
const linkederrors = require('./integrations/linkederrors.js');
const modules = require('./integrations/modules.js');
const contextlines = require('./integrations/contextlines.js');
const context = require('./integrations/context.js');
const requestdata = require('./integrations/requestdata.js');
const localvariables = require('./integrations/localvariables.js');
require('./integrations/undici/index.js');
const module$1 = require('./module.js');
const http$1 = require('./transports/http.js');

/* eslint-disable max-lines */

const defaultIntegrations = [
  // Common
  new core.Integrations.InboundFilters(),
  new core.Integrations.FunctionToString(),
  // Native Wrappers
  new console.Console(),
  new http.Http(),
  // Global Handlers
  new onuncaughtexception.OnUncaughtException(),
  new onunhandledrejection.OnUnhandledRejection(),
  // Event Info
  new contextlines.ContextLines(),
  new localvariables.LocalVariables(),
  new context.Context(),
  new modules.Modules(),
  new requestdata.RequestData(),
  // Misc
  new linkederrors.LinkedErrors(),
];

/**
 * The Sentry Node SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * main entry module. To set context information or send manual events, use the
 * provided methods.
 *
 * @example
 * ```
 *
 * const { init } = require('@sentry/node');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { configureScope } = require('@sentry/node');
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { addBreadcrumb } = require('@sentry/node');
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const Sentry = require('@sentry/node');
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link NodeOptions} for documentation on configuration options.
 */
function init(options = {}) {
  const carrier = core.getMainCarrier();

  index.setNodeAsyncContextStrategy();

  const autoloadedIntegrations = _optionalChain([carrier, 'access', _ => _.__SENTRY__, 'optionalAccess', _2 => _2.integrations]) || [];

  options.defaultIntegrations =
    options.defaultIntegrations === false
      ? []
      : [
          ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations),
          ...autoloadedIntegrations,
        ];

  if (options.dsn === undefined && process.env.SENTRY_DSN) {
    options.dsn = process.env.SENTRY_DSN;
  }

  if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) {
    const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);
    if (isFinite(tracesSampleRate)) {
      options.tracesSampleRate = tracesSampleRate;
    }
  }

  if (options.release === undefined) {
    const detectedRelease = getSentryRelease();
    if (detectedRelease !== undefined) {
      options.release = detectedRelease;
    } else {
      // If release is not provided, then we should disable autoSessionTracking
      options.autoSessionTracking = false;
    }
  }

  if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {
    options.environment = process.env.SENTRY_ENVIRONMENT;
  }

  if (options.autoSessionTracking === undefined && options.dsn !== undefined) {
    options.autoSessionTracking = true;
  }

  if (options.instrumenter === undefined) {
    options.instrumenter = 'sentry';
  }

  // TODO(v7): Refactor this to reduce the logic above
  const clientOptions = {
    ...options,
    stackParser: utils.stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
    integrations: core.getIntegrationsToSetup(options),
    transport: options.transport || http$1.makeNodeTransport,
  };

  core.initAndBind(client.NodeClient, clientOptions);

  if (options.autoSessionTracking) {
    startSessionTracking();
  }
}

/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
function lastEventId() {
  return core.getCurrentHub().lastEventId();
}

/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
async function flush(timeout) {
  const client = core.getCurrentHub().getClient();
  if (client) {
    return client.flush(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Cannot flush events. No client defined.');
  return Promise.resolve(false);
}

/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
async function close(timeout) {
  const client = core.getCurrentHub().getClient();
  if (client) {
    return client.close(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Cannot flush events and disable SDK. No client defined.');
  return Promise.resolve(false);
}

/**
 * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
 */
function isAutoSessionTrackingEnabled(client) {
  if (client === undefined) {
    return false;
  }
  const clientOptions = client && client.getOptions();
  if (clientOptions && clientOptions.autoSessionTracking !== undefined) {
    return clientOptions.autoSessionTracking;
  }
  return false;
}

/**
 * Returns a release dynamically from environment variables.
 */
function getSentryRelease(fallback) {
  // Always read first as Sentry takes this as precedence
  if (process.env.SENTRY_RELEASE) {
    return process.env.SENTRY_RELEASE;
  }

  // This supports the variable that sentry-webpack-plugin injects
  if (utils.GLOBAL_OBJ.SENTRY_RELEASE && utils.GLOBAL_OBJ.SENTRY_RELEASE.id) {
    return utils.GLOBAL_OBJ.SENTRY_RELEASE.id;
  }

  return (
    // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
    process.env.GITHUB_SHA ||
    // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
    process.env.COMMIT_REF ||
    // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables
    process.env.VERCEL_GIT_COMMIT_SHA ||
    process.env.VERCEL_GITHUB_COMMIT_SHA ||
    process.env.VERCEL_GITLAB_COMMIT_SHA ||
    process.env.VERCEL_BITBUCKET_COMMIT_SHA ||
    // Zeit (now known as Vercel)
    process.env.ZEIT_GITHUB_COMMIT_SHA ||
    process.env.ZEIT_GITLAB_COMMIT_SHA ||
    process.env.ZEIT_BITBUCKET_COMMIT_SHA ||
    fallback
  );
}

/** Node.js stack parser */
const defaultStackParser = utils.createStackParser(utils.nodeStackLineParser(module$1.getModule));

/**
 * Enable automatic Session Tracking for the node process.
 */
function startSessionTracking() {
  const hub = core.getCurrentHub();
  hub.startSession();
  // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because
  // The 'beforeExit' event is not emitted for conditions causing explicit termination,
  // such as calling process.exit() or uncaught exceptions.
  // Ref: https://nodejs.org/api/process.html#process_event_beforeexit
  process.on('beforeExit', () => {
    const session = _optionalChain([hub, 'access', _3 => _3.getScope, 'call', _4 => _4(), 'optionalAccess', _5 => _5.getSession, 'call', _6 => _6()]);
    const terminalStates = ['exited', 'crashed'];
    // Only call endSession, if the Session exists on Scope and SessionStatus is not a
    // Terminal Status i.e. Exited or Crashed because
    // "When a session is moved away from ok it must not be updated anymore."
    // Ref: https://develop.sentry.dev/sdk/sessions/
    if (session && !terminalStates.includes(session.status)) hub.endSession();
  });
}

exports.close = close;
exports.defaultIntegrations = defaultIntegrations;
exports.defaultStackParser = defaultStackParser;
exports.flush = flush;
exports.getSentryRelease = getSentryRelease;
exports.init = init;
exports.isAutoSessionTrackingEnabled = isAutoSessionTrackingEnabled;
exports.lastEventId = lastEventId;
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport {\n  getCurrentHub,\n  getIntegrationsToSetup,\n  getMainCarrier,\n  initAndBind,\n  Integrations as CoreIntegrations,\n} from '@sentry/core';\nimport type { SessionStatus, StackParser } from '@sentry/types';\nimport {\n  createStackParser,\n  GLOBAL_OBJ,\n  logger,\n  nodeStackLineParser,\n  stackParserFromStackParserOptions,\n} from '@sentry/utils';\n\nimport { setNodeAsyncContextStrategy } from './async';\nimport { NodeClient } from './client';\nimport {\n  Console,\n  Context,\n  ContextLines,\n  Http,\n  LinkedErrors,\n  LocalVariables,\n  Modules,\n  OnUncaughtException,\n  OnUnhandledRejection,\n  RequestData,\n} from './integrations';\nimport { getModule } from './module';\nimport { makeNodeTransport } from './transports';\nimport type { NodeClientOptions, NodeOptions } from './types';\n\nexport const defaultIntegrations = [\n  // Common\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  // Native Wrappers\n  new Console(),\n  new Http(),\n  // Global Handlers\n  new OnUncaughtException(),\n  new OnUnhandledRejection(),\n  // Event Info\n  new ContextLines(),\n  new LocalVariables(),\n  new Context(),\n  new Modules(),\n  new RequestData(),\n  // Misc\n  new LinkedErrors(),\n];\n\n/**\n * The Sentry Node SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible in the\n * main entry module. To set context information or send manual events, use the\n * provided methods.\n *\n * @example\n * ```\n *\n * const { init } = require('@sentry/node');\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * const { configureScope } = require('@sentry/node');\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * const { addBreadcrumb } = require('@sentry/node');\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * const Sentry = require('@sentry/node');\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link NodeOptions} for documentation on configuration options.\n */\nexport function init(options: NodeOptions = {}): void {\n  const carrier = getMainCarrier();\n\n  setNodeAsyncContextStrategy();\n\n  const autoloadedIntegrations = carrier.__SENTRY__?.integrations || [];\n\n  options.defaultIntegrations =\n    options.defaultIntegrations === false\n      ? []\n      : [\n          ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations),\n          ...autoloadedIntegrations,\n        ];\n\n  if (options.dsn === undefined && process.env.SENTRY_DSN) {\n    options.dsn = process.env.SENTRY_DSN;\n  }\n\n  if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) {\n    const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);\n    if (isFinite(tracesSampleRate)) {\n      options.tracesSampleRate = tracesSampleRate;\n    }\n  }\n\n  if (options.release === undefined) {\n    const detectedRelease = getSentryRelease();\n    if (detectedRelease !== undefined) {\n      options.release = detectedRelease;\n    } else {\n      // If release is not provided, then we should disable autoSessionTracking\n      options.autoSessionTracking = false;\n    }\n  }\n\n  if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {\n    options.environment = process.env.SENTRY_ENVIRONMENT;\n  }\n\n  if (options.autoSessionTracking === undefined && options.dsn !== undefined) {\n    options.autoSessionTracking = true;\n  }\n\n  if (options.instrumenter === undefined) {\n    options.instrumenter = 'sentry';\n  }\n\n  // TODO(v7): Refactor this to reduce the logic above\n  const clientOptions: NodeClientOptions = {\n    ...options,\n    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n    integrations: getIntegrationsToSetup(options),\n    transport: options.transport || makeNodeTransport,\n  };\n\n  initAndBind(NodeClient, clientOptions);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient<NodeClient>();\n  if (client) {\n    return client.flush(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient<NodeClient>();\n  if (client) {\n    return client.close(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events and disable SDK. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client\n */\nexport function isAutoSessionTrackingEnabled(client?: NodeClient): boolean {\n  if (client === undefined) {\n    return false;\n  }\n  const clientOptions = client && client.getOptions();\n  if (clientOptions && clientOptions.autoSessionTracking !== undefined) {\n    return clientOptions.autoSessionTracking;\n  }\n  return false;\n}\n\n/**\n * Returns a release dynamically from environment variables.\n */\nexport function getSentryRelease(fallback?: string): string | undefined {\n  // Always read first as Sentry takes this as precedence\n  if (process.env.SENTRY_RELEASE) {\n    return process.env.SENTRY_RELEASE;\n  }\n\n  // This supports the variable that sentry-webpack-plugin injects\n  if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {\n    return GLOBAL_OBJ.SENTRY_RELEASE.id;\n  }\n\n  return (\n    // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables\n    process.env.GITHUB_SHA ||\n    // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata\n    process.env.COMMIT_REF ||\n    // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables\n    process.env.VERCEL_GIT_COMMIT_SHA ||\n    process.env.VERCEL_GITHUB_COMMIT_SHA ||\n    process.env.VERCEL_GITLAB_COMMIT_SHA ||\n    process.env.VERCEL_BITBUCKET_COMMIT_SHA ||\n    // Zeit (now known as Vercel)\n    process.env.ZEIT_GITHUB_COMMIT_SHA ||\n    process.env.ZEIT_GITLAB_COMMIT_SHA ||\n    process.env.ZEIT_BITBUCKET_COMMIT_SHA ||\n    fallback\n  );\n}\n\n/** Node.js stack parser */\nexport const defaultStackParser: StackParser = createStackParser(nodeStackLineParser(getModule));\n\n/**\n * Enable automatic Session Tracking for the node process.\n */\nfunction startSessionTracking(): void {\n  const hub = getCurrentHub();\n  hub.startSession();\n  // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because\n  // The 'beforeExit' event is not emitted for conditions causing explicit termination,\n  // such as calling process.exit() or uncaught exceptions.\n  // Ref: https://nodejs.org/api/process.html#process_event_beforeexit\n  process.on('beforeExit', () => {\n    const session = hub.getScope()?.getSession();\n    const terminalStates: SessionStatus[] = ['exited', 'crashed'];\n    // Only call endSession, if the Session exists on Scope and SessionStatus is not a\n    // Terminal Status i.e. Exited or Crashed because\n    // \"When a session is moved away from ok it must not be updated anymore.\"\n    // Ref: https://develop.sentry.dev/sdk/sessions/\n    if (session && !terminalStates.includes(session.status)) hub.endSession();\n  });\n}\n"],"names":["CoreIntegrations","Console","Http","OnUncaughtException","OnUnhandledRejection","ContextLines","LocalVariables","Context","Modules","RequestData","LinkedErrors","getMainCarrier","setNodeAsyncContextStrategy","stackParserFromStackParserOptions","getIntegrationsToSetup","makeNodeTransport","initAndBind","NodeClient","getCurrentHub","logger","GLOBAL_OBJ","createStackParser","nodeStackLineParser","getModule"],"mappings":";;;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AA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA;AACA;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const tracing = require('@sentry-internal/tracing');
const utils = require('@sentry/utils');

/**
 * Automatically detects and returns integrations that will work with your dependencies.
 */
function autoDiscoverNodePerformanceMonitoringIntegrations() {
  const loadedIntegrations = tracing.lazyLoadedNodePerformanceMonitoringIntegrations
    .map(tryLoad => {
      try {
        return tryLoad();
      } catch (_) {
        return undefined;
      }
    })
    .filter(integration => !!integration) ;

  if (loadedIntegrations.length === 0) {
    utils.logger.warn('Performance monitoring integrations could not be automatically loaded.');
  }

  // Only return integrations where their dependencies loaded successfully.
  return loadedIntegrations.filter(integration => !!integration.loadDependency());
}

exports.autoDiscoverNodePerformanceMonitoringIntegrations = autoDiscoverNodePerformanceMonitoringIntegrations;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/tracing/index.ts"],"sourcesContent":["import type { LazyLoadedIntegration } from '@sentry-internal/tracing';\nimport { lazyLoadedNodePerformanceMonitoringIntegrations } from '@sentry-internal/tracing';\nimport type { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/**\n * Automatically detects and returns integrations that will work with your dependencies.\n */\nexport function autoDiscoverNodePerformanceMonitoringIntegrations(): Integration[] {\n  const loadedIntegrations = lazyLoadedNodePerformanceMonitoringIntegrations\n    .map(tryLoad => {\n      try {\n        return tryLoad();\n      } catch (_) {\n        return undefined;\n      }\n    })\n    .filter(integration => !!integration) as LazyLoadedIntegration[];\n\n  if (loadedIntegrations.length === 0) {\n    logger.warn('Performance monitoring integrations could not be automatically loaded.');\n  }\n\n  // Only return integrations where their dependencies loaded successfully.\n  return loadedIntegrations.filter(integration => !!integration.loadDependency());\n}\n"],"names":["lazyLoadedNodePerformanceMonitoringIntegrations","logger"],"mappings":";;;;;AAKA;AACA;AACA;AACA,SAAA,iDAAA,GAAA;AACA,EAAA,MAAA,kBAAA,GAAAA,uDAAA;AACA,KAAA,GAAA,CAAA,OAAA,IAAA;AACA,MAAA,IAAA;AACA,QAAA,OAAA,OAAA,EAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,KAAA,MAAA,CAAA,WAAA,IAAA,CAAA,CAAA,WAAA,CAAA,EAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAAC,YAAA,CAAA,IAAA,CAAA,wEAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA,MAAA,CAAA,WAAA,IAAA,CAAA,CAAA,WAAA,CAAA,cAAA,EAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const tracing = require('@sentry-internal/tracing');



exports.Apollo = tracing.Apollo;
exports.Express = tracing.Express;
exports.GraphQL = tracing.GraphQL;
exports.Mongo = tracing.Mongo;
exports.Mysql = tracing.Mysql;
exports.Postgres = tracing.Postgres;
exports.Prisma = tracing.Prisma;
//# sourceMappingURL=integrations.js.map
{"version":3,"file":"integrations.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}var {
  _nullishCoalesce
} = require('@sentry/utils/cjs/buildPolyfills');

Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const http = require('http');
const https = require('https');
const httpsProxyAgent = require('https-proxy-agent');
const stream = require('stream');
const url = require('url');
const zlib = require('zlib');

// Estimated maximum size for reasonable standalone event
const GZIP_THRESHOLD = 1024 * 32;

/**
 * Gets a stream from a Uint8Array or string
 * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0
 */
function streamFromBody(body) {
  return new stream.Readable({
    read() {
      this.push(body);
      this.push(null);
    },
  });
}

/**
 * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.
 */
function makeNodeTransport(options) {
  let urlSegments;

  try {
    urlSegments = new url.URL(options.url);
  } catch (e) {
    // eslint-disable-next-line no-console
    console.warn(
      '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',
    );
    return core.createTransport(options, () => Promise.resolve({}));
  }

  const isHttps = urlSegments.protocol === 'https:';

  // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`
  // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`
  const proxy = applyNoProxyOption(
    urlSegments,
    options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,
  );

  const nativeHttpModule = isHttps ? https : http;
  const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;

  // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
  // versions(>= 8) as they had memory leaks when using it: #2555
  const agent = proxy
    ? (new httpsProxyAgent.HttpsProxyAgent(proxy) )
    : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });

  const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => ( nativeHttpModule)), agent);
  return core.createTransport(options, requestExecutor);
}

/**
 * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.
 *
 * @param transportUrl The URL the transport intends to send events to.
 * @param proxy The client configured proxy.
 * @returns A proxy the transport should use.
 */
function applyNoProxyOption(transportUrlSegments, proxy) {
  const { no_proxy } = process.env;

  const urlIsExemptFromProxy =
    no_proxy &&
    no_proxy
      .split(',')
      .some(
        exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),
      );

  if (urlIsExemptFromProxy) {
    return undefined;
  } else {
    return proxy;
  }
}

/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
function createRequestExecutor(
  options,
  httpModule,
  agent,
) {
  const { hostname, pathname, port, protocol, search } = new url.URL(options.url);
  return function makeRequest(request) {
    return new Promise((resolve, reject) => {
      let body = streamFromBody(request.body);

      const headers = { ...options.headers };

      if (request.body.length > GZIP_THRESHOLD) {
        headers['content-encoding'] = 'gzip';
        body = body.pipe(zlib.createGzip());
      }

      const req = httpModule.request(
        {
          method: 'POST',
          agent,
          headers,
          hostname,
          path: `${pathname}${search}`,
          port,
          protocol,
          ca: options.caCerts,
        },
        res => {
          res.on('data', () => {
            // Drain socket
          });

          res.on('end', () => {
            // Drain socket
          });

          res.setEncoding('utf8');

          // "Key-value pairs of header names and values. Header names are lower-cased."
          // https://nodejs.org/api/http.html#http_message_headers
          const retryAfterHeader = _nullishCoalesce(res.headers['retry-after'], () => ( null));
          const rateLimitsHeader = _nullishCoalesce(res.headers['x-sentry-rate-limits'], () => ( null));

          resolve({
            statusCode: res.statusCode,
            headers: {
              'retry-after': retryAfterHeader,
              'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,
            },
          });
        },
      );

      req.on('error', reject);
      body.pipe(req);
    });
  };
}

exports.makeNodeTransport = makeNodeTransport;
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../src/transports/http.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type {\n  BaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequest,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport * as http from 'http';\nimport * as https from 'https';\nimport { HttpsProxyAgent } from 'https-proxy-agent';\nimport { Readable } from 'stream';\nimport { URL } from 'url';\nimport { createGzip } from 'zlib';\n\nimport type { HTTPModule } from './http-module';\n\nexport interface NodeTransportOptions extends BaseTransportOptions {\n  /** Define custom headers */\n  headers?: Record<string, string>;\n  /** Set a proxy that should be used for outbound requests. */\n  proxy?: string;\n  /** HTTPS proxy CA certificates */\n  caCerts?: string | Buffer | Array<string | Buffer>;\n  /** Custom HTTP module. Defaults to the native 'http' and 'https' modules. */\n  httpModule?: HTTPModule;\n  /** Allow overriding connection keepAlive, defaults to false */\n  keepAlive?: boolean;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n  return new Readable({\n    read() {\n      this.push(body);\n      this.push(null);\n    },\n  });\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nexport function makeNodeTransport(options: NodeTransportOptions): Transport {\n  let urlSegments: URL;\n\n  try {\n    urlSegments = new URL(options.url);\n  } catch (e) {\n    // eslint-disable-next-line no-console\n    console.warn(\n      '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',\n    );\n    return createTransport(options, () => Promise.resolve({}));\n  }\n\n  const isHttps = urlSegments.protocol === 'https:';\n\n  // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`\n  // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`\n  const proxy = applyNoProxyOption(\n    urlSegments,\n    options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,\n  );\n\n  const nativeHttpModule = isHttps ? https : http;\n  const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;\n\n  // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node\n  // versions(>= 8) as they had memory leaks when using it: #2555\n  const agent = proxy\n    ? (new HttpsProxyAgent(proxy) as http.Agent)\n    : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });\n\n  const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);\n  return createTransport(options, requestExecutor);\n}\n\n/**\n * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.\n *\n * @param transportUrl The URL the transport intends to send events to.\n * @param proxy The client configured proxy.\n * @returns A proxy the transport should use.\n */\nfunction applyNoProxyOption(transportUrlSegments: URL, proxy: string | undefined): string | undefined {\n  const { no_proxy } = process.env;\n\n  const urlIsExemptFromProxy =\n    no_proxy &&\n    no_proxy\n      .split(',')\n      .some(\n        exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),\n      );\n\n  if (urlIsExemptFromProxy) {\n    return undefined;\n  } else {\n    return proxy;\n  }\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(\n  options: NodeTransportOptions,\n  httpModule: HTTPModule,\n  agent: http.Agent,\n): TransportRequestExecutor {\n  const { hostname, pathname, port, protocol, search } = new URL(options.url);\n  return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    return new Promise((resolve, reject) => {\n      let body = streamFromBody(request.body);\n\n      const headers: Record<string, string> = { ...options.headers };\n\n      if (request.body.length > GZIP_THRESHOLD) {\n        headers['content-encoding'] = 'gzip';\n        body = body.pipe(createGzip());\n      }\n\n      const req = httpModule.request(\n        {\n          method: 'POST',\n          agent,\n          headers,\n          hostname,\n          path: `${pathname}${search}`,\n          port,\n          protocol,\n          ca: options.caCerts,\n        },\n        res => {\n          res.on('data', () => {\n            // Drain socket\n          });\n\n          res.on('end', () => {\n            // Drain socket\n          });\n\n          res.setEncoding('utf8');\n\n          // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n          // https://nodejs.org/api/http.html#http_message_headers\n          const retryAfterHeader = res.headers['retry-after'] ?? null;\n          const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n          resolve({\n            statusCode: res.statusCode,\n            headers: {\n              'retry-after': retryAfterHeader,\n              'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,\n            },\n          });\n        },\n      );\n\n      req.on('error', reject);\n      body.pipe(req);\n    });\n  };\n}\n"],"names":["Readable","URL","createTransport","HttpsProxyAgent","createGzip"],"mappings":";;;;;;;;;;;;;;AA8BA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,C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A,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,CAAA;EACA,CAAA;AACA;;"}Object.defineProperty(exports, '__esModule', { value: true });

const fs = require('fs');
const path = require('path');

/**
 * Recursively read the contents of a directory.
 *
 * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this
 * directory.
 * @returns Array holding all relative paths
 */
function deepReadDirSync(targetDir) {
  const targetDirAbsPath = path.resolve(targetDir);

  if (!fs.existsSync(targetDirAbsPath)) {
    throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`);
  }

  if (!fs.statSync(targetDirAbsPath).isDirectory()) {
    throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`);
  }

  // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it
  // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve
  // the difference between `targetDirAbsPath` and `currentDirAbsPath`.
  const deepReadCurrentDir = (currentDirAbsPath) => {
    return fs.readdirSync(currentDirAbsPath).reduce((absPaths, itemName) => {
      const itemAbsPath = path.join(currentDirAbsPath, itemName);

      if (fs.statSync(itemAbsPath).isDirectory()) {
        return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];
      }

      return [...absPaths, itemAbsPath];
    }, []);
  };

  return deepReadCurrentDir(targetDirAbsPath).map(absPath => path.relative(targetDirAbsPath, absPath));
}

exports.deepReadDirSync = deepReadDirSync;
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\n/**\n * Recursively read the contents of a directory.\n *\n * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this\n * directory.\n * @returns Array holding all relative paths\n */\nexport function deepReadDirSync(targetDir: string): string[] {\n  const targetDirAbsPath = path.resolve(targetDir);\n\n  if (!fs.existsSync(targetDirAbsPath)) {\n    throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`);\n  }\n\n  if (!fs.statSync(targetDirAbsPath).isDirectory()) {\n    throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`);\n  }\n\n  // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it\n  // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve\n  // the difference between `targetDirAbsPath` and `currentDirAbsPath`.\n  const deepReadCurrentDir = (currentDirAbsPath: string): string[] => {\n    return fs.readdirSync(currentDirAbsPath).reduce((absPaths: string[], itemName: string) => {\n      const itemAbsPath = path.join(currentDirAbsPath, itemName);\n\n      if (fs.statSync(itemAbsPath).isDirectory()) {\n        return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];\n      }\n\n      return [...absPaths, itemAbsPath];\n    }, []);\n  };\n\n  return deepReadCurrentDir(targetDirAbsPath).map(absPath => path.relative(targetDirAbsPath, absPath));\n}\n"],"names":[],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,SAAA,EAAA;AACA,EAAA,MAAA,gBAAA,GAAA,IAAA,CAAA,OAAA,CAAA,SAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,EAAA,CAAA,UAAA,CAAA,gBAAA,CAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,wBAAA,EAAA,gBAAA,CAAA,2BAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,CAAA,EAAA,CAAA,QAAA,CAAA,gBAAA,CAAA,CAAA,WAAA,EAAA,EAAA;AACA,IAAA,MAAA,IAAA,KAAA,CAAA,CAAA,wBAAA,EAAA,gBAAA,CAAA,gCAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,kBAAA,GAAA,CAAA,iBAAA,KAAA;AACA,IAAA,OAAA,EAAA,CAAA,WAAA,CAAA,iBAAA,CAAA,CAAA,MAAA,CAAA,CAAA,QAAA,EAAA,QAAA,KAAA;AACA,MAAA,MAAA,WAAA,GAAA,IAAA,CAAA,IAAA,CAAA,iBAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA,MAAA,IAAA,EAAA,CAAA,QAAA,CAAA,WAAA,CAAA,CAAA,WAAA,EAAA,EAAA;AACA,QAAA,OAAA,CAAA,GAAA,QAAA,EAAA,GAAA,kBAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,OAAA,CAAA,GAAA,QAAA,EAAA,WAAA,CAAA,CAAA;AACA,KAAA,EAAA,EAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA,gBAAA,CAAA,CAAA,GAAA,CAAA,OAAA,IAAA,IAAA,CAAA,QAAA,CAAA,gBAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { setAsyncContextStrategy, ensureHubOnCarrier, getHubFromCarrier, setHubOnCarrier } from '@sentry/core';
import * as domain from 'domain';

function getActiveDomain() {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
  return (domain ).active ;
}

function getCurrentHub() {
  const activeDomain = getActiveDomain();

  // If there's no active domain, just return undefined and the global hub will be used
  if (!activeDomain) {
    return undefined;
  }

  ensureHubOnCarrier(activeDomain);

  return getHubFromCarrier(activeDomain);
}

function createNewHub(parent) {
  const carrier = {};
  ensureHubOnCarrier(carrier, parent);
  return getHubFromCarrier(carrier);
}

function runWithAsyncContext(callback, options) {
  const activeDomain = getActiveDomain();

  if (activeDomain && _optionalChain([options, 'optionalAccess', _ => _.reuseExisting])) {
    // We're already in a domain, so we don't need to create a new one, just call the callback with the current hub
    return callback();
  }

  const local = domain.create() ;

  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : undefined;
  const newHub = createNewHub(parentHub);
  setHubOnCarrier(local, newHub);

  return local.bind(() => {
    return callback();
  })();
}

/**
 * Sets the async context strategy to use Node.js domains.
 */
function setDomainAsyncContextStrategy() {
  setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });
}

export { setDomainAsyncContextStrategy };
//# sourceMappingURL=domain.js.map
{"version":3,"file":"domain.js","sources":["../../../src/async/domain.ts"],"sourcesContent":["import type { Carrier, Hub, RunWithAsyncContextOptions } from '@sentry/core';\nimport { ensureHubOnCarrier, getHubFromCarrier, setAsyncContextStrategy, setHubOnCarrier } from '@sentry/core';\nimport * as domain from 'domain';\n\nfunction getActiveDomain<T>(): T | undefined {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n  return (domain as any).active as T | undefined;\n}\n\nfunction getCurrentHub(): Hub | undefined {\n  const activeDomain = getActiveDomain<Carrier>();\n\n  // If there's no active domain, just return undefined and the global hub will be used\n  if (!activeDomain) {\n    return undefined;\n  }\n\n  ensureHubOnCarrier(activeDomain);\n\n  return getHubFromCarrier(activeDomain);\n}\n\nfunction createNewHub(parent: Hub | undefined): Hub {\n  const carrier: Carrier = {};\n  ensureHubOnCarrier(carrier, parent);\n  return getHubFromCarrier(carrier);\n}\n\nfunction runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T {\n  const activeDomain = getActiveDomain<domain.Domain & Carrier>();\n\n  if (activeDomain && options?.reuseExisting) {\n    // We're already in a domain, so we don't need to create a new one, just call the callback with the current hub\n    return callback();\n  }\n\n  const local = domain.create() as domain.Domain & Carrier;\n\n  const parentHub = activeDomain ? getHubFromCarrier(activeDomain) : undefined;\n  const newHub = createNewHub(parentHub);\n  setHubOnCarrier(local, newHub);\n\n  return local.bind(() => {\n    return callback();\n  })();\n}\n\n/**\n * Sets the async context strategy to use Node.js domains.\n */\nexport function setDomainAsyncContextStrategy(): void {\n  setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });\n}\n"],"names":[],"mappings":";;;;AAIA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,eAAA,CAAA,EAAA;EACA,CAAA,EAA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CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,EAAA;AACA;;AAEA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,6BAAA,CAAA,EAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { setAsyncContextStrategy, ensureHubOnCarrier, getHubFromCarrier } from '@sentry/core';
import * as async_hooks from 'async_hooks';

/**
 * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.
 */
function setHooksAsyncContextStrategy() {
  const asyncStorage = new (async_hooks ).AsyncLocalStorage();

  function getCurrentHub() {
    return asyncStorage.getStore();
  }

  function createNewHub(parent) {
    const carrier = {};
    ensureHubOnCarrier(carrier, parent);
    return getHubFromCarrier(carrier);
  }

  function runWithAsyncContext(callback, options) {
    const existingHub = getCurrentHub();

    if (existingHub && _optionalChain([options, 'optionalAccess', _ => _.reuseExisting])) {
      // We're already in an async context, so we don't need to create a new one
      // just call the callback with the current hub
      return callback();
    }

    const newHub = createNewHub(existingHub);

    return asyncStorage.run(newHub, () => {
      return callback();
    });
  }

  setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });
}

export { setHooksAsyncContextStrategy };
//# sourceMappingURL=hooks.js.map
{"version":3,"file":"hooks.js","sources":["../../../src/async/hooks.ts"],"sourcesContent":["import type { Carrier, Hub, RunWithAsyncContextOptions } from '@sentry/core';\nimport { ensureHubOnCarrier, getHubFromCarrier, setAsyncContextStrategy } from '@sentry/core';\nimport * as async_hooks from 'async_hooks';\n\ninterface AsyncLocalStorage<T> {\n  getStore(): T | undefined;\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;\n}\n\ntype AsyncLocalStorageConstructor = { new <T>(): AsyncLocalStorage<T> };\n// AsyncLocalStorage only exists in async_hook after Node v12.17.0 or v13.10.0\ntype NewerAsyncHooks = typeof async_hooks & { AsyncLocalStorage: AsyncLocalStorageConstructor };\n\n/**\n * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.\n */\nexport function setHooksAsyncContextStrategy(): void {\n  const asyncStorage = new (async_hooks as NewerAsyncHooks).AsyncLocalStorage<Hub>();\n\n  function getCurrentHub(): Hub | undefined {\n    return asyncStorage.getStore();\n  }\n\n  function createNewHub(parent: Hub | undefined): Hub {\n    const carrier: Carrier = {};\n    ensureHubOnCarrier(carrier, parent);\n    return getHubFromCarrier(carrier);\n  }\n\n  function runWithAsyncContext<T>(callback: () => T, options: RunWithAsyncContextOptions): T {\n    const existingHub = getCurrentHub();\n\n    if (existingHub && options?.reuseExisting) {\n      // We're already in an async context, so we don't need to create a new one\n      // just call the callback with the current hub\n      return callback();\n    }\n\n    const newHub = createNewHub(existingHub);\n\n    return asyncStorage.run(newHub, () => {\n      return callback();\n    });\n  }\n\n  setAsyncContextStrategy({ getCurrentHub, runWithAsyncContext });\n}\n"],"names":[],"mappings":";;;;AAcA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,4BAAA,CAAA,EAAA;EACA,CAAA,CAAA,CAAA,CAAA,EAAA,aAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,aAAA,CAAA,EAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAA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CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,CAAA;EACA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA;AACA;;"}import { NODE_VERSION } from '../nodeVersion.js';
import { setDomainAsyncContextStrategy } from './domain.js';
import { setHooksAsyncContextStrategy } from './hooks.js';

/**
 * Sets the correct async context strategy for Node.js
 *
 * Node.js >= 14 uses AsyncLocalStorage
 * Node.js < 14 uses domains
 */
function setNodeAsyncContextStrategy() {
  if (NODE_VERSION.major && NODE_VERSION.major >= 14) {
    setHooksAsyncContextStrategy();
  } else {
    setDomainAsyncContextStrategy();
  }
}

export { setNodeAsyncContextStrategy };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/async/index.ts"],"sourcesContent":["import { NODE_VERSION } from '../nodeVersion';\nimport { setDomainAsyncContextStrategy } from './domain';\nimport { setHooksAsyncContextStrategy } from './hooks';\n\n/**\n * Sets the correct async context strategy for Node.js\n *\n * Node.js >= 14 uses AsyncLocalStorage\n * Node.js < 14 uses domains\n */\nexport function setNodeAsyncContextStrategy(): void {\n  if (NODE_VERSION.major && NODE_VERSION.major >= 14) {\n    setHooksAsyncContextStrategy();\n  } else {\n    setDomainAsyncContextStrategy();\n  }\n}\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,2BAAA,GAAA;AACA,EAAA,IAAA,YAAA,CAAA,KAAA,IAAA,YAAA,CAAA,KAAA,IAAA,EAAA,EAAA;AACA,IAAA,4BAAA,EAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,6BAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { BaseClient, SDK_VERSION, addTracingExtensions, SessionFlusher } from '@sentry/core';
import { logger, resolvedSyncPromise } from '@sentry/utils';
import * as os from 'os';
import { TextEncoder } from 'util';
import { eventFromUnknownInput, eventFromMessage } from './eventbuilder.js';

/**
 * The Sentry Node SDK Client.
 *
 * @see NodeClientOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
class NodeClient extends BaseClient {

  /**
   * Creates a new Node SDK instance.
   * @param options Configuration options for this SDK.
   */
   constructor(options) {
    options._metadata = options._metadata || {};
    options._metadata.sdk = options._metadata.sdk || {
      name: 'sentry.javascript.node',
      packages: [
        {
          name: 'npm:@sentry/node',
          version: SDK_VERSION,
        },
      ],
      version: SDK_VERSION,
    };

    // Until node supports global TextEncoder in all versions we support, we are forced to pass it from util
    options.transportOptions = {
      textEncoder: new TextEncoder(),
      ...options.transportOptions,
    };

    // The Node client always supports tracing
    addTracingExtensions();

    super(options);
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   captureException(exception, hint, scope) {
    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only
    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload
    // sent to the Server only when the `requestHandler` middleware is used
    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
      const requestSession = scope.getRequestSession();

      // Necessary checks to ensure this is code block is executed only within a request
      // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage
      if (requestSession && requestSession.status === 'ok') {
        requestSession.status = 'errored';
      }
    }

    return super.captureException(exception, hint, scope);
  }

  /**
   * @inheritDoc
   */
   captureEvent(event, hint, scope) {
    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only
    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload
    // sent to the Server only when the `requestHandler` middleware is used
    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {
      const eventType = event.type || 'exception';
      const isException =
        eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0;

      // If the event is of type Exception, then a request session should be captured
      if (isException) {
        const requestSession = scope.getRequestSession();

        // Ensure that this is happening within the bounds of a request, and make sure not to override
        // Session Status if Errored / Crashed
        if (requestSession && requestSession.status === 'ok') {
          requestSession.status = 'errored';
        }
      }
    }

    return super.captureEvent(event, hint, scope);
  }

  /**
   *
   * @inheritdoc
   */
   close(timeout) {
    _optionalChain([this, 'access', _ => _._sessionFlusher, 'optionalAccess', _2 => _2.close, 'call', _3 => _3()]);
    return super.close(timeout);
  }

  /** Method that initialises an instance of SessionFlusher on Client */
   initSessionFlusher() {
    const { release, environment } = this._options;
    if (!release) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!');
    } else {
      this._sessionFlusher = new SessionFlusher(this, {
        release,
        environment,
      });
    }
  }

  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
   eventFromException(exception, hint) {
    return resolvedSyncPromise(eventFromUnknownInput(this._options.stackParser, exception, hint));
  }

  /**
   * @inheritDoc
   */
   eventFromMessage(
    message,
    // eslint-disable-next-line deprecation/deprecation
    level = 'info',
    hint,
  ) {
    return resolvedSyncPromise(
      eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace),
    );
  }

  /**
   * @inheritDoc
   */
   _prepareEvent(event, hint, scope) {
    event.platform = event.platform || 'node';
    event.contexts = {
      ...event.contexts,
      runtime: _optionalChain([event, 'access', _4 => _4.contexts, 'optionalAccess', _5 => _5.runtime]) || {
        name: 'node',
        version: global.process.version,
      },
    };
    event.server_name =
      event.server_name || this.getOptions().serverName || global.process.env.SENTRY_NAME || os.hostname();
    return super._prepareEvent(event, hint, scope);
  }

  /**
   * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment
   * appropriate session aggregates bucket
   */
   _captureRequestSession() {
    if (!this._sessionFlusher) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Discarded request mode session because autoSessionTracking option was disabled');
    } else {
      this._sessionFlusher.incrementSessionStatusCount();
    }
  }
}

export { NodeClient };
//# sourceMappingURL=client.js.map
{"version":3,"file":"client.js","sources":["../../src/client.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addTracingExtensions, BaseClient, SDK_VERSION, SessionFlusher } from '@sentry/core';\nimport type { Event, EventHint, Severity, SeverityLevel } from '@sentry/types';\nimport { logger, resolvedSyncPromise } from '@sentry/utils';\nimport * as os from 'os';\nimport { TextEncoder } from 'util';\n\nimport { eventFromMessage, eventFromUnknownInput } from './eventbuilder';\nimport type { NodeClientOptions } from './types';\n\n/**\n * The Sentry Node SDK Client.\n *\n * @see NodeClientOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nexport class NodeClient extends BaseClient<NodeClientOptions> {\n  protected _sessionFlusher: SessionFlusher | undefined;\n\n  /**\n   * Creates a new Node SDK instance.\n   * @param options Configuration options for this SDK.\n   */\n  public constructor(options: NodeClientOptions) {\n    options._metadata = options._metadata || {};\n    options._metadata.sdk = options._metadata.sdk || {\n      name: 'sentry.javascript.node',\n      packages: [\n        {\n          name: 'npm:@sentry/node',\n          version: SDK_VERSION,\n        },\n      ],\n      version: SDK_VERSION,\n    };\n\n    // Until node supports global TextEncoder in all versions we support, we are forced to pass it from util\n    options.transportOptions = {\n      textEncoder: new TextEncoder(),\n      ...options.transportOptions,\n    };\n\n    // The Node client always supports tracing\n    addTracingExtensions();\n\n    super(options);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined {\n    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n    // sent to the Server only when the `requestHandler` middleware is used\n    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {\n      const requestSession = scope.getRequestSession();\n\n      // Necessary checks to ensure this is code block is executed only within a request\n      // Should override the status only if `requestSession.status` is `Ok`, which is its initial stage\n      if (requestSession && requestSession.status === 'ok') {\n        requestSession.status = 'errored';\n      }\n    }\n\n    return super.captureException(exception, hint, scope);\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined {\n    // Check if the flag `autoSessionTracking` is enabled, and if `_sessionFlusher` exists because it is initialised only\n    // when the `requestHandler` middleware is used, and hence the expectation is to have SessionAggregates payload\n    // sent to the Server only when the `requestHandler` middleware is used\n    if (this._options.autoSessionTracking && this._sessionFlusher && scope) {\n      const eventType = event.type || 'exception';\n      const isException =\n        eventType === 'exception' && event.exception && event.exception.values && event.exception.values.length > 0;\n\n      // If the event is of type Exception, then a request session should be captured\n      if (isException) {\n        const requestSession = scope.getRequestSession();\n\n        // Ensure that this is happening within the bounds of a request, and make sure not to override\n        // Session Status if Errored / Crashed\n        if (requestSession && requestSession.status === 'ok') {\n          requestSession.status = 'errored';\n        }\n      }\n    }\n\n    return super.captureEvent(event, hint, scope);\n  }\n\n  /**\n   *\n   * @inheritdoc\n   */\n  public close(timeout?: number): PromiseLike<boolean> {\n    this._sessionFlusher?.close();\n    return super.close(timeout);\n  }\n\n  /** Method that initialises an instance of SessionFlusher on Client */\n  public initSessionFlusher(): void {\n    const { release, environment } = this._options;\n    if (!release) {\n      __DEBUG_BUILD__ && logger.warn('Cannot initialise an instance of SessionFlusher if no release is provided!');\n    } else {\n      this._sessionFlusher = new SessionFlusher(this, {\n        release,\n        environment,\n      });\n    }\n  }\n\n  /**\n   * @inheritDoc\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n  public eventFromException(exception: any, hint?: EventHint): PromiseLike<Event> {\n    return resolvedSyncPromise(eventFromUnknownInput(this._options.stackParser, exception, hint));\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public eventFromMessage(\n    message: string,\n    // eslint-disable-next-line deprecation/deprecation\n    level: Severity | SeverityLevel = 'info',\n    hint?: EventHint,\n  ): PromiseLike<Event> {\n    return resolvedSyncPromise(\n      eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace),\n    );\n  }\n\n  /**\n   * @inheritDoc\n   */\n  protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null> {\n    event.platform = event.platform || 'node';\n    event.contexts = {\n      ...event.contexts,\n      runtime: event.contexts?.runtime || {\n        name: 'node',\n        version: global.process.version,\n      },\n    };\n    event.server_name =\n      event.server_name || this.getOptions().serverName || global.process.env.SENTRY_NAME || os.hostname();\n    return super._prepareEvent(event, hint, scope);\n  }\n\n  /**\n   * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment\n   * appropriate session aggregates bucket\n   */\n  protected _captureRequestSession(): void {\n    if (!this._sessionFlusher) {\n      __DEBUG_BUILD__ && logger.warn('Discarded request mode session because autoSessionTracking option was disabled');\n    } else {\n      this._sessionFlusher.incrementSessionStatusCount();\n    }\n  }\n}\n"],"names":[],"mappings":";;;;;;;AAUA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,EAAA,CAAA,CAAA,CAAA,EAAA;MACA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;IACA;EACA;AACA;;"}import { getCurrentHub } from '@sentry/core';
import { isError, isPlainObject, extractExceptionKeysForMessage, normalizeToSize, addExceptionTypeValue, addExceptionMechanism } from '@sentry/utils';

/**
 * Extracts stack frames from the error.stack string
 */
function parseStackFrames(stackParser, error) {
  return stackParser(error.stack || '', 1);
}

/**
 * Extracts stack frames from the error and builds a Sentry Exception
 */
function exceptionFromError(stackParser, error) {
  const exception = {
    type: error.name || error.constructor.name,
    value: error.message,
  };

  const frames = parseStackFrames(stackParser, error);
  if (frames.length) {
    exception.stacktrace = { frames };
  }

  return exception;
}

/**
 * Builds and Event from a Exception
 * @hidden
 */
function eventFromUnknownInput(stackParser, exception, hint) {
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  let ex = exception;
  const providedMechanism =
    hint && hint.data && (hint.data ).mechanism;
  const mechanism = providedMechanism || {
    handled: true,
    type: 'generic',
  };

  if (!isError(exception)) {
    if (isPlainObject(exception)) {
      // This will allow us to group events based on top-level keys
      // which is much better than creating new group when any key/value change
      const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;

      const hub = getCurrentHub();
      const client = hub.getClient();
      const normalizeDepth = client && client.getOptions().normalizeDepth;
      hub.configureScope(scope => {
        scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));
      });

      ex = (hint && hint.syntheticException) || new Error(message);
      (ex ).message = message;
    } else {
      // This handles when someone does: `throw "something awesome";`
      // We use synthesized Error here so we can extract a (rough) stack trace.
      ex = (hint && hint.syntheticException) || new Error(exception );
      (ex ).message = exception ;
    }
    mechanism.synthetic = true;
  }

  const event = {
    exception: {
      values: [exceptionFromError(stackParser, ex )],
    },
  };

  addExceptionTypeValue(event, undefined, undefined);
  addExceptionMechanism(event, mechanism);

  return {
    ...event,
    event_id: hint && hint.event_id,
  };
}

/**
 * Builds and Event from a Message
 * @hidden
 */
function eventFromMessage(
  stackParser,
  message,
  // eslint-disable-next-line deprecation/deprecation
  level = 'info',
  hint,
  attachStacktrace,
) {
  const event = {
    event_id: hint && hint.event_id,
    level,
    message,
  };

  if (attachStacktrace && hint && hint.syntheticException) {
    const frames = parseStackFrames(stackParser, hint.syntheticException);
    if (frames.length) {
      event.exception = {
        values: [
          {
            value: message,
            stacktrace: { frames },
          },
        ],
      };
    }
  }

  return event;
}

export { eventFromMessage, eventFromUnknownInput, exceptionFromError, parseStackFrames };
//# sourceMappingURL=eventbuilder.js.map
{"version":3,"file":"eventbuilder.js","sources":["../../src/eventbuilder.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type {\n  Event,\n  EventHint,\n  Exception,\n  Mechanism,\n  Severity,\n  SeverityLevel,\n  StackFrame,\n  StackParser,\n} from '@sentry/types';\nimport {\n  addExceptionMechanism,\n  addExceptionTypeValue,\n  extractExceptionKeysForMessage,\n  isError,\n  isPlainObject,\n  normalizeToSize,\n} from '@sentry/utils';\n\n/**\n * Extracts stack frames from the error.stack string\n */\nexport function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[] {\n  return stackParser(error.stack || '', 1);\n}\n\n/**\n * Extracts stack frames from the error and builds a Sentry Exception\n */\nexport function exceptionFromError(stackParser: StackParser, error: Error): Exception {\n  const exception: Exception = {\n    type: error.name || error.constructor.name,\n    value: error.message,\n  };\n\n  const frames = parseStackFrames(stackParser, error);\n  if (frames.length) {\n    exception.stacktrace = { frames };\n  }\n\n  return exception;\n}\n\n/**\n * Builds and Event from a Exception\n * @hidden\n */\nexport function eventFromUnknownInput(stackParser: StackParser, exception: unknown, hint?: EventHint): Event {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  let ex: unknown = exception;\n  const providedMechanism: Mechanism | undefined =\n    hint && hint.data && (hint.data as { mechanism: Mechanism }).mechanism;\n  const mechanism: Mechanism = providedMechanism || {\n    handled: true,\n    type: 'generic',\n  };\n\n  if (!isError(exception)) {\n    if (isPlainObject(exception)) {\n      // This will allow us to group events based on top-level keys\n      // which is much better than creating new group when any key/value change\n      const message = `Non-Error exception captured with keys: ${extractExceptionKeysForMessage(exception)}`;\n\n      const hub = getCurrentHub();\n      const client = hub.getClient();\n      const normalizeDepth = client && client.getOptions().normalizeDepth;\n      hub.configureScope(scope => {\n        scope.setExtra('__serialized__', normalizeToSize(exception, normalizeDepth));\n      });\n\n      ex = (hint && hint.syntheticException) || new Error(message);\n      (ex as Error).message = message;\n    } else {\n      // This handles when someone does: `throw \"something awesome\";`\n      // We use synthesized Error here so we can extract a (rough) stack trace.\n      ex = (hint && hint.syntheticException) || new Error(exception as string);\n      (ex as Error).message = exception as string;\n    }\n    mechanism.synthetic = true;\n  }\n\n  const event = {\n    exception: {\n      values: [exceptionFromError(stackParser, ex as Error)],\n    },\n  };\n\n  addExceptionTypeValue(event, undefined, undefined);\n  addExceptionMechanism(event, mechanism);\n\n  return {\n    ...event,\n    event_id: hint && hint.event_id,\n  };\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nexport function eventFromMessage(\n  stackParser: StackParser,\n  message: string,\n  // eslint-disable-next-line deprecation/deprecation\n  level: Severity | SeverityLevel = 'info',\n  hint?: EventHint,\n  attachStacktrace?: boolean,\n): Event {\n  const event: Event = {\n    event_id: hint && hint.event_id,\n    level,\n    message,\n  };\n\n  if (attachStacktrace && hint && hint.syntheticException) {\n    const frames = parseStackFrames(stackParser, hint.syntheticException);\n    if (frames.length) {\n      event.exception = {\n        values: [\n          {\n            value: message,\n            stacktrace: { frames },\n          },\n        ],\n      };\n    }\n  }\n\n  return event;\n}\n"],"names":[],"mappings":";;;AAoBA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA,EAAA,OAAA,WAAA,CAAA,KAAA,CAAA,KAAA,IAAA,EAAA,EAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,WAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA;AACA,IAAA,IAAA,EAAA,KAAA,CAAA,IAAA,IAAA,KAAA,CAAA,WAAA,CAAA,IAAA;AACA,IAAA,KAAA,EAAA,KAAA,CAAA,OAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,gBAAA,CAAA,WAAA,EAAA,KAAA,CAAA,CAAA;AACA,EAAA,IAAA,MAAA,CAAA,MAAA,EAAA;AACA,IAAA,SAAA,CAAA,UAAA,GAAA,EAAA,MAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AAC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} from '@sentry/utils/esm/buildPolyfills';
import { getCurrentHub, hasTracingEnabled, startTransaction, runWithAsyncContext, withScope, captureException } from '@sentry/core';
import { logger, isString, extractTraceparentData, baggageHeaderToDynamicSamplingContext, extractPathForTransaction, addRequestDataToTransaction, normalize, dropUndefinedKeys } from '@sentry/utils';
import { extractRequestData } from './requestdata.js';
import { isAutoSessionTrackingEnabled, flush } from './sdk.js';
export { extractRequestData, parseRequest } from './requestDataDeprecated.js';

/* eslint-disable @typescript-eslint/no-explicit-any */

/**
 * Express-compatible tracing handler.
 * @see Exposed as `Handlers.tracingHandler`
 */
function tracingHandler()

 {
  return function sentryTracingMiddleware(
    req,
    res,
    next,
  ) {
    const hub = getCurrentHub();
    const options = _optionalChain([hub, 'access', _ => _.getClient, 'call', _2 => _2(), 'optionalAccess', _3 => _3.getOptions, 'call', _4 => _4()]);

    if (
      !options ||
      options.instrumenter !== 'sentry' ||
      _optionalChain([req, 'access', _5 => _5.method, 'optionalAccess', _6 => _6.toUpperCase, 'call', _7 => _7()]) === 'OPTIONS' ||
      _optionalChain([req, 'access', _8 => _8.method, 'optionalAccess', _9 => _9.toUpperCase, 'call', _10 => _10()]) === 'HEAD'
    ) {
      return next();
    }

    if (!hasTracingEnabled(options)) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn(
          'Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting ' +
            'either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options.',
        );
      return next();
    }

    // If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision)
    const traceparentData =
      req.headers && isString(req.headers['sentry-trace']) && extractTraceparentData(req.headers['sentry-trace']);
    const incomingBaggageHeaders = _optionalChain([req, 'access', _11 => _11.headers, 'optionalAccess', _12 => _12.baggage]);
    const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(incomingBaggageHeaders);

    const [name, source] = extractPathForTransaction(req, { path: true, method: true });
    const transaction = startTransaction(
      {
        name,
        op: 'http.server',
        ...traceparentData,
        metadata: {
          dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,
          // The request should already have been stored in `scope.sdkProcessingMetadata` (which will become
          // `event.sdkProcessingMetadata` the same way the metadata here will) by `sentryRequestMiddleware`, but on the
          // off chance someone is using `sentryTracingMiddleware` without `sentryRequestMiddleware`, it doesn't hurt to
          // be sure
          request: req,
          source,
        },
      },
      // extra context passed to the tracesSampler
      { request: extractRequestData(req) },
    );

    // We put the transaction on the scope so users can attach children to it
    hub.configureScope(scope => {
      scope.setSpan(transaction);
    });

    // We also set __sentry_transaction on the response so people can grab the transaction there to add
    // spans to it later.
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    (res ).__sentry_transaction = transaction;

    res.once('finish', () => {
      // Push `transaction.finish` to the next event loop so open spans have a chance to finish before the transaction
      // closes
      setImmediate(() => {
        addRequestDataToTransaction(transaction, req);
        transaction.setHttpStatus(res.statusCode);
        transaction.finish();
      });
    });

    next();
  };
}

/**
 * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the
 * `AddRequestDataToEventOptions` interface.
 *
 * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`.
 */
function convertReqHandlerOptsToAddReqDataOpts(
  reqHandlerOptions = {},
) {
  let addRequestDataOptions;

  if ('include' in reqHandlerOptions) {
    addRequestDataOptions = { include: reqHandlerOptions.include };
  } else {
    // eslint-disable-next-line deprecation/deprecation
    const { ip, request, transaction, user } = reqHandlerOptions ;

    if (ip || request || transaction || user) {
      addRequestDataOptions = { include: dropUndefinedKeys({ ip, request, transaction, user }) };
    }
  }

  return addRequestDataOptions;
}

/**
 * Express compatible request handler.
 * @see Exposed as `Handlers.requestHandler`
 */
function requestHandler(
  options,
) {
  // TODO (v8): Get rid of this
  const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts(options);

  const currentHub = getCurrentHub();
  const client = currentHub.getClient();
  // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the
  // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode
  if (client && isAutoSessionTrackingEnabled(client)) {
    client.initSessionFlusher();

    // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode
    const scope = currentHub.getScope();
    if (scope && scope.getSession()) {
      scope.setSession();
    }
  }

  return function sentryRequestMiddleware(
    req,
    res,
    next,
  ) {
    if (options && options.flushTimeout && options.flushTimeout > 0) {
      // eslint-disable-next-line @typescript-eslint/unbound-method
      const _end = res.end;
      res.end = function (chunk, encoding, cb) {
        void flush(options.flushTimeout)
          .then(() => {
            _end.call(this, chunk, encoding, cb);
          })
          .then(null, e => {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(e);
            _end.call(this, chunk, encoding, cb);
          });
      };
    }
    runWithAsyncContext(() => {
      const currentHub = getCurrentHub();
      currentHub.configureScope(scope => {
        scope.setSDKProcessingMetadata({
          request: req,
          // TODO (v8): Stop passing this
          requestDataOptionsFromExpressHandler: requestDataOptions,
        });

        const client = currentHub.getClient();
        if (isAutoSessionTrackingEnabled(client)) {
          const scope = currentHub.getScope();
          if (scope) {
            // Set `status` of `RequestSession` to Ok, at the beginning of the request
            scope.setRequestSession({ status: 'ok' });
          }
        }
      });

      res.once('finish', () => {
        const client = currentHub.getClient();
        if (isAutoSessionTrackingEnabled(client)) {
          setImmediate(() => {
            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
            if (client && (client )._captureRequestSession) {
              // Calling _captureRequestSession to capture request session at the end of the request by incrementing
              // the correct SessionAggregates bucket i.e. crashed, errored or exited
              // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
              (client )._captureRequestSession();
            }
          });
        }
      });
      next();
    });
  };
}

/** JSDoc */

/** JSDoc */
function getStatusCodeFromResponse(error) {
  const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);
  return statusCode ? parseInt(statusCode , 10) : 500;
}

/** Returns true if response code is internal server error */
function defaultShouldHandleError(error) {
  const status = getStatusCodeFromResponse(error);
  return status >= 500;
}

/**
 * Express compatible error handler.
 * @see Exposed as `Handlers.errorHandler`
 */
function errorHandler(options

)

 {
  return function sentryErrorMiddleware(
    error,
    _req,
    res,
    next,
  ) {
    const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError;

    if (shouldHandleError(error)) {
      withScope(_scope => {
        // The request should already have been stored in `scope.sdkProcessingMetadata` by `sentryRequestMiddleware`,
        // but on the off chance someone is using `sentryErrorMiddleware` without `sentryRequestMiddleware`, it doesn't
        // hurt to be sure
        _scope.setSDKProcessingMetadata({ request: _req });

        // For some reason we need to set the transaction on the scope again
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        const transaction = (res ).__sentry_transaction ;
        if (transaction && _scope.getSpan() === undefined) {
          _scope.setSpan(transaction);
        }

        const client = getCurrentHub().getClient();
        if (client && isAutoSessionTrackingEnabled(client)) {
          // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the
          // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only
          // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be
          // running in SessionAggregates mode
          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
          const isSessionAggregatesMode = (client )._sessionFlusher !== undefined;
          if (isSessionAggregatesMode) {
            const requestSession = _scope.getRequestSession();
            // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a
            // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within
            // the bounds of a request, and if so the status is updated
            if (requestSession && requestSession.status !== undefined) {
              requestSession.status = 'crashed';
            }
          }
        }

        const eventId = captureException(error);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        (res ).sentry = eventId;
        next(error);
      });

      return;
    }

    next(error);
  };
}

/**
 * Sentry tRPC middleware that names the handling transaction after the called procedure.
 *
 * Use the Sentry tRPC middleware in combination with the Sentry server integration,
 * e.g. Express Request Handlers or Next.js SDK.
 */
function trpcMiddleware(options = {}) {
  return function ({ path, type, next, rawInput }) {
    const hub = getCurrentHub();
    const clientOptions = _optionalChain([hub, 'access', _13 => _13.getClient, 'call', _14 => _14(), 'optionalAccess', _15 => _15.getOptions, 'call', _16 => _16()]);
    const sentryTransaction = _optionalChain([hub, 'access', _17 => _17.getScope, 'call', _18 => _18(), 'optionalAccess', _19 => _19.getTransaction, 'call', _20 => _20()]);

    if (sentryTransaction) {
      sentryTransaction.setName(`trcp/${path}`, 'route');
      sentryTransaction.op = 'rpc.server';

      const trpcContext = {
        procedure_type: type,
      };

      if (options.attachRpcInput !== undefined ? options.attachRpcInput : _optionalChain([clientOptions, 'optionalAccess', _21 => _21.sendDefaultPii])) {
        trpcContext.input = normalize(rawInput);
      }

      sentryTransaction.setContext('trpc', trpcContext);
    }

    return next();
  };
}

export { errorHandler, requestHandler, tracingHandler, trpcMiddleware };
//# sourceMappingURL=handlers.js.map
{"version":3,"file":"handlers.js","sources":["../../src/handlers.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport {\n  captureException,\n  getCurrentHub,\n  hasTracingEnabled,\n  runWithAsyncContext,\n  startTransaction,\n  withScope,\n} from '@sentry/core';\nimport type { Span } from '@sentry/types';\nimport type { AddRequestDataToEventOptions } from '@sentry/utils';\nimport {\n  addRequestDataToTransaction,\n  baggageHeaderToDynamicSamplingContext,\n  dropUndefinedKeys,\n  extractPathForTransaction,\n  extractTraceparentData,\n  isString,\n  logger,\n  normalize,\n} from '@sentry/utils';\nimport type * as http from 'http';\n\nimport type { NodeClient } from './client';\nimport { extractRequestData } from './requestdata';\n// TODO (v8 / XXX) Remove this import\nimport type { ParseRequestOptions } from './requestDataDeprecated';\nimport { flush, isAutoSessionTrackingEnabled } from './sdk';\n\n/**\n * Express-compatible tracing handler.\n * @see Exposed as `Handlers.tracingHandler`\n */\nexport function tracingHandler(): (\n  req: http.IncomingMessage,\n  res: http.ServerResponse,\n  next: (error?: any) => void,\n) => void {\n  return function sentryTracingMiddleware(\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error?: any) => void,\n  ): void {\n    const hub = getCurrentHub();\n    const options = hub.getClient()?.getOptions();\n\n    if (\n      !options ||\n      options.instrumenter !== 'sentry' ||\n      req.method?.toUpperCase() === 'OPTIONS' ||\n      req.method?.toUpperCase() === 'HEAD'\n    ) {\n      return next();\n    }\n\n    if (!hasTracingEnabled(options)) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          'Sentry `tracingHandler` is being used, but tracing is disabled. Please enable tracing by setting ' +\n            'either `tracesSampleRate` or `tracesSampler` in your `Sentry.init()` options.',\n        );\n      return next();\n    }\n\n    // If there is a trace header set, we extract the data from it (parentSpanId, traceId, and sampling decision)\n    const traceparentData =\n      req.headers && isString(req.headers['sentry-trace']) && extractTraceparentData(req.headers['sentry-trace']);\n    const incomingBaggageHeaders = req.headers?.baggage;\n    const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(incomingBaggageHeaders);\n\n    const [name, source] = extractPathForTransaction(req, { path: true, method: true });\n    const transaction = startTransaction(\n      {\n        name,\n        op: 'http.server',\n        ...traceparentData,\n        metadata: {\n          dynamicSamplingContext: traceparentData && !dynamicSamplingContext ? {} : dynamicSamplingContext,\n          // The request should already have been stored in `scope.sdkProcessingMetadata` (which will become\n          // `event.sdkProcessingMetadata` the same way the metadata here will) by `sentryRequestMiddleware`, but on the\n          // off chance someone is using `sentryTracingMiddleware` without `sentryRequestMiddleware`, it doesn't hurt to\n          // be sure\n          request: req,\n          source,\n        },\n      },\n      // extra context passed to the tracesSampler\n      { request: extractRequestData(req) },\n    );\n\n    // We put the transaction on the scope so users can attach children to it\n    hub.configureScope(scope => {\n      scope.setSpan(transaction);\n    });\n\n    // We also set __sentry_transaction on the response so people can grab the transaction there to add\n    // spans to it later.\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    (res as any).__sentry_transaction = transaction;\n\n    res.once('finish', () => {\n      // Push `transaction.finish` to the next event loop so open spans have a chance to finish before the transaction\n      // closes\n      setImmediate(() => {\n        addRequestDataToTransaction(transaction, req);\n        transaction.setHttpStatus(res.statusCode);\n        transaction.finish();\n      });\n    });\n\n    next();\n  };\n}\n\nexport type RequestHandlerOptions =\n  // TODO (v8 / XXX) Remove ParseRequestOptions type and eslint override\n  // eslint-disable-next-line deprecation/deprecation\n  | (ParseRequestOptions | AddRequestDataToEventOptions) & {\n      flushTimeout?: number;\n    };\n\n/**\n * Backwards compatibility shim which can be removed in v8. Forces the given options to follow the\n * `AddRequestDataToEventOptions` interface.\n *\n * TODO (v8): Get rid of this, and stop passing `requestDataOptionsFromExpressHandler` to `setSDKProcessingMetadata`.\n */\nfunction convertReqHandlerOptsToAddReqDataOpts(\n  reqHandlerOptions: RequestHandlerOptions = {},\n): AddRequestDataToEventOptions | undefined {\n  let addRequestDataOptions: AddRequestDataToEventOptions | undefined;\n\n  if ('include' in reqHandlerOptions) {\n    addRequestDataOptions = { include: reqHandlerOptions.include };\n  } else {\n    // eslint-disable-next-line deprecation/deprecation\n    const { ip, request, transaction, user } = reqHandlerOptions as ParseRequestOptions;\n\n    if (ip || request || transaction || user) {\n      addRequestDataOptions = { include: dropUndefinedKeys({ ip, request, transaction, user }) };\n    }\n  }\n\n  return addRequestDataOptions;\n}\n\n/**\n * Express compatible request handler.\n * @see Exposed as `Handlers.requestHandler`\n */\nexport function requestHandler(\n  options?: RequestHandlerOptions,\n): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void {\n  // TODO (v8): Get rid of this\n  const requestDataOptions = convertReqHandlerOptsToAddReqDataOpts(options);\n\n  const currentHub = getCurrentHub();\n  const client = currentHub.getClient<NodeClient>();\n  // Initialise an instance of SessionFlusher on the client when `autoSessionTracking` is enabled and the\n  // `requestHandler` middleware is used indicating that we are running in SessionAggregates mode\n  if (client && isAutoSessionTrackingEnabled(client)) {\n    client.initSessionFlusher();\n\n    // If Scope contains a Single mode Session, it is removed in favor of using Session Aggregates mode\n    const scope = currentHub.getScope();\n    if (scope && scope.getSession()) {\n      scope.setSession();\n    }\n  }\n\n  return function sentryRequestMiddleware(\n    req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error?: any) => void,\n  ): void {\n    if (options && options.flushTimeout && options.flushTimeout > 0) {\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      const _end = res.end;\n      res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): void {\n        void flush(options.flushTimeout)\n          .then(() => {\n            _end.call(this, chunk, encoding, cb);\n          })\n          .then(null, e => {\n            __DEBUG_BUILD__ && logger.error(e);\n            _end.call(this, chunk, encoding, cb);\n          });\n      };\n    }\n    runWithAsyncContext(() => {\n      const currentHub = getCurrentHub();\n      currentHub.configureScope(scope => {\n        scope.setSDKProcessingMetadata({\n          request: req,\n          // TODO (v8): Stop passing this\n          requestDataOptionsFromExpressHandler: requestDataOptions,\n        });\n\n        const client = currentHub.getClient<NodeClient>();\n        if (isAutoSessionTrackingEnabled(client)) {\n          const scope = currentHub.getScope();\n          if (scope) {\n            // Set `status` of `RequestSession` to Ok, at the beginning of the request\n            scope.setRequestSession({ status: 'ok' });\n          }\n        }\n      });\n\n      res.once('finish', () => {\n        const client = currentHub.getClient<NodeClient>();\n        if (isAutoSessionTrackingEnabled(client)) {\n          setImmediate(() => {\n            // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n            if (client && (client as any)._captureRequestSession) {\n              // Calling _captureRequestSession to capture request session at the end of the request by incrementing\n              // the correct SessionAggregates bucket i.e. crashed, errored or exited\n              // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n              (client as any)._captureRequestSession();\n            }\n          });\n        }\n      });\n      next();\n    });\n  };\n}\n\n/** JSDoc */\ninterface MiddlewareError extends Error {\n  status?: number | string;\n  statusCode?: number | string;\n  status_code?: number | string;\n  output?: {\n    statusCode?: number | string;\n  };\n}\n\n/** JSDoc */\nfunction getStatusCodeFromResponse(error: MiddlewareError): number {\n  const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);\n  return statusCode ? parseInt(statusCode as string, 10) : 500;\n}\n\n/** Returns true if response code is internal server error */\nfunction defaultShouldHandleError(error: MiddlewareError): boolean {\n  const status = getStatusCodeFromResponse(error);\n  return status >= 500;\n}\n\n/**\n * Express compatible error handler.\n * @see Exposed as `Handlers.errorHandler`\n */\nexport function errorHandler(options?: {\n  /**\n   * Callback method deciding whether error should be captured and sent to Sentry\n   * @param error Captured middleware error\n   */\n  shouldHandleError?(this: void, error: MiddlewareError): boolean;\n}): (\n  error: MiddlewareError,\n  req: http.IncomingMessage,\n  res: http.ServerResponse,\n  next: (error: MiddlewareError) => void,\n) => void {\n  return function sentryErrorMiddleware(\n    error: MiddlewareError,\n    _req: http.IncomingMessage,\n    res: http.ServerResponse,\n    next: (error: MiddlewareError) => void,\n  ): void {\n    const shouldHandleError = (options && options.shouldHandleError) || defaultShouldHandleError;\n\n    if (shouldHandleError(error)) {\n      withScope(_scope => {\n        // The request should already have been stored in `scope.sdkProcessingMetadata` by `sentryRequestMiddleware`,\n        // but on the off chance someone is using `sentryErrorMiddleware` without `sentryRequestMiddleware`, it doesn't\n        // hurt to be sure\n        _scope.setSDKProcessingMetadata({ request: _req });\n\n        // For some reason we need to set the transaction on the scope again\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        const transaction = (res as any).__sentry_transaction as Span;\n        if (transaction && _scope.getSpan() === undefined) {\n          _scope.setSpan(transaction);\n        }\n\n        const client = getCurrentHub().getClient<NodeClient>();\n        if (client && isAutoSessionTrackingEnabled(client)) {\n          // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the\n          // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only\n          // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be\n          // running in SessionAggregates mode\n          // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n          const isSessionAggregatesMode = (client as any)._sessionFlusher !== undefined;\n          if (isSessionAggregatesMode) {\n            const requestSession = _scope.getRequestSession();\n            // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a\n            // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within\n            // the bounds of a request, and if so the status is updated\n            if (requestSession && requestSession.status !== undefined) {\n              requestSession.status = 'crashed';\n            }\n          }\n        }\n\n        const eventId = captureException(error);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        (res as any).sentry = eventId;\n        next(error);\n      });\n\n      return;\n    }\n\n    next(error);\n  };\n}\n\ninterface SentryTrpcMiddlewareOptions {\n  /** Whether to include procedure inputs in reported events. Defaults to `false`. */\n  attachRpcInput?: boolean;\n}\n\ninterface TrpcMiddlewareArguments<T> {\n  path: string;\n  type: 'query' | 'mutation' | 'subscription';\n  next: () => T;\n  rawInput: unknown;\n}\n\n/**\n * Sentry tRPC middleware that names the handling transaction after the called procedure.\n *\n * Use the Sentry tRPC middleware in combination with the Sentry server integration,\n * e.g. Express Request Handlers or Next.js SDK.\n */\nexport function trpcMiddleware(options: SentryTrpcMiddlewareOptions = {}) {\n  return function <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>): T {\n    const hub = getCurrentHub();\n    const clientOptions = hub.getClient()?.getOptions();\n    const sentryTransaction = hub.getScope()?.getTransaction();\n\n    if (sentryTransaction) {\n      sentryTransaction.setName(`trcp/${path}`, 'route');\n      sentryTransaction.op = 'rpc.server';\n\n      const trpcContext: Record<string, unknown> = {\n        procedure_type: type,\n      };\n\n      if (options.attachRpcInput !== undefined ? options.attachRpcInput : clientOptions?.sendDefaultPii) {\n        trpcContext.input = normalize(rawInput);\n      }\n\n      sentryTransaction.setContext('trpc', trpcContext);\n    }\n\n    return next();\n  };\n}\n\n// TODO (v8 / #5257): Remove this\n// eslint-disable-next-line deprecation/deprecation\nexport type { ParseRequestOptions, ExpressRequest } from './requestDataDeprecated';\n// eslint-disable-next-line deprecation/deprecation\nexport { parseRequest, extractRequestData } from './requestDataDeprecated';\n"],"names":[],"mappings":";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AAA,CAAA,CAAA;MACA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA;;IAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA;AACA;;"}import { Integrations } from '@sentry/core';
export { Hub, SDK_VERSION, Scope, addBreadcrumb, addGlobalEventProcessor, captureEvent, captureException, captureMessage, configureScope, createTransport, extractTraceparentData, getActiveTransaction, getCurrentHub, getHubFromCarrier, makeMain, runWithAsyncContext, setContext, setExtra, setExtras, setTag, setTags, setUser, spanStatusfromHttpCode, startTransaction, trace, withScope } from '@sentry/core';
export { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing/index.js';
export { NodeClient } from './client.js';
export { makeNodeTransport } from './transports/http.js';
export { close, defaultIntegrations, defaultStackParser, flush, getSentryRelease, init, lastEventId } from './sdk.js';
export { DEFAULT_USER_INCLUDES, addRequestDataToEvent, extractRequestData } from './requestdata.js';
export { deepReadDirSync } from './utils.js';
import * as handlers from './handlers.js';
export { handlers as Handlers };
import * as index from './integrations/index.js';
import * as integrations from './tracing/integrations.js';

const INTEGRATIONS = {
  ...Integrations,
  ...index,
  ...integrations,
};

export { INTEGRATIONS as Integrations };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["export type {\n  Breadcrumb,\n  BreadcrumbHint,\n  PolymorphicRequest,\n  Request,\n  SdkInfo,\n  Event,\n  EventHint,\n  Exception,\n  Session,\n  // eslint-disable-next-line deprecation/deprecation\n  Severity,\n  SeverityLevel,\n  Span,\n  StackFrame,\n  Stacktrace,\n  Thread,\n  Transaction,\n  User,\n} from '@sentry/types';\nexport type { AddRequestDataToEventOptions } from '@sentry/utils';\n\nexport type { TransactionNamingScheme } from './requestdata';\nexport type { NodeOptions } from './types';\n\nexport {\n  addGlobalEventProcessor,\n  addBreadcrumb,\n  captureException,\n  captureEvent,\n  captureMessage,\n  configureScope,\n  createTransport,\n  extractTraceparentData,\n  getActiveTransaction,\n  getHubFromCarrier,\n  getCurrentHub,\n  Hub,\n  makeMain,\n  runWithAsyncContext,\n  Scope,\n  startTransaction,\n  SDK_VERSION,\n  setContext,\n  setExtra,\n  setExtras,\n  setTag,\n  setTags,\n  setUser,\n  spanStatusfromHttpCode,\n  trace,\n  withScope,\n} from '@sentry/core';\nexport type { SpanStatusType } from '@sentry/core';\nexport { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing';\n\nexport { NodeClient } from './client';\nexport { makeNodeTransport } from './transports';\nexport { defaultIntegrations, init, defaultStackParser, lastEventId, flush, close, getSentryRelease } from './sdk';\nexport { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from './requestdata';\nexport { deepReadDirSync } from './utils';\n\nimport { Integrations as CoreIntegrations } from '@sentry/core';\n\nimport * as Handlers from './handlers';\nimport * as NodeIntegrations from './integrations';\nimport * as TracingIntegrations from './tracing/integrations';\n\nconst INTEGRATIONS = {\n  ...CoreIntegrations,\n  ...NodeIntegrations,\n  ...TracingIntegrations,\n};\n\nexport { INTEGRATIONS as Integrations, Handlers };\n"],"names":["CoreIntegrations","NodeIntegrations","TracingIntegrations"],"mappings":";;;;;;;;;;;;;AAoEA,MAAA,YAAA,GAAA;AACA,EAAA,GAAAA,YAAA;AACA,EAAA,GAAAC,KAAA;AACA,EAAA,GAAAC,YAAA;AACA;;;;"}import { getCurrentHub } from '@sentry/core';
import { fill, severityLevelFromString } from '@sentry/utils';
import * as util from 'util';

/** Console module integration */
class Console  {constructor() { Console.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Console';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Console.id;}

  /**
   * @inheritDoc
   */
   setupOnce() {
    for (const level of ['debug', 'info', 'warn', 'error', 'log']) {
      fill(console, level, createConsoleWrapper(level));
    }
  }
} Console.__initStatic();

/**
 * Wrapper function that'll be used for every console level
 */
function createConsoleWrapper(level) {
  return function consoleWrapper(originalConsoleMethod) {
    const sentryLevel = severityLevelFromString(level);

    /* eslint-disable prefer-rest-params */
    return function () {
      if (getCurrentHub().getIntegration(Console)) {
        getCurrentHub().addBreadcrumb(
          {
            category: 'console',
            level: sentryLevel,
            message: util.format.apply(undefined, arguments),
          },
          {
            input: [...arguments],
            level,
          },
        );
      }

      originalConsoleMethod.apply(this, arguments);
    };
    /* eslint-enable prefer-rest-params */
  };
}

export { Console };
//# sourceMappingURL=console.js.map
{"version":3,"file":"console.js","sources":["../../../src/integrations/console.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { fill, severityLevelFromString } from '@sentry/utils';\nimport * as util from 'util';\n\n/** Console module integration */\nexport class Console implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Console';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Console.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    for (const level of ['debug', 'info', 'warn', 'error', 'log']) {\n      fill(console, level, createConsoleWrapper(level));\n    }\n  }\n}\n\n/**\n * Wrapper function that'll be used for every console level\n */\nfunction createConsoleWrapper(level: string): (originalConsoleMethod: () => void) => void {\n  return function consoleWrapper(originalConsoleMethod: () => void): () => void {\n    const sentryLevel = severityLevelFromString(level);\n\n    /* eslint-disable prefer-rest-params */\n    return function (this: typeof console): void {\n      if (getCurrentHub().getIntegration(Console)) {\n        getCurrentHub().addBreadcrumb(\n          {\n            category: 'console',\n            level: sentryLevel,\n            message: util.format.apply(undefined, arguments),\n          },\n          {\n            input: [...arguments],\n            level,\n          },\n        );\n      }\n\n      originalConsoleMethod.apply(this, arguments);\n    };\n    /* eslint-enable prefer-rest-params */\n  };\n}\n"],"names":[],"mappings":";;;;AAKA;AACA,MAAA,OAAA,EAAA,CAAA,WAAA,GAAA,EAAA,OAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,OAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,KAAA,MAAA,KAAA,IAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,KAAA,CAAA,EAAA;AACA,MAAA,IAAA,CAAA,OAAA,EAAA,KAAA,EAAA,oBAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,CAAA,CAAA,OAAA,CAAA,YAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,SAAA,cAAA,CAAA,qBAAA,EAAA;AACA,IAAA,MAAA,WAAA,GAAA,uBAAA,CAAA,KAAA,CAAA,CAAA;AACA;AACA;AACA,IAAA,OAAA,YAAA;AACA,MAAA,IAAA,aAAA,EAAA,CAAA,cAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,aAAA,EAAA,CAAA,aAAA;AACA,UAAA;AACA,YAAA,QAAA,EAAA,SAAA;AACA,YAAA,KAAA,EAAA,WAAA;AACA,YAAA,OAAA,EAAA,IAAA,CAAA,MAAA,CAAA,KAAA,CAAA,SAAA,EAAA,SAAA,CAAA;AACA,WAAA;AACA,UAAA;AACA,YAAA,KAAA,EAAA,CAAA,GAAA,SAAA,CAAA;AACA,YAAA,KAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,qBAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA,GAAA,CAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { execFile } from 'child_process';
import { readFile, readdir } from 'fs';
import * as os from 'os';
import { join } from 'path';
import { promisify } from 'util';

// TODO: Required until we drop support for Node v8
const readFileAsync = promisify(readFile);
const readDirAsync = promisify(readdir);

/** Add node modules / packages to the event */
class Context  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Context';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Context.id;}

  /**
   * Caches context so it's only evaluated once
   */

   constructor(  _options = { app: true, os: true, device: true, culture: true }) {this._options = _options;Context.prototype.__init.call(this);
    //
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    addGlobalEventProcessor(event => this.addContext(event));
  }

  /** Processes an event and adds context */
   async addContext(event) {
    if (this._cachedContext === undefined) {
      this._cachedContext = this._getContexts();
    }

    const updatedContext = this._updateContext(await this._cachedContext);

    event.contexts = {
      ...event.contexts,
      app: { ...updatedContext.app, ..._optionalChain([event, 'access', _ => _.contexts, 'optionalAccess', _2 => _2.app]) },
      os: { ...updatedContext.os, ..._optionalChain([event, 'access', _3 => _3.contexts, 'optionalAccess', _4 => _4.os]) },
      device: { ...updatedContext.device, ..._optionalChain([event, 'access', _5 => _5.contexts, 'optionalAccess', _6 => _6.device]) },
      culture: { ...updatedContext.culture, ..._optionalChain([event, 'access', _7 => _7.contexts, 'optionalAccess', _8 => _8.culture]) },
    };

    return event;
  }

  /**
   * Updates the context with dynamic values that can change
   */
   _updateContext(contexts) {
    // Only update properties if they exist
    if (_optionalChain([contexts, 'optionalAccess', _9 => _9.app, 'optionalAccess', _10 => _10.app_memory])) {
      contexts.app.app_memory = process.memoryUsage().rss;
    }

    if (_optionalChain([contexts, 'optionalAccess', _11 => _11.device, 'optionalAccess', _12 => _12.free_memory])) {
      contexts.device.free_memory = os.freemem();
    }

    return contexts;
  }

  /**
   * Gets the contexts for the current environment
   */
   async _getContexts() {
    const contexts = {};

    if (this._options.os) {
      contexts.os = await getOsContext();
    }

    if (this._options.app) {
      contexts.app = getAppContext();
    }

    if (this._options.device) {
      contexts.device = getDeviceContext(this._options.device);
    }

    if (this._options.culture) {
      const culture = getCultureContext();

      if (culture) {
        contexts.culture = culture;
      }
    }

    return contexts;
  }
}Context.__initStatic();

/**
 * Returns the operating system context.
 *
 * Based on the current platform, this uses a different strategy to provide the
 * most accurate OS information. Since this might involve spawning subprocesses
 * or accessing the file system, this should only be executed lazily and cached.
 *
 *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context
 *    has a `name`, `version`, `build` and `kernel_version` set.
 *  - On Linux, this will try to load a distribution release from `/etc` and set
 *    the `name`, `version` and `kernel_version` fields.
 *  - On all other platforms, only a `name` and `version` will be returned. Note
 *    that `version` might actually be the kernel version.
 */
async function getOsContext() {
  const platformId = os.platform();
  switch (platformId) {
    case 'darwin':
      return getDarwinInfo();
    case 'linux':
      return getLinuxInfo();
    default:
      return {
        name: PLATFORM_NAMES[platformId] || platformId,
        version: os.release(),
      };
  }
}

function getCultureContext() {
  try {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
    if (typeof (process.versions ).icu !== 'string') {
      // Node was built without ICU support
      return;
    }

    // Check that node was built with full Intl support. Its possible it was built without support for non-English
    // locales which will make resolvedOptions inaccurate
    //
    // https://nodejs.org/api/intl.html#detecting-internationalization-support
    const january = new Date(9e8);
    const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
    if (spanish.format(january) === 'enero') {
      const options = Intl.DateTimeFormat().resolvedOptions();

      return {
        locale: options.locale,
        timezone: options.timeZone,
      };
    }
  } catch (err) {
    //
  }

  return;
}

function getAppContext() {
  const app_memory = process.memoryUsage().rss;
  const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();

  return { app_start_time, app_memory };
}

/**
 * Gets device information from os
 */
function getDeviceContext(deviceOpt) {
  const device = {};

  // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).
  // Hence, we only set boot time, if we get a valid uptime value.
  // @see https://github.com/getsentry/sentry-javascript/issues/5856
  const uptime = os.uptime && os.uptime();
  if (typeof uptime === 'number') {
    device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();
  }

  device.arch = os.arch();

  if (deviceOpt === true || deviceOpt.memory) {
    device.memory_size = os.totalmem();
    device.free_memory = os.freemem();
  }

  if (deviceOpt === true || deviceOpt.cpu) {
    const cpuInfo = os.cpus();
    if (cpuInfo && cpuInfo.length) {
      const firstCpu = cpuInfo[0];

      device.processor_count = cpuInfo.length;
      device.cpu_description = firstCpu.model;
      device.processor_frequency = firstCpu.speed;
    }
  }

  return device;
}

/** Mapping of Node's platform names to actual OS names. */
const PLATFORM_NAMES = {
  aix: 'IBM AIX',
  freebsd: 'FreeBSD',
  openbsd: 'OpenBSD',
  sunos: 'SunOS',
  win32: 'Windows',
};

/** Linux version file to check for a distribution. */

/** Mapping of linux release files located in /etc to distributions. */
const LINUX_DISTROS = [
  { name: 'fedora-release', distros: ['Fedora'] },
  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },
  { name: 'redhat_version', distros: ['Red Hat Linux'] },
  { name: 'SuSE-release', distros: ['SUSE Linux'] },
  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },
  { name: 'debian_version', distros: ['Debian'] },
  { name: 'debian_release', distros: ['Debian'] },
  { name: 'arch-release', distros: ['Arch Linux'] },
  { name: 'gentoo-release', distros: ['Gentoo Linux'] },
  { name: 'novell-release', distros: ['SUSE Linux'] },
  { name: 'alpine-release', distros: ['Alpine Linux'] },
];

/** Functions to extract the OS version from Linux release files. */
const LINUX_VERSIONS

 = {
  alpine: content => content,
  arch: content => matchFirst(/distrib_release=(.*)/, content),
  centos: content => matchFirst(/release ([^ ]+)/, content),
  debian: content => content,
  fedora: content => matchFirst(/release (..)/, content),
  mint: content => matchFirst(/distrib_release=(.*)/, content),
  red: content => matchFirst(/release ([^ ]+)/, content),
  suse: content => matchFirst(/VERSION = (.*)\n/, content),
  ubuntu: content => matchFirst(/distrib_release=(.*)/, content),
};

/**
 * Executes a regular expression with one capture group.
 *
 * @param regex A regular expression to execute.
 * @param text Content to execute the RegEx on.
 * @returns The captured string if matched; otherwise undefined.
 */
function matchFirst(regex, text) {
  const match = regex.exec(text);
  return match ? match[1] : undefined;
}

/** Loads the macOS operating system context. */
async function getDarwinInfo() {
  // Default values that will be used in case no operating system information
  // can be loaded. The default version is computed via heuristics from the
  // kernel version, but the build ID is missing.
  const darwinInfo = {
    kernel_version: os.release(),
    name: 'Mac OS X',
    version: `10.${Number(os.release().split('.')[0]) - 4}`,
  };

  try {
    // We try to load the actual macOS version by executing the `sw_vers` tool.
    // This tool should be available on every standard macOS installation. In
    // case this fails, we stick with the values computed above.

    const output = await new Promise((resolve, reject) => {
      execFile('/usr/bin/sw_vers', (error, stdout) => {
        if (error) {
          reject(error);
          return;
        }
        resolve(stdout);
      });
    });

    darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
    darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
    darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
  } catch (e) {
    // ignore
  }

  return darwinInfo;
}

/** Returns a distribution identifier to look up version callbacks. */
function getLinuxDistroId(name) {
  return name.split(' ')[0].toLowerCase();
}

/** Loads the Linux operating system context. */
async function getLinuxInfo() {
  // By default, we cannot assume anything about the distribution or Linux
  // version. `os.release()` returns the kernel version and we assume a generic
  // "Linux" name, which will be replaced down below.
  const linuxInfo = {
    kernel_version: os.release(),
    name: 'Linux',
  };

  try {
    // We start guessing the distribution by listing files in the /etc
    // directory. This is were most Linux distributions (except Knoppix) store
    // release files with certain distribution-dependent meta data. We search
    // for exactly one known file defined in `LINUX_DISTROS` and exit if none
    // are found. In case there are more than one file, we just stick with the
    // first one.
    const etcFiles = await readDirAsync('/etc');
    const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));
    if (!distroFile) {
      return linuxInfo;
    }

    // Once that file is known, load its contents. To make searching in those
    // files easier, we lowercase the file contents. Since these files are
    // usually quite small, this should not allocate too much memory and we only
    // hold on to it for a very short amount of time.
    const distroPath = join('/etc', distroFile.name);
    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase();

    // Some Linux distributions store their release information in the same file
    // (e.g. RHEL and Centos). In those cases, we scan the file for an
    // identifier, that basically consists of the first word of the linux
    // distribution name (e.g. "red" for Red Hat). In case there is no match, we
    // just assume the first distribution in our list.
    const { distros } = distroFile;
    linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];

    // Based on the found distribution, we can now compute the actual version
    // number. This is different for every distribution, so several strategies
    // are computed in `LINUX_VERSIONS`.
    const id = getLinuxDistroId(linuxInfo.name);
    linuxInfo.version = LINUX_VERSIONS[id](contents);
  } catch (e) {
    // ignore
  }

  return linuxInfo;
}

export { Context, getDeviceContext, readDirAsync, readFileAsync };
//# sourceMappingURL=context.js.map
{"version":3,"file":"context.js","sources":["../../../src/integrations/context.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport type {\n  AppContext,\n  Contexts,\n  CultureContext,\n  DeviceContext,\n  Event,\n  EventProcessor,\n  Integration,\n  OsContext,\n} from '@sentry/types';\nimport { execFile } from 'child_process';\nimport { readdir, readFile } from 'fs';\nimport * as os from 'os';\nimport { join } from 'path';\nimport { promisify } from 'util';\n\n// TODO: Required until we drop support for Node v8\nexport const readFileAsync = promisify(readFile);\nexport const readDirAsync = promisify(readdir);\n\ninterface DeviceContextOptions {\n  cpu?: boolean;\n  memory?: boolean;\n}\n\ninterface ContextOptions {\n  app?: boolean;\n  os?: boolean;\n  device?: DeviceContextOptions | boolean;\n  culture?: boolean;\n}\n\n/** Add node modules / packages to the event */\nexport class Context implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Context';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Context.id;\n\n  /**\n   * Caches context so it's only evaluated once\n   */\n  private _cachedContext: Promise<Contexts> | undefined;\n\n  public constructor(private readonly _options: ContextOptions = { app: true, os: true, device: true, culture: true }) {\n    //\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(event => this.addContext(event));\n  }\n\n  /** Processes an event and adds context */\n  public async addContext(event: Event): Promise<Event> {\n    if (this._cachedContext === undefined) {\n      this._cachedContext = this._getContexts();\n    }\n\n    const updatedContext = this._updateContext(await this._cachedContext);\n\n    event.contexts = {\n      ...event.contexts,\n      app: { ...updatedContext.app, ...event.contexts?.app },\n      os: { ...updatedContext.os, ...event.contexts?.os },\n      device: { ...updatedContext.device, ...event.contexts?.device },\n      culture: { ...updatedContext.culture, ...event.contexts?.culture },\n    };\n\n    return event;\n  }\n\n  /**\n   * Updates the context with dynamic values that can change\n   */\n  private _updateContext(contexts: Contexts): Contexts {\n    // Only update properties if they exist\n    if (contexts?.app?.app_memory) {\n      contexts.app.app_memory = process.memoryUsage().rss;\n    }\n\n    if (contexts?.device?.free_memory) {\n      contexts.device.free_memory = os.freemem();\n    }\n\n    return contexts;\n  }\n\n  /**\n   * Gets the contexts for the current environment\n   */\n  private async _getContexts(): Promise<Contexts> {\n    const contexts: Contexts = {};\n\n    if (this._options.os) {\n      contexts.os = await getOsContext();\n    }\n\n    if (this._options.app) {\n      contexts.app = getAppContext();\n    }\n\n    if (this._options.device) {\n      contexts.device = getDeviceContext(this._options.device);\n    }\n\n    if (this._options.culture) {\n      const culture = getCultureContext();\n\n      if (culture) {\n        contexts.culture = culture;\n      }\n    }\n\n    return contexts;\n  }\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n *  - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n *    has a `name`, `version`, `build` and `kernel_version` set.\n *  - On Linux, this will try to load a distribution release from `/etc` and set\n *    the `name`, `version` and `kernel_version` fields.\n *  - On all other platforms, only a `name` and `version` will be returned. Note\n *    that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n  const platformId = os.platform();\n  switch (platformId) {\n    case 'darwin':\n      return getDarwinInfo();\n    case 'linux':\n      return getLinuxInfo();\n    default:\n      return {\n        name: PLATFORM_NAMES[platformId] || platformId,\n        version: os.release(),\n      };\n  }\n}\n\nfunction getCultureContext(): CultureContext | undefined {\n  try {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n    if (typeof (process.versions as unknown as any).icu !== 'string') {\n      // Node was built without ICU support\n      return;\n    }\n\n    // Check that node was built with full Intl support. Its possible it was built without support for non-English\n    // locales which will make resolvedOptions inaccurate\n    //\n    // https://nodejs.org/api/intl.html#detecting-internationalization-support\n    const january = new Date(9e8);\n    const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n    if (spanish.format(january) === 'enero') {\n      const options = Intl.DateTimeFormat().resolvedOptions();\n\n      return {\n        locale: options.locale,\n        timezone: options.timeZone,\n      };\n    }\n  } catch (err) {\n    //\n  }\n\n  return;\n}\n\nfunction getAppContext(): AppContext {\n  const app_memory = process.memoryUsage().rss;\n  const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n\n  return { app_start_time, app_memory };\n}\n\n/**\n * Gets device information from os\n */\nexport function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext {\n  const device: DeviceContext = {};\n\n  // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n  // Hence, we only set boot time, if we get a valid uptime value.\n  // @see https://github.com/getsentry/sentry-javascript/issues/5856\n  const uptime = os.uptime && os.uptime();\n  if (typeof uptime === 'number') {\n    device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n  }\n\n  device.arch = os.arch();\n\n  if (deviceOpt === true || deviceOpt.memory) {\n    device.memory_size = os.totalmem();\n    device.free_memory = os.freemem();\n  }\n\n  if (deviceOpt === true || deviceOpt.cpu) {\n    const cpuInfo: os.CpuInfo[] | undefined = os.cpus();\n    if (cpuInfo && cpuInfo.length) {\n      const firstCpu = cpuInfo[0];\n\n      device.processor_count = cpuInfo.length;\n      device.cpu_description = firstCpu.model;\n      device.processor_frequency = firstCpu.speed;\n    }\n  }\n\n  return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n  aix: 'IBM AIX',\n  freebsd: 'FreeBSD',\n  openbsd: 'OpenBSD',\n  sunos: 'SunOS',\n  win32: 'Windows',\n};\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n  /** The file name, located in `/etc`. */\n  name: string;\n  /** Potential distributions to check. */\n  distros: string[];\n}\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n  { name: 'fedora-release', distros: ['Fedora'] },\n  { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n  { name: 'redhat_version', distros: ['Red Hat Linux'] },\n  { name: 'SuSE-release', distros: ['SUSE Linux'] },\n  { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n  { name: 'debian_version', distros: ['Debian'] },\n  { name: 'debian_release', distros: ['Debian'] },\n  { name: 'arch-release', distros: ['Arch Linux'] },\n  { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n  { name: 'novell-release', distros: ['SUSE Linux'] },\n  { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n  [identifier: string]: (content: string) => string | undefined;\n} = {\n  alpine: content => content,\n  arch: content => matchFirst(/distrib_release=(.*)/, content),\n  centos: content => matchFirst(/release ([^ ]+)/, content),\n  debian: content => content,\n  fedora: content => matchFirst(/release (..)/, content),\n  mint: content => matchFirst(/distrib_release=(.*)/, content),\n  red: content => matchFirst(/release ([^ ]+)/, content),\n  suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n  ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n  const match = regex.exec(text);\n  return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n  // Default values that will be used in case no operating system information\n  // can be loaded. The default version is computed via heuristics from the\n  // kernel version, but the build ID is missing.\n  const darwinInfo: OsContext = {\n    kernel_version: os.release(),\n    name: 'Mac OS X',\n    version: `10.${Number(os.release().split('.')[0]) - 4}`,\n  };\n\n  try {\n    // We try to load the actual macOS version by executing the `sw_vers` tool.\n    // This tool should be available on every standard macOS installation. In\n    // case this fails, we stick with the values computed above.\n\n    const output = await new Promise<string>((resolve, reject) => {\n      execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n        if (error) {\n          reject(error);\n          return;\n        }\n        resolve(stdout);\n      });\n    });\n\n    darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n    darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n    darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n  } catch (e) {\n    // ignore\n  }\n\n  return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n  return name.split(' ')[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n  // By default, we cannot assume anything about the distribution or Linux\n  // version. `os.release()` returns the kernel version and we assume a generic\n  // \"Linux\" name, which will be replaced down below.\n  const linuxInfo: OsContext = {\n    kernel_version: os.release(),\n    name: 'Linux',\n  };\n\n  try {\n    // We start guessing the distribution by listing files in the /etc\n    // directory. This is were most Linux distributions (except Knoppix) store\n    // release files with certain distribution-dependent meta data. We search\n    // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n    // are found. In case there are more than one file, we just stick with the\n    // first one.\n    const etcFiles = await readDirAsync('/etc');\n    const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n    if (!distroFile) {\n      return linuxInfo;\n    }\n\n    // Once that file is known, load its contents. To make searching in those\n    // files easier, we lowercase the file contents. Since these files are\n    // usually quite small, this should not allocate too much memory and we only\n    // hold on to it for a very short amount of time.\n    const distroPath = join('/etc', distroFile.name);\n    const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) as string).toLowerCase();\n\n    // Some Linux distributions store their release information in the same file\n    // (e.g. RHEL and Centos). In those cases, we scan the file for an\n    // identifier, that basically consists of the first word of the linux\n    // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n    // just assume the first distribution in our list.\n    const { distros } = distroFile;\n    linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n    // Based on the found distribution, we can now compute the actual version\n    // number. This is different for every distribution, so several strategies\n    // are computed in `LINUX_VERSIONS`.\n    const id = getLinuxDistroId(linuxInfo.name);\n    linuxInfo.version = LINUX_VERSIONS[id](contents);\n  } catch (e) {\n    // ignore\n  }\n\n  return linuxInfo;\n}\n"],"names":[],"mappings":";;;;;;;AAiBA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,C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AA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA;IACA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,SAAA;AACA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { addContextToFrame } from '@sentry/utils';
import { readFile } from 'fs';
import { LRUMap } from 'lru_map';

const FILE_CONTENT_CACHE = new LRUMap(100);
const DEFAULT_LINES_OF_CONTEXT = 7;

// TODO: Replace with promisify when minimum supported node >= v8
function readTextFileAsync(path) {
  return new Promise((resolve, reject) => {
    readFile(path, 'utf8', (err, data) => {
      if (err) reject(err);
      else resolve(data);
    });
  });
}

/** Add node modules / packages to the event */
class ContextLines  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'ContextLines';}

  /**
   * @inheritDoc
   */
   __init() {this.name = ContextLines.id;}

   constructor(  _options = {}) {this._options = _options;ContextLines.prototype.__init.call(this);}

  /** Get's the number of context lines to add */
   get _contextLines() {
    return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor) {
    addGlobalEventProcessor(event => this.addSourceContext(event));
  }

  /** Processes an event and adds context lines */
   async addSourceContext(event) {
    // keep a lookup map of which files we've already enqueued to read,
    // so we don't enqueue the same file multiple times which would cause multiple i/o reads
    const enqueuedReadSourceFileTasks = {};
    const readSourceFileTasks = [];

    if (this._contextLines > 0 && _optionalChain([event, 'access', _2 => _2.exception, 'optionalAccess', _3 => _3.values])) {
      for (const exception of event.exception.values) {
        if (!_optionalChain([exception, 'access', _4 => _4.stacktrace, 'optionalAccess', _5 => _5.frames])) {
          continue;
        }

        // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.
        // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.
        for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {
          const frame = exception.stacktrace.frames[i];
          // Call cache.get to bump the file to the top of the cache and ensure we have not already
          // enqueued a read operation for this filename
          if (
            frame.filename &&
            !enqueuedReadSourceFileTasks[frame.filename] &&
            !FILE_CONTENT_CACHE.get(frame.filename)
          ) {
            readSourceFileTasks.push(_readSourceFile(frame.filename));
            enqueuedReadSourceFileTasks[frame.filename] = 1;
          }
        }
      }
    }

    // check if files to read > 0, if so, await all of them to be read before adding source contexts.
    // Normally, Promise.all here could be short circuited if one of the promises rejects, but we
    // are guarding from that by wrapping the i/o read operation in a try/catch.
    if (readSourceFileTasks.length > 0) {
      await Promise.all(readSourceFileTasks);
    }

    // Perform the same loop as above, but this time we can assume all files are in the cache
    // and attempt to add source context to frames.
    if (this._contextLines > 0 && _optionalChain([event, 'access', _6 => _6.exception, 'optionalAccess', _7 => _7.values])) {
      for (const exception of event.exception.values) {
        if (exception.stacktrace && exception.stacktrace.frames) {
          await this.addSourceContextToFrames(exception.stacktrace.frames);
        }
      }
    }

    return event;
  }

  /** Adds context lines to frames */
   addSourceContextToFrames(frames) {
    for (const frame of frames) {
      // Only add context if we have a filename and it hasn't already been added
      if (frame.filename && frame.context_line === undefined) {
        const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);

        if (sourceFileLines) {
          try {
            addContextToFrame(sourceFileLines, frame, this._contextLines);
          } catch (e) {
            // anomaly, being defensive in case
            // unlikely to ever happen in practice but can definitely happen in theory
          }
        }
      }
    }
  }
}ContextLines.__initStatic();

/**
 * Reads file contents and caches them in a global LRU cache.
 * If reading fails, mark the file as null in the cache so we don't try again.
 *
 * @param filename filepath to read content from.
 */
async function _readSourceFile(filename) {
  const cachedFile = FILE_CONTENT_CACHE.get(filename);

  // We have already attempted to read this file and failed, do not try again
  if (cachedFile === null) {
    return null;
  }

  // We have a cache hit, return it
  if (cachedFile !== undefined) {
    return cachedFile;
  }

  // Guard from throwing if readFile fails, this enables us to use Promise.all and
  // not have it short circuiting if one of the promises rejects + since context lines are added
  // on a best effort basis, we want to throw here anyways.

  // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it
  let content = null;
  try {
    const rawFileContents = await readTextFileAsync(filename);
    content = rawFileContents.split('\n');
  } catch (_) {
    // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it
  }

  FILE_CONTENT_CACHE.set(filename, content);
  return content;
}

export { ContextLines };
//# sourceMappingURL=contextlines.js.map
{"version":3,"file":"contextlines.js","sources":["../../../src/integrations/contextlines.ts"],"sourcesContent":["import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types';\nimport { addContextToFrame } from '@sentry/utils';\nimport { readFile } from 'fs';\nimport { LRUMap } from 'lru_map';\n\nconst FILE_CONTENT_CACHE = new LRUMap<string, string[] | null>(100);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\n\n// TODO: Replace with promisify when minimum supported node >= v8\nfunction readTextFileAsync(path: string): Promise<string> {\n  return new Promise((resolve, reject) => {\n    readFile(path, 'utf8', (err, data) => {\n      if (err) reject(err);\n      else resolve(data);\n    });\n  });\n}\n\n/**\n * Resets the file cache. Exists for testing purposes.\n * @hidden\n */\nexport function resetFileContentCache(): void {\n  FILE_CONTENT_CACHE.clear();\n}\n\ninterface ContextLinesOptions {\n  /**\n   * Sets the number of context lines for each frame when loading a file.\n   * Defaults to 7.\n   *\n   * Set to 0 to disable loading and inclusion of source files.\n   **/\n  frameContextLines?: number;\n}\n\n/** Add node modules / packages to the event */\nexport class ContextLines implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'ContextLines';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = ContextLines.id;\n\n  public constructor(private readonly _options: ContextLinesOptions = {}) {}\n\n  /** Get's the number of context lines to add */\n  private get _contextLines(): number {\n    return this._options.frameContextLines !== undefined ? this._options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void {\n    addGlobalEventProcessor(event => this.addSourceContext(event));\n  }\n\n  /** Processes an event and adds context lines */\n  public async addSourceContext(event: Event): Promise<Event> {\n    // keep a lookup map of which files we've already enqueued to read,\n    // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n    const enqueuedReadSourceFileTasks: Record<string, number> = {};\n    const readSourceFileTasks: Promise<string[] | null>[] = [];\n\n    if (this._contextLines > 0 && event.exception?.values) {\n      for (const exception of event.exception.values) {\n        if (!exception.stacktrace?.frames) {\n          continue;\n        }\n\n        // We want to iterate in reverse order as calling cache.get will bump the file in our LRU cache.\n        // This ends up prioritizes source context for frames at the top of the stack instead of the bottom.\n        for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n          const frame = exception.stacktrace.frames[i];\n          // Call cache.get to bump the file to the top of the cache and ensure we have not already\n          // enqueued a read operation for this filename\n          if (\n            frame.filename &&\n            !enqueuedReadSourceFileTasks[frame.filename] &&\n            !FILE_CONTENT_CACHE.get(frame.filename)\n          ) {\n            readSourceFileTasks.push(_readSourceFile(frame.filename));\n            enqueuedReadSourceFileTasks[frame.filename] = 1;\n          }\n        }\n      }\n    }\n\n    // check if files to read > 0, if so, await all of them to be read before adding source contexts.\n    // Normally, Promise.all here could be short circuited if one of the promises rejects, but we\n    // are guarding from that by wrapping the i/o read operation in a try/catch.\n    if (readSourceFileTasks.length > 0) {\n      await Promise.all(readSourceFileTasks);\n    }\n\n    // Perform the same loop as above, but this time we can assume all files are in the cache\n    // and attempt to add source context to frames.\n    if (this._contextLines > 0 && event.exception?.values) {\n      for (const exception of event.exception.values) {\n        if (exception.stacktrace && exception.stacktrace.frames) {\n          await this.addSourceContextToFrames(exception.stacktrace.frames);\n        }\n      }\n    }\n\n    return event;\n  }\n\n  /** Adds context lines to frames */\n  public addSourceContextToFrames(frames: StackFrame[]): void {\n    for (const frame of frames) {\n      // Only add context if we have a filename and it hasn't already been added\n      if (frame.filename && frame.context_line === undefined) {\n        const sourceFileLines = FILE_CONTENT_CACHE.get(frame.filename);\n\n        if (sourceFileLines) {\n          try {\n            addContextToFrame(sourceFileLines, frame, this._contextLines);\n          } catch (e) {\n            // anomaly, being defensive in case\n            // unlikely to ever happen in practice but can definitely happen in theory\n          }\n        }\n      }\n    }\n  }\n}\n\n/**\n * Reads file contents and caches them in a global LRU cache.\n * If reading fails, mark the file as null in the cache so we don't try again.\n *\n * @param filename filepath to read content from.\n */\nasync function _readSourceFile(filename: string): Promise<string[] | null> {\n  const cachedFile = FILE_CONTENT_CACHE.get(filename);\n\n  // We have already attempted to read this file and failed, do not try again\n  if (cachedFile === null) {\n    return null;\n  }\n\n  // We have a cache hit, return it\n  if (cachedFile !== undefined) {\n    return cachedFile;\n  }\n\n  // Guard from throwing if readFile fails, this enables us to use Promise.all and\n  // not have it short circuiting if one of the promises rejects + since context lines are added\n  // on a best effort basis, we want to throw here anyways.\n\n  // If we made it to here, it means that our file is not cache nor marked as failed, so attempt to read it\n  let content: string[] | null = null;\n  try {\n    const rawFileContents = await readTextFileAsync(filename);\n    content = rawFileContents.split('\\n');\n  } catch (_) {\n    // if we fail, we will mark the file as null in the cache and short circuit next time we try to read it\n  }\n\n  FILE_CONTENT_CACHE.set(filename, content);\n  return content;\n}\n"],"names":[],"mappings":";;;;;AAKA,CAAA,CAAA,CAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA;;AAEA,CAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA;IACA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;EACA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAA;AACA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { getCurrentHub } from '@sentry/core';
import { logger, fill, dynamicSamplingContextToSentryBaggageHeader, stringMatchesSomePattern } from '@sentry/utils';
import { LRUMap } from 'lru_map';
import { NODE_VERSION } from '../nodeVersion.js';
import { normalizeRequestArgs, extractRawUrl, extractUrl, isSentryRequest, cleanSpanDescription } from './utils/http.js';

/**
 * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing
 * http requests and attaches trace data when tracing is enabled via its `tracing` option.
 */
class Http  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Http';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Http.id;}

  /**
   * @inheritDoc
   */
   constructor(options = {}) {Http.prototype.__init.call(this);
    this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;
    this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;
  }

  /**
   * @inheritDoc
   */
   setupOnce(
    _addGlobalEventProcessor,
    setupOnceGetCurrentHub,
  ) {
    // No need to instrument if we don't want to track anything
    if (!this._breadcrumbs && !this._tracing) {
      return;
    }

    const clientOptions = _optionalChain([setupOnceGetCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getOptions, 'call', _5 => _5()]);

    // Do not auto-instrument for other instrumenter
    if (clientOptions && clientOptions.instrumenter !== 'sentry') {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('HTTP Integration is skipped because of instrumenter configuration.');
      return;
    }

    // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions
    // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.
    const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;

    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const httpModule = require('http');
    const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);
    fill(httpModule, 'get', wrappedHttpHandlerMaker);
    fill(httpModule, 'request', wrappedHttpHandlerMaker);

    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
    // If we do, we'd get double breadcrumbs and double spans for `https` calls.
    // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.
    if (NODE_VERSION.major && NODE_VERSION.major > 8) {
      // eslint-disable-next-line @typescript-eslint/no-var-requires
      const httpsModule = require('https');
      const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(
        this._breadcrumbs,
        tracingOptions,
        httpsModule,
      );
      fill(httpsModule, 'get', wrappedHttpsHandlerMaker);
      fill(httpsModule, 'request', wrappedHttpsHandlerMaker);
    }
  }
}Http.__initStatic();

// for ease of reading below

/**
 * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`
 * and `https` modules. (NB: Not a typo - this is a creator^2!)
 *
 * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs
 * @param tracingEnabled Whether or not to record outgoing requests as tracing spans
 *
 * @returns A function which accepts the exiting handler and returns a wrapped handler
 */
function _createWrappedRequestMethodFactory(
  breadcrumbsEnabled,
  tracingOptions,
  httpModule,
) {
  // We're caching results so we don't have to recompute regexp every time we create a request.
  const createSpanUrlMap = new LRUMap(100);
  const headersUrlMap = {};

  const shouldCreateSpan = (url) => {
    if (_optionalChain([tracingOptions, 'optionalAccess', _6 => _6.shouldCreateSpanForRequest]) === undefined) {
      return true;
    }

    const cachedDecision = createSpanUrlMap.get(url);
    if (cachedDecision !== undefined) {
      return cachedDecision;
    }

    const decision = tracingOptions.shouldCreateSpanForRequest(url);
    createSpanUrlMap.set(url, decision);
    return decision;
  };

  const shouldAttachTraceData = (url) => {
    if (_optionalChain([tracingOptions, 'optionalAccess', _7 => _7.tracePropagationTargets]) === undefined) {
      return true;
    }

    if (headersUrlMap[url]) {
      return headersUrlMap[url];
    }

    headersUrlMap[url] = stringMatchesSomePattern(url, tracingOptions.tracePropagationTargets);

    return headersUrlMap[url];
  };

  return function wrappedRequestMethodFactory(originalRequestMethod) {
    return function wrappedMethod( ...args) {
      const requestArgs = normalizeRequestArgs(httpModule, args);
      const requestOptions = requestArgs[0];
      // eslint-disable-next-line deprecation/deprecation
      const rawRequestUrl = extractRawUrl(requestOptions);
      const requestUrl = extractUrl(requestOptions);

      // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method
      if (isSentryRequest(requestUrl)) {
        return originalRequestMethod.apply(httpModule, requestArgs);
      }

      let requestSpan;
      let parentSpan;

      const scope = getCurrentHub().getScope();

      const requestSpanData = {
        url: requestUrl,
        method: requestOptions.method || 'GET',
      };
      if (requestOptions.hash) {
        // strip leading "#"
        requestSpanData['http.fragment'] = requestOptions.hash.substring(1);
      }
      if (requestOptions.search) {
        // strip leading "?"
        requestSpanData['http.query'] = requestOptions.search.substring(1);
      }

      if (scope && tracingOptions && shouldCreateSpan(rawRequestUrl)) {
        parentSpan = scope.getSpan();

        if (parentSpan) {
          requestSpan = parentSpan.startChild({
            description: `${requestSpanData.method} ${requestSpanData.url}`,
            op: 'http.client',
            data: requestSpanData,
          });

          if (shouldAttachTraceData(rawRequestUrl)) {
            const sentryTraceHeader = requestSpan.toTraceparent();
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              logger.log(
                `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to "${requestUrl}": `,
              );

            requestOptions.headers = {
              ...requestOptions.headers,
              'sentry-trace': sentryTraceHeader,
            };

            if (parentSpan.transaction) {
              const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext();
              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);

              let newBaggageHeaderField;
              if (!requestOptions.headers || !requestOptions.headers.baggage) {
                newBaggageHeaderField = sentryBaggageHeader;
              } else if (!sentryBaggageHeader) {
                newBaggageHeaderField = requestOptions.headers.baggage;
              } else if (Array.isArray(requestOptions.headers.baggage)) {
                newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader];
              } else {
                // Type-cast explanation:
                // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity
                // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.
                newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] ;
              }

              requestOptions.headers = {
                ...requestOptions.headers,
                // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined
                ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }),
              };
            }
          } else {
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              logger.log(
                `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,
              );
          }
        }
      }

      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      return originalRequestMethod
        .apply(httpModule, requestArgs)
        .once('response', function ( res) {
          // eslint-disable-next-line @typescript-eslint/no-this-alias
          const req = this;
          if (breadcrumbsEnabled) {
            addRequestBreadcrumb('response', requestSpanData, req, res);
          }
          if (requestSpan) {
            if (res.statusCode) {
              requestSpan.setHttpStatus(res.statusCode);
            }
            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);
            requestSpan.finish();
          }
        })
        .once('error', function () {
          // eslint-disable-next-line @typescript-eslint/no-this-alias
          const req = this;

          if (breadcrumbsEnabled) {
            addRequestBreadcrumb('error', requestSpanData, req);
          }
          if (requestSpan) {
            requestSpan.setHttpStatus(500);
            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);
            requestSpan.finish();
          }
        });
    };
  };
}

/**
 * Captures Breadcrumb based on provided request/response pair
 */
function addRequestBreadcrumb(
  event,
  requestSpanData,
  req,
  res,
) {
  if (!getCurrentHub().getIntegration(Http)) {
    return;
  }

  getCurrentHub().addBreadcrumb(
    {
      category: 'http',
      data: {
        status_code: res && res.statusCode,
        ...requestSpanData,
      },
      type: 'http',
    },
    {
      event,
      request: req,
      response: res,
    },
  );
}

export { Http };
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { EventProcessor, Integration, SanitizedRequestData, Span, TracePropagationTargets } from '@sentry/types';\nimport { dynamicSamplingContextToSentryBaggageHeader, fill, logger, stringMatchesSomePattern } from '@sentry/utils';\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport { LRUMap } from 'lru_map';\n\nimport type { NodeClient } from '../client';\nimport { NODE_VERSION } from '../nodeVersion';\nimport type { RequestMethod, RequestMethodArgs } from './utils/http';\nimport { cleanSpanDescription, extractRawUrl, extractUrl, isSentryRequest, normalizeRequestArgs } from './utils/http';\n\ninterface TracingOptions {\n  /**\n   * List of strings/regex controlling to which outgoing requests\n   * the SDK will attach tracing headers.\n   *\n   * By default the SDK will attach those headers to all outgoing\n   * requests. If this option is provided, the SDK will match the\n   * request URL of outgoing requests against the items in this\n   * array, and only attach tracing headers if a match was found.\n   */\n  tracePropagationTargets?: TracePropagationTargets;\n\n  /**\n   * Function determining whether or not to create spans to track outgoing requests to the given URL.\n   * By default, spans will be created for all outgoing requests.\n   */\n  shouldCreateSpanForRequest?: (url: string) => boolean;\n}\n\ninterface HttpOptions {\n  /**\n   * Whether breadcrumbs should be recorded for requests\n   * Defaults to true\n   */\n  breadcrumbs?: boolean;\n\n  /**\n   * Whether tracing spans should be created for requests\n   * Defaults to false\n   */\n  tracing?: TracingOptions | boolean;\n}\n\n/**\n * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing\n * http requests and attaches trace data when tracing is enabled via its `tracing` option.\n */\nexport class Http implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Http';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Http.id;\n\n  private readonly _breadcrumbs: boolean;\n  private readonly _tracing: TracingOptions | undefined;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: HttpOptions = {}) {\n    this._breadcrumbs = typeof options.breadcrumbs === 'undefined' ? true : options.breadcrumbs;\n    this._tracing = !options.tracing ? undefined : options.tracing === true ? {} : options.tracing;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(\n    _addGlobalEventProcessor: (callback: EventProcessor) => void,\n    setupOnceGetCurrentHub: () => Hub,\n  ): void {\n    // No need to instrument if we don't want to track anything\n    if (!this._breadcrumbs && !this._tracing) {\n      return;\n    }\n\n    const clientOptions = setupOnceGetCurrentHub().getClient<NodeClient>()?.getOptions();\n\n    // Do not auto-instrument for other instrumenter\n    if (clientOptions && clientOptions.instrumenter !== 'sentry') {\n      __DEBUG_BUILD__ && logger.log('HTTP Integration is skipped because of instrumenter configuration.');\n      return;\n    }\n\n    // TODO (v8): `tracePropagationTargets` and `shouldCreateSpanForRequest` will be removed from clientOptions\n    // and we will no longer have to do this optional merge, we can just pass `this._tracing` directly.\n    const tracingOptions = this._tracing ? { ...clientOptions, ...this._tracing } : undefined;\n\n    // eslint-disable-next-line @typescript-eslint/no-var-requires\n    const httpModule = require('http');\n    const wrappedHttpHandlerMaker = _createWrappedRequestMethodFactory(this._breadcrumbs, tracingOptions, httpModule);\n    fill(httpModule, 'get', wrappedHttpHandlerMaker);\n    fill(httpModule, 'request', wrappedHttpHandlerMaker);\n\n    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n    // If we do, we'd get double breadcrumbs and double spans for `https` calls.\n    // It has been changed in Node 9, so for all versions equal and above, we patch `https` separately.\n    if (NODE_VERSION.major && NODE_VERSION.major > 8) {\n      // eslint-disable-next-line @typescript-eslint/no-var-requires\n      const httpsModule = require('https');\n      const wrappedHttpsHandlerMaker = _createWrappedRequestMethodFactory(\n        this._breadcrumbs,\n        tracingOptions,\n        httpsModule,\n      );\n      fill(httpsModule, 'get', wrappedHttpsHandlerMaker);\n      fill(httpsModule, 'request', wrappedHttpsHandlerMaker);\n    }\n  }\n}\n\n// for ease of reading below\ntype OriginalRequestMethod = RequestMethod;\ntype WrappedRequestMethod = RequestMethod;\ntype WrappedRequestMethodFactory = (original: OriginalRequestMethod) => WrappedRequestMethod;\n\n/**\n * Function which creates a function which creates wrapped versions of internal `request` and `get` calls within `http`\n * and `https` modules. (NB: Not a typo - this is a creator^2!)\n *\n * @param breadcrumbsEnabled Whether or not to record outgoing requests as breadcrumbs\n * @param tracingEnabled Whether or not to record outgoing requests as tracing spans\n *\n * @returns A function which accepts the exiting handler and returns a wrapped handler\n */\nfunction _createWrappedRequestMethodFactory(\n  breadcrumbsEnabled: boolean,\n  tracingOptions: TracingOptions | undefined,\n  httpModule: typeof http | typeof https,\n): WrappedRequestMethodFactory {\n  // We're caching results so we don't have to recompute regexp every time we create a request.\n  const createSpanUrlMap = new LRUMap<string, boolean>(100);\n  const headersUrlMap: Record<string, boolean> = {};\n\n  const shouldCreateSpan = (url: string): boolean => {\n    if (tracingOptions?.shouldCreateSpanForRequest === undefined) {\n      return true;\n    }\n\n    const cachedDecision = createSpanUrlMap.get(url);\n    if (cachedDecision !== undefined) {\n      return cachedDecision;\n    }\n\n    const decision = tracingOptions.shouldCreateSpanForRequest(url);\n    createSpanUrlMap.set(url, decision);\n    return decision;\n  };\n\n  const shouldAttachTraceData = (url: string): boolean => {\n    if (tracingOptions?.tracePropagationTargets === undefined) {\n      return true;\n    }\n\n    if (headersUrlMap[url]) {\n      return headersUrlMap[url];\n    }\n\n    headersUrlMap[url] = stringMatchesSomePattern(url, tracingOptions.tracePropagationTargets);\n\n    return headersUrlMap[url];\n  };\n\n  return function wrappedRequestMethodFactory(originalRequestMethod: OriginalRequestMethod): WrappedRequestMethod {\n    return function wrappedMethod(this: unknown, ...args: RequestMethodArgs): http.ClientRequest {\n      const requestArgs = normalizeRequestArgs(httpModule, args);\n      const requestOptions = requestArgs[0];\n      // eslint-disable-next-line deprecation/deprecation\n      const rawRequestUrl = extractRawUrl(requestOptions);\n      const requestUrl = extractUrl(requestOptions);\n\n      // we don't want to record requests to Sentry as either breadcrumbs or spans, so just use the original method\n      if (isSentryRequest(requestUrl)) {\n        return originalRequestMethod.apply(httpModule, requestArgs);\n      }\n\n      let requestSpan: Span | undefined;\n      let parentSpan: Span | undefined;\n\n      const scope = getCurrentHub().getScope();\n\n      const requestSpanData: SanitizedRequestData = {\n        url: requestUrl,\n        method: requestOptions.method || 'GET',\n      };\n      if (requestOptions.hash) {\n        // strip leading \"#\"\n        requestSpanData['http.fragment'] = requestOptions.hash.substring(1);\n      }\n      if (requestOptions.search) {\n        // strip leading \"?\"\n        requestSpanData['http.query'] = requestOptions.search.substring(1);\n      }\n\n      if (scope && tracingOptions && shouldCreateSpan(rawRequestUrl)) {\n        parentSpan = scope.getSpan();\n\n        if (parentSpan) {\n          requestSpan = parentSpan.startChild({\n            description: `${requestSpanData.method} ${requestSpanData.url}`,\n            op: 'http.client',\n            data: requestSpanData,\n          });\n\n          if (shouldAttachTraceData(rawRequestUrl)) {\n            const sentryTraceHeader = requestSpan.toTraceparent();\n            __DEBUG_BUILD__ &&\n              logger.log(\n                `[Tracing] Adding sentry-trace header ${sentryTraceHeader} to outgoing request to \"${requestUrl}\": `,\n              );\n\n            requestOptions.headers = {\n              ...requestOptions.headers,\n              'sentry-trace': sentryTraceHeader,\n            };\n\n            if (parentSpan.transaction) {\n              const dynamicSamplingContext = parentSpan.transaction.getDynamicSamplingContext();\n              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n\n              let newBaggageHeaderField;\n              if (!requestOptions.headers || !requestOptions.headers.baggage) {\n                newBaggageHeaderField = sentryBaggageHeader;\n              } else if (!sentryBaggageHeader) {\n                newBaggageHeaderField = requestOptions.headers.baggage;\n              } else if (Array.isArray(requestOptions.headers.baggage)) {\n                newBaggageHeaderField = [...requestOptions.headers.baggage, sentryBaggageHeader];\n              } else {\n                // Type-cast explanation:\n                // Technically this the following could be of type `(number | string)[]` but for the sake of simplicity\n                // we say this is undefined behaviour, since it would not be baggage spec conform if the user did this.\n                newBaggageHeaderField = [requestOptions.headers.baggage, sentryBaggageHeader] as string[];\n              }\n\n              requestOptions.headers = {\n                ...requestOptions.headers,\n                // Setting a hader to `undefined` will crash in node so we only set the baggage header when it's defined\n                ...(newBaggageHeaderField && { baggage: newBaggageHeaderField }),\n              };\n            }\n          } else {\n            __DEBUG_BUILD__ &&\n              logger.log(\n                `[Tracing] Not adding sentry-trace header to outgoing request (${requestUrl}) due to mismatching tracePropagationTargets option.`,\n              );\n          }\n        }\n      }\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalRequestMethod\n        .apply(httpModule, requestArgs)\n        .once('response', function (this: http.ClientRequest, res: http.IncomingMessage): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n          if (breadcrumbsEnabled) {\n            addRequestBreadcrumb('response', requestSpanData, req, res);\n          }\n          if (requestSpan) {\n            if (res.statusCode) {\n              requestSpan.setHttpStatus(res.statusCode);\n            }\n            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);\n            requestSpan.finish();\n          }\n        })\n        .once('error', function (this: http.ClientRequest): void {\n          // eslint-disable-next-line @typescript-eslint/no-this-alias\n          const req = this;\n\n          if (breadcrumbsEnabled) {\n            addRequestBreadcrumb('error', requestSpanData, req);\n          }\n          if (requestSpan) {\n            requestSpan.setHttpStatus(500);\n            requestSpan.description = cleanSpanDescription(requestSpan.description, requestOptions, req);\n            requestSpan.finish();\n          }\n        });\n    };\n  };\n}\n\n/**\n * Captures Breadcrumb based on provided request/response pair\n */\nfunction addRequestBreadcrumb(\n  event: string,\n  requestSpanData: SanitizedRequestData,\n  req: http.ClientRequest,\n  res?: http.IncomingMessage,\n): void {\n  if (!getCurrentHub().getIntegration(Http)) {\n    return;\n  }\n\n  getCurrentHub().addBreadcrumb(\n    {\n      category: 'http',\n      data: {\n        status_code: res && res.statusCode,\n        ...requestSpanData,\n      },\n      type: 'http',\n    },\n    {\n      event,\n      request: req,\n      response: res,\n    },\n  );\n}\n"],"names":[],"mappings":";;;;;;;AA8CA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA;IACA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;MACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;IACA,CAAA;EACA,CAAA;AACA;;"}export { Console } from './console.js';
export { Http } from './http.js';
export { OnUncaughtException } from './onuncaughtexception.js';
export { OnUnhandledRejection } from './onunhandledrejection.js';
export { LinkedErrors } from './linkederrors.js';
export { Modules } from './modules.js';
export { ContextLines } from './contextlines.js';
export { Context } from './context.js';
export { RequestData } from './requestdata.js';
export { LocalVariables } from './localvariables.js';
export { Undici } from './undici/index.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';
import { isInstanceOf, resolvedSyncPromise, SyncPromise } from '@sentry/utils';
import { exceptionFromError } from '../eventbuilder.js';
import { ContextLines } from './contextlines.js';

const DEFAULT_KEY = 'cause';
const DEFAULT_LIMIT = 5;

/** Adds SDK info to an event. */
class LinkedErrors  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'LinkedErrors';}

  /**
   * @inheritDoc
   */
    __init() {this.name = LinkedErrors.id;}

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {LinkedErrors.prototype.__init.call(this);
    this._key = options.key || DEFAULT_KEY;
    this._limit = options.limit || DEFAULT_LIMIT;
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    addGlobalEventProcessor(async (event, hint) => {
      const hub = getCurrentHub();
      const self = hub.getIntegration(LinkedErrors);
      const client = hub.getClient();
      if (client && self && self._handler && typeof self._handler === 'function') {
        await self._handler(client.getOptions().stackParser, event, hint);
      }
      return event;
    });
  }

  /**
   * @inheritDoc
   */
   _handler(stackParser, event, hint) {
    if (!event.exception || !event.exception.values || !isInstanceOf(hint.originalException, Error)) {
      return resolvedSyncPromise(event);
    }

    return new SyncPromise(resolve => {
      void this._walkErrorTree(stackParser, hint.originalException , this._key)
        .then((linkedErrors) => {
          if (event && event.exception && event.exception.values) {
            event.exception.values = [...linkedErrors, ...event.exception.values];
          }
          resolve(event);
        })
        .then(null, () => {
          resolve(event);
        });
    });
  }

  /**
   * @inheritDoc
   */
   async _walkErrorTree(
    stackParser,
    error,
    key,
    stack = [],
  ) {
    if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {
      return Promise.resolve(stack);
    }

    const exception = exceptionFromError(stackParser, error[key]);

    // If the ContextLines integration is enabled, we add source code context to linked errors
    // because we can't guarantee the order that integrations are run.
    const contextLines = getCurrentHub().getIntegration(ContextLines);
    if (contextLines && _optionalChain([exception, 'access', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames])) {
      await contextLines.addSourceContextToFrames(exception.stacktrace.frames);
    }

    return new Promise((resolve, reject) => {
      void this._walkErrorTree(stackParser, error[key], key, [exception, ...stack])
        .then(resolve)
        .then(null, () => {
          reject();
        });
    });
  }
}LinkedErrors.__initStatic();

export { LinkedErrors };
//# sourceMappingURL=linkederrors.js.map
{"version":3,"file":"linkederrors.js","sources":["../../../src/integrations/linkederrors.ts"],"sourcesContent":["import { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Event, EventHint, Exception, ExtendedError, Integration, StackParser } from '@sentry/types';\nimport { isInstanceOf, resolvedSyncPromise, SyncPromise } from '@sentry/utils';\n\nimport type { NodeClient } from '../client';\nimport { exceptionFromError } from '../eventbuilder';\nimport { ContextLines } from './contextlines';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\n/** Adds SDK info to an event. */\nexport class LinkedErrors implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'LinkedErrors';\n\n  /**\n   * @inheritDoc\n   */\n  public readonly name: string = LinkedErrors.id;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _key: string;\n\n  /**\n   * @inheritDoc\n   */\n  private readonly _limit: number;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: { key?: string; limit?: number } = {}) {\n    this._key = options.key || DEFAULT_KEY;\n    this._limit = options.limit || DEFAULT_LIMIT;\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    addGlobalEventProcessor(async (event: Event, hint: EventHint) => {\n      const hub = getCurrentHub();\n      const self = hub.getIntegration(LinkedErrors);\n      const client = hub.getClient<NodeClient>();\n      if (client && self && self._handler && typeof self._handler === 'function') {\n        await self._handler(client.getOptions().stackParser, event, hint);\n      }\n      return event;\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private _handler(stackParser: StackParser, event: Event, hint: EventHint): PromiseLike<Event> {\n    if (!event.exception || !event.exception.values || !isInstanceOf(hint.originalException, Error)) {\n      return resolvedSyncPromise(event);\n    }\n\n    return new SyncPromise<Event>(resolve => {\n      void this._walkErrorTree(stackParser, hint.originalException as Error, this._key)\n        .then((linkedErrors: Exception[]) => {\n          if (event && event.exception && event.exception.values) {\n            event.exception.values = [...linkedErrors, ...event.exception.values];\n          }\n          resolve(event);\n        })\n        .then(null, () => {\n          resolve(event);\n        });\n    });\n  }\n\n  /**\n   * @inheritDoc\n   */\n  private async _walkErrorTree(\n    stackParser: StackParser,\n    error: ExtendedError,\n    key: string,\n    stack: Exception[] = [],\n  ): Promise<Exception[]> {\n    if (!isInstanceOf(error[key], Error) || stack.length + 1 >= this._limit) {\n      return Promise.resolve(stack);\n    }\n\n    const exception = exceptionFromError(stackParser, error[key]);\n\n    // If the ContextLines integration is enabled, we add source code context to linked errors\n    // because we can't guarantee the order that integrations are run.\n    const contextLines = getCurrentHub().getIntegration(ContextLines);\n    if (contextLines && exception.stacktrace?.frames) {\n      await contextLines.addSourceContextToFrames(exception.stacktrace.frames);\n    }\n\n    return new Promise<Exception[]>((resolve, reject) => {\n      void this._walkErrorTree(stackParser, error[key], key, [exception, ...stack])\n        .then(resolve)\n        .then(null, () => {\n          reject();\n        });\n    });\n  }\n}\n"],"names":[],"mappings":";;;;;;AAQA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA;;AAEA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,cAAA;EACA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;GACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;EAEA,CAAA,CAAA;GACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GACA,CAAA;IAC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AA,EAAA,MAAA,EAAA,CAAA,EAAA;MACA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA;UACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;QACA,CAAA,CAAA;IACA,CAAA,CAAA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { logger } from '@sentry/utils';
import { LRUMap } from 'lru_map';
import { NODE_VERSION } from '../nodeVersion.js';

/** Creates a container for callbacks to be called sequentially */
function createCallbackList(complete) {
  // A collection of callbacks to be executed last to first
  let callbacks = [];

  let completedCalled = false;
  function checkedComplete(result) {
    callbacks = [];
    if (completedCalled) {
      return;
    }
    completedCalled = true;
    complete(result);
  }

  // complete should be called last
  callbacks.push(checkedComplete);

  function add(fn) {
    callbacks.push(fn);
  }

  function next(result) {
    const popped = callbacks.pop() || checkedComplete;

    try {
      popped(result);
    } catch (_) {
      // If there is an error, we still want to call the complete callback
      checkedComplete(result);
    }
  }

  return { add, next };
}

/**
 * Promise API is available as `Experimental` and in Node 19 only.
 *
 * Callback-based API is `Stable` since v14 and `Experimental` since v8.
 * Because of that, we are creating our own `AsyncSession` class.
 *
 * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api
 * https://nodejs.org/docs/latest-v14.x/api/inspector.html
 */
class AsyncSession  {

  /** Throws if inspector API is not available */
   constructor() {
    /*
    TODO: We really should get rid of this require statement below for a couple of reasons:
    1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`
       in SvelteKit server code (at least not by default).
    2. Throwing in a constructor is bad practice

    More context for a future attempt to fix this:
    We already tried replacing it with import but didn't get it to work because of async problems.
    We still called import in the constructor but assigned to a promise which we "awaited" in
    `configureAndConnect`. However, this broke the Node integration tests as no local variables
    were reported any more. We probably missed a place where we need to await the promise, too.
    */

    // Node can be built without inspector support so this can throw
    // eslint-disable-next-line @typescript-eslint/no-var-requires
    const { Session } = require('inspector');
    this._session = new Session();
  }

  /** @inheritdoc */
   configureAndConnect(onPause, captureAll) {
    this._session.connect();

    this._session.on('Debugger.paused', event => {
      onPause(event, () => {
        // After the pause work is complete, resume execution or the exception context memory is leaked
        this._session.post('Debugger.resume');
      });
    });

    this._session.post('Debugger.enable');
    this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });
  }

  /** @inheritdoc */
   getLocalVariables(objectId, complete) {
    this._getProperties(objectId, props => {
      const { add, next } = createCallbackList(complete);

      for (const prop of props) {
        if (_optionalChain([prop, 'optionalAccess', _2 => _2.value, 'optionalAccess', _3 => _3.objectId]) && _optionalChain([prop, 'optionalAccess', _4 => _4.value, 'access', _5 => _5.className]) === 'Array') {
          const id = prop.value.objectId;
          add(vars => this._unrollArray(id, prop.name, vars, next));
        } else if (_optionalChain([prop, 'optionalAccess', _6 => _6.value, 'optionalAccess', _7 => _7.objectId]) && _optionalChain([prop, 'optionalAccess', _8 => _8.value, 'optionalAccess', _9 => _9.className]) === 'Object') {
          const id = prop.value.objectId;
          add(vars => this._unrollObject(id, prop.name, vars, next));
        } else if (_optionalChain([prop, 'optionalAccess', _10 => _10.value, 'optionalAccess', _11 => _11.value]) || _optionalChain([prop, 'optionalAccess', _12 => _12.value, 'optionalAccess', _13 => _13.description])) {
          add(vars => this._unrollOther(prop, vars, next));
        }
      }

      next({});
    });
  }

  /**
   * Gets all the PropertyDescriptors of an object
   */
   _getProperties(objectId, next) {
    this._session.post(
      'Runtime.getProperties',
      {
        objectId,
        ownProperties: true,
      },
      (err, params) => {
        if (err) {
          next([]);
        } else {
          next(params.result);
        }
      },
    );
  }

  /**
   * Unrolls an array property
   */
   _unrollArray(objectId, name, vars, next) {
    this._getProperties(objectId, props => {
      vars[name] = props
        .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))
        .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))
        .map(v => _optionalChain([v, 'optionalAccess', _14 => _14.value, 'optionalAccess', _15 => _15.value]));

      next(vars);
    });
  }

  /**
   * Unrolls an object property
   */
   _unrollObject(objectId, name, vars, next) {
    this._getProperties(objectId, props => {
      vars[name] = props
        .map(v => [v.name, _optionalChain([v, 'optionalAccess', _16 => _16.value, 'optionalAccess', _17 => _17.value])])
        .reduce((obj, [key, val]) => {
          obj[key] = val;
          return obj;
        }, {} );

      next(vars);
    });
  }

  /**
   * Unrolls other properties
   */
   _unrollOther(prop, vars, next) {
    if (_optionalChain([prop, 'optionalAccess', _18 => _18.value, 'optionalAccess', _19 => _19.value])) {
      vars[prop.name] = prop.value.value;
    } else if (_optionalChain([prop, 'optionalAccess', _20 => _20.value, 'optionalAccess', _21 => _21.description]) && _optionalChain([prop, 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.type]) !== 'function') {
      vars[prop.name] = `<${prop.value.description}>`;
    }

    next(vars);
  }
}

/**
 * When using Vercel pkg, the inspector module is not available.
 * https://github.com/getsentry/sentry-javascript/issues/6769
 */
function tryNewAsyncSession() {
  try {
    return new AsyncSession();
  } catch (e) {
    return undefined;
  }
}

// Add types for the exception event data

/** Could this be an anonymous function? */
function isAnonymous(name) {
  return name !== undefined && ['', '?', '<anonymous>'].includes(name);
}

/** Do the function names appear to match? */
function functionNamesMatch(a, b) {
  return a === b || (isAnonymous(a) && isAnonymous(b));
}

/** Creates a unique hash from stack frames */
function hashFrames(frames) {
  if (frames === undefined) {
    return;
  }

  // Only hash the 10 most recent frames (ie. the last 10)
  return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');
}

/**
 * We use the stack parser to create a unique hash from the exception stack trace
 * This is used to lookup vars when the exception passes through the event processor
 */
function hashFromStack(stackParser, stack) {
  if (stack === undefined) {
    return undefined;
  }

  return hashFrames(stackParser(stack, 1));
}

/**
 * Adds local variables to exception frames
 */
class LocalVariables  {
   static __initStatic() {this.id = 'LocalVariables';}

    __init() {this.name = LocalVariables.id;}

    __init2() {this._cachedFrames = new LRUMap(20);}

   constructor(
      _options = {},
      _session = tryNewAsyncSession(),
  ) {this._options = _options;this._session = _session;LocalVariables.prototype.__init.call(this);LocalVariables.prototype.__init2.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    this._setup(addGlobalEventProcessor, _optionalChain([getCurrentHub, 'call', _24 => _24(), 'access', _25 => _25.getClient, 'call', _26 => _26(), 'optionalAccess', _27 => _27.getOptions, 'call', _28 => _28()]));
  }

  /** Setup in a way that's easier to call from tests */
   _setup(
    addGlobalEventProcessor,
    clientOptions,
  ) {
    if (this._session && _optionalChain([clientOptions, 'optionalAccess', _29 => _29.includeLocalVariables])) {
      // Only setup this integration if the Node version is >= v18
      // https://github.com/getsentry/sentry-javascript/issues/7697
      const unsupportedNodeVersion = (NODE_VERSION.major || 0) < 18;

      if (unsupportedNodeVersion) {
        logger.log('The `LocalVariables` integration is only supported on Node >= v18.');
        return;
      }

      this._session.configureAndConnect(
        (ev, complete) =>
          this._handlePaused(clientOptions.stackParser, ev , complete),
        !!this._options.captureAllExceptions,
      );

      addGlobalEventProcessor(async event => this._addLocalVariables(event));
    }
  }

  /**
   * Handle the pause event
   */
   _handlePaused(
    stackParser,
    { params: { reason, data, callFrames } },
    complete,
  ) {
    if (reason !== 'exception' && reason !== 'promiseRejection') {
      complete();
      return;
    }

    // data.description contains the original error.stack
    const exceptionHash = hashFromStack(stackParser, _optionalChain([data, 'optionalAccess', _30 => _30.description]));

    if (exceptionHash == undefined) {
      complete();
      return;
    }

    const { add, next } = createCallbackList(frames => {
      this._cachedFrames.set(exceptionHash, frames);
      complete();
    });

    // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack
    // For this reason we only attempt to get local variables for the first 5 frames
    for (let i = 0; i < Math.min(callFrames.length, 5); i++) {
      const { scopeChain, functionName, this: obj } = callFrames[i];

      const localScope = scopeChain.find(scope => scope.type === 'local');

      // obj.className is undefined in ESM modules
      const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;

      if (_optionalChain([localScope, 'optionalAccess', _31 => _31.object, 'access', _32 => _32.objectId]) === undefined) {
        add(frames => {
          frames[i] = { function: fn };
          next(frames);
        });
      } else {
        const id = localScope.object.objectId;
        add(frames =>
          _optionalChain([this, 'access', _33 => _33._session, 'optionalAccess', _34 => _34.getLocalVariables, 'call', _35 => _35(id, vars => {
            frames[i] = { function: fn, vars };
            next(frames);
          })]),
        );
      }
    }

    next([]);
  }

  /**
   * Adds local variables event stack frames.
   */
   _addLocalVariables(event) {
    for (const exception of _optionalChain([event, 'optionalAccess', _36 => _36.exception, 'optionalAccess', _37 => _37.values]) || []) {
      this._addLocalVariablesToException(exception);
    }

    return event;
  }

  /**
   * Adds local variables to the exception stack frames.
   */
   _addLocalVariablesToException(exception) {
    const hash = hashFrames(_optionalChain([exception, 'optionalAccess', _38 => _38.stacktrace, 'optionalAccess', _39 => _39.frames]));

    if (hash === undefined) {
      return;
    }

    // Check if we have local variables for an exception that matches the hash
    // delete is identical to get but also removes the entry from the cache
    const cachedFrames = this._cachedFrames.delete(hash);

    if (cachedFrames === undefined) {
      return;
    }

    const frameCount = _optionalChain([exception, 'access', _40 => _40.stacktrace, 'optionalAccess', _41 => _41.frames, 'optionalAccess', _42 => _42.length]) || 0;

    for (let i = 0; i < frameCount; i++) {
      // Sentry frames are in reverse order
      const frameIndex = frameCount - i - 1;

      // Drop out if we run out of frames to match up
      if (!_optionalChain([exception, 'optionalAccess', _43 => _43.stacktrace, 'optionalAccess', _44 => _44.frames, 'optionalAccess', _45 => _45[frameIndex]]) || !cachedFrames[i]) {
        break;
      }

      if (
        // We need to have vars to add
        cachedFrames[i].vars === undefined ||
        // We're not interested in frames that are not in_app because the vars are not relevant
        exception.stacktrace.frames[frameIndex].in_app === false ||
        // The function names need to match
        !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i].function)
      ) {
        continue;
      }

      exception.stacktrace.frames[frameIndex].vars = cachedFrames[i].vars;
    }
  }
}LocalVariables.__initStatic();

export { LocalVariables, createCallbackList };
//# sourceMappingURL=localvariables.js.map
{"version":3,"file":"localvariables.js","sources":["../../../src/integrations/localvariables.ts"],"sourcesContent":["import type { Event, EventProcessor, Exception, Hub, Integration, StackFrame, StackParser } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport type { Debugger, InspectorNotification, Runtime, Session } from 'inspector';\nimport { LRUMap } from 'lru_map';\n\nimport { NODE_VERSION } from '../nodeVersion';\nimport type { NodeClientOptions } from '../types';\n\ntype Variables = Record<string, unknown>;\ntype OnPauseEvent = InspectorNotification<Debugger.PausedEventDataType>;\nexport interface DebugSession {\n  /** Configures and connects to the debug session */\n  configureAndConnect(onPause: (message: OnPauseEvent, complete: () => void) => void, captureAll: boolean): void;\n  /** Gets local variables for an objectId */\n  getLocalVariables(objectId: string, callback: (vars: Variables) => void): void;\n}\n\ntype Next<T> = (result: T) => void;\ntype Add<T> = (fn: Next<T>) => void;\ntype CallbackWrapper<T> = { add: Add<T>; next: Next<T> };\n\n/** Creates a container for callbacks to be called sequentially */\nexport function createCallbackList<T>(complete: Next<T>): CallbackWrapper<T> {\n  // A collection of callbacks to be executed last to first\n  let callbacks: Next<T>[] = [];\n\n  let completedCalled = false;\n  function checkedComplete(result: T): void {\n    callbacks = [];\n    if (completedCalled) {\n      return;\n    }\n    completedCalled = true;\n    complete(result);\n  }\n\n  // complete should be called last\n  callbacks.push(checkedComplete);\n\n  function add(fn: Next<T>): void {\n    callbacks.push(fn);\n  }\n\n  function next(result: T): void {\n    const popped = callbacks.pop() || checkedComplete;\n\n    try {\n      popped(result);\n    } catch (_) {\n      // If there is an error, we still want to call the complete callback\n      checkedComplete(result);\n    }\n  }\n\n  return { add, next };\n}\n\n/**\n * Promise API is available as `Experimental` and in Node 19 only.\n *\n * Callback-based API is `Stable` since v14 and `Experimental` since v8.\n * Because of that, we are creating our own `AsyncSession` class.\n *\n * https://nodejs.org/docs/latest-v19.x/api/inspector.html#promises-api\n * https://nodejs.org/docs/latest-v14.x/api/inspector.html\n */\nclass AsyncSession implements DebugSession {\n  private readonly _session: Session;\n\n  /** Throws if inspector API is not available */\n  public constructor() {\n    /*\n    TODO: We really should get rid of this require statement below for a couple of reasons:\n    1. It makes the integration unusable in the SvelteKit SDK, as it's not possible to use `require`\n       in SvelteKit server code (at least not by default).\n    2. Throwing in a constructor is bad practice\n\n    More context for a future attempt to fix this:\n    We already tried replacing it with import but didn't get it to work because of async problems.\n    We still called import in the constructor but assigned to a promise which we \"awaited\" in\n    `configureAndConnect`. However, this broke the Node integration tests as no local variables\n    were reported any more. We probably missed a place where we need to await the promise, too.\n    */\n\n    // Node can be built without inspector support so this can throw\n    // eslint-disable-next-line @typescript-eslint/no-var-requires\n    const { Session } = require('inspector');\n    this._session = new Session();\n  }\n\n  /** @inheritdoc */\n  public configureAndConnect(onPause: (event: OnPauseEvent, complete: () => void) => void, captureAll: boolean): void {\n    this._session.connect();\n\n    this._session.on('Debugger.paused', event => {\n      onPause(event, () => {\n        // After the pause work is complete, resume execution or the exception context memory is leaked\n        this._session.post('Debugger.resume');\n      });\n    });\n\n    this._session.post('Debugger.enable');\n    this._session.post('Debugger.setPauseOnExceptions', { state: captureAll ? 'all' : 'uncaught' });\n  }\n\n  /** @inheritdoc */\n  public getLocalVariables(objectId: string, complete: (vars: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      const { add, next } = createCallbackList<Variables>(complete);\n\n      for (const prop of props) {\n        if (prop?.value?.objectId && prop?.value.className === 'Array') {\n          const id = prop.value.objectId;\n          add(vars => this._unrollArray(id, prop.name, vars, next));\n        } else if (prop?.value?.objectId && prop?.value?.className === 'Object') {\n          const id = prop.value.objectId;\n          add(vars => this._unrollObject(id, prop.name, vars, next));\n        } else if (prop?.value?.value || prop?.value?.description) {\n          add(vars => this._unrollOther(prop, vars, next));\n        }\n      }\n\n      next({});\n    });\n  }\n\n  /**\n   * Gets all the PropertyDescriptors of an object\n   */\n  private _getProperties(objectId: string, next: (result: Runtime.PropertyDescriptor[]) => void): void {\n    this._session.post(\n      'Runtime.getProperties',\n      {\n        objectId,\n        ownProperties: true,\n      },\n      (err, params) => {\n        if (err) {\n          next([]);\n        } else {\n          next(params.result);\n        }\n      },\n    );\n  }\n\n  /**\n   * Unrolls an array property\n   */\n  private _unrollArray(objectId: string, name: string, vars: Variables, next: (vars: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      vars[name] = props\n        .filter(v => v.name !== 'length' && !isNaN(parseInt(v.name, 10)))\n        .sort((a, b) => parseInt(a.name, 10) - parseInt(b.name, 10))\n        .map(v => v?.value?.value);\n\n      next(vars);\n    });\n  }\n\n  /**\n   * Unrolls an object property\n   */\n  private _unrollObject(objectId: string, name: string, vars: Variables, next: (obj: Variables) => void): void {\n    this._getProperties(objectId, props => {\n      vars[name] = props\n        .map<[string, unknown]>(v => [v.name, v?.value?.value])\n        .reduce((obj, [key, val]) => {\n          obj[key] = val;\n          return obj;\n        }, {} as Variables);\n\n      next(vars);\n    });\n  }\n\n  /**\n   * Unrolls other properties\n   */\n  private _unrollOther(prop: Runtime.PropertyDescriptor, vars: Variables, next: (vars: Variables) => void): void {\n    if (prop?.value?.value) {\n      vars[prop.name] = prop.value.value;\n    } else if (prop?.value?.description && prop?.value?.type !== 'function') {\n      vars[prop.name] = `<${prop.value.description}>`;\n    }\n\n    next(vars);\n  }\n}\n\n/**\n * When using Vercel pkg, the inspector module is not available.\n * https://github.com/getsentry/sentry-javascript/issues/6769\n */\nfunction tryNewAsyncSession(): AsyncSession | undefined {\n  try {\n    return new AsyncSession();\n  } catch (e) {\n    return undefined;\n  }\n}\n\n// Add types for the exception event data\ntype PausedExceptionEvent = Debugger.PausedEventDataType & {\n  data: {\n    // This contains error.stack\n    description: string;\n  };\n};\n\n/** Could this be an anonymous function? */\nfunction isAnonymous(name: string | undefined): boolean {\n  return name !== undefined && ['', '?', '<anonymous>'].includes(name);\n}\n\n/** Do the function names appear to match? */\nfunction functionNamesMatch(a: string | undefined, b: string | undefined): boolean {\n  return a === b || (isAnonymous(a) && isAnonymous(b));\n}\n\n/** Creates a unique hash from stack frames */\nfunction hashFrames(frames: StackFrame[] | undefined): string | undefined {\n  if (frames === undefined) {\n    return;\n  }\n\n  // Only hash the 10 most recent frames (ie. the last 10)\n  return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, '');\n}\n\n/**\n * We use the stack parser to create a unique hash from the exception stack trace\n * This is used to lookup vars when the exception passes through the event processor\n */\nfunction hashFromStack(stackParser: StackParser, stack: string | undefined): string | undefined {\n  if (stack === undefined) {\n    return undefined;\n  }\n\n  return hashFrames(stackParser(stack, 1));\n}\n\nexport interface FrameVariables {\n  function: string;\n  vars?: Variables;\n}\n\n/** There are no options yet. This allows them to be added later without breaking changes */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface Options {\n  /**\n   * Capture local variables for both handled and unhandled exceptions\n   *\n   * Default: false - Only captures local variables for uncaught exceptions\n   */\n  captureAllExceptions?: boolean;\n}\n\n/**\n * Adds local variables to exception frames\n */\nexport class LocalVariables implements Integration {\n  public static id: string = 'LocalVariables';\n\n  public readonly name: string = LocalVariables.id;\n\n  private readonly _cachedFrames: LRUMap<string, FrameVariables[]> = new LRUMap(20);\n\n  public constructor(\n    private readonly _options: Options = {},\n    private readonly _session: DebugSession | undefined = tryNewAsyncSession(),\n  ) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    this._setup(addGlobalEventProcessor, getCurrentHub().getClient()?.getOptions());\n  }\n\n  /** Setup in a way that's easier to call from tests */\n  private _setup(\n    addGlobalEventProcessor: (callback: EventProcessor) => void,\n    clientOptions: NodeClientOptions | undefined,\n  ): void {\n    if (this._session && clientOptions?.includeLocalVariables) {\n      // Only setup this integration if the Node version is >= v18\n      // https://github.com/getsentry/sentry-javascript/issues/7697\n      const unsupportedNodeVersion = (NODE_VERSION.major || 0) < 18;\n\n      if (unsupportedNodeVersion) {\n        logger.log('The `LocalVariables` integration is only supported on Node >= v18.');\n        return;\n      }\n\n      this._session.configureAndConnect(\n        (ev, complete) =>\n          this._handlePaused(clientOptions.stackParser, ev as InspectorNotification<PausedExceptionEvent>, complete),\n        !!this._options.captureAllExceptions,\n      );\n\n      addGlobalEventProcessor(async event => this._addLocalVariables(event));\n    }\n  }\n\n  /**\n   * Handle the pause event\n   */\n  private _handlePaused(\n    stackParser: StackParser,\n    { params: { reason, data, callFrames } }: InspectorNotification<PausedExceptionEvent>,\n    complete: () => void,\n  ): void {\n    if (reason !== 'exception' && reason !== 'promiseRejection') {\n      complete();\n      return;\n    }\n\n    // data.description contains the original error.stack\n    const exceptionHash = hashFromStack(stackParser, data?.description);\n\n    if (exceptionHash == undefined) {\n      complete();\n      return;\n    }\n\n    const { add, next } = createCallbackList<FrameVariables[]>(frames => {\n      this._cachedFrames.set(exceptionHash, frames);\n      complete();\n    });\n\n    // Because we're queuing up and making all these calls synchronously, we can potentially overflow the stack\n    // For this reason we only attempt to get local variables for the first 5 frames\n    for (let i = 0; i < Math.min(callFrames.length, 5); i++) {\n      const { scopeChain, functionName, this: obj } = callFrames[i];\n\n      const localScope = scopeChain.find(scope => scope.type === 'local');\n\n      // obj.className is undefined in ESM modules\n      const fn = obj.className === 'global' || !obj.className ? functionName : `${obj.className}.${functionName}`;\n\n      if (localScope?.object.objectId === undefined) {\n        add(frames => {\n          frames[i] = { function: fn };\n          next(frames);\n        });\n      } else {\n        const id = localScope.object.objectId;\n        add(frames =>\n          this._session?.getLocalVariables(id, vars => {\n            frames[i] = { function: fn, vars };\n            next(frames);\n          }),\n        );\n      }\n    }\n\n    next([]);\n  }\n\n  /**\n   * Adds local variables event stack frames.\n   */\n  private _addLocalVariables(event: Event): Event {\n    for (const exception of event?.exception?.values || []) {\n      this._addLocalVariablesToException(exception);\n    }\n\n    return event;\n  }\n\n  /**\n   * Adds local variables to the exception stack frames.\n   */\n  private _addLocalVariablesToException(exception: Exception): void {\n    const hash = hashFrames(exception?.stacktrace?.frames);\n\n    if (hash === undefined) {\n      return;\n    }\n\n    // Check if we have local variables for an exception that matches the hash\n    // delete is identical to get but also removes the entry from the cache\n    const cachedFrames = this._cachedFrames.delete(hash);\n\n    if (cachedFrames === undefined) {\n      return;\n    }\n\n    const frameCount = exception.stacktrace?.frames?.length || 0;\n\n    for (let i = 0; i < frameCount; i++) {\n      // Sentry frames are in reverse order\n      const frameIndex = frameCount - i - 1;\n\n      // Drop out if we run out of frames to match up\n      if (!exception?.stacktrace?.frames?.[frameIndex] || !cachedFrames[i]) {\n        break;\n      }\n\n      if (\n        // We need to have vars to add\n        cachedFrames[i].vars === undefined ||\n        // We're not interested in frames that are not in_app because the vars are not relevant\n        exception.stacktrace.frames[frameIndex].in_app === false ||\n        // The function names need to match\n        !functionNamesMatch(exception.stacktrace.frames[frameIndex].function, cachedFrames[i].function)\n      ) {\n        continue;\n      }\n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A,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;QACA,CAAA,kBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA;MACA,EAAA;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA;;MAEA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA;IACA;EACA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;"}import { existsSync, readFileSync } from 'fs';
import { dirname, join } from 'path';

let moduleCache;

/** Extract information about paths */
function getPaths() {
  try {
    return require.cache ? Object.keys(require.cache ) : [];
  } catch (e) {
    return [];
  }
}

/** Extract information about package.json modules */
function collectModules()

 {
  const mainPaths = (require.main && require.main.paths) || [];
  const paths = getPaths();
  const infos

 = {};
  const seen

 = {};

  paths.forEach(path => {
    let dir = path;

    /** Traverse directories upward in the search of package.json file */
    const updir = () => {
      const orig = dir;
      dir = dirname(orig);

      if (!dir || orig === dir || seen[orig]) {
        return undefined;
      }
      if (mainPaths.indexOf(dir) < 0) {
        return updir();
      }

      const pkgfile = join(orig, 'package.json');
      seen[orig] = true;

      if (!existsSync(pkgfile)) {
        return updir();
      }

      try {
        const info = JSON.parse(readFileSync(pkgfile, 'utf8'))

;
        infos[info.name] = info.version;
      } catch (_oO) {
        // no-empty
      }
    };

    updir();
  });

  return infos;
}

/** Add node modules / packages to the event */
class Modules  {constructor() { Modules.prototype.__init.call(this); }
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Modules';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Modules.id;}

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    addGlobalEventProcessor(event => {
      if (!getCurrentHub().getIntegration(Modules)) {
        return event;
      }
      return {
        ...event,
        modules: {
          ...event.modules,
          ...this._getModules(),
        },
      };
    });
  }

  /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
   _getModules() {
    if (!moduleCache) {
      moduleCache = collectModules();
    }
    return moduleCache;
  }
} Modules.__initStatic();

export { Modules };
//# sourceMappingURL=modules.js.map
{"version":3,"file":"modules.js","sources":["../../../src/integrations/modules.ts"],"sourcesContent":["import type { EventProcessor, Hub, Integration } from '@sentry/types';\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join } from 'path';\n\nlet moduleCache: { [key: string]: string };\n\n/** Extract information about paths */\nfunction getPaths(): string[] {\n  try {\n    return require.cache ? Object.keys(require.cache as Record<string, unknown>) : [];\n  } catch (e) {\n    return [];\n  }\n}\n\n/** Extract information about package.json modules */\nfunction collectModules(): {\n  [name: string]: string;\n} {\n  const mainPaths = (require.main && require.main.paths) || [];\n  const paths = getPaths();\n  const infos: {\n    [name: string]: string;\n  } = {};\n  const seen: {\n    [path: string]: boolean;\n  } = {};\n\n  paths.forEach(path => {\n    let dir = path;\n\n    /** Traverse directories upward in the search of package.json file */\n    const updir = (): void | (() => void) => {\n      const orig = dir;\n      dir = dirname(orig);\n\n      if (!dir || orig === dir || seen[orig]) {\n        return undefined;\n      }\n      if (mainPaths.indexOf(dir) < 0) {\n        return updir();\n      }\n\n      const pkgfile = join(orig, 'package.json');\n      seen[orig] = true;\n\n      if (!existsSync(pkgfile)) {\n        return updir();\n      }\n\n      try {\n        const info = JSON.parse(readFileSync(pkgfile, 'utf8')) as {\n          name: string;\n          version: string;\n        };\n        infos[info.name] = info.version;\n      } catch (_oO) {\n        // no-empty\n      }\n    };\n\n    updir();\n  });\n\n  return infos;\n}\n\n/** Add node modules / packages to the event */\nexport class Modules implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Modules';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Modules.id;\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    addGlobalEventProcessor(event => {\n      if (!getCurrentHub().getIntegration(Modules)) {\n        return event;\n      }\n      return {\n        ...event,\n        modules: {\n          ...event.modules,\n          ...this._getModules(),\n        },\n      };\n    });\n  }\n\n  /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */\n  private _getModules(): { [key: string]: string } {\n    if (!moduleCache) {\n      moduleCache = collectModules();\n    }\n    return moduleCache;\n  }\n}\n"],"names":[],"mappings":";;;AAIA,IAAA,WAAA,CAAA;AACA;AACA;AACA,SAAA,QAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,OAAA,CAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,EAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,cAAA;AACA;AACA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;AACA,KAAA,CAAA;AACA;AACA,IAAA,KAAA,EAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,OAAA,EAAA,CAAA,WAAA,GAAA,EAAA,OAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,UAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,OAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,CAAA,uBAAA,EAAA,aAAA,EAAA;AACA,IAAA,uBAAA,CAAA,KAAA,IAAA;AACA,MAAA,IAAA,CAAA,aAAA,EAAA,CAAA,cAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,KAAA,CAAA;AACA,OAAA;AACA,MAAA,OAAA;AACA,QAAA,GAAA,KAAA;AACA,QAAA,OAAA,EAAA;AACA,UAAA,GAAA,KAAA,CAAA,OAAA;AACA,UAAA,GAAA,IAAA,CAAA,WAAA,EAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,GAAA,WAAA,GAAA;AACA,IAAA,IAAA,CAAA,WAAA,EAAA;AACA,MAAA,WAAA,GAAA,cAAA,EAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA,WAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,OAAA,CAAA,YAAA,EAAA;;;;"}import { getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';
import { logAndExitProcess } from './utils/errorhandling.js';

/** Global Exception handler */
class OnUncaughtException  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'OnUncaughtException';}

  /**
   * @inheritDoc
   */
   __init() {this.name = OnUncaughtException.id;}

  /**
   * @inheritDoc
   */
    __init2() {this.handler = this._makeErrorHandler();}

  // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`

  /**
   * @inheritDoc
   */
   constructor(options = {}) {OnUncaughtException.prototype.__init.call(this);OnUncaughtException.prototype.__init2.call(this);
    this._options = {
      exitEvenIfOtherHandlersAreRegistered: true,
      ...options,
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce() {
    global.process.on('uncaughtException', this.handler);
  }

  /**
   * @hidden
   */
   _makeErrorHandler() {
    const timeout = 2000;
    let caughtFirstError = false;
    let caughtSecondError = false;
    let calledFatalError = false;
    let firstError;

    return (error) => {
      let onFatalError = logAndExitProcess;
      const client = getCurrentHub().getClient();

      if (this._options.onFatalError) {
        onFatalError = this._options.onFatalError;
      } else if (client && client.getOptions().onFatalError) {
        onFatalError = client.getOptions().onFatalError ;
      }

      // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not
      // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust
      // exit behaviour of the SDK accordingly:
      // - If other listeners are attached, do not exit.
      // - If the only listener attached is ours, exit.
      const userProvidedListenersCount = (
        global.process.listeners('uncaughtException')
      ).reduce((acc, listener) => {
        if (
          // There are 3 listeners we ignore:
          listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself
          (listener.tag && listener.tag === 'sentry_tracingErrorCallback') || // the handler we register for tracing
          listener === this.handler // the handler we register in this integration
        ) {
          return acc;
        } else {
          return acc + 1;
        }
      }, 0);

      const processWouldExit = userProvidedListenersCount === 0;
      const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;

      if (!caughtFirstError) {
        const hub = getCurrentHub();

        // this is the first uncaught error and the ultimate reason for shutting down
        // we want to do absolutely everything possible to ensure it gets captured
        // also we want to make sure we don't go recursion crazy if more errors happen after this one
        firstError = error;
        caughtFirstError = true;

        if (hub.getIntegration(OnUncaughtException)) {
          hub.withScope((scope) => {
            scope.setLevel('fatal');
            hub.captureException(error, {
              originalException: error,
              data: { mechanism: { handled: false, type: 'onuncaughtexception' } },
            });
            if (!calledFatalError && shouldApplyFatalHandlingLogic) {
              calledFatalError = true;
              onFatalError(error);
            }
          });
        } else {
          if (!calledFatalError && shouldApplyFatalHandlingLogic) {
            calledFatalError = true;
            onFatalError(error);
          }
        }
      } else {
        if (shouldApplyFatalHandlingLogic) {
          if (calledFatalError) {
            // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down
            (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
              logger.warn(
                'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',
              );
            logAndExitProcess(error);
          } else if (!caughtSecondError) {
            // two cases for how we can hit this branch:
            //   - capturing of first error blew up and we just caught the exception from that
            //     - quit trying to capture, proceed with shutdown
            //   - a second independent error happened while waiting for first error to capture
            //     - want to avoid causing premature shutdown before first error capture finishes
            // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff
            // so let's instead just delay a bit before we proceed with our action here
            // in case 1, we just wait a bit unnecessarily but ultimately do the same thing
            // in case 2, the delay hopefully made us wait long enough for the capture to finish
            // two potential nonideal outcomes:
            //   nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError
            //   nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error
            // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)
            //   we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish
            caughtSecondError = true;
            setTimeout(() => {
              if (!calledFatalError) {
                // it was probably case 1, let's treat err as the sendErr and call onFatalError
                calledFatalError = true;
                onFatalError(firstError, error);
              }
            }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc
          }
        }
      }
    };
  }
} OnUncaughtException.__initStatic();

export { OnUncaughtException };
//# sourceMappingURL=onuncaughtexception.js.map
{"version":3,"file":"onuncaughtexception.js","sources":["../../../src/integrations/onuncaughtexception.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { NodeClient } from '../client';\nimport { logAndExitProcess } from './utils/errorhandling';\n\ntype OnFatalErrorHandler = (firstError: Error, secondError?: Error) => void;\n\ntype TaggedListener = NodeJS.UncaughtExceptionListener & {\n  tag?: string;\n};\n\n// CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`\ninterface OnUncaughtExceptionOptions {\n  // TODO(v8): Evaluate whether we should switch the default behaviour here.\n  // Also, we can evaluate using https://nodejs.org/api/process.html#event-uncaughtexceptionmonitor per default, and\n  // falling back to current behaviour when that's not available.\n  /**\n   * Controls if the SDK should register a handler to exit the process on uncaught errors:\n   * - `true`: The SDK will exit the process on all uncaught errors.\n   * - `false`: The SDK will only exit the process when there are no other `uncaughtException` handlers attached.\n   *\n   * Default: `true`\n   */\n  exitEvenIfOtherHandlersAreRegistered: boolean;\n\n  /**\n   * This is called when an uncaught error would cause the process to exit.\n   *\n   * @param firstError Uncaught error causing the process to exit\n   * @param secondError Will be set if the handler was called multiple times. This can happen either because\n   * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`\n   * was running.\n   */\n  onFatalError?(this: void, firstError: Error, secondError?: Error): void;\n}\n\n/** Global Exception handler */\nexport class OnUncaughtException implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'OnUncaughtException';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = OnUncaughtException.id;\n\n  /**\n   * @inheritDoc\n   */\n  public readonly handler: (error: Error) => void = this._makeErrorHandler();\n\n  // CAREFUL: Please think twice before updating the way _options looks because the Next.js SDK depends on it in `index.server.ts`\n  private readonly _options: OnUncaughtExceptionOptions;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: Partial<OnUncaughtExceptionOptions> = {}) {\n    this._options = {\n      exitEvenIfOtherHandlersAreRegistered: true,\n      ...options,\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    global.process.on('uncaughtException', this.handler);\n  }\n\n  /**\n   * @hidden\n   */\n  private _makeErrorHandler(): (error: Error) => void {\n    const timeout = 2000;\n    let caughtFirstError: boolean = false;\n    let caughtSecondError: boolean = false;\n    let calledFatalError: boolean = false;\n    let firstError: Error;\n\n    return (error: Error): void => {\n      let onFatalError: OnFatalErrorHandler = logAndExitProcess;\n      const client = getCurrentHub().getClient<NodeClient>();\n\n      if (this._options.onFatalError) {\n        onFatalError = this._options.onFatalError;\n      } else if (client && client.getOptions().onFatalError) {\n        onFatalError = client.getOptions().onFatalError as OnFatalErrorHandler;\n      }\n\n      // Attaching a listener to `uncaughtException` will prevent the node process from exiting. We generally do not\n      // want to alter this behaviour so we check for other listeners that users may have attached themselves and adjust\n      // exit behaviour of the SDK accordingly:\n      // - If other listeners are attached, do not exit.\n      // - If the only listener attached is ours, exit.\n      const userProvidedListenersCount = (\n        global.process.listeners('uncaughtException') as TaggedListener[]\n      ).reduce<number>((acc, listener) => {\n        if (\n          // There are 3 listeners we ignore:\n          listener.name === 'domainUncaughtExceptionClear' || // as soon as we're using domains this listener is attached by node itself\n          (listener.tag && listener.tag === 'sentry_tracingErrorCallback') || // the handler we register for tracing\n          listener === this.handler // the handler we register in this integration\n        ) {\n          return acc;\n        } else {\n          return acc + 1;\n        }\n      }, 0);\n\n      const processWouldExit = userProvidedListenersCount === 0;\n      const shouldApplyFatalHandlingLogic = this._options.exitEvenIfOtherHandlersAreRegistered || processWouldExit;\n\n      if (!caughtFirstError) {\n        const hub = getCurrentHub();\n\n        // this is the first uncaught error and the ultimate reason for shutting down\n        // we want to do absolutely everything possible to ensure it gets captured\n        // also we want to make sure we don't go recursion crazy if more errors happen after this one\n        firstError = error;\n        caughtFirstError = true;\n\n        if (hub.getIntegration(OnUncaughtException)) {\n          hub.withScope((scope: Scope) => {\n            scope.setLevel('fatal');\n            hub.captureException(error, {\n              originalException: error,\n              data: { mechanism: { handled: false, type: 'onuncaughtexception' } },\n            });\n            if (!calledFatalError && shouldApplyFatalHandlingLogic) {\n              calledFatalError = true;\n              onFatalError(error);\n            }\n          });\n        } else {\n          if (!calledFatalError && shouldApplyFatalHandlingLogic) {\n            calledFatalError = true;\n            onFatalError(error);\n          }\n        }\n      } else {\n        if (shouldApplyFatalHandlingLogic) {\n          if (calledFatalError) {\n            // we hit an error *after* calling onFatalError - pretty boned at this point, just shut it down\n            __DEBUG_BUILD__ &&\n              logger.warn(\n                'uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown',\n              );\n            logAndExitProcess(error);\n          } else if (!caughtSecondError) {\n            // two cases for how we can hit this branch:\n            //   - capturing of first error blew up and we just caught the exception from that\n            //     - quit trying to capture, proceed with shutdown\n            //   - a second independent error happened while waiting for first error to capture\n            //     - want to avoid causing premature shutdown before first error capture finishes\n            // it's hard to immediately tell case 1 from case 2 without doing some fancy/questionable domain stuff\n            // so let's instead just delay a bit before we proceed with our action here\n            // in case 1, we just wait a bit unnecessarily but ultimately do the same thing\n            // in case 2, the delay hopefully made us wait long enough for the capture to finish\n            // two potential nonideal outcomes:\n            //   nonideal case 1: capturing fails fast, we sit around for a few seconds unnecessarily before proceeding correctly by calling onFatalError\n            //   nonideal case 2: case 2 happens, 1st error is captured but slowly, timeout completes before capture and we treat second error as the sendErr of (nonexistent) failure from trying to capture first error\n            // note that after hitting this branch, we might catch more errors where (caughtSecondError && !calledFatalError)\n            //   we ignore them - they don't matter to us, we're just waiting for the second error timeout to finish\n            caughtSecondError = true;\n            setTimeout(() => {\n              if (!calledFatalError) {\n                // it was probably case 1, let's treat err as the sendErr and call onFatalError\n                calledFatalError = true;\n                onFatalError(firstError, error);\n              } else {\n                // it was probably case 2, our first error finished capturing while we waited, cool, do nothing\n              }\n            }, timeout); // capturing could take at least sendTimeout to fail, plus an arbitrary second for how long it takes to collect surrounding source etc\n          }\n        }\n      }\n    };\n  }\n}\n"],"names":[],"mappings":";;;;AAuCA;AACA,MAAA,mBAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,sBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,mBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,OAAA,GAAA,CAAA,IAAA,CAAA,OAAA,GAAA,IAAA,CAAA,iBAAA,GAAA,CAAA;AACA;AACA;;AAGA;AACA;AACA;AACA,GAAA,WAAA,CAAA,OAAA,GAAA,EAAA,EAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,mBAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,oCAAA,EAAA,IAAA;AACA,MAAA,GAAA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,MAAA,CAAA,OAAA,CAAA,EAAA,CAAA,mBAAA,EAAA,IAAA,CAAA,OAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA,GAAA,iBAAA,GAAA;AACA,IAAA,MAAA,OAAA,GAAA,IAAA,CAAA;AACA,IAAA,IAAA,gBAAA,GAAA,KAAA,CAAA;AACA,IAAA,IAAA,iBAAA,GAAA,KAAA,CAAA;AACA,IAAA,IAAA,gBAAA,GAAA,KAAA,CAAA;AACA,IAAA,IAAA,UAAA,CAAA;AACA;AACA,IAAA,OAAA,CAAA,KAAA,KAAA;AACA,MAAA,IAAA,YAAA,GAAA,iBAAA,CAAA;AACA,MAAA,MAAA,MAAA,GAAA,aAAA,EA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AAA,CAAA,mBAAA,CAAA,YAAA,EAAA;;;;"}import { getCurrentHub } from '@sentry/core';
import { consoleSandbox } from '@sentry/utils';
import { logAndExitProcess } from './utils/errorhandling.js';

/** Global Promise Rejection handler */
class OnUnhandledRejection  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'OnUnhandledRejection';}

  /**
   * @inheritDoc
   */
   __init() {this.name = OnUnhandledRejection.id;}

  /**
   * @inheritDoc
   */
   constructor(
      _options

 = { mode: 'warn' },
  ) {this._options = _options;OnUnhandledRejection.prototype.__init.call(this);}

  /**
   * @inheritDoc
   */
   setupOnce() {
    global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this));
  }

  /**
   * Send an exception with reason
   * @param reason string
   * @param promise promise
   */
   sendUnhandledPromise(reason, promise) {
    const hub = getCurrentHub();
    if (hub.getIntegration(OnUnhandledRejection)) {
      hub.withScope((scope) => {
        scope.setExtra('unhandledPromiseRejection', true);
        hub.captureException(reason, {
          originalException: promise,
          data: { mechanism: { handled: false, type: 'onunhandledrejection' } },
        });
      });
    }
    this._handleRejection(reason);
  }

  /**
   * Handler for `mode` option
   */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
   _handleRejection(reason) {
    // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240
    const rejectionWarning =
      'This error originated either by ' +
      'throwing inside of an async function without a catch block, ' +
      'or by rejecting a promise which was not handled with .catch().' +
      ' The promise rejected with the reason:';

    /* eslint-disable no-console */
    if (this._options.mode === 'warn') {
      consoleSandbox(() => {
        console.warn(rejectionWarning);
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        console.error(reason && reason.stack ? reason.stack : reason);
      });
    } else if (this._options.mode === 'strict') {
      consoleSandbox(() => {
        console.warn(rejectionWarning);
      });
      logAndExitProcess(reason);
    }
    /* eslint-enable no-console */
  }
} OnUnhandledRejection.__initStatic();

export { OnUnhandledRejection };
//# sourceMappingURL=onunhandledrejection.js.map
{"version":3,"file":"onunhandledrejection.js","sources":["../../../src/integrations/onunhandledrejection.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { getCurrentHub } from '@sentry/core';\nimport type { Integration } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\n\nimport { logAndExitProcess } from './utils/errorhandling';\n\ntype UnhandledRejectionMode = 'none' | 'warn' | 'strict';\n\n/** Global Promise Rejection handler */\nexport class OnUnhandledRejection implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'OnUnhandledRejection';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = OnUnhandledRejection.id;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(\n    private readonly _options: {\n      /**\n       * Option deciding what to do after capturing unhandledRejection,\n       * that mimicks behavior of node's --unhandled-rejection flag.\n       */\n      mode: UnhandledRejectionMode;\n    } = { mode: 'warn' },\n  ) {}\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(): void {\n    global.process.on('unhandledRejection', this.sendUnhandledPromise.bind(this));\n  }\n\n  /**\n   * Send an exception with reason\n   * @param reason string\n   * @param promise promise\n   */\n  public sendUnhandledPromise(reason: unknown, promise: unknown): void {\n    const hub = getCurrentHub();\n    if (hub.getIntegration(OnUnhandledRejection)) {\n      hub.withScope((scope: Scope) => {\n        scope.setExtra('unhandledPromiseRejection', true);\n        hub.captureException(reason, {\n          originalException: promise,\n          data: { mechanism: { handled: false, type: 'onunhandledrejection' } },\n        });\n      });\n    }\n    this._handleRejection(reason);\n  }\n\n  /**\n   * Handler for `mode` option\n   */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  private _handleRejection(reason: any): void {\n    // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240\n    const rejectionWarning =\n      'This error originated either by ' +\n      'throwing inside of an async function without a catch block, ' +\n      'or by rejecting a promise which was not handled with .catch().' +\n      ' The promise rejected with the reason:';\n\n    /* eslint-disable no-console */\n    if (this._options.mode === 'warn') {\n      consoleSandbox(() => {\n        console.warn(rejectionWarning);\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        console.error(reason && reason.stack ? reason.stack : reason);\n      });\n    } else if (this._options.mode === 'strict') {\n      consoleSandbox(() => {\n        console.warn(rejectionWarning);\n      });\n      logAndExitProcess(reason);\n    }\n    /* eslint-enable no-console */\n  }\n}\n"],"names":[],"mappings":";;;;AASA;AACA,MAAA,oBAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,uBAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,oBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,WAAA;AACA,MAAA,QAAA;;AAMA,GAAA,EAAA,IAAA,EAAA,MAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA,oBAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,SAAA,GAAA;AACA,IAAA,MAAA,CAAA,OAAA,CAAA,EAAA,CAAA,oBAAA,EAAA,IAAA,CAAA,oBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,oBAAA,CAAA,MAAA,EAAA,OAAA,EAAA;AACA,IAAA,MAAA,GAAA,GAAA,aAAA,EAAA,CAAA;AACA,IAAA,IAAA,GAAA,CAAA,cAAA,CAAA,oBAAA,CAAA,EAAA;AACA,MAAA,GAAA,CAAA,SAAA,CAAA,CAAA,KAAA,KAAA;AACA,QAAA,KAAA,CAAA,QAAA,CAAA,2BAAA,EAAA,IAAA,CAAA,CAAA;AACA,QAAA,GAAA,CAAA,gBAAA,CAAA,MAAA,EAAA;AACA,UAAA,iBAAA,EAAA,OAAA;AACA,UAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,KAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,EAAA;AACA,SAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,IAAA,CAAA,gBAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,GAAA,gBAAA,CAAA,MAAA,EAAA;AACA;AACA,IAAA,MAAA,gBAAA;AACA,MAAA,kCAAA;AACA,MAAA,8DAAA;AACA,MAAA,gEAAA;AACA,MAAA,wCAAA,CAAA;AACA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,QAAA,CAAA,IAAA,KAAA,MAAA,EAAA;AACA,MAAA,cAAA,CAAA,MAAA;AACA,QAAA,OAAA,CAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AACA;AACA,QAAA,OAAA,CAAA,KAAA,CAAA,MAAA,IAAA,MAAA,CAAA,KAAA,GAAA,MAAA,CAAA,KAAA,GAAA,MAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,IAAA,CAAA,QAAA,CAAA,IAAA,KAAA,QAAA,EAAA;AACA,MAAA,cAAA,CAAA,MAAA;AACA,QAAA,OAAA,CAAA,IAAA,CAAA,gBAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,MAAA,iBAAA,CAAA,MAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,GAAA;AACA,CAAA,CAAA,oBAAA,CAAA,YAAA,EAAA;;;;"}import { extractPathForTransaction } from '@sentry/utils';
import { addRequestDataToEvent } from '../requestdata.js';

const DEFAULT_OPTIONS = {
  include: {
    cookies: true,
    data: true,
    headers: true,
    ip: false,
    query_string: true,
    url: true,
    user: {
      id: true,
      username: true,
      email: true,
    },
  },
  transactionNamingScheme: 'methodPath',
};

/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`
 * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */
class RequestData  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'RequestData';}

  /**
   * @inheritDoc
   */
   __init() {this.name = RequestData.id;}

  /**
   * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
   * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use
   * something similar in browser-based SDKs in the future.
   */

  /**
   * @inheritDoc
   */
   constructor(options = {}) {RequestData.prototype.__init.call(this);
    this._addRequestData = addRequestDataToEvent;
    this._options = {
      ...DEFAULT_OPTIONS,
      ...options,
      include: {
        // @ts-ignore It's mad because `method` isn't a known `include` key. (It's only here and not set by default in
        // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)
        method: true,
        ...DEFAULT_OPTIONS.include,
        ...options.include,
        user:
          options.include && typeof options.include.user === 'boolean'
            ? options.include.user
            : {
                ...DEFAULT_OPTIONS.include.user,
                // Unclear why TS still thinks `options.include.user` could be a boolean at this point
                ...((options.include || {}).user ),
              },
      },
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    // Note: In the long run, most of the logic here should probably move into the request data utility functions. For
    // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.
    // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once
    // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)
    const { transactionNamingScheme } = this._options;

    addGlobalEventProcessor(event => {
      const hub = getCurrentHub();
      const self = hub.getIntegration(RequestData);

      const { sdkProcessingMetadata = {} } = event;
      const req = sdkProcessingMetadata.request;

      // If the globally installed instance of this integration isn't associated with the current hub, `self` will be
      // undefined
      if (!self || !req) {
        return event;
      }

      // The Express request handler takes a similar `include` option to that which can be passed to this integration.
      // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this
      // integration, so that all of this passing and conversion isn't necessary
      const addRequestDataOptions =
        sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||
        sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||
        convertReqDataIntegrationOptsToAddReqDataOpts(this._options);

      const processedEvent = this._addRequestData(event, req, addRequestDataOptions);

      // Transaction events already have the right `transaction` value
      if (event.type === 'transaction' || transactionNamingScheme === 'handler') {
        return processedEvent;
      }

      // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`
      // value with a high-quality one
      const reqWithTransaction = req ;
      const transaction = reqWithTransaction._sentryTransaction;
      if (transaction) {
        // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to
        // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential
        // to break things like alert rules.)
        const shouldIncludeMethodInTransactionName =
          getSDKName(hub) === 'sentry.javascript.nextjs'
            ? transaction.name.startsWith('/api')
            : transactionNamingScheme !== 'path';

        const [transactionValue] = extractPathForTransaction(req, {
          path: true,
          method: shouldIncludeMethodInTransactionName,
          customRoute: transaction.name,
        });

        processedEvent.transaction = transactionValue;
      }

      return processedEvent;
    });
  }
} RequestData.__initStatic();

/** Convert this integration's options to match what `addRequestDataToEvent` expects */
/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */
function convertReqDataIntegrationOptsToAddReqDataOpts(
  integrationOptions,
) {
  const {
    transactionNamingScheme,
    include: { ip, user, ...requestOptions },
  } = integrationOptions;

  const requestIncludeKeys = [];
  for (const [key, value] of Object.entries(requestOptions)) {
    if (value) {
      requestIncludeKeys.push(key);
    }
  }

  let addReqDataUserOpt;
  if (user === undefined) {
    addReqDataUserOpt = true;
  } else if (typeof user === 'boolean') {
    addReqDataUserOpt = user;
  } else {
    const userIncludeKeys = [];
    for (const [key, value] of Object.entries(user)) {
      if (value) {
        userIncludeKeys.push(key);
      }
    }
    addReqDataUserOpt = userIncludeKeys;
  }

  return {
    include: {
      ip,
      user: addReqDataUserOpt,
      request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,
      transaction: transactionNamingScheme,
    },
  };
}

function getSDKName(hub) {
  try {
    // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to
    // write out a long chain of `a && a.b && a.b.c && ...`
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
    return hub.getClient().getOptions()._metadata.sdk.name;
  } catch (err) {
    // In theory we should never get here
    return undefined;
  }
}

export { RequestData };
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../../src/integrations/requestdata.ts"],"sourcesContent":["// TODO (v8 or v9): Whenever this becomes a default integration for `@sentry/browser`, move this to `@sentry/core`. For\n// now, we leave it in `@sentry/integrations` so that it doesn't contribute bytes to our CDN bundles.\n\nimport type { Event, EventProcessor, Hub, Integration, PolymorphicRequest, Transaction } from '@sentry/types';\nimport { extractPathForTransaction } from '@sentry/utils';\n\nimport type { AddRequestDataToEventOptions, TransactionNamingScheme } from '../requestdata';\nimport { addRequestDataToEvent } from '../requestdata';\n\nexport type RequestDataIntegrationOptions = {\n  /**\n   * Controls what data is pulled from the request and added to the event\n   */\n  include?: {\n    cookies?: boolean;\n    data?: boolean;\n    headers?: boolean;\n    ip?: boolean;\n    query_string?: boolean;\n    url?: boolean;\n    user?:\n      | boolean\n      | {\n          id?: boolean;\n          username?: boolean;\n          email?: boolean;\n        };\n  };\n\n  /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */\n  transactionNamingScheme?: TransactionNamingScheme;\n};\n\nconst DEFAULT_OPTIONS = {\n  include: {\n    cookies: true,\n    data: true,\n    headers: true,\n    ip: false,\n    query_string: true,\n    url: true,\n    user: {\n      id: true,\n      username: true,\n      email: true,\n    },\n  },\n  transactionNamingScheme: 'methodPath',\n};\n\n/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */\nexport class RequestData implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'RequestData';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = RequestData.id;\n\n  /**\n   * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but\n   * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use\n   * something similar in browser-based SDKs in the future.\n   */\n  protected _addRequestData: (event: Event, req: PolymorphicRequest, options?: { [key: string]: unknown }) => Event;\n\n  private _options: Required<RequestDataIntegrationOptions>;\n\n  /**\n   * @inheritDoc\n   */\n  public constructor(options: RequestDataIntegrationOptions = {}) {\n    this._addRequestData = addRequestDataToEvent;\n    this._options = {\n      ...DEFAULT_OPTIONS,\n      ...options,\n      include: {\n        // @ts-ignore It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n        // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n        method: true,\n        ...DEFAULT_OPTIONS.include,\n        ...options.include,\n        user:\n          options.include && typeof options.include.user === 'boolean'\n            ? options.include.user\n            : {\n                ...DEFAULT_OPTIONS.include.user,\n                // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n                ...((options.include || {}).user as Record<string, boolean>),\n              },\n      },\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(addGlobalEventProcessor: (eventProcessor: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n    // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n    // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n    // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n    const { transactionNamingScheme } = this._options;\n\n    addGlobalEventProcessor(event => {\n      const hub = getCurrentHub();\n      const self = hub.getIntegration(RequestData);\n\n      const { sdkProcessingMetadata = {} } = event;\n      const req = sdkProcessingMetadata.request;\n\n      // If the globally installed instance of this integration isn't associated with the current hub, `self` will be\n      // undefined\n      if (!self || !req) {\n        return event;\n      }\n\n      // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n      // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n      // integration, so that all of this passing and conversion isn't necessary\n      const addRequestDataOptions =\n        sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n        sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n        convertReqDataIntegrationOptsToAddReqDataOpts(this._options);\n\n      const processedEvent = this._addRequestData(event, req, addRequestDataOptions);\n\n      // Transaction events already have the right `transaction` value\n      if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n        return processedEvent;\n      }\n\n      // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n      // value with a high-quality one\n      const reqWithTransaction = req as { _sentryTransaction?: Transaction };\n      const transaction = reqWithTransaction._sentryTransaction;\n      if (transaction) {\n        // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n        // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n        // to break things like alert rules.)\n        const shouldIncludeMethodInTransactionName =\n          getSDKName(hub) === 'sentry.javascript.nextjs'\n            ? transaction.name.startsWith('/api')\n            : transactionNamingScheme !== 'path';\n\n        const [transactionValue] = extractPathForTransaction(req, {\n          path: true,\n          method: shouldIncludeMethodInTransactionName,\n          customRoute: transaction.name,\n        });\n\n        processedEvent.transaction = transactionValue;\n      }\n\n      return processedEvent;\n    });\n  }\n}\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n  integrationOptions: Required<RequestDataIntegrationOptions>,\n): AddRequestDataToEventOptions {\n  const {\n    transactionNamingScheme,\n    include: { ip, user, ...requestOptions },\n  } = integrationOptions;\n\n  const requestIncludeKeys: string[] = [];\n  for (const [key, value] of Object.entries(requestOptions)) {\n    if (value) {\n      requestIncludeKeys.push(key);\n    }\n  }\n\n  let addReqDataUserOpt;\n  if (user === undefined) {\n    addReqDataUserOpt = true;\n  } else if (typeof user === 'boolean') {\n    addReqDataUserOpt = user;\n  } else {\n    const userIncludeKeys: string[] = [];\n    for (const [key, value] of Object.entries(user)) {\n      if (value) {\n        userIncludeKeys.push(key);\n      }\n    }\n    addReqDataUserOpt = userIncludeKeys;\n  }\n\n  return {\n    include: {\n      ip,\n      user: addReqDataUserOpt,\n      request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n      transaction: transactionNamingScheme,\n    },\n  };\n}\n\nfunction getSDKName(hub: Hub): string | undefined {\n  try {\n    // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n    // write out a long chain of `a && a.b && a.b.c && ...`\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    return hub.getClient()!.getOptions()!._metadata!.sdk!.name;\n  } catch (err) {\n    // In theory we should never get here\n    return undefined;\n  }\n}\n"],"names":[],"mappings":";;;AAiCA,MAAA,eAAA,GAAA;AACA,EAAA,OAAA,EAAA;AACA,IAAA,OAAA,EAAA,IAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,OAAA,EAAA,IAAA;AACA,IAAA,EAAA,EAAA,KAAA;AACA,IAAA,YAAA,EAAA,IAAA;AACA,IAAA,GAAA,EAAA,IAAA;AACA,IAAA,IAAA,EAAA;AACA,MAAA,EAAA,EAAA,IAAA;AACA,MAAA,QAAA,EAAA,IAAA;AACA,MAAA,KAAA,EAAA,IAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,uBAAA,EAAA,YAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA,MAAA,WAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,cAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,WAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AAC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AA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;;;;"}import { dynamicRequire, stripUrlQueryAndFragment, stringMatchesSomePattern, dynamicSamplingContextToSentryBaggageHeader } from '@sentry/utils';
import { NODE_VERSION } from '../../nodeVersion.js';
import { isSentryRequest } from '../utils/http.js';

var ChannelName; (function (ChannelName) {
  // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md#undicirequestcreate
  const RequestCreate = 'undici:request:create'; ChannelName["RequestCreate"] = RequestCreate;
  const RequestEnd = 'undici:request:headers'; ChannelName["RequestEnd"] = RequestEnd;
  const RequestError = 'undici:request:error'; ChannelName["RequestError"] = RequestError;
})(ChannelName || (ChannelName = {}));

// Please note that you cannot use `console.log` to debug the callbacks registered to the `diagnostics_channel` API.
// To debug, you can use `writeFileSync` to write to a file:
// https://nodejs.org/api/async_hooks.html#printing-in-asynchook-callbacks

/**
 * Instruments outgoing HTTP requests made with the `undici` package via
 * Node's `diagnostics_channel` API.
 *
 * Supports Undici 4.7.0 or higher.
 *
 * Requires Node 16.17.0 or higher.
 */
class Undici  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Undici';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Undici.id;}

   constructor(_options = {}) {Undici.prototype.__init.call(this);
    this._options = {
      breadcrumbs: _options.breadcrumbs === undefined ? true : _options.breadcrumbs,
      shouldCreateSpanForRequest: _options.shouldCreateSpanForRequest || (() => true),
    };
  }

  /**
   * @inheritDoc
   */
   setupOnce(_addGlobalEventProcessor, getCurrentHub) {
    // Requires Node 16+ to use the diagnostics_channel API.
    if (NODE_VERSION.major && NODE_VERSION.major < 16) {
      return;
    }

    let ds;
    try {
      // eslint-disable-next-line @typescript-eslint/no-var-requires
      ds = dynamicRequire(module, 'diagnostics_channel') ;
    } catch (e) {
      // no-op
    }

    if (!ds || !ds.subscribe) {
      return;
    }

    // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md
    ds.subscribe(ChannelName.RequestCreate, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (isSentryRequest(stringUrl) || request.__sentry__ !== undefined) {
        return;
      }

      const client = hub.getClient();
      const scope = hub.getScope();

      const activeSpan = scope.getSpan();

      if (activeSpan && client) {
        const clientOptions = client.getOptions();
        const shouldCreateSpan = this._options.shouldCreateSpanForRequest(stringUrl);

        if (shouldCreateSpan) {
          const data = {};
          const params = url.searchParams.toString();
          if (params) {
            data['http.query'] = `?${params}`;
          }
          if (url.hash) {
            data['http.fragment'] = url.hash;
          }

          const span = activeSpan.startChild({
            op: 'http.client',
            description: `${request.method || 'GET'} ${stripUrlQueryAndFragment(stringUrl)}`,
            data,
          });
          request.__sentry__ = span;

          const shouldPropagate = clientOptions.tracePropagationTargets
            ? stringMatchesSomePattern(stringUrl, clientOptions.tracePropagationTargets)
            : true;

          if (shouldPropagate) {
            request.addHeader('sentry-trace', span.toTraceparent());
            if (span.transaction) {
              const dynamicSamplingContext = span.transaction.getDynamicSamplingContext();
              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);
              if (sentryBaggageHeader) {
                request.addHeader('baggage', sentryBaggageHeader);
              }
            }
          }
        }
      }
    });

    ds.subscribe(ChannelName.RequestEnd, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request, response } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (isSentryRequest(stringUrl)) {
        return;
      }

      const span = request.__sentry__;
      if (span) {
        span.setHttpStatus(response.statusCode);
        span.finish();
      }

      if (this._options.breadcrumbs) {
        hub.addBreadcrumb(
          {
            category: 'http',
            data: {
              method: request.method,
              status_code: response.statusCode,
              url: stringUrl,
            },
            type: 'http',
          },
          {
            event: 'response',
            request,
            response,
          },
        );
      }
    });

    ds.subscribe(ChannelName.RequestError, message => {
      const hub = getCurrentHub();
      if (!hub.getIntegration(Undici)) {
        return;
      }

      const { request } = message ;

      const url = new URL(request.path, request.origin);
      const stringUrl = url.toString();

      if (isSentryRequest(stringUrl)) {
        return;
      }

      const span = request.__sentry__;
      if (span) {
        span.setStatus('internal_error');
        span.finish();
      }

      if (this._options.breadcrumbs) {
        hub.addBreadcrumb(
          {
            category: 'http',
            data: {
              method: request.method,
              url: stringUrl,
            },
            level: 'error',
            type: 'http',
          },
          {
            event: 'error',
            request,
          },
        );
      }
    });
  }
} Undici.__initStatic();

export { ChannelName, Undici };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../../src/integrations/undici/index.ts"],"sourcesContent":["import type { Hub } from '@sentry/core';\nimport type { EventProcessor, Integration } from '@sentry/types';\nimport {\n  dynamicRequire,\n  dynamicSamplingContextToSentryBaggageHeader,\n  stringMatchesSomePattern,\n  stripUrlQueryAndFragment,\n} from '@sentry/utils';\n\nimport type { NodeClient } from '../../client';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport { isSentryRequest } from '../utils/http';\nimport type { DiagnosticsChannel, RequestCreateMessage, RequestEndMessage, RequestErrorMessage } from './types';\n\nexport enum ChannelName {\n  // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md#undicirequestcreate\n  RequestCreate = 'undici:request:create',\n  RequestEnd = 'undici:request:headers',\n  RequestError = 'undici:request:error',\n}\n\nexport interface UndiciOptions {\n  /**\n   * Whether breadcrumbs should be recorded for requests\n   * Defaults to true\n   */\n  breadcrumbs: boolean;\n  /**\n   * Function determining whether or not to create spans to track outgoing requests to the given URL.\n   * By default, spans will be created for all outgoing requests.\n   */\n  shouldCreateSpanForRequest: (url: string) => boolean;\n}\n\n// Please note that you cannot use `console.log` to debug the callbacks registered to the `diagnostics_channel` API.\n// To debug, you can use `writeFileSync` to write to a file:\n// https://nodejs.org/api/async_hooks.html#printing-in-asynchook-callbacks\n\n/**\n * Instruments outgoing HTTP requests made with the `undici` package via\n * Node's `diagnostics_channel` API.\n *\n * Supports Undici 4.7.0 or higher.\n *\n * Requires Node 16.17.0 or higher.\n */\nexport class Undici implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Undici';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Undici.id;\n\n  private readonly _options: UndiciOptions;\n\n  public constructor(_options: Partial<UndiciOptions> = {}) {\n    this._options = {\n      breadcrumbs: _options.breadcrumbs === undefined ? true : _options.breadcrumbs,\n      shouldCreateSpanForRequest: _options.shouldCreateSpanForRequest || (() => true),\n    };\n  }\n\n  /**\n   * @inheritDoc\n   */\n  public setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void {\n    // Requires Node 16+ to use the diagnostics_channel API.\n    if (NODE_VERSION.major && NODE_VERSION.major < 16) {\n      return;\n    }\n\n    let ds: DiagnosticsChannel | undefined;\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-var-requires\n      ds = dynamicRequire(module, 'diagnostics_channel') as DiagnosticsChannel;\n    } catch (e) {\n      // no-op\n    }\n\n    if (!ds || !ds.subscribe) {\n      return;\n    }\n\n    // https://github.com/nodejs/undici/blob/e6fc80f809d1217814c044f52ed40ef13f21e43c/docs/api/DiagnosticsChannel.md\n    ds.subscribe(ChannelName.RequestCreate, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request } = message as RequestCreateMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl) || request.__sentry__ !== undefined) {\n        return;\n      }\n\n      const client = hub.getClient<NodeClient>();\n      const scope = hub.getScope();\n\n      const activeSpan = scope.getSpan();\n\n      if (activeSpan && client) {\n        const clientOptions = client.getOptions();\n        const shouldCreateSpan = this._options.shouldCreateSpanForRequest(stringUrl);\n\n        if (shouldCreateSpan) {\n          const data: Record<string, unknown> = {};\n          const params = url.searchParams.toString();\n          if (params) {\n            data['http.query'] = `?${params}`;\n          }\n          if (url.hash) {\n            data['http.fragment'] = url.hash;\n          }\n\n          const span = activeSpan.startChild({\n            op: 'http.client',\n            description: `${request.method || 'GET'} ${stripUrlQueryAndFragment(stringUrl)}`,\n            data,\n          });\n          request.__sentry__ = span;\n\n          const shouldPropagate = clientOptions.tracePropagationTargets\n            ? stringMatchesSomePattern(stringUrl, clientOptions.tracePropagationTargets)\n            : true;\n\n          if (shouldPropagate) {\n            request.addHeader('sentry-trace', span.toTraceparent());\n            if (span.transaction) {\n              const dynamicSamplingContext = span.transaction.getDynamicSamplingContext();\n              const sentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext);\n              if (sentryBaggageHeader) {\n                request.addHeader('baggage', sentryBaggageHeader);\n              }\n            }\n          }\n        }\n      }\n    });\n\n    ds.subscribe(ChannelName.RequestEnd, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request, response } = message as RequestEndMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl)) {\n        return;\n      }\n\n      const span = request.__sentry__;\n      if (span) {\n        span.setHttpStatus(response.statusCode);\n        span.finish();\n      }\n\n      if (this._options.breadcrumbs) {\n        hub.addBreadcrumb(\n          {\n            category: 'http',\n            data: {\n              method: request.method,\n              status_code: response.statusCode,\n              url: stringUrl,\n            },\n            type: 'http',\n          },\n          {\n            event: 'response',\n            request,\n            response,\n          },\n        );\n      }\n    });\n\n    ds.subscribe(ChannelName.RequestError, message => {\n      const hub = getCurrentHub();\n      if (!hub.getIntegration(Undici)) {\n        return;\n      }\n\n      const { request } = message as RequestErrorMessage;\n\n      const url = new URL(request.path, request.origin);\n      const stringUrl = url.toString();\n\n      if (isSentryRequest(stringUrl)) {\n        return;\n      }\n\n      const span = request.__sentry__;\n      if (span) {\n        span.setStatus('internal_error');\n        span.finish();\n      }\n\n      if (this._options.breadcrumbs) {\n        hub.addBreadcrumb(\n          {\n            category: 'http',\n            data: {\n              method: request.method,\n              url: stringUrl,\n            },\n            level: 'error',\n            type: 'http',\n          },\n          {\n            event: 'error',\n            request,\n          },\n        );\n      }\n    });\n  }\n}\n"],"names":[],"mappings":";;;;AAcA,IAAA,YAAA,CAAA,CAAA,UAAA,WAAA,EAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,uBAAA,CAAA,CAAA,WAAA,CAAA,eAAA,CAAA,GAAA,aAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,wBAAA,CAAA,CAAA,WAAA,CAAA,YAAA,CAAA,GAAA,UAAA,CAAA;AACA,EAAA,MAAA,YAAA,GAAA,sBAAA,CAAA,CAAA,WAAA,CAAA,cAAA,CAAA,GAAA,YAAA,CAAA;AACA,CAAA,EAAA,WAAA,KAAA,WAAA,GAAA,EAAA,CAAA,CAAA,CAAA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,MAAA,EAAA;AACA;AACA;AACA;AACA,GAAA,OAAA,YAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,SAAA,CAAA;AACA;AACA;AACA;AACA;AACA,GAAA,MAAA,GAAA,CAAA,IAAA,CAAA,IAAA,GAAA,MAAA,CAAA,GAAA,CAAA;;AAIA,GAAA,WAAA,CAAA,QAAA,GAAA,EAAA,EAAA,CAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA;AACA,MAAA,WAAA,EAAA,QAAA,CAAA,WAAA,KAAA,SAAA,GAAA,IAAA,GAAA,QAAA,CAAA,WAAA;AACA,MAAA,0BAAA,EAAA,QAAA,CAAA,0BAAA,KAAA,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AA,OAAA;AACA,YAAA,OAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA,CAAA,MAAA,CAAA,YAAA,EAAA;;;;"}import { getCurrentHub } from '@sentry/core';
import { logger } from '@sentry/utils';

const DEFAULT_SHUTDOWN_TIMEOUT = 2000;

/**
 * @hidden
 */
function logAndExitProcess(error) {
  // eslint-disable-next-line no-console
  console.error(error && error.stack ? error.stack : error);

  const client = getCurrentHub().getClient();

  if (client === undefined) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('No NodeClient was defined, we are exiting the process now.');
    global.process.exit(1);
  }

  const options = client.getOptions();
  const timeout =
    (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||
    DEFAULT_SHUTDOWN_TIMEOUT;
  client.close(timeout).then(
    (result) => {
      if (!result) {
        (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');
      }
      global.process.exit(1);
    },
    error => {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);
    },
  );
}

export { logAndExitProcess };
//# sourceMappingURL=errorhandling.js.map
{"version":3,"file":"errorhandling.js","sources":["../../../../src/integrations/utils/errorhandling.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport type { NodeClient } from '../../client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: Error): void {\n  // eslint-disable-next-line no-console\n  console.error(error && error.stack ? error.stack : error);\n\n  const client = getCurrentHub().getClient<NodeClient>();\n\n  if (client === undefined) {\n    __DEBUG_BUILD__ && logger.warn('No NodeClient was defined, we are exiting the process now.');\n    global.process.exit(1);\n  }\n\n  const options = client.getOptions();\n  const timeout =\n    (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||\n    DEFAULT_SHUTDOWN_TIMEOUT;\n  client.close(timeout).then(\n    (result: boolean) => {\n      if (!result) {\n        __DEBUG_BUILD__ && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n      }\n      global.process.exit(1);\n    },\n    error => {\n      __DEBUG_BUILD__ && logger.error(error);\n    },\n  );\n}\n"],"names":[],"mappings":";;;AAKA,MAAA,wBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,KAAA,EAAA;AACA;AACA,EAAA,OAAA,CAAA,KAAA,CAAA,KAAA,IAAA,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA,KAAA,GAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,aAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,KAAA,SAAA,EAAA;AACA,IAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,IAAA,CAAA,4DAAA,CAAA,CAAA;AACA,IAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,MAAA,CAAA,UAAA,EAAA,CAAA;AACA,EAAA,MAAA,OAAA;AACA,IAAA,CAAA,OAAA,IAAA,OAAA,CAAA,eAAA,IAAA,OAAA,CAAA,eAAA,GAAA,CAAA,IAAA,OAAA,CAAA,eAAA;AACA,IAAA,wBAAA,CAAA;AACA,EAAA,MAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,IAAA;AACA,IAAA,CAAA,MAAA,KAAA;AACA,MAAA,IAAA,CAAA,MAAA,EAAA;AACA,QAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,IAAA,CAAA,4EAAA,CAAA,CAAA;AACA,OAAA;AACA,MAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,IAAA,KAAA,IAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,MAAA,CAAA,KAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { getCurrentHub } from '@sentry/core';
import { URL } from 'url';
import { NODE_VERSION } from '../../nodeVersion.js';

/**
 * Checks whether given url points to Sentry server
 * @param url url to verify
 */
function isSentryRequest(url) {
  const dsn = _optionalChain([getCurrentHub, 'call', _ => _(), 'access', _2 => _2.getClient, 'call', _3 => _3(), 'optionalAccess', _4 => _4.getDsn, 'call', _5 => _5()]);
  return dsn ? url.includes(dsn.host) : false;
}

/**
 * Assembles a URL that's passed to the users to filter on.
 * It can include raw (potentially PII containing) data, which we'll allow users to access to filter
 * but won't include in spans or breadcrumbs.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
// TODO (v8): This function should include auth, query and fragment (it's breaking, so we need to wait for v8)
function extractRawUrl(requestOptions) {
  const protocol = requestOptions.protocol || '';
  const hostname = requestOptions.hostname || requestOptions.host || '';
  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise
  const port =
    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;
  const path = requestOptions.path ? requestOptions.path : '/';
  return `${protocol}//${hostname}${port}${path}`;
}

/**
 * Assemble a URL to be used for breadcrumbs and spans.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
function extractUrl(requestOptions) {
  const protocol = requestOptions.protocol || '';
  const hostname = requestOptions.hostname || requestOptions.host || '';
  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise
  const port =
    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;
  // do not include search or hash in span descriptions, per https://develop.sentry.dev/sdk/data-handling/#structuring-data
  const path = requestOptions.pathname || '/';
  // always filter authority, see https://develop.sentry.dev/sdk/data-handling/#structuring-data
  const authority = requestOptions.auth ? redactAuthority(requestOptions.auth) : '';

  return `${protocol}//${authority}${hostname}${port}${path}`;
}

function redactAuthority(auth) {
  const [user, password] = auth.split(':');
  return `${user ? '[Filtered]' : ''}:${password ? '[Filtered]' : ''}@`;
}

/**
 * Handle various edge cases in the span description (for spans representing http(s) requests).
 *
 * @param description current `description` property of the span representing the request
 * @param requestOptions Configuration data for the request
 * @param Request Request object
 *
 * @returns The cleaned description
 */
function cleanSpanDescription(
  description,
  requestOptions,
  request,
) {
  // nothing to clean
  if (!description) {
    return description;
  }

  // eslint-disable-next-line prefer-const
  let [method, requestUrl] = description.split(' ');

  // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing,
  // we're likely dealing with an internal route and this doesn't apply)
  if (requestOptions.host && !requestOptions.protocol) {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
    requestOptions.protocol = _optionalChain([(request ), 'optionalAccess', _6 => _6.agent, 'optionalAccess', _7 => _7.protocol]); // worst comes to worst, this is undefined and nothing changes
    // This URL contains the filtered authority ([filtered]:[filtered]@example.com) but no fragment or query params
    requestUrl = extractUrl(requestOptions);
  }

  // internal routes can end up starting with a triple slash rather than a single one
  if (_optionalChain([requestUrl, 'optionalAccess', _8 => _8.startsWith, 'call', _9 => _9('///')])) {
    requestUrl = requestUrl.slice(2);
  }

  return `${method} ${requestUrl}`;
}

// the node types are missing a few properties which node's `urlToOptions` function spits out

/**
 * Convert a URL object into a RequestOptions object.
 *
 * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the
 * RequestOptions type above.
 *
 * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.
 */
function urlToOptions(url) {
  const options = {
    protocol: url.protocol,
    hostname:
      typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
    hash: url.hash,
    search: url.search,
    pathname: url.pathname,
    path: `${url.pathname || ''}${url.search || ''}`,
    href: url.href,
  };
  if (url.port !== '') {
    options.port = Number(url.port);
  }
  if (url.username || url.password) {
    options.auth = `${url.username}:${url.password}`;
  }
  return options;
}

/**
 * Normalize inputs to `http(s).request()` and `http(s).get()`.
 *
 * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:
 *     [ RequestOptions | string | URL ],
 *     [ RequestOptions | string | URL, RequestCallback ],
 *     [ string | URL, RequestOptions ], and
 *     [ string | URL, RequestOptions, RequestCallback ].
 *
 * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is
 * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact
 * with the args in a standard way.
 *
 * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.
 *
 * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].
 */
function normalizeRequestArgs(
  httpModule,
  requestArgs,
) {
  let callback, requestOptions;

  // pop off the callback, if there is one
  if (typeof requestArgs[requestArgs.length - 1] === 'function') {
    callback = requestArgs.pop() ;
  }

  // create a RequestOptions object of whatever's at index 0
  if (typeof requestArgs[0] === 'string') {
    requestOptions = urlToOptions(new URL(requestArgs[0]));
  } else if (requestArgs[0] instanceof URL) {
    requestOptions = urlToOptions(requestArgs[0]);
  } else {
    requestOptions = requestArgs[0];
  }

  // if the options were given separately from the URL, fold them in
  if (requestArgs.length === 2) {
    requestOptions = { ...requestOptions, ...requestArgs[1] };
  }

  // Figure out the protocol if it's currently missing
  if (requestOptions.protocol === undefined) {
    // Worst case we end up populating protocol with undefined, which it already is
    /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */

    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.
    // Because of that, we cannot rely on `httpModule` to provide us with valid protocol,
    // as it will always return `http`, even when using `https` module.
    //
    // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.
    if (NODE_VERSION.major && NODE_VERSION.major > 8) {
      requestOptions.protocol =
        _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _10 => _10.globalAgent]) ), 'optionalAccess', _11 => _11.protocol]) ||
        _optionalChain([(requestOptions.agent ), 'optionalAccess', _12 => _12.protocol]) ||
        _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _13 => _13.protocol]);
    } else {
      requestOptions.protocol =
        _optionalChain([(requestOptions.agent ), 'optionalAccess', _14 => _14.protocol]) ||
        _optionalChain([(requestOptions._defaultAgent ), 'optionalAccess', _15 => _15.protocol]) ||
        _optionalChain([(_optionalChain([httpModule, 'optionalAccess', _16 => _16.globalAgent]) ), 'optionalAccess', _17 => _17.protocol]);
    }
    /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */
  }

  // return args in standardized form
  if (callback) {
    return [requestOptions, callback];
  } else {
    return [requestOptions];
  }
}

export { cleanSpanDescription, extractRawUrl, extractUrl, isSentryRequest, normalizeRequestArgs, urlToOptions };
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../../src/integrations/utils/http.ts"],"sourcesContent":["import { getCurrentHub } from '@sentry/core';\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport { URL } from 'url';\n\nimport { NODE_VERSION } from '../../nodeVersion';\n\n/**\n * Checks whether given url points to Sentry server\n * @param url url to verify\n */\nexport function isSentryRequest(url: string): boolean {\n  const dsn = getCurrentHub().getClient()?.getDsn();\n  return dsn ? url.includes(dsn.host) : false;\n}\n\n/**\n * Assembles a URL that's passed to the users to filter on.\n * It can include raw (potentially PII containing) data, which we'll allow users to access to filter\n * but won't include in spans or breadcrumbs.\n *\n * @param requestOptions RequestOptions object containing the component parts for a URL\n * @returns Fully-formed URL\n */\n// TODO (v8): This function should include auth, query and fragment (it's breaking, so we need to wait for v8)\nexport function extractRawUrl(requestOptions: RequestOptions): string {\n  const protocol = requestOptions.protocol || '';\n  const hostname = requestOptions.hostname || requestOptions.host || '';\n  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n  const port =\n    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;\n  const path = requestOptions.path ? requestOptions.path : '/';\n  return `${protocol}//${hostname}${port}${path}`;\n}\n\n/**\n * Assemble a URL to be used for breadcrumbs and spans.\n *\n * @param requestOptions RequestOptions object containing the component parts for a URL\n * @returns Fully-formed URL\n */\nexport function extractUrl(requestOptions: RequestOptions): string {\n  const protocol = requestOptions.protocol || '';\n  const hostname = requestOptions.hostname || requestOptions.host || '';\n  // Don't log standard :80 (http) and :443 (https) ports to reduce the noise\n  const port =\n    !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 ? '' : `:${requestOptions.port}`;\n  // do not include search or hash in span descriptions, per https://develop.sentry.dev/sdk/data-handling/#structuring-data\n  const path = requestOptions.pathname || '/';\n  // always filter authority, see https://develop.sentry.dev/sdk/data-handling/#structuring-data\n  const authority = requestOptions.auth ? redactAuthority(requestOptions.auth) : '';\n\n  return `${protocol}//${authority}${hostname}${port}${path}`;\n}\n\nfunction redactAuthority(auth: string): string {\n  const [user, password] = auth.split(':');\n  return `${user ? '[Filtered]' : ''}:${password ? '[Filtered]' : ''}@`;\n}\n\n/**\n * Handle various edge cases in the span description (for spans representing http(s) requests).\n *\n * @param description current `description` property of the span representing the request\n * @param requestOptions Configuration data for the request\n * @param Request Request object\n *\n * @returns The cleaned description\n */\nexport function cleanSpanDescription(\n  description: string | undefined,\n  requestOptions: RequestOptions,\n  request: http.ClientRequest,\n): string | undefined {\n  // nothing to clean\n  if (!description) {\n    return description;\n  }\n\n  // eslint-disable-next-line prefer-const\n  let [method, requestUrl] = description.split(' ');\n\n  // superagent sticks the protocol in a weird place (we check for host because if both host *and* protocol are missing,\n  // we're likely dealing with an internal route and this doesn't apply)\n  if (requestOptions.host && !requestOptions.protocol) {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n    requestOptions.protocol = (request as any)?.agent?.protocol; // worst comes to worst, this is undefined and nothing changes\n    // This URL contains the filtered authority ([filtered]:[filtered]@example.com) but no fragment or query params\n    requestUrl = extractUrl(requestOptions);\n  }\n\n  // internal routes can end up starting with a triple slash rather than a single one\n  if (requestUrl?.startsWith('///')) {\n    requestUrl = requestUrl.slice(2);\n  }\n\n  return `${method} ${requestUrl}`;\n}\n\n// the node types are missing a few properties which node's `urlToOptions` function spits out\nexport type RequestOptions = http.RequestOptions & { hash?: string; search?: string; pathname?: string; href?: string };\ntype RequestCallback = (response: http.IncomingMessage) => void;\nexport type RequestMethodArgs =\n  | [RequestOptions | string | URL, RequestCallback?]\n  | [string | URL, RequestOptions, RequestCallback?];\nexport type RequestMethod = (...args: RequestMethodArgs) => http.ClientRequest;\n\n/**\n * Convert a URL object into a RequestOptions object.\n *\n * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the\n * RequestOptions type above.\n *\n * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.\n */\nexport function urlToOptions(url: URL): RequestOptions {\n  const options: RequestOptions = {\n    protocol: url.protocol,\n    hostname:\n      typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,\n    hash: url.hash,\n    search: url.search,\n    pathname: url.pathname,\n    path: `${url.pathname || ''}${url.search || ''}`,\n    href: url.href,\n  };\n  if (url.port !== '') {\n    options.port = Number(url.port);\n  }\n  if (url.username || url.password) {\n    options.auth = `${url.username}:${url.password}`;\n  }\n  return options;\n}\n\n/**\n * Normalize inputs to `http(s).request()` and `http(s).get()`.\n *\n * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:\n *     [ RequestOptions | string | URL ],\n *     [ RequestOptions | string | URL, RequestCallback ],\n *     [ string | URL, RequestOptions ], and\n *     [ string | URL, RequestOptions, RequestCallback ].\n *\n * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is\n * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact\n * with the args in a standard way.\n *\n * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.\n *\n * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].\n */\nexport function normalizeRequestArgs(\n  httpModule: typeof http | typeof https,\n  requestArgs: RequestMethodArgs,\n): [RequestOptions] | [RequestOptions, RequestCallback] {\n  let callback, requestOptions;\n\n  // pop off the callback, if there is one\n  if (typeof requestArgs[requestArgs.length - 1] === 'function') {\n    callback = requestArgs.pop() as RequestCallback;\n  }\n\n  // create a RequestOptions object of whatever's at index 0\n  if (typeof requestArgs[0] === 'string') {\n    requestOptions = urlToOptions(new URL(requestArgs[0]));\n  } else if (requestArgs[0] instanceof URL) {\n    requestOptions = urlToOptions(requestArgs[0]);\n  } else {\n    requestOptions = requestArgs[0];\n  }\n\n  // if the options were given separately from the URL, fold them in\n  if (requestArgs.length === 2) {\n    requestOptions = { ...requestOptions, ...requestArgs[1] };\n  }\n\n  // Figure out the protocol if it's currently missing\n  if (requestOptions.protocol === undefined) {\n    // Worst case we end up populating protocol with undefined, which it already is\n    /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n\n    // NOTE: Prior to Node 9, `https` used internals of `http` module, thus we don't patch it.\n    // Because of that, we cannot rely on `httpModule` to provide us with valid protocol,\n    // as it will always return `http`, even when using `https` module.\n    //\n    // See test/integrations/http.test.ts for more details on Node <=v8 protocol issue.\n    if (NODE_VERSION.major && NODE_VERSION.major > 8) {\n      requestOptions.protocol =\n        (httpModule?.globalAgent as any)?.protocol ||\n        (requestOptions.agent as any)?.protocol ||\n        (requestOptions._defaultAgent as any)?.protocol;\n    } else {\n      requestOptions.protocol =\n        (requestOptions.agent as any)?.protocol ||\n        (requestOptions._defaultAgent as any)?.protocol ||\n        (httpModule?.globalAgent as any)?.protocol;\n    }\n    /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */\n  }\n\n  // return args in standardized form\n  if (callback) {\n    return [requestOptions, callback];\n  } else {\n    return [requestOptions];\n  }\n}\n"],"names":[],"mappings":";;;;;AAOA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA,CAAA,CAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAA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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;EACA,CAAA,EAAA,CAAA,QAAA,EAAA;IACA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,EAAA,CAAA,CAAA,CAAA,EAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA;AACA;;"}import { posix, sep } from 'path';

const isWindowsPlatform = sep === '\\';

/** normalizes Windows paths */
function normalizeWindowsPath(path) {
  return path
    .replace(/^[A-Z]:/, '') // remove Windows-style prefix
    .replace(/\\/g, '/'); // replace all `\` instances with `/`
}

/** Gets the module from a filename */
function getModule(
  filename,
  normalizeWindowsPathSeparator = isWindowsPlatform,
) {
  if (!filename) {
    return;
  }

  const normalizedFilename = normalizeWindowsPathSeparator ? normalizeWindowsPath(filename) : filename;

  // eslint-disable-next-line prefer-const
  let { root, dir, base: basename, ext } = posix.parse(normalizedFilename);

  const base = (require && require.main && require.main.filename && dir) || global.process.cwd();

  const normalizedBase = `${base}/`;

  // It's specifically a module
  let file = basename;

  if (ext === '.js') {
    file = file.slice(0, file.length - '.js'.length);
  }

  if (!root && !dir) {
    // No dirname whatsoever
    dir = '.';
  }

  let n = dir.lastIndexOf('/node_modules/');
  if (n > -1) {
    // /node_modules/ is 14 chars
    return `${dir.slice(n + 14).replace(/\//g, '.')}:${file}`;
  }
  // Let's see if it's a part of the main module
  // To be a part of main module, it has to share the same base
  n = `${dir}/`.lastIndexOf(normalizedBase, 0);

  if (n === 0) {
    let moduleName = dir.slice(normalizedBase.length).replace(/\//g, '.');
    if (moduleName) {
      moduleName += ':';
    }
    moduleName += file;
    return moduleName;
  }
  return file;
}

export { getModule };
//# sourceMappingURL=module.js.map
{"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import { posix, sep } from 'path';\n\nconst isWindowsPlatform = sep === '\\\\';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n  return path\n    .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n    .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Gets the module from a filename */\nexport function getModule(\n  filename: string | undefined,\n  normalizeWindowsPathSeparator: boolean = isWindowsPlatform,\n): string | undefined {\n  if (!filename) {\n    return;\n  }\n\n  const normalizedFilename = normalizeWindowsPathSeparator ? normalizeWindowsPath(filename) : filename;\n\n  // eslint-disable-next-line prefer-const\n  let { root, dir, base: basename, ext } = posix.parse(normalizedFilename);\n\n  const base = (require && require.main && require.main.filename && dir) || global.process.cwd();\n\n  const normalizedBase = `${base}/`;\n\n  // It's specifically a module\n  let file = basename;\n\n  if (ext === '.js') {\n    file = file.slice(0, file.length - '.js'.length);\n  }\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    dir = '.';\n  }\n\n  let n = dir.lastIndexOf('/node_modules/');\n  if (n > -1) {\n    // /node_modules/ is 14 chars\n    return `${dir.slice(n + 14).replace(/\\//g, '.')}:${file}`;\n  }\n  // Let's see if it's a part of the main module\n  // To be a part of main module, it has to share the same base\n  n = `${dir}/`.lastIndexOf(normalizedBase, 0);\n\n  if (n === 0) {\n    let moduleName = dir.slice(normalizedBase.length).replace(/\\//g, '.');\n    if (moduleName) {\n      moduleName += ':';\n    }\n    moduleName += file;\n    return moduleName;\n  }\n  return file;\n}\n"],"names":[],"mappings":";;AAEA,MAAA,iBAAA,GAAA,GAAA,KAAA,IAAA,CAAA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,IAAA;AACA,KAAA,OAAA,CAAA,SAAA,EAAA,EAAA,CAAA;AACA,KAAA,OAAA,CA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GAAA,CAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,CAAA,GAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,cAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,CAAA,EAAA;AACA,IAAA,IAAA,UAAA,GAAA,GAAA,CAAA,KAAA,CAAA,cAAA,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,CAAA;AACA,IAAA,IAAA,UAAA,EAAA;AACA,MAAA,UAAA,IAAA,GAAA,CAAA;AACA,KAAA;AACA,IAAA,UAAA,IAAA,IAAA,CAAA;AACA,IAAA,OAAA,UAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;"}import { parseSemver } from '@sentry/utils';

const NODE_VERSION = parseSemver(process.versions.node);

export { NODE_VERSION };
//# sourceMappingURL=nodeVersion.js.map
{"version":3,"file":"nodeVersion.js","sources":["../../src/nodeVersion.ts"],"sourcesContent":["import { parseSemver } from '@sentry/utils';\n\nexport const NODE_VERSION: ReturnType<typeof parseSemver> = parseSemver(process.versions.node);\n"],"names":[],"mappings":";;AAEA,MAAA,YAAA,GAAA,WAAA,CAAA,OAAA,CAAA,QAAA,CAAA,IAAA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { isString, normalize, isPlainObject, stripUrlQueryAndFragment } from '@sentry/utils';
import * as cookie from 'cookie';
import * as url from 'url';

const DEFAULT_INCLUDES = {
  ip: false,
  request: true,
  transaction: true,
  user: true,
};
const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];
const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];

/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
function extractPathForTransaction(
  req,
  options = {},
) {
  const method = req.method && req.method.toUpperCase();

  let path = '';
  let source = 'url';

  // Check to see if there's a parameterized route we can use (as there is in Express)
  if (options.customRoute || req.route) {
    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;
    source = 'route';
  }

  // Otherwise, just take the original URL
  else if (req.originalUrl || req.url) {
    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');
  }

  let name = '';
  if (options.method && method) {
    name += method;
  }
  if (options.method && options.path) {
    name += ' ';
  }
  if (options.path && path) {
    name += path;
  }

  return [name, source];
}

/** JSDoc */
function extractTransaction(req, type) {
  switch (type) {
    case 'path': {
      return extractPathForTransaction(req, { path: true })[0];
    }
    case 'handler': {
      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';
    }
    case 'methodPath':
    default: {
      return extractPathForTransaction(req, { path: true, method: true })[0];
    }
  }
}

/** JSDoc */
function extractUserData(
  user

,
  keys,
) {
  const extractedUser = {};
  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;

  attributes.forEach(key => {
    if (user && key in user) {
      extractedUser[key] = user[key];
    }
  });

  return extractedUser;
}

/**
 * Normalize data from the request object
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 *
 * @returns An object containing normalized request data
 */
function extractRequestData(
  req,
  options

,
) {
  const { include = DEFAULT_REQUEST_INCLUDES } = options || {};
  const requestData = {};

  // headers:
  //   node, express, koa, nextjs: req.headers
  const headers = (req.headers || {})

;
  // method:
  //   node, express, koa, nextjs: req.method
  const method = req.method;
  // host:
  //   express: req.hostname in > 4 and req.host in < 4
  //   koa: req.host
  //   node, nextjs: req.headers.host
  const host = req.hostname || req.host || headers.host || '<no host>';
  // protocol:
  //   node, nextjs: <n/a>
  //   express, koa: req.protocol
  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  const originalUrl = req.originalUrl || req.url || '';
  // absolute url
  const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;
  include.forEach(key => {
    switch (key) {
      case 'headers': {
        requestData.headers = headers;

        // Remove the Cookie header in case cookie data should not be included in the event
        if (!include.includes('cookies')) {
          delete (requestData.headers ).cookie;
        }

        break;
      }
      case 'method': {
        requestData.method = method;
        break;
      }
      case 'url': {
        requestData.url = absoluteUrl;
        break;
      }
      case 'cookies': {
        // cookies:
        //   node, express, koa: req.headers.cookie
        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.cookies =
          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
          // come off in v8
          req.cookies || (headers.cookie && cookie.parse(headers.cookie)) || {};
        break;
      }
      case 'query_string': {
        // query string:
        //   node: req.url (raw)
        //   express, koa, nextjs: req.query
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.query_string = extractQueryParams(req);
        break;
      }
      case 'data': {
        if (method === 'GET' || method === 'HEAD') {
          break;
        }
        // body data:
        //   express, koa, nextjs: req.body
        //
        //   when using node by itself, you have to read the incoming stream(see
        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know
        //   where they're going to store the final result, so they'll have to capture this data themselves
        if (req.body !== undefined) {
          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));
        }
        break;
      }
      default: {
        if ({}.hasOwnProperty.call(req, key)) {
          requestData[key] = (req )[key];
        }
      }
    }
  });

  return requestData;
}

/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 *
 * @returns The mutated `Event` object
 */
function addRequestDataToEvent(
  event,
  req,
  options,
) {
  const include = {
    ...DEFAULT_INCLUDES,
    ..._optionalChain([options, 'optionalAccess', _ => _.include]),
  };

  if (include.request) {
    const extractedRequestData = Array.isArray(include.request)
      ? extractRequestData(req, { include: include.request })
      : extractRequestData(req);

    event.request = {
      ...event.request,
      ...extractedRequestData,
    };
  }

  if (include.user) {
    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};

    if (Object.keys(extractedUser).length) {
      event.user = {
        ...event.user,
        ...extractedUser,
      };
    }
  }

  // client ip:
  //   node, nextjs: req.socket.remoteAddress
  //   express, koa: req.ip
  if (include.ip) {
    const ip = req.ip || (req.socket && req.socket.remoteAddress);
    if (ip) {
      event.user = {
        ...event.user,
        ip_address: ip,
      };
    }
  }

  if (include.transaction && !event.transaction) {
    // TODO do we even need this anymore?
    // TODO make this work for nextjs
    event.transaction = extractTransaction(req, include.transaction);
  }

  return event;
}

function extractQueryParams(req) {
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  let originalUrl = req.originalUrl || req.url || '';

  if (!originalUrl) {
    return;
  }

  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and
  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.
  if (originalUrl.startsWith('/')) {
    originalUrl = `http://dogs.are.great${originalUrl}`;
  }

  return (
    req.query ||
    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||
    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
    url.parse(originalUrl).query ||
    undefined
  );
}

export { DEFAULT_USER_INCLUDES, addRequestDataToEvent, extractPathForTransaction, extractRequestData };
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../src/requestdata.ts"],"sourcesContent":["import type {\n  Event,\n  ExtractedNodeRequestData,\n  PolymorphicRequest,\n  Transaction,\n  TransactionSource,\n} from '@sentry/types';\nimport { isPlainObject, isString, normalize, stripUrlQueryAndFragment } from '@sentry/utils';\nimport * as cookie from 'cookie';\nimport * as url from 'url';\n\nconst DEFAULT_INCLUDES = {\n  ip: false,\n  request: true,\n  transaction: true,\n  user: true,\n};\nconst DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\nexport const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n */\nexport type AddRequestDataToEventOptions = {\n  /** Flags controlling whether each type of data should be added to the event */\n  include?: {\n    ip?: boolean;\n    request?: boolean | Array<(typeof DEFAULT_REQUEST_INCLUDES)[number]>;\n    transaction?: boolean | TransactionNamingScheme;\n    user?: boolean | Array<(typeof DEFAULT_USER_INCLUDES)[number]>;\n  };\n};\n\nexport type TransactionNamingScheme = 'path' | 'methodPath' | 'handler';\n\n/**\n * Sets parameterized route as transaction name e.g.: `GET /users/:id`\n * Also adds more context data on the transaction from the request\n */\nexport function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest): void {\n  if (!transaction) return;\n  if (!transaction.metadata.source || transaction.metadata.source === 'url') {\n    // Attempt to grab a parameterized route off of the request\n    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));\n  }\n  transaction.setData('url', req.originalUrl || req.url);\n  if (req.baseUrl) {\n    transaction.setData('baseUrl', req.baseUrl);\n  }\n  transaction.setData('query', extractQueryParams(req));\n}\n\n/**\n * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.\n * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.\n *\n * Additionally, this function determines and returns the transaction name source\n *\n * eg. GET /mountpoint/user/:id\n *\n * @param req A request object\n * @param options What to include in the transaction name (method, path, or a custom route name to be\n *                used instead of the request's route)\n *\n * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')\n */\nexport function extractPathForTransaction(\n  req: PolymorphicRequest,\n  options: { path?: boolean; method?: boolean; customRoute?: string } = {},\n): [string, TransactionSource] {\n  const method = req.method && req.method.toUpperCase();\n\n  let path = '';\n  let source: TransactionSource = 'url';\n\n  // Check to see if there's a parameterized route we can use (as there is in Express)\n  if (options.customRoute || req.route) {\n    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;\n    source = 'route';\n  }\n\n  // Otherwise, just take the original URL\n  else if (req.originalUrl || req.url) {\n    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n  }\n\n  let name = '';\n  if (options.method && method) {\n    name += method;\n  }\n  if (options.method && options.path) {\n    name += ' ';\n  }\n  if (options.path && path) {\n    name += path;\n  }\n\n  return [name, source];\n}\n\n/** JSDoc */\nfunction extractTransaction(req: PolymorphicRequest, type: boolean | TransactionNamingScheme): string {\n  switch (type) {\n    case 'path': {\n      return extractPathForTransaction(req, { path: true })[0];\n    }\n    case 'handler': {\n      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';\n    }\n    case 'methodPath':\n    default: {\n      return extractPathForTransaction(req, { path: true, method: true })[0];\n    }\n  }\n}\n\n/** JSDoc */\nfunction extractUserData(\n  user: {\n    [key: string]: unknown;\n  },\n  keys: boolean | string[],\n): { [key: string]: unknown } {\n  const extractedUser: { [key: string]: unknown } = {};\n  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;\n\n  attributes.forEach(key => {\n    if (user && key in user) {\n      extractedUser[key] = user[key];\n    }\n  });\n\n  return extractedUser;\n}\n\n/**\n * Normalize data from the request object\n *\n * @param req The request object from which to extract data\n * @param options.include An optional array of keys to include in the normalized data. Defaults to\n * DEFAULT_REQUEST_INCLUDES if not provided.\n * @param options.deps Injected, platform-specific dependencies\n *\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(\n  req: PolymorphicRequest,\n  options?: {\n    include?: string[];\n  },\n): ExtractedNodeRequestData {\n  const { include = DEFAULT_REQUEST_INCLUDES } = options || {};\n  const requestData: { [key: string]: unknown } = {};\n\n  // headers:\n  //   node, express, koa, nextjs: req.headers\n  const headers = (req.headers || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa, nextjs: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node, nextjs: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node, nextjs: <n/a>\n  //   express, koa: req.protocol\n  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  const originalUrl = req.originalUrl || req.url || '';\n  // absolute url\n  const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;\n  include.forEach(key => {\n    switch (key) {\n      case 'headers': {\n        requestData.headers = headers;\n\n        // Remove the Cookie header in case cookie data should not be included in the event\n        if (!include.includes('cookies')) {\n          delete (requestData.headers as { cookie?: string }).cookie;\n        }\n\n        break;\n      }\n      case 'method': {\n        requestData.method = method;\n        break;\n      }\n      case 'url': {\n        requestData.url = absoluteUrl;\n        break;\n      }\n      case 'cookies': {\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies =\n          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can\n          // come off in v8\n          req.cookies || (headers.cookie && cookie.parse(headers.cookie)) || {};\n        break;\n      }\n      case 'query_string': {\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa, nextjs: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = extractQueryParams(req);\n        break;\n      }\n      case 'data': {\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   express, koa, nextjs: req.body\n        //\n        //   when using node by itself, you have to read the incoming stream(see\n        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n        //   where they're going to store the final result, so they'll have to capture this data themselves\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      }\n      default: {\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: unknown })[key];\n        }\n      }\n    }\n  });\n\n  return requestData;\n}\n\n/**\n * Add data from the given request to the given event\n *\n * @param event The event to which the request data will be added\n * @param req Request object\n * @param options.include Flags to control what data is included\n *\n * @returns The mutated `Event` object\n */\nexport function addRequestDataToEvent(\n  event: Event,\n  req: PolymorphicRequest,\n  options?: AddRequestDataToEventOptions,\n): Event {\n  const include = {\n    ...DEFAULT_INCLUDES,\n    ...options?.include,\n  };\n\n  if (include.request) {\n    const extractedRequestData = Array.isArray(include.request)\n      ? extractRequestData(req, { include: include.request })\n      : extractRequestData(req);\n\n    event.request = {\n      ...event.request,\n      ...extractedRequestData,\n    };\n  }\n\n  if (include.user) {\n    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};\n\n    if (Object.keys(extractedUser).length) {\n      event.user = {\n        ...event.user,\n        ...extractedUser,\n      };\n    }\n  }\n\n  // client ip:\n  //   node, nextjs: req.socket.remoteAddress\n  //   express, koa: req.ip\n  if (include.ip) {\n    const ip = req.ip || (req.socket && req.socket.remoteAddress);\n    if (ip) {\n      event.user = {\n        ...event.user,\n        ip_address: ip,\n      };\n    }\n  }\n\n  if (include.transaction && !event.transaction) {\n    // TODO do we even need this anymore?\n    // TODO make this work for nextjs\n    event.transaction = extractTransaction(req, include.transaction);\n  }\n\n  return event;\n}\n\nfunction extractQueryParams(req: PolymorphicRequest): string | Record<string, unknown> | undefined {\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  let originalUrl = req.originalUrl || req.url || '';\n\n  if (!originalUrl) {\n    return;\n  }\n\n  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and\n  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.\n  if (originalUrl.startsWith('/')) {\n    originalUrl = `http://dogs.are.great${originalUrl}`;\n  }\n\n  return (\n    req.query ||\n    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||\n    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node\n    url.parse(originalUrl).query ||\n    undefined\n  );\n}\n"],"names":[],"mappings":";;;;;AAWA,CAAA,CAAA,CAAA,CAAA,EAAA,iBAAA,EAAA;EACA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,QAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CA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EAAA,CAAA,CAAA,CAAA;IACA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;IACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA;AACA;;"}import { extractRequestData as extractRequestData$1, addRequestDataToEvent } from './requestdata.js';

/**
 * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead.
 */

/**
 * Normalizes data from the request object, accounting for framework differences.
 *
 * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead.
 *
 * @param req The request object from which to extract data
 * @param keys An optional array of keys to include in the normalized data.
 * @returns An object containing normalized request data
 */
function extractRequestData(req, keys) {
  return extractRequestData$1(req, { include: keys });
}

/**
 * Options deciding what parts of the request to use when enhancing an event
 *
 * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use
 * `AddRequestDataToEventOptions` in `@sentry/utils` instead.
 */

/**
 * Enriches passed event with request data.
 *
 * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead.
 *
 * @param event Will be mutated and enriched with req data
 * @param req Request object
 * @param options object containing flags to enable functionality
 * @hidden
 */
function parseRequest(event, req, options = {}) {
  return addRequestDataToEvent(event, req, { include: options });
}

export { extractRequestData, parseRequest };
//# sourceMappingURL=requestDataDeprecated.js.map
{"version":3,"file":"requestDataDeprecated.js","sources":["../../src/requestDataDeprecated.ts"],"sourcesContent":["/**\n * Deprecated functions which are slated for removal in v8. When the time comes, this entire file can be deleted.\n *\n * See https://github.com/getsentry/sentry-javascript/pull/5257.\n */\n\n/* eslint-disable deprecation/deprecation */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, ExtractedNodeRequestData, PolymorphicRequest } from '@sentry/types';\n\nimport type { AddRequestDataToEventOptions } from './requestdata';\nimport { addRequestDataToEvent, extractRequestData as _extractRequestData } from './requestdata';\n\n/**\n * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead.\n */\nexport type ExpressRequest = PolymorphicRequest;\n\n/**\n * Normalizes data from the request object, accounting for framework differences.\n *\n * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead.\n *\n * @param req The request object from which to extract data\n * @param keys An optional array of keys to include in the normalized data.\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(req: { [key: string]: any }, keys?: string[]): ExtractedNodeRequestData {\n  return _extractRequestData(req, { include: keys });\n}\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n *\n * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use\n * `AddRequestDataToEventOptions` in `@sentry/utils` instead.\n */\nexport type ParseRequestOptions = AddRequestDataToEventOptions['include'] & {\n  serverName?: boolean;\n  version?: boolean;\n};\n\n/**\n * Enriches passed event with request data.\n *\n * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead.\n *\n * @param event Will be mutated and enriched with req data\n * @param req Request object\n * @param options object containing flags to enable functionality\n * @hidden\n */\nexport function parseRequest(event: Event, req: ExpressRequest, options: ParseRequestOptions = {}): Event {\n  return addRequestDataToEvent(event, req, { include: options });\n}\n"],"names":["_extractRequestData"],"mappings":";;AAaA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,GAAA,EAAA,IAAA,EAAA;AACA,EAAA,OAAAA,oBAAA,CAAA,GAAA,EAAA,EAAA,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,KAAA,EAAA,GAAA,EAAA,OAAA,GAAA,EAAA,EAAA;AACA,EAAA,OAAA,qBAAA,CAAA,KAAA,EAAA,GAAA,EAAA,EAAA,OAAA,EAAA,OAAA,EAAA,CAAA,CAAA;AACA;;;;"}import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
import { Integrations, getMainCarrier, getIntegrationsToSetup, initAndBind, getCurrentHub } from '@sentry/core';
import { createStackParser, nodeStackLineParser, stackParserFromStackParserOptions, logger, GLOBAL_OBJ } from '@sentry/utils';
import { setNodeAsyncContextStrategy } from './async/index.js';
import { NodeClient } from './client.js';
import { Console } from './integrations/console.js';
import { Http } from './integrations/http.js';
import { OnUncaughtException } from './integrations/onuncaughtexception.js';
import { OnUnhandledRejection } from './integrations/onunhandledrejection.js';
import { LinkedErrors } from './integrations/linkederrors.js';
import { Modules } from './integrations/modules.js';
import { ContextLines } from './integrations/contextlines.js';
import { Context } from './integrations/context.js';
import { RequestData } from './integrations/requestdata.js';
import { LocalVariables } from './integrations/localvariables.js';
import './integrations/undici/index.js';
import { getModule } from './module.js';
import { makeNodeTransport } from './transports/http.js';

/* eslint-disable max-lines */

const defaultIntegrations = [
  // Common
  new Integrations.InboundFilters(),
  new Integrations.FunctionToString(),
  // Native Wrappers
  new Console(),
  new Http(),
  // Global Handlers
  new OnUncaughtException(),
  new OnUnhandledRejection(),
  // Event Info
  new ContextLines(),
  new LocalVariables(),
  new Context(),
  new Modules(),
  new RequestData(),
  // Misc
  new LinkedErrors(),
];

/**
 * The Sentry Node SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * main entry module. To set context information or send manual events, use the
 * provided methods.
 *
 * @example
 * ```
 *
 * const { init } = require('@sentry/node');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { configureScope } = require('@sentry/node');
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { addBreadcrumb } = require('@sentry/node');
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const Sentry = require('@sentry/node');
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link NodeOptions} for documentation on configuration options.
 */
function init(options = {}) {
  const carrier = getMainCarrier();

  setNodeAsyncContextStrategy();

  const autoloadedIntegrations = _optionalChain([carrier, 'access', _ => _.__SENTRY__, 'optionalAccess', _2 => _2.integrations]) || [];

  options.defaultIntegrations =
    options.defaultIntegrations === false
      ? []
      : [
          ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations),
          ...autoloadedIntegrations,
        ];

  if (options.dsn === undefined && process.env.SENTRY_DSN) {
    options.dsn = process.env.SENTRY_DSN;
  }

  if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) {
    const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);
    if (isFinite(tracesSampleRate)) {
      options.tracesSampleRate = tracesSampleRate;
    }
  }

  if (options.release === undefined) {
    const detectedRelease = getSentryRelease();
    if (detectedRelease !== undefined) {
      options.release = detectedRelease;
    } else {
      // If release is not provided, then we should disable autoSessionTracking
      options.autoSessionTracking = false;
    }
  }

  if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {
    options.environment = process.env.SENTRY_ENVIRONMENT;
  }

  if (options.autoSessionTracking === undefined && options.dsn !== undefined) {
    options.autoSessionTracking = true;
  }

  if (options.instrumenter === undefined) {
    options.instrumenter = 'sentry';
  }

  // TODO(v7): Refactor this to reduce the logic above
  const clientOptions = {
    ...options,
    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
    integrations: getIntegrationsToSetup(options),
    transport: options.transport || makeNodeTransport,
  };

  initAndBind(NodeClient, clientOptions);

  if (options.autoSessionTracking) {
    startSessionTracking();
  }
}

/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
function lastEventId() {
  return getCurrentHub().lastEventId();
}

/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
async function flush(timeout) {
  const client = getCurrentHub().getClient();
  if (client) {
    return client.flush(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events. No client defined.');
  return Promise.resolve(false);
}

/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
async function close(timeout) {
  const client = getCurrentHub().getClient();
  if (client) {
    return client.close(timeout);
  }
  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Cannot flush events and disable SDK. No client defined.');
  return Promise.resolve(false);
}

/**
 * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
 */
function isAutoSessionTrackingEnabled(client) {
  if (client === undefined) {
    return false;
  }
  const clientOptions = client && client.getOptions();
  if (clientOptions && clientOptions.autoSessionTracking !== undefined) {
    return clientOptions.autoSessionTracking;
  }
  return false;
}

/**
 * Returns a release dynamically from environment variables.
 */
function getSentryRelease(fallback) {
  // Always read first as Sentry takes this as precedence
  if (process.env.SENTRY_RELEASE) {
    return process.env.SENTRY_RELEASE;
  }

  // This supports the variable that sentry-webpack-plugin injects
  if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {
    return GLOBAL_OBJ.SENTRY_RELEASE.id;
  }

  return (
    // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
    process.env.GITHUB_SHA ||
    // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata
    process.env.COMMIT_REF ||
    // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables
    process.env.VERCEL_GIT_COMMIT_SHA ||
    process.env.VERCEL_GITHUB_COMMIT_SHA ||
    process.env.VERCEL_GITLAB_COMMIT_SHA ||
    process.env.VERCEL_BITBUCKET_COMMIT_SHA ||
    // Zeit (now known as Vercel)
    process.env.ZEIT_GITHUB_COMMIT_SHA ||
    process.env.ZEIT_GITLAB_COMMIT_SHA ||
    process.env.ZEIT_BITBUCKET_COMMIT_SHA ||
    fallback
  );
}

/** Node.js stack parser */
const defaultStackParser = createStackParser(nodeStackLineParser(getModule));

/**
 * Enable automatic Session Tracking for the node process.
 */
function startSessionTracking() {
  const hub = getCurrentHub();
  hub.startSession();
  // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because
  // The 'beforeExit' event is not emitted for conditions causing explicit termination,
  // such as calling process.exit() or uncaught exceptions.
  // Ref: https://nodejs.org/api/process.html#process_event_beforeexit
  process.on('beforeExit', () => {
    const session = _optionalChain([hub, 'access', _3 => _3.getScope, 'call', _4 => _4(), 'optionalAccess', _5 => _5.getSession, 'call', _6 => _6()]);
    const terminalStates = ['exited', 'crashed'];
    // Only call endSession, if the Session exists on Scope and SessionStatus is not a
    // Terminal Status i.e. Exited or Crashed because
    // "When a session is moved away from ok it must not be updated anymore."
    // Ref: https://develop.sentry.dev/sdk/sessions/
    if (session && !terminalStates.includes(session.status)) hub.endSession();
  });
}

export { close, defaultIntegrations, defaultStackParser, flush, getSentryRelease, init, isAutoSessionTrackingEnabled, lastEventId };
//# sourceMappingURL=sdk.js.map
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["/* eslint-disable max-lines */\nimport {\n  getCurrentHub,\n  getIntegrationsToSetup,\n  getMainCarrier,\n  initAndBind,\n  Integrations as CoreIntegrations,\n} from '@sentry/core';\nimport type { SessionStatus, StackParser } from '@sentry/types';\nimport {\n  createStackParser,\n  GLOBAL_OBJ,\n  logger,\n  nodeStackLineParser,\n  stackParserFromStackParserOptions,\n} from '@sentry/utils';\n\nimport { setNodeAsyncContextStrategy } from './async';\nimport { NodeClient } from './client';\nimport {\n  Console,\n  Context,\n  ContextLines,\n  Http,\n  LinkedErrors,\n  LocalVariables,\n  Modules,\n  OnUncaughtException,\n  OnUnhandledRejection,\n  RequestData,\n} from './integrations';\nimport { getModule } from './module';\nimport { makeNodeTransport } from './transports';\nimport type { NodeClientOptions, NodeOptions } from './types';\n\nexport const defaultIntegrations = [\n  // Common\n  new CoreIntegrations.InboundFilters(),\n  new CoreIntegrations.FunctionToString(),\n  // Native Wrappers\n  new Console(),\n  new Http(),\n  // Global Handlers\n  new OnUncaughtException(),\n  new OnUnhandledRejection(),\n  // Event Info\n  new ContextLines(),\n  new LocalVariables(),\n  new Context(),\n  new Modules(),\n  new RequestData(),\n  // Misc\n  new LinkedErrors(),\n];\n\n/**\n * The Sentry Node SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible in the\n * main entry module. To set context information or send manual events, use the\n * provided methods.\n *\n * @example\n * ```\n *\n * const { init } = require('@sentry/node');\n *\n * init({\n *   dsn: '__DSN__',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * const { configureScope } = require('@sentry/node');\n * configureScope((scope: Scope) => {\n *   scope.setExtra({ battery: 0.7 });\n *   scope.setTag({ user_mode: 'admin' });\n *   scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * const { addBreadcrumb } = require('@sentry/node');\n * addBreadcrumb({\n *   message: 'My Breadcrumb',\n *   // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * const Sentry = require('@sentry/node');\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n *   message: 'Manual',\n *   stacktrace: [\n *     // ...\n *   ],\n * });\n * ```\n *\n * @see {@link NodeOptions} for documentation on configuration options.\n */\nexport function init(options: NodeOptions = {}): void {\n  const carrier = getMainCarrier();\n\n  setNodeAsyncContextStrategy();\n\n  const autoloadedIntegrations = carrier.__SENTRY__?.integrations || [];\n\n  options.defaultIntegrations =\n    options.defaultIntegrations === false\n      ? []\n      : [\n          ...(Array.isArray(options.defaultIntegrations) ? options.defaultIntegrations : defaultIntegrations),\n          ...autoloadedIntegrations,\n        ];\n\n  if (options.dsn === undefined && process.env.SENTRY_DSN) {\n    options.dsn = process.env.SENTRY_DSN;\n  }\n\n  if (options.tracesSampleRate === undefined && process.env.SENTRY_TRACES_SAMPLE_RATE) {\n    const tracesSampleRate = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE);\n    if (isFinite(tracesSampleRate)) {\n      options.tracesSampleRate = tracesSampleRate;\n    }\n  }\n\n  if (options.release === undefined) {\n    const detectedRelease = getSentryRelease();\n    if (detectedRelease !== undefined) {\n      options.release = detectedRelease;\n    } else {\n      // If release is not provided, then we should disable autoSessionTracking\n      options.autoSessionTracking = false;\n    }\n  }\n\n  if (options.environment === undefined && process.env.SENTRY_ENVIRONMENT) {\n    options.environment = process.env.SENTRY_ENVIRONMENT;\n  }\n\n  if (options.autoSessionTracking === undefined && options.dsn !== undefined) {\n    options.autoSessionTracking = true;\n  }\n\n  if (options.instrumenter === undefined) {\n    options.instrumenter = 'sentry';\n  }\n\n  // TODO(v7): Refactor this to reduce the logic above\n  const clientOptions: NodeClientOptions = {\n    ...options,\n    stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n    integrations: getIntegrationsToSetup(options),\n    transport: options.transport || makeNodeTransport,\n  };\n\n  initAndBind(NodeClient, clientOptions);\n\n  if (options.autoSessionTracking) {\n    startSessionTracking();\n  }\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nexport function lastEventId(): string | undefined {\n  return getCurrentHub().lastEventId();\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function flush(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient<NodeClient>();\n  if (client) {\n    return client.flush(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nexport async function close(timeout?: number): Promise<boolean> {\n  const client = getCurrentHub().getClient<NodeClient>();\n  if (client) {\n    return client.close(timeout);\n  }\n  __DEBUG_BUILD__ && logger.warn('Cannot flush events and disable SDK. No client defined.');\n  return Promise.resolve(false);\n}\n\n/**\n * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client\n */\nexport function isAutoSessionTrackingEnabled(client?: NodeClient): boolean {\n  if (client === undefined) {\n    return false;\n  }\n  const clientOptions = client && client.getOptions();\n  if (clientOptions && clientOptions.autoSessionTracking !== undefined) {\n    return clientOptions.autoSessionTracking;\n  }\n  return false;\n}\n\n/**\n * Returns a release dynamically from environment variables.\n */\nexport function getSentryRelease(fallback?: string): string | undefined {\n  // Always read first as Sentry takes this as precedence\n  if (process.env.SENTRY_RELEASE) {\n    return process.env.SENTRY_RELEASE;\n  }\n\n  // This supports the variable that sentry-webpack-plugin injects\n  if (GLOBAL_OBJ.SENTRY_RELEASE && GLOBAL_OBJ.SENTRY_RELEASE.id) {\n    return GLOBAL_OBJ.SENTRY_RELEASE.id;\n  }\n\n  return (\n    // GitHub Actions - https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables\n    process.env.GITHUB_SHA ||\n    // Netlify - https://docs.netlify.com/configure-builds/environment-variables/#build-metadata\n    process.env.COMMIT_REF ||\n    // Vercel - https://vercel.com/docs/v2/build-step#system-environment-variables\n    process.env.VERCEL_GIT_COMMIT_SHA ||\n    process.env.VERCEL_GITHUB_COMMIT_SHA ||\n    process.env.VERCEL_GITLAB_COMMIT_SHA ||\n    process.env.VERCEL_BITBUCKET_COMMIT_SHA ||\n    // Zeit (now known as Vercel)\n    process.env.ZEIT_GITHUB_COMMIT_SHA ||\n    process.env.ZEIT_GITLAB_COMMIT_SHA ||\n    process.env.ZEIT_BITBUCKET_COMMIT_SHA ||\n    fallback\n  );\n}\n\n/** Node.js stack parser */\nexport const defaultStackParser: StackParser = createStackParser(nodeStackLineParser(getModule));\n\n/**\n * Enable automatic Session Tracking for the node process.\n */\nfunction startSessionTracking(): void {\n  const hub = getCurrentHub();\n  hub.startSession();\n  // Emitted in the case of healthy sessions, error of `mechanism.handled: true` and unhandledrejections because\n  // The 'beforeExit' event is not emitted for conditions causing explicit termination,\n  // such as calling process.exit() or uncaught exceptions.\n  // Ref: https://nodejs.org/api/process.html#process_event_beforeexit\n  process.on('beforeExit', () => {\n    const session = hub.getScope()?.getSession();\n    const terminalStates: SessionStatus[] = ['exited', 'crashed'];\n    // Only call endSession, if the Session exists on Scope and SessionStatus is not a\n    // Terminal Status i.e. Exited or Crashed because\n    // \"When a session is moved away from ok it must not be updated anymore.\"\n    // Ref: https://develop.sentry.dev/sdk/sessions/\n    if (session && !terminalStates.includes(session.status)) hub.endSession();\n  });\n}\n"],"names":["CoreIntegrations"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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,CAAA,CAAA,CAAA,CAAA,MAAA,CAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA;AACA;;"}import { lazyLoadedNodePerformanceMonitoringIntegrations } from '@sentry-internal/tracing';
import { logger } from '@sentry/utils';

/**
 * Automatically detects and returns integrations that will work with your dependencies.
 */
function autoDiscoverNodePerformanceMonitoringIntegrations() {
  const loadedIntegrations = lazyLoadedNodePerformanceMonitoringIntegrations
    .map(tryLoad => {
      try {
        return tryLoad();
      } catch (_) {
        return undefined;
      }
    })
    .filter(integration => !!integration) ;

  if (loadedIntegrations.length === 0) {
    logger.warn('Performance monitoring integrations could not be automatically loaded.');
  }

  // Only return integrations where their dependencies loaded successfully.
  return loadedIntegrations.filter(integration => !!integration.loadDependency());
}

export { autoDiscoverNodePerformanceMonitoringIntegrations };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/tracing/index.ts"],"sourcesContent":["import type { LazyLoadedIntegration } from '@sentry-internal/tracing';\nimport { lazyLoadedNodePerformanceMonitoringIntegrations } from '@sentry-internal/tracing';\nimport type { Integration } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\n/**\n * Automatically detects and returns integrations that will work with your dependencies.\n */\nexport function autoDiscoverNodePerformanceMonitoringIntegrations(): Integration[] {\n  const loadedIntegrations = lazyLoadedNodePerformanceMonitoringIntegrations\n    .map(tryLoad => {\n      try {\n        return tryLoad();\n      } catch (_) {\n        return undefined;\n      }\n    })\n    .filter(integration => !!integration) as LazyLoadedIntegration[];\n\n  if (loadedIntegrations.length === 0) {\n    logger.warn('Performance monitoring integrations could not be automatically loaded.');\n  }\n\n  // Only return integrations where their dependencies loaded successfully.\n  return loadedIntegrations.filter(integration => !!integration.loadDependency());\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA,SAAA,iDAAA,GAAA;AACA,EAAA,MAAA,kBAAA,GAAA,+CAAA;AACA,KAAA,GAAA,CAAA,OAAA,IAAA;AACA,MAAA,IAAA;AACA,QAAA,OAAA,OAAA,EAAA,CAAA;AACA,OAAA,CAAA,OAAA,CAAA,EAAA;AACA,QAAA,OAAA,SAAA,CAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,KAAA,MAAA,CAAA,WAAA,IAAA,CAAA,CAAA,WAAA,CAAA,EAAA;AACA;AACA,EAAA,IAAA,kBAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAA,MAAA,CAAA,IAAA,CAAA,wEAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,OAAA,kBAAA,CAAA,MAAA,CAAA,WAAA,IAAA,CAAA,CAAA,WAAA,CAAA,cAAA,EAAA,CAAA,CAAA;AACA;;;;"}export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma } from '@sentry-internal/tracing';
//# sourceMappingURL=integrations.js.map
{"version":3,"file":"integrations.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}import { _nullishCoalesce } from '@sentry/utils/esm/buildPolyfills';
import { createTransport } from '@sentry/core';
import * as http from 'http';
import * as https from 'https';
import { HttpsProxyAgent } from 'https-proxy-agent';
import { Readable } from 'stream';
import { URL } from 'url';
import { createGzip } from 'zlib';

// Estimated maximum size for reasonable standalone event
const GZIP_THRESHOLD = 1024 * 32;

/**
 * Gets a stream from a Uint8Array or string
 * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0
 */
function streamFromBody(body) {
  return new Readable({
    read() {
      this.push(body);
      this.push(null);
    },
  });
}

/**
 * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.
 */
function makeNodeTransport(options) {
  let urlSegments;

  try {
    urlSegments = new URL(options.url);
  } catch (e) {
    // eslint-disable-next-line no-console
    console.warn(
      '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',
    );
    return createTransport(options, () => Promise.resolve({}));
  }

  const isHttps = urlSegments.protocol === 'https:';

  // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`
  // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`
  const proxy = applyNoProxyOption(
    urlSegments,
    options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,
  );

  const nativeHttpModule = isHttps ? https : http;
  const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;

  // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node
  // versions(>= 8) as they had memory leaks when using it: #2555
  const agent = proxy
    ? (new HttpsProxyAgent(proxy) )
    : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });

  const requestExecutor = createRequestExecutor(options, _nullishCoalesce(options.httpModule, () => ( nativeHttpModule)), agent);
  return createTransport(options, requestExecutor);
}

/**
 * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.
 *
 * @param transportUrl The URL the transport intends to send events to.
 * @param proxy The client configured proxy.
 * @returns A proxy the transport should use.
 */
function applyNoProxyOption(transportUrlSegments, proxy) {
  const { no_proxy } = process.env;

  const urlIsExemptFromProxy =
    no_proxy &&
    no_proxy
      .split(',')
      .some(
        exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),
      );

  if (urlIsExemptFromProxy) {
    return undefined;
  } else {
    return proxy;
  }
}

/**
 * Creates a RequestExecutor to be used with `createTransport`.
 */
function createRequestExecutor(
  options,
  httpModule,
  agent,
) {
  const { hostname, pathname, port, protocol, search } = new URL(options.url);
  return function makeRequest(request) {
    return new Promise((resolve, reject) => {
      let body = streamFromBody(request.body);

      const headers = { ...options.headers };

      if (request.body.length > GZIP_THRESHOLD) {
        headers['content-encoding'] = 'gzip';
        body = body.pipe(createGzip());
      }

      const req = httpModule.request(
        {
          method: 'POST',
          agent,
          headers,
          hostname,
          path: `${pathname}${search}`,
          port,
          protocol,
          ca: options.caCerts,
        },
        res => {
          res.on('data', () => {
            // Drain socket
          });

          res.on('end', () => {
            // Drain socket
          });

          res.setEncoding('utf8');

          // "Key-value pairs of header names and values. Header names are lower-cased."
          // https://nodejs.org/api/http.html#http_message_headers
          const retryAfterHeader = _nullishCoalesce(res.headers['retry-after'], () => ( null));
          const rateLimitsHeader = _nullishCoalesce(res.headers['x-sentry-rate-limits'], () => ( null));

          resolve({
            statusCode: res.statusCode,
            headers: {
              'retry-after': retryAfterHeader,
              'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,
            },
          });
        },
      );

      req.on('error', reject);
      body.pipe(req);
    });
  };
}

export { makeNodeTransport };
//# sourceMappingURL=http.js.map
{"version":3,"file":"http.js","sources":["../../../src/transports/http.ts"],"sourcesContent":["import { createTransport } from '@sentry/core';\nimport type {\n  BaseTransportOptions,\n  Transport,\n  TransportMakeRequestResponse,\n  TransportRequest,\n  TransportRequestExecutor,\n} from '@sentry/types';\nimport * as http from 'http';\nimport * as https from 'https';\nimport { HttpsProxyAgent } from 'https-proxy-agent';\nimport { Readable } from 'stream';\nimport { URL } from 'url';\nimport { createGzip } from 'zlib';\n\nimport type { HTTPModule } from './http-module';\n\nexport interface NodeTransportOptions extends BaseTransportOptions {\n  /** Define custom headers */\n  headers?: Record<string, string>;\n  /** Set a proxy that should be used for outbound requests. */\n  proxy?: string;\n  /** HTTPS proxy CA certificates */\n  caCerts?: string | Buffer | Array<string | Buffer>;\n  /** Custom HTTP module. Defaults to the native 'http' and 'https' modules. */\n  httpModule?: HTTPModule;\n  /** Allow overriding connection keepAlive, defaults to false */\n  keepAlive?: boolean;\n}\n\n// Estimated maximum size for reasonable standalone event\nconst GZIP_THRESHOLD = 1024 * 32;\n\n/**\n * Gets a stream from a Uint8Array or string\n * Readable.from is ideal but was added in node.js v12.3.0 and v10.17.0\n */\nfunction streamFromBody(body: Uint8Array | string): Readable {\n  return new Readable({\n    read() {\n      this.push(body);\n      this.push(null);\n    },\n  });\n}\n\n/**\n * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.\n */\nexport function makeNodeTransport(options: NodeTransportOptions): Transport {\n  let urlSegments: URL;\n\n  try {\n    urlSegments = new URL(options.url);\n  } catch (e) {\n    // eslint-disable-next-line no-console\n    console.warn(\n      '[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.',\n    );\n    return createTransport(options, () => Promise.resolve({}));\n  }\n\n  const isHttps = urlSegments.protocol === 'https:';\n\n  // Proxy prioritization: http => `options.proxy` | `process.env.http_proxy`\n  // Proxy prioritization: https => `options.proxy` | `process.env.https_proxy` | `process.env.http_proxy`\n  const proxy = applyNoProxyOption(\n    urlSegments,\n    options.proxy || (isHttps ? process.env.https_proxy : undefined) || process.env.http_proxy,\n  );\n\n  const nativeHttpModule = isHttps ? https : http;\n  const keepAlive = options.keepAlive === undefined ? false : options.keepAlive;\n\n  // TODO(v7): Evaluate if we can set keepAlive to true. This would involve testing for memory leaks in older node\n  // versions(>= 8) as they had memory leaks when using it: #2555\n  const agent = proxy\n    ? (new HttpsProxyAgent(proxy) as http.Agent)\n    : new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });\n\n  const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);\n  return createTransport(options, requestExecutor);\n}\n\n/**\n * Honors the `no_proxy` env variable with the highest priority to allow for hosts exclusion.\n *\n * @param transportUrl The URL the transport intends to send events to.\n * @param proxy The client configured proxy.\n * @returns A proxy the transport should use.\n */\nfunction applyNoProxyOption(transportUrlSegments: URL, proxy: string | undefined): string | undefined {\n  const { no_proxy } = process.env;\n\n  const urlIsExemptFromProxy =\n    no_proxy &&\n    no_proxy\n      .split(',')\n      .some(\n        exemption => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption),\n      );\n\n  if (urlIsExemptFromProxy) {\n    return undefined;\n  } else {\n    return proxy;\n  }\n}\n\n/**\n * Creates a RequestExecutor to be used with `createTransport`.\n */\nfunction createRequestExecutor(\n  options: NodeTransportOptions,\n  httpModule: HTTPModule,\n  agent: http.Agent,\n): TransportRequestExecutor {\n  const { hostname, pathname, port, protocol, search } = new URL(options.url);\n  return function makeRequest(request: TransportRequest): Promise<TransportMakeRequestResponse> {\n    return new Promise((resolve, reject) => {\n      let body = streamFromBody(request.body);\n\n      const headers: Record<string, string> = { ...options.headers };\n\n      if (request.body.length > GZIP_THRESHOLD) {\n        headers['content-encoding'] = 'gzip';\n        body = body.pipe(createGzip());\n      }\n\n      const req = httpModule.request(\n        {\n          method: 'POST',\n          agent,\n          headers,\n          hostname,\n          path: `${pathname}${search}`,\n          port,\n          protocol,\n          ca: options.caCerts,\n        },\n        res => {\n          res.on('data', () => {\n            // Drain socket\n          });\n\n          res.on('end', () => {\n            // Drain socket\n          });\n\n          res.setEncoding('utf8');\n\n          // \"Key-value pairs of header names and values. Header names are lower-cased.\"\n          // https://nodejs.org/api/http.html#http_message_headers\n          const retryAfterHeader = res.headers['retry-after'] ?? null;\n          const rateLimitsHeader = res.headers['x-sentry-rate-limits'] ?? null;\n\n          resolve({\n            statusCode: res.statusCode,\n            headers: {\n              'retry-after': retryAfterHeader,\n              'x-sentry-rate-limits': Array.isArray(rateLimitsHeader) ? rateLimitsHeader[0] : rateLimitsHeader,\n            },\n          });\n        },\n      );\n\n      req.on('error', reject);\n      body.pipe(req);\n    });\n  };\n}\n"],"names":[],"mappings":";;;;;;;;;AA8BA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;cACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;YACA,CAAA;UACA,CAAA,CAAA;QACA,CAAA;MACA,CAAA;;MAEA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;MACA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA,CAAA;EACA,CAAA;AACA;;"}import * as fs from 'fs';
import * as path from 'path';

/**
 * Recursively read the contents of a directory.
 *
 * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this
 * directory.
 * @returns Array holding all relative paths
 */
function deepReadDirSync(targetDir) {
  const targetDirAbsPath = path.resolve(targetDir);

  if (!fs.existsSync(targetDirAbsPath)) {
    throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`);
  }

  if (!fs.statSync(targetDirAbsPath).isDirectory()) {
    throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`);
  }

  // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it
  // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve
  // the difference between `targetDirAbsPath` and `currentDirAbsPath`.
  const deepReadCurrentDir = (currentDirAbsPath) => {
    return fs.readdirSync(currentDirAbsPath).reduce((absPaths, itemName) => {
      const itemAbsPath = path.join(currentDirAbsPath, itemName);

      if (fs.statSync(itemAbsPath).isDirectory()) {
        return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];
      }

      return [...absPaths, itemAbsPath];
    }, []);
  };

  return deepReadCurrentDir(targetDirAbsPath).map(absPath => path.relative(targetDirAbsPath, absPath));
}

export { deepReadDirSync };
//# sourceMappingURL=utils.js.map
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\n/**\n * Recursively read the contents of a directory.\n *\n * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this\n * directory.\n * @returns Array holding all relative paths\n */\nexport function deepReadDirSync(targetDir: string): string[] {\n  const targetDirAbsPath = path.resolve(targetDir);\n\n  if (!fs.existsSync(targetDirAbsPath)) {\n    throw new Error(`Cannot read contents of ${targetDirAbsPath}. Directory does not exist.`);\n  }\n\n  if (!fs.statSync(targetDirAbsPath).isDirectory()) {\n    throw new Error(`Cannot read contents of ${targetDirAbsPath}, because it is not a directory.`);\n  }\n\n  // This does the same thing as its containing function, `deepReadDirSync` (except that - purely for convenience - it\n  // deals in absolute paths rather than relative ones). We need this to be separate from the outer function to preserve\n  // the difference between `targetDirAbsPath` and `currentDirAbsPath`.\n  const deepReadCurrentDir = (currentDirAbsPath: string): string[] => {\n    return fs.readdirSync(currentDirAbsPath).reduce((absPaths: string[], itemName: string) => {\n      const itemAbsPath = path.join(currentDirAbsPath, itemName);\n\n      if (fs.statSync(itemAbsPath).isDirectory()) {\n        return [...absPaths, ...deepReadCurrentDir(itemAbsPath)];\n      }\n\n      return [...absPaths, itemAbsPath];\n    }, []);\n  };\n\n  return deepReadCurrentDir(targetDirAbsPath).map(absPath => path.relative(targetDirAbsPath, absPath));\n}\n"],"names":[],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entry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/node",
  "version": "7.48.0",
  "description": "Official Sentry SDK for Node.js",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@sentry-internal/tracing": "7.48.0",
    "@sentry/core": "7.48.0",
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0",
    "cookie": "^0.4.1",
    "https-proxy-agent": "^5.0.0",
    "lru_map": "^0.3.3",
    "tslib": "^1.9.3"
  },
  "devDependencies": {
    "@types/cookie": "0.3.2",
    "@types/express": "^4.17.14",
    "@types/lru-cache": "^5.1.0",
    "@types/node": "~10.17.0",
    "express": "^4.17.1",
    "nock": "^13.0.5",
    "undici": "^5.21.0"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Official Sentry SDK for NodeJS

[![npm version](https://img.shields.io/npm/v/@sentry/node.svg)](https://www.npmjs.com/package/@sentry/node)
[![npm dm](https://img.shields.io/npm/dm/@sentry/node.svg)](https://www.npmjs.com/package/@sentry/node)
[![npm dt](https://img.shields.io/npm/dt/@sentry/node.svg)](https://www.npmjs.com/package/@sentry/node)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

## Usage

To use this SDK, call `init(options)` as early as possible in the main entry module. This will initialize the SDK and
hook into the environment. Note that you can turn off almost all side effects using the respective options.

```javascript
// ES5 Syntax
const Sentry = require('@sentry/node');
// ES6 Syntax
import * as Sentry from '@sentry/node';

Sentry.init({
  dsn: '__DSN__',
  // ...
});
```

To set context information or send manual events, use the exported functions of `@sentry/node`. Note that these
functions will not perform any action before you have called `init()`:

```javascript
// Set user information, as well as tags and further extras
Sentry.configureScope(scope => {
  scope.setExtra('battery', 0.7);
  scope.setTag('user_mode', 'admin');
  scope.setUser({ id: '4711' });
  // scope.clear();
});

// Add a breadcrumb for future events
Sentry.addBreadcrumb({
  message: 'My Breadcrumb',
  // ...
});

// Capture exceptions, messages or manual events
Sentry.captureMessage('Hello, world!');
Sentry.captureException(new Error('Good bye'));
Sentry.captureEvent({
  message: 'Manual',
  stacktrace: [
    // ...
  ],
});
```
/**
 * Sets the async context strategy to use Node.js domains.
 */
export declare function setDomainAsyncContextStrategy(): void;
//# sourceMappingURL=domain.d.ts.map{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../src/async/domain.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD"}/**
 * Sets the async context strategy to use AsyncLocalStorage which requires Node v12.17.0 or v13.10.0.
 */
export declare function setHooksAsyncContextStrategy(): void;
//# sourceMappingURL=hooks.d.ts.map{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/async/hooks.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CA8BnD"}/**
 * Sets the correct async context strategy for Node.js
 *
 * Node.js >= 14 uses AsyncLocalStorage
 * Node.js < 14 uses domains
 */
export declare function setNodeAsyncContextStrategy(): void;
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/async/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,2BAA2B,IAAI,IAAI,CAMlD"}import type { CheckIn, CheckInEvelope, DsnComponents, SdkMetadata } from '@sentry/types';
/**
 * Create envelope from check in item.
 */
export declare function createCheckInEnvelope(checkIn: CheckIn, metadata?: SdkMetadata, tunnel?: string, dsn?: DsnComponents): CheckInEvelope;
//# sourceMappingURL=checkin.d.ts.map{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../src/checkin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAe,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGtG;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,WAAW,EACtB,MAAM,CAAC,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,aAAa,GAClB,cAAc,CAchB"}import type { Scope } from '@sentry/core';
import { BaseClient, SessionFlusher } from '@sentry/core';
import type { Event, EventHint, Severity, SeverityLevel } from '@sentry/types';
import type { NodeClientOptions } from './types';
/**
 * The Sentry Node SDK Client.
 *
 * @see NodeClientOptions for documentation on configuration options.
 * @see SentryClient for usage documentation.
 */
export declare class NodeClient extends BaseClient<NodeClientOptions> {
    protected _sessionFlusher: SessionFlusher | undefined;
    /**
     * Creates a new Node SDK instance.
     * @param options Configuration options for this SDK.
     */
    constructor(options: NodeClientOptions);
    /**
     * @inheritDoc
     */
    captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * @inheritDoc
     */
    captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     *
     * @inheritdoc
     */
    close(timeout?: number): PromiseLike<boolean>;
    /** Method that initialises an instance of SessionFlusher on Client */
    initSessionFlusher(): void;
    /**
     * @inheritDoc
     */
    eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
    /**
     * @inheritDoc
     */
    eventFromMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
    /**
     * @inheritDoc
     */
    protected _prepareEvent(event: Event, hint: EventHint, scope?: Scope): PromiseLike<Event | null>;
    /**
     * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment
     * appropriate session aggregates bucket
     */
    protected _captureRequestSession(): void;
}
//# sourceMappingURL=client.d.ts.map{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAwB,UAAU,EAAe,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,UAAU,CAAC,iBAAiB,CAAC;IAC3D,SAAS,CAAC,eAAe,EAAE,cAAc,GAAG,SAAS,CAAC;IAEtD;;;OAGG;gBACgB,OAAO,EAAE,iBAAiB;IAyB7C;;OAEG;IAEI,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;IAiB5F;;OAEG;IACI,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS;IAwBtF;;;OAGG;IACI,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;IAKpD,sEAAsE;IAC/D,kBAAkB,IAAI,IAAI;IAYjC;;OAEG;IAEI,kBAAkB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC;IAI/E;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,MAAM,EAEf,KAAK,GAAE,QAAQ,GAAG,aAAsB,EACxC,IAAI,CAAC,EAAE,SAAS,GACf,WAAW,CAAC,KAAK,CAAC;IAMrB;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC;IAchG;;;OAGG;IACH,SAAS,CAAC,sBAAsB,IAAI,IAAI;CAOzC"}import type { Event, EventHint, Exception, Severity, SeverityLevel, StackFrame, StackParser } from '@sentry/types';
/**
 * Extracts stack frames from the error.stack string
 */
export declare function parseStackFrames(stackParser: StackParser, error: Error): StackFrame[];
/**
 * Extracts stack frames from the error and builds a Sentry Exception
 */
export declare function exceptionFromError(stackParser: StackParser, error: Error): Exception;
/**
 * Builds and Event from a Exception
 * @hidden
 */
export declare function eventFromUnknownInput(stackParser: StackParser, exception: unknown, hint?: EventHint): Event;
/**
 * Builds and Event from a Message
 * @hidden
 */
export declare function eventFromMessage(stackParser: StackParser, message: string, level?: Severity | SeverityLevel, hint?: EventHint, attachStacktrace?: boolean): Event;
//# sourceMappingURL=eventbuilder.d.ts.map{"version":3,"file":"eventbuilder.d.ts","sourceRoot":"","sources":["../../src/eventbuilder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,SAAS,EAET,QAAQ,EACR,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,eAAe,CAAC;AAUvB;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,UAAU,EAAE,CAErF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAYpF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CA+C3G;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,MAAM,EAEf,KAAK,GAAE,QAAQ,GAAG,aAAsB,EACxC,IAAI,CAAC,EAAE,SAAS,EAChB,gBAAgB,CAAC,EAAE,OAAO,GACzB,KAAK,CAsBP"}/// <reference types="node" />
import type { AddRequestDataToEventOptions } from '@sentry/utils';
import type * as http from 'http';
import type { ParseRequestOptions } from './requestDataDeprecated';
/**
 * Express-compatible tracing handler.
 * @see Exposed as `Handlers.tracingHandler`
 */
export declare function tracingHandler(): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
export declare type RequestHandlerOptions = (ParseRequestOptions | AddRequestDataToEventOptions) & {
    flushTimeout?: number;
};
/**
 * Express compatible request handler.
 * @see Exposed as `Handlers.requestHandler`
 */
export declare function requestHandler(options?: RequestHandlerOptions): (req: http.IncomingMessage, res: http.ServerResponse, next: (error?: any) => void) => void;
/** JSDoc */
interface MiddlewareError extends Error {
    status?: number | string;
    statusCode?: number | string;
    status_code?: number | string;
    output?: {
        statusCode?: number | string;
    };
}
/**
 * Express compatible error handler.
 * @see Exposed as `Handlers.errorHandler`
 */
export declare function errorHandler(options?: {
    /**
     * Callback method deciding whether error should be captured and sent to Sentry
     * @param error Captured middleware error
     */
    shouldHandleError?(this: void, error: MiddlewareError): boolean;
}): (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
interface SentryTrpcMiddlewareOptions {
    /** Whether to include procedure inputs in reported events. Defaults to `false`. */
    attachRpcInput?: boolean;
}
interface TrpcMiddlewareArguments<T> {
    path: string;
    type: 'query' | 'mutation' | 'subscription';
    next: () => T;
    rawInput: unknown;
}
/**
 * Sentry tRPC middleware that names the handling transaction after the called procedure.
 *
 * Use the Sentry tRPC middleware in combination with the Sentry server integration,
 * e.g. Express Request Handlers or Next.js SDK.
 */
export declare function trpcMiddleware(options?: SentryTrpcMiddlewareOptions): <T>({ path, type, next, rawInput }: TrpcMiddlewareArguments<T>) => T;
export type { ParseRequestOptions, ExpressRequest } from './requestDataDeprecated';
export { parseRequest, extractRequestData } from './requestDataDeprecated';
//# sourceMappingURL=handlers.d.ts.map{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/handlers.ts"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAWlE,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAKlC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGnE;;;GAGG;AACH,wBAAgB,cAAc,IAAI,CAChC,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,KACxB,IAAI,CA2ER;AAED,oBAAY,qBAAqB,GAG7B,CAAC,mBAAmB,GAAG,4BAA4B,CAAC,GAAG;IACrD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AA2BN;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,qBAAqB,GAC9B,CA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"}export type { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, Exception, Session, Severity, SeverityLevel, Span, StackFrame, Stacktrace, Thread, Transaction, User, } from '@sentry/types';
export type { AddRequestDataToEventOptions } from '@sentry/utils';
export type { TransactionNamingScheme } from './requestdata';
export type { NodeOptions } from './types';
export { addGlobalEventProcessor, addBreadcrumb, captureException, captureEvent, captureMessage, configureScope, createTransport, extractTraceparentData, getActiveTransaction, getHubFromCarrier, getCurrentHub, Hub, makeMain, runWithAsyncContext, Scope, startTransaction, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, spanStatusfromHttpCode, trace, withScope, } from '@sentry/core';
export type { SpanStatusType } from '@sentry/core';
export { autoDiscoverNodePerformanceMonitoringIntegrations } from './tracing';
export { NodeClient } from './client';
export { makeNodeTransport } from './transports';
export { defaultIntegrations, init, defaultStackParser, lastEventId, flush, close, getSentryRelease } from './sdk';
export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from './requestdata';
export { deepReadDirSync } from './utils';
import { Integrations as CoreIntegrations } from '@sentry/core';
import * as Handlers from './handlers';
import * as NodeIntegrations from './integrations';
import * as TracingIntegrations from './tracing/integrations';
declare const INTEGRATIONS: {
    Apollo: typeof TracingIntegrations.Apollo;
    Express: typeof TracingIntegrations.Express;
    GraphQL: typeof TracingIntegrations.GraphQL;
    Mongo: typeof TracingIntegrations.Mongo;
    Mysql: typeof TracingIntegrations.Mysql;
    Postgres: typeof TracingIntegrations.Postgres;
    Prisma: typeof TracingIntegrations.Prisma;
    Console: typeof NodeIntegrations.Console;
    Http: typeof NodeIntegrations.Http;
    OnUncaughtException: typeof NodeIntegrations.OnUncaughtException;
    OnUnhandledRejection: typeof NodeIntegrations.OnUnhandledRejection;
    LinkedErrors: typeof NodeIntegrations.LinkedErrors;
    Modules: typeof NodeIntegrations.Modules;
    ContextLines: typeof NodeIntegrations.ContextLines;
    Context: typeof NodeIntegrations.Context;
    RequestData: typeof NodeIntegrations.RequestData;
    LocalVariables: typeof NodeIntegrations.LocalVariables;
    Undici: typeof NodeIntegrations.Undici;
    FunctionToString: typeof CoreIntegrations.FunctionToString;
    InboundFilters: typeof CoreIntegrations.InboundFilters;
};
export { INTEGRATIONS as Integrations, Handlers };
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,SAAS,EACT,OAAO,EAEP,QAAQ,EACR,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,WAAW,EACX,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAElE,YAAY,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,GAAG,EACH,QAAQ,EACR,mBAAmB,EACnB,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,sBAAsB,EACtB,KAAK,EACL,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iDAAiD,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,gBAAgB,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,mBAAmB,MAAM,wBAAwB,CAAC;AAE9D,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;CAIjB,CAAC;AAEF,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,QAAQ,EAAE,CAAC"}import type { Integration } from '@sentry/types';
/** Console module integration */
export declare class Console implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(): void;
}
//# sourceMappingURL=console.d.ts.map{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/integrations/console.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAIjD,iCAAiC;AACjC,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACI,SAAS,IAAI,IAAI;CAKzB"}/// <reference types="node" />
import type { DeviceContext, Event, EventProcessor, Integration } from '@sentry/types';
import { readdir, readFile } from 'fs';
export declare const readFileAsync: typeof readFile.__promisify__;
export declare const readDirAsync: typeof readdir.__promisify__;
interface DeviceContextOptions {
    cpu?: boolean;
    memory?: boolean;
}
interface ContextOptions {
    app?: boolean;
    os?: boolean;
    device?: DeviceContextOptions | boolean;
    culture?: boolean;
}
/** Add node modules / packages to the event */
export declare class Context implements Integration {
    private readonly _options;
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Caches context so it's only evaluated once
     */
    private _cachedContext;
    constructor(_options?: ContextOptions);
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
    /** Processes an event and adds context */
    addContext(event: Event): Promise<Event>;
    /**
     * Updates the context with dynamic values that can change
     */
    private _updateContext;
    /**
     * Gets the contexts for the current environment
     */
    private _getContexts;
}
/**
 * Gets device information from os
 */
export declare function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext;
export {};
//# sourceMappingURL=context.d.ts.map{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/integrations/context.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAIV,aAAa,EACb,KAAK,EACL,cAAc,EACd,WAAW,EAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAMvC,eAAO,MAAM,aAAa,+BAAsB,CAAC;AACjD,eAAO,MAAM,YAAY,8BAAqB,CAAC;AAE/C,UAAU,oBAAoB;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,cAAc;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,+CAA+C;AAC/C,qBAAa,OAAQ,YAAW,WAAW;IAgBtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAf5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACH,OAAO,CAAC,cAAc,CAAgC;gBAElB,QAAQ,GAAE,cAAqE;IAInH;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAInF,0CAA0C;IAC7B,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAkBrD;;OAEG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;YACW,YAAY;CAyB3B;AAmED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,GAAG,aAAa,CA8BtF"}import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types';
/**
 * Resets the file cache. Exists for testing purposes.
 * @hidden
 */
export declare function resetFileContentCache(): void;
interface ContextLinesOptions {
    /**
     * Sets the number of context lines for each frame when loading a file.
     * Defaults to 7.
     *
     * Set to 0 to disable loading and inclusion of source files.
     **/
    frameContextLines?: number;
}
/** Add node modules / packages to the event */
export declare class ContextLines implements Integration {
    private readonly _options;
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    constructor(_options?: ContextLinesOptions);
    /** Get's the number of context lines to add */
    private get _contextLines();
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void): void;
    /** Processes an event and adds context lines */
    addSourceContext(event: Event): Promise<Event>;
    /** Adds context lines to frames */
    addSourceContextToFrames(frames: StackFrame[]): void;
}
export {};
//# sourceMappingURL=contextlines.d.ts.map{"version":3,"file":"contextlines.d.ts","sourceRoot":"","sources":["../../../src/integrations/contextlines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAkBpF;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED,UAAU,mBAAmB;IAC3B;;;;;QAKI;IACJ,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,+CAA+C;AAC/C,qBAAa,YAAa,YAAW,WAAW;IAW3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV5C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C;;OAEG;IACI,IAAI,EAAE,MAAM,CAAmB;gBAEF,QAAQ,GAAE,mBAAwB;IAEtE,+CAA+C;IAC/C,OAAO,KAAK,aAAa,GAExB;IAED;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAInF,gDAAgD;IACnC,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAkD3D,mCAAmC;IAC5B,wBAAwB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;CAiB5D"}import type { Hub } from '@sentry/core';
import type { EventProcessor, Integration, TracePropagationTargets } from '@sentry/types';
interface TracingOptions {
    /**
     * List of strings/regex controlling to which outgoing requests
     * the SDK will attach tracing headers.
     *
     * By default the SDK will attach those headers to all outgoing
     * requests. If this option is provided, the SDK will match the
     * request URL of outgoing requests against the items in this
     * array, and only attach tracing headers if a match was found.
     */
    tracePropagationTargets?: TracePropagationTargets;
    /**
     * Function determining whether or not to create spans to track outgoing requests to the given URL.
     * By default, spans will be created for all outgoing requests.
     */
    shouldCreateSpanForRequest?: (url: string) => boolean;
}
interface HttpOptions {
    /**
     * Whether breadcrumbs should be recorded for requests
     * Defaults to true
     */
    breadcrumbs?: boolean;
    /**
     * Whether tracing spans should be created for requests
     * Defaults to false
     */
    tracing?: TracingOptions | boolean;
}
/**
 * The http module integration instruments Node's internal http module. It creates breadcrumbs, transactions for outgoing
 * http requests and attaches trace data when tracing is enabled via its `tracing` option.
 */
export declare class Http implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private readonly _breadcrumbs;
    private readonly _tracing;
    /**
     * @inheritDoc
     */
    constructor(options?: HttpOptions);
    /**
     * @inheritDoc
     */
    setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, setupOnceGetCurrentHub: () => Hub): void;
}
export {};
//# sourceMappingURL=http.d.ts.map{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAA8B,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAWtH,UAAU,cAAc;IACtB;;;;;;;;OAQG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;;OAGG;IACH,0BAA0B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACvD;AAED,UAAU,WAAW;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;CACpC;AAED;;;GAGG;AACH,qBAAa,IAAK,YAAW,WAAW;IACtC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAU;IAElC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD;;OAEG;gBACgB,OAAO,GAAE,WAAgB;IAK5C;;OAEG;IACI,SAAS,CACd,wBAAwB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAC5D,sBAAsB,EAAE,MAAM,GAAG,GAChC,IAAI;CAuCR"}export { Console } from './console';
export { Http } from './http';
export { OnUncaughtException } from './onuncaughtexception';
export { OnUnhandledRejection } from './onunhandledrejection';
export { LinkedErrors } from './linkederrors';
export { Modules } from './modules';
export { ContextLines } from './contextlines';
export { Context } from './context';
export { RequestData } from './requestdata';
export { LocalVariables } from './localvariables';
export { Undici } from './undici';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}import type { Integration } from '@sentry/types';
/** Adds SDK info to an event. */
export declare class LinkedErrors implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    readonly name: string;
    /**
     * @inheritDoc
     */
    private readonly _key;
    /**
     * @inheritDoc
     */
    private readonly _limit;
    /**
     * @inheritDoc
     */
    constructor(options?: {
        key?: string;
        limit?: number;
    });
    /**
     * @inheritDoc
     */
    setupOnce(): void;
    /**
     * @inheritDoc
     */
    private _handler;
    /**
     * @inheritDoc
     */
    private _walkErrorTree;
}
//# sourceMappingURL=linkederrors.d.ts.map{"version":3,"file":"linkederrors.d.ts","sourceRoot":"","sources":["../../../src/integrations/linkederrors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8C,WAAW,EAAe,MAAM,eAAe,CAAC;AAU1G,iCAAiC;AACjC,qBAAa,YAAa,YAAW,WAAW;IAC9C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAkB;IAE1C;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAmB;IAE/C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAE9B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;OAEG;gBACgB,OAAO,GAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO;IAKjE;;OAEG;IACI,SAAS,IAAI,IAAI;IAYxB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAmBhB;;OAEG;YACW,cAAc;CA2B7B"}import type { EventProcessor, Hub, Integration } from '@sentry/types';
import type { Debugger, InspectorNotification } from 'inspector';
declare type Variables = Record<string, unknown>;
declare type OnPauseEvent = InspectorNotification<Debugger.PausedEventDataType>;
export interface DebugSession {
    /** Configures and connects to the debug session */
    configureAndConnect(onPause: (message: OnPauseEvent, complete: () => void) => void, captureAll: boolean): void;
    /** Gets local variables for an objectId */
    getLocalVariables(objectId: string, callback: (vars: Variables) => void): void;
}
declare type Next<T> = (result: T) => void;
declare type Add<T> = (fn: Next<T>) => void;
declare type CallbackWrapper<T> = {
    add: Add<T>;
    next: Next<T>;
};
/** Creates a container for callbacks to be called sequentially */
export declare function createCallbackList<T>(complete: Next<T>): CallbackWrapper<T>;
export interface FrameVariables {
    function: string;
    vars?: Variables;
}
/** There are no options yet. This allows them to be added later without breaking changes */
interface Options {
    /**
     * Capture local variables for both handled and unhandled exceptions
     *
     * Default: false - Only captures local variables for uncaught exceptions
     */
    captureAllExceptions?: boolean;
}
/**
 * Adds local variables to exception frames
 */
export declare class LocalVariables implements Integration {
    private readonly _options;
    private readonly _session;
    static id: string;
    readonly name: string;
    private readonly _cachedFrames;
    constructor(_options?: Options, _session?: DebugSession | undefined);
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
    /** Setup in a way that's easier to call from tests */
    private _setup;
    /**
     * Handle the pause event
     */
    private _handlePaused;
    /**
     * Adds local variables event stack frames.
     */
    private _addLocalVariables;
    /**
     * Adds local variables to the exception stack frames.
     */
    private _addLocalVariablesToException;
}
export {};
//# sourceMappingURL=localvariables.d.ts.map{"version":3,"file":"localvariables.d.ts","sourceRoot":"","sources":["../../../src/integrations/localvariables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,cAAc,EAAa,GAAG,EAAE,WAAW,EAA2B,MAAM,eAAe,CAAC;AAEjH,OAAO,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAoB,MAAM,WAAW,CAAC;AAMnF,aAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACzC,aAAK,YAAY,GAAG,qBAAqB,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACxE,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,mBAAmB,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/G,2CAA2C;IAC3C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,IAAI,CAAC;CAChF;AAED,aAAK,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC;AACnC,aAAK,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AACpC,aAAK,eAAe,CAAC,CAAC,IAAI;IAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC;AAEzD,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAiC3E;AA2LD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,4FAA4F;AAE5F,UAAU,OAAO;IACf;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;GAEG;AACH,qBAAa,cAAe,YAAW,WAAW;IAQ9C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAR3B,OAAc,EAAE,EAAE,MAAM,CAAoB;IAE5C,SAAgB,IAAI,EAAE,MAAM,CAAqB;IAEjD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoD;gBAG/D,QAAQ,GAAE,OAAY,EACtB,QAAQ,GAAE,YAAY,GAAG,SAAgC;IAG5E;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;IAI7G,sDAAsD;IACtD,OAAO,CAAC,MAAM;IAwBd;;OAEG;IACH,OAAO,CAAC,aAAa;IAoDrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;OAEG;IACH,OAAO,CAAC,6BAA6B;CAwCtC"}import type { EventProcessor, Hub, Integration } from '@sentry/types';
/** Add node modules / packages to the event */
export declare class Modules implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
    /** Fetches the list of modules and the versions loaded by the entry file for your node.js app. */
    private _getModules;
}
//# sourceMappingURL=modules.d.ts.map{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../../src/integrations/modules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAmEtE,+CAA+C;AAC/C,qBAAa,OAAQ,YAAW,WAAW;IACzC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAa;IAErC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAc;IAEjC;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;IAe7G,kGAAkG;IAClG,OAAO,CAAC,WAAW;CAMpB"}import type { Integration } from '@sentry/types';
interface OnUncaughtExceptionOptions {
    /**
     * Controls if the SDK should register a handler to exit the process on uncaught errors:
     * - `true`: The SDK will exit the process on all uncaught errors.
     * - `false`: The SDK will only exit the process when there are no other `uncaughtException` handlers attached.
     *
     * Default: `true`
     */
    exitEvenIfOtherHandlersAreRegistered: boolean;
    /**
     * This is called when an uncaught error would cause the process to exit.
     *
     * @param firstError Uncaught error causing the process to exit
     * @param secondError Will be set if the handler was called multiple times. This can happen either because
     * `onFatalError` itself threw, or because an independent error happened somewhere else while `onFatalError`
     * was running.
     */
    onFatalError?(this: void, firstError: Error, secondError?: Error): void;
}
/** Global Exception handler */
export declare class OnUncaughtException implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    readonly handler: (error: Error) => void;
    private readonly _options;
    /**
     * @inheritDoc
     */
    constructor(options?: Partial<OnUncaughtExceptionOptions>);
    /**
     * @inheritDoc
     */
    setupOnce(): void;
    /**
     * @hidden
     */
    private _makeErrorHandler;
}
export {};
//# sourceMappingURL=onuncaughtexception.d.ts.map{"version":3,"file":"onuncaughtexception.d.ts","sourceRoot":"","sources":["../../../src/integrations/onuncaughtexception.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAajD,UAAU,0BAA0B;IAIlC;;;;;;OAMG;IACH,oCAAoC,EAAE,OAAO,CAAC;IAE9C;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACzE;AAED,+BAA+B;AAC/B,qBAAa,mBAAoB,YAAW,WAAW;IACrD;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAyB;IAEjD;;OAEG;IACI,IAAI,EAAE,MAAM,CAA0B;IAE7C;;OAEG;IACH,SAAgB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAA4B;IAG3E,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IAEtD;;OAEG;gBACgB,OAAO,GAAE,OAAO,CAAC,0BAA0B,CAAM;IAOpE;;OAEG;IACI,SAAS,IAAI,IAAI;IAIxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;CA0G1B"}import type { Integration } from '@sentry/types';
declare type UnhandledRejectionMode = 'none' | 'warn' | 'strict';
/** Global Promise Rejection handler */
export declare class OnUnhandledRejection implements Integration {
    private readonly _options;
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * @inheritDoc
     */
    constructor(_options?: {
        /**
         * Option deciding what to do after capturing unhandledRejection,
         * that mimicks behavior of node's --unhandled-rejection flag.
         */
        mode: UnhandledRejectionMode;
    });
    /**
     * @inheritDoc
     */
    setupOnce(): void;
    /**
     * Send an exception with reason
     * @param reason string
     * @param promise promise
     */
    sendUnhandledPromise(reason: unknown, promise: unknown): void;
    /**
     * Handler for `mode` option
     */
    private _handleRejection;
}
export {};
//# sourceMappingURL=onunhandledrejection.d.ts.map{"version":3,"file":"onunhandledrejection.d.ts","sourceRoot":"","sources":["../../../src/integrations/onunhandledrejection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAKjD,aAAK,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzD,uCAAuC;AACvC,qBAAa,oBAAqB,YAAW,WAAW;IAepD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAd3B;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAA0B;IAElD;;OAEG;IACI,IAAI,EAAE,MAAM,CAA2B;IAE9C;;OAEG;gBAEgB,QAAQ,GAAE;QACzB;;;WAGG;QACH,IAAI,EAAE,sBAAsB,CAAC;KACX;IAGtB;;OAEG;IACI,SAAS,IAAI,IAAI;IAIxB;;;;OAIG;IACI,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAcpE;;OAEG;IAEH,OAAO,CAAC,gBAAgB;CAuBzB"}import type { Event, EventProcessor, Hub, Integration, PolymorphicRequest } from '@sentry/types';
import type { TransactionNamingScheme } from '../requestdata';
export declare type RequestDataIntegrationOptions = {
    /**
     * Controls what data is pulled from the request and added to the event
     */
    include?: {
        cookies?: boolean;
        data?: boolean;
        headers?: boolean;
        ip?: boolean;
        query_string?: boolean;
        url?: boolean;
        user?: boolean | {
            id?: boolean;
            username?: boolean;
            email?: boolean;
        };
    };
    /** Whether to identify transactions by parameterized path, parameterized path with method, or handler name */
    transactionNamingScheme?: TransactionNamingScheme;
};
/** Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`
 * so it can be used in cross-platform SDKs like `@sentry/nextjs`. */
export declare class RequestData implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Function for adding request data to event. Defaults to `addRequestDataToEvent` from `@sentry/node` for now, but
     * left as a property so this integration can be moved to `@sentry/core` as a base class in case we decide to use
     * something similar in browser-based SDKs in the future.
     */
    protected _addRequestData: (event: Event, req: PolymorphicRequest, options?: {
        [key: string]: unknown;
    }) => Event;
    private _options;
    /**
     * @inheritDoc
     */
    constructor(options?: RequestDataIntegrationOptions);
    /**
     * @inheritDoc
     */
    setupOnce(addGlobalEventProcessor: (eventProcessor: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
//# sourceMappingURL=requestdata.d.ts.map{"version":3,"file":"requestdata.d.ts","sourceRoot":"","sources":["../../../src/integrations/requestdata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,WAAW,EAAE,kBAAkB,EAAe,MAAM,eAAe,CAAC;AAG9G,OAAO,KAAK,EAAgC,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAG5F,oBAAY,6BAA6B,GAAG;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,EAAE,CAAC,EAAE,OAAO,CAAC;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,IAAI,CAAC,EACD,OAAO,GACP;YACE,EAAE,CAAC,EAAE,OAAO,CAAC;YACb,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,KAAK,CAAC,EAAE,OAAO,CAAC;SACjB,CAAC;KACP,CAAC;IAEF,8GAA8G;IAC9G,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD,CAAC;AAmBF;qEACqE;AACrE,qBAAa,WAAY,YAAW,WAAW;IAC7C;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAiB;IAEzC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAkB;IAErC;;;;OAIG;IACH,SAAS,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,KAAK,KAAK,CAAC;IAElH,OAAO,CAAC,QAAQ,CAA0C;IAE1D;;OAEG;gBACgB,OAAO,GAAE,6BAAkC;IAuB9D;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA4DpH"}import type { Hub } from '@sentry/core';
import type { EventProcessor, Integration } from '@sentry/types';
export declare enum ChannelName {
    RequestCreate = "undici:request:create",
    RequestEnd = "undici:request:headers",
    RequestError = "undici:request:error"
}
export interface UndiciOptions {
    /**
     * Whether breadcrumbs should be recorded for requests
     * Defaults to true
     */
    breadcrumbs: boolean;
    /**
     * Function determining whether or not to create spans to track outgoing requests to the given URL.
     * By default, spans will be created for all outgoing requests.
     */
    shouldCreateSpanForRequest: (url: string) => boolean;
}
/**
 * Instruments outgoing HTTP requests made with the `undici` package via
 * Node's `diagnostics_channel` API.
 *
 * Supports Undici 4.7.0 or higher.
 *
 * Requires Node 16.17.0 or higher.
 */
export declare class Undici implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    private readonly _options;
    constructor(_options?: Partial<UndiciOptions>);
    /**
     * @inheritDoc
     */
    setupOnce(_addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/undici/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAajE,oBAAY,WAAW;IAErB,aAAa,0BAA0B;IACvC,UAAU,2BAA2B;IACrC,YAAY,yBAAyB;CACtC;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,0BAA0B,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACtD;AAMD;;;;;;;GAOG;AACH,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAEtB,QAAQ,GAAE,OAAO,CAAC,aAAa,CAAM;IAOxD;;OAEG;IACI,SAAS,CAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI;CA+J/G"}/// <reference types="node" />
import type { Span } from '@sentry/core';
export declare type ChannelListener = (message: unknown, name: string | symbol) => void;
/**
 * The `diagnostics_channel` module provides an API to create named channels
 * to report arbitrary message data for diagnostics purposes.
 *
 * It can be accessed using:
 *
 * ```js
 * import diagnostics_channel from 'diagnostics_channel';
 * ```
 *
 * It is intended that a module writer wanting to report diagnostics messages
 * will create one or many top-level channels to report messages through.
 * Channels may also be acquired at runtime but it is not encouraged
 * due to the additional overhead of doing so. Channels may be exported for
 * convenience, but as long as the name is known it can be acquired anywhere.
 *
 * If you intend for your module to produce diagnostics data for others to
 * consume it is recommended that you include documentation of what named
 * channels are used along with the shape of the message data. Channel names
 * should generally include the module name to avoid collisions with data from
 * other modules.
 * @experimental
 * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/diagnostics_channel.js)
 */
export interface DiagnosticsChannel {
    /**
     * Check if there are active subscribers to the named channel. This is helpful if
     * the message you want to send might be expensive to prepare.
     *
     * This API is optional but helpful when trying to publish messages from very
     * performance-sensitive code.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * if (diagnostics_channel.hasSubscribers('my-channel')) {
     *   // There are subscribers, prepare and publish message
     * }
     * ```
     * @since v15.1.0, v14.17.0
     * @param name The channel name
     * @return If there are active subscribers
     */
    hasSubscribers(name: string | symbol): boolean;
    /**
     * This is the primary entry-point for anyone wanting to interact with a named
     * channel. It produces a channel object which is optimized to reduce overhead at
     * publish time as much as possible.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * const channel = diagnostics_channel.channel('my-channel');
     * ```
     * @since v15.1.0, v14.17.0
     * @param name The channel name
     * @return The named channel object
     */
    channel(name: string | symbol): Channel;
    /**
     * Register a message handler to subscribe to this channel. This message handler will be run synchronously
     * whenever a message is published to the channel. Any errors thrown in the message handler will
     * trigger an 'uncaughtException'.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * diagnostics_channel.subscribe('my-channel', (message, name) => {
     *   // Received data
     * });
     * ```
     *
     * @since v18.7.0, v16.17.0
     * @param name The channel name
     * @param onMessage The handler to receive channel messages
     */
    subscribe(name: string | symbol, onMessage: ChannelListener): void;
    /**
     * Remove a message handler previously registered to this channel with diagnostics_channel.subscribe(name, onMessage).
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * function onMessage(message, name) {
     *  // Received data
     * }
     *
     * diagnostics_channel.subscribe('my-channel', onMessage);
     *
     * diagnostics_channel.unsubscribe('my-channel', onMessage);
     * ```
     *
     * @since v18.7.0, v16.17.0
     * @param name The channel name
     * @param onMessage The previous subscribed handler to remove
     * @returns `true` if the handler was found, `false` otherwise
     */
    unsubscribe(name: string | symbol, onMessage: ChannelListener): boolean;
}
/**
 * The class `Channel` represents an individual named channel within the data
 * pipeline. It is use to track subscribers and to publish messages when there
 * are subscribers present. It exists as a separate object to avoid channel
 * lookups at publish time, enabling very fast publish speeds and allowing
 * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly
 * with `new Channel(name)` is not supported.
 * @since v15.1.0, v14.17.0
 */
interface ChannelI {
    readonly name: string | symbol;
    /**
     * Check if there are active subscribers to this channel. This is helpful if
     * the message you want to send might be expensive to prepare.
     *
     * This API is optional but helpful when trying to publish messages from very
     * performance-sensitive code.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * const channel = diagnostics_channel.channel('my-channel');
     *
     * if (channel.hasSubscribers) {
     *   // There are subscribers, prepare and publish message
     * }
     * ```
     * @since v15.1.0, v14.17.0
     */
    readonly hasSubscribers: boolean;
    /**
     * Publish a message to any subscribers to the channel. This will
     * trigger message handlers synchronously so they will execute within
     * the same context.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * const channel = diagnostics_channel.channel('my-channel');
     *
     * channel.publish({
     *   some: 'message'
     * });
     * ```
     * @since v15.1.0, v14.17.0
     * @param message The message to send to the channel subscribers
     */
    publish(message: unknown): void;
    /**
     * Register a message handler to subscribe to this channel. This message handler
     * will be run synchronously whenever a message is published to the channel. Any
     * errors thrown in the message handler will trigger an `'uncaughtException'`.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * const channel = diagnostics_channel.channel('my-channel');
     *
     * channel.subscribe((message, name) => {
     *   // Received data
     * });
     * ```
     * @since v15.1.0, v14.17.0
     * @param onMessage The handler to receive channel messages
     */
    subscribe(onMessage: ChannelListener): void;
    /**
     * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`.
     *
     * ```js
     * import diagnostics_channel from 'diagnostics_channel';
     *
     * const channel = diagnostics_channel.channel('my-channel');
     *
     * function onMessage(message, name) {
     *   // Received data
     * }
     *
     * channel.subscribe(onMessage);
     *
     * channel.unsubscribe(onMessage);
     * ```
     * @since v15.1.0, v14.17.0
     * @param onMessage The previous subscribed handler to remove
     * @return `true` if the handler was found, `false` otherwise.
     */
    unsubscribe(onMessage: ChannelListener): void;
}
export interface Channel extends ChannelI {
    new (name: string | symbol): void;
}
export interface UndiciRequest {
    origin?: string | URL;
    completed: boolean;
    method?: string;
    path: string;
    headers: string;
    addHeader(key: string, value: string): Request;
}
export interface UndiciResponse {
    statusCode: number;
    statusText: string;
    headers: Array<Buffer>;
}
export interface RequestWithSentry extends UndiciRequest {
    __sentry__?: Span;
}
export interface RequestCreateMessage {
    request: RequestWithSentry;
}
export interface RequestEndMessage {
    request: RequestWithSentry;
    response: UndiciResponse;
}
export interface RequestErrorMessage {
    request: RequestWithSentry;
    error: Error;
}
export {};
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/integrations/undici/types.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAoBzC,oBAAY,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACxC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IACnE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC;CACzE;AAED;;;;;;;;GAQG;AACH,UAAU,QAAQ;IAChB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEjC;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;IAC5C;;;;;;;;;;;;;;;;;;;OAmBG;IACH,WAAW,CAAC,SAAS,EAAE,eAAe,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,WAAW,OAAQ,SAAQ,QAAQ;IACvC,KAAK,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACnC;AAGD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAChD;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,UAAU,CAAC,EAAE,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC;CACd"}/**
 * @hidden
 */
export declare function logAndExitProcess(error: Error): void;
//# sourceMappingURL=errorhandling.d.ts.map{"version":3,"file":"errorhandling.d.ts","sourceRoot":"","sources":["../../../../src/integrations/utils/errorhandling.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CA0BpD"}/// <reference types="node" />
import type * as http from 'http';
import type * as https from 'https';
import { URL } from 'url';
/**
 * Checks whether given url points to Sentry server
 * @param url url to verify
 */
export declare function isSentryRequest(url: string): boolean;
/**
 * Assembles a URL that's passed to the users to filter on.
 * It can include raw (potentially PII containing) data, which we'll allow users to access to filter
 * but won't include in spans or breadcrumbs.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
export declare function extractRawUrl(requestOptions: RequestOptions): string;
/**
 * Assemble a URL to be used for breadcrumbs and spans.
 *
 * @param requestOptions RequestOptions object containing the component parts for a URL
 * @returns Fully-formed URL
 */
export declare function extractUrl(requestOptions: RequestOptions): string;
/**
 * Handle various edge cases in the span description (for spans representing http(s) requests).
 *
 * @param description current `description` property of the span representing the request
 * @param requestOptions Configuration data for the request
 * @param Request Request object
 *
 * @returns The cleaned description
 */
export declare function cleanSpanDescription(description: string | undefined, requestOptions: RequestOptions, request: http.ClientRequest): string | undefined;
export declare type RequestOptions = http.RequestOptions & {
    hash?: string;
    search?: string;
    pathname?: string;
    href?: string;
};
declare type RequestCallback = (response: http.IncomingMessage) => void;
export declare type RequestMethodArgs = [RequestOptions | string | URL, RequestCallback?] | [string | URL, RequestOptions, RequestCallback?];
export declare type RequestMethod = (...args: RequestMethodArgs) => http.ClientRequest;
/**
 * Convert a URL object into a RequestOptions object.
 *
 * Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the
 * RequestOptions type above.
 *
 * See https://github.com/nodejs/node/blob/master/lib/internal/url.js.
 */
export declare function urlToOptions(url: URL): RequestOptions;
/**
 * Normalize inputs to `http(s).request()` and `http(s).get()`.
 *
 * Legal inputs to `http(s).request()` and `http(s).get()` can take one of ten forms:
 *     [ RequestOptions | string | URL ],
 *     [ RequestOptions | string | URL, RequestCallback ],
 *     [ string | URL, RequestOptions ], and
 *     [ string | URL, RequestOptions, RequestCallback ].
 *
 * This standardizes to one of two forms: [ RequestOptions ] and [ RequestOptions, RequestCallback ]. A similar thing is
 * done as the first step of `http(s).request()` and `http(s).get()`; this just does it early so that we can interact
 * with the args in a standard way.
 *
 * @param requestArgs The inputs to `http(s).request()` or `http(s).get()`, as an array.
 *
 * @returns Equivalent args of the form [ RequestOptions ] or [ RequestOptions, RequestCallback ].
 */
export declare function normalizeRequestArgs(httpModule: typeof http | typeof https, requestArgs: RequestMethodArgs): [RequestOptions] | [RequestOptions, RequestCallback];
export {};
//# sourceMappingURL=http.d.ts.map{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/integrations/utils/http.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGpD;AAED;;;;;;;GAOG;AAEH,wBAAgB,aAAa,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAQpE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,cAAc,EAAE,cAAc,GAAG,MAAM,CAYjE;AAOD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,IAAI,CAAC,aAAa,GAC1B,MAAM,GAAG,SAAS,CAwBpB;AAGD,oBAAY,cAAc,GAAG,IAAI,CAAC,cAAc,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACxH,aAAK,eAAe,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC;AAChE,oBAAY,iBAAiB,GACzB,CAAC,cAAc,GAAG,MAAM,GAAG,GAAG,EAAE,eAAe,CAAC,CAAC,GACjD,CAAC,MAAM,GAAG,GAAG,EAAE,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC;AACrD,oBAAY,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC,aAAa,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAkBrD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,OAAO,IAAI,GAAG,OAAO,KAAK,EACtC,WAAW,EAAE,iBAAiB,GAC7B,CAAC,cAAc,CAAC,GAAG,CAAC,cAAc,EAAE,eAAe,CAAC,CAoDtD"}/** Gets the module from a filename */
export declare function getModule(filename: string | undefined, normalizeWindowsPathSeparator?: boolean): string | undefined;
//# sourceMappingURL=module.d.ts.map{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAWA,sCAAsC;AACtC,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,6BAA6B,GAAE,OAA2B,GACzD,MAAM,GAAG,SAAS,CA4CpB"}import { parseSemver } from '@sentry/utils';
export declare const NODE_VERSION: ReturnType<typeof parseSemver>;
//# sourceMappingURL=nodeVersion.d.ts.map{"version":3,"file":"nodeVersion.d.ts","sourceRoot":"","sources":["../../src/nodeVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,YAAY,EAAE,UAAU,CAAC,OAAO,WAAW,CAAsC,CAAC"}import type { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource } from '@sentry/types';
declare const DEFAULT_REQUEST_INCLUDES: string[];
export declare const DEFAULT_USER_INCLUDES: string[];
/**
 * Options deciding what parts of the request to use when enhancing an event
 */
export declare type AddRequestDataToEventOptions = {
    /** Flags controlling whether each type of data should be added to the event */
    include?: {
        ip?: boolean;
        request?: boolean | Array<(typeof DEFAULT_REQUEST_INCLUDES)[number]>;
        transaction?: boolean | TransactionNamingScheme;
        user?: boolean | Array<(typeof DEFAULT_USER_INCLUDES)[number]>;
    };
};
export declare type TransactionNamingScheme = 'path' | 'methodPath' | 'handler';
/**
 * Sets parameterized route as transaction name e.g.: `GET /users/:id`
 * Also adds more context data on the transaction from the request
 */
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest): void;
/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
export declare function extractPathForTransaction(req: PolymorphicRequest, options?: {
    path?: boolean;
    method?: boolean;
    customRoute?: string;
}): [string, TransactionSource];
/**
 * Normalize data from the request object
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 *
 * @returns An object containing normalized request data
 */
export declare function extractRequestData(req: PolymorphicRequest, options?: {
    include?: string[];
}): ExtractedNodeRequestData;
/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 *
 * @returns The mutated `Event` object
 */
export declare function addRequestDataToEvent(event: Event, req: PolymorphicRequest, options?: AddRequestDataToEventOptions): Event;
export {};
//# sourceMappingURL=requestdata.d.ts.map{"version":3,"file":"requestdata.d.ts","sourceRoot":"","sources":["../../src/requestdata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAClB,MAAM,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**
 * Deprecated functions which are slated for removal in v8. When the time comes, this entire file can be deleted.
 *
 * See https://github.com/getsentry/sentry-javascript/pull/5257.
 */
import type { Event, ExtractedNodeRequestData, PolymorphicRequest } from '@sentry/types';
import type { AddRequestDataToEventOptions } from './requestdata';
/**
 * @deprecated `Handlers.ExpressRequest` is deprecated and will be removed in v8. Use `PolymorphicRequest` instead.
 */
export declare type ExpressRequest = PolymorphicRequest;
/**
 * Normalizes data from the request object, accounting for framework differences.
 *
 * @deprecated `Handlers.extractRequestData` is deprecated and will be removed in v8. Use `extractRequestData` instead.
 *
 * @param req The request object from which to extract data
 * @param keys An optional array of keys to include in the normalized data.
 * @returns An object containing normalized request data
 */
export declare function extractRequestData(req: {
    [key: string]: any;
}, keys?: string[]): ExtractedNodeRequestData;
/**
 * Options deciding what parts of the request to use when enhancing an event
 *
 * @deprecated `Handlers.ParseRequestOptions` is deprecated and will be removed in v8. Use
 * `AddRequestDataToEventOptions` in `@sentry/utils` instead.
 */
export declare type ParseRequestOptions = AddRequestDataToEventOptions['include'] & {
    serverName?: boolean;
    version?: boolean;
};
/**
 * Enriches passed event with request data.
 *
 * @deprecated `Handlers.parseRequest` is deprecated and will be removed in v8. Use `addRequestDataToEvent` instead.
 *
 * @param event Will be mutated and enriched with req data
 * @param req Request object
 * @param options object containing flags to enable functionality
 * @hidden
 */
export declare function parseRequest(event: Event, req: ExpressRequest, options?: ParseRequestOptions): Event;
//# sourceMappingURL=requestDataDeprecated.d.ts.map{"version":3,"file":"requestDataDeprecated.d.ts","sourceRoot":"","sources":["../../src/requestDataDeprecated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGlE;;GAEG;AACH,oBAAY,cAAc,GAAG,kBAAkB,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,wBAAwB,CAEzG;AAED;;;;;GAKG;AACH,oBAAY,mBAAmB,GAAG,4BAA4B,CAAC,SAAS,CAAC,GAAG;IAC1E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,GAAE,mBAAwB,GAAG,KAAK,CAExG"}import { Integrations as CoreIntegrations } from '@sentry/core';
import type { StackParser } from '@sentry/types';
import { NodeClient } from './client';
import { Console, Context, ContextLines, Http, LinkedErrors, LocalVariables, Modules, OnUncaughtException, OnUnhandledRejection, RequestData } from './integrations';
import type { NodeOptions } from './types';
export declare const defaultIntegrations: (Console | Http | OnUncaughtException | OnUnhandledRejection | ContextLines | LinkedErrors | Modules | Context | RequestData | LocalVariables | CoreIntegrations.InboundFilters | CoreIntegrations.FunctionToString)[];
/**
 * The Sentry Node SDK Client.
 *
 * To use this SDK, call the {@link init} function as early as possible in the
 * main entry module. To set context information or send manual events, use the
 * provided methods.
 *
 * @example
 * ```
 *
 * const { init } = require('@sentry/node');
 *
 * init({
 *   dsn: '__DSN__',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { configureScope } = require('@sentry/node');
 * configureScope((scope: Scope) => {
 *   scope.setExtra({ battery: 0.7 });
 *   scope.setTag({ user_mode: 'admin' });
 *   scope.setUser({ id: '4711' });
 * });
 * ```
 *
 * @example
 * ```
 *
 * const { addBreadcrumb } = require('@sentry/node');
 * addBreadcrumb({
 *   message: 'My Breadcrumb',
 *   // ...
 * });
 * ```
 *
 * @example
 * ```
 *
 * const Sentry = require('@sentry/node');
 * Sentry.captureMessage('Hello, world!');
 * Sentry.captureException(new Error('Good bye'));
 * Sentry.captureEvent({
 *   message: 'Manual',
 *   stacktrace: [
 *     // ...
 *   ],
 * });
 * ```
 *
 * @see {@link NodeOptions} for documentation on configuration options.
 */
export declare function init(options?: NodeOptions): void;
/**
 * This is the getter for lastEventId.
 *
 * @returns The last event id of a captured event.
 */
export declare function lastEventId(): string | undefined;
/**
 * Call `flush()` on the current client, if there is one. See {@link Client.flush}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause
 * the client to wait until all events are sent before resolving the promise.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function flush(timeout?: number): Promise<boolean>;
/**
 * Call `close()` on the current client, if there is one. See {@link Client.close}.
 *
 * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this
 * parameter will cause the client to wait until all events are sent before disabling itself.
 * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it
 * doesn't (or if there's no client defined).
 */
export declare function close(timeout?: number): Promise<boolean>;
/**
 * Function that takes an instance of NodeClient and checks if autoSessionTracking option is enabled for that client
 */
export declare function isAutoSessionTrackingEnabled(client?: NodeClient): boolean;
/**
 * Returns a release dynamically from environment variables.
 */
export declare function getSentryRelease(fallback?: string): string | undefined;
/** Node.js stack parser */
export declare const defaultStackParser: StackParser;
//# sourceMappingURL=sdk.d.ts.map{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,YAAY,IAAI,gBAAgB,EACjC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,eAAe,CAAC;AAUhE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EACL,OAAO,EACP,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,OAAO,EACP,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9D,eAAO,MAAM,mBAAmB,wNAkB/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CA6DpD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,GAAG,SAAS,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9D;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9D;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CASzE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA2BtE;AAED,2BAA2B;AAC3B,eAAO,MAAM,kBAAkB,EAAE,WAA+D,CAAC"}import type { Integration } from '@sentry/types';
/**
 * Automatically detects and returns integrations that will work with your dependencies.
 */
export declare function autoDiscoverNodePerformanceMonitoringIntegrations(): Integration[];
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tracing/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,wBAAgB,iDAAiD,IAAI,WAAW,EAAE,CAiBjF"}export { Apollo, Express, GraphQL, Mongo, Mysql, Postgres, Prisma } from '@sentry-internal/tracing';
//# sourceMappingURL=integrations.d.ts.map{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/tracing/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC"}/// <reference types="node" />
import type { IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'http';
import type { RequestOptions as HTTPSRequestOptions } from 'https';
import type { Writable } from 'stream';
import type { URL } from 'url';
export declare type HTTPModuleRequestOptions = HTTPRequestOptions | HTTPSRequestOptions | string | URL;
/**
 * Cut version of http.IncomingMessage.
 * Some transports work in a special Javascript environment where http.IncomingMessage is not available.
 */
export interface HTTPModuleRequestIncomingMessage {
    headers: IncomingHttpHeaders;
    statusCode?: number;
    on(event: 'data' | 'end', listener: () => void): void;
    setEncoding(encoding: string): void;
}
/**
 * Internal used interface for typescript.
 * @hidden
 */
export interface HTTPModule {
    /**
     * Request wrapper
     * @param options These are {@see TransportOptions}
     * @param callback Callback when request is finished
     */
    request(options: HTTPModuleRequestOptions, callback?: (res: HTTPModuleRequestIncomingMessage) => void): Writable;
}
//# sourceMappingURL=http-module.d.ts.map{"version":3,"file":"http-module.d.ts","sourceRoot":"","sources":["../../../src/transports/http-module.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,MAAM,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B,oBAAY,wBAAwB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,MAAM,GAAG,GAAG,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACtD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,wBAAwB,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,gCAAgC,KAAK,IAAI,GAAG,QAAQ,CAAC;CAWlH"}/// <reference types="node" />
import type { BaseTransportOptions, Transport } from '@sentry/types';
import type { HTTPModule } from './http-module';
export interface NodeTransportOptions extends BaseTransportOptions {
    /** Define custom headers */
    headers?: Record<string, string>;
    /** Set a proxy that should be used for outbound requests. */
    proxy?: string;
    /** HTTPS proxy CA certificates */
    caCerts?: string | Buffer | Array<string | Buffer>;
    /** Custom HTTP module. Defaults to the native 'http' and 'https' modules. */
    httpModule?: HTTPModule;
    /** Allow overriding connection keepAlive, defaults to false */
    keepAlive?: boolean;
}
/**
 * Creates a Transport that uses native the native 'http' and 'https' modules to send events to Sentry.
 */
export declare function makeNodeTransport(options: NodeTransportOptions): Transport;
//# sourceMappingURL=http.d.ts.map{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/transports/http.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EAIV,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACnD,6EAA6E;IAC7E,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAiC1E"}export type { NodeTransportOptions } from './http';
export { makeNodeTransport } from './http';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transports/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}import type { ClientOptions, Options, SamplingContext, TracePropagationTargets } from '@sentry/types';
import type { NodeTransportOptions } from './transports';
export interface BaseNodeOptions {
    /**
     * Sets profiling sample rate when @sentry/profiling-node is installed
     */
    profilesSampleRate?: number;
    /**
     * Function to compute profiling sample rate dynamically and filter unwanted profiles.
     *
     * Profiling is enabled if either this or `profilesSampleRate` is defined. If both are defined, `profilesSampleRate` is
     * ignored.
     *
     * Will automatically be passed a context object of default and optional custom data. See
     * {@link Transaction.samplingContext} and {@link Hub.startTransaction}.
     *
     * @returns A sample rate between 0 and 1 (0 drops the profile, 1 guarantees it will be sent). Returning `true` is
     * equivalent to returning 1 and returning `false` is equivalent to returning 0.
     */
    profilesSampler?: (samplingContext: SamplingContext) => number | boolean;
    /** Sets an optional server name (device name) */
    serverName?: string;
    /**
     * Include local variables with stack traces.
     *
     * Requires the `LocalVariables` integration.
     */
    includeLocalVariables?: boolean;
    /**
     * List of strings/regex controlling to which outgoing requests
     * the SDK will attach tracing headers.
     *
     * By default the SDK will attach those headers to all outgoing
     * requests. If this option is provided, the SDK will match the
     * request URL of outgoing requests against the items in this
     * array, and only attach tracing headers if a match was found.
     *
     * @example
     * ```js
     * Sentry.init({
     *   tracePropagationTargets: ['api.site.com'],
     * });
     * ```
     */
    tracePropagationTargets?: TracePropagationTargets;
    /**
     * @deprecated Moved to constructor options of the `Http` and `Undici` integration.
     * @example
     * ```js
     * Sentry.init({
     *   integrations: [
     *     new Sentry.Integrations.Http({
     *       tracing: {
     *         shouldCreateSpanForRequest: (url: string) => false,
     *       }
     *     });
     *   ],
     * });
     * ```
     */
    shouldCreateSpanForRequest?(this: void, url: string): boolean;
    /** Callback that is executed when a fatal global error occurs. */
    onFatalError?(this: void, error: Error): void;
}
/**
 * Configuration options for the Sentry Node SDK
 * @see @sentry/types Options for more information.
 */
export interface NodeOptions extends Options<NodeTransportOptions>, BaseNodeOptions {
}
/**
 * Configuration options for the Sentry Node SDK Client class
 * @see NodeClient for more information.
 */
export interface NodeClientOptions extends ClientOptions<NodeTransportOptions>, BaseNodeOptions {
}
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,MAAM,GAAG,OAAO,CAAC;IAEzE,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;;;OAeG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAGlD;;;;;;;;;;;;;;OAcG;IACH,0BAA0B,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE9D,kEAAkE;IAClE,YAAY,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,oBAAoB,CAAC,EAAE,eAAe;CAAG;AAEtF;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa,CAAC,oBAAoB,CAAC,EAAE,eAAe;CAAG"}/**
 * Recursively read the contents of a directory.
 *
 * @param targetDir Absolute or relative path of the directory to scan. All returned paths will be relative to this
 * directory.
 * @returns Array holding all relative paths
 */
export declare function deepReadDirSync(targetDir: string): string[];
//# sourceMappingURL=utils.d.ts.map{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA2B3D"}Object.defineProperty(exports, '__esModule', { value: true });

const core = require('@sentry/core');
const utils = require('@sentry/utils');

// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`
// prevents the browser package from being bundled in the CDN bundle, and avoids a
// circular dependency between the browser and replay packages should `@sentry/browser` import
// from `@sentry/replay` in the future
const WINDOW = utils.GLOBAL_OBJ ;

const REPLAY_SESSION_KEY = 'sentryReplaySession';
const REPLAY_EVENT_NAME = 'replay_event';
const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';

// The idle limit for a session
const SESSION_IDLE_DURATION = 300000; // 5 minutes in ms

// The maximum length of a session
const MAX_SESSION_LIFE = 3600000; // 60 minutes

/** Default flush delays */
const DEFAULT_FLUSH_MIN_DELAY = 5000;
// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it
// was the same as `wait`
const DEFAULT_FLUSH_MAX_DELAY = 5500;

/* How long to wait for error checkouts */
const ERROR_CHECKOUT_TIME = 60000;

const RETRY_BASE_INTERVAL = 5000;
const RETRY_MAX_COUNT = 3;

/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be dropped. */
const NETWORK_BODY_MAX_SIZE = 300000;

var NodeType$1;
(function (NodeType) {
    NodeType[NodeType["Document"] = 0] = "Document";
    NodeType[NodeType["DocumentType"] = 1] = "DocumentType";
    NodeType[NodeType["Element"] = 2] = "Element";
    NodeType[NodeType["Text"] = 3] = "Text";
    NodeType[NodeType["CDATA"] = 4] = "CDATA";
    NodeType[NodeType["Comment"] = 5] = "Comment";
})(NodeType$1 || (NodeType$1 = {}));

function isElement(n) {
    return n.nodeType === n.ELEMENT_NODE;
}
function isShadowRoot(n) {
    const host = n === null || n === void 0 ? void 0 : n.host;
    return Boolean(host && host.shadowRoot && host.shadowRoot === n);
}
function isInputTypeMasked({ maskInputOptions, tagName, type, }) {
    if (tagName.toLowerCase() === 'option') {
        tagName = 'select';
    }
    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;
    return (maskInputOptions[tagName.toLowerCase()] ||
        (actualType && maskInputOptions[actualType]) ||
        actualType === 'password' ||
        (tagName === 'input' && !type && maskInputOptions['text']));
}
function hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {
    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));
}
function maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {
    let text = value || '';
    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {
        return text;
    }
    if (input.hasAttribute('rr_is_password')) {
        type = 'password';
    }
    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||
        (maskInputSelector && input.matches(maskInputSelector))) {
        if (maskInputFn) {
            text = maskInputFn(text);
        }
        else {
            text = '*'.repeat(text.length);
        }
    }
    return text;
}
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
function is2DCanvasBlank(canvas) {
    const ctx = canvas.getContext('2d');
    if (!ctx)
        return true;
    const chunkSize = 50;
    for (let x = 0; x < canvas.width; x += chunkSize) {
        for (let y = 0; y < canvas.height; y += chunkSize) {
            const getImageData = ctx.getImageData;
            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData
                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]
                : getImageData;
            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);
            if (pixelBuffer.some((pixel) => pixel !== 0))
                return false;
        }
    }
    return true;
}

let _id = 1;
const tagNameRegex = new RegExp('[^a-z0-9-_:]');
const IGNORED_NODE = -2;
function defaultMaskFn(str) {
    return str ? str.replace(/[\S]/g, '*') : '';
}
function genId() {
    return _id++;
}
function getValidTagName(element) {
    if (element instanceof HTMLFormElement) {
        return 'form';
    }
    const processedTagName = element.tagName.toLowerCase().trim();
    if (tagNameRegex.test(processedTagName)) {
        return 'div';
    }
    return processedTagName;
}
function getCssRulesString(s) {
    try {
        const rules = s.rules || s.cssRules;
        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;
    }
    catch (error) {
        return null;
    }
}
function getCssRuleString(rule) {
    let cssStringified = rule.cssText;
    if (isCSSImportRule(rule)) {
        try {
            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;
        }
        catch (_a) {
        }
    }
    return cssStringified;
}
function isCSSImportRule(rule) {
    return 'styleSheet' in rule;
}
function stringifyStyleSheet(sheet) {
    return sheet.cssRules
        ? Array.from(sheet.cssRules)
            .map((rule) => rule.cssText || '')
            .join('')
        : '';
}
function extractOrigin(url) {
    let origin = '';
    if (url.indexOf('//') > -1) {
        origin = url.split('/').slice(0, 3).join('/');
    }
    else {
        origin = url.split('/')[0];
    }
    origin = origin.split('?')[0];
    return origin;
}
let canvasService;
let canvasCtx;
const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm;
const RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/;
const DATA_URI = /^(data:)([^,]*),(.*)/i;
function absoluteToStylesheet(cssText, href) {
    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {
        const filePath = path1 || path2 || path3;
        const maybeQuote = quote1 || quote2 || '';
        if (!filePath) {
            return origin;
        }
        if (!RELATIVE_PATH.test(filePath)) {
            return `url(${maybeQuote}${filePath}${maybeQuote})`;
        }
        if (DATA_URI.test(filePath)) {
            return `url(${maybeQuote}${filePath}${maybeQuote})`;
        }
        if (filePath[0] === '/') {
            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;
        }
        const stack = href.split('/');
        const parts = filePath.split('/');
        stack.pop();
        for (const part of parts) {
            if (part === '.') {
                continue;
            }
            else if (part === '..') {
                stack.pop();
            }
            else {
                stack.push(part);
            }
        }
        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;
    });
}
const SRCSET_NOT_SPACES = /^[^ \t\n\r\u000c]+/;
const SRCSET_COMMAS_OR_SPACES = /^[, \t\n\r\u000c]+/;
function getAbsoluteSrcsetString(doc, attributeValue) {
    if (attributeValue.trim() === '') {
        return attributeValue;
    }
    let pos = 0;
    function collectCharacters(regEx) {
        let chars;
        let match = regEx.exec(attributeValue.substring(pos));
        if (match) {
            chars = match[0];
            pos += chars.length;
            return chars;
        }
        return '';
    }
    let output = [];
    while (true) {
        collectCharacters(SRCSET_COMMAS_OR_SPACES);
        if (pos >= attributeValue.length) {
            break;
        }
        let url = collectCharacters(SRCSET_NOT_SPACES);
        if (url.slice(-1) === ',') {
            url = absoluteToDoc(doc, url.substring(0, url.length - 1));
            output.push(url);
        }
        else {
            let descriptorsStr = '';
            url = absoluteToDoc(doc, url);
            let inParens = false;
            while (true) {
                let c = attributeValue.charAt(pos);
                if (c === '') {
                    output.push((url + descriptorsStr).trim());
                    break;
                }
                else if (!inParens) {
                    if (c === ',') {
                        pos += 1;
                        output.push((url + descriptorsStr).trim());
                        break;
                    }
                    else if (c === '(') {
                        inParens = true;
                    }
                }
                else {
                    if (c === ')') {
                        inParens = false;
                    }
                }
                descriptorsStr += c;
                pos += 1;
            }
        }
    }
    return output.join(', ');
}
function absoluteToDoc(doc, attributeValue) {
    if (!attributeValue || attributeValue.trim() === '') {
        return attributeValue;
    }
    const a = doc.createElement('a');
    a.href = attributeValue;
    return a.href;
}
function isSVGElement(el) {
    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);
}
function getHref() {
    const a = document.createElement('a');
    a.href = '';
    return a.href;
}
function transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {
    if (!value) {
        return value;
    }
    const name = _name.toLowerCase();
    const tagName = _tagName.toLowerCase();
    if (name === 'src' || name === 'href') {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'xlink:href' && value[0] !== '#') {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'background' &&
        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'srcset') {
        return getAbsoluteSrcsetString(doc, value);
    }
    else if (name === 'style') {
        return absoluteToStylesheet(value, getHref());
    }
    else if (tagName === 'object' && name === 'data') {
        return absoluteToDoc(doc, value);
    }
    else if (maskAllText &&
        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {
        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);
    }
    return value;
}
function _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {
    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {
        return false;
    }
    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||
        (tagName === 'input' &&
            attribute === 'value' &&
            element.hasAttribute('type') &&
            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));
}
function _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {
    if (unblockSelector && element.matches(unblockSelector)) {
        return false;
    }
    if (typeof blockClass === 'string') {
        if (element.classList.contains(blockClass)) {
            return true;
        }
    }
    else {
        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {
            const className = element.classList[eIndex];
            if (blockClass.test(className)) {
                return true;
            }
        }
    }
    if (blockSelector) {
        return element.matches(blockSelector);
    }
    return false;
}
function needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {
    if (!node) {
        return false;
    }
    if (node.nodeType !== node.ELEMENT_NODE) {
        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);
    }
    if (unmaskTextSelector) {
        if (node.matches(unmaskTextSelector) ||
            node.closest(unmaskTextSelector)) {
            return false;
        }
    }
    if (maskAllText) {
        return true;
    }
    if (typeof maskTextClass === 'string') {
        if (node.classList.contains(maskTextClass)) {
            return true;
        }
    }
    else {
        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {
            const className = node.classList[eIndex];
            if (maskTextClass.test(className)) {
                return true;
            }
        }
    }
    if (maskTextSelector) {
        if (node.matches(maskTextSelector)) {
            return true;
        }
    }
    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);
}
function onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {
    const win = iframeEl.contentWindow;
    if (!win) {
        return;
    }
    let fired = false;
    let readyState;
    try {
        readyState = win.document.readyState;
    }
    catch (error) {
        return;
    }
    if (readyState !== 'complete') {
        const timer = setTimeout(() => {
            if (!fired) {
                listener();
                fired = true;
            }
        }, iframeLoadTimeout);
        iframeEl.addEventListener('load', () => {
            clearTimeout(timer);
            fired = true;
            listener();
        });
        return;
    }
    const blankUrl = 'about:blank';
    if (win.location.href !== blankUrl ||
        iframeEl.src === blankUrl ||
        iframeEl.src === '') {
        setTimeout(listener, 0);
        return;
    }
    iframeEl.addEventListener('load', listener);
}
function serializeNode(n, options) {
    var _a;
    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;
    let rootId;
    if (doc.__sn) {
        const docId = doc.__sn.id;
        rootId = docId === 1 ? undefined : docId;
    }
    switch (n.nodeType) {
        case n.DOCUMENT_NODE:
            if (n.compatMode !== 'CSS1Compat') {
                return {
                    type: NodeType$1.Document,
                    childNodes: [],
                    compatMode: n.compatMode,
                    rootId,
                };
            }
            else {
                return {
                    type: NodeType$1.Document,
                    childNodes: [],
                    rootId,
                };
            }
        case n.DOCUMENT_TYPE_NODE:
            return {
                type: NodeType$1.DocumentType,
                name: n.name,
                publicId: n.publicId,
                systemId: n.systemId,
                rootId,
            };
        case n.ELEMENT_NODE:
            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);
            const tagName = getValidTagName(n);
            let attributes = {};
            for (const { name, value } of Array.from(n.attributes)) {
                if (!skipAttribute(tagName, name)) {
                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);
                }
            }
            if (tagName === 'link' && inlineStylesheet) {
                const stylesheet = Array.from(doc.styleSheets).find((s) => {
                    return s.href === n.href;
                });
                let cssText = null;
                if (stylesheet) {
                    cssText = getCssRulesString(stylesheet);
                }
                if (cssText) {
                    delete attributes.rel;
                    delete attributes.href;
                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);
                }
            }
            if (tagName === 'style' &&
                n.sheet &&
                !(n.innerText ||
                    n.textContent ||
                    '').trim().length) {
                const cssText = getCssRulesString(n.sheet);
                if (cssText) {
                    attributes._cssText = absoluteToStylesheet(cssText, getHref());
                }
            }
            if (tagName === 'input' ||
                tagName === 'textarea' ||
                tagName === 'select' ||
                tagName === 'option') {
                const el = n;
                const value = getInputValue(tagName, el, attributes);
                const checked = n.checked;
                if (attributes.type !== 'submit' &&
                    attributes.type !== 'button' &&
                    value) {
                    attributes.value = maskInputValue({
                        input: el,
                        type: attributes.type,
                        tagName,
                        value,
                        maskInputSelector,
                        unmaskInputSelector,
                        maskInputOptions,
                        maskInputFn,
                    });
                }
                if (checked) {
                    attributes.checked = checked;
                }
            }
            if (tagName === 'option') {
                if (n.selected && !maskInputOptions['select']) {
                    attributes.selected = true;
                }
                else {
                    delete attributes.selected;
                }
            }
            if (tagName === 'canvas' && recordCanvas) {
                if (n.__context === '2d') {
                    if (!is2DCanvasBlank(n)) {
                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    }
                }
                else if (!('__context' in n)) {
                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    const blankCanvas = document.createElement('canvas');
                    blankCanvas.width = n.width;
                    blankCanvas.height = n.height;
                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    if (canvasDataURL !== blankCanvasDataURL) {
                        attributes.rr_dataURL = canvasDataURL;
                    }
                }
            }
            if (tagName === 'img' && inlineImages) {
                if (!canvasService) {
                    canvasService = doc.createElement('canvas');
                    canvasCtx = canvasService.getContext('2d');
                }
                const image = n;
                const oldValue = image.crossOrigin;
                image.crossOrigin = 'anonymous';
                const recordInlineImage = () => {
                    try {
                        canvasService.width = image.naturalWidth;
                        canvasService.height = image.naturalHeight;
                        canvasCtx.drawImage(image, 0, 0);
                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    }
                    catch (err) {
                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);
                    }
                    oldValue
                        ? (attributes.crossOrigin = oldValue)
                        : delete attributes.crossOrigin;
                };
                if (image.complete && image.naturalWidth !== 0)
                    recordInlineImage();
                else
                    image.onload = recordInlineImage;
            }
            if (tagName === 'audio' || tagName === 'video') {
                attributes.rr_mediaState = n.paused
                    ? 'paused'
                    : 'played';
                attributes.rr_mediaCurrentTime = n.currentTime;
            }
            if (n.scrollLeft) {
                attributes.rr_scrollLeft = n.scrollLeft;
            }
            if (n.scrollTop) {
                attributes.rr_scrollTop = n.scrollTop;
            }
            if (needBlock) {
                const { width, height } = n.getBoundingClientRect();
                attributes = {
                    class: attributes.class,
                    rr_width: `${width}px`,
                    rr_height: `${height}px`,
                };
            }
            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {
                if (!n.contentDocument) {
                    attributes.rr_src = attributes.src;
                }
                delete attributes.src;
            }
            return {
                type: NodeType$1.Element,
                tagName,
                attributes,
                childNodes: [],
                isSVG: isSVGElement(n) || undefined,
                needBlock,
                rootId,
            };
        case n.TEXT_NODE:
            const parentTagName = n.parentNode && n.parentNode.tagName;
            let textContent = n.textContent;
            const isStyle = parentTagName === 'STYLE' ? true : undefined;
            const isScript = parentTagName === 'SCRIPT' ? true : undefined;
            if (isStyle && textContent) {
                try {
                    if (n.nextSibling || n.previousSibling) {
                    }
                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
                        textContent = stringifyStyleSheet(n.parentNode.sheet);
                    }
                }
                catch (err) {
                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);
                }
                textContent = absoluteToStylesheet(textContent, getHref());
            }
            if (isScript) {
                textContent = 'SCRIPT_PLACEHOLDER';
            }
            if (parentTagName === 'TEXTAREA' && textContent) {
                textContent = '';
            }
            else if (parentTagName === 'OPTION' && textContent) {
                const option = n.parentNode;
                textContent = maskInputValue({
                    input: option,
                    type: null,
                    tagName: parentTagName,
                    value: textContent,
                    maskInputSelector,
                    unmaskInputSelector,
                    maskInputOptions,
                    maskInputFn,
                });
            }
            else if (!isStyle &&
                !isScript &&
                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&
                textContent) {
                textContent = maskTextFn
                    ? maskTextFn(textContent)
                    : defaultMaskFn(textContent);
            }
            return {
                type: NodeType$1.Text,
                textContent: textContent || '',
                isStyle,
                rootId,
            };
        case n.CDATA_SECTION_NODE:
            return {
                type: NodeType$1.CDATA,
                textContent: '',
                rootId,
            };
        case n.COMMENT_NODE:
            return {
                type: NodeType$1.Comment,
                textContent: n.textContent || '',
                rootId,
            };
        default:
            return false;
    }
}
function lowerIfExists(maybeAttr) {
    if (maybeAttr === undefined || maybeAttr === null) {
        return '';
    }
    else {
        return maybeAttr.toLowerCase();
    }
}
function slimDOMExcluded(sn, slimDOMOptions) {
    if (slimDOMOptions.comment && sn.type === NodeType$1.Comment) {
        return true;
    }
    else if (sn.type === NodeType$1.Element) {
        if (slimDOMOptions.script &&
            (sn.tagName === 'script' ||
                (sn.tagName === 'link' &&
                    (sn.attributes.rel === 'preload' ||
                        sn.attributes.rel === 'modulepreload') &&
                    sn.attributes.as === 'script') ||
                (sn.tagName === 'link' &&
                    sn.attributes.rel === 'prefetch' &&
                    typeof sn.attributes.href === 'string' &&
                    sn.attributes.href.endsWith('.js')))) {
            return true;
        }
        else if (slimDOMOptions.headFavicon &&
            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||
                (sn.tagName === 'meta' &&
                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||
                        lowerIfExists(sn.attributes.name) === 'application-name' ||
                        lowerIfExists(sn.attributes.rel) === 'icon' ||
                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||
                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {
            return true;
        }
        else if (sn.tagName === 'meta') {
            if (slimDOMOptions.headMetaDescKeywords &&
                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {
                return true;
            }
            else if (slimDOMOptions.headMetaSocial &&
                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||
                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||
                    lowerIfExists(sn.attributes.name) === 'pinterest')) {
                return true;
            }
            else if (slimDOMOptions.headMetaRobots &&
                (lowerIfExists(sn.attributes.name) === 'robots' ||
                    lowerIfExists(sn.attributes.name) === 'googlebot' ||
                    lowerIfExists(sn.attributes.name) === 'bingbot')) {
                return true;
            }
            else if (slimDOMOptions.headMetaHttpEquiv &&
                sn.attributes['http-equiv'] !== undefined) {
                return true;
            }
            else if (slimDOMOptions.headMetaAuthorship &&
                (lowerIfExists(sn.attributes.name) === 'author' ||
                    lowerIfExists(sn.attributes.name) === 'generator' ||
                    lowerIfExists(sn.attributes.name) === 'framework' ||
                    lowerIfExists(sn.attributes.name) === 'publisher' ||
                    lowerIfExists(sn.attributes.name) === 'progid' ||
                    lowerIfExists(sn.attributes.property).match(/^article:/) ||
                    lowerIfExists(sn.attributes.property).match(/^product:/))) {
                return true;
            }
            else if (slimDOMOptions.headMetaVerification &&
                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||
                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||
                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||
                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||
                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||
                    lowerIfExists(sn.attributes.name) === 'verification' ||
                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {
                return true;
            }
        }
    }
    return false;
}
function serializeNodeWithId(n, options) {
    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;
    let { preserveWhiteSpace = true } = options;
    const _serializedNode = serializeNode(n, {
        doc,
        blockClass,
        blockSelector,
        unblockSelector,
        maskTextClass,
        maskTextSelector,
        unmaskTextSelector,
        inlineStylesheet,
        maskInputSelector,
        unmaskInputSelector,
        maskAllText,
        maskInputOptions,
        maskTextFn,
        maskInputFn,
        dataURLOptions,
        inlineImages,
        recordCanvas,
        keepIframeSrcFn,
    });
    if (!_serializedNode) {
        console.warn(n, 'not serialized');
        return null;
    }
    let id;
    if ('__sn' in n) {
        id = n.__sn.id;
    }
    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||
        (!preserveWhiteSpace &&
            _serializedNode.type === NodeType$1.Text &&
            !_serializedNode.isStyle &&
            !_serializedNode.textContent.replace(/^\s+|\s+$/gm, '').length)) {
        id = IGNORED_NODE;
    }
    else {
        id = genId();
    }
    const serializedNode = Object.assign(_serializedNode, { id });
    n.__sn = serializedNode;
    if (id === IGNORED_NODE) {
        return null;
    }
    map[id] = n;
    if (onSerialize) {
        onSerialize(n);
    }
    let recordChild = !skipChild;
    if (serializedNode.type === NodeType$1.Element) {
        recordChild = recordChild && !serializedNode.needBlock;
        delete serializedNode.needBlock;
        if (n.shadowRoot)
            serializedNode.isShadowHost = true;
    }
    if ((serializedNode.type === NodeType$1.Document ||
        serializedNode.type === NodeType$1.Element) &&
        recordChild) {
        if (slimDOMOptions.headWhitespace &&
            _serializedNode.type === NodeType$1.Element &&
            _serializedNode.tagName === 'head') {
            preserveWhiteSpace = false;
        }
        const bypassOptions = {
            doc,
            map,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            skipChild,
            inlineStylesheet,
            maskInputSelector,
            unmaskInputSelector,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            slimDOMOptions,
            dataURLOptions,
            inlineImages,
            recordCanvas,
            preserveWhiteSpace,
            onSerialize,
            onIframeLoad,
            iframeLoadTimeout,
            keepIframeSrcFn,
        };
        for (const childN of Array.from(n.childNodes)) {
            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
            if (serializedChildNode) {
                serializedNode.childNodes.push(serializedChildNode);
            }
        }
        if (isElement(n) && n.shadowRoot) {
            for (const childN of Array.from(n.shadowRoot.childNodes)) {
                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
                if (serializedChildNode) {
                    serializedChildNode.isShadow = true;
                    serializedNode.childNodes.push(serializedChildNode);
                }
            }
        }
    }
    if (n.parentNode && isShadowRoot(n.parentNode)) {
        serializedNode.isShadow = true;
    }
    if (serializedNode.type === NodeType$1.Element &&
        serializedNode.tagName === 'iframe') {
        onceIframeLoaded(n, () => {
            const iframeDoc = n.contentDocument;
            if (iframeDoc && onIframeLoad) {
                const serializedIframeNode = serializeNodeWithId(iframeDoc, {
                    doc: iframeDoc,
                    map,
                    blockClass,
                    blockSelector,
                    unblockSelector,
                    maskTextClass,
                    maskTextSelector,
                    unmaskTextSelector,
                    skipChild: false,
                    inlineStylesheet,
                    maskInputSelector,
                    unmaskInputSelector,
                    maskAllText,
                    maskInputOptions,
                    maskTextFn,
                    maskInputFn,
                    slimDOMOptions,
                    dataURLOptions,
                    inlineImages,
                    recordCanvas,
                    preserveWhiteSpace,
                    onSerialize,
                    onIframeLoad,
                    iframeLoadTimeout,
                    keepIframeSrcFn,
                });
                if (serializedIframeNode) {
                    onIframeLoad(n, serializedIframeNode);
                }
            }
        }, iframeLoadTimeout);
    }
    return serializedNode;
}
function snapshot(n, options) {
    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};
    const idNodeMap = {};
    const maskInputOptions = maskAllInputs === true
        ? {
            color: true,
            date: true,
            'datetime-local': true,
            email: true,
            month: true,
            number: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true,
            textarea: true,
            select: true,
        }
        : maskAllInputs === false
            ? {}
            : maskAllInputs;
    const slimDOMOptions = slimDOM === true || slimDOM === 'all'
        ?
            {
                script: true,
                comment: true,
                headFavicon: true,
                headWhitespace: true,
                headMetaDescKeywords: slimDOM === 'all',
                headMetaSocial: true,
                headMetaRobots: true,
                headMetaHttpEquiv: true,
                headMetaAuthorship: true,
                headMetaVerification: true,
            }
        : slimDOM === false
            ? {}
            : slimDOM;
    return [
        serializeNodeWithId(n, {
            doc: n,
            map: idNodeMap,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            skipChild: false,
            inlineStylesheet,
            maskInputSelector,
            unmaskInputSelector,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            slimDOMOptions,
            dataURLOptions,
            inlineImages,
            recordCanvas,
            preserveWhiteSpace,
            onSerialize,
            onIframeLoad,
            iframeLoadTimeout,
            keepIframeSrcFn,
        }),
        idNodeMap,
    ];
}
function skipAttribute(tagName, attributeName, value) {
    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');
}
function getInputValue(tagName, el, attributes) {
    if (tagName === 'input' &&
        (attributes.type === 'radio' || attributes.type === 'checkbox')) {
        return el.getAttribute('value') || '';
    }
    return el.value;
}

var EventType;
(function (EventType) {
    EventType[EventType["DomContentLoaded"] = 0] = "DomContentLoaded";
    EventType[EventType["Load"] = 1] = "Load";
    EventType[EventType["FullSnapshot"] = 2] = "FullSnapshot";
    EventType[EventType["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
    EventType[EventType["Meta"] = 4] = "Meta";
    EventType[EventType["Custom"] = 5] = "Custom";
    EventType[EventType["Plugin"] = 6] = "Plugin";
})(EventType || (EventType = {}));
var IncrementalSource;
(function (IncrementalSource) {
    IncrementalSource[IncrementalSource["Mutation"] = 0] = "Mutation";
    IncrementalSource[IncrementalSource["MouseMove"] = 1] = "MouseMove";
    IncrementalSource[IncrementalSource["MouseInteraction"] = 2] = "MouseInteraction";
    IncrementalSource[IncrementalSource["Scroll"] = 3] = "Scroll";
    IncrementalSource[IncrementalSource["ViewportResize"] = 4] = "ViewportResize";
    IncrementalSource[IncrementalSource["Input"] = 5] = "Input";
    IncrementalSource[IncrementalSource["TouchMove"] = 6] = "TouchMove";
    IncrementalSource[IncrementalSource["MediaInteraction"] = 7] = "MediaInteraction";
    IncrementalSource[IncrementalSource["StyleSheetRule"] = 8] = "StyleSheetRule";
    IncrementalSource[IncrementalSource["CanvasMutation"] = 9] = "CanvasMutation";
    IncrementalSource[IncrementalSource["Font"] = 10] = "Font";
    IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
    IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
    IncrementalSource[IncrementalSource["StyleDeclaration"] = 13] = "StyleDeclaration";
})(IncrementalSource || (IncrementalSource = {}));
var MouseInteractions;
(function (MouseInteractions) {
    MouseInteractions[MouseInteractions["MouseUp"] = 0] = "MouseUp";
    MouseInteractions[MouseInteractions["MouseDown"] = 1] = "MouseDown";
    MouseInteractions[MouseInteractions["Click"] = 2] = "Click";
    MouseInteractions[MouseInteractions["ContextMenu"] = 3] = "ContextMenu";
    MouseInteractions[MouseInteractions["DblClick"] = 4] = "DblClick";
    MouseInteractions[MouseInteractions["Focus"] = 5] = "Focus";
    MouseInteractions[MouseInteractions["Blur"] = 6] = "Blur";
    MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
    MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
    MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";
    MouseInteractions[MouseInteractions["TouchCancel"] = 10] = "TouchCancel";
})(MouseInteractions || (MouseInteractions = {}));
var CanvasContext;
(function (CanvasContext) {
    CanvasContext[CanvasContext["2D"] = 0] = "2D";
    CanvasContext[CanvasContext["WebGL"] = 1] = "WebGL";
    CanvasContext[CanvasContext["WebGL2"] = 2] = "WebGL2";
})(CanvasContext || (CanvasContext = {}));
var MediaInteractions;
(function (MediaInteractions) {
    MediaInteractions[MediaInteractions["Play"] = 0] = "Play";
    MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
    MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
    MediaInteractions[MediaInteractions["VolumeChange"] = 3] = "VolumeChange";
})(MediaInteractions || (MediaInteractions = {}));
var ReplayerEvents;
(function (ReplayerEvents) {
    ReplayerEvents["Start"] = "start";
    ReplayerEvents["Pause"] = "pause";
    ReplayerEvents["Resume"] = "resume";
    ReplayerEvents["Resize"] = "resize";
    ReplayerEvents["Finish"] = "finish";
    ReplayerEvents["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
    ReplayerEvents["LoadStylesheetStart"] = "load-stylesheet-start";
    ReplayerEvents["LoadStylesheetEnd"] = "load-stylesheet-end";
    ReplayerEvents["SkipStart"] = "skip-start";
    ReplayerEvents["SkipEnd"] = "skip-end";
    ReplayerEvents["MouseInteraction"] = "mouse-interaction";
    ReplayerEvents["EventCast"] = "event-cast";
    ReplayerEvents["CustomEvent"] = "custom-event";
    ReplayerEvents["Flush"] = "flush";
    ReplayerEvents["StateChange"] = "state-change";
    ReplayerEvents["PlayBack"] = "play-back";
})(ReplayerEvents || (ReplayerEvents = {}));

function on(type, fn, target = document) {
    const options = { capture: true, passive: true };
    target.addEventListener(type, fn, options);
    return () => target.removeEventListener(type, fn, options);
}
function createMirror() {
    return {
        map: {},
        getId(n) {
            if (!n || !n.__sn) {
                return -1;
            }
            return n.__sn.id;
        },
        getNode(id) {
            return this.map[id] || null;
        },
        removeNodeFromMap(n) {
            const id = n.__sn && n.__sn.id;
            delete this.map[id];
            if (n.childNodes) {
                n.childNodes.forEach((child) => this.removeNodeFromMap(child));
            }
        },
        has(id) {
            return this.map.hasOwnProperty(id);
        },
        reset() {
            this.map = {};
        },
    };
}
const DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
    '\r\n' +
    'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
    '\r\n' +
    'or you can use record.mirror to access the mirror instance during recording.';
let _mirror = {
    map: {},
    getId() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return -1;
    },
    getNode() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return null;
    },
    removeNodeFromMap() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
    },
    has() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return false;
    },
    reset() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
    },
};
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
    _mirror = new Proxy(_mirror, {
        get(target, prop, receiver) {
            if (prop === 'map') {
                console.error(DEPARTED_MIRROR_ACCESS_WARNING);
            }
            return Reflect.get(target, prop, receiver);
        },
    });
}
function throttle(func, wait, options = {}) {
    let timeout = null;
    let previous = 0;
    return function (arg) {
        let now = Date.now();
        if (!previous && options.leading === false) {
            previous = now;
        }
        let remaining = wait - (now - previous);
        let context = this;
        let args = arguments;
        if (remaining <= 0 || remaining > wait) {
            if (timeout) {
                clearTimeout(timeout);
                timeout = null;
            }
            previous = now;
            func.apply(context, args);
        }
        else if (!timeout && options.trailing !== false) {
            timeout = setTimeout(() => {
                previous = options.leading === false ? 0 : Date.now();
                timeout = null;
                func.apply(context, args);
            }, remaining);
        }
    };
}
function hookSetter(target, key, d, isRevoked, win = window) {
    const original = win.Object.getOwnPropertyDescriptor(target, key);
    win.Object.defineProperty(target, key, isRevoked
        ? d
        : {
            set(value) {
                setTimeout(() => {
                    d.set.call(this, value);
                }, 0);
                if (original && original.set) {
                    original.set.call(this, value);
                }
            },
        });
    return () => hookSetter(target, key, original || {}, true);
}
function patch(source, name, replacement) {
    try {
        if (!(name in source)) {
            return () => { };
        }
        const original = source[name];
        const wrapped = replacement(original);
        if (typeof wrapped === 'function') {
            wrapped.prototype = wrapped.prototype || {};
            Object.defineProperties(wrapped, {
                __rrweb_original__: {
                    enumerable: false,
                    value: original,
                },
            });
        }
        source[name] = wrapped;
        return () => {
            source[name] = original;
        };
    }
    catch (_a) {
        return () => { };
    }
}
function getWindowHeight() {
    return (window.innerHeight ||
        (document.documentElement && document.documentElement.clientHeight) ||
        (document.body && document.body.clientHeight));
}
function getWindowWidth() {
    return (window.innerWidth ||
        (document.documentElement && document.documentElement.clientWidth) ||
        (document.body && document.body.clientWidth));
}
function isBlocked(node, blockClass, blockSelector, unblockSelector) {
    if (!node) {
        return false;
    }
    if (node.nodeType === node.ELEMENT_NODE) {
        let needBlock = false;
        const needUnblock = unblockSelector && node.matches(unblockSelector);
        if (typeof blockClass === 'string') {
            if (node.closest !== undefined) {
                needBlock =
                    !needUnblock &&
                        node.closest('.' + blockClass) !== null;
            }
            else {
                needBlock =
                    !needUnblock && node.classList.contains(blockClass);
            }
        }
        else {
            !needUnblock &&
                node.classList.forEach((className) => {
                    if (blockClass.test(className)) {
                        needBlock = true;
                    }
                });
        }
        if (!needBlock && blockSelector) {
            needBlock = node.matches(blockSelector);
        }
        return ((!needUnblock && needBlock) ||
            isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector));
    }
    if (node.nodeType === node.TEXT_NODE) {
        return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);
    }
    return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);
}
function isIgnored(n) {
    if ('__sn' in n) {
        return n.__sn.id === IGNORED_NODE;
    }
    return false;
}
function isAncestorRemoved(target, mirror) {
    if (isShadowRoot(target)) {
        return false;
    }
    const id = mirror.getId(target);
    if (!mirror.has(id)) {
        return true;
    }
    if (target.parentNode &&
        target.parentNode.nodeType === target.DOCUMENT_NODE) {
        return false;
    }
    if (!target.parentNode) {
        return true;
    }
    return isAncestorRemoved(target.parentNode, mirror);
}
function isTouchEvent(event) {
    return Boolean(event.changedTouches);
}
function polyfill(win = window) {
    if ('NodeList' in win && !win.NodeList.prototype.forEach) {
        win.NodeList.prototype.forEach = Array.prototype
            .forEach;
    }
    if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {
        win.DOMTokenList.prototype.forEach = Array.prototype
            .forEach;
    }
    if (!Node.prototype.contains) {
        Node.prototype.contains = function contains(node) {
            if (!(0 in arguments)) {
                throw new TypeError('1 argument is required');
            }
            do {
                if (this === node) {
                    return true;
                }
            } while ((node = node && node.parentNode));
            return false;
        };
    }
}
function isIframeINode(node) {
    if ('__sn' in node) {
        return (node.__sn.type === NodeType$1.Element && node.__sn.tagName === 'iframe');
    }
    return false;
}
function hasShadowRoot(n) {
    return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);
}

function isNodeInLinkedList(n) {
    return '__ln' in n;
}
class DoubleLinkedList {
    constructor() {
        this.length = 0;
        this.head = null;
    }
    get(position) {
        if (position >= this.length) {
            throw new Error('Position outside of list range');
        }
        let current = this.head;
        for (let index = 0; index < position; index++) {
            current = (current === null || current === void 0 ? void 0 : current.next) || null;
        }
        return current;
    }
    addNode(n) {
        const node = {
            value: n,
            previous: null,
            next: null,
        };
        n.__ln = node;
        if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {
            const current = n.previousSibling.__ln.next;
            node.next = current;
            node.previous = n.previousSibling.__ln;
            n.previousSibling.__ln.next = node;
            if (current) {
                current.previous = node;
            }
        }
        else if (n.nextSibling &&
            isNodeInLinkedList(n.nextSibling) &&
            n.nextSibling.__ln.previous) {
            const current = n.nextSibling.__ln.previous;
            node.previous = current;
            node.next = n.nextSibling.__ln;
            n.nextSibling.__ln.previous = node;
            if (current) {
                current.next = node;
            }
        }
        else {
            if (this.head) {
                this.head.previous = node;
            }
            node.next = this.head;
            this.head = node;
        }
        this.length++;
    }
    removeNode(n) {
        const current = n.__ln;
        if (!this.head) {
            return;
        }
        if (!current.previous) {
            this.head = current.next;
            if (this.head) {
                this.head.previous = null;
            }
        }
        else {
            current.previous.next = current.next;
            if (current.next) {
                current.next.previous = current.previous;
            }
        }
        if (n.__ln) {
            delete n.__ln;
        }
        this.length--;
    }
}
const moveKey = (id, parentId) => `${id}@${parentId}`;
function isINode(n) {
    return '__sn' in n;
}
class MutationBuffer {
    constructor() {
        this.frozen = false;
        this.locked = false;
        this.texts = [];
        this.attributes = [];
        this.removes = [];
        this.mapRemoves = [];
        this.movedMap = {};
        this.addedSet = new Set();
        this.movedSet = new Set();
        this.droppedSet = new Set();
        this.processMutations = (mutations) => {
            mutations.forEach(this.processMutation);
            this.emit();
        };
        this.emit = () => {
            if (this.frozen || this.locked) {
                return;
            }
            const adds = [];
            const addList = new DoubleLinkedList();
            const getNextId = (n) => {
                let ns = n;
                let nextId = IGNORED_NODE;
                while (nextId === IGNORED_NODE) {
                    ns = ns && ns.nextSibling;
                    nextId = ns && this.mirror.getId(ns);
                }
                return nextId;
            };
            const pushAdd = (n) => {
                var _a, _b, _c, _d, _e;
                const shadowHost = n.getRootNode
                    ? (_a = n.getRootNode()) === null || _a === void 0 ? void 0 : _a.host
                    : null;
                let rootShadowHost = shadowHost;
                while ((_c = (_b = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _b === void 0 ? void 0 : _b.call(rootShadowHost)) === null || _c === void 0 ? void 0 : _c.host)
                    rootShadowHost =
                        ((_e = (_d = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _d === void 0 ? void 0 : _d.call(rootShadowHost)) === null || _e === void 0 ? void 0 : _e.host) ||
                            null;
                const notInDoc = !this.doc.contains(n) &&
                    (!rootShadowHost || !this.doc.contains(rootShadowHost));
                if (!n.parentNode || notInDoc) {
                    return;
                }
                const parentId = isShadowRoot(n.parentNode)
                    ? this.mirror.getId(shadowHost)
                    : this.mirror.getId(n.parentNode);
                const nextId = getNextId(n);
                if (parentId === -1 || nextId === -1) {
                    return addList.addNode(n);
                }
                let sn = serializeNodeWithId(n, {
                    doc: this.doc,
                    map: this.mirror.map,
                    blockClass: this.blockClass,
                    blockSelector: this.blockSelector,
                    unblockSelector: this.unblockSelector,
                    maskTextClass: this.maskTextClass,
                    maskTextSelector: this.maskTextSelector,
                    unmaskTextSelector: this.unmaskTextSelector,
                    maskInputSelector: this.maskInputSelector,
                    unmaskInputSelector: this.unmaskInputSelector,
                    skipChild: true,
                    inlineStylesheet: this.inlineStylesheet,
                    maskAllText: this.maskAllText,
                    maskInputOptions: this.maskInputOptions,
                    maskTextFn: this.maskTextFn,
                    maskInputFn: this.maskInputFn,
                    slimDOMOptions: this.slimDOMOptions,
                    recordCanvas: this.recordCanvas,
                    inlineImages: this.inlineImages,
                    onSerialize: (currentN) => {
                        if (isIframeINode(currentN)) {
                            this.iframeManager.addIframe(currentN);
                        }
                        if (hasShadowRoot(n)) {
                            this.shadowDomManager.addShadowRoot(n.shadowRoot, document);
                        }
                    },
                    onIframeLoad: (iframe, childSn) => {
                        this.iframeManager.attachIframe(iframe, childSn);
                        this.shadowDomManager.observeAttachShadow(iframe);
                    },
                });
                if (sn) {
                    adds.push({
                        parentId,
                        nextId,
                        node: sn,
                    });
                }
            };
            while (this.mapRemoves.length) {
                this.mirror.removeNodeFromMap(this.mapRemoves.shift());
            }
            for (const n of this.movedSet) {
                if (isParentRemoved(this.removes, n, this.mirror) &&
                    !this.movedSet.has(n.parentNode)) {
                    continue;
                }
                pushAdd(n);
            }
            for (const n of this.addedSet) {
                if (!isAncestorInSet(this.droppedSet, n) &&
                    !isParentRemoved(this.removes, n, this.mirror)) {
                    pushAdd(n);
                }
                else if (isAncestorInSet(this.movedSet, n)) {
                    pushAdd(n);
                }
                else {
                    this.droppedSet.add(n);
                }
            }
            let candidate = null;
            while (addList.length) {
                let node = null;
                if (candidate) {
                    const parentId = this.mirror.getId(candidate.value.parentNode);
                    const nextId = getNextId(candidate.value);
                    if (parentId !== -1 && nextId !== -1) {
                        node = candidate;
                    }
                }
                if (!node) {
                    for (let index = addList.length - 1; index >= 0; index--) {
                        const _node = addList.get(index);
                        if (_node) {
                            const parentId = this.mirror.getId(_node.value.parentNode);
                            const nextId = getNextId(_node.value);
                            if (parentId !== -1 && nextId !== -1) {
                                node = _node;
                                break;
                            }
                        }
                    }
                }
                if (!node) {
                    while (addList.head) {
                        addList.removeNode(addList.head.value);
                    }
                    break;
                }
                candidate = node.previous;
                addList.removeNode(node.value);
                pushAdd(node.value);
            }
            const payload = {
                texts: this.texts
                    .map((text) => ({
                    id: this.mirror.getId(text.node),
                    value: text.value,
                }))
                    .filter((text) => this.mirror.has(text.id)),
                attributes: this.attributes
                    .map((attribute) => ({
                    id: this.mirror.getId(attribute.node),
                    attributes: attribute.attributes,
                }))
                    .filter((attribute) => this.mirror.has(attribute.id)),
                removes: this.removes,
                adds,
            };
            if (!payload.texts.length &&
                !payload.attributes.length &&
                !payload.removes.length &&
                !payload.adds.length) {
                return;
            }
            this.texts = [];
            this.attributes = [];
            this.removes = [];
            this.addedSet = new Set();
            this.movedSet = new Set();
            this.droppedSet = new Set();
            this.movedMap = {};
            this.mutationCb(payload);
        };
        this.processMutation = (m) => {
            if (isIgnored(m.target)) {
                return;
            }
            switch (m.type) {
                case 'characterData': {
                    const value = m.target.textContent;
                    if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) && value !== m.oldValue) {
                        this.texts.push({
                            value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextSelector, this.maskAllText) && value
                                ? this.maskTextFn
                                    ? this.maskTextFn(value)
                                    : value.replace(/[\S]/g, '*')
                                : value,
                            node: m.target,
                        });
                    }
                    break;
                }
                case 'attributes': {
                    const target = m.target;
                    let value = target.getAttribute(m.attributeName);
                    if (m.attributeName === 'value') {
                        value = maskInputValue({
                            input: target,
                            maskInputSelector: this.maskInputSelector,
                            unmaskInputSelector: this.unmaskInputSelector,
                            maskInputOptions: this.maskInputOptions,
                            tagName: target.tagName,
                            type: target.getAttribute('type'),
                            value,
                            maskInputFn: this.maskInputFn,
                        });
                    }
                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || value === m.oldValue) {
                        return;
                    }
                    let item = this.attributes.find((a) => a.node === m.target);
                    if (!item) {
                        item = {
                            node: m.target,
                            attributes: {},
                        };
                        this.attributes.push(item);
                    }
                    if (m.attributeName === 'type' &&
                        m.target.tagName === 'INPUT' &&
                        (m.oldValue || '').toLowerCase() === 'password') {
                        m.target.setAttribute('rr_is_password', 'true');
                    }
                    if (m.attributeName === 'style') {
                        const old = this.doc.createElement('span');
                        if (m.oldValue) {
                            old.setAttribute('style', m.oldValue);
                        }
                        if (item.attributes.style === undefined ||
                            item.attributes.style === null) {
                            item.attributes.style = {};
                        }
                        try {
                            const styleObj = item.attributes.style;
                            for (const pname of Array.from(target.style)) {
                                const newValue = target.style.getPropertyValue(pname);
                                const newPriority = target.style.getPropertyPriority(pname);
                                if (newValue !== old.style.getPropertyValue(pname) ||
                                    newPriority !== old.style.getPropertyPriority(pname)) {
                                    if (newPriority === '') {
                                        styleObj[pname] = newValue;
                                    }
                                    else {
                                        styleObj[pname] = [newValue, newPriority];
                                    }
                                }
                            }
                            for (const pname of Array.from(old.style)) {
                                if (target.style.getPropertyValue(pname) === '') {
                                    styleObj[pname] = false;
                                }
                            }
                        }
                        catch (error) {
                            console.warn('[rrweb] Error when parsing update to style attribute:', error);
                        }
                    }
                    else {
                        const element = m.target;
                        item.attributes[m.attributeName] = transformAttribute(this.doc, element, element.tagName, m.attributeName, value, this.maskAllText, this.unmaskTextSelector, this.maskTextFn);
                    }
                    break;
                }
                case 'childList': {
                    m.addedNodes.forEach((n) => this.genAdds(n, m.target));
                    m.removedNodes.forEach((n) => {
                        const nodeId = this.mirror.getId(n);
                        const parentId = isShadowRoot(m.target)
                            ? this.mirror.getId(m.target.host)
                            : this.mirror.getId(m.target);
                        if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || isIgnored(n)) {
                            return;
                        }
                        if (this.addedSet.has(n)) {
                            deepDelete(this.addedSet, n);
                            this.droppedSet.add(n);
                        }
                        else if (this.addedSet.has(m.target) && nodeId === -1) ;
                        else if (isAncestorRemoved(m.target, this.mirror)) ;
                        else if (this.movedSet.has(n) &&
                            this.movedMap[moveKey(nodeId, parentId)]) {
                            deepDelete(this.movedSet, n);
                        }
                        else {
                            this.removes.push({
                                parentId,
                                id: nodeId,
                                isShadow: isShadowRoot(m.target) ? true : undefined,
                            });
                        }
                        this.mapRemoves.push(n);
                    });
                    break;
                }
            }
        };
        this.genAdds = (n, target) => {
            if (target && isBlocked(target, this.blockClass, this.blockSelector, this.unblockSelector)) {
                return;
            }
            if (isINode(n)) {
                if (isIgnored(n)) {
                    return;
                }
                this.movedSet.add(n);
                let targetId = null;
                if (target && isINode(target)) {
                    targetId = target.__sn.id;
                }
                if (targetId) {
                    this.movedMap[moveKey(n.__sn.id, targetId)] = true;
                }
            }
            else {
                this.addedSet.add(n);
                this.droppedSet.delete(n);
            }
            if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector))
                n.childNodes.forEach((childN) => this.genAdds(childN));
        };
    }
    init(options) {
        [
            'mutationCb',
            'blockClass',
            'blockSelector',
            'unblockSelector',
            'maskTextClass',
            'maskTextSelector',
            'unmaskTextSelector',
            'maskInputSelector',
            'unmaskInputSelector',
            'inlineStylesheet',
            'maskAllText',
            'maskInputOptions',
            'maskTextFn',
            'maskInputFn',
            'recordCanvas',
            'inlineImages',
            'slimDOMOptions',
            'doc',
            'mirror',
            'iframeManager',
            'shadowDomManager',
            'canvasManager',
        ].forEach((key) => {
            this[key] = options[key];
        });
    }
    freeze() {
        this.frozen = true;
        this.canvasManager.freeze();
    }
    unfreeze() {
        this.frozen = false;
        this.canvasManager.unfreeze();
        this.emit();
    }
    isFrozen() {
        return this.frozen;
    }
    lock() {
        this.locked = true;
        this.canvasManager.lock();
    }
    unlock() {
        this.locked = false;
        this.canvasManager.unlock();
        this.emit();
    }
    reset() {
        this.shadowDomManager.reset();
        this.canvasManager.reset();
    }
}
function deepDelete(addsSet, n) {
    addsSet.delete(n);
    n.childNodes.forEach((childN) => deepDelete(addsSet, childN));
}
function isParentRemoved(removes, n, mirror) {
    const { parentNode } = n;
    if (!parentNode) {
        return false;
    }
    const parentId = mirror.getId(parentNode);
    if (removes.some((r) => r.id === parentId)) {
        return true;
    }
    return isParentRemoved(removes, parentNode, mirror);
}
function isAncestorInSet(set, n) {
    const { parentNode } = n;
    if (!parentNode) {
        return false;
    }
    if (set.has(parentNode)) {
        return true;
    }
    return isAncestorInSet(set, parentNode);
}

const callbackWrapper = (cb) => {
    const rrwebWrapped = (...rest) => {
        try {
            return cb(...rest);
        }
        catch (error) {
            try {
                error.__rrweb__ = true;
            }
            catch (_a) {
            }
            throw error;
        }
    };
    return rrwebWrapped;
};

const mutationBuffers = [];
function getEventTarget(event) {
    try {
        if ('composedPath' in event) {
            const path = event.composedPath();
            if (path.length) {
                return path[0];
            }
        }
        else if ('path' in event && event.path.length) {
            return event.path[0];
        }
    }
    catch (_a) { }
    return event && event.target;
}
function initMutationObserver(options, rootEl) {
    var _a, _b;
    const mutationBuffer = new MutationBuffer();
    mutationBuffers.push(mutationBuffer);
    mutationBuffer.init(options);
    let mutationObserverCtor = window.MutationObserver ||
        window.__rrMutationObserver;
    const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');
    if (angularZoneSymbol &&
        window[angularZoneSymbol]) {
        mutationObserverCtor = window[angularZoneSymbol];
    }
    const observer = new mutationObserverCtor(callbackWrapper((mutations) => {
        if (options.onMutation && options.onMutation(mutations) === false) {
            return;
        }
        mutationBuffer.processMutations(mutations);
    }));
    observer.observe(rootEl, {
        attributes: true,
        attributeOldValue: true,
        characterData: true,
        characterDataOldValue: true,
        childList: true,
        subtree: true,
    });
    return observer;
}
function initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {
    if (sampling.mousemove === false) {
        return () => { };
    }
    const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;
    const callbackThreshold = typeof sampling.mousemoveCallback === 'number'
        ? sampling.mousemoveCallback
        : 500;
    let positions = [];
    let timeBaseline;
    const wrappedCb = throttle((source) => {
        const totalOffset = Date.now() - timeBaseline;
        callbackWrapper(mousemoveCb)(positions.map((p) => {
            p.timeOffset -= totalOffset;
            return p;
        }), source);
        positions = [];
        timeBaseline = null;
    }, callbackThreshold);
    const updatePosition = throttle((evt) => {
        const target = getEventTarget(evt);
        const { clientX, clientY } = isTouchEvent(evt)
            ? evt.changedTouches[0]
            : evt;
        if (!timeBaseline) {
            timeBaseline = Date.now();
        }
        positions.push({
            x: clientX,
            y: clientY,
            id: mirror.getId(target),
            timeOffset: Date.now() - timeBaseline,
        });
        wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent
            ? IncrementalSource.Drag
            : evt instanceof MouseEvent
                ? IncrementalSource.MouseMove
                : IncrementalSource.TouchMove);
    }, threshold, {
        trailing: false,
    });
    const handlers = [
        on('mousemove', callbackWrapper(updatePosition), doc),
        on('touchmove', callbackWrapper(updatePosition), doc),
        on('drag', callbackWrapper(updatePosition), doc),
    ];
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {
    if (sampling.mouseInteraction === false) {
        return () => { };
    }
    const disableMap = sampling.mouseInteraction === true ||
        sampling.mouseInteraction === undefined
        ? {}
        : sampling.mouseInteraction;
    const handlers = [];
    const getHandler = (eventKey) => {
        return (event) => {
            const target = getEventTarget(event);
            if (isBlocked(target, blockClass, blockSelector, unblockSelector)) {
                return;
            }
            const e = isTouchEvent(event) ? event.changedTouches[0] : event;
            if (!e) {
                return;
            }
            const id = mirror.getId(target);
            const { clientX, clientY } = e;
            callbackWrapper(mouseInteractionCb)({
                type: MouseInteractions[eventKey],
                id,
                x: clientX,
                y: clientY,
            });
        };
    };
    Object.keys(MouseInteractions)
        .filter((key) => Number.isNaN(Number(key)) &&
        !key.endsWith('_Departed') &&
        disableMap[key] !== false)
        .forEach((eventKey) => {
        const eventName = eventKey.toLowerCase();
        const handler = callbackWrapper(getHandler(eventKey));
        handlers.push(on(eventName, handler, doc));
    });
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {
    const updatePosition = throttle((evt) => {
        const target = getEventTarget(evt);
        if (!target ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        const id = mirror.getId(target);
        if (target === doc) {
            const scrollEl = (doc.scrollingElement || doc.documentElement);
            callbackWrapper(scrollCb)({
                id,
                x: scrollEl.scrollLeft,
                y: scrollEl.scrollTop,
            });
        }
        else {
            callbackWrapper(scrollCb)({
                id,
                x: target.scrollLeft,
                y: target.scrollTop,
            });
        }
    }, sampling.scroll || 100);
    return on('scroll', callbackWrapper(updatePosition), doc);
}
function initViewportResizeObserver({ viewportResizeCb, }) {
    let lastH = -1;
    let lastW = -1;
    const updateDimension = throttle(() => {
        const height = getWindowHeight();
        const width = getWindowWidth();
        if (lastH !== height || lastW !== width) {
            callbackWrapper(viewportResizeCb)({
                width: Number(width),
                height: Number(height),
            });
            lastH = height;
            lastW = width;
        }
    }, 200);
    return on('resize', callbackWrapper(updateDimension), window);
}
function wrapEventWithUserTriggeredFlag(v, enable) {
    const value = Object.assign({}, v);
    if (!enable)
        delete value.userTriggered;
    return value;
}
const INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
const lastInputValueMap = new WeakMap();
function initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputSelector, unmaskInputSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {
    function eventHandler(event) {
        let target = getEventTarget(event);
        const tagName = target && target.tagName;
        const userTriggered = event.isTrusted;
        if (tagName === 'OPTION')
            target = target.parentElement;
        if (!target ||
            !tagName ||
            INPUT_TAGS.indexOf(tagName) < 0 ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        let type = target.type;
        if (target.classList.contains(ignoreClass) ||
            (ignoreSelector && target.matches(ignoreSelector))) {
            return;
        }
        let text = target.value;
        let isChecked = false;
        if (target.hasAttribute('rr_is_password')) {
            type = 'password';
        }
        if (type === 'radio' || type === 'checkbox') {
            isChecked = target.checked;
        }
        else if (hasInputMaskOptions({
            maskInputOptions,
            maskInputSelector,
            tagName,
            type,
        })) {
            text = maskInputValue({
                input: target,
                maskInputOptions,
                maskInputSelector,
                unmaskInputSelector,
                tagName,
                type,
                value: text,
                maskInputFn,
            });
        }
        cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));
        const name = target.name;
        if (type === 'radio' && name && isChecked) {
            doc
                .querySelectorAll(`input[type="radio"][name="${name}"]`)
                .forEach((el) => {
                if (el !== target) {
                    cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({
                        text: el.value,
                        isChecked: !isChecked,
                        userTriggered: false,
                    }, userTriggeredOnInput));
                }
            });
        }
    }
    function cbWithDedup(target, v) {
        const lastInputValue = lastInputValueMap.get(target);
        if (!lastInputValue ||
            lastInputValue.text !== v.text ||
            lastInputValue.isChecked !== v.isChecked) {
            lastInputValueMap.set(target, v);
            const id = mirror.getId(target);
            inputCb(Object.assign(Object.assign({}, v), { id }));
        }
    }
    const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];
    const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));
    const propertyDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
    const hookProperties = [
        [HTMLInputElement.prototype, 'value'],
        [HTMLInputElement.prototype, 'checked'],
        [HTMLSelectElement.prototype, 'value'],
        [HTMLTextAreaElement.prototype, 'value'],
        [HTMLSelectElement.prototype, 'selectedIndex'],
        [HTMLOptionElement.prototype, 'selected'],
    ];
    if (propertyDescriptor && propertyDescriptor.set) {
        handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {
            set() {
                callbackWrapper(eventHandler)({ target: this });
            },
        })));
    }
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function getNestedCSSRulePositions(rule) {
    const positions = [];
    function recurse(childRule, pos) {
        if ((hasNestedCSSRule('CSSGroupingRule') &&
            childRule.parentRule instanceof CSSGroupingRule) ||
            (hasNestedCSSRule('CSSMediaRule') &&
                childRule.parentRule instanceof CSSMediaRule) ||
            (hasNestedCSSRule('CSSSupportsRule') &&
                childRule.parentRule instanceof CSSSupportsRule) ||
            (hasNestedCSSRule('CSSConditionRule') &&
                childRule.parentRule instanceof CSSConditionRule)) {
            const rules = Array.from(childRule.parentRule.cssRules);
            const index = rules.indexOf(childRule);
            pos.unshift(index);
        }
        else {
            const rules = Array.from(childRule.parentStyleSheet.cssRules);
            const index = rules.indexOf(childRule);
            pos.unshift(index);
        }
        return pos;
    }
    return recurse(rule, positions);
}
function initStyleSheetObserver({ styleSheetRuleCb, mirror }, { win }) {
    if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {
        return () => { };
    }
    const insertRule = win.CSSStyleSheet.prototype.insertRule;
    win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            const [rule, index] = argumentsList;
            const id = mirror.getId(thisArg.ownerNode);
            if (id !== -1) {
                styleSheetRuleCb({
                    id,
                    adds: [{ rule, index }],
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const deleteRule = win.CSSStyleSheet.prototype.deleteRule;
    win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            const [index] = argumentsList;
            const id = mirror.getId(thisArg.ownerNode);
            if (id !== -1) {
                styleSheetRuleCb({
                    id,
                    removes: [{ index }],
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const supportedNestedCSSRuleTypes = {};
    if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {
        supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;
    }
    else {
        if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {
            supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;
        }
        if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {
            supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;
        }
        if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {
            supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;
        }
    }
    const unmodifiedFunctions = {};
    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {
        unmodifiedFunctions[typeKey] = {
            insertRule: type.prototype.insertRule,
            deleteRule: type.prototype.deleteRule,
        };
        type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {
            apply: callbackWrapper((target, thisArg, argumentsList) => {
                const [rule, index] = argumentsList;
                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);
                if (id !== -1) {
                    styleSheetRuleCb({
                        id,
                        adds: [
                            {
                                rule,
                                index: [
                                    ...getNestedCSSRulePositions(thisArg),
                                    index || 0,
                                ],
                            },
                        ],
                    });
                }
                return target.apply(thisArg, argumentsList);
            }),
        });
        type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {
            apply: callbackWrapper((target, thisArg, argumentsList) => {
                const [index] = argumentsList;
                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);
                if (id !== -1) {
                    styleSheetRuleCb({
                        id,
                        removes: [
                            { index: [...getNestedCSSRulePositions(thisArg), index] },
                        ],
                    });
                }
                return target.apply(thisArg, argumentsList);
            }),
        });
    });
    return callbackWrapper(() => {
        win.CSSStyleSheet.prototype.insertRule = insertRule;
        win.CSSStyleSheet.prototype.deleteRule = deleteRule;
        Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {
            type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;
            type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;
        });
    });
}
function initStyleDeclarationObserver({ styleDeclarationCb, mirror }, { win }) {
    const setProperty = win.CSSStyleDeclaration.prototype.setProperty;
    win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            var _a, _b;
            const [property, value, priority] = argumentsList;
            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);
            if (id !== -1) {
                styleDeclarationCb({
                    id,
                    set: {
                        property,
                        value,
                        priority,
                    },
                    index: getNestedCSSRulePositions(thisArg.parentRule),
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;
    win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            var _a, _b;
            const [property] = argumentsList;
            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);
            if (id !== -1) {
                styleDeclarationCb({
                    id,
                    remove: {
                        property,
                    },
                    index: getNestedCSSRulePositions(thisArg.parentRule),
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    return callbackWrapper(() => {
        win.CSSStyleDeclaration.prototype.setProperty = setProperty;
        win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;
    });
}
function initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, }) {
    const handler = (type) => throttle(callbackWrapper((event) => {
        const target = getEventTarget(event);
        if (!target ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        const { currentTime, volume, muted } = target;
        mediaInteractionCb({
            type,
            id: mirror.getId(target),
            currentTime,
            volume,
            muted,
        });
    }), sampling.media || 500);
    const handlers = [
        on('play', handler(0)),
        on('pause', handler(1)),
        on('seeked', handler(2)),
        on('volumechange', handler(3)),
    ];
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initFontObserver({ fontCb, doc }) {
    const win = doc.defaultView;
    if (!win) {
        return () => { };
    }
    const handlers = [];
    const fontMap = new WeakMap();
    const originalFontFace = win.FontFace;
    win.FontFace = function FontFace(family, source, descriptors) {
        const fontFace = new originalFontFace(family, source, descriptors);
        fontMap.set(fontFace, {
            family,
            buffer: typeof source !== 'string',
            descriptors,
            fontSource: typeof source === 'string'
                ? source
                :
                    JSON.stringify(Array.from(new Uint8Array(source))),
        });
        return fontFace;
    };
    const restoreHandler = patch(doc.fonts, 'add', function (original) {
        return function (fontFace) {
            setTimeout(() => {
                const p = fontMap.get(fontFace);
                if (p) {
                    fontCb(p);
                    fontMap.delete(fontFace);
                }
            }, 0);
            return original.apply(this, [fontFace]);
        };
    });
    handlers.push(() => {
        win.FontFace = originalFontFace;
    });
    handlers.push(restoreHandler);
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function mergeHooks(o, hooks) {
    const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, } = o;
    o.mutationCb = (...p) => {
        if (hooks.mutation) {
            hooks.mutation(...p);
        }
        mutationCb(...p);
    };
    o.mousemoveCb = (...p) => {
        if (hooks.mousemove) {
            hooks.mousemove(...p);
        }
        mousemoveCb(...p);
    };
    o.mouseInteractionCb = (...p) => {
        if (hooks.mouseInteraction) {
            hooks.mouseInteraction(...p);
        }
        mouseInteractionCb(...p);
    };
    o.scrollCb = (...p) => {
        if (hooks.scroll) {
            hooks.scroll(...p);
        }
        scrollCb(...p);
    };
    o.viewportResizeCb = (...p) => {
        if (hooks.viewportResize) {
            hooks.viewportResize(...p);
        }
        viewportResizeCb(...p);
    };
    o.inputCb = (...p) => {
        if (hooks.input) {
            hooks.input(...p);
        }
        inputCb(...p);
    };
    o.mediaInteractionCb = (...p) => {
        if (hooks.mediaInteaction) {
            hooks.mediaInteaction(...p);
        }
        mediaInteractionCb(...p);
    };
    o.styleSheetRuleCb = (...p) => {
        if (hooks.styleSheetRule) {
            hooks.styleSheetRule(...p);
        }
        styleSheetRuleCb(...p);
    };
    o.styleDeclarationCb = (...p) => {
        if (hooks.styleDeclaration) {
            hooks.styleDeclaration(...p);
        }
        styleDeclarationCb(...p);
    };
    o.canvasMutationCb = (...p) => {
        if (hooks.canvasMutation) {
            hooks.canvasMutation(...p);
        }
        canvasMutationCb(...p);
    };
    o.fontCb = (...p) => {
        if (hooks.font) {
            hooks.font(...p);
        }
        fontCb(...p);
    };
}
function initObservers(o, hooks = {}) {
    const currentWindow = o.doc.defaultView;
    if (!currentWindow) {
        return () => { };
    }
    mergeHooks(o, hooks);
    const mutationObserver = initMutationObserver(o, o.doc);
    const mousemoveHandler = initMoveObserver(o);
    const mouseInteractionHandler = initMouseInteractionObserver(o);
    const scrollHandler = initScrollObserver(o);
    const viewportResizeHandler = initViewportResizeObserver(o);
    const inputHandler = initInputObserver(o);
    const mediaInteractionHandler = initMediaInteractionObserver(o);
    const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });
    const styleDeclarationObserver = initStyleDeclarationObserver(o, {
        win: currentWindow,
    });
    const fontObserver = o.collectFonts ? initFontObserver(o) : () => { };
    const pluginHandlers = [];
    for (const plugin of o.plugins) {
        pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));
    }
    return callbackWrapper(() => {
        mutationBuffers.forEach((b) => b.reset());
        mutationObserver.disconnect();
        mousemoveHandler();
        mouseInteractionHandler();
        scrollHandler();
        viewportResizeHandler();
        inputHandler();
        mediaInteractionHandler();
        try {
            styleSheetObserver();
            styleDeclarationObserver();
        }
        catch (e) {
        }
        fontObserver();
        pluginHandlers.forEach((h) => h());
    });
}
function hasNestedCSSRule(prop) {
    return typeof window[prop] !== 'undefined';
}
function canMonkeyPatchNestedCSSRule(prop) {
    return Boolean(typeof window[prop] !== 'undefined' &&
        window[prop].prototype &&
        'insertRule' in window[prop].prototype &&
        'deleteRule' in window[prop].prototype);
}

class IframeManager {
    constructor(options) {
        this.iframes = new WeakMap();
        this.mutationCb = options.mutationCb;
    }
    addIframe(iframeEl) {
        this.iframes.set(iframeEl, true);
    }
    addLoadListener(cb) {
        this.loadListener = cb;
    }
    attachIframe(iframeEl, childSn) {
        var _a;
        this.mutationCb({
            adds: [
                {
                    parentId: iframeEl.__sn.id,
                    nextId: null,
                    node: childSn,
                },
            ],
            removes: [],
            texts: [],
            attributes: [],
            isAttachIframe: true,
        });
        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);
    }
}

class ShadowDomManager {
    constructor(options) {
        this.restorePatches = [];
        this.mutationCb = options.mutationCb;
        this.scrollCb = options.scrollCb;
        this.bypassOptions = options.bypassOptions;
        this.mirror = options.mirror;
        const manager = this;
        this.restorePatches.push(patch(HTMLElement.prototype, 'attachShadow', function (original) {
            return function () {
                const shadowRoot = original.apply(this, arguments);
                if (this.shadowRoot)
                    manager.addShadowRoot(this.shadowRoot, this.ownerDocument);
                return shadowRoot;
            };
        }));
    }
    addShadowRoot(shadowRoot, doc) {
        initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);
        initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }));
    }
    observeAttachShadow(iframeElement) {
        if (iframeElement.contentWindow) {
            const manager = this;
            this.restorePatches.push(patch(iframeElement.contentWindow.HTMLElement.prototype, 'attachShadow', function (original) {
                return function () {
                    const shadowRoot = original.apply(this, arguments);
                    if (this.shadowRoot)
                        manager.addShadowRoot(this.shadowRoot, iframeElement.contentDocument);
                    return shadowRoot;
                };
            }));
        }
    }
    reset() {
        this.restorePatches.forEach((restorePatch) => restorePatch());
    }
}

/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

function initCanvas2DMutationObserver(cb, win, blockClass, unblockSelector, blockSelector, mirror) {
    const handlers = [];
    const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);
    for (const prop of props2D) {
        try {
            if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {
                continue;
            }
            const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {
                return function (...args) {
                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {
                        setTimeout(() => {
                            const recordArgs = [...args];
                            if (prop === 'drawImage') {
                                if (recordArgs[0] &&
                                    recordArgs[0] instanceof HTMLCanvasElement) {
                                    const canvas = recordArgs[0];
                                    const ctx = canvas.getContext('2d');
                                    let imgd = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, canvas.width, canvas.height);
                                    let pix = imgd === null || imgd === void 0 ? void 0 : imgd.data;
                                    recordArgs[0] = JSON.stringify(pix);
                                }
                            }
                            cb(this.canvas, {
                                type: CanvasContext['2D'],
                                property: prop,
                                args: recordArgs,
                            });
                        }, 0);
                    }
                    return original.apply(this, args);
                };
            });
            handlers.push(restoreHandler);
        }
        catch (_a) {
            const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {
                set(v) {
                    cb(this.canvas, {
                        type: CanvasContext['2D'],
                        property: prop,
                        args: [v],
                        setter: true,
                    });
                },
            });
            handlers.push(hookHandler);
        }
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

function initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector) {
    const handlers = [];
    try {
        const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {
            return function (contextType, ...args) {
                if (!isBlocked(this, blockClass, blockSelector, unblockSelector)) {
                    if (!('__context' in this))
                        this.__context = contextType;
                }
                return original.apply(this, [contextType, ...args]);
            };
        });
        handlers.push(restoreHandler);
    }
    catch (_a) {
        console.error('failed to patch HTMLCanvasElement.prototype.getContext');
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

/*
 * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Use a lookup table to find the index.
var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
for (var i = 0; i < chars.length; i++) {
    lookup[chars.charCodeAt(i)] = i;
}
var encode = function (arraybuffer) {
    var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';
    for (i = 0; i < len; i += 3) {
        base64 += chars[bytes[i] >> 2];
        base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
        base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
        base64 += chars[bytes[i + 2] & 63];
    }
    if (len % 3 === 2) {
        base64 = base64.substring(0, base64.length - 1) + '=';
    }
    else if (len % 3 === 1) {
        base64 = base64.substring(0, base64.length - 2) + '==';
    }
    return base64;
};

const webGLVarMap = new Map();
function variableListFor(ctx, ctor) {
    let contextMap = webGLVarMap.get(ctx);
    if (!contextMap) {
        contextMap = new Map();
        webGLVarMap.set(ctx, contextMap);
    }
    if (!contextMap.has(ctor)) {
        contextMap.set(ctor, []);
    }
    return contextMap.get(ctor);
}
const saveWebGLVar = (value, win, ctx) => {
    if (!value ||
        !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))
        return;
    const name = value.constructor.name;
    const list = variableListFor(ctx, name);
    let index = list.indexOf(value);
    if (index === -1) {
        index = list.length;
        list.push(value);
    }
    return index;
};
function serializeArg(value, win, ctx) {
    if (value instanceof Array) {
        return value.map((arg) => serializeArg(arg, win, ctx));
    }
    else if (value === null) {
        return value;
    }
    else if (value instanceof Float32Array ||
        value instanceof Float64Array ||
        value instanceof Int32Array ||
        value instanceof Uint32Array ||
        value instanceof Uint8Array ||
        value instanceof Uint16Array ||
        value instanceof Int16Array ||
        value instanceof Int8Array ||
        value instanceof Uint8ClampedArray) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [Object.values(value)],
        };
    }
    else if (value instanceof ArrayBuffer) {
        const name = value.constructor.name;
        const base64 = encode(value);
        return {
            rr_type: name,
            base64,
        };
    }
    else if (value instanceof DataView) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [
                serializeArg(value.buffer, win, ctx),
                value.byteOffset,
                value.byteLength,
            ],
        };
    }
    else if (value instanceof HTMLImageElement) {
        const name = value.constructor.name;
        const { src } = value;
        return {
            rr_type: name,
            src,
        };
    }
    else if (value instanceof ImageData) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [serializeArg(value.data, win, ctx), value.width, value.height],
        };
    }
    else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {
        const name = value.constructor.name;
        const index = saveWebGLVar(value, win, ctx);
        return {
            rr_type: name,
            index: index,
        };
    }
    return value;
}
const serializeArgs = (args, win, ctx) => {
    return [...args].map((arg) => serializeArg(arg, win, ctx));
};
const isInstanceOfWebGLObject = (value, win) => {
    const webGLConstructorNames = [
        'WebGLActiveInfo',
        'WebGLBuffer',
        'WebGLFramebuffer',
        'WebGLProgram',
        'WebGLRenderbuffer',
        'WebGLShader',
        'WebGLShaderPrecisionFormat',
        'WebGLTexture',
        'WebGLUniformLocation',
        'WebGLVertexArrayObject',
        'WebGLVertexArrayObjectOES',
    ];
    const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');
    return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));
};

function patchGLPrototype(prototype, type, cb, blockClass, unblockSelector, blockSelector, mirror, win) {
    const handlers = [];
    const props = Object.getOwnPropertyNames(prototype);
    for (const prop of props) {
        try {
            if (typeof prototype[prop] !== 'function') {
                continue;
            }
            const restoreHandler = patch(prototype, prop, function (original) {
                return function (...args) {
                    const result = original.apply(this, args);
                    saveWebGLVar(result, win, prototype);
                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {
                        const id = mirror.getId(this.canvas);
                        const recordArgs = serializeArgs([...args], win, prototype);
                        const mutation = {
                            type,
                            property: prop,
                            args: recordArgs,
                        };
                        cb(this.canvas, mutation);
                    }
                    return result;
                };
            });
            handlers.push(restoreHandler);
        }
        catch (_a) {
            const hookHandler = hookSetter(prototype, prop, {
                set(v) {
                    cb(this.canvas, {
                        type,
                        property: prop,
                        args: [v],
                        setter: true,
                    });
                },
            });
            handlers.push(hookHandler);
        }
    }
    return handlers;
}
function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {
    const handlers = [];
    handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win));
    if (typeof win.WebGL2RenderingContext !== 'undefined') {
        handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win));
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

class CanvasManager {
    reset() {
        this.pendingCanvasMutations.clear();
        this.resetObservers && this.resetObservers();
    }
    freeze() {
        this.frozen = true;
    }
    unfreeze() {
        this.frozen = false;
    }
    lock() {
        this.locked = true;
    }
    unlock() {
        this.locked = false;
    }
    constructor(options) {
        this.pendingCanvasMutations = new Map();
        this.rafStamps = { latestId: 0, invokeId: null };
        this.frozen = false;
        this.locked = false;
        this.processMutation = function (target, mutation) {
            const newFrame = this.rafStamps.invokeId &&
                this.rafStamps.latestId !== this.rafStamps.invokeId;
            if (newFrame || !this.rafStamps.invokeId)
                this.rafStamps.invokeId = this.rafStamps.latestId;
            if (!this.pendingCanvasMutations.has(target)) {
                this.pendingCanvasMutations.set(target, []);
            }
            this.pendingCanvasMutations.get(target).push(mutation);
        };
        this.mutationCb = options.mutationCb;
        this.mirror = options.mirror;
        if (options.recordCanvas === true)
            this.initCanvasMutationObserver(options.win, options.blockClass, options.blockSelector, options.unblockSelector);
    }
    initCanvasMutationObserver(win, blockClass, unblockSelector, blockSelector) {
        this.startRAFTimestamping();
        this.startPendingCanvasMutationFlusher();
        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector);
        const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);
        const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);
        this.resetObservers = () => {
            canvasContextReset();
            canvas2DReset();
            canvasWebGL1and2Reset();
        };
    }
    startPendingCanvasMutationFlusher() {
        requestAnimationFrame(() => this.flushPendingCanvasMutations());
    }
    startRAFTimestamping() {
        const setLatestRAFTimestamp = (timestamp) => {
            this.rafStamps.latestId = timestamp;
            requestAnimationFrame(setLatestRAFTimestamp);
        };
        requestAnimationFrame(setLatestRAFTimestamp);
    }
    flushPendingCanvasMutations() {
        this.pendingCanvasMutations.forEach((values, canvas) => {
            const id = this.mirror.getId(canvas);
            this.flushPendingCanvasMutationFor(canvas, id);
        });
        requestAnimationFrame(() => this.flushPendingCanvasMutations());
    }
    flushPendingCanvasMutationFor(canvas, id) {
        if (this.frozen || this.locked) {
            return;
        }
        const valuesWithType = this.pendingCanvasMutations.get(canvas);
        if (!valuesWithType || id === -1)
            return;
        const values = valuesWithType.map((value) => {
            const rest = __rest(value, ["type"]);
            return rest;
        });
        const { type } = valuesWithType[0];
        this.mutationCb({ id, type, commands: values });
        this.pendingCanvasMutations.delete(canvas);
    }
}

function wrapEvent(e) {
    return Object.assign(Object.assign({}, e), { timestamp: Date.now() });
}
let wrappedEmit;
let takeFullSnapshot;
const mirror = createMirror();
function record(options = {}) {
    const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, maskInputSelector = null, unmaskTextSelector = null, unmaskInputSelector = null, inlineStylesheet = true, maskAllText = false, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, mousemoveWait, recordCanvas = false, userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, onMutation, } = options;
    if (!emit) {
        throw new Error('emit function is required');
    }
    if (mousemoveWait !== undefined && sampling.mousemove === undefined) {
        sampling.mousemove = mousemoveWait;
    }
    const maskInputOptions = maskAllInputs === true
        ? {
            color: true,
            date: true,
            'datetime-local': true,
            email: true,
            month: true,
            number: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true,
            textarea: true,
            select: true,
            radio: true,
            checkbox: true,
        }
        : _maskInputOptions !== undefined
            ? _maskInputOptions
            : {};
    const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'
        ? {
            script: true,
            comment: true,
            headFavicon: true,
            headWhitespace: true,
            headMetaSocial: true,
            headMetaRobots: true,
            headMetaHttpEquiv: true,
            headMetaVerification: true,
            headMetaAuthorship: _slimDOMOptions === 'all',
            headMetaDescKeywords: _slimDOMOptions === 'all',
        }
        : _slimDOMOptions
            ? _slimDOMOptions
            : {};
    polyfill();
    let lastFullSnapshotEvent;
    let incrementalSnapshotCount = 0;
    const eventProcessor = (e) => {
        for (const plugin of plugins || []) {
            if (plugin.eventProcessor) {
                e = plugin.eventProcessor(e);
            }
        }
        if (packFn) {
            e = packFn(e);
        }
        return e;
    };
    wrappedEmit = (e, isCheckout) => {
        var _a;
        if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&
            e.type !== EventType.FullSnapshot &&
            !(e.type === EventType.IncrementalSnapshot &&
                e.data.source === IncrementalSource.Mutation)) {
            mutationBuffers.forEach((buf) => buf.unfreeze());
        }
        emit(eventProcessor(e), isCheckout);
        if (e.type === EventType.FullSnapshot) {
            lastFullSnapshotEvent = e;
            incrementalSnapshotCount = 0;
        }
        else if (e.type === EventType.IncrementalSnapshot) {
            if (e.data.source === IncrementalSource.Mutation &&
                e.data.isAttachIframe) {
                return;
            }
            incrementalSnapshotCount++;
            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
            const exceedTime = checkoutEveryNms &&
                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
            if (exceedCount || exceedTime) {
                takeFullSnapshot(true);
            }
        }
    };
    const wrappedMutationEmit = (m) => {
        wrappedEmit(wrapEvent({
            type: EventType.IncrementalSnapshot,
            data: Object.assign({ source: IncrementalSource.Mutation }, m),
        }));
    };
    const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({
        type: EventType.IncrementalSnapshot,
        data: Object.assign({ source: IncrementalSource.Scroll }, p),
    }));
    const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({
        type: EventType.IncrementalSnapshot,
        data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),
    }));
    const iframeManager = new IframeManager({
        mutationCb: wrappedMutationEmit,
    });
    const canvasManager = new CanvasManager({
        recordCanvas,
        mutationCb: wrappedCanvasMutationEmit,
        win: window,
        blockClass,
        blockSelector,
        unblockSelector,
        mirror,
    });
    const shadowDomManager = new ShadowDomManager({
        mutationCb: wrappedMutationEmit,
        scrollCb: wrappedScrollEmit,
        bypassOptions: {
            onMutation,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            maskInputSelector,
            unmaskInputSelector,
            inlineStylesheet,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            recordCanvas,
            inlineImages,
            sampling,
            slimDOMOptions,
            iframeManager,
            canvasManager,
        },
        mirror,
    });
    takeFullSnapshot = (isCheckout = false) => {
        var _a, _b, _c, _d;
        wrappedEmit(wrapEvent({
            type: EventType.Meta,
            data: {
                href: window.location.href,
                width: getWindowWidth(),
                height: getWindowHeight(),
            },
        }), isCheckout);
        mutationBuffers.forEach((buf) => buf.lock());
        const [node, idNodeMap] = snapshot(document, {
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            maskInputSelector,
            unmaskInputSelector,
            inlineStylesheet,
            maskAllText,
            maskAllInputs: maskInputOptions,
            maskTextFn,
            slimDOM: slimDOMOptions,
            recordCanvas,
            inlineImages,
            onSerialize: (n) => {
                if (isIframeINode(n)) {
                    iframeManager.addIframe(n);
                }
                if (hasShadowRoot(n)) {
                    shadowDomManager.addShadowRoot(n.shadowRoot, document);
                }
            },
            onIframeLoad: (iframe, childSn) => {
                iframeManager.attachIframe(iframe, childSn);
                shadowDomManager.observeAttachShadow(iframe);
            },
            keepIframeSrcFn,
        });
        if (!node) {
            return console.warn('Failed to snapshot the document');
        }
        mirror.map = idNodeMap;
        wrappedEmit(wrapEvent({
            type: EventType.FullSnapshot,
            data: {
                node,
                initialOffset: {
                    left: window.pageXOffset !== undefined
                        ? window.pageXOffset
                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollLeft) ||
                            ((_b = (_a = document === null || document === void 0 ? void 0 : document.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||
                            (document === null || document === void 0 ? void 0 : document.body.scrollLeft) ||
                            0,
                    top: window.pageYOffset !== undefined
                        ? window.pageYOffset
                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollTop) ||
                            ((_d = (_c = document === null || document === void 0 ? void 0 : document.body) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.scrollTop) ||
                            (document === null || document === void 0 ? void 0 : document.body.scrollTop) ||
                            0,
                },
            },
        }));
        mutationBuffers.forEach((buf) => buf.unlock());
    };
    try {
        const handlers = [];
        handlers.push(on('DOMContentLoaded', () => {
            wrappedEmit(wrapEvent({
                type: EventType.DomContentLoaded,
                data: {},
            }));
        }));
        const observe = (doc) => {
            var _a;
            return callbackWrapper(initObservers)({
                onMutation,
                mutationCb: wrappedMutationEmit,
                mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: {
                        source,
                        positions,
                    },
                })),
                mouseInteractionCb: (d) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),
                })),
                scrollCb: wrappedScrollEmit,
                viewportResizeCb: (d) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.ViewportResize }, d),
                })),
                inputCb: (v) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.Input }, v),
                })),
                mediaInteractionCb: (p) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),
                })),
                styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),
                })),
                styleDeclarationCb: (r) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),
                })),
                canvasMutationCb: wrappedCanvasMutationEmit,
                fontCb: (p) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.Font }, p),
                })),
                blockClass,
                ignoreClass,
                ignoreSelector,
                maskTextClass,
                maskTextSelector,
                unmaskTextSelector,
                maskInputSelector,
                unmaskInputSelector,
                maskInputOptions,
                inlineStylesheet,
                sampling,
                recordCanvas,
                inlineImages,
                userTriggeredOnInput,
                collectFonts,
                doc,
                maskAllText,
                maskInputFn,
                maskTextFn,
                blockSelector,
                unblockSelector,
                slimDOMOptions,
                mirror,
                iframeManager,
                shadowDomManager,
                canvasManager,
                plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({
                    observer: p.observer,
                    options: p.options,
                    callback: (payload) => wrappedEmit(wrapEvent({
                        type: EventType.Plugin,
                        data: {
                            plugin: p.name,
                            payload,
                        },
                    })),
                }))) || [],
            }, hooks);
        };
        iframeManager.addLoadListener((iframeEl) => {
            try {
                handlers.push(observe(iframeEl.contentDocument));
            }
            catch (error) {
                console.warn(error);
            }
        });
        const init = () => {
            takeFullSnapshot();
            handlers.push(observe(document));
        };
        if (document.readyState === 'interactive' ||
            document.readyState === 'complete') {
            init();
        }
        else {
            handlers.push(on('load', () => {
                wrappedEmit(wrapEvent({
                    type: EventType.Load,
                    data: {},
                }));
                init();
            }, window));
        }
        return () => {
            handlers.forEach((h) => h());
        };
    }
    catch (error) {
        console.warn(error);
    }
}
record.addCustomEvent = (tag, payload) => {
    if (!wrappedEmit) {
        throw new Error('please add custom event after start recording');
    }
    wrappedEmit(wrapEvent({
        type: EventType.Custom,
        data: {
            tag,
            payload,
        },
    }));
};
record.freezePage = () => {
    mutationBuffers.forEach((buf) => buf.freeze());
};
record.takeFullSnapshot = (isCheckout) => {
    if (!takeFullSnapshot) {
        throw new Error('please take full snapshot after start recording');
    }
    takeFullSnapshot(isCheckout);
};
record.mirror = mirror;

const NAVIGATION_ENTRY_KEYS = [
  'name',
  'type',
  'startTime',
  'transferSize',
  'duration',
];

function isNavigationEntryEqual(a) {
  return function (b) {
    return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]);
  };
}

/**
 * There are some difficulties diagnosing why there are duplicate navigation
 * entries. We've witnessed several intermittent results:
 * - duplicate entries have duration = 0
 * - duplicate entries are the same object reference
 * - none of the above
 *
 * Compare the values of several keys to determine if the entries are duplicates or not.
 */
// TODO (high-prio): Figure out wth is returned here
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function dedupePerformanceEntries(
  currentList,
  newList,
) {
  // Partition `currentList` into 3 different lists based on entryType
  const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce(
    (acc, entry) => {
      if (entry.entryType === 'navigation') {
        acc[0].push(entry );
      } else if (entry.entryType === 'largest-contentful-paint') {
        acc[1].push(entry );
      } else {
        acc[2].push(entry);
      }
      return acc;
    },
    [[], [], []],
  );

  const newEntries = [];
  const newNavigationEntries = [];
  let newLcpEntry = existingLcpEntries.length
    ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted
    : undefined;

  newList.forEach(entry => {
    if (entry.entryType === 'largest-contentful-paint') {
      // We want the latest LCP event only
      if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) {
        newLcpEntry = entry;
      }
      return;
    }

    if (entry.entryType === 'navigation') {
      const navigationEntry = entry ;

      // Check if the navigation entry is contained in currentList or newList
      if (
        // Ignore any navigation entries with duration 0, as they are likely duplicates
        entry.duration > 0 &&
        // Ensure new entry does not already exist in existing entries
        !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) &&
        // Ensure new entry does not already exist in new list of navigation entries
        !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry))
      ) {
        newNavigationEntries.push(navigationEntry);
      }

      // Otherwise this navigation entry is considered a duplicate and is thrown away
      return;
    }

    newEntries.push(entry);
  });

  // Re-combine and sort by startTime
  return [
    ...(newLcpEntry ? [newLcpEntry] : []),
    ...existingNavigationEntries,
    ...existingEntries,
    ...newEntries,
    ...newNavigationEntries,
  ].sort((a, b) => a.startTime - b.startTime);
}

/**
 * Sets up a PerformanceObserver to listen to all performance entry types.
 */
function setupPerformanceObserver(replay) {
  const performanceObserverHandler = (list) => {
    // For whatever reason the observer was returning duplicate navigation
    // entries (the other entry types were not duplicated).
    const newPerformanceEntries = dedupePerformanceEntries(
      replay.performanceEvents,
      list.getEntries() ,
    );
    replay.performanceEvents = newPerformanceEntries;
  };

  const performanceObserver = new PerformanceObserver(performanceObserverHandler);

  [
    'element',
    'event',
    'first-input',
    'largest-contentful-paint',
    'layout-shift',
    'longtask',
    'navigation',
    'paint',
    'resource',
  ].forEach(type => {
    try {
      performanceObserver.observe({
        type,
        buffered: true,
      });
    } catch (e) {
      // This can throw if an entry type is not supported in the browser.
      // Ignore these errors.
    }
  });

  return performanceObserver;
}

const r = `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},p=(t,e,a)=>{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},A=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},E=(t,i,n)=>{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f<t.sym_next);p(t,256,i)},R=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},U=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{p(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(p(t,n,t.bl_tree),o--),p(t,16,t.bl_tree),g(t,o-3,2)):o<=10?(p(t,17,t.bl_tree),g(t,o-3,3)):(p(t,18,t.bl_tree),g(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let S=!1;const D=(t,e,a,i)=>{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s<i;s++)g(t,t.bl_tree[2*n[s]+1],3);U(t,t.dyn_ltree,e-1),U(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),E(t,t.dyn_ltree,t.dyn_dtree)),y(t),i&&x(t)},O={_tr_init:t=>{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<<e[m];t++)l[w++]=m;for(l[w-1]=m,b=0,m=0;m<16;m++)for(d[m]=b,t=0;t<1<<a[m];t++)o[b++]=m;for(b>>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<<a[m]-7;t++)o[256+b++]=m;for(n=0;n<=15;n++)g[n]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(v(s,287,g),t=0;t<30;t++)r[2*t+1]=5,r[2*t]=k(t,5);f=new _(s,e,257,286,15),c=new _(r,a,0,30,15),u=new _(new Array(0),i,0,19,7)})(),S=!0),t.l_desc=new w(t.dyn_ltree,f),t.d_desc=new w(t.dyn_dtree,c),t.bl_desc=new w(t.bl_tree,u),t.bi_buf=0,t.bi_valid=0,y(t)},_tr_stored_block:D,_tr_flush_block:T,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const ct=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=258-(f-s),s=f-258,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==X||e===P||a!==i+t.strm.avail_in))break;r=e===X&&a===i+t.strm.avail_in?1:0,H(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==P&&e!==X&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a),t.match_length<=5&&(t.strategy===et||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,Zt(t)};var St={deflateInit:(t,e)=>Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=258-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ft=!1}const Lt=new Uint8Array(256);for(let t=0;t<256;t++)Lt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Lt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Bt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=16209;break t}k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];a:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=16209;break t}if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const te=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ee=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ae=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ne=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=15;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=te,D=ee,u=257):(A=ae,D=ie,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ue={inflateReset:ve,inflateReset2:ye,inflateResetKeep:ke,inflateInit:t=>xe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:16191,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==we){t.msg="unknown compression method",a.mode=me;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=me;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=me;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=be(h),h=0,d=0,a.mode=16190;case 16190:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,de;t.adler=a.check=1,a.mode=16191;case 16191:if(e===re||e===oe)break t;case 16192:if(a.last){h>>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(0==(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:be(h))!==a.check){t.msg="incorrect data check",a.mode=me;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=me;break}h=0,d=0}a.mode=16208;case 16208:x=he;break t;case me:x=fe;break t;case 16210:return ce;default:return _e}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<me&&(a.mode<16206||e!==se))&&Ze(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(16191===a.mode?128:0)+(16199===a.mode||16194===a.mode?256:0),(0===_&&0===f||e===se)&&x===le&&(x=ue),x},inflateEnd:t=>{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;

function e(){const e=new Blob([r]);return URL.createObjectURL(e)}

/**
 * A basic event buffer that does not do any compression.
 * Used as fallback if the compression worker cannot be loaded or is disabled.
 */
class EventBufferArray  {
  /** All the events that are buffered to be sent. */

   constructor() {
    this.events = [];
  }

  /** @inheritdoc */
   get hasEvents() {
    return this.events.length > 0;
  }

  /** @inheritdoc */
   destroy() {
    this.events = [];
  }

  /** @inheritdoc */
   async addEvent(event, isCheckout) {
    if (isCheckout) {
      this.events = [event];
      return;
    }

    this.events.push(event);
    return;
  }

  /** @inheritdoc */
   finish() {
    return new Promise(resolve => {
      // Make a copy of the events array reference and immediately clear the
      // events member so that we do not lose new events while uploading
      // attachment.
      const eventsRet = this.events;
      this.events = [];
      resolve(JSON.stringify(eventsRet));
    });
  }
}

/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
class WorkerHandler {

   constructor(worker) {
    this._worker = worker;
    this._id = 0;
  }

  /**
   * Ensure the worker is ready (or not).
   * This will either resolve when the worker is ready, or reject if an error occured.
   */
   ensureReady() {
    // Ensure we only check once
    if (this._ensureReadyPromise) {
      return this._ensureReadyPromise;
    }

    this._ensureReadyPromise = new Promise((resolve, reject) => {
      this._worker.addEventListener(
        'message',
        ({ data }) => {
          if ((data ).success) {
            resolve();
          } else {
            reject();
          }
        },
        { once: true },
      );

      this._worker.addEventListener(
        'error',
        error => {
          reject(error);
        },
        { once: true },
      );
    });

    return this._ensureReadyPromise;
  }

  /**
   * Destroy the worker.
   */
   destroy() {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Destroying compression worker');
    this._worker.terminate();
  }

  /**
   * Post message to worker and wait for response before resolving promise.
   */
   postMessage(method, arg) {
    const id = this._getAndIncrementId();

    return new Promise((resolve, reject) => {
      const listener = ({ data }) => {
        const response = data ;
        if (response.method !== method) {
          return;
        }

        // There can be multiple listeners for a single method, the id ensures
        // that the response matches the caller.
        if (response.id !== id) {
          return;
        }

        // At this point, we'll always want to remove listener regardless of result status
        this._worker.removeEventListener('message', listener);

        if (!response.success) {
          // TODO: Do some error handling, not sure what
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay]', response.response);

          reject(new Error('Error in compression worker'));
          return;
        }

        resolve(response.response );
      };

      // Note: we can't use `once` option because it's possible it needs to
      // listen to multiple messages
      this._worker.addEventListener('message', listener);
      this._worker.postMessage({ id, method, arg });
    });
  }

  /** Get the current ID and increment it for the next call. */
   _getAndIncrementId() {
    return this._id++;
  }
}

/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
class EventBufferCompressionWorker  {
  /** @inheritdoc */

   constructor(worker) {
    this._worker = new WorkerHandler(worker);
    this.hasEvents = false;
  }

  /**
   * Ensure the worker is ready (or not).
   * This will either resolve when the worker is ready, or reject if an error occured.
   */
   ensureReady() {
    return this._worker.ensureReady();
  }

  /**
   * Destroy the event buffer.
   */
   destroy() {
    this._worker.destroy();
  }

  /**
   * Add an event to the event buffer.
   *
   * Returns true if event was successfuly received and processed by worker.
   */
   async addEvent(event, isCheckout) {
    this.hasEvents = true;

    if (isCheckout) {
      // This event is a checkout, make sure worker buffer is cleared before
      // proceeding.
      await this._clear();
    }

    return this._sendEventToWorker(event);
  }

  /**
   * Finish the event buffer and return the compressed data.
   */
   finish() {
    return this._finishRequest();
  }

  /**
   * Send the event to the worker.
   */
   _sendEventToWorker(event) {
    return this._worker.postMessage('addEvent', JSON.stringify(event));
  }

  /**
   * Finish the request and return the compressed data from the worker.
   */
   async _finishRequest() {
    const response = await this._worker.postMessage('finish');

    this.hasEvents = false;

    return response;
  }

  /** Clear any pending events from the worker. */
   _clear() {
    return this._worker.postMessage('clear');
  }
}

/**
 * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
 * This can happen e.g. if the worker cannot be loaded.
 * Exported only for testing.
 */
class EventBufferProxy  {

   constructor(worker) {
    this._fallback = new EventBufferArray();
    this._compression = new EventBufferCompressionWorker(worker);
    this._used = this._fallback;

    this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();
  }

  /** @inheritDoc */
   get hasEvents() {
    return this._used.hasEvents;
  }

  /** @inheritDoc */
   destroy() {
    this._fallback.destroy();
    this._compression.destroy();
  }

  /**
   * Add an event to the event buffer.
   *
   * Returns true if event was successfully added.
   */
   addEvent(event, isCheckout) {
    return this._used.addEvent(event, isCheckout);
  }

  /** @inheritDoc */
   async finish() {
    // Ensure the worker is loaded, so the sent event is compressed
    await this.ensureWorkerIsLoaded();

    return this._used.finish();
  }

  /** Ensure the worker has loaded. */
   ensureWorkerIsLoaded() {
    return this._ensureWorkerIsLoadedPromise;
  }

  /** Actually check if the worker has been loaded. */
   async _ensureWorkerIsLoaded() {
    try {
      await this._compression.ensureReady();
    } catch (error) {
      // If the worker fails to load, we fall back to the simple buffer.
      // Nothing more to do from our side here
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Failed to load the compression worker, falling back to simple buffer');
      return;
    }

    // Now we need to switch over the array buffer to the compression worker
    await this._switchToCompressionWorker();
  }

  /** Switch the used buffer to the compression worker. */
   async _switchToCompressionWorker() {
    const { events } = this._fallback;

    const addEventPromises = [];
    for (const event of events) {
      addEventPromises.push(this._compression.addEvent(event));
    }

    // We switch over to the new buffer immediately - any further events will be added
    // after the previously buffered ones
    this._used = this._compression;

    // Wait for original events to be re-added before resolving
    try {
      await Promise.all(addEventPromises);
    } catch (error) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('[Replay] Failed to add events when switching buffers.', error);
    }
  }
}

/**
 * Create an event buffer for replays.
 */
function createEventBuffer({ useCompression }) {
  // eslint-disable-next-line no-restricted-globals
  if (useCompression && window.Worker) {
    try {
      const workerUrl = e();

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Using compression worker');
      const worker = new Worker(workerUrl);
      return new EventBufferProxy(worker);
    } catch (error) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Failed to create compression worker');
      // Fall back to use simple event buffer array
    }
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Using simple buffer');
  return new EventBufferArray();
}

/**
 * Given an initial timestamp and an expiry duration, checks to see if current
 * time should be considered as expired.
 */
function isExpired(
  initialTime,
  expiry,
  targetTime = +new Date(),
) {
  // Always expired if < 0
  if (initialTime === null || expiry === undefined || expiry < 0) {
    return true;
  }

  // Never expires if == 0
  if (expiry === 0) {
    return false;
  }

  return initialTime + expiry <= targetTime;
}

/**
 * Checks to see if session is expired
 */
function isSessionExpired(session, timeouts, targetTime = +new Date()) {
  return (
    // First, check that maximum session length has not been exceeded
    isExpired(session.started, timeouts.maxSessionLife, targetTime) ||
    // check that the idle timeout has not been exceeded (i.e. user has
    // performed an action within the last `idleTimeout` ms)
    isExpired(session.lastActivity, timeouts.sessionIdle, targetTime)
  );
}

/**
 * Save a session to session storage.
 */
function saveSession(session) {
  const hasSessionStorage = 'sessionStorage' in WINDOW;
  if (!hasSessionStorage) {
    return;
  }

  try {
    WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));
  } catch (e) {
    // Ignore potential SecurityError exceptions
  }
}

/**
 * Given a sample rate, returns true if replay should be sampled.
 *
 * 1.0 = 100% sampling
 * 0.0 = 0% sampling
 */
function isSampled(sampleRate) {
  if (sampleRate === undefined) {
    return false;
  }

  // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)
  return Math.random() < sampleRate;
}

/**
 * Get a session with defaults & applied sampling.
 */
function makeSession(session) {
  const now = Date.now();
  const id = session.id || utils.uuid4();
  // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.
  const started = session.started || now;
  const lastActivity = session.lastActivity || now;
  const segmentId = session.segmentId || 0;
  const sampled = session.sampled;

  return {
    id,
    started,
    lastActivity,
    segmentId,
    sampled,
  };
}

/**
 * Get the sampled status for a session based on sample rates & current sampled status.
 */
function getSessionSampleType(sessionSampleRate, errorSampleRate) {
  return isSampled(sessionSampleRate) ? 'session' : isSampled(errorSampleRate) ? 'error' : false;
}

/**
 * Create a new session, which in its current implementation is a Sentry event
 * that all replays will be saved to as attachments. Currently, we only expect
 * one of these Sentry events per "replay session".
 */
function createSession({ sessionSampleRate, errorSampleRate, stickySession = false }) {
  const sampled = getSessionSampleType(sessionSampleRate, errorSampleRate);
  const session = makeSession({
    sampled,
  });

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log(`[Replay] Creating new session: ${session.id}`);

  if (stickySession) {
    saveSession(session);
  }

  return session;
}

/**
 * Fetches a session from storage
 */
function fetchSession() {
  const hasSessionStorage = 'sessionStorage' in WINDOW;

  if (!hasSessionStorage) {
    return null;
  }

  try {
    // This can throw if cookies are disabled
    const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);

    if (!sessionStringFromStorage) {
      return null;
    }

    const sessionObj = JSON.parse(sessionStringFromStorage) ;

    return makeSession(sessionObj);
  } catch (e) {
    return null;
  }
}

/**
 * Get or create a session
 */
function getSession({
  timeouts,
  currentSession,
  stickySession,
  sessionSampleRate,
  errorSampleRate,
}) {
  // If session exists and is passed, use it instead of always hitting session storage
  const session = currentSession || (stickySession && fetchSession());

  if (session) {
    // If there is a session, check if it is valid (e.g. "last activity" time
    // should be within the "session idle time", and "session started" time is
    // within "max session time").
    const isExpired = isSessionExpired(session, timeouts);

    if (!isExpired) {
      return { type: 'saved', session };
    } else if (session.sampled === 'error') {
      // Error samples should not be re-created when expired, but instead we stop when the replay is done
      const discardedSession = makeSession({ sampled: false });
      return { type: 'new', session: discardedSession };
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Session has expired');
    }
    // Otherwise continue to create a new session
  }

  const newSession = createSession({
    stickySession,
    sessionSampleRate,
    errorSampleRate,
  });

  return { type: 'new', session: newSession };
}

/**
 * Add an event to the event buffer.
 * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
 */
async function addEvent(
  replay,
  event,
  isCheckout,
) {
  if (!replay.eventBuffer) {
    // This implies that `_isEnabled` is false
    return null;
  }

  if (replay.isPaused()) {
    // Do not add to event buffer when recording is paused
    return null;
  }

  // TODO: sadness -- we will want to normalize timestamps to be in ms -
  // requires coordination with frontend
  const isMs = event.timestamp > 9999999999;
  const timestampInMs = isMs ? event.timestamp : event.timestamp * 1000;

  // Throw out events that happen more than 5 minutes ago. This can happen if
  // page has been left open and idle for a long period of time and user
  // comes back to trigger a new session. The performance entries rely on
  // `performance.timeOrigin`, which is when the page first opened.
  if (timestampInMs + replay.timeouts.sessionIdle < Date.now()) {
    return null;
  }

  // Only record earliest event if a new session was created, otherwise it
  // shouldn't be relevant
  const earliestEvent = replay.getContext().earliestEvent;
  if (replay.session && replay.session.segmentId === 0 && (!earliestEvent || timestampInMs < earliestEvent)) {
    replay.getContext().earliestEvent = timestampInMs;
  }

  try {
    return await replay.eventBuffer.addEvent(event, isCheckout);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(error);
    replay.stop('addEvent');

    const client = core.getCurrentHub().getClient();

    if (client) {
      client.recordDroppedEvent('internal_sdk_error', 'replay');
    }
  }
}

/** If the event is an error event */
function isErrorEvent(event) {
  return !event.type;
}

/** If the event is a transaction event */
function isTransactionEvent(event) {
  return event.type === 'transaction';
}

/** If the event is an replay event */
function isReplayEvent(event) {
  return event.type === 'replay_event';
}

/**
 * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
 */
function handleAfterSendEvent(replay) {
  // Custom transports may still be returning `Promise<void>`, which means we cannot expect the status code to be available there
  // TODO (v8): remove this check as it will no longer be necessary
  const enforceStatusCode = isBaseTransportSend();

  return (event, sendResponse) => {
    if (!isErrorEvent(event) && !isTransactionEvent(event)) {
      return;
    }

    const statusCode = sendResponse && sendResponse.statusCode;

    // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached
    // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)
    // If we do use the base transport, we skip if we encountered an non-OK status code
    if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {
      return;
    }

    // Collect traceIds in _context regardless of `recordingMode`
    // In error mode, _context gets cleared on every checkout
    if (isTransactionEvent(event) && event.contexts && event.contexts.trace && event.contexts.trace.trace_id) {
      replay.getContext().traceIds.add(event.contexts.trace.trace_id );
      return;
    }

    // Everything below is just for error events
    if (!isErrorEvent(event)) {
      return;
    }

    // Add error to list of errorIds of replay
    if (event.event_id) {
      replay.getContext().errorIds.add(event.event_id);
    }

    // Trigger error recording
    // Need to be very careful that this does not cause an infinite loop
    if (
      replay.recordingMode === 'error' &&
      event.exception &&
      event.message !== UNABLE_TO_SEND_REPLAY // ignore this error because otherwise we could loop indefinitely with trying to capture replay and failing
    ) {
      setTimeout(async () => {
        // Allow flush to complete before resuming as a session recording, otherwise
        // the checkout from `startRecording` may be included in the payload.
        // Prefer to keep the error replay as a separate (and smaller) segment
        // than the session replay.
        await replay.flushImmediate();

        if (replay.stopRecording()) {
          // Reset all "capture on error" configuration before
          // starting a new recording
          replay.recordingMode = 'session';
          replay.startRecording();
        }
      });
    }
  };
}

function isBaseTransportSend() {
  const client = core.getCurrentHub().getClient();
  if (!client) {
    return false;
  }

  const transport = client.getTransport();
  if (!transport) {
    return false;
  }

  return (
    (transport.send ).__sentry__baseTransport__ || false
  );
}

var NodeType;
(function (NodeType) {
    NodeType[NodeType["Document"] = 0] = "Document";
    NodeType[NodeType["DocumentType"] = 1] = "DocumentType";
    NodeType[NodeType["Element"] = 2] = "Element";
    NodeType[NodeType["Text"] = 3] = "Text";
    NodeType[NodeType["CDATA"] = 4] = "CDATA";
    NodeType[NodeType["Comment"] = 5] = "Comment";
})(NodeType || (NodeType = {}));

/**
 * Create a breadcrumb for a replay.
 */
function createBreadcrumb(
  breadcrumb,
) {
  return {
    timestamp: Date.now() / 1000,
    type: 'default',
    ...breadcrumb,
  };
}

/**
 * Add a breadcrumb event to replay.
 */
function addBreadcrumbEvent(replay, breadcrumb) {
  if (breadcrumb.category === 'sentry.transaction') {
    return;
  }

  if (['ui.click', 'ui.input'].includes(breadcrumb.category )) {
    replay.triggerUserActivity();
  } else {
    replay.checkAndHandleExpiredSession();
  }

  replay.addUpdate(() => {
    void addEvent(replay, {
      type: EventType.Custom,
      // TODO: We were converting from ms to seconds for breadcrumbs, spans,
      // but maybe we should just keep them as milliseconds
      timestamp: (breadcrumb.timestamp || 0) * 1000,
      data: {
        tag: 'breadcrumb',
        payload: utils.normalize(breadcrumb),
      },
    });

    // Do not flush after console log messages
    return breadcrumb.category === 'console';
  });
}

// Note that these are the serialized attributes and not attributes directly on
// the DOM Node. Attributes we are interested in:
const ATTRIBUTES_TO_RECORD = new Set([
  'id',
  'class',
  'aria-label',
  'role',
  'name',
  'alt',
  'title',
  'data-test-id',
  'data-testid',
]);

/**
 * Inclusion list of attributes that we want to record from the DOM element
 */
function getAttributesToRecord(attributes) {
  const obj = {};
  for (const key in attributes) {
    if (ATTRIBUTES_TO_RECORD.has(key)) {
      let normalizedKey = key;

      if (key === 'data-testid' || key === 'data-test-id') {
        normalizedKey = 'testId';
      }

      obj[normalizedKey] = attributes[key];
    }
  }

  return obj;
}

const handleDomListener =
  (replay) =>
  (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleDom(handlerData);

    if (!result) {
      return;
    }

    addBreadcrumbEvent(replay, result);
  };

/**
 * An event handler to react to DOM events.
 */
function handleDom(handlerData) {
  let target;
  let targetNode;

  // Accessing event.target can throw (see getsentry/raven-js#838, #768)
  try {
    targetNode = getTargetNode(handlerData);
    target = utils.htmlTreeAsString(targetNode);
  } catch (e) {
    target = '<unknown>';
  }

  // `__sn` property is the serialized node created by rrweb
  const serializedNode =
    targetNode && '__sn' in targetNode && targetNode.__sn.type === NodeType.Element ? targetNode.__sn : null;

  return createBreadcrumb({
    category: `ui.${handlerData.name}`,
    message: target,
    data: serializedNode
      ? {
          nodeId: serializedNode.id,
          node: {
            id: serializedNode.id,
            tagName: serializedNode.tagName,
            textContent: targetNode
              ? Array.from(targetNode.childNodes)
                  .map(
                    (node) => '__sn' in node && node.__sn.type === NodeType.Text && node.__sn.textContent,
                  )
                  .filter(Boolean) // filter out empty values
                  .map(text => (text ).trim())
                  .join('')
              : '',
            attributes: getAttributesToRecord(serializedNode.attributes),
          },
        }
      : {},
  });
}

function getTargetNode(handlerData) {
  if (isEventWithTarget(handlerData.event)) {
    return handlerData.event.target;
  }

  return handlerData.event;
}

function isEventWithTarget(event) {
  return !!(event ).target;
}

/**
 * Returns true if we think the given event is an error originating inside of rrweb.
 */
function isRrwebError(event, hint) {
  if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {
    return false;
  }

  // @ts-ignore this may be set by rrweb when it finds errors
  if (hint.originalException && hint.originalException.__rrweb__) {
    return true;
  }

  // Check if any exception originates from rrweb
  return event.exception.values.some(exception => {
    if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {
      return false;
    }

    return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));
  });
}

/**
 * Returns a listener to be added to `addGlobalEventProcessor(listener)`.
 */
function handleGlobalEventListener(
  replay,
  includeAfterSendEventHandling = false,
) {
  const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;

  return (event, hint) => {
    if (isReplayEvent(event)) {
      // Replays have separate set of breadcrumbs, do not include breadcrumbs
      // from core SDK
      delete event.breadcrumbs;
      return event;
    }

    // We only want to handle errors & transactions, nothing else
    if (!isErrorEvent(event) && !isTransactionEvent(event)) {
      return event;
    }

    // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb
    // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users
    if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Ignoring error from rrweb internals', event);
      return null;
    }

    // Only tag transactions with replayId if not waiting for an error
    if (isErrorEvent(event) || (isTransactionEvent(event) && replay.recordingMode === 'session')) {
      event.tags = { ...event.tags, replayId: replay.getSessionId() };
    }

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals && isErrorEvent(event)) {
      const exc = getEventExceptionValues(event);
      addInternalBreadcrumb({
        message: `Tagging event (${event.event_id}) - ${event.message} - ${exc.type}: ${exc.value}`,
      });
    }

    // In cases where a custom client is used that does not support the new hooks (yet),
    // we manually call this hook method here
    if (afterSendHandler) {
      // Pretend the error had a 200 response so we always capture it
      afterSendHandler(event, { statusCode: 200 });
    }

    return event;
  };
}

function addInternalBreadcrumb(arg) {
  const { category, level, message, ...rest } = arg;

  core.addBreadcrumb({
    category: category || 'console',
    level: level || 'debug',
    message: `[debug]: ${message}`,
    ...rest,
  });
}

function getEventExceptionValues(event) {
  return {
    type: 'Unknown',
    value: 'n/a',
    ...(event.exception && event.exception.values && event.exception.values[0]),
  };
}

/**
 * Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
 */
function createPerformanceSpans(
  replay,
  entries,
) {
  return entries.map(({ type, start, end, name, data }) =>
    addEvent(replay, {
      type: EventType.Custom,
      timestamp: start,
      data: {
        tag: 'performanceSpan',
        payload: {
          op: type,
          description: name,
          startTimestamp: start,
          endTimestamp: end,
          data,
        },
      },
    }),
  );
}

function handleHistory(handlerData) {
  const { from, to } = handlerData;

  const now = Date.now() / 1000;

  return {
    type: 'navigation.push',
    start: now,
    end: now,
    name: to,
    data: {
      previous: from,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.
 */
function handleHistorySpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleHistory(handlerData);

    if (result === null) {
      return;
    }

    // Need to collect visited URLs
    replay.getContext().urls.push(result.name);
    replay.triggerUserActivity();

    replay.addUpdate(() => {
      createPerformanceSpans(replay, [result]);
      // Returning false to flush
      return false;
    });
  };
}

/**
 * Check whether a given request URL should be filtered out. This is so we
 * don't log Sentry ingest requests.
 */
function shouldFilterRequest(replay, url) {
  // If we enabled the `traceInternals` experiment, we want to trace everything
  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals) {
    return false;
  }

  return _isSentryRequest(url);
}

/**
 * Checks wether a given URL belongs to the configured Sentry DSN.
 */
function _isSentryRequest(url) {
  const client = core.getCurrentHub().getClient();
  const dsn = client && client.getDsn();
  return dsn ? url.includes(dsn.host) : false;
}

/** Add a performance entry breadcrumb */
function addNetworkBreadcrumb(
  replay,
  result,
) {
  if (!replay.isEnabled()) {
    return;
  }

  if (result === null) {
    return;
  }

  if (shouldFilterRequest(replay, result.name)) {
    return;
  }

  replay.addUpdate(() => {
    createPerformanceSpans(replay, [result]);
    // Returning true will cause `addUpdate` to not flush
    // We do not want network requests to cause a flush. This will prevent
    // recurring/polling requests from keeping the replay session alive.
    return true;
  });
}

/** only exported for tests */
function handleFetch(handlerData) {
  const { startTimestamp, endTimestamp, fetchData, response } = handlerData;

  if (!endTimestamp) {
    return null;
  }

  // This is only used as a fallback, so we know the body sizes are never set here
  const { method, url } = fetchData;

  return {
    type: 'resource.fetch',
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    name: url,
    data: {
      method,
      statusCode: response && (response ).status,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.
 */
function handleFetchSpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleFetch(handlerData);

    addNetworkBreadcrumb(replay, result);
  };
}

/** only exported for tests */
function handleXhr(handlerData) {
  const { startTimestamp, endTimestamp, xhr } = handlerData;

  const sentryXhrData = xhr[utils.SENTRY_XHR_DATA_KEY];

  if (!startTimestamp || !endTimestamp || !sentryXhrData) {
    return null;
  }

  // This is only used as a fallback, so we know the body sizes are never set here
  const { method, url, status_code: statusCode } = sentryXhrData;

  if (url === undefined) {
    return null;
  }

  return {
    type: 'resource.xhr',
    name: url,
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    data: {
      method,
      statusCode,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.
 */
function handleXhrSpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleXhr(handlerData);

    addNetworkBreadcrumb(replay, result);
  };
}

/** Get the size of a body. */
function getBodySize(
  body,
  textEncoder,
) {
  if (!body) {
    return undefined;
  }

  try {
    if (typeof body === 'string') {
      return textEncoder.encode(body).length;
    }

    if (body instanceof URLSearchParams) {
      return textEncoder.encode(body.toString()).length;
    }

    if (body instanceof FormData) {
      const formDataStr = _serializeFormData(body);
      return textEncoder.encode(formDataStr).length;
    }

    if (body instanceof Blob) {
      return body.size;
    }

    if (body instanceof ArrayBuffer) {
      return body.byteLength;
    }

    // Currently unhandled types: ArrayBufferView, ReadableStream
  } catch (e) {
    // just return undefined
  }

  return undefined;
}

/** Convert a Content-Length header to number/undefined.  */
function parseContentLengthHeader(header) {
  if (!header) {
    return undefined;
  }

  const size = parseInt(header, 10);
  return isNaN(size) ? undefined : size;
}

/** Get the string representation of a body. */
function getBodyString(body) {
  if (typeof body === 'string') {
    return body;
  }

  if (body instanceof URLSearchParams) {
    return body.toString();
  }

  if (body instanceof FormData) {
    return _serializeFormData(body);
  }

  return undefined;
}

/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
function makeNetworkReplayBreadcrumb(
  type,
  data,
) {
  if (!data) {
    return null;
  }

  const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;

  const result = {
    type,
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    name: url,
    data: utils.dropUndefinedKeys({
      method,
      statusCode,
      request,
      response,
    }),
  };

  return result;
}

/** Get either a JSON network body, or a text representation. */
function getNetworkBody(bodyText) {
  if (!bodyText) {
    return;
  }

  try {
    return JSON.parse(bodyText);
  } catch (e2) {
    // return text
  }

  return bodyText;
}

/** Build the request or response part of a replay network breadcrumb. */
function buildNetworkRequestOrResponse(
  headers,
  bodySize,
  body,
) {
  if (!bodySize && Object.keys(headers).length === 0) {
    return undefined;
  }

  if (!bodySize) {
    return {
      headers,
    };
  }

  if (!body) {
    return {
      headers,
      size: bodySize,
    };
  }

  const info = {
    headers,
    size: bodySize,
  };

  if (bodySize < NETWORK_BODY_MAX_SIZE) {
    info.body = body;
  } else {
    info._meta = {
      errors: ['MAX_BODY_SIZE_EXCEEDED'],
    };
  }

  return info;
}

/** Filter a set of headers */
function getAllowedHeaders(headers, allowedHeaders) {
  return Object.keys(headers).reduce((filteredHeaders, key) => {
    const normalizedKey = key.toLowerCase();
    // Avoid putting empty strings into the headers
    if (allowedHeaders.includes(normalizedKey) && headers[key]) {
      filteredHeaders[normalizedKey] = headers[key];
    }
    return filteredHeaders;
  }, {});
}

function _serializeFormData(formData) {
  // This is a bit simplified, but gives us a decent estimate
  // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'
  // @ts-ignore passing FormData to URLSearchParams actually works
  return new URLSearchParams(formData).toString();
}

/**
 * Capture a fetch breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
async function captureFetchBreadcrumbToReplay(
  breadcrumb,
  hint,
  options

,
) {
  try {
    const data = await _prepareFetchData(breadcrumb, hint, options);

    // Create a replay performance entry from this breadcrumb
    const result = makeNetworkReplayBreadcrumb('resource.fetch', data);
    addNetworkBreadcrumb(options.replay, result);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay] Failed to capture fetch breadcrumb', error);
  }
}

/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
function enrichFetchBreadcrumb(
  breadcrumb,
  hint,
  options,
) {
  const { input, response } = hint;

  const body = _getFetchRequestArgBody(input);
  const reqSize = getBodySize(body, options.textEncoder);

  const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;

  if (reqSize !== undefined) {
    breadcrumb.data.request_body_size = reqSize;
  }
  if (resSize !== undefined) {
    breadcrumb.data.response_body_size = resSize;
  }
}

async function _prepareFetchData(
  breadcrumb,
  hint,
  options

,
) {
  const { startTimestamp, endTimestamp } = hint;

  const {
    url,
    method,
    status_code: statusCode,
    request_body_size: requestBodySize,
    response_body_size: responseBodySize,
  } = breadcrumb.data;

  const request = _getRequestInfo(options, hint.input, requestBodySize);
  const response = await _getResponseInfo(options, hint.response, responseBodySize);

  return {
    startTimestamp,
    endTimestamp,
    url,
    method,
    statusCode: statusCode || 0,
    request,
    response,
  };
}

function _getRequestInfo(
  { captureBodies, requestHeaders },
  input,
  requestBodySize,
) {
  const headers = getRequestHeaders(input, requestHeaders);

  if (!captureBodies) {
    return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);
  }

  // We only want to transmit string or string-like bodies
  const requestBody = _getFetchRequestArgBody(input);
  const body = getNetworkBody(getBodyString(requestBody));
  return buildNetworkRequestOrResponse(headers, requestBodySize, body);
}

async function _getResponseInfo(
  {
    captureBodies,
    textEncoder,
    responseHeaders,
  }

,
  response,
  responseBodySize,
) {
  const headers = getAllHeaders(response.headers, responseHeaders);

  if (!captureBodies && responseBodySize !== undefined) {
    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);
  }

  // Only clone the response if we need to
  try {
    // We have to clone this, as the body can only be read once
    const res = response.clone();
    const { body, bodyText } = await _parseFetchBody(res);

    const size =
      bodyText && bodyText.length && responseBodySize === undefined
        ? getBodySize(bodyText, textEncoder)
        : responseBodySize;

    if (captureBodies) {
      return buildNetworkRequestOrResponse(headers, size, body);
    }

    return buildNetworkRequestOrResponse(headers, size, undefined);
  } catch (e) {
    // fallback
    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);
  }
}

async function _parseFetchBody(
  response,
) {
  let bodyText;

  try {
    bodyText = await response.text();
  } catch (e2) {
    return {};
  }

  try {
    const body = JSON.parse(bodyText);
    return { body, bodyText };
  } catch (e3) {
    // just send bodyText
  }

  return { bodyText, body: bodyText };
}

function _getFetchRequestArgBody(fetchArgs = []) {
  // We only support getting the body from the fetch options
  if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {
    return undefined;
  }

  return (fetchArgs[1] ).body;
}

function getAllHeaders(headers, allowedHeaders) {
  const allHeaders = {};

  allowedHeaders.forEach(header => {
    if (headers.get(header)) {
      allHeaders[header] = headers.get(header) ;
    }
  });

  return allHeaders;
}

function getRequestHeaders(fetchArgs, allowedHeaders) {
  if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {
    return getHeadersFromOptions(fetchArgs[0] , allowedHeaders);
  }

  if (fetchArgs.length === 2) {
    return getHeadersFromOptions(fetchArgs[1] , allowedHeaders);
  }

  return {};
}

function getHeadersFromOptions(
  input,
  allowedHeaders,
) {
  if (!input) {
    return {};
  }

  const headers = input.headers;

  if (!headers) {
    return {};
  }

  if (headers instanceof Headers) {
    return getAllHeaders(headers, allowedHeaders);
  }

  // We do not support this, as it is not really documented (anymore?)
  if (Array.isArray(headers)) {
    return {};
  }

  return getAllowedHeaders(headers, allowedHeaders);
}

/**
 * Capture an XHR breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
async function captureXhrBreadcrumbToReplay(
  breadcrumb,
  hint,
  options,
) {
  try {
    const data = _prepareXhrData(breadcrumb, hint, options);

    // Create a replay performance entry from this breadcrumb
    const result = makeNetworkReplayBreadcrumb('resource.xhr', data);
    addNetworkBreadcrumb(options.replay, result);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay] Failed to capture fetch breadcrumb', error);
  }
}

/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
function enrichXhrBreadcrumb(
  breadcrumb,
  hint,
  options,
) {
  const { xhr, input } = hint;

  const reqSize = getBodySize(input, options.textEncoder);
  const resSize = xhr.getResponseHeader('content-length')
    ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))
    : getBodySize(xhr.response, options.textEncoder);

  if (reqSize !== undefined) {
    breadcrumb.data.request_body_size = reqSize;
  }
  if (resSize !== undefined) {
    breadcrumb.data.response_body_size = resSize;
  }
}

function _prepareXhrData(
  breadcrumb,
  hint,
  options,
) {
  const { startTimestamp, endTimestamp, input, xhr } = hint;

  const {
    url,
    method,
    status_code: statusCode,
    request_body_size: requestBodySize,
    response_body_size: responseBodySize,
  } = breadcrumb.data;

  const xhrInfo = xhr[utils.SENTRY_XHR_DATA_KEY];
  const requestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options.requestHeaders) : {};
  const responseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.responseHeaders);

  if (!url) {
    return null;
  }

  const request = buildNetworkRequestOrResponse(
    requestHeaders,
    requestBodySize,
    options.captureBodies ? getNetworkBody(getBodyString(input)) : undefined,
  );
  const response = buildNetworkRequestOrResponse(
    responseHeaders,
    responseBodySize,
    options.captureBodies ? getNetworkBody(hint.xhr.responseText) : undefined,
  );

  return {
    startTimestamp,
    endTimestamp,
    url,
    method,
    statusCode: statusCode || 0,
    request,
    response,
  };
}

function getResponseHeaders(xhr) {
  const headers = xhr.getAllResponseHeaders();

  if (!headers) {
    return {};
  }

  return headers.split('\r\n').reduce((acc, line) => {
    const [key, value] = line.split(': ');
    acc[key.toLowerCase()] = value;
    return acc;
  }, {});
}

/**
 * This method does two things:
 * - It enriches the regular XHR/fetch breadcrumbs with request/response size data
 * - It captures the XHR/fetch breadcrumbs to the replay
 *   (enriching it with further data that is _not_ added to the regular breadcrumbs)
 */
function handleNetworkBreadcrumbs(replay) {
  const client = core.getCurrentHub().getClient();

  try {
    const textEncoder = new TextEncoder();

    const options = {
      replay,
      textEncoder,
      ...replay.getExperimentalOptions().network,
    };

    if (client && client.on) {
      client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));
    } else {
      // Fallback behavior
      utils.addInstrumentationHandler('fetch', handleFetchSpanListener(replay));
      utils.addInstrumentationHandler('xhr', handleXhrSpanListener(replay));
    }
  } catch (e2) {
    // Do nothing
  }
}

/** just exported for tests */
function beforeAddNetworkBreadcrumb(
  options,
  breadcrumb,
  hint,
) {
  if (!breadcrumb.data) {
    return;
  }

  try {
    if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {
      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick
      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on
      // So any async mutations to it will not be reflected in the final breadcrumb
      enrichXhrBreadcrumb(breadcrumb, hint, options);

      void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);
    }

    if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {
      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick
      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on
      // So any async mutations to it will not be reflected in the final breadcrumb
      enrichFetchBreadcrumb(breadcrumb, hint, options);

      void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);
    }
  } catch (e) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('Error when enriching network breadcrumb');
  }
}

function _isXhrBreadcrumb(breadcrumb) {
  return breadcrumb.category === 'xhr';
}

function _isFetchBreadcrumb(breadcrumb) {
  return breadcrumb.category === 'fetch';
}

function _isXhrHint(hint) {
  return hint && hint.xhr;
}

function _isFetchHint(hint) {
  return hint && hint.response;
}

let _LAST_BREADCRUMB = null;

const handleScopeListener =
  (replay) =>
  (scope) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleScope(scope);

    if (!result) {
      return;
    }

    addBreadcrumbEvent(replay, result);
  };

/**
 * An event handler to handle scope changes.
 */
function handleScope(scope) {
  // TODO (v8): Remove this guard. This was put in place because we introduced
  // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.
  // For now, we'll just return null if the method doesn't exist but we should eventually
  // get rid of this guard.
  const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();

  // Listener can be called when breadcrumbs have not changed, so we store the
  // reference to the last crumb and only return a crumb if it has changed
  if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {
    return null;
  }

  _LAST_BREADCRUMB = newBreadcrumb;

  if (
    newBreadcrumb.category &&
    (['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||
      newBreadcrumb.category.startsWith('ui.'))
  ) {
    return null;
  }

  return createBreadcrumb(newBreadcrumb);
}

/**
 * Add global listeners that cannot be removed.
 */
function addGlobalListeners(replay) {
  // Listeners from core SDK //
  const scope = core.getCurrentHub().getScope();
  const client = core.getCurrentHub().getClient();

  if (scope) {
    scope.addScopeListener(handleScopeListener(replay));
  }
  utils.addInstrumentationHandler('dom', handleDomListener(replay));
  utils.addInstrumentationHandler('history', handleHistorySpanListener(replay));
  handleNetworkBreadcrumbs(replay);

  // Tag all (non replay) events that get sent to Sentry with the current
  // replay ID so that we can reference them later in the UI
  core.addGlobalEventProcessor(handleGlobalEventListener(replay, !hasHooks(client)));

  // If a custom client has no hooks yet, we continue to use the "old" implementation
  if (hasHooks(client)) {
    client.on('afterSendEvent', handleAfterSendEvent(replay));
    client.on('createDsc', (dsc) => {
      const replayId = replay.getSessionId();
      if (replayId) {
        dsc.replay_id = replayId;
      }
    });
  }
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function hasHooks(client) {
  return !!(client && client.on);
}

/**
 * Create a "span" for the total amount of memory being used by JS objects
 * (including v8 internal objects).
 */
async function addMemoryEntry(replay) {
  // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this
  try {
    return Promise.all(
      createPerformanceSpans(replay, [
        // @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
        createMemoryEntry(WINDOW.performance.memory),
      ]),
    );
  } catch (error) {
    // Do nothing
    return [];
  }
}

function createMemoryEntry(memoryEntry) {
  const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;
  // we don't want to use `getAbsoluteTime` because it adds the event time to the
  // time origin, so we get the current timestamp instead
  const time = Date.now() / 1000;
  return {
    type: 'memory',
    name: 'memory',
    start: time,
    end: time,
    data: {
      memory: {
        jsHeapSizeLimit,
        totalJSHeapSize,
        usedJSHeapSize,
      },
    },
  };
}

// Map entryType -> function to normalize data for event
// @ts-ignore TODO: entry type does not fit the create* functions entry type
const ENTRY_TYPES

 = {
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  resource: createResourceEntry,
  paint: createPaintEntry,
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  navigation: createNavigationEntry,
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  ['largest-contentful-paint']: createLargestContentfulPaint,
};

/**
 * Create replay performance entries from the browser performance entries.
 */
function createPerformanceEntries(
  entries,
) {
  return entries.map(createPerformanceEntry).filter(Boolean) ;
}

function createPerformanceEntry(entry) {
  if (ENTRY_TYPES[entry.entryType] === undefined) {
    return null;
  }

  return ENTRY_TYPES[entry.entryType](entry);
}

function getAbsoluteTime(time) {
  // browserPerformanceTimeOrigin can be undefined if `performance` or
  // `performance.now` doesn't exist, but this is already checked by this integration
  return ((utils.browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;
}

function createPaintEntry(entry) {
  const { duration, entryType, name, startTime } = entry;

  const start = getAbsoluteTime(startTime);
  return {
    type: entryType,
    name,
    start,
    end: start + duration,
    data: undefined,
  };
}

function createNavigationEntry(entry) {
  const {
    entryType,
    name,
    decodedBodySize,
    duration,
    domComplete,
    encodedBodySize,
    domContentLoadedEventStart,
    domContentLoadedEventEnd,
    domInteractive,
    loadEventStart,
    loadEventEnd,
    redirectCount,
    startTime,
    transferSize,
    type,
  } = entry;

  // Ignore entries with no duration, they do not seem to be useful and cause dupes
  if (duration === 0) {
    return null;
  }

  return {
    type: `${entryType}.${type}`,
    start: getAbsoluteTime(startTime),
    end: getAbsoluteTime(domComplete),
    name,
    data: {
      size: transferSize,
      decodedBodySize,
      encodedBodySize,
      duration,
      domInteractive,
      domContentLoadedEventStart,
      domContentLoadedEventEnd,
      loadEventStart,
      loadEventEnd,
      domComplete,
      redirectCount,
    },
  };
}

function createResourceEntry(
  entry,
) {
  const {
    entryType,
    initiatorType,
    name,
    responseEnd,
    startTime,
    decodedBodySize,
    encodedBodySize,
    responseStatus,
    transferSize,
  } = entry;

  // Core SDK handles these
  if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {
    return null;
  }

  return {
    type: `${entryType}.${initiatorType}`,
    start: getAbsoluteTime(startTime),
    end: getAbsoluteTime(responseEnd),
    name,
    data: {
      size: transferSize,
      statusCode: responseStatus,
      decodedBodySize,
      encodedBodySize,
    },
  };
}

function createLargestContentfulPaint(
  entry,
) {
  const { entryType, startTime, size } = entry;

  let startTimeOrNavigationActivation = 0;

  if (WINDOW.performance) {
    const navEntry = WINDOW.performance.getEntriesByType('navigation')[0]

;

    // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21
    startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0;
  }

  // value is in ms
  const value = Math.max(startTime - startTimeOrNavigationActivation, 0);
  // LCP doesn't have a "duration", it just happens at a single point in time.
  // But the UI expects both, so use end (in seconds) for both timestamps.
  const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000;

  return {
    type: entryType,
    name: entryType,
    start: end,
    end,
    data: {
      value, // LCP "duration" in ms
      size,
      // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      nodeId: record.mirror.getId(entry.element ),
    },
  };
}

/**
 * Heavily simplified debounce function based on lodash.debounce.
 *
 * This function takes a callback function (@param fun) and delays its invocation
 * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
 * which ensures that the callback is invoked at least once after the specified max. wait time.
 *
 * @param func the function whose invocation is to be debounced
 * @param wait the minimum time until the function is invoked after it was called once
 * @param options the options object, which can contain the `maxWait` property
 *
 * @returns the debounced version of the function, which needs to be called at least once to start the
 *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
 *          was already invoked in the meantime, return @param func's return value.
 *          The debounced function has two additional properties:
 *          - `flush`: Invokes the debounced function immediately and returns its return value
 *          - `cancel`: Cancels the debouncing process and resets the debouncing timer
 */
function debounce(func, wait, options) {
  let callbackReturnValue;

  let timerId;
  let maxTimerId;

  const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;

  function invokeFunc() {
    cancelTimers();
    callbackReturnValue = func();
    return callbackReturnValue;
  }

  function cancelTimers() {
    timerId !== undefined && clearTimeout(timerId);
    maxTimerId !== undefined && clearTimeout(maxTimerId);
    timerId = maxTimerId = undefined;
  }

  function flush() {
    if (timerId !== undefined || maxTimerId !== undefined) {
      return invokeFunc();
    }
    return callbackReturnValue;
  }

  function debounced() {
    if (timerId) {
      clearTimeout(timerId);
    }
    timerId = setTimeout(invokeFunc, wait);

    if (maxWait && maxTimerId === undefined) {
      maxTimerId = setTimeout(invokeFunc, maxWait);
    }

    return callbackReturnValue;
  }

  debounced.cancel = cancelTimers;
  debounced.flush = flush;
  return debounced;
}

/**
 * Handler for recording events.
 *
 * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
 */
function getHandleRecordingEmit(replay) {
  let hadFirstEvent = false;

  return (event, _isCheckout) => {
    // If this is false, it means session is expired, create and a new session and wait for checkout
    if (!replay.checkAndHandleExpiredSession()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('[Replay] Received replay event after session expired.');

      return;
    }

    // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`
    // We also want to treat the first event as a checkout, so we handle this specifically here
    const isCheckout = _isCheckout || !hadFirstEvent;
    hadFirstEvent = true;

    // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.
    replay.addUpdate(() => {
      // The session is always started immediately on pageload/init, but for
      // error-only replays, it should reflect the most recent checkout
      // when an error occurs. Clear any state that happens before this current
      // checkout. This needs to happen before `addEvent()` which updates state
      // dependent on this reset.
      if (replay.recordingMode === 'error' && isCheckout) {
        replay.setInitialState();
      }

      // We need to clear existing events on a checkout, otherwise they are
      // incremental event updates and should be appended
      void addEvent(replay, event, isCheckout);

      // Different behavior for full snapshots (type=2), ignore other event types
      // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
      if (!isCheckout) {
        return false;
      }

      // If there is a previousSessionId after a full snapshot occurs, then
      // the replay session was started due to session expiration. The new session
      // is started before triggering a new checkout and contains the id
      // of the previous session. Do not immediately flush in this case
      // to avoid capturing only the checkout and instead the replay will
      // be captured if they perform any follow-up actions.
      if (replay.session && replay.session.previousSessionId) {
        return true;
      }

      // See note above re: session start needs to reflect the most recent
      // checkout.
      if (replay.recordingMode === 'error' && replay.session) {
        const { earliestEvent } = replay.getContext();
        if (earliestEvent) {
          replay.session.started = earliestEvent;

          if (replay.getOptions().stickySession) {
            saveSession(replay.session);
          }
        }
      }

      // Flush immediately so that we do not miss the first segment, otherwise
      // it can prevent loading on the UI. This will cause an increase in short
      // replays (e.g. opening and closing a tab quickly), but these can be
      // filtered on the UI.
      if (replay.recordingMode === 'session') {
        // We want to ensure the worker is ready, as otherwise we'd always send the first event uncompressed
        void replay.flushImmediate();
      }

      return true;
    });
  };
}

/**
 * Create a replay envelope ready to be sent.
 * This includes both the replay event, as well as the recording data.
 */
function createReplayEnvelope(
  replayEvent,
  recordingData,
  dsn,
  tunnel,
) {
  return utils.createEnvelope(
    utils.createEventEnvelopeHeaders(replayEvent, utils.getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),
    [
      [{ type: 'replay_event' }, replayEvent],
      [
        {
          type: 'replay_recording',
          // If string then we need to encode to UTF8, otherwise will have
          // wrong size. TextEncoder has similar browser support to
          // MutationObserver, although it does not accept IE11.
          length:
            typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,
        },
        recordingData,
      ],
    ],
  );
}

/**
 * Prepare the recording data ready to be sent.
 */
function prepareRecordingData({
  recordingData,
  headers,
}

) {
  let payloadWithSequence;

  // XXX: newline is needed to separate sequence id from events
  const replayHeaders = `${JSON.stringify(headers)}
`;

  if (typeof recordingData === 'string') {
    payloadWithSequence = `${replayHeaders}${recordingData}`;
  } else {
    const enc = new TextEncoder();
    // XXX: newline is needed to separate sequence id from events
    const sequence = enc.encode(replayHeaders);
    // Merge the two Uint8Arrays
    payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);
    payloadWithSequence.set(sequence);
    payloadWithSequence.set(recordingData, sequence.length);
  }

  return payloadWithSequence;
}

/**
 * Prepare a replay event & enrich it with the SDK metadata.
 */
async function prepareReplayEvent({
  client,
  scope,
  replayId: event_id,
  event,
}

) {
  const integrations =
    typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)
      ? Object.keys(client._integrations)
      : undefined;
  const preparedEvent = (await core.prepareEvent(
    client.getOptions(),
    event,
    { event_id, integrations },
    scope,
  )) ;

  // If e.g. a global event processor returned null
  if (!preparedEvent) {
    return null;
  }

  // This normally happens in browser client "_prepareEvent"
  // but since we do not use this private method from the client, but rather the plain import
  // we need to do this manually.
  preparedEvent.platform = preparedEvent.platform || 'javascript';

  // extract the SDK name because `client._prepareEvent` doesn't add it to the event
  const metadata = client.getSdkMetadata && client.getSdkMetadata();
  const { name, version } = (metadata && metadata.sdk) || {};

  preparedEvent.sdk = {
    ...preparedEvent.sdk,
    name: name || 'sentry.javascript.unknown',
    version: version || '0.0.0',
  };

  return preparedEvent;
}

/**
 * Send replay attachment using `fetch()`
 */
async function sendReplayRequest({
  recordingData,
  replayId,
  segmentId: segment_id,
  eventContext,
  timestamp,
  session,
  options,
}) {
  const preparedRecordingData = prepareRecordingData({
    recordingData,
    headers: {
      segment_id,
    },
  });

  const { urls, errorIds, traceIds, initialTimestamp } = eventContext;

  const hub = core.getCurrentHub();
  const client = hub.getClient();
  const scope = hub.getScope();
  const transport = client && client.getTransport();
  const dsn = client && client.getDsn();

  if (!client || !scope || !transport || !dsn || !session.sampled) {
    return;
  }

  const baseEvent = {
    type: REPLAY_EVENT_NAME,
    replay_start_timestamp: initialTimestamp / 1000,
    timestamp: timestamp / 1000,
    error_ids: errorIds,
    trace_ids: traceIds,
    urls,
    replay_id: replayId,
    segment_id,
    replay_type: session.sampled,
  };

  const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });

  if (!replayEvent) {
    // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions
    client.recordDroppedEvent('event_processor', 'replay', baseEvent);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('An event processor returned `null`, will not send event.');
    return;
  }

  replayEvent.contexts = {
    ...replayEvent.contexts,
    replay: {
      ...(replayEvent.contexts && replayEvent.contexts.replay),
      session_sample_rate: options.sessionSampleRate,
      error_sample_rate: options.errorSampleRate,
    },
  };

  /*
  For reference, the fully built event looks something like this:
  {
      "type": "replay_event",
      "timestamp": 1670837008.634,
      "error_ids": [
          "errorId"
      ],
      "trace_ids": [
          "traceId"
      ],
      "urls": [
          "https://example.com"
      ],
      "replay_id": "eventId",
      "segment_id": 3,
      "replay_type": "error",
      "platform": "javascript",
      "event_id": "eventId",
      "environment": "production",
      "sdk": {
          "integrations": [
              "BrowserTracing",
              "Replay"
          ],
          "name": "sentry.javascript.browser",
          "version": "7.25.0"
      },
      "sdkProcessingMetadata": {},
      "contexts": {
        "replay": {
          "session_sample_rate": 1,
          "error_sample_rate": 0,
        },
      },
  }
  */

  const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);

  let response;

  try {
    response = await transport.send(envelope);
  } catch (err) {
    const error = new Error(UNABLE_TO_SEND_REPLAY);

    try {
      // In case browsers don't allow this property to be writable
      // @ts-ignore This needs lib es2022 and newer
      error.cause = err;
    } catch (e) {
      // nothing to do
    }
    throw error;
  }

  // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore
  if (!response) {
    return response;
  }

  // If the status code is invalid, we want to immediately stop & not retry
  if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {
    throw new TransportStatusCodeError(response.statusCode);
  }

  return response;
}

/**
 * This error indicates that the transport returned an invalid status code.
 */
class TransportStatusCodeError extends Error {
   constructor(statusCode) {
    super(`Transport returned status code ${statusCode}`);
  }
}

/**
 * Finalize and send the current replay event to Sentry
 */
async function sendReplay(
  replayData,
  retryConfig = {
    count: 0,
    interval: RETRY_BASE_INTERVAL,
  },
) {
  const { recordingData, options } = replayData;

  // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)
  if (!recordingData.length) {
    return;
  }

  try {
    await sendReplayRequest(replayData);
    return true;
  } catch (err) {
    if (err instanceof TransportStatusCodeError) {
      throw err;
    }

    // Capture error for every failed replay
    core.setContext('Replays', {
      _retryCount: retryConfig.count,
    });

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && options._experiments && options._experiments.captureExceptions) {
      core.captureException(err);
    }

    // If an error happened here, it's likely that uploading the attachment
    // failed, we'll can retry with the same events payload
    if (retryConfig.count >= RETRY_MAX_COUNT) {
      const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);

      try {
        // In case browsers don't allow this property to be writable
        // @ts-ignore This needs lib es2022 and newer
        error.cause = err;
      } catch (e) {
        // nothing to do
      }

      throw error;
    }

    // will retry in intervals of 5, 10, 30
    retryConfig.interval *= ++retryConfig.count;

    return await new Promise((resolve, reject) => {
      setTimeout(async () => {
        try {
          await sendReplay(replayData, retryConfig);
          resolve(true);
        } catch (err) {
          reject(err);
        }
      }, retryConfig.interval);
    });
  }
}

/* eslint-disable max-lines */ // TODO: We might want to split this file up

/**
 * The main replay container class, which holds all the state and methods for recording and sending replays.
 */
class ReplayContainer  {
   __init() {this.eventBuffer = null;}

  /**
   * List of PerformanceEntry from PerformanceObserver
   */
   __init2() {this.performanceEvents = [];}

  /**
   * Recording can happen in one of two modes:
   * * session: Record the whole session, sending it continuously
   * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately
   */
   __init3() {this.recordingMode = 'session';}

  /**
   * These are here so we can overwrite them in tests etc.
   * @hidden
   */
    __init4() {this.timeouts = {
    sessionIdle: SESSION_IDLE_DURATION,
    maxSessionLife: MAX_SESSION_LIFE,
  }; }

  /**
   * Options to pass to `rrweb.record()`
   */

   __init5() {this._performanceObserver = null;}

   __init6() {this._flushLock = null;}

  /**
   * Timestamp of the last user activity. This lives across sessions.
   */
   __init7() {this._lastActivity = Date.now();}

  /**
   * Is the integration currently active?
   */
   __init8() {this._isEnabled = false;}

  /**
   * Paused is a state where:
   * - DOM Recording is not listening at all
   * - Nothing will be added to event buffer (e.g. core SDK events)
   */
   __init9() {this._isPaused = false;}

  /**
   * Have we attached listeners to the core SDK?
   * Note we have to track this as there is no way to remove instrumentation handlers.
   */
   __init10() {this._hasInitializedCoreListeners = false;}

  /**
   * Function to stop recording
   */
   __init11() {this._stopRecording = null;}

   __init12() {this._context = {
    errorIds: new Set(),
    traceIds: new Set(),
    urls: [],
    earliestEvent: null,
    initialTimestamp: Date.now(),
    initialUrl: '',
  };}

   constructor({
    options,
    recordingOptions,
  }

) {ReplayContainer.prototype.__init.call(this);ReplayContainer.prototype.__init2.call(this);ReplayContainer.prototype.__init3.call(this);ReplayContainer.prototype.__init4.call(this);ReplayContainer.prototype.__init5.call(this);ReplayContainer.prototype.__init6.call(this);ReplayContainer.prototype.__init7.call(this);ReplayContainer.prototype.__init8.call(this);ReplayContainer.prototype.__init9.call(this);ReplayContainer.prototype.__init10.call(this);ReplayContainer.prototype.__init11.call(this);ReplayContainer.prototype.__init12.call(this);ReplayContainer.prototype.__init13.call(this);ReplayContainer.prototype.__init14.call(this);ReplayContainer.prototype.__init15.call(this);ReplayContainer.prototype.__init16.call(this);ReplayContainer.prototype.__init17.call(this);
    this._recordingOptions = recordingOptions;
    this._options = options;

    this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {
      maxWait: this._options.flushMaxDelay,
    });

    this._experimentalOptions = _getExperimentalOptions(options);
  }

  /** Get the event context. */
   getContext() {
    return this._context;
  }

  /** If recording is currently enabled. */
   isEnabled() {
    return this._isEnabled;
  }

  /** If recording is currently paused. */
   isPaused() {
    return this._isPaused;
  }

  /** Get the replay integration options. */
   getOptions() {
    return this._options;
  }

  /**
   * Get the experimental options.
   * THIS IS INTERNAL AND SUBJECT TO CHANGE!
   * @hidden
   */
   getExperimentalOptions() {
    return this._experimentalOptions;
  }

  /**
   * Initializes the plugin.
   *
   * Creates or loads a session, attaches listeners to varying events (DOM,
   * _performanceObserver, Recording, Sentry SDK, etc)
   */
   start() {
    this.setInitialState();

    if (!this._loadAndCheckSession()) {
      return;
    }

    // If there is no session, then something bad has happened - can't continue
    if (!this.session) {
      this._handleException(new Error('No session found'));
      return;
    }

    if (!this.session.sampled) {
      // If session was not sampled, then we do not initialize the integration at all.
      return;
    }

    // If session is sampled for errors, then we need to set the recordingMode
    // to 'error', which will configure recording with different options.
    if (this.session.sampled === 'error') {
      this.recordingMode = 'error';
    }

    // setup() is generally called on page load or manually - in both cases we
    // should treat it as an activity
    this._updateSessionActivity();

    this.eventBuffer = createEventBuffer({
      useCompression: this._options.useCompression,
    });

    this._addListeners();

    // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout
    this._isEnabled = true;

    this.startRecording();
  }

  /**
   * Start recording.
   *
   * Note that this will cause a new DOM checkout
   */
   startRecording() {
    try {
      this._stopRecording = record({
        ...this._recordingOptions,
        // When running in error sampling mode, we need to overwrite `checkoutEveryNms`
        // Without this, it would record forever, until an error happens, which we don't want
        // instead, we'll always keep the last 60 seconds of replay before an error happened
        ...(this.recordingMode === 'error' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),
        emit: getHandleRecordingEmit(this),
        onMutation: this._onMutationHandler,
      });
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Stops the recording, if it was running.
   * Returns true if it was stopped, else false.
   */
   stopRecording() {
    try {
      if (this._stopRecording) {
        this._stopRecording();
        this._stopRecording = undefined;
        return true;
      }

      return false;
    } catch (err) {
      this._handleException(err);
      return false;
    }
  }

  /**
   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
   * does not support a teardown
   */
   stop(reason) {
    if (!this._isEnabled) {
      return;
    }

    try {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        const msg = `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`;

        // When `traceInternals` is enabled, we want to log this to the console
        // Else, use the regular debug output
        // eslint-disable-next-line
        const log = this.getOptions()._experiments.traceInternals ? console.warn : utils.logger.log;
        log(msg);
      }

      this._isEnabled = false;
      this._removeListeners();
      this.stopRecording();
      this.eventBuffer && this.eventBuffer.destroy();
      this.eventBuffer = null;
      this._debouncedFlush.cancel();
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Pause some replay functionality. See comments for `_isPaused`.
   * This differs from stop as this only stops DOM recording, it is
   * not as thorough of a shutdown as `stop()`.
   */
   pause() {
    this._isPaused = true;
    this.stopRecording();
  }

  /**
   * Resumes recording, see notes for `pause().
   *
   * Note that calling `startRecording()` here will cause a
   * new DOM checkout.`
   */
   resume() {
    if (!this._loadAndCheckSession()) {
      return;
    }

    this._isPaused = false;
    this.startRecording();
  }

  /**
   * We want to batch uploads of replay events. Save events only if
   * `<flushMinDelay>` milliseconds have elapsed since the last event
   * *OR* if `<flushMaxDelay>` milliseconds have elapsed.
   *
   * Accepts a callback to perform side-effects and returns true to stop batch
   * processing and hand back control to caller.
   */
   addUpdate(cb) {
    // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'error'`)
    const cbResult = cb();

    // If this option is turned on then we will only want to call `flush`
    // explicitly
    if (this.recordingMode === 'error') {
      return;
    }

    // If callback is true, we do not want to continue with flushing -- the
    // caller will need to handle it.
    if (cbResult === true) {
      return;
    }

    // addUpdate is called quite frequently - use _debouncedFlush so that it
    // respects the flush delays and does not flush immediately
    this._debouncedFlush();
  }

  /**
   * Updates the user activity timestamp and resumes recording. This should be
   * called in an event handler for a user action that we consider as the user
   * being "active" (e.g. a mouse click).
   */
   triggerUserActivity() {
    this._updateUserActivity();

    // This case means that recording was once stopped due to inactivity.
    // Ensure that recording is resumed.
    if (!this._stopRecording) {
      // Create a new session, otherwise when the user action is flushed, it
      // will get rejected due to an expired session.
      if (!this._loadAndCheckSession()) {
        return;
      }

      // Note: This will cause a new DOM checkout
      this.resume();
      return;
    }

    // Otherwise... recording was never suspended, continue as normalish
    this.checkAndHandleExpiredSession();

    this._updateSessionActivity();
  }

  /**
   *
   * Always flush via `_debouncedFlush` so that we do not have flushes triggered
   * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
   * cases of mulitple flushes happening closely together.
   */
   flushImmediate() {
    this._debouncedFlush();
    // `.flush` is provided by the debounced function, analogously to lodash.debounce
    return this._debouncedFlush.flush() ;
  }

  /** Get the current sesion (=replay) ID */
   getSessionId() {
    return this.session && this.session.id;
  }

  /**
   * Checks if recording should be stopped due to user inactivity. Otherwise
   * check if session is expired and create a new session if so. Triggers a new
   * full snapshot on new session.
   *
   * Returns true if session is not expired, false otherwise.
   * @hidden
   */
   checkAndHandleExpiredSession() {
    const oldSessionId = this.getSessionId();

    // Prevent starting a new session if the last user activity is older than
    // SESSION_IDLE_DURATION. Otherwise non-user activity can trigger a new
    // session+recording. This creates noisy replays that do not have much
    // content in them.
    if (
      this._lastActivity &&
      isExpired(this._lastActivity, this.timeouts.sessionIdle) &&
      this.session &&
      this.session.sampled === 'session'
    ) {
      // Pause recording only for session-based replays. Otherwise, resuming
      // will create a new replay and will conflict with users who only choose
      // to record error-based replays only. (e.g. the resumed replay will not
      // contain a reference to an error)
      this.pause();
      return;
    }

    // --- There is recent user activity --- //
    // This will create a new session if expired, based on expiry length
    if (!this._loadAndCheckSession()) {
      return;
    }

    // Session was expired if session ids do not match
    const expired = oldSessionId !== this.getSessionId();

    if (!expired) {
      return true;
    }

    // Session is expired, trigger a full snapshot (which will create a new session)
    this._triggerFullSnapshot();

    return false;
  }

  /**
   * Capture some initial state that can change throughout the lifespan of the
   * replay. This is required because otherwise they would be captured at the
   * first flush.
   */
   setInitialState() {
    const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;
    const url = `${WINDOW.location.origin}${urlPath}`;

    this.performanceEvents = [];

    // Reset _context as well
    this._clearContext();

    this._context.initialUrl = url;
    this._context.initialTimestamp = Date.now();
    this._context.urls.push(url);
  }

  /** A wrapper to conditionally capture exceptions. */
   _handleException(error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay]', error);

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && this._options._experiments && this._options._experiments.captureExceptions) {
      core.captureException(error);
    }
  }

  /**
   * Loads (or refreshes) the current session.
   * Returns false if session is not recorded.
   */
   _loadAndCheckSession() {
    const { type, session } = getSession({
      timeouts: this.timeouts,
      stickySession: Boolean(this._options.stickySession),
      currentSession: this.session,
      sessionSampleRate: this._options.sessionSampleRate,
      errorSampleRate: this._options.errorSampleRate,
    });

    // If session was newly created (i.e. was not loaded from storage), then
    // enable flag to create the root replay
    if (type === 'new') {
      this.setInitialState();
    }

    const currentSessionId = this.getSessionId();
    if (session.id !== currentSessionId) {
      session.previousSessionId = currentSessionId;
    }

    this.session = session;

    if (!this.session.sampled) {
      this.stop('session unsampled');
      return false;
    }

    return true;
  }

  /**
   * Adds listeners to record events for the replay
   */
   _addListeners() {
    try {
      WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);
      WINDOW.addEventListener('blur', this._handleWindowBlur);
      WINDOW.addEventListener('focus', this._handleWindowFocus);

      // There is no way to remove these listeners, so ensure they are only added once
      if (!this._hasInitializedCoreListeners) {
        addGlobalListeners(this);

        this._hasInitializedCoreListeners = true;
      }
    } catch (err) {
      this._handleException(err);
    }

    // PerformanceObserver //
    if (!('PerformanceObserver' in WINDOW)) {
      return;
    }

    this._performanceObserver = setupPerformanceObserver(this);
  }

  /**
   * Cleans up listeners that were created in `_addListeners`
   */
   _removeListeners() {
    try {
      WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);

      WINDOW.removeEventListener('blur', this._handleWindowBlur);
      WINDOW.removeEventListener('focus', this._handleWindowFocus);

      if (this._performanceObserver) {
        this._performanceObserver.disconnect();
        this._performanceObserver = null;
      }
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Handle when visibility of the page content changes. Opening a new tab will
   * cause the state to change to hidden because of content of current page will
   * be hidden. Likewise, moving a different window to cover the contents of the
   * page will also trigger a change to a hidden state.
   */
   __init13() {this._handleVisibilityChange = () => {
    if (WINDOW.document.visibilityState === 'visible') {
      this._doChangeToForegroundTasks();
    } else {
      this._doChangeToBackgroundTasks();
    }
  };}

  /**
   * Handle when page is blurred
   */
   __init14() {this._handleWindowBlur = () => {
    const breadcrumb = createBreadcrumb({
      category: 'ui.blur',
    });

    // Do not count blur as a user action -- it's part of the process of them
    // leaving the page
    this._doChangeToBackgroundTasks(breadcrumb);
  };}

  /**
   * Handle when page is focused
   */
   __init15() {this._handleWindowFocus = () => {
    const breadcrumb = createBreadcrumb({
      category: 'ui.focus',
    });

    // Do not count focus as a user action -- instead wait until they focus and
    // interactive with page
    this._doChangeToForegroundTasks(breadcrumb);
  };}

  /**
   * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
   */
   _doChangeToBackgroundTasks(breadcrumb) {
    if (!this.session) {
      return;
    }

    const expired = isSessionExpired(this.session, this.timeouts);

    if (breadcrumb && !expired) {
      this._createCustomBreadcrumb(breadcrumb);
    }

    // Send replay when the page/tab becomes hidden. There is no reason to send
    // replay if it becomes visible, since no actions we care about were done
    // while it was hidden
    this._conditionalFlush();
  }

  /**
   * Tasks to run when we consider a page to be visible (via focus and/or visibility)
   */
   _doChangeToForegroundTasks(breadcrumb) {
    if (!this.session) {
      return;
    }

    const isSessionActive = this.checkAndHandleExpiredSession();

    if (!isSessionActive) {
      // If the user has come back to the page within SESSION_IDLE_DURATION
      // ms, we will re-use the existing session, otherwise create a new
      // session
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Document has become active, but session has expired');
      return;
    }

    if (breadcrumb) {
      this._createCustomBreadcrumb(breadcrumb);
    }
  }

  /**
   * Trigger rrweb to take a full snapshot which will cause this plugin to
   * create a new Replay event.
   */
   _triggerFullSnapshot(checkout = true) {
    try {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.log('[Replay] Taking full rrweb snapshot');
      record.takeFullSnapshot(checkout);
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Update user activity (across session lifespans)
   */
   _updateUserActivity(_lastActivity = Date.now()) {
    this._lastActivity = _lastActivity;
  }

  /**
   * Updates the session's last activity timestamp
   */
   _updateSessionActivity(_lastActivity = Date.now()) {
    if (this.session) {
      this.session.lastActivity = _lastActivity;
      this._maybeSaveSession();
    }
  }

  /**
   * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
   */
   _createCustomBreadcrumb(breadcrumb) {
    this.addUpdate(() => {
      void addEvent(this, {
        type: EventType.Custom,
        timestamp: breadcrumb.timestamp || 0,
        data: {
          tag: 'breadcrumb',
          payload: breadcrumb,
        },
      });
    });
  }

  /**
   * Observed performance events are added to `this.performanceEvents`. These
   * are included in the replay event before it is finished and sent to Sentry.
   */
   _addPerformanceEntries() {
    // Copy and reset entries before processing
    const entries = [...this.performanceEvents];
    this.performanceEvents = [];

    return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));
  }

  /**
   * Only flush if `this.recordingMode === 'session'`
   */
   _conditionalFlush() {
    if (this.recordingMode === 'error') {
      return;
    }

    void this.flushImmediate();
  }

  /**
   * Clear _context
   */
   _clearContext() {
    // XXX: `initialTimestamp` and `initialUrl` do not get cleared
    this._context.errorIds.clear();
    this._context.traceIds.clear();
    this._context.urls = [];
    this._context.earliestEvent = null;
  }

  /**
   * Return and clear _context
   */
   _popEventContext() {
    if (this._context.earliestEvent && this._context.earliestEvent < this._context.initialTimestamp) {
      this._context.initialTimestamp = this._context.earliestEvent;
    }

    const _context = {
      initialTimestamp: this._context.initialTimestamp,
      initialUrl: this._context.initialUrl,
      errorIds: Array.from(this._context.errorIds).filter(Boolean),
      traceIds: Array.from(this._context.traceIds).filter(Boolean),
      urls: this._context.urls,
    };

    this._clearContext();

    return _context;
  }

  /**
   * Flushes replay event buffer to Sentry.
   *
   * Performance events are only added right before flushing - this is
   * due to the buffered performance observer events.
   *
   * Should never be called directly, only by `flush`
   */
   async _runFlush() {
    if (!this.session || !this.eventBuffer) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay] No session or eventBuffer found to flush.');
      return;
    }

    await this._addPerformanceEntries();

    // Check eventBuffer again, as it could have been stopped in the meanwhile
    if (!this.eventBuffer || !this.eventBuffer.hasEvents) {
      return;
    }

    // Only attach memory event if eventBuffer is not empty
    await addMemoryEntry(this);

    // Check eventBuffer again, as it could have been stopped in the meanwhile
    if (!this.eventBuffer) {
      return;
    }

    try {
      // Note this empties the event buffer regardless of outcome of sending replay
      const recordingData = await this.eventBuffer.finish();

      // NOTE: Copy values from instance members, as it's possible they could
      // change before the flush finishes.
      const replayId = this.session.id;
      const eventContext = this._popEventContext();
      // Always increment segmentId regardless of outcome of sending replay
      const segmentId = this.session.segmentId++;
      this._maybeSaveSession();

      await sendReplay({
        replayId,
        recordingData,
        segmentId,
        eventContext,
        session: this.session,
        options: this.getOptions(),
        timestamp: Date.now(),
      });
    } catch (err) {
      this._handleException(err);

      // This means we retried 3 times and all of them failed,
      // or we ran into a problem we don't want to retry, like rate limiting.
      // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments
      this.stop('sendReplay');

      const client = core.getCurrentHub().getClient();

      if (client) {
        client.recordDroppedEvent('send_error', 'replay');
      }
    }
  }

  /**
   * Flush recording data to Sentry. Creates a lock so that only a single flush
   * can be active at a time. Do not call this directly.
   */
   __init16() {this._flush = async () => {
    if (!this._isEnabled) {
      // This can happen if e.g. the replay was stopped because of exceeding the retry limit
      return;
    }

    if (!this.checkAndHandleExpiredSession()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay] Attempting to finish replay event after session expired.');
      return;
    }

    if (!this.session) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error('[Replay] No session found to flush.');
      return;
    }

    // A flush is about to happen, cancel any queued flushes
    this._debouncedFlush.cancel();

    // this._flushLock acts as a lock so that future calls to `_flush()`
    // will be blocked until this promise resolves
    if (!this._flushLock) {
      this._flushLock = this._runFlush();
      await this._flushLock;
      this._flushLock = null;
      return;
    }

    // Wait for previous flush to finish, then call the debounced `_flush()`.
    // It's possible there are other flush requests queued and waiting for it
    // to resolve. We want to reduce all outstanding requests (as well as any
    // new flush requests that occur within a second of the locked flush
    // completing) into a single flush.

    try {
      await this._flushLock;
    } catch (err) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.error(err);
    } finally {
      this._debouncedFlush();
    }
  };}

  /** Save the session, if it is sticky */
   _maybeSaveSession() {
    if (this.session && this._options.stickySession) {
      saveSession(this.session);
    }
  }

  /** Handler for rrweb.record.onMutation */
   __init17() {this._onMutationHandler = (mutations) => {
    const count = mutations.length;

    const mutationLimit = this._options._experiments.mutationLimit || 0;
    const mutationBreadcrumbLimit = this._options._experiments.mutationBreadcrumbLimit || 1000;
    const overMutationLimit = mutationLimit && count > mutationLimit;

    // Create a breadcrumb if a lot of mutations happen at the same time
    // We can show this in the UI as an information with potential performance improvements
    if (count > mutationBreadcrumbLimit || overMutationLimit) {
      const breadcrumb = createBreadcrumb({
        category: 'replay.mutations',
        data: {
          count,
        },
      });
      this._createCustomBreadcrumb(breadcrumb);
    }

    if (overMutationLimit) {
      // We want to skip doing an incremental snapshot if there are too many mutations
      // Instead, we do a full snapshot
      this._triggerFullSnapshot(false);
      return false;
    }

    // `true` means we use the regular mutation handling by rrweb
    return true;
  };}
}

function _getExperimentalOptions(options) {
  const requestHeaders = options._experiments.captureRequestHeaders || [];
  const responseHeaders = options._experiments.captureResponseHeaders || [];
  const captureBodies = options._experiments.captureNetworkBodies || false;

  // Add defaults
  const defaultHeaders = ['content-length', 'content-type', 'accept'];

  return {
    network: {
      captureBodies,
      requestHeaders: [...defaultHeaders, ...requestHeaders.map(header => header.toLowerCase())],
      responseHeaders: [...defaultHeaders, ...responseHeaders.map(header => header.toLowerCase())],
    },
  };
}

function getOption(
  selectors,
  defaultSelectors,
  deprecatedClassOption,
  deprecatedSelectorOption,
) {
  const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];

  const allSelectors = [
    ...selectors,
    // @deprecated
    ...deprecatedSelectors,

    // sentry defaults
    ...defaultSelectors,
  ];

  // @deprecated
  if (typeof deprecatedClassOption !== 'undefined') {
    // NOTE: No support for RegExp
    if (typeof deprecatedClassOption === 'string') {
      allSelectors.push(`.${deprecatedClassOption}`);
    }

    // eslint-disable-next-line no-console
    console.warn(
      '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',
    );
  }

  return allSelectors.join(',');
}

/**
 * Returns privacy related configuration for use in rrweb
 */
function getPrivacyOptions({
  mask,
  unmask,
  block,
  unblock,
  ignore,

  // eslint-disable-next-line deprecation/deprecation
  blockClass,
  // eslint-disable-next-line deprecation/deprecation
  blockSelector,
  // eslint-disable-next-line deprecation/deprecation
  maskTextClass,
  // eslint-disable-next-line deprecation/deprecation
  maskTextSelector,
  // eslint-disable-next-line deprecation/deprecation
  ignoreClass,
}) {
  const defaultBlockedElements = ['base[href="/"]'];

  const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);
  const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);

  const options = {
    // We are making the decision to make text and input selectors the same
    maskTextSelector: maskSelector,
    unmaskTextSelector: unmaskSelector,
    maskInputSelector: maskSelector,
    unmaskInputSelector: unmaskSelector,

    blockSelector: getOption(
      block,
      ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],
      blockClass,
      blockSelector,
    ),
    unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),
    ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type="file"]'], ignoreClass),
  };

  if (blockClass instanceof RegExp) {
    options.blockClass = blockClass;
  }

  if (maskTextClass instanceof RegExp) {
    options.maskTextClass = maskTextClass;
  }

  return options;
}

/**
 * Returns true if we are in the browser.
 */
function isBrowser() {
  // eslint-disable-next-line no-restricted-globals
  return typeof window !== 'undefined' && (!utils.isNodeEnv() || isElectronNodeRenderer());
}

// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them
function isElectronNodeRenderer() {
  return typeof process !== 'undefined' && (process ).type === 'renderer';
}

const MEDIA_SELECTORS =
  'img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]';

let _initialized = false;

/**
 * The main replay integration class, to be passed to `init({  integrations: [] })`.
 */
class Replay  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Replay';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Replay.id;}

  /**
   * Options to pass to `rrweb.record()`
   */

  /**
   * Initial options passed to the replay integration, merged with default values.
   * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
   * can only be finally set when setupOnce() is called.
   *
   * @private
   */

   constructor({
    flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,
    flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,
    stickySession = true,
    useCompression = true,
    _experiments = {},
    sessionSampleRate,
    errorSampleRate,
    maskAllText = true,
    maskAllInputs = true,
    blockAllMedia = true,

    mask = [],
    unmask = [],
    block = [],
    unblock = [],
    ignore = [],
    maskFn,

    // eslint-disable-next-line deprecation/deprecation
    blockClass,
    // eslint-disable-next-line deprecation/deprecation
    blockSelector,
    // eslint-disable-next-line deprecation/deprecation
    maskInputOptions,
    // eslint-disable-next-line deprecation/deprecation
    maskTextClass,
    // eslint-disable-next-line deprecation/deprecation
    maskTextSelector,
    // eslint-disable-next-line deprecation/deprecation
    ignoreClass,
  } = {}) {Replay.prototype.__init.call(this);
    this._recordingOptions = {
      maskAllInputs,
      maskAllText,
      maskInputOptions: { ...(maskInputOptions || {}), password: true },
      maskTextFn: maskFn,
      maskInputFn: maskFn,

      ...getPrivacyOptions({
        mask,
        unmask,
        block,
        unblock,
        ignore,
        blockClass,
        blockSelector,
        maskTextClass,
        maskTextSelector,
        ignoreClass,
      }),

      // Our defaults
      slimDOMOptions: 'all',
      inlineStylesheet: true,
      // Disable inline images as it will increase segment/replay size
      inlineImages: false,
      // collect fonts, but be aware that `sentry.io` needs to be an allowed
      // origin for playback
      collectFonts: true,
    };

    this._initialOptions = {
      flushMinDelay,
      flushMaxDelay,
      stickySession,
      sessionSampleRate,
      errorSampleRate,
      useCompression,
      blockAllMedia,
      _experiments,
    };

    if (typeof sessionSampleRate === 'number') {
      // eslint-disable-next-line
      console.warn(
        `[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,
      );

      this._initialOptions.sessionSampleRate = sessionSampleRate;
    }

    if (typeof errorSampleRate === 'number') {
      // eslint-disable-next-line
      console.warn(
        `[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
      );

      this._initialOptions.errorSampleRate = errorSampleRate;
    }

    if (this._initialOptions.blockAllMedia) {
      // `blockAllMedia` is a more user friendly option to configure blocking
      // embedded media elements
      this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector
        ? MEDIA_SELECTORS
        : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;
    }

    if (this._isInitialized && isBrowser()) {
      throw new Error('Multiple Sentry Session Replay instances are not supported');
    }

    this._isInitialized = true;
  }

  /** If replay has already been initialized */
   get _isInitialized() {
    return _initialized;
  }

  /** Update _isInitialized */
   set _isInitialized(value) {
    _initialized = value;
  }

  /**
   * We previously used to create a transaction in `setupOnce` and it would
   * potentially create a transaction before some native SDK integrations have run
   * and applied their own global event processor. An example is:
   * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
   *
   * So we call `replay.setup` in next event loop as a workaround to wait for other
   * global event processors to finish. This is no longer needed, but keeping it
   * here to avoid any future issues.
   */
   setupOnce() {
    if (!isBrowser()) {
      return;
    }

    this._setup();

    // XXX: See method comments above
    setTimeout(() => this.start());
  }

  /**
   * Initializes the plugin.
   *
   * Creates or loads a session, attaches listeners to varying events (DOM,
   * PerformanceObserver, Recording, Sentry SDK, etc)
   */
   start() {
    if (!this._replay) {
      return;
    }

    this._replay.start();
  }

  /**
   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
   * does not support a teardown
   */
   stop() {
    if (!this._replay) {
      return;
    }

    this._replay.stop();
  }

  /**
   * Immediately send all pending events.
   */
   flush() {
    if (!this._replay || !this._replay.isEnabled()) {
      return;
    }

    return this._replay.flushImmediate();
  }

  /**
   * Get the current session ID.
   */
   getReplayId() {
    if (!this._replay || !this._replay.isEnabled()) {
      return;
    }

    return this._replay.getSessionId();
  }

  /** Setup the integration. */
   _setup() {
    // Client is not available in constructor, so we need to wait until setupOnce
    const finalOptions = loadReplayOptionsFromClient(this._initialOptions);

    this._replay = new ReplayContainer({
      options: finalOptions,
      recordingOptions: this._recordingOptions,
    });
  }
} Replay.__initStatic();

/** Parse Replay-related options from SDK options */
function loadReplayOptionsFromClient(initialOptions) {
  const client = core.getCurrentHub().getClient();
  const opt = client && (client.getOptions() );

  const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...utils.dropUndefinedKeys(initialOptions) };

  if (!opt) {
    // eslint-disable-next-line no-console
    console.warn('SDK client is not available.');
    return finalOptions;
  }

  if (
    initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed
    initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed
    opt.replaysSessionSampleRate == null &&
    opt.replaysOnErrorSampleRate == null
  ) {
    // eslint-disable-next-line no-console
    console.warn(
      'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',
    );
  }

  if (typeof opt.replaysSessionSampleRate === 'number') {
    finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;
  }

  if (typeof opt.replaysOnErrorSampleRate === 'number') {
    finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;
  }

  return finalOptions;
}

exports.Replay = Replay;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/constants.ts","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/types.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/utils.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/sentry/callbackWrapper.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observer.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/tslib/tslib.es6.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/index.js","../../../src/util/dedupePerformanceEntries.ts","../../../src/coreHandlers/performanceObserver.ts","../../../../replay-worker/build/npm/esm/worker.ts","../../../../replay-worker/build/npm/esm/index.js","../../../src/eventBuffer/EventBufferArray.ts","../../../src/eventBuffer/WorkerHandler.ts","../../../src/eventBuffer/EventBufferCompressionWorker.ts","../../../src/eventBuffer/EventBufferProxy.ts","../../../src/eventBuffer/index.ts","../../../src/util/isExpired.ts","../../../src/util/isSessionExpired.ts","../../../src/session/saveSession.ts","../../../src/util/isSampled.ts","../../../src/session/Session.ts","../../../src/session/createSession.ts","../../../src/session/fetchSession.ts","../../../src/session/getSession.ts","../../../src/util/addEvent.ts","../../../src/util/eventUtils.ts","../../../src/coreHandlers/handleAfterSendEvent.ts","../../../../../node_modules/@sentry-internal/rrweb-snapshot/es/rrweb-snapshot.js","../../../src/util/createBreadcrumb.ts","../../../src/coreHandlers/util/addBreadcrumbEvent.ts","../../../src/coreHandlers/util/getAttributesToRecord.ts","../../../src/coreHandlers/handleDom.ts","../../../src/util/isRrwebError.ts","../../../src/coreHandlers/handleGlobalEvent.ts","../../../src/util/createPerformanceSpans.ts","../../../src/coreHandlers/handleHistory.ts","../../../src/util/shouldFilterRequest.ts","../../../src/coreHandlers/util/addNetworkBreadcrumb.ts","../../../src/coreHandlers/handleFetch.ts","../../../src/coreHandlers/handleXhr.ts","../../../src/coreHandlers/util/networkUtils.ts","../../../src/coreHandlers/util/fetchUtils.ts","../../../src/coreHandlers/util/xhrUtils.ts","../../../src/coreHandlers/handleNetworkBreadcrumbs.ts","../../../src/coreHandlers/handleScope.ts","../../../src/util/addGlobalListeners.ts","../../../src/util/addMemoryEntry.ts","../../../src/util/createPerformanceEntries.ts","../../../src/util/debounce.ts","../../../src/util/handleRecordingEmit.ts","../../../src/util/createReplayEnvelope.ts","../../../src/util/prepareRecordingData.ts","../../../src/util/prepareReplayEvent.ts","../../../src/util/sendReplayRequest.ts","../../../src/util/sendReplay.ts","../../../src/replay.ts","../../../src/util/getPrivacyOptions.ts","../../../src/util/isBrowser.ts","../../../src/integration.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/utils';\n\n// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nexport const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const REPLAY_EVENT_NAME = 'replay_event';\nexport const RECORDING_EVENT_NAME = 'replay_recording';\nexport const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';\n\n// The idle limit for a session\nexport const SESSION_IDLE_DURATION = 300_000; // 5 minutes in ms\n\n// The maximum length of a session\nexport const MAX_SESSION_LIFE = 3_600_000; // 60 minutes\n\n/** Default flush delays */\nexport const DEFAULT_FLUSH_MIN_DELAY = 5_000;\n// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\nexport const DEFAULT_FLUSH_MAX_DELAY = 5_500;\n\n/* How long to wait for error checkouts */\nexport const ERROR_CHECKOUT_TIME = 60_000;\n\nexport const RETRY_BASE_INTERVAL = 5000;\nexport const RETRY_MAX_COUNT = 3;\n\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be dropped. */\nexport const NETWORK_BODY_MAX_SIZE = 300_000;\n","var NodeType;\n(function (NodeType) {\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\n    return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n    const host = n === null || n === void 0 ? void 0 : n.host;\n    return Boolean(host && host.shadowRoot && host.shadowRoot === n);\n}\nfunction isInputTypeMasked({ maskInputOptions, tagName, type, }) {\n    if (tagName.toLowerCase() === 'option') {\n        tagName = 'select';\n    }\n    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;\n    return (maskInputOptions[tagName.toLowerCase()] ||\n        (actualType && maskInputOptions[actualType]) ||\n        actualType === 'password' ||\n        (tagName === 'input' && !type && maskInputOptions['text']));\n}\nfunction hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {\n    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));\n}\nfunction maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {\n    let text = value || '';\n    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {\n        return text;\n    }\n    if (input.hasAttribute('rr_is_password')) {\n        type = 'password';\n    }\n    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||\n        (maskInputSelector && input.matches(maskInputSelector))) {\n        if (maskInputFn) {\n            text = maskInputFn(text);\n        }\n        else {\n            text = '*'.repeat(text.length);\n        }\n    }\n    return text;\n}\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\nfunction is2DCanvasBlank(canvas) {\n    const ctx = canvas.getContext('2d');\n    if (!ctx)\n        return true;\n    const chunkSize = 50;\n    for (let x = 0; x < canvas.width; x += chunkSize) {\n        for (let y = 0; y < canvas.height; y += chunkSize) {\n            const getImageData = ctx.getImageData;\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\n                : getImageData;\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n            if (pixelBuffer.some((pixel) => pixel !== 0))\n                return false;\n        }\n    }\n    return true;\n}\n\nlet _id = 1;\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\nconst IGNORED_NODE = -2;\nfunction defaultMaskFn(str) {\n    return str ? str.replace(/[\\S]/g, '*') : '';\n}\nfunction genId() {\n    return _id++;\n}\nfunction getValidTagName(element) {\n    if (element instanceof HTMLFormElement) {\n        return 'form';\n    }\n    const processedTagName = element.tagName.toLowerCase().trim();\n    if (tagNameRegex.test(processedTagName)) {\n        return 'div';\n    }\n    return processedTagName;\n}\nfunction getCssRulesString(s) {\n    try {\n        const rules = s.rules || s.cssRules;\n        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;\n    }\n    catch (error) {\n        return null;\n    }\n}\nfunction getCssRuleString(rule) {\n    let cssStringified = rule.cssText;\n    if (isCSSImportRule(rule)) {\n        try {\n            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;\n        }\n        catch (_a) {\n        }\n    }\n    return cssStringified;\n}\nfunction isCSSImportRule(rule) {\n    return 'styleSheet' in rule;\n}\nfunction stringifyStyleSheet(sheet) {\n    return sheet.cssRules\n        ? Array.from(sheet.cssRules)\n            .map((rule) => rule.cssText || '')\n            .join('')\n        : '';\n}\nfunction extractOrigin(url) {\n    let origin = '';\n    if (url.indexOf('//') > -1) {\n        origin = url.split('/').slice(0, 3).join('/');\n    }\n    else {\n        origin = url.split('/')[0];\n    }\n    origin = origin.split('?')[0];\n    return origin;\n}\nlet canvasService;\nlet canvasCtx;\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst RELATIVE_PATH = /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/|#).*/;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absoluteToStylesheet(cssText, href) {\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\n        const filePath = path1 || path2 || path3;\n        const maybeQuote = quote1 || quote2 || '';\n        if (!filePath) {\n            return origin;\n        }\n        if (!RELATIVE_PATH.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (DATA_URI.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (filePath[0] === '/') {\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n        }\n        const stack = href.split('/');\n        const parts = filePath.split('/');\n        stack.pop();\n        for (const part of parts) {\n            if (part === '.') {\n                continue;\n            }\n            else if (part === '..') {\n                stack.pop();\n            }\n            else {\n                stack.push(part);\n            }\n        }\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\n    });\n}\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n    if (attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    let pos = 0;\n    function collectCharacters(regEx) {\n        let chars;\n        let match = regEx.exec(attributeValue.substring(pos));\n        if (match) {\n            chars = match[0];\n            pos += chars.length;\n            return chars;\n        }\n        return '';\n    }\n    let output = [];\n    while (true) {\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\n        if (pos >= attributeValue.length) {\n            break;\n        }\n        let url = collectCharacters(SRCSET_NOT_SPACES);\n        if (url.slice(-1) === ',') {\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n            output.push(url);\n        }\n        else {\n            let descriptorsStr = '';\n            url = absoluteToDoc(doc, url);\n            let inParens = false;\n            while (true) {\n                let c = attributeValue.charAt(pos);\n                if (c === '') {\n                    output.push((url + descriptorsStr).trim());\n                    break;\n                }\n                else if (!inParens) {\n                    if (c === ',') {\n                        pos += 1;\n                        output.push((url + descriptorsStr).trim());\n                        break;\n                    }\n                    else if (c === '(') {\n                        inParens = true;\n                    }\n                }\n                else {\n                    if (c === ')') {\n                        inParens = false;\n                    }\n                }\n                descriptorsStr += c;\n                pos += 1;\n            }\n        }\n    }\n    return output.join(', ');\n}\nfunction absoluteToDoc(doc, attributeValue) {\n    if (!attributeValue || attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    const a = doc.createElement('a');\n    a.href = attributeValue;\n    return a.href;\n}\nfunction isSVGElement(el) {\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\nfunction getHref() {\n    const a = document.createElement('a');\n    a.href = '';\n    return a.href;\n}\nfunction transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {\n    if (!value) {\n        return value;\n    }\n    const name = _name.toLowerCase();\n    const tagName = _tagName.toLowerCase();\n    if (name === 'src' || name === 'href') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'xlink:href' && value[0] !== '#') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'background' &&\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'srcset') {\n        return getAbsoluteSrcsetString(doc, value);\n    }\n    else if (name === 'style') {\n        return absoluteToStylesheet(value, getHref());\n    }\n    else if (tagName === 'object' && name === 'data') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (maskAllText &&\n        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {\n        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);\n    }\n    return value;\n}\nfunction _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {\n    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {\n        return false;\n    }\n    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||\n        (tagName === 'input' &&\n            attribute === 'value' &&\n            element.hasAttribute('type') &&\n            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));\n}\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n    if (unblockSelector && element.matches(unblockSelector)) {\n        return false;\n    }\n    if (typeof blockClass === 'string') {\n        if (element.classList.contains(blockClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {\n            const className = element.classList[eIndex];\n            if (blockClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (blockSelector) {\n        return element.matches(blockSelector);\n    }\n    return false;\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType !== node.ELEMENT_NODE) {\n        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n    }\n    if (unmaskTextSelector) {\n        if (node.matches(unmaskTextSelector) ||\n            node.closest(unmaskTextSelector)) {\n            return false;\n        }\n    }\n    if (maskAllText) {\n        return true;\n    }\n    if (typeof maskTextClass === 'string') {\n        if (node.classList.contains(maskTextClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {\n            const className = node.classList[eIndex];\n            if (maskTextClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (maskTextSelector) {\n        if (node.matches(maskTextSelector)) {\n            return true;\n        }\n    }\n    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n    const win = iframeEl.contentWindow;\n    if (!win) {\n        return;\n    }\n    let fired = false;\n    let readyState;\n    try {\n        readyState = win.document.readyState;\n    }\n    catch (error) {\n        return;\n    }\n    if (readyState !== 'complete') {\n        const timer = setTimeout(() => {\n            if (!fired) {\n                listener();\n                fired = true;\n            }\n        }, iframeLoadTimeout);\n        iframeEl.addEventListener('load', () => {\n            clearTimeout(timer);\n            fired = true;\n            listener();\n        });\n        return;\n    }\n    const blankUrl = 'about:blank';\n    if (win.location.href !== blankUrl ||\n        iframeEl.src === blankUrl ||\n        iframeEl.src === '') {\n        setTimeout(listener, 0);\n        return;\n    }\n    iframeEl.addEventListener('load', listener);\n}\nfunction serializeNode(n, options) {\n    var _a;\n    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;\n    let rootId;\n    if (doc.__sn) {\n        const docId = doc.__sn.id;\n        rootId = docId === 1 ? undefined : docId;\n    }\n    switch (n.nodeType) {\n        case n.DOCUMENT_NODE:\n            if (n.compatMode !== 'CSS1Compat') {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    compatMode: n.compatMode,\n                    rootId,\n                };\n            }\n            else {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    rootId,\n                };\n            }\n        case n.DOCUMENT_TYPE_NODE:\n            return {\n                type: NodeType.DocumentType,\n                name: n.name,\n                publicId: n.publicId,\n                systemId: n.systemId,\n                rootId,\n            };\n        case n.ELEMENT_NODE:\n            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n            const tagName = getValidTagName(n);\n            let attributes = {};\n            for (const { name, value } of Array.from(n.attributes)) {\n                if (!skipAttribute(tagName, name)) {\n                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);\n                }\n            }\n            if (tagName === 'link' && inlineStylesheet) {\n                const stylesheet = Array.from(doc.styleSheets).find((s) => {\n                    return s.href === n.href;\n                });\n                let cssText = null;\n                if (stylesheet) {\n                    cssText = getCssRulesString(stylesheet);\n                }\n                if (cssText) {\n                    delete attributes.rel;\n                    delete attributes.href;\n                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n                }\n            }\n            if (tagName === 'style' &&\n                n.sheet &&\n                !(n.innerText ||\n                    n.textContent ||\n                    '').trim().length) {\n                const cssText = getCssRulesString(n.sheet);\n                if (cssText) {\n                    attributes._cssText = absoluteToStylesheet(cssText, getHref());\n                }\n            }\n            if (tagName === 'input' ||\n                tagName === 'textarea' ||\n                tagName === 'select' ||\n                tagName === 'option') {\n                const el = n;\n                const value = getInputValue(tagName, el, attributes);\n                const checked = n.checked;\n                if (attributes.type !== 'submit' &&\n                    attributes.type !== 'button' &&\n                    value) {\n                    attributes.value = maskInputValue({\n                        input: el,\n                        type: attributes.type,\n                        tagName,\n                        value,\n                        maskInputSelector,\n                        unmaskInputSelector,\n                        maskInputOptions,\n                        maskInputFn,\n                    });\n                }\n                if (checked) {\n                    attributes.checked = checked;\n                }\n            }\n            if (tagName === 'option') {\n                if (n.selected && !maskInputOptions['select']) {\n                    attributes.selected = true;\n                }\n                else {\n                    delete attributes.selected;\n                }\n            }\n            if (tagName === 'canvas' && recordCanvas) {\n                if (n.__context === '2d') {\n                    if (!is2DCanvasBlank(n)) {\n                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                }\n                else if (!('__context' in n)) {\n                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    const blankCanvas = document.createElement('canvas');\n                    blankCanvas.width = n.width;\n                    blankCanvas.height = n.height;\n                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    if (canvasDataURL !== blankCanvasDataURL) {\n                        attributes.rr_dataURL = canvasDataURL;\n                    }\n                }\n            }\n            if (tagName === 'img' && inlineImages) {\n                if (!canvasService) {\n                    canvasService = doc.createElement('canvas');\n                    canvasCtx = canvasService.getContext('2d');\n                }\n                const image = n;\n                const oldValue = image.crossOrigin;\n                image.crossOrigin = 'anonymous';\n                const recordInlineImage = () => {\n                    try {\n                        canvasService.width = image.naturalWidth;\n                        canvasService.height = image.naturalHeight;\n                        canvasCtx.drawImage(image, 0, 0);\n                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                    catch (err) {\n                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\n                    }\n                    oldValue\n                        ? (attributes.crossOrigin = oldValue)\n                        : delete attributes.crossOrigin;\n                };\n                if (image.complete && image.naturalWidth !== 0)\n                    recordInlineImage();\n                else\n                    image.onload = recordInlineImage;\n            }\n            if (tagName === 'audio' || tagName === 'video') {\n                attributes.rr_mediaState = n.paused\n                    ? 'paused'\n                    : 'played';\n                attributes.rr_mediaCurrentTime = n.currentTime;\n            }\n            if (n.scrollLeft) {\n                attributes.rr_scrollLeft = n.scrollLeft;\n            }\n            if (n.scrollTop) {\n                attributes.rr_scrollTop = n.scrollTop;\n            }\n            if (needBlock) {\n                const { width, height } = n.getBoundingClientRect();\n                attributes = {\n                    class: attributes.class,\n                    rr_width: `${width}px`,\n                    rr_height: `${height}px`,\n                };\n            }\n            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n                if (!n.contentDocument) {\n                    attributes.rr_src = attributes.src;\n                }\n                delete attributes.src;\n            }\n            return {\n                type: NodeType.Element,\n                tagName,\n                attributes,\n                childNodes: [],\n                isSVG: isSVGElement(n) || undefined,\n                needBlock,\n                rootId,\n            };\n        case n.TEXT_NODE:\n            const parentTagName = n.parentNode && n.parentNode.tagName;\n            let textContent = n.textContent;\n            const isStyle = parentTagName === 'STYLE' ? true : undefined;\n            const isScript = parentTagName === 'SCRIPT' ? true : undefined;\n            if (isStyle && textContent) {\n                try {\n                    if (n.nextSibling || n.previousSibling) {\n                    }\n                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\n                        textContent = stringifyStyleSheet(n.parentNode.sheet);\n                    }\n                }\n                catch (err) {\n                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\n                }\n                textContent = absoluteToStylesheet(textContent, getHref());\n            }\n            if (isScript) {\n                textContent = 'SCRIPT_PLACEHOLDER';\n            }\n            if (parentTagName === 'TEXTAREA' && textContent) {\n                textContent = '';\n            }\n            else if (parentTagName === 'OPTION' && textContent) {\n                const option = n.parentNode;\n                textContent = maskInputValue({\n                    input: option,\n                    type: null,\n                    tagName: parentTagName,\n                    value: textContent,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskInputOptions,\n                    maskInputFn,\n                });\n            }\n            else if (!isStyle &&\n                !isScript &&\n                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&\n                textContent) {\n                textContent = maskTextFn\n                    ? maskTextFn(textContent)\n                    : defaultMaskFn(textContent);\n            }\n            return {\n                type: NodeType.Text,\n                textContent: textContent || '',\n                isStyle,\n                rootId,\n            };\n        case n.CDATA_SECTION_NODE:\n            return {\n                type: NodeType.CDATA,\n                textContent: '',\n                rootId,\n            };\n        case n.COMMENT_NODE:\n            return {\n                type: NodeType.Comment,\n                textContent: n.textContent || '',\n                rootId,\n            };\n        default:\n            return false;\n    }\n}\nfunction lowerIfExists(maybeAttr) {\n    if (maybeAttr === undefined || maybeAttr === null) {\n        return '';\n    }\n    else {\n        return maybeAttr.toLowerCase();\n    }\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\n        return true;\n    }\n    else if (sn.type === NodeType.Element) {\n        if (slimDOMOptions.script &&\n            (sn.tagName === 'script' ||\n                (sn.tagName === 'link' &&\n                    (sn.attributes.rel === 'preload' ||\n                        sn.attributes.rel === 'modulepreload') &&\n                    sn.attributes.as === 'script') ||\n                (sn.tagName === 'link' &&\n                    sn.attributes.rel === 'prefetch' &&\n                    typeof sn.attributes.href === 'string' &&\n                    sn.attributes.href.endsWith('.js')))) {\n            return true;\n        }\n        else if (slimDOMOptions.headFavicon &&\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\n                (sn.tagName === 'meta' &&\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\n            return true;\n        }\n        else if (sn.tagName === 'meta') {\n            if (slimDOMOptions.headMetaDescKeywords &&\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaSocial &&\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaRobots &&\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaHttpEquiv &&\n                sn.attributes['http-equiv'] !== undefined) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaAuthorship &&\n                (lowerIfExists(sn.attributes.name) === 'author' ||\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaVerification &&\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction serializeNodeWithId(n, options) {\n    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;\n    let { preserveWhiteSpace = true } = options;\n    const _serializedNode = serializeNode(n, {\n        doc,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        maskTextClass,\n        maskTextSelector,\n        unmaskTextSelector,\n        inlineStylesheet,\n        maskInputSelector,\n        unmaskInputSelector,\n        maskAllText,\n        maskInputOptions,\n        maskTextFn,\n        maskInputFn,\n        dataURLOptions,\n        inlineImages,\n        recordCanvas,\n        keepIframeSrcFn,\n    });\n    if (!_serializedNode) {\n        console.warn(n, 'not serialized');\n        return null;\n    }\n    let id;\n    if ('__sn' in n) {\n        id = n.__sn.id;\n    }\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\n        (!preserveWhiteSpace &&\n            _serializedNode.type === NodeType.Text &&\n            !_serializedNode.isStyle &&\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\n        id = IGNORED_NODE;\n    }\n    else {\n        id = genId();\n    }\n    const serializedNode = Object.assign(_serializedNode, { id });\n    n.__sn = serializedNode;\n    if (id === IGNORED_NODE) {\n        return null;\n    }\n    map[id] = n;\n    if (onSerialize) {\n        onSerialize(n);\n    }\n    let recordChild = !skipChild;\n    if (serializedNode.type === NodeType.Element) {\n        recordChild = recordChild && !serializedNode.needBlock;\n        delete serializedNode.needBlock;\n        if (n.shadowRoot)\n            serializedNode.isShadowHost = true;\n    }\n    if ((serializedNode.type === NodeType.Document ||\n        serializedNode.type === NodeType.Element) &&\n        recordChild) {\n        if (slimDOMOptions.headWhitespace &&\n            _serializedNode.type === NodeType.Element &&\n            _serializedNode.tagName === 'head') {\n            preserveWhiteSpace = false;\n        }\n        const bypassOptions = {\n            doc,\n            map,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        };\n        for (const childN of Array.from(n.childNodes)) {\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n            if (serializedChildNode) {\n                serializedNode.childNodes.push(serializedChildNode);\n            }\n        }\n        if (isElement(n) && n.shadowRoot) {\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n                if (serializedChildNode) {\n                    serializedChildNode.isShadow = true;\n                    serializedNode.childNodes.push(serializedChildNode);\n                }\n            }\n        }\n    }\n    if (n.parentNode && isShadowRoot(n.parentNode)) {\n        serializedNode.isShadow = true;\n    }\n    if (serializedNode.type === NodeType.Element &&\n        serializedNode.tagName === 'iframe') {\n        onceIframeLoaded(n, () => {\n            const iframeDoc = n.contentDocument;\n            if (iframeDoc && onIframeLoad) {\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n                    doc: iframeDoc,\n                    map,\n                    blockClass,\n                    blockSelector,\n                    unblockSelector,\n                    maskTextClass,\n                    maskTextSelector,\n                    unmaskTextSelector,\n                    skipChild: false,\n                    inlineStylesheet,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskAllText,\n                    maskInputOptions,\n                    maskTextFn,\n                    maskInputFn,\n                    slimDOMOptions,\n                    dataURLOptions,\n                    inlineImages,\n                    recordCanvas,\n                    preserveWhiteSpace,\n                    onSerialize,\n                    onIframeLoad,\n                    iframeLoadTimeout,\n                    keepIframeSrcFn,\n                });\n                if (serializedIframeNode) {\n                    onIframeLoad(n, serializedIframeNode);\n                }\n            }\n        }, iframeLoadTimeout);\n    }\n    return serializedNode;\n}\nfunction snapshot(n, options) {\n    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\n    const idNodeMap = {};\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n        }\n        : maskAllInputs === false\n            ? {}\n            : maskAllInputs;\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\n        ?\n            {\n                script: true,\n                comment: true,\n                headFavicon: true,\n                headWhitespace: true,\n                headMetaDescKeywords: slimDOM === 'all',\n                headMetaSocial: true,\n                headMetaRobots: true,\n                headMetaHttpEquiv: true,\n                headMetaAuthorship: true,\n                headMetaVerification: true,\n            }\n        : slimDOM === false\n            ? {}\n            : slimDOM;\n    return [\n        serializeNodeWithId(n, {\n            doc: n,\n            map: idNodeMap,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        }),\n        idNodeMap,\n    ];\n}\nfunction skipAttribute(tagName, attributeName, value) {\n    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');\n}\nfunction getInputValue(tagName, el, attributes) {\n    if (tagName === 'input' &&\n        (attributes.type === 'radio' || attributes.type === 'checkbox')) {\n        return el.getAttribute('value') || '';\n    }\n    return el.value;\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\nfunction parse(css, options = {}) {\n    let lineno = 1;\n    let column = 1;\n    function updatePosition(str) {\n        const lines = str.match(/\\n/g);\n        if (lines) {\n            lineno += lines.length;\n        }\n        let i = str.lastIndexOf('\\n');\n        column = i === -1 ? column + str.length : str.length - i;\n    }\n    function position() {\n        const start = { line: lineno, column };\n        return (node) => {\n            node.position = new Position(start);\n            whitespace();\n            return node;\n        };\n    }\n    class Position {\n        constructor(start) {\n            this.start = start;\n            this.end = { line: lineno, column };\n            this.source = options.source;\n        }\n    }\n    Position.prototype.content = css;\n    const errorsList = [];\n    function error(msg) {\n        const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);\n        err.reason = msg;\n        err.filename = options.source;\n        err.line = lineno;\n        err.column = column;\n        err.source = css;\n        if (options.silent) {\n            errorsList.push(err);\n        }\n        else {\n            throw err;\n        }\n    }\n    function stylesheet() {\n        const rulesList = rules();\n        return {\n            type: 'stylesheet',\n            stylesheet: {\n                source: options.source,\n                rules: rulesList,\n                parsingErrors: errorsList,\n            },\n        };\n    }\n    function open() {\n        return match(/^{\\s*/);\n    }\n    function close() {\n        return match(/^}/);\n    }\n    function rules() {\n        let node;\n        const rules = [];\n        whitespace();\n        comments(rules);\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\n            if (node !== false) {\n                rules.push(node);\n                comments(rules);\n            }\n        }\n        return rules;\n    }\n    function match(re) {\n        const m = re.exec(css);\n        if (!m) {\n            return;\n        }\n        const str = m[0];\n        updatePosition(str);\n        css = css.slice(str.length);\n        return m;\n    }\n    function whitespace() {\n        match(/^\\s*/);\n    }\n    function comments(rules = []) {\n        let c;\n        while ((c = comment())) {\n            if (c !== false) {\n                rules.push(c);\n            }\n            c = comment();\n        }\n        return rules;\n    }\n    function comment() {\n        const pos = position();\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\n            return;\n        }\n        let i = 2;\n        while ('' !== css.charAt(i) &&\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\n            ++i;\n        }\n        i += 2;\n        if ('' === css.charAt(i - 1)) {\n            return error('End of comment missing');\n        }\n        const str = css.slice(2, i - 2);\n        column += 2;\n        updatePosition(str);\n        css = css.slice(i);\n        column += 2;\n        return pos({\n            type: 'comment',\n            comment: str,\n        });\n    }\n    function selector() {\n        const m = match(/^([^{]+)/);\n        if (!m) {\n            return;\n        }\n        return trim(m[0])\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\n            return m.replace(/,/g, '\\u200C');\n        })\n            .split(/\\s*(?![^(]*\\)),\\s*/)\n            .map((s) => {\n            return s.replace(/\\u200C/g, ',');\n        });\n    }\n    function declaration() {\n        const pos = position();\n        let propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\n        if (!propMatch) {\n            return;\n        }\n        const prop = trim(propMatch[0]);\n        if (!match(/^:\\s*/)) {\n            return error(`property missing ':'`);\n        }\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\n        const ret = pos({\n            type: 'declaration',\n            property: prop.replace(commentre, ''),\n            value: val ? trim(val[0]).replace(commentre, '') : '',\n        });\n        match(/^[;\\s]*/);\n        return ret;\n    }\n    function declarations() {\n        const decls = [];\n        if (!open()) {\n            return error(`missing '{'`);\n        }\n        comments(decls);\n        let decl;\n        while ((decl = declaration())) {\n            if (decl !== false) {\n                decls.push(decl);\n                comments(decls);\n            }\n            decl = declaration();\n        }\n        if (!close()) {\n            return error(`missing '}'`);\n        }\n        return decls;\n    }\n    function keyframe() {\n        let m;\n        const vals = [];\n        const pos = position();\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\n            vals.push(m[1]);\n            match(/^,\\s*/);\n        }\n        if (!vals.length) {\n            return;\n        }\n        return pos({\n            type: 'keyframe',\n            values: vals,\n            declarations: declarations(),\n        });\n    }\n    function atkeyframes() {\n        const pos = position();\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\n        if (!m) {\n            return;\n        }\n        const vendor = m[1];\n        m = match(/^([-\\w]+)\\s*/);\n        if (!m) {\n            return error('@keyframes missing name');\n        }\n        const name = m[1];\n        if (!open()) {\n            return error(`@keyframes missing '{'`);\n        }\n        let frame;\n        let frames = comments();\n        while ((frame = keyframe())) {\n            frames.push(frame);\n            frames = frames.concat(comments());\n        }\n        if (!close()) {\n            return error(`@keyframes missing '}'`);\n        }\n        return pos({\n            type: 'keyframes',\n            name,\n            vendor,\n            keyframes: frames,\n        });\n    }\n    function atsupports() {\n        const pos = position();\n        const m = match(/^@supports *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const supports = trim(m[1]);\n        if (!open()) {\n            return error(`@supports missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@supports missing '}'`);\n        }\n        return pos({\n            type: 'supports',\n            supports,\n            rules: style,\n        });\n    }\n    function athost() {\n        const pos = position();\n        const m = match(/^@host\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@host missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@host missing '}'`);\n        }\n        return pos({\n            type: 'host',\n            rules: style,\n        });\n    }\n    function atmedia() {\n        const pos = position();\n        const m = match(/^@media *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const media = trim(m[1]);\n        if (!open()) {\n            return error(`@media missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@media missing '}'`);\n        }\n        return pos({\n            type: 'media',\n            media,\n            rules: style,\n        });\n    }\n    function atcustommedia() {\n        const pos = position();\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\n        if (!m) {\n            return;\n        }\n        return pos({\n            type: 'custom-media',\n            name: trim(m[1]),\n            media: trim(m[2]),\n        });\n    }\n    function atpage() {\n        const pos = position();\n        const m = match(/^@page */);\n        if (!m) {\n            return;\n        }\n        const sel = selector() || [];\n        if (!open()) {\n            return error(`@page missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@page missing '}'`);\n        }\n        return pos({\n            type: 'page',\n            selectors: sel,\n            declarations: decls,\n        });\n    }\n    function atdocument() {\n        const pos = position();\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const vendor = trim(m[1]);\n        const doc = trim(m[2]);\n        if (!open()) {\n            return error(`@document missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@document missing '}'`);\n        }\n        return pos({\n            type: 'document',\n            document: doc,\n            vendor,\n            rules: style,\n        });\n    }\n    function atfontface() {\n        const pos = position();\n        const m = match(/^@font-face\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@font-face missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@font-face missing '}'`);\n        }\n        return pos({\n            type: 'font-face',\n            declarations: decls,\n        });\n    }\n    const atimport = _compileAtrule('import');\n    const atcharset = _compileAtrule('charset');\n    const atnamespace = _compileAtrule('namespace');\n    function _compileAtrule(name) {\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\n        return () => {\n            const pos = position();\n            const m = match(re);\n            if (!m) {\n                return;\n            }\n            const ret = { type: name };\n            ret[name] = m[1].trim();\n            return pos(ret);\n        };\n    }\n    function atrule() {\n        if (css[0] !== '@') {\n            return;\n        }\n        return (atkeyframes() ||\n            atmedia() ||\n            atcustommedia() ||\n            atsupports() ||\n            atimport() ||\n            atcharset() ||\n            atnamespace() ||\n            atdocument() ||\n            atpage() ||\n            athost() ||\n            atfontface());\n    }\n    function rule() {\n        const pos = position();\n        const sel = selector();\n        if (!sel) {\n            return error('selector missing');\n        }\n        comments();\n        return pos({\n            type: 'rule',\n            selectors: sel,\n            declarations: declarations(),\n        });\n    }\n    return addParent(stylesheet());\n}\nfunction trim(str) {\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\n}\nfunction addParent(obj, parent) {\n    const isNode = obj && typeof obj.type === 'string';\n    const childParent = isNode ? obj : parent;\n    for (const k of Object.keys(obj)) {\n        const value = obj[k];\n        if (Array.isArray(value)) {\n            value.forEach((v) => {\n                addParent(v, childParent);\n            });\n        }\n        else if (value && typeof value === 'object') {\n            addParent(value, childParent);\n        }\n    }\n    if (isNode) {\n        Object.defineProperty(obj, 'parent', {\n            configurable: true,\n            writable: true,\n            enumerable: false,\n            value: parent || null,\n        });\n    }\n    return obj;\n}\n\nconst tagMap = {\n    script: 'noscript',\n    altglyph: 'altGlyph',\n    altglyphdef: 'altGlyphDef',\n    altglyphitem: 'altGlyphItem',\n    animatecolor: 'animateColor',\n    animatemotion: 'animateMotion',\n    animatetransform: 'animateTransform',\n    clippath: 'clipPath',\n    feblend: 'feBlend',\n    fecolormatrix: 'feColorMatrix',\n    fecomponenttransfer: 'feComponentTransfer',\n    fecomposite: 'feComposite',\n    feconvolvematrix: 'feConvolveMatrix',\n    fediffuselighting: 'feDiffuseLighting',\n    fedisplacementmap: 'feDisplacementMap',\n    fedistantlight: 'feDistantLight',\n    fedropshadow: 'feDropShadow',\n    feflood: 'feFlood',\n    fefunca: 'feFuncA',\n    fefuncb: 'feFuncB',\n    fefuncg: 'feFuncG',\n    fefuncr: 'feFuncR',\n    fegaussianblur: 'feGaussianBlur',\n    feimage: 'feImage',\n    femerge: 'feMerge',\n    femergenode: 'feMergeNode',\n    femorphology: 'feMorphology',\n    feoffset: 'feOffset',\n    fepointlight: 'fePointLight',\n    fespecularlighting: 'feSpecularLighting',\n    fespotlight: 'feSpotLight',\n    fetile: 'feTile',\n    feturbulence: 'feTurbulence',\n    foreignobject: 'foreignObject',\n    glyphref: 'glyphRef',\n    lineargradient: 'linearGradient',\n    radialgradient: 'radialGradient',\n};\nfunction getTagName(n) {\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\n    if (tagName === 'link' && n.attributes._cssText) {\n        tagName = 'style';\n    }\n    return tagName;\n}\nfunction escapeRegExp(str) {\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\nfunction addHoverClass(cssText, cache) {\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\n    if (cachedStyle)\n        return cachedStyle;\n    const ast = parse(cssText, {\n        silent: true,\n    });\n    if (!ast.stylesheet) {\n        return cssText;\n    }\n    const selectors = [];\n    ast.stylesheet.rules.forEach((rule) => {\n        if ('selectors' in rule) {\n            (rule.selectors || []).forEach((selector) => {\n                if (HOVER_SELECTOR.test(selector)) {\n                    selectors.push(selector);\n                }\n            });\n        }\n    });\n    if (selectors.length === 0) {\n        return cssText;\n    }\n    const selectorMatcher = new RegExp(selectors\n        .filter((selector, index) => selectors.indexOf(selector) === index)\n        .sort((a, b) => b.length - a.length)\n        .map((selector) => {\n        return escapeRegExp(selector);\n    })\n        .join('|'), 'g');\n    const result = cssText.replace(selectorMatcher, (selector) => {\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\n        return `${selector}, ${newSelector}`;\n    });\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\n    return result;\n}\nfunction createCache() {\n    const stylesWithHoverClass = new Map();\n    return {\n        stylesWithHoverClass,\n    };\n}\nfunction buildNode(n, options) {\n    const { doc, hackCss, cache } = options;\n    switch (n.type) {\n        case NodeType.Document:\n            return doc.implementation.createDocument(null, '', null);\n        case NodeType.DocumentType:\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\n        case NodeType.Element:\n            const tagName = getTagName(n);\n            let node;\n            if (n.isSVG) {\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\n            }\n            else {\n                node = doc.createElement(tagName);\n            }\n            for (const name in n.attributes) {\n                if (!n.attributes.hasOwnProperty(name)) {\n                    continue;\n                }\n                let value = n.attributes[name];\n                if (tagName === 'option' && name === 'selected' && value === false) {\n                    continue;\n                }\n                value =\n                    typeof value === 'boolean' || typeof value === 'number' || value === null ? '' : value;\n                if (!name.startsWith('rr_')) {\n                    const isTextarea = tagName === 'textarea' && name === 'value';\n                    const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\n                    if (isRemoteOrDynamicCss && hackCss) {\n                        value = addHoverClass(value, cache);\n                    }\n                    if (isTextarea || isRemoteOrDynamicCss) {\n                        const child = doc.createTextNode(value);\n                        for (const c of Array.from(node.childNodes)) {\n                            if (c.nodeType === node.TEXT_NODE) {\n                                node.removeChild(c);\n                            }\n                        }\n                        node.appendChild(child);\n                        continue;\n                    }\n                    try {\n                        if (n.isSVG && name === 'xlink:href') {\n                            node.setAttributeNS('http://www.w3.org/1999/xlink', name, value);\n                        }\n                        else if (name === 'onload' ||\n                            name === 'onclick' ||\n                            name.substring(0, 7) === 'onmouse') {\n                            node.setAttribute('_' + name, value);\n                        }\n                        else if (tagName === 'meta' &&\n                            n.attributes['http-equiv'] === 'Content-Security-Policy' &&\n                            name === 'content') {\n                            node.setAttribute('csp-content', value);\n                            continue;\n                        }\n                        else if (tagName === 'link' &&\n                            (n.attributes.rel === 'preload' || n.attributes.rel === 'modulepreload') &&\n                            n.attributes.as === 'script') {\n                        }\n                        else if (tagName === 'link' &&\n                            n.attributes.rel === 'prefetch' &&\n                            typeof n.attributes.href === 'string' &&\n                            n.attributes.href.endsWith('.js')) {\n                        }\n                        else if (tagName === 'img' &&\n                            n.attributes.srcset &&\n                            n.attributes.rr_dataURL) {\n                            node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\n                        }\n                        else {\n                            node.setAttribute(name, value);\n                        }\n                    }\n                    catch (error) {\n                    }\n                }\n                else {\n                    if (tagName === 'canvas' && name === 'rr_dataURL') {\n                        const image = document.createElement('img');\n                        image.src = value;\n                        image.onload = () => {\n                            const ctx = node.getContext('2d');\n                            if (ctx) {\n                                ctx.drawImage(image, 0, 0, image.width, image.height);\n                            }\n                        };\n                    }\n                    else if (tagName === 'img' && name === 'rr_dataURL') {\n                        const image = node;\n                        if (!image.currentSrc.startsWith('data:')) {\n                            image.setAttribute('rrweb-original-src', n.attributes.src);\n                            image.src = value;\n                        }\n                    }\n                    if (name === 'rr_width') {\n                        node.style.width = value;\n                    }\n                    else if (name === 'rr_height') {\n                        node.style.height = value;\n                    }\n                    else if (name === 'rr_mediaCurrentTime') {\n                        node.currentTime = n.attributes\n                            .rr_mediaCurrentTime;\n                    }\n                    else if (name === 'rr_mediaState') {\n                        switch (value) {\n                            case 'played':\n                                node\n                                    .play()\n                                    .catch((e) => console.warn('media playback error', e));\n                                break;\n                            case 'paused':\n                                node.pause();\n                                break;\n                        }\n                    }\n                }\n            }\n            if (n.isShadowHost) {\n                if (!node.shadowRoot) {\n                    node.attachShadow({ mode: 'open' });\n                }\n                else {\n                    while (node.shadowRoot.firstChild) {\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\n                    }\n                }\n            }\n            return node;\n        case NodeType.Text:\n            return doc.createTextNode(n.isStyle && hackCss\n                ? addHoverClass(n.textContent, cache)\n                : n.textContent);\n        case NodeType.CDATA:\n            return doc.createCDATASection(n.textContent);\n        case NodeType.Comment:\n            return doc.createComment(n.textContent);\n        default:\n            return null;\n    }\n}\nfunction buildNodeWithSN(n, options) {\n    const { doc, map, skipChild = false, hackCss = true, afterAppend, cache, } = options;\n    let node = buildNode(n, { doc, hackCss, cache });\n    if (!node) {\n        return null;\n    }\n    if (n.rootId) {\n        console.assert(map[n.rootId] === doc, 'Target document should has the same root id.');\n    }\n    if (n.type === NodeType.Document) {\n        doc.close();\n        doc.open();\n        if (n.compatMode === 'BackCompat' &&\n            n.childNodes &&\n            n.childNodes[0].type !== NodeType.DocumentType) {\n            if (n.childNodes[0].type === NodeType.Element &&\n                'xmlns' in n.childNodes[0].attributes &&\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\n            }\n            else {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\n            }\n        }\n        node = doc;\n    }\n    node.__sn = n;\n    map[n.id] = node;\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\n        !skipChild) {\n        for (const childN of n.childNodes) {\n            const childNode = buildNodeWithSN(childN, {\n                doc,\n                map,\n                skipChild: false,\n                hackCss,\n                afterAppend,\n                cache,\n            });\n            if (!childNode) {\n                console.warn('Failed to rebuild', childN);\n                continue;\n            }\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\n                node.shadowRoot.appendChild(childNode);\n            }\n            else {\n                node.appendChild(childNode);\n            }\n            if (afterAppend) {\n                afterAppend(childNode);\n            }\n        }\n    }\n    return node;\n}\nfunction visit(idNodeMap, onVisit) {\n    function walk(node) {\n        onVisit(node);\n    }\n    for (const key in idNodeMap) {\n        if (idNodeMap[key]) {\n            walk(idNodeMap[key]);\n        }\n    }\n}\nfunction handleScroll(node) {\n    const n = node.__sn;\n    if (n.type !== NodeType.Element) {\n        return;\n    }\n    const el = node;\n    for (const name in n.attributes) {\n        if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {\n            continue;\n        }\n        const value = n.attributes[name];\n        if (name === 'rr_scrollLeft') {\n            el.scrollLeft = value;\n        }\n        if (name === 'rr_scrollTop') {\n            el.scrollTop = value;\n        }\n    }\n}\nfunction rebuild(n, options) {\n    const { doc, onVisit, hackCss = true, afterAppend, cache } = options;\n    const idNodeMap = {};\n    const node = buildNodeWithSN(n, {\n        doc,\n        map: idNodeMap,\n        skipChild: false,\n        hackCss,\n        afterAppend,\n        cache,\n    });\n    visit(idNodeMap, (visitedNode) => {\n        if (onVisit) {\n            onVisit(visitedNode);\n        }\n        handleScroll(visitedNode);\n    });\n    return [node, idNodeMap];\n}\n\nexport { IGNORED_NODE, NodeType, addHoverClass, buildNodeWithSN, createCache, hasInputMaskOptions, is2DCanvasBlank, isElement, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, snapshot, transformAttribute };\n","var EventType;\n(function (EventType) {\n    EventType[EventType[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n    EventType[EventType[\"Load\"] = 1] = \"Load\";\n    EventType[EventType[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n    EventType[EventType[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n    EventType[EventType[\"Meta\"] = 4] = \"Meta\";\n    EventType[EventType[\"Custom\"] = 5] = \"Custom\";\n    EventType[EventType[\"Plugin\"] = 6] = \"Plugin\";\n})(EventType || (EventType = {}));\nvar IncrementalSource;\n(function (IncrementalSource) {\n    IncrementalSource[IncrementalSource[\"Mutation\"] = 0] = \"Mutation\";\n    IncrementalSource[IncrementalSource[\"MouseMove\"] = 1] = \"MouseMove\";\n    IncrementalSource[IncrementalSource[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n    IncrementalSource[IncrementalSource[\"Scroll\"] = 3] = \"Scroll\";\n    IncrementalSource[IncrementalSource[\"ViewportResize\"] = 4] = \"ViewportResize\";\n    IncrementalSource[IncrementalSource[\"Input\"] = 5] = \"Input\";\n    IncrementalSource[IncrementalSource[\"TouchMove\"] = 6] = \"TouchMove\";\n    IncrementalSource[IncrementalSource[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n    IncrementalSource[IncrementalSource[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n    IncrementalSource[IncrementalSource[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n    IncrementalSource[IncrementalSource[\"Font\"] = 10] = \"Font\";\n    IncrementalSource[IncrementalSource[\"Log\"] = 11] = \"Log\";\n    IncrementalSource[IncrementalSource[\"Drag\"] = 12] = \"Drag\";\n    IncrementalSource[IncrementalSource[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n})(IncrementalSource || (IncrementalSource = {}));\nvar MouseInteractions;\n(function (MouseInteractions) {\n    MouseInteractions[MouseInteractions[\"MouseUp\"] = 0] = \"MouseUp\";\n    MouseInteractions[MouseInteractions[\"MouseDown\"] = 1] = \"MouseDown\";\n    MouseInteractions[MouseInteractions[\"Click\"] = 2] = \"Click\";\n    MouseInteractions[MouseInteractions[\"ContextMenu\"] = 3] = \"ContextMenu\";\n    MouseInteractions[MouseInteractions[\"DblClick\"] = 4] = \"DblClick\";\n    MouseInteractions[MouseInteractions[\"Focus\"] = 5] = \"Focus\";\n    MouseInteractions[MouseInteractions[\"Blur\"] = 6] = \"Blur\";\n    MouseInteractions[MouseInteractions[\"TouchStart\"] = 7] = \"TouchStart\";\n    MouseInteractions[MouseInteractions[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n    MouseInteractions[MouseInteractions[\"TouchEnd\"] = 9] = \"TouchEnd\";\n    MouseInteractions[MouseInteractions[\"TouchCancel\"] = 10] = \"TouchCancel\";\n})(MouseInteractions || (MouseInteractions = {}));\nvar CanvasContext;\n(function (CanvasContext) {\n    CanvasContext[CanvasContext[\"2D\"] = 0] = \"2D\";\n    CanvasContext[CanvasContext[\"WebGL\"] = 1] = \"WebGL\";\n    CanvasContext[CanvasContext[\"WebGL2\"] = 2] = \"WebGL2\";\n})(CanvasContext || (CanvasContext = {}));\nvar MediaInteractions;\n(function (MediaInteractions) {\n    MediaInteractions[MediaInteractions[\"Play\"] = 0] = \"Play\";\n    MediaInteractions[MediaInteractions[\"Pause\"] = 1] = \"Pause\";\n    MediaInteractions[MediaInteractions[\"Seeked\"] = 2] = \"Seeked\";\n    MediaInteractions[MediaInteractions[\"VolumeChange\"] = 3] = \"VolumeChange\";\n})(MediaInteractions || (MediaInteractions = {}));\nvar ReplayerEvents;\n(function (ReplayerEvents) {\n    ReplayerEvents[\"Start\"] = \"start\";\n    ReplayerEvents[\"Pause\"] = \"pause\";\n    ReplayerEvents[\"Resume\"] = \"resume\";\n    ReplayerEvents[\"Resize\"] = \"resize\";\n    ReplayerEvents[\"Finish\"] = \"finish\";\n    ReplayerEvents[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n    ReplayerEvents[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n    ReplayerEvents[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n    ReplayerEvents[\"SkipStart\"] = \"skip-start\";\n    ReplayerEvents[\"SkipEnd\"] = \"skip-end\";\n    ReplayerEvents[\"MouseInteraction\"] = \"mouse-interaction\";\n    ReplayerEvents[\"EventCast\"] = \"event-cast\";\n    ReplayerEvents[\"CustomEvent\"] = \"custom-event\";\n    ReplayerEvents[\"Flush\"] = \"flush\";\n    ReplayerEvents[\"StateChange\"] = \"state-change\";\n    ReplayerEvents[\"PlayBack\"] = \"play-back\";\n})(ReplayerEvents || (ReplayerEvents = {}));\n\nexport { CanvasContext, EventType, IncrementalSource, MediaInteractions, MouseInteractions, ReplayerEvents };\n","import { IncrementalSource } from './types.js';\nimport { IGNORED_NODE, isShadowRoot, NodeType } from '../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nfunction on(type, fn, target = document) {\n    const options = { capture: true, passive: true };\n    target.addEventListener(type, fn, options);\n    return () => target.removeEventListener(type, fn, options);\n}\nfunction createMirror() {\n    return {\n        map: {},\n        getId(n) {\n            if (!n || !n.__sn) {\n                return -1;\n            }\n            return n.__sn.id;\n        },\n        getNode(id) {\n            return this.map[id] || null;\n        },\n        removeNodeFromMap(n) {\n            const id = n.__sn && n.__sn.id;\n            delete this.map[id];\n            if (n.childNodes) {\n                n.childNodes.forEach((child) => this.removeNodeFromMap(child));\n            }\n        },\n        has(id) {\n            return this.map.hasOwnProperty(id);\n        },\n        reset() {\n            this.map = {};\n        },\n    };\n}\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\n    '\\r\\n' +\n    'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\n    '\\r\\n' +\n    'or you can use record.mirror to access the mirror instance during recording.';\nlet _mirror = {\n    map: {},\n    getId() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return -1;\n    },\n    getNode() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return null;\n    },\n    removeNodeFromMap() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    },\n    has() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return false;\n    },\n    reset() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    },\n};\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\n    _mirror = new Proxy(_mirror, {\n        get(target, prop, receiver) {\n            if (prop === 'map') {\n                console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n            }\n            return Reflect.get(target, prop, receiver);\n        },\n    });\n}\nfunction throttle(func, wait, options = {}) {\n    let timeout = null;\n    let previous = 0;\n    return function (arg) {\n        let now = Date.now();\n        if (!previous && options.leading === false) {\n            previous = now;\n        }\n        let remaining = wait - (now - previous);\n        let context = this;\n        let args = arguments;\n        if (remaining <= 0 || remaining > wait) {\n            if (timeout) {\n                clearTimeout(timeout);\n                timeout = null;\n            }\n            previous = now;\n            func.apply(context, args);\n        }\n        else if (!timeout && options.trailing !== false) {\n            timeout = setTimeout(() => {\n                previous = options.leading === false ? 0 : Date.now();\n                timeout = null;\n                func.apply(context, args);\n            }, remaining);\n        }\n    };\n}\nfunction hookSetter(target, key, d, isRevoked, win = window) {\n    const original = win.Object.getOwnPropertyDescriptor(target, key);\n    win.Object.defineProperty(target, key, isRevoked\n        ? d\n        : {\n            set(value) {\n                setTimeout(() => {\n                    d.set.call(this, value);\n                }, 0);\n                if (original && original.set) {\n                    original.set.call(this, value);\n                }\n            },\n        });\n    return () => hookSetter(target, key, original || {}, true);\n}\nfunction patch(source, name, replacement) {\n    try {\n        if (!(name in source)) {\n            return () => { };\n        }\n        const original = source[name];\n        const wrapped = replacement(original);\n        if (typeof wrapped === 'function') {\n            wrapped.prototype = wrapped.prototype || {};\n            Object.defineProperties(wrapped, {\n                __rrweb_original__: {\n                    enumerable: false,\n                    value: original,\n                },\n            });\n        }\n        source[name] = wrapped;\n        return () => {\n            source[name] = original;\n        };\n    }\n    catch (_a) {\n        return () => { };\n    }\n}\nfunction getWindowHeight() {\n    return (window.innerHeight ||\n        (document.documentElement && document.documentElement.clientHeight) ||\n        (document.body && document.body.clientHeight));\n}\nfunction getWindowWidth() {\n    return (window.innerWidth ||\n        (document.documentElement && document.documentElement.clientWidth) ||\n        (document.body && document.body.clientWidth));\n}\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType === node.ELEMENT_NODE) {\n        let needBlock = false;\n        const needUnblock = unblockSelector && node.matches(unblockSelector);\n        if (typeof blockClass === 'string') {\n            if (node.closest !== undefined) {\n                needBlock =\n                    !needUnblock &&\n                        node.closest('.' + blockClass) !== null;\n            }\n            else {\n                needBlock =\n                    !needUnblock && node.classList.contains(blockClass);\n            }\n        }\n        else {\n            !needUnblock &&\n                node.classList.forEach((className) => {\n                    if (blockClass.test(className)) {\n                        needBlock = true;\n                    }\n                });\n        }\n        if (!needBlock && blockSelector) {\n            needBlock = node.matches(blockSelector);\n        }\n        return ((!needUnblock && needBlock) ||\n            isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector));\n    }\n    if (node.nodeType === node.TEXT_NODE) {\n        return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);\n    }\n    return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);\n}\nfunction isIgnored(n) {\n    if ('__sn' in n) {\n        return n.__sn.id === IGNORED_NODE;\n    }\n    return false;\n}\nfunction isAncestorRemoved(target, mirror) {\n    if (isShadowRoot(target)) {\n        return false;\n    }\n    const id = mirror.getId(target);\n    if (!mirror.has(id)) {\n        return true;\n    }\n    if (target.parentNode &&\n        target.parentNode.nodeType === target.DOCUMENT_NODE) {\n        return false;\n    }\n    if (!target.parentNode) {\n        return true;\n    }\n    return isAncestorRemoved(target.parentNode, mirror);\n}\nfunction isTouchEvent(event) {\n    return Boolean(event.changedTouches);\n}\nfunction polyfill(win = window) {\n    if ('NodeList' in win && !win.NodeList.prototype.forEach) {\n        win.NodeList.prototype.forEach = Array.prototype\n            .forEach;\n    }\n    if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\n        win.DOMTokenList.prototype.forEach = Array.prototype\n            .forEach;\n    }\n    if (!Node.prototype.contains) {\n        Node.prototype.contains = function contains(node) {\n            if (!(0 in arguments)) {\n                throw new TypeError('1 argument is required');\n            }\n            do {\n                if (this === node) {\n                    return true;\n                }\n            } while ((node = node && node.parentNode));\n            return false;\n        };\n    }\n}\nclass TreeIndex {\n    constructor() {\n        this.reset();\n    }\n    add(mutation) {\n        const parentTreeNode = this.indexes.get(mutation.parentId);\n        const treeNode = {\n            id: mutation.node.id,\n            mutation,\n            children: [],\n            texts: [],\n            attributes: [],\n        };\n        if (!parentTreeNode) {\n            this.tree[treeNode.id] = treeNode;\n        }\n        else {\n            treeNode.parent = parentTreeNode;\n            parentTreeNode.children[treeNode.id] = treeNode;\n        }\n        this.indexes.set(treeNode.id, treeNode);\n    }\n    remove(mutation, mirror) {\n        const parentTreeNode = this.indexes.get(mutation.parentId);\n        const treeNode = this.indexes.get(mutation.id);\n        const deepRemoveFromMirror = (id) => {\n            this.removeIdSet.add(id);\n            const node = mirror.getNode(id);\n            node === null || node === void 0 ? void 0 : node.childNodes.forEach((childNode) => {\n                if ('__sn' in childNode) {\n                    deepRemoveFromMirror(childNode.__sn.id);\n                }\n            });\n        };\n        const deepRemoveFromTreeIndex = (node) => {\n            this.removeIdSet.add(node.id);\n            Object.values(node.children).forEach((n) => deepRemoveFromTreeIndex(n));\n            const _treeNode = this.indexes.get(node.id);\n            if (_treeNode) {\n                const _parentTreeNode = _treeNode.parent;\n                if (_parentTreeNode) {\n                    delete _treeNode.parent;\n                    delete _parentTreeNode.children[_treeNode.id];\n                    this.indexes.delete(mutation.id);\n                }\n            }\n        };\n        if (!treeNode) {\n            this.removeNodeMutations.push(mutation);\n            deepRemoveFromMirror(mutation.id);\n        }\n        else if (!parentTreeNode) {\n            delete this.tree[treeNode.id];\n            this.indexes.delete(treeNode.id);\n            deepRemoveFromTreeIndex(treeNode);\n        }\n        else {\n            delete treeNode.parent;\n            delete parentTreeNode.children[treeNode.id];\n            this.indexes.delete(mutation.id);\n            deepRemoveFromTreeIndex(treeNode);\n        }\n    }\n    text(mutation) {\n        const treeNode = this.indexes.get(mutation.id);\n        if (treeNode) {\n            treeNode.texts.push(mutation);\n        }\n        else {\n            this.textMutations.push(mutation);\n        }\n    }\n    attribute(mutation) {\n        const treeNode = this.indexes.get(mutation.id);\n        if (treeNode) {\n            treeNode.attributes.push(mutation);\n        }\n        else {\n            this.attributeMutations.push(mutation);\n        }\n    }\n    scroll(d) {\n        this.scrollMap.set(d.id, d);\n    }\n    input(d) {\n        this.inputMap.set(d.id, d);\n    }\n    flush() {\n        const { tree, removeNodeMutations, textMutations, attributeMutations, } = this;\n        const batchMutationData = {\n            source: IncrementalSource.Mutation,\n            removes: removeNodeMutations,\n            texts: textMutations,\n            attributes: attributeMutations,\n            adds: [],\n        };\n        const walk = (treeNode, removed) => {\n            if (removed) {\n                this.removeIdSet.add(treeNode.id);\n            }\n            batchMutationData.texts = batchMutationData.texts\n                .concat(removed ? [] : treeNode.texts)\n                .filter((m) => !this.removeIdSet.has(m.id));\n            batchMutationData.attributes = batchMutationData.attributes\n                .concat(removed ? [] : treeNode.attributes)\n                .filter((m) => !this.removeIdSet.has(m.id));\n            if (!this.removeIdSet.has(treeNode.id) &&\n                !this.removeIdSet.has(treeNode.mutation.parentId) &&\n                !removed) {\n                batchMutationData.adds.push(treeNode.mutation);\n                if (treeNode.children) {\n                    Object.values(treeNode.children).forEach((n) => walk(n, false));\n                }\n            }\n            else {\n                Object.values(treeNode.children).forEach((n) => walk(n, true));\n            }\n        };\n        Object.values(tree).forEach((n) => walk(n, false));\n        for (const id of this.scrollMap.keys()) {\n            if (this.removeIdSet.has(id)) {\n                this.scrollMap.delete(id);\n            }\n        }\n        for (const id of this.inputMap.keys()) {\n            if (this.removeIdSet.has(id)) {\n                this.inputMap.delete(id);\n            }\n        }\n        const scrollMap = new Map(this.scrollMap);\n        const inputMap = new Map(this.inputMap);\n        this.reset();\n        return {\n            mutationData: batchMutationData,\n            scrollMap,\n            inputMap,\n        };\n    }\n    reset() {\n        this.tree = [];\n        this.indexes = new Map();\n        this.removeNodeMutations = [];\n        this.textMutations = [];\n        this.attributeMutations = [];\n        this.removeIdSet = new Set();\n        this.scrollMap = new Map();\n        this.inputMap = new Map();\n    }\n    idRemoved(id) {\n        return this.removeIdSet.has(id);\n    }\n}\nfunction queueToResolveTrees(queue) {\n    const queueNodeMap = {};\n    const putIntoMap = (m, parent) => {\n        const nodeInTree = {\n            value: m,\n            parent,\n            children: [],\n        };\n        queueNodeMap[m.node.id] = nodeInTree;\n        return nodeInTree;\n    };\n    const queueNodeTrees = [];\n    for (const mutation of queue) {\n        const { nextId, parentId } = mutation;\n        if (nextId && nextId in queueNodeMap) {\n            const nextInTree = queueNodeMap[nextId];\n            if (nextInTree.parent) {\n                const idx = nextInTree.parent.children.indexOf(nextInTree);\n                nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));\n            }\n            else {\n                const idx = queueNodeTrees.indexOf(nextInTree);\n                queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\n            }\n            continue;\n        }\n        if (parentId in queueNodeMap) {\n            const parentInTree = queueNodeMap[parentId];\n            parentInTree.children.push(putIntoMap(mutation, parentInTree));\n            continue;\n        }\n        queueNodeTrees.push(putIntoMap(mutation, null));\n    }\n    return queueNodeTrees;\n}\nfunction iterateResolveTree(tree, cb) {\n    cb(tree.value);\n    for (let i = tree.children.length - 1; i >= 0; i--) {\n        iterateResolveTree(tree.children[i], cb);\n    }\n}\nfunction isIframeINode(node) {\n    if ('__sn' in node) {\n        return (node.__sn.type === NodeType.Element && node.__sn.tagName === 'iframe');\n    }\n    return false;\n}\nfunction getBaseDimension(node, rootIframe) {\n    var _a, _b;\n    const frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;\n    if (!frameElement || frameElement === rootIframe) {\n        return {\n            x: 0,\n            y: 0,\n            relativeScale: 1,\n            absoluteScale: 1,\n        };\n    }\n    const frameDimension = frameElement.getBoundingClientRect();\n    const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\n    const relativeScale = frameDimension.height / frameElement.clientHeight;\n    return {\n        x: frameDimension.x * frameBaseDimension.relativeScale +\n            frameBaseDimension.x,\n        y: frameDimension.y * frameBaseDimension.relativeScale +\n            frameBaseDimension.y,\n        relativeScale,\n        absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\n    };\n}\nfunction hasShadowRoot(n) {\n    return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\n}\n\nexport { TreeIndex, _mirror, createMirror, getBaseDimension, getWindowHeight, getWindowWidth, hasShadowRoot, hookSetter, isAncestorRemoved, isBlocked, isIframeINode, isIgnored, isTouchEvent, iterateResolveTree, on, patch, polyfill, queueToResolveTrees, throttle };\n","import { isShadowRoot, maskInputValue, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { isIgnored, isBlocked, isAncestorRemoved, isIframeINode, hasShadowRoot } from '../utils.js';\n\nfunction isNodeInLinkedList(n) {\n    return '__ln' in n;\n}\nclass DoubleLinkedList {\n    constructor() {\n        this.length = 0;\n        this.head = null;\n    }\n    get(position) {\n        if (position >= this.length) {\n            throw new Error('Position outside of list range');\n        }\n        let current = this.head;\n        for (let index = 0; index < position; index++) {\n            current = (current === null || current === void 0 ? void 0 : current.next) || null;\n        }\n        return current;\n    }\n    addNode(n) {\n        const node = {\n            value: n,\n            previous: null,\n            next: null,\n        };\n        n.__ln = node;\n        if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\n            const current = n.previousSibling.__ln.next;\n            node.next = current;\n            node.previous = n.previousSibling.__ln;\n            n.previousSibling.__ln.next = node;\n            if (current) {\n                current.previous = node;\n            }\n        }\n        else if (n.nextSibling &&\n            isNodeInLinkedList(n.nextSibling) &&\n            n.nextSibling.__ln.previous) {\n            const current = n.nextSibling.__ln.previous;\n            node.previous = current;\n            node.next = n.nextSibling.__ln;\n            n.nextSibling.__ln.previous = node;\n            if (current) {\n                current.next = node;\n            }\n        }\n        else {\n            if (this.head) {\n                this.head.previous = node;\n            }\n            node.next = this.head;\n            this.head = node;\n        }\n        this.length++;\n    }\n    removeNode(n) {\n        const current = n.__ln;\n        if (!this.head) {\n            return;\n        }\n        if (!current.previous) {\n            this.head = current.next;\n            if (this.head) {\n                this.head.previous = null;\n            }\n        }\n        else {\n            current.previous.next = current.next;\n            if (current.next) {\n                current.next.previous = current.previous;\n            }\n        }\n        if (n.__ln) {\n            delete n.__ln;\n        }\n        this.length--;\n    }\n}\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\nfunction isINode(n) {\n    return '__sn' in n;\n}\nclass MutationBuffer {\n    constructor() {\n        this.frozen = false;\n        this.locked = false;\n        this.texts = [];\n        this.attributes = [];\n        this.removes = [];\n        this.mapRemoves = [];\n        this.movedMap = {};\n        this.addedSet = new Set();\n        this.movedSet = new Set();\n        this.droppedSet = new Set();\n        this.processMutations = (mutations) => {\n            mutations.forEach(this.processMutation);\n            this.emit();\n        };\n        this.emit = () => {\n            if (this.frozen || this.locked) {\n                return;\n            }\n            const adds = [];\n            const addList = new DoubleLinkedList();\n            const getNextId = (n) => {\n                let ns = n;\n                let nextId = IGNORED_NODE;\n                while (nextId === IGNORED_NODE) {\n                    ns = ns && ns.nextSibling;\n                    nextId = ns && this.mirror.getId(ns);\n                }\n                return nextId;\n            };\n            const pushAdd = (n) => {\n                var _a, _b, _c, _d, _e;\n                const shadowHost = n.getRootNode\n                    ? (_a = n.getRootNode()) === null || _a === void 0 ? void 0 : _a.host\n                    : null;\n                let rootShadowHost = shadowHost;\n                while ((_c = (_b = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _b === void 0 ? void 0 : _b.call(rootShadowHost)) === null || _c === void 0 ? void 0 : _c.host)\n                    rootShadowHost =\n                        ((_e = (_d = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _d === void 0 ? void 0 : _d.call(rootShadowHost)) === null || _e === void 0 ? void 0 : _e.host) ||\n                            null;\n                const notInDoc = !this.doc.contains(n) &&\n                    (!rootShadowHost || !this.doc.contains(rootShadowHost));\n                if (!n.parentNode || notInDoc) {\n                    return;\n                }\n                const parentId = isShadowRoot(n.parentNode)\n                    ? this.mirror.getId(shadowHost)\n                    : this.mirror.getId(n.parentNode);\n                const nextId = getNextId(n);\n                if (parentId === -1 || nextId === -1) {\n                    return addList.addNode(n);\n                }\n                let sn = serializeNodeWithId(n, {\n                    doc: this.doc,\n                    map: this.mirror.map,\n                    blockClass: this.blockClass,\n                    blockSelector: this.blockSelector,\n                    unblockSelector: this.unblockSelector,\n                    maskTextClass: this.maskTextClass,\n                    maskTextSelector: this.maskTextSelector,\n                    unmaskTextSelector: this.unmaskTextSelector,\n                    maskInputSelector: this.maskInputSelector,\n                    unmaskInputSelector: this.unmaskInputSelector,\n                    skipChild: true,\n                    inlineStylesheet: this.inlineStylesheet,\n                    maskAllText: this.maskAllText,\n                    maskInputOptions: this.maskInputOptions,\n                    maskTextFn: this.maskTextFn,\n                    maskInputFn: this.maskInputFn,\n                    slimDOMOptions: this.slimDOMOptions,\n                    recordCanvas: this.recordCanvas,\n                    inlineImages: this.inlineImages,\n                    onSerialize: (currentN) => {\n                        if (isIframeINode(currentN)) {\n                            this.iframeManager.addIframe(currentN);\n                        }\n                        if (hasShadowRoot(n)) {\n                            this.shadowDomManager.addShadowRoot(n.shadowRoot, document);\n                        }\n                    },\n                    onIframeLoad: (iframe, childSn) => {\n                        this.iframeManager.attachIframe(iframe, childSn);\n                        this.shadowDomManager.observeAttachShadow(iframe);\n                    },\n                });\n                if (sn) {\n                    adds.push({\n                        parentId,\n                        nextId,\n                        node: sn,\n                    });\n                }\n            };\n            while (this.mapRemoves.length) {\n                this.mirror.removeNodeFromMap(this.mapRemoves.shift());\n            }\n            for (const n of this.movedSet) {\n                if (isParentRemoved(this.removes, n, this.mirror) &&\n                    !this.movedSet.has(n.parentNode)) {\n                    continue;\n                }\n                pushAdd(n);\n            }\n            for (const n of this.addedSet) {\n                if (!isAncestorInSet(this.droppedSet, n) &&\n                    !isParentRemoved(this.removes, n, this.mirror)) {\n                    pushAdd(n);\n                }\n                else if (isAncestorInSet(this.movedSet, n)) {\n                    pushAdd(n);\n                }\n                else {\n                    this.droppedSet.add(n);\n                }\n            }\n            let candidate = null;\n            while (addList.length) {\n                let node = null;\n                if (candidate) {\n                    const parentId = this.mirror.getId(candidate.value.parentNode);\n                    const nextId = getNextId(candidate.value);\n                    if (parentId !== -1 && nextId !== -1) {\n                        node = candidate;\n                    }\n                }\n                if (!node) {\n                    for (let index = addList.length - 1; index >= 0; index--) {\n                        const _node = addList.get(index);\n                        if (_node) {\n                            const parentId = this.mirror.getId(_node.value.parentNode);\n                            const nextId = getNextId(_node.value);\n                            if (parentId !== -1 && nextId !== -1) {\n                                node = _node;\n                                break;\n                            }\n                        }\n                    }\n                }\n                if (!node) {\n                    while (addList.head) {\n                        addList.removeNode(addList.head.value);\n                    }\n                    break;\n                }\n                candidate = node.previous;\n                addList.removeNode(node.value);\n                pushAdd(node.value);\n            }\n            const payload = {\n                texts: this.texts\n                    .map((text) => ({\n                    id: this.mirror.getId(text.node),\n                    value: text.value,\n                }))\n                    .filter((text) => this.mirror.has(text.id)),\n                attributes: this.attributes\n                    .map((attribute) => ({\n                    id: this.mirror.getId(attribute.node),\n                    attributes: attribute.attributes,\n                }))\n                    .filter((attribute) => this.mirror.has(attribute.id)),\n                removes: this.removes,\n                adds,\n            };\n            if (!payload.texts.length &&\n                !payload.attributes.length &&\n                !payload.removes.length &&\n                !payload.adds.length) {\n                return;\n            }\n            this.texts = [];\n            this.attributes = [];\n            this.removes = [];\n            this.addedSet = new Set();\n            this.movedSet = new Set();\n            this.droppedSet = new Set();\n            this.movedMap = {};\n            this.mutationCb(payload);\n        };\n        this.processMutation = (m) => {\n            if (isIgnored(m.target)) {\n                return;\n            }\n            switch (m.type) {\n                case 'characterData': {\n                    const value = m.target.textContent;\n                    if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) && value !== m.oldValue) {\n                        this.texts.push({\n                            value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextSelector, this.maskAllText) && value\n                                ? this.maskTextFn\n                                    ? this.maskTextFn(value)\n                                    : value.replace(/[\\S]/g, '*')\n                                : value,\n                            node: m.target,\n                        });\n                    }\n                    break;\n                }\n                case 'attributes': {\n                    const target = m.target;\n                    let value = target.getAttribute(m.attributeName);\n                    if (m.attributeName === 'value') {\n                        value = maskInputValue({\n                            input: target,\n                            maskInputSelector: this.maskInputSelector,\n                            unmaskInputSelector: this.unmaskInputSelector,\n                            maskInputOptions: this.maskInputOptions,\n                            tagName: target.tagName,\n                            type: target.getAttribute('type'),\n                            value,\n                            maskInputFn: this.maskInputFn,\n                        });\n                    }\n                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || value === m.oldValue) {\n                        return;\n                    }\n                    let item = this.attributes.find((a) => a.node === m.target);\n                    if (!item) {\n                        item = {\n                            node: m.target,\n                            attributes: {},\n                        };\n                        this.attributes.push(item);\n                    }\n                    if (m.attributeName === 'type' &&\n                        m.target.tagName === 'INPUT' &&\n                        (m.oldValue || '').toLowerCase() === 'password') {\n                        m.target.setAttribute('rr_is_password', 'true');\n                    }\n                    if (m.attributeName === 'style') {\n                        const old = this.doc.createElement('span');\n                        if (m.oldValue) {\n                            old.setAttribute('style', m.oldValue);\n                        }\n                        if (item.attributes.style === undefined ||\n                            item.attributes.style === null) {\n                            item.attributes.style = {};\n                        }\n                        try {\n                            const styleObj = item.attributes.style;\n                            for (const pname of Array.from(target.style)) {\n                                const newValue = target.style.getPropertyValue(pname);\n                                const newPriority = target.style.getPropertyPriority(pname);\n                                if (newValue !== old.style.getPropertyValue(pname) ||\n                                    newPriority !== old.style.getPropertyPriority(pname)) {\n                                    if (newPriority === '') {\n                                        styleObj[pname] = newValue;\n                                    }\n                                    else {\n                                        styleObj[pname] = [newValue, newPriority];\n                                    }\n                                }\n                            }\n                            for (const pname of Array.from(old.style)) {\n                                if (target.style.getPropertyValue(pname) === '') {\n                                    styleObj[pname] = false;\n                                }\n                            }\n                        }\n                        catch (error) {\n                            console.warn('[rrweb] Error when parsing update to style attribute:', error);\n                        }\n                    }\n                    else {\n                        const element = m.target;\n                        item.attributes[m.attributeName] = transformAttribute(this.doc, element, element.tagName, m.attributeName, value, this.maskAllText, this.unmaskTextSelector, this.maskTextFn);\n                    }\n                    break;\n                }\n                case 'childList': {\n                    m.addedNodes.forEach((n) => this.genAdds(n, m.target));\n                    m.removedNodes.forEach((n) => {\n                        const nodeId = this.mirror.getId(n);\n                        const parentId = isShadowRoot(m.target)\n                            ? this.mirror.getId(m.target.host)\n                            : this.mirror.getId(m.target);\n                        if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || isIgnored(n)) {\n                            return;\n                        }\n                        if (this.addedSet.has(n)) {\n                            deepDelete(this.addedSet, n);\n                            this.droppedSet.add(n);\n                        }\n                        else if (this.addedSet.has(m.target) && nodeId === -1) ;\n                        else if (isAncestorRemoved(m.target, this.mirror)) ;\n                        else if (this.movedSet.has(n) &&\n                            this.movedMap[moveKey(nodeId, parentId)]) {\n                            deepDelete(this.movedSet, n);\n                        }\n                        else {\n                            this.removes.push({\n                                parentId,\n                                id: nodeId,\n                                isShadow: isShadowRoot(m.target) ? true : undefined,\n                            });\n                        }\n                        this.mapRemoves.push(n);\n                    });\n                    break;\n                }\n            }\n        };\n        this.genAdds = (n, target) => {\n            if (target && isBlocked(target, this.blockClass, this.blockSelector, this.unblockSelector)) {\n                return;\n            }\n            if (isINode(n)) {\n                if (isIgnored(n)) {\n                    return;\n                }\n                this.movedSet.add(n);\n                let targetId = null;\n                if (target && isINode(target)) {\n                    targetId = target.__sn.id;\n                }\n                if (targetId) {\n                    this.movedMap[moveKey(n.__sn.id, targetId)] = true;\n                }\n            }\n            else {\n                this.addedSet.add(n);\n                this.droppedSet.delete(n);\n            }\n            if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector))\n                n.childNodes.forEach((childN) => this.genAdds(childN));\n        };\n    }\n    init(options) {\n        [\n            'mutationCb',\n            'blockClass',\n            'blockSelector',\n            'unblockSelector',\n            'maskTextClass',\n            'maskTextSelector',\n            'unmaskTextSelector',\n            'maskInputSelector',\n            'unmaskInputSelector',\n            'inlineStylesheet',\n            'maskAllText',\n            'maskInputOptions',\n            'maskTextFn',\n            'maskInputFn',\n            'recordCanvas',\n            'inlineImages',\n            'slimDOMOptions',\n            'doc',\n            'mirror',\n            'iframeManager',\n            'shadowDomManager',\n            'canvasManager',\n        ].forEach((key) => {\n            this[key] = options[key];\n        });\n    }\n    freeze() {\n        this.frozen = true;\n        this.canvasManager.freeze();\n    }\n    unfreeze() {\n        this.frozen = false;\n        this.canvasManager.unfreeze();\n        this.emit();\n    }\n    isFrozen() {\n        return this.frozen;\n    }\n    lock() {\n        this.locked = true;\n        this.canvasManager.lock();\n    }\n    unlock() {\n        this.locked = false;\n        this.canvasManager.unlock();\n        this.emit();\n    }\n    reset() {\n        this.shadowDomManager.reset();\n        this.canvasManager.reset();\n    }\n}\nfunction deepDelete(addsSet, n) {\n    addsSet.delete(n);\n    n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\n}\nfunction isParentRemoved(removes, n, mirror) {\n    const { parentNode } = n;\n    if (!parentNode) {\n        return false;\n    }\n    const parentId = mirror.getId(parentNode);\n    if (removes.some((r) => r.id === parentId)) {\n        return true;\n    }\n    return isParentRemoved(removes, parentNode, mirror);\n}\nfunction isAncestorInSet(set, n) {\n    const { parentNode } = n;\n    if (!parentNode) {\n        return false;\n    }\n    if (set.has(parentNode)) {\n        return true;\n    }\n    return isAncestorInSet(set, parentNode);\n}\n\nexport { MutationBuffer as default };\n","const callbackWrapper = (cb) => {\n    const rrwebWrapped = (...rest) => {\n        try {\n            return cb(...rest);\n        }\n        catch (error) {\n            try {\n                error.__rrweb__ = true;\n            }\n            catch (_a) {\n            }\n            throw error;\n        }\n    };\n    return rrwebWrapped;\n};\n\nexport { callbackWrapper };\n","import { hasInputMaskOptions, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { on, throttle, isBlocked, hookSetter, patch, isTouchEvent, getWindowHeight, getWindowWidth } from '../utils.js';\nimport { MouseInteractions, IncrementalSource } from '../types.js';\nimport MutationBuffer from './mutation.js';\nimport { callbackWrapper } from '../sentry/callbackWrapper.js';\n\nconst mutationBuffers = [];\nfunction getEventTarget(event) {\n    try {\n        if ('composedPath' in event) {\n            const path = event.composedPath();\n            if (path.length) {\n                return path[0];\n            }\n        }\n        else if ('path' in event && event.path.length) {\n            return event.path[0];\n        }\n    }\n    catch (_a) { }\n    return event && event.target;\n}\nfunction initMutationObserver(options, rootEl) {\n    var _a, _b;\n    const mutationBuffer = new MutationBuffer();\n    mutationBuffers.push(mutationBuffer);\n    mutationBuffer.init(options);\n    let mutationObserverCtor = window.MutationObserver ||\n        window.__rrMutationObserver;\n    const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\n    if (angularZoneSymbol &&\n        window[angularZoneSymbol]) {\n        mutationObserverCtor = window[angularZoneSymbol];\n    }\n    const observer = new mutationObserverCtor(callbackWrapper((mutations) => {\n        if (options.onMutation && options.onMutation(mutations) === false) {\n            return;\n        }\n        mutationBuffer.processMutations(mutations);\n    }));\n    observer.observe(rootEl, {\n        attributes: true,\n        attributeOldValue: true,\n        characterData: true,\n        characterDataOldValue: true,\n        childList: true,\n        subtree: true,\n    });\n    return observer;\n}\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\n    if (sampling.mousemove === false) {\n        return () => { };\n    }\n    const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\n    const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\n        ? sampling.mousemoveCallback\n        : 500;\n    let positions = [];\n    let timeBaseline;\n    const wrappedCb = throttle((source) => {\n        const totalOffset = Date.now() - timeBaseline;\n        callbackWrapper(mousemoveCb)(positions.map((p) => {\n            p.timeOffset -= totalOffset;\n            return p;\n        }), source);\n        positions = [];\n        timeBaseline = null;\n    }, callbackThreshold);\n    const updatePosition = throttle((evt) => {\n        const target = getEventTarget(evt);\n        const { clientX, clientY } = isTouchEvent(evt)\n            ? evt.changedTouches[0]\n            : evt;\n        if (!timeBaseline) {\n            timeBaseline = Date.now();\n        }\n        positions.push({\n            x: clientX,\n            y: clientY,\n            id: mirror.getId(target),\n            timeOffset: Date.now() - timeBaseline,\n        });\n        wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\n            ? IncrementalSource.Drag\n            : evt instanceof MouseEvent\n                ? IncrementalSource.MouseMove\n                : IncrementalSource.TouchMove);\n    }, threshold, {\n        trailing: false,\n    });\n    const handlers = [\n        on('mousemove', callbackWrapper(updatePosition), doc),\n        on('touchmove', callbackWrapper(updatePosition), doc),\n        on('drag', callbackWrapper(updatePosition), doc),\n    ];\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n    if (sampling.mouseInteraction === false) {\n        return () => { };\n    }\n    const disableMap = sampling.mouseInteraction === true ||\n        sampling.mouseInteraction === undefined\n        ? {}\n        : sampling.mouseInteraction;\n    const handlers = [];\n    const getHandler = (eventKey) => {\n        return (event) => {\n            const target = getEventTarget(event);\n            if (isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n                return;\n            }\n            const e = isTouchEvent(event) ? event.changedTouches[0] : event;\n            if (!e) {\n                return;\n            }\n            const id = mirror.getId(target);\n            const { clientX, clientY } = e;\n            callbackWrapper(mouseInteractionCb)({\n                type: MouseInteractions[eventKey],\n                id,\n                x: clientX,\n                y: clientY,\n            });\n        };\n    };\n    Object.keys(MouseInteractions)\n        .filter((key) => Number.isNaN(Number(key)) &&\n        !key.endsWith('_Departed') &&\n        disableMap[key] !== false)\n        .forEach((eventKey) => {\n        const eventName = eventKey.toLowerCase();\n        const handler = callbackWrapper(getHandler(eventKey));\n        handlers.push(on(eventName, handler, doc));\n    });\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n    const updatePosition = throttle((evt) => {\n        const target = getEventTarget(evt);\n        if (!target ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        const id = mirror.getId(target);\n        if (target === doc) {\n            const scrollEl = (doc.scrollingElement || doc.documentElement);\n            callbackWrapper(scrollCb)({\n                id,\n                x: scrollEl.scrollLeft,\n                y: scrollEl.scrollTop,\n            });\n        }\n        else {\n            callbackWrapper(scrollCb)({\n                id,\n                x: target.scrollLeft,\n                y: target.scrollTop,\n            });\n        }\n    }, sampling.scroll || 100);\n    return on('scroll', callbackWrapper(updatePosition), doc);\n}\nfunction initViewportResizeObserver({ viewportResizeCb, }) {\n    let lastH = -1;\n    let lastW = -1;\n    const updateDimension = throttle(() => {\n        const height = getWindowHeight();\n        const width = getWindowWidth();\n        if (lastH !== height || lastW !== width) {\n            callbackWrapper(viewportResizeCb)({\n                width: Number(width),\n                height: Number(height),\n            });\n            lastH = height;\n            lastW = width;\n        }\n    }, 200);\n    return on('resize', callbackWrapper(updateDimension), window);\n}\nfunction wrapEventWithUserTriggeredFlag(v, enable) {\n    const value = Object.assign({}, v);\n    if (!enable)\n        delete value.userTriggered;\n    return value;\n}\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\nconst lastInputValueMap = new WeakMap();\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputSelector, unmaskInputSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {\n    function eventHandler(event) {\n        let target = getEventTarget(event);\n        const tagName = target && target.tagName;\n        const userTriggered = event.isTrusted;\n        if (tagName === 'OPTION')\n            target = target.parentElement;\n        if (!target ||\n            !tagName ||\n            INPUT_TAGS.indexOf(tagName) < 0 ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        let type = target.type;\n        if (target.classList.contains(ignoreClass) ||\n            (ignoreSelector && target.matches(ignoreSelector))) {\n            return;\n        }\n        let text = target.value;\n        let isChecked = false;\n        if (target.hasAttribute('rr_is_password')) {\n            type = 'password';\n        }\n        if (type === 'radio' || type === 'checkbox') {\n            isChecked = target.checked;\n        }\n        else if (hasInputMaskOptions({\n            maskInputOptions,\n            maskInputSelector,\n            tagName,\n            type,\n        })) {\n            text = maskInputValue({\n                input: target,\n                maskInputOptions,\n                maskInputSelector,\n                unmaskInputSelector,\n                tagName,\n                type,\n                value: text,\n                maskInputFn,\n            });\n        }\n        cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));\n        const name = target.name;\n        if (type === 'radio' && name && isChecked) {\n            doc\n                .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\n                .forEach((el) => {\n                if (el !== target) {\n                    cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({\n                        text: el.value,\n                        isChecked: !isChecked,\n                        userTriggered: false,\n                    }, userTriggeredOnInput));\n                }\n            });\n        }\n    }\n    function cbWithDedup(target, v) {\n        const lastInputValue = lastInputValueMap.get(target);\n        if (!lastInputValue ||\n            lastInputValue.text !== v.text ||\n            lastInputValue.isChecked !== v.isChecked) {\n            lastInputValueMap.set(target, v);\n            const id = mirror.getId(target);\n            inputCb(Object.assign(Object.assign({}, v), { id }));\n        }\n    }\n    const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\n    const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\n    const propertyDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');\n    const hookProperties = [\n        [HTMLInputElement.prototype, 'value'],\n        [HTMLInputElement.prototype, 'checked'],\n        [HTMLSelectElement.prototype, 'value'],\n        [HTMLTextAreaElement.prototype, 'value'],\n        [HTMLSelectElement.prototype, 'selectedIndex'],\n        [HTMLOptionElement.prototype, 'selected'],\n    ];\n    if (propertyDescriptor && propertyDescriptor.set) {\n        handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\n            set() {\n                callbackWrapper(eventHandler)({ target: this });\n            },\n        })));\n    }\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction getNestedCSSRulePositions(rule) {\n    const positions = [];\n    function recurse(childRule, pos) {\n        if ((hasNestedCSSRule('CSSGroupingRule') &&\n            childRule.parentRule instanceof CSSGroupingRule) ||\n            (hasNestedCSSRule('CSSMediaRule') &&\n                childRule.parentRule instanceof CSSMediaRule) ||\n            (hasNestedCSSRule('CSSSupportsRule') &&\n                childRule.parentRule instanceof CSSSupportsRule) ||\n            (hasNestedCSSRule('CSSConditionRule') &&\n                childRule.parentRule instanceof CSSConditionRule)) {\n            const rules = Array.from(childRule.parentRule.cssRules);\n            const index = rules.indexOf(childRule);\n            pos.unshift(index);\n        }\n        else {\n            const rules = Array.from(childRule.parentStyleSheet.cssRules);\n            const index = rules.indexOf(childRule);\n            pos.unshift(index);\n        }\n        return pos;\n    }\n    return recurse(rule, positions);\n}\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror }, { win }) {\n    if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n        return () => { };\n    }\n    const insertRule = win.CSSStyleSheet.prototype.insertRule;\n    win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            const [rule, index] = argumentsList;\n            const id = mirror.getId(thisArg.ownerNode);\n            if (id !== -1) {\n                styleSheetRuleCb({\n                    id,\n                    adds: [{ rule, index }],\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n    win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            const [index] = argumentsList;\n            const id = mirror.getId(thisArg.ownerNode);\n            if (id !== -1) {\n                styleSheetRuleCb({\n                    id,\n                    removes: [{ index }],\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const supportedNestedCSSRuleTypes = {};\n    if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\n        supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n    }\n    else {\n        if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\n            supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n        }\n        if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\n            supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n        }\n        if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\n            supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n        }\n    }\n    const unmodifiedFunctions = {};\n    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n        unmodifiedFunctions[typeKey] = {\n            insertRule: type.prototype.insertRule,\n            deleteRule: type.prototype.deleteRule,\n        };\n        type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\n                const [rule, index] = argumentsList;\n                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);\n                if (id !== -1) {\n                    styleSheetRuleCb({\n                        id,\n                        adds: [\n                            {\n                                rule,\n                                index: [\n                                    ...getNestedCSSRulePositions(thisArg),\n                                    index || 0,\n                                ],\n                            },\n                        ],\n                    });\n                }\n                return target.apply(thisArg, argumentsList);\n            }),\n        });\n        type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\n                const [index] = argumentsList;\n                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);\n                if (id !== -1) {\n                    styleSheetRuleCb({\n                        id,\n                        removes: [\n                            { index: [...getNestedCSSRulePositions(thisArg), index] },\n                        ],\n                    });\n                }\n                return target.apply(thisArg, argumentsList);\n            }),\n        });\n    });\n    return callbackWrapper(() => {\n        win.CSSStyleSheet.prototype.insertRule = insertRule;\n        win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n        Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n            type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n            type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n        });\n    });\n}\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror }, { win }) {\n    const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n    win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            var _a, _b;\n            const [property, value, priority] = argumentsList;\n            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);\n            if (id !== -1) {\n                styleDeclarationCb({\n                    id,\n                    set: {\n                        property,\n                        value,\n                        priority,\n                    },\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n    win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            var _a, _b;\n            const [property] = argumentsList;\n            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);\n            if (id !== -1) {\n                styleDeclarationCb({\n                    id,\n                    remove: {\n                        property,\n                    },\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    return callbackWrapper(() => {\n        win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n        win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n    });\n}\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, }) {\n    const handler = (type) => throttle(callbackWrapper((event) => {\n        const target = getEventTarget(event);\n        if (!target ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        const { currentTime, volume, muted } = target;\n        mediaInteractionCb({\n            type,\n            id: mirror.getId(target),\n            currentTime,\n            volume,\n            muted,\n        });\n    }), sampling.media || 500);\n    const handlers = [\n        on('play', handler(0)),\n        on('pause', handler(1)),\n        on('seeked', handler(2)),\n        on('volumechange', handler(3)),\n    ];\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initFontObserver({ fontCb, doc }) {\n    const win = doc.defaultView;\n    if (!win) {\n        return () => { };\n    }\n    const handlers = [];\n    const fontMap = new WeakMap();\n    const originalFontFace = win.FontFace;\n    win.FontFace = function FontFace(family, source, descriptors) {\n        const fontFace = new originalFontFace(family, source, descriptors);\n        fontMap.set(fontFace, {\n            family,\n            buffer: typeof source !== 'string',\n            descriptors,\n            fontSource: typeof source === 'string'\n                ? source\n                :\n                    JSON.stringify(Array.from(new Uint8Array(source))),\n        });\n        return fontFace;\n    };\n    const restoreHandler = patch(doc.fonts, 'add', function (original) {\n        return function (fontFace) {\n            setTimeout(() => {\n                const p = fontMap.get(fontFace);\n                if (p) {\n                    fontCb(p);\n                    fontMap.delete(fontFace);\n                }\n            }, 0);\n            return original.apply(this, [fontFace]);\n        };\n    });\n    handlers.push(() => {\n        win.FontFace = originalFontFace;\n    });\n    handlers.push(restoreHandler);\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction mergeHooks(o, hooks) {\n    const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, } = o;\n    o.mutationCb = (...p) => {\n        if (hooks.mutation) {\n            hooks.mutation(...p);\n        }\n        mutationCb(...p);\n    };\n    o.mousemoveCb = (...p) => {\n        if (hooks.mousemove) {\n            hooks.mousemove(...p);\n        }\n        mousemoveCb(...p);\n    };\n    o.mouseInteractionCb = (...p) => {\n        if (hooks.mouseInteraction) {\n            hooks.mouseInteraction(...p);\n        }\n        mouseInteractionCb(...p);\n    };\n    o.scrollCb = (...p) => {\n        if (hooks.scroll) {\n            hooks.scroll(...p);\n        }\n        scrollCb(...p);\n    };\n    o.viewportResizeCb = (...p) => {\n        if (hooks.viewportResize) {\n            hooks.viewportResize(...p);\n        }\n        viewportResizeCb(...p);\n    };\n    o.inputCb = (...p) => {\n        if (hooks.input) {\n            hooks.input(...p);\n        }\n        inputCb(...p);\n    };\n    o.mediaInteractionCb = (...p) => {\n        if (hooks.mediaInteaction) {\n            hooks.mediaInteaction(...p);\n        }\n        mediaInteractionCb(...p);\n    };\n    o.styleSheetRuleCb = (...p) => {\n        if (hooks.styleSheetRule) {\n            hooks.styleSheetRule(...p);\n        }\n        styleSheetRuleCb(...p);\n    };\n    o.styleDeclarationCb = (...p) => {\n        if (hooks.styleDeclaration) {\n            hooks.styleDeclaration(...p);\n        }\n        styleDeclarationCb(...p);\n    };\n    o.canvasMutationCb = (...p) => {\n        if (hooks.canvasMutation) {\n            hooks.canvasMutation(...p);\n        }\n        canvasMutationCb(...p);\n    };\n    o.fontCb = (...p) => {\n        if (hooks.font) {\n            hooks.font(...p);\n        }\n        fontCb(...p);\n    };\n}\nfunction initObservers(o, hooks = {}) {\n    const currentWindow = o.doc.defaultView;\n    if (!currentWindow) {\n        return () => { };\n    }\n    mergeHooks(o, hooks);\n    const mutationObserver = initMutationObserver(o, o.doc);\n    const mousemoveHandler = initMoveObserver(o);\n    const mouseInteractionHandler = initMouseInteractionObserver(o);\n    const scrollHandler = initScrollObserver(o);\n    const viewportResizeHandler = initViewportResizeObserver(o);\n    const inputHandler = initInputObserver(o);\n    const mediaInteractionHandler = initMediaInteractionObserver(o);\n    const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\n    const styleDeclarationObserver = initStyleDeclarationObserver(o, {\n        win: currentWindow,\n    });\n    const fontObserver = o.collectFonts ? initFontObserver(o) : () => { };\n    const pluginHandlers = [];\n    for (const plugin of o.plugins) {\n        pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\n    }\n    return callbackWrapper(() => {\n        mutationBuffers.forEach((b) => b.reset());\n        mutationObserver.disconnect();\n        mousemoveHandler();\n        mouseInteractionHandler();\n        scrollHandler();\n        viewportResizeHandler();\n        inputHandler();\n        mediaInteractionHandler();\n        try {\n            styleSheetObserver();\n            styleDeclarationObserver();\n        }\n        catch (e) {\n        }\n        fontObserver();\n        pluginHandlers.forEach((h) => h());\n    });\n}\nfunction hasNestedCSSRule(prop) {\n    return typeof window[prop] !== 'undefined';\n}\nfunction canMonkeyPatchNestedCSSRule(prop) {\n    return Boolean(typeof window[prop] !== 'undefined' &&\n        window[prop].prototype &&\n        'insertRule' in window[prop].prototype &&\n        'deleteRule' in window[prop].prototype);\n}\n\nexport { INPUT_TAGS, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };\n","class IframeManager {\n    constructor(options) {\n        this.iframes = new WeakMap();\n        this.mutationCb = options.mutationCb;\n    }\n    addIframe(iframeEl) {\n        this.iframes.set(iframeEl, true);\n    }\n    addLoadListener(cb) {\n        this.loadListener = cb;\n    }\n    attachIframe(iframeEl, childSn) {\n        var _a;\n        this.mutationCb({\n            adds: [\n                {\n                    parentId: iframeEl.__sn.id,\n                    nextId: null,\n                    node: childSn,\n                },\n            ],\n            removes: [],\n            texts: [],\n            attributes: [],\n            isAttachIframe: true,\n        });\n        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\n    }\n}\n\nexport { IframeManager };\n","import { initMutationObserver, initScrollObserver } from './observer.js';\nimport { patch } from '../utils.js';\n\nclass ShadowDomManager {\n    constructor(options) {\n        this.restorePatches = [];\n        this.mutationCb = options.mutationCb;\n        this.scrollCb = options.scrollCb;\n        this.bypassOptions = options.bypassOptions;\n        this.mirror = options.mirror;\n        const manager = this;\n        this.restorePatches.push(patch(HTMLElement.prototype, 'attachShadow', function (original) {\n            return function () {\n                const shadowRoot = original.apply(this, arguments);\n                if (this.shadowRoot)\n                    manager.addShadowRoot(this.shadowRoot, this.ownerDocument);\n                return shadowRoot;\n            };\n        }));\n    }\n    addShadowRoot(shadowRoot, doc) {\n        initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);\n        initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }));\n    }\n    observeAttachShadow(iframeElement) {\n        if (iframeElement.contentWindow) {\n            const manager = this;\n            this.restorePatches.push(patch(iframeElement.contentWindow.HTMLElement.prototype, 'attachShadow', function (original) {\n                return function () {\n                    const shadowRoot = original.apply(this, arguments);\n                    if (this.shadowRoot)\n                        manager.addShadowRoot(this.shadowRoot, iframeElement.contentDocument);\n                    return shadowRoot;\n                };\n            }));\n        }\n    }\n    reset() {\n        this.restorePatches.forEach((restorePatch) => restorePatch());\n    }\n}\n\nexport { ShadowDomManager };\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\n\nexport { __rest };\n","import { CanvasContext } from '../../../types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, unblockSelector, blockSelector, mirror) {\n    const handlers = [];\n    const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\n    for (const prop of props2D) {\n        try {\n            if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\n                continue;\n            }\n            const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\n                return function (...args) {\n                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {\n                        setTimeout(() => {\n                            const recordArgs = [...args];\n                            if (prop === 'drawImage') {\n                                if (recordArgs[0] &&\n                                    recordArgs[0] instanceof HTMLCanvasElement) {\n                                    const canvas = recordArgs[0];\n                                    const ctx = canvas.getContext('2d');\n                                    let imgd = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, canvas.width, canvas.height);\n                                    let pix = imgd === null || imgd === void 0 ? void 0 : imgd.data;\n                                    recordArgs[0] = JSON.stringify(pix);\n                                }\n                            }\n                            cb(this.canvas, {\n                                type: CanvasContext['2D'],\n                                property: prop,\n                                args: recordArgs,\n                            });\n                        }, 0);\n                    }\n                    return original.apply(this, args);\n                };\n            });\n            handlers.push(restoreHandler);\n        }\n        catch (_a) {\n            const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\n                set(v) {\n                    cb(this.canvas, {\n                        type: CanvasContext['2D'],\n                        property: prop,\n                        args: [v],\n                        setter: true,\n                    });\n                },\n            });\n            handlers.push(hookHandler);\n        }\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvas2DMutationObserver as default };\n","import { patch, isBlocked } from '../../../utils.js';\n\nfunction initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector) {\n    const handlers = [];\n    try {\n        const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\n            return function (contextType, ...args) {\n                if (!isBlocked(this, blockClass, blockSelector, unblockSelector)) {\n                    if (!('__context' in this))\n                        this.__context = contextType;\n                }\n                return original.apply(this, [contextType, ...args]);\n            };\n        });\n        handlers.push(restoreHandler);\n    }\n    catch (_a) {\n        console.error('failed to patch HTMLCanvasElement.prototype.getContext');\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvasContextObserver as default };\n","/*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n    for (i = 0; i < len; i += 3) {\n        base64 += chars[bytes[i] >> 2];\n        base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n        base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n        base64 += chars[bytes[i + 2] & 63];\n    }\n    if (len % 3 === 2) {\n        base64 = base64.substring(0, base64.length - 1) + '=';\n    }\n    else if (len % 3 === 1) {\n        base64 = base64.substring(0, base64.length - 2) + '==';\n    }\n    return base64;\n};\nvar decode = function (base64) {\n    var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n    if (base64[base64.length - 1] === '=') {\n        bufferLength--;\n        if (base64[base64.length - 2] === '=') {\n            bufferLength--;\n        }\n    }\n    var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n    for (i = 0; i < len; i += 4) {\n        encoded1 = lookup[base64.charCodeAt(i)];\n        encoded2 = lookup[base64.charCodeAt(i + 1)];\n        encoded3 = lookup[base64.charCodeAt(i + 2)];\n        encoded4 = lookup[base64.charCodeAt(i + 3)];\n        bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n        bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n        bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n    return arraybuffer;\n};\n\nexport { decode, encode };\n","import { encode } from './../../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst webGLVarMap = new Map();\nfunction variableListFor(ctx, ctor) {\n    let contextMap = webGLVarMap.get(ctx);\n    if (!contextMap) {\n        contextMap = new Map();\n        webGLVarMap.set(ctx, contextMap);\n    }\n    if (!contextMap.has(ctor)) {\n        contextMap.set(ctor, []);\n    }\n    return contextMap.get(ctor);\n}\nconst saveWebGLVar = (value, win, ctx) => {\n    if (!value ||\n        !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))\n        return;\n    const name = value.constructor.name;\n    const list = variableListFor(ctx, name);\n    let index = list.indexOf(value);\n    if (index === -1) {\n        index = list.length;\n        list.push(value);\n    }\n    return index;\n};\nfunction serializeArg(value, win, ctx) {\n    if (value instanceof Array) {\n        return value.map((arg) => serializeArg(arg, win, ctx));\n    }\n    else if (value === null) {\n        return value;\n    }\n    else if (value instanceof Float32Array ||\n        value instanceof Float64Array ||\n        value instanceof Int32Array ||\n        value instanceof Uint32Array ||\n        value instanceof Uint8Array ||\n        value instanceof Uint16Array ||\n        value instanceof Int16Array ||\n        value instanceof Int8Array ||\n        value instanceof Uint8ClampedArray) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [Object.values(value)],\n        };\n    }\n    else if (value instanceof ArrayBuffer) {\n        const name = value.constructor.name;\n        const base64 = encode(value);\n        return {\n            rr_type: name,\n            base64,\n        };\n    }\n    else if (value instanceof DataView) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [\n                serializeArg(value.buffer, win, ctx),\n                value.byteOffset,\n                value.byteLength,\n            ],\n        };\n    }\n    else if (value instanceof HTMLImageElement) {\n        const name = value.constructor.name;\n        const { src } = value;\n        return {\n            rr_type: name,\n            src,\n        };\n    }\n    else if (value instanceof ImageData) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [serializeArg(value.data, win, ctx), value.width, value.height],\n        };\n    }\n    else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\n        const name = value.constructor.name;\n        const index = saveWebGLVar(value, win, ctx);\n        return {\n            rr_type: name,\n            index: index,\n        };\n    }\n    return value;\n}\nconst serializeArgs = (args, win, ctx) => {\n    return [...args].map((arg) => serializeArg(arg, win, ctx));\n};\nconst isInstanceOfWebGLObject = (value, win) => {\n    const webGLConstructorNames = [\n        'WebGLActiveInfo',\n        'WebGLBuffer',\n        'WebGLFramebuffer',\n        'WebGLProgram',\n        'WebGLRenderbuffer',\n        'WebGLShader',\n        'WebGLShaderPrecisionFormat',\n        'WebGLTexture',\n        'WebGLUniformLocation',\n        'WebGLVertexArrayObject',\n        'WebGLVertexArrayObjectOES',\n    ];\n    const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');\n    return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));\n};\n\nexport { isInstanceOfWebGLObject, saveWebGLVar, serializeArg, serializeArgs, variableListFor };\n","import { CanvasContext } from '../../../types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { saveWebGLVar, serializeArgs } from './serialize-args.js';\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, unblockSelector, blockSelector, mirror, win) {\n    const handlers = [];\n    const props = Object.getOwnPropertyNames(prototype);\n    for (const prop of props) {\n        try {\n            if (typeof prototype[prop] !== 'function') {\n                continue;\n            }\n            const restoreHandler = patch(prototype, prop, function (original) {\n                return function (...args) {\n                    const result = original.apply(this, args);\n                    saveWebGLVar(result, win, prototype);\n                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {\n                        const id = mirror.getId(this.canvas);\n                        const recordArgs = serializeArgs([...args], win, prototype);\n                        const mutation = {\n                            type,\n                            property: prop,\n                            args: recordArgs,\n                        };\n                        cb(this.canvas, mutation);\n                    }\n                    return result;\n                };\n            });\n            handlers.push(restoreHandler);\n        }\n        catch (_a) {\n            const hookHandler = hookSetter(prototype, prop, {\n                set(v) {\n                    cb(this.canvas, {\n                        type,\n                        property: prop,\n                        args: [v],\n                        setter: true,\n                    });\n                },\n            });\n            handlers.push(hookHandler);\n        }\n    }\n    return handlers;\n}\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {\n    const handlers = [];\n    handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win));\n    if (typeof win.WebGL2RenderingContext !== 'undefined') {\n        handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win));\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvasWebGLMutationObserver as default };\n","import { __rest } from './../../../../../../ext/tslib/tslib.es6.js';\nimport initCanvas2DMutationObserver from './2d.js';\nimport initCanvasContextObserver from './canvas.js';\nimport initCanvasWebGLMutationObserver from './webgl.js';\n\nclass CanvasManager {\n    reset() {\n        this.pendingCanvasMutations.clear();\n        this.resetObservers && this.resetObservers();\n    }\n    freeze() {\n        this.frozen = true;\n    }\n    unfreeze() {\n        this.frozen = false;\n    }\n    lock() {\n        this.locked = true;\n    }\n    unlock() {\n        this.locked = false;\n    }\n    constructor(options) {\n        this.pendingCanvasMutations = new Map();\n        this.rafStamps = { latestId: 0, invokeId: null };\n        this.frozen = false;\n        this.locked = false;\n        this.processMutation = function (target, mutation) {\n            const newFrame = this.rafStamps.invokeId &&\n                this.rafStamps.latestId !== this.rafStamps.invokeId;\n            if (newFrame || !this.rafStamps.invokeId)\n                this.rafStamps.invokeId = this.rafStamps.latestId;\n            if (!this.pendingCanvasMutations.has(target)) {\n                this.pendingCanvasMutations.set(target, []);\n            }\n            this.pendingCanvasMutations.get(target).push(mutation);\n        };\n        this.mutationCb = options.mutationCb;\n        this.mirror = options.mirror;\n        if (options.recordCanvas === true)\n            this.initCanvasMutationObserver(options.win, options.blockClass, options.blockSelector, options.unblockSelector);\n    }\n    initCanvasMutationObserver(win, blockClass, unblockSelector, blockSelector) {\n        this.startRAFTimestamping();\n        this.startPendingCanvasMutationFlusher();\n        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector);\n        const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\n        const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\n        this.resetObservers = () => {\n            canvasContextReset();\n            canvas2DReset();\n            canvasWebGL1and2Reset();\n        };\n    }\n    startPendingCanvasMutationFlusher() {\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\n    }\n    startRAFTimestamping() {\n        const setLatestRAFTimestamp = (timestamp) => {\n            this.rafStamps.latestId = timestamp;\n            requestAnimationFrame(setLatestRAFTimestamp);\n        };\n        requestAnimationFrame(setLatestRAFTimestamp);\n    }\n    flushPendingCanvasMutations() {\n        this.pendingCanvasMutations.forEach((values, canvas) => {\n            const id = this.mirror.getId(canvas);\n            this.flushPendingCanvasMutationFor(canvas, id);\n        });\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\n    }\n    flushPendingCanvasMutationFor(canvas, id) {\n        if (this.frozen || this.locked) {\n            return;\n        }\n        const valuesWithType = this.pendingCanvasMutations.get(canvas);\n        if (!valuesWithType || id === -1)\n            return;\n        const values = valuesWithType.map((value) => {\n            const rest = __rest(value, [\"type\"]);\n            return rest;\n        });\n        const { type } = valuesWithType[0];\n        this.mutationCb({ id, type, commands: values });\n        this.pendingCanvasMutations.delete(canvas);\n    }\n}\n\nexport { CanvasManager };\n","import { snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { initObservers, mutationBuffers } from './observer.js';\nimport { polyfill, on, createMirror, getWindowWidth, getWindowHeight, isIframeINode, hasShadowRoot } from '../utils.js';\nimport { EventType, IncrementalSource } from '../types.js';\nimport { IframeManager } from './iframe-manager.js';\nimport { ShadowDomManager } from './shadow-dom-manager.js';\nimport { CanvasManager } from './observers/canvas/canvas-manager.js';\nimport { callbackWrapper } from '../sentry/callbackWrapper.js';\n\nfunction wrapEvent(e) {\n    return Object.assign(Object.assign({}, e), { timestamp: Date.now() });\n}\nlet wrappedEmit;\nlet takeFullSnapshot;\nconst mirror = createMirror();\nfunction record(options = {}) {\n    const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, maskInputSelector = null, unmaskTextSelector = null, unmaskInputSelector = null, inlineStylesheet = true, maskAllText = false, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, mousemoveWait, recordCanvas = false, userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, onMutation, } = options;\n    if (!emit) {\n        throw new Error('emit function is required');\n    }\n    if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\n        sampling.mousemove = mousemoveWait;\n    }\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n            radio: true,\n            checkbox: true,\n        }\n        : _maskInputOptions !== undefined\n            ? _maskInputOptions\n            : {};\n    const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\n        ? {\n            script: true,\n            comment: true,\n            headFavicon: true,\n            headWhitespace: true,\n            headMetaSocial: true,\n            headMetaRobots: true,\n            headMetaHttpEquiv: true,\n            headMetaVerification: true,\n            headMetaAuthorship: _slimDOMOptions === 'all',\n            headMetaDescKeywords: _slimDOMOptions === 'all',\n        }\n        : _slimDOMOptions\n            ? _slimDOMOptions\n            : {};\n    polyfill();\n    let lastFullSnapshotEvent;\n    let incrementalSnapshotCount = 0;\n    const eventProcessor = (e) => {\n        for (const plugin of plugins || []) {\n            if (plugin.eventProcessor) {\n                e = plugin.eventProcessor(e);\n            }\n        }\n        if (packFn) {\n            e = packFn(e);\n        }\n        return e;\n    };\n    wrappedEmit = (e, isCheckout) => {\n        var _a;\n        if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&\n            e.type !== EventType.FullSnapshot &&\n            !(e.type === EventType.IncrementalSnapshot &&\n                e.data.source === IncrementalSource.Mutation)) {\n            mutationBuffers.forEach((buf) => buf.unfreeze());\n        }\n        emit(eventProcessor(e), isCheckout);\n        if (e.type === EventType.FullSnapshot) {\n            lastFullSnapshotEvent = e;\n            incrementalSnapshotCount = 0;\n        }\n        else if (e.type === EventType.IncrementalSnapshot) {\n            if (e.data.source === IncrementalSource.Mutation &&\n                e.data.isAttachIframe) {\n                return;\n            }\n            incrementalSnapshotCount++;\n            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n            const exceedTime = checkoutEveryNms &&\n                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n            if (exceedCount || exceedTime) {\n                takeFullSnapshot(true);\n            }\n        }\n    };\n    const wrappedMutationEmit = (m) => {\n        wrappedEmit(wrapEvent({\n            type: EventType.IncrementalSnapshot,\n            data: Object.assign({ source: IncrementalSource.Mutation }, m),\n        }));\n    };\n    const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({\n        type: EventType.IncrementalSnapshot,\n        data: Object.assign({ source: IncrementalSource.Scroll }, p),\n    }));\n    const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({\n        type: EventType.IncrementalSnapshot,\n        data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),\n    }));\n    const iframeManager = new IframeManager({\n        mutationCb: wrappedMutationEmit,\n    });\n    const canvasManager = new CanvasManager({\n        recordCanvas,\n        mutationCb: wrappedCanvasMutationEmit,\n        win: window,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        mirror,\n    });\n    const shadowDomManager = new ShadowDomManager({\n        mutationCb: wrappedMutationEmit,\n        scrollCb: wrappedScrollEmit,\n        bypassOptions: {\n            onMutation,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            maskInputSelector,\n            unmaskInputSelector,\n            inlineStylesheet,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            recordCanvas,\n            inlineImages,\n            sampling,\n            slimDOMOptions,\n            iframeManager,\n            canvasManager,\n        },\n        mirror,\n    });\n    takeFullSnapshot = (isCheckout = false) => {\n        var _a, _b, _c, _d;\n        wrappedEmit(wrapEvent({\n            type: EventType.Meta,\n            data: {\n                href: window.location.href,\n                width: getWindowWidth(),\n                height: getWindowHeight(),\n            },\n        }), isCheckout);\n        mutationBuffers.forEach((buf) => buf.lock());\n        const [node, idNodeMap] = snapshot(document, {\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            maskInputSelector,\n            unmaskInputSelector,\n            inlineStylesheet,\n            maskAllText,\n            maskAllInputs: maskInputOptions,\n            maskTextFn,\n            slimDOM: slimDOMOptions,\n            recordCanvas,\n            inlineImages,\n            onSerialize: (n) => {\n                if (isIframeINode(n)) {\n                    iframeManager.addIframe(n);\n                }\n                if (hasShadowRoot(n)) {\n                    shadowDomManager.addShadowRoot(n.shadowRoot, document);\n                }\n            },\n            onIframeLoad: (iframe, childSn) => {\n                iframeManager.attachIframe(iframe, childSn);\n                shadowDomManager.observeAttachShadow(iframe);\n            },\n            keepIframeSrcFn,\n        });\n        if (!node) {\n            return console.warn('Failed to snapshot the document');\n        }\n        mirror.map = idNodeMap;\n        wrappedEmit(wrapEvent({\n            type: EventType.FullSnapshot,\n            data: {\n                node,\n                initialOffset: {\n                    left: window.pageXOffset !== undefined\n                        ? window.pageXOffset\n                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollLeft) ||\n                            ((_b = (_a = document === null || document === void 0 ? void 0 : document.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||\n                            (document === null || document === void 0 ? void 0 : document.body.scrollLeft) ||\n                            0,\n                    top: window.pageYOffset !== undefined\n                        ? window.pageYOffset\n                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollTop) ||\n                            ((_d = (_c = document === null || document === void 0 ? void 0 : document.body) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.scrollTop) ||\n                            (document === null || document === void 0 ? void 0 : document.body.scrollTop) ||\n                            0,\n                },\n            },\n        }));\n        mutationBuffers.forEach((buf) => buf.unlock());\n    };\n    try {\n        const handlers = [];\n        handlers.push(on('DOMContentLoaded', () => {\n            wrappedEmit(wrapEvent({\n                type: EventType.DomContentLoaded,\n                data: {},\n            }));\n        }));\n        const observe = (doc) => {\n            var _a;\n            return callbackWrapper(initObservers)({\n                onMutation,\n                mutationCb: wrappedMutationEmit,\n                mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: {\n                        source,\n                        positions,\n                    },\n                })),\n                mouseInteractionCb: (d) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),\n                })),\n                scrollCb: wrappedScrollEmit,\n                viewportResizeCb: (d) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.ViewportResize }, d),\n                })),\n                inputCb: (v) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.Input }, v),\n                })),\n                mediaInteractionCb: (p) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),\n                })),\n                styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),\n                })),\n                styleDeclarationCb: (r) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),\n                })),\n                canvasMutationCb: wrappedCanvasMutationEmit,\n                fontCb: (p) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.Font }, p),\n                })),\n                blockClass,\n                ignoreClass,\n                ignoreSelector,\n                maskTextClass,\n                maskTextSelector,\n                unmaskTextSelector,\n                maskInputSelector,\n                unmaskInputSelector,\n                maskInputOptions,\n                inlineStylesheet,\n                sampling,\n                recordCanvas,\n                inlineImages,\n                userTriggeredOnInput,\n                collectFonts,\n                doc,\n                maskAllText,\n                maskInputFn,\n                maskTextFn,\n                blockSelector,\n                unblockSelector,\n                slimDOMOptions,\n                mirror,\n                iframeManager,\n                shadowDomManager,\n                canvasManager,\n                plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({\n                    observer: p.observer,\n                    options: p.options,\n                    callback: (payload) => wrappedEmit(wrapEvent({\n                        type: EventType.Plugin,\n                        data: {\n                            plugin: p.name,\n                            payload,\n                        },\n                    })),\n                }))) || [],\n            }, hooks);\n        };\n        iframeManager.addLoadListener((iframeEl) => {\n            try {\n                handlers.push(observe(iframeEl.contentDocument));\n            }\n            catch (error) {\n                console.warn(error);\n            }\n        });\n        const init = () => {\n            takeFullSnapshot();\n            handlers.push(observe(document));\n        };\n        if (document.readyState === 'interactive' ||\n            document.readyState === 'complete') {\n            init();\n        }\n        else {\n            handlers.push(on('load', () => {\n                wrappedEmit(wrapEvent({\n                    type: EventType.Load,\n                    data: {},\n                }));\n                init();\n            }, window));\n        }\n        return () => {\n            handlers.forEach((h) => h());\n        };\n    }\n    catch (error) {\n        console.warn(error);\n    }\n}\nrecord.addCustomEvent = (tag, payload) => {\n    if (!wrappedEmit) {\n        throw new Error('please add custom event after start recording');\n    }\n    wrappedEmit(wrapEvent({\n        type: EventType.Custom,\n        data: {\n            tag,\n            payload,\n        },\n    }));\n};\nrecord.freezePage = () => {\n    mutationBuffers.forEach((buf) => buf.freeze());\n};\nrecord.takeFullSnapshot = (isCheckout) => {\n    if (!takeFullSnapshot) {\n        throw new Error('please take full snapshot after start recording');\n    }\n    takeFullSnapshot(isCheckout);\n};\nrecord.mirror = mirror;\n\nexport { record as default };\n","import type { PerformanceNavigationTiming, PerformancePaintTiming } from '../types';\n\nconst NAVIGATION_ENTRY_KEYS: Array<keyof PerformanceNavigationTiming> = [\n  'name',\n  'type',\n  'startTime',\n  'transferSize',\n  'duration',\n];\n\nfunction isNavigationEntryEqual(a: PerformanceNavigationTiming) {\n  return function (b: PerformanceNavigationTiming) {\n    return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]);\n  };\n}\n\n/**\n * There are some difficulties diagnosing why there are duplicate navigation\n * entries. We've witnessed several intermittent results:\n * - duplicate entries have duration = 0\n * - duplicate entries are the same object reference\n * - none of the above\n *\n * Compare the values of several keys to determine if the entries are duplicates or not.\n */\n// TODO (high-prio): Figure out wth is returned here\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function dedupePerformanceEntries(\n  currentList: PerformanceEntryList,\n  newList: PerformanceEntryList,\n): PerformanceEntryList {\n  // Partition `currentList` into 3 different lists based on entryType\n  const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce(\n    (acc: [PerformanceNavigationTiming[], PerformancePaintTiming[], PerformanceEntryList], entry) => {\n      if (entry.entryType === 'navigation') {\n        acc[0].push(entry as PerformanceNavigationTiming);\n      } else if (entry.entryType === 'largest-contentful-paint') {\n        acc[1].push(entry as PerformancePaintTiming);\n      } else {\n        acc[2].push(entry);\n      }\n      return acc;\n    },\n    [[], [], []],\n  );\n\n  const newEntries: PerformanceEntryList = [];\n  const newNavigationEntries: PerformanceNavigationTiming[] = [];\n  let newLcpEntry: PerformancePaintTiming | undefined = existingLcpEntries.length\n    ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted\n    : undefined;\n\n  newList.forEach(entry => {\n    if (entry.entryType === 'largest-contentful-paint') {\n      // We want the latest LCP event only\n      if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) {\n        newLcpEntry = entry;\n      }\n      return;\n    }\n\n    if (entry.entryType === 'navigation') {\n      const navigationEntry = entry as PerformanceNavigationTiming;\n\n      // Check if the navigation entry is contained in currentList or newList\n      if (\n        // Ignore any navigation entries with duration 0, as they are likely duplicates\n        entry.duration > 0 &&\n        // Ensure new entry does not already exist in existing entries\n        !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) &&\n        // Ensure new entry does not already exist in new list of navigation entries\n        !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry))\n      ) {\n        newNavigationEntries.push(navigationEntry);\n      }\n\n      // Otherwise this navigation entry is considered a duplicate and is thrown away\n      return;\n    }\n\n    newEntries.push(entry);\n  });\n\n  // Re-combine and sort by startTime\n  return [\n    ...(newLcpEntry ? [newLcpEntry] : []),\n    ...existingNavigationEntries,\n    ...existingEntries,\n    ...newEntries,\n    ...newNavigationEntries,\n  ].sort((a, b) => a.startTime - b.startTime);\n}\n","import type { AllPerformanceEntry, ReplayContainer } from '../types';\nimport { dedupePerformanceEntries } from '../util/dedupePerformanceEntries';\n\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n */\nexport function setupPerformanceObserver(replay: ReplayContainer): PerformanceObserver {\n  const performanceObserverHandler = (list: PerformanceObserverEntryList): void => {\n    // For whatever reason the observer was returning duplicate navigation\n    // entries (the other entry types were not duplicated).\n    const newPerformanceEntries = dedupePerformanceEntries(\n      replay.performanceEvents,\n      list.getEntries() as AllPerformanceEntry[],\n    );\n    replay.performanceEvents = newPerformanceEntries;\n  };\n\n  const performanceObserver = new PerformanceObserver(performanceObserverHandler);\n\n  [\n    'element',\n    'event',\n    'first-input',\n    'largest-contentful-paint',\n    'layout-shift',\n    'longtask',\n    'navigation',\n    'paint',\n    'resource',\n  ].forEach(type => {\n    try {\n      performanceObserver.observe({\n        type,\n        buffered: true,\n      });\n    } catch {\n      // This can throw if an entry type is not supported in the browser.\n      // Ignore these errors.\n    }\n  });\n\n  return performanceObserver;\n}\n","export default `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\nfunction t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},p=(t,e,a)=>{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},A=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},E=(t,i,n)=>{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f<t.sym_next);p(t,256,i)},R=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},U=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{p(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(p(t,n,t.bl_tree),o--),p(t,16,t.bl_tree),g(t,o-3,2)):o<=10?(p(t,17,t.bl_tree),g(t,o-3,3)):(p(t,18,t.bl_tree),g(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let S=!1;const D=(t,e,a,i)=>{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s<i;s++)g(t,t.bl_tree[2*n[s]+1],3);U(t,t.dyn_ltree,e-1),U(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),E(t,t.dyn_ltree,t.dyn_dtree)),y(t),i&&x(t)},O={_tr_init:t=>{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<<e[m];t++)l[w++]=m;for(l[w-1]=m,b=0,m=0;m<16;m++)for(d[m]=b,t=0;t<1<<a[m];t++)o[b++]=m;for(b>>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<<a[m]-7;t++)o[256+b++]=m;for(n=0;n<=15;n++)g[n]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(v(s,287,g),t=0;t<30;t++)r[2*t+1]=5,r[2*t]=k(t,5);f=new _(s,e,257,286,15),c=new _(r,a,0,30,15),u=new _(new Array(0),i,0,19,7)})(),S=!0),t.l_desc=new w(t.dyn_ltree,f),t.d_desc=new w(t.dyn_dtree,c),t.bl_desc=new w(t.bl_tree,u),t.bi_buf=0,t.bi_valid=0,y(t)},_tr_stored_block:D,_tr_flush_block:T,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},I={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const ct=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=258-(f-s),s=f-258,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==X||e===P||a!==i+t.strm.avail_in))break;r=e===X&&a===i+t.strm.avail_in?1:0,H(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==P&&e!==X&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a),t.match_length<=5&&(t.strategy===et||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,Zt(t)};var St={deflateInit:(t,e)=>Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=258-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:\"pako deflate (from Nodeca project)\"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if(\"object\"!=typeof a)throw new TypeError(a+\"must be non-object\");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ft=!1}const Lt=new Uint8Array(256);for(let t=0;t<256;t++)Lt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if(\"function\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Lt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a=\"\";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Bt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t=\"string\"==typeof e.dictionary?Nt(e.dictionary):\"[object ArrayBuffer]\"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,\"string\"==typeof t?a.input=Nt(t):\"[object ArrayBuffer]\"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg=\"invalid literal/length code\",E.mode=16209;break t}k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];a:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg=\"invalid distance code\",E.mode=16209;break t}if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const te=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ee=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ae=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ne=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=15;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=te,D=ee,u=257):(A=ae,D=ie,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ue={inflateReset:ve,inflateReset2:ye,inflateResetKeep:ke,inflateInit:t=>xe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg=\"incorrect header check\",a.mode=me;break}if((15&h)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg=\"invalid window size\",a.mode=me;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:16191,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(57344&a.flags){t.msg=\"unknown header flags set\",a.mode=me;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg=\"header crc mismatch\",a.mode=me;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=be(h),h=0,d=0,a.mode=16190;case 16190:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,de;t.adler=a.check=1,a.mode=16191;case 16191:if(e===re||e===oe)break t;case 16192:if(a.last){h>>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg=\"invalid block type\",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg=\"invalid stored block lengths\",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg=\"too many length or distance symbols\",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid code lengths set\",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg=\"invalid bit length repeat\",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg=\"invalid bit length repeat\",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg=\"invalid code -- missing end-of-block\",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid literal/lengths set\",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg=\"invalid distances set\",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg=\"invalid literal/length code\",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(0==(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg=\"invalid distance code\",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg=\"invalid distance too far back\",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg=\"invalid distance too far back\",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:be(h))!==a.check){t.msg=\"incorrect data check\",a.mode=me;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg=\"incorrect length check\",a.mode=me;break}h=0,d=0}a.mode=16208;case 16208:x=he;break t;case me:x=fe;break t;case 16210:return ce;default:return _e}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<me&&(a.mode<16206||e!==se))&&Ze(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(16191===a.mode?128:0)+(16199===a.mode||16194===a.mode?256:0),(0===_&&0===f||e===se)&&x===le&&(x=ue),x},inflateEnd:t=>{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:\"pako inflate (from Nodeca project)\"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:\"\"},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):\"[object ArrayBuffer]\"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,\"[object ArrayBuffer]\"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if(\"string\"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\"Adding invalid event\");const e=this._hasEvents?\",\":\"\";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push(\"]\",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push(\"[\",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener(\"message\",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&\"function\"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\"init\",success:!0,response:void 0});`;\n","import r from\"./worker\";function e(){const e=new Blob([r]);return URL.createObjectURL(e)}export{e as getWorkerURL};\n","import type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\n\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\nexport class EventBufferArray implements EventBuffer {\n  /** All the events that are buffered to be sent. */\n  public events: RecordingEvent[];\n\n  public constructor() {\n    this.events = [];\n  }\n\n  /** @inheritdoc */\n  public get hasEvents(): boolean {\n    return this.events.length > 0;\n  }\n\n  /** @inheritdoc */\n  public destroy(): void {\n    this.events = [];\n  }\n\n  /** @inheritdoc */\n  public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    if (isCheckout) {\n      this.events = [event];\n      return;\n    }\n\n    this.events.push(event);\n    return;\n  }\n\n  /** @inheritdoc */\n  public finish(): Promise<string> {\n    return new Promise<string>(resolve => {\n      // Make a copy of the events array reference and immediately clear the\n      // events member so that we do not lose new events while uploading\n      // attachment.\n      const eventsRet = this.events;\n      this.events = [];\n      resolve(JSON.stringify(eventsRet));\n    });\n  }\n}\n","import { logger } from '@sentry/utils';\n\nimport type { WorkerRequest, WorkerResponse } from '../types';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class WorkerHandler {\n  private _worker: Worker;\n  private _id: number;\n  private _ensureReadyPromise?: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._worker = worker;\n    this._id = 0;\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    // Ensure we only check once\n    if (this._ensureReadyPromise) {\n      return this._ensureReadyPromise;\n    }\n\n    this._ensureReadyPromise = new Promise((resolve, reject) => {\n      this._worker.addEventListener(\n        'message',\n        ({ data }: MessageEvent) => {\n          if ((data as WorkerResponse).success) {\n            resolve();\n          } else {\n            reject();\n          }\n        },\n        { once: true },\n      );\n\n      this._worker.addEventListener(\n        'error',\n        error => {\n          reject(error);\n        },\n        { once: true },\n      );\n    });\n\n    return this._ensureReadyPromise;\n  }\n\n  /**\n   * Destroy the worker.\n   */\n  public destroy(): void {\n    __DEBUG_BUILD__ && logger.log('[Replay] Destroying compression worker');\n    this._worker.terminate();\n  }\n\n  /**\n   * Post message to worker and wait for response before resolving promise.\n   */\n  public postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T> {\n    const id = this._getAndIncrementId();\n\n    return new Promise((resolve, reject) => {\n      const listener = ({ data }: MessageEvent): void => {\n        const response = data as WorkerResponse;\n        if (response.method !== method) {\n          return;\n        }\n\n        // There can be multiple listeners for a single method, the id ensures\n        // that the response matches the caller.\n        if (response.id !== id) {\n          return;\n        }\n\n        // At this point, we'll always want to remove listener regardless of result status\n        this._worker.removeEventListener('message', listener);\n\n        if (!response.success) {\n          // TODO: Do some error handling, not sure what\n          __DEBUG_BUILD__ && logger.error('[Replay]', response.response);\n\n          reject(new Error('Error in compression worker'));\n          return;\n        }\n\n        resolve(response.response as T);\n      };\n\n      // Note: we can't use `once` option because it's possible it needs to\n      // listen to multiple messages\n      this._worker.addEventListener('message', listener);\n      this._worker.postMessage({ id, method, arg });\n    });\n  }\n\n  /** Get the current ID and increment it for the next call. */\n  private _getAndIncrementId(): number {\n    return this._id++;\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\nimport type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\nimport { WorkerHandler } from './WorkerHandler';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class EventBufferCompressionWorker implements EventBuffer {\n  /** @inheritdoc */\n  public hasEvents: boolean;\n\n  private _worker: WorkerHandler;\n\n  public constructor(worker: Worker) {\n    this._worker = new WorkerHandler(worker);\n    this.hasEvents = false;\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    return this._worker.ensureReady();\n  }\n\n  /**\n   * Destroy the event buffer.\n   */\n  public destroy(): void {\n    this._worker.destroy();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfuly received and processed by worker.\n   */\n  public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    this.hasEvents = true;\n\n    if (isCheckout) {\n      // This event is a checkout, make sure worker buffer is cleared before\n      // proceeding.\n      await this._clear();\n    }\n\n    return this._sendEventToWorker(event);\n  }\n\n  /**\n   * Finish the event buffer and return the compressed data.\n   */\n  public finish(): Promise<ReplayRecordingData> {\n    return this._finishRequest();\n  }\n\n  /**\n   * Send the event to the worker.\n   */\n  private _sendEventToWorker(event: RecordingEvent): Promise<AddEventResult> {\n    return this._worker.postMessage<void>('addEvent', JSON.stringify(event));\n  }\n\n  /**\n   * Finish the request and return the compressed data from the worker.\n   */\n  private async _finishRequest(): Promise<Uint8Array> {\n    const response = await this._worker.postMessage<Uint8Array>('finish');\n\n    this.hasEvents = false;\n\n    return response;\n  }\n\n  /** Clear any pending events from the worker. */\n  private _clear(): Promise<void> {\n    return this._worker.postMessage('clear');\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferCompressionWorker } from './EventBufferCompressionWorker';\n\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\nexport class EventBufferProxy implements EventBuffer {\n  private _fallback: EventBufferArray;\n  private _compression: EventBufferCompressionWorker;\n  private _used: EventBuffer;\n  private _ensureWorkerIsLoadedPromise: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._fallback = new EventBufferArray();\n    this._compression = new EventBufferCompressionWorker(worker);\n    this._used = this._fallback;\n\n    this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n  }\n\n  /** @inheritDoc */\n  public get hasEvents(): boolean {\n    return this._used.hasEvents;\n  }\n\n  /** @inheritDoc */\n  public destroy(): void {\n    this._fallback.destroy();\n    this._compression.destroy();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfully added.\n   */\n  public addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    return this._used.addEvent(event, isCheckout);\n  }\n\n  /** @inheritDoc */\n  public async finish(): Promise<ReplayRecordingData> {\n    // Ensure the worker is loaded, so the sent event is compressed\n    await this.ensureWorkerIsLoaded();\n\n    return this._used.finish();\n  }\n\n  /** Ensure the worker has loaded. */\n  public ensureWorkerIsLoaded(): Promise<void> {\n    return this._ensureWorkerIsLoadedPromise;\n  }\n\n  /** Actually check if the worker has been loaded. */\n  private async _ensureWorkerIsLoaded(): Promise<void> {\n    try {\n      await this._compression.ensureReady();\n    } catch (error) {\n      // If the worker fails to load, we fall back to the simple buffer.\n      // Nothing more to do from our side here\n      __DEBUG_BUILD__ && logger.log('[Replay] Failed to load the compression worker, falling back to simple buffer');\n      return;\n    }\n\n    // Now we need to switch over the array buffer to the compression worker\n    await this._switchToCompressionWorker();\n  }\n\n  /** Switch the used buffer to the compression worker. */\n  private async _switchToCompressionWorker(): Promise<void> {\n    const { events } = this._fallback;\n\n    const addEventPromises: Promise<void>[] = [];\n    for (const event of events) {\n      addEventPromises.push(this._compression.addEvent(event));\n    }\n\n    // We switch over to the new buffer immediately - any further events will be added\n    // after the previously buffered ones\n    this._used = this._compression;\n\n    // Wait for original events to be re-added before resolving\n    try {\n      await Promise.all(addEventPromises);\n    } catch (error) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n    }\n  }\n}\n","import { getWorkerURL } from '@sentry-internal/replay-worker';\nimport { logger } from '@sentry/utils';\n\nimport type { EventBuffer } from '../types';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferProxy } from './EventBufferProxy';\n\ninterface CreateEventBufferParams {\n  useCompression: boolean;\n}\n\n/**\n * Create an event buffer for replays.\n */\nexport function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBuffer {\n  // eslint-disable-next-line no-restricted-globals\n  if (useCompression && window.Worker) {\n    try {\n      const workerUrl = getWorkerURL();\n\n      __DEBUG_BUILD__ && logger.log('[Replay] Using compression worker');\n      const worker = new Worker(workerUrl);\n      return new EventBufferProxy(worker);\n    } catch (error) {\n      __DEBUG_BUILD__ && logger.log('[Replay] Failed to create compression worker');\n      // Fall back to use simple event buffer array\n    }\n  }\n\n  __DEBUG_BUILD__ && logger.log('[Replay] Using simple buffer');\n  return new EventBufferArray();\n}\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n  initialTime: null | number,\n  expiry: undefined | number,\n  targetTime: number = +new Date(),\n): boolean {\n  // Always expired if < 0\n  if (initialTime === null || expiry === undefined || expiry < 0) {\n    return true;\n  }\n\n  // Never expires if == 0\n  if (expiry === 0) {\n    return false;\n  }\n\n  return initialTime + expiry <= targetTime;\n}\n","import type { Session, Timeouts } from '../types';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(session: Session, timeouts: Timeouts, targetTime: number = +new Date()): boolean {\n  return (\n    // First, check that maximum session length has not been exceeded\n    isExpired(session.started, timeouts.maxSessionLife, targetTime) ||\n    // check that the idle timeout has not been exceeded (i.e. user has\n    // performed an action within the last `idleTimeout` ms)\n    isExpired(session.lastActivity, timeouts.sessionIdle, targetTime)\n  );\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\n\n/**\n * Save a session to session storage.\n */\nexport function saveSession(session: Session): void {\n  const hasSessionStorage = 'sessionStorage' in WINDOW;\n  if (!hasSessionStorage) {\n    return;\n  }\n\n  try {\n    WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n  } catch {\n    // Ignore potential SecurityError exceptions\n  }\n}\n","/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\nexport function isSampled(sampleRate?: number): boolean {\n  if (sampleRate === undefined) {\n    return false;\n  }\n\n  // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n  return Math.random() < sampleRate;\n}\n","import { uuid4 } from '@sentry/utils';\n\nimport type { Sampled, Session } from '../types';\nimport { isSampled } from '../util/isSampled';\n\n/**\n * Get a session with defaults & applied sampling.\n */\nexport function makeSession(session: Partial<Session> & { sampled: Sampled }): Session {\n  const now = Date.now();\n  const id = session.id || uuid4();\n  // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n  const started = session.started || now;\n  const lastActivity = session.lastActivity || now;\n  const segmentId = session.segmentId || 0;\n  const sampled = session.sampled;\n\n  return {\n    id,\n    started,\n    lastActivity,\n    segmentId,\n    sampled,\n  };\n}\n\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\nexport function getSessionSampleType(sessionSampleRate: number, errorSampleRate: number): Sampled {\n  return isSampled(sessionSampleRate) ? 'session' : isSampled(errorSampleRate) ? 'error' : false;\n}\n","import { logger } from '@sentry/utils';\n\nimport type { Session, SessionOptions } from '../types';\nimport { saveSession } from './saveSession';\nimport { getSessionSampleType, makeSession } from './Session';\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession({ sessionSampleRate, errorSampleRate, stickySession = false }: SessionOptions): Session {\n  const sampled = getSessionSampleType(sessionSampleRate, errorSampleRate);\n  const session = makeSession({\n    sampled,\n  });\n\n  __DEBUG_BUILD__ && logger.log(`[Replay] Creating new session: ${session.id}`);\n\n  if (stickySession) {\n    saveSession(session);\n  }\n\n  return session;\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { makeSession } from './Session';\n\n/**\n * Fetches a session from storage\n */\nexport function fetchSession(): Session | null {\n  const hasSessionStorage = 'sessionStorage' in WINDOW;\n\n  if (!hasSessionStorage) {\n    return null;\n  }\n\n  try {\n    // This can throw if cookies are disabled\n    const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n    if (!sessionStringFromStorage) {\n      return null;\n    }\n\n    const sessionObj = JSON.parse(sessionStringFromStorage) as Session;\n\n    return makeSession(sessionObj);\n  } catch {\n    return null;\n  }\n}\n","import { logger } from '@sentry/utils';\n\nimport type { Session, SessionOptions, Timeouts } from '../types';\nimport { isSessionExpired } from '../util/isSessionExpired';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { makeSession } from './Session';\n\ninterface GetSessionParams extends SessionOptions {\n  timeouts: Timeouts;\n\n  /**\n   * The current session (e.g. if stickySession is off)\n   */\n  currentSession?: Session;\n}\n\n/**\n * Get or create a session\n */\nexport function getSession({\n  timeouts,\n  currentSession,\n  stickySession,\n  sessionSampleRate,\n  errorSampleRate,\n}: GetSessionParams): { type: 'new' | 'saved'; session: Session } {\n  // If session exists and is passed, use it instead of always hitting session storage\n  const session = currentSession || (stickySession && fetchSession());\n\n  if (session) {\n    // If there is a session, check if it is valid (e.g. \"last activity\" time\n    // should be within the \"session idle time\", and \"session started\" time is\n    // within \"max session time\").\n    const isExpired = isSessionExpired(session, timeouts);\n\n    if (!isExpired) {\n      return { type: 'saved', session };\n    } else if (session.sampled === 'error') {\n      // Error samples should not be re-created when expired, but instead we stop when the replay is done\n      const discardedSession = makeSession({ sampled: false });\n      return { type: 'new', session: discardedSession };\n    } else {\n      __DEBUG_BUILD__ && logger.log('[Replay] Session has expired');\n    }\n    // Otherwise continue to create a new session\n  }\n\n  const newSession = createSession({\n    stickySession,\n    sessionSampleRate,\n    errorSampleRate,\n  });\n\n  return { type: 'new', session: newSession };\n}\n","import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';\n\n/**\n * Add an event to the event buffer.\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport async function addEvent(\n  replay: ReplayContainer,\n  event: RecordingEvent,\n  isCheckout?: boolean,\n): Promise<AddEventResult | null> {\n  if (!replay.eventBuffer) {\n    // This implies that `_isEnabled` is false\n    return null;\n  }\n\n  if (replay.isPaused()) {\n    // Do not add to event buffer when recording is paused\n    return null;\n  }\n\n  // TODO: sadness -- we will want to normalize timestamps to be in ms -\n  // requires coordination with frontend\n  const isMs = event.timestamp > 9999999999;\n  const timestampInMs = isMs ? event.timestamp : event.timestamp * 1000;\n\n  // Throw out events that happen more than 5 minutes ago. This can happen if\n  // page has been left open and idle for a long period of time and user\n  // comes back to trigger a new session. The performance entries rely on\n  // `performance.timeOrigin`, which is when the page first opened.\n  if (timestampInMs + replay.timeouts.sessionIdle < Date.now()) {\n    return null;\n  }\n\n  // Only record earliest event if a new session was created, otherwise it\n  // shouldn't be relevant\n  const earliestEvent = replay.getContext().earliestEvent;\n  if (replay.session && replay.session.segmentId === 0 && (!earliestEvent || timestampInMs < earliestEvent)) {\n    replay.getContext().earliestEvent = timestampInMs;\n  }\n\n  try {\n    return await replay.eventBuffer.addEvent(event, isCheckout);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error(error);\n    replay.stop('addEvent');\n\n    const client = getCurrentHub().getClient();\n\n    if (client) {\n      client.recordDroppedEvent('internal_sdk_error', 'replay');\n    }\n  }\n}\n","import type { ErrorEvent, Event, ReplayEvent, TransactionEvent } from '@sentry/types';\n\n/** If the event is an error event */\nexport function isErrorEvent(event: Event): event is ErrorEvent {\n  return !event.type;\n}\n\n/** If the event is a transaction event */\nexport function isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n\n/** If the event is an replay event */\nexport function isReplayEvent(event: Event): event is ReplayEvent {\n  return event.type === 'replay_event';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { Event, Transport, TransportMakeRequestResponse } from '@sentry/types';\n\nimport { UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isTransactionEvent } from '../util/eventUtils';\n\ntype AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nexport function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback {\n  // Custom transports may still be returning `Promise<void>`, which means we cannot expect the status code to be available there\n  // TODO (v8): remove this check as it will no longer be necessary\n  const enforceStatusCode = isBaseTransportSend();\n\n  return (event: Event, sendResponse: TransportMakeRequestResponse | void) => {\n    if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n      return;\n    }\n\n    const statusCode = sendResponse && sendResponse.statusCode;\n\n    // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n    // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n    // If we do use the base transport, we skip if we encountered an non-OK status code\n    if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n      return;\n    }\n\n    // Collect traceIds in _context regardless of `recordingMode`\n    // In error mode, _context gets cleared on every checkout\n    if (isTransactionEvent(event) && event.contexts && event.contexts.trace && event.contexts.trace.trace_id) {\n      replay.getContext().traceIds.add(event.contexts.trace.trace_id as string);\n      return;\n    }\n\n    // Everything below is just for error events\n    if (!isErrorEvent(event)) {\n      return;\n    }\n\n    // Add error to list of errorIds of replay\n    if (event.event_id) {\n      replay.getContext().errorIds.add(event.event_id);\n    }\n\n    // Trigger error recording\n    // Need to be very careful that this does not cause an infinite loop\n    if (\n      replay.recordingMode === 'error' &&\n      event.exception &&\n      event.message !== UNABLE_TO_SEND_REPLAY // ignore this error because otherwise we could loop indefinitely with trying to capture replay and failing\n    ) {\n      setTimeout(async () => {\n        // Allow flush to complete before resuming as a session recording, otherwise\n        // the checkout from `startRecording` may be included in the payload.\n        // Prefer to keep the error replay as a separate (and smaller) segment\n        // than the session replay.\n        await replay.flushImmediate();\n\n        if (replay.stopRecording()) {\n          // Reset all \"capture on error\" configuration before\n          // starting a new recording\n          replay.recordingMode = 'session';\n          replay.startRecording();\n        }\n      });\n    }\n  };\n}\n\nfunction isBaseTransportSend(): boolean {\n  const client = getCurrentHub().getClient();\n  if (!client) {\n    return false;\n  }\n\n  const transport = client.getTransport();\n  if (!transport) {\n    return false;\n  }\n\n  return (\n    (transport.send as Transport['send'] & { __sentry__baseTransport__?: true }).__sentry__baseTransport__ || false\n  );\n}\n","var NodeType;\n(function (NodeType) {\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\n    return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n    const host = n === null || n === void 0 ? void 0 : n.host;\n    return Boolean(host && host.shadowRoot && host.shadowRoot === n);\n}\nfunction isInputTypeMasked({ maskInputOptions, tagName, type, }) {\n    if (tagName.toLowerCase() === 'option') {\n        tagName = 'select';\n    }\n    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;\n    return (maskInputOptions[tagName.toLowerCase()] ||\n        (actualType && maskInputOptions[actualType]) ||\n        actualType === 'password' ||\n        (tagName === 'input' && !type && maskInputOptions['text']));\n}\nfunction hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {\n    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));\n}\nfunction maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {\n    let text = value || '';\n    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {\n        return text;\n    }\n    if (input.hasAttribute('rr_is_password')) {\n        type = 'password';\n    }\n    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||\n        (maskInputSelector && input.matches(maskInputSelector))) {\n        if (maskInputFn) {\n            text = maskInputFn(text);\n        }\n        else {\n            text = '*'.repeat(text.length);\n        }\n    }\n    return text;\n}\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\nfunction is2DCanvasBlank(canvas) {\n    const ctx = canvas.getContext('2d');\n    if (!ctx)\n        return true;\n    const chunkSize = 50;\n    for (let x = 0; x < canvas.width; x += chunkSize) {\n        for (let y = 0; y < canvas.height; y += chunkSize) {\n            const getImageData = ctx.getImageData;\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\n                : getImageData;\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n            if (pixelBuffer.some((pixel) => pixel !== 0))\n                return false;\n        }\n    }\n    return true;\n}\n\nlet _id = 1;\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\nconst IGNORED_NODE = -2;\nfunction defaultMaskFn(str) {\n    return str ? str.replace(/[\\S]/g, '*') : '';\n}\nfunction genId() {\n    return _id++;\n}\nfunction getValidTagName(element) {\n    if (element instanceof HTMLFormElement) {\n        return 'form';\n    }\n    const processedTagName = element.tagName.toLowerCase().trim();\n    if (tagNameRegex.test(processedTagName)) {\n        return 'div';\n    }\n    return processedTagName;\n}\nfunction getCssRulesString(s) {\n    try {\n        const rules = s.rules || s.cssRules;\n        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;\n    }\n    catch (error) {\n        return null;\n    }\n}\nfunction getCssRuleString(rule) {\n    let cssStringified = rule.cssText;\n    if (isCSSImportRule(rule)) {\n        try {\n            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;\n        }\n        catch (_a) {\n        }\n    }\n    return cssStringified;\n}\nfunction isCSSImportRule(rule) {\n    return 'styleSheet' in rule;\n}\nfunction stringifyStyleSheet(sheet) {\n    return sheet.cssRules\n        ? Array.from(sheet.cssRules)\n            .map((rule) => rule.cssText || '')\n            .join('')\n        : '';\n}\nfunction extractOrigin(url) {\n    let origin = '';\n    if (url.indexOf('//') > -1) {\n        origin = url.split('/').slice(0, 3).join('/');\n    }\n    else {\n        origin = url.split('/')[0];\n    }\n    origin = origin.split('?')[0];\n    return origin;\n}\nlet canvasService;\nlet canvasCtx;\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst RELATIVE_PATH = /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/|#).*/;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absoluteToStylesheet(cssText, href) {\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\n        const filePath = path1 || path2 || path3;\n        const maybeQuote = quote1 || quote2 || '';\n        if (!filePath) {\n            return origin;\n        }\n        if (!RELATIVE_PATH.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (DATA_URI.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (filePath[0] === '/') {\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n        }\n        const stack = href.split('/');\n        const parts = filePath.split('/');\n        stack.pop();\n        for (const part of parts) {\n            if (part === '.') {\n                continue;\n            }\n            else if (part === '..') {\n                stack.pop();\n            }\n            else {\n                stack.push(part);\n            }\n        }\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\n    });\n}\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n    if (attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    let pos = 0;\n    function collectCharacters(regEx) {\n        let chars;\n        let match = regEx.exec(attributeValue.substring(pos));\n        if (match) {\n            chars = match[0];\n            pos += chars.length;\n            return chars;\n        }\n        return '';\n    }\n    let output = [];\n    while (true) {\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\n        if (pos >= attributeValue.length) {\n            break;\n        }\n        let url = collectCharacters(SRCSET_NOT_SPACES);\n        if (url.slice(-1) === ',') {\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n            output.push(url);\n        }\n        else {\n            let descriptorsStr = '';\n            url = absoluteToDoc(doc, url);\n            let inParens = false;\n            while (true) {\n                let c = attributeValue.charAt(pos);\n                if (c === '') {\n                    output.push((url + descriptorsStr).trim());\n                    break;\n                }\n                else if (!inParens) {\n                    if (c === ',') {\n                        pos += 1;\n                        output.push((url + descriptorsStr).trim());\n                        break;\n                    }\n                    else if (c === '(') {\n                        inParens = true;\n                    }\n                }\n                else {\n                    if (c === ')') {\n                        inParens = false;\n                    }\n                }\n                descriptorsStr += c;\n                pos += 1;\n            }\n        }\n    }\n    return output.join(', ');\n}\nfunction absoluteToDoc(doc, attributeValue) {\n    if (!attributeValue || attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    const a = doc.createElement('a');\n    a.href = attributeValue;\n    return a.href;\n}\nfunction isSVGElement(el) {\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\nfunction getHref() {\n    const a = document.createElement('a');\n    a.href = '';\n    return a.href;\n}\nfunction transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {\n    if (!value) {\n        return value;\n    }\n    const name = _name.toLowerCase();\n    const tagName = _tagName.toLowerCase();\n    if (name === 'src' || name === 'href') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'xlink:href' && value[0] !== '#') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'background' &&\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'srcset') {\n        return getAbsoluteSrcsetString(doc, value);\n    }\n    else if (name === 'style') {\n        return absoluteToStylesheet(value, getHref());\n    }\n    else if (tagName === 'object' && name === 'data') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (maskAllText &&\n        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {\n        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);\n    }\n    return value;\n}\nfunction _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {\n    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {\n        return false;\n    }\n    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||\n        (tagName === 'input' &&\n            attribute === 'value' &&\n            element.hasAttribute('type') &&\n            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));\n}\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n    if (unblockSelector && element.matches(unblockSelector)) {\n        return false;\n    }\n    if (typeof blockClass === 'string') {\n        if (element.classList.contains(blockClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {\n            const className = element.classList[eIndex];\n            if (blockClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (blockSelector) {\n        return element.matches(blockSelector);\n    }\n    return false;\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType !== node.ELEMENT_NODE) {\n        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n    }\n    if (unmaskTextSelector) {\n        if (node.matches(unmaskTextSelector) ||\n            node.closest(unmaskTextSelector)) {\n            return false;\n        }\n    }\n    if (maskAllText) {\n        return true;\n    }\n    if (typeof maskTextClass === 'string') {\n        if (node.classList.contains(maskTextClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {\n            const className = node.classList[eIndex];\n            if (maskTextClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (maskTextSelector) {\n        if (node.matches(maskTextSelector)) {\n            return true;\n        }\n    }\n    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n    const win = iframeEl.contentWindow;\n    if (!win) {\n        return;\n    }\n    let fired = false;\n    let readyState;\n    try {\n        readyState = win.document.readyState;\n    }\n    catch (error) {\n        return;\n    }\n    if (readyState !== 'complete') {\n        const timer = setTimeout(() => {\n            if (!fired) {\n                listener();\n                fired = true;\n            }\n        }, iframeLoadTimeout);\n        iframeEl.addEventListener('load', () => {\n            clearTimeout(timer);\n            fired = true;\n            listener();\n        });\n        return;\n    }\n    const blankUrl = 'about:blank';\n    if (win.location.href !== blankUrl ||\n        iframeEl.src === blankUrl ||\n        iframeEl.src === '') {\n        setTimeout(listener, 0);\n        return;\n    }\n    iframeEl.addEventListener('load', listener);\n}\nfunction serializeNode(n, options) {\n    var _a;\n    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;\n    let rootId;\n    if (doc.__sn) {\n        const docId = doc.__sn.id;\n        rootId = docId === 1 ? undefined : docId;\n    }\n    switch (n.nodeType) {\n        case n.DOCUMENT_NODE:\n            if (n.compatMode !== 'CSS1Compat') {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    compatMode: n.compatMode,\n                    rootId,\n                };\n            }\n            else {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    rootId,\n                };\n            }\n        case n.DOCUMENT_TYPE_NODE:\n            return {\n                type: NodeType.DocumentType,\n                name: n.name,\n                publicId: n.publicId,\n                systemId: n.systemId,\n                rootId,\n            };\n        case n.ELEMENT_NODE:\n            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n            const tagName = getValidTagName(n);\n            let attributes = {};\n            for (const { name, value } of Array.from(n.attributes)) {\n                if (!skipAttribute(tagName, name)) {\n                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);\n                }\n            }\n            if (tagName === 'link' && inlineStylesheet) {\n                const stylesheet = Array.from(doc.styleSheets).find((s) => {\n                    return s.href === n.href;\n                });\n                let cssText = null;\n                if (stylesheet) {\n                    cssText = getCssRulesString(stylesheet);\n                }\n                if (cssText) {\n                    delete attributes.rel;\n                    delete attributes.href;\n                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n                }\n            }\n            if (tagName === 'style' &&\n                n.sheet &&\n                !(n.innerText ||\n                    n.textContent ||\n                    '').trim().length) {\n                const cssText = getCssRulesString(n.sheet);\n                if (cssText) {\n                    attributes._cssText = absoluteToStylesheet(cssText, getHref());\n                }\n            }\n            if (tagName === 'input' ||\n                tagName === 'textarea' ||\n                tagName === 'select' ||\n                tagName === 'option') {\n                const el = n;\n                const value = getInputValue(tagName, el, attributes);\n                const checked = n.checked;\n                if (attributes.type !== 'submit' &&\n                    attributes.type !== 'button' &&\n                    value) {\n                    attributes.value = maskInputValue({\n                        input: el,\n                        type: attributes.type,\n                        tagName,\n                        value,\n                        maskInputSelector,\n                        unmaskInputSelector,\n                        maskInputOptions,\n                        maskInputFn,\n                    });\n                }\n                if (checked) {\n                    attributes.checked = checked;\n                }\n            }\n            if (tagName === 'option') {\n                if (n.selected && !maskInputOptions['select']) {\n                    attributes.selected = true;\n                }\n                else {\n                    delete attributes.selected;\n                }\n            }\n            if (tagName === 'canvas' && recordCanvas) {\n                if (n.__context === '2d') {\n                    if (!is2DCanvasBlank(n)) {\n                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                }\n                else if (!('__context' in n)) {\n                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    const blankCanvas = document.createElement('canvas');\n                    blankCanvas.width = n.width;\n                    blankCanvas.height = n.height;\n                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    if (canvasDataURL !== blankCanvasDataURL) {\n                        attributes.rr_dataURL = canvasDataURL;\n                    }\n                }\n            }\n            if (tagName === 'img' && inlineImages) {\n                if (!canvasService) {\n                    canvasService = doc.createElement('canvas');\n                    canvasCtx = canvasService.getContext('2d');\n                }\n                const image = n;\n                const oldValue = image.crossOrigin;\n                image.crossOrigin = 'anonymous';\n                const recordInlineImage = () => {\n                    try {\n                        canvasService.width = image.naturalWidth;\n                        canvasService.height = image.naturalHeight;\n                        canvasCtx.drawImage(image, 0, 0);\n                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                    catch (err) {\n                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\n                    }\n                    oldValue\n                        ? (attributes.crossOrigin = oldValue)\n                        : delete attributes.crossOrigin;\n                };\n                if (image.complete && image.naturalWidth !== 0)\n                    recordInlineImage();\n                else\n                    image.onload = recordInlineImage;\n            }\n            if (tagName === 'audio' || tagName === 'video') {\n                attributes.rr_mediaState = n.paused\n                    ? 'paused'\n                    : 'played';\n                attributes.rr_mediaCurrentTime = n.currentTime;\n            }\n            if (n.scrollLeft) {\n                attributes.rr_scrollLeft = n.scrollLeft;\n            }\n            if (n.scrollTop) {\n                attributes.rr_scrollTop = n.scrollTop;\n            }\n            if (needBlock) {\n                const { width, height } = n.getBoundingClientRect();\n                attributes = {\n                    class: attributes.class,\n                    rr_width: `${width}px`,\n                    rr_height: `${height}px`,\n                };\n            }\n            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n                if (!n.contentDocument) {\n                    attributes.rr_src = attributes.src;\n                }\n                delete attributes.src;\n            }\n            return {\n                type: NodeType.Element,\n                tagName,\n                attributes,\n                childNodes: [],\n                isSVG: isSVGElement(n) || undefined,\n                needBlock,\n                rootId,\n            };\n        case n.TEXT_NODE:\n            const parentTagName = n.parentNode && n.parentNode.tagName;\n            let textContent = n.textContent;\n            const isStyle = parentTagName === 'STYLE' ? true : undefined;\n            const isScript = parentTagName === 'SCRIPT' ? true : undefined;\n            if (isStyle && textContent) {\n                try {\n                    if (n.nextSibling || n.previousSibling) {\n                    }\n                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\n                        textContent = stringifyStyleSheet(n.parentNode.sheet);\n                    }\n                }\n                catch (err) {\n                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\n                }\n                textContent = absoluteToStylesheet(textContent, getHref());\n            }\n            if (isScript) {\n                textContent = 'SCRIPT_PLACEHOLDER';\n            }\n            if (parentTagName === 'TEXTAREA' && textContent) {\n                textContent = '';\n            }\n            else if (parentTagName === 'OPTION' && textContent) {\n                const option = n.parentNode;\n                textContent = maskInputValue({\n                    input: option,\n                    type: null,\n                    tagName: parentTagName,\n                    value: textContent,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskInputOptions,\n                    maskInputFn,\n                });\n            }\n            else if (!isStyle &&\n                !isScript &&\n                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&\n                textContent) {\n                textContent = maskTextFn\n                    ? maskTextFn(textContent)\n                    : defaultMaskFn(textContent);\n            }\n            return {\n                type: NodeType.Text,\n                textContent: textContent || '',\n                isStyle,\n                rootId,\n            };\n        case n.CDATA_SECTION_NODE:\n            return {\n                type: NodeType.CDATA,\n                textContent: '',\n                rootId,\n            };\n        case n.COMMENT_NODE:\n            return {\n                type: NodeType.Comment,\n                textContent: n.textContent || '',\n                rootId,\n            };\n        default:\n            return false;\n    }\n}\nfunction lowerIfExists(maybeAttr) {\n    if (maybeAttr === undefined || maybeAttr === null) {\n        return '';\n    }\n    else {\n        return maybeAttr.toLowerCase();\n    }\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\n        return true;\n    }\n    else if (sn.type === NodeType.Element) {\n        if (slimDOMOptions.script &&\n            (sn.tagName === 'script' ||\n                (sn.tagName === 'link' &&\n                    (sn.attributes.rel === 'preload' ||\n                        sn.attributes.rel === 'modulepreload') &&\n                    sn.attributes.as === 'script') ||\n                (sn.tagName === 'link' &&\n                    sn.attributes.rel === 'prefetch' &&\n                    typeof sn.attributes.href === 'string' &&\n                    sn.attributes.href.endsWith('.js')))) {\n            return true;\n        }\n        else if (slimDOMOptions.headFavicon &&\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\n                (sn.tagName === 'meta' &&\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\n            return true;\n        }\n        else if (sn.tagName === 'meta') {\n            if (slimDOMOptions.headMetaDescKeywords &&\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaSocial &&\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaRobots &&\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaHttpEquiv &&\n                sn.attributes['http-equiv'] !== undefined) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaAuthorship &&\n                (lowerIfExists(sn.attributes.name) === 'author' ||\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaVerification &&\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction serializeNodeWithId(n, options) {\n    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;\n    let { preserveWhiteSpace = true } = options;\n    const _serializedNode = serializeNode(n, {\n        doc,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        maskTextClass,\n        maskTextSelector,\n        unmaskTextSelector,\n        inlineStylesheet,\n        maskInputSelector,\n        unmaskInputSelector,\n        maskAllText,\n        maskInputOptions,\n        maskTextFn,\n        maskInputFn,\n        dataURLOptions,\n        inlineImages,\n        recordCanvas,\n        keepIframeSrcFn,\n    });\n    if (!_serializedNode) {\n        console.warn(n, 'not serialized');\n        return null;\n    }\n    let id;\n    if ('__sn' in n) {\n        id = n.__sn.id;\n    }\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\n        (!preserveWhiteSpace &&\n            _serializedNode.type === NodeType.Text &&\n            !_serializedNode.isStyle &&\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\n        id = IGNORED_NODE;\n    }\n    else {\n        id = genId();\n    }\n    const serializedNode = Object.assign(_serializedNode, { id });\n    n.__sn = serializedNode;\n    if (id === IGNORED_NODE) {\n        return null;\n    }\n    map[id] = n;\n    if (onSerialize) {\n        onSerialize(n);\n    }\n    let recordChild = !skipChild;\n    if (serializedNode.type === NodeType.Element) {\n        recordChild = recordChild && !serializedNode.needBlock;\n        delete serializedNode.needBlock;\n        if (n.shadowRoot)\n            serializedNode.isShadowHost = true;\n    }\n    if ((serializedNode.type === NodeType.Document ||\n        serializedNode.type === NodeType.Element) &&\n        recordChild) {\n        if (slimDOMOptions.headWhitespace &&\n            _serializedNode.type === NodeType.Element &&\n            _serializedNode.tagName === 'head') {\n            preserveWhiteSpace = false;\n        }\n        const bypassOptions = {\n            doc,\n            map,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        };\n        for (const childN of Array.from(n.childNodes)) {\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n            if (serializedChildNode) {\n                serializedNode.childNodes.push(serializedChildNode);\n            }\n        }\n        if (isElement(n) && n.shadowRoot) {\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n                if (serializedChildNode) {\n                    serializedChildNode.isShadow = true;\n                    serializedNode.childNodes.push(serializedChildNode);\n                }\n            }\n        }\n    }\n    if (n.parentNode && isShadowRoot(n.parentNode)) {\n        serializedNode.isShadow = true;\n    }\n    if (serializedNode.type === NodeType.Element &&\n        serializedNode.tagName === 'iframe') {\n        onceIframeLoaded(n, () => {\n            const iframeDoc = n.contentDocument;\n            if (iframeDoc && onIframeLoad) {\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n                    doc: iframeDoc,\n                    map,\n                    blockClass,\n                    blockSelector,\n                    unblockSelector,\n                    maskTextClass,\n                    maskTextSelector,\n                    unmaskTextSelector,\n                    skipChild: false,\n                    inlineStylesheet,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskAllText,\n                    maskInputOptions,\n                    maskTextFn,\n                    maskInputFn,\n                    slimDOMOptions,\n                    dataURLOptions,\n                    inlineImages,\n                    recordCanvas,\n                    preserveWhiteSpace,\n                    onSerialize,\n                    onIframeLoad,\n                    iframeLoadTimeout,\n                    keepIframeSrcFn,\n                });\n                if (serializedIframeNode) {\n                    onIframeLoad(n, serializedIframeNode);\n                }\n            }\n        }, iframeLoadTimeout);\n    }\n    return serializedNode;\n}\nfunction snapshot(n, options) {\n    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\n    const idNodeMap = {};\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n        }\n        : maskAllInputs === false\n            ? {}\n            : maskAllInputs;\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\n        ?\n            {\n                script: true,\n                comment: true,\n                headFavicon: true,\n                headWhitespace: true,\n                headMetaDescKeywords: slimDOM === 'all',\n                headMetaSocial: true,\n                headMetaRobots: true,\n                headMetaHttpEquiv: true,\n                headMetaAuthorship: true,\n                headMetaVerification: true,\n            }\n        : slimDOM === false\n            ? {}\n            : slimDOM;\n    return [\n        serializeNodeWithId(n, {\n            doc: n,\n            map: idNodeMap,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        }),\n        idNodeMap,\n    ];\n}\nfunction visitSnapshot(node, onVisit) {\n    function walk(current) {\n        onVisit(current);\n        if (current.type === NodeType.Document ||\n            current.type === NodeType.Element) {\n            current.childNodes.forEach(walk);\n        }\n    }\n    walk(node);\n}\nfunction cleanupSnapshot() {\n    _id = 1;\n}\nfunction skipAttribute(tagName, attributeName, value) {\n    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');\n}\nfunction getInputValue(tagName, el, attributes) {\n    if (tagName === 'input' &&\n        (attributes.type === 'radio' || attributes.type === 'checkbox')) {\n        return el.getAttribute('value') || '';\n    }\n    return el.value;\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\nfunction parse(css, options = {}) {\n    let lineno = 1;\n    let column = 1;\n    function updatePosition(str) {\n        const lines = str.match(/\\n/g);\n        if (lines) {\n            lineno += lines.length;\n        }\n        let i = str.lastIndexOf('\\n');\n        column = i === -1 ? column + str.length : str.length - i;\n    }\n    function position() {\n        const start = { line: lineno, column };\n        return (node) => {\n            node.position = new Position(start);\n            whitespace();\n            return node;\n        };\n    }\n    class Position {\n        constructor(start) {\n            this.start = start;\n            this.end = { line: lineno, column };\n            this.source = options.source;\n        }\n    }\n    Position.prototype.content = css;\n    const errorsList = [];\n    function error(msg) {\n        const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);\n        err.reason = msg;\n        err.filename = options.source;\n        err.line = lineno;\n        err.column = column;\n        err.source = css;\n        if (options.silent) {\n            errorsList.push(err);\n        }\n        else {\n            throw err;\n        }\n    }\n    function stylesheet() {\n        const rulesList = rules();\n        return {\n            type: 'stylesheet',\n            stylesheet: {\n                source: options.source,\n                rules: rulesList,\n                parsingErrors: errorsList,\n            },\n        };\n    }\n    function open() {\n        return match(/^{\\s*/);\n    }\n    function close() {\n        return match(/^}/);\n    }\n    function rules() {\n        let node;\n        const rules = [];\n        whitespace();\n        comments(rules);\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\n            if (node !== false) {\n                rules.push(node);\n                comments(rules);\n            }\n        }\n        return rules;\n    }\n    function match(re) {\n        const m = re.exec(css);\n        if (!m) {\n            return;\n        }\n        const str = m[0];\n        updatePosition(str);\n        css = css.slice(str.length);\n        return m;\n    }\n    function whitespace() {\n        match(/^\\s*/);\n    }\n    function comments(rules = []) {\n        let c;\n        while ((c = comment())) {\n            if (c !== false) {\n                rules.push(c);\n            }\n            c = comment();\n        }\n        return rules;\n    }\n    function comment() {\n        const pos = position();\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\n            return;\n        }\n        let i = 2;\n        while ('' !== css.charAt(i) &&\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\n            ++i;\n        }\n        i += 2;\n        if ('' === css.charAt(i - 1)) {\n            return error('End of comment missing');\n        }\n        const str = css.slice(2, i - 2);\n        column += 2;\n        updatePosition(str);\n        css = css.slice(i);\n        column += 2;\n        return pos({\n            type: 'comment',\n            comment: str,\n        });\n    }\n    function selector() {\n        const m = match(/^([^{]+)/);\n        if (!m) {\n            return;\n        }\n        return trim(m[0])\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\n            return m.replace(/,/g, '\\u200C');\n        })\n            .split(/\\s*(?![^(]*\\)),\\s*/)\n            .map((s) => {\n            return s.replace(/\\u200C/g, ',');\n        });\n    }\n    function declaration() {\n        const pos = position();\n        let propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\n        if (!propMatch) {\n            return;\n        }\n        const prop = trim(propMatch[0]);\n        if (!match(/^:\\s*/)) {\n            return error(`property missing ':'`);\n        }\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\n        const ret = pos({\n            type: 'declaration',\n            property: prop.replace(commentre, ''),\n            value: val ? trim(val[0]).replace(commentre, '') : '',\n        });\n        match(/^[;\\s]*/);\n        return ret;\n    }\n    function declarations() {\n        const decls = [];\n        if (!open()) {\n            return error(`missing '{'`);\n        }\n        comments(decls);\n        let decl;\n        while ((decl = declaration())) {\n            if (decl !== false) {\n                decls.push(decl);\n                comments(decls);\n            }\n            decl = declaration();\n        }\n        if (!close()) {\n            return error(`missing '}'`);\n        }\n        return decls;\n    }\n    function keyframe() {\n        let m;\n        const vals = [];\n        const pos = position();\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\n            vals.push(m[1]);\n            match(/^,\\s*/);\n        }\n        if (!vals.length) {\n            return;\n        }\n        return pos({\n            type: 'keyframe',\n            values: vals,\n            declarations: declarations(),\n        });\n    }\n    function atkeyframes() {\n        const pos = position();\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\n        if (!m) {\n            return;\n        }\n        const vendor = m[1];\n        m = match(/^([-\\w]+)\\s*/);\n        if (!m) {\n            return error('@keyframes missing name');\n        }\n        const name = m[1];\n        if (!open()) {\n            return error(`@keyframes missing '{'`);\n        }\n        let frame;\n        let frames = comments();\n        while ((frame = keyframe())) {\n            frames.push(frame);\n            frames = frames.concat(comments());\n        }\n        if (!close()) {\n            return error(`@keyframes missing '}'`);\n        }\n        return pos({\n            type: 'keyframes',\n            name,\n            vendor,\n            keyframes: frames,\n        });\n    }\n    function atsupports() {\n        const pos = position();\n        const m = match(/^@supports *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const supports = trim(m[1]);\n        if (!open()) {\n            return error(`@supports missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@supports missing '}'`);\n        }\n        return pos({\n            type: 'supports',\n            supports,\n            rules: style,\n        });\n    }\n    function athost() {\n        const pos = position();\n        const m = match(/^@host\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@host missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@host missing '}'`);\n        }\n        return pos({\n            type: 'host',\n            rules: style,\n        });\n    }\n    function atmedia() {\n        const pos = position();\n        const m = match(/^@media *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const media = trim(m[1]);\n        if (!open()) {\n            return error(`@media missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@media missing '}'`);\n        }\n        return pos({\n            type: 'media',\n            media,\n            rules: style,\n        });\n    }\n    function atcustommedia() {\n        const pos = position();\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\n        if (!m) {\n            return;\n        }\n        return pos({\n            type: 'custom-media',\n            name: trim(m[1]),\n            media: trim(m[2]),\n        });\n    }\n    function atpage() {\n        const pos = position();\n        const m = match(/^@page */);\n        if (!m) {\n            return;\n        }\n        const sel = selector() || [];\n        if (!open()) {\n            return error(`@page missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@page missing '}'`);\n        }\n        return pos({\n            type: 'page',\n            selectors: sel,\n            declarations: decls,\n        });\n    }\n    function atdocument() {\n        const pos = position();\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const vendor = trim(m[1]);\n        const doc = trim(m[2]);\n        if (!open()) {\n            return error(`@document missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@document missing '}'`);\n        }\n        return pos({\n            type: 'document',\n            document: doc,\n            vendor,\n            rules: style,\n        });\n    }\n    function atfontface() {\n        const pos = position();\n        const m = match(/^@font-face\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@font-face missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@font-face missing '}'`);\n        }\n        return pos({\n            type: 'font-face',\n            declarations: decls,\n        });\n    }\n    const atimport = _compileAtrule('import');\n    const atcharset = _compileAtrule('charset');\n    const atnamespace = _compileAtrule('namespace');\n    function _compileAtrule(name) {\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\n        return () => {\n            const pos = position();\n            const m = match(re);\n            if (!m) {\n                return;\n            }\n            const ret = { type: name };\n            ret[name] = m[1].trim();\n            return pos(ret);\n        };\n    }\n    function atrule() {\n        if (css[0] !== '@') {\n            return;\n        }\n        return (atkeyframes() ||\n            atmedia() ||\n            atcustommedia() ||\n            atsupports() ||\n            atimport() ||\n            atcharset() ||\n            atnamespace() ||\n            atdocument() ||\n            atpage() ||\n            athost() ||\n            atfontface());\n    }\n    function rule() {\n        const pos = position();\n        const sel = selector();\n        if (!sel) {\n            return error('selector missing');\n        }\n        comments();\n        return pos({\n            type: 'rule',\n            selectors: sel,\n            declarations: declarations(),\n        });\n    }\n    return addParent(stylesheet());\n}\nfunction trim(str) {\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\n}\nfunction addParent(obj, parent) {\n    const isNode = obj && typeof obj.type === 'string';\n    const childParent = isNode ? obj : parent;\n    for (const k of Object.keys(obj)) {\n        const value = obj[k];\n        if (Array.isArray(value)) {\n            value.forEach((v) => {\n                addParent(v, childParent);\n            });\n        }\n        else if (value && typeof value === 'object') {\n            addParent(value, childParent);\n        }\n    }\n    if (isNode) {\n        Object.defineProperty(obj, 'parent', {\n            configurable: true,\n            writable: true,\n            enumerable: false,\n            value: parent || null,\n        });\n    }\n    return obj;\n}\n\nconst tagMap = {\n    script: 'noscript',\n    altglyph: 'altGlyph',\n    altglyphdef: 'altGlyphDef',\n    altglyphitem: 'altGlyphItem',\n    animatecolor: 'animateColor',\n    animatemotion: 'animateMotion',\n    animatetransform: 'animateTransform',\n    clippath: 'clipPath',\n    feblend: 'feBlend',\n    fecolormatrix: 'feColorMatrix',\n    fecomponenttransfer: 'feComponentTransfer',\n    fecomposite: 'feComposite',\n    feconvolvematrix: 'feConvolveMatrix',\n    fediffuselighting: 'feDiffuseLighting',\n    fedisplacementmap: 'feDisplacementMap',\n    fedistantlight: 'feDistantLight',\n    fedropshadow: 'feDropShadow',\n    feflood: 'feFlood',\n    fefunca: 'feFuncA',\n    fefuncb: 'feFuncB',\n    fefuncg: 'feFuncG',\n    fefuncr: 'feFuncR',\n    fegaussianblur: 'feGaussianBlur',\n    feimage: 'feImage',\n    femerge: 'feMerge',\n    femergenode: 'feMergeNode',\n    femorphology: 'feMorphology',\n    feoffset: 'feOffset',\n    fepointlight: 'fePointLight',\n    fespecularlighting: 'feSpecularLighting',\n    fespotlight: 'feSpotLight',\n    fetile: 'feTile',\n    feturbulence: 'feTurbulence',\n    foreignobject: 'foreignObject',\n    glyphref: 'glyphRef',\n    lineargradient: 'linearGradient',\n    radialgradient: 'radialGradient',\n};\nfunction getTagName(n) {\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\n    if (tagName === 'link' && n.attributes._cssText) {\n        tagName = 'style';\n    }\n    return tagName;\n}\nfunction escapeRegExp(str) {\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\nfunction addHoverClass(cssText, cache) {\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\n    if (cachedStyle)\n        return cachedStyle;\n    const ast = parse(cssText, {\n        silent: true,\n    });\n    if (!ast.stylesheet) {\n        return cssText;\n    }\n    const selectors = [];\n    ast.stylesheet.rules.forEach((rule) => {\n        if ('selectors' in rule) {\n            (rule.selectors || []).forEach((selector) => {\n                if (HOVER_SELECTOR.test(selector)) {\n                    selectors.push(selector);\n                }\n            });\n        }\n    });\n    if (selectors.length === 0) {\n        return cssText;\n    }\n    const selectorMatcher = new RegExp(selectors\n        .filter((selector, index) => selectors.indexOf(selector) === index)\n        .sort((a, b) => b.length - a.length)\n        .map((selector) => {\n        return escapeRegExp(selector);\n    })\n        .join('|'), 'g');\n    const result = cssText.replace(selectorMatcher, (selector) => {\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\n        return `${selector}, ${newSelector}`;\n    });\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\n    return result;\n}\nfunction createCache() {\n    const stylesWithHoverClass = new Map();\n    return {\n        stylesWithHoverClass,\n    };\n}\nfunction buildNode(n, options) {\n    const { doc, hackCss, cache } = options;\n    switch (n.type) {\n        case NodeType.Document:\n            return doc.implementation.createDocument(null, '', null);\n        case NodeType.DocumentType:\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\n        case NodeType.Element:\n            const tagName = getTagName(n);\n            let node;\n            if (n.isSVG) {\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\n            }\n            else {\n                node = doc.createElement(tagName);\n            }\n            for (const name in n.attributes) {\n                if (!n.attributes.hasOwnProperty(name)) {\n                    continue;\n                }\n                let value = n.attributes[name];\n                if (tagName === 'option' && name === 'selected' && value === false) {\n                    continue;\n                }\n                value =\n                    typeof value === 'boolean' || typeof value === 'number' || value === null ? '' : value;\n                if (!name.startsWith('rr_')) {\n                    const isTextarea = tagName === 'textarea' && name === 'value';\n                    const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\n                    if (isRemoteOrDynamicCss && hackCss) {\n                        value = addHoverClass(value, cache);\n                    }\n                    if (isTextarea || isRemoteOrDynamicCss) {\n                        const child = doc.createTextNode(value);\n                        for (const c of Array.from(node.childNodes)) {\n                            if (c.nodeType === node.TEXT_NODE) {\n                                node.removeChild(c);\n                            }\n                        }\n                        node.appendChild(child);\n                        continue;\n                    }\n                    try {\n                        if (n.isSVG && name === 'xlink:href') {\n                            node.setAttributeNS('http://www.w3.org/1999/xlink', name, value);\n                        }\n                        else if (name === 'onload' ||\n                            name === 'onclick' ||\n                            name.substring(0, 7) === 'onmouse') {\n                            node.setAttribute('_' + name, value);\n                        }\n                        else if (tagName === 'meta' &&\n                            n.attributes['http-equiv'] === 'Content-Security-Policy' &&\n                            name === 'content') {\n                            node.setAttribute('csp-content', value);\n                            continue;\n                        }\n                        else if (tagName === 'link' &&\n                            (n.attributes.rel === 'preload' || n.attributes.rel === 'modulepreload') &&\n                            n.attributes.as === 'script') {\n                        }\n                        else if (tagName === 'link' &&\n                            n.attributes.rel === 'prefetch' &&\n                            typeof n.attributes.href === 'string' &&\n                            n.attributes.href.endsWith('.js')) {\n                        }\n                        else if (tagName === 'img' &&\n                            n.attributes.srcset &&\n                            n.attributes.rr_dataURL) {\n                            node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\n                        }\n                        else {\n                            node.setAttribute(name, value);\n                        }\n                    }\n                    catch (error) {\n                    }\n                }\n                else {\n                    if (tagName === 'canvas' && name === 'rr_dataURL') {\n                        const image = document.createElement('img');\n                        image.src = value;\n                        image.onload = () => {\n                            const ctx = node.getContext('2d');\n                            if (ctx) {\n                                ctx.drawImage(image, 0, 0, image.width, image.height);\n                            }\n                        };\n                    }\n                    else if (tagName === 'img' && name === 'rr_dataURL') {\n                        const image = node;\n                        if (!image.currentSrc.startsWith('data:')) {\n                            image.setAttribute('rrweb-original-src', n.attributes.src);\n                            image.src = value;\n                        }\n                    }\n                    if (name === 'rr_width') {\n                        node.style.width = value;\n                    }\n                    else if (name === 'rr_height') {\n                        node.style.height = value;\n                    }\n                    else if (name === 'rr_mediaCurrentTime') {\n                        node.currentTime = n.attributes\n                            .rr_mediaCurrentTime;\n                    }\n                    else if (name === 'rr_mediaState') {\n                        switch (value) {\n                            case 'played':\n                                node\n                                    .play()\n                                    .catch((e) => console.warn('media playback error', e));\n                                break;\n                            case 'paused':\n                                node.pause();\n                                break;\n                        }\n                    }\n                }\n            }\n            if (n.isShadowHost) {\n                if (!node.shadowRoot) {\n                    node.attachShadow({ mode: 'open' });\n                }\n                else {\n                    while (node.shadowRoot.firstChild) {\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\n                    }\n                }\n            }\n            return node;\n        case NodeType.Text:\n            return doc.createTextNode(n.isStyle && hackCss\n                ? addHoverClass(n.textContent, cache)\n                : n.textContent);\n        case NodeType.CDATA:\n            return doc.createCDATASection(n.textContent);\n        case NodeType.Comment:\n            return doc.createComment(n.textContent);\n        default:\n            return null;\n    }\n}\nfunction buildNodeWithSN(n, options) {\n    const { doc, map, skipChild = false, hackCss = true, afterAppend, cache, } = options;\n    let node = buildNode(n, { doc, hackCss, cache });\n    if (!node) {\n        return null;\n    }\n    if (n.rootId) {\n        console.assert(map[n.rootId] === doc, 'Target document should has the same root id.');\n    }\n    if (n.type === NodeType.Document) {\n        doc.close();\n        doc.open();\n        if (n.compatMode === 'BackCompat' &&\n            n.childNodes &&\n            n.childNodes[0].type !== NodeType.DocumentType) {\n            if (n.childNodes[0].type === NodeType.Element &&\n                'xmlns' in n.childNodes[0].attributes &&\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\n            }\n            else {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\n            }\n        }\n        node = doc;\n    }\n    node.__sn = n;\n    map[n.id] = node;\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\n        !skipChild) {\n        for (const childN of n.childNodes) {\n            const childNode = buildNodeWithSN(childN, {\n                doc,\n                map,\n                skipChild: false,\n                hackCss,\n                afterAppend,\n                cache,\n            });\n            if (!childNode) {\n                console.warn('Failed to rebuild', childN);\n                continue;\n            }\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\n                node.shadowRoot.appendChild(childNode);\n            }\n            else {\n                node.appendChild(childNode);\n            }\n            if (afterAppend) {\n                afterAppend(childNode);\n            }\n        }\n    }\n    return node;\n}\nfunction visit(idNodeMap, onVisit) {\n    function walk(node) {\n        onVisit(node);\n    }\n    for (const key in idNodeMap) {\n        if (idNodeMap[key]) {\n            walk(idNodeMap[key]);\n        }\n    }\n}\nfunction handleScroll(node) {\n    const n = node.__sn;\n    if (n.type !== NodeType.Element) {\n        return;\n    }\n    const el = node;\n    for (const name in n.attributes) {\n        if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {\n            continue;\n        }\n        const value = n.attributes[name];\n        if (name === 'rr_scrollLeft') {\n            el.scrollLeft = value;\n        }\n        if (name === 'rr_scrollTop') {\n            el.scrollTop = value;\n        }\n    }\n}\nfunction rebuild(n, options) {\n    const { doc, onVisit, hackCss = true, afterAppend, cache } = options;\n    const idNodeMap = {};\n    const node = buildNodeWithSN(n, {\n        doc,\n        map: idNodeMap,\n        skipChild: false,\n        hackCss,\n        afterAppend,\n        cache,\n    });\n    visit(idNodeMap, (visitedNode) => {\n        if (onVisit) {\n            onVisit(visitedNode);\n        }\n        handleScroll(visitedNode);\n    });\n    return [node, idNodeMap];\n}\n\nexport { IGNORED_NODE, NodeType, addHoverClass, buildNodeWithSN, cleanupSnapshot, createCache, hasInputMaskOptions, is2DCanvasBlank, isElement, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, snapshot, transformAttribute, visitSnapshot };\n","import type { Breadcrumb } from '@sentry/types';\n\ntype RequiredProperties = 'category' | 'message';\n\n/**\n * Create a breadcrumb for a replay.\n */\nexport function createBreadcrumb(\n  breadcrumb: Pick<Breadcrumb, RequiredProperties> & Partial<Omit<Breadcrumb, RequiredProperties>>,\n): Breadcrumb {\n  return {\n    timestamp: Date.now() / 1000,\n    type: 'default',\n    ...breadcrumb,\n  };\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport type { Breadcrumb } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../../types';\nimport { addEvent } from '../../util/addEvent';\n\n/**\n * Add a breadcrumb event to replay.\n */\nexport function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void {\n  if (breadcrumb.category === 'sentry.transaction') {\n    return;\n  }\n\n  if (['ui.click', 'ui.input'].includes(breadcrumb.category as string)) {\n    replay.triggerUserActivity();\n  } else {\n    replay.checkAndHandleExpiredSession();\n  }\n\n  replay.addUpdate(() => {\n    void addEvent(replay, {\n      type: EventType.Custom,\n      // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n      // but maybe we should just keep them as milliseconds\n      timestamp: (breadcrumb.timestamp || 0) * 1000,\n      data: {\n        tag: 'breadcrumb',\n        payload: normalize(breadcrumb),\n      },\n    });\n\n    // Do not flush after console log messages\n    return breadcrumb.category === 'console';\n  });\n}\n","// Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\nconst ATTRIBUTES_TO_RECORD = new Set([\n  'id',\n  'class',\n  'aria-label',\n  'role',\n  'name',\n  'alt',\n  'title',\n  'data-test-id',\n  'data-testid',\n]);\n\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\nexport function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown> {\n  const obj: Record<string, unknown> = {};\n  for (const key in attributes) {\n    if (ATTRIBUTES_TO_RECORD.has(key)) {\n      let normalizedKey = key;\n\n      if (key === 'data-testid' || key === 'data-test-id') {\n        normalizedKey = 'testId';\n      }\n\n      obj[normalizedKey] = attributes[key];\n    }\n  }\n\n  return obj;\n}\n","import type { INode } from '@sentry-internal/rrweb-snapshot';\nimport { NodeType } from '@sentry-internal/rrweb-snapshot';\nimport type { Breadcrumb } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport { getAttributesToRecord } from './util/getAttributesToRecord';\n\ninterface DomHandlerData {\n  name: string;\n  event: Node | { target: Node };\n}\n\nexport const handleDomListener: (replay: ReplayContainer) => (handlerData: DomHandlerData) => void =\n  (replay: ReplayContainer) =>\n  (handlerData: DomHandlerData): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleDom(handlerData);\n\n    if (!result) {\n      return;\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n\n/**\n * An event handler to react to DOM events.\n */\nfunction handleDom(handlerData: DomHandlerData): Breadcrumb | null {\n  let target;\n  let targetNode: Node | INode | undefined;\n\n  // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n  try {\n    targetNode = getTargetNode(handlerData);\n    target = htmlTreeAsString(targetNode);\n  } catch (e) {\n    target = '<unknown>';\n  }\n\n  // `__sn` property is the serialized node created by rrweb\n  const serializedNode =\n    targetNode && '__sn' in targetNode && targetNode.__sn.type === NodeType.Element ? targetNode.__sn : null;\n\n  return createBreadcrumb({\n    category: `ui.${handlerData.name}`,\n    message: target,\n    data: serializedNode\n      ? {\n          nodeId: serializedNode.id,\n          node: {\n            id: serializedNode.id,\n            tagName: serializedNode.tagName,\n            textContent: targetNode\n              ? Array.from(targetNode.childNodes)\n                  .map(\n                    (node: Node | INode) => '__sn' in node && node.__sn.type === NodeType.Text && node.__sn.textContent,\n                  )\n                  .filter(Boolean) // filter out empty values\n                  .map(text => (text as string).trim())\n                  .join('')\n              : '',\n            attributes: getAttributesToRecord(serializedNode.attributes),\n          },\n        }\n      : {},\n  });\n}\n\nfunction getTargetNode(handlerData: DomHandlerData): Node {\n  if (isEventWithTarget(handlerData.event)) {\n    return handlerData.event.target;\n  }\n\n  return handlerData.event;\n}\n\nfunction isEventWithTarget(event: unknown): event is { target: Node } {\n  return !!(event as { target?: Node }).target;\n}\n","import type { Event, EventHint } from '@sentry/types';\n\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\nexport function isRrwebError(event: Event, hint: EventHint): boolean {\n  if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n    return false;\n  }\n\n  // @ts-ignore this may be set by rrweb when it finds errors\n  if (hint.originalException && hint.originalException.__rrweb__) {\n    return true;\n  }\n\n  // Check if any exception originates from rrweb\n  return event.exception.values.some(exception => {\n    if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {\n      return false;\n    }\n\n    return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));\n  });\n}\n","import { addBreadcrumb } from '@sentry/core';\nimport type { Event, EventHint } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isReplayEvent, isTransactionEvent } from '../util/eventUtils';\nimport { isRrwebError } from '../util/isRrwebError';\nimport { handleAfterSendEvent } from './handleAfterSendEvent';\n\n/**\n * Returns a listener to be added to `addGlobalEventProcessor(listener)`.\n */\nexport function handleGlobalEventListener(\n  replay: ReplayContainer,\n  includeAfterSendEventHandling = false,\n): (event: Event, hint: EventHint) => Event | null {\n  const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n\n  return (event: Event, hint: EventHint) => {\n    if (isReplayEvent(event)) {\n      // Replays have separate set of breadcrumbs, do not include breadcrumbs\n      // from core SDK\n      delete event.breadcrumbs;\n      return event;\n    }\n\n    // We only want to handle errors & transactions, nothing else\n    if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n      return event;\n    }\n\n    // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n    // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n    if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n      __DEBUG_BUILD__ && logger.log('[Replay] Ignoring error from rrweb internals', event);\n      return null;\n    }\n\n    // Only tag transactions with replayId if not waiting for an error\n    if (isErrorEvent(event) || (isTransactionEvent(event) && replay.recordingMode === 'session')) {\n      event.tags = { ...event.tags, replayId: replay.getSessionId() };\n    }\n\n    if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals && isErrorEvent(event)) {\n      const exc = getEventExceptionValues(event);\n      addInternalBreadcrumb({\n        message: `Tagging event (${event.event_id}) - ${event.message} - ${exc.type}: ${exc.value}`,\n      });\n    }\n\n    // In cases where a custom client is used that does not support the new hooks (yet),\n    // we manually call this hook method here\n    if (afterSendHandler) {\n      // Pretend the error had a 200 response so we always capture it\n      afterSendHandler(event, { statusCode: 200 });\n    }\n\n    return event;\n  };\n}\n\nfunction addInternalBreadcrumb(arg: Parameters<typeof addBreadcrumb>[0]): void {\n  const { category, level, message, ...rest } = arg;\n\n  addBreadcrumb({\n    category: category || 'console',\n    level: level || 'debug',\n    message: `[debug]: ${message}`,\n    ...rest,\n  });\n}\n\nfunction getEventExceptionValues(event: Event): { type: string; value: string } {\n  return {\n    type: 'Unknown',\n    value: 'n/a',\n    ...(event.exception && event.exception.values && event.exception.values[0]),\n  };\n}\n","import { EventType } from '@sentry-internal/rrweb';\n\nimport type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addEvent } from './addEvent';\n\n/**\n * Create a \"span\" for each performance entry. The parent transaction is `this.replayEvent`.\n */\nexport function createPerformanceSpans(\n  replay: ReplayContainer,\n  entries: ReplayPerformanceEntry<AllEntryData>[],\n): Promise<AddEventResult | null>[] {\n  return entries.map(({ type, start, end, name, data }) =>\n    addEvent(replay, {\n      type: EventType.Custom,\n      timestamp: start,\n      data: {\n        tag: 'performanceSpan',\n        payload: {\n          op: type,\n          description: name,\n          startTimestamp: start,\n          endTimestamp: end,\n          data,\n        },\n      },\n    }),\n  );\n}\n","import type { HistoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from '../util/createPerformanceSpans';\n\ninterface HistoryHandlerData {\n  from: string;\n  to: string;\n}\n\nfunction handleHistory(handlerData: HistoryHandlerData): ReplayPerformanceEntry<HistoryData> {\n  const { from, to } = handlerData;\n\n  const now = Date.now() / 1000;\n\n  return {\n    type: 'navigation.push',\n    start: now,\n    end: now,\n    name: to,\n    data: {\n      previous: from,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.\n */\nexport function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HistoryHandlerData) => void {\n  return (handlerData: HistoryHandlerData) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleHistory(handlerData);\n\n    if (result === null) {\n      return;\n    }\n\n    // Need to collect visited URLs\n    replay.getContext().urls.push(result.name);\n    replay.triggerUserActivity();\n\n    replay.addUpdate(() => {\n      createPerformanceSpans(replay, [result]);\n      // Returning false to flush\n      return false;\n    });\n  };\n}\n","import { getCurrentHub } from '@sentry/core';\n\nimport type { ReplayContainer } from '../types';\n\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\nexport function shouldFilterRequest(replay: ReplayContainer, url: string): boolean {\n  // If we enabled the `traceInternals` experiment, we want to trace everything\n  if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals) {\n    return false;\n  }\n\n  return _isSentryRequest(url);\n}\n\n/**\n * Checks wether a given URL belongs to the configured Sentry DSN.\n */\nfunction _isSentryRequest(url: string): boolean {\n  const client = getCurrentHub().getClient();\n  const dsn = client && client.getDsn();\n  return dsn ? url.includes(dsn.host) : false;\n}\n","import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';\nimport { createPerformanceSpans } from '../../util/createPerformanceSpans';\nimport { shouldFilterRequest } from '../../util/shouldFilterRequest';\n\n/** Add a performance entry breadcrumb */\nexport function addNetworkBreadcrumb(\n  replay: ReplayContainer,\n  result: ReplayPerformanceEntry<NetworkRequestData> | null,\n): void {\n  if (!replay.isEnabled()) {\n    return;\n  }\n\n  if (result === null) {\n    return;\n  }\n\n  if (shouldFilterRequest(replay, result.name)) {\n    return;\n  }\n\n  replay.addUpdate(() => {\n    createPerformanceSpans(replay, [result]);\n    // Returning true will cause `addUpdate` to not flush\n    // We do not want network requests to cause a flush. This will prevent\n    // recurring/polling requests from keeping the replay session alive.\n    return true;\n  });\n}\n","import type { HandlerDataFetch } from '@sentry/types';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry<NetworkRequestData> {\n  const { startTimestamp, endTimestamp, fetchData, response } = handlerData;\n\n  if (!endTimestamp) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url } = fetchData;\n\n  return {\n    type: 'resource.fetch',\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: {\n      method,\n      statusCode: response && (response as Response).status,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.\n */\nexport function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void {\n  return (handlerData: HandlerDataFetch) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleFetch(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { HandlerDataXhr } from '@sentry/types';\nimport { SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry<NetworkRequestData> | null {\n  const { startTimestamp, endTimestamp, xhr } = handlerData;\n\n  const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url, status_code: statusCode } = sentryXhrData;\n\n  if (url === undefined) {\n    return null;\n  }\n\n  return {\n    type: 'resource.xhr',\n    name: url,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    data: {\n      method,\n      statusCode,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.\n */\nexport function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void {\n  return (handlerData: HandlerDataXhr) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleXhr(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { TextEncoderInternal } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { NETWORK_BODY_MAX_SIZE } from '../../constants';\nimport type {\n  NetworkBody,\n  NetworkRequestData,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n  ReplayPerformanceEntry,\n} from '../../types';\n\n/** Get the size of a body. */\nexport function getBodySize(\n  body: RequestInit['body'],\n  textEncoder: TextEncoder | TextEncoderInternal,\n): number | undefined {\n  if (!body) {\n    return undefined;\n  }\n\n  try {\n    if (typeof body === 'string') {\n      return textEncoder.encode(body).length;\n    }\n\n    if (body instanceof URLSearchParams) {\n      return textEncoder.encode(body.toString()).length;\n    }\n\n    if (body instanceof FormData) {\n      const formDataStr = _serializeFormData(body);\n      return textEncoder.encode(formDataStr).length;\n    }\n\n    if (body instanceof Blob) {\n      return body.size;\n    }\n\n    if (body instanceof ArrayBuffer) {\n      return body.byteLength;\n    }\n\n    // Currently unhandled types: ArrayBufferView, ReadableStream\n  } catch {\n    // just return undefined\n  }\n\n  return undefined;\n}\n\n/** Convert a Content-Length header to number/undefined.  */\nexport function parseContentLengthHeader(header: string | null | undefined): number | undefined {\n  if (!header) {\n    return undefined;\n  }\n\n  const size = parseInt(header, 10);\n  return isNaN(size) ? undefined : size;\n}\n\n/** Get the string representation of a body. */\nexport function getBodyString(body: unknown): string | undefined {\n  if (typeof body === 'string') {\n    return body;\n  }\n\n  if (body instanceof URLSearchParams) {\n    return body.toString();\n  }\n\n  if (body instanceof FormData) {\n    return _serializeFormData(body);\n  }\n\n  return undefined;\n}\n\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\nexport function makeNetworkReplayBreadcrumb(\n  type: string,\n  data: ReplayNetworkRequestData | null,\n): ReplayPerformanceEntry<NetworkRequestData> | null {\n  if (!data) {\n    return null;\n  }\n\n  const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;\n\n  const result: ReplayPerformanceEntry<NetworkRequestData> = {\n    type,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: dropUndefinedKeys({\n      method,\n      statusCode,\n      request,\n      response,\n    }),\n  };\n\n  return result;\n}\n\n/** Get either a JSON network body, or a text representation. */\nexport function getNetworkBody(bodyText: string | undefined): NetworkBody | undefined {\n  if (!bodyText) {\n    return;\n  }\n\n  try {\n    return JSON.parse(bodyText);\n  } catch {\n    // return text\n  }\n\n  return bodyText;\n}\n\n/** Build the request or response part of a replay network breadcrumb. */\nexport function buildNetworkRequestOrResponse(\n  headers: Record<string, string>,\n  bodySize: number | undefined,\n  body: NetworkBody | undefined,\n): ReplayNetworkRequestOrResponse | undefined {\n  if (!bodySize && Object.keys(headers).length === 0) {\n    return undefined;\n  }\n\n  if (!bodySize) {\n    return {\n      headers,\n    };\n  }\n\n  if (!body) {\n    return {\n      headers,\n      size: bodySize,\n    };\n  }\n\n  const info: ReplayNetworkRequestOrResponse = {\n    headers,\n    size: bodySize,\n  };\n\n  if (bodySize < NETWORK_BODY_MAX_SIZE) {\n    info.body = body;\n  } else {\n    info._meta = {\n      errors: ['MAX_BODY_SIZE_EXCEEDED'],\n    };\n  }\n\n  return info;\n}\n\n/** Filter a set of headers */\nexport function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string> {\n  return Object.keys(headers).reduce((filteredHeaders: Record<string, string>, key: string) => {\n    const normalizedKey = key.toLowerCase();\n    // Avoid putting empty strings into the headers\n    if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n      filteredHeaders[normalizedKey] = headers[key];\n    }\n    return filteredHeaders;\n  }, {});\n}\n\nfunction _serializeFormData(formData: FormData): string {\n  // This is a bit simplified, but gives us a decent estimate\n  // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n  // @ts-ignore passing FormData to URLSearchParams actually works\n  return new URLSearchParams(formData).toString();\n}\n","import type { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type {\n  FetchHint,\n  NetworkBody,\n  ReplayContainer,\n  ReplayNetworkOptions,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n} from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  getNetworkBody,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n} from './networkUtils';\n\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureFetchBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n    replay: ReplayContainer;\n  },\n): Promise<void> {\n  try {\n    const data = await _prepareFetchData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichFetchBreadcrumb(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { input, response } = hint;\n\n  const body = _getFetchRequestArgBody(input);\n  const reqSize = getBodySize(body, options.textEncoder);\n\n  const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nasync function _prepareFetchData(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n): Promise<ReplayNetworkRequestData> {\n  const { startTimestamp, endTimestamp } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  const request = _getRequestInfo(options, hint.input, requestBodySize);\n  const response = await _getResponseInfo(options, hint.response, responseBodySize);\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode: statusCode || 0,\n    request,\n    response,\n  };\n}\n\nfunction _getRequestInfo(\n  { captureBodies, requestHeaders }: ReplayNetworkOptions,\n  input: FetchHint['input'],\n  requestBodySize?: number,\n): ReplayNetworkRequestOrResponse | undefined {\n  const headers = getRequestHeaders(input, requestHeaders);\n\n  if (!captureBodies) {\n    return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n  }\n\n  // We only want to transmit string or string-like bodies\n  const requestBody = _getFetchRequestArgBody(input);\n  const body = getNetworkBody(getBodyString(requestBody));\n  return buildNetworkRequestOrResponse(headers, requestBodySize, body);\n}\n\nasync function _getResponseInfo(\n  {\n    captureBodies,\n    textEncoder,\n    responseHeaders,\n  }: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n  response: Response,\n  responseBodySize?: number,\n): Promise<ReplayNetworkRequestOrResponse | undefined> {\n  const headers = getAllHeaders(response.headers, responseHeaders);\n\n  if (!captureBodies && responseBodySize !== undefined) {\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n\n  // Only clone the response if we need to\n  try {\n    // We have to clone this, as the body can only be read once\n    const res = response.clone();\n    const { body, bodyText } = await _parseFetchBody(res);\n\n    const size =\n      bodyText && bodyText.length && responseBodySize === undefined\n        ? getBodySize(bodyText, textEncoder)\n        : responseBodySize;\n\n    if (captureBodies) {\n      return buildNetworkRequestOrResponse(headers, size, body);\n    }\n\n    return buildNetworkRequestOrResponse(headers, size, undefined);\n  } catch {\n    // fallback\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n}\n\nasync function _parseFetchBody(\n  response: Response,\n): Promise<{ body?: NetworkBody | undefined; bodyText?: string | undefined }> {\n  let bodyText: string;\n\n  try {\n    bodyText = await response.text();\n  } catch {\n    return {};\n  }\n\n  try {\n    const body = JSON.parse(bodyText);\n    return { body, bodyText };\n  } catch {\n    // just send bodyText\n  }\n\n  return { bodyText, body: bodyText };\n}\n\nfunction _getFetchRequestArgBody(fetchArgs: unknown[] = []): RequestInit['body'] | undefined {\n  // We only support getting the body from the fetch options\n  if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n    return undefined;\n  }\n\n  return (fetchArgs[1] as RequestInit).body;\n}\n\nfunction getAllHeaders(headers: Headers, allowedHeaders: string[]): Record<string, string> {\n  const allHeaders: Record<string, string> = {};\n\n  allowedHeaders.forEach(header => {\n    if (headers.get(header)) {\n      allHeaders[header] = headers.get(header) as string;\n    }\n  });\n\n  return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs: unknown[], allowedHeaders: string[]): Record<string, string> {\n  if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n    return getHeadersFromOptions(fetchArgs[0] as Request | RequestInit, allowedHeaders);\n  }\n\n  if (fetchArgs.length === 2) {\n    return getHeadersFromOptions(fetchArgs[1] as Request | RequestInit, allowedHeaders);\n  }\n\n  return {};\n}\n\nfunction getHeadersFromOptions(\n  input: Request | RequestInit | undefined,\n  allowedHeaders: string[],\n): Record<string, string> {\n  if (!input) {\n    return {};\n  }\n\n  const headers = input.headers;\n\n  if (!headers) {\n    return {};\n  }\n\n  if (headers instanceof Headers) {\n    return getAllHeaders(headers, allowedHeaders);\n  }\n\n  // We do not support this, as it is not really documented (anymore?)\n  if (Array.isArray(headers)) {\n    return {};\n  }\n\n  return getAllowedHeaders(headers, allowedHeaders);\n}\n","import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';\nimport { logger, SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestData, XhrHint } from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  getNetworkBody,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n} from './networkUtils';\n\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureXhrBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions & { replay: ReplayContainer },\n): Promise<void> {\n  try {\n    const data = _prepareXhrData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichXhrBreadcrumb(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { xhr, input } = hint;\n\n  const reqSize = getBodySize(input, options.textEncoder);\n  const resSize = xhr.getResponseHeader('content-length')\n    ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n    : getBodySize(xhr.response, options.textEncoder);\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nfunction _prepareXhrData(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions,\n): ReplayNetworkRequestData | null {\n  const { startTimestamp, endTimestamp, input, xhr } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n  const requestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options.requestHeaders) : {};\n  const responseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.responseHeaders);\n\n  if (!url) {\n    return null;\n  }\n\n  const request = buildNetworkRequestOrResponse(\n    requestHeaders,\n    requestBodySize,\n    options.captureBodies ? getNetworkBody(getBodyString(input)) : undefined,\n  );\n  const response = buildNetworkRequestOrResponse(\n    responseHeaders,\n    responseBodySize,\n    options.captureBodies ? getNetworkBody(hint.xhr.responseText) : undefined,\n  );\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode: statusCode || 0,\n    request,\n    response,\n  };\n}\n\nfunction getResponseHeaders(xhr: XMLHttpRequest): Record<string, string> {\n  const headers = xhr.getAllResponseHeaders();\n\n  if (!headers) {\n    return {};\n  }\n\n  return headers.split('\\r\\n').reduce((acc: Record<string, string>, line: string) => {\n    const [key, value] = line.split(': ');\n    acc[key.toLowerCase()] = value;\n    return acc;\n  }, {});\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  FetchBreadcrumbData,\n  TextEncoderInternal,\n  XhrBreadcrumbData,\n} from '@sentry/types';\nimport { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { FetchHint, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../types';\nimport { handleFetchSpanListener } from './handleFetch';\nimport { handleXhrSpanListener } from './handleXhr';\nimport { captureFetchBreadcrumbToReplay, enrichFetchBreadcrumb } from './util/fetchUtils';\nimport { captureXhrBreadcrumbToReplay, enrichXhrBreadcrumb } from './util/xhrUtils';\n\ninterface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {\n  replay: ReplayContainer;\n  textEncoder: TextEncoderInternal;\n}\n\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n *   (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\nexport function handleNetworkBreadcrumbs(replay: ReplayContainer): void {\n  const client = getCurrentHub().getClient();\n\n  try {\n    const textEncoder = new TextEncoder();\n\n    const options: ExtendedNetworkBreadcrumbsOptions = {\n      replay,\n      textEncoder,\n      ...replay.getExperimentalOptions().network,\n    };\n\n    if (client && client.on) {\n      client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));\n    } else {\n      // Fallback behavior\n      addInstrumentationHandler('fetch', handleFetchSpanListener(replay));\n      addInstrumentationHandler('xhr', handleXhrSpanListener(replay));\n    }\n  } catch {\n    // Do nothing\n  }\n}\n\n/** just exported for tests */\nexport function beforeAddNetworkBreadcrumb(\n  options: ExtendedNetworkBreadcrumbsOptions,\n  breadcrumb: Breadcrumb,\n  hint?: BreadcrumbHint,\n): void {\n  if (!breadcrumb.data) {\n    return;\n  }\n\n  try {\n    if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichXhrBreadcrumb(breadcrumb, hint, options);\n\n      void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n\n    if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichFetchBreadcrumb(breadcrumb, hint, options);\n\n      void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n  } catch (e) {\n    __DEBUG_BUILD__ && logger.warn('Error when enriching network breadcrumb');\n  }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: XhrBreadcrumbData } {\n  return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: FetchBreadcrumbData } {\n  return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint?: BreadcrumbHint): hint is XhrHint {\n  return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint?: BreadcrumbHint): hint is FetchHint {\n  return hint && hint.response;\n}\n","import type { Breadcrumb, Scope } from '@sentry/types';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\nlet _LAST_BREADCRUMB: null | Breadcrumb = null;\n\nexport const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void =\n  (replay: ReplayContainer) =>\n  (scope: Scope): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleScope(scope);\n\n    if (!result) {\n      return;\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n\n/**\n * An event handler to handle scope changes.\n */\nexport function handleScope(scope: Scope): Breadcrumb | null {\n  // TODO (v8): Remove this guard. This was put in place because we introduced\n  // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n  // For now, we'll just return null if the method doesn't exist but we should eventually\n  // get rid of this guard.\n  const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();\n\n  // Listener can be called when breadcrumbs have not changed, so we store the\n  // reference to the last crumb and only return a crumb if it has changed\n  if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n    return null;\n  }\n\n  _LAST_BREADCRUMB = newBreadcrumb;\n\n  if (\n    newBreadcrumb.category &&\n    (['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||\n      newBreadcrumb.category.startsWith('ui.'))\n  ) {\n    return null;\n  }\n\n  return createBreadcrumb(newBreadcrumb);\n}\n","import type { BaseClient } from '@sentry/core';\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Client, DynamicSamplingContext } from '@sentry/types';\nimport { addInstrumentationHandler } from '@sentry/utils';\n\nimport { handleAfterSendEvent } from '../coreHandlers/handleAfterSendEvent';\nimport { handleDomListener } from '../coreHandlers/handleDom';\nimport { handleGlobalEventListener } from '../coreHandlers/handleGlobalEvent';\nimport { handleHistorySpanListener } from '../coreHandlers/handleHistory';\nimport { handleNetworkBreadcrumbs } from '../coreHandlers/handleNetworkBreadcrumbs';\nimport { handleScopeListener } from '../coreHandlers/handleScope';\nimport type { ReplayContainer } from '../types';\n\n/**\n * Add global listeners that cannot be removed.\n */\nexport function addGlobalListeners(replay: ReplayContainer): void {\n  // Listeners from core SDK //\n  const scope = getCurrentHub().getScope();\n  const client = getCurrentHub().getClient();\n\n  if (scope) {\n    scope.addScopeListener(handleScopeListener(replay));\n  }\n  addInstrumentationHandler('dom', handleDomListener(replay));\n  addInstrumentationHandler('history', handleHistorySpanListener(replay));\n  handleNetworkBreadcrumbs(replay);\n\n  // Tag all (non replay) events that get sent to Sentry with the current\n  // replay ID so that we can reference them later in the UI\n  addGlobalEventProcessor(handleGlobalEventListener(replay, !hasHooks(client)));\n\n  // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n  if (hasHooks(client)) {\n    client.on('afterSendEvent', handleAfterSendEvent(replay));\n    client.on('createDsc', (dsc: DynamicSamplingContext) => {\n      const replayId = replay.getSessionId();\n      if (replayId) {\n        dsc.replay_id = replayId;\n      }\n    });\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction hasHooks(client: Client | undefined): client is BaseClient<any> {\n  return !!(client && client.on);\n}\n","import { WINDOW } from '../constants';\nimport type { AddEventResult, MemoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from './createPerformanceSpans';\n\ntype ReplayMemoryEntry = ReplayPerformanceEntry<MemoryData> & { data: { memory: MemoryInfo } };\n\ninterface MemoryInfo {\n  jsHeapSizeLimit: number;\n  totalJSHeapSize: number;\n  usedJSHeapSize: number;\n}\n\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\nexport async function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>> {\n  // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this\n  try {\n    return Promise.all(\n      createPerformanceSpans(replay, [\n        // @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n        createMemoryEntry(WINDOW.performance.memory),\n      ]),\n    );\n  } catch (error) {\n    // Do nothing\n    return [];\n  }\n}\n\nfunction createMemoryEntry(memoryEntry: MemoryInfo): ReplayMemoryEntry {\n  const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n  // we don't want to use `getAbsoluteTime` because it adds the event time to the\n  // time origin, so we get the current timestamp instead\n  const time = Date.now() / 1000;\n  return {\n    type: 'memory',\n    name: 'memory',\n    start: time,\n    end: time,\n    data: {\n      memory: {\n        jsHeapSizeLimit,\n        totalJSHeapSize,\n        usedJSHeapSize,\n      },\n    },\n  };\n}\n","import { record } from '@sentry-internal/rrweb';\nimport { browserPerformanceTimeOrigin } from '@sentry/utils';\n\nimport { WINDOW } from '../constants';\nimport type {\n  AllPerformanceEntry,\n  AllPerformanceEntryData,\n  ExperimentalPerformanceResourceTiming,\n  LargestContentfulPaintData,\n  NavigationData,\n  PaintData,\n  PerformanceNavigationTiming,\n  PerformancePaintTiming,\n  ReplayPerformanceEntry,\n  ResourceData,\n} from '../types';\n\n// Map entryType -> function to normalize data for event\n// @ts-ignore TODO: entry type does not fit the create* functions entry type\nconst ENTRY_TYPES: Record<\n  string,\n  (entry: AllPerformanceEntry) => null | ReplayPerformanceEntry<AllPerformanceEntryData>\n> = {\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  resource: createResourceEntry,\n  paint: createPaintEntry,\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  navigation: createNavigationEntry,\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  ['largest-contentful-paint']: createLargestContentfulPaint,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nexport function createPerformanceEntries(\n  entries: AllPerformanceEntry[],\n): ReplayPerformanceEntry<AllPerformanceEntryData>[] {\n  return entries.map(createPerformanceEntry).filter(Boolean) as ReplayPerformanceEntry<AllPerformanceEntryData>[];\n}\n\nfunction createPerformanceEntry(entry: AllPerformanceEntry): ReplayPerformanceEntry<AllPerformanceEntryData> | null {\n  if (ENTRY_TYPES[entry.entryType] === undefined) {\n    return null;\n  }\n\n  return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number): number {\n  // browserPerformanceTimeOrigin can be undefined if `performance` or\n  // `performance.now` doesn't exist, but this is already checked by this integration\n  return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming): ReplayPerformanceEntry<PaintData> {\n  const { duration, entryType, name, startTime } = entry;\n\n  const start = getAbsoluteTime(startTime);\n  return {\n    type: entryType,\n    name,\n    start,\n    end: start + duration,\n    data: undefined,\n  };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming): ReplayPerformanceEntry<NavigationData> | null {\n  const {\n    entryType,\n    name,\n    decodedBodySize,\n    duration,\n    domComplete,\n    encodedBodySize,\n    domContentLoadedEventStart,\n    domContentLoadedEventEnd,\n    domInteractive,\n    loadEventStart,\n    loadEventEnd,\n    redirectCount,\n    startTime,\n    transferSize,\n    type,\n  } = entry;\n\n  // Ignore entries with no duration, they do not seem to be useful and cause dupes\n  if (duration === 0) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${type}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(domComplete),\n    name,\n    data: {\n      size: transferSize,\n      decodedBodySize,\n      encodedBodySize,\n      duration,\n      domInteractive,\n      domContentLoadedEventStart,\n      domContentLoadedEventEnd,\n      loadEventStart,\n      loadEventEnd,\n      domComplete,\n      redirectCount,\n    },\n  };\n}\n\nfunction createResourceEntry(\n  entry: ExperimentalPerformanceResourceTiming,\n): ReplayPerformanceEntry<ResourceData> | null {\n  const {\n    entryType,\n    initiatorType,\n    name,\n    responseEnd,\n    startTime,\n    decodedBodySize,\n    encodedBodySize,\n    responseStatus,\n    transferSize,\n  } = entry;\n\n  // Core SDK handles these\n  if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${initiatorType}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(responseEnd),\n    name,\n    data: {\n      size: transferSize,\n      statusCode: responseStatus,\n      decodedBodySize,\n      encodedBodySize,\n    },\n  };\n}\n\nfunction createLargestContentfulPaint(\n  entry: PerformanceEntry & { size: number; element: Node },\n): ReplayPerformanceEntry<LargestContentfulPaintData> {\n  const { entryType, startTime, size } = entry;\n\n  let startTimeOrNavigationActivation = 0;\n\n  if (WINDOW.performance) {\n    const navEntry = WINDOW.performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming & {\n      activationStart: number;\n    };\n\n    // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21\n    startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0;\n  }\n\n  // value is in ms\n  const value = Math.max(startTime - startTimeOrNavigationActivation, 0);\n  // LCP doesn't have a \"duration\", it just happens at a single point in time.\n  // But the UI expects both, so use end (in seconds) for both timestamps.\n  const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000;\n\n  return {\n    type: entryType,\n    name: entryType,\n    start: end,\n    end,\n    data: {\n      value, // LCP \"duration\" in ms\n      size,\n      // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      nodeId: record.mirror.getId(entry.element as any),\n    },\n  };\n}\n","type DebouncedCallback = {\n  (): void | unknown;\n  flush: () => void | unknown;\n  cancel: () => void;\n};\ntype CallbackFunction = () => unknown;\ntype DebounceOptions = { maxWait?: number };\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n *          was already invoked in the meantime, return @param func's return value.\n *          The debounced function has two additional properties:\n *          - `flush`: Invokes the debounced function immediately and returns its return value\n *          - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nexport function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback {\n  let callbackReturnValue: unknown;\n\n  let timerId: ReturnType<typeof setTimeout> | undefined;\n  let maxTimerId: ReturnType<typeof setTimeout> | undefined;\n\n  const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n  function invokeFunc(): unknown {\n    cancelTimers();\n    callbackReturnValue = func();\n    return callbackReturnValue;\n  }\n\n  function cancelTimers(): void {\n    timerId !== undefined && clearTimeout(timerId);\n    maxTimerId !== undefined && clearTimeout(maxTimerId);\n    timerId = maxTimerId = undefined;\n  }\n\n  function flush(): unknown {\n    if (timerId !== undefined || maxTimerId !== undefined) {\n      return invokeFunc();\n    }\n    return callbackReturnValue;\n  }\n\n  function debounced(): unknown {\n    if (timerId) {\n      clearTimeout(timerId);\n    }\n    timerId = setTimeout(invokeFunc, wait);\n\n    if (maxWait && maxTimerId === undefined) {\n      maxTimerId = setTimeout(invokeFunc, maxWait);\n    }\n\n    return callbackReturnValue;\n  }\n\n  debounced.cancel = cancelTimers;\n  debounced.flush = flush;\n  return debounced;\n}\n","import { logger } from '@sentry/utils';\n\nimport { saveSession } from '../session/saveSession';\nimport type { RecordingEvent, ReplayContainer } from '../types';\nimport { addEvent } from './addEvent';\n\ntype RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;\n\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\nexport function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback {\n  let hadFirstEvent = false;\n\n  return (event: RecordingEvent, _isCheckout?: boolean) => {\n    // If this is false, it means session is expired, create and a new session and wait for checkout\n    if (!replay.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Received replay event after session expired.');\n\n      return;\n    }\n\n    // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n    // We also want to treat the first event as a checkout, so we handle this specifically here\n    const isCheckout = _isCheckout || !hadFirstEvent;\n    hadFirstEvent = true;\n\n    // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n    replay.addUpdate(() => {\n      // The session is always started immediately on pageload/init, but for\n      // error-only replays, it should reflect the most recent checkout\n      // when an error occurs. Clear any state that happens before this current\n      // checkout. This needs to happen before `addEvent()` which updates state\n      // dependent on this reset.\n      if (replay.recordingMode === 'error' && isCheckout) {\n        replay.setInitialState();\n      }\n\n      // We need to clear existing events on a checkout, otherwise they are\n      // incremental event updates and should be appended\n      void addEvent(replay, event, isCheckout);\n\n      // Different behavior for full snapshots (type=2), ignore other event types\n      // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n      if (!isCheckout) {\n        return false;\n      }\n\n      // If there is a previousSessionId after a full snapshot occurs, then\n      // the replay session was started due to session expiration. The new session\n      // is started before triggering a new checkout and contains the id\n      // of the previous session. Do not immediately flush in this case\n      // to avoid capturing only the checkout and instead the replay will\n      // be captured if they perform any follow-up actions.\n      if (replay.session && replay.session.previousSessionId) {\n        return true;\n      }\n\n      // See note above re: session start needs to reflect the most recent\n      // checkout.\n      if (replay.recordingMode === 'error' && replay.session) {\n        const { earliestEvent } = replay.getContext();\n        if (earliestEvent) {\n          replay.session.started = earliestEvent;\n\n          if (replay.getOptions().stickySession) {\n            saveSession(replay.session);\n          }\n        }\n      }\n\n      // Flush immediately so that we do not miss the first segment, otherwise\n      // it can prevent loading on the UI. This will cause an increase in short\n      // replays (e.g. opening and closing a tab quickly), but these can be\n      // filtered on the UI.\n      if (replay.recordingMode === 'session') {\n        // We want to ensure the worker is ready, as otherwise we'd always send the first event uncompressed\n        void replay.flushImmediate();\n      }\n\n      return true;\n    });\n  };\n}\n","import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';\nimport { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';\n\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\nexport function createReplayEnvelope(\n  replayEvent: ReplayEvent,\n  recordingData: ReplayRecordingData,\n  dsn: DsnComponents,\n  tunnel?: string,\n): ReplayEnvelope {\n  return createEnvelope<ReplayEnvelope>(\n    createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),\n    [\n      [{ type: 'replay_event' }, replayEvent],\n      [\n        {\n          type: 'replay_recording',\n          // If string then we need to encode to UTF8, otherwise will have\n          // wrong size. TextEncoder has similar browser support to\n          // MutationObserver, although it does not accept IE11.\n          length:\n            typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,\n        },\n        recordingData,\n      ],\n    ],\n  );\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\n/**\n * Prepare the recording data ready to be sent.\n */\nexport function prepareRecordingData({\n  recordingData,\n  headers,\n}: {\n  recordingData: ReplayRecordingData;\n  headers: Record<string, unknown>;\n}): ReplayRecordingData {\n  let payloadWithSequence;\n\n  // XXX: newline is needed to separate sequence id from events\n  const replayHeaders = `${JSON.stringify(headers)}\n`;\n\n  if (typeof recordingData === 'string') {\n    payloadWithSequence = `${replayHeaders}${recordingData}`;\n  } else {\n    const enc = new TextEncoder();\n    // XXX: newline is needed to separate sequence id from events\n    const sequence = enc.encode(replayHeaders);\n    // Merge the two Uint8Arrays\n    payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n    payloadWithSequence.set(sequence);\n    payloadWithSequence.set(recordingData, sequence.length);\n  }\n\n  return payloadWithSequence;\n}\n","import type { Scope } from '@sentry/core';\nimport { prepareEvent } from '@sentry/core';\nimport type { IntegrationIndex } from '@sentry/core/build/types/integration';\nimport type { Client, ReplayEvent } from '@sentry/types';\n\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\nexport async function prepareReplayEvent({\n  client,\n  scope,\n  replayId: event_id,\n  event,\n}: {\n  client: Client & { _integrations?: IntegrationIndex };\n  scope: Scope;\n  replayId: string;\n  event: ReplayEvent;\n}): Promise<ReplayEvent | null> {\n  const integrations =\n    typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)\n      ? Object.keys(client._integrations)\n      : undefined;\n  const preparedEvent = (await prepareEvent(\n    client.getOptions(),\n    event,\n    { event_id, integrations },\n    scope,\n  )) as ReplayEvent | null;\n\n  // If e.g. a global event processor returned null\n  if (!preparedEvent) {\n    return null;\n  }\n\n  // This normally happens in browser client \"_prepareEvent\"\n  // but since we do not use this private method from the client, but rather the plain import\n  // we need to do this manually.\n  preparedEvent.platform = preparedEvent.platform || 'javascript';\n\n  // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n  const metadata = client.getSdkMetadata && client.getSdkMetadata();\n  const { name, version } = (metadata && metadata.sdk) || {};\n\n  preparedEvent.sdk = {\n    ...preparedEvent.sdk,\n    name: name || 'sentry.javascript.unknown',\n    version: version || '0.0.0',\n  };\n\n  return preparedEvent;\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { ReplayEvent, TransportMakeRequestResponse } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { createReplayEnvelope } from './createReplayEnvelope';\nimport { prepareRecordingData } from './prepareRecordingData';\nimport { prepareReplayEvent } from './prepareReplayEvent';\n\n/**\n * Send replay attachment using `fetch()`\n */\nexport async function sendReplayRequest({\n  recordingData,\n  replayId,\n  segmentId: segment_id,\n  eventContext,\n  timestamp,\n  session,\n  options,\n}: SendReplayData): Promise<void | TransportMakeRequestResponse> {\n  const preparedRecordingData = prepareRecordingData({\n    recordingData,\n    headers: {\n      segment_id,\n    },\n  });\n\n  const { urls, errorIds, traceIds, initialTimestamp } = eventContext;\n\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const scope = hub.getScope();\n  const transport = client && client.getTransport();\n  const dsn = client && client.getDsn();\n\n  if (!client || !scope || !transport || !dsn || !session.sampled) {\n    return;\n  }\n\n  const baseEvent: ReplayEvent = {\n    type: REPLAY_EVENT_NAME,\n    replay_start_timestamp: initialTimestamp / 1000,\n    timestamp: timestamp / 1000,\n    error_ids: errorIds,\n    trace_ids: traceIds,\n    urls,\n    replay_id: replayId,\n    segment_id,\n    replay_type: session.sampled,\n  };\n\n  const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });\n\n  if (!replayEvent) {\n    // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n    client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n    __DEBUG_BUILD__ && logger.log('An event processor returned `null`, will not send event.');\n    return;\n  }\n\n  replayEvent.contexts = {\n    ...replayEvent.contexts,\n    replay: {\n      ...(replayEvent.contexts && replayEvent.contexts.replay),\n      session_sample_rate: options.sessionSampleRate,\n      error_sample_rate: options.errorSampleRate,\n    },\n  };\n\n  /*\n  For reference, the fully built event looks something like this:\n  {\n      \"type\": \"replay_event\",\n      \"timestamp\": 1670837008.634,\n      \"error_ids\": [\n          \"errorId\"\n      ],\n      \"trace_ids\": [\n          \"traceId\"\n      ],\n      \"urls\": [\n          \"https://example.com\"\n      ],\n      \"replay_id\": \"eventId\",\n      \"segment_id\": 3,\n      \"replay_type\": \"error\",\n      \"platform\": \"javascript\",\n      \"event_id\": \"eventId\",\n      \"environment\": \"production\",\n      \"sdk\": {\n          \"integrations\": [\n              \"BrowserTracing\",\n              \"Replay\"\n          ],\n          \"name\": \"sentry.javascript.browser\",\n          \"version\": \"7.25.0\"\n      },\n      \"sdkProcessingMetadata\": {},\n      \"contexts\": {\n        \"replay\": {\n          \"session_sample_rate\": 1,\n          \"error_sample_rate\": 0,\n        },\n      },\n  }\n  */\n\n  const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n\n  let response: void | TransportMakeRequestResponse;\n\n  try {\n    response = await transport.send(envelope);\n  } catch (err) {\n    const error = new Error(UNABLE_TO_SEND_REPLAY);\n\n    try {\n      // In case browsers don't allow this property to be writable\n      // @ts-ignore This needs lib es2022 and newer\n      error.cause = err;\n    } catch {\n      // nothing to do\n    }\n    throw error;\n  }\n\n  // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore\n  if (!response) {\n    return response;\n  }\n\n  // If the status code is invalid, we want to immediately stop & not retry\n  if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {\n    throw new TransportStatusCodeError(response.statusCode);\n  }\n\n  return response;\n}\n\n/**\n * This error indicates that the transport returned an invalid status code.\n */\nexport class TransportStatusCodeError extends Error {\n  public constructor(statusCode: number) {\n    super(`Transport returned status code ${statusCode}`);\n  }\n}\n","import { captureException, setContext } from '@sentry/core';\n\nimport { RETRY_BASE_INTERVAL, RETRY_MAX_COUNT, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { sendReplayRequest, TransportStatusCodeError } from './sendReplayRequest';\n\n/**\n * Finalize and send the current replay event to Sentry\n */\nexport async function sendReplay(\n  replayData: SendReplayData,\n  retryConfig = {\n    count: 0,\n    interval: RETRY_BASE_INTERVAL,\n  },\n): Promise<unknown> {\n  const { recordingData, options } = replayData;\n\n  // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n  if (!recordingData.length) {\n    return;\n  }\n\n  try {\n    await sendReplayRequest(replayData);\n    return true;\n  } catch (err) {\n    if (err instanceof TransportStatusCodeError) {\n      throw err;\n    }\n\n    // Capture error for every failed replay\n    setContext('Replays', {\n      _retryCount: retryConfig.count,\n    });\n\n    if (__DEBUG_BUILD__ && options._experiments && options._experiments.captureExceptions) {\n      captureException(err);\n    }\n\n    // If an error happened here, it's likely that uploading the attachment\n    // failed, we'll can retry with the same events payload\n    if (retryConfig.count >= RETRY_MAX_COUNT) {\n      const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);\n\n      try {\n        // In case browsers don't allow this property to be writable\n        // @ts-ignore This needs lib es2022 and newer\n        error.cause = err;\n      } catch {\n        // nothing to do\n      }\n\n      throw error;\n    }\n\n    // will retry in intervals of 5, 10, 30\n    retryConfig.interval *= ++retryConfig.count;\n\n    return await new Promise((resolve, reject) => {\n      setTimeout(async () => {\n        try {\n          await sendReplay(replayData, retryConfig);\n          resolve(true);\n        } catch (err) {\n          reject(err);\n        }\n      }, retryConfig.interval);\n    });\n  }\n}\n","/* eslint-disable max-lines */ // TODO: We might want to split this file up\nimport { EventType, record } from '@sentry-internal/rrweb';\nimport { captureException, getCurrentHub } from '@sentry/core';\nimport type { Breadcrumb, ReplayRecordingMode } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { ERROR_CHECKOUT_TIME, MAX_SESSION_LIFE, SESSION_IDLE_DURATION, WINDOW } from './constants';\nimport { setupPerformanceObserver } from './coreHandlers/performanceObserver';\nimport { createEventBuffer } from './eventBuffer';\nimport { getSession } from './session/getSession';\nimport { saveSession } from './session/saveSession';\nimport type {\n  AddEventResult,\n  AddUpdateCallback,\n  AllPerformanceEntry,\n  EventBuffer,\n  InternalEventContext,\n  PopEventContext,\n  RecordingOptions,\n  ReplayContainer as ReplayContainerInterface,\n  ReplayExperimentalPluginOptions,\n  ReplayPluginOptions,\n  Session,\n  Timeouts,\n} from './types';\nimport { addEvent } from './util/addEvent';\nimport { addGlobalListeners } from './util/addGlobalListeners';\nimport { addMemoryEntry } from './util/addMemoryEntry';\nimport { createBreadcrumb } from './util/createBreadcrumb';\nimport { createPerformanceEntries } from './util/createPerformanceEntries';\nimport { createPerformanceSpans } from './util/createPerformanceSpans';\nimport { debounce } from './util/debounce';\nimport { getHandleRecordingEmit } from './util/handleRecordingEmit';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { sendReplay } from './util/sendReplay';\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\nexport class ReplayContainer implements ReplayContainerInterface {\n  public eventBuffer: EventBuffer | null = null;\n\n  /**\n   * List of PerformanceEntry from PerformanceObserver\n   */\n  public performanceEvents: AllPerformanceEntry[] = [];\n\n  public session: Session | undefined;\n\n  /**\n   * Recording can happen in one of two modes:\n   * * session: Record the whole session, sending it continuously\n   * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately\n   */\n  public recordingMode: ReplayRecordingMode = 'session';\n\n  /**\n   * These are here so we can overwrite them in tests etc.\n   * @hidden\n   */\n  public readonly timeouts: Timeouts = {\n    sessionIdle: SESSION_IDLE_DURATION,\n    maxSessionLife: MAX_SESSION_LIFE,\n  } as const;\n\n  private readonly _experimentalOptions: ReplayExperimentalPluginOptions;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  private readonly _options: ReplayPluginOptions;\n\n  private _performanceObserver: PerformanceObserver | null = null;\n\n  private _debouncedFlush: ReturnType<typeof debounce>;\n  private _flushLock: Promise<unknown> | null = null;\n\n  /**\n   * Timestamp of the last user activity. This lives across sessions.\n   */\n  private _lastActivity: number = Date.now();\n\n  /**\n   * Is the integration currently active?\n   */\n  private _isEnabled: boolean = false;\n\n  /**\n   * Paused is a state where:\n   * - DOM Recording is not listening at all\n   * - Nothing will be added to event buffer (e.g. core SDK events)\n   */\n  private _isPaused: boolean = false;\n\n  /**\n   * Have we attached listeners to the core SDK?\n   * Note we have to track this as there is no way to remove instrumentation handlers.\n   */\n  private _hasInitializedCoreListeners: boolean = false;\n\n  /**\n   * Function to stop recording\n   */\n  private _stopRecording: ReturnType<typeof record> | null = null;\n\n  private _context: InternalEventContext = {\n    errorIds: new Set(),\n    traceIds: new Set(),\n    urls: [],\n    earliestEvent: null,\n    initialTimestamp: Date.now(),\n    initialUrl: '',\n  };\n\n  public constructor({\n    options,\n    recordingOptions,\n  }: {\n    options: ReplayPluginOptions;\n    recordingOptions: RecordingOptions;\n  }) {\n    this._recordingOptions = recordingOptions;\n    this._options = options;\n\n    this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {\n      maxWait: this._options.flushMaxDelay,\n    });\n\n    this._experimentalOptions = _getExperimentalOptions(options);\n  }\n\n  /** Get the event context. */\n  public getContext(): InternalEventContext {\n    return this._context;\n  }\n\n  /** If recording is currently enabled. */\n  public isEnabled(): boolean {\n    return this._isEnabled;\n  }\n\n  /** If recording is currently paused. */\n  public isPaused(): boolean {\n    return this._isPaused;\n  }\n\n  /** Get the replay integration options. */\n  public getOptions(): ReplayPluginOptions {\n    return this._options;\n  }\n\n  /**\n   * Get the experimental options.\n   * THIS IS INTERNAL AND SUBJECT TO CHANGE!\n   * @hidden\n   */\n  public getExperimentalOptions(): ReplayExperimentalPluginOptions {\n    return this._experimentalOptions;\n  }\n\n  /**\n   * Initializes the plugin.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * _performanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    this.setInitialState();\n\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    // If there is no session, then something bad has happened - can't continue\n    if (!this.session) {\n      this._handleException(new Error('No session found'));\n      return;\n    }\n\n    if (!this.session.sampled) {\n      // If session was not sampled, then we do not initialize the integration at all.\n      return;\n    }\n\n    // If session is sampled for errors, then we need to set the recordingMode\n    // to 'error', which will configure recording with different options.\n    if (this.session.sampled === 'error') {\n      this.recordingMode = 'error';\n    }\n\n    // setup() is generally called on page load or manually - in both cases we\n    // should treat it as an activity\n    this._updateSessionActivity();\n\n    this.eventBuffer = createEventBuffer({\n      useCompression: this._options.useCompression,\n    });\n\n    this._addListeners();\n\n    // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n    this._isEnabled = true;\n\n    this.startRecording();\n  }\n\n  /**\n   * Start recording.\n   *\n   * Note that this will cause a new DOM checkout\n   */\n  public startRecording(): void {\n    try {\n      this._stopRecording = record({\n        ...this._recordingOptions,\n        // When running in error sampling mode, we need to overwrite `checkoutEveryNms`\n        // Without this, it would record forever, until an error happens, which we don't want\n        // instead, we'll always keep the last 60 seconds of replay before an error happened\n        ...(this.recordingMode === 'error' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),\n        emit: getHandleRecordingEmit(this),\n        onMutation: this._onMutationHandler,\n      });\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Stops the recording, if it was running.\n   * Returns true if it was stopped, else false.\n   */\n  public stopRecording(): boolean {\n    try {\n      if (this._stopRecording) {\n        this._stopRecording();\n        this._stopRecording = undefined;\n        return true;\n      }\n\n      return false;\n    } catch (err) {\n      this._handleException(err);\n      return false;\n    }\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public stop(reason?: string): void {\n    if (!this._isEnabled) {\n      return;\n    }\n\n    try {\n      if (__DEBUG_BUILD__) {\n        const msg = `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`;\n\n        // When `traceInternals` is enabled, we want to log this to the console\n        // Else, use the regular debug output\n        // eslint-disable-next-line\n        const log = this.getOptions()._experiments.traceInternals ? console.warn : logger.log;\n        log(msg);\n      }\n\n      this._isEnabled = false;\n      this._removeListeners();\n      this.stopRecording();\n      this.eventBuffer && this.eventBuffer.destroy();\n      this.eventBuffer = null;\n      this._debouncedFlush.cancel();\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Pause some replay functionality. See comments for `_isPaused`.\n   * This differs from stop as this only stops DOM recording, it is\n   * not as thorough of a shutdown as `stop()`.\n   */\n  public pause(): void {\n    this._isPaused = true;\n    this.stopRecording();\n  }\n\n  /**\n   * Resumes recording, see notes for `pause().\n   *\n   * Note that calling `startRecording()` here will cause a\n   * new DOM checkout.`\n   */\n  public resume(): void {\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    this._isPaused = false;\n    this.startRecording();\n  }\n\n  /**\n   * We want to batch uploads of replay events. Save events only if\n   * `<flushMinDelay>` milliseconds have elapsed since the last event\n   * *OR* if `<flushMaxDelay>` milliseconds have elapsed.\n   *\n   * Accepts a callback to perform side-effects and returns true to stop batch\n   * processing and hand back control to caller.\n   */\n  public addUpdate(cb: AddUpdateCallback): void {\n    // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'error'`)\n    const cbResult = cb();\n\n    // If this option is turned on then we will only want to call `flush`\n    // explicitly\n    if (this.recordingMode === 'error') {\n      return;\n    }\n\n    // If callback is true, we do not want to continue with flushing -- the\n    // caller will need to handle it.\n    if (cbResult === true) {\n      return;\n    }\n\n    // addUpdate is called quite frequently - use _debouncedFlush so that it\n    // respects the flush delays and does not flush immediately\n    this._debouncedFlush();\n  }\n\n  /**\n   * Updates the user activity timestamp and resumes recording. This should be\n   * called in an event handler for a user action that we consider as the user\n   * being \"active\" (e.g. a mouse click).\n   */\n  public triggerUserActivity(): void {\n    this._updateUserActivity();\n\n    // This case means that recording was once stopped due to inactivity.\n    // Ensure that recording is resumed.\n    if (!this._stopRecording) {\n      // Create a new session, otherwise when the user action is flushed, it\n      // will get rejected due to an expired session.\n      if (!this._loadAndCheckSession()) {\n        return;\n      }\n\n      // Note: This will cause a new DOM checkout\n      this.resume();\n      return;\n    }\n\n    // Otherwise... recording was never suspended, continue as normalish\n    this.checkAndHandleExpiredSession();\n\n    this._updateSessionActivity();\n  }\n\n  /**\n   *\n   * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n   * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n   * cases of mulitple flushes happening closely together.\n   */\n  public flushImmediate(): Promise<void> {\n    this._debouncedFlush();\n    // `.flush` is provided by the debounced function, analogously to lodash.debounce\n    return this._debouncedFlush.flush() as Promise<void>;\n  }\n\n  /** Get the current sesion (=replay) ID */\n  public getSessionId(): string | undefined {\n    return this.session && this.session.id;\n  }\n\n  /**\n   * Checks if recording should be stopped due to user inactivity. Otherwise\n   * check if session is expired and create a new session if so. Triggers a new\n   * full snapshot on new session.\n   *\n   * Returns true if session is not expired, false otherwise.\n   * @hidden\n   */\n  public checkAndHandleExpiredSession(): boolean | void {\n    const oldSessionId = this.getSessionId();\n\n    // Prevent starting a new session if the last user activity is older than\n    // SESSION_IDLE_DURATION. Otherwise non-user activity can trigger a new\n    // session+recording. This creates noisy replays that do not have much\n    // content in them.\n    if (\n      this._lastActivity &&\n      isExpired(this._lastActivity, this.timeouts.sessionIdle) &&\n      this.session &&\n      this.session.sampled === 'session'\n    ) {\n      // Pause recording only for session-based replays. Otherwise, resuming\n      // will create a new replay and will conflict with users who only choose\n      // to record error-based replays only. (e.g. the resumed replay will not\n      // contain a reference to an error)\n      this.pause();\n      return;\n    }\n\n    // --- There is recent user activity --- //\n    // This will create a new session if expired, based on expiry length\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    // Session was expired if session ids do not match\n    const expired = oldSessionId !== this.getSessionId();\n\n    if (!expired) {\n      return true;\n    }\n\n    // Session is expired, trigger a full snapshot (which will create a new session)\n    this._triggerFullSnapshot();\n\n    return false;\n  }\n\n  /**\n   * Capture some initial state that can change throughout the lifespan of the\n   * replay. This is required because otherwise they would be captured at the\n   * first flush.\n   */\n  public setInitialState(): void {\n    const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;\n    const url = `${WINDOW.location.origin}${urlPath}`;\n\n    this.performanceEvents = [];\n\n    // Reset _context as well\n    this._clearContext();\n\n    this._context.initialUrl = url;\n    this._context.initialTimestamp = Date.now();\n    this._context.urls.push(url);\n  }\n\n  /** A wrapper to conditionally capture exceptions. */\n  private _handleException(error: unknown): void {\n    __DEBUG_BUILD__ && logger.error('[Replay]', error);\n\n    if (__DEBUG_BUILD__ && this._options._experiments && this._options._experiments.captureExceptions) {\n      captureException(error);\n    }\n  }\n\n  /**\n   * Loads (or refreshes) the current session.\n   * Returns false if session is not recorded.\n   */\n  private _loadAndCheckSession(): boolean {\n    const { type, session } = getSession({\n      timeouts: this.timeouts,\n      stickySession: Boolean(this._options.stickySession),\n      currentSession: this.session,\n      sessionSampleRate: this._options.sessionSampleRate,\n      errorSampleRate: this._options.errorSampleRate,\n    });\n\n    // If session was newly created (i.e. was not loaded from storage), then\n    // enable flag to create the root replay\n    if (type === 'new') {\n      this.setInitialState();\n    }\n\n    const currentSessionId = this.getSessionId();\n    if (session.id !== currentSessionId) {\n      session.previousSessionId = currentSessionId;\n    }\n\n    this.session = session;\n\n    if (!this.session.sampled) {\n      this.stop('session unsampled');\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Adds listeners to record events for the replay\n   */\n  private _addListeners(): void {\n    try {\n      WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n      WINDOW.addEventListener('blur', this._handleWindowBlur);\n      WINDOW.addEventListener('focus', this._handleWindowFocus);\n\n      // There is no way to remove these listeners, so ensure they are only added once\n      if (!this._hasInitializedCoreListeners) {\n        addGlobalListeners(this);\n\n        this._hasInitializedCoreListeners = true;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n\n    // PerformanceObserver //\n    if (!('PerformanceObserver' in WINDOW)) {\n      return;\n    }\n\n    this._performanceObserver = setupPerformanceObserver(this);\n  }\n\n  /**\n   * Cleans up listeners that were created in `_addListeners`\n   */\n  private _removeListeners(): void {\n    try {\n      WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n      WINDOW.removeEventListener('blur', this._handleWindowBlur);\n      WINDOW.removeEventListener('focus', this._handleWindowFocus);\n\n      if (this._performanceObserver) {\n        this._performanceObserver.disconnect();\n        this._performanceObserver = null;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Handle when visibility of the page content changes. Opening a new tab will\n   * cause the state to change to hidden because of content of current page will\n   * be hidden. Likewise, moving a different window to cover the contents of the\n   * page will also trigger a change to a hidden state.\n   */\n  private _handleVisibilityChange: () => void = () => {\n    if (WINDOW.document.visibilityState === 'visible') {\n      this._doChangeToForegroundTasks();\n    } else {\n      this._doChangeToBackgroundTasks();\n    }\n  };\n\n  /**\n   * Handle when page is blurred\n   */\n  private _handleWindowBlur: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.blur',\n    });\n\n    // Do not count blur as a user action -- it's part of the process of them\n    // leaving the page\n    this._doChangeToBackgroundTasks(breadcrumb);\n  };\n\n  /**\n   * Handle when page is focused\n   */\n  private _handleWindowFocus: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.focus',\n    });\n\n    // Do not count focus as a user action -- instead wait until they focus and\n    // interactive with page\n    this._doChangeToForegroundTasks(breadcrumb);\n  };\n\n  /**\n   * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n   */\n  private _doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void {\n    if (!this.session) {\n      return;\n    }\n\n    const expired = isSessionExpired(this.session, this.timeouts);\n\n    if (breadcrumb && !expired) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    // Send replay when the page/tab becomes hidden. There is no reason to send\n    // replay if it becomes visible, since no actions we care about were done\n    // while it was hidden\n    this._conditionalFlush();\n  }\n\n  /**\n   * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n   */\n  private _doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void {\n    if (!this.session) {\n      return;\n    }\n\n    const isSessionActive = this.checkAndHandleExpiredSession();\n\n    if (!isSessionActive) {\n      // If the user has come back to the page within SESSION_IDLE_DURATION\n      // ms, we will re-use the existing session, otherwise create a new\n      // session\n      __DEBUG_BUILD__ && logger.log('[Replay] Document has become active, but session has expired');\n      return;\n    }\n\n    if (breadcrumb) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n  }\n\n  /**\n   * Trigger rrweb to take a full snapshot which will cause this plugin to\n   * create a new Replay event.\n   */\n  private _triggerFullSnapshot(checkout = true): void {\n    try {\n      __DEBUG_BUILD__ && logger.log('[Replay] Taking full rrweb snapshot');\n      record.takeFullSnapshot(checkout);\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Update user activity (across session lifespans)\n   */\n  private _updateUserActivity(_lastActivity: number = Date.now()): void {\n    this._lastActivity = _lastActivity;\n  }\n\n  /**\n   * Updates the session's last activity timestamp\n   */\n  private _updateSessionActivity(_lastActivity: number = Date.now()): void {\n    if (this.session) {\n      this.session.lastActivity = _lastActivity;\n      this._maybeSaveSession();\n    }\n  }\n\n  /**\n   * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n   */\n  private _createCustomBreadcrumb(breadcrumb: Breadcrumb): void {\n    this.addUpdate(() => {\n      void addEvent(this, {\n        type: EventType.Custom,\n        timestamp: breadcrumb.timestamp || 0,\n        data: {\n          tag: 'breadcrumb',\n          payload: breadcrumb,\n        },\n      });\n    });\n  }\n\n  /**\n   * Observed performance events are added to `this.performanceEvents`. These\n   * are included in the replay event before it is finished and sent to Sentry.\n   */\n  private _addPerformanceEntries(): Promise<Array<AddEventResult | null>> {\n    // Copy and reset entries before processing\n    const entries = [...this.performanceEvents];\n    this.performanceEvents = [];\n\n    return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));\n  }\n\n  /**\n   * Only flush if `this.recordingMode === 'session'`\n   */\n  private _conditionalFlush(): void {\n    if (this.recordingMode === 'error') {\n      return;\n    }\n\n    void this.flushImmediate();\n  }\n\n  /**\n   * Clear _context\n   */\n  private _clearContext(): void {\n    // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n    this._context.errorIds.clear();\n    this._context.traceIds.clear();\n    this._context.urls = [];\n    this._context.earliestEvent = null;\n  }\n\n  /**\n   * Return and clear _context\n   */\n  private _popEventContext(): PopEventContext {\n    if (this._context.earliestEvent && this._context.earliestEvent < this._context.initialTimestamp) {\n      this._context.initialTimestamp = this._context.earliestEvent;\n    }\n\n    const _context = {\n      initialTimestamp: this._context.initialTimestamp,\n      initialUrl: this._context.initialUrl,\n      errorIds: Array.from(this._context.errorIds).filter(Boolean),\n      traceIds: Array.from(this._context.traceIds).filter(Boolean),\n      urls: this._context.urls,\n    };\n\n    this._clearContext();\n\n    return _context;\n  }\n\n  /**\n   * Flushes replay event buffer to Sentry.\n   *\n   * Performance events are only added right before flushing - this is\n   * due to the buffered performance observer events.\n   *\n   * Should never be called directly, only by `flush`\n   */\n  private async _runFlush(): Promise<void> {\n    if (!this.session || !this.eventBuffer) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session or eventBuffer found to flush.');\n      return;\n    }\n\n    await this._addPerformanceEntries();\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer || !this.eventBuffer.hasEvents) {\n      return;\n    }\n\n    // Only attach memory event if eventBuffer is not empty\n    await addMemoryEntry(this);\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer) {\n      return;\n    }\n\n    try {\n      // Note this empties the event buffer regardless of outcome of sending replay\n      const recordingData = await this.eventBuffer.finish();\n\n      // NOTE: Copy values from instance members, as it's possible they could\n      // change before the flush finishes.\n      const replayId = this.session.id;\n      const eventContext = this._popEventContext();\n      // Always increment segmentId regardless of outcome of sending replay\n      const segmentId = this.session.segmentId++;\n      this._maybeSaveSession();\n\n      await sendReplay({\n        replayId,\n        recordingData,\n        segmentId,\n        eventContext,\n        session: this.session,\n        options: this.getOptions(),\n        timestamp: Date.now(),\n      });\n    } catch (err) {\n      this._handleException(err);\n\n      // This means we retried 3 times and all of them failed,\n      // or we ran into a problem we don't want to retry, like rate limiting.\n      // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n      this.stop('sendReplay');\n\n      const client = getCurrentHub().getClient();\n\n      if (client) {\n        client.recordDroppedEvent('send_error', 'replay');\n      }\n    }\n  }\n\n  /**\n   * Flush recording data to Sentry. Creates a lock so that only a single flush\n   * can be active at a time. Do not call this directly.\n   */\n  private _flush: () => Promise<void> = async () => {\n    if (!this._isEnabled) {\n      // This can happen if e.g. the replay was stopped because of exceeding the retry limit\n      return;\n    }\n\n    if (!this.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.error('[Replay] Attempting to finish replay event after session expired.');\n      return;\n    }\n\n    if (!this.session) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session found to flush.');\n      return;\n    }\n\n    // A flush is about to happen, cancel any queued flushes\n    this._debouncedFlush.cancel();\n\n    // this._flushLock acts as a lock so that future calls to `_flush()`\n    // will be blocked until this promise resolves\n    if (!this._flushLock) {\n      this._flushLock = this._runFlush();\n      await this._flushLock;\n      this._flushLock = null;\n      return;\n    }\n\n    // Wait for previous flush to finish, then call the debounced `_flush()`.\n    // It's possible there are other flush requests queued and waiting for it\n    // to resolve. We want to reduce all outstanding requests (as well as any\n    // new flush requests that occur within a second of the locked flush\n    // completing) into a single flush.\n\n    try {\n      await this._flushLock;\n    } catch (err) {\n      __DEBUG_BUILD__ && logger.error(err);\n    } finally {\n      this._debouncedFlush();\n    }\n  };\n\n  /** Save the session, if it is sticky */\n  private _maybeSaveSession(): void {\n    if (this.session && this._options.stickySession) {\n      saveSession(this.session);\n    }\n  }\n\n  /** Handler for rrweb.record.onMutation */\n  private _onMutationHandler = (mutations: unknown[]): boolean => {\n    const count = mutations.length;\n\n    const mutationLimit = this._options._experiments.mutationLimit || 0;\n    const mutationBreadcrumbLimit = this._options._experiments.mutationBreadcrumbLimit || 1000;\n    const overMutationLimit = mutationLimit && count > mutationLimit;\n\n    // Create a breadcrumb if a lot of mutations happen at the same time\n    // We can show this in the UI as an information with potential performance improvements\n    if (count > mutationBreadcrumbLimit || overMutationLimit) {\n      const breadcrumb = createBreadcrumb({\n        category: 'replay.mutations',\n        data: {\n          count,\n        },\n      });\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    if (overMutationLimit) {\n      // We want to skip doing an incremental snapshot if there are too many mutations\n      // Instead, we do a full snapshot\n      this._triggerFullSnapshot(false);\n      return false;\n    }\n\n    // `true` means we use the regular mutation handling by rrweb\n    return true;\n  };\n}\n\nfunction _getExperimentalOptions(options: ReplayPluginOptions): ReplayExperimentalPluginOptions {\n  const requestHeaders = options._experiments.captureRequestHeaders || [];\n  const responseHeaders = options._experiments.captureResponseHeaders || [];\n  const captureBodies = options._experiments.captureNetworkBodies || false;\n\n  // Add defaults\n  const defaultHeaders = ['content-length', 'content-type', 'accept'];\n\n  return {\n    network: {\n      captureBodies,\n      requestHeaders: [...defaultHeaders, ...requestHeaders.map(header => header.toLowerCase())],\n      responseHeaders: [...defaultHeaders, ...responseHeaders.map(header => header.toLowerCase())],\n    },\n  };\n}\n","import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';\n\ntype GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> &\n  Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;\ninterface GetPrivacyReturn {\n  maskTextSelector: string;\n  unmaskTextSelector: string;\n  maskInputSelector: string;\n  unmaskInputSelector: string;\n  blockSelector: string;\n  unblockSelector: string;\n  ignoreSelector: string;\n\n  blockClass?: RegExp;\n  maskTextClass?: RegExp;\n}\n\nfunction getOption(\n  selectors: string[],\n  defaultSelectors: string[],\n  deprecatedClassOption?: string | RegExp,\n  deprecatedSelectorOption?: string,\n): string {\n  const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n\n  const allSelectors = [\n    ...selectors,\n    // @deprecated\n    ...deprecatedSelectors,\n\n    // sentry defaults\n    ...defaultSelectors,\n  ];\n\n  // @deprecated\n  if (typeof deprecatedClassOption !== 'undefined') {\n    // NOTE: No support for RegExp\n    if (typeof deprecatedClassOption === 'string') {\n      allSelectors.push(`.${deprecatedClassOption}`);\n    }\n\n    // eslint-disable-next-line no-console\n    console.warn(\n      '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',\n    );\n  }\n\n  return allSelectors.join(',');\n}\n\n/**\n * Returns privacy related configuration for use in rrweb\n */\nexport function getPrivacyOptions({\n  mask,\n  unmask,\n  block,\n  unblock,\n  ignore,\n\n  // eslint-disable-next-line deprecation/deprecation\n  blockClass,\n  // eslint-disable-next-line deprecation/deprecation\n  blockSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextClass,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  ignoreClass,\n}: GetPrivacyOptions): GetPrivacyReturn {\n  const defaultBlockedElements = ['base[href=\"/\"]'];\n\n  const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n  const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n\n  const options: GetPrivacyReturn = {\n    // We are making the decision to make text and input selectors the same\n    maskTextSelector: maskSelector,\n    unmaskTextSelector: unmaskSelector,\n    maskInputSelector: maskSelector,\n    unmaskInputSelector: unmaskSelector,\n\n    blockSelector: getOption(\n      block,\n      ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],\n      blockClass,\n      blockSelector,\n    ),\n    unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n    ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass),\n  };\n\n  if (blockClass instanceof RegExp) {\n    options.blockClass = blockClass;\n  }\n\n  if (maskTextClass instanceof RegExp) {\n    options.maskTextClass = maskTextClass;\n  }\n\n  return options;\n}\n","import { isNodeEnv } from '@sentry/utils';\n\n/**\n * Returns true if we are in the browser.\n */\nexport function isBrowser(): boolean {\n  // eslint-disable-next-line no-restricted-globals\n  return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\ntype ElectronProcess = { type?: string };\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer(): boolean {\n  return typeof process !== 'undefined' && (process as ElectronProcess).type === 'renderer';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { BrowserClientReplayOptions, Integration } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_FLUSH_MAX_DELAY, DEFAULT_FLUSH_MIN_DELAY } from './constants';\nimport { ReplayContainer } from './replay';\nimport type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';\nimport { getPrivacyOptions } from './util/getPrivacyOptions';\nimport { isBrowser } from './util/isBrowser';\n\nconst MEDIA_SELECTORS =\n  'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\n\nlet _initialized = false;\n\ntype InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'> &\n  Partial<Pick<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;\n\n/**\n * The main replay integration class, to be passed to `init({  integrations: [] })`.\n */\nexport class Replay implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Replay';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Replay.id;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  /**\n   * Initial options passed to the replay integration, merged with default values.\n   * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n   * can only be finally set when setupOnce() is called.\n   *\n   * @private\n   */\n  private readonly _initialOptions: InitialReplayPluginOptions;\n\n  private _replay?: ReplayContainer;\n\n  public constructor({\n    flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,\n    flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,\n    stickySession = true,\n    useCompression = true,\n    _experiments = {},\n    sessionSampleRate,\n    errorSampleRate,\n    maskAllText = true,\n    maskAllInputs = true,\n    blockAllMedia = true,\n\n    mask = [],\n    unmask = [],\n    block = [],\n    unblock = [],\n    ignore = [],\n    maskFn,\n\n    // eslint-disable-next-line deprecation/deprecation\n    blockClass,\n    // eslint-disable-next-line deprecation/deprecation\n    blockSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    maskInputOptions,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextClass,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    ignoreClass,\n  }: ReplayConfiguration = {}) {\n    this._recordingOptions = {\n      maskAllInputs,\n      maskAllText,\n      maskInputOptions: { ...(maskInputOptions || {}), password: true },\n      maskTextFn: maskFn,\n      maskInputFn: maskFn,\n\n      ...getPrivacyOptions({\n        mask,\n        unmask,\n        block,\n        unblock,\n        ignore,\n        blockClass,\n        blockSelector,\n        maskTextClass,\n        maskTextSelector,\n        ignoreClass,\n      }),\n\n      // Our defaults\n      slimDOMOptions: 'all',\n      inlineStylesheet: true,\n      // Disable inline images as it will increase segment/replay size\n      inlineImages: false,\n      // collect fonts, but be aware that `sentry.io` needs to be an allowed\n      // origin for playback\n      collectFonts: true,\n    };\n\n    this._initialOptions = {\n      flushMinDelay,\n      flushMaxDelay,\n      stickySession,\n      sessionSampleRate,\n      errorSampleRate,\n      useCompression,\n      blockAllMedia,\n      _experiments,\n    };\n\n    if (typeof sessionSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`sessionSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysSessionSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,\n      );\n\n      this._initialOptions.sessionSampleRate = sessionSampleRate;\n    }\n\n    if (typeof errorSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`errorSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysOnErrorSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,\n      );\n\n      this._initialOptions.errorSampleRate = errorSampleRate;\n    }\n\n    if (this._initialOptions.blockAllMedia) {\n      // `blockAllMedia` is a more user friendly option to configure blocking\n      // embedded media elements\n      this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector\n        ? MEDIA_SELECTORS\n        : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;\n    }\n\n    if (this._isInitialized && isBrowser()) {\n      throw new Error('Multiple Sentry Session Replay instances are not supported');\n    }\n\n    this._isInitialized = true;\n  }\n\n  /** If replay has already been initialized */\n  protected get _isInitialized(): boolean {\n    return _initialized;\n  }\n\n  /** Update _isInitialized */\n  protected set _isInitialized(value: boolean) {\n    _initialized = value;\n  }\n\n  /**\n   * We previously used to create a transaction in `setupOnce` and it would\n   * potentially create a transaction before some native SDK integrations have run\n   * and applied their own global event processor. An example is:\n   * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n   *\n   * So we call `replay.setup` in next event loop as a workaround to wait for other\n   * global event processors to finish. This is no longer needed, but keeping it\n   * here to avoid any future issues.\n   */\n  public setupOnce(): void {\n    if (!isBrowser()) {\n      return;\n    }\n\n    this._setup();\n\n    // XXX: See method comments above\n    setTimeout(() => this.start());\n  }\n\n  /**\n   * Initializes the plugin.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * PerformanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.start();\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public stop(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.stop();\n  }\n\n  /**\n   * Immediately send all pending events.\n   */\n  public flush(): Promise<void> | void {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return;\n    }\n\n    return this._replay.flushImmediate();\n  }\n\n  /**\n   * Get the current session ID.\n   */\n  public getReplayId(): string | undefined {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return;\n    }\n\n    return this._replay.getSessionId();\n  }\n\n  /** Setup the integration. */\n  private _setup(): void {\n    // Client is not available in constructor, so we need to wait until setupOnce\n    const finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n\n    this._replay = new ReplayContainer({\n      options: finalOptions,\n      recordingOptions: this._recordingOptions,\n    });\n  }\n}\n\n/** Parse Replay-related options from SDK options */\nfunction loadReplayOptionsFromClient(initialOptions: InitialReplayPluginOptions): ReplayPluginOptions {\n  const client = getCurrentHub().getClient();\n  const opt = client && (client.getOptions() as BrowserClientReplayOptions);\n\n  const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };\n\n  if (!opt) {\n    // eslint-disable-next-line no-console\n    console.warn('SDK client is not available.');\n    return finalOptions;\n  }\n\n  if (\n    initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n    initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n    opt.replaysSessionSampleRate == null &&\n    opt.replaysOnErrorSampleRate == null\n  ) {\n    // eslint-disable-next-line no-console\n    console.warn(\n      'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',\n    );\n  }\n\n  if (typeof opt.replaysSessionSampleRate === 'number') {\n    finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n  }\n\n  if (typeof opt.replaysOnErrorSampleRate === 'number') {\n    finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n  }\n\n  return finalOptions;\n}\n"],"names":["GLOBAL_OBJ","NodeType","logger","getWorkerURL","uuid4","getCurrentHub","normalize","htmlTreeAsString","addBreadcrumb","SENTRY_XHR_DATA_KEY","dropUndefinedKeys","addInstrumentationHandler","addGlobalEventProcessor","browserPerformanceTimeOrigin","createEnvelope","createEventEnvelopeHeaders","getSdkMetadataForEnvelopeHeader","prepareEvent","setContext","captureException","isNodeEnv"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA,MAAA,MAAA,GAAAA,gBAAA,EAAA;AACA;AACA,MAAA,kBAAA,GAAA,qBAAA,CAAA;AACA,MAAA,iBAAA,GAAA,cAAA,CAAA;AAEA,MAAA,qBAAA,GAAA,uBAAA,CAAA;AACA;AACA;AACA,MAAA,qBAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,OAAA,CAAA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,KAAA,CAAA;AACA;AACA,MAAA,mBAAA,GAAA,IAAA,CAAA;AACA,MAAA,eAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA,MAAA,qBAAA,GAAA,MAAA;;AChCA,IAAAC,UAAA,CAAA;AACA,CAAA,UAAA,QAAA,EAAA;AACA,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KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,OAAA,GAAA,CAAA,wBAAA,KAAA,QAAA,EAAA;AACA,IAAA,YAAA,CAAA,iBAAA,GAAA,GAAA,CAAA,wBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,OAAA,GAAA,CAAA,wBAAA,KAAA,QAAA,EAAA;AACA,IAAA,YAAA,CAAA,eAAA,GAAA,GAAA,CAAA,wBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,YAAA,CAAA;AACA;;;;"}import { getCurrentHub, addBreadcrumb, addGlobalEventProcessor, prepareEvent, setContext, captureException } from '@sentry/core';
import { GLOBAL_OBJ, logger, uuid4, normalize, htmlTreeAsString, SENTRY_XHR_DATA_KEY, dropUndefinedKeys, addInstrumentationHandler, browserPerformanceTimeOrigin, createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader, isNodeEnv } from '@sentry/utils';

// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`
// prevents the browser package from being bundled in the CDN bundle, and avoids a
// circular dependency between the browser and replay packages should `@sentry/browser` import
// from `@sentry/replay` in the future
const WINDOW = GLOBAL_OBJ ;

const REPLAY_SESSION_KEY = 'sentryReplaySession';
const REPLAY_EVENT_NAME = 'replay_event';
const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';

// The idle limit for a session
const SESSION_IDLE_DURATION = 300000; // 5 minutes in ms

// The maximum length of a session
const MAX_SESSION_LIFE = 3600000; // 60 minutes

/** Default flush delays */
const DEFAULT_FLUSH_MIN_DELAY = 5000;
// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it
// was the same as `wait`
const DEFAULT_FLUSH_MAX_DELAY = 5500;

/* How long to wait for error checkouts */
const ERROR_CHECKOUT_TIME = 60000;

const RETRY_BASE_INTERVAL = 5000;
const RETRY_MAX_COUNT = 3;

/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be dropped. */
const NETWORK_BODY_MAX_SIZE = 300000;

var NodeType$1;
(function (NodeType) {
    NodeType[NodeType["Document"] = 0] = "Document";
    NodeType[NodeType["DocumentType"] = 1] = "DocumentType";
    NodeType[NodeType["Element"] = 2] = "Element";
    NodeType[NodeType["Text"] = 3] = "Text";
    NodeType[NodeType["CDATA"] = 4] = "CDATA";
    NodeType[NodeType["Comment"] = 5] = "Comment";
})(NodeType$1 || (NodeType$1 = {}));

function isElement(n) {
    return n.nodeType === n.ELEMENT_NODE;
}
function isShadowRoot(n) {
    const host = n === null || n === void 0 ? void 0 : n.host;
    return Boolean(host && host.shadowRoot && host.shadowRoot === n);
}
function isInputTypeMasked({ maskInputOptions, tagName, type, }) {
    if (tagName.toLowerCase() === 'option') {
        tagName = 'select';
    }
    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;
    return (maskInputOptions[tagName.toLowerCase()] ||
        (actualType && maskInputOptions[actualType]) ||
        actualType === 'password' ||
        (tagName === 'input' && !type && maskInputOptions['text']));
}
function hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {
    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));
}
function maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {
    let text = value || '';
    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {
        return text;
    }
    if (input.hasAttribute('rr_is_password')) {
        type = 'password';
    }
    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||
        (maskInputSelector && input.matches(maskInputSelector))) {
        if (maskInputFn) {
            text = maskInputFn(text);
        }
        else {
            text = '*'.repeat(text.length);
        }
    }
    return text;
}
const ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';
function is2DCanvasBlank(canvas) {
    const ctx = canvas.getContext('2d');
    if (!ctx)
        return true;
    const chunkSize = 50;
    for (let x = 0; x < canvas.width; x += chunkSize) {
        for (let y = 0; y < canvas.height; y += chunkSize) {
            const getImageData = ctx.getImageData;
            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData
                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]
                : getImageData;
            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);
            if (pixelBuffer.some((pixel) => pixel !== 0))
                return false;
        }
    }
    return true;
}

let _id = 1;
const tagNameRegex = new RegExp('[^a-z0-9-_:]');
const IGNORED_NODE = -2;
function defaultMaskFn(str) {
    return str ? str.replace(/[\S]/g, '*') : '';
}
function genId() {
    return _id++;
}
function getValidTagName(element) {
    if (element instanceof HTMLFormElement) {
        return 'form';
    }
    const processedTagName = element.tagName.toLowerCase().trim();
    if (tagNameRegex.test(processedTagName)) {
        return 'div';
    }
    return processedTagName;
}
function getCssRulesString(s) {
    try {
        const rules = s.rules || s.cssRules;
        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;
    }
    catch (error) {
        return null;
    }
}
function getCssRuleString(rule) {
    let cssStringified = rule.cssText;
    if (isCSSImportRule(rule)) {
        try {
            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;
        }
        catch (_a) {
        }
    }
    return cssStringified;
}
function isCSSImportRule(rule) {
    return 'styleSheet' in rule;
}
function stringifyStyleSheet(sheet) {
    return sheet.cssRules
        ? Array.from(sheet.cssRules)
            .map((rule) => rule.cssText || '')
            .join('')
        : '';
}
function extractOrigin(url) {
    let origin = '';
    if (url.indexOf('//') > -1) {
        origin = url.split('/').slice(0, 3).join('/');
    }
    else {
        origin = url.split('/')[0];
    }
    origin = origin.split('?')[0];
    return origin;
}
let canvasService;
let canvasCtx;
const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm;
const RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/;
const DATA_URI = /^(data:)([^,]*),(.*)/i;
function absoluteToStylesheet(cssText, href) {
    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {
        const filePath = path1 || path2 || path3;
        const maybeQuote = quote1 || quote2 || '';
        if (!filePath) {
            return origin;
        }
        if (!RELATIVE_PATH.test(filePath)) {
            return `url(${maybeQuote}${filePath}${maybeQuote})`;
        }
        if (DATA_URI.test(filePath)) {
            return `url(${maybeQuote}${filePath}${maybeQuote})`;
        }
        if (filePath[0] === '/') {
            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;
        }
        const stack = href.split('/');
        const parts = filePath.split('/');
        stack.pop();
        for (const part of parts) {
            if (part === '.') {
                continue;
            }
            else if (part === '..') {
                stack.pop();
            }
            else {
                stack.push(part);
            }
        }
        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;
    });
}
const SRCSET_NOT_SPACES = /^[^ \t\n\r\u000c]+/;
const SRCSET_COMMAS_OR_SPACES = /^[, \t\n\r\u000c]+/;
function getAbsoluteSrcsetString(doc, attributeValue) {
    if (attributeValue.trim() === '') {
        return attributeValue;
    }
    let pos = 0;
    function collectCharacters(regEx) {
        let chars;
        let match = regEx.exec(attributeValue.substring(pos));
        if (match) {
            chars = match[0];
            pos += chars.length;
            return chars;
        }
        return '';
    }
    let output = [];
    while (true) {
        collectCharacters(SRCSET_COMMAS_OR_SPACES);
        if (pos >= attributeValue.length) {
            break;
        }
        let url = collectCharacters(SRCSET_NOT_SPACES);
        if (url.slice(-1) === ',') {
            url = absoluteToDoc(doc, url.substring(0, url.length - 1));
            output.push(url);
        }
        else {
            let descriptorsStr = '';
            url = absoluteToDoc(doc, url);
            let inParens = false;
            while (true) {
                let c = attributeValue.charAt(pos);
                if (c === '') {
                    output.push((url + descriptorsStr).trim());
                    break;
                }
                else if (!inParens) {
                    if (c === ',') {
                        pos += 1;
                        output.push((url + descriptorsStr).trim());
                        break;
                    }
                    else if (c === '(') {
                        inParens = true;
                    }
                }
                else {
                    if (c === ')') {
                        inParens = false;
                    }
                }
                descriptorsStr += c;
                pos += 1;
            }
        }
    }
    return output.join(', ');
}
function absoluteToDoc(doc, attributeValue) {
    if (!attributeValue || attributeValue.trim() === '') {
        return attributeValue;
    }
    const a = doc.createElement('a');
    a.href = attributeValue;
    return a.href;
}
function isSVGElement(el) {
    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);
}
function getHref() {
    const a = document.createElement('a');
    a.href = '';
    return a.href;
}
function transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {
    if (!value) {
        return value;
    }
    const name = _name.toLowerCase();
    const tagName = _tagName.toLowerCase();
    if (name === 'src' || name === 'href') {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'xlink:href' && value[0] !== '#') {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'background' &&
        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {
        return absoluteToDoc(doc, value);
    }
    else if (name === 'srcset') {
        return getAbsoluteSrcsetString(doc, value);
    }
    else if (name === 'style') {
        return absoluteToStylesheet(value, getHref());
    }
    else if (tagName === 'object' && name === 'data') {
        return absoluteToDoc(doc, value);
    }
    else if (maskAllText &&
        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {
        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);
    }
    return value;
}
function _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {
    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {
        return false;
    }
    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||
        (tagName === 'input' &&
            attribute === 'value' &&
            element.hasAttribute('type') &&
            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));
}
function _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {
    if (unblockSelector && element.matches(unblockSelector)) {
        return false;
    }
    if (typeof blockClass === 'string') {
        if (element.classList.contains(blockClass)) {
            return true;
        }
    }
    else {
        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {
            const className = element.classList[eIndex];
            if (blockClass.test(className)) {
                return true;
            }
        }
    }
    if (blockSelector) {
        return element.matches(blockSelector);
    }
    return false;
}
function needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {
    if (!node) {
        return false;
    }
    if (node.nodeType !== node.ELEMENT_NODE) {
        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);
    }
    if (unmaskTextSelector) {
        if (node.matches(unmaskTextSelector) ||
            node.closest(unmaskTextSelector)) {
            return false;
        }
    }
    if (maskAllText) {
        return true;
    }
    if (typeof maskTextClass === 'string') {
        if (node.classList.contains(maskTextClass)) {
            return true;
        }
    }
    else {
        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {
            const className = node.classList[eIndex];
            if (maskTextClass.test(className)) {
                return true;
            }
        }
    }
    if (maskTextSelector) {
        if (node.matches(maskTextSelector)) {
            return true;
        }
    }
    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);
}
function onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {
    const win = iframeEl.contentWindow;
    if (!win) {
        return;
    }
    let fired = false;
    let readyState;
    try {
        readyState = win.document.readyState;
    }
    catch (error) {
        return;
    }
    if (readyState !== 'complete') {
        const timer = setTimeout(() => {
            if (!fired) {
                listener();
                fired = true;
            }
        }, iframeLoadTimeout);
        iframeEl.addEventListener('load', () => {
            clearTimeout(timer);
            fired = true;
            listener();
        });
        return;
    }
    const blankUrl = 'about:blank';
    if (win.location.href !== blankUrl ||
        iframeEl.src === blankUrl ||
        iframeEl.src === '') {
        setTimeout(listener, 0);
        return;
    }
    iframeEl.addEventListener('load', listener);
}
function serializeNode(n, options) {
    var _a;
    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;
    let rootId;
    if (doc.__sn) {
        const docId = doc.__sn.id;
        rootId = docId === 1 ? undefined : docId;
    }
    switch (n.nodeType) {
        case n.DOCUMENT_NODE:
            if (n.compatMode !== 'CSS1Compat') {
                return {
                    type: NodeType$1.Document,
                    childNodes: [],
                    compatMode: n.compatMode,
                    rootId,
                };
            }
            else {
                return {
                    type: NodeType$1.Document,
                    childNodes: [],
                    rootId,
                };
            }
        case n.DOCUMENT_TYPE_NODE:
            return {
                type: NodeType$1.DocumentType,
                name: n.name,
                publicId: n.publicId,
                systemId: n.systemId,
                rootId,
            };
        case n.ELEMENT_NODE:
            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);
            const tagName = getValidTagName(n);
            let attributes = {};
            for (const { name, value } of Array.from(n.attributes)) {
                if (!skipAttribute(tagName, name)) {
                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);
                }
            }
            if (tagName === 'link' && inlineStylesheet) {
                const stylesheet = Array.from(doc.styleSheets).find((s) => {
                    return s.href === n.href;
                });
                let cssText = null;
                if (stylesheet) {
                    cssText = getCssRulesString(stylesheet);
                }
                if (cssText) {
                    delete attributes.rel;
                    delete attributes.href;
                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);
                }
            }
            if (tagName === 'style' &&
                n.sheet &&
                !(n.innerText ||
                    n.textContent ||
                    '').trim().length) {
                const cssText = getCssRulesString(n.sheet);
                if (cssText) {
                    attributes._cssText = absoluteToStylesheet(cssText, getHref());
                }
            }
            if (tagName === 'input' ||
                tagName === 'textarea' ||
                tagName === 'select' ||
                tagName === 'option') {
                const el = n;
                const value = getInputValue(tagName, el, attributes);
                const checked = n.checked;
                if (attributes.type !== 'submit' &&
                    attributes.type !== 'button' &&
                    value) {
                    attributes.value = maskInputValue({
                        input: el,
                        type: attributes.type,
                        tagName,
                        value,
                        maskInputSelector,
                        unmaskInputSelector,
                        maskInputOptions,
                        maskInputFn,
                    });
                }
                if (checked) {
                    attributes.checked = checked;
                }
            }
            if (tagName === 'option') {
                if (n.selected && !maskInputOptions['select']) {
                    attributes.selected = true;
                }
                else {
                    delete attributes.selected;
                }
            }
            if (tagName === 'canvas' && recordCanvas) {
                if (n.__context === '2d') {
                    if (!is2DCanvasBlank(n)) {
                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    }
                }
                else if (!('__context' in n)) {
                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    const blankCanvas = document.createElement('canvas');
                    blankCanvas.width = n.width;
                    blankCanvas.height = n.height;
                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    if (canvasDataURL !== blankCanvasDataURL) {
                        attributes.rr_dataURL = canvasDataURL;
                    }
                }
            }
            if (tagName === 'img' && inlineImages) {
                if (!canvasService) {
                    canvasService = doc.createElement('canvas');
                    canvasCtx = canvasService.getContext('2d');
                }
                const image = n;
                const oldValue = image.crossOrigin;
                image.crossOrigin = 'anonymous';
                const recordInlineImage = () => {
                    try {
                        canvasService.width = image.naturalWidth;
                        canvasService.height = image.naturalHeight;
                        canvasCtx.drawImage(image, 0, 0);
                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);
                    }
                    catch (err) {
                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);
                    }
                    oldValue
                        ? (attributes.crossOrigin = oldValue)
                        : delete attributes.crossOrigin;
                };
                if (image.complete && image.naturalWidth !== 0)
                    recordInlineImage();
                else
                    image.onload = recordInlineImage;
            }
            if (tagName === 'audio' || tagName === 'video') {
                attributes.rr_mediaState = n.paused
                    ? 'paused'
                    : 'played';
                attributes.rr_mediaCurrentTime = n.currentTime;
            }
            if (n.scrollLeft) {
                attributes.rr_scrollLeft = n.scrollLeft;
            }
            if (n.scrollTop) {
                attributes.rr_scrollTop = n.scrollTop;
            }
            if (needBlock) {
                const { width, height } = n.getBoundingClientRect();
                attributes = {
                    class: attributes.class,
                    rr_width: `${width}px`,
                    rr_height: `${height}px`,
                };
            }
            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {
                if (!n.contentDocument) {
                    attributes.rr_src = attributes.src;
                }
                delete attributes.src;
            }
            return {
                type: NodeType$1.Element,
                tagName,
                attributes,
                childNodes: [],
                isSVG: isSVGElement(n) || undefined,
                needBlock,
                rootId,
            };
        case n.TEXT_NODE:
            const parentTagName = n.parentNode && n.parentNode.tagName;
            let textContent = n.textContent;
            const isStyle = parentTagName === 'STYLE' ? true : undefined;
            const isScript = parentTagName === 'SCRIPT' ? true : undefined;
            if (isStyle && textContent) {
                try {
                    if (n.nextSibling || n.previousSibling) {
                    }
                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {
                        textContent = stringifyStyleSheet(n.parentNode.sheet);
                    }
                }
                catch (err) {
                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);
                }
                textContent = absoluteToStylesheet(textContent, getHref());
            }
            if (isScript) {
                textContent = 'SCRIPT_PLACEHOLDER';
            }
            if (parentTagName === 'TEXTAREA' && textContent) {
                textContent = '';
            }
            else if (parentTagName === 'OPTION' && textContent) {
                const option = n.parentNode;
                textContent = maskInputValue({
                    input: option,
                    type: null,
                    tagName: parentTagName,
                    value: textContent,
                    maskInputSelector,
                    unmaskInputSelector,
                    maskInputOptions,
                    maskInputFn,
                });
            }
            else if (!isStyle &&
                !isScript &&
                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&
                textContent) {
                textContent = maskTextFn
                    ? maskTextFn(textContent)
                    : defaultMaskFn(textContent);
            }
            return {
                type: NodeType$1.Text,
                textContent: textContent || '',
                isStyle,
                rootId,
            };
        case n.CDATA_SECTION_NODE:
            return {
                type: NodeType$1.CDATA,
                textContent: '',
                rootId,
            };
        case n.COMMENT_NODE:
            return {
                type: NodeType$1.Comment,
                textContent: n.textContent || '',
                rootId,
            };
        default:
            return false;
    }
}
function lowerIfExists(maybeAttr) {
    if (maybeAttr === undefined || maybeAttr === null) {
        return '';
    }
    else {
        return maybeAttr.toLowerCase();
    }
}
function slimDOMExcluded(sn, slimDOMOptions) {
    if (slimDOMOptions.comment && sn.type === NodeType$1.Comment) {
        return true;
    }
    else if (sn.type === NodeType$1.Element) {
        if (slimDOMOptions.script &&
            (sn.tagName === 'script' ||
                (sn.tagName === 'link' &&
                    (sn.attributes.rel === 'preload' ||
                        sn.attributes.rel === 'modulepreload') &&
                    sn.attributes.as === 'script') ||
                (sn.tagName === 'link' &&
                    sn.attributes.rel === 'prefetch' &&
                    typeof sn.attributes.href === 'string' &&
                    sn.attributes.href.endsWith('.js')))) {
            return true;
        }
        else if (slimDOMOptions.headFavicon &&
            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||
                (sn.tagName === 'meta' &&
                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||
                        lowerIfExists(sn.attributes.name) === 'application-name' ||
                        lowerIfExists(sn.attributes.rel) === 'icon' ||
                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||
                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {
            return true;
        }
        else if (sn.tagName === 'meta') {
            if (slimDOMOptions.headMetaDescKeywords &&
                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {
                return true;
            }
            else if (slimDOMOptions.headMetaSocial &&
                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||
                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||
                    lowerIfExists(sn.attributes.name) === 'pinterest')) {
                return true;
            }
            else if (slimDOMOptions.headMetaRobots &&
                (lowerIfExists(sn.attributes.name) === 'robots' ||
                    lowerIfExists(sn.attributes.name) === 'googlebot' ||
                    lowerIfExists(sn.attributes.name) === 'bingbot')) {
                return true;
            }
            else if (slimDOMOptions.headMetaHttpEquiv &&
                sn.attributes['http-equiv'] !== undefined) {
                return true;
            }
            else if (slimDOMOptions.headMetaAuthorship &&
                (lowerIfExists(sn.attributes.name) === 'author' ||
                    lowerIfExists(sn.attributes.name) === 'generator' ||
                    lowerIfExists(sn.attributes.name) === 'framework' ||
                    lowerIfExists(sn.attributes.name) === 'publisher' ||
                    lowerIfExists(sn.attributes.name) === 'progid' ||
                    lowerIfExists(sn.attributes.property).match(/^article:/) ||
                    lowerIfExists(sn.attributes.property).match(/^product:/))) {
                return true;
            }
            else if (slimDOMOptions.headMetaVerification &&
                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||
                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||
                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||
                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||
                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||
                    lowerIfExists(sn.attributes.name) === 'verification' ||
                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {
                return true;
            }
        }
    }
    return false;
}
function serializeNodeWithId(n, options) {
    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;
    let { preserveWhiteSpace = true } = options;
    const _serializedNode = serializeNode(n, {
        doc,
        blockClass,
        blockSelector,
        unblockSelector,
        maskTextClass,
        maskTextSelector,
        unmaskTextSelector,
        inlineStylesheet,
        maskInputSelector,
        unmaskInputSelector,
        maskAllText,
        maskInputOptions,
        maskTextFn,
        maskInputFn,
        dataURLOptions,
        inlineImages,
        recordCanvas,
        keepIframeSrcFn,
    });
    if (!_serializedNode) {
        console.warn(n, 'not serialized');
        return null;
    }
    let id;
    if ('__sn' in n) {
        id = n.__sn.id;
    }
    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||
        (!preserveWhiteSpace &&
            _serializedNode.type === NodeType$1.Text &&
            !_serializedNode.isStyle &&
            !_serializedNode.textContent.replace(/^\s+|\s+$/gm, '').length)) {
        id = IGNORED_NODE;
    }
    else {
        id = genId();
    }
    const serializedNode = Object.assign(_serializedNode, { id });
    n.__sn = serializedNode;
    if (id === IGNORED_NODE) {
        return null;
    }
    map[id] = n;
    if (onSerialize) {
        onSerialize(n);
    }
    let recordChild = !skipChild;
    if (serializedNode.type === NodeType$1.Element) {
        recordChild = recordChild && !serializedNode.needBlock;
        delete serializedNode.needBlock;
        if (n.shadowRoot)
            serializedNode.isShadowHost = true;
    }
    if ((serializedNode.type === NodeType$1.Document ||
        serializedNode.type === NodeType$1.Element) &&
        recordChild) {
        if (slimDOMOptions.headWhitespace &&
            _serializedNode.type === NodeType$1.Element &&
            _serializedNode.tagName === 'head') {
            preserveWhiteSpace = false;
        }
        const bypassOptions = {
            doc,
            map,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            skipChild,
            inlineStylesheet,
            maskInputSelector,
            unmaskInputSelector,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            slimDOMOptions,
            dataURLOptions,
            inlineImages,
            recordCanvas,
            preserveWhiteSpace,
            onSerialize,
            onIframeLoad,
            iframeLoadTimeout,
            keepIframeSrcFn,
        };
        for (const childN of Array.from(n.childNodes)) {
            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
            if (serializedChildNode) {
                serializedNode.childNodes.push(serializedChildNode);
            }
        }
        if (isElement(n) && n.shadowRoot) {
            for (const childN of Array.from(n.shadowRoot.childNodes)) {
                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
                if (serializedChildNode) {
                    serializedChildNode.isShadow = true;
                    serializedNode.childNodes.push(serializedChildNode);
                }
            }
        }
    }
    if (n.parentNode && isShadowRoot(n.parentNode)) {
        serializedNode.isShadow = true;
    }
    if (serializedNode.type === NodeType$1.Element &&
        serializedNode.tagName === 'iframe') {
        onceIframeLoaded(n, () => {
            const iframeDoc = n.contentDocument;
            if (iframeDoc && onIframeLoad) {
                const serializedIframeNode = serializeNodeWithId(iframeDoc, {
                    doc: iframeDoc,
                    map,
                    blockClass,
                    blockSelector,
                    unblockSelector,
                    maskTextClass,
                    maskTextSelector,
                    unmaskTextSelector,
                    skipChild: false,
                    inlineStylesheet,
                    maskInputSelector,
                    unmaskInputSelector,
                    maskAllText,
                    maskInputOptions,
                    maskTextFn,
                    maskInputFn,
                    slimDOMOptions,
                    dataURLOptions,
                    inlineImages,
                    recordCanvas,
                    preserveWhiteSpace,
                    onSerialize,
                    onIframeLoad,
                    iframeLoadTimeout,
                    keepIframeSrcFn,
                });
                if (serializedIframeNode) {
                    onIframeLoad(n, serializedIframeNode);
                }
            }
        }, iframeLoadTimeout);
    }
    return serializedNode;
}
function snapshot(n, options) {
    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};
    const idNodeMap = {};
    const maskInputOptions = maskAllInputs === true
        ? {
            color: true,
            date: true,
            'datetime-local': true,
            email: true,
            month: true,
            number: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true,
            textarea: true,
            select: true,
        }
        : maskAllInputs === false
            ? {}
            : maskAllInputs;
    const slimDOMOptions = slimDOM === true || slimDOM === 'all'
        ?
            {
                script: true,
                comment: true,
                headFavicon: true,
                headWhitespace: true,
                headMetaDescKeywords: slimDOM === 'all',
                headMetaSocial: true,
                headMetaRobots: true,
                headMetaHttpEquiv: true,
                headMetaAuthorship: true,
                headMetaVerification: true,
            }
        : slimDOM === false
            ? {}
            : slimDOM;
    return [
        serializeNodeWithId(n, {
            doc: n,
            map: idNodeMap,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            skipChild: false,
            inlineStylesheet,
            maskInputSelector,
            unmaskInputSelector,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            slimDOMOptions,
            dataURLOptions,
            inlineImages,
            recordCanvas,
            preserveWhiteSpace,
            onSerialize,
            onIframeLoad,
            iframeLoadTimeout,
            keepIframeSrcFn,
        }),
        idNodeMap,
    ];
}
function skipAttribute(tagName, attributeName, value) {
    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');
}
function getInputValue(tagName, el, attributes) {
    if (tagName === 'input' &&
        (attributes.type === 'radio' || attributes.type === 'checkbox')) {
        return el.getAttribute('value') || '';
    }
    return el.value;
}

var EventType;
(function (EventType) {
    EventType[EventType["DomContentLoaded"] = 0] = "DomContentLoaded";
    EventType[EventType["Load"] = 1] = "Load";
    EventType[EventType["FullSnapshot"] = 2] = "FullSnapshot";
    EventType[EventType["IncrementalSnapshot"] = 3] = "IncrementalSnapshot";
    EventType[EventType["Meta"] = 4] = "Meta";
    EventType[EventType["Custom"] = 5] = "Custom";
    EventType[EventType["Plugin"] = 6] = "Plugin";
})(EventType || (EventType = {}));
var IncrementalSource;
(function (IncrementalSource) {
    IncrementalSource[IncrementalSource["Mutation"] = 0] = "Mutation";
    IncrementalSource[IncrementalSource["MouseMove"] = 1] = "MouseMove";
    IncrementalSource[IncrementalSource["MouseInteraction"] = 2] = "MouseInteraction";
    IncrementalSource[IncrementalSource["Scroll"] = 3] = "Scroll";
    IncrementalSource[IncrementalSource["ViewportResize"] = 4] = "ViewportResize";
    IncrementalSource[IncrementalSource["Input"] = 5] = "Input";
    IncrementalSource[IncrementalSource["TouchMove"] = 6] = "TouchMove";
    IncrementalSource[IncrementalSource["MediaInteraction"] = 7] = "MediaInteraction";
    IncrementalSource[IncrementalSource["StyleSheetRule"] = 8] = "StyleSheetRule";
    IncrementalSource[IncrementalSource["CanvasMutation"] = 9] = "CanvasMutation";
    IncrementalSource[IncrementalSource["Font"] = 10] = "Font";
    IncrementalSource[IncrementalSource["Log"] = 11] = "Log";
    IncrementalSource[IncrementalSource["Drag"] = 12] = "Drag";
    IncrementalSource[IncrementalSource["StyleDeclaration"] = 13] = "StyleDeclaration";
})(IncrementalSource || (IncrementalSource = {}));
var MouseInteractions;
(function (MouseInteractions) {
    MouseInteractions[MouseInteractions["MouseUp"] = 0] = "MouseUp";
    MouseInteractions[MouseInteractions["MouseDown"] = 1] = "MouseDown";
    MouseInteractions[MouseInteractions["Click"] = 2] = "Click";
    MouseInteractions[MouseInteractions["ContextMenu"] = 3] = "ContextMenu";
    MouseInteractions[MouseInteractions["DblClick"] = 4] = "DblClick";
    MouseInteractions[MouseInteractions["Focus"] = 5] = "Focus";
    MouseInteractions[MouseInteractions["Blur"] = 6] = "Blur";
    MouseInteractions[MouseInteractions["TouchStart"] = 7] = "TouchStart";
    MouseInteractions[MouseInteractions["TouchMove_Departed"] = 8] = "TouchMove_Departed";
    MouseInteractions[MouseInteractions["TouchEnd"] = 9] = "TouchEnd";
    MouseInteractions[MouseInteractions["TouchCancel"] = 10] = "TouchCancel";
})(MouseInteractions || (MouseInteractions = {}));
var CanvasContext;
(function (CanvasContext) {
    CanvasContext[CanvasContext["2D"] = 0] = "2D";
    CanvasContext[CanvasContext["WebGL"] = 1] = "WebGL";
    CanvasContext[CanvasContext["WebGL2"] = 2] = "WebGL2";
})(CanvasContext || (CanvasContext = {}));
var MediaInteractions;
(function (MediaInteractions) {
    MediaInteractions[MediaInteractions["Play"] = 0] = "Play";
    MediaInteractions[MediaInteractions["Pause"] = 1] = "Pause";
    MediaInteractions[MediaInteractions["Seeked"] = 2] = "Seeked";
    MediaInteractions[MediaInteractions["VolumeChange"] = 3] = "VolumeChange";
})(MediaInteractions || (MediaInteractions = {}));
var ReplayerEvents;
(function (ReplayerEvents) {
    ReplayerEvents["Start"] = "start";
    ReplayerEvents["Pause"] = "pause";
    ReplayerEvents["Resume"] = "resume";
    ReplayerEvents["Resize"] = "resize";
    ReplayerEvents["Finish"] = "finish";
    ReplayerEvents["FullsnapshotRebuilded"] = "fullsnapshot-rebuilded";
    ReplayerEvents["LoadStylesheetStart"] = "load-stylesheet-start";
    ReplayerEvents["LoadStylesheetEnd"] = "load-stylesheet-end";
    ReplayerEvents["SkipStart"] = "skip-start";
    ReplayerEvents["SkipEnd"] = "skip-end";
    ReplayerEvents["MouseInteraction"] = "mouse-interaction";
    ReplayerEvents["EventCast"] = "event-cast";
    ReplayerEvents["CustomEvent"] = "custom-event";
    ReplayerEvents["Flush"] = "flush";
    ReplayerEvents["StateChange"] = "state-change";
    ReplayerEvents["PlayBack"] = "play-back";
})(ReplayerEvents || (ReplayerEvents = {}));

function on(type, fn, target = document) {
    const options = { capture: true, passive: true };
    target.addEventListener(type, fn, options);
    return () => target.removeEventListener(type, fn, options);
}
function createMirror() {
    return {
        map: {},
        getId(n) {
            if (!n || !n.__sn) {
                return -1;
            }
            return n.__sn.id;
        },
        getNode(id) {
            return this.map[id] || null;
        },
        removeNodeFromMap(n) {
            const id = n.__sn && n.__sn.id;
            delete this.map[id];
            if (n.childNodes) {
                n.childNodes.forEach((child) => this.removeNodeFromMap(child));
            }
        },
        has(id) {
            return this.map.hasOwnProperty(id);
        },
        reset() {
            this.map = {};
        },
    };
}
const DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +
    '\r\n' +
    'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +
    '\r\n' +
    'or you can use record.mirror to access the mirror instance during recording.';
let _mirror = {
    map: {},
    getId() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return -1;
    },
    getNode() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return null;
    },
    removeNodeFromMap() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
    },
    has() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
        return false;
    },
    reset() {
        console.error(DEPARTED_MIRROR_ACCESS_WARNING);
    },
};
if (typeof window !== 'undefined' && window.Proxy && window.Reflect) {
    _mirror = new Proxy(_mirror, {
        get(target, prop, receiver) {
            if (prop === 'map') {
                console.error(DEPARTED_MIRROR_ACCESS_WARNING);
            }
            return Reflect.get(target, prop, receiver);
        },
    });
}
function throttle(func, wait, options = {}) {
    let timeout = null;
    let previous = 0;
    return function (arg) {
        let now = Date.now();
        if (!previous && options.leading === false) {
            previous = now;
        }
        let remaining = wait - (now - previous);
        let context = this;
        let args = arguments;
        if (remaining <= 0 || remaining > wait) {
            if (timeout) {
                clearTimeout(timeout);
                timeout = null;
            }
            previous = now;
            func.apply(context, args);
        }
        else if (!timeout && options.trailing !== false) {
            timeout = setTimeout(() => {
                previous = options.leading === false ? 0 : Date.now();
                timeout = null;
                func.apply(context, args);
            }, remaining);
        }
    };
}
function hookSetter(target, key, d, isRevoked, win = window) {
    const original = win.Object.getOwnPropertyDescriptor(target, key);
    win.Object.defineProperty(target, key, isRevoked
        ? d
        : {
            set(value) {
                setTimeout(() => {
                    d.set.call(this, value);
                }, 0);
                if (original && original.set) {
                    original.set.call(this, value);
                }
            },
        });
    return () => hookSetter(target, key, original || {}, true);
}
function patch(source, name, replacement) {
    try {
        if (!(name in source)) {
            return () => { };
        }
        const original = source[name];
        const wrapped = replacement(original);
        if (typeof wrapped === 'function') {
            wrapped.prototype = wrapped.prototype || {};
            Object.defineProperties(wrapped, {
                __rrweb_original__: {
                    enumerable: false,
                    value: original,
                },
            });
        }
        source[name] = wrapped;
        return () => {
            source[name] = original;
        };
    }
    catch (_a) {
        return () => { };
    }
}
function getWindowHeight() {
    return (window.innerHeight ||
        (document.documentElement && document.documentElement.clientHeight) ||
        (document.body && document.body.clientHeight));
}
function getWindowWidth() {
    return (window.innerWidth ||
        (document.documentElement && document.documentElement.clientWidth) ||
        (document.body && document.body.clientWidth));
}
function isBlocked(node, blockClass, blockSelector, unblockSelector) {
    if (!node) {
        return false;
    }
    if (node.nodeType === node.ELEMENT_NODE) {
        let needBlock = false;
        const needUnblock = unblockSelector && node.matches(unblockSelector);
        if (typeof blockClass === 'string') {
            if (node.closest !== undefined) {
                needBlock =
                    !needUnblock &&
                        node.closest('.' + blockClass) !== null;
            }
            else {
                needBlock =
                    !needUnblock && node.classList.contains(blockClass);
            }
        }
        else {
            !needUnblock &&
                node.classList.forEach((className) => {
                    if (blockClass.test(className)) {
                        needBlock = true;
                    }
                });
        }
        if (!needBlock && blockSelector) {
            needBlock = node.matches(blockSelector);
        }
        return ((!needUnblock && needBlock) ||
            isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector));
    }
    if (node.nodeType === node.TEXT_NODE) {
        return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);
    }
    return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);
}
function isIgnored(n) {
    if ('__sn' in n) {
        return n.__sn.id === IGNORED_NODE;
    }
    return false;
}
function isAncestorRemoved(target, mirror) {
    if (isShadowRoot(target)) {
        return false;
    }
    const id = mirror.getId(target);
    if (!mirror.has(id)) {
        return true;
    }
    if (target.parentNode &&
        target.parentNode.nodeType === target.DOCUMENT_NODE) {
        return false;
    }
    if (!target.parentNode) {
        return true;
    }
    return isAncestorRemoved(target.parentNode, mirror);
}
function isTouchEvent(event) {
    return Boolean(event.changedTouches);
}
function polyfill(win = window) {
    if ('NodeList' in win && !win.NodeList.prototype.forEach) {
        win.NodeList.prototype.forEach = Array.prototype
            .forEach;
    }
    if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {
        win.DOMTokenList.prototype.forEach = Array.prototype
            .forEach;
    }
    if (!Node.prototype.contains) {
        Node.prototype.contains = function contains(node) {
            if (!(0 in arguments)) {
                throw new TypeError('1 argument is required');
            }
            do {
                if (this === node) {
                    return true;
                }
            } while ((node = node && node.parentNode));
            return false;
        };
    }
}
function isIframeINode(node) {
    if ('__sn' in node) {
        return (node.__sn.type === NodeType$1.Element && node.__sn.tagName === 'iframe');
    }
    return false;
}
function hasShadowRoot(n) {
    return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);
}

function isNodeInLinkedList(n) {
    return '__ln' in n;
}
class DoubleLinkedList {
    constructor() {
        this.length = 0;
        this.head = null;
    }
    get(position) {
        if (position >= this.length) {
            throw new Error('Position outside of list range');
        }
        let current = this.head;
        for (let index = 0; index < position; index++) {
            current = (current === null || current === void 0 ? void 0 : current.next) || null;
        }
        return current;
    }
    addNode(n) {
        const node = {
            value: n,
            previous: null,
            next: null,
        };
        n.__ln = node;
        if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {
            const current = n.previousSibling.__ln.next;
            node.next = current;
            node.previous = n.previousSibling.__ln;
            n.previousSibling.__ln.next = node;
            if (current) {
                current.previous = node;
            }
        }
        else if (n.nextSibling &&
            isNodeInLinkedList(n.nextSibling) &&
            n.nextSibling.__ln.previous) {
            const current = n.nextSibling.__ln.previous;
            node.previous = current;
            node.next = n.nextSibling.__ln;
            n.nextSibling.__ln.previous = node;
            if (current) {
                current.next = node;
            }
        }
        else {
            if (this.head) {
                this.head.previous = node;
            }
            node.next = this.head;
            this.head = node;
        }
        this.length++;
    }
    removeNode(n) {
        const current = n.__ln;
        if (!this.head) {
            return;
        }
        if (!current.previous) {
            this.head = current.next;
            if (this.head) {
                this.head.previous = null;
            }
        }
        else {
            current.previous.next = current.next;
            if (current.next) {
                current.next.previous = current.previous;
            }
        }
        if (n.__ln) {
            delete n.__ln;
        }
        this.length--;
    }
}
const moveKey = (id, parentId) => `${id}@${parentId}`;
function isINode(n) {
    return '__sn' in n;
}
class MutationBuffer {
    constructor() {
        this.frozen = false;
        this.locked = false;
        this.texts = [];
        this.attributes = [];
        this.removes = [];
        this.mapRemoves = [];
        this.movedMap = {};
        this.addedSet = new Set();
        this.movedSet = new Set();
        this.droppedSet = new Set();
        this.processMutations = (mutations) => {
            mutations.forEach(this.processMutation);
            this.emit();
        };
        this.emit = () => {
            if (this.frozen || this.locked) {
                return;
            }
            const adds = [];
            const addList = new DoubleLinkedList();
            const getNextId = (n) => {
                let ns = n;
                let nextId = IGNORED_NODE;
                while (nextId === IGNORED_NODE) {
                    ns = ns && ns.nextSibling;
                    nextId = ns && this.mirror.getId(ns);
                }
                return nextId;
            };
            const pushAdd = (n) => {
                var _a, _b, _c, _d, _e;
                const shadowHost = n.getRootNode
                    ? (_a = n.getRootNode()) === null || _a === void 0 ? void 0 : _a.host
                    : null;
                let rootShadowHost = shadowHost;
                while ((_c = (_b = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _b === void 0 ? void 0 : _b.call(rootShadowHost)) === null || _c === void 0 ? void 0 : _c.host)
                    rootShadowHost =
                        ((_e = (_d = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _d === void 0 ? void 0 : _d.call(rootShadowHost)) === null || _e === void 0 ? void 0 : _e.host) ||
                            null;
                const notInDoc = !this.doc.contains(n) &&
                    (!rootShadowHost || !this.doc.contains(rootShadowHost));
                if (!n.parentNode || notInDoc) {
                    return;
                }
                const parentId = isShadowRoot(n.parentNode)
                    ? this.mirror.getId(shadowHost)
                    : this.mirror.getId(n.parentNode);
                const nextId = getNextId(n);
                if (parentId === -1 || nextId === -1) {
                    return addList.addNode(n);
                }
                let sn = serializeNodeWithId(n, {
                    doc: this.doc,
                    map: this.mirror.map,
                    blockClass: this.blockClass,
                    blockSelector: this.blockSelector,
                    unblockSelector: this.unblockSelector,
                    maskTextClass: this.maskTextClass,
                    maskTextSelector: this.maskTextSelector,
                    unmaskTextSelector: this.unmaskTextSelector,
                    maskInputSelector: this.maskInputSelector,
                    unmaskInputSelector: this.unmaskInputSelector,
                    skipChild: true,
                    inlineStylesheet: this.inlineStylesheet,
                    maskAllText: this.maskAllText,
                    maskInputOptions: this.maskInputOptions,
                    maskTextFn: this.maskTextFn,
                    maskInputFn: this.maskInputFn,
                    slimDOMOptions: this.slimDOMOptions,
                    recordCanvas: this.recordCanvas,
                    inlineImages: this.inlineImages,
                    onSerialize: (currentN) => {
                        if (isIframeINode(currentN)) {
                            this.iframeManager.addIframe(currentN);
                        }
                        if (hasShadowRoot(n)) {
                            this.shadowDomManager.addShadowRoot(n.shadowRoot, document);
                        }
                    },
                    onIframeLoad: (iframe, childSn) => {
                        this.iframeManager.attachIframe(iframe, childSn);
                        this.shadowDomManager.observeAttachShadow(iframe);
                    },
                });
                if (sn) {
                    adds.push({
                        parentId,
                        nextId,
                        node: sn,
                    });
                }
            };
            while (this.mapRemoves.length) {
                this.mirror.removeNodeFromMap(this.mapRemoves.shift());
            }
            for (const n of this.movedSet) {
                if (isParentRemoved(this.removes, n, this.mirror) &&
                    !this.movedSet.has(n.parentNode)) {
                    continue;
                }
                pushAdd(n);
            }
            for (const n of this.addedSet) {
                if (!isAncestorInSet(this.droppedSet, n) &&
                    !isParentRemoved(this.removes, n, this.mirror)) {
                    pushAdd(n);
                }
                else if (isAncestorInSet(this.movedSet, n)) {
                    pushAdd(n);
                }
                else {
                    this.droppedSet.add(n);
                }
            }
            let candidate = null;
            while (addList.length) {
                let node = null;
                if (candidate) {
                    const parentId = this.mirror.getId(candidate.value.parentNode);
                    const nextId = getNextId(candidate.value);
                    if (parentId !== -1 && nextId !== -1) {
                        node = candidate;
                    }
                }
                if (!node) {
                    for (let index = addList.length - 1; index >= 0; index--) {
                        const _node = addList.get(index);
                        if (_node) {
                            const parentId = this.mirror.getId(_node.value.parentNode);
                            const nextId = getNextId(_node.value);
                            if (parentId !== -1 && nextId !== -1) {
                                node = _node;
                                break;
                            }
                        }
                    }
                }
                if (!node) {
                    while (addList.head) {
                        addList.removeNode(addList.head.value);
                    }
                    break;
                }
                candidate = node.previous;
                addList.removeNode(node.value);
                pushAdd(node.value);
            }
            const payload = {
                texts: this.texts
                    .map((text) => ({
                    id: this.mirror.getId(text.node),
                    value: text.value,
                }))
                    .filter((text) => this.mirror.has(text.id)),
                attributes: this.attributes
                    .map((attribute) => ({
                    id: this.mirror.getId(attribute.node),
                    attributes: attribute.attributes,
                }))
                    .filter((attribute) => this.mirror.has(attribute.id)),
                removes: this.removes,
                adds,
            };
            if (!payload.texts.length &&
                !payload.attributes.length &&
                !payload.removes.length &&
                !payload.adds.length) {
                return;
            }
            this.texts = [];
            this.attributes = [];
            this.removes = [];
            this.addedSet = new Set();
            this.movedSet = new Set();
            this.droppedSet = new Set();
            this.movedMap = {};
            this.mutationCb(payload);
        };
        this.processMutation = (m) => {
            if (isIgnored(m.target)) {
                return;
            }
            switch (m.type) {
                case 'characterData': {
                    const value = m.target.textContent;
                    if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) && value !== m.oldValue) {
                        this.texts.push({
                            value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextSelector, this.maskAllText) && value
                                ? this.maskTextFn
                                    ? this.maskTextFn(value)
                                    : value.replace(/[\S]/g, '*')
                                : value,
                            node: m.target,
                        });
                    }
                    break;
                }
                case 'attributes': {
                    const target = m.target;
                    let value = target.getAttribute(m.attributeName);
                    if (m.attributeName === 'value') {
                        value = maskInputValue({
                            input: target,
                            maskInputSelector: this.maskInputSelector,
                            unmaskInputSelector: this.unmaskInputSelector,
                            maskInputOptions: this.maskInputOptions,
                            tagName: target.tagName,
                            type: target.getAttribute('type'),
                            value,
                            maskInputFn: this.maskInputFn,
                        });
                    }
                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || value === m.oldValue) {
                        return;
                    }
                    let item = this.attributes.find((a) => a.node === m.target);
                    if (!item) {
                        item = {
                            node: m.target,
                            attributes: {},
                        };
                        this.attributes.push(item);
                    }
                    if (m.attributeName === 'type' &&
                        m.target.tagName === 'INPUT' &&
                        (m.oldValue || '').toLowerCase() === 'password') {
                        m.target.setAttribute('rr_is_password', 'true');
                    }
                    if (m.attributeName === 'style') {
                        const old = this.doc.createElement('span');
                        if (m.oldValue) {
                            old.setAttribute('style', m.oldValue);
                        }
                        if (item.attributes.style === undefined ||
                            item.attributes.style === null) {
                            item.attributes.style = {};
                        }
                        try {
                            const styleObj = item.attributes.style;
                            for (const pname of Array.from(target.style)) {
                                const newValue = target.style.getPropertyValue(pname);
                                const newPriority = target.style.getPropertyPriority(pname);
                                if (newValue !== old.style.getPropertyValue(pname) ||
                                    newPriority !== old.style.getPropertyPriority(pname)) {
                                    if (newPriority === '') {
                                        styleObj[pname] = newValue;
                                    }
                                    else {
                                        styleObj[pname] = [newValue, newPriority];
                                    }
                                }
                            }
                            for (const pname of Array.from(old.style)) {
                                if (target.style.getPropertyValue(pname) === '') {
                                    styleObj[pname] = false;
                                }
                            }
                        }
                        catch (error) {
                            console.warn('[rrweb] Error when parsing update to style attribute:', error);
                        }
                    }
                    else {
                        const element = m.target;
                        item.attributes[m.attributeName] = transformAttribute(this.doc, element, element.tagName, m.attributeName, value, this.maskAllText, this.unmaskTextSelector, this.maskTextFn);
                    }
                    break;
                }
                case 'childList': {
                    m.addedNodes.forEach((n) => this.genAdds(n, m.target));
                    m.removedNodes.forEach((n) => {
                        const nodeId = this.mirror.getId(n);
                        const parentId = isShadowRoot(m.target)
                            ? this.mirror.getId(m.target.host)
                            : this.mirror.getId(m.target);
                        if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || isIgnored(n)) {
                            return;
                        }
                        if (this.addedSet.has(n)) {
                            deepDelete(this.addedSet, n);
                            this.droppedSet.add(n);
                        }
                        else if (this.addedSet.has(m.target) && nodeId === -1) ;
                        else if (isAncestorRemoved(m.target, this.mirror)) ;
                        else if (this.movedSet.has(n) &&
                            this.movedMap[moveKey(nodeId, parentId)]) {
                            deepDelete(this.movedSet, n);
                        }
                        else {
                            this.removes.push({
                                parentId,
                                id: nodeId,
                                isShadow: isShadowRoot(m.target) ? true : undefined,
                            });
                        }
                        this.mapRemoves.push(n);
                    });
                    break;
                }
            }
        };
        this.genAdds = (n, target) => {
            if (target && isBlocked(target, this.blockClass, this.blockSelector, this.unblockSelector)) {
                return;
            }
            if (isINode(n)) {
                if (isIgnored(n)) {
                    return;
                }
                this.movedSet.add(n);
                let targetId = null;
                if (target && isINode(target)) {
                    targetId = target.__sn.id;
                }
                if (targetId) {
                    this.movedMap[moveKey(n.__sn.id, targetId)] = true;
                }
            }
            else {
                this.addedSet.add(n);
                this.droppedSet.delete(n);
            }
            if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector))
                n.childNodes.forEach((childN) => this.genAdds(childN));
        };
    }
    init(options) {
        [
            'mutationCb',
            'blockClass',
            'blockSelector',
            'unblockSelector',
            'maskTextClass',
            'maskTextSelector',
            'unmaskTextSelector',
            'maskInputSelector',
            'unmaskInputSelector',
            'inlineStylesheet',
            'maskAllText',
            'maskInputOptions',
            'maskTextFn',
            'maskInputFn',
            'recordCanvas',
            'inlineImages',
            'slimDOMOptions',
            'doc',
            'mirror',
            'iframeManager',
            'shadowDomManager',
            'canvasManager',
        ].forEach((key) => {
            this[key] = options[key];
        });
    }
    freeze() {
        this.frozen = true;
        this.canvasManager.freeze();
    }
    unfreeze() {
        this.frozen = false;
        this.canvasManager.unfreeze();
        this.emit();
    }
    isFrozen() {
        return this.frozen;
    }
    lock() {
        this.locked = true;
        this.canvasManager.lock();
    }
    unlock() {
        this.locked = false;
        this.canvasManager.unlock();
        this.emit();
    }
    reset() {
        this.shadowDomManager.reset();
        this.canvasManager.reset();
    }
}
function deepDelete(addsSet, n) {
    addsSet.delete(n);
    n.childNodes.forEach((childN) => deepDelete(addsSet, childN));
}
function isParentRemoved(removes, n, mirror) {
    const { parentNode } = n;
    if (!parentNode) {
        return false;
    }
    const parentId = mirror.getId(parentNode);
    if (removes.some((r) => r.id === parentId)) {
        return true;
    }
    return isParentRemoved(removes, parentNode, mirror);
}
function isAncestorInSet(set, n) {
    const { parentNode } = n;
    if (!parentNode) {
        return false;
    }
    if (set.has(parentNode)) {
        return true;
    }
    return isAncestorInSet(set, parentNode);
}

const callbackWrapper = (cb) => {
    const rrwebWrapped = (...rest) => {
        try {
            return cb(...rest);
        }
        catch (error) {
            try {
                error.__rrweb__ = true;
            }
            catch (_a) {
            }
            throw error;
        }
    };
    return rrwebWrapped;
};

const mutationBuffers = [];
function getEventTarget(event) {
    try {
        if ('composedPath' in event) {
            const path = event.composedPath();
            if (path.length) {
                return path[0];
            }
        }
        else if ('path' in event && event.path.length) {
            return event.path[0];
        }
    }
    catch (_a) { }
    return event && event.target;
}
function initMutationObserver(options, rootEl) {
    var _a, _b;
    const mutationBuffer = new MutationBuffer();
    mutationBuffers.push(mutationBuffer);
    mutationBuffer.init(options);
    let mutationObserverCtor = window.MutationObserver ||
        window.__rrMutationObserver;
    const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');
    if (angularZoneSymbol &&
        window[angularZoneSymbol]) {
        mutationObserverCtor = window[angularZoneSymbol];
    }
    const observer = new mutationObserverCtor(callbackWrapper((mutations) => {
        if (options.onMutation && options.onMutation(mutations) === false) {
            return;
        }
        mutationBuffer.processMutations(mutations);
    }));
    observer.observe(rootEl, {
        attributes: true,
        attributeOldValue: true,
        characterData: true,
        characterDataOldValue: true,
        childList: true,
        subtree: true,
    });
    return observer;
}
function initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {
    if (sampling.mousemove === false) {
        return () => { };
    }
    const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;
    const callbackThreshold = typeof sampling.mousemoveCallback === 'number'
        ? sampling.mousemoveCallback
        : 500;
    let positions = [];
    let timeBaseline;
    const wrappedCb = throttle((source) => {
        const totalOffset = Date.now() - timeBaseline;
        callbackWrapper(mousemoveCb)(positions.map((p) => {
            p.timeOffset -= totalOffset;
            return p;
        }), source);
        positions = [];
        timeBaseline = null;
    }, callbackThreshold);
    const updatePosition = throttle((evt) => {
        const target = getEventTarget(evt);
        const { clientX, clientY } = isTouchEvent(evt)
            ? evt.changedTouches[0]
            : evt;
        if (!timeBaseline) {
            timeBaseline = Date.now();
        }
        positions.push({
            x: clientX,
            y: clientY,
            id: mirror.getId(target),
            timeOffset: Date.now() - timeBaseline,
        });
        wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent
            ? IncrementalSource.Drag
            : evt instanceof MouseEvent
                ? IncrementalSource.MouseMove
                : IncrementalSource.TouchMove);
    }, threshold, {
        trailing: false,
    });
    const handlers = [
        on('mousemove', callbackWrapper(updatePosition), doc),
        on('touchmove', callbackWrapper(updatePosition), doc),
        on('drag', callbackWrapper(updatePosition), doc),
    ];
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {
    if (sampling.mouseInteraction === false) {
        return () => { };
    }
    const disableMap = sampling.mouseInteraction === true ||
        sampling.mouseInteraction === undefined
        ? {}
        : sampling.mouseInteraction;
    const handlers = [];
    const getHandler = (eventKey) => {
        return (event) => {
            const target = getEventTarget(event);
            if (isBlocked(target, blockClass, blockSelector, unblockSelector)) {
                return;
            }
            const e = isTouchEvent(event) ? event.changedTouches[0] : event;
            if (!e) {
                return;
            }
            const id = mirror.getId(target);
            const { clientX, clientY } = e;
            callbackWrapper(mouseInteractionCb)({
                type: MouseInteractions[eventKey],
                id,
                x: clientX,
                y: clientY,
            });
        };
    };
    Object.keys(MouseInteractions)
        .filter((key) => Number.isNaN(Number(key)) &&
        !key.endsWith('_Departed') &&
        disableMap[key] !== false)
        .forEach((eventKey) => {
        const eventName = eventKey.toLowerCase();
        const handler = callbackWrapper(getHandler(eventKey));
        handlers.push(on(eventName, handler, doc));
    });
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {
    const updatePosition = throttle((evt) => {
        const target = getEventTarget(evt);
        if (!target ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        const id = mirror.getId(target);
        if (target === doc) {
            const scrollEl = (doc.scrollingElement || doc.documentElement);
            callbackWrapper(scrollCb)({
                id,
                x: scrollEl.scrollLeft,
                y: scrollEl.scrollTop,
            });
        }
        else {
            callbackWrapper(scrollCb)({
                id,
                x: target.scrollLeft,
                y: target.scrollTop,
            });
        }
    }, sampling.scroll || 100);
    return on('scroll', callbackWrapper(updatePosition), doc);
}
function initViewportResizeObserver({ viewportResizeCb, }) {
    let lastH = -1;
    let lastW = -1;
    const updateDimension = throttle(() => {
        const height = getWindowHeight();
        const width = getWindowWidth();
        if (lastH !== height || lastW !== width) {
            callbackWrapper(viewportResizeCb)({
                width: Number(width),
                height: Number(height),
            });
            lastH = height;
            lastW = width;
        }
    }, 200);
    return on('resize', callbackWrapper(updateDimension), window);
}
function wrapEventWithUserTriggeredFlag(v, enable) {
    const value = Object.assign({}, v);
    if (!enable)
        delete value.userTriggered;
    return value;
}
const INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];
const lastInputValueMap = new WeakMap();
function initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputSelector, unmaskInputSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {
    function eventHandler(event) {
        let target = getEventTarget(event);
        const tagName = target && target.tagName;
        const userTriggered = event.isTrusted;
        if (tagName === 'OPTION')
            target = target.parentElement;
        if (!target ||
            !tagName ||
            INPUT_TAGS.indexOf(tagName) < 0 ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        let type = target.type;
        if (target.classList.contains(ignoreClass) ||
            (ignoreSelector && target.matches(ignoreSelector))) {
            return;
        }
        let text = target.value;
        let isChecked = false;
        if (target.hasAttribute('rr_is_password')) {
            type = 'password';
        }
        if (type === 'radio' || type === 'checkbox') {
            isChecked = target.checked;
        }
        else if (hasInputMaskOptions({
            maskInputOptions,
            maskInputSelector,
            tagName,
            type,
        })) {
            text = maskInputValue({
                input: target,
                maskInputOptions,
                maskInputSelector,
                unmaskInputSelector,
                tagName,
                type,
                value: text,
                maskInputFn,
            });
        }
        cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));
        const name = target.name;
        if (type === 'radio' && name && isChecked) {
            doc
                .querySelectorAll(`input[type="radio"][name="${name}"]`)
                .forEach((el) => {
                if (el !== target) {
                    cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({
                        text: el.value,
                        isChecked: !isChecked,
                        userTriggered: false,
                    }, userTriggeredOnInput));
                }
            });
        }
    }
    function cbWithDedup(target, v) {
        const lastInputValue = lastInputValueMap.get(target);
        if (!lastInputValue ||
            lastInputValue.text !== v.text ||
            lastInputValue.isChecked !== v.isChecked) {
            lastInputValueMap.set(target, v);
            const id = mirror.getId(target);
            inputCb(Object.assign(Object.assign({}, v), { id }));
        }
    }
    const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];
    const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));
    const propertyDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
    const hookProperties = [
        [HTMLInputElement.prototype, 'value'],
        [HTMLInputElement.prototype, 'checked'],
        [HTMLSelectElement.prototype, 'value'],
        [HTMLTextAreaElement.prototype, 'value'],
        [HTMLSelectElement.prototype, 'selectedIndex'],
        [HTMLOptionElement.prototype, 'selected'],
    ];
    if (propertyDescriptor && propertyDescriptor.set) {
        handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {
            set() {
                callbackWrapper(eventHandler)({ target: this });
            },
        })));
    }
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function getNestedCSSRulePositions(rule) {
    const positions = [];
    function recurse(childRule, pos) {
        if ((hasNestedCSSRule('CSSGroupingRule') &&
            childRule.parentRule instanceof CSSGroupingRule) ||
            (hasNestedCSSRule('CSSMediaRule') &&
                childRule.parentRule instanceof CSSMediaRule) ||
            (hasNestedCSSRule('CSSSupportsRule') &&
                childRule.parentRule instanceof CSSSupportsRule) ||
            (hasNestedCSSRule('CSSConditionRule') &&
                childRule.parentRule instanceof CSSConditionRule)) {
            const rules = Array.from(childRule.parentRule.cssRules);
            const index = rules.indexOf(childRule);
            pos.unshift(index);
        }
        else {
            const rules = Array.from(childRule.parentStyleSheet.cssRules);
            const index = rules.indexOf(childRule);
            pos.unshift(index);
        }
        return pos;
    }
    return recurse(rule, positions);
}
function initStyleSheetObserver({ styleSheetRuleCb, mirror }, { win }) {
    if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {
        return () => { };
    }
    const insertRule = win.CSSStyleSheet.prototype.insertRule;
    win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            const [rule, index] = argumentsList;
            const id = mirror.getId(thisArg.ownerNode);
            if (id !== -1) {
                styleSheetRuleCb({
                    id,
                    adds: [{ rule, index }],
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const deleteRule = win.CSSStyleSheet.prototype.deleteRule;
    win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            const [index] = argumentsList;
            const id = mirror.getId(thisArg.ownerNode);
            if (id !== -1) {
                styleSheetRuleCb({
                    id,
                    removes: [{ index }],
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const supportedNestedCSSRuleTypes = {};
    if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {
        supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;
    }
    else {
        if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {
            supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;
        }
        if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {
            supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;
        }
        if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {
            supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;
        }
    }
    const unmodifiedFunctions = {};
    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {
        unmodifiedFunctions[typeKey] = {
            insertRule: type.prototype.insertRule,
            deleteRule: type.prototype.deleteRule,
        };
        type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {
            apply: callbackWrapper((target, thisArg, argumentsList) => {
                const [rule, index] = argumentsList;
                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);
                if (id !== -1) {
                    styleSheetRuleCb({
                        id,
                        adds: [
                            {
                                rule,
                                index: [
                                    ...getNestedCSSRulePositions(thisArg),
                                    index || 0,
                                ],
                            },
                        ],
                    });
                }
                return target.apply(thisArg, argumentsList);
            }),
        });
        type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {
            apply: callbackWrapper((target, thisArg, argumentsList) => {
                const [index] = argumentsList;
                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);
                if (id !== -1) {
                    styleSheetRuleCb({
                        id,
                        removes: [
                            { index: [...getNestedCSSRulePositions(thisArg), index] },
                        ],
                    });
                }
                return target.apply(thisArg, argumentsList);
            }),
        });
    });
    return callbackWrapper(() => {
        win.CSSStyleSheet.prototype.insertRule = insertRule;
        win.CSSStyleSheet.prototype.deleteRule = deleteRule;
        Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {
            type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;
            type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;
        });
    });
}
function initStyleDeclarationObserver({ styleDeclarationCb, mirror }, { win }) {
    const setProperty = win.CSSStyleDeclaration.prototype.setProperty;
    win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            var _a, _b;
            const [property, value, priority] = argumentsList;
            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);
            if (id !== -1) {
                styleDeclarationCb({
                    id,
                    set: {
                        property,
                        value,
                        priority,
                    },
                    index: getNestedCSSRulePositions(thisArg.parentRule),
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;
    win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {
        apply: callbackWrapper((target, thisArg, argumentsList) => {
            var _a, _b;
            const [property] = argumentsList;
            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);
            if (id !== -1) {
                styleDeclarationCb({
                    id,
                    remove: {
                        property,
                    },
                    index: getNestedCSSRulePositions(thisArg.parentRule),
                });
            }
            return target.apply(thisArg, argumentsList);
        }),
    });
    return callbackWrapper(() => {
        win.CSSStyleDeclaration.prototype.setProperty = setProperty;
        win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;
    });
}
function initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, }) {
    const handler = (type) => throttle(callbackWrapper((event) => {
        const target = getEventTarget(event);
        if (!target ||
            isBlocked(target, blockClass, blockSelector, unblockSelector)) {
            return;
        }
        const { currentTime, volume, muted } = target;
        mediaInteractionCb({
            type,
            id: mirror.getId(target),
            currentTime,
            volume,
            muted,
        });
    }), sampling.media || 500);
    const handlers = [
        on('play', handler(0)),
        on('pause', handler(1)),
        on('seeked', handler(2)),
        on('volumechange', handler(3)),
    ];
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function initFontObserver({ fontCb, doc }) {
    const win = doc.defaultView;
    if (!win) {
        return () => { };
    }
    const handlers = [];
    const fontMap = new WeakMap();
    const originalFontFace = win.FontFace;
    win.FontFace = function FontFace(family, source, descriptors) {
        const fontFace = new originalFontFace(family, source, descriptors);
        fontMap.set(fontFace, {
            family,
            buffer: typeof source !== 'string',
            descriptors,
            fontSource: typeof source === 'string'
                ? source
                :
                    JSON.stringify(Array.from(new Uint8Array(source))),
        });
        return fontFace;
    };
    const restoreHandler = patch(doc.fonts, 'add', function (original) {
        return function (fontFace) {
            setTimeout(() => {
                const p = fontMap.get(fontFace);
                if (p) {
                    fontCb(p);
                    fontMap.delete(fontFace);
                }
            }, 0);
            return original.apply(this, [fontFace]);
        };
    });
    handlers.push(() => {
        win.FontFace = originalFontFace;
    });
    handlers.push(restoreHandler);
    return callbackWrapper(() => {
        handlers.forEach((h) => h());
    });
}
function mergeHooks(o, hooks) {
    const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, } = o;
    o.mutationCb = (...p) => {
        if (hooks.mutation) {
            hooks.mutation(...p);
        }
        mutationCb(...p);
    };
    o.mousemoveCb = (...p) => {
        if (hooks.mousemove) {
            hooks.mousemove(...p);
        }
        mousemoveCb(...p);
    };
    o.mouseInteractionCb = (...p) => {
        if (hooks.mouseInteraction) {
            hooks.mouseInteraction(...p);
        }
        mouseInteractionCb(...p);
    };
    o.scrollCb = (...p) => {
        if (hooks.scroll) {
            hooks.scroll(...p);
        }
        scrollCb(...p);
    };
    o.viewportResizeCb = (...p) => {
        if (hooks.viewportResize) {
            hooks.viewportResize(...p);
        }
        viewportResizeCb(...p);
    };
    o.inputCb = (...p) => {
        if (hooks.input) {
            hooks.input(...p);
        }
        inputCb(...p);
    };
    o.mediaInteractionCb = (...p) => {
        if (hooks.mediaInteaction) {
            hooks.mediaInteaction(...p);
        }
        mediaInteractionCb(...p);
    };
    o.styleSheetRuleCb = (...p) => {
        if (hooks.styleSheetRule) {
            hooks.styleSheetRule(...p);
        }
        styleSheetRuleCb(...p);
    };
    o.styleDeclarationCb = (...p) => {
        if (hooks.styleDeclaration) {
            hooks.styleDeclaration(...p);
        }
        styleDeclarationCb(...p);
    };
    o.canvasMutationCb = (...p) => {
        if (hooks.canvasMutation) {
            hooks.canvasMutation(...p);
        }
        canvasMutationCb(...p);
    };
    o.fontCb = (...p) => {
        if (hooks.font) {
            hooks.font(...p);
        }
        fontCb(...p);
    };
}
function initObservers(o, hooks = {}) {
    const currentWindow = o.doc.defaultView;
    if (!currentWindow) {
        return () => { };
    }
    mergeHooks(o, hooks);
    const mutationObserver = initMutationObserver(o, o.doc);
    const mousemoveHandler = initMoveObserver(o);
    const mouseInteractionHandler = initMouseInteractionObserver(o);
    const scrollHandler = initScrollObserver(o);
    const viewportResizeHandler = initViewportResizeObserver(o);
    const inputHandler = initInputObserver(o);
    const mediaInteractionHandler = initMediaInteractionObserver(o);
    const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });
    const styleDeclarationObserver = initStyleDeclarationObserver(o, {
        win: currentWindow,
    });
    const fontObserver = o.collectFonts ? initFontObserver(o) : () => { };
    const pluginHandlers = [];
    for (const plugin of o.plugins) {
        pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));
    }
    return callbackWrapper(() => {
        mutationBuffers.forEach((b) => b.reset());
        mutationObserver.disconnect();
        mousemoveHandler();
        mouseInteractionHandler();
        scrollHandler();
        viewportResizeHandler();
        inputHandler();
        mediaInteractionHandler();
        try {
            styleSheetObserver();
            styleDeclarationObserver();
        }
        catch (e) {
        }
        fontObserver();
        pluginHandlers.forEach((h) => h());
    });
}
function hasNestedCSSRule(prop) {
    return typeof window[prop] !== 'undefined';
}
function canMonkeyPatchNestedCSSRule(prop) {
    return Boolean(typeof window[prop] !== 'undefined' &&
        window[prop].prototype &&
        'insertRule' in window[prop].prototype &&
        'deleteRule' in window[prop].prototype);
}

class IframeManager {
    constructor(options) {
        this.iframes = new WeakMap();
        this.mutationCb = options.mutationCb;
    }
    addIframe(iframeEl) {
        this.iframes.set(iframeEl, true);
    }
    addLoadListener(cb) {
        this.loadListener = cb;
    }
    attachIframe(iframeEl, childSn) {
        var _a;
        this.mutationCb({
            adds: [
                {
                    parentId: iframeEl.__sn.id,
                    nextId: null,
                    node: childSn,
                },
            ],
            removes: [],
            texts: [],
            attributes: [],
            isAttachIframe: true,
        });
        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);
    }
}

class ShadowDomManager {
    constructor(options) {
        this.restorePatches = [];
        this.mutationCb = options.mutationCb;
        this.scrollCb = options.scrollCb;
        this.bypassOptions = options.bypassOptions;
        this.mirror = options.mirror;
        const manager = this;
        this.restorePatches.push(patch(HTMLElement.prototype, 'attachShadow', function (original) {
            return function () {
                const shadowRoot = original.apply(this, arguments);
                if (this.shadowRoot)
                    manager.addShadowRoot(this.shadowRoot, this.ownerDocument);
                return shadowRoot;
            };
        }));
    }
    addShadowRoot(shadowRoot, doc) {
        initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);
        initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }));
    }
    observeAttachShadow(iframeElement) {
        if (iframeElement.contentWindow) {
            const manager = this;
            this.restorePatches.push(patch(iframeElement.contentWindow.HTMLElement.prototype, 'attachShadow', function (original) {
                return function () {
                    const shadowRoot = original.apply(this, arguments);
                    if (this.shadowRoot)
                        manager.addShadowRoot(this.shadowRoot, iframeElement.contentDocument);
                    return shadowRoot;
                };
            }));
        }
    }
    reset() {
        this.restorePatches.forEach((restorePatch) => restorePatch());
    }
}

/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

function initCanvas2DMutationObserver(cb, win, blockClass, unblockSelector, blockSelector, mirror) {
    const handlers = [];
    const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);
    for (const prop of props2D) {
        try {
            if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {
                continue;
            }
            const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {
                return function (...args) {
                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {
                        setTimeout(() => {
                            const recordArgs = [...args];
                            if (prop === 'drawImage') {
                                if (recordArgs[0] &&
                                    recordArgs[0] instanceof HTMLCanvasElement) {
                                    const canvas = recordArgs[0];
                                    const ctx = canvas.getContext('2d');
                                    let imgd = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, canvas.width, canvas.height);
                                    let pix = imgd === null || imgd === void 0 ? void 0 : imgd.data;
                                    recordArgs[0] = JSON.stringify(pix);
                                }
                            }
                            cb(this.canvas, {
                                type: CanvasContext['2D'],
                                property: prop,
                                args: recordArgs,
                            });
                        }, 0);
                    }
                    return original.apply(this, args);
                };
            });
            handlers.push(restoreHandler);
        }
        catch (_a) {
            const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {
                set(v) {
                    cb(this.canvas, {
                        type: CanvasContext['2D'],
                        property: prop,
                        args: [v],
                        setter: true,
                    });
                },
            });
            handlers.push(hookHandler);
        }
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

function initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector) {
    const handlers = [];
    try {
        const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {
            return function (contextType, ...args) {
                if (!isBlocked(this, blockClass, blockSelector, unblockSelector)) {
                    if (!('__context' in this))
                        this.__context = contextType;
                }
                return original.apply(this, [contextType, ...args]);
            };
        });
        handlers.push(restoreHandler);
    }
    catch (_a) {
        console.error('failed to patch HTMLCanvasElement.prototype.getContext');
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

/*
 * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 */
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
// Use a lookup table to find the index.
var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
for (var i = 0; i < chars.length; i++) {
    lookup[chars.charCodeAt(i)] = i;
}
var encode = function (arraybuffer) {
    var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';
    for (i = 0; i < len; i += 3) {
        base64 += chars[bytes[i] >> 2];
        base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
        base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
        base64 += chars[bytes[i + 2] & 63];
    }
    if (len % 3 === 2) {
        base64 = base64.substring(0, base64.length - 1) + '=';
    }
    else if (len % 3 === 1) {
        base64 = base64.substring(0, base64.length - 2) + '==';
    }
    return base64;
};

const webGLVarMap = new Map();
function variableListFor(ctx, ctor) {
    let contextMap = webGLVarMap.get(ctx);
    if (!contextMap) {
        contextMap = new Map();
        webGLVarMap.set(ctx, contextMap);
    }
    if (!contextMap.has(ctor)) {
        contextMap.set(ctor, []);
    }
    return contextMap.get(ctor);
}
const saveWebGLVar = (value, win, ctx) => {
    if (!value ||
        !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))
        return;
    const name = value.constructor.name;
    const list = variableListFor(ctx, name);
    let index = list.indexOf(value);
    if (index === -1) {
        index = list.length;
        list.push(value);
    }
    return index;
};
function serializeArg(value, win, ctx) {
    if (value instanceof Array) {
        return value.map((arg) => serializeArg(arg, win, ctx));
    }
    else if (value === null) {
        return value;
    }
    else if (value instanceof Float32Array ||
        value instanceof Float64Array ||
        value instanceof Int32Array ||
        value instanceof Uint32Array ||
        value instanceof Uint8Array ||
        value instanceof Uint16Array ||
        value instanceof Int16Array ||
        value instanceof Int8Array ||
        value instanceof Uint8ClampedArray) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [Object.values(value)],
        };
    }
    else if (value instanceof ArrayBuffer) {
        const name = value.constructor.name;
        const base64 = encode(value);
        return {
            rr_type: name,
            base64,
        };
    }
    else if (value instanceof DataView) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [
                serializeArg(value.buffer, win, ctx),
                value.byteOffset,
                value.byteLength,
            ],
        };
    }
    else if (value instanceof HTMLImageElement) {
        const name = value.constructor.name;
        const { src } = value;
        return {
            rr_type: name,
            src,
        };
    }
    else if (value instanceof ImageData) {
        const name = value.constructor.name;
        return {
            rr_type: name,
            args: [serializeArg(value.data, win, ctx), value.width, value.height],
        };
    }
    else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {
        const name = value.constructor.name;
        const index = saveWebGLVar(value, win, ctx);
        return {
            rr_type: name,
            index: index,
        };
    }
    return value;
}
const serializeArgs = (args, win, ctx) => {
    return [...args].map((arg) => serializeArg(arg, win, ctx));
};
const isInstanceOfWebGLObject = (value, win) => {
    const webGLConstructorNames = [
        'WebGLActiveInfo',
        'WebGLBuffer',
        'WebGLFramebuffer',
        'WebGLProgram',
        'WebGLRenderbuffer',
        'WebGLShader',
        'WebGLShaderPrecisionFormat',
        'WebGLTexture',
        'WebGLUniformLocation',
        'WebGLVertexArrayObject',
        'WebGLVertexArrayObjectOES',
    ];
    const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');
    return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));
};

function patchGLPrototype(prototype, type, cb, blockClass, unblockSelector, blockSelector, mirror, win) {
    const handlers = [];
    const props = Object.getOwnPropertyNames(prototype);
    for (const prop of props) {
        try {
            if (typeof prototype[prop] !== 'function') {
                continue;
            }
            const restoreHandler = patch(prototype, prop, function (original) {
                return function (...args) {
                    const result = original.apply(this, args);
                    saveWebGLVar(result, win, prototype);
                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {
                        const id = mirror.getId(this.canvas);
                        const recordArgs = serializeArgs([...args], win, prototype);
                        const mutation = {
                            type,
                            property: prop,
                            args: recordArgs,
                        };
                        cb(this.canvas, mutation);
                    }
                    return result;
                };
            });
            handlers.push(restoreHandler);
        }
        catch (_a) {
            const hookHandler = hookSetter(prototype, prop, {
                set(v) {
                    cb(this.canvas, {
                        type,
                        property: prop,
                        args: [v],
                        setter: true,
                    });
                },
            });
            handlers.push(hookHandler);
        }
    }
    return handlers;
}
function initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {
    const handlers = [];
    handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win));
    if (typeof win.WebGL2RenderingContext !== 'undefined') {
        handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win));
    }
    return () => {
        handlers.forEach((h) => h());
    };
}

class CanvasManager {
    reset() {
        this.pendingCanvasMutations.clear();
        this.resetObservers && this.resetObservers();
    }
    freeze() {
        this.frozen = true;
    }
    unfreeze() {
        this.frozen = false;
    }
    lock() {
        this.locked = true;
    }
    unlock() {
        this.locked = false;
    }
    constructor(options) {
        this.pendingCanvasMutations = new Map();
        this.rafStamps = { latestId: 0, invokeId: null };
        this.frozen = false;
        this.locked = false;
        this.processMutation = function (target, mutation) {
            const newFrame = this.rafStamps.invokeId &&
                this.rafStamps.latestId !== this.rafStamps.invokeId;
            if (newFrame || !this.rafStamps.invokeId)
                this.rafStamps.invokeId = this.rafStamps.latestId;
            if (!this.pendingCanvasMutations.has(target)) {
                this.pendingCanvasMutations.set(target, []);
            }
            this.pendingCanvasMutations.get(target).push(mutation);
        };
        this.mutationCb = options.mutationCb;
        this.mirror = options.mirror;
        if (options.recordCanvas === true)
            this.initCanvasMutationObserver(options.win, options.blockClass, options.blockSelector, options.unblockSelector);
    }
    initCanvasMutationObserver(win, blockClass, unblockSelector, blockSelector) {
        this.startRAFTimestamping();
        this.startPendingCanvasMutationFlusher();
        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector);
        const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);
        const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);
        this.resetObservers = () => {
            canvasContextReset();
            canvas2DReset();
            canvasWebGL1and2Reset();
        };
    }
    startPendingCanvasMutationFlusher() {
        requestAnimationFrame(() => this.flushPendingCanvasMutations());
    }
    startRAFTimestamping() {
        const setLatestRAFTimestamp = (timestamp) => {
            this.rafStamps.latestId = timestamp;
            requestAnimationFrame(setLatestRAFTimestamp);
        };
        requestAnimationFrame(setLatestRAFTimestamp);
    }
    flushPendingCanvasMutations() {
        this.pendingCanvasMutations.forEach((values, canvas) => {
            const id = this.mirror.getId(canvas);
            this.flushPendingCanvasMutationFor(canvas, id);
        });
        requestAnimationFrame(() => this.flushPendingCanvasMutations());
    }
    flushPendingCanvasMutationFor(canvas, id) {
        if (this.frozen || this.locked) {
            return;
        }
        const valuesWithType = this.pendingCanvasMutations.get(canvas);
        if (!valuesWithType || id === -1)
            return;
        const values = valuesWithType.map((value) => {
            const rest = __rest(value, ["type"]);
            return rest;
        });
        const { type } = valuesWithType[0];
        this.mutationCb({ id, type, commands: values });
        this.pendingCanvasMutations.delete(canvas);
    }
}

function wrapEvent(e) {
    return Object.assign(Object.assign({}, e), { timestamp: Date.now() });
}
let wrappedEmit;
let takeFullSnapshot;
const mirror = createMirror();
function record(options = {}) {
    const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, maskInputSelector = null, unmaskTextSelector = null, unmaskInputSelector = null, inlineStylesheet = true, maskAllText = false, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, mousemoveWait, recordCanvas = false, userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, onMutation, } = options;
    if (!emit) {
        throw new Error('emit function is required');
    }
    if (mousemoveWait !== undefined && sampling.mousemove === undefined) {
        sampling.mousemove = mousemoveWait;
    }
    const maskInputOptions = maskAllInputs === true
        ? {
            color: true,
            date: true,
            'datetime-local': true,
            email: true,
            month: true,
            number: true,
            range: true,
            search: true,
            tel: true,
            text: true,
            time: true,
            url: true,
            week: true,
            textarea: true,
            select: true,
            radio: true,
            checkbox: true,
        }
        : _maskInputOptions !== undefined
            ? _maskInputOptions
            : {};
    const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'
        ? {
            script: true,
            comment: true,
            headFavicon: true,
            headWhitespace: true,
            headMetaSocial: true,
            headMetaRobots: true,
            headMetaHttpEquiv: true,
            headMetaVerification: true,
            headMetaAuthorship: _slimDOMOptions === 'all',
            headMetaDescKeywords: _slimDOMOptions === 'all',
        }
        : _slimDOMOptions
            ? _slimDOMOptions
            : {};
    polyfill();
    let lastFullSnapshotEvent;
    let incrementalSnapshotCount = 0;
    const eventProcessor = (e) => {
        for (const plugin of plugins || []) {
            if (plugin.eventProcessor) {
                e = plugin.eventProcessor(e);
            }
        }
        if (packFn) {
            e = packFn(e);
        }
        return e;
    };
    wrappedEmit = (e, isCheckout) => {
        var _a;
        if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&
            e.type !== EventType.FullSnapshot &&
            !(e.type === EventType.IncrementalSnapshot &&
                e.data.source === IncrementalSource.Mutation)) {
            mutationBuffers.forEach((buf) => buf.unfreeze());
        }
        emit(eventProcessor(e), isCheckout);
        if (e.type === EventType.FullSnapshot) {
            lastFullSnapshotEvent = e;
            incrementalSnapshotCount = 0;
        }
        else if (e.type === EventType.IncrementalSnapshot) {
            if (e.data.source === IncrementalSource.Mutation &&
                e.data.isAttachIframe) {
                return;
            }
            incrementalSnapshotCount++;
            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
            const exceedTime = checkoutEveryNms &&
                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
            if (exceedCount || exceedTime) {
                takeFullSnapshot(true);
            }
        }
    };
    const wrappedMutationEmit = (m) => {
        wrappedEmit(wrapEvent({
            type: EventType.IncrementalSnapshot,
            data: Object.assign({ source: IncrementalSource.Mutation }, m),
        }));
    };
    const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({
        type: EventType.IncrementalSnapshot,
        data: Object.assign({ source: IncrementalSource.Scroll }, p),
    }));
    const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({
        type: EventType.IncrementalSnapshot,
        data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),
    }));
    const iframeManager = new IframeManager({
        mutationCb: wrappedMutationEmit,
    });
    const canvasManager = new CanvasManager({
        recordCanvas,
        mutationCb: wrappedCanvasMutationEmit,
        win: window,
        blockClass,
        blockSelector,
        unblockSelector,
        mirror,
    });
    const shadowDomManager = new ShadowDomManager({
        mutationCb: wrappedMutationEmit,
        scrollCb: wrappedScrollEmit,
        bypassOptions: {
            onMutation,
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            maskInputSelector,
            unmaskInputSelector,
            inlineStylesheet,
            maskAllText,
            maskInputOptions,
            maskTextFn,
            maskInputFn,
            recordCanvas,
            inlineImages,
            sampling,
            slimDOMOptions,
            iframeManager,
            canvasManager,
        },
        mirror,
    });
    takeFullSnapshot = (isCheckout = false) => {
        var _a, _b, _c, _d;
        wrappedEmit(wrapEvent({
            type: EventType.Meta,
            data: {
                href: window.location.href,
                width: getWindowWidth(),
                height: getWindowHeight(),
            },
        }), isCheckout);
        mutationBuffers.forEach((buf) => buf.lock());
        const [node, idNodeMap] = snapshot(document, {
            blockClass,
            blockSelector,
            unblockSelector,
            maskTextClass,
            maskTextSelector,
            unmaskTextSelector,
            maskInputSelector,
            unmaskInputSelector,
            inlineStylesheet,
            maskAllText,
            maskAllInputs: maskInputOptions,
            maskTextFn,
            slimDOM: slimDOMOptions,
            recordCanvas,
            inlineImages,
            onSerialize: (n) => {
                if (isIframeINode(n)) {
                    iframeManager.addIframe(n);
                }
                if (hasShadowRoot(n)) {
                    shadowDomManager.addShadowRoot(n.shadowRoot, document);
                }
            },
            onIframeLoad: (iframe, childSn) => {
                iframeManager.attachIframe(iframe, childSn);
                shadowDomManager.observeAttachShadow(iframe);
            },
            keepIframeSrcFn,
        });
        if (!node) {
            return console.warn('Failed to snapshot the document');
        }
        mirror.map = idNodeMap;
        wrappedEmit(wrapEvent({
            type: EventType.FullSnapshot,
            data: {
                node,
                initialOffset: {
                    left: window.pageXOffset !== undefined
                        ? window.pageXOffset
                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollLeft) ||
                            ((_b = (_a = document === null || document === void 0 ? void 0 : document.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||
                            (document === null || document === void 0 ? void 0 : document.body.scrollLeft) ||
                            0,
                    top: window.pageYOffset !== undefined
                        ? window.pageYOffset
                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollTop) ||
                            ((_d = (_c = document === null || document === void 0 ? void 0 : document.body) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.scrollTop) ||
                            (document === null || document === void 0 ? void 0 : document.body.scrollTop) ||
                            0,
                },
            },
        }));
        mutationBuffers.forEach((buf) => buf.unlock());
    };
    try {
        const handlers = [];
        handlers.push(on('DOMContentLoaded', () => {
            wrappedEmit(wrapEvent({
                type: EventType.DomContentLoaded,
                data: {},
            }));
        }));
        const observe = (doc) => {
            var _a;
            return callbackWrapper(initObservers)({
                onMutation,
                mutationCb: wrappedMutationEmit,
                mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: {
                        source,
                        positions,
                    },
                })),
                mouseInteractionCb: (d) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),
                })),
                scrollCb: wrappedScrollEmit,
                viewportResizeCb: (d) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.ViewportResize }, d),
                })),
                inputCb: (v) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.Input }, v),
                })),
                mediaInteractionCb: (p) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),
                })),
                styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),
                })),
                styleDeclarationCb: (r) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),
                })),
                canvasMutationCb: wrappedCanvasMutationEmit,
                fontCb: (p) => wrappedEmit(wrapEvent({
                    type: EventType.IncrementalSnapshot,
                    data: Object.assign({ source: IncrementalSource.Font }, p),
                })),
                blockClass,
                ignoreClass,
                ignoreSelector,
                maskTextClass,
                maskTextSelector,
                unmaskTextSelector,
                maskInputSelector,
                unmaskInputSelector,
                maskInputOptions,
                inlineStylesheet,
                sampling,
                recordCanvas,
                inlineImages,
                userTriggeredOnInput,
                collectFonts,
                doc,
                maskAllText,
                maskInputFn,
                maskTextFn,
                blockSelector,
                unblockSelector,
                slimDOMOptions,
                mirror,
                iframeManager,
                shadowDomManager,
                canvasManager,
                plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({
                    observer: p.observer,
                    options: p.options,
                    callback: (payload) => wrappedEmit(wrapEvent({
                        type: EventType.Plugin,
                        data: {
                            plugin: p.name,
                            payload,
                        },
                    })),
                }))) || [],
            }, hooks);
        };
        iframeManager.addLoadListener((iframeEl) => {
            try {
                handlers.push(observe(iframeEl.contentDocument));
            }
            catch (error) {
                console.warn(error);
            }
        });
        const init = () => {
            takeFullSnapshot();
            handlers.push(observe(document));
        };
        if (document.readyState === 'interactive' ||
            document.readyState === 'complete') {
            init();
        }
        else {
            handlers.push(on('load', () => {
                wrappedEmit(wrapEvent({
                    type: EventType.Load,
                    data: {},
                }));
                init();
            }, window));
        }
        return () => {
            handlers.forEach((h) => h());
        };
    }
    catch (error) {
        console.warn(error);
    }
}
record.addCustomEvent = (tag, payload) => {
    if (!wrappedEmit) {
        throw new Error('please add custom event after start recording');
    }
    wrappedEmit(wrapEvent({
        type: EventType.Custom,
        data: {
            tag,
            payload,
        },
    }));
};
record.freezePage = () => {
    mutationBuffers.forEach((buf) => buf.freeze());
};
record.takeFullSnapshot = (isCheckout) => {
    if (!takeFullSnapshot) {
        throw new Error('please take full snapshot after start recording');
    }
    takeFullSnapshot(isCheckout);
};
record.mirror = mirror;

const NAVIGATION_ENTRY_KEYS = [
  'name',
  'type',
  'startTime',
  'transferSize',
  'duration',
];

function isNavigationEntryEqual(a) {
  return function (b) {
    return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]);
  };
}

/**
 * There are some difficulties diagnosing why there are duplicate navigation
 * entries. We've witnessed several intermittent results:
 * - duplicate entries have duration = 0
 * - duplicate entries are the same object reference
 * - none of the above
 *
 * Compare the values of several keys to determine if the entries are duplicates or not.
 */
// TODO (high-prio): Figure out wth is returned here
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function dedupePerformanceEntries(
  currentList,
  newList,
) {
  // Partition `currentList` into 3 different lists based on entryType
  const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce(
    (acc, entry) => {
      if (entry.entryType === 'navigation') {
        acc[0].push(entry );
      } else if (entry.entryType === 'largest-contentful-paint') {
        acc[1].push(entry );
      } else {
        acc[2].push(entry);
      }
      return acc;
    },
    [[], [], []],
  );

  const newEntries = [];
  const newNavigationEntries = [];
  let newLcpEntry = existingLcpEntries.length
    ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted
    : undefined;

  newList.forEach(entry => {
    if (entry.entryType === 'largest-contentful-paint') {
      // We want the latest LCP event only
      if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) {
        newLcpEntry = entry;
      }
      return;
    }

    if (entry.entryType === 'navigation') {
      const navigationEntry = entry ;

      // Check if the navigation entry is contained in currentList or newList
      if (
        // Ignore any navigation entries with duration 0, as they are likely duplicates
        entry.duration > 0 &&
        // Ensure new entry does not already exist in existing entries
        !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) &&
        // Ensure new entry does not already exist in new list of navigation entries
        !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry))
      ) {
        newNavigationEntries.push(navigationEntry);
      }

      // Otherwise this navigation entry is considered a duplicate and is thrown away
      return;
    }

    newEntries.push(entry);
  });

  // Re-combine and sort by startTime
  return [
    ...(newLcpEntry ? [newLcpEntry] : []),
    ...existingNavigationEntries,
    ...existingEntries,
    ...newEntries,
    ...newNavigationEntries,
  ].sort((a, b) => a.startTime - b.startTime);
}

/**
 * Sets up a PerformanceObserver to listen to all performance entry types.
 */
function setupPerformanceObserver(replay) {
  const performanceObserverHandler = (list) => {
    // For whatever reason the observer was returning duplicate navigation
    // entries (the other entry types were not duplicated).
    const newPerformanceEntries = dedupePerformanceEntries(
      replay.performanceEvents,
      list.getEntries() ,
    );
    replay.performanceEvents = newPerformanceEntries;
  };

  const performanceObserver = new PerformanceObserver(performanceObserverHandler);

  [
    'element',
    'event',
    'first-input',
    'largest-contentful-paint',
    'layout-shift',
    'longtask',
    'navigation',
    'paint',
    'resource',
  ].forEach(type => {
    try {
      performanceObserver.observe({
        type,
        buffered: true,
      });
    } catch (e) {
      // This can throw if an entry type is not supported in the browser.
      // Ignore these errors.
    }
  });

  return performanceObserver;
}

const r = `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
function t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},p=(t,e,a)=>{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},A=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},E=(t,i,n)=>{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f<t.sym_next);p(t,256,i)},R=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},U=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{p(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(p(t,n,t.bl_tree),o--),p(t,16,t.bl_tree),g(t,o-3,2)):o<=10?(p(t,17,t.bl_tree),g(t,o-3,3)):(p(t,18,t.bl_tree),g(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let S=!1;const D=(t,e,a,i)=>{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s<i;s++)g(t,t.bl_tree[2*n[s]+1],3);U(t,t.dyn_ltree,e-1),U(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),E(t,t.dyn_ltree,t.dyn_dtree)),y(t),i&&x(t)},O={_tr_init:t=>{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<<e[m];t++)l[w++]=m;for(l[w-1]=m,b=0,m=0;m<16;m++)for(d[m]=b,t=0;t<1<<a[m];t++)o[b++]=m;for(b>>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<<a[m]-7;t++)o[256+b++]=m;for(n=0;n<=15;n++)g[n]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(v(s,287,g),t=0;t<30;t++)r[2*t+1]=5,r[2*t]=k(t,5);f=new _(s,e,257,286,15),c=new _(r,a,0,30,15),u=new _(new Array(0),i,0,19,7)})(),S=!0),t.l_desc=new w(t.dyn_ltree,f),t.d_desc=new w(t.dyn_dtree,c),t.bl_desc=new w(t.bl_tree,u),t.bi_buf=0,t.bi_valid=0,y(t)},_tr_stored_block:D,_tr_flush_block:T,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},I={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const ct=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=258-(f-s),s=f-258,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==X||e===P||a!==i+t.strm.avail_in))break;r=e===X&&a===i+t.strm.avail_in?1:0,H(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==P&&e!==X&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a),t.match_length<=5&&(t.strategy===et||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,Zt(t)};var St={deflateInit:(t,e)=>Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=258-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:"pako deflate (from Nodeca project)"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ft=!1}const Lt=new Uint8Array(256);for(let t=0;t<256;t++)Lt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Lt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a="";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Bt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Nt(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,"string"==typeof t?a.input=Nt(t):"[object ArrayBuffer]"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg="invalid literal/length code",E.mode=16209;break t}k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];a:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg="invalid distance code",E.mode=16209;break t}if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg="invalid distance too far back",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg="invalid distance too far back",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const te=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ee=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ae=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ne=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=15;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=te,D=ee,u=257):(A=ae,D=ie,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ue={inflateReset:ve,inflateReset2:ye,inflateResetKeep:ke,inflateInit:t=>xe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg="incorrect header check",a.mode=me;break}if((15&h)!==we){t.msg="unknown compression method",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg="invalid window size",a.mode=me;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:16191,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==we){t.msg="unknown compression method",a.mode=me;break}if(57344&a.flags){t.msg="unknown header flags set",a.mode=me;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg="header crc mismatch",a.mode=me;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=be(h),h=0,d=0,a.mode=16190;case 16190:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,de;t.adler=a.check=1,a.mode=16191;case 16191:if(e===re||e===oe)break t;case 16192:if(a.last){h>>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg="invalid block type",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg="invalid stored block lengths",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg="too many length or distance symbols",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid code lengths set",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg="invalid bit length repeat",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg="invalid bit length repeat",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg="invalid code -- missing end-of-block",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg="invalid literal/lengths set",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg="invalid distances set",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg="invalid literal/length code",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(0==(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg="invalid distance code",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg="invalid distance too far back",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg="invalid distance too far back",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:be(h))!==a.check){t.msg="incorrect data check",a.mode=me;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg="incorrect length check",a.mode=me;break}h=0,d=0}a.mode=16208;case 16208:x=he;break t;case me:x=fe;break t;case 16210:return ce;default:return _e}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<me&&(a.mode<16206||e!==se))&&Ze(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(16191===a.mode?128:0)+(16199===a.mode||16194===a.mode?256:0),(0===_&&0===f||e===se)&&x===le&&(x=ue),x},inflateEnd:t=>{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:"pako inflate (from Nodeca project)"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):"[object ArrayBuffer]"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,"[object ArrayBuffer]"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if("string"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const e=this._hasEvents?",":"";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push("]",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push("[",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener("message",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&"function"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:"init",success:!0,response:void 0});`;

function e(){const e=new Blob([r]);return URL.createObjectURL(e)}

/**
 * A basic event buffer that does not do any compression.
 * Used as fallback if the compression worker cannot be loaded or is disabled.
 */
class EventBufferArray  {
  /** All the events that are buffered to be sent. */

   constructor() {
    this.events = [];
  }

  /** @inheritdoc */
   get hasEvents() {
    return this.events.length > 0;
  }

  /** @inheritdoc */
   destroy() {
    this.events = [];
  }

  /** @inheritdoc */
   async addEvent(event, isCheckout) {
    if (isCheckout) {
      this.events = [event];
      return;
    }

    this.events.push(event);
    return;
  }

  /** @inheritdoc */
   finish() {
    return new Promise(resolve => {
      // Make a copy of the events array reference and immediately clear the
      // events member so that we do not lose new events while uploading
      // attachment.
      const eventsRet = this.events;
      this.events = [];
      resolve(JSON.stringify(eventsRet));
    });
  }
}

/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
class WorkerHandler {

   constructor(worker) {
    this._worker = worker;
    this._id = 0;
  }

  /**
   * Ensure the worker is ready (or not).
   * This will either resolve when the worker is ready, or reject if an error occured.
   */
   ensureReady() {
    // Ensure we only check once
    if (this._ensureReadyPromise) {
      return this._ensureReadyPromise;
    }

    this._ensureReadyPromise = new Promise((resolve, reject) => {
      this._worker.addEventListener(
        'message',
        ({ data }) => {
          if ((data ).success) {
            resolve();
          } else {
            reject();
          }
        },
        { once: true },
      );

      this._worker.addEventListener(
        'error',
        error => {
          reject(error);
        },
        { once: true },
      );
    });

    return this._ensureReadyPromise;
  }

  /**
   * Destroy the worker.
   */
   destroy() {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Destroying compression worker');
    this._worker.terminate();
  }

  /**
   * Post message to worker and wait for response before resolving promise.
   */
   postMessage(method, arg) {
    const id = this._getAndIncrementId();

    return new Promise((resolve, reject) => {
      const listener = ({ data }) => {
        const response = data ;
        if (response.method !== method) {
          return;
        }

        // There can be multiple listeners for a single method, the id ensures
        // that the response matches the caller.
        if (response.id !== id) {
          return;
        }

        // At this point, we'll always want to remove listener regardless of result status
        this._worker.removeEventListener('message', listener);

        if (!response.success) {
          // TODO: Do some error handling, not sure what
          (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay]', response.response);

          reject(new Error('Error in compression worker'));
          return;
        }

        resolve(response.response );
      };

      // Note: we can't use `once` option because it's possible it needs to
      // listen to multiple messages
      this._worker.addEventListener('message', listener);
      this._worker.postMessage({ id, method, arg });
    });
  }

  /** Get the current ID and increment it for the next call. */
   _getAndIncrementId() {
    return this._id++;
  }
}

/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
class EventBufferCompressionWorker  {
  /** @inheritdoc */

   constructor(worker) {
    this._worker = new WorkerHandler(worker);
    this.hasEvents = false;
  }

  /**
   * Ensure the worker is ready (or not).
   * This will either resolve when the worker is ready, or reject if an error occured.
   */
   ensureReady() {
    return this._worker.ensureReady();
  }

  /**
   * Destroy the event buffer.
   */
   destroy() {
    this._worker.destroy();
  }

  /**
   * Add an event to the event buffer.
   *
   * Returns true if event was successfuly received and processed by worker.
   */
   async addEvent(event, isCheckout) {
    this.hasEvents = true;

    if (isCheckout) {
      // This event is a checkout, make sure worker buffer is cleared before
      // proceeding.
      await this._clear();
    }

    return this._sendEventToWorker(event);
  }

  /**
   * Finish the event buffer and return the compressed data.
   */
   finish() {
    return this._finishRequest();
  }

  /**
   * Send the event to the worker.
   */
   _sendEventToWorker(event) {
    return this._worker.postMessage('addEvent', JSON.stringify(event));
  }

  /**
   * Finish the request and return the compressed data from the worker.
   */
   async _finishRequest() {
    const response = await this._worker.postMessage('finish');

    this.hasEvents = false;

    return response;
  }

  /** Clear any pending events from the worker. */
   _clear() {
    return this._worker.postMessage('clear');
  }
}

/**
 * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
 * This can happen e.g. if the worker cannot be loaded.
 * Exported only for testing.
 */
class EventBufferProxy  {

   constructor(worker) {
    this._fallback = new EventBufferArray();
    this._compression = new EventBufferCompressionWorker(worker);
    this._used = this._fallback;

    this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();
  }

  /** @inheritDoc */
   get hasEvents() {
    return this._used.hasEvents;
  }

  /** @inheritDoc */
   destroy() {
    this._fallback.destroy();
    this._compression.destroy();
  }

  /**
   * Add an event to the event buffer.
   *
   * Returns true if event was successfully added.
   */
   addEvent(event, isCheckout) {
    return this._used.addEvent(event, isCheckout);
  }

  /** @inheritDoc */
   async finish() {
    // Ensure the worker is loaded, so the sent event is compressed
    await this.ensureWorkerIsLoaded();

    return this._used.finish();
  }

  /** Ensure the worker has loaded. */
   ensureWorkerIsLoaded() {
    return this._ensureWorkerIsLoadedPromise;
  }

  /** Actually check if the worker has been loaded. */
   async _ensureWorkerIsLoaded() {
    try {
      await this._compression.ensureReady();
    } catch (error) {
      // If the worker fails to load, we fall back to the simple buffer.
      // Nothing more to do from our side here
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Failed to load the compression worker, falling back to simple buffer');
      return;
    }

    // Now we need to switch over the array buffer to the compression worker
    await this._switchToCompressionWorker();
  }

  /** Switch the used buffer to the compression worker. */
   async _switchToCompressionWorker() {
    const { events } = this._fallback;

    const addEventPromises = [];
    for (const event of events) {
      addEventPromises.push(this._compression.addEvent(event));
    }

    // We switch over to the new buffer immediately - any further events will be added
    // after the previously buffered ones
    this._used = this._compression;

    // Wait for original events to be re-added before resolving
    try {
      await Promise.all(addEventPromises);
    } catch (error) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Replay] Failed to add events when switching buffers.', error);
    }
  }
}

/**
 * Create an event buffer for replays.
 */
function createEventBuffer({ useCompression }) {
  // eslint-disable-next-line no-restricted-globals
  if (useCompression && window.Worker) {
    try {
      const workerUrl = e();

      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Using compression worker');
      const worker = new Worker(workerUrl);
      return new EventBufferProxy(worker);
    } catch (error) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Failed to create compression worker');
      // Fall back to use simple event buffer array
    }
  }

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Using simple buffer');
  return new EventBufferArray();
}

/**
 * Given an initial timestamp and an expiry duration, checks to see if current
 * time should be considered as expired.
 */
function isExpired(
  initialTime,
  expiry,
  targetTime = +new Date(),
) {
  // Always expired if < 0
  if (initialTime === null || expiry === undefined || expiry < 0) {
    return true;
  }

  // Never expires if == 0
  if (expiry === 0) {
    return false;
  }

  return initialTime + expiry <= targetTime;
}

/**
 * Checks to see if session is expired
 */
function isSessionExpired(session, timeouts, targetTime = +new Date()) {
  return (
    // First, check that maximum session length has not been exceeded
    isExpired(session.started, timeouts.maxSessionLife, targetTime) ||
    // check that the idle timeout has not been exceeded (i.e. user has
    // performed an action within the last `idleTimeout` ms)
    isExpired(session.lastActivity, timeouts.sessionIdle, targetTime)
  );
}

/**
 * Save a session to session storage.
 */
function saveSession(session) {
  const hasSessionStorage = 'sessionStorage' in WINDOW;
  if (!hasSessionStorage) {
    return;
  }

  try {
    WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));
  } catch (e) {
    // Ignore potential SecurityError exceptions
  }
}

/**
 * Given a sample rate, returns true if replay should be sampled.
 *
 * 1.0 = 100% sampling
 * 0.0 = 0% sampling
 */
function isSampled(sampleRate) {
  if (sampleRate === undefined) {
    return false;
  }

  // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)
  return Math.random() < sampleRate;
}

/**
 * Get a session with defaults & applied sampling.
 */
function makeSession(session) {
  const now = Date.now();
  const id = session.id || uuid4();
  // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.
  const started = session.started || now;
  const lastActivity = session.lastActivity || now;
  const segmentId = session.segmentId || 0;
  const sampled = session.sampled;

  return {
    id,
    started,
    lastActivity,
    segmentId,
    sampled,
  };
}

/**
 * Get the sampled status for a session based on sample rates & current sampled status.
 */
function getSessionSampleType(sessionSampleRate, errorSampleRate) {
  return isSampled(sessionSampleRate) ? 'session' : isSampled(errorSampleRate) ? 'error' : false;
}

/**
 * Create a new session, which in its current implementation is a Sentry event
 * that all replays will be saved to as attachments. Currently, we only expect
 * one of these Sentry events per "replay session".
 */
function createSession({ sessionSampleRate, errorSampleRate, stickySession = false }) {
  const sampled = getSessionSampleType(sessionSampleRate, errorSampleRate);
  const session = makeSession({
    sampled,
  });

  (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log(`[Replay] Creating new session: ${session.id}`);

  if (stickySession) {
    saveSession(session);
  }

  return session;
}

/**
 * Fetches a session from storage
 */
function fetchSession() {
  const hasSessionStorage = 'sessionStorage' in WINDOW;

  if (!hasSessionStorage) {
    return null;
  }

  try {
    // This can throw if cookies are disabled
    const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);

    if (!sessionStringFromStorage) {
      return null;
    }

    const sessionObj = JSON.parse(sessionStringFromStorage) ;

    return makeSession(sessionObj);
  } catch (e) {
    return null;
  }
}

/**
 * Get or create a session
 */
function getSession({
  timeouts,
  currentSession,
  stickySession,
  sessionSampleRate,
  errorSampleRate,
}) {
  // If session exists and is passed, use it instead of always hitting session storage
  const session = currentSession || (stickySession && fetchSession());

  if (session) {
    // If there is a session, check if it is valid (e.g. "last activity" time
    // should be within the "session idle time", and "session started" time is
    // within "max session time").
    const isExpired = isSessionExpired(session, timeouts);

    if (!isExpired) {
      return { type: 'saved', session };
    } else if (session.sampled === 'error') {
      // Error samples should not be re-created when expired, but instead we stop when the replay is done
      const discardedSession = makeSession({ sampled: false });
      return { type: 'new', session: discardedSession };
    } else {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Session has expired');
    }
    // Otherwise continue to create a new session
  }

  const newSession = createSession({
    stickySession,
    sessionSampleRate,
    errorSampleRate,
  });

  return { type: 'new', session: newSession };
}

/**
 * Add an event to the event buffer.
 * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
 */
async function addEvent(
  replay,
  event,
  isCheckout,
) {
  if (!replay.eventBuffer) {
    // This implies that `_isEnabled` is false
    return null;
  }

  if (replay.isPaused()) {
    // Do not add to event buffer when recording is paused
    return null;
  }

  // TODO: sadness -- we will want to normalize timestamps to be in ms -
  // requires coordination with frontend
  const isMs = event.timestamp > 9999999999;
  const timestampInMs = isMs ? event.timestamp : event.timestamp * 1000;

  // Throw out events that happen more than 5 minutes ago. This can happen if
  // page has been left open and idle for a long period of time and user
  // comes back to trigger a new session. The performance entries rely on
  // `performance.timeOrigin`, which is when the page first opened.
  if (timestampInMs + replay.timeouts.sessionIdle < Date.now()) {
    return null;
  }

  // Only record earliest event if a new session was created, otherwise it
  // shouldn't be relevant
  const earliestEvent = replay.getContext().earliestEvent;
  if (replay.session && replay.session.segmentId === 0 && (!earliestEvent || timestampInMs < earliestEvent)) {
    replay.getContext().earliestEvent = timestampInMs;
  }

  try {
    return await replay.eventBuffer.addEvent(event, isCheckout);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(error);
    replay.stop('addEvent');

    const client = getCurrentHub().getClient();

    if (client) {
      client.recordDroppedEvent('internal_sdk_error', 'replay');
    }
  }
}

/** If the event is an error event */
function isErrorEvent(event) {
  return !event.type;
}

/** If the event is a transaction event */
function isTransactionEvent(event) {
  return event.type === 'transaction';
}

/** If the event is an replay event */
function isReplayEvent(event) {
  return event.type === 'replay_event';
}

/**
 * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
 */
function handleAfterSendEvent(replay) {
  // Custom transports may still be returning `Promise<void>`, which means we cannot expect the status code to be available there
  // TODO (v8): remove this check as it will no longer be necessary
  const enforceStatusCode = isBaseTransportSend();

  return (event, sendResponse) => {
    if (!isErrorEvent(event) && !isTransactionEvent(event)) {
      return;
    }

    const statusCode = sendResponse && sendResponse.statusCode;

    // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached
    // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)
    // If we do use the base transport, we skip if we encountered an non-OK status code
    if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {
      return;
    }

    // Collect traceIds in _context regardless of `recordingMode`
    // In error mode, _context gets cleared on every checkout
    if (isTransactionEvent(event) && event.contexts && event.contexts.trace && event.contexts.trace.trace_id) {
      replay.getContext().traceIds.add(event.contexts.trace.trace_id );
      return;
    }

    // Everything below is just for error events
    if (!isErrorEvent(event)) {
      return;
    }

    // Add error to list of errorIds of replay
    if (event.event_id) {
      replay.getContext().errorIds.add(event.event_id);
    }

    // Trigger error recording
    // Need to be very careful that this does not cause an infinite loop
    if (
      replay.recordingMode === 'error' &&
      event.exception &&
      event.message !== UNABLE_TO_SEND_REPLAY // ignore this error because otherwise we could loop indefinitely with trying to capture replay and failing
    ) {
      setTimeout(async () => {
        // Allow flush to complete before resuming as a session recording, otherwise
        // the checkout from `startRecording` may be included in the payload.
        // Prefer to keep the error replay as a separate (and smaller) segment
        // than the session replay.
        await replay.flushImmediate();

        if (replay.stopRecording()) {
          // Reset all "capture on error" configuration before
          // starting a new recording
          replay.recordingMode = 'session';
          replay.startRecording();
        }
      });
    }
  };
}

function isBaseTransportSend() {
  const client = getCurrentHub().getClient();
  if (!client) {
    return false;
  }

  const transport = client.getTransport();
  if (!transport) {
    return false;
  }

  return (
    (transport.send ).__sentry__baseTransport__ || false
  );
}

var NodeType;
(function (NodeType) {
    NodeType[NodeType["Document"] = 0] = "Document";
    NodeType[NodeType["DocumentType"] = 1] = "DocumentType";
    NodeType[NodeType["Element"] = 2] = "Element";
    NodeType[NodeType["Text"] = 3] = "Text";
    NodeType[NodeType["CDATA"] = 4] = "CDATA";
    NodeType[NodeType["Comment"] = 5] = "Comment";
})(NodeType || (NodeType = {}));

/**
 * Create a breadcrumb for a replay.
 */
function createBreadcrumb(
  breadcrumb,
) {
  return {
    timestamp: Date.now() / 1000,
    type: 'default',
    ...breadcrumb,
  };
}

/**
 * Add a breadcrumb event to replay.
 */
function addBreadcrumbEvent(replay, breadcrumb) {
  if (breadcrumb.category === 'sentry.transaction') {
    return;
  }

  if (['ui.click', 'ui.input'].includes(breadcrumb.category )) {
    replay.triggerUserActivity();
  } else {
    replay.checkAndHandleExpiredSession();
  }

  replay.addUpdate(() => {
    void addEvent(replay, {
      type: EventType.Custom,
      // TODO: We were converting from ms to seconds for breadcrumbs, spans,
      // but maybe we should just keep them as milliseconds
      timestamp: (breadcrumb.timestamp || 0) * 1000,
      data: {
        tag: 'breadcrumb',
        payload: normalize(breadcrumb),
      },
    });

    // Do not flush after console log messages
    return breadcrumb.category === 'console';
  });
}

// Note that these are the serialized attributes and not attributes directly on
// the DOM Node. Attributes we are interested in:
const ATTRIBUTES_TO_RECORD = new Set([
  'id',
  'class',
  'aria-label',
  'role',
  'name',
  'alt',
  'title',
  'data-test-id',
  'data-testid',
]);

/**
 * Inclusion list of attributes that we want to record from the DOM element
 */
function getAttributesToRecord(attributes) {
  const obj = {};
  for (const key in attributes) {
    if (ATTRIBUTES_TO_RECORD.has(key)) {
      let normalizedKey = key;

      if (key === 'data-testid' || key === 'data-test-id') {
        normalizedKey = 'testId';
      }

      obj[normalizedKey] = attributes[key];
    }
  }

  return obj;
}

const handleDomListener =
  (replay) =>
  (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleDom(handlerData);

    if (!result) {
      return;
    }

    addBreadcrumbEvent(replay, result);
  };

/**
 * An event handler to react to DOM events.
 */
function handleDom(handlerData) {
  let target;
  let targetNode;

  // Accessing event.target can throw (see getsentry/raven-js#838, #768)
  try {
    targetNode = getTargetNode(handlerData);
    target = htmlTreeAsString(targetNode);
  } catch (e) {
    target = '<unknown>';
  }

  // `__sn` property is the serialized node created by rrweb
  const serializedNode =
    targetNode && '__sn' in targetNode && targetNode.__sn.type === NodeType.Element ? targetNode.__sn : null;

  return createBreadcrumb({
    category: `ui.${handlerData.name}`,
    message: target,
    data: serializedNode
      ? {
          nodeId: serializedNode.id,
          node: {
            id: serializedNode.id,
            tagName: serializedNode.tagName,
            textContent: targetNode
              ? Array.from(targetNode.childNodes)
                  .map(
                    (node) => '__sn' in node && node.__sn.type === NodeType.Text && node.__sn.textContent,
                  )
                  .filter(Boolean) // filter out empty values
                  .map(text => (text ).trim())
                  .join('')
              : '',
            attributes: getAttributesToRecord(serializedNode.attributes),
          },
        }
      : {},
  });
}

function getTargetNode(handlerData) {
  if (isEventWithTarget(handlerData.event)) {
    return handlerData.event.target;
  }

  return handlerData.event;
}

function isEventWithTarget(event) {
  return !!(event ).target;
}

/**
 * Returns true if we think the given event is an error originating inside of rrweb.
 */
function isRrwebError(event, hint) {
  if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {
    return false;
  }

  // @ts-ignore this may be set by rrweb when it finds errors
  if (hint.originalException && hint.originalException.__rrweb__) {
    return true;
  }

  // Check if any exception originates from rrweb
  return event.exception.values.some(exception => {
    if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {
      return false;
    }

    return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));
  });
}

/**
 * Returns a listener to be added to `addGlobalEventProcessor(listener)`.
 */
function handleGlobalEventListener(
  replay,
  includeAfterSendEventHandling = false,
) {
  const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;

  return (event, hint) => {
    if (isReplayEvent(event)) {
      // Replays have separate set of breadcrumbs, do not include breadcrumbs
      // from core SDK
      delete event.breadcrumbs;
      return event;
    }

    // We only want to handle errors & transactions, nothing else
    if (!isErrorEvent(event) && !isTransactionEvent(event)) {
      return event;
    }

    // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb
    // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users
    if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Ignoring error from rrweb internals', event);
      return null;
    }

    // Only tag transactions with replayId if not waiting for an error
    if (isErrorEvent(event) || (isTransactionEvent(event) && replay.recordingMode === 'session')) {
      event.tags = { ...event.tags, replayId: replay.getSessionId() };
    }

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals && isErrorEvent(event)) {
      const exc = getEventExceptionValues(event);
      addInternalBreadcrumb({
        message: `Tagging event (${event.event_id}) - ${event.message} - ${exc.type}: ${exc.value}`,
      });
    }

    // In cases where a custom client is used that does not support the new hooks (yet),
    // we manually call this hook method here
    if (afterSendHandler) {
      // Pretend the error had a 200 response so we always capture it
      afterSendHandler(event, { statusCode: 200 });
    }

    return event;
  };
}

function addInternalBreadcrumb(arg) {
  const { category, level, message, ...rest } = arg;

  addBreadcrumb({
    category: category || 'console',
    level: level || 'debug',
    message: `[debug]: ${message}`,
    ...rest,
  });
}

function getEventExceptionValues(event) {
  return {
    type: 'Unknown',
    value: 'n/a',
    ...(event.exception && event.exception.values && event.exception.values[0]),
  };
}

/**
 * Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
 */
function createPerformanceSpans(
  replay,
  entries,
) {
  return entries.map(({ type, start, end, name, data }) =>
    addEvent(replay, {
      type: EventType.Custom,
      timestamp: start,
      data: {
        tag: 'performanceSpan',
        payload: {
          op: type,
          description: name,
          startTimestamp: start,
          endTimestamp: end,
          data,
        },
      },
    }),
  );
}

function handleHistory(handlerData) {
  const { from, to } = handlerData;

  const now = Date.now() / 1000;

  return {
    type: 'navigation.push',
    start: now,
    end: now,
    name: to,
    data: {
      previous: from,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.
 */
function handleHistorySpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleHistory(handlerData);

    if (result === null) {
      return;
    }

    // Need to collect visited URLs
    replay.getContext().urls.push(result.name);
    replay.triggerUserActivity();

    replay.addUpdate(() => {
      createPerformanceSpans(replay, [result]);
      // Returning false to flush
      return false;
    });
  };
}

/**
 * Check whether a given request URL should be filtered out. This is so we
 * don't log Sentry ingest requests.
 */
function shouldFilterRequest(replay, url) {
  // If we enabled the `traceInternals` experiment, we want to trace everything
  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && replay.getOptions()._experiments.traceInternals) {
    return false;
  }

  return _isSentryRequest(url);
}

/**
 * Checks wether a given URL belongs to the configured Sentry DSN.
 */
function _isSentryRequest(url) {
  const client = getCurrentHub().getClient();
  const dsn = client && client.getDsn();
  return dsn ? url.includes(dsn.host) : false;
}

/** Add a performance entry breadcrumb */
function addNetworkBreadcrumb(
  replay,
  result,
) {
  if (!replay.isEnabled()) {
    return;
  }

  if (result === null) {
    return;
  }

  if (shouldFilterRequest(replay, result.name)) {
    return;
  }

  replay.addUpdate(() => {
    createPerformanceSpans(replay, [result]);
    // Returning true will cause `addUpdate` to not flush
    // We do not want network requests to cause a flush. This will prevent
    // recurring/polling requests from keeping the replay session alive.
    return true;
  });
}

/** only exported for tests */
function handleFetch(handlerData) {
  const { startTimestamp, endTimestamp, fetchData, response } = handlerData;

  if (!endTimestamp) {
    return null;
  }

  // This is only used as a fallback, so we know the body sizes are never set here
  const { method, url } = fetchData;

  return {
    type: 'resource.fetch',
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    name: url,
    data: {
      method,
      statusCode: response && (response ).status,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.
 */
function handleFetchSpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleFetch(handlerData);

    addNetworkBreadcrumb(replay, result);
  };
}

/** only exported for tests */
function handleXhr(handlerData) {
  const { startTimestamp, endTimestamp, xhr } = handlerData;

  const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];

  if (!startTimestamp || !endTimestamp || !sentryXhrData) {
    return null;
  }

  // This is only used as a fallback, so we know the body sizes are never set here
  const { method, url, status_code: statusCode } = sentryXhrData;

  if (url === undefined) {
    return null;
  }

  return {
    type: 'resource.xhr',
    name: url,
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    data: {
      method,
      statusCode,
    },
  };
}

/**
 * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.
 */
function handleXhrSpanListener(replay) {
  return (handlerData) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleXhr(handlerData);

    addNetworkBreadcrumb(replay, result);
  };
}

/** Get the size of a body. */
function getBodySize(
  body,
  textEncoder,
) {
  if (!body) {
    return undefined;
  }

  try {
    if (typeof body === 'string') {
      return textEncoder.encode(body).length;
    }

    if (body instanceof URLSearchParams) {
      return textEncoder.encode(body.toString()).length;
    }

    if (body instanceof FormData) {
      const formDataStr = _serializeFormData(body);
      return textEncoder.encode(formDataStr).length;
    }

    if (body instanceof Blob) {
      return body.size;
    }

    if (body instanceof ArrayBuffer) {
      return body.byteLength;
    }

    // Currently unhandled types: ArrayBufferView, ReadableStream
  } catch (e) {
    // just return undefined
  }

  return undefined;
}

/** Convert a Content-Length header to number/undefined.  */
function parseContentLengthHeader(header) {
  if (!header) {
    return undefined;
  }

  const size = parseInt(header, 10);
  return isNaN(size) ? undefined : size;
}

/** Get the string representation of a body. */
function getBodyString(body) {
  if (typeof body === 'string') {
    return body;
  }

  if (body instanceof URLSearchParams) {
    return body.toString();
  }

  if (body instanceof FormData) {
    return _serializeFormData(body);
  }

  return undefined;
}

/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
function makeNetworkReplayBreadcrumb(
  type,
  data,
) {
  if (!data) {
    return null;
  }

  const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;

  const result = {
    type,
    start: startTimestamp / 1000,
    end: endTimestamp / 1000,
    name: url,
    data: dropUndefinedKeys({
      method,
      statusCode,
      request,
      response,
    }),
  };

  return result;
}

/** Get either a JSON network body, or a text representation. */
function getNetworkBody(bodyText) {
  if (!bodyText) {
    return;
  }

  try {
    return JSON.parse(bodyText);
  } catch (e2) {
    // return text
  }

  return bodyText;
}

/** Build the request or response part of a replay network breadcrumb. */
function buildNetworkRequestOrResponse(
  headers,
  bodySize,
  body,
) {
  if (!bodySize && Object.keys(headers).length === 0) {
    return undefined;
  }

  if (!bodySize) {
    return {
      headers,
    };
  }

  if (!body) {
    return {
      headers,
      size: bodySize,
    };
  }

  const info = {
    headers,
    size: bodySize,
  };

  if (bodySize < NETWORK_BODY_MAX_SIZE) {
    info.body = body;
  } else {
    info._meta = {
      errors: ['MAX_BODY_SIZE_EXCEEDED'],
    };
  }

  return info;
}

/** Filter a set of headers */
function getAllowedHeaders(headers, allowedHeaders) {
  return Object.keys(headers).reduce((filteredHeaders, key) => {
    const normalizedKey = key.toLowerCase();
    // Avoid putting empty strings into the headers
    if (allowedHeaders.includes(normalizedKey) && headers[key]) {
      filteredHeaders[normalizedKey] = headers[key];
    }
    return filteredHeaders;
  }, {});
}

function _serializeFormData(formData) {
  // This is a bit simplified, but gives us a decent estimate
  // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'
  // @ts-ignore passing FormData to URLSearchParams actually works
  return new URLSearchParams(formData).toString();
}

/**
 * Capture a fetch breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
async function captureFetchBreadcrumbToReplay(
  breadcrumb,
  hint,
  options

,
) {
  try {
    const data = await _prepareFetchData(breadcrumb, hint, options);

    // Create a replay performance entry from this breadcrumb
    const result = makeNetworkReplayBreadcrumb('resource.fetch', data);
    addNetworkBreadcrumb(options.replay, result);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Failed to capture fetch breadcrumb', error);
  }
}

/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
function enrichFetchBreadcrumb(
  breadcrumb,
  hint,
  options,
) {
  const { input, response } = hint;

  const body = _getFetchRequestArgBody(input);
  const reqSize = getBodySize(body, options.textEncoder);

  const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;

  if (reqSize !== undefined) {
    breadcrumb.data.request_body_size = reqSize;
  }
  if (resSize !== undefined) {
    breadcrumb.data.response_body_size = resSize;
  }
}

async function _prepareFetchData(
  breadcrumb,
  hint,
  options

,
) {
  const { startTimestamp, endTimestamp } = hint;

  const {
    url,
    method,
    status_code: statusCode,
    request_body_size: requestBodySize,
    response_body_size: responseBodySize,
  } = breadcrumb.data;

  const request = _getRequestInfo(options, hint.input, requestBodySize);
  const response = await _getResponseInfo(options, hint.response, responseBodySize);

  return {
    startTimestamp,
    endTimestamp,
    url,
    method,
    statusCode: statusCode || 0,
    request,
    response,
  };
}

function _getRequestInfo(
  { captureBodies, requestHeaders },
  input,
  requestBodySize,
) {
  const headers = getRequestHeaders(input, requestHeaders);

  if (!captureBodies) {
    return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);
  }

  // We only want to transmit string or string-like bodies
  const requestBody = _getFetchRequestArgBody(input);
  const body = getNetworkBody(getBodyString(requestBody));
  return buildNetworkRequestOrResponse(headers, requestBodySize, body);
}

async function _getResponseInfo(
  {
    captureBodies,
    textEncoder,
    responseHeaders,
  }

,
  response,
  responseBodySize,
) {
  const headers = getAllHeaders(response.headers, responseHeaders);

  if (!captureBodies && responseBodySize !== undefined) {
    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);
  }

  // Only clone the response if we need to
  try {
    // We have to clone this, as the body can only be read once
    const res = response.clone();
    const { body, bodyText } = await _parseFetchBody(res);

    const size =
      bodyText && bodyText.length && responseBodySize === undefined
        ? getBodySize(bodyText, textEncoder)
        : responseBodySize;

    if (captureBodies) {
      return buildNetworkRequestOrResponse(headers, size, body);
    }

    return buildNetworkRequestOrResponse(headers, size, undefined);
  } catch (e) {
    // fallback
    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);
  }
}

async function _parseFetchBody(
  response,
) {
  let bodyText;

  try {
    bodyText = await response.text();
  } catch (e2) {
    return {};
  }

  try {
    const body = JSON.parse(bodyText);
    return { body, bodyText };
  } catch (e3) {
    // just send bodyText
  }

  return { bodyText, body: bodyText };
}

function _getFetchRequestArgBody(fetchArgs = []) {
  // We only support getting the body from the fetch options
  if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {
    return undefined;
  }

  return (fetchArgs[1] ).body;
}

function getAllHeaders(headers, allowedHeaders) {
  const allHeaders = {};

  allowedHeaders.forEach(header => {
    if (headers.get(header)) {
      allHeaders[header] = headers.get(header) ;
    }
  });

  return allHeaders;
}

function getRequestHeaders(fetchArgs, allowedHeaders) {
  if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {
    return getHeadersFromOptions(fetchArgs[0] , allowedHeaders);
  }

  if (fetchArgs.length === 2) {
    return getHeadersFromOptions(fetchArgs[1] , allowedHeaders);
  }

  return {};
}

function getHeadersFromOptions(
  input,
  allowedHeaders,
) {
  if (!input) {
    return {};
  }

  const headers = input.headers;

  if (!headers) {
    return {};
  }

  if (headers instanceof Headers) {
    return getAllHeaders(headers, allowedHeaders);
  }

  // We do not support this, as it is not really documented (anymore?)
  if (Array.isArray(headers)) {
    return {};
  }

  return getAllowedHeaders(headers, allowedHeaders);
}

/**
 * Capture an XHR breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
async function captureXhrBreadcrumbToReplay(
  breadcrumb,
  hint,
  options,
) {
  try {
    const data = _prepareXhrData(breadcrumb, hint, options);

    // Create a replay performance entry from this breadcrumb
    const result = makeNetworkReplayBreadcrumb('resource.xhr', data);
    addNetworkBreadcrumb(options.replay, result);
  } catch (error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Failed to capture fetch breadcrumb', error);
  }
}

/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
function enrichXhrBreadcrumb(
  breadcrumb,
  hint,
  options,
) {
  const { xhr, input } = hint;

  const reqSize = getBodySize(input, options.textEncoder);
  const resSize = xhr.getResponseHeader('content-length')
    ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))
    : getBodySize(xhr.response, options.textEncoder);

  if (reqSize !== undefined) {
    breadcrumb.data.request_body_size = reqSize;
  }
  if (resSize !== undefined) {
    breadcrumb.data.response_body_size = resSize;
  }
}

function _prepareXhrData(
  breadcrumb,
  hint,
  options,
) {
  const { startTimestamp, endTimestamp, input, xhr } = hint;

  const {
    url,
    method,
    status_code: statusCode,
    request_body_size: requestBodySize,
    response_body_size: responseBodySize,
  } = breadcrumb.data;

  const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];
  const requestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options.requestHeaders) : {};
  const responseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.responseHeaders);

  if (!url) {
    return null;
  }

  const request = buildNetworkRequestOrResponse(
    requestHeaders,
    requestBodySize,
    options.captureBodies ? getNetworkBody(getBodyString(input)) : undefined,
  );
  const response = buildNetworkRequestOrResponse(
    responseHeaders,
    responseBodySize,
    options.captureBodies ? getNetworkBody(hint.xhr.responseText) : undefined,
  );

  return {
    startTimestamp,
    endTimestamp,
    url,
    method,
    statusCode: statusCode || 0,
    request,
    response,
  };
}

function getResponseHeaders(xhr) {
  const headers = xhr.getAllResponseHeaders();

  if (!headers) {
    return {};
  }

  return headers.split('\r\n').reduce((acc, line) => {
    const [key, value] = line.split(': ');
    acc[key.toLowerCase()] = value;
    return acc;
  }, {});
}

/**
 * This method does two things:
 * - It enriches the regular XHR/fetch breadcrumbs with request/response size data
 * - It captures the XHR/fetch breadcrumbs to the replay
 *   (enriching it with further data that is _not_ added to the regular breadcrumbs)
 */
function handleNetworkBreadcrumbs(replay) {
  const client = getCurrentHub().getClient();

  try {
    const textEncoder = new TextEncoder();

    const options = {
      replay,
      textEncoder,
      ...replay.getExperimentalOptions().network,
    };

    if (client && client.on) {
      client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));
    } else {
      // Fallback behavior
      addInstrumentationHandler('fetch', handleFetchSpanListener(replay));
      addInstrumentationHandler('xhr', handleXhrSpanListener(replay));
    }
  } catch (e2) {
    // Do nothing
  }
}

/** just exported for tests */
function beforeAddNetworkBreadcrumb(
  options,
  breadcrumb,
  hint,
) {
  if (!breadcrumb.data) {
    return;
  }

  try {
    if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {
      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick
      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on
      // So any async mutations to it will not be reflected in the final breadcrumb
      enrichXhrBreadcrumb(breadcrumb, hint, options);

      void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);
    }

    if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {
      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick
      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on
      // So any async mutations to it will not be reflected in the final breadcrumb
      enrichFetchBreadcrumb(breadcrumb, hint, options);

      void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);
    }
  } catch (e) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('Error when enriching network breadcrumb');
  }
}

function _isXhrBreadcrumb(breadcrumb) {
  return breadcrumb.category === 'xhr';
}

function _isFetchBreadcrumb(breadcrumb) {
  return breadcrumb.category === 'fetch';
}

function _isXhrHint(hint) {
  return hint && hint.xhr;
}

function _isFetchHint(hint) {
  return hint && hint.response;
}

let _LAST_BREADCRUMB = null;

const handleScopeListener =
  (replay) =>
  (scope) => {
    if (!replay.isEnabled()) {
      return;
    }

    const result = handleScope(scope);

    if (!result) {
      return;
    }

    addBreadcrumbEvent(replay, result);
  };

/**
 * An event handler to handle scope changes.
 */
function handleScope(scope) {
  // TODO (v8): Remove this guard. This was put in place because we introduced
  // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.
  // For now, we'll just return null if the method doesn't exist but we should eventually
  // get rid of this guard.
  const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();

  // Listener can be called when breadcrumbs have not changed, so we store the
  // reference to the last crumb and only return a crumb if it has changed
  if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {
    return null;
  }

  _LAST_BREADCRUMB = newBreadcrumb;

  if (
    newBreadcrumb.category &&
    (['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||
      newBreadcrumb.category.startsWith('ui.'))
  ) {
    return null;
  }

  return createBreadcrumb(newBreadcrumb);
}

/**
 * Add global listeners that cannot be removed.
 */
function addGlobalListeners(replay) {
  // Listeners from core SDK //
  const scope = getCurrentHub().getScope();
  const client = getCurrentHub().getClient();

  if (scope) {
    scope.addScopeListener(handleScopeListener(replay));
  }
  addInstrumentationHandler('dom', handleDomListener(replay));
  addInstrumentationHandler('history', handleHistorySpanListener(replay));
  handleNetworkBreadcrumbs(replay);

  // Tag all (non replay) events that get sent to Sentry with the current
  // replay ID so that we can reference them later in the UI
  addGlobalEventProcessor(handleGlobalEventListener(replay, !hasHooks(client)));

  // If a custom client has no hooks yet, we continue to use the "old" implementation
  if (hasHooks(client)) {
    client.on('afterSendEvent', handleAfterSendEvent(replay));
    client.on('createDsc', (dsc) => {
      const replayId = replay.getSessionId();
      if (replayId) {
        dsc.replay_id = replayId;
      }
    });
  }
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function hasHooks(client) {
  return !!(client && client.on);
}

/**
 * Create a "span" for the total amount of memory being used by JS objects
 * (including v8 internal objects).
 */
async function addMemoryEntry(replay) {
  // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this
  try {
    return Promise.all(
      createPerformanceSpans(replay, [
        // @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)
        createMemoryEntry(WINDOW.performance.memory),
      ]),
    );
  } catch (error) {
    // Do nothing
    return [];
  }
}

function createMemoryEntry(memoryEntry) {
  const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;
  // we don't want to use `getAbsoluteTime` because it adds the event time to the
  // time origin, so we get the current timestamp instead
  const time = Date.now() / 1000;
  return {
    type: 'memory',
    name: 'memory',
    start: time,
    end: time,
    data: {
      memory: {
        jsHeapSizeLimit,
        totalJSHeapSize,
        usedJSHeapSize,
      },
    },
  };
}

// Map entryType -> function to normalize data for event
// @ts-ignore TODO: entry type does not fit the create* functions entry type
const ENTRY_TYPES

 = {
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  resource: createResourceEntry,
  paint: createPaintEntry,
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  navigation: createNavigationEntry,
  // @ts-ignore TODO: entry type does not fit the create* functions entry type
  ['largest-contentful-paint']: createLargestContentfulPaint,
};

/**
 * Create replay performance entries from the browser performance entries.
 */
function createPerformanceEntries(
  entries,
) {
  return entries.map(createPerformanceEntry).filter(Boolean) ;
}

function createPerformanceEntry(entry) {
  if (ENTRY_TYPES[entry.entryType] === undefined) {
    return null;
  }

  return ENTRY_TYPES[entry.entryType](entry);
}

function getAbsoluteTime(time) {
  // browserPerformanceTimeOrigin can be undefined if `performance` or
  // `performance.now` doesn't exist, but this is already checked by this integration
  return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;
}

function createPaintEntry(entry) {
  const { duration, entryType, name, startTime } = entry;

  const start = getAbsoluteTime(startTime);
  return {
    type: entryType,
    name,
    start,
    end: start + duration,
    data: undefined,
  };
}

function createNavigationEntry(entry) {
  const {
    entryType,
    name,
    decodedBodySize,
    duration,
    domComplete,
    encodedBodySize,
    domContentLoadedEventStart,
    domContentLoadedEventEnd,
    domInteractive,
    loadEventStart,
    loadEventEnd,
    redirectCount,
    startTime,
    transferSize,
    type,
  } = entry;

  // Ignore entries with no duration, they do not seem to be useful and cause dupes
  if (duration === 0) {
    return null;
  }

  return {
    type: `${entryType}.${type}`,
    start: getAbsoluteTime(startTime),
    end: getAbsoluteTime(domComplete),
    name,
    data: {
      size: transferSize,
      decodedBodySize,
      encodedBodySize,
      duration,
      domInteractive,
      domContentLoadedEventStart,
      domContentLoadedEventEnd,
      loadEventStart,
      loadEventEnd,
      domComplete,
      redirectCount,
    },
  };
}

function createResourceEntry(
  entry,
) {
  const {
    entryType,
    initiatorType,
    name,
    responseEnd,
    startTime,
    decodedBodySize,
    encodedBodySize,
    responseStatus,
    transferSize,
  } = entry;

  // Core SDK handles these
  if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {
    return null;
  }

  return {
    type: `${entryType}.${initiatorType}`,
    start: getAbsoluteTime(startTime),
    end: getAbsoluteTime(responseEnd),
    name,
    data: {
      size: transferSize,
      statusCode: responseStatus,
      decodedBodySize,
      encodedBodySize,
    },
  };
}

function createLargestContentfulPaint(
  entry,
) {
  const { entryType, startTime, size } = entry;

  let startTimeOrNavigationActivation = 0;

  if (WINDOW.performance) {
    const navEntry = WINDOW.performance.getEntriesByType('navigation')[0]

;

    // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21
    startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0;
  }

  // value is in ms
  const value = Math.max(startTime - startTimeOrNavigationActivation, 0);
  // LCP doesn't have a "duration", it just happens at a single point in time.
  // But the UI expects both, so use end (in seconds) for both timestamps.
  const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000;

  return {
    type: entryType,
    name: entryType,
    start: end,
    end,
    data: {
      value, // LCP "duration" in ms
      size,
      // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      nodeId: record.mirror.getId(entry.element ),
    },
  };
}

/**
 * Heavily simplified debounce function based on lodash.debounce.
 *
 * This function takes a callback function (@param fun) and delays its invocation
 * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
 * which ensures that the callback is invoked at least once after the specified max. wait time.
 *
 * @param func the function whose invocation is to be debounced
 * @param wait the minimum time until the function is invoked after it was called once
 * @param options the options object, which can contain the `maxWait` property
 *
 * @returns the debounced version of the function, which needs to be called at least once to start the
 *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
 *          was already invoked in the meantime, return @param func's return value.
 *          The debounced function has two additional properties:
 *          - `flush`: Invokes the debounced function immediately and returns its return value
 *          - `cancel`: Cancels the debouncing process and resets the debouncing timer
 */
function debounce(func, wait, options) {
  let callbackReturnValue;

  let timerId;
  let maxTimerId;

  const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;

  function invokeFunc() {
    cancelTimers();
    callbackReturnValue = func();
    return callbackReturnValue;
  }

  function cancelTimers() {
    timerId !== undefined && clearTimeout(timerId);
    maxTimerId !== undefined && clearTimeout(maxTimerId);
    timerId = maxTimerId = undefined;
  }

  function flush() {
    if (timerId !== undefined || maxTimerId !== undefined) {
      return invokeFunc();
    }
    return callbackReturnValue;
  }

  function debounced() {
    if (timerId) {
      clearTimeout(timerId);
    }
    timerId = setTimeout(invokeFunc, wait);

    if (maxWait && maxTimerId === undefined) {
      maxTimerId = setTimeout(invokeFunc, maxWait);
    }

    return callbackReturnValue;
  }

  debounced.cancel = cancelTimers;
  debounced.flush = flush;
  return debounced;
}

/**
 * Handler for recording events.
 *
 * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
 */
function getHandleRecordingEmit(replay) {
  let hadFirstEvent = false;

  return (event, _isCheckout) => {
    // If this is false, it means session is expired, create and a new session and wait for checkout
    if (!replay.checkAndHandleExpiredSession()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('[Replay] Received replay event after session expired.');

      return;
    }

    // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`
    // We also want to treat the first event as a checkout, so we handle this specifically here
    const isCheckout = _isCheckout || !hadFirstEvent;
    hadFirstEvent = true;

    // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.
    replay.addUpdate(() => {
      // The session is always started immediately on pageload/init, but for
      // error-only replays, it should reflect the most recent checkout
      // when an error occurs. Clear any state that happens before this current
      // checkout. This needs to happen before `addEvent()` which updates state
      // dependent on this reset.
      if (replay.recordingMode === 'error' && isCheckout) {
        replay.setInitialState();
      }

      // We need to clear existing events on a checkout, otherwise they are
      // incremental event updates and should be appended
      void addEvent(replay, event, isCheckout);

      // Different behavior for full snapshots (type=2), ignore other event types
      // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16
      if (!isCheckout) {
        return false;
      }

      // If there is a previousSessionId after a full snapshot occurs, then
      // the replay session was started due to session expiration. The new session
      // is started before triggering a new checkout and contains the id
      // of the previous session. Do not immediately flush in this case
      // to avoid capturing only the checkout and instead the replay will
      // be captured if they perform any follow-up actions.
      if (replay.session && replay.session.previousSessionId) {
        return true;
      }

      // See note above re: session start needs to reflect the most recent
      // checkout.
      if (replay.recordingMode === 'error' && replay.session) {
        const { earliestEvent } = replay.getContext();
        if (earliestEvent) {
          replay.session.started = earliestEvent;

          if (replay.getOptions().stickySession) {
            saveSession(replay.session);
          }
        }
      }

      // Flush immediately so that we do not miss the first segment, otherwise
      // it can prevent loading on the UI. This will cause an increase in short
      // replays (e.g. opening and closing a tab quickly), but these can be
      // filtered on the UI.
      if (replay.recordingMode === 'session') {
        // We want to ensure the worker is ready, as otherwise we'd always send the first event uncompressed
        void replay.flushImmediate();
      }

      return true;
    });
  };
}

/**
 * Create a replay envelope ready to be sent.
 * This includes both the replay event, as well as the recording data.
 */
function createReplayEnvelope(
  replayEvent,
  recordingData,
  dsn,
  tunnel,
) {
  return createEnvelope(
    createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),
    [
      [{ type: 'replay_event' }, replayEvent],
      [
        {
          type: 'replay_recording',
          // If string then we need to encode to UTF8, otherwise will have
          // wrong size. TextEncoder has similar browser support to
          // MutationObserver, although it does not accept IE11.
          length:
            typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,
        },
        recordingData,
      ],
    ],
  );
}

/**
 * Prepare the recording data ready to be sent.
 */
function prepareRecordingData({
  recordingData,
  headers,
}

) {
  let payloadWithSequence;

  // XXX: newline is needed to separate sequence id from events
  const replayHeaders = `${JSON.stringify(headers)}
`;

  if (typeof recordingData === 'string') {
    payloadWithSequence = `${replayHeaders}${recordingData}`;
  } else {
    const enc = new TextEncoder();
    // XXX: newline is needed to separate sequence id from events
    const sequence = enc.encode(replayHeaders);
    // Merge the two Uint8Arrays
    payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);
    payloadWithSequence.set(sequence);
    payloadWithSequence.set(recordingData, sequence.length);
  }

  return payloadWithSequence;
}

/**
 * Prepare a replay event & enrich it with the SDK metadata.
 */
async function prepareReplayEvent({
  client,
  scope,
  replayId: event_id,
  event,
}

) {
  const integrations =
    typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)
      ? Object.keys(client._integrations)
      : undefined;
  const preparedEvent = (await prepareEvent(
    client.getOptions(),
    event,
    { event_id, integrations },
    scope,
  )) ;

  // If e.g. a global event processor returned null
  if (!preparedEvent) {
    return null;
  }

  // This normally happens in browser client "_prepareEvent"
  // but since we do not use this private method from the client, but rather the plain import
  // we need to do this manually.
  preparedEvent.platform = preparedEvent.platform || 'javascript';

  // extract the SDK name because `client._prepareEvent` doesn't add it to the event
  const metadata = client.getSdkMetadata && client.getSdkMetadata();
  const { name, version } = (metadata && metadata.sdk) || {};

  preparedEvent.sdk = {
    ...preparedEvent.sdk,
    name: name || 'sentry.javascript.unknown',
    version: version || '0.0.0',
  };

  return preparedEvent;
}

/**
 * Send replay attachment using `fetch()`
 */
async function sendReplayRequest({
  recordingData,
  replayId,
  segmentId: segment_id,
  eventContext,
  timestamp,
  session,
  options,
}) {
  const preparedRecordingData = prepareRecordingData({
    recordingData,
    headers: {
      segment_id,
    },
  });

  const { urls, errorIds, traceIds, initialTimestamp } = eventContext;

  const hub = getCurrentHub();
  const client = hub.getClient();
  const scope = hub.getScope();
  const transport = client && client.getTransport();
  const dsn = client && client.getDsn();

  if (!client || !scope || !transport || !dsn || !session.sampled) {
    return;
  }

  const baseEvent = {
    type: REPLAY_EVENT_NAME,
    replay_start_timestamp: initialTimestamp / 1000,
    timestamp: timestamp / 1000,
    error_ids: errorIds,
    trace_ids: traceIds,
    urls,
    replay_id: replayId,
    segment_id,
    replay_type: session.sampled,
  };

  const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });

  if (!replayEvent) {
    // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions
    client.recordDroppedEvent('event_processor', 'replay', baseEvent);
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('An event processor returned `null`, will not send event.');
    return;
  }

  replayEvent.contexts = {
    ...replayEvent.contexts,
    replay: {
      ...(replayEvent.contexts && replayEvent.contexts.replay),
      session_sample_rate: options.sessionSampleRate,
      error_sample_rate: options.errorSampleRate,
    },
  };

  /*
  For reference, the fully built event looks something like this:
  {
      "type": "replay_event",
      "timestamp": 1670837008.634,
      "error_ids": [
          "errorId"
      ],
      "trace_ids": [
          "traceId"
      ],
      "urls": [
          "https://example.com"
      ],
      "replay_id": "eventId",
      "segment_id": 3,
      "replay_type": "error",
      "platform": "javascript",
      "event_id": "eventId",
      "environment": "production",
      "sdk": {
          "integrations": [
              "BrowserTracing",
              "Replay"
          ],
          "name": "sentry.javascript.browser",
          "version": "7.25.0"
      },
      "sdkProcessingMetadata": {},
      "contexts": {
        "replay": {
          "session_sample_rate": 1,
          "error_sample_rate": 0,
        },
      },
  }
  */

  const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);

  let response;

  try {
    response = await transport.send(envelope);
  } catch (err) {
    const error = new Error(UNABLE_TO_SEND_REPLAY);

    try {
      // In case browsers don't allow this property to be writable
      // @ts-ignore This needs lib es2022 and newer
      error.cause = err;
    } catch (e) {
      // nothing to do
    }
    throw error;
  }

  // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore
  if (!response) {
    return response;
  }

  // If the status code is invalid, we want to immediately stop & not retry
  if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {
    throw new TransportStatusCodeError(response.statusCode);
  }

  return response;
}

/**
 * This error indicates that the transport returned an invalid status code.
 */
class TransportStatusCodeError extends Error {
   constructor(statusCode) {
    super(`Transport returned status code ${statusCode}`);
  }
}

/**
 * Finalize and send the current replay event to Sentry
 */
async function sendReplay(
  replayData,
  retryConfig = {
    count: 0,
    interval: RETRY_BASE_INTERVAL,
  },
) {
  const { recordingData, options } = replayData;

  // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)
  if (!recordingData.length) {
    return;
  }

  try {
    await sendReplayRequest(replayData);
    return true;
  } catch (err) {
    if (err instanceof TransportStatusCodeError) {
      throw err;
    }

    // Capture error for every failed replay
    setContext('Replays', {
      _retryCount: retryConfig.count,
    });

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && options._experiments && options._experiments.captureExceptions) {
      captureException(err);
    }

    // If an error happened here, it's likely that uploading the attachment
    // failed, we'll can retry with the same events payload
    if (retryConfig.count >= RETRY_MAX_COUNT) {
      const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);

      try {
        // In case browsers don't allow this property to be writable
        // @ts-ignore This needs lib es2022 and newer
        error.cause = err;
      } catch (e) {
        // nothing to do
      }

      throw error;
    }

    // will retry in intervals of 5, 10, 30
    retryConfig.interval *= ++retryConfig.count;

    return await new Promise((resolve, reject) => {
      setTimeout(async () => {
        try {
          await sendReplay(replayData, retryConfig);
          resolve(true);
        } catch (err) {
          reject(err);
        }
      }, retryConfig.interval);
    });
  }
}

/* eslint-disable max-lines */ // TODO: We might want to split this file up

/**
 * The main replay container class, which holds all the state and methods for recording and sending replays.
 */
class ReplayContainer  {
   __init() {this.eventBuffer = null;}

  /**
   * List of PerformanceEntry from PerformanceObserver
   */
   __init2() {this.performanceEvents = [];}

  /**
   * Recording can happen in one of two modes:
   * * session: Record the whole session, sending it continuously
   * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately
   */
   __init3() {this.recordingMode = 'session';}

  /**
   * These are here so we can overwrite them in tests etc.
   * @hidden
   */
    __init4() {this.timeouts = {
    sessionIdle: SESSION_IDLE_DURATION,
    maxSessionLife: MAX_SESSION_LIFE,
  }; }

  /**
   * Options to pass to `rrweb.record()`
   */

   __init5() {this._performanceObserver = null;}

   __init6() {this._flushLock = null;}

  /**
   * Timestamp of the last user activity. This lives across sessions.
   */
   __init7() {this._lastActivity = Date.now();}

  /**
   * Is the integration currently active?
   */
   __init8() {this._isEnabled = false;}

  /**
   * Paused is a state where:
   * - DOM Recording is not listening at all
   * - Nothing will be added to event buffer (e.g. core SDK events)
   */
   __init9() {this._isPaused = false;}

  /**
   * Have we attached listeners to the core SDK?
   * Note we have to track this as there is no way to remove instrumentation handlers.
   */
   __init10() {this._hasInitializedCoreListeners = false;}

  /**
   * Function to stop recording
   */
   __init11() {this._stopRecording = null;}

   __init12() {this._context = {
    errorIds: new Set(),
    traceIds: new Set(),
    urls: [],
    earliestEvent: null,
    initialTimestamp: Date.now(),
    initialUrl: '',
  };}

   constructor({
    options,
    recordingOptions,
  }

) {ReplayContainer.prototype.__init.call(this);ReplayContainer.prototype.__init2.call(this);ReplayContainer.prototype.__init3.call(this);ReplayContainer.prototype.__init4.call(this);ReplayContainer.prototype.__init5.call(this);ReplayContainer.prototype.__init6.call(this);ReplayContainer.prototype.__init7.call(this);ReplayContainer.prototype.__init8.call(this);ReplayContainer.prototype.__init9.call(this);ReplayContainer.prototype.__init10.call(this);ReplayContainer.prototype.__init11.call(this);ReplayContainer.prototype.__init12.call(this);ReplayContainer.prototype.__init13.call(this);ReplayContainer.prototype.__init14.call(this);ReplayContainer.prototype.__init15.call(this);ReplayContainer.prototype.__init16.call(this);ReplayContainer.prototype.__init17.call(this);
    this._recordingOptions = recordingOptions;
    this._options = options;

    this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {
      maxWait: this._options.flushMaxDelay,
    });

    this._experimentalOptions = _getExperimentalOptions(options);
  }

  /** Get the event context. */
   getContext() {
    return this._context;
  }

  /** If recording is currently enabled. */
   isEnabled() {
    return this._isEnabled;
  }

  /** If recording is currently paused. */
   isPaused() {
    return this._isPaused;
  }

  /** Get the replay integration options. */
   getOptions() {
    return this._options;
  }

  /**
   * Get the experimental options.
   * THIS IS INTERNAL AND SUBJECT TO CHANGE!
   * @hidden
   */
   getExperimentalOptions() {
    return this._experimentalOptions;
  }

  /**
   * Initializes the plugin.
   *
   * Creates or loads a session, attaches listeners to varying events (DOM,
   * _performanceObserver, Recording, Sentry SDK, etc)
   */
   start() {
    this.setInitialState();

    if (!this._loadAndCheckSession()) {
      return;
    }

    // If there is no session, then something bad has happened - can't continue
    if (!this.session) {
      this._handleException(new Error('No session found'));
      return;
    }

    if (!this.session.sampled) {
      // If session was not sampled, then we do not initialize the integration at all.
      return;
    }

    // If session is sampled for errors, then we need to set the recordingMode
    // to 'error', which will configure recording with different options.
    if (this.session.sampled === 'error') {
      this.recordingMode = 'error';
    }

    // setup() is generally called on page load or manually - in both cases we
    // should treat it as an activity
    this._updateSessionActivity();

    this.eventBuffer = createEventBuffer({
      useCompression: this._options.useCompression,
    });

    this._addListeners();

    // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout
    this._isEnabled = true;

    this.startRecording();
  }

  /**
   * Start recording.
   *
   * Note that this will cause a new DOM checkout
   */
   startRecording() {
    try {
      this._stopRecording = record({
        ...this._recordingOptions,
        // When running in error sampling mode, we need to overwrite `checkoutEveryNms`
        // Without this, it would record forever, until an error happens, which we don't want
        // instead, we'll always keep the last 60 seconds of replay before an error happened
        ...(this.recordingMode === 'error' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),
        emit: getHandleRecordingEmit(this),
        onMutation: this._onMutationHandler,
      });
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Stops the recording, if it was running.
   * Returns true if it was stopped, else false.
   */
   stopRecording() {
    try {
      if (this._stopRecording) {
        this._stopRecording();
        this._stopRecording = undefined;
        return true;
      }

      return false;
    } catch (err) {
      this._handleException(err);
      return false;
    }
  }

  /**
   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
   * does not support a teardown
   */
   stop(reason) {
    if (!this._isEnabled) {
      return;
    }

    try {
      if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
        const msg = `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`;

        // When `traceInternals` is enabled, we want to log this to the console
        // Else, use the regular debug output
        // eslint-disable-next-line
        const log = this.getOptions()._experiments.traceInternals ? console.warn : logger.log;
        log(msg);
      }

      this._isEnabled = false;
      this._removeListeners();
      this.stopRecording();
      this.eventBuffer && this.eventBuffer.destroy();
      this.eventBuffer = null;
      this._debouncedFlush.cancel();
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Pause some replay functionality. See comments for `_isPaused`.
   * This differs from stop as this only stops DOM recording, it is
   * not as thorough of a shutdown as `stop()`.
   */
   pause() {
    this._isPaused = true;
    this.stopRecording();
  }

  /**
   * Resumes recording, see notes for `pause().
   *
   * Note that calling `startRecording()` here will cause a
   * new DOM checkout.`
   */
   resume() {
    if (!this._loadAndCheckSession()) {
      return;
    }

    this._isPaused = false;
    this.startRecording();
  }

  /**
   * We want to batch uploads of replay events. Save events only if
   * `<flushMinDelay>` milliseconds have elapsed since the last event
   * *OR* if `<flushMaxDelay>` milliseconds have elapsed.
   *
   * Accepts a callback to perform side-effects and returns true to stop batch
   * processing and hand back control to caller.
   */
   addUpdate(cb) {
    // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'error'`)
    const cbResult = cb();

    // If this option is turned on then we will only want to call `flush`
    // explicitly
    if (this.recordingMode === 'error') {
      return;
    }

    // If callback is true, we do not want to continue with flushing -- the
    // caller will need to handle it.
    if (cbResult === true) {
      return;
    }

    // addUpdate is called quite frequently - use _debouncedFlush so that it
    // respects the flush delays and does not flush immediately
    this._debouncedFlush();
  }

  /**
   * Updates the user activity timestamp and resumes recording. This should be
   * called in an event handler for a user action that we consider as the user
   * being "active" (e.g. a mouse click).
   */
   triggerUserActivity() {
    this._updateUserActivity();

    // This case means that recording was once stopped due to inactivity.
    // Ensure that recording is resumed.
    if (!this._stopRecording) {
      // Create a new session, otherwise when the user action is flushed, it
      // will get rejected due to an expired session.
      if (!this._loadAndCheckSession()) {
        return;
      }

      // Note: This will cause a new DOM checkout
      this.resume();
      return;
    }

    // Otherwise... recording was never suspended, continue as normalish
    this.checkAndHandleExpiredSession();

    this._updateSessionActivity();
  }

  /**
   *
   * Always flush via `_debouncedFlush` so that we do not have flushes triggered
   * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
   * cases of mulitple flushes happening closely together.
   */
   flushImmediate() {
    this._debouncedFlush();
    // `.flush` is provided by the debounced function, analogously to lodash.debounce
    return this._debouncedFlush.flush() ;
  }

  /** Get the current sesion (=replay) ID */
   getSessionId() {
    return this.session && this.session.id;
  }

  /**
   * Checks if recording should be stopped due to user inactivity. Otherwise
   * check if session is expired and create a new session if so. Triggers a new
   * full snapshot on new session.
   *
   * Returns true if session is not expired, false otherwise.
   * @hidden
   */
   checkAndHandleExpiredSession() {
    const oldSessionId = this.getSessionId();

    // Prevent starting a new session if the last user activity is older than
    // SESSION_IDLE_DURATION. Otherwise non-user activity can trigger a new
    // session+recording. This creates noisy replays that do not have much
    // content in them.
    if (
      this._lastActivity &&
      isExpired(this._lastActivity, this.timeouts.sessionIdle) &&
      this.session &&
      this.session.sampled === 'session'
    ) {
      // Pause recording only for session-based replays. Otherwise, resuming
      // will create a new replay and will conflict with users who only choose
      // to record error-based replays only. (e.g. the resumed replay will not
      // contain a reference to an error)
      this.pause();
      return;
    }

    // --- There is recent user activity --- //
    // This will create a new session if expired, based on expiry length
    if (!this._loadAndCheckSession()) {
      return;
    }

    // Session was expired if session ids do not match
    const expired = oldSessionId !== this.getSessionId();

    if (!expired) {
      return true;
    }

    // Session is expired, trigger a full snapshot (which will create a new session)
    this._triggerFullSnapshot();

    return false;
  }

  /**
   * Capture some initial state that can change throughout the lifespan of the
   * replay. This is required because otherwise they would be captured at the
   * first flush.
   */
   setInitialState() {
    const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;
    const url = `${WINDOW.location.origin}${urlPath}`;

    this.performanceEvents = [];

    // Reset _context as well
    this._clearContext();

    this._context.initialUrl = url;
    this._context.initialTimestamp = Date.now();
    this._context.urls.push(url);
  }

  /** A wrapper to conditionally capture exceptions. */
   _handleException(error) {
    (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay]', error);

    if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && this._options._experiments && this._options._experiments.captureExceptions) {
      captureException(error);
    }
  }

  /**
   * Loads (or refreshes) the current session.
   * Returns false if session is not recorded.
   */
   _loadAndCheckSession() {
    const { type, session } = getSession({
      timeouts: this.timeouts,
      stickySession: Boolean(this._options.stickySession),
      currentSession: this.session,
      sessionSampleRate: this._options.sessionSampleRate,
      errorSampleRate: this._options.errorSampleRate,
    });

    // If session was newly created (i.e. was not loaded from storage), then
    // enable flag to create the root replay
    if (type === 'new') {
      this.setInitialState();
    }

    const currentSessionId = this.getSessionId();
    if (session.id !== currentSessionId) {
      session.previousSessionId = currentSessionId;
    }

    this.session = session;

    if (!this.session.sampled) {
      this.stop('session unsampled');
      return false;
    }

    return true;
  }

  /**
   * Adds listeners to record events for the replay
   */
   _addListeners() {
    try {
      WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);
      WINDOW.addEventListener('blur', this._handleWindowBlur);
      WINDOW.addEventListener('focus', this._handleWindowFocus);

      // There is no way to remove these listeners, so ensure they are only added once
      if (!this._hasInitializedCoreListeners) {
        addGlobalListeners(this);

        this._hasInitializedCoreListeners = true;
      }
    } catch (err) {
      this._handleException(err);
    }

    // PerformanceObserver //
    if (!('PerformanceObserver' in WINDOW)) {
      return;
    }

    this._performanceObserver = setupPerformanceObserver(this);
  }

  /**
   * Cleans up listeners that were created in `_addListeners`
   */
   _removeListeners() {
    try {
      WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);

      WINDOW.removeEventListener('blur', this._handleWindowBlur);
      WINDOW.removeEventListener('focus', this._handleWindowFocus);

      if (this._performanceObserver) {
        this._performanceObserver.disconnect();
        this._performanceObserver = null;
      }
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Handle when visibility of the page content changes. Opening a new tab will
   * cause the state to change to hidden because of content of current page will
   * be hidden. Likewise, moving a different window to cover the contents of the
   * page will also trigger a change to a hidden state.
   */
   __init13() {this._handleVisibilityChange = () => {
    if (WINDOW.document.visibilityState === 'visible') {
      this._doChangeToForegroundTasks();
    } else {
      this._doChangeToBackgroundTasks();
    }
  };}

  /**
   * Handle when page is blurred
   */
   __init14() {this._handleWindowBlur = () => {
    const breadcrumb = createBreadcrumb({
      category: 'ui.blur',
    });

    // Do not count blur as a user action -- it's part of the process of them
    // leaving the page
    this._doChangeToBackgroundTasks(breadcrumb);
  };}

  /**
   * Handle when page is focused
   */
   __init15() {this._handleWindowFocus = () => {
    const breadcrumb = createBreadcrumb({
      category: 'ui.focus',
    });

    // Do not count focus as a user action -- instead wait until they focus and
    // interactive with page
    this._doChangeToForegroundTasks(breadcrumb);
  };}

  /**
   * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
   */
   _doChangeToBackgroundTasks(breadcrumb) {
    if (!this.session) {
      return;
    }

    const expired = isSessionExpired(this.session, this.timeouts);

    if (breadcrumb && !expired) {
      this._createCustomBreadcrumb(breadcrumb);
    }

    // Send replay when the page/tab becomes hidden. There is no reason to send
    // replay if it becomes visible, since no actions we care about were done
    // while it was hidden
    this._conditionalFlush();
  }

  /**
   * Tasks to run when we consider a page to be visible (via focus and/or visibility)
   */
   _doChangeToForegroundTasks(breadcrumb) {
    if (!this.session) {
      return;
    }

    const isSessionActive = this.checkAndHandleExpiredSession();

    if (!isSessionActive) {
      // If the user has come back to the page within SESSION_IDLE_DURATION
      // ms, we will re-use the existing session, otherwise create a new
      // session
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Document has become active, but session has expired');
      return;
    }

    if (breadcrumb) {
      this._createCustomBreadcrumb(breadcrumb);
    }
  }

  /**
   * Trigger rrweb to take a full snapshot which will cause this plugin to
   * create a new Replay event.
   */
   _triggerFullSnapshot(checkout = true) {
    try {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.log('[Replay] Taking full rrweb snapshot');
      record.takeFullSnapshot(checkout);
    } catch (err) {
      this._handleException(err);
    }
  }

  /**
   * Update user activity (across session lifespans)
   */
   _updateUserActivity(_lastActivity = Date.now()) {
    this._lastActivity = _lastActivity;
  }

  /**
   * Updates the session's last activity timestamp
   */
   _updateSessionActivity(_lastActivity = Date.now()) {
    if (this.session) {
      this.session.lastActivity = _lastActivity;
      this._maybeSaveSession();
    }
  }

  /**
   * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
   */
   _createCustomBreadcrumb(breadcrumb) {
    this.addUpdate(() => {
      void addEvent(this, {
        type: EventType.Custom,
        timestamp: breadcrumb.timestamp || 0,
        data: {
          tag: 'breadcrumb',
          payload: breadcrumb,
        },
      });
    });
  }

  /**
   * Observed performance events are added to `this.performanceEvents`. These
   * are included in the replay event before it is finished and sent to Sentry.
   */
   _addPerformanceEntries() {
    // Copy and reset entries before processing
    const entries = [...this.performanceEvents];
    this.performanceEvents = [];

    return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));
  }

  /**
   * Only flush if `this.recordingMode === 'session'`
   */
   _conditionalFlush() {
    if (this.recordingMode === 'error') {
      return;
    }

    void this.flushImmediate();
  }

  /**
   * Clear _context
   */
   _clearContext() {
    // XXX: `initialTimestamp` and `initialUrl` do not get cleared
    this._context.errorIds.clear();
    this._context.traceIds.clear();
    this._context.urls = [];
    this._context.earliestEvent = null;
  }

  /**
   * Return and clear _context
   */
   _popEventContext() {
    if (this._context.earliestEvent && this._context.earliestEvent < this._context.initialTimestamp) {
      this._context.initialTimestamp = this._context.earliestEvent;
    }

    const _context = {
      initialTimestamp: this._context.initialTimestamp,
      initialUrl: this._context.initialUrl,
      errorIds: Array.from(this._context.errorIds).filter(Boolean),
      traceIds: Array.from(this._context.traceIds).filter(Boolean),
      urls: this._context.urls,
    };

    this._clearContext();

    return _context;
  }

  /**
   * Flushes replay event buffer to Sentry.
   *
   * Performance events are only added right before flushing - this is
   * due to the buffered performance observer events.
   *
   * Should never be called directly, only by `flush`
   */
   async _runFlush() {
    if (!this.session || !this.eventBuffer) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] No session or eventBuffer found to flush.');
      return;
    }

    await this._addPerformanceEntries();

    // Check eventBuffer again, as it could have been stopped in the meanwhile
    if (!this.eventBuffer || !this.eventBuffer.hasEvents) {
      return;
    }

    // Only attach memory event if eventBuffer is not empty
    await addMemoryEntry(this);

    // Check eventBuffer again, as it could have been stopped in the meanwhile
    if (!this.eventBuffer) {
      return;
    }

    try {
      // Note this empties the event buffer regardless of outcome of sending replay
      const recordingData = await this.eventBuffer.finish();

      // NOTE: Copy values from instance members, as it's possible they could
      // change before the flush finishes.
      const replayId = this.session.id;
      const eventContext = this._popEventContext();
      // Always increment segmentId regardless of outcome of sending replay
      const segmentId = this.session.segmentId++;
      this._maybeSaveSession();

      await sendReplay({
        replayId,
        recordingData,
        segmentId,
        eventContext,
        session: this.session,
        options: this.getOptions(),
        timestamp: Date.now(),
      });
    } catch (err) {
      this._handleException(err);

      // This means we retried 3 times and all of them failed,
      // or we ran into a problem we don't want to retry, like rate limiting.
      // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments
      this.stop('sendReplay');

      const client = getCurrentHub().getClient();

      if (client) {
        client.recordDroppedEvent('send_error', 'replay');
      }
    }
  }

  /**
   * Flush recording data to Sentry. Creates a lock so that only a single flush
   * can be active at a time. Do not call this directly.
   */
   __init16() {this._flush = async () => {
    if (!this._isEnabled) {
      // This can happen if e.g. the replay was stopped because of exceeding the retry limit
      return;
    }

    if (!this.checkAndHandleExpiredSession()) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] Attempting to finish replay event after session expired.');
      return;
    }

    if (!this.session) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error('[Replay] No session found to flush.');
      return;
    }

    // A flush is about to happen, cancel any queued flushes
    this._debouncedFlush.cancel();

    // this._flushLock acts as a lock so that future calls to `_flush()`
    // will be blocked until this promise resolves
    if (!this._flushLock) {
      this._flushLock = this._runFlush();
      await this._flushLock;
      this._flushLock = null;
      return;
    }

    // Wait for previous flush to finish, then call the debounced `_flush()`.
    // It's possible there are other flush requests queued and waiting for it
    // to resolve. We want to reduce all outstanding requests (as well as any
    // new flush requests that occur within a second of the locked flush
    // completing) into a single flush.

    try {
      await this._flushLock;
    } catch (err) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.error(err);
    } finally {
      this._debouncedFlush();
    }
  };}

  /** Save the session, if it is sticky */
   _maybeSaveSession() {
    if (this.session && this._options.stickySession) {
      saveSession(this.session);
    }
  }

  /** Handler for rrweb.record.onMutation */
   __init17() {this._onMutationHandler = (mutations) => {
    const count = mutations.length;

    const mutationLimit = this._options._experiments.mutationLimit || 0;
    const mutationBreadcrumbLimit = this._options._experiments.mutationBreadcrumbLimit || 1000;
    const overMutationLimit = mutationLimit && count > mutationLimit;

    // Create a breadcrumb if a lot of mutations happen at the same time
    // We can show this in the UI as an information with potential performance improvements
    if (count > mutationBreadcrumbLimit || overMutationLimit) {
      const breadcrumb = createBreadcrumb({
        category: 'replay.mutations',
        data: {
          count,
        },
      });
      this._createCustomBreadcrumb(breadcrumb);
    }

    if (overMutationLimit) {
      // We want to skip doing an incremental snapshot if there are too many mutations
      // Instead, we do a full snapshot
      this._triggerFullSnapshot(false);
      return false;
    }

    // `true` means we use the regular mutation handling by rrweb
    return true;
  };}
}

function _getExperimentalOptions(options) {
  const requestHeaders = options._experiments.captureRequestHeaders || [];
  const responseHeaders = options._experiments.captureResponseHeaders || [];
  const captureBodies = options._experiments.captureNetworkBodies || false;

  // Add defaults
  const defaultHeaders = ['content-length', 'content-type', 'accept'];

  return {
    network: {
      captureBodies,
      requestHeaders: [...defaultHeaders, ...requestHeaders.map(header => header.toLowerCase())],
      responseHeaders: [...defaultHeaders, ...responseHeaders.map(header => header.toLowerCase())],
    },
  };
}

function getOption(
  selectors,
  defaultSelectors,
  deprecatedClassOption,
  deprecatedSelectorOption,
) {
  const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];

  const allSelectors = [
    ...selectors,
    // @deprecated
    ...deprecatedSelectors,

    // sentry defaults
    ...defaultSelectors,
  ];

  // @deprecated
  if (typeof deprecatedClassOption !== 'undefined') {
    // NOTE: No support for RegExp
    if (typeof deprecatedClassOption === 'string') {
      allSelectors.push(`.${deprecatedClassOption}`);
    }

    // eslint-disable-next-line no-console
    console.warn(
      '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',
    );
  }

  return allSelectors.join(',');
}

/**
 * Returns privacy related configuration for use in rrweb
 */
function getPrivacyOptions({
  mask,
  unmask,
  block,
  unblock,
  ignore,

  // eslint-disable-next-line deprecation/deprecation
  blockClass,
  // eslint-disable-next-line deprecation/deprecation
  blockSelector,
  // eslint-disable-next-line deprecation/deprecation
  maskTextClass,
  // eslint-disable-next-line deprecation/deprecation
  maskTextSelector,
  // eslint-disable-next-line deprecation/deprecation
  ignoreClass,
}) {
  const defaultBlockedElements = ['base[href="/"]'];

  const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);
  const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);

  const options = {
    // We are making the decision to make text and input selectors the same
    maskTextSelector: maskSelector,
    unmaskTextSelector: unmaskSelector,
    maskInputSelector: maskSelector,
    unmaskInputSelector: unmaskSelector,

    blockSelector: getOption(
      block,
      ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],
      blockClass,
      blockSelector,
    ),
    unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),
    ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type="file"]'], ignoreClass),
  };

  if (blockClass instanceof RegExp) {
    options.blockClass = blockClass;
  }

  if (maskTextClass instanceof RegExp) {
    options.maskTextClass = maskTextClass;
  }

  return options;
}

/**
 * Returns true if we are in the browser.
 */
function isBrowser() {
  // eslint-disable-next-line no-restricted-globals
  return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());
}

// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them
function isElectronNodeRenderer() {
  return typeof process !== 'undefined' && (process ).type === 'renderer';
}

const MEDIA_SELECTORS =
  'img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]';

let _initialized = false;

/**
 * The main replay integration class, to be passed to `init({  integrations: [] })`.
 */
class Replay  {
  /**
   * @inheritDoc
   */
   static __initStatic() {this.id = 'Replay';}

  /**
   * @inheritDoc
   */
   __init() {this.name = Replay.id;}

  /**
   * Options to pass to `rrweb.record()`
   */

  /**
   * Initial options passed to the replay integration, merged with default values.
   * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
   * can only be finally set when setupOnce() is called.
   *
   * @private
   */

   constructor({
    flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,
    flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,
    stickySession = true,
    useCompression = true,
    _experiments = {},
    sessionSampleRate,
    errorSampleRate,
    maskAllText = true,
    maskAllInputs = true,
    blockAllMedia = true,

    mask = [],
    unmask = [],
    block = [],
    unblock = [],
    ignore = [],
    maskFn,

    // eslint-disable-next-line deprecation/deprecation
    blockClass,
    // eslint-disable-next-line deprecation/deprecation
    blockSelector,
    // eslint-disable-next-line deprecation/deprecation
    maskInputOptions,
    // eslint-disable-next-line deprecation/deprecation
    maskTextClass,
    // eslint-disable-next-line deprecation/deprecation
    maskTextSelector,
    // eslint-disable-next-line deprecation/deprecation
    ignoreClass,
  } = {}) {Replay.prototype.__init.call(this);
    this._recordingOptions = {
      maskAllInputs,
      maskAllText,
      maskInputOptions: { ...(maskInputOptions || {}), password: true },
      maskTextFn: maskFn,
      maskInputFn: maskFn,

      ...getPrivacyOptions({
        mask,
        unmask,
        block,
        unblock,
        ignore,
        blockClass,
        blockSelector,
        maskTextClass,
        maskTextSelector,
        ignoreClass,
      }),

      // Our defaults
      slimDOMOptions: 'all',
      inlineStylesheet: true,
      // Disable inline images as it will increase segment/replay size
      inlineImages: false,
      // collect fonts, but be aware that `sentry.io` needs to be an allowed
      // origin for playback
      collectFonts: true,
    };

    this._initialOptions = {
      flushMinDelay,
      flushMaxDelay,
      stickySession,
      sessionSampleRate,
      errorSampleRate,
      useCompression,
      blockAllMedia,
      _experiments,
    };

    if (typeof sessionSampleRate === 'number') {
      // eslint-disable-next-line
      console.warn(
        `[Replay] You are passing \`sessionSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysSessionSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,
      );

      this._initialOptions.sessionSampleRate = sessionSampleRate;
    }

    if (typeof errorSampleRate === 'number') {
      // eslint-disable-next-line
      console.warn(
        `[Replay] You are passing \`errorSampleRate\` to the Replay integration.
This option is deprecated and will be removed soon.
Instead, configure \`replaysOnErrorSampleRate\` directly in the SDK init options, e.g.:
Sentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,
      );

      this._initialOptions.errorSampleRate = errorSampleRate;
    }

    if (this._initialOptions.blockAllMedia) {
      // `blockAllMedia` is a more user friendly option to configure blocking
      // embedded media elements
      this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector
        ? MEDIA_SELECTORS
        : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;
    }

    if (this._isInitialized && isBrowser()) {
      throw new Error('Multiple Sentry Session Replay instances are not supported');
    }

    this._isInitialized = true;
  }

  /** If replay has already been initialized */
   get _isInitialized() {
    return _initialized;
  }

  /** Update _isInitialized */
   set _isInitialized(value) {
    _initialized = value;
  }

  /**
   * We previously used to create a transaction in `setupOnce` and it would
   * potentially create a transaction before some native SDK integrations have run
   * and applied their own global event processor. An example is:
   * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
   *
   * So we call `replay.setup` in next event loop as a workaround to wait for other
   * global event processors to finish. This is no longer needed, but keeping it
   * here to avoid any future issues.
   */
   setupOnce() {
    if (!isBrowser()) {
      return;
    }

    this._setup();

    // XXX: See method comments above
    setTimeout(() => this.start());
  }

  /**
   * Initializes the plugin.
   *
   * Creates or loads a session, attaches listeners to varying events (DOM,
   * PerformanceObserver, Recording, Sentry SDK, etc)
   */
   start() {
    if (!this._replay) {
      return;
    }

    this._replay.start();
  }

  /**
   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
   * does not support a teardown
   */
   stop() {
    if (!this._replay) {
      return;
    }

    this._replay.stop();
  }

  /**
   * Immediately send all pending events.
   */
   flush() {
    if (!this._replay || !this._replay.isEnabled()) {
      return;
    }

    return this._replay.flushImmediate();
  }

  /**
   * Get the current session ID.
   */
   getReplayId() {
    if (!this._replay || !this._replay.isEnabled()) {
      return;
    }

    return this._replay.getSessionId();
  }

  /** Setup the integration. */
   _setup() {
    // Client is not available in constructor, so we need to wait until setupOnce
    const finalOptions = loadReplayOptionsFromClient(this._initialOptions);

    this._replay = new ReplayContainer({
      options: finalOptions,
      recordingOptions: this._recordingOptions,
    });
  }
} Replay.__initStatic();

/** Parse Replay-related options from SDK options */
function loadReplayOptionsFromClient(initialOptions) {
  const client = getCurrentHub().getClient();
  const opt = client && (client.getOptions() );

  const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };

  if (!opt) {
    // eslint-disable-next-line no-console
    console.warn('SDK client is not available.');
    return finalOptions;
  }

  if (
    initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed
    initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed
    opt.replaysSessionSampleRate == null &&
    opt.replaysOnErrorSampleRate == null
  ) {
    // eslint-disable-next-line no-console
    console.warn(
      'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',
    );
  }

  if (typeof opt.replaysSessionSampleRate === 'number') {
    finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;
  }

  if (typeof opt.replaysOnErrorSampleRate === 'number') {
    finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;
  }

  return finalOptions;
}

export { Replay };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../../../src/constants.ts","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb-snapshot/es/rrweb-snapshot.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/types.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/utils.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/mutation.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/sentry/callbackWrapper.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observer.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/iframe-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/shadow-dom-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/tslib/tslib.es6.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/2d.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/serialize-args.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/webgl.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/observers/canvas/canvas-manager.js","../../../../../node_modules/@sentry-internal/rrweb/es/rrweb/packages/rrweb/src/record/index.js","../../../src/util/dedupePerformanceEntries.ts","../../../src/coreHandlers/performanceObserver.ts","../../../../replay-worker/build/npm/esm/worker.ts","../../../../replay-worker/build/npm/esm/index.js","../../../src/eventBuffer/EventBufferArray.ts","../../../src/eventBuffer/WorkerHandler.ts","../../../src/eventBuffer/EventBufferCompressionWorker.ts","../../../src/eventBuffer/EventBufferProxy.ts","../../../src/eventBuffer/index.ts","../../../src/util/isExpired.ts","../../../src/util/isSessionExpired.ts","../../../src/session/saveSession.ts","../../../src/util/isSampled.ts","../../../src/session/Session.ts","../../../src/session/createSession.ts","../../../src/session/fetchSession.ts","../../../src/session/getSession.ts","../../../src/util/addEvent.ts","../../../src/util/eventUtils.ts","../../../src/coreHandlers/handleAfterSendEvent.ts","../../../../../node_modules/@sentry-internal/rrweb-snapshot/es/rrweb-snapshot.js","../../../src/util/createBreadcrumb.ts","../../../src/coreHandlers/util/addBreadcrumbEvent.ts","../../../src/coreHandlers/util/getAttributesToRecord.ts","../../../src/coreHandlers/handleDom.ts","../../../src/util/isRrwebError.ts","../../../src/coreHandlers/handleGlobalEvent.ts","../../../src/util/createPerformanceSpans.ts","../../../src/coreHandlers/handleHistory.ts","../../../src/util/shouldFilterRequest.ts","../../../src/coreHandlers/util/addNetworkBreadcrumb.ts","../../../src/coreHandlers/handleFetch.ts","../../../src/coreHandlers/handleXhr.ts","../../../src/coreHandlers/util/networkUtils.ts","../../../src/coreHandlers/util/fetchUtils.ts","../../../src/coreHandlers/util/xhrUtils.ts","../../../src/coreHandlers/handleNetworkBreadcrumbs.ts","../../../src/coreHandlers/handleScope.ts","../../../src/util/addGlobalListeners.ts","../../../src/util/addMemoryEntry.ts","../../../src/util/createPerformanceEntries.ts","../../../src/util/debounce.ts","../../../src/util/handleRecordingEmit.ts","../../../src/util/createReplayEnvelope.ts","../../../src/util/prepareRecordingData.ts","../../../src/util/prepareReplayEvent.ts","../../../src/util/sendReplayRequest.ts","../../../src/util/sendReplay.ts","../../../src/replay.ts","../../../src/util/getPrivacyOptions.ts","../../../src/util/isBrowser.ts","../../../src/integration.ts"],"sourcesContent":["import { GLOBAL_OBJ } from '@sentry/utils';\n\n// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\nexport const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;\n\nexport const REPLAY_SESSION_KEY = 'sentryReplaySession';\nexport const REPLAY_EVENT_NAME = 'replay_event';\nexport const RECORDING_EVENT_NAME = 'replay_recording';\nexport const UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';\n\n// The idle limit for a session\nexport const SESSION_IDLE_DURATION = 300_000; // 5 minutes in ms\n\n// The maximum length of a session\nexport const MAX_SESSION_LIFE = 3_600_000; // 60 minutes\n\n/** Default flush delays */\nexport const DEFAULT_FLUSH_MIN_DELAY = 5_000;\n// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\nexport const DEFAULT_FLUSH_MAX_DELAY = 5_500;\n\n/* How long to wait for error checkouts */\nexport const ERROR_CHECKOUT_TIME = 60_000;\n\nexport const RETRY_BASE_INTERVAL = 5000;\nexport const RETRY_MAX_COUNT = 3;\n\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be dropped. */\nexport const NETWORK_BODY_MAX_SIZE = 300_000;\n","var NodeType;\n(function (NodeType) {\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\n    return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n    const host = n === null || n === void 0 ? void 0 : n.host;\n    return Boolean(host && host.shadowRoot && host.shadowRoot === n);\n}\nfunction isInputTypeMasked({ maskInputOptions, tagName, type, }) {\n    if (tagName.toLowerCase() === 'option') {\n        tagName = 'select';\n    }\n    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;\n    return (maskInputOptions[tagName.toLowerCase()] ||\n        (actualType && maskInputOptions[actualType]) ||\n        actualType === 'password' ||\n        (tagName === 'input' && !type && maskInputOptions['text']));\n}\nfunction hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {\n    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));\n}\nfunction maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {\n    let text = value || '';\n    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {\n        return text;\n    }\n    if (input.hasAttribute('rr_is_password')) {\n        type = 'password';\n    }\n    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||\n        (maskInputSelector && input.matches(maskInputSelector))) {\n        if (maskInputFn) {\n            text = maskInputFn(text);\n        }\n        else {\n            text = '*'.repeat(text.length);\n        }\n    }\n    return text;\n}\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\nfunction is2DCanvasBlank(canvas) {\n    const ctx = canvas.getContext('2d');\n    if (!ctx)\n        return true;\n    const chunkSize = 50;\n    for (let x = 0; x < canvas.width; x += chunkSize) {\n        for (let y = 0; y < canvas.height; y += chunkSize) {\n            const getImageData = ctx.getImageData;\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\n                : getImageData;\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n            if (pixelBuffer.some((pixel) => pixel !== 0))\n                return false;\n        }\n    }\n    return true;\n}\n\nlet _id = 1;\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\nconst IGNORED_NODE = -2;\nfunction defaultMaskFn(str) {\n    return str ? str.replace(/[\\S]/g, '*') : '';\n}\nfunction genId() {\n    return _id++;\n}\nfunction getValidTagName(element) {\n    if (element instanceof HTMLFormElement) {\n        return 'form';\n    }\n    const processedTagName = element.tagName.toLowerCase().trim();\n    if (tagNameRegex.test(processedTagName)) {\n        return 'div';\n    }\n    return processedTagName;\n}\nfunction getCssRulesString(s) {\n    try {\n        const rules = s.rules || s.cssRules;\n        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;\n    }\n    catch (error) {\n        return null;\n    }\n}\nfunction getCssRuleString(rule) {\n    let cssStringified = rule.cssText;\n    if (isCSSImportRule(rule)) {\n        try {\n            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;\n        }\n        catch (_a) {\n        }\n    }\n    return cssStringified;\n}\nfunction isCSSImportRule(rule) {\n    return 'styleSheet' in rule;\n}\nfunction stringifyStyleSheet(sheet) {\n    return sheet.cssRules\n        ? Array.from(sheet.cssRules)\n            .map((rule) => rule.cssText || '')\n            .join('')\n        : '';\n}\nfunction extractOrigin(url) {\n    let origin = '';\n    if (url.indexOf('//') > -1) {\n        origin = url.split('/').slice(0, 3).join('/');\n    }\n    else {\n        origin = url.split('/')[0];\n    }\n    origin = origin.split('?')[0];\n    return origin;\n}\nlet canvasService;\nlet canvasCtx;\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst RELATIVE_PATH = /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/|#).*/;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absoluteToStylesheet(cssText, href) {\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\n        const filePath = path1 || path2 || path3;\n        const maybeQuote = quote1 || quote2 || '';\n        if (!filePath) {\n            return origin;\n        }\n        if (!RELATIVE_PATH.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (DATA_URI.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (filePath[0] === '/') {\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n        }\n        const stack = href.split('/');\n        const parts = filePath.split('/');\n        stack.pop();\n        for (const part of parts) {\n            if (part === '.') {\n                continue;\n            }\n            else if (part === '..') {\n                stack.pop();\n            }\n            else {\n                stack.push(part);\n            }\n        }\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\n    });\n}\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n    if (attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    let pos = 0;\n    function collectCharacters(regEx) {\n        let chars;\n        let match = regEx.exec(attributeValue.substring(pos));\n        if (match) {\n            chars = match[0];\n            pos += chars.length;\n            return chars;\n        }\n        return '';\n    }\n    let output = [];\n    while (true) {\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\n        if (pos >= attributeValue.length) {\n            break;\n        }\n        let url = collectCharacters(SRCSET_NOT_SPACES);\n        if (url.slice(-1) === ',') {\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n            output.push(url);\n        }\n        else {\n            let descriptorsStr = '';\n            url = absoluteToDoc(doc, url);\n            let inParens = false;\n            while (true) {\n                let c = attributeValue.charAt(pos);\n                if (c === '') {\n                    output.push((url + descriptorsStr).trim());\n                    break;\n                }\n                else if (!inParens) {\n                    if (c === ',') {\n                        pos += 1;\n                        output.push((url + descriptorsStr).trim());\n                        break;\n                    }\n                    else if (c === '(') {\n                        inParens = true;\n                    }\n                }\n                else {\n                    if (c === ')') {\n                        inParens = false;\n                    }\n                }\n                descriptorsStr += c;\n                pos += 1;\n            }\n        }\n    }\n    return output.join(', ');\n}\nfunction absoluteToDoc(doc, attributeValue) {\n    if (!attributeValue || attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    const a = doc.createElement('a');\n    a.href = attributeValue;\n    return a.href;\n}\nfunction isSVGElement(el) {\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\nfunction getHref() {\n    const a = document.createElement('a');\n    a.href = '';\n    return a.href;\n}\nfunction transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {\n    if (!value) {\n        return value;\n    }\n    const name = _name.toLowerCase();\n    const tagName = _tagName.toLowerCase();\n    if (name === 'src' || name === 'href') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'xlink:href' && value[0] !== '#') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'background' &&\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'srcset') {\n        return getAbsoluteSrcsetString(doc, value);\n    }\n    else if (name === 'style') {\n        return absoluteToStylesheet(value, getHref());\n    }\n    else if (tagName === 'object' && name === 'data') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (maskAllText &&\n        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {\n        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);\n    }\n    return value;\n}\nfunction _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {\n    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {\n        return false;\n    }\n    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||\n        (tagName === 'input' &&\n            attribute === 'value' &&\n            element.hasAttribute('type') &&\n            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));\n}\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n    if (unblockSelector && element.matches(unblockSelector)) {\n        return false;\n    }\n    if (typeof blockClass === 'string') {\n        if (element.classList.contains(blockClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {\n            const className = element.classList[eIndex];\n            if (blockClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (blockSelector) {\n        return element.matches(blockSelector);\n    }\n    return false;\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType !== node.ELEMENT_NODE) {\n        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n    }\n    if (unmaskTextSelector) {\n        if (node.matches(unmaskTextSelector) ||\n            node.closest(unmaskTextSelector)) {\n            return false;\n        }\n    }\n    if (maskAllText) {\n        return true;\n    }\n    if (typeof maskTextClass === 'string') {\n        if (node.classList.contains(maskTextClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {\n            const className = node.classList[eIndex];\n            if (maskTextClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (maskTextSelector) {\n        if (node.matches(maskTextSelector)) {\n            return true;\n        }\n    }\n    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n    const win = iframeEl.contentWindow;\n    if (!win) {\n        return;\n    }\n    let fired = false;\n    let readyState;\n    try {\n        readyState = win.document.readyState;\n    }\n    catch (error) {\n        return;\n    }\n    if (readyState !== 'complete') {\n        const timer = setTimeout(() => {\n            if (!fired) {\n                listener();\n                fired = true;\n            }\n        }, iframeLoadTimeout);\n        iframeEl.addEventListener('load', () => {\n            clearTimeout(timer);\n            fired = true;\n            listener();\n        });\n        return;\n    }\n    const blankUrl = 'about:blank';\n    if (win.location.href !== blankUrl ||\n        iframeEl.src === blankUrl ||\n        iframeEl.src === '') {\n        setTimeout(listener, 0);\n        return;\n    }\n    iframeEl.addEventListener('load', listener);\n}\nfunction serializeNode(n, options) {\n    var _a;\n    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;\n    let rootId;\n    if (doc.__sn) {\n        const docId = doc.__sn.id;\n        rootId = docId === 1 ? undefined : docId;\n    }\n    switch (n.nodeType) {\n        case n.DOCUMENT_NODE:\n            if (n.compatMode !== 'CSS1Compat') {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    compatMode: n.compatMode,\n                    rootId,\n                };\n            }\n            else {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    rootId,\n                };\n            }\n        case n.DOCUMENT_TYPE_NODE:\n            return {\n                type: NodeType.DocumentType,\n                name: n.name,\n                publicId: n.publicId,\n                systemId: n.systemId,\n                rootId,\n            };\n        case n.ELEMENT_NODE:\n            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n            const tagName = getValidTagName(n);\n            let attributes = {};\n            for (const { name, value } of Array.from(n.attributes)) {\n                if (!skipAttribute(tagName, name)) {\n                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);\n                }\n            }\n            if (tagName === 'link' && inlineStylesheet) {\n                const stylesheet = Array.from(doc.styleSheets).find((s) => {\n                    return s.href === n.href;\n                });\n                let cssText = null;\n                if (stylesheet) {\n                    cssText = getCssRulesString(stylesheet);\n                }\n                if (cssText) {\n                    delete attributes.rel;\n                    delete attributes.href;\n                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n                }\n            }\n            if (tagName === 'style' &&\n                n.sheet &&\n                !(n.innerText ||\n                    n.textContent ||\n                    '').trim().length) {\n                const cssText = getCssRulesString(n.sheet);\n                if (cssText) {\n                    attributes._cssText = absoluteToStylesheet(cssText, getHref());\n                }\n            }\n            if (tagName === 'input' ||\n                tagName === 'textarea' ||\n                tagName === 'select' ||\n                tagName === 'option') {\n                const el = n;\n                const value = getInputValue(tagName, el, attributes);\n                const checked = n.checked;\n                if (attributes.type !== 'submit' &&\n                    attributes.type !== 'button' &&\n                    value) {\n                    attributes.value = maskInputValue({\n                        input: el,\n                        type: attributes.type,\n                        tagName,\n                        value,\n                        maskInputSelector,\n                        unmaskInputSelector,\n                        maskInputOptions,\n                        maskInputFn,\n                    });\n                }\n                if (checked) {\n                    attributes.checked = checked;\n                }\n            }\n            if (tagName === 'option') {\n                if (n.selected && !maskInputOptions['select']) {\n                    attributes.selected = true;\n                }\n                else {\n                    delete attributes.selected;\n                }\n            }\n            if (tagName === 'canvas' && recordCanvas) {\n                if (n.__context === '2d') {\n                    if (!is2DCanvasBlank(n)) {\n                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                }\n                else if (!('__context' in n)) {\n                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    const blankCanvas = document.createElement('canvas');\n                    blankCanvas.width = n.width;\n                    blankCanvas.height = n.height;\n                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    if (canvasDataURL !== blankCanvasDataURL) {\n                        attributes.rr_dataURL = canvasDataURL;\n                    }\n                }\n            }\n            if (tagName === 'img' && inlineImages) {\n                if (!canvasService) {\n                    canvasService = doc.createElement('canvas');\n                    canvasCtx = canvasService.getContext('2d');\n                }\n                const image = n;\n                const oldValue = image.crossOrigin;\n                image.crossOrigin = 'anonymous';\n                const recordInlineImage = () => {\n                    try {\n                        canvasService.width = image.naturalWidth;\n                        canvasService.height = image.naturalHeight;\n                        canvasCtx.drawImage(image, 0, 0);\n                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                    catch (err) {\n                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\n                    }\n                    oldValue\n                        ? (attributes.crossOrigin = oldValue)\n                        : delete attributes.crossOrigin;\n                };\n                if (image.complete && image.naturalWidth !== 0)\n                    recordInlineImage();\n                else\n                    image.onload = recordInlineImage;\n            }\n            if (tagName === 'audio' || tagName === 'video') {\n                attributes.rr_mediaState = n.paused\n                    ? 'paused'\n                    : 'played';\n                attributes.rr_mediaCurrentTime = n.currentTime;\n            }\n            if (n.scrollLeft) {\n                attributes.rr_scrollLeft = n.scrollLeft;\n            }\n            if (n.scrollTop) {\n                attributes.rr_scrollTop = n.scrollTop;\n            }\n            if (needBlock) {\n                const { width, height } = n.getBoundingClientRect();\n                attributes = {\n                    class: attributes.class,\n                    rr_width: `${width}px`,\n                    rr_height: `${height}px`,\n                };\n            }\n            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n                if (!n.contentDocument) {\n                    attributes.rr_src = attributes.src;\n                }\n                delete attributes.src;\n            }\n            return {\n                type: NodeType.Element,\n                tagName,\n                attributes,\n                childNodes: [],\n                isSVG: isSVGElement(n) || undefined,\n                needBlock,\n                rootId,\n            };\n        case n.TEXT_NODE:\n            const parentTagName = n.parentNode && n.parentNode.tagName;\n            let textContent = n.textContent;\n            const isStyle = parentTagName === 'STYLE' ? true : undefined;\n            const isScript = parentTagName === 'SCRIPT' ? true : undefined;\n            if (isStyle && textContent) {\n                try {\n                    if (n.nextSibling || n.previousSibling) {\n                    }\n                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\n                        textContent = stringifyStyleSheet(n.parentNode.sheet);\n                    }\n                }\n                catch (err) {\n                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\n                }\n                textContent = absoluteToStylesheet(textContent, getHref());\n            }\n            if (isScript) {\n                textContent = 'SCRIPT_PLACEHOLDER';\n            }\n            if (parentTagName === 'TEXTAREA' && textContent) {\n                textContent = '';\n            }\n            else if (parentTagName === 'OPTION' && textContent) {\n                const option = n.parentNode;\n                textContent = maskInputValue({\n                    input: option,\n                    type: null,\n                    tagName: parentTagName,\n                    value: textContent,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskInputOptions,\n                    maskInputFn,\n                });\n            }\n            else if (!isStyle &&\n                !isScript &&\n                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&\n                textContent) {\n                textContent = maskTextFn\n                    ? maskTextFn(textContent)\n                    : defaultMaskFn(textContent);\n            }\n            return {\n                type: NodeType.Text,\n                textContent: textContent || '',\n                isStyle,\n                rootId,\n            };\n        case n.CDATA_SECTION_NODE:\n            return {\n                type: NodeType.CDATA,\n                textContent: '',\n                rootId,\n            };\n        case n.COMMENT_NODE:\n            return {\n                type: NodeType.Comment,\n                textContent: n.textContent || '',\n                rootId,\n            };\n        default:\n            return false;\n    }\n}\nfunction lowerIfExists(maybeAttr) {\n    if (maybeAttr === undefined || maybeAttr === null) {\n        return '';\n    }\n    else {\n        return maybeAttr.toLowerCase();\n    }\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\n        return true;\n    }\n    else if (sn.type === NodeType.Element) {\n        if (slimDOMOptions.script &&\n            (sn.tagName === 'script' ||\n                (sn.tagName === 'link' &&\n                    (sn.attributes.rel === 'preload' ||\n                        sn.attributes.rel === 'modulepreload') &&\n                    sn.attributes.as === 'script') ||\n                (sn.tagName === 'link' &&\n                    sn.attributes.rel === 'prefetch' &&\n                    typeof sn.attributes.href === 'string' &&\n                    sn.attributes.href.endsWith('.js')))) {\n            return true;\n        }\n        else if (slimDOMOptions.headFavicon &&\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\n                (sn.tagName === 'meta' &&\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\n            return true;\n        }\n        else if (sn.tagName === 'meta') {\n            if (slimDOMOptions.headMetaDescKeywords &&\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaSocial &&\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaRobots &&\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaHttpEquiv &&\n                sn.attributes['http-equiv'] !== undefined) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaAuthorship &&\n                (lowerIfExists(sn.attributes.name) === 'author' ||\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaVerification &&\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction serializeNodeWithId(n, options) {\n    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;\n    let { preserveWhiteSpace = true } = options;\n    const _serializedNode = serializeNode(n, {\n        doc,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        maskTextClass,\n        maskTextSelector,\n        unmaskTextSelector,\n        inlineStylesheet,\n        maskInputSelector,\n        unmaskInputSelector,\n        maskAllText,\n        maskInputOptions,\n        maskTextFn,\n        maskInputFn,\n        dataURLOptions,\n        inlineImages,\n        recordCanvas,\n        keepIframeSrcFn,\n    });\n    if (!_serializedNode) {\n        console.warn(n, 'not serialized');\n        return null;\n    }\n    let id;\n    if ('__sn' in n) {\n        id = n.__sn.id;\n    }\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\n        (!preserveWhiteSpace &&\n            _serializedNode.type === NodeType.Text &&\n            !_serializedNode.isStyle &&\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\n        id = IGNORED_NODE;\n    }\n    else {\n        id = genId();\n    }\n    const serializedNode = Object.assign(_serializedNode, { id });\n    n.__sn = serializedNode;\n    if (id === IGNORED_NODE) {\n        return null;\n    }\n    map[id] = n;\n    if (onSerialize) {\n        onSerialize(n);\n    }\n    let recordChild = !skipChild;\n    if (serializedNode.type === NodeType.Element) {\n        recordChild = recordChild && !serializedNode.needBlock;\n        delete serializedNode.needBlock;\n        if (n.shadowRoot)\n            serializedNode.isShadowHost = true;\n    }\n    if ((serializedNode.type === NodeType.Document ||\n        serializedNode.type === NodeType.Element) &&\n        recordChild) {\n        if (slimDOMOptions.headWhitespace &&\n            _serializedNode.type === NodeType.Element &&\n            _serializedNode.tagName === 'head') {\n            preserveWhiteSpace = false;\n        }\n        const bypassOptions = {\n            doc,\n            map,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        };\n        for (const childN of Array.from(n.childNodes)) {\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n            if (serializedChildNode) {\n                serializedNode.childNodes.push(serializedChildNode);\n            }\n        }\n        if (isElement(n) && n.shadowRoot) {\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n                if (serializedChildNode) {\n                    serializedChildNode.isShadow = true;\n                    serializedNode.childNodes.push(serializedChildNode);\n                }\n            }\n        }\n    }\n    if (n.parentNode && isShadowRoot(n.parentNode)) {\n        serializedNode.isShadow = true;\n    }\n    if (serializedNode.type === NodeType.Element &&\n        serializedNode.tagName === 'iframe') {\n        onceIframeLoaded(n, () => {\n            const iframeDoc = n.contentDocument;\n            if (iframeDoc && onIframeLoad) {\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n                    doc: iframeDoc,\n                    map,\n                    blockClass,\n                    blockSelector,\n                    unblockSelector,\n                    maskTextClass,\n                    maskTextSelector,\n                    unmaskTextSelector,\n                    skipChild: false,\n                    inlineStylesheet,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskAllText,\n                    maskInputOptions,\n                    maskTextFn,\n                    maskInputFn,\n                    slimDOMOptions,\n                    dataURLOptions,\n                    inlineImages,\n                    recordCanvas,\n                    preserveWhiteSpace,\n                    onSerialize,\n                    onIframeLoad,\n                    iframeLoadTimeout,\n                    keepIframeSrcFn,\n                });\n                if (serializedIframeNode) {\n                    onIframeLoad(n, serializedIframeNode);\n                }\n            }\n        }, iframeLoadTimeout);\n    }\n    return serializedNode;\n}\nfunction snapshot(n, options) {\n    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\n    const idNodeMap = {};\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n        }\n        : maskAllInputs === false\n            ? {}\n            : maskAllInputs;\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\n        ?\n            {\n                script: true,\n                comment: true,\n                headFavicon: true,\n                headWhitespace: true,\n                headMetaDescKeywords: slimDOM === 'all',\n                headMetaSocial: true,\n                headMetaRobots: true,\n                headMetaHttpEquiv: true,\n                headMetaAuthorship: true,\n                headMetaVerification: true,\n            }\n        : slimDOM === false\n            ? {}\n            : slimDOM;\n    return [\n        serializeNodeWithId(n, {\n            doc: n,\n            map: idNodeMap,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        }),\n        idNodeMap,\n    ];\n}\nfunction skipAttribute(tagName, attributeName, value) {\n    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');\n}\nfunction getInputValue(tagName, el, attributes) {\n    if (tagName === 'input' &&\n        (attributes.type === 'radio' || attributes.type === 'checkbox')) {\n        return el.getAttribute('value') || '';\n    }\n    return el.value;\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\nfunction parse(css, options = {}) {\n    let lineno = 1;\n    let column = 1;\n    function updatePosition(str) {\n        const lines = str.match(/\\n/g);\n        if (lines) {\n            lineno += lines.length;\n        }\n        let i = str.lastIndexOf('\\n');\n        column = i === -1 ? column + str.length : str.length - i;\n    }\n    function position() {\n        const start = { line: lineno, column };\n        return (node) => {\n            node.position = new Position(start);\n            whitespace();\n            return node;\n        };\n    }\n    class Position {\n        constructor(start) {\n            this.start = start;\n            this.end = { line: lineno, column };\n            this.source = options.source;\n        }\n    }\n    Position.prototype.content = css;\n    const errorsList = [];\n    function error(msg) {\n        const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);\n        err.reason = msg;\n        err.filename = options.source;\n        err.line = lineno;\n        err.column = column;\n        err.source = css;\n        if (options.silent) {\n            errorsList.push(err);\n        }\n        else {\n            throw err;\n        }\n    }\n    function stylesheet() {\n        const rulesList = rules();\n        return {\n            type: 'stylesheet',\n            stylesheet: {\n                source: options.source,\n                rules: rulesList,\n                parsingErrors: errorsList,\n            },\n        };\n    }\n    function open() {\n        return match(/^{\\s*/);\n    }\n    function close() {\n        return match(/^}/);\n    }\n    function rules() {\n        let node;\n        const rules = [];\n        whitespace();\n        comments(rules);\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\n            if (node !== false) {\n                rules.push(node);\n                comments(rules);\n            }\n        }\n        return rules;\n    }\n    function match(re) {\n        const m = re.exec(css);\n        if (!m) {\n            return;\n        }\n        const str = m[0];\n        updatePosition(str);\n        css = css.slice(str.length);\n        return m;\n    }\n    function whitespace() {\n        match(/^\\s*/);\n    }\n    function comments(rules = []) {\n        let c;\n        while ((c = comment())) {\n            if (c !== false) {\n                rules.push(c);\n            }\n            c = comment();\n        }\n        return rules;\n    }\n    function comment() {\n        const pos = position();\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\n            return;\n        }\n        let i = 2;\n        while ('' !== css.charAt(i) &&\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\n            ++i;\n        }\n        i += 2;\n        if ('' === css.charAt(i - 1)) {\n            return error('End of comment missing');\n        }\n        const str = css.slice(2, i - 2);\n        column += 2;\n        updatePosition(str);\n        css = css.slice(i);\n        column += 2;\n        return pos({\n            type: 'comment',\n            comment: str,\n        });\n    }\n    function selector() {\n        const m = match(/^([^{]+)/);\n        if (!m) {\n            return;\n        }\n        return trim(m[0])\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\n            return m.replace(/,/g, '\\u200C');\n        })\n            .split(/\\s*(?![^(]*\\)),\\s*/)\n            .map((s) => {\n            return s.replace(/\\u200C/g, ',');\n        });\n    }\n    function declaration() {\n        const pos = position();\n        let propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\n        if (!propMatch) {\n            return;\n        }\n        const prop = trim(propMatch[0]);\n        if (!match(/^:\\s*/)) {\n            return error(`property missing ':'`);\n        }\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\n        const ret = pos({\n            type: 'declaration',\n            property: prop.replace(commentre, ''),\n            value: val ? trim(val[0]).replace(commentre, '') : '',\n        });\n        match(/^[;\\s]*/);\n        return ret;\n    }\n    function declarations() {\n        const decls = [];\n        if (!open()) {\n            return error(`missing '{'`);\n        }\n        comments(decls);\n        let decl;\n        while ((decl = declaration())) {\n            if (decl !== false) {\n                decls.push(decl);\n                comments(decls);\n            }\n            decl = declaration();\n        }\n        if (!close()) {\n            return error(`missing '}'`);\n        }\n        return decls;\n    }\n    function keyframe() {\n        let m;\n        const vals = [];\n        const pos = position();\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\n            vals.push(m[1]);\n            match(/^,\\s*/);\n        }\n        if (!vals.length) {\n            return;\n        }\n        return pos({\n            type: 'keyframe',\n            values: vals,\n            declarations: declarations(),\n        });\n    }\n    function atkeyframes() {\n        const pos = position();\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\n        if (!m) {\n            return;\n        }\n        const vendor = m[1];\n        m = match(/^([-\\w]+)\\s*/);\n        if (!m) {\n            return error('@keyframes missing name');\n        }\n        const name = m[1];\n        if (!open()) {\n            return error(`@keyframes missing '{'`);\n        }\n        let frame;\n        let frames = comments();\n        while ((frame = keyframe())) {\n            frames.push(frame);\n            frames = frames.concat(comments());\n        }\n        if (!close()) {\n            return error(`@keyframes missing '}'`);\n        }\n        return pos({\n            type: 'keyframes',\n            name,\n            vendor,\n            keyframes: frames,\n        });\n    }\n    function atsupports() {\n        const pos = position();\n        const m = match(/^@supports *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const supports = trim(m[1]);\n        if (!open()) {\n            return error(`@supports missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@supports missing '}'`);\n        }\n        return pos({\n            type: 'supports',\n            supports,\n            rules: style,\n        });\n    }\n    function athost() {\n        const pos = position();\n        const m = match(/^@host\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@host missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@host missing '}'`);\n        }\n        return pos({\n            type: 'host',\n            rules: style,\n        });\n    }\n    function atmedia() {\n        const pos = position();\n        const m = match(/^@media *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const media = trim(m[1]);\n        if (!open()) {\n            return error(`@media missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@media missing '}'`);\n        }\n        return pos({\n            type: 'media',\n            media,\n            rules: style,\n        });\n    }\n    function atcustommedia() {\n        const pos = position();\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\n        if (!m) {\n            return;\n        }\n        return pos({\n            type: 'custom-media',\n            name: trim(m[1]),\n            media: trim(m[2]),\n        });\n    }\n    function atpage() {\n        const pos = position();\n        const m = match(/^@page */);\n        if (!m) {\n            return;\n        }\n        const sel = selector() || [];\n        if (!open()) {\n            return error(`@page missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@page missing '}'`);\n        }\n        return pos({\n            type: 'page',\n            selectors: sel,\n            declarations: decls,\n        });\n    }\n    function atdocument() {\n        const pos = position();\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const vendor = trim(m[1]);\n        const doc = trim(m[2]);\n        if (!open()) {\n            return error(`@document missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@document missing '}'`);\n        }\n        return pos({\n            type: 'document',\n            document: doc,\n            vendor,\n            rules: style,\n        });\n    }\n    function atfontface() {\n        const pos = position();\n        const m = match(/^@font-face\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@font-face missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@font-face missing '}'`);\n        }\n        return pos({\n            type: 'font-face',\n            declarations: decls,\n        });\n    }\n    const atimport = _compileAtrule('import');\n    const atcharset = _compileAtrule('charset');\n    const atnamespace = _compileAtrule('namespace');\n    function _compileAtrule(name) {\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\n        return () => {\n            const pos = position();\n            const m = match(re);\n            if (!m) {\n                return;\n            }\n            const ret = { type: name };\n            ret[name] = m[1].trim();\n            return pos(ret);\n        };\n    }\n    function atrule() {\n        if (css[0] !== '@') {\n            return;\n        }\n        return (atkeyframes() ||\n            atmedia() ||\n            atcustommedia() ||\n            atsupports() ||\n            atimport() ||\n            atcharset() ||\n            atnamespace() ||\n            atdocument() ||\n            atpage() ||\n            athost() ||\n            atfontface());\n    }\n    function rule() {\n        const pos = position();\n        const sel = selector();\n        if (!sel) {\n            return error('selector missing');\n        }\n        comments();\n        return pos({\n            type: 'rule',\n            selectors: sel,\n            declarations: declarations(),\n        });\n    }\n    return addParent(stylesheet());\n}\nfunction trim(str) {\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\n}\nfunction addParent(obj, parent) {\n    const isNode = obj && typeof obj.type === 'string';\n    const childParent = isNode ? obj : parent;\n    for (const k of Object.keys(obj)) {\n        const value = obj[k];\n        if (Array.isArray(value)) {\n            value.forEach((v) => {\n                addParent(v, childParent);\n            });\n        }\n        else if (value && typeof value === 'object') {\n            addParent(value, childParent);\n        }\n    }\n    if (isNode) {\n        Object.defineProperty(obj, 'parent', {\n            configurable: true,\n            writable: true,\n            enumerable: false,\n            value: parent || null,\n        });\n    }\n    return obj;\n}\n\nconst tagMap = {\n    script: 'noscript',\n    altglyph: 'altGlyph',\n    altglyphdef: 'altGlyphDef',\n    altglyphitem: 'altGlyphItem',\n    animatecolor: 'animateColor',\n    animatemotion: 'animateMotion',\n    animatetransform: 'animateTransform',\n    clippath: 'clipPath',\n    feblend: 'feBlend',\n    fecolormatrix: 'feColorMatrix',\n    fecomponenttransfer: 'feComponentTransfer',\n    fecomposite: 'feComposite',\n    feconvolvematrix: 'feConvolveMatrix',\n    fediffuselighting: 'feDiffuseLighting',\n    fedisplacementmap: 'feDisplacementMap',\n    fedistantlight: 'feDistantLight',\n    fedropshadow: 'feDropShadow',\n    feflood: 'feFlood',\n    fefunca: 'feFuncA',\n    fefuncb: 'feFuncB',\n    fefuncg: 'feFuncG',\n    fefuncr: 'feFuncR',\n    fegaussianblur: 'feGaussianBlur',\n    feimage: 'feImage',\n    femerge: 'feMerge',\n    femergenode: 'feMergeNode',\n    femorphology: 'feMorphology',\n    feoffset: 'feOffset',\n    fepointlight: 'fePointLight',\n    fespecularlighting: 'feSpecularLighting',\n    fespotlight: 'feSpotLight',\n    fetile: 'feTile',\n    feturbulence: 'feTurbulence',\n    foreignobject: 'foreignObject',\n    glyphref: 'glyphRef',\n    lineargradient: 'linearGradient',\n    radialgradient: 'radialGradient',\n};\nfunction getTagName(n) {\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\n    if (tagName === 'link' && n.attributes._cssText) {\n        tagName = 'style';\n    }\n    return tagName;\n}\nfunction escapeRegExp(str) {\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\nfunction addHoverClass(cssText, cache) {\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\n    if (cachedStyle)\n        return cachedStyle;\n    const ast = parse(cssText, {\n        silent: true,\n    });\n    if (!ast.stylesheet) {\n        return cssText;\n    }\n    const selectors = [];\n    ast.stylesheet.rules.forEach((rule) => {\n        if ('selectors' in rule) {\n            (rule.selectors || []).forEach((selector) => {\n                if (HOVER_SELECTOR.test(selector)) {\n                    selectors.push(selector);\n                }\n            });\n        }\n    });\n    if (selectors.length === 0) {\n        return cssText;\n    }\n    const selectorMatcher = new RegExp(selectors\n        .filter((selector, index) => selectors.indexOf(selector) === index)\n        .sort((a, b) => b.length - a.length)\n        .map((selector) => {\n        return escapeRegExp(selector);\n    })\n        .join('|'), 'g');\n    const result = cssText.replace(selectorMatcher, (selector) => {\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\n        return `${selector}, ${newSelector}`;\n    });\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\n    return result;\n}\nfunction createCache() {\n    const stylesWithHoverClass = new Map();\n    return {\n        stylesWithHoverClass,\n    };\n}\nfunction buildNode(n, options) {\n    const { doc, hackCss, cache } = options;\n    switch (n.type) {\n        case NodeType.Document:\n            return doc.implementation.createDocument(null, '', null);\n        case NodeType.DocumentType:\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\n        case NodeType.Element:\n            const tagName = getTagName(n);\n            let node;\n            if (n.isSVG) {\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\n            }\n            else {\n                node = doc.createElement(tagName);\n            }\n            for (const name in n.attributes) {\n                if (!n.attributes.hasOwnProperty(name)) {\n                    continue;\n                }\n                let value = n.attributes[name];\n                if (tagName === 'option' && name === 'selected' && value === false) {\n                    continue;\n                }\n                value =\n                    typeof value === 'boolean' || typeof value === 'number' || value === null ? '' : value;\n                if (!name.startsWith('rr_')) {\n                    const isTextarea = tagName === 'textarea' && name === 'value';\n                    const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\n                    if (isRemoteOrDynamicCss && hackCss) {\n                        value = addHoverClass(value, cache);\n                    }\n                    if (isTextarea || isRemoteOrDynamicCss) {\n                        const child = doc.createTextNode(value);\n                        for (const c of Array.from(node.childNodes)) {\n                            if (c.nodeType === node.TEXT_NODE) {\n                                node.removeChild(c);\n                            }\n                        }\n                        node.appendChild(child);\n                        continue;\n                    }\n                    try {\n                        if (n.isSVG && name === 'xlink:href') {\n                            node.setAttributeNS('http://www.w3.org/1999/xlink', name, value);\n                        }\n                        else if (name === 'onload' ||\n                            name === 'onclick' ||\n                            name.substring(0, 7) === 'onmouse') {\n                            node.setAttribute('_' + name, value);\n                        }\n                        else if (tagName === 'meta' &&\n                            n.attributes['http-equiv'] === 'Content-Security-Policy' &&\n                            name === 'content') {\n                            node.setAttribute('csp-content', value);\n                            continue;\n                        }\n                        else if (tagName === 'link' &&\n                            (n.attributes.rel === 'preload' || n.attributes.rel === 'modulepreload') &&\n                            n.attributes.as === 'script') {\n                        }\n                        else if (tagName === 'link' &&\n                            n.attributes.rel === 'prefetch' &&\n                            typeof n.attributes.href === 'string' &&\n                            n.attributes.href.endsWith('.js')) {\n                        }\n                        else if (tagName === 'img' &&\n                            n.attributes.srcset &&\n                            n.attributes.rr_dataURL) {\n                            node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\n                        }\n                        else {\n                            node.setAttribute(name, value);\n                        }\n                    }\n                    catch (error) {\n                    }\n                }\n                else {\n                    if (tagName === 'canvas' && name === 'rr_dataURL') {\n                        const image = document.createElement('img');\n                        image.src = value;\n                        image.onload = () => {\n                            const ctx = node.getContext('2d');\n                            if (ctx) {\n                                ctx.drawImage(image, 0, 0, image.width, image.height);\n                            }\n                        };\n                    }\n                    else if (tagName === 'img' && name === 'rr_dataURL') {\n                        const image = node;\n                        if (!image.currentSrc.startsWith('data:')) {\n                            image.setAttribute('rrweb-original-src', n.attributes.src);\n                            image.src = value;\n                        }\n                    }\n                    if (name === 'rr_width') {\n                        node.style.width = value;\n                    }\n                    else if (name === 'rr_height') {\n                        node.style.height = value;\n                    }\n                    else if (name === 'rr_mediaCurrentTime') {\n                        node.currentTime = n.attributes\n                            .rr_mediaCurrentTime;\n                    }\n                    else if (name === 'rr_mediaState') {\n                        switch (value) {\n                            case 'played':\n                                node\n                                    .play()\n                                    .catch((e) => console.warn('media playback error', e));\n                                break;\n                            case 'paused':\n                                node.pause();\n                                break;\n                        }\n                    }\n                }\n            }\n            if (n.isShadowHost) {\n                if (!node.shadowRoot) {\n                    node.attachShadow({ mode: 'open' });\n                }\n                else {\n                    while (node.shadowRoot.firstChild) {\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\n                    }\n                }\n            }\n            return node;\n        case NodeType.Text:\n            return doc.createTextNode(n.isStyle && hackCss\n                ? addHoverClass(n.textContent, cache)\n                : n.textContent);\n        case NodeType.CDATA:\n            return doc.createCDATASection(n.textContent);\n        case NodeType.Comment:\n            return doc.createComment(n.textContent);\n        default:\n            return null;\n    }\n}\nfunction buildNodeWithSN(n, options) {\n    const { doc, map, skipChild = false, hackCss = true, afterAppend, cache, } = options;\n    let node = buildNode(n, { doc, hackCss, cache });\n    if (!node) {\n        return null;\n    }\n    if (n.rootId) {\n        console.assert(map[n.rootId] === doc, 'Target document should has the same root id.');\n    }\n    if (n.type === NodeType.Document) {\n        doc.close();\n        doc.open();\n        if (n.compatMode === 'BackCompat' &&\n            n.childNodes &&\n            n.childNodes[0].type !== NodeType.DocumentType) {\n            if (n.childNodes[0].type === NodeType.Element &&\n                'xmlns' in n.childNodes[0].attributes &&\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\n            }\n            else {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\n            }\n        }\n        node = doc;\n    }\n    node.__sn = n;\n    map[n.id] = node;\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\n        !skipChild) {\n        for (const childN of n.childNodes) {\n            const childNode = buildNodeWithSN(childN, {\n                doc,\n                map,\n                skipChild: false,\n                hackCss,\n                afterAppend,\n                cache,\n            });\n            if (!childNode) {\n                console.warn('Failed to rebuild', childN);\n                continue;\n            }\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\n                node.shadowRoot.appendChild(childNode);\n            }\n            else {\n                node.appendChild(childNode);\n            }\n            if (afterAppend) {\n                afterAppend(childNode);\n            }\n        }\n    }\n    return node;\n}\nfunction visit(idNodeMap, onVisit) {\n    function walk(node) {\n        onVisit(node);\n    }\n    for (const key in idNodeMap) {\n        if (idNodeMap[key]) {\n            walk(idNodeMap[key]);\n        }\n    }\n}\nfunction handleScroll(node) {\n    const n = node.__sn;\n    if (n.type !== NodeType.Element) {\n        return;\n    }\n    const el = node;\n    for (const name in n.attributes) {\n        if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {\n            continue;\n        }\n        const value = n.attributes[name];\n        if (name === 'rr_scrollLeft') {\n            el.scrollLeft = value;\n        }\n        if (name === 'rr_scrollTop') {\n            el.scrollTop = value;\n        }\n    }\n}\nfunction rebuild(n, options) {\n    const { doc, onVisit, hackCss = true, afterAppend, cache } = options;\n    const idNodeMap = {};\n    const node = buildNodeWithSN(n, {\n        doc,\n        map: idNodeMap,\n        skipChild: false,\n        hackCss,\n        afterAppend,\n        cache,\n    });\n    visit(idNodeMap, (visitedNode) => {\n        if (onVisit) {\n            onVisit(visitedNode);\n        }\n        handleScroll(visitedNode);\n    });\n    return [node, idNodeMap];\n}\n\nexport { IGNORED_NODE, NodeType, addHoverClass, buildNodeWithSN, createCache, hasInputMaskOptions, is2DCanvasBlank, isElement, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, snapshot, transformAttribute };\n","var EventType;\n(function (EventType) {\n    EventType[EventType[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n    EventType[EventType[\"Load\"] = 1] = \"Load\";\n    EventType[EventType[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n    EventType[EventType[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n    EventType[EventType[\"Meta\"] = 4] = \"Meta\";\n    EventType[EventType[\"Custom\"] = 5] = \"Custom\";\n    EventType[EventType[\"Plugin\"] = 6] = \"Plugin\";\n})(EventType || (EventType = {}));\nvar IncrementalSource;\n(function (IncrementalSource) {\n    IncrementalSource[IncrementalSource[\"Mutation\"] = 0] = \"Mutation\";\n    IncrementalSource[IncrementalSource[\"MouseMove\"] = 1] = \"MouseMove\";\n    IncrementalSource[IncrementalSource[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n    IncrementalSource[IncrementalSource[\"Scroll\"] = 3] = \"Scroll\";\n    IncrementalSource[IncrementalSource[\"ViewportResize\"] = 4] = \"ViewportResize\";\n    IncrementalSource[IncrementalSource[\"Input\"] = 5] = \"Input\";\n    IncrementalSource[IncrementalSource[\"TouchMove\"] = 6] = \"TouchMove\";\n    IncrementalSource[IncrementalSource[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n    IncrementalSource[IncrementalSource[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n    IncrementalSource[IncrementalSource[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n    IncrementalSource[IncrementalSource[\"Font\"] = 10] = \"Font\";\n    IncrementalSource[IncrementalSource[\"Log\"] = 11] = \"Log\";\n    IncrementalSource[IncrementalSource[\"Drag\"] = 12] = \"Drag\";\n    IncrementalSource[IncrementalSource[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n})(IncrementalSource || (IncrementalSource = {}));\nvar MouseInteractions;\n(function (MouseInteractions) {\n    MouseInteractions[MouseInteractions[\"MouseUp\"] = 0] = \"MouseUp\";\n    MouseInteractions[MouseInteractions[\"MouseDown\"] = 1] = \"MouseDown\";\n    MouseInteractions[MouseInteractions[\"Click\"] = 2] = \"Click\";\n    MouseInteractions[MouseInteractions[\"ContextMenu\"] = 3] = \"ContextMenu\";\n    MouseInteractions[MouseInteractions[\"DblClick\"] = 4] = \"DblClick\";\n    MouseInteractions[MouseInteractions[\"Focus\"] = 5] = \"Focus\";\n    MouseInteractions[MouseInteractions[\"Blur\"] = 6] = \"Blur\";\n    MouseInteractions[MouseInteractions[\"TouchStart\"] = 7] = \"TouchStart\";\n    MouseInteractions[MouseInteractions[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n    MouseInteractions[MouseInteractions[\"TouchEnd\"] = 9] = \"TouchEnd\";\n    MouseInteractions[MouseInteractions[\"TouchCancel\"] = 10] = \"TouchCancel\";\n})(MouseInteractions || (MouseInteractions = {}));\nvar CanvasContext;\n(function (CanvasContext) {\n    CanvasContext[CanvasContext[\"2D\"] = 0] = \"2D\";\n    CanvasContext[CanvasContext[\"WebGL\"] = 1] = \"WebGL\";\n    CanvasContext[CanvasContext[\"WebGL2\"] = 2] = \"WebGL2\";\n})(CanvasContext || (CanvasContext = {}));\nvar MediaInteractions;\n(function (MediaInteractions) {\n    MediaInteractions[MediaInteractions[\"Play\"] = 0] = \"Play\";\n    MediaInteractions[MediaInteractions[\"Pause\"] = 1] = \"Pause\";\n    MediaInteractions[MediaInteractions[\"Seeked\"] = 2] = \"Seeked\";\n    MediaInteractions[MediaInteractions[\"VolumeChange\"] = 3] = \"VolumeChange\";\n})(MediaInteractions || (MediaInteractions = {}));\nvar ReplayerEvents;\n(function (ReplayerEvents) {\n    ReplayerEvents[\"Start\"] = \"start\";\n    ReplayerEvents[\"Pause\"] = \"pause\";\n    ReplayerEvents[\"Resume\"] = \"resume\";\n    ReplayerEvents[\"Resize\"] = \"resize\";\n    ReplayerEvents[\"Finish\"] = \"finish\";\n    ReplayerEvents[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n    ReplayerEvents[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n    ReplayerEvents[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n    ReplayerEvents[\"SkipStart\"] = \"skip-start\";\n    ReplayerEvents[\"SkipEnd\"] = \"skip-end\";\n    ReplayerEvents[\"MouseInteraction\"] = \"mouse-interaction\";\n    ReplayerEvents[\"EventCast\"] = \"event-cast\";\n    ReplayerEvents[\"CustomEvent\"] = \"custom-event\";\n    ReplayerEvents[\"Flush\"] = \"flush\";\n    ReplayerEvents[\"StateChange\"] = \"state-change\";\n    ReplayerEvents[\"PlayBack\"] = \"play-back\";\n})(ReplayerEvents || (ReplayerEvents = {}));\n\nexport { CanvasContext, EventType, IncrementalSource, MediaInteractions, MouseInteractions, ReplayerEvents };\n","import { IncrementalSource } from './types.js';\nimport { IGNORED_NODE, isShadowRoot, NodeType } from '../../rrweb-snapshot/es/rrweb-snapshot.js';\n\nfunction on(type, fn, target = document) {\n    const options = { capture: true, passive: true };\n    target.addEventListener(type, fn, options);\n    return () => target.removeEventListener(type, fn, options);\n}\nfunction createMirror() {\n    return {\n        map: {},\n        getId(n) {\n            if (!n || !n.__sn) {\n                return -1;\n            }\n            return n.__sn.id;\n        },\n        getNode(id) {\n            return this.map[id] || null;\n        },\n        removeNodeFromMap(n) {\n            const id = n.__sn && n.__sn.id;\n            delete this.map[id];\n            if (n.childNodes) {\n                n.childNodes.forEach((child) => this.removeNodeFromMap(child));\n            }\n        },\n        has(id) {\n            return this.map.hasOwnProperty(id);\n        },\n        reset() {\n            this.map = {};\n        },\n    };\n}\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\n    '\\r\\n' +\n    'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\n    '\\r\\n' +\n    'or you can use record.mirror to access the mirror instance during recording.';\nlet _mirror = {\n    map: {},\n    getId() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return -1;\n    },\n    getNode() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return null;\n    },\n    removeNodeFromMap() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    },\n    has() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n        return false;\n    },\n    reset() {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    },\n};\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\n    _mirror = new Proxy(_mirror, {\n        get(target, prop, receiver) {\n            if (prop === 'map') {\n                console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n            }\n            return Reflect.get(target, prop, receiver);\n        },\n    });\n}\nfunction throttle(func, wait, options = {}) {\n    let timeout = null;\n    let previous = 0;\n    return function (arg) {\n        let now = Date.now();\n        if (!previous && options.leading === false) {\n            previous = now;\n        }\n        let remaining = wait - (now - previous);\n        let context = this;\n        let args = arguments;\n        if (remaining <= 0 || remaining > wait) {\n            if (timeout) {\n                clearTimeout(timeout);\n                timeout = null;\n            }\n            previous = now;\n            func.apply(context, args);\n        }\n        else if (!timeout && options.trailing !== false) {\n            timeout = setTimeout(() => {\n                previous = options.leading === false ? 0 : Date.now();\n                timeout = null;\n                func.apply(context, args);\n            }, remaining);\n        }\n    };\n}\nfunction hookSetter(target, key, d, isRevoked, win = window) {\n    const original = win.Object.getOwnPropertyDescriptor(target, key);\n    win.Object.defineProperty(target, key, isRevoked\n        ? d\n        : {\n            set(value) {\n                setTimeout(() => {\n                    d.set.call(this, value);\n                }, 0);\n                if (original && original.set) {\n                    original.set.call(this, value);\n                }\n            },\n        });\n    return () => hookSetter(target, key, original || {}, true);\n}\nfunction patch(source, name, replacement) {\n    try {\n        if (!(name in source)) {\n            return () => { };\n        }\n        const original = source[name];\n        const wrapped = replacement(original);\n        if (typeof wrapped === 'function') {\n            wrapped.prototype = wrapped.prototype || {};\n            Object.defineProperties(wrapped, {\n                __rrweb_original__: {\n                    enumerable: false,\n                    value: original,\n                },\n            });\n        }\n        source[name] = wrapped;\n        return () => {\n            source[name] = original;\n        };\n    }\n    catch (_a) {\n        return () => { };\n    }\n}\nfunction getWindowHeight() {\n    return (window.innerHeight ||\n        (document.documentElement && document.documentElement.clientHeight) ||\n        (document.body && document.body.clientHeight));\n}\nfunction getWindowWidth() {\n    return (window.innerWidth ||\n        (document.documentElement && document.documentElement.clientWidth) ||\n        (document.body && document.body.clientWidth));\n}\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType === node.ELEMENT_NODE) {\n        let needBlock = false;\n        const needUnblock = unblockSelector && node.matches(unblockSelector);\n        if (typeof blockClass === 'string') {\n            if (node.closest !== undefined) {\n                needBlock =\n                    !needUnblock &&\n                        node.closest('.' + blockClass) !== null;\n            }\n            else {\n                needBlock =\n                    !needUnblock && node.classList.contains(blockClass);\n            }\n        }\n        else {\n            !needUnblock &&\n                node.classList.forEach((className) => {\n                    if (blockClass.test(className)) {\n                        needBlock = true;\n                    }\n                });\n        }\n        if (!needBlock && blockSelector) {\n            needBlock = node.matches(blockSelector);\n        }\n        return ((!needUnblock && needBlock) ||\n            isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector));\n    }\n    if (node.nodeType === node.TEXT_NODE) {\n        return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);\n    }\n    return isBlocked(node.parentNode, blockClass, blockSelector, unblockSelector);\n}\nfunction isIgnored(n) {\n    if ('__sn' in n) {\n        return n.__sn.id === IGNORED_NODE;\n    }\n    return false;\n}\nfunction isAncestorRemoved(target, mirror) {\n    if (isShadowRoot(target)) {\n        return false;\n    }\n    const id = mirror.getId(target);\n    if (!mirror.has(id)) {\n        return true;\n    }\n    if (target.parentNode &&\n        target.parentNode.nodeType === target.DOCUMENT_NODE) {\n        return false;\n    }\n    if (!target.parentNode) {\n        return true;\n    }\n    return isAncestorRemoved(target.parentNode, mirror);\n}\nfunction isTouchEvent(event) {\n    return Boolean(event.changedTouches);\n}\nfunction polyfill(win = window) {\n    if ('NodeList' in win && !win.NodeList.prototype.forEach) {\n        win.NodeList.prototype.forEach = Array.prototype\n            .forEach;\n    }\n    if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\n        win.DOMTokenList.prototype.forEach = Array.prototype\n            .forEach;\n    }\n    if (!Node.prototype.contains) {\n        Node.prototype.contains = function contains(node) {\n            if (!(0 in arguments)) {\n                throw new TypeError('1 argument is required');\n            }\n            do {\n                if (this === node) {\n                    return true;\n                }\n            } while ((node = node && node.parentNode));\n            return false;\n        };\n    }\n}\nclass TreeIndex {\n    constructor() {\n        this.reset();\n    }\n    add(mutation) {\n        const parentTreeNode = this.indexes.get(mutation.parentId);\n        const treeNode = {\n            id: mutation.node.id,\n            mutation,\n            children: [],\n            texts: [],\n            attributes: [],\n        };\n        if (!parentTreeNode) {\n            this.tree[treeNode.id] = treeNode;\n        }\n        else {\n            treeNode.parent = parentTreeNode;\n            parentTreeNode.children[treeNode.id] = treeNode;\n        }\n        this.indexes.set(treeNode.id, treeNode);\n    }\n    remove(mutation, mirror) {\n        const parentTreeNode = this.indexes.get(mutation.parentId);\n        const treeNode = this.indexes.get(mutation.id);\n        const deepRemoveFromMirror = (id) => {\n            this.removeIdSet.add(id);\n            const node = mirror.getNode(id);\n            node === null || node === void 0 ? void 0 : node.childNodes.forEach((childNode) => {\n                if ('__sn' in childNode) {\n                    deepRemoveFromMirror(childNode.__sn.id);\n                }\n            });\n        };\n        const deepRemoveFromTreeIndex = (node) => {\n            this.removeIdSet.add(node.id);\n            Object.values(node.children).forEach((n) => deepRemoveFromTreeIndex(n));\n            const _treeNode = this.indexes.get(node.id);\n            if (_treeNode) {\n                const _parentTreeNode = _treeNode.parent;\n                if (_parentTreeNode) {\n                    delete _treeNode.parent;\n                    delete _parentTreeNode.children[_treeNode.id];\n                    this.indexes.delete(mutation.id);\n                }\n            }\n        };\n        if (!treeNode) {\n            this.removeNodeMutations.push(mutation);\n            deepRemoveFromMirror(mutation.id);\n        }\n        else if (!parentTreeNode) {\n            delete this.tree[treeNode.id];\n            this.indexes.delete(treeNode.id);\n            deepRemoveFromTreeIndex(treeNode);\n        }\n        else {\n            delete treeNode.parent;\n            delete parentTreeNode.children[treeNode.id];\n            this.indexes.delete(mutation.id);\n            deepRemoveFromTreeIndex(treeNode);\n        }\n    }\n    text(mutation) {\n        const treeNode = this.indexes.get(mutation.id);\n        if (treeNode) {\n            treeNode.texts.push(mutation);\n        }\n        else {\n            this.textMutations.push(mutation);\n        }\n    }\n    attribute(mutation) {\n        const treeNode = this.indexes.get(mutation.id);\n        if (treeNode) {\n            treeNode.attributes.push(mutation);\n        }\n        else {\n            this.attributeMutations.push(mutation);\n        }\n    }\n    scroll(d) {\n        this.scrollMap.set(d.id, d);\n    }\n    input(d) {\n        this.inputMap.set(d.id, d);\n    }\n    flush() {\n        const { tree, removeNodeMutations, textMutations, attributeMutations, } = this;\n        const batchMutationData = {\n            source: IncrementalSource.Mutation,\n            removes: removeNodeMutations,\n            texts: textMutations,\n            attributes: attributeMutations,\n            adds: [],\n        };\n        const walk = (treeNode, removed) => {\n            if (removed) {\n                this.removeIdSet.add(treeNode.id);\n            }\n            batchMutationData.texts = batchMutationData.texts\n                .concat(removed ? [] : treeNode.texts)\n                .filter((m) => !this.removeIdSet.has(m.id));\n            batchMutationData.attributes = batchMutationData.attributes\n                .concat(removed ? [] : treeNode.attributes)\n                .filter((m) => !this.removeIdSet.has(m.id));\n            if (!this.removeIdSet.has(treeNode.id) &&\n                !this.removeIdSet.has(treeNode.mutation.parentId) &&\n                !removed) {\n                batchMutationData.adds.push(treeNode.mutation);\n                if (treeNode.children) {\n                    Object.values(treeNode.children).forEach((n) => walk(n, false));\n                }\n            }\n            else {\n                Object.values(treeNode.children).forEach((n) => walk(n, true));\n            }\n        };\n        Object.values(tree).forEach((n) => walk(n, false));\n        for (const id of this.scrollMap.keys()) {\n            if (this.removeIdSet.has(id)) {\n                this.scrollMap.delete(id);\n            }\n        }\n        for (const id of this.inputMap.keys()) {\n            if (this.removeIdSet.has(id)) {\n                this.inputMap.delete(id);\n            }\n        }\n        const scrollMap = new Map(this.scrollMap);\n        const inputMap = new Map(this.inputMap);\n        this.reset();\n        return {\n            mutationData: batchMutationData,\n            scrollMap,\n            inputMap,\n        };\n    }\n    reset() {\n        this.tree = [];\n        this.indexes = new Map();\n        this.removeNodeMutations = [];\n        this.textMutations = [];\n        this.attributeMutations = [];\n        this.removeIdSet = new Set();\n        this.scrollMap = new Map();\n        this.inputMap = new Map();\n    }\n    idRemoved(id) {\n        return this.removeIdSet.has(id);\n    }\n}\nfunction queueToResolveTrees(queue) {\n    const queueNodeMap = {};\n    const putIntoMap = (m, parent) => {\n        const nodeInTree = {\n            value: m,\n            parent,\n            children: [],\n        };\n        queueNodeMap[m.node.id] = nodeInTree;\n        return nodeInTree;\n    };\n    const queueNodeTrees = [];\n    for (const mutation of queue) {\n        const { nextId, parentId } = mutation;\n        if (nextId && nextId in queueNodeMap) {\n            const nextInTree = queueNodeMap[nextId];\n            if (nextInTree.parent) {\n                const idx = nextInTree.parent.children.indexOf(nextInTree);\n                nextInTree.parent.children.splice(idx, 0, putIntoMap(mutation, nextInTree.parent));\n            }\n            else {\n                const idx = queueNodeTrees.indexOf(nextInTree);\n                queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\n            }\n            continue;\n        }\n        if (parentId in queueNodeMap) {\n            const parentInTree = queueNodeMap[parentId];\n            parentInTree.children.push(putIntoMap(mutation, parentInTree));\n            continue;\n        }\n        queueNodeTrees.push(putIntoMap(mutation, null));\n    }\n    return queueNodeTrees;\n}\nfunction iterateResolveTree(tree, cb) {\n    cb(tree.value);\n    for (let i = tree.children.length - 1; i >= 0; i--) {\n        iterateResolveTree(tree.children[i], cb);\n    }\n}\nfunction isIframeINode(node) {\n    if ('__sn' in node) {\n        return (node.__sn.type === NodeType.Element && node.__sn.tagName === 'iframe');\n    }\n    return false;\n}\nfunction getBaseDimension(node, rootIframe) {\n    var _a, _b;\n    const frameElement = (_b = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) === null || _b === void 0 ? void 0 : _b.frameElement;\n    if (!frameElement || frameElement === rootIframe) {\n        return {\n            x: 0,\n            y: 0,\n            relativeScale: 1,\n            absoluteScale: 1,\n        };\n    }\n    const frameDimension = frameElement.getBoundingClientRect();\n    const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\n    const relativeScale = frameDimension.height / frameElement.clientHeight;\n    return {\n        x: frameDimension.x * frameBaseDimension.relativeScale +\n            frameBaseDimension.x,\n        y: frameDimension.y * frameBaseDimension.relativeScale +\n            frameBaseDimension.y,\n        relativeScale,\n        absoluteScale: frameBaseDimension.absoluteScale * relativeScale,\n    };\n}\nfunction hasShadowRoot(n) {\n    return Boolean(n === null || n === void 0 ? void 0 : n.shadowRoot);\n}\n\nexport { TreeIndex, _mirror, createMirror, getBaseDimension, getWindowHeight, getWindowWidth, hasShadowRoot, hookSetter, isAncestorRemoved, isBlocked, isIframeINode, isIgnored, isTouchEvent, iterateResolveTree, on, patch, polyfill, queueToResolveTrees, throttle };\n","import { isShadowRoot, maskInputValue, transformAttribute, needMaskingText, IGNORED_NODE, serializeNodeWithId } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { isIgnored, isBlocked, isAncestorRemoved, isIframeINode, hasShadowRoot } from '../utils.js';\n\nfunction isNodeInLinkedList(n) {\n    return '__ln' in n;\n}\nclass DoubleLinkedList {\n    constructor() {\n        this.length = 0;\n        this.head = null;\n    }\n    get(position) {\n        if (position >= this.length) {\n            throw new Error('Position outside of list range');\n        }\n        let current = this.head;\n        for (let index = 0; index < position; index++) {\n            current = (current === null || current === void 0 ? void 0 : current.next) || null;\n        }\n        return current;\n    }\n    addNode(n) {\n        const node = {\n            value: n,\n            previous: null,\n            next: null,\n        };\n        n.__ln = node;\n        if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\n            const current = n.previousSibling.__ln.next;\n            node.next = current;\n            node.previous = n.previousSibling.__ln;\n            n.previousSibling.__ln.next = node;\n            if (current) {\n                current.previous = node;\n            }\n        }\n        else if (n.nextSibling &&\n            isNodeInLinkedList(n.nextSibling) &&\n            n.nextSibling.__ln.previous) {\n            const current = n.nextSibling.__ln.previous;\n            node.previous = current;\n            node.next = n.nextSibling.__ln;\n            n.nextSibling.__ln.previous = node;\n            if (current) {\n                current.next = node;\n            }\n        }\n        else {\n            if (this.head) {\n                this.head.previous = node;\n            }\n            node.next = this.head;\n            this.head = node;\n        }\n        this.length++;\n    }\n    removeNode(n) {\n        const current = n.__ln;\n        if (!this.head) {\n            return;\n        }\n        if (!current.previous) {\n            this.head = current.next;\n            if (this.head) {\n                this.head.previous = null;\n            }\n        }\n        else {\n            current.previous.next = current.next;\n            if (current.next) {\n                current.next.previous = current.previous;\n            }\n        }\n        if (n.__ln) {\n            delete n.__ln;\n        }\n        this.length--;\n    }\n}\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\nfunction isINode(n) {\n    return '__sn' in n;\n}\nclass MutationBuffer {\n    constructor() {\n        this.frozen = false;\n        this.locked = false;\n        this.texts = [];\n        this.attributes = [];\n        this.removes = [];\n        this.mapRemoves = [];\n        this.movedMap = {};\n        this.addedSet = new Set();\n        this.movedSet = new Set();\n        this.droppedSet = new Set();\n        this.processMutations = (mutations) => {\n            mutations.forEach(this.processMutation);\n            this.emit();\n        };\n        this.emit = () => {\n            if (this.frozen || this.locked) {\n                return;\n            }\n            const adds = [];\n            const addList = new DoubleLinkedList();\n            const getNextId = (n) => {\n                let ns = n;\n                let nextId = IGNORED_NODE;\n                while (nextId === IGNORED_NODE) {\n                    ns = ns && ns.nextSibling;\n                    nextId = ns && this.mirror.getId(ns);\n                }\n                return nextId;\n            };\n            const pushAdd = (n) => {\n                var _a, _b, _c, _d, _e;\n                const shadowHost = n.getRootNode\n                    ? (_a = n.getRootNode()) === null || _a === void 0 ? void 0 : _a.host\n                    : null;\n                let rootShadowHost = shadowHost;\n                while ((_c = (_b = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _b === void 0 ? void 0 : _b.call(rootShadowHost)) === null || _c === void 0 ? void 0 : _c.host)\n                    rootShadowHost =\n                        ((_e = (_d = rootShadowHost === null || rootShadowHost === void 0 ? void 0 : rootShadowHost.getRootNode) === null || _d === void 0 ? void 0 : _d.call(rootShadowHost)) === null || _e === void 0 ? void 0 : _e.host) ||\n                            null;\n                const notInDoc = !this.doc.contains(n) &&\n                    (!rootShadowHost || !this.doc.contains(rootShadowHost));\n                if (!n.parentNode || notInDoc) {\n                    return;\n                }\n                const parentId = isShadowRoot(n.parentNode)\n                    ? this.mirror.getId(shadowHost)\n                    : this.mirror.getId(n.parentNode);\n                const nextId = getNextId(n);\n                if (parentId === -1 || nextId === -1) {\n                    return addList.addNode(n);\n                }\n                let sn = serializeNodeWithId(n, {\n                    doc: this.doc,\n                    map: this.mirror.map,\n                    blockClass: this.blockClass,\n                    blockSelector: this.blockSelector,\n                    unblockSelector: this.unblockSelector,\n                    maskTextClass: this.maskTextClass,\n                    maskTextSelector: this.maskTextSelector,\n                    unmaskTextSelector: this.unmaskTextSelector,\n                    maskInputSelector: this.maskInputSelector,\n                    unmaskInputSelector: this.unmaskInputSelector,\n                    skipChild: true,\n                    inlineStylesheet: this.inlineStylesheet,\n                    maskAllText: this.maskAllText,\n                    maskInputOptions: this.maskInputOptions,\n                    maskTextFn: this.maskTextFn,\n                    maskInputFn: this.maskInputFn,\n                    slimDOMOptions: this.slimDOMOptions,\n                    recordCanvas: this.recordCanvas,\n                    inlineImages: this.inlineImages,\n                    onSerialize: (currentN) => {\n                        if (isIframeINode(currentN)) {\n                            this.iframeManager.addIframe(currentN);\n                        }\n                        if (hasShadowRoot(n)) {\n                            this.shadowDomManager.addShadowRoot(n.shadowRoot, document);\n                        }\n                    },\n                    onIframeLoad: (iframe, childSn) => {\n                        this.iframeManager.attachIframe(iframe, childSn);\n                        this.shadowDomManager.observeAttachShadow(iframe);\n                    },\n                });\n                if (sn) {\n                    adds.push({\n                        parentId,\n                        nextId,\n                        node: sn,\n                    });\n                }\n            };\n            while (this.mapRemoves.length) {\n                this.mirror.removeNodeFromMap(this.mapRemoves.shift());\n            }\n            for (const n of this.movedSet) {\n                if (isParentRemoved(this.removes, n, this.mirror) &&\n                    !this.movedSet.has(n.parentNode)) {\n                    continue;\n                }\n                pushAdd(n);\n            }\n            for (const n of this.addedSet) {\n                if (!isAncestorInSet(this.droppedSet, n) &&\n                    !isParentRemoved(this.removes, n, this.mirror)) {\n                    pushAdd(n);\n                }\n                else if (isAncestorInSet(this.movedSet, n)) {\n                    pushAdd(n);\n                }\n                else {\n                    this.droppedSet.add(n);\n                }\n            }\n            let candidate = null;\n            while (addList.length) {\n                let node = null;\n                if (candidate) {\n                    const parentId = this.mirror.getId(candidate.value.parentNode);\n                    const nextId = getNextId(candidate.value);\n                    if (parentId !== -1 && nextId !== -1) {\n                        node = candidate;\n                    }\n                }\n                if (!node) {\n                    for (let index = addList.length - 1; index >= 0; index--) {\n                        const _node = addList.get(index);\n                        if (_node) {\n                            const parentId = this.mirror.getId(_node.value.parentNode);\n                            const nextId = getNextId(_node.value);\n                            if (parentId !== -1 && nextId !== -1) {\n                                node = _node;\n                                break;\n                            }\n                        }\n                    }\n                }\n                if (!node) {\n                    while (addList.head) {\n                        addList.removeNode(addList.head.value);\n                    }\n                    break;\n                }\n                candidate = node.previous;\n                addList.removeNode(node.value);\n                pushAdd(node.value);\n            }\n            const payload = {\n                texts: this.texts\n                    .map((text) => ({\n                    id: this.mirror.getId(text.node),\n                    value: text.value,\n                }))\n                    .filter((text) => this.mirror.has(text.id)),\n                attributes: this.attributes\n                    .map((attribute) => ({\n                    id: this.mirror.getId(attribute.node),\n                    attributes: attribute.attributes,\n                }))\n                    .filter((attribute) => this.mirror.has(attribute.id)),\n                removes: this.removes,\n                adds,\n            };\n            if (!payload.texts.length &&\n                !payload.attributes.length &&\n                !payload.removes.length &&\n                !payload.adds.length) {\n                return;\n            }\n            this.texts = [];\n            this.attributes = [];\n            this.removes = [];\n            this.addedSet = new Set();\n            this.movedSet = new Set();\n            this.droppedSet = new Set();\n            this.movedMap = {};\n            this.mutationCb(payload);\n        };\n        this.processMutation = (m) => {\n            if (isIgnored(m.target)) {\n                return;\n            }\n            switch (m.type) {\n                case 'characterData': {\n                    const value = m.target.textContent;\n                    if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) && value !== m.oldValue) {\n                        this.texts.push({\n                            value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextSelector, this.maskAllText) && value\n                                ? this.maskTextFn\n                                    ? this.maskTextFn(value)\n                                    : value.replace(/[\\S]/g, '*')\n                                : value,\n                            node: m.target,\n                        });\n                    }\n                    break;\n                }\n                case 'attributes': {\n                    const target = m.target;\n                    let value = target.getAttribute(m.attributeName);\n                    if (m.attributeName === 'value') {\n                        value = maskInputValue({\n                            input: target,\n                            maskInputSelector: this.maskInputSelector,\n                            unmaskInputSelector: this.unmaskInputSelector,\n                            maskInputOptions: this.maskInputOptions,\n                            tagName: target.tagName,\n                            type: target.getAttribute('type'),\n                            value,\n                            maskInputFn: this.maskInputFn,\n                        });\n                    }\n                    if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || value === m.oldValue) {\n                        return;\n                    }\n                    let item = this.attributes.find((a) => a.node === m.target);\n                    if (!item) {\n                        item = {\n                            node: m.target,\n                            attributes: {},\n                        };\n                        this.attributes.push(item);\n                    }\n                    if (m.attributeName === 'type' &&\n                        m.target.tagName === 'INPUT' &&\n                        (m.oldValue || '').toLowerCase() === 'password') {\n                        m.target.setAttribute('rr_is_password', 'true');\n                    }\n                    if (m.attributeName === 'style') {\n                        const old = this.doc.createElement('span');\n                        if (m.oldValue) {\n                            old.setAttribute('style', m.oldValue);\n                        }\n                        if (item.attributes.style === undefined ||\n                            item.attributes.style === null) {\n                            item.attributes.style = {};\n                        }\n                        try {\n                            const styleObj = item.attributes.style;\n                            for (const pname of Array.from(target.style)) {\n                                const newValue = target.style.getPropertyValue(pname);\n                                const newPriority = target.style.getPropertyPriority(pname);\n                                if (newValue !== old.style.getPropertyValue(pname) ||\n                                    newPriority !== old.style.getPropertyPriority(pname)) {\n                                    if (newPriority === '') {\n                                        styleObj[pname] = newValue;\n                                    }\n                                    else {\n                                        styleObj[pname] = [newValue, newPriority];\n                                    }\n                                }\n                            }\n                            for (const pname of Array.from(old.style)) {\n                                if (target.style.getPropertyValue(pname) === '') {\n                                    styleObj[pname] = false;\n                                }\n                            }\n                        }\n                        catch (error) {\n                            console.warn('[rrweb] Error when parsing update to style attribute:', error);\n                        }\n                    }\n                    else {\n                        const element = m.target;\n                        item.attributes[m.attributeName] = transformAttribute(this.doc, element, element.tagName, m.attributeName, value, this.maskAllText, this.unmaskTextSelector, this.maskTextFn);\n                    }\n                    break;\n                }\n                case 'childList': {\n                    m.addedNodes.forEach((n) => this.genAdds(n, m.target));\n                    m.removedNodes.forEach((n) => {\n                        const nodeId = this.mirror.getId(n);\n                        const parentId = isShadowRoot(m.target)\n                            ? this.mirror.getId(m.target.host)\n                            : this.mirror.getId(m.target);\n                        if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector) || isIgnored(n)) {\n                            return;\n                        }\n                        if (this.addedSet.has(n)) {\n                            deepDelete(this.addedSet, n);\n                            this.droppedSet.add(n);\n                        }\n                        else if (this.addedSet.has(m.target) && nodeId === -1) ;\n                        else if (isAncestorRemoved(m.target, this.mirror)) ;\n                        else if (this.movedSet.has(n) &&\n                            this.movedMap[moveKey(nodeId, parentId)]) {\n                            deepDelete(this.movedSet, n);\n                        }\n                        else {\n                            this.removes.push({\n                                parentId,\n                                id: nodeId,\n                                isShadow: isShadowRoot(m.target) ? true : undefined,\n                            });\n                        }\n                        this.mapRemoves.push(n);\n                    });\n                    break;\n                }\n            }\n        };\n        this.genAdds = (n, target) => {\n            if (target && isBlocked(target, this.blockClass, this.blockSelector, this.unblockSelector)) {\n                return;\n            }\n            if (isINode(n)) {\n                if (isIgnored(n)) {\n                    return;\n                }\n                this.movedSet.add(n);\n                let targetId = null;\n                if (target && isINode(target)) {\n                    targetId = target.__sn.id;\n                }\n                if (targetId) {\n                    this.movedMap[moveKey(n.__sn.id, targetId)] = true;\n                }\n            }\n            else {\n                this.addedSet.add(n);\n                this.droppedSet.delete(n);\n            }\n            if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector))\n                n.childNodes.forEach((childN) => this.genAdds(childN));\n        };\n    }\n    init(options) {\n        [\n            'mutationCb',\n            'blockClass',\n            'blockSelector',\n            'unblockSelector',\n            'maskTextClass',\n            'maskTextSelector',\n            'unmaskTextSelector',\n            'maskInputSelector',\n            'unmaskInputSelector',\n            'inlineStylesheet',\n            'maskAllText',\n            'maskInputOptions',\n            'maskTextFn',\n            'maskInputFn',\n            'recordCanvas',\n            'inlineImages',\n            'slimDOMOptions',\n            'doc',\n            'mirror',\n            'iframeManager',\n            'shadowDomManager',\n            'canvasManager',\n        ].forEach((key) => {\n            this[key] = options[key];\n        });\n    }\n    freeze() {\n        this.frozen = true;\n        this.canvasManager.freeze();\n    }\n    unfreeze() {\n        this.frozen = false;\n        this.canvasManager.unfreeze();\n        this.emit();\n    }\n    isFrozen() {\n        return this.frozen;\n    }\n    lock() {\n        this.locked = true;\n        this.canvasManager.lock();\n    }\n    unlock() {\n        this.locked = false;\n        this.canvasManager.unlock();\n        this.emit();\n    }\n    reset() {\n        this.shadowDomManager.reset();\n        this.canvasManager.reset();\n    }\n}\nfunction deepDelete(addsSet, n) {\n    addsSet.delete(n);\n    n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\n}\nfunction isParentRemoved(removes, n, mirror) {\n    const { parentNode } = n;\n    if (!parentNode) {\n        return false;\n    }\n    const parentId = mirror.getId(parentNode);\n    if (removes.some((r) => r.id === parentId)) {\n        return true;\n    }\n    return isParentRemoved(removes, parentNode, mirror);\n}\nfunction isAncestorInSet(set, n) {\n    const { parentNode } = n;\n    if (!parentNode) {\n        return false;\n    }\n    if (set.has(parentNode)) {\n        return true;\n    }\n    return isAncestorInSet(set, parentNode);\n}\n\nexport { MutationBuffer as default };\n","const callbackWrapper = (cb) => {\n    const rrwebWrapped = (...rest) => {\n        try {\n            return cb(...rest);\n        }\n        catch (error) {\n            try {\n                error.__rrweb__ = true;\n            }\n            catch (_a) {\n            }\n            throw error;\n        }\n    };\n    return rrwebWrapped;\n};\n\nexport { callbackWrapper };\n","import { hasInputMaskOptions, maskInputValue } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { on, throttle, isBlocked, hookSetter, patch, isTouchEvent, getWindowHeight, getWindowWidth } from '../utils.js';\nimport { MouseInteractions, IncrementalSource } from '../types.js';\nimport MutationBuffer from './mutation.js';\nimport { callbackWrapper } from '../sentry/callbackWrapper.js';\n\nconst mutationBuffers = [];\nfunction getEventTarget(event) {\n    try {\n        if ('composedPath' in event) {\n            const path = event.composedPath();\n            if (path.length) {\n                return path[0];\n            }\n        }\n        else if ('path' in event && event.path.length) {\n            return event.path[0];\n        }\n    }\n    catch (_a) { }\n    return event && event.target;\n}\nfunction initMutationObserver(options, rootEl) {\n    var _a, _b;\n    const mutationBuffer = new MutationBuffer();\n    mutationBuffers.push(mutationBuffer);\n    mutationBuffer.init(options);\n    let mutationObserverCtor = window.MutationObserver ||\n        window.__rrMutationObserver;\n    const angularZoneSymbol = (_b = (_a = window === null || window === void 0 ? void 0 : window.Zone) === null || _a === void 0 ? void 0 : _a.__symbol__) === null || _b === void 0 ? void 0 : _b.call(_a, 'MutationObserver');\n    if (angularZoneSymbol &&\n        window[angularZoneSymbol]) {\n        mutationObserverCtor = window[angularZoneSymbol];\n    }\n    const observer = new mutationObserverCtor(callbackWrapper((mutations) => {\n        if (options.onMutation && options.onMutation(mutations) === false) {\n            return;\n        }\n        mutationBuffer.processMutations(mutations);\n    }));\n    observer.observe(rootEl, {\n        attributes: true,\n        attributeOldValue: true,\n        characterData: true,\n        characterDataOldValue: true,\n        childList: true,\n        subtree: true,\n    });\n    return observer;\n}\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\n    if (sampling.mousemove === false) {\n        return () => { };\n    }\n    const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\n    const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\n        ? sampling.mousemoveCallback\n        : 500;\n    let positions = [];\n    let timeBaseline;\n    const wrappedCb = throttle((source) => {\n        const totalOffset = Date.now() - timeBaseline;\n        callbackWrapper(mousemoveCb)(positions.map((p) => {\n            p.timeOffset -= totalOffset;\n            return p;\n        }), source);\n        positions = [];\n        timeBaseline = null;\n    }, callbackThreshold);\n    const updatePosition = throttle((evt) => {\n        const target = getEventTarget(evt);\n        const { clientX, clientY } = isTouchEvent(evt)\n            ? evt.changedTouches[0]\n            : evt;\n        if (!timeBaseline) {\n            timeBaseline = Date.now();\n        }\n        positions.push({\n            x: clientX,\n            y: clientY,\n            id: mirror.getId(target),\n            timeOffset: Date.now() - timeBaseline,\n        });\n        wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\n            ? IncrementalSource.Drag\n            : evt instanceof MouseEvent\n                ? IncrementalSource.MouseMove\n                : IncrementalSource.TouchMove);\n    }, threshold, {\n        trailing: false,\n    });\n    const handlers = [\n        on('mousemove', callbackWrapper(updatePosition), doc),\n        on('touchmove', callbackWrapper(updatePosition), doc),\n        on('drag', callbackWrapper(updatePosition), doc),\n    ];\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n    if (sampling.mouseInteraction === false) {\n        return () => { };\n    }\n    const disableMap = sampling.mouseInteraction === true ||\n        sampling.mouseInteraction === undefined\n        ? {}\n        : sampling.mouseInteraction;\n    const handlers = [];\n    const getHandler = (eventKey) => {\n        return (event) => {\n            const target = getEventTarget(event);\n            if (isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n                return;\n            }\n            const e = isTouchEvent(event) ? event.changedTouches[0] : event;\n            if (!e) {\n                return;\n            }\n            const id = mirror.getId(target);\n            const { clientX, clientY } = e;\n            callbackWrapper(mouseInteractionCb)({\n                type: MouseInteractions[eventKey],\n                id,\n                x: clientX,\n                y: clientY,\n            });\n        };\n    };\n    Object.keys(MouseInteractions)\n        .filter((key) => Number.isNaN(Number(key)) &&\n        !key.endsWith('_Departed') &&\n        disableMap[key] !== false)\n        .forEach((eventKey) => {\n        const eventName = eventKey.toLowerCase();\n        const handler = callbackWrapper(getHandler(eventKey));\n        handlers.push(on(eventName, handler, doc));\n    });\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n    const updatePosition = throttle((evt) => {\n        const target = getEventTarget(evt);\n        if (!target ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        const id = mirror.getId(target);\n        if (target === doc) {\n            const scrollEl = (doc.scrollingElement || doc.documentElement);\n            callbackWrapper(scrollCb)({\n                id,\n                x: scrollEl.scrollLeft,\n                y: scrollEl.scrollTop,\n            });\n        }\n        else {\n            callbackWrapper(scrollCb)({\n                id,\n                x: target.scrollLeft,\n                y: target.scrollTop,\n            });\n        }\n    }, sampling.scroll || 100);\n    return on('scroll', callbackWrapper(updatePosition), doc);\n}\nfunction initViewportResizeObserver({ viewportResizeCb, }) {\n    let lastH = -1;\n    let lastW = -1;\n    const updateDimension = throttle(() => {\n        const height = getWindowHeight();\n        const width = getWindowWidth();\n        if (lastH !== height || lastW !== width) {\n            callbackWrapper(viewportResizeCb)({\n                width: Number(width),\n                height: Number(height),\n            });\n            lastH = height;\n            lastW = width;\n        }\n    }, 200);\n    return on('resize', callbackWrapper(updateDimension), window);\n}\nfunction wrapEventWithUserTriggeredFlag(v, enable) {\n    const value = Object.assign({}, v);\n    if (!enable)\n        delete value.userTriggered;\n    return value;\n}\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\nconst lastInputValueMap = new WeakMap();\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputSelector, unmaskInputSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, }) {\n    function eventHandler(event) {\n        let target = getEventTarget(event);\n        const tagName = target && target.tagName;\n        const userTriggered = event.isTrusted;\n        if (tagName === 'OPTION')\n            target = target.parentElement;\n        if (!target ||\n            !tagName ||\n            INPUT_TAGS.indexOf(tagName) < 0 ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        let type = target.type;\n        if (target.classList.contains(ignoreClass) ||\n            (ignoreSelector && target.matches(ignoreSelector))) {\n            return;\n        }\n        let text = target.value;\n        let isChecked = false;\n        if (target.hasAttribute('rr_is_password')) {\n            type = 'password';\n        }\n        if (type === 'radio' || type === 'checkbox') {\n            isChecked = target.checked;\n        }\n        else if (hasInputMaskOptions({\n            maskInputOptions,\n            maskInputSelector,\n            tagName,\n            type,\n        })) {\n            text = maskInputValue({\n                input: target,\n                maskInputOptions,\n                maskInputSelector,\n                unmaskInputSelector,\n                tagName,\n                type,\n                value: text,\n                maskInputFn,\n            });\n        }\n        cbWithDedup(target, callbackWrapper(wrapEventWithUserTriggeredFlag)({ text, isChecked, userTriggered }, userTriggeredOnInput));\n        const name = target.name;\n        if (type === 'radio' && name && isChecked) {\n            doc\n                .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\n                .forEach((el) => {\n                if (el !== target) {\n                    cbWithDedup(el, callbackWrapper(wrapEventWithUserTriggeredFlag)({\n                        text: el.value,\n                        isChecked: !isChecked,\n                        userTriggered: false,\n                    }, userTriggeredOnInput));\n                }\n            });\n        }\n    }\n    function cbWithDedup(target, v) {\n        const lastInputValue = lastInputValueMap.get(target);\n        if (!lastInputValue ||\n            lastInputValue.text !== v.text ||\n            lastInputValue.isChecked !== v.isChecked) {\n            lastInputValueMap.set(target, v);\n            const id = mirror.getId(target);\n            inputCb(Object.assign(Object.assign({}, v), { id }));\n        }\n    }\n    const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\n    const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\n    const propertyDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');\n    const hookProperties = [\n        [HTMLInputElement.prototype, 'value'],\n        [HTMLInputElement.prototype, 'checked'],\n        [HTMLSelectElement.prototype, 'value'],\n        [HTMLTextAreaElement.prototype, 'value'],\n        [HTMLSelectElement.prototype, 'selectedIndex'],\n        [HTMLOptionElement.prototype, 'selected'],\n    ];\n    if (propertyDescriptor && propertyDescriptor.set) {\n        handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\n            set() {\n                callbackWrapper(eventHandler)({ target: this });\n            },\n        })));\n    }\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction getNestedCSSRulePositions(rule) {\n    const positions = [];\n    function recurse(childRule, pos) {\n        if ((hasNestedCSSRule('CSSGroupingRule') &&\n            childRule.parentRule instanceof CSSGroupingRule) ||\n            (hasNestedCSSRule('CSSMediaRule') &&\n                childRule.parentRule instanceof CSSMediaRule) ||\n            (hasNestedCSSRule('CSSSupportsRule') &&\n                childRule.parentRule instanceof CSSSupportsRule) ||\n            (hasNestedCSSRule('CSSConditionRule') &&\n                childRule.parentRule instanceof CSSConditionRule)) {\n            const rules = Array.from(childRule.parentRule.cssRules);\n            const index = rules.indexOf(childRule);\n            pos.unshift(index);\n        }\n        else {\n            const rules = Array.from(childRule.parentStyleSheet.cssRules);\n            const index = rules.indexOf(childRule);\n            pos.unshift(index);\n        }\n        return pos;\n    }\n    return recurse(rule, positions);\n}\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror }, { win }) {\n    if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n        return () => { };\n    }\n    const insertRule = win.CSSStyleSheet.prototype.insertRule;\n    win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            const [rule, index] = argumentsList;\n            const id = mirror.getId(thisArg.ownerNode);\n            if (id !== -1) {\n                styleSheetRuleCb({\n                    id,\n                    adds: [{ rule, index }],\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n    win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            const [index] = argumentsList;\n            const id = mirror.getId(thisArg.ownerNode);\n            if (id !== -1) {\n                styleSheetRuleCb({\n                    id,\n                    removes: [{ index }],\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const supportedNestedCSSRuleTypes = {};\n    if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\n        supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n    }\n    else {\n        if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\n            supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n        }\n        if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\n            supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n        }\n        if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\n            supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n        }\n    }\n    const unmodifiedFunctions = {};\n    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n        unmodifiedFunctions[typeKey] = {\n            insertRule: type.prototype.insertRule,\n            deleteRule: type.prototype.deleteRule,\n        };\n        type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\n                const [rule, index] = argumentsList;\n                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);\n                if (id !== -1) {\n                    styleSheetRuleCb({\n                        id,\n                        adds: [\n                            {\n                                rule,\n                                index: [\n                                    ...getNestedCSSRulePositions(thisArg),\n                                    index || 0,\n                                ],\n                            },\n                        ],\n                    });\n                }\n                return target.apply(thisArg, argumentsList);\n            }),\n        });\n        type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\n            apply: callbackWrapper((target, thisArg, argumentsList) => {\n                const [index] = argumentsList;\n                const id = mirror.getId(thisArg.parentStyleSheet.ownerNode);\n                if (id !== -1) {\n                    styleSheetRuleCb({\n                        id,\n                        removes: [\n                            { index: [...getNestedCSSRulePositions(thisArg), index] },\n                        ],\n                    });\n                }\n                return target.apply(thisArg, argumentsList);\n            }),\n        });\n    });\n    return callbackWrapper(() => {\n        win.CSSStyleSheet.prototype.insertRule = insertRule;\n        win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n        Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n            type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n            type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n        });\n    });\n}\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror }, { win }) {\n    const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n    win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            var _a, _b;\n            const [property, value, priority] = argumentsList;\n            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);\n            if (id !== -1) {\n                styleDeclarationCb({\n                    id,\n                    set: {\n                        property,\n                        value,\n                        priority,\n                    },\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n    win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n        apply: callbackWrapper((target, thisArg, argumentsList) => {\n            var _a, _b;\n            const [property] = argumentsList;\n            const id = mirror.getId((_b = (_a = thisArg.parentRule) === null || _a === void 0 ? void 0 : _a.parentStyleSheet) === null || _b === void 0 ? void 0 : _b.ownerNode);\n            if (id !== -1) {\n                styleDeclarationCb({\n                    id,\n                    remove: {\n                        property,\n                    },\n                    index: getNestedCSSRulePositions(thisArg.parentRule),\n                });\n            }\n            return target.apply(thisArg, argumentsList);\n        }),\n    });\n    return callbackWrapper(() => {\n        win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n        win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n    });\n}\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, }) {\n    const handler = (type) => throttle(callbackWrapper((event) => {\n        const target = getEventTarget(event);\n        if (!target ||\n            isBlocked(target, blockClass, blockSelector, unblockSelector)) {\n            return;\n        }\n        const { currentTime, volume, muted } = target;\n        mediaInteractionCb({\n            type,\n            id: mirror.getId(target),\n            currentTime,\n            volume,\n            muted,\n        });\n    }), sampling.media || 500);\n    const handlers = [\n        on('play', handler(0)),\n        on('pause', handler(1)),\n        on('seeked', handler(2)),\n        on('volumechange', handler(3)),\n    ];\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction initFontObserver({ fontCb, doc }) {\n    const win = doc.defaultView;\n    if (!win) {\n        return () => { };\n    }\n    const handlers = [];\n    const fontMap = new WeakMap();\n    const originalFontFace = win.FontFace;\n    win.FontFace = function FontFace(family, source, descriptors) {\n        const fontFace = new originalFontFace(family, source, descriptors);\n        fontMap.set(fontFace, {\n            family,\n            buffer: typeof source !== 'string',\n            descriptors,\n            fontSource: typeof source === 'string'\n                ? source\n                :\n                    JSON.stringify(Array.from(new Uint8Array(source))),\n        });\n        return fontFace;\n    };\n    const restoreHandler = patch(doc.fonts, 'add', function (original) {\n        return function (fontFace) {\n            setTimeout(() => {\n                const p = fontMap.get(fontFace);\n                if (p) {\n                    fontCb(p);\n                    fontMap.delete(fontFace);\n                }\n            }, 0);\n            return original.apply(this, [fontFace]);\n        };\n    });\n    handlers.push(() => {\n        win.FontFace = originalFontFace;\n    });\n    handlers.push(restoreHandler);\n    return callbackWrapper(() => {\n        handlers.forEach((h) => h());\n    });\n}\nfunction mergeHooks(o, hooks) {\n    const { mutationCb, mousemoveCb, mouseInteractionCb, scrollCb, viewportResizeCb, inputCb, mediaInteractionCb, styleSheetRuleCb, styleDeclarationCb, canvasMutationCb, fontCb, } = o;\n    o.mutationCb = (...p) => {\n        if (hooks.mutation) {\n            hooks.mutation(...p);\n        }\n        mutationCb(...p);\n    };\n    o.mousemoveCb = (...p) => {\n        if (hooks.mousemove) {\n            hooks.mousemove(...p);\n        }\n        mousemoveCb(...p);\n    };\n    o.mouseInteractionCb = (...p) => {\n        if (hooks.mouseInteraction) {\n            hooks.mouseInteraction(...p);\n        }\n        mouseInteractionCb(...p);\n    };\n    o.scrollCb = (...p) => {\n        if (hooks.scroll) {\n            hooks.scroll(...p);\n        }\n        scrollCb(...p);\n    };\n    o.viewportResizeCb = (...p) => {\n        if (hooks.viewportResize) {\n            hooks.viewportResize(...p);\n        }\n        viewportResizeCb(...p);\n    };\n    o.inputCb = (...p) => {\n        if (hooks.input) {\n            hooks.input(...p);\n        }\n        inputCb(...p);\n    };\n    o.mediaInteractionCb = (...p) => {\n        if (hooks.mediaInteaction) {\n            hooks.mediaInteaction(...p);\n        }\n        mediaInteractionCb(...p);\n    };\n    o.styleSheetRuleCb = (...p) => {\n        if (hooks.styleSheetRule) {\n            hooks.styleSheetRule(...p);\n        }\n        styleSheetRuleCb(...p);\n    };\n    o.styleDeclarationCb = (...p) => {\n        if (hooks.styleDeclaration) {\n            hooks.styleDeclaration(...p);\n        }\n        styleDeclarationCb(...p);\n    };\n    o.canvasMutationCb = (...p) => {\n        if (hooks.canvasMutation) {\n            hooks.canvasMutation(...p);\n        }\n        canvasMutationCb(...p);\n    };\n    o.fontCb = (...p) => {\n        if (hooks.font) {\n            hooks.font(...p);\n        }\n        fontCb(...p);\n    };\n}\nfunction initObservers(o, hooks = {}) {\n    const currentWindow = o.doc.defaultView;\n    if (!currentWindow) {\n        return () => { };\n    }\n    mergeHooks(o, hooks);\n    const mutationObserver = initMutationObserver(o, o.doc);\n    const mousemoveHandler = initMoveObserver(o);\n    const mouseInteractionHandler = initMouseInteractionObserver(o);\n    const scrollHandler = initScrollObserver(o);\n    const viewportResizeHandler = initViewportResizeObserver(o);\n    const inputHandler = initInputObserver(o);\n    const mediaInteractionHandler = initMediaInteractionObserver(o);\n    const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\n    const styleDeclarationObserver = initStyleDeclarationObserver(o, {\n        win: currentWindow,\n    });\n    const fontObserver = o.collectFonts ? initFontObserver(o) : () => { };\n    const pluginHandlers = [];\n    for (const plugin of o.plugins) {\n        pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\n    }\n    return callbackWrapper(() => {\n        mutationBuffers.forEach((b) => b.reset());\n        mutationObserver.disconnect();\n        mousemoveHandler();\n        mouseInteractionHandler();\n        scrollHandler();\n        viewportResizeHandler();\n        inputHandler();\n        mediaInteractionHandler();\n        try {\n            styleSheetObserver();\n            styleDeclarationObserver();\n        }\n        catch (e) {\n        }\n        fontObserver();\n        pluginHandlers.forEach((h) => h());\n    });\n}\nfunction hasNestedCSSRule(prop) {\n    return typeof window[prop] !== 'undefined';\n}\nfunction canMonkeyPatchNestedCSSRule(prop) {\n    return Boolean(typeof window[prop] !== 'undefined' &&\n        window[prop].prototype &&\n        'insertRule' in window[prop].prototype &&\n        'deleteRule' in window[prop].prototype);\n}\n\nexport { INPUT_TAGS, initMutationObserver, initObservers, initScrollObserver, mutationBuffers };\n","class IframeManager {\n    constructor(options) {\n        this.iframes = new WeakMap();\n        this.mutationCb = options.mutationCb;\n    }\n    addIframe(iframeEl) {\n        this.iframes.set(iframeEl, true);\n    }\n    addLoadListener(cb) {\n        this.loadListener = cb;\n    }\n    attachIframe(iframeEl, childSn) {\n        var _a;\n        this.mutationCb({\n            adds: [\n                {\n                    parentId: iframeEl.__sn.id,\n                    nextId: null,\n                    node: childSn,\n                },\n            ],\n            removes: [],\n            texts: [],\n            attributes: [],\n            isAttachIframe: true,\n        });\n        (_a = this.loadListener) === null || _a === void 0 ? void 0 : _a.call(this, iframeEl);\n    }\n}\n\nexport { IframeManager };\n","import { initMutationObserver, initScrollObserver } from './observer.js';\nimport { patch } from '../utils.js';\n\nclass ShadowDomManager {\n    constructor(options) {\n        this.restorePatches = [];\n        this.mutationCb = options.mutationCb;\n        this.scrollCb = options.scrollCb;\n        this.bypassOptions = options.bypassOptions;\n        this.mirror = options.mirror;\n        const manager = this;\n        this.restorePatches.push(patch(HTMLElement.prototype, 'attachShadow', function (original) {\n            return function () {\n                const shadowRoot = original.apply(this, arguments);\n                if (this.shadowRoot)\n                    manager.addShadowRoot(this.shadowRoot, this.ownerDocument);\n                return shadowRoot;\n            };\n        }));\n    }\n    addShadowRoot(shadowRoot, doc) {\n        initMutationObserver(Object.assign(Object.assign({}, this.bypassOptions), { doc, mutationCb: this.mutationCb, mirror: this.mirror, shadowDomManager: this }), shadowRoot);\n        initScrollObserver(Object.assign(Object.assign({}, this.bypassOptions), { scrollCb: this.scrollCb, doc: shadowRoot, mirror: this.mirror }));\n    }\n    observeAttachShadow(iframeElement) {\n        if (iframeElement.contentWindow) {\n            const manager = this;\n            this.restorePatches.push(patch(iframeElement.contentWindow.HTMLElement.prototype, 'attachShadow', function (original) {\n                return function () {\n                    const shadowRoot = original.apply(this, arguments);\n                    if (this.shadowRoot)\n                        manager.addShadowRoot(this.shadowRoot, iframeElement.contentDocument);\n                    return shadowRoot;\n                };\n            }));\n        }\n    }\n    reset() {\n        this.restorePatches.forEach((restorePatch) => restorePatch());\n    }\n}\n\nexport { ShadowDomManager };\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\n\nexport { __rest };\n","import { CanvasContext } from '../../../types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\n\nfunction initCanvas2DMutationObserver(cb, win, blockClass, unblockSelector, blockSelector, mirror) {\n    const handlers = [];\n    const props2D = Object.getOwnPropertyNames(win.CanvasRenderingContext2D.prototype);\n    for (const prop of props2D) {\n        try {\n            if (typeof win.CanvasRenderingContext2D.prototype[prop] !== 'function') {\n                continue;\n            }\n            const restoreHandler = patch(win.CanvasRenderingContext2D.prototype, prop, function (original) {\n                return function (...args) {\n                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {\n                        setTimeout(() => {\n                            const recordArgs = [...args];\n                            if (prop === 'drawImage') {\n                                if (recordArgs[0] &&\n                                    recordArgs[0] instanceof HTMLCanvasElement) {\n                                    const canvas = recordArgs[0];\n                                    const ctx = canvas.getContext('2d');\n                                    let imgd = ctx === null || ctx === void 0 ? void 0 : ctx.getImageData(0, 0, canvas.width, canvas.height);\n                                    let pix = imgd === null || imgd === void 0 ? void 0 : imgd.data;\n                                    recordArgs[0] = JSON.stringify(pix);\n                                }\n                            }\n                            cb(this.canvas, {\n                                type: CanvasContext['2D'],\n                                property: prop,\n                                args: recordArgs,\n                            });\n                        }, 0);\n                    }\n                    return original.apply(this, args);\n                };\n            });\n            handlers.push(restoreHandler);\n        }\n        catch (_a) {\n            const hookHandler = hookSetter(win.CanvasRenderingContext2D.prototype, prop, {\n                set(v) {\n                    cb(this.canvas, {\n                        type: CanvasContext['2D'],\n                        property: prop,\n                        args: [v],\n                        setter: true,\n                    });\n                },\n            });\n            handlers.push(hookHandler);\n        }\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvas2DMutationObserver as default };\n","import { patch, isBlocked } from '../../../utils.js';\n\nfunction initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector) {\n    const handlers = [];\n    try {\n        const restoreHandler = patch(win.HTMLCanvasElement.prototype, 'getContext', function (original) {\n            return function (contextType, ...args) {\n                if (!isBlocked(this, blockClass, blockSelector, unblockSelector)) {\n                    if (!('__context' in this))\n                        this.__context = contextType;\n                }\n                return original.apply(this, [contextType, ...args]);\n            };\n        });\n        handlers.push(restoreHandler);\n    }\n    catch (_a) {\n        console.error('failed to patch HTMLCanvasElement.prototype.getContext');\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvasContextObserver as default };\n","/*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nvar lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function (arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n    for (i = 0; i < len; i += 3) {\n        base64 += chars[bytes[i] >> 2];\n        base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n        base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n        base64 += chars[bytes[i + 2] & 63];\n    }\n    if (len % 3 === 2) {\n        base64 = base64.substring(0, base64.length - 1) + '=';\n    }\n    else if (len % 3 === 1) {\n        base64 = base64.substring(0, base64.length - 2) + '==';\n    }\n    return base64;\n};\nvar decode = function (base64) {\n    var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n    if (base64[base64.length - 1] === '=') {\n        bufferLength--;\n        if (base64[base64.length - 2] === '=') {\n            bufferLength--;\n        }\n    }\n    var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n    for (i = 0; i < len; i += 4) {\n        encoded1 = lookup[base64.charCodeAt(i)];\n        encoded2 = lookup[base64.charCodeAt(i + 1)];\n        encoded3 = lookup[base64.charCodeAt(i + 2)];\n        encoded4 = lookup[base64.charCodeAt(i + 3)];\n        bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n        bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n        bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n    return arraybuffer;\n};\n\nexport { decode, encode };\n","import { encode } from './../../../../../../ext/base64-arraybuffer/dist/base64-arraybuffer.es5.js';\n\nconst webGLVarMap = new Map();\nfunction variableListFor(ctx, ctor) {\n    let contextMap = webGLVarMap.get(ctx);\n    if (!contextMap) {\n        contextMap = new Map();\n        webGLVarMap.set(ctx, contextMap);\n    }\n    if (!contextMap.has(ctor)) {\n        contextMap.set(ctor, []);\n    }\n    return contextMap.get(ctor);\n}\nconst saveWebGLVar = (value, win, ctx) => {\n    if (!value ||\n        !(isInstanceOfWebGLObject(value, win) || typeof value === 'object'))\n        return;\n    const name = value.constructor.name;\n    const list = variableListFor(ctx, name);\n    let index = list.indexOf(value);\n    if (index === -1) {\n        index = list.length;\n        list.push(value);\n    }\n    return index;\n};\nfunction serializeArg(value, win, ctx) {\n    if (value instanceof Array) {\n        return value.map((arg) => serializeArg(arg, win, ctx));\n    }\n    else if (value === null) {\n        return value;\n    }\n    else if (value instanceof Float32Array ||\n        value instanceof Float64Array ||\n        value instanceof Int32Array ||\n        value instanceof Uint32Array ||\n        value instanceof Uint8Array ||\n        value instanceof Uint16Array ||\n        value instanceof Int16Array ||\n        value instanceof Int8Array ||\n        value instanceof Uint8ClampedArray) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [Object.values(value)],\n        };\n    }\n    else if (value instanceof ArrayBuffer) {\n        const name = value.constructor.name;\n        const base64 = encode(value);\n        return {\n            rr_type: name,\n            base64,\n        };\n    }\n    else if (value instanceof DataView) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [\n                serializeArg(value.buffer, win, ctx),\n                value.byteOffset,\n                value.byteLength,\n            ],\n        };\n    }\n    else if (value instanceof HTMLImageElement) {\n        const name = value.constructor.name;\n        const { src } = value;\n        return {\n            rr_type: name,\n            src,\n        };\n    }\n    else if (value instanceof ImageData) {\n        const name = value.constructor.name;\n        return {\n            rr_type: name,\n            args: [serializeArg(value.data, win, ctx), value.width, value.height],\n        };\n    }\n    else if (isInstanceOfWebGLObject(value, win) || typeof value === 'object') {\n        const name = value.constructor.name;\n        const index = saveWebGLVar(value, win, ctx);\n        return {\n            rr_type: name,\n            index: index,\n        };\n    }\n    return value;\n}\nconst serializeArgs = (args, win, ctx) => {\n    return [...args].map((arg) => serializeArg(arg, win, ctx));\n};\nconst isInstanceOfWebGLObject = (value, win) => {\n    const webGLConstructorNames = [\n        'WebGLActiveInfo',\n        'WebGLBuffer',\n        'WebGLFramebuffer',\n        'WebGLProgram',\n        'WebGLRenderbuffer',\n        'WebGLShader',\n        'WebGLShaderPrecisionFormat',\n        'WebGLTexture',\n        'WebGLUniformLocation',\n        'WebGLVertexArrayObject',\n        'WebGLVertexArrayObjectOES',\n    ];\n    const supportedWebGLConstructorNames = webGLConstructorNames.filter((name) => typeof win[name] === 'function');\n    return Boolean(supportedWebGLConstructorNames.find((name) => value instanceof win[name]));\n};\n\nexport { isInstanceOfWebGLObject, saveWebGLVar, serializeArg, serializeArgs, variableListFor };\n","import { CanvasContext } from '../../../types.js';\nimport { patch, isBlocked, hookSetter } from '../../../utils.js';\nimport { saveWebGLVar, serializeArgs } from './serialize-args.js';\n\nfunction patchGLPrototype(prototype, type, cb, blockClass, unblockSelector, blockSelector, mirror, win) {\n    const handlers = [];\n    const props = Object.getOwnPropertyNames(prototype);\n    for (const prop of props) {\n        try {\n            if (typeof prototype[prop] !== 'function') {\n                continue;\n            }\n            const restoreHandler = patch(prototype, prop, function (original) {\n                return function (...args) {\n                    const result = original.apply(this, args);\n                    saveWebGLVar(result, win, prototype);\n                    if (!isBlocked(this.canvas, blockClass, blockSelector, unblockSelector)) {\n                        const id = mirror.getId(this.canvas);\n                        const recordArgs = serializeArgs([...args], win, prototype);\n                        const mutation = {\n                            type,\n                            property: prop,\n                            args: recordArgs,\n                        };\n                        cb(this.canvas, mutation);\n                    }\n                    return result;\n                };\n            });\n            handlers.push(restoreHandler);\n        }\n        catch (_a) {\n            const hookHandler = hookSetter(prototype, prop, {\n                set(v) {\n                    cb(this.canvas, {\n                        type,\n                        property: prop,\n                        args: [v],\n                        setter: true,\n                    });\n                },\n            });\n            handlers.push(hookHandler);\n        }\n    }\n    return handlers;\n}\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector, unblockSelector, mirror) {\n    const handlers = [];\n    handlers.push(...patchGLPrototype(win.WebGLRenderingContext.prototype, CanvasContext.WebGL, cb, blockClass, blockSelector, unblockSelector, mirror, win));\n    if (typeof win.WebGL2RenderingContext !== 'undefined') {\n        handlers.push(...patchGLPrototype(win.WebGL2RenderingContext.prototype, CanvasContext.WebGL2, cb, blockClass, blockSelector, unblockSelector, mirror, win));\n    }\n    return () => {\n        handlers.forEach((h) => h());\n    };\n}\n\nexport { initCanvasWebGLMutationObserver as default };\n","import { __rest } from './../../../../../../ext/tslib/tslib.es6.js';\nimport initCanvas2DMutationObserver from './2d.js';\nimport initCanvasContextObserver from './canvas.js';\nimport initCanvasWebGLMutationObserver from './webgl.js';\n\nclass CanvasManager {\n    reset() {\n        this.pendingCanvasMutations.clear();\n        this.resetObservers && this.resetObservers();\n    }\n    freeze() {\n        this.frozen = true;\n    }\n    unfreeze() {\n        this.frozen = false;\n    }\n    lock() {\n        this.locked = true;\n    }\n    unlock() {\n        this.locked = false;\n    }\n    constructor(options) {\n        this.pendingCanvasMutations = new Map();\n        this.rafStamps = { latestId: 0, invokeId: null };\n        this.frozen = false;\n        this.locked = false;\n        this.processMutation = function (target, mutation) {\n            const newFrame = this.rafStamps.invokeId &&\n                this.rafStamps.latestId !== this.rafStamps.invokeId;\n            if (newFrame || !this.rafStamps.invokeId)\n                this.rafStamps.invokeId = this.rafStamps.latestId;\n            if (!this.pendingCanvasMutations.has(target)) {\n                this.pendingCanvasMutations.set(target, []);\n            }\n            this.pendingCanvasMutations.get(target).push(mutation);\n        };\n        this.mutationCb = options.mutationCb;\n        this.mirror = options.mirror;\n        if (options.recordCanvas === true)\n            this.initCanvasMutationObserver(options.win, options.blockClass, options.blockSelector, options.unblockSelector);\n    }\n    initCanvasMutationObserver(win, blockClass, unblockSelector, blockSelector) {\n        this.startRAFTimestamping();\n        this.startPendingCanvasMutationFlusher();\n        const canvasContextReset = initCanvasContextObserver(win, blockClass, blockSelector, unblockSelector);\n        const canvas2DReset = initCanvas2DMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\n        const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(this.processMutation.bind(this), win, blockClass, blockSelector, unblockSelector, this.mirror);\n        this.resetObservers = () => {\n            canvasContextReset();\n            canvas2DReset();\n            canvasWebGL1and2Reset();\n        };\n    }\n    startPendingCanvasMutationFlusher() {\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\n    }\n    startRAFTimestamping() {\n        const setLatestRAFTimestamp = (timestamp) => {\n            this.rafStamps.latestId = timestamp;\n            requestAnimationFrame(setLatestRAFTimestamp);\n        };\n        requestAnimationFrame(setLatestRAFTimestamp);\n    }\n    flushPendingCanvasMutations() {\n        this.pendingCanvasMutations.forEach((values, canvas) => {\n            const id = this.mirror.getId(canvas);\n            this.flushPendingCanvasMutationFor(canvas, id);\n        });\n        requestAnimationFrame(() => this.flushPendingCanvasMutations());\n    }\n    flushPendingCanvasMutationFor(canvas, id) {\n        if (this.frozen || this.locked) {\n            return;\n        }\n        const valuesWithType = this.pendingCanvasMutations.get(canvas);\n        if (!valuesWithType || id === -1)\n            return;\n        const values = valuesWithType.map((value) => {\n            const rest = __rest(value, [\"type\"]);\n            return rest;\n        });\n        const { type } = valuesWithType[0];\n        this.mutationCb({ id, type, commands: values });\n        this.pendingCanvasMutations.delete(canvas);\n    }\n}\n\nexport { CanvasManager };\n","import { snapshot } from '../../../rrweb-snapshot/es/rrweb-snapshot.js';\nimport { initObservers, mutationBuffers } from './observer.js';\nimport { polyfill, on, createMirror, getWindowWidth, getWindowHeight, isIframeINode, hasShadowRoot } from '../utils.js';\nimport { EventType, IncrementalSource } from '../types.js';\nimport { IframeManager } from './iframe-manager.js';\nimport { ShadowDomManager } from './shadow-dom-manager.js';\nimport { CanvasManager } from './observers/canvas/canvas-manager.js';\nimport { callbackWrapper } from '../sentry/callbackWrapper.js';\n\nfunction wrapEvent(e) {\n    return Object.assign(Object.assign({}, e), { timestamp: Date.now() });\n}\nlet wrappedEmit;\nlet takeFullSnapshot;\nconst mirror = createMirror();\nfunction record(options = {}) {\n    const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, maskInputSelector = null, unmaskTextSelector = null, unmaskInputSelector = null, inlineStylesheet = true, maskAllText = false, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskInputFn, maskTextFn, hooks, packFn, sampling = {}, mousemoveWait, recordCanvas = false, userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, onMutation, } = options;\n    if (!emit) {\n        throw new Error('emit function is required');\n    }\n    if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\n        sampling.mousemove = mousemoveWait;\n    }\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n            radio: true,\n            checkbox: true,\n        }\n        : _maskInputOptions !== undefined\n            ? _maskInputOptions\n            : {};\n    const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\n        ? {\n            script: true,\n            comment: true,\n            headFavicon: true,\n            headWhitespace: true,\n            headMetaSocial: true,\n            headMetaRobots: true,\n            headMetaHttpEquiv: true,\n            headMetaVerification: true,\n            headMetaAuthorship: _slimDOMOptions === 'all',\n            headMetaDescKeywords: _slimDOMOptions === 'all',\n        }\n        : _slimDOMOptions\n            ? _slimDOMOptions\n            : {};\n    polyfill();\n    let lastFullSnapshotEvent;\n    let incrementalSnapshotCount = 0;\n    const eventProcessor = (e) => {\n        for (const plugin of plugins || []) {\n            if (plugin.eventProcessor) {\n                e = plugin.eventProcessor(e);\n            }\n        }\n        if (packFn) {\n            e = packFn(e);\n        }\n        return e;\n    };\n    wrappedEmit = (e, isCheckout) => {\n        var _a;\n        if (((_a = mutationBuffers[0]) === null || _a === void 0 ? void 0 : _a.isFrozen()) &&\n            e.type !== EventType.FullSnapshot &&\n            !(e.type === EventType.IncrementalSnapshot &&\n                e.data.source === IncrementalSource.Mutation)) {\n            mutationBuffers.forEach((buf) => buf.unfreeze());\n        }\n        emit(eventProcessor(e), isCheckout);\n        if (e.type === EventType.FullSnapshot) {\n            lastFullSnapshotEvent = e;\n            incrementalSnapshotCount = 0;\n        }\n        else if (e.type === EventType.IncrementalSnapshot) {\n            if (e.data.source === IncrementalSource.Mutation &&\n                e.data.isAttachIframe) {\n                return;\n            }\n            incrementalSnapshotCount++;\n            const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n            const exceedTime = checkoutEveryNms &&\n                e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n            if (exceedCount || exceedTime) {\n                takeFullSnapshot(true);\n            }\n        }\n    };\n    const wrappedMutationEmit = (m) => {\n        wrappedEmit(wrapEvent({\n            type: EventType.IncrementalSnapshot,\n            data: Object.assign({ source: IncrementalSource.Mutation }, m),\n        }));\n    };\n    const wrappedScrollEmit = (p) => wrappedEmit(wrapEvent({\n        type: EventType.IncrementalSnapshot,\n        data: Object.assign({ source: IncrementalSource.Scroll }, p),\n    }));\n    const wrappedCanvasMutationEmit = (p) => wrappedEmit(wrapEvent({\n        type: EventType.IncrementalSnapshot,\n        data: Object.assign({ source: IncrementalSource.CanvasMutation }, p),\n    }));\n    const iframeManager = new IframeManager({\n        mutationCb: wrappedMutationEmit,\n    });\n    const canvasManager = new CanvasManager({\n        recordCanvas,\n        mutationCb: wrappedCanvasMutationEmit,\n        win: window,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        mirror,\n    });\n    const shadowDomManager = new ShadowDomManager({\n        mutationCb: wrappedMutationEmit,\n        scrollCb: wrappedScrollEmit,\n        bypassOptions: {\n            onMutation,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            maskInputSelector,\n            unmaskInputSelector,\n            inlineStylesheet,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            recordCanvas,\n            inlineImages,\n            sampling,\n            slimDOMOptions,\n            iframeManager,\n            canvasManager,\n        },\n        mirror,\n    });\n    takeFullSnapshot = (isCheckout = false) => {\n        var _a, _b, _c, _d;\n        wrappedEmit(wrapEvent({\n            type: EventType.Meta,\n            data: {\n                href: window.location.href,\n                width: getWindowWidth(),\n                height: getWindowHeight(),\n            },\n        }), isCheckout);\n        mutationBuffers.forEach((buf) => buf.lock());\n        const [node, idNodeMap] = snapshot(document, {\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            maskInputSelector,\n            unmaskInputSelector,\n            inlineStylesheet,\n            maskAllText,\n            maskAllInputs: maskInputOptions,\n            maskTextFn,\n            slimDOM: slimDOMOptions,\n            recordCanvas,\n            inlineImages,\n            onSerialize: (n) => {\n                if (isIframeINode(n)) {\n                    iframeManager.addIframe(n);\n                }\n                if (hasShadowRoot(n)) {\n                    shadowDomManager.addShadowRoot(n.shadowRoot, document);\n                }\n            },\n            onIframeLoad: (iframe, childSn) => {\n                iframeManager.attachIframe(iframe, childSn);\n                shadowDomManager.observeAttachShadow(iframe);\n            },\n            keepIframeSrcFn,\n        });\n        if (!node) {\n            return console.warn('Failed to snapshot the document');\n        }\n        mirror.map = idNodeMap;\n        wrappedEmit(wrapEvent({\n            type: EventType.FullSnapshot,\n            data: {\n                node,\n                initialOffset: {\n                    left: window.pageXOffset !== undefined\n                        ? window.pageXOffset\n                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollLeft) ||\n                            ((_b = (_a = document === null || document === void 0 ? void 0 : document.body) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.scrollLeft) ||\n                            (document === null || document === void 0 ? void 0 : document.body.scrollLeft) ||\n                            0,\n                    top: window.pageYOffset !== undefined\n                        ? window.pageYOffset\n                        : (document === null || document === void 0 ? void 0 : document.documentElement.scrollTop) ||\n                            ((_d = (_c = document === null || document === void 0 ? void 0 : document.body) === null || _c === void 0 ? void 0 : _c.parentElement) === null || _d === void 0 ? void 0 : _d.scrollTop) ||\n                            (document === null || document === void 0 ? void 0 : document.body.scrollTop) ||\n                            0,\n                },\n            },\n        }));\n        mutationBuffers.forEach((buf) => buf.unlock());\n    };\n    try {\n        const handlers = [];\n        handlers.push(on('DOMContentLoaded', () => {\n            wrappedEmit(wrapEvent({\n                type: EventType.DomContentLoaded,\n                data: {},\n            }));\n        }));\n        const observe = (doc) => {\n            var _a;\n            return callbackWrapper(initObservers)({\n                onMutation,\n                mutationCb: wrappedMutationEmit,\n                mousemoveCb: (positions, source) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: {\n                        source,\n                        positions,\n                    },\n                })),\n                mouseInteractionCb: (d) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.MouseInteraction }, d),\n                })),\n                scrollCb: wrappedScrollEmit,\n                viewportResizeCb: (d) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.ViewportResize }, d),\n                })),\n                inputCb: (v) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.Input }, v),\n                })),\n                mediaInteractionCb: (p) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.MediaInteraction }, p),\n                })),\n                styleSheetRuleCb: (r) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.StyleSheetRule }, r),\n                })),\n                styleDeclarationCb: (r) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.StyleDeclaration }, r),\n                })),\n                canvasMutationCb: wrappedCanvasMutationEmit,\n                fontCb: (p) => wrappedEmit(wrapEvent({\n                    type: EventType.IncrementalSnapshot,\n                    data: Object.assign({ source: IncrementalSource.Font }, p),\n                })),\n                blockClass,\n                ignoreClass,\n                ignoreSelector,\n                maskTextClass,\n                maskTextSelector,\n                unmaskTextSelector,\n                maskInputSelector,\n                unmaskInputSelector,\n                maskInputOptions,\n                inlineStylesheet,\n                sampling,\n                recordCanvas,\n                inlineImages,\n                userTriggeredOnInput,\n                collectFonts,\n                doc,\n                maskAllText,\n                maskInputFn,\n                maskTextFn,\n                blockSelector,\n                unblockSelector,\n                slimDOMOptions,\n                mirror,\n                iframeManager,\n                shadowDomManager,\n                canvasManager,\n                plugins: ((_a = plugins === null || plugins === void 0 ? void 0 : plugins.filter((p) => p.observer)) === null || _a === void 0 ? void 0 : _a.map((p) => ({\n                    observer: p.observer,\n                    options: p.options,\n                    callback: (payload) => wrappedEmit(wrapEvent({\n                        type: EventType.Plugin,\n                        data: {\n                            plugin: p.name,\n                            payload,\n                        },\n                    })),\n                }))) || [],\n            }, hooks);\n        };\n        iframeManager.addLoadListener((iframeEl) => {\n            try {\n                handlers.push(observe(iframeEl.contentDocument));\n            }\n            catch (error) {\n                console.warn(error);\n            }\n        });\n        const init = () => {\n            takeFullSnapshot();\n            handlers.push(observe(document));\n        };\n        if (document.readyState === 'interactive' ||\n            document.readyState === 'complete') {\n            init();\n        }\n        else {\n            handlers.push(on('load', () => {\n                wrappedEmit(wrapEvent({\n                    type: EventType.Load,\n                    data: {},\n                }));\n                init();\n            }, window));\n        }\n        return () => {\n            handlers.forEach((h) => h());\n        };\n    }\n    catch (error) {\n        console.warn(error);\n    }\n}\nrecord.addCustomEvent = (tag, payload) => {\n    if (!wrappedEmit) {\n        throw new Error('please add custom event after start recording');\n    }\n    wrappedEmit(wrapEvent({\n        type: EventType.Custom,\n        data: {\n            tag,\n            payload,\n        },\n    }));\n};\nrecord.freezePage = () => {\n    mutationBuffers.forEach((buf) => buf.freeze());\n};\nrecord.takeFullSnapshot = (isCheckout) => {\n    if (!takeFullSnapshot) {\n        throw new Error('please take full snapshot after start recording');\n    }\n    takeFullSnapshot(isCheckout);\n};\nrecord.mirror = mirror;\n\nexport { record as default };\n","import type { PerformanceNavigationTiming, PerformancePaintTiming } from '../types';\n\nconst NAVIGATION_ENTRY_KEYS: Array<keyof PerformanceNavigationTiming> = [\n  'name',\n  'type',\n  'startTime',\n  'transferSize',\n  'duration',\n];\n\nfunction isNavigationEntryEqual(a: PerformanceNavigationTiming) {\n  return function (b: PerformanceNavigationTiming) {\n    return NAVIGATION_ENTRY_KEYS.every(key => a[key] === b[key]);\n  };\n}\n\n/**\n * There are some difficulties diagnosing why there are duplicate navigation\n * entries. We've witnessed several intermittent results:\n * - duplicate entries have duration = 0\n * - duplicate entries are the same object reference\n * - none of the above\n *\n * Compare the values of several keys to determine if the entries are duplicates or not.\n */\n// TODO (high-prio): Figure out wth is returned here\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function dedupePerformanceEntries(\n  currentList: PerformanceEntryList,\n  newList: PerformanceEntryList,\n): PerformanceEntryList {\n  // Partition `currentList` into 3 different lists based on entryType\n  const [existingNavigationEntries, existingLcpEntries, existingEntries] = currentList.reduce(\n    (acc: [PerformanceNavigationTiming[], PerformancePaintTiming[], PerformanceEntryList], entry) => {\n      if (entry.entryType === 'navigation') {\n        acc[0].push(entry as PerformanceNavigationTiming);\n      } else if (entry.entryType === 'largest-contentful-paint') {\n        acc[1].push(entry as PerformancePaintTiming);\n      } else {\n        acc[2].push(entry);\n      }\n      return acc;\n    },\n    [[], [], []],\n  );\n\n  const newEntries: PerformanceEntryList = [];\n  const newNavigationEntries: PerformanceNavigationTiming[] = [];\n  let newLcpEntry: PerformancePaintTiming | undefined = existingLcpEntries.length\n    ? existingLcpEntries[existingLcpEntries.length - 1] // Take the last element as list is sorted\n    : undefined;\n\n  newList.forEach(entry => {\n    if (entry.entryType === 'largest-contentful-paint') {\n      // We want the latest LCP event only\n      if (!newLcpEntry || newLcpEntry.startTime < entry.startTime) {\n        newLcpEntry = entry;\n      }\n      return;\n    }\n\n    if (entry.entryType === 'navigation') {\n      const navigationEntry = entry as PerformanceNavigationTiming;\n\n      // Check if the navigation entry is contained in currentList or newList\n      if (\n        // Ignore any navigation entries with duration 0, as they are likely duplicates\n        entry.duration > 0 &&\n        // Ensure new entry does not already exist in existing entries\n        !existingNavigationEntries.find(isNavigationEntryEqual(navigationEntry)) &&\n        // Ensure new entry does not already exist in new list of navigation entries\n        !newNavigationEntries.find(isNavigationEntryEqual(navigationEntry))\n      ) {\n        newNavigationEntries.push(navigationEntry);\n      }\n\n      // Otherwise this navigation entry is considered a duplicate and is thrown away\n      return;\n    }\n\n    newEntries.push(entry);\n  });\n\n  // Re-combine and sort by startTime\n  return [\n    ...(newLcpEntry ? [newLcpEntry] : []),\n    ...existingNavigationEntries,\n    ...existingEntries,\n    ...newEntries,\n    ...newNavigationEntries,\n  ].sort((a, b) => a.startTime - b.startTime);\n}\n","import type { AllPerformanceEntry, ReplayContainer } from '../types';\nimport { dedupePerformanceEntries } from '../util/dedupePerformanceEntries';\n\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n */\nexport function setupPerformanceObserver(replay: ReplayContainer): PerformanceObserver {\n  const performanceObserverHandler = (list: PerformanceObserverEntryList): void => {\n    // For whatever reason the observer was returning duplicate navigation\n    // entries (the other entry types were not duplicated).\n    const newPerformanceEntries = dedupePerformanceEntries(\n      replay.performanceEvents,\n      list.getEntries() as AllPerformanceEntry[],\n    );\n    replay.performanceEvents = newPerformanceEntries;\n  };\n\n  const performanceObserver = new PerformanceObserver(performanceObserverHandler);\n\n  [\n    'element',\n    'event',\n    'first-input',\n    'largest-contentful-paint',\n    'layout-shift',\n    'longtask',\n    'navigation',\n    'paint',\n    'resource',\n  ].forEach(type => {\n    try {\n      performanceObserver.observe({\n        type,\n        buffered: true,\n      });\n    } catch {\n      // This can throw if an entry type is not supported in the browser.\n      // Ignore these errors.\n    }\n  });\n\n  return performanceObserver;\n}\n","export default `/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */\nfunction t(t){let e=t.length;for(;--e>=0;)t[e]=0}const e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),a=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);const r=new Array(60);t(r);const o=new Array(512);t(o);const l=new Array(256);t(l);const h=new Array(29);t(h);const d=new Array(30);function _(t,e,a,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}let f,c,u;function w(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);const m=t=>t<256?o[t]:o[256+(t>>>7)],b=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},g=(t,e,a)=>{t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,b(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},p=(t,e,a)=>{g(t,a[2*e],a[2*e+1])},k=(t,e)=>{let a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},v=(t,e,a)=>{const i=new Array(16);let n,s,r=0;for(n=1;n<=15;n++)r=r+a[n-1]<<1,i[n]=r;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=k(i[e]++,e))}},y=t=>{let e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=t=>{t.bi_valid>8?b(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},z=(t,e,a,i)=>{const n=2*e,s=2*a;return t[n]<t[s]||t[n]===t[s]&&i[e]<=i[a]},A=(t,e,a)=>{const i=t.heap[a];let n=a<<1;for(;n<=t.heap_len&&(n<t.heap_len&&z(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!z(e,i,t.heap[n],t.depth));)t.heap[a]=t.heap[n],a=n,n<<=1;t.heap[a]=i},E=(t,i,n)=>{let s,r,o,_,f=0;if(0!==t.sym_next)do{s=255&t.pending_buf[t.sym_buf+f++],s+=(255&t.pending_buf[t.sym_buf+f++])<<8,r=t.pending_buf[t.sym_buf+f++],0===s?p(t,r,i):(o=l[r],p(t,o+256+1,i),_=e[o],0!==_&&(r-=h[o],g(t,r,_)),s--,o=m(s),p(t,o,n),_=a[o],0!==_&&(s-=d[o],g(t,s,_)))}while(f<t.sym_next);p(t,256,i)},R=(t,e)=>{const a=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,o,l,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=h<2?++h:0,a[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=i[2*l+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)A(t,a,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),o=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=o,a[2*l]=a[2*r]+a[2*o],t.depth[l]=(t.depth[r]>=t.depth[o]?t.depth[r]:t.depth[o])+1,a[2*r+1]=a[2*o+1]=l,t.heap[1]=l++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const a=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length;let h,d,_,f,c,u,w=0;for(f=0;f<=15;f++)t.bl_count[f]=0;for(a[2*t.heap[t.heap_max]+1]=0,h=t.heap_max+1;h<573;h++)d=t.heap[h],f=a[2*a[2*d+1]+1]+1,f>l&&(f=l,w++),a[2*d+1]=f,d>i||(t.bl_count[f]++,c=0,d>=o&&(c=r[d-o]),u=a[2*d],t.opt_len+=u*(f+c),s&&(t.static_len+=u*(n[2*d+1]+c)));if(0!==w){do{for(f=l-1;0===t.bl_count[f];)f--;t.bl_count[f]--,t.bl_count[f+1]+=2,t.bl_count[l]--,w-=2}while(w>0);for(f=l;0!==f;f--)for(d=t.bl_count[f];0!==d;)_=t.heap[--h],_>i||(a[2*_+1]!==f&&(t.opt_len+=(f-a[2*_+1])*a[2*_],a[2*_+1]=f),d--)}})(t,e),v(a,h,t.bl_count)},Z=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),e[2*(a+1)+1]=65535,i=0;i<=a;i++)n=r,r=e[2*(i+1)+1],++o<l&&n===r||(o<h?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4))},U=(t,e,a)=>{let i,n,s=-1,r=e[1],o=0,l=7,h=4;for(0===r&&(l=138,h=3),i=0;i<=a;i++)if(n=r,r=e[2*(i+1)+1],!(++o<l&&n===r)){if(o<h)do{p(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(p(t,n,t.bl_tree),o--),p(t,16,t.bl_tree),g(t,o-3,2)):o<=10?(p(t,17,t.bl_tree),g(t,o-3,3)):(p(t,18,t.bl_tree),g(t,o-11,7));o=0,s=n,0===r?(l=138,h=3):n===r?(l=6,h=3):(l=7,h=4)}};let S=!1;const D=(t,e,a,i)=>{g(t,0+(i?1:0),3),x(t),b(t,a),b(t,~a),a&&t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a};var T=(t,e,a,i)=>{let o,l,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),R(t,t.l_desc),R(t,t.d_desc),h=(t=>{let e;for(Z(t,t.dyn_ltree,t.l_desc.max_code),Z(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),o=t.opt_len+3+7>>>3,l=t.static_len+3+7>>>3,l<=o&&(o=l)):o=l=a+5,a+4<=o&&-1!==e?D(t,e,a,i):4===t.strategy||l===o?(g(t,2+(i?1:0),3),E(t,s,r)):(g(t,4+(i?1:0),3),((t,e,a,i)=>{let s;for(g(t,e-257,5),g(t,a-1,5),g(t,i-4,4),s=0;s<i;s++)g(t,t.bl_tree[2*n[s]+1],3);U(t,t.dyn_ltree,e-1),U(t,t.dyn_dtree,a-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),E(t,t.dyn_ltree,t.dyn_dtree)),y(t),i&&x(t)},O={_tr_init:t=>{S||((()=>{let t,n,w,m,b;const g=new Array(16);for(w=0,m=0;m<28;m++)for(h[m]=w,t=0;t<1<<e[m];t++)l[w++]=m;for(l[w-1]=m,b=0,m=0;m<16;m++)for(d[m]=b,t=0;t<1<<a[m];t++)o[b++]=m;for(b>>=7;m<30;m++)for(d[m]=b<<7,t=0;t<1<<a[m]-7;t++)o[256+b++]=m;for(n=0;n<=15;n++)g[n]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,g[8]++;for(;t<=255;)s[2*t+1]=9,t++,g[9]++;for(;t<=279;)s[2*t+1]=7,t++,g[7]++;for(;t<=287;)s[2*t+1]=8,t++,g[8]++;for(v(s,287,g),t=0;t<30;t++)r[2*t+1]=5,r[2*t]=k(t,5);f=new _(s,e,257,286,15),c=new _(r,a,0,30,15),u=new _(new Array(0),i,0,19,7)})(),S=!0),t.l_desc=new w(t.dyn_ltree,f),t.d_desc=new w(t.dyn_dtree,c),t.bl_desc=new w(t.bl_tree,u),t.bi_buf=0,t.bi_valid=0,y(t)},_tr_stored_block:D,_tr_flush_block:T,_tr_tally:(t,e,a)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=a,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(l[a]+256+1)]++,t.dyn_dtree[2*m(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{g(t,2,3),p(t,256,s),(t=>{16===t.bi_valid?(b(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var F=(t,e,a,i)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==a;){r=a>2e3?2e3:a,a-=r;do{n=n+e[i++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const L=new Uint32Array((()=>{let t,e=[];for(var a=0;a<256;a++){t=a;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e})());var N=(t,e,a,i)=>{const n=L,s=i+a;t^=-1;for(let a=i;a<s;a++)t=t>>>8^n[255&(t^e[a])];return-1^t},I={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},B={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:C,_tr_stored_block:H,_tr_flush_block:M,_tr_tally:j,_tr_align:K}=O,{Z_NO_FLUSH:P,Z_PARTIAL_FLUSH:Y,Z_FULL_FLUSH:G,Z_FINISH:X,Z_BLOCK:W,Z_OK:q,Z_STREAM_END:J,Z_STREAM_ERROR:Q,Z_DATA_ERROR:V,Z_BUF_ERROR:$,Z_DEFAULT_COMPRESSION:tt,Z_FILTERED:et,Z_HUFFMAN_ONLY:at,Z_RLE:it,Z_FIXED:nt,Z_DEFAULT_STRATEGY:st,Z_UNKNOWN:rt,Z_DEFLATED:ot}=B,lt=(t,e)=>(t.msg=I[e],e),ht=t=>2*t-(t>4?9:0),dt=t=>{let e=t.length;for(;--e>=0;)t[e]=0},_t=t=>{let e,a,i,n=t.w_size;e=t.hash_size,i=e;do{a=t.head[--i],t.head[i]=a>=n?a-n:0}while(--e);e=n,i=e;do{a=t.prev[--i],t.prev[i]=a>=n?a-n:0}while(--e)};let ft=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const ct=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},ut=(t,e)=>{M(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,ct(t.strm)},wt=(t,e)=>{t.pending_buf[t.pending++]=e},mt=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=(t,e,a,i)=>{let n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),a),1===t.state.wrap?t.adler=F(t.adler,e,n,a):2===t.state.wrap&&(t.adler=N(t.adler,e,n,a)),t.next_in+=n,t.total_in+=n,n)},gt=(t,e)=>{let a,i,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,h=t.window,d=t.w_mask,_=t.prev,f=t.strstart+258;let c=h[s+r-1],u=h[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(a=e,h[a+r]===u&&h[a+r-1]===c&&h[a]===h[s]&&h[++a]===h[s+1]){s+=2,a++;do{}while(h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&h[++s]===h[++a]&&s<f);if(i=258-(f-s),s=f-258,i>r){if(t.match_start=e,r=i,i>=o)break;c=h[s+r-1],u=h[s+r]}}}while((e=_[e&d])>l&&0!=--n);return r<=t.lookahead?r:t.lookahead},pt=t=>{const e=t.w_size;let a,i,n;do{if(i=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)&&(t.window.set(t.window.subarray(e,e+e-i),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),i+=e),0===t.strm.avail_in)break;if(a=bt(t.strm,t.window,t.strstart+t.lookahead,i),t.lookahead+=a,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=ft(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=ft(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},kt=(t,e)=>{let a,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,r=0,o=t.strm.avail_in;do{if(a=65535,n=t.bi_valid+42>>3,t.strm.avail_out<n)break;if(n=t.strm.avail_out-n,i=t.strstart-t.block_start,a>i+t.strm.avail_in&&(a=i+t.strm.avail_in),a>n&&(a=n),a<s&&(0===a&&e!==X||e===P||a!==i+t.strm.avail_in))break;r=e===X&&a===i+t.strm.avail_in?1:0,H(t,0,0,r),t.pending_buf[t.pending-4]=a,t.pending_buf[t.pending-3]=a>>8,t.pending_buf[t.pending-2]=~a,t.pending_buf[t.pending-1]=~a>>8,ct(t.strm),i&&(i>a&&(i=a),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,a-=i),a&&(bt(t.strm,t.strm.output,t.strm.next_out,a),t.strm.next_out+=a,t.strm.avail_out-=a,t.strm.total_out+=a)}while(0===r);return o-=t.strm.avail_in,o&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),r?4:e!==P&&e!==X&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(n=t.window_size-t.strstart,t.strm.avail_in>n&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water<t.strstart&&(t.high_water=t.strstart),n=t.bi_valid+42>>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===X)&&e!==P&&0===t.strm.avail_in&&i<=n)&&(a=i>n?n:i,r=e===X&&0===t.strm.avail_in&&a===i?1:0,H(t,t.block_start,a,r),t.block_start+=a,ct(t.strm)),r?3:1)},vt=(t,e)=>{let a,i;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a)),t.match_length>=3)if(i=j(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=ft(t,t.ins_h,t.window[t.strstart+1]);else i=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2},yt=(t,e)=>{let a,i,n;for(;;){if(t.lookahead<262){if(pt(t),t.lookahead<262&&e===P)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=gt(t,a),t.match_length<=5&&(t.strategy===et||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=j(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=ft(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(ut(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(i=j(t,0,t.window[t.strstart-1]),i&&ut(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=j(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2};function xt(t,e,a,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=i,this.func=n}const zt=[new xt(0,0,0,0,kt),new xt(4,4,8,4,vt),new xt(4,5,16,8,vt),new xt(4,6,32,32,vt),new xt(4,4,16,16,yt),new xt(8,16,32,32,yt),new xt(8,16,128,128,yt),new xt(8,32,128,256,yt),new xt(32,128,258,1024,yt),new xt(32,258,258,4096,yt)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),dt(this.dyn_ltree),dt(this.dyn_dtree),dt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),dt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),dt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Et=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Rt=t=>{if(Et(t))return lt(t,Q);t.total_in=t.total_out=0,t.data_type=rt;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,C(e),q},Zt=t=>{const e=Rt(t);var a;return e===q&&((a=t.state).window_size=2*a.w_size,dt(a.head),a.max_lazy_match=zt[a.level].max_lazy,a.good_match=zt[a.level].good_length,a.nice_match=zt[a.level].nice_length,a.max_chain_length=zt[a.level].max_chain,a.strstart=0,a.block_start=0,a.lookahead=0,a.insert=0,a.match_length=a.prev_length=2,a.match_available=0,a.ins_h=0),e},Ut=(t,e,a,i,n,s)=>{if(!t)return Q;let r=1;if(e===tt&&(e=6),i<0?(r=0,i=-i):i>15&&(r=2,i-=16),n<1||n>9||a!==ot||i<8||i>15||e<0||e>9||s<0||s>nt||8===i&&1!==r)return lt(t,Q);8===i&&(i=9);const o=new At;return t.state=o,o.strm=t,o.status=42,o.wrap=r,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=s,o.method=a,Zt(t)};var St={deflateInit:(t,e)=>Ut(t,e,ot,15,8,st),deflateInit2:Ut,deflateReset:Zt,deflateResetKeep:Rt,deflateSetHeader:(t,e)=>Et(t)||2!==t.state.wrap?Q:(t.state.gzhead=e,q),deflate:(t,e)=>{if(Et(t)||e>W||e<0)return t?lt(t,Q):Q;const a=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===a.status&&e!==X)return lt(t,0===t.avail_out?$:Q);const i=a.last_flush;if(a.last_flush=e,0!==a.pending){if(ct(t),0===t.avail_out)return a.last_flush=-1,q}else if(0===t.avail_in&&ht(e)<=ht(i)&&e!==X)return lt(t,$);if(666===a.status&&0!==t.avail_in)return lt(t,$);if(42===a.status&&0===a.wrap&&(a.status=113),42===a.status){let e=ot+(a.w_bits-8<<4)<<8,i=-1;if(i=a.strategy>=at||a.level<2?0:a.level<6?1:6===a.level?2:3,e|=i<<6,0!==a.strstart&&(e|=32),e+=31-e%31,mt(a,e),0!==a.strstart&&(mt(a,t.adler>>>16),mt(a,65535&t.adler)),t.adler=1,a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(57===a.status)if(t.adler=0,wt(a,31),wt(a,139),wt(a,8),a.gzhead)wt(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),wt(a,255&a.gzhead.time),wt(a,a.gzhead.time>>8&255),wt(a,a.gzhead.time>>16&255),wt(a,a.gzhead.time>>24&255),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(wt(a,255&a.gzhead.extra.length),wt(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(t.adler=N(t.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69;else if(wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,0),wt(a,9===a.level?2:a.strategy>=at||a.level<2?4:0),wt(a,3),a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q;if(69===a.status){if(a.gzhead.extra){let e=a.pending,i=(65535&a.gzhead.extra.length)-a.gzindex;for(;a.pending+i>a.pending_buf_size;){let n=a.pending_buf_size-a.pending;if(a.pending_buf.set(a.gzhead.extra.subarray(a.gzindex,a.gzindex+n),a.pending),a.pending=a.pending_buf_size,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex+=n,ct(t),0!==a.pending)return a.last_flush=-1,q;e=0,i-=n}let n=new Uint8Array(a.gzhead.extra);a.pending_buf.set(n.subarray(a.gzindex,a.gzindex+i),a.pending),a.pending+=i,a.gzhead.hcrc&&a.pending>e&&(t.adler=N(t.adler,a.pending_buf,a.pending-e,e)),a.gzindex=0}a.status=73}if(73===a.status){if(a.gzhead.name){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),a.gzindex=0}a.status=91}if(91===a.status){if(a.gzhead.comment){let e,i=a.pending;do{if(a.pending===a.pending_buf_size){if(a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i)),ct(t),0!==a.pending)return a.last_flush=-1,q;i=0}e=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,wt(a,e)}while(0!==e);a.gzhead.hcrc&&a.pending>i&&(t.adler=N(t.adler,a.pending_buf,a.pending-i,i))}a.status=103}if(103===a.status){if(a.gzhead.hcrc){if(a.pending+2>a.pending_buf_size&&(ct(t),0!==a.pending))return a.last_flush=-1,q;wt(a,255&t.adler),wt(a,t.adler>>8&255),t.adler=0}if(a.status=113,ct(t),0!==a.pending)return a.last_flush=-1,q}if(0!==t.avail_in||0!==a.lookahead||e!==P&&666!==a.status){let i=0===a.level?kt(a,e):a.strategy===at?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(pt(t),0===t.lookahead)){if(e===P)return 1;break}if(t.match_length=0,a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):a.strategy===it?((t,e)=>{let a,i,n,s;const r=t.window;for(;;){if(t.lookahead<=258){if(pt(t),t.lookahead<=258&&e===P)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,i=r[n],i===r[++n]&&i===r[++n]&&i===r[++n])){s=t.strstart+258;do{}while(i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&i===r[++n]&&n<s);t.match_length=258-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=j(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=j(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(ut(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===X?(ut(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(ut(t,!1),0===t.strm.avail_out)?1:2})(a,e):zt[a.level].func(a,e);if(3!==i&&4!==i||(a.status=666),1===i||3===i)return 0===t.avail_out&&(a.last_flush=-1),q;if(2===i&&(e===Y?K(a):e!==W&&(H(a,0,0,!1),e===G&&(dt(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),ct(t),0===t.avail_out))return a.last_flush=-1,q}return e!==X?q:a.wrap<=0?J:(2===a.wrap?(wt(a,255&t.adler),wt(a,t.adler>>8&255),wt(a,t.adler>>16&255),wt(a,t.adler>>24&255),wt(a,255&t.total_in),wt(a,t.total_in>>8&255),wt(a,t.total_in>>16&255),wt(a,t.total_in>>24&255)):(mt(a,t.adler>>>16),mt(a,65535&t.adler)),ct(t),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?q:J)},deflateEnd:t=>{if(Et(t))return Q;const e=t.state.status;return t.state=null,113===e?lt(t,V):q},deflateSetDictionary:(t,e)=>{let a=e.length;if(Et(t))return Q;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return Q;if(1===n&&(t.adler=F(t.adler,e,a,0)),i.wrap=0,a>=i.w_size){0===n&&(dt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(e.subarray(a-i.w_size,a),0),e=t,a=i.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,pt(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=ft(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,pt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,i.wrap=n,q},deflateInfo:\"pako deflate (from Nodeca project)\"};const Dt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Tt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const a=e.shift();if(a){if(\"object\"!=typeof a)throw new TypeError(a+\"must be non-object\");for(const e in a)Dt(a,e)&&(t[e]=a[e])}}return t},Ot=t=>{let e=0;for(let a=0,i=t.length;a<i;a++)e+=t[a].length;const a=new Uint8Array(e);for(let e=0,i=0,n=t.length;e<n;e++){let n=t[e];a.set(n,i),i+=n.length}return a};let Ft=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ft=!1}const Lt=new Uint8Array(256);for(let t=0;t<256;t++)Lt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Lt[254]=Lt[254]=1;var Nt=t=>{if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,i,n,s,r=t.length,o=0;for(n=0;n<r;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),o+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)a=t.charCodeAt(n),55296==(64512&a)&&n+1<r&&(i=t.charCodeAt(n+1),56320==(64512&i)&&(a=65536+(a-55296<<10)+(i-56320),n++)),a<128?e[s++]=a:a<2048?(e[s++]=192|a>>>6,e[s++]=128|63&a):a<65536?(e[s++]=224|a>>>12,e[s++]=128|a>>>6&63,e[s++]=128|63&a):(e[s++]=240|a>>>18,e[s++]=128|a>>>12&63,e[s++]=128|a>>>6&63,e[s++]=128|63&a);return e},It=(t,e)=>{const a=e||t.length;if(\"function\"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let i,n;const s=new Array(2*a);for(n=0,i=0;i<a;){let e=t[i++];if(e<128){s[n++]=e;continue}let r=Lt[e];if(r>4)s[n++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<a;)e=e<<6|63&t[i++],r--;r>1?s[n++]=65533:e<65536?s[n++]=e:(e-=65536,s[n++]=55296|e>>10&1023,s[n++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Ft)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let a=\"\";for(let i=0;i<e;i++)a+=String.fromCharCode(t[i]);return a})(s,n)},Bt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let a=e-1;for(;a>=0&&128==(192&t[a]);)a--;return a<0||0===a?e:a+Lt[t[a]]>e?a:e};var Ct=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0};const Ht=Object.prototype.toString,{Z_NO_FLUSH:Mt,Z_SYNC_FLUSH:jt,Z_FULL_FLUSH:Kt,Z_FINISH:Pt,Z_OK:Yt,Z_STREAM_END:Gt,Z_DEFAULT_COMPRESSION:Xt,Z_DEFAULT_STRATEGY:Wt,Z_DEFLATED:qt}=B;function Jt(t){this.options=Tt({level:Xt,method:qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=St.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(a!==Yt)throw new Error(I[a]);if(e.header&&St.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t=\"string\"==typeof e.dictionary?Nt(e.dictionary):\"[object ArrayBuffer]\"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,a=St.deflateSetDictionary(this.strm,t),a!==Yt)throw new Error(I[a]);this._dict_set=!0}}function Qt(t,e){const a=new Jt(e);if(a.push(t,!0),a.err)throw a.msg||I[a.err];return a.result}Jt.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Pt:Mt,\"string\"==typeof t?a.input=Nt(t):\"[object ArrayBuffer]\"===Ht.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;)if(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),(s===jt||s===Kt)&&a.avail_out<=6)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else{if(n=St.deflate(a,s),n===Gt)return a.next_out>0&&this.onData(a.output.subarray(0,a.next_out)),n=St.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Yt;if(0!==a.avail_out){if(s>0&&a.next_out>0)this.onData(a.output.subarray(0,a.next_out)),a.avail_out=0;else if(0===a.avail_in)break}else this.onData(a.output)}return!0},Jt.prototype.onData=function(t){this.chunks.push(t)},Jt.prototype.onEnd=function(t){t===Yt&&(this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Vt={Deflate:Jt,deflate:Qt,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Qt(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Qt(t,e)},constants:B};var $t=function(t,e){let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z,A;const E=t.state;a=t.next_in,z=t.input,i=a+(t.avail_in-5),n=t.next_out,A=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=E.dmax,l=E.wsize,h=E.whave,d=E.wnext,_=E.window,f=E.hold,c=E.bits,u=E.lencode,w=E.distcode,m=(1<<E.lenbits)-1,b=(1<<E.distbits)-1;t:do{c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=u[f&m];e:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,0===p)A[n++]=65535&g;else{if(!(16&p)){if(0==(64&p)){g=u[(65535&g)+(f&(1<<p)-1)];continue e}if(32&p){E.mode=16191;break t}t.msg=\"invalid literal/length code\",E.mode=16209;break t}k=65535&g,p&=15,p&&(c<p&&(f+=z[a++]<<c,c+=8),k+=f&(1<<p)-1,f>>>=p,c-=p),c<15&&(f+=z[a++]<<c,c+=8,f+=z[a++]<<c,c+=8),g=w[f&b];a:for(;;){if(p=g>>>24,f>>>=p,c-=p,p=g>>>16&255,!(16&p)){if(0==(64&p)){g=w[(65535&g)+(f&(1<<p)-1)];continue a}t.msg=\"invalid distance code\",E.mode=16209;break t}if(v=65535&g,p&=15,c<p&&(f+=z[a++]<<c,c+=8,c<p&&(f+=z[a++]<<c,c+=8)),v+=f&(1<<p)-1,v>o){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(f>>>=p,c-=p,p=n-s,v>p){if(p=v-p,p>h&&E.sane){t.msg=\"invalid distance too far back\",E.mode=16209;break t}if(y=0,x=_,0===d){if(y+=l-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}else if(d<p){if(y+=l+d-p,p-=d,p<k){k-=p;do{A[n++]=_[y++]}while(--p);if(y=0,d<k){p=d,k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}}}else if(y+=d-p,p<k){k-=p;do{A[n++]=_[y++]}while(--p);y=n-v,x=A}for(;k>2;)A[n++]=x[y++],A[n++]=x[y++],A[n++]=x[y++],k-=3;k&&(A[n++]=x[y++],k>1&&(A[n++]=x[y++]))}else{y=n-v;do{A[n++]=A[y++],A[n++]=A[y++],A[n++]=A[y++],k-=3}while(k>2);k&&(A[n++]=A[y++],k>1&&(A[n++]=A[y++]))}break}}break}}while(a<i&&n<r);k=c>>3,a-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=a,t.next_out=n,t.avail_in=a<i?i-a+5:5-(a-i),t.avail_out=n<r?r-n+257:257-(n-r),E.hold=f,E.bits=c};const te=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),ee=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ae=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),ie=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ne=(t,e,a,i,n,s,r,o)=>{const l=o.bits;let h,d,_,f,c,u,w=0,m=0,b=0,g=0,p=0,k=0,v=0,y=0,x=0,z=0,A=null;const E=new Uint16Array(16),R=new Uint16Array(16);let Z,U,S,D=null;for(w=0;w<=15;w++)E[w]=0;for(m=0;m<i;m++)E[e[a+m]]++;for(p=l,g=15;g>=1&&0===E[g];g--);if(p>g&&(p=g),0===g)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(b=1;b<g&&0===E[b];b++);for(p<b&&(p=b),y=1,w=1;w<=15;w++)if(y<<=1,y-=E[w],y<0)return-1;if(y>0&&(0===t||1!==g))return-1;for(R[1]=0,w=1;w<15;w++)R[w+1]=R[w]+E[w];for(m=0;m<i;m++)0!==e[a+m]&&(r[R[e[a+m]]++]=m);if(0===t?(A=D=r,u=20):1===t?(A=te,D=ee,u=257):(A=ae,D=ie,u=0),z=0,m=0,w=b,c=s,k=p,v=0,_=-1,x=1<<p,f=x-1,1===t&&x>852||2===t&&x>592)return 1;for(;;){Z=w-v,r[m]+1<u?(U=0,S=r[m]):r[m]>=u?(U=D[r[m]-u],S=A[r[m]-u]):(U=96,S=0),h=1<<w-v,d=1<<k,b=d;do{d-=h,n[c+(z>>v)+d]=Z<<24|U<<16|S|0}while(0!==d);for(h=1<<w-1;z&h;)h>>=1;if(0!==h?(z&=h-1,z+=h):z=0,m++,0==--E[w]){if(w===g)break;w=e[a+r[m]]}if(w>p&&(z&f)!==_){for(0===v&&(v=p),c+=b,k=w-v,y=1<<k;k+v<g&&(y-=E[k+v],!(y<=0));)k++,y<<=1;if(x+=1<<k,1===t&&x>852||2===t&&x>592)return 1;_=z&f,n[_]=p<<24|k<<16|c-s|0}}return 0!==z&&(n[c+z]=w-v<<24|64<<16|0),o.bits=p,0};const{Z_FINISH:se,Z_BLOCK:re,Z_TREES:oe,Z_OK:le,Z_STREAM_END:he,Z_NEED_DICT:de,Z_STREAM_ERROR:_e,Z_DATA_ERROR:fe,Z_MEM_ERROR:ce,Z_BUF_ERROR:ue,Z_DEFLATED:we}=B,me=16209,be=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function ge(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const pe=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<16180||e.mode>16211?1:0},ke=t=>{if(pe(t))return _e;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg=\"\",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,le},ve=t=>{if(pe(t))return _e;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,ke(t)},ye=(t,e)=>{let a;if(pe(t))return _e;const i=t.state;return e<0?(a=0,e=-e):(a=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_e:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=a,i.wbits=e,ve(t))},xe=(t,e)=>{if(!t)return _e;const a=new ge;t.state=a,a.strm=t,a.window=null,a.mode=16180;const i=ye(t,e);return i!==le&&(t.state=null),i};let ze,Ae,Ee=!0;const Re=t=>{if(Ee){ze=new Int32Array(512),Ae=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ne(1,t.lens,0,288,ze,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ne(2,t.lens,0,32,Ae,0,t.work,{bits:5}),Ee=!1}t.lencode=ze,t.lenbits=9,t.distcode=Ae,t.distbits=5},Ze=(t,e,a,i)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),i>=s.wsize?(s.window.set(e.subarray(a-s.wsize,a),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),s.window.set(e.subarray(a-i,a-i+n),s.wnext),(i-=n)?(s.window.set(e.subarray(a-i,a),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ue={inflateReset:ve,inflateReset2:ye,inflateResetKeep:ke,inflateInit:t=>xe(t,15),inflateInit2:xe,inflate:(t,e)=>{let a,i,n,s,r,o,l,h,d,_,f,c,u,w,m,b,g,p,k,v,y,x,z=0;const A=new Uint8Array(4);let E,R;const Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(pe(t)||!t.output||!t.input&&0!==t.avail_in)return _e;a=t.state,16191===a.mode&&(a.mode=16192),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,_=o,f=l,x=le;t:for(;;)switch(a.mode){case 16180:if(0===a.wrap){a.mode=16192;break}for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(2&a.wrap&&35615===h){0===a.wbits&&(a.wbits=15),a.check=0,A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0),h=0,d=0,a.mode=16181;break}if(a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){t.msg=\"incorrect header check\",a.mode=me;break}if((15&h)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(h>>>=4,d-=4,y=8+(15&h),0===a.wbits&&(a.wbits=y),y>15||y>a.wbits){t.msg=\"invalid window size\",a.mode=me;break}a.dmax=1<<a.wbits,a.flags=0,t.adler=a.check=1,a.mode=512&h?16189:16191,h=0,d=0;break;case 16181:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.flags=h,(255&a.flags)!==we){t.msg=\"unknown compression method\",a.mode=me;break}if(57344&a.flags){t.msg=\"unknown header flags set\",a.mode=me;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16182;case 16182:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,A[2]=h>>>16&255,A[3]=h>>>24&255,a.check=N(a.check,A,4,0)),h=0,d=0,a.mode=16183;case 16183:for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0,a.mode=16184;case 16184:if(1024&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&4&a.wrap&&(A[0]=255&h,A[1]=h>>>8&255,a.check=N(a.check,A,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=16185;case 16185:if(1024&a.flags&&(c=a.length,c>o&&(c=o),c&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Uint8Array(a.head.extra_len)),a.head.extra.set(i.subarray(s,s+c),y)),512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,a.length-=c),a.length))break t;a.length=0,a.mode=16186;case 16186:if(2048&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.name=null);a.length=0,a.mode=16187;case 16187:if(4096&a.flags){if(0===o)break t;c=0;do{y=i[s+c++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&c<o);if(512&a.flags&&4&a.wrap&&(a.check=N(a.check,i,c,s)),o-=c,s+=c,y)break t}else a.head&&(a.head.comment=null);a.mode=16188;case 16188:if(512&a.flags){for(;d<16;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(65535&a.check)){t.msg=\"header crc mismatch\",a.mode=me;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),t.adler=a.check=0,a.mode=16191;break;case 16189:for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}t.adler=a.check=be(h),h=0,d=0,a.mode=16190;case 16190:if(0===a.havedict)return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,de;t.adler=a.check=1,a.mode=16191;case 16191:if(e===re||e===oe)break t;case 16192:if(a.last){h>>>=7&d,d-=7&d,a.mode=16206;break}for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}switch(a.last=1&h,h>>>=1,d-=1,3&h){case 0:a.mode=16193;break;case 1:if(Re(a),a.mode=16199,e===oe){h>>>=2,d-=2;break t}break;case 2:a.mode=16196;break;case 3:t.msg=\"invalid block type\",a.mode=me}h>>>=2,d-=2;break;case 16193:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){t.msg=\"invalid stored block lengths\",a.mode=me;break}if(a.length=65535&h,h=0,d=0,a.mode=16194,e===oe)break t;case 16194:a.mode=16195;case 16195:if(c=a.length,c){if(c>o&&(c=o),c>l&&(c=l),0===c)break t;n.set(i.subarray(s,s+c),r),o-=c,s+=c,l-=c,r+=c,a.length-=c;break}a.mode=16191;break;case 16196:for(;d<14;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){t.msg=\"too many length or distance symbols\",a.mode=me;break}a.have=0,a.mode=16197;case 16197:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.lens[Z[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[Z[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,E={bits:a.lenbits},x=ne(0,a.lens,0,19,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid code lengths set\",a.mode=me;break}a.have=0,a.mode=16198;case 16198:for(;a.have<a.nlen+a.ndist;){for(;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(g<16)h>>>=m,d-=m,a.lens[a.have++]=g;else{if(16===g){for(R=m+2;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){t.msg=\"invalid bit length repeat\",a.mode=me;break}y=a.lens[a.have-1],c=3+(3&h),h>>>=2,d-=2}else if(17===g){for(R=m+3;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=3+(7&h),h>>>=3,d-=3}else{for(R=m+7;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=m,d-=m,y=0,c=11+(127&h),h>>>=7,d-=7}if(a.have+c>a.nlen+a.ndist){t.msg=\"invalid bit length repeat\",a.mode=me;break}for(;c--;)a.lens[a.have++]=y}}if(a.mode===me)break;if(0===a.lens[256]){t.msg=\"invalid code -- missing end-of-block\",a.mode=me;break}if(a.lenbits=9,E={bits:a.lenbits},x=ne(1,a.lens,0,a.nlen,a.lencode,0,a.work,E),a.lenbits=E.bits,x){t.msg=\"invalid literal/lengths set\",a.mode=me;break}if(a.distbits=6,a.distcode=a.distdyn,E={bits:a.distbits},x=ne(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,E),a.distbits=E.bits,x){t.msg=\"invalid distances set\",a.mode=me;break}if(a.mode=16199,e===oe)break t;case 16199:a.mode=16200;case 16200:if(o>=6&&l>=258){t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,$t(t,f),r=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,h=a.hold,d=a.bits,16191===a.mode&&(a.back=-1);break}for(a.back=0;z=a.lencode[h&(1<<a.lenbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(b&&0==(240&b)){for(p=m,k=b,v=g;z=a.lencode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=g,0===b){a.mode=16205;break}if(32&b){a.back=-1,a.mode=16191;break}if(64&b){t.msg=\"invalid literal/length code\",a.mode=me;break}a.extra=15&b,a.mode=16201;case 16201:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=16202;case 16202:for(;z=a.distcode[h&(1<<a.distbits)-1],m=z>>>24,b=z>>>16&255,g=65535&z,!(m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(0==(240&b)){for(p=m,k=b,v=g;z=a.distcode[v+((h&(1<<p+k)-1)>>p)],m=z>>>24,b=z>>>16&255,g=65535&z,!(p+m<=d);){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){t.msg=\"invalid distance code\",a.mode=me;break}a.offset=g,a.extra=15&b,a.mode=16203;case 16203:if(a.extra){for(R=a.extra;d<R;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){t.msg=\"invalid distance too far back\",a.mode=me;break}a.mode=16204;case 16204:if(0===l)break t;if(c=f-l,a.offset>c){if(c=a.offset-c,c>a.whave&&a.sane){t.msg=\"invalid distance too far back\",a.mode=me;break}c>a.wnext?(c-=a.wnext,u=a.wsize-c):u=a.wnext-c,c>a.length&&(c=a.length),w=a.window}else w=n,u=r-a.offset,c=a.length;c>l&&(c=l),l-=c,a.length-=c;do{n[r++]=w[u++]}while(--c);0===a.length&&(a.mode=16200);break;case 16205:if(0===l)break t;n[r++]=a.length,l--,a.mode=16200;break;case 16206:if(a.wrap){for(;d<32;){if(0===o)break t;o--,h|=i[s++]<<d,d+=8}if(f-=l,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,r-f):F(a.check,n,f,r-f)),f=l,4&a.wrap&&(a.flags?h:be(h))!==a.check){t.msg=\"incorrect data check\",a.mode=me;break}h=0,d=0}a.mode=16207;case 16207:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break t;o--,h+=i[s++]<<d,d+=8}if(4&a.wrap&&h!==(4294967295&a.total)){t.msg=\"incorrect length check\",a.mode=me;break}h=0,d=0}a.mode=16208;case 16208:x=he;break t;case me:x=fe;break t;case 16210:return ce;default:return _e}return t.next_out=r,t.avail_out=l,t.next_in=s,t.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==t.avail_out&&a.mode<me&&(a.mode<16206||e!==se))&&Ze(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,a.total+=f,4&a.wrap&&f&&(t.adler=a.check=a.flags?N(a.check,n,f,t.next_out-f):F(a.check,n,f,t.next_out-f)),t.data_type=a.bits+(a.last?64:0)+(16191===a.mode?128:0)+(16199===a.mode||16194===a.mode?256:0),(0===_&&0===f||e===se)&&x===le&&(x=ue),x},inflateEnd:t=>{if(pe(t))return _e;let e=t.state;return e.window&&(e.window=null),t.state=null,le},inflateGetHeader:(t,e)=>{if(pe(t))return _e;const a=t.state;return 0==(2&a.wrap)?_e:(a.head=e,e.done=!1,le)},inflateSetDictionary:(t,e)=>{const a=e.length;let i,n,s;return pe(t)?_e:(i=t.state,0!==i.wrap&&16190!==i.mode?_e:16190===i.mode&&(n=1,n=F(n,e,a,0),n!==i.check)?fe:(s=Ze(t,e,a,a),s?(i.mode=16210,ce):(i.havedict=1,le)))},inflateInfo:\"pako inflate (from Nodeca project)\"};var Se=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=\"\",this.comment=\"\",this.hcrc=0,this.done=!1};const De=Object.prototype.toString,{Z_NO_FLUSH:Te,Z_FINISH:Oe,Z_OK:Fe,Z_STREAM_END:Le,Z_NEED_DICT:Ne,Z_STREAM_ERROR:Ie,Z_DATA_ERROR:Be,Z_MEM_ERROR:Ce}=B;function He(t){this.options=Tt({chunkSize:65536,windowBits:15,to:\"\"},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Ct,this.strm.avail_out=0;let a=Ue.inflateInit2(this.strm,e.windowBits);if(a!==Fe)throw new Error(I[a]);if(this.header=new Se,Ue.inflateGetHeader(this.strm,this.header),e.dictionary&&(\"string\"==typeof e.dictionary?e.dictionary=Nt(e.dictionary):\"[object ArrayBuffer]\"===De.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(a=Ue.inflateSetDictionary(this.strm,e.dictionary),a!==Fe)))throw new Error(I[a])}He.prototype.push=function(t,e){const a=this.strm,i=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Oe:Te,\"[object ArrayBuffer]\"===De.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(i),a.next_out=0,a.avail_out=i),s=Ue.inflate(a,r),s===Ne&&n&&(s=Ue.inflateSetDictionary(a,n),s===Fe?s=Ue.inflate(a,r):s===Be&&(s=Ne));a.avail_in>0&&s===Le&&a.state.wrap>0&&0!==t[a.next_in];)Ue.inflateReset(a),s=Ue.inflate(a,r);switch(s){case Ie:case Be:case Ne:case Ce:return this.onEnd(s),this.ended=!0,!1}if(o=a.avail_out,a.next_out&&(0===a.avail_out||s===Le))if(\"string\"===this.options.to){let t=Bt(a.output,a.next_out),e=a.next_out-t,n=It(a.output,t);a.next_out=e,a.avail_out=i-e,e&&a.output.set(a.output.subarray(t,t+e),0),this.onData(n)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(s!==Fe||0!==o){if(s===Le)return s=Ue.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},He.prototype.onData=function(t){this.chunks.push(t)},He.prototype.onEnd=function(t){t===Fe&&(\"string\"===this.options.to?this.result=this.chunks.join(\"\"):this.result=Ot(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:Me,deflate:je,deflateRaw:Ke,gzip:Pe}=Vt;var Ye=Me,Ge=je,Xe=B;const We=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\"Adding invalid event\");const e=this._hasEvents?\",\":\"\";this.deflate.push(e+t,Xe.Z_SYNC_FLUSH),this._hasEvents=!0}finish(){if(this.deflate.push(\"]\",Xe.Z_FINISH),this.deflate.err)throw this.deflate.err;const t=this.deflate.result;return this._init(),t}_init(){this._hasEvents=!1,this.deflate=new Ye,this.deflate.push(\"[\",Xe.Z_NO_FLUSH)}},qe={clear:()=>{We.clear()},addEvent:t=>We.addEvent(t),finish:()=>We.finish(),compress:t=>function(t){return Ge(t)}(t)};addEventListener(\"message\",(function(t){const e=t.data.method,a=t.data.id,i=t.data.arg;if(e in qe&&\"function\"==typeof qe[e])try{const t=qe[e](i);postMessage({id:a,method:e,success:!0,response:t})}catch(t){postMessage({id:a,method:e,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\"init\",success:!0,response:void 0});`;\n","import r from\"./worker\";function e(){const e=new Blob([r]);return URL.createObjectURL(e)}export{e as getWorkerURL};\n","import type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\n\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\nexport class EventBufferArray implements EventBuffer {\n  /** All the events that are buffered to be sent. */\n  public events: RecordingEvent[];\n\n  public constructor() {\n    this.events = [];\n  }\n\n  /** @inheritdoc */\n  public get hasEvents(): boolean {\n    return this.events.length > 0;\n  }\n\n  /** @inheritdoc */\n  public destroy(): void {\n    this.events = [];\n  }\n\n  /** @inheritdoc */\n  public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    if (isCheckout) {\n      this.events = [event];\n      return;\n    }\n\n    this.events.push(event);\n    return;\n  }\n\n  /** @inheritdoc */\n  public finish(): Promise<string> {\n    return new Promise<string>(resolve => {\n      // Make a copy of the events array reference and immediately clear the\n      // events member so that we do not lose new events while uploading\n      // attachment.\n      const eventsRet = this.events;\n      this.events = [];\n      resolve(JSON.stringify(eventsRet));\n    });\n  }\n}\n","import { logger } from '@sentry/utils';\n\nimport type { WorkerRequest, WorkerResponse } from '../types';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class WorkerHandler {\n  private _worker: Worker;\n  private _id: number;\n  private _ensureReadyPromise?: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._worker = worker;\n    this._id = 0;\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    // Ensure we only check once\n    if (this._ensureReadyPromise) {\n      return this._ensureReadyPromise;\n    }\n\n    this._ensureReadyPromise = new Promise((resolve, reject) => {\n      this._worker.addEventListener(\n        'message',\n        ({ data }: MessageEvent) => {\n          if ((data as WorkerResponse).success) {\n            resolve();\n          } else {\n            reject();\n          }\n        },\n        { once: true },\n      );\n\n      this._worker.addEventListener(\n        'error',\n        error => {\n          reject(error);\n        },\n        { once: true },\n      );\n    });\n\n    return this._ensureReadyPromise;\n  }\n\n  /**\n   * Destroy the worker.\n   */\n  public destroy(): void {\n    __DEBUG_BUILD__ && logger.log('[Replay] Destroying compression worker');\n    this._worker.terminate();\n  }\n\n  /**\n   * Post message to worker and wait for response before resolving promise.\n   */\n  public postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T> {\n    const id = this._getAndIncrementId();\n\n    return new Promise((resolve, reject) => {\n      const listener = ({ data }: MessageEvent): void => {\n        const response = data as WorkerResponse;\n        if (response.method !== method) {\n          return;\n        }\n\n        // There can be multiple listeners for a single method, the id ensures\n        // that the response matches the caller.\n        if (response.id !== id) {\n          return;\n        }\n\n        // At this point, we'll always want to remove listener regardless of result status\n        this._worker.removeEventListener('message', listener);\n\n        if (!response.success) {\n          // TODO: Do some error handling, not sure what\n          __DEBUG_BUILD__ && logger.error('[Replay]', response.response);\n\n          reject(new Error('Error in compression worker'));\n          return;\n        }\n\n        resolve(response.response as T);\n      };\n\n      // Note: we can't use `once` option because it's possible it needs to\n      // listen to multiple messages\n      this._worker.addEventListener('message', listener);\n      this._worker.postMessage({ id, method, arg });\n    });\n  }\n\n  /** Get the current ID and increment it for the next call. */\n  private _getAndIncrementId(): number {\n    return this._id++;\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\nimport type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\nimport { WorkerHandler } from './WorkerHandler';\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nexport class EventBufferCompressionWorker implements EventBuffer {\n  /** @inheritdoc */\n  public hasEvents: boolean;\n\n  private _worker: WorkerHandler;\n\n  public constructor(worker: Worker) {\n    this._worker = new WorkerHandler(worker);\n    this.hasEvents = false;\n  }\n\n  /**\n   * Ensure the worker is ready (or not).\n   * This will either resolve when the worker is ready, or reject if an error occured.\n   */\n  public ensureReady(): Promise<void> {\n    return this._worker.ensureReady();\n  }\n\n  /**\n   * Destroy the event buffer.\n   */\n  public destroy(): void {\n    this._worker.destroy();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfuly received and processed by worker.\n   */\n  public async addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    this.hasEvents = true;\n\n    if (isCheckout) {\n      // This event is a checkout, make sure worker buffer is cleared before\n      // proceeding.\n      await this._clear();\n    }\n\n    return this._sendEventToWorker(event);\n  }\n\n  /**\n   * Finish the event buffer and return the compressed data.\n   */\n  public finish(): Promise<ReplayRecordingData> {\n    return this._finishRequest();\n  }\n\n  /**\n   * Send the event to the worker.\n   */\n  private _sendEventToWorker(event: RecordingEvent): Promise<AddEventResult> {\n    return this._worker.postMessage<void>('addEvent', JSON.stringify(event));\n  }\n\n  /**\n   * Finish the request and return the compressed data from the worker.\n   */\n  private async _finishRequest(): Promise<Uint8Array> {\n    const response = await this._worker.postMessage<Uint8Array>('finish');\n\n    this.hasEvents = false;\n\n    return response;\n  }\n\n  /** Clear any pending events from the worker. */\n  private _clear(): Promise<void> {\n    return this._worker.postMessage('clear');\n  }\n}\n","import type { ReplayRecordingData } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { AddEventResult, EventBuffer, RecordingEvent } from '../types';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferCompressionWorker } from './EventBufferCompressionWorker';\n\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\nexport class EventBufferProxy implements EventBuffer {\n  private _fallback: EventBufferArray;\n  private _compression: EventBufferCompressionWorker;\n  private _used: EventBuffer;\n  private _ensureWorkerIsLoadedPromise: Promise<void>;\n\n  public constructor(worker: Worker) {\n    this._fallback = new EventBufferArray();\n    this._compression = new EventBufferCompressionWorker(worker);\n    this._used = this._fallback;\n\n    this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n  }\n\n  /** @inheritDoc */\n  public get hasEvents(): boolean {\n    return this._used.hasEvents;\n  }\n\n  /** @inheritDoc */\n  public destroy(): void {\n    this._fallback.destroy();\n    this._compression.destroy();\n  }\n\n  /**\n   * Add an event to the event buffer.\n   *\n   * Returns true if event was successfully added.\n   */\n  public addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult> {\n    return this._used.addEvent(event, isCheckout);\n  }\n\n  /** @inheritDoc */\n  public async finish(): Promise<ReplayRecordingData> {\n    // Ensure the worker is loaded, so the sent event is compressed\n    await this.ensureWorkerIsLoaded();\n\n    return this._used.finish();\n  }\n\n  /** Ensure the worker has loaded. */\n  public ensureWorkerIsLoaded(): Promise<void> {\n    return this._ensureWorkerIsLoadedPromise;\n  }\n\n  /** Actually check if the worker has been loaded. */\n  private async _ensureWorkerIsLoaded(): Promise<void> {\n    try {\n      await this._compression.ensureReady();\n    } catch (error) {\n      // If the worker fails to load, we fall back to the simple buffer.\n      // Nothing more to do from our side here\n      __DEBUG_BUILD__ && logger.log('[Replay] Failed to load the compression worker, falling back to simple buffer');\n      return;\n    }\n\n    // Now we need to switch over the array buffer to the compression worker\n    await this._switchToCompressionWorker();\n  }\n\n  /** Switch the used buffer to the compression worker. */\n  private async _switchToCompressionWorker(): Promise<void> {\n    const { events } = this._fallback;\n\n    const addEventPromises: Promise<void>[] = [];\n    for (const event of events) {\n      addEventPromises.push(this._compression.addEvent(event));\n    }\n\n    // We switch over to the new buffer immediately - any further events will be added\n    // after the previously buffered ones\n    this._used = this._compression;\n\n    // Wait for original events to be re-added before resolving\n    try {\n      await Promise.all(addEventPromises);\n    } catch (error) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n    }\n  }\n}\n","import { getWorkerURL } from '@sentry-internal/replay-worker';\nimport { logger } from '@sentry/utils';\n\nimport type { EventBuffer } from '../types';\nimport { EventBufferArray } from './EventBufferArray';\nimport { EventBufferProxy } from './EventBufferProxy';\n\ninterface CreateEventBufferParams {\n  useCompression: boolean;\n}\n\n/**\n * Create an event buffer for replays.\n */\nexport function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBuffer {\n  // eslint-disable-next-line no-restricted-globals\n  if (useCompression && window.Worker) {\n    try {\n      const workerUrl = getWorkerURL();\n\n      __DEBUG_BUILD__ && logger.log('[Replay] Using compression worker');\n      const worker = new Worker(workerUrl);\n      return new EventBufferProxy(worker);\n    } catch (error) {\n      __DEBUG_BUILD__ && logger.log('[Replay] Failed to create compression worker');\n      // Fall back to use simple event buffer array\n    }\n  }\n\n  __DEBUG_BUILD__ && logger.log('[Replay] Using simple buffer');\n  return new EventBufferArray();\n}\n","/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nexport function isExpired(\n  initialTime: null | number,\n  expiry: undefined | number,\n  targetTime: number = +new Date(),\n): boolean {\n  // Always expired if < 0\n  if (initialTime === null || expiry === undefined || expiry < 0) {\n    return true;\n  }\n\n  // Never expires if == 0\n  if (expiry === 0) {\n    return false;\n  }\n\n  return initialTime + expiry <= targetTime;\n}\n","import type { Session, Timeouts } from '../types';\nimport { isExpired } from './isExpired';\n\n/**\n * Checks to see if session is expired\n */\nexport function isSessionExpired(session: Session, timeouts: Timeouts, targetTime: number = +new Date()): boolean {\n  return (\n    // First, check that maximum session length has not been exceeded\n    isExpired(session.started, timeouts.maxSessionLife, targetTime) ||\n    // check that the idle timeout has not been exceeded (i.e. user has\n    // performed an action within the last `idleTimeout` ms)\n    isExpired(session.lastActivity, timeouts.sessionIdle, targetTime)\n  );\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\n\n/**\n * Save a session to session storage.\n */\nexport function saveSession(session: Session): void {\n  const hasSessionStorage = 'sessionStorage' in WINDOW;\n  if (!hasSessionStorage) {\n    return;\n  }\n\n  try {\n    WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n  } catch {\n    // Ignore potential SecurityError exceptions\n  }\n}\n","/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\nexport function isSampled(sampleRate?: number): boolean {\n  if (sampleRate === undefined) {\n    return false;\n  }\n\n  // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n  return Math.random() < sampleRate;\n}\n","import { uuid4 } from '@sentry/utils';\n\nimport type { Sampled, Session } from '../types';\nimport { isSampled } from '../util/isSampled';\n\n/**\n * Get a session with defaults & applied sampling.\n */\nexport function makeSession(session: Partial<Session> & { sampled: Sampled }): Session {\n  const now = Date.now();\n  const id = session.id || uuid4();\n  // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n  const started = session.started || now;\n  const lastActivity = session.lastActivity || now;\n  const segmentId = session.segmentId || 0;\n  const sampled = session.sampled;\n\n  return {\n    id,\n    started,\n    lastActivity,\n    segmentId,\n    sampled,\n  };\n}\n\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\nexport function getSessionSampleType(sessionSampleRate: number, errorSampleRate: number): Sampled {\n  return isSampled(sessionSampleRate) ? 'session' : isSampled(errorSampleRate) ? 'error' : false;\n}\n","import { logger } from '@sentry/utils';\n\nimport type { Session, SessionOptions } from '../types';\nimport { saveSession } from './saveSession';\nimport { getSessionSampleType, makeSession } from './Session';\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nexport function createSession({ sessionSampleRate, errorSampleRate, stickySession = false }: SessionOptions): Session {\n  const sampled = getSessionSampleType(sessionSampleRate, errorSampleRate);\n  const session = makeSession({\n    sampled,\n  });\n\n  __DEBUG_BUILD__ && logger.log(`[Replay] Creating new session: ${session.id}`);\n\n  if (stickySession) {\n    saveSession(session);\n  }\n\n  return session;\n}\n","import { REPLAY_SESSION_KEY, WINDOW } from '../constants';\nimport type { Session } from '../types';\nimport { makeSession } from './Session';\n\n/**\n * Fetches a session from storage\n */\nexport function fetchSession(): Session | null {\n  const hasSessionStorage = 'sessionStorage' in WINDOW;\n\n  if (!hasSessionStorage) {\n    return null;\n  }\n\n  try {\n    // This can throw if cookies are disabled\n    const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n    if (!sessionStringFromStorage) {\n      return null;\n    }\n\n    const sessionObj = JSON.parse(sessionStringFromStorage) as Session;\n\n    return makeSession(sessionObj);\n  } catch {\n    return null;\n  }\n}\n","import { logger } from '@sentry/utils';\n\nimport type { Session, SessionOptions, Timeouts } from '../types';\nimport { isSessionExpired } from '../util/isSessionExpired';\nimport { createSession } from './createSession';\nimport { fetchSession } from './fetchSession';\nimport { makeSession } from './Session';\n\ninterface GetSessionParams extends SessionOptions {\n  timeouts: Timeouts;\n\n  /**\n   * The current session (e.g. if stickySession is off)\n   */\n  currentSession?: Session;\n}\n\n/**\n * Get or create a session\n */\nexport function getSession({\n  timeouts,\n  currentSession,\n  stickySession,\n  sessionSampleRate,\n  errorSampleRate,\n}: GetSessionParams): { type: 'new' | 'saved'; session: Session } {\n  // If session exists and is passed, use it instead of always hitting session storage\n  const session = currentSession || (stickySession && fetchSession());\n\n  if (session) {\n    // If there is a session, check if it is valid (e.g. \"last activity\" time\n    // should be within the \"session idle time\", and \"session started\" time is\n    // within \"max session time\").\n    const isExpired = isSessionExpired(session, timeouts);\n\n    if (!isExpired) {\n      return { type: 'saved', session };\n    } else if (session.sampled === 'error') {\n      // Error samples should not be re-created when expired, but instead we stop when the replay is done\n      const discardedSession = makeSession({ sampled: false });\n      return { type: 'new', session: discardedSession };\n    } else {\n      __DEBUG_BUILD__ && logger.log('[Replay] Session has expired');\n    }\n    // Otherwise continue to create a new session\n  }\n\n  const newSession = createSession({\n    stickySession,\n    sessionSampleRate,\n    errorSampleRate,\n  });\n\n  return { type: 'new', session: newSession };\n}\n","import { getCurrentHub } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';\n\n/**\n * Add an event to the event buffer.\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nexport async function addEvent(\n  replay: ReplayContainer,\n  event: RecordingEvent,\n  isCheckout?: boolean,\n): Promise<AddEventResult | null> {\n  if (!replay.eventBuffer) {\n    // This implies that `_isEnabled` is false\n    return null;\n  }\n\n  if (replay.isPaused()) {\n    // Do not add to event buffer when recording is paused\n    return null;\n  }\n\n  // TODO: sadness -- we will want to normalize timestamps to be in ms -\n  // requires coordination with frontend\n  const isMs = event.timestamp > 9999999999;\n  const timestampInMs = isMs ? event.timestamp : event.timestamp * 1000;\n\n  // Throw out events that happen more than 5 minutes ago. This can happen if\n  // page has been left open and idle for a long period of time and user\n  // comes back to trigger a new session. The performance entries rely on\n  // `performance.timeOrigin`, which is when the page first opened.\n  if (timestampInMs + replay.timeouts.sessionIdle < Date.now()) {\n    return null;\n  }\n\n  // Only record earliest event if a new session was created, otherwise it\n  // shouldn't be relevant\n  const earliestEvent = replay.getContext().earliestEvent;\n  if (replay.session && replay.session.segmentId === 0 && (!earliestEvent || timestampInMs < earliestEvent)) {\n    replay.getContext().earliestEvent = timestampInMs;\n  }\n\n  try {\n    return await replay.eventBuffer.addEvent(event, isCheckout);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error(error);\n    replay.stop('addEvent');\n\n    const client = getCurrentHub().getClient();\n\n    if (client) {\n      client.recordDroppedEvent('internal_sdk_error', 'replay');\n    }\n  }\n}\n","import type { ErrorEvent, Event, ReplayEvent, TransactionEvent } from '@sentry/types';\n\n/** If the event is an error event */\nexport function isErrorEvent(event: Event): event is ErrorEvent {\n  return !event.type;\n}\n\n/** If the event is a transaction event */\nexport function isTransactionEvent(event: Event): event is TransactionEvent {\n  return event.type === 'transaction';\n}\n\n/** If the event is an replay event */\nexport function isReplayEvent(event: Event): event is ReplayEvent {\n  return event.type === 'replay_event';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { Event, Transport, TransportMakeRequestResponse } from '@sentry/types';\n\nimport { UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isTransactionEvent } from '../util/eventUtils';\n\ntype AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nexport function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback {\n  // Custom transports may still be returning `Promise<void>`, which means we cannot expect the status code to be available there\n  // TODO (v8): remove this check as it will no longer be necessary\n  const enforceStatusCode = isBaseTransportSend();\n\n  return (event: Event, sendResponse: TransportMakeRequestResponse | void) => {\n    if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n      return;\n    }\n\n    const statusCode = sendResponse && sendResponse.statusCode;\n\n    // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n    // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n    // If we do use the base transport, we skip if we encountered an non-OK status code\n    if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n      return;\n    }\n\n    // Collect traceIds in _context regardless of `recordingMode`\n    // In error mode, _context gets cleared on every checkout\n    if (isTransactionEvent(event) && event.contexts && event.contexts.trace && event.contexts.trace.trace_id) {\n      replay.getContext().traceIds.add(event.contexts.trace.trace_id as string);\n      return;\n    }\n\n    // Everything below is just for error events\n    if (!isErrorEvent(event)) {\n      return;\n    }\n\n    // Add error to list of errorIds of replay\n    if (event.event_id) {\n      replay.getContext().errorIds.add(event.event_id);\n    }\n\n    // Trigger error recording\n    // Need to be very careful that this does not cause an infinite loop\n    if (\n      replay.recordingMode === 'error' &&\n      event.exception &&\n      event.message !== UNABLE_TO_SEND_REPLAY // ignore this error because otherwise we could loop indefinitely with trying to capture replay and failing\n    ) {\n      setTimeout(async () => {\n        // Allow flush to complete before resuming as a session recording, otherwise\n        // the checkout from `startRecording` may be included in the payload.\n        // Prefer to keep the error replay as a separate (and smaller) segment\n        // than the session replay.\n        await replay.flushImmediate();\n\n        if (replay.stopRecording()) {\n          // Reset all \"capture on error\" configuration before\n          // starting a new recording\n          replay.recordingMode = 'session';\n          replay.startRecording();\n        }\n      });\n    }\n  };\n}\n\nfunction isBaseTransportSend(): boolean {\n  const client = getCurrentHub().getClient();\n  if (!client) {\n    return false;\n  }\n\n  const transport = client.getTransport();\n  if (!transport) {\n    return false;\n  }\n\n  return (\n    (transport.send as Transport['send'] & { __sentry__baseTransport__?: true }).__sentry__baseTransport__ || false\n  );\n}\n","var NodeType;\n(function (NodeType) {\n    NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n    NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n    NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n    NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n    NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n    NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {}));\n\nfunction isElement(n) {\n    return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n    const host = n === null || n === void 0 ? void 0 : n.host;\n    return Boolean(host && host.shadowRoot && host.shadowRoot === n);\n}\nfunction isInputTypeMasked({ maskInputOptions, tagName, type, }) {\n    if (tagName.toLowerCase() === 'option') {\n        tagName = 'select';\n    }\n    const actualType = typeof type === 'string' ? type.toLowerCase() : undefined;\n    return (maskInputOptions[tagName.toLowerCase()] ||\n        (actualType && maskInputOptions[actualType]) ||\n        actualType === 'password' ||\n        (tagName === 'input' && !type && maskInputOptions['text']));\n}\nfunction hasInputMaskOptions({ tagName, type, maskInputOptions, maskInputSelector, }) {\n    return (maskInputSelector || isInputTypeMasked({ maskInputOptions, tagName, type }));\n}\nfunction maskInputValue({ input, maskInputSelector, unmaskInputSelector, maskInputOptions, tagName, type, value, maskInputFn, }) {\n    let text = value || '';\n    if (unmaskInputSelector && input.matches(unmaskInputSelector)) {\n        return text;\n    }\n    if (input.hasAttribute('rr_is_password')) {\n        type = 'password';\n    }\n    if (isInputTypeMasked({ maskInputOptions, tagName, type }) ||\n        (maskInputSelector && input.matches(maskInputSelector))) {\n        if (maskInputFn) {\n            text = maskInputFn(text);\n        }\n        else {\n            text = '*'.repeat(text.length);\n        }\n    }\n    return text;\n}\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\nfunction is2DCanvasBlank(canvas) {\n    const ctx = canvas.getContext('2d');\n    if (!ctx)\n        return true;\n    const chunkSize = 50;\n    for (let x = 0; x < canvas.width; x += chunkSize) {\n        for (let y = 0; y < canvas.height; y += chunkSize) {\n            const getImageData = ctx.getImageData;\n            const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\n                ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\n                : getImageData;\n            const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n            if (pixelBuffer.some((pixel) => pixel !== 0))\n                return false;\n        }\n    }\n    return true;\n}\n\nlet _id = 1;\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\nconst IGNORED_NODE = -2;\nfunction defaultMaskFn(str) {\n    return str ? str.replace(/[\\S]/g, '*') : '';\n}\nfunction genId() {\n    return _id++;\n}\nfunction getValidTagName(element) {\n    if (element instanceof HTMLFormElement) {\n        return 'form';\n    }\n    const processedTagName = element.tagName.toLowerCase().trim();\n    if (tagNameRegex.test(processedTagName)) {\n        return 'div';\n    }\n    return processedTagName;\n}\nfunction getCssRulesString(s) {\n    try {\n        const rules = s.rules || s.cssRules;\n        return rules ? Array.from(rules).map(getCssRuleString).join('') : null;\n    }\n    catch (error) {\n        return null;\n    }\n}\nfunction getCssRuleString(rule) {\n    let cssStringified = rule.cssText;\n    if (isCSSImportRule(rule)) {\n        try {\n            cssStringified = getCssRulesString(rule.styleSheet) || cssStringified;\n        }\n        catch (_a) {\n        }\n    }\n    return cssStringified;\n}\nfunction isCSSImportRule(rule) {\n    return 'styleSheet' in rule;\n}\nfunction stringifyStyleSheet(sheet) {\n    return sheet.cssRules\n        ? Array.from(sheet.cssRules)\n            .map((rule) => rule.cssText || '')\n            .join('')\n        : '';\n}\nfunction extractOrigin(url) {\n    let origin = '';\n    if (url.indexOf('//') > -1) {\n        origin = url.split('/').slice(0, 3).join('/');\n    }\n    else {\n        origin = url.split('/')[0];\n    }\n    origin = origin.split('?')[0];\n    return origin;\n}\nlet canvasService;\nlet canvasCtx;\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst RELATIVE_PATH = /^(?!www\\.|(?:http|ftp)s?:\\/\\/|[A-Za-z]:\\\\|\\/\\/|#).*/;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absoluteToStylesheet(cssText, href) {\n    return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\n        const filePath = path1 || path2 || path3;\n        const maybeQuote = quote1 || quote2 || '';\n        if (!filePath) {\n            return origin;\n        }\n        if (!RELATIVE_PATH.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (DATA_URI.test(filePath)) {\n            return `url(${maybeQuote}${filePath}${maybeQuote})`;\n        }\n        if (filePath[0] === '/') {\n            return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n        }\n        const stack = href.split('/');\n        const parts = filePath.split('/');\n        stack.pop();\n        for (const part of parts) {\n            if (part === '.') {\n                continue;\n            }\n            else if (part === '..') {\n                stack.pop();\n            }\n            else {\n                stack.push(part);\n            }\n        }\n        return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\n    });\n}\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n    if (attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    let pos = 0;\n    function collectCharacters(regEx) {\n        let chars;\n        let match = regEx.exec(attributeValue.substring(pos));\n        if (match) {\n            chars = match[0];\n            pos += chars.length;\n            return chars;\n        }\n        return '';\n    }\n    let output = [];\n    while (true) {\n        collectCharacters(SRCSET_COMMAS_OR_SPACES);\n        if (pos >= attributeValue.length) {\n            break;\n        }\n        let url = collectCharacters(SRCSET_NOT_SPACES);\n        if (url.slice(-1) === ',') {\n            url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n            output.push(url);\n        }\n        else {\n            let descriptorsStr = '';\n            url = absoluteToDoc(doc, url);\n            let inParens = false;\n            while (true) {\n                let c = attributeValue.charAt(pos);\n                if (c === '') {\n                    output.push((url + descriptorsStr).trim());\n                    break;\n                }\n                else if (!inParens) {\n                    if (c === ',') {\n                        pos += 1;\n                        output.push((url + descriptorsStr).trim());\n                        break;\n                    }\n                    else if (c === '(') {\n                        inParens = true;\n                    }\n                }\n                else {\n                    if (c === ')') {\n                        inParens = false;\n                    }\n                }\n                descriptorsStr += c;\n                pos += 1;\n            }\n        }\n    }\n    return output.join(', ');\n}\nfunction absoluteToDoc(doc, attributeValue) {\n    if (!attributeValue || attributeValue.trim() === '') {\n        return attributeValue;\n    }\n    const a = doc.createElement('a');\n    a.href = attributeValue;\n    return a.href;\n}\nfunction isSVGElement(el) {\n    return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\nfunction getHref() {\n    const a = document.createElement('a');\n    a.href = '';\n    return a.href;\n}\nfunction transformAttribute(doc, element, _tagName, _name, value, maskAllText, unmaskTextSelector, maskTextFn) {\n    if (!value) {\n        return value;\n    }\n    const name = _name.toLowerCase();\n    const tagName = _tagName.toLowerCase();\n    if (name === 'src' || name === 'href') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'xlink:href' && value[0] !== '#') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'background' &&\n        (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n        return absoluteToDoc(doc, value);\n    }\n    else if (name === 'srcset') {\n        return getAbsoluteSrcsetString(doc, value);\n    }\n    else if (name === 'style') {\n        return absoluteToStylesheet(value, getHref());\n    }\n    else if (tagName === 'object' && name === 'data') {\n        return absoluteToDoc(doc, value);\n    }\n    else if (maskAllText &&\n        _shouldMaskAttribute(element, name, tagName, unmaskTextSelector)) {\n        return maskTextFn ? maskTextFn(value) : defaultMaskFn(value);\n    }\n    return value;\n}\nfunction _shouldMaskAttribute(element, attribute, tagName, unmaskTextSelector) {\n    if (unmaskTextSelector && element.matches(unmaskTextSelector)) {\n        return false;\n    }\n    return (['placeholder', 'title', 'aria-label'].indexOf(attribute) > -1 ||\n        (tagName === 'input' &&\n            attribute === 'value' &&\n            element.hasAttribute('type') &&\n            ['submit', 'button'].indexOf(element.getAttribute('type').toLowerCase()) > -1));\n}\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n    if (unblockSelector && element.matches(unblockSelector)) {\n        return false;\n    }\n    if (typeof blockClass === 'string') {\n        if (element.classList.contains(blockClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {\n            const className = element.classList[eIndex];\n            if (blockClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (blockSelector) {\n        return element.matches(blockSelector);\n    }\n    return false;\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) {\n    if (!node) {\n        return false;\n    }\n    if (node.nodeType !== node.ELEMENT_NODE) {\n        return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n    }\n    if (unmaskTextSelector) {\n        if (node.matches(unmaskTextSelector) ||\n            node.closest(unmaskTextSelector)) {\n            return false;\n        }\n    }\n    if (maskAllText) {\n        return true;\n    }\n    if (typeof maskTextClass === 'string') {\n        if (node.classList.contains(maskTextClass)) {\n            return true;\n        }\n    }\n    else {\n        for (let eIndex = 0; eIndex < node.classList.length; eIndex++) {\n            const className = node.classList[eIndex];\n            if (maskTextClass.test(className)) {\n                return true;\n            }\n        }\n    }\n    if (maskTextSelector) {\n        if (node.matches(maskTextSelector)) {\n            return true;\n        }\n    }\n    return needMaskingText(node.parentNode, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText);\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n    const win = iframeEl.contentWindow;\n    if (!win) {\n        return;\n    }\n    let fired = false;\n    let readyState;\n    try {\n        readyState = win.document.readyState;\n    }\n    catch (error) {\n        return;\n    }\n    if (readyState !== 'complete') {\n        const timer = setTimeout(() => {\n            if (!fired) {\n                listener();\n                fired = true;\n            }\n        }, iframeLoadTimeout);\n        iframeEl.addEventListener('load', () => {\n            clearTimeout(timer);\n            fired = true;\n            listener();\n        });\n        return;\n    }\n    const blankUrl = 'about:blank';\n    if (win.location.href !== blankUrl ||\n        iframeEl.src === blankUrl ||\n        iframeEl.src === '') {\n        setTimeout(listener, 0);\n        return;\n    }\n    iframeEl.addEventListener('load', listener);\n}\nfunction serializeNode(n, options) {\n    var _a;\n    const { doc, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, } = options;\n    let rootId;\n    if (doc.__sn) {\n        const docId = doc.__sn.id;\n        rootId = docId === 1 ? undefined : docId;\n    }\n    switch (n.nodeType) {\n        case n.DOCUMENT_NODE:\n            if (n.compatMode !== 'CSS1Compat') {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    compatMode: n.compatMode,\n                    rootId,\n                };\n            }\n            else {\n                return {\n                    type: NodeType.Document,\n                    childNodes: [],\n                    rootId,\n                };\n            }\n        case n.DOCUMENT_TYPE_NODE:\n            return {\n                type: NodeType.DocumentType,\n                name: n.name,\n                publicId: n.publicId,\n                systemId: n.systemId,\n                rootId,\n            };\n        case n.ELEMENT_NODE:\n            const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n            const tagName = getValidTagName(n);\n            let attributes = {};\n            for (const { name, value } of Array.from(n.attributes)) {\n                if (!skipAttribute(tagName, name)) {\n                    attributes[name] = transformAttribute(doc, n, tagName, name, value, maskAllText, unmaskTextSelector, maskTextFn);\n                }\n            }\n            if (tagName === 'link' && inlineStylesheet) {\n                const stylesheet = Array.from(doc.styleSheets).find((s) => {\n                    return s.href === n.href;\n                });\n                let cssText = null;\n                if (stylesheet) {\n                    cssText = getCssRulesString(stylesheet);\n                }\n                if (cssText) {\n                    delete attributes.rel;\n                    delete attributes.href;\n                    attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n                }\n            }\n            if (tagName === 'style' &&\n                n.sheet &&\n                !(n.innerText ||\n                    n.textContent ||\n                    '').trim().length) {\n                const cssText = getCssRulesString(n.sheet);\n                if (cssText) {\n                    attributes._cssText = absoluteToStylesheet(cssText, getHref());\n                }\n            }\n            if (tagName === 'input' ||\n                tagName === 'textarea' ||\n                tagName === 'select' ||\n                tagName === 'option') {\n                const el = n;\n                const value = getInputValue(tagName, el, attributes);\n                const checked = n.checked;\n                if (attributes.type !== 'submit' &&\n                    attributes.type !== 'button' &&\n                    value) {\n                    attributes.value = maskInputValue({\n                        input: el,\n                        type: attributes.type,\n                        tagName,\n                        value,\n                        maskInputSelector,\n                        unmaskInputSelector,\n                        maskInputOptions,\n                        maskInputFn,\n                    });\n                }\n                if (checked) {\n                    attributes.checked = checked;\n                }\n            }\n            if (tagName === 'option') {\n                if (n.selected && !maskInputOptions['select']) {\n                    attributes.selected = true;\n                }\n                else {\n                    delete attributes.selected;\n                }\n            }\n            if (tagName === 'canvas' && recordCanvas) {\n                if (n.__context === '2d') {\n                    if (!is2DCanvasBlank(n)) {\n                        attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                }\n                else if (!('__context' in n)) {\n                    const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    const blankCanvas = document.createElement('canvas');\n                    blankCanvas.width = n.width;\n                    blankCanvas.height = n.height;\n                    const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    if (canvasDataURL !== blankCanvasDataURL) {\n                        attributes.rr_dataURL = canvasDataURL;\n                    }\n                }\n            }\n            if (tagName === 'img' && inlineImages) {\n                if (!canvasService) {\n                    canvasService = doc.createElement('canvas');\n                    canvasCtx = canvasService.getContext('2d');\n                }\n                const image = n;\n                const oldValue = image.crossOrigin;\n                image.crossOrigin = 'anonymous';\n                const recordInlineImage = () => {\n                    try {\n                        canvasService.width = image.naturalWidth;\n                        canvasService.height = image.naturalHeight;\n                        canvasCtx.drawImage(image, 0, 0);\n                        attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n                    }\n                    catch (err) {\n                        console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\n                    }\n                    oldValue\n                        ? (attributes.crossOrigin = oldValue)\n                        : delete attributes.crossOrigin;\n                };\n                if (image.complete && image.naturalWidth !== 0)\n                    recordInlineImage();\n                else\n                    image.onload = recordInlineImage;\n            }\n            if (tagName === 'audio' || tagName === 'video') {\n                attributes.rr_mediaState = n.paused\n                    ? 'paused'\n                    : 'played';\n                attributes.rr_mediaCurrentTime = n.currentTime;\n            }\n            if (n.scrollLeft) {\n                attributes.rr_scrollLeft = n.scrollLeft;\n            }\n            if (n.scrollTop) {\n                attributes.rr_scrollTop = n.scrollTop;\n            }\n            if (needBlock) {\n                const { width, height } = n.getBoundingClientRect();\n                attributes = {\n                    class: attributes.class,\n                    rr_width: `${width}px`,\n                    rr_height: `${height}px`,\n                };\n            }\n            if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n                if (!n.contentDocument) {\n                    attributes.rr_src = attributes.src;\n                }\n                delete attributes.src;\n            }\n            return {\n                type: NodeType.Element,\n                tagName,\n                attributes,\n                childNodes: [],\n                isSVG: isSVGElement(n) || undefined,\n                needBlock,\n                rootId,\n            };\n        case n.TEXT_NODE:\n            const parentTagName = n.parentNode && n.parentNode.tagName;\n            let textContent = n.textContent;\n            const isStyle = parentTagName === 'STYLE' ? true : undefined;\n            const isScript = parentTagName === 'SCRIPT' ? true : undefined;\n            if (isStyle && textContent) {\n                try {\n                    if (n.nextSibling || n.previousSibling) {\n                    }\n                    else if ((_a = n.parentNode.sheet) === null || _a === void 0 ? void 0 : _a.cssRules) {\n                        textContent = stringifyStyleSheet(n.parentNode.sheet);\n                    }\n                }\n                catch (err) {\n                    console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\n                }\n                textContent = absoluteToStylesheet(textContent, getHref());\n            }\n            if (isScript) {\n                textContent = 'SCRIPT_PLACEHOLDER';\n            }\n            if (parentTagName === 'TEXTAREA' && textContent) {\n                textContent = '';\n            }\n            else if (parentTagName === 'OPTION' && textContent) {\n                const option = n.parentNode;\n                textContent = maskInputValue({\n                    input: option,\n                    type: null,\n                    tagName: parentTagName,\n                    value: textContent,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskInputOptions,\n                    maskInputFn,\n                });\n            }\n            else if (!isStyle &&\n                !isScript &&\n                needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextSelector, maskAllText) &&\n                textContent) {\n                textContent = maskTextFn\n                    ? maskTextFn(textContent)\n                    : defaultMaskFn(textContent);\n            }\n            return {\n                type: NodeType.Text,\n                textContent: textContent || '',\n                isStyle,\n                rootId,\n            };\n        case n.CDATA_SECTION_NODE:\n            return {\n                type: NodeType.CDATA,\n                textContent: '',\n                rootId,\n            };\n        case n.COMMENT_NODE:\n            return {\n                type: NodeType.Comment,\n                textContent: n.textContent || '',\n                rootId,\n            };\n        default:\n            return false;\n    }\n}\nfunction lowerIfExists(maybeAttr) {\n    if (maybeAttr === undefined || maybeAttr === null) {\n        return '';\n    }\n    else {\n        return maybeAttr.toLowerCase();\n    }\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n    if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\n        return true;\n    }\n    else if (sn.type === NodeType.Element) {\n        if (slimDOMOptions.script &&\n            (sn.tagName === 'script' ||\n                (sn.tagName === 'link' &&\n                    (sn.attributes.rel === 'preload' ||\n                        sn.attributes.rel === 'modulepreload') &&\n                    sn.attributes.as === 'script') ||\n                (sn.tagName === 'link' &&\n                    sn.attributes.rel === 'prefetch' &&\n                    typeof sn.attributes.href === 'string' &&\n                    sn.attributes.href.endsWith('.js')))) {\n            return true;\n        }\n        else if (slimDOMOptions.headFavicon &&\n            ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\n                (sn.tagName === 'meta' &&\n                    (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\n                        lowerIfExists(sn.attributes.name) === 'application-name' ||\n                        lowerIfExists(sn.attributes.rel) === 'icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\n                        lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\n            return true;\n        }\n        else if (sn.tagName === 'meta') {\n            if (slimDOMOptions.headMetaDescKeywords &&\n                lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaSocial &&\n                (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\n                    lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\n                    lowerIfExists(sn.attributes.name) === 'pinterest')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaRobots &&\n                (lowerIfExists(sn.attributes.name) === 'robots' ||\n                    lowerIfExists(sn.attributes.name) === 'googlebot' ||\n                    lowerIfExists(sn.attributes.name) === 'bingbot')) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaHttpEquiv &&\n                sn.attributes['http-equiv'] !== undefined) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaAuthorship &&\n                (lowerIfExists(sn.attributes.name) === 'author' ||\n                    lowerIfExists(sn.attributes.name) === 'generator' ||\n                    lowerIfExists(sn.attributes.name) === 'framework' ||\n                    lowerIfExists(sn.attributes.name) === 'publisher' ||\n                    lowerIfExists(sn.attributes.name) === 'progid' ||\n                    lowerIfExists(sn.attributes.property).match(/^article:/) ||\n                    lowerIfExists(sn.attributes.property).match(/^product:/))) {\n                return true;\n            }\n            else if (slimDOMOptions.headMetaVerification &&\n                (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\n                    lowerIfExists(sn.attributes.name) === 'csrf-token' ||\n                    lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\n                    lowerIfExists(sn.attributes.name) === 'verify-v1' ||\n                    lowerIfExists(sn.attributes.name) === 'verification' ||\n                    lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction serializeNodeWithId(n, options) {\n    const { doc, map, blockClass, blockSelector, unblockSelector, maskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputSelector, unmaskInputSelector, maskAllText, maskInputOptions = {}, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, keepIframeSrcFn = () => false, } = options;\n    let { preserveWhiteSpace = true } = options;\n    const _serializedNode = serializeNode(n, {\n        doc,\n        blockClass,\n        blockSelector,\n        unblockSelector,\n        maskTextClass,\n        maskTextSelector,\n        unmaskTextSelector,\n        inlineStylesheet,\n        maskInputSelector,\n        unmaskInputSelector,\n        maskAllText,\n        maskInputOptions,\n        maskTextFn,\n        maskInputFn,\n        dataURLOptions,\n        inlineImages,\n        recordCanvas,\n        keepIframeSrcFn,\n    });\n    if (!_serializedNode) {\n        console.warn(n, 'not serialized');\n        return null;\n    }\n    let id;\n    if ('__sn' in n) {\n        id = n.__sn.id;\n    }\n    else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\n        (!preserveWhiteSpace &&\n            _serializedNode.type === NodeType.Text &&\n            !_serializedNode.isStyle &&\n            !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\n        id = IGNORED_NODE;\n    }\n    else {\n        id = genId();\n    }\n    const serializedNode = Object.assign(_serializedNode, { id });\n    n.__sn = serializedNode;\n    if (id === IGNORED_NODE) {\n        return null;\n    }\n    map[id] = n;\n    if (onSerialize) {\n        onSerialize(n);\n    }\n    let recordChild = !skipChild;\n    if (serializedNode.type === NodeType.Element) {\n        recordChild = recordChild && !serializedNode.needBlock;\n        delete serializedNode.needBlock;\n        if (n.shadowRoot)\n            serializedNode.isShadowHost = true;\n    }\n    if ((serializedNode.type === NodeType.Document ||\n        serializedNode.type === NodeType.Element) &&\n        recordChild) {\n        if (slimDOMOptions.headWhitespace &&\n            _serializedNode.type === NodeType.Element &&\n            _serializedNode.tagName === 'head') {\n            preserveWhiteSpace = false;\n        }\n        const bypassOptions = {\n            doc,\n            map,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        };\n        for (const childN of Array.from(n.childNodes)) {\n            const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n            if (serializedChildNode) {\n                serializedNode.childNodes.push(serializedChildNode);\n            }\n        }\n        if (isElement(n) && n.shadowRoot) {\n            for (const childN of Array.from(n.shadowRoot.childNodes)) {\n                const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n                if (serializedChildNode) {\n                    serializedChildNode.isShadow = true;\n                    serializedNode.childNodes.push(serializedChildNode);\n                }\n            }\n        }\n    }\n    if (n.parentNode && isShadowRoot(n.parentNode)) {\n        serializedNode.isShadow = true;\n    }\n    if (serializedNode.type === NodeType.Element &&\n        serializedNode.tagName === 'iframe') {\n        onceIframeLoaded(n, () => {\n            const iframeDoc = n.contentDocument;\n            if (iframeDoc && onIframeLoad) {\n                const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n                    doc: iframeDoc,\n                    map,\n                    blockClass,\n                    blockSelector,\n                    unblockSelector,\n                    maskTextClass,\n                    maskTextSelector,\n                    unmaskTextSelector,\n                    skipChild: false,\n                    inlineStylesheet,\n                    maskInputSelector,\n                    unmaskInputSelector,\n                    maskAllText,\n                    maskInputOptions,\n                    maskTextFn,\n                    maskInputFn,\n                    slimDOMOptions,\n                    dataURLOptions,\n                    inlineImages,\n                    recordCanvas,\n                    preserveWhiteSpace,\n                    onSerialize,\n                    onIframeLoad,\n                    iframeLoadTimeout,\n                    keepIframeSrcFn,\n                });\n                if (serializedIframeNode) {\n                    onIframeLoad(n, serializedIframeNode);\n                }\n            }\n        }, iframeLoadTimeout);\n    }\n    return serializedNode;\n}\nfunction snapshot(n, options) {\n    const { blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskTextClass = 'rr-mask', maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskInputSelector = null, unmaskInputSelector = null, maskAllText = false, maskAllInputs = false, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\n    const idNodeMap = {};\n    const maskInputOptions = maskAllInputs === true\n        ? {\n            color: true,\n            date: true,\n            'datetime-local': true,\n            email: true,\n            month: true,\n            number: true,\n            range: true,\n            search: true,\n            tel: true,\n            text: true,\n            time: true,\n            url: true,\n            week: true,\n            textarea: true,\n            select: true,\n        }\n        : maskAllInputs === false\n            ? {}\n            : maskAllInputs;\n    const slimDOMOptions = slimDOM === true || slimDOM === 'all'\n        ?\n            {\n                script: true,\n                comment: true,\n                headFavicon: true,\n                headWhitespace: true,\n                headMetaDescKeywords: slimDOM === 'all',\n                headMetaSocial: true,\n                headMetaRobots: true,\n                headMetaHttpEquiv: true,\n                headMetaAuthorship: true,\n                headMetaVerification: true,\n            }\n        : slimDOM === false\n            ? {}\n            : slimDOM;\n    return [\n        serializeNodeWithId(n, {\n            doc: n,\n            map: idNodeMap,\n            blockClass,\n            blockSelector,\n            unblockSelector,\n            maskTextClass,\n            maskTextSelector,\n            unmaskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputSelector,\n            unmaskInputSelector,\n            maskAllText,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            keepIframeSrcFn,\n        }),\n        idNodeMap,\n    ];\n}\nfunction visitSnapshot(node, onVisit) {\n    function walk(current) {\n        onVisit(current);\n        if (current.type === NodeType.Document ||\n            current.type === NodeType.Element) {\n            current.childNodes.forEach(walk);\n        }\n    }\n    walk(node);\n}\nfunction cleanupSnapshot() {\n    _id = 1;\n}\nfunction skipAttribute(tagName, attributeName, value) {\n    return ((tagName === 'video' || tagName === 'audio') && attributeName === 'autoplay');\n}\nfunction getInputValue(tagName, el, attributes) {\n    if (tagName === 'input' &&\n        (attributes.type === 'radio' || attributes.type === 'checkbox')) {\n        return el.getAttribute('value') || '';\n    }\n    return el.value;\n}\n\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\nfunction parse(css, options = {}) {\n    let lineno = 1;\n    let column = 1;\n    function updatePosition(str) {\n        const lines = str.match(/\\n/g);\n        if (lines) {\n            lineno += lines.length;\n        }\n        let i = str.lastIndexOf('\\n');\n        column = i === -1 ? column + str.length : str.length - i;\n    }\n    function position() {\n        const start = { line: lineno, column };\n        return (node) => {\n            node.position = new Position(start);\n            whitespace();\n            return node;\n        };\n    }\n    class Position {\n        constructor(start) {\n            this.start = start;\n            this.end = { line: lineno, column };\n            this.source = options.source;\n        }\n    }\n    Position.prototype.content = css;\n    const errorsList = [];\n    function error(msg) {\n        const err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);\n        err.reason = msg;\n        err.filename = options.source;\n        err.line = lineno;\n        err.column = column;\n        err.source = css;\n        if (options.silent) {\n            errorsList.push(err);\n        }\n        else {\n            throw err;\n        }\n    }\n    function stylesheet() {\n        const rulesList = rules();\n        return {\n            type: 'stylesheet',\n            stylesheet: {\n                source: options.source,\n                rules: rulesList,\n                parsingErrors: errorsList,\n            },\n        };\n    }\n    function open() {\n        return match(/^{\\s*/);\n    }\n    function close() {\n        return match(/^}/);\n    }\n    function rules() {\n        let node;\n        const rules = [];\n        whitespace();\n        comments(rules);\n        while (css.length && css.charAt(0) !== '}' && (node = atrule() || rule())) {\n            if (node !== false) {\n                rules.push(node);\n                comments(rules);\n            }\n        }\n        return rules;\n    }\n    function match(re) {\n        const m = re.exec(css);\n        if (!m) {\n            return;\n        }\n        const str = m[0];\n        updatePosition(str);\n        css = css.slice(str.length);\n        return m;\n    }\n    function whitespace() {\n        match(/^\\s*/);\n    }\n    function comments(rules = []) {\n        let c;\n        while ((c = comment())) {\n            if (c !== false) {\n                rules.push(c);\n            }\n            c = comment();\n        }\n        return rules;\n    }\n    function comment() {\n        const pos = position();\n        if ('/' !== css.charAt(0) || '*' !== css.charAt(1)) {\n            return;\n        }\n        let i = 2;\n        while ('' !== css.charAt(i) &&\n            ('*' !== css.charAt(i) || '/' !== css.charAt(i + 1))) {\n            ++i;\n        }\n        i += 2;\n        if ('' === css.charAt(i - 1)) {\n            return error('End of comment missing');\n        }\n        const str = css.slice(2, i - 2);\n        column += 2;\n        updatePosition(str);\n        css = css.slice(i);\n        column += 2;\n        return pos({\n            type: 'comment',\n            comment: str,\n        });\n    }\n    function selector() {\n        const m = match(/^([^{]+)/);\n        if (!m) {\n            return;\n        }\n        return trim(m[0])\n            .replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, '')\n            .replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m) => {\n            return m.replace(/,/g, '\\u200C');\n        })\n            .split(/\\s*(?![^(]*\\)),\\s*/)\n            .map((s) => {\n            return s.replace(/\\u200C/g, ',');\n        });\n    }\n    function declaration() {\n        const pos = position();\n        let propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\n        if (!propMatch) {\n            return;\n        }\n        const prop = trim(propMatch[0]);\n        if (!match(/^:\\s*/)) {\n            return error(`property missing ':'`);\n        }\n        const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\n        const ret = pos({\n            type: 'declaration',\n            property: prop.replace(commentre, ''),\n            value: val ? trim(val[0]).replace(commentre, '') : '',\n        });\n        match(/^[;\\s]*/);\n        return ret;\n    }\n    function declarations() {\n        const decls = [];\n        if (!open()) {\n            return error(`missing '{'`);\n        }\n        comments(decls);\n        let decl;\n        while ((decl = declaration())) {\n            if (decl !== false) {\n                decls.push(decl);\n                comments(decls);\n            }\n            decl = declaration();\n        }\n        if (!close()) {\n            return error(`missing '}'`);\n        }\n        return decls;\n    }\n    function keyframe() {\n        let m;\n        const vals = [];\n        const pos = position();\n        while ((m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/))) {\n            vals.push(m[1]);\n            match(/^,\\s*/);\n        }\n        if (!vals.length) {\n            return;\n        }\n        return pos({\n            type: 'keyframe',\n            values: vals,\n            declarations: declarations(),\n        });\n    }\n    function atkeyframes() {\n        const pos = position();\n        let m = match(/^@([-\\w]+)?keyframes\\s*/);\n        if (!m) {\n            return;\n        }\n        const vendor = m[1];\n        m = match(/^([-\\w]+)\\s*/);\n        if (!m) {\n            return error('@keyframes missing name');\n        }\n        const name = m[1];\n        if (!open()) {\n            return error(`@keyframes missing '{'`);\n        }\n        let frame;\n        let frames = comments();\n        while ((frame = keyframe())) {\n            frames.push(frame);\n            frames = frames.concat(comments());\n        }\n        if (!close()) {\n            return error(`@keyframes missing '}'`);\n        }\n        return pos({\n            type: 'keyframes',\n            name,\n            vendor,\n            keyframes: frames,\n        });\n    }\n    function atsupports() {\n        const pos = position();\n        const m = match(/^@supports *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const supports = trim(m[1]);\n        if (!open()) {\n            return error(`@supports missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@supports missing '}'`);\n        }\n        return pos({\n            type: 'supports',\n            supports,\n            rules: style,\n        });\n    }\n    function athost() {\n        const pos = position();\n        const m = match(/^@host\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@host missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@host missing '}'`);\n        }\n        return pos({\n            type: 'host',\n            rules: style,\n        });\n    }\n    function atmedia() {\n        const pos = position();\n        const m = match(/^@media *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const media = trim(m[1]);\n        if (!open()) {\n            return error(`@media missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@media missing '}'`);\n        }\n        return pos({\n            type: 'media',\n            media,\n            rules: style,\n        });\n    }\n    function atcustommedia() {\n        const pos = position();\n        const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\n        if (!m) {\n            return;\n        }\n        return pos({\n            type: 'custom-media',\n            name: trim(m[1]),\n            media: trim(m[2]),\n        });\n    }\n    function atpage() {\n        const pos = position();\n        const m = match(/^@page */);\n        if (!m) {\n            return;\n        }\n        const sel = selector() || [];\n        if (!open()) {\n            return error(`@page missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@page missing '}'`);\n        }\n        return pos({\n            type: 'page',\n            selectors: sel,\n            declarations: decls,\n        });\n    }\n    function atdocument() {\n        const pos = position();\n        const m = match(/^@([-\\w]+)?document *([^{]+)/);\n        if (!m) {\n            return;\n        }\n        const vendor = trim(m[1]);\n        const doc = trim(m[2]);\n        if (!open()) {\n            return error(`@document missing '{'`);\n        }\n        const style = comments().concat(rules());\n        if (!close()) {\n            return error(`@document missing '}'`);\n        }\n        return pos({\n            type: 'document',\n            document: doc,\n            vendor,\n            rules: style,\n        });\n    }\n    function atfontface() {\n        const pos = position();\n        const m = match(/^@font-face\\s*/);\n        if (!m) {\n            return;\n        }\n        if (!open()) {\n            return error(`@font-face missing '{'`);\n        }\n        let decls = comments();\n        let decl;\n        while ((decl = declaration())) {\n            decls.push(decl);\n            decls = decls.concat(comments());\n        }\n        if (!close()) {\n            return error(`@font-face missing '}'`);\n        }\n        return pos({\n            type: 'font-face',\n            declarations: decls,\n        });\n    }\n    const atimport = _compileAtrule('import');\n    const atcharset = _compileAtrule('charset');\n    const atnamespace = _compileAtrule('namespace');\n    function _compileAtrule(name) {\n        const re = new RegExp('^@' + name + '\\\\s*([^;]+);');\n        return () => {\n            const pos = position();\n            const m = match(re);\n            if (!m) {\n                return;\n            }\n            const ret = { type: name };\n            ret[name] = m[1].trim();\n            return pos(ret);\n        };\n    }\n    function atrule() {\n        if (css[0] !== '@') {\n            return;\n        }\n        return (atkeyframes() ||\n            atmedia() ||\n            atcustommedia() ||\n            atsupports() ||\n            atimport() ||\n            atcharset() ||\n            atnamespace() ||\n            atdocument() ||\n            atpage() ||\n            athost() ||\n            atfontface());\n    }\n    function rule() {\n        const pos = position();\n        const sel = selector();\n        if (!sel) {\n            return error('selector missing');\n        }\n        comments();\n        return pos({\n            type: 'rule',\n            selectors: sel,\n            declarations: declarations(),\n        });\n    }\n    return addParent(stylesheet());\n}\nfunction trim(str) {\n    return str ? str.replace(/^\\s+|\\s+$/g, '') : '';\n}\nfunction addParent(obj, parent) {\n    const isNode = obj && typeof obj.type === 'string';\n    const childParent = isNode ? obj : parent;\n    for (const k of Object.keys(obj)) {\n        const value = obj[k];\n        if (Array.isArray(value)) {\n            value.forEach((v) => {\n                addParent(v, childParent);\n            });\n        }\n        else if (value && typeof value === 'object') {\n            addParent(value, childParent);\n        }\n    }\n    if (isNode) {\n        Object.defineProperty(obj, 'parent', {\n            configurable: true,\n            writable: true,\n            enumerable: false,\n            value: parent || null,\n        });\n    }\n    return obj;\n}\n\nconst tagMap = {\n    script: 'noscript',\n    altglyph: 'altGlyph',\n    altglyphdef: 'altGlyphDef',\n    altglyphitem: 'altGlyphItem',\n    animatecolor: 'animateColor',\n    animatemotion: 'animateMotion',\n    animatetransform: 'animateTransform',\n    clippath: 'clipPath',\n    feblend: 'feBlend',\n    fecolormatrix: 'feColorMatrix',\n    fecomponenttransfer: 'feComponentTransfer',\n    fecomposite: 'feComposite',\n    feconvolvematrix: 'feConvolveMatrix',\n    fediffuselighting: 'feDiffuseLighting',\n    fedisplacementmap: 'feDisplacementMap',\n    fedistantlight: 'feDistantLight',\n    fedropshadow: 'feDropShadow',\n    feflood: 'feFlood',\n    fefunca: 'feFuncA',\n    fefuncb: 'feFuncB',\n    fefuncg: 'feFuncG',\n    fefuncr: 'feFuncR',\n    fegaussianblur: 'feGaussianBlur',\n    feimage: 'feImage',\n    femerge: 'feMerge',\n    femergenode: 'feMergeNode',\n    femorphology: 'feMorphology',\n    feoffset: 'feOffset',\n    fepointlight: 'fePointLight',\n    fespecularlighting: 'feSpecularLighting',\n    fespotlight: 'feSpotLight',\n    fetile: 'feTile',\n    feturbulence: 'feTurbulence',\n    foreignobject: 'foreignObject',\n    glyphref: 'glyphRef',\n    lineargradient: 'linearGradient',\n    radialgradient: 'radialGradient',\n};\nfunction getTagName(n) {\n    let tagName = tagMap[n.tagName] ? tagMap[n.tagName] : n.tagName;\n    if (tagName === 'link' && n.attributes._cssText) {\n        tagName = 'style';\n    }\n    return tagName;\n}\nfunction escapeRegExp(str) {\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, 'g');\nfunction addHoverClass(cssText, cache) {\n    const cachedStyle = cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.get(cssText);\n    if (cachedStyle)\n        return cachedStyle;\n    const ast = parse(cssText, {\n        silent: true,\n    });\n    if (!ast.stylesheet) {\n        return cssText;\n    }\n    const selectors = [];\n    ast.stylesheet.rules.forEach((rule) => {\n        if ('selectors' in rule) {\n            (rule.selectors || []).forEach((selector) => {\n                if (HOVER_SELECTOR.test(selector)) {\n                    selectors.push(selector);\n                }\n            });\n        }\n    });\n    if (selectors.length === 0) {\n        return cssText;\n    }\n    const selectorMatcher = new RegExp(selectors\n        .filter((selector, index) => selectors.indexOf(selector) === index)\n        .sort((a, b) => b.length - a.length)\n        .map((selector) => {\n        return escapeRegExp(selector);\n    })\n        .join('|'), 'g');\n    const result = cssText.replace(selectorMatcher, (selector) => {\n        const newSelector = selector.replace(HOVER_SELECTOR_GLOBAL, '$1.\\\\:hover');\n        return `${selector}, ${newSelector}`;\n    });\n    cache === null || cache === void 0 ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\n    return result;\n}\nfunction createCache() {\n    const stylesWithHoverClass = new Map();\n    return {\n        stylesWithHoverClass,\n    };\n}\nfunction buildNode(n, options) {\n    const { doc, hackCss, cache } = options;\n    switch (n.type) {\n        case NodeType.Document:\n            return doc.implementation.createDocument(null, '', null);\n        case NodeType.DocumentType:\n            return doc.implementation.createDocumentType(n.name || 'html', n.publicId, n.systemId);\n        case NodeType.Element:\n            const tagName = getTagName(n);\n            let node;\n            if (n.isSVG) {\n                node = doc.createElementNS('http://www.w3.org/2000/svg', tagName);\n            }\n            else {\n                node = doc.createElement(tagName);\n            }\n            for (const name in n.attributes) {\n                if (!n.attributes.hasOwnProperty(name)) {\n                    continue;\n                }\n                let value = n.attributes[name];\n                if (tagName === 'option' && name === 'selected' && value === false) {\n                    continue;\n                }\n                value =\n                    typeof value === 'boolean' || typeof value === 'number' || value === null ? '' : value;\n                if (!name.startsWith('rr_')) {\n                    const isTextarea = tagName === 'textarea' && name === 'value';\n                    const isRemoteOrDynamicCss = tagName === 'style' && name === '_cssText';\n                    if (isRemoteOrDynamicCss && hackCss) {\n                        value = addHoverClass(value, cache);\n                    }\n                    if (isTextarea || isRemoteOrDynamicCss) {\n                        const child = doc.createTextNode(value);\n                        for (const c of Array.from(node.childNodes)) {\n                            if (c.nodeType === node.TEXT_NODE) {\n                                node.removeChild(c);\n                            }\n                        }\n                        node.appendChild(child);\n                        continue;\n                    }\n                    try {\n                        if (n.isSVG && name === 'xlink:href') {\n                            node.setAttributeNS('http://www.w3.org/1999/xlink', name, value);\n                        }\n                        else if (name === 'onload' ||\n                            name === 'onclick' ||\n                            name.substring(0, 7) === 'onmouse') {\n                            node.setAttribute('_' + name, value);\n                        }\n                        else if (tagName === 'meta' &&\n                            n.attributes['http-equiv'] === 'Content-Security-Policy' &&\n                            name === 'content') {\n                            node.setAttribute('csp-content', value);\n                            continue;\n                        }\n                        else if (tagName === 'link' &&\n                            (n.attributes.rel === 'preload' || n.attributes.rel === 'modulepreload') &&\n                            n.attributes.as === 'script') {\n                        }\n                        else if (tagName === 'link' &&\n                            n.attributes.rel === 'prefetch' &&\n                            typeof n.attributes.href === 'string' &&\n                            n.attributes.href.endsWith('.js')) {\n                        }\n                        else if (tagName === 'img' &&\n                            n.attributes.srcset &&\n                            n.attributes.rr_dataURL) {\n                            node.setAttribute('rrweb-original-srcset', n.attributes.srcset);\n                        }\n                        else {\n                            node.setAttribute(name, value);\n                        }\n                    }\n                    catch (error) {\n                    }\n                }\n                else {\n                    if (tagName === 'canvas' && name === 'rr_dataURL') {\n                        const image = document.createElement('img');\n                        image.src = value;\n                        image.onload = () => {\n                            const ctx = node.getContext('2d');\n                            if (ctx) {\n                                ctx.drawImage(image, 0, 0, image.width, image.height);\n                            }\n                        };\n                    }\n                    else if (tagName === 'img' && name === 'rr_dataURL') {\n                        const image = node;\n                        if (!image.currentSrc.startsWith('data:')) {\n                            image.setAttribute('rrweb-original-src', n.attributes.src);\n                            image.src = value;\n                        }\n                    }\n                    if (name === 'rr_width') {\n                        node.style.width = value;\n                    }\n                    else if (name === 'rr_height') {\n                        node.style.height = value;\n                    }\n                    else if (name === 'rr_mediaCurrentTime') {\n                        node.currentTime = n.attributes\n                            .rr_mediaCurrentTime;\n                    }\n                    else if (name === 'rr_mediaState') {\n                        switch (value) {\n                            case 'played':\n                                node\n                                    .play()\n                                    .catch((e) => console.warn('media playback error', e));\n                                break;\n                            case 'paused':\n                                node.pause();\n                                break;\n                        }\n                    }\n                }\n            }\n            if (n.isShadowHost) {\n                if (!node.shadowRoot) {\n                    node.attachShadow({ mode: 'open' });\n                }\n                else {\n                    while (node.shadowRoot.firstChild) {\n                        node.shadowRoot.removeChild(node.shadowRoot.firstChild);\n                    }\n                }\n            }\n            return node;\n        case NodeType.Text:\n            return doc.createTextNode(n.isStyle && hackCss\n                ? addHoverClass(n.textContent, cache)\n                : n.textContent);\n        case NodeType.CDATA:\n            return doc.createCDATASection(n.textContent);\n        case NodeType.Comment:\n            return doc.createComment(n.textContent);\n        default:\n            return null;\n    }\n}\nfunction buildNodeWithSN(n, options) {\n    const { doc, map, skipChild = false, hackCss = true, afterAppend, cache, } = options;\n    let node = buildNode(n, { doc, hackCss, cache });\n    if (!node) {\n        return null;\n    }\n    if (n.rootId) {\n        console.assert(map[n.rootId] === doc, 'Target document should has the same root id.');\n    }\n    if (n.type === NodeType.Document) {\n        doc.close();\n        doc.open();\n        if (n.compatMode === 'BackCompat' &&\n            n.childNodes &&\n            n.childNodes[0].type !== NodeType.DocumentType) {\n            if (n.childNodes[0].type === NodeType.Element &&\n                'xmlns' in n.childNodes[0].attributes &&\n                n.childNodes[0].attributes.xmlns === 'http://www.w3.org/1999/xhtml') {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">');\n            }\n            else {\n                doc.write('<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">');\n            }\n        }\n        node = doc;\n    }\n    node.__sn = n;\n    map[n.id] = node;\n    if ((n.type === NodeType.Document || n.type === NodeType.Element) &&\n        !skipChild) {\n        for (const childN of n.childNodes) {\n            const childNode = buildNodeWithSN(childN, {\n                doc,\n                map,\n                skipChild: false,\n                hackCss,\n                afterAppend,\n                cache,\n            });\n            if (!childNode) {\n                console.warn('Failed to rebuild', childN);\n                continue;\n            }\n            if (childN.isShadow && isElement(node) && node.shadowRoot) {\n                node.shadowRoot.appendChild(childNode);\n            }\n            else {\n                node.appendChild(childNode);\n            }\n            if (afterAppend) {\n                afterAppend(childNode);\n            }\n        }\n    }\n    return node;\n}\nfunction visit(idNodeMap, onVisit) {\n    function walk(node) {\n        onVisit(node);\n    }\n    for (const key in idNodeMap) {\n        if (idNodeMap[key]) {\n            walk(idNodeMap[key]);\n        }\n    }\n}\nfunction handleScroll(node) {\n    const n = node.__sn;\n    if (n.type !== NodeType.Element) {\n        return;\n    }\n    const el = node;\n    for (const name in n.attributes) {\n        if (!(n.attributes.hasOwnProperty(name) && name.startsWith('rr_'))) {\n            continue;\n        }\n        const value = n.attributes[name];\n        if (name === 'rr_scrollLeft') {\n            el.scrollLeft = value;\n        }\n        if (name === 'rr_scrollTop') {\n            el.scrollTop = value;\n        }\n    }\n}\nfunction rebuild(n, options) {\n    const { doc, onVisit, hackCss = true, afterAppend, cache } = options;\n    const idNodeMap = {};\n    const node = buildNodeWithSN(n, {\n        doc,\n        map: idNodeMap,\n        skipChild: false,\n        hackCss,\n        afterAppend,\n        cache,\n    });\n    visit(idNodeMap, (visitedNode) => {\n        if (onVisit) {\n            onVisit(visitedNode);\n        }\n        handleScroll(visitedNode);\n    });\n    return [node, idNodeMap];\n}\n\nexport { IGNORED_NODE, NodeType, addHoverClass, buildNodeWithSN, cleanupSnapshot, createCache, hasInputMaskOptions, is2DCanvasBlank, isElement, isShadowRoot, maskInputValue, needMaskingText, rebuild, serializeNodeWithId, snapshot, transformAttribute, visitSnapshot };\n","import type { Breadcrumb } from '@sentry/types';\n\ntype RequiredProperties = 'category' | 'message';\n\n/**\n * Create a breadcrumb for a replay.\n */\nexport function createBreadcrumb(\n  breadcrumb: Pick<Breadcrumb, RequiredProperties> & Partial<Omit<Breadcrumb, RequiredProperties>>,\n): Breadcrumb {\n  return {\n    timestamp: Date.now() / 1000,\n    type: 'default',\n    ...breadcrumb,\n  };\n}\n","import { EventType } from '@sentry-internal/rrweb';\nimport type { Breadcrumb } from '@sentry/types';\nimport { normalize } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../../types';\nimport { addEvent } from '../../util/addEvent';\n\n/**\n * Add a breadcrumb event to replay.\n */\nexport function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void {\n  if (breadcrumb.category === 'sentry.transaction') {\n    return;\n  }\n\n  if (['ui.click', 'ui.input'].includes(breadcrumb.category as string)) {\n    replay.triggerUserActivity();\n  } else {\n    replay.checkAndHandleExpiredSession();\n  }\n\n  replay.addUpdate(() => {\n    void addEvent(replay, {\n      type: EventType.Custom,\n      // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n      // but maybe we should just keep them as milliseconds\n      timestamp: (breadcrumb.timestamp || 0) * 1000,\n      data: {\n        tag: 'breadcrumb',\n        payload: normalize(breadcrumb),\n      },\n    });\n\n    // Do not flush after console log messages\n    return breadcrumb.category === 'console';\n  });\n}\n","// Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\nconst ATTRIBUTES_TO_RECORD = new Set([\n  'id',\n  'class',\n  'aria-label',\n  'role',\n  'name',\n  'alt',\n  'title',\n  'data-test-id',\n  'data-testid',\n]);\n\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\nexport function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown> {\n  const obj: Record<string, unknown> = {};\n  for (const key in attributes) {\n    if (ATTRIBUTES_TO_RECORD.has(key)) {\n      let normalizedKey = key;\n\n      if (key === 'data-testid' || key === 'data-test-id') {\n        normalizedKey = 'testId';\n      }\n\n      obj[normalizedKey] = attributes[key];\n    }\n  }\n\n  return obj;\n}\n","import type { INode } from '@sentry-internal/rrweb-snapshot';\nimport { NodeType } from '@sentry-internal/rrweb-snapshot';\nimport type { Breadcrumb } from '@sentry/types';\nimport { htmlTreeAsString } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\nimport { getAttributesToRecord } from './util/getAttributesToRecord';\n\ninterface DomHandlerData {\n  name: string;\n  event: Node | { target: Node };\n}\n\nexport const handleDomListener: (replay: ReplayContainer) => (handlerData: DomHandlerData) => void =\n  (replay: ReplayContainer) =>\n  (handlerData: DomHandlerData): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleDom(handlerData);\n\n    if (!result) {\n      return;\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n\n/**\n * An event handler to react to DOM events.\n */\nfunction handleDom(handlerData: DomHandlerData): Breadcrumb | null {\n  let target;\n  let targetNode: Node | INode | undefined;\n\n  // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n  try {\n    targetNode = getTargetNode(handlerData);\n    target = htmlTreeAsString(targetNode);\n  } catch (e) {\n    target = '<unknown>';\n  }\n\n  // `__sn` property is the serialized node created by rrweb\n  const serializedNode =\n    targetNode && '__sn' in targetNode && targetNode.__sn.type === NodeType.Element ? targetNode.__sn : null;\n\n  return createBreadcrumb({\n    category: `ui.${handlerData.name}`,\n    message: target,\n    data: serializedNode\n      ? {\n          nodeId: serializedNode.id,\n          node: {\n            id: serializedNode.id,\n            tagName: serializedNode.tagName,\n            textContent: targetNode\n              ? Array.from(targetNode.childNodes)\n                  .map(\n                    (node: Node | INode) => '__sn' in node && node.__sn.type === NodeType.Text && node.__sn.textContent,\n                  )\n                  .filter(Boolean) // filter out empty values\n                  .map(text => (text as string).trim())\n                  .join('')\n              : '',\n            attributes: getAttributesToRecord(serializedNode.attributes),\n          },\n        }\n      : {},\n  });\n}\n\nfunction getTargetNode(handlerData: DomHandlerData): Node {\n  if (isEventWithTarget(handlerData.event)) {\n    return handlerData.event.target;\n  }\n\n  return handlerData.event;\n}\n\nfunction isEventWithTarget(event: unknown): event is { target: Node } {\n  return !!(event as { target?: Node }).target;\n}\n","import type { Event, EventHint } from '@sentry/types';\n\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\nexport function isRrwebError(event: Event, hint: EventHint): boolean {\n  if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n    return false;\n  }\n\n  // @ts-ignore this may be set by rrweb when it finds errors\n  if (hint.originalException && hint.originalException.__rrweb__) {\n    return true;\n  }\n\n  // Check if any exception originates from rrweb\n  return event.exception.values.some(exception => {\n    if (!exception.stacktrace || !exception.stacktrace.frames || !exception.stacktrace.frames.length) {\n      return false;\n    }\n\n    return exception.stacktrace.frames.some(frame => frame.filename && frame.filename.includes('/rrweb/src/'));\n  });\n}\n","import { addBreadcrumb } from '@sentry/core';\nimport type { Event, EventHint } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type { ReplayContainer } from '../types';\nimport { isErrorEvent, isReplayEvent, isTransactionEvent } from '../util/eventUtils';\nimport { isRrwebError } from '../util/isRrwebError';\nimport { handleAfterSendEvent } from './handleAfterSendEvent';\n\n/**\n * Returns a listener to be added to `addGlobalEventProcessor(listener)`.\n */\nexport function handleGlobalEventListener(\n  replay: ReplayContainer,\n  includeAfterSendEventHandling = false,\n): (event: Event, hint: EventHint) => Event | null {\n  const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n\n  return (event: Event, hint: EventHint) => {\n    if (isReplayEvent(event)) {\n      // Replays have separate set of breadcrumbs, do not include breadcrumbs\n      // from core SDK\n      delete event.breadcrumbs;\n      return event;\n    }\n\n    // We only want to handle errors & transactions, nothing else\n    if (!isErrorEvent(event) && !isTransactionEvent(event)) {\n      return event;\n    }\n\n    // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n    // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n    if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n      __DEBUG_BUILD__ && logger.log('[Replay] Ignoring error from rrweb internals', event);\n      return null;\n    }\n\n    // Only tag transactions with replayId if not waiting for an error\n    if (isErrorEvent(event) || (isTransactionEvent(event) && replay.recordingMode === 'session')) {\n      event.tags = { ...event.tags, replayId: replay.getSessionId() };\n    }\n\n    if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals && isErrorEvent(event)) {\n      const exc = getEventExceptionValues(event);\n      addInternalBreadcrumb({\n        message: `Tagging event (${event.event_id}) - ${event.message} - ${exc.type}: ${exc.value}`,\n      });\n    }\n\n    // In cases where a custom client is used that does not support the new hooks (yet),\n    // we manually call this hook method here\n    if (afterSendHandler) {\n      // Pretend the error had a 200 response so we always capture it\n      afterSendHandler(event, { statusCode: 200 });\n    }\n\n    return event;\n  };\n}\n\nfunction addInternalBreadcrumb(arg: Parameters<typeof addBreadcrumb>[0]): void {\n  const { category, level, message, ...rest } = arg;\n\n  addBreadcrumb({\n    category: category || 'console',\n    level: level || 'debug',\n    message: `[debug]: ${message}`,\n    ...rest,\n  });\n}\n\nfunction getEventExceptionValues(event: Event): { type: string; value: string } {\n  return {\n    type: 'Unknown',\n    value: 'n/a',\n    ...(event.exception && event.exception.values && event.exception.values[0]),\n  };\n}\n","import { EventType } from '@sentry-internal/rrweb';\n\nimport type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addEvent } from './addEvent';\n\n/**\n * Create a \"span\" for each performance entry. The parent transaction is `this.replayEvent`.\n */\nexport function createPerformanceSpans(\n  replay: ReplayContainer,\n  entries: ReplayPerformanceEntry<AllEntryData>[],\n): Promise<AddEventResult | null>[] {\n  return entries.map(({ type, start, end, name, data }) =>\n    addEvent(replay, {\n      type: EventType.Custom,\n      timestamp: start,\n      data: {\n        tag: 'performanceSpan',\n        payload: {\n          op: type,\n          description: name,\n          startTimestamp: start,\n          endTimestamp: end,\n          data,\n        },\n      },\n    }),\n  );\n}\n","import type { HistoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from '../util/createPerformanceSpans';\n\ninterface HistoryHandlerData {\n  from: string;\n  to: string;\n}\n\nfunction handleHistory(handlerData: HistoryHandlerData): ReplayPerformanceEntry<HistoryData> {\n  const { from, to } = handlerData;\n\n  const now = Date.now() / 1000;\n\n  return {\n    type: 'navigation.push',\n    start: now,\n    end: now,\n    name: to,\n    data: {\n      previous: from,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.\n */\nexport function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HistoryHandlerData) => void {\n  return (handlerData: HistoryHandlerData) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleHistory(handlerData);\n\n    if (result === null) {\n      return;\n    }\n\n    // Need to collect visited URLs\n    replay.getContext().urls.push(result.name);\n    replay.triggerUserActivity();\n\n    replay.addUpdate(() => {\n      createPerformanceSpans(replay, [result]);\n      // Returning false to flush\n      return false;\n    });\n  };\n}\n","import { getCurrentHub } from '@sentry/core';\n\nimport type { ReplayContainer } from '../types';\n\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\nexport function shouldFilterRequest(replay: ReplayContainer, url: string): boolean {\n  // If we enabled the `traceInternals` experiment, we want to trace everything\n  if (__DEBUG_BUILD__ && replay.getOptions()._experiments.traceInternals) {\n    return false;\n  }\n\n  return _isSentryRequest(url);\n}\n\n/**\n * Checks wether a given URL belongs to the configured Sentry DSN.\n */\nfunction _isSentryRequest(url: string): boolean {\n  const client = getCurrentHub().getClient();\n  const dsn = client && client.getDsn();\n  return dsn ? url.includes(dsn.host) : false;\n}\n","import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';\nimport { createPerformanceSpans } from '../../util/createPerformanceSpans';\nimport { shouldFilterRequest } from '../../util/shouldFilterRequest';\n\n/** Add a performance entry breadcrumb */\nexport function addNetworkBreadcrumb(\n  replay: ReplayContainer,\n  result: ReplayPerformanceEntry<NetworkRequestData> | null,\n): void {\n  if (!replay.isEnabled()) {\n    return;\n  }\n\n  if (result === null) {\n    return;\n  }\n\n  if (shouldFilterRequest(replay, result.name)) {\n    return;\n  }\n\n  replay.addUpdate(() => {\n    createPerformanceSpans(replay, [result]);\n    // Returning true will cause `addUpdate` to not flush\n    // We do not want network requests to cause a flush. This will prevent\n    // recurring/polling requests from keeping the replay session alive.\n    return true;\n  });\n}\n","import type { HandlerDataFetch } from '@sentry/types';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry<NetworkRequestData> {\n  const { startTimestamp, endTimestamp, fetchData, response } = handlerData;\n\n  if (!endTimestamp) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url } = fetchData;\n\n  return {\n    type: 'resource.fetch',\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: {\n      method,\n      statusCode: response && (response as Response).status,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.\n */\nexport function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void {\n  return (handlerData: HandlerDataFetch) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleFetch(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { HandlerDataXhr } from '@sentry/types';\nimport { SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { addNetworkBreadcrumb } from './util/addNetworkBreadcrumb';\n\n/** only exported for tests */\nexport function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry<NetworkRequestData> | null {\n  const { startTimestamp, endTimestamp, xhr } = handlerData;\n\n  const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n  if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n    return null;\n  }\n\n  // This is only used as a fallback, so we know the body sizes are never set here\n  const { method, url, status_code: statusCode } = sentryXhrData;\n\n  if (url === undefined) {\n    return null;\n  }\n\n  return {\n    type: 'resource.xhr',\n    name: url,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    data: {\n      method,\n      statusCode,\n    },\n  };\n}\n\n/**\n * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.\n */\nexport function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void {\n  return (handlerData: HandlerDataXhr) => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleXhr(handlerData);\n\n    addNetworkBreadcrumb(replay, result);\n  };\n}\n","import type { TextEncoderInternal } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { NETWORK_BODY_MAX_SIZE } from '../../constants';\nimport type {\n  NetworkBody,\n  NetworkRequestData,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n  ReplayPerformanceEntry,\n} from '../../types';\n\n/** Get the size of a body. */\nexport function getBodySize(\n  body: RequestInit['body'],\n  textEncoder: TextEncoder | TextEncoderInternal,\n): number | undefined {\n  if (!body) {\n    return undefined;\n  }\n\n  try {\n    if (typeof body === 'string') {\n      return textEncoder.encode(body).length;\n    }\n\n    if (body instanceof URLSearchParams) {\n      return textEncoder.encode(body.toString()).length;\n    }\n\n    if (body instanceof FormData) {\n      const formDataStr = _serializeFormData(body);\n      return textEncoder.encode(formDataStr).length;\n    }\n\n    if (body instanceof Blob) {\n      return body.size;\n    }\n\n    if (body instanceof ArrayBuffer) {\n      return body.byteLength;\n    }\n\n    // Currently unhandled types: ArrayBufferView, ReadableStream\n  } catch {\n    // just return undefined\n  }\n\n  return undefined;\n}\n\n/** Convert a Content-Length header to number/undefined.  */\nexport function parseContentLengthHeader(header: string | null | undefined): number | undefined {\n  if (!header) {\n    return undefined;\n  }\n\n  const size = parseInt(header, 10);\n  return isNaN(size) ? undefined : size;\n}\n\n/** Get the string representation of a body. */\nexport function getBodyString(body: unknown): string | undefined {\n  if (typeof body === 'string') {\n    return body;\n  }\n\n  if (body instanceof URLSearchParams) {\n    return body.toString();\n  }\n\n  if (body instanceof FormData) {\n    return _serializeFormData(body);\n  }\n\n  return undefined;\n}\n\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\nexport function makeNetworkReplayBreadcrumb(\n  type: string,\n  data: ReplayNetworkRequestData | null,\n): ReplayPerformanceEntry<NetworkRequestData> | null {\n  if (!data) {\n    return null;\n  }\n\n  const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;\n\n  const result: ReplayPerformanceEntry<NetworkRequestData> = {\n    type,\n    start: startTimestamp / 1000,\n    end: endTimestamp / 1000,\n    name: url,\n    data: dropUndefinedKeys({\n      method,\n      statusCode,\n      request,\n      response,\n    }),\n  };\n\n  return result;\n}\n\n/** Get either a JSON network body, or a text representation. */\nexport function getNetworkBody(bodyText: string | undefined): NetworkBody | undefined {\n  if (!bodyText) {\n    return;\n  }\n\n  try {\n    return JSON.parse(bodyText);\n  } catch {\n    // return text\n  }\n\n  return bodyText;\n}\n\n/** Build the request or response part of a replay network breadcrumb. */\nexport function buildNetworkRequestOrResponse(\n  headers: Record<string, string>,\n  bodySize: number | undefined,\n  body: NetworkBody | undefined,\n): ReplayNetworkRequestOrResponse | undefined {\n  if (!bodySize && Object.keys(headers).length === 0) {\n    return undefined;\n  }\n\n  if (!bodySize) {\n    return {\n      headers,\n    };\n  }\n\n  if (!body) {\n    return {\n      headers,\n      size: bodySize,\n    };\n  }\n\n  const info: ReplayNetworkRequestOrResponse = {\n    headers,\n    size: bodySize,\n  };\n\n  if (bodySize < NETWORK_BODY_MAX_SIZE) {\n    info.body = body;\n  } else {\n    info._meta = {\n      errors: ['MAX_BODY_SIZE_EXCEEDED'],\n    };\n  }\n\n  return info;\n}\n\n/** Filter a set of headers */\nexport function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string> {\n  return Object.keys(headers).reduce((filteredHeaders: Record<string, string>, key: string) => {\n    const normalizedKey = key.toLowerCase();\n    // Avoid putting empty strings into the headers\n    if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n      filteredHeaders[normalizedKey] = headers[key];\n    }\n    return filteredHeaders;\n  }, {});\n}\n\nfunction _serializeFormData(formData: FormData): string {\n  // This is a bit simplified, but gives us a decent estimate\n  // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n  // @ts-ignore passing FormData to URLSearchParams actually works\n  return new URLSearchParams(formData).toString();\n}\n","import type { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport type {\n  FetchHint,\n  NetworkBody,\n  ReplayContainer,\n  ReplayNetworkOptions,\n  ReplayNetworkRequestData,\n  ReplayNetworkRequestOrResponse,\n} from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  getNetworkBody,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n} from './networkUtils';\n\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureFetchBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n    replay: ReplayContainer;\n  },\n): Promise<void> {\n  try {\n    const data = await _prepareFetchData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichFetchBreadcrumb(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { input, response } = hint;\n\n  const body = _getFetchRequestArgBody(input);\n  const reqSize = getBodySize(body, options.textEncoder);\n\n  const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nasync function _prepareFetchData(\n  breadcrumb: Breadcrumb & { data: FetchBreadcrumbData },\n  hint: FetchHint,\n  options: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n): Promise<ReplayNetworkRequestData> {\n  const { startTimestamp, endTimestamp } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  const request = _getRequestInfo(options, hint.input, requestBodySize);\n  const response = await _getResponseInfo(options, hint.response, responseBodySize);\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode: statusCode || 0,\n    request,\n    response,\n  };\n}\n\nfunction _getRequestInfo(\n  { captureBodies, requestHeaders }: ReplayNetworkOptions,\n  input: FetchHint['input'],\n  requestBodySize?: number,\n): ReplayNetworkRequestOrResponse | undefined {\n  const headers = getRequestHeaders(input, requestHeaders);\n\n  if (!captureBodies) {\n    return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n  }\n\n  // We only want to transmit string or string-like bodies\n  const requestBody = _getFetchRequestArgBody(input);\n  const body = getNetworkBody(getBodyString(requestBody));\n  return buildNetworkRequestOrResponse(headers, requestBodySize, body);\n}\n\nasync function _getResponseInfo(\n  {\n    captureBodies,\n    textEncoder,\n    responseHeaders,\n  }: ReplayNetworkOptions & {\n    textEncoder: TextEncoderInternal;\n  },\n  response: Response,\n  responseBodySize?: number,\n): Promise<ReplayNetworkRequestOrResponse | undefined> {\n  const headers = getAllHeaders(response.headers, responseHeaders);\n\n  if (!captureBodies && responseBodySize !== undefined) {\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n\n  // Only clone the response if we need to\n  try {\n    // We have to clone this, as the body can only be read once\n    const res = response.clone();\n    const { body, bodyText } = await _parseFetchBody(res);\n\n    const size =\n      bodyText && bodyText.length && responseBodySize === undefined\n        ? getBodySize(bodyText, textEncoder)\n        : responseBodySize;\n\n    if (captureBodies) {\n      return buildNetworkRequestOrResponse(headers, size, body);\n    }\n\n    return buildNetworkRequestOrResponse(headers, size, undefined);\n  } catch {\n    // fallback\n    return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n  }\n}\n\nasync function _parseFetchBody(\n  response: Response,\n): Promise<{ body?: NetworkBody | undefined; bodyText?: string | undefined }> {\n  let bodyText: string;\n\n  try {\n    bodyText = await response.text();\n  } catch {\n    return {};\n  }\n\n  try {\n    const body = JSON.parse(bodyText);\n    return { body, bodyText };\n  } catch {\n    // just send bodyText\n  }\n\n  return { bodyText, body: bodyText };\n}\n\nfunction _getFetchRequestArgBody(fetchArgs: unknown[] = []): RequestInit['body'] | undefined {\n  // We only support getting the body from the fetch options\n  if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n    return undefined;\n  }\n\n  return (fetchArgs[1] as RequestInit).body;\n}\n\nfunction getAllHeaders(headers: Headers, allowedHeaders: string[]): Record<string, string> {\n  const allHeaders: Record<string, string> = {};\n\n  allowedHeaders.forEach(header => {\n    if (headers.get(header)) {\n      allHeaders[header] = headers.get(header) as string;\n    }\n  });\n\n  return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs: unknown[], allowedHeaders: string[]): Record<string, string> {\n  if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n    return getHeadersFromOptions(fetchArgs[0] as Request | RequestInit, allowedHeaders);\n  }\n\n  if (fetchArgs.length === 2) {\n    return getHeadersFromOptions(fetchArgs[1] as Request | RequestInit, allowedHeaders);\n  }\n\n  return {};\n}\n\nfunction getHeadersFromOptions(\n  input: Request | RequestInit | undefined,\n  allowedHeaders: string[],\n): Record<string, string> {\n  if (!input) {\n    return {};\n  }\n\n  const headers = input.headers;\n\n  if (!headers) {\n    return {};\n  }\n\n  if (headers instanceof Headers) {\n    return getAllHeaders(headers, allowedHeaders);\n  }\n\n  // We do not support this, as it is not really documented (anymore?)\n  if (Array.isArray(headers)) {\n    return {};\n  }\n\n  return getAllowedHeaders(headers, allowedHeaders);\n}\n","import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';\nimport { logger, SENTRY_XHR_DATA_KEY } from '@sentry/utils';\n\nimport type { ReplayContainer, ReplayNetworkOptions, ReplayNetworkRequestData, XhrHint } from '../../types';\nimport { addNetworkBreadcrumb } from './addNetworkBreadcrumb';\nimport {\n  buildNetworkRequestOrResponse,\n  getAllowedHeaders,\n  getBodySize,\n  getBodyString,\n  getNetworkBody,\n  makeNetworkReplayBreadcrumb,\n  parseContentLengthHeader,\n} from './networkUtils';\n\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nexport async function captureXhrBreadcrumbToReplay(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions & { replay: ReplayContainer },\n): Promise<void> {\n  try {\n    const data = _prepareXhrData(breadcrumb, hint, options);\n\n    // Create a replay performance entry from this breadcrumb\n    const result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n    addNetworkBreadcrumb(options.replay, result);\n  } catch (error) {\n    __DEBUG_BUILD__ && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n  }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nexport function enrichXhrBreadcrumb(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: { textEncoder: TextEncoderInternal },\n): void {\n  const { xhr, input } = hint;\n\n  const reqSize = getBodySize(input, options.textEncoder);\n  const resSize = xhr.getResponseHeader('content-length')\n    ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n    : getBodySize(xhr.response, options.textEncoder);\n\n  if (reqSize !== undefined) {\n    breadcrumb.data.request_body_size = reqSize;\n  }\n  if (resSize !== undefined) {\n    breadcrumb.data.response_body_size = resSize;\n  }\n}\n\nfunction _prepareXhrData(\n  breadcrumb: Breadcrumb & { data: XhrBreadcrumbData },\n  hint: XhrHint,\n  options: ReplayNetworkOptions,\n): ReplayNetworkRequestData | null {\n  const { startTimestamp, endTimestamp, input, xhr } = hint;\n\n  const {\n    url,\n    method,\n    status_code: statusCode,\n    request_body_size: requestBodySize,\n    response_body_size: responseBodySize,\n  } = breadcrumb.data;\n\n  const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n  const requestHeaders = xhrInfo ? getAllowedHeaders(xhrInfo.request_headers, options.requestHeaders) : {};\n  const responseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.responseHeaders);\n\n  if (!url) {\n    return null;\n  }\n\n  const request = buildNetworkRequestOrResponse(\n    requestHeaders,\n    requestBodySize,\n    options.captureBodies ? getNetworkBody(getBodyString(input)) : undefined,\n  );\n  const response = buildNetworkRequestOrResponse(\n    responseHeaders,\n    responseBodySize,\n    options.captureBodies ? getNetworkBody(hint.xhr.responseText) : undefined,\n  );\n\n  return {\n    startTimestamp,\n    endTimestamp,\n    url,\n    method,\n    statusCode: statusCode || 0,\n    request,\n    response,\n  };\n}\n\nfunction getResponseHeaders(xhr: XMLHttpRequest): Record<string, string> {\n  const headers = xhr.getAllResponseHeaders();\n\n  if (!headers) {\n    return {};\n  }\n\n  return headers.split('\\r\\n').reduce((acc: Record<string, string>, line: string) => {\n    const [key, value] = line.split(': ');\n    acc[key.toLowerCase()] = value;\n    return acc;\n  }, {});\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type {\n  Breadcrumb,\n  BreadcrumbHint,\n  FetchBreadcrumbData,\n  TextEncoderInternal,\n  XhrBreadcrumbData,\n} from '@sentry/types';\nimport { addInstrumentationHandler, logger } from '@sentry/utils';\n\nimport type { FetchHint, ReplayContainer, ReplayNetworkOptions, XhrHint } from '../types';\nimport { handleFetchSpanListener } from './handleFetch';\nimport { handleXhrSpanListener } from './handleXhr';\nimport { captureFetchBreadcrumbToReplay, enrichFetchBreadcrumb } from './util/fetchUtils';\nimport { captureXhrBreadcrumbToReplay, enrichXhrBreadcrumb } from './util/xhrUtils';\n\ninterface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {\n  replay: ReplayContainer;\n  textEncoder: TextEncoderInternal;\n}\n\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n *   (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\nexport function handleNetworkBreadcrumbs(replay: ReplayContainer): void {\n  const client = getCurrentHub().getClient();\n\n  try {\n    const textEncoder = new TextEncoder();\n\n    const options: ExtendedNetworkBreadcrumbsOptions = {\n      replay,\n      textEncoder,\n      ...replay.getExperimentalOptions().network,\n    };\n\n    if (client && client.on) {\n      client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));\n    } else {\n      // Fallback behavior\n      addInstrumentationHandler('fetch', handleFetchSpanListener(replay));\n      addInstrumentationHandler('xhr', handleXhrSpanListener(replay));\n    }\n  } catch {\n    // Do nothing\n  }\n}\n\n/** just exported for tests */\nexport function beforeAddNetworkBreadcrumb(\n  options: ExtendedNetworkBreadcrumbsOptions,\n  breadcrumb: Breadcrumb,\n  hint?: BreadcrumbHint,\n): void {\n  if (!breadcrumb.data) {\n    return;\n  }\n\n  try {\n    if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichXhrBreadcrumb(breadcrumb, hint, options);\n\n      void captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n\n    if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n      // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n      // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n      // So any async mutations to it will not be reflected in the final breadcrumb\n      enrichFetchBreadcrumb(breadcrumb, hint, options);\n\n      void captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n    }\n  } catch (e) {\n    __DEBUG_BUILD__ && logger.warn('Error when enriching network breadcrumb');\n  }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: XhrBreadcrumbData } {\n  return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb: Breadcrumb): breadcrumb is Breadcrumb & { data: FetchBreadcrumbData } {\n  return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint?: BreadcrumbHint): hint is XhrHint {\n  return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint?: BreadcrumbHint): hint is FetchHint {\n  return hint && hint.response;\n}\n","import type { Breadcrumb, Scope } from '@sentry/types';\n\nimport type { ReplayContainer } from '../types';\nimport { createBreadcrumb } from '../util/createBreadcrumb';\nimport { addBreadcrumbEvent } from './util/addBreadcrumbEvent';\n\nlet _LAST_BREADCRUMB: null | Breadcrumb = null;\n\nexport const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void =\n  (replay: ReplayContainer) =>\n  (scope: Scope): void => {\n    if (!replay.isEnabled()) {\n      return;\n    }\n\n    const result = handleScope(scope);\n\n    if (!result) {\n      return;\n    }\n\n    addBreadcrumbEvent(replay, result);\n  };\n\n/**\n * An event handler to handle scope changes.\n */\nexport function handleScope(scope: Scope): Breadcrumb | null {\n  // TODO (v8): Remove this guard. This was put in place because we introduced\n  // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n  // For now, we'll just return null if the method doesn't exist but we should eventually\n  // get rid of this guard.\n  const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();\n\n  // Listener can be called when breadcrumbs have not changed, so we store the\n  // reference to the last crumb and only return a crumb if it has changed\n  if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n    return null;\n  }\n\n  _LAST_BREADCRUMB = newBreadcrumb;\n\n  if (\n    newBreadcrumb.category &&\n    (['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||\n      newBreadcrumb.category.startsWith('ui.'))\n  ) {\n    return null;\n  }\n\n  return createBreadcrumb(newBreadcrumb);\n}\n","import type { BaseClient } from '@sentry/core';\nimport { addGlobalEventProcessor, getCurrentHub } from '@sentry/core';\nimport type { Client, DynamicSamplingContext } from '@sentry/types';\nimport { addInstrumentationHandler } from '@sentry/utils';\n\nimport { handleAfterSendEvent } from '../coreHandlers/handleAfterSendEvent';\nimport { handleDomListener } from '../coreHandlers/handleDom';\nimport { handleGlobalEventListener } from '../coreHandlers/handleGlobalEvent';\nimport { handleHistorySpanListener } from '../coreHandlers/handleHistory';\nimport { handleNetworkBreadcrumbs } from '../coreHandlers/handleNetworkBreadcrumbs';\nimport { handleScopeListener } from '../coreHandlers/handleScope';\nimport type { ReplayContainer } from '../types';\n\n/**\n * Add global listeners that cannot be removed.\n */\nexport function addGlobalListeners(replay: ReplayContainer): void {\n  // Listeners from core SDK //\n  const scope = getCurrentHub().getScope();\n  const client = getCurrentHub().getClient();\n\n  if (scope) {\n    scope.addScopeListener(handleScopeListener(replay));\n  }\n  addInstrumentationHandler('dom', handleDomListener(replay));\n  addInstrumentationHandler('history', handleHistorySpanListener(replay));\n  handleNetworkBreadcrumbs(replay);\n\n  // Tag all (non replay) events that get sent to Sentry with the current\n  // replay ID so that we can reference them later in the UI\n  addGlobalEventProcessor(handleGlobalEventListener(replay, !hasHooks(client)));\n\n  // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n  if (hasHooks(client)) {\n    client.on('afterSendEvent', handleAfterSendEvent(replay));\n    client.on('createDsc', (dsc: DynamicSamplingContext) => {\n      const replayId = replay.getSessionId();\n      if (replayId) {\n        dsc.replay_id = replayId;\n      }\n    });\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction hasHooks(client: Client | undefined): client is BaseClient<any> {\n  return !!(client && client.on);\n}\n","import { WINDOW } from '../constants';\nimport type { AddEventResult, MemoryData, ReplayContainer, ReplayPerformanceEntry } from '../types';\nimport { createPerformanceSpans } from './createPerformanceSpans';\n\ntype ReplayMemoryEntry = ReplayPerformanceEntry<MemoryData> & { data: { memory: MemoryInfo } };\n\ninterface MemoryInfo {\n  jsHeapSizeLimit: number;\n  totalJSHeapSize: number;\n  usedJSHeapSize: number;\n}\n\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\nexport async function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>> {\n  // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this\n  try {\n    return Promise.all(\n      createPerformanceSpans(replay, [\n        // @ts-ignore memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n        createMemoryEntry(WINDOW.performance.memory),\n      ]),\n    );\n  } catch (error) {\n    // Do nothing\n    return [];\n  }\n}\n\nfunction createMemoryEntry(memoryEntry: MemoryInfo): ReplayMemoryEntry {\n  const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n  // we don't want to use `getAbsoluteTime` because it adds the event time to the\n  // time origin, so we get the current timestamp instead\n  const time = Date.now() / 1000;\n  return {\n    type: 'memory',\n    name: 'memory',\n    start: time,\n    end: time,\n    data: {\n      memory: {\n        jsHeapSizeLimit,\n        totalJSHeapSize,\n        usedJSHeapSize,\n      },\n    },\n  };\n}\n","import { record } from '@sentry-internal/rrweb';\nimport { browserPerformanceTimeOrigin } from '@sentry/utils';\n\nimport { WINDOW } from '../constants';\nimport type {\n  AllPerformanceEntry,\n  AllPerformanceEntryData,\n  ExperimentalPerformanceResourceTiming,\n  LargestContentfulPaintData,\n  NavigationData,\n  PaintData,\n  PerformanceNavigationTiming,\n  PerformancePaintTiming,\n  ReplayPerformanceEntry,\n  ResourceData,\n} from '../types';\n\n// Map entryType -> function to normalize data for event\n// @ts-ignore TODO: entry type does not fit the create* functions entry type\nconst ENTRY_TYPES: Record<\n  string,\n  (entry: AllPerformanceEntry) => null | ReplayPerformanceEntry<AllPerformanceEntryData>\n> = {\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  resource: createResourceEntry,\n  paint: createPaintEntry,\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  navigation: createNavigationEntry,\n  // @ts-ignore TODO: entry type does not fit the create* functions entry type\n  ['largest-contentful-paint']: createLargestContentfulPaint,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nexport function createPerformanceEntries(\n  entries: AllPerformanceEntry[],\n): ReplayPerformanceEntry<AllPerformanceEntryData>[] {\n  return entries.map(createPerformanceEntry).filter(Boolean) as ReplayPerformanceEntry<AllPerformanceEntryData>[];\n}\n\nfunction createPerformanceEntry(entry: AllPerformanceEntry): ReplayPerformanceEntry<AllPerformanceEntryData> | null {\n  if (ENTRY_TYPES[entry.entryType] === undefined) {\n    return null;\n  }\n\n  return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time: number): number {\n  // browserPerformanceTimeOrigin can be undefined if `performance` or\n  // `performance.now` doesn't exist, but this is already checked by this integration\n  return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry: PerformancePaintTiming): ReplayPerformanceEntry<PaintData> {\n  const { duration, entryType, name, startTime } = entry;\n\n  const start = getAbsoluteTime(startTime);\n  return {\n    type: entryType,\n    name,\n    start,\n    end: start + duration,\n    data: undefined,\n  };\n}\n\nfunction createNavigationEntry(entry: PerformanceNavigationTiming): ReplayPerformanceEntry<NavigationData> | null {\n  const {\n    entryType,\n    name,\n    decodedBodySize,\n    duration,\n    domComplete,\n    encodedBodySize,\n    domContentLoadedEventStart,\n    domContentLoadedEventEnd,\n    domInteractive,\n    loadEventStart,\n    loadEventEnd,\n    redirectCount,\n    startTime,\n    transferSize,\n    type,\n  } = entry;\n\n  // Ignore entries with no duration, they do not seem to be useful and cause dupes\n  if (duration === 0) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${type}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(domComplete),\n    name,\n    data: {\n      size: transferSize,\n      decodedBodySize,\n      encodedBodySize,\n      duration,\n      domInteractive,\n      domContentLoadedEventStart,\n      domContentLoadedEventEnd,\n      loadEventStart,\n      loadEventEnd,\n      domComplete,\n      redirectCount,\n    },\n  };\n}\n\nfunction createResourceEntry(\n  entry: ExperimentalPerformanceResourceTiming,\n): ReplayPerformanceEntry<ResourceData> | null {\n  const {\n    entryType,\n    initiatorType,\n    name,\n    responseEnd,\n    startTime,\n    decodedBodySize,\n    encodedBodySize,\n    responseStatus,\n    transferSize,\n  } = entry;\n\n  // Core SDK handles these\n  if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n    return null;\n  }\n\n  return {\n    type: `${entryType}.${initiatorType}`,\n    start: getAbsoluteTime(startTime),\n    end: getAbsoluteTime(responseEnd),\n    name,\n    data: {\n      size: transferSize,\n      statusCode: responseStatus,\n      decodedBodySize,\n      encodedBodySize,\n    },\n  };\n}\n\nfunction createLargestContentfulPaint(\n  entry: PerformanceEntry & { size: number; element: Node },\n): ReplayPerformanceEntry<LargestContentfulPaintData> {\n  const { entryType, startTime, size } = entry;\n\n  let startTimeOrNavigationActivation = 0;\n\n  if (WINDOW.performance) {\n    const navEntry = WINDOW.performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming & {\n      activationStart: number;\n    };\n\n    // See https://github.com/GoogleChrome/web-vitals/blob/9f11c4c6578fb4c5ee6fa4e32b9d1d756475f135/src/lib/getActivationStart.ts#L21\n    startTimeOrNavigationActivation = (navEntry && navEntry.activationStart) || 0;\n  }\n\n  // value is in ms\n  const value = Math.max(startTime - startTimeOrNavigationActivation, 0);\n  // LCP doesn't have a \"duration\", it just happens at a single point in time.\n  // But the UI expects both, so use end (in seconds) for both timestamps.\n  const end = getAbsoluteTime(startTimeOrNavigationActivation) + value / 1000;\n\n  return {\n    type: entryType,\n    name: entryType,\n    start: end,\n    end,\n    data: {\n      value, // LCP \"duration\" in ms\n      size,\n      // Not sure why this errors, Node should be correct (Argument of type 'Node' is not assignable to parameter of type 'INode')\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      nodeId: record.mirror.getId(entry.element as any),\n    },\n  };\n}\n","type DebouncedCallback = {\n  (): void | unknown;\n  flush: () => void | unknown;\n  cancel: () => void;\n};\ntype CallbackFunction = () => unknown;\ntype DebounceOptions = { maxWait?: number };\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n *          was already invoked in the meantime, return @param func's return value.\n *          The debounced function has two additional properties:\n *          - `flush`: Invokes the debounced function immediately and returns its return value\n *          - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nexport function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback {\n  let callbackReturnValue: unknown;\n\n  let timerId: ReturnType<typeof setTimeout> | undefined;\n  let maxTimerId: ReturnType<typeof setTimeout> | undefined;\n\n  const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n  function invokeFunc(): unknown {\n    cancelTimers();\n    callbackReturnValue = func();\n    return callbackReturnValue;\n  }\n\n  function cancelTimers(): void {\n    timerId !== undefined && clearTimeout(timerId);\n    maxTimerId !== undefined && clearTimeout(maxTimerId);\n    timerId = maxTimerId = undefined;\n  }\n\n  function flush(): unknown {\n    if (timerId !== undefined || maxTimerId !== undefined) {\n      return invokeFunc();\n    }\n    return callbackReturnValue;\n  }\n\n  function debounced(): unknown {\n    if (timerId) {\n      clearTimeout(timerId);\n    }\n    timerId = setTimeout(invokeFunc, wait);\n\n    if (maxWait && maxTimerId === undefined) {\n      maxTimerId = setTimeout(invokeFunc, maxWait);\n    }\n\n    return callbackReturnValue;\n  }\n\n  debounced.cancel = cancelTimers;\n  debounced.flush = flush;\n  return debounced;\n}\n","import { logger } from '@sentry/utils';\n\nimport { saveSession } from '../session/saveSession';\nimport type { RecordingEvent, ReplayContainer } from '../types';\nimport { addEvent } from './addEvent';\n\ntype RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;\n\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\nexport function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback {\n  let hadFirstEvent = false;\n\n  return (event: RecordingEvent, _isCheckout?: boolean) => {\n    // If this is false, it means session is expired, create and a new session and wait for checkout\n    if (!replay.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.warn('[Replay] Received replay event after session expired.');\n\n      return;\n    }\n\n    // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n    // We also want to treat the first event as a checkout, so we handle this specifically here\n    const isCheckout = _isCheckout || !hadFirstEvent;\n    hadFirstEvent = true;\n\n    // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n    replay.addUpdate(() => {\n      // The session is always started immediately on pageload/init, but for\n      // error-only replays, it should reflect the most recent checkout\n      // when an error occurs. Clear any state that happens before this current\n      // checkout. This needs to happen before `addEvent()` which updates state\n      // dependent on this reset.\n      if (replay.recordingMode === 'error' && isCheckout) {\n        replay.setInitialState();\n      }\n\n      // We need to clear existing events on a checkout, otherwise they are\n      // incremental event updates and should be appended\n      void addEvent(replay, event, isCheckout);\n\n      // Different behavior for full snapshots (type=2), ignore other event types\n      // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n      if (!isCheckout) {\n        return false;\n      }\n\n      // If there is a previousSessionId after a full snapshot occurs, then\n      // the replay session was started due to session expiration. The new session\n      // is started before triggering a new checkout and contains the id\n      // of the previous session. Do not immediately flush in this case\n      // to avoid capturing only the checkout and instead the replay will\n      // be captured if they perform any follow-up actions.\n      if (replay.session && replay.session.previousSessionId) {\n        return true;\n      }\n\n      // See note above re: session start needs to reflect the most recent\n      // checkout.\n      if (replay.recordingMode === 'error' && replay.session) {\n        const { earliestEvent } = replay.getContext();\n        if (earliestEvent) {\n          replay.session.started = earliestEvent;\n\n          if (replay.getOptions().stickySession) {\n            saveSession(replay.session);\n          }\n        }\n      }\n\n      // Flush immediately so that we do not miss the first segment, otherwise\n      // it can prevent loading on the UI. This will cause an increase in short\n      // replays (e.g. opening and closing a tab quickly), but these can be\n      // filtered on the UI.\n      if (replay.recordingMode === 'session') {\n        // We want to ensure the worker is ready, as otherwise we'd always send the first event uncompressed\n        void replay.flushImmediate();\n      }\n\n      return true;\n    });\n  };\n}\n","import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';\nimport { createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader } from '@sentry/utils';\n\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\nexport function createReplayEnvelope(\n  replayEvent: ReplayEvent,\n  recordingData: ReplayRecordingData,\n  dsn: DsnComponents,\n  tunnel?: string,\n): ReplayEnvelope {\n  return createEnvelope<ReplayEnvelope>(\n    createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),\n    [\n      [{ type: 'replay_event' }, replayEvent],\n      [\n        {\n          type: 'replay_recording',\n          // If string then we need to encode to UTF8, otherwise will have\n          // wrong size. TextEncoder has similar browser support to\n          // MutationObserver, although it does not accept IE11.\n          length:\n            typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,\n        },\n        recordingData,\n      ],\n    ],\n  );\n}\n","import type { ReplayRecordingData } from '@sentry/types';\n\n/**\n * Prepare the recording data ready to be sent.\n */\nexport function prepareRecordingData({\n  recordingData,\n  headers,\n}: {\n  recordingData: ReplayRecordingData;\n  headers: Record<string, unknown>;\n}): ReplayRecordingData {\n  let payloadWithSequence;\n\n  // XXX: newline is needed to separate sequence id from events\n  const replayHeaders = `${JSON.stringify(headers)}\n`;\n\n  if (typeof recordingData === 'string') {\n    payloadWithSequence = `${replayHeaders}${recordingData}`;\n  } else {\n    const enc = new TextEncoder();\n    // XXX: newline is needed to separate sequence id from events\n    const sequence = enc.encode(replayHeaders);\n    // Merge the two Uint8Arrays\n    payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n    payloadWithSequence.set(sequence);\n    payloadWithSequence.set(recordingData, sequence.length);\n  }\n\n  return payloadWithSequence;\n}\n","import type { Scope } from '@sentry/core';\nimport { prepareEvent } from '@sentry/core';\nimport type { IntegrationIndex } from '@sentry/core/build/types/integration';\nimport type { Client, ReplayEvent } from '@sentry/types';\n\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\nexport async function prepareReplayEvent({\n  client,\n  scope,\n  replayId: event_id,\n  event,\n}: {\n  client: Client & { _integrations?: IntegrationIndex };\n  scope: Scope;\n  replayId: string;\n  event: ReplayEvent;\n}): Promise<ReplayEvent | null> {\n  const integrations =\n    typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)\n      ? Object.keys(client._integrations)\n      : undefined;\n  const preparedEvent = (await prepareEvent(\n    client.getOptions(),\n    event,\n    { event_id, integrations },\n    scope,\n  )) as ReplayEvent | null;\n\n  // If e.g. a global event processor returned null\n  if (!preparedEvent) {\n    return null;\n  }\n\n  // This normally happens in browser client \"_prepareEvent\"\n  // but since we do not use this private method from the client, but rather the plain import\n  // we need to do this manually.\n  preparedEvent.platform = preparedEvent.platform || 'javascript';\n\n  // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n  const metadata = client.getSdkMetadata && client.getSdkMetadata();\n  const { name, version } = (metadata && metadata.sdk) || {};\n\n  preparedEvent.sdk = {\n    ...preparedEvent.sdk,\n    name: name || 'sentry.javascript.unknown',\n    version: version || '0.0.0',\n  };\n\n  return preparedEvent;\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { ReplayEvent, TransportMakeRequestResponse } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { createReplayEnvelope } from './createReplayEnvelope';\nimport { prepareRecordingData } from './prepareRecordingData';\nimport { prepareReplayEvent } from './prepareReplayEvent';\n\n/**\n * Send replay attachment using `fetch()`\n */\nexport async function sendReplayRequest({\n  recordingData,\n  replayId,\n  segmentId: segment_id,\n  eventContext,\n  timestamp,\n  session,\n  options,\n}: SendReplayData): Promise<void | TransportMakeRequestResponse> {\n  const preparedRecordingData = prepareRecordingData({\n    recordingData,\n    headers: {\n      segment_id,\n    },\n  });\n\n  const { urls, errorIds, traceIds, initialTimestamp } = eventContext;\n\n  const hub = getCurrentHub();\n  const client = hub.getClient();\n  const scope = hub.getScope();\n  const transport = client && client.getTransport();\n  const dsn = client && client.getDsn();\n\n  if (!client || !scope || !transport || !dsn || !session.sampled) {\n    return;\n  }\n\n  const baseEvent: ReplayEvent = {\n    type: REPLAY_EVENT_NAME,\n    replay_start_timestamp: initialTimestamp / 1000,\n    timestamp: timestamp / 1000,\n    error_ids: errorIds,\n    trace_ids: traceIds,\n    urls,\n    replay_id: replayId,\n    segment_id,\n    replay_type: session.sampled,\n  };\n\n  const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });\n\n  if (!replayEvent) {\n    // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n    client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n    __DEBUG_BUILD__ && logger.log('An event processor returned `null`, will not send event.');\n    return;\n  }\n\n  replayEvent.contexts = {\n    ...replayEvent.contexts,\n    replay: {\n      ...(replayEvent.contexts && replayEvent.contexts.replay),\n      session_sample_rate: options.sessionSampleRate,\n      error_sample_rate: options.errorSampleRate,\n    },\n  };\n\n  /*\n  For reference, the fully built event looks something like this:\n  {\n      \"type\": \"replay_event\",\n      \"timestamp\": 1670837008.634,\n      \"error_ids\": [\n          \"errorId\"\n      ],\n      \"trace_ids\": [\n          \"traceId\"\n      ],\n      \"urls\": [\n          \"https://example.com\"\n      ],\n      \"replay_id\": \"eventId\",\n      \"segment_id\": 3,\n      \"replay_type\": \"error\",\n      \"platform\": \"javascript\",\n      \"event_id\": \"eventId\",\n      \"environment\": \"production\",\n      \"sdk\": {\n          \"integrations\": [\n              \"BrowserTracing\",\n              \"Replay\"\n          ],\n          \"name\": \"sentry.javascript.browser\",\n          \"version\": \"7.25.0\"\n      },\n      \"sdkProcessingMetadata\": {},\n      \"contexts\": {\n        \"replay\": {\n          \"session_sample_rate\": 1,\n          \"error_sample_rate\": 0,\n        },\n      },\n  }\n  */\n\n  const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n\n  let response: void | TransportMakeRequestResponse;\n\n  try {\n    response = await transport.send(envelope);\n  } catch (err) {\n    const error = new Error(UNABLE_TO_SEND_REPLAY);\n\n    try {\n      // In case browsers don't allow this property to be writable\n      // @ts-ignore This needs lib es2022 and newer\n      error.cause = err;\n    } catch {\n      // nothing to do\n    }\n    throw error;\n  }\n\n  // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore\n  if (!response) {\n    return response;\n  }\n\n  // If the status code is invalid, we want to immediately stop & not retry\n  if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {\n    throw new TransportStatusCodeError(response.statusCode);\n  }\n\n  return response;\n}\n\n/**\n * This error indicates that the transport returned an invalid status code.\n */\nexport class TransportStatusCodeError extends Error {\n  public constructor(statusCode: number) {\n    super(`Transport returned status code ${statusCode}`);\n  }\n}\n","import { captureException, setContext } from '@sentry/core';\n\nimport { RETRY_BASE_INTERVAL, RETRY_MAX_COUNT, UNABLE_TO_SEND_REPLAY } from '../constants';\nimport type { SendReplayData } from '../types';\nimport { sendReplayRequest, TransportStatusCodeError } from './sendReplayRequest';\n\n/**\n * Finalize and send the current replay event to Sentry\n */\nexport async function sendReplay(\n  replayData: SendReplayData,\n  retryConfig = {\n    count: 0,\n    interval: RETRY_BASE_INTERVAL,\n  },\n): Promise<unknown> {\n  const { recordingData, options } = replayData;\n\n  // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n  if (!recordingData.length) {\n    return;\n  }\n\n  try {\n    await sendReplayRequest(replayData);\n    return true;\n  } catch (err) {\n    if (err instanceof TransportStatusCodeError) {\n      throw err;\n    }\n\n    // Capture error for every failed replay\n    setContext('Replays', {\n      _retryCount: retryConfig.count,\n    });\n\n    if (__DEBUG_BUILD__ && options._experiments && options._experiments.captureExceptions) {\n      captureException(err);\n    }\n\n    // If an error happened here, it's likely that uploading the attachment\n    // failed, we'll can retry with the same events payload\n    if (retryConfig.count >= RETRY_MAX_COUNT) {\n      const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);\n\n      try {\n        // In case browsers don't allow this property to be writable\n        // @ts-ignore This needs lib es2022 and newer\n        error.cause = err;\n      } catch {\n        // nothing to do\n      }\n\n      throw error;\n    }\n\n    // will retry in intervals of 5, 10, 30\n    retryConfig.interval *= ++retryConfig.count;\n\n    return await new Promise((resolve, reject) => {\n      setTimeout(async () => {\n        try {\n          await sendReplay(replayData, retryConfig);\n          resolve(true);\n        } catch (err) {\n          reject(err);\n        }\n      }, retryConfig.interval);\n    });\n  }\n}\n","/* eslint-disable max-lines */ // TODO: We might want to split this file up\nimport { EventType, record } from '@sentry-internal/rrweb';\nimport { captureException, getCurrentHub } from '@sentry/core';\nimport type { Breadcrumb, ReplayRecordingMode } from '@sentry/types';\nimport { logger } from '@sentry/utils';\n\nimport { ERROR_CHECKOUT_TIME, MAX_SESSION_LIFE, SESSION_IDLE_DURATION, WINDOW } from './constants';\nimport { setupPerformanceObserver } from './coreHandlers/performanceObserver';\nimport { createEventBuffer } from './eventBuffer';\nimport { getSession } from './session/getSession';\nimport { saveSession } from './session/saveSession';\nimport type {\n  AddEventResult,\n  AddUpdateCallback,\n  AllPerformanceEntry,\n  EventBuffer,\n  InternalEventContext,\n  PopEventContext,\n  RecordingOptions,\n  ReplayContainer as ReplayContainerInterface,\n  ReplayExperimentalPluginOptions,\n  ReplayPluginOptions,\n  Session,\n  Timeouts,\n} from './types';\nimport { addEvent } from './util/addEvent';\nimport { addGlobalListeners } from './util/addGlobalListeners';\nimport { addMemoryEntry } from './util/addMemoryEntry';\nimport { createBreadcrumb } from './util/createBreadcrumb';\nimport { createPerformanceEntries } from './util/createPerformanceEntries';\nimport { createPerformanceSpans } from './util/createPerformanceSpans';\nimport { debounce } from './util/debounce';\nimport { getHandleRecordingEmit } from './util/handleRecordingEmit';\nimport { isExpired } from './util/isExpired';\nimport { isSessionExpired } from './util/isSessionExpired';\nimport { sendReplay } from './util/sendReplay';\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\nexport class ReplayContainer implements ReplayContainerInterface {\n  public eventBuffer: EventBuffer | null = null;\n\n  /**\n   * List of PerformanceEntry from PerformanceObserver\n   */\n  public performanceEvents: AllPerformanceEntry[] = [];\n\n  public session: Session | undefined;\n\n  /**\n   * Recording can happen in one of two modes:\n   * * session: Record the whole session, sending it continuously\n   * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately\n   */\n  public recordingMode: ReplayRecordingMode = 'session';\n\n  /**\n   * These are here so we can overwrite them in tests etc.\n   * @hidden\n   */\n  public readonly timeouts: Timeouts = {\n    sessionIdle: SESSION_IDLE_DURATION,\n    maxSessionLife: MAX_SESSION_LIFE,\n  } as const;\n\n  private readonly _experimentalOptions: ReplayExperimentalPluginOptions;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  private readonly _options: ReplayPluginOptions;\n\n  private _performanceObserver: PerformanceObserver | null = null;\n\n  private _debouncedFlush: ReturnType<typeof debounce>;\n  private _flushLock: Promise<unknown> | null = null;\n\n  /**\n   * Timestamp of the last user activity. This lives across sessions.\n   */\n  private _lastActivity: number = Date.now();\n\n  /**\n   * Is the integration currently active?\n   */\n  private _isEnabled: boolean = false;\n\n  /**\n   * Paused is a state where:\n   * - DOM Recording is not listening at all\n   * - Nothing will be added to event buffer (e.g. core SDK events)\n   */\n  private _isPaused: boolean = false;\n\n  /**\n   * Have we attached listeners to the core SDK?\n   * Note we have to track this as there is no way to remove instrumentation handlers.\n   */\n  private _hasInitializedCoreListeners: boolean = false;\n\n  /**\n   * Function to stop recording\n   */\n  private _stopRecording: ReturnType<typeof record> | null = null;\n\n  private _context: InternalEventContext = {\n    errorIds: new Set(),\n    traceIds: new Set(),\n    urls: [],\n    earliestEvent: null,\n    initialTimestamp: Date.now(),\n    initialUrl: '',\n  };\n\n  public constructor({\n    options,\n    recordingOptions,\n  }: {\n    options: ReplayPluginOptions;\n    recordingOptions: RecordingOptions;\n  }) {\n    this._recordingOptions = recordingOptions;\n    this._options = options;\n\n    this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {\n      maxWait: this._options.flushMaxDelay,\n    });\n\n    this._experimentalOptions = _getExperimentalOptions(options);\n  }\n\n  /** Get the event context. */\n  public getContext(): InternalEventContext {\n    return this._context;\n  }\n\n  /** If recording is currently enabled. */\n  public isEnabled(): boolean {\n    return this._isEnabled;\n  }\n\n  /** If recording is currently paused. */\n  public isPaused(): boolean {\n    return this._isPaused;\n  }\n\n  /** Get the replay integration options. */\n  public getOptions(): ReplayPluginOptions {\n    return this._options;\n  }\n\n  /**\n   * Get the experimental options.\n   * THIS IS INTERNAL AND SUBJECT TO CHANGE!\n   * @hidden\n   */\n  public getExperimentalOptions(): ReplayExperimentalPluginOptions {\n    return this._experimentalOptions;\n  }\n\n  /**\n   * Initializes the plugin.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * _performanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    this.setInitialState();\n\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    // If there is no session, then something bad has happened - can't continue\n    if (!this.session) {\n      this._handleException(new Error('No session found'));\n      return;\n    }\n\n    if (!this.session.sampled) {\n      // If session was not sampled, then we do not initialize the integration at all.\n      return;\n    }\n\n    // If session is sampled for errors, then we need to set the recordingMode\n    // to 'error', which will configure recording with different options.\n    if (this.session.sampled === 'error') {\n      this.recordingMode = 'error';\n    }\n\n    // setup() is generally called on page load or manually - in both cases we\n    // should treat it as an activity\n    this._updateSessionActivity();\n\n    this.eventBuffer = createEventBuffer({\n      useCompression: this._options.useCompression,\n    });\n\n    this._addListeners();\n\n    // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n    this._isEnabled = true;\n\n    this.startRecording();\n  }\n\n  /**\n   * Start recording.\n   *\n   * Note that this will cause a new DOM checkout\n   */\n  public startRecording(): void {\n    try {\n      this._stopRecording = record({\n        ...this._recordingOptions,\n        // When running in error sampling mode, we need to overwrite `checkoutEveryNms`\n        // Without this, it would record forever, until an error happens, which we don't want\n        // instead, we'll always keep the last 60 seconds of replay before an error happened\n        ...(this.recordingMode === 'error' && { checkoutEveryNms: ERROR_CHECKOUT_TIME }),\n        emit: getHandleRecordingEmit(this),\n        onMutation: this._onMutationHandler,\n      });\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Stops the recording, if it was running.\n   * Returns true if it was stopped, else false.\n   */\n  public stopRecording(): boolean {\n    try {\n      if (this._stopRecording) {\n        this._stopRecording();\n        this._stopRecording = undefined;\n        return true;\n      }\n\n      return false;\n    } catch (err) {\n      this._handleException(err);\n      return false;\n    }\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public stop(reason?: string): void {\n    if (!this._isEnabled) {\n      return;\n    }\n\n    try {\n      if (__DEBUG_BUILD__) {\n        const msg = `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`;\n\n        // When `traceInternals` is enabled, we want to log this to the console\n        // Else, use the regular debug output\n        // eslint-disable-next-line\n        const log = this.getOptions()._experiments.traceInternals ? console.warn : logger.log;\n        log(msg);\n      }\n\n      this._isEnabled = false;\n      this._removeListeners();\n      this.stopRecording();\n      this.eventBuffer && this.eventBuffer.destroy();\n      this.eventBuffer = null;\n      this._debouncedFlush.cancel();\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Pause some replay functionality. See comments for `_isPaused`.\n   * This differs from stop as this only stops DOM recording, it is\n   * not as thorough of a shutdown as `stop()`.\n   */\n  public pause(): void {\n    this._isPaused = true;\n    this.stopRecording();\n  }\n\n  /**\n   * Resumes recording, see notes for `pause().\n   *\n   * Note that calling `startRecording()` here will cause a\n   * new DOM checkout.`\n   */\n  public resume(): void {\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    this._isPaused = false;\n    this.startRecording();\n  }\n\n  /**\n   * We want to batch uploads of replay events. Save events only if\n   * `<flushMinDelay>` milliseconds have elapsed since the last event\n   * *OR* if `<flushMaxDelay>` milliseconds have elapsed.\n   *\n   * Accepts a callback to perform side-effects and returns true to stop batch\n   * processing and hand back control to caller.\n   */\n  public addUpdate(cb: AddUpdateCallback): void {\n    // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'error'`)\n    const cbResult = cb();\n\n    // If this option is turned on then we will only want to call `flush`\n    // explicitly\n    if (this.recordingMode === 'error') {\n      return;\n    }\n\n    // If callback is true, we do not want to continue with flushing -- the\n    // caller will need to handle it.\n    if (cbResult === true) {\n      return;\n    }\n\n    // addUpdate is called quite frequently - use _debouncedFlush so that it\n    // respects the flush delays and does not flush immediately\n    this._debouncedFlush();\n  }\n\n  /**\n   * Updates the user activity timestamp and resumes recording. This should be\n   * called in an event handler for a user action that we consider as the user\n   * being \"active\" (e.g. a mouse click).\n   */\n  public triggerUserActivity(): void {\n    this._updateUserActivity();\n\n    // This case means that recording was once stopped due to inactivity.\n    // Ensure that recording is resumed.\n    if (!this._stopRecording) {\n      // Create a new session, otherwise when the user action is flushed, it\n      // will get rejected due to an expired session.\n      if (!this._loadAndCheckSession()) {\n        return;\n      }\n\n      // Note: This will cause a new DOM checkout\n      this.resume();\n      return;\n    }\n\n    // Otherwise... recording was never suspended, continue as normalish\n    this.checkAndHandleExpiredSession();\n\n    this._updateSessionActivity();\n  }\n\n  /**\n   *\n   * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n   * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n   * cases of mulitple flushes happening closely together.\n   */\n  public flushImmediate(): Promise<void> {\n    this._debouncedFlush();\n    // `.flush` is provided by the debounced function, analogously to lodash.debounce\n    return this._debouncedFlush.flush() as Promise<void>;\n  }\n\n  /** Get the current sesion (=replay) ID */\n  public getSessionId(): string | undefined {\n    return this.session && this.session.id;\n  }\n\n  /**\n   * Checks if recording should be stopped due to user inactivity. Otherwise\n   * check if session is expired and create a new session if so. Triggers a new\n   * full snapshot on new session.\n   *\n   * Returns true if session is not expired, false otherwise.\n   * @hidden\n   */\n  public checkAndHandleExpiredSession(): boolean | void {\n    const oldSessionId = this.getSessionId();\n\n    // Prevent starting a new session if the last user activity is older than\n    // SESSION_IDLE_DURATION. Otherwise non-user activity can trigger a new\n    // session+recording. This creates noisy replays that do not have much\n    // content in them.\n    if (\n      this._lastActivity &&\n      isExpired(this._lastActivity, this.timeouts.sessionIdle) &&\n      this.session &&\n      this.session.sampled === 'session'\n    ) {\n      // Pause recording only for session-based replays. Otherwise, resuming\n      // will create a new replay and will conflict with users who only choose\n      // to record error-based replays only. (e.g. the resumed replay will not\n      // contain a reference to an error)\n      this.pause();\n      return;\n    }\n\n    // --- There is recent user activity --- //\n    // This will create a new session if expired, based on expiry length\n    if (!this._loadAndCheckSession()) {\n      return;\n    }\n\n    // Session was expired if session ids do not match\n    const expired = oldSessionId !== this.getSessionId();\n\n    if (!expired) {\n      return true;\n    }\n\n    // Session is expired, trigger a full snapshot (which will create a new session)\n    this._triggerFullSnapshot();\n\n    return false;\n  }\n\n  /**\n   * Capture some initial state that can change throughout the lifespan of the\n   * replay. This is required because otherwise they would be captured at the\n   * first flush.\n   */\n  public setInitialState(): void {\n    const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;\n    const url = `${WINDOW.location.origin}${urlPath}`;\n\n    this.performanceEvents = [];\n\n    // Reset _context as well\n    this._clearContext();\n\n    this._context.initialUrl = url;\n    this._context.initialTimestamp = Date.now();\n    this._context.urls.push(url);\n  }\n\n  /** A wrapper to conditionally capture exceptions. */\n  private _handleException(error: unknown): void {\n    __DEBUG_BUILD__ && logger.error('[Replay]', error);\n\n    if (__DEBUG_BUILD__ && this._options._experiments && this._options._experiments.captureExceptions) {\n      captureException(error);\n    }\n  }\n\n  /**\n   * Loads (or refreshes) the current session.\n   * Returns false if session is not recorded.\n   */\n  private _loadAndCheckSession(): boolean {\n    const { type, session } = getSession({\n      timeouts: this.timeouts,\n      stickySession: Boolean(this._options.stickySession),\n      currentSession: this.session,\n      sessionSampleRate: this._options.sessionSampleRate,\n      errorSampleRate: this._options.errorSampleRate,\n    });\n\n    // If session was newly created (i.e. was not loaded from storage), then\n    // enable flag to create the root replay\n    if (type === 'new') {\n      this.setInitialState();\n    }\n\n    const currentSessionId = this.getSessionId();\n    if (session.id !== currentSessionId) {\n      session.previousSessionId = currentSessionId;\n    }\n\n    this.session = session;\n\n    if (!this.session.sampled) {\n      this.stop('session unsampled');\n      return false;\n    }\n\n    return true;\n  }\n\n  /**\n   * Adds listeners to record events for the replay\n   */\n  private _addListeners(): void {\n    try {\n      WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n      WINDOW.addEventListener('blur', this._handleWindowBlur);\n      WINDOW.addEventListener('focus', this._handleWindowFocus);\n\n      // There is no way to remove these listeners, so ensure they are only added once\n      if (!this._hasInitializedCoreListeners) {\n        addGlobalListeners(this);\n\n        this._hasInitializedCoreListeners = true;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n\n    // PerformanceObserver //\n    if (!('PerformanceObserver' in WINDOW)) {\n      return;\n    }\n\n    this._performanceObserver = setupPerformanceObserver(this);\n  }\n\n  /**\n   * Cleans up listeners that were created in `_addListeners`\n   */\n  private _removeListeners(): void {\n    try {\n      WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n      WINDOW.removeEventListener('blur', this._handleWindowBlur);\n      WINDOW.removeEventListener('focus', this._handleWindowFocus);\n\n      if (this._performanceObserver) {\n        this._performanceObserver.disconnect();\n        this._performanceObserver = null;\n      }\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Handle when visibility of the page content changes. Opening a new tab will\n   * cause the state to change to hidden because of content of current page will\n   * be hidden. Likewise, moving a different window to cover the contents of the\n   * page will also trigger a change to a hidden state.\n   */\n  private _handleVisibilityChange: () => void = () => {\n    if (WINDOW.document.visibilityState === 'visible') {\n      this._doChangeToForegroundTasks();\n    } else {\n      this._doChangeToBackgroundTasks();\n    }\n  };\n\n  /**\n   * Handle when page is blurred\n   */\n  private _handleWindowBlur: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.blur',\n    });\n\n    // Do not count blur as a user action -- it's part of the process of them\n    // leaving the page\n    this._doChangeToBackgroundTasks(breadcrumb);\n  };\n\n  /**\n   * Handle when page is focused\n   */\n  private _handleWindowFocus: () => void = () => {\n    const breadcrumb = createBreadcrumb({\n      category: 'ui.focus',\n    });\n\n    // Do not count focus as a user action -- instead wait until they focus and\n    // interactive with page\n    this._doChangeToForegroundTasks(breadcrumb);\n  };\n\n  /**\n   * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n   */\n  private _doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void {\n    if (!this.session) {\n      return;\n    }\n\n    const expired = isSessionExpired(this.session, this.timeouts);\n\n    if (breadcrumb && !expired) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    // Send replay when the page/tab becomes hidden. There is no reason to send\n    // replay if it becomes visible, since no actions we care about were done\n    // while it was hidden\n    this._conditionalFlush();\n  }\n\n  /**\n   * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n   */\n  private _doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void {\n    if (!this.session) {\n      return;\n    }\n\n    const isSessionActive = this.checkAndHandleExpiredSession();\n\n    if (!isSessionActive) {\n      // If the user has come back to the page within SESSION_IDLE_DURATION\n      // ms, we will re-use the existing session, otherwise create a new\n      // session\n      __DEBUG_BUILD__ && logger.log('[Replay] Document has become active, but session has expired');\n      return;\n    }\n\n    if (breadcrumb) {\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n  }\n\n  /**\n   * Trigger rrweb to take a full snapshot which will cause this plugin to\n   * create a new Replay event.\n   */\n  private _triggerFullSnapshot(checkout = true): void {\n    try {\n      __DEBUG_BUILD__ && logger.log('[Replay] Taking full rrweb snapshot');\n      record.takeFullSnapshot(checkout);\n    } catch (err) {\n      this._handleException(err);\n    }\n  }\n\n  /**\n   * Update user activity (across session lifespans)\n   */\n  private _updateUserActivity(_lastActivity: number = Date.now()): void {\n    this._lastActivity = _lastActivity;\n  }\n\n  /**\n   * Updates the session's last activity timestamp\n   */\n  private _updateSessionActivity(_lastActivity: number = Date.now()): void {\n    if (this.session) {\n      this.session.lastActivity = _lastActivity;\n      this._maybeSaveSession();\n    }\n  }\n\n  /**\n   * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n   */\n  private _createCustomBreadcrumb(breadcrumb: Breadcrumb): void {\n    this.addUpdate(() => {\n      void addEvent(this, {\n        type: EventType.Custom,\n        timestamp: breadcrumb.timestamp || 0,\n        data: {\n          tag: 'breadcrumb',\n          payload: breadcrumb,\n        },\n      });\n    });\n  }\n\n  /**\n   * Observed performance events are added to `this.performanceEvents`. These\n   * are included in the replay event before it is finished and sent to Sentry.\n   */\n  private _addPerformanceEntries(): Promise<Array<AddEventResult | null>> {\n    // Copy and reset entries before processing\n    const entries = [...this.performanceEvents];\n    this.performanceEvents = [];\n\n    return Promise.all(createPerformanceSpans(this, createPerformanceEntries(entries)));\n  }\n\n  /**\n   * Only flush if `this.recordingMode === 'session'`\n   */\n  private _conditionalFlush(): void {\n    if (this.recordingMode === 'error') {\n      return;\n    }\n\n    void this.flushImmediate();\n  }\n\n  /**\n   * Clear _context\n   */\n  private _clearContext(): void {\n    // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n    this._context.errorIds.clear();\n    this._context.traceIds.clear();\n    this._context.urls = [];\n    this._context.earliestEvent = null;\n  }\n\n  /**\n   * Return and clear _context\n   */\n  private _popEventContext(): PopEventContext {\n    if (this._context.earliestEvent && this._context.earliestEvent < this._context.initialTimestamp) {\n      this._context.initialTimestamp = this._context.earliestEvent;\n    }\n\n    const _context = {\n      initialTimestamp: this._context.initialTimestamp,\n      initialUrl: this._context.initialUrl,\n      errorIds: Array.from(this._context.errorIds).filter(Boolean),\n      traceIds: Array.from(this._context.traceIds).filter(Boolean),\n      urls: this._context.urls,\n    };\n\n    this._clearContext();\n\n    return _context;\n  }\n\n  /**\n   * Flushes replay event buffer to Sentry.\n   *\n   * Performance events are only added right before flushing - this is\n   * due to the buffered performance observer events.\n   *\n   * Should never be called directly, only by `flush`\n   */\n  private async _runFlush(): Promise<void> {\n    if (!this.session || !this.eventBuffer) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session or eventBuffer found to flush.');\n      return;\n    }\n\n    await this._addPerformanceEntries();\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer || !this.eventBuffer.hasEvents) {\n      return;\n    }\n\n    // Only attach memory event if eventBuffer is not empty\n    await addMemoryEntry(this);\n\n    // Check eventBuffer again, as it could have been stopped in the meanwhile\n    if (!this.eventBuffer) {\n      return;\n    }\n\n    try {\n      // Note this empties the event buffer regardless of outcome of sending replay\n      const recordingData = await this.eventBuffer.finish();\n\n      // NOTE: Copy values from instance members, as it's possible they could\n      // change before the flush finishes.\n      const replayId = this.session.id;\n      const eventContext = this._popEventContext();\n      // Always increment segmentId regardless of outcome of sending replay\n      const segmentId = this.session.segmentId++;\n      this._maybeSaveSession();\n\n      await sendReplay({\n        replayId,\n        recordingData,\n        segmentId,\n        eventContext,\n        session: this.session,\n        options: this.getOptions(),\n        timestamp: Date.now(),\n      });\n    } catch (err) {\n      this._handleException(err);\n\n      // This means we retried 3 times and all of them failed,\n      // or we ran into a problem we don't want to retry, like rate limiting.\n      // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n      this.stop('sendReplay');\n\n      const client = getCurrentHub().getClient();\n\n      if (client) {\n        client.recordDroppedEvent('send_error', 'replay');\n      }\n    }\n  }\n\n  /**\n   * Flush recording data to Sentry. Creates a lock so that only a single flush\n   * can be active at a time. Do not call this directly.\n   */\n  private _flush: () => Promise<void> = async () => {\n    if (!this._isEnabled) {\n      // This can happen if e.g. the replay was stopped because of exceeding the retry limit\n      return;\n    }\n\n    if (!this.checkAndHandleExpiredSession()) {\n      __DEBUG_BUILD__ && logger.error('[Replay] Attempting to finish replay event after session expired.');\n      return;\n    }\n\n    if (!this.session) {\n      __DEBUG_BUILD__ && logger.error('[Replay] No session found to flush.');\n      return;\n    }\n\n    // A flush is about to happen, cancel any queued flushes\n    this._debouncedFlush.cancel();\n\n    // this._flushLock acts as a lock so that future calls to `_flush()`\n    // will be blocked until this promise resolves\n    if (!this._flushLock) {\n      this._flushLock = this._runFlush();\n      await this._flushLock;\n      this._flushLock = null;\n      return;\n    }\n\n    // Wait for previous flush to finish, then call the debounced `_flush()`.\n    // It's possible there are other flush requests queued and waiting for it\n    // to resolve. We want to reduce all outstanding requests (as well as any\n    // new flush requests that occur within a second of the locked flush\n    // completing) into a single flush.\n\n    try {\n      await this._flushLock;\n    } catch (err) {\n      __DEBUG_BUILD__ && logger.error(err);\n    } finally {\n      this._debouncedFlush();\n    }\n  };\n\n  /** Save the session, if it is sticky */\n  private _maybeSaveSession(): void {\n    if (this.session && this._options.stickySession) {\n      saveSession(this.session);\n    }\n  }\n\n  /** Handler for rrweb.record.onMutation */\n  private _onMutationHandler = (mutations: unknown[]): boolean => {\n    const count = mutations.length;\n\n    const mutationLimit = this._options._experiments.mutationLimit || 0;\n    const mutationBreadcrumbLimit = this._options._experiments.mutationBreadcrumbLimit || 1000;\n    const overMutationLimit = mutationLimit && count > mutationLimit;\n\n    // Create a breadcrumb if a lot of mutations happen at the same time\n    // We can show this in the UI as an information with potential performance improvements\n    if (count > mutationBreadcrumbLimit || overMutationLimit) {\n      const breadcrumb = createBreadcrumb({\n        category: 'replay.mutations',\n        data: {\n          count,\n        },\n      });\n      this._createCustomBreadcrumb(breadcrumb);\n    }\n\n    if (overMutationLimit) {\n      // We want to skip doing an incremental snapshot if there are too many mutations\n      // Instead, we do a full snapshot\n      this._triggerFullSnapshot(false);\n      return false;\n    }\n\n    // `true` means we use the regular mutation handling by rrweb\n    return true;\n  };\n}\n\nfunction _getExperimentalOptions(options: ReplayPluginOptions): ReplayExperimentalPluginOptions {\n  const requestHeaders = options._experiments.captureRequestHeaders || [];\n  const responseHeaders = options._experiments.captureResponseHeaders || [];\n  const captureBodies = options._experiments.captureNetworkBodies || false;\n\n  // Add defaults\n  const defaultHeaders = ['content-length', 'content-type', 'accept'];\n\n  return {\n    network: {\n      captureBodies,\n      requestHeaders: [...defaultHeaders, ...requestHeaders.map(header => header.toLowerCase())],\n      responseHeaders: [...defaultHeaders, ...responseHeaders.map(header => header.toLowerCase())],\n    },\n  };\n}\n","import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';\n\ntype GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> &\n  Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;\ninterface GetPrivacyReturn {\n  maskTextSelector: string;\n  unmaskTextSelector: string;\n  maskInputSelector: string;\n  unmaskInputSelector: string;\n  blockSelector: string;\n  unblockSelector: string;\n  ignoreSelector: string;\n\n  blockClass?: RegExp;\n  maskTextClass?: RegExp;\n}\n\nfunction getOption(\n  selectors: string[],\n  defaultSelectors: string[],\n  deprecatedClassOption?: string | RegExp,\n  deprecatedSelectorOption?: string,\n): string {\n  const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n\n  const allSelectors = [\n    ...selectors,\n    // @deprecated\n    ...deprecatedSelectors,\n\n    // sentry defaults\n    ...defaultSelectors,\n  ];\n\n  // @deprecated\n  if (typeof deprecatedClassOption !== 'undefined') {\n    // NOTE: No support for RegExp\n    if (typeof deprecatedClassOption === 'string') {\n      allSelectors.push(`.${deprecatedClassOption}`);\n    }\n\n    // eslint-disable-next-line no-console\n    console.warn(\n      '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',\n    );\n  }\n\n  return allSelectors.join(',');\n}\n\n/**\n * Returns privacy related configuration for use in rrweb\n */\nexport function getPrivacyOptions({\n  mask,\n  unmask,\n  block,\n  unblock,\n  ignore,\n\n  // eslint-disable-next-line deprecation/deprecation\n  blockClass,\n  // eslint-disable-next-line deprecation/deprecation\n  blockSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextClass,\n  // eslint-disable-next-line deprecation/deprecation\n  maskTextSelector,\n  // eslint-disable-next-line deprecation/deprecation\n  ignoreClass,\n}: GetPrivacyOptions): GetPrivacyReturn {\n  const defaultBlockedElements = ['base[href=\"/\"]'];\n\n  const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n  const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n\n  const options: GetPrivacyReturn = {\n    // We are making the decision to make text and input selectors the same\n    maskTextSelector: maskSelector,\n    unmaskTextSelector: unmaskSelector,\n    maskInputSelector: maskSelector,\n    unmaskInputSelector: unmaskSelector,\n\n    blockSelector: getOption(\n      block,\n      ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],\n      blockClass,\n      blockSelector,\n    ),\n    unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n    ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass),\n  };\n\n  if (blockClass instanceof RegExp) {\n    options.blockClass = blockClass;\n  }\n\n  if (maskTextClass instanceof RegExp) {\n    options.maskTextClass = maskTextClass;\n  }\n\n  return options;\n}\n","import { isNodeEnv } from '@sentry/utils';\n\n/**\n * Returns true if we are in the browser.\n */\nexport function isBrowser(): boolean {\n  // eslint-disable-next-line no-restricted-globals\n  return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\ntype ElectronProcess = { type?: string };\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer(): boolean {\n  return typeof process !== 'undefined' && (process as ElectronProcess).type === 'renderer';\n}\n","import { getCurrentHub } from '@sentry/core';\nimport type { BrowserClientReplayOptions, Integration } from '@sentry/types';\nimport { dropUndefinedKeys } from '@sentry/utils';\n\nimport { DEFAULT_FLUSH_MAX_DELAY, DEFAULT_FLUSH_MIN_DELAY } from './constants';\nimport { ReplayContainer } from './replay';\nimport type { RecordingOptions, ReplayConfiguration, ReplayPluginOptions } from './types';\nimport { getPrivacyOptions } from './util/getPrivacyOptions';\nimport { isBrowser } from './util/isBrowser';\n\nconst MEDIA_SELECTORS =\n  'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\n\nlet _initialized = false;\n\ntype InitialReplayPluginOptions = Omit<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'> &\n  Partial<Pick<ReplayPluginOptions, 'sessionSampleRate' | 'errorSampleRate'>>;\n\n/**\n * The main replay integration class, to be passed to `init({  integrations: [] })`.\n */\nexport class Replay implements Integration {\n  /**\n   * @inheritDoc\n   */\n  public static id: string = 'Replay';\n\n  /**\n   * @inheritDoc\n   */\n  public name: string = Replay.id;\n\n  /**\n   * Options to pass to `rrweb.record()`\n   */\n  private readonly _recordingOptions: RecordingOptions;\n\n  /**\n   * Initial options passed to the replay integration, merged with default values.\n   * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n   * can only be finally set when setupOnce() is called.\n   *\n   * @private\n   */\n  private readonly _initialOptions: InitialReplayPluginOptions;\n\n  private _replay?: ReplayContainer;\n\n  public constructor({\n    flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,\n    flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,\n    stickySession = true,\n    useCompression = true,\n    _experiments = {},\n    sessionSampleRate,\n    errorSampleRate,\n    maskAllText = true,\n    maskAllInputs = true,\n    blockAllMedia = true,\n\n    mask = [],\n    unmask = [],\n    block = [],\n    unblock = [],\n    ignore = [],\n    maskFn,\n\n    // eslint-disable-next-line deprecation/deprecation\n    blockClass,\n    // eslint-disable-next-line deprecation/deprecation\n    blockSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    maskInputOptions,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextClass,\n    // eslint-disable-next-line deprecation/deprecation\n    maskTextSelector,\n    // eslint-disable-next-line deprecation/deprecation\n    ignoreClass,\n  }: ReplayConfiguration = {}) {\n    this._recordingOptions = {\n      maskAllInputs,\n      maskAllText,\n      maskInputOptions: { ...(maskInputOptions || {}), password: true },\n      maskTextFn: maskFn,\n      maskInputFn: maskFn,\n\n      ...getPrivacyOptions({\n        mask,\n        unmask,\n        block,\n        unblock,\n        ignore,\n        blockClass,\n        blockSelector,\n        maskTextClass,\n        maskTextSelector,\n        ignoreClass,\n      }),\n\n      // Our defaults\n      slimDOMOptions: 'all',\n      inlineStylesheet: true,\n      // Disable inline images as it will increase segment/replay size\n      inlineImages: false,\n      // collect fonts, but be aware that `sentry.io` needs to be an allowed\n      // origin for playback\n      collectFonts: true,\n    };\n\n    this._initialOptions = {\n      flushMinDelay,\n      flushMaxDelay,\n      stickySession,\n      sessionSampleRate,\n      errorSampleRate,\n      useCompression,\n      blockAllMedia,\n      _experiments,\n    };\n\n    if (typeof sessionSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`sessionSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysSessionSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,\n      );\n\n      this._initialOptions.sessionSampleRate = sessionSampleRate;\n    }\n\n    if (typeof errorSampleRate === 'number') {\n      // eslint-disable-next-line\n      console.warn(\n        `[Replay] You are passing \\`errorSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysOnErrorSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,\n      );\n\n      this._initialOptions.errorSampleRate = errorSampleRate;\n    }\n\n    if (this._initialOptions.blockAllMedia) {\n      // `blockAllMedia` is a more user friendly option to configure blocking\n      // embedded media elements\n      this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector\n        ? MEDIA_SELECTORS\n        : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;\n    }\n\n    if (this._isInitialized && isBrowser()) {\n      throw new Error('Multiple Sentry Session Replay instances are not supported');\n    }\n\n    this._isInitialized = true;\n  }\n\n  /** If replay has already been initialized */\n  protected get _isInitialized(): boolean {\n    return _initialized;\n  }\n\n  /** Update _isInitialized */\n  protected set _isInitialized(value: boolean) {\n    _initialized = value;\n  }\n\n  /**\n   * We previously used to create a transaction in `setupOnce` and it would\n   * potentially create a transaction before some native SDK integrations have run\n   * and applied their own global event processor. An example is:\n   * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n   *\n   * So we call `replay.setup` in next event loop as a workaround to wait for other\n   * global event processors to finish. This is no longer needed, but keeping it\n   * here to avoid any future issues.\n   */\n  public setupOnce(): void {\n    if (!isBrowser()) {\n      return;\n    }\n\n    this._setup();\n\n    // XXX: See method comments above\n    setTimeout(() => this.start());\n  }\n\n  /**\n   * Initializes the plugin.\n   *\n   * Creates or loads a session, attaches listeners to varying events (DOM,\n   * PerformanceObserver, Recording, Sentry SDK, etc)\n   */\n  public start(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.start();\n  }\n\n  /**\n   * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n   * does not support a teardown\n   */\n  public stop(): void {\n    if (!this._replay) {\n      return;\n    }\n\n    this._replay.stop();\n  }\n\n  /**\n   * Immediately send all pending events.\n   */\n  public flush(): Promise<void> | void {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return;\n    }\n\n    return this._replay.flushImmediate();\n  }\n\n  /**\n   * Get the current session ID.\n   */\n  public getReplayId(): string | undefined {\n    if (!this._replay || !this._replay.isEnabled()) {\n      return;\n    }\n\n    return this._replay.getSessionId();\n  }\n\n  /** Setup the integration. */\n  private _setup(): void {\n    // Client is not available in constructor, so we need to wait until setupOnce\n    const finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n\n    this._replay = new ReplayContainer({\n      options: finalOptions,\n      recordingOptions: this._recordingOptions,\n    });\n  }\n}\n\n/** Parse Replay-related options from SDK options */\nfunction loadReplayOptionsFromClient(initialOptions: InitialReplayPluginOptions): ReplayPluginOptions {\n  const client = getCurrentHub().getClient();\n  const opt = client && (client.getOptions() as BrowserClientReplayOptions);\n\n  const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };\n\n  if (!opt) {\n    // eslint-disable-next-line no-console\n    console.warn('SDK client is not available.');\n    return finalOptions;\n  }\n\n  if (\n    initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n    initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n    opt.replaysSessionSampleRate == null &&\n    opt.replaysOnErrorSampleRate == null\n  ) {\n    // eslint-disable-next-line no-console\n    console.warn(\n      'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',\n    );\n  }\n\n  if (typeof opt.replaysSessionSampleRate === 'number') {\n    finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n  }\n\n  if (typeof opt.replaysOnErrorSampleRate === 'number') {\n    finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n  }\n\n  return finalOptions;\n}\n"],"names":["NodeType","getWorkerURL"],"mappings":";;;AAEA;AACA;AACA;AACA;AACA,MAAA,MAAA,GAAA,UAAA,EAAA;AACA;AACA,MAAA,kBAAA,GAAA,qBAAA,CAAA;AACA,MAAA,iBAAA,GAAA,cAAA,CAAA;AAEA,MAAA,qBAAA,GAAA,uBAAA,CAAA;AACA;AACA;AACA,MAAA,qBAAA,GAAA,MAAA,CAAA;AACA;AACA;AACA,MAAA,gBAAA,GAAA,OAAA,CAAA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA,MAAA,uBAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,KAAA,CAAA;AACA;AACA,MAAA,mBAAA,GAAA,IAAA,CAAA;AACA,MAAA,eAAA,GAAA,CAAA,CAAA;AACA;AACA;AACA,MAAA,qBAAA,GAAA,MAAA;;AChCA,IAAAA,UAAA,CAAA;AACA,CAAA,UAAA,QAAA,EAAA;AACA,IAAA,QAAA,CAAA,QAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAA,CAAA;AACA,IAAA,QAAA,CAAA,QAAA,CAAA,cAAA,CAAA,GAAA,CAAA,CAAA,GAAA,cAAA,CAAA;AACA,IAAA,QAAA,CAAA,QAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA,CAAA;AACA,IAAA,QAAA,CAAA,QAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA,CAAA;AACA,IAAA,QAAA,CAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA,CAAA;AACA,IAAA,QAAA,CAAA,QA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ACA;AACA;AACA,SAAA,2BAAA,CAAA,cAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,aAAA,EAAA,CAAA,SAAA,EAAA,CAAA;AACA,EAAA,MAAA,GAAA,GAAA,MAAA,KAAA,MAAA,CAAA,UAAA,EAAA,EAAA,CAAA;AACA;AACA,EAAA,MAAA,YAAA,GAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,GAAA,iBAAA,CAAA,cAAA,CAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,GAAA,EAAA;AACA;AACA,IAAA,OAAA,CAAA,IAAA,CAAA,8BAAA,CAAA,CAAA;AACA,IAAA,OAAA,YAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA;AACA,IAAA,cAAA,CAAA,iBAAA,IAAA,IAAA;AACA,IAAA,cAAA,CAAA,eAAA,IAAA,IAAA;AACA,IAAA,GAAA,CAAA,wBAAA,IAAA,IAAA;AACA,IAAA,GAAA,CAAA,wBAAA,IAAA,IAAA;AACA,IAAA;AACA;AACA,IAAA,OAAA,CAAA,IAAA;AACA,MAAA,uGAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,OAAA,GAAA,CAAA,wBAAA,KAAA,QAAA,EAAA;AACA,IAAA,YAAA,CAAA,iBAAA,GAAA,GAAA,CAAA,wBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,OAAA,GAAA,CAAA,wBAAA,KAAA,QAAA,EAAA;AACA,IAAA,YAAA,CAAA,eAAA,GAAA,GAAA,CAAA,wBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,YAAA,CAAA;AACA;;;;"}Copyright (c) 2022 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/replay",
  "version": "7.48.0",
  "description": "User replays for Sentry",
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "sideEffects": false,
  "repository": {
    "type": "git",
    "url": "git+https://github.com/getsentry/sentry-javascript.git"
  },
  "author": "Sentry",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/getsentry/sentry-javascript/issues"
  },
  "homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
  "devDependencies": {
    "@babel/core": "^7.17.5",
    "@sentry-internal/replay-worker": "7.48.0",
    "@sentry-internal/rrweb": "1.106.0",
    "@sentry-internal/rrweb-snapshot": "1.106.0",
    "jsdom-worker": "^0.2.1",
    "tslib": "^1.9.3"
  },
  "dependencies": {
    "@sentry/core": "7.48.0",
    "@sentry/types": "7.48.0",
    "@sentry/utils": "7.48.0"
  },
  "engines": {
    "node": ">=12"
  }
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Sentry Session Replay

[![npm version](https://img.shields.io/npm/v/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)
[![npm dm](https://img.shields.io/npm/dm/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)
[![npm dt](https://img.shields.io/npm/dt/@sentry/replay.svg)](https://www.npmjs.com/package/@sentry/replay)

## Pre-requisites

`@sentry/replay` requires Node 12+, and browsers newer than IE11.

## Installation

Replay can be imported from `@sentry/browser`, or a respective SDK package like `@sentry/react` or `@sentry/vue`.
You don't need to install anything in order to use Session Replay. The minimum version that includes Replay is 7.27.0.

For details on using Replay when using Sentry via the CDN bundles, see [CDN bundle](#loading-replay-as-a-cdn-bundle).

## Setup

To set up the integration, add the following to your Sentry initialization. Several options are supported and passable via the integration constructor.
See the [configuration section](#configuration) below for more details.

```javascript
import * as Sentry from '@sentry/browser';
// or e.g. import * as Sentry from '@sentry/react';

Sentry.init({
  dsn: '__DSN__',

  // This sets the sample rate to be 10%. You may want this to be 100% while
  // in development and sample at a lower rate in production
  replaysSessionSampleRate: 0.1,

  // If the entire session is not sampled, use the below sample rate to sample
  // sessions when an error occurs.
  replaysOnErrorSampleRate: 1.0,

  integrations: [
    new Sentry.Replay({
      // Additional SDK configuration goes in here, for example:
      maskAllText: true,
      blockAllMedia: true
      // See below for all available options
    })
  ],
  // ...
});
```

### Lazy loading Replay

Replay will start automatically when you add the integration.
If you do not want to start Replay immediately (e.g. if you want to lazy-load it),
you can also use `addIntegration` to load it later:

```js
import * as Sentry from "@sentry/react";
import { BrowserClient } from "@sentry/browser";

Sentry.init({
  // Do not load it initially
  integrations: []
});

// Sometime later
const { Replay } = await import('@sentry/browser');
const client = Sentry.getCurrentHub().getClient<BrowserClient>();

// Client can be undefined
client?.addIntegration(new Replay());
```

### Identifying Users

If you have only followed the above instructions to setup session replays, you will only see IP addresses in Sentry's UI. In order to associate a user identity to a session replay, use [`setUser`](https://docs.sentry.io/platforms/javascript/enriching-events/identify-user/).

```javascript
import * as Sentry from "@sentry/browser";

Sentry.setUser({ email: "jane.doe@example.com" });
```

### Stopping & re-starting replays

Replay recording only starts when it is included in the `integrations` array when calling `Sentry.init` or calling `addIntegration` from the a Sentry client instance. To stop recording you can call the `stop()`.

```js
import * as Sentry from "@sentry/react";
import { BrowserClient } from "@sentry/browser";

const replay = new Replay();

Sentry.init({
  integrations: [replay]
});

const client = Sentry.getCurrentHub().getClient<BrowserClient>();

// Add replay integration, will start recoring
client?.addIntegration(replay);

// Stop recording
replay.stop();
```

## Loading Replay as a CDN Bundle

As an alternative to the NPM package, you can use Replay as a CDN bundle.
Please refer to the [Session Replay installation guide](https://docs.sentry.io/platforms/javascript/session-replay/#install) for CDN bundle instructions.

<details>
<summary>Deprecated Replay integration bundle</summary>
Installing the replay integration as a secondary integration bundle to the SDK bundle was deprecated in favour of
complete CDN bundles that already contain the replay integration. No need to keep two bundles in sync anymore.
The `replay.(min.)js` bundle will be removed in v8 of the JS SDKs.

```html
<script
  src="https://browser.sentry-cdn.com/7.41.0/bundle.min.js"
  crossorigin="anonymous"
></script>
<script
  src="https://browser.sentry-cdn.com/7.41.0/replay.min.js"
  crossorigin="anonymous"
></script>
```
</details>

## Sessions

A session starts when the Session Replay SDK is first loaded and initialized. The session will continue until 5 minutes passes without any user interactions[^1] with the application *OR* until a maximum of 30 minutes have elapsed. Closing the browser tab will end the session immediately according to the rules for [SessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).

[^1]: An 'interaction' refers to either a mouse click or a browser navigation event.

### Accessing the Replay Session ID

You can get the ID of the currently running session via `replay.getReplayId()`.
This will return `undefined` if no session is ongoing.

### Replay Captures Only on Errors

Alternatively, rather than recording an entire session, you can capture a replay only when an error occurs. In this case, the integration will buffer up to one minute worth of events prior to the error being thrown. It will continue to record the session following the rules above regarding session life and activity. Read the [sampling](#Sampling) section for configuration options.

## Sampling

Sampling allows you to control how much of your website's traffic will result in a Session Replay. There are two sample rates you can adjust to get the replays more relevant to your interests:

- `replaysSessionSampleRate` - The sample rate for replays that begin recording immediately and last the entirety of the user's session.
- `replaysOnErrorSampleRate` - The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends.

Sampling occurs when the session is first started. `replaysSessionSampleRate` is evaluated first. If it is sampled, then the replay recording begins. Otherwise, `replaysOnErrorSampleRate` is evaluated and if it is sampled, the integration will begin buffering the replay and will only upload a replay to Sentry when an error occurs. The remainder of the replay will behave similarly to a whole-session replay.


## Configuration

### SDK Configuration

The following options can be configured on the root level of your browser-based Sentry SDK, in `init({})`:


| key                 | type    | default | description                                                                                                                                                                                                                     |
| ------------------- | ------- | ------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   |
| replaysSessionSampleRate   | number  | `0`   | The sample rate for replays that begin recording immediately and last the entirety of the user's session. 1.0 will collect all replays, 0 will collect no replays.                                           |
| replaysOnErrorSampleRate     | number  | `0`   |The sample rate for replays that are recorded when an error happens. This type of replay will record up to a minute of events prior to the error and continue recording until the session ends. 1.0 capturing all sessions with an error, and 0 capturing none.

### General Integration Configuration

The following options can be configured as options to the integration, in `new Replay({})`:

| key                 | type    | default | description                                                                                                                                                                                                                     |
| ------------------- | ------- | ------- | -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------   |
| stickySession       | boolean | `true`  | Keep track of the user across page loads. Note a single user using multiple tabs will result in multiple sessions. Closing a tab will result in the session being closed as well.                                               |


### Privacy Configuration

The following options can be configured as options to the integration, in `new Replay({})`:

| key              | type                     | default                                 | description                                                                                                                                                                                         |
| ---------------- | ------------------------ | -----------------------------------     | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| maskAllText      | boolean                  | `true`                                  | Mask _all_ text content. Will pass text content through `maskTextFn` before sending to server.                                                                                                       |
| maskAllInputs    | boolean                  | `true`                                  | Mask values of `<input>` elements. Passes input values through `maskInputFn` before sending to server.                                                                                               |
| blockAllMedia    | boolean                  | `true`                                  | Block _all_ media elements (`img, svg, video, object, picture, embed, map, audio`)
| maskTextFn       | (text: string) => string | `(text) => '*'.repeat(text.length)`     | Function to customize how text content is masked before sending to server. By default, masks text with `*`.                                                                                         |
| block            | Array<string>            | `.sentry-block, [data-sentry-block]`    | Redact any elements that match the DOM selectors. See [privacy](#blocking) section for an example.                                                                                                                                                     |
| unblock          | Array<string>            | `.sentry-unblock, [data-sentry-unblock]`| Do not redact any elements that match the DOM selectors. Useful when using `blockAllMedia`. See [privacy](#blocking) section for an example.                                                                                                                                                     |
| mask             | Array<string>            | `.sentry-mask, [data-sentry-mask]`      | Mask all elements that match the given DOM selectors. See [privacy](#masking) section for an example.                                                                                                                                                        |
| unmask           | Array<string>            | `.sentry-unmask, [data-sentry-unmask]`  | Unmask all elements that match the given DOM selectors. Useful when using `maskAllText`. See [privacy](#masking) section for an example.                                                                                                                                                        |
| ignore           | Array<string>            | `.sentry-ignore, [data-sentry-ignore]`  | Ignores all events on the matching input fields. See [privacy](#ignoring) section for an example.                                                                                                                                                     |

#### Deprecated options
In order to streamline our privacy options, the following have been deprecated in favor for the respective options above.

| deprecated key   | replaced by | description |
| ---------------- | ----------- | ----------- |
| maskInputOptions | mask        | Use CSS selectors in `mask` in order to mask all inputs of a certain type. For example, `input[type="address"]` |
| blockSelector    | block       | The selector(s) can be moved directly in the `block` array. |
| blockClass       | block       | Convert the class name to a CSS selector and add to `block` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
| maskClass        | mask        | Convert the class name to a CSS selector and add to `mask` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |
| maskSelector     | mask        | The selector(s) can be moved directly in the `mask` array. |
| ignoreClass      | ignore      | Convert the class name to a CSS selector and add to `ignore` array. For example, `first-name` becomes `.first-name`. Regexes can be moved as-is. |

## Privacy
There are several ways to deal with PII. By default, the integration will mask all text content with `*` and block all media elements (`img, svg, video, object, picture, embed, map, audio`). This can be disabled by setting `maskAllText` to `false`. It is also possible to add the following CSS classes to specific DOM elements to prevent recording its contents: `sentry-block`, `sentry-ignore`, and `sentry-mask`. The following sections will show examples of how content is handled by the differing methods.

### Masking
Masking replaces the text content with something else. The default masking behavior is to replace each character with a `*`. In this example the relevant html code is: `<table class="sentry-mask">...</table>`.
![Masking example](https://user-images.githubusercontent.com/79684/193118192-dee1d3d8-5813-47e8-b532-f9ee1c8714b3.png)

### Blocking
Blocking replaces the element with a placeholder that has the same dimensions. The recording will show an empty space where the content was. In this example the relevant html code is: `<table data-sentry-block>...</table>`.
![Blocking example](https://user-images.githubusercontent.com/79684/193118084-51a589fc-2160-476a-a8dc-b681eddb136c.png)

### Ignoring
Ignoring only applies to form inputs. Events will be ignored on the input element so that the replay does not show what occurs inside of the input. In the below example, notice how the results in the table below the input changes, but no text is visible in the input.

https://user-images.githubusercontent.com/79684/192815134-a6451c3f-d3cb-455f-a699-7c3fe04d0a2e.mov

## Error Linking

Currently, errors that happen on the page while a replay is running are linked to the Replay,
making it as easy as possible to jump between related issues/replays.
However, please note that it is _possible_ that the error count reported on the Replay Detail page
does not match the actual errors that have been captured.
The reason for that is that errors _can_ be lost, e.g. a network request fails, or similar.
This should not happen to often, but be aware that it is theoretically possible.

## Manually sending replay data

You can use `replay.flush()` to immediately send all currently captured replay data.
This can be combined with `replaysOnErrorSampleRate: 1`
in order to be able to send the last 60 seconds of replay data on-demand.
export declare const WINDOW: import("@sentry/utils").InternalGlobal & Window;
export declare const REPLAY_SESSION_KEY = "sentryReplaySession";
export declare const REPLAY_EVENT_NAME = "replay_event";
export declare const RECORDING_EVENT_NAME = "replay_recording";
export declare const UNABLE_TO_SEND_REPLAY = "Unable to send Replay";
export declare const SESSION_IDLE_DURATION = 300000;
export declare const MAX_SESSION_LIFE = 3600000;
/** Default flush delays */
export declare const DEFAULT_FLUSH_MIN_DELAY = 5000;
export declare const DEFAULT_FLUSH_MAX_DELAY = 5500;
export declare const ERROR_CHECKOUT_TIME = 60000;
export declare const RETRY_BASE_INTERVAL = 5000;
export declare const RETRY_MAX_COUNT = 3;
export declare const NETWORK_BODY_MAX_SIZE = 300000;
//# sourceMappingURL=constants.d.ts.map{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,iDAA2C,CAAC;AAE/D,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAG7D,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAG7C,eAAO,MAAM,gBAAgB,UAAY,CAAC;AAE1C,2BAA2B;AAC3B,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAG7C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,eAAe,IAAI,CAAC;AAGjC,eAAO,MAAM,qBAAqB,SAAU,CAAC"}import type { Event, TransportMakeRequestResponse } from '@sentry/types';
import type { ReplayContainer } from '../types';
declare type AfterSendEventCallback = (event: Event, sendResponse: TransportMakeRequestResponse | void) => void;
/**
 * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.
 */
export declare function handleAfterSendEvent(replay: ReplayContainer): AfterSendEventCallback;
export {};
//# sourceMappingURL=handleAfterSendEvent.d.ts.map{"version":3,"file":"handleAfterSendEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleAfterSendEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAa,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGpF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,aAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,4BAA4B,GAAG,IAAI,KAAK,IAAI,CAAC;AAExG;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,sBAAsB,CA2DpF"}import type { ReplayContainer } from '../types';
interface DomHandlerData {
    name: string;
    event: Node | {
        target: Node;
    };
}
export declare const handleDomListener: (replay: ReplayContainer) => (handlerData: DomHandlerData) => void;
export {};
//# sourceMappingURL=handleDom.d.ts.map{"version":3,"file":"handleDom.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleDom.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,IAAI,GAAG;QAAE,MAAM,EAAE,IAAI,CAAA;KAAE,CAAC;CAChC;AAED,eAAO,MAAM,iBAAiB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,CAAC,WAAW,EAAE,cAAc,KAAK,IAc3F,CAAC"}import type { HandlerDataFetch } from '@sentry/types';
import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/** only exported for tests */
export declare function handleFetch(handlerData: HandlerDataFetch): null | ReplayPerformanceEntry<NetworkRequestData>;
/**
 * Returns a listener to be added to `addInstrumentationHandler('fetch', listener)`.
 */
export declare function handleFetchSpanListener(replay: ReplayContainer): (handlerData: HandlerDataFetch) => void;
//# sourceMappingURL=handleFetch.d.ts.map{"version":3,"file":"handleFetch.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleFetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG5F,8BAA8B;AAC9B,wBAAgB,WAAW,CAAC,WAAW,EAAE,gBAAgB,GAAG,IAAI,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,CAoB5G;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,WAAW,EAAE,gBAAgB,KAAK,IAAI,CAUxG"}import type { Event, EventHint } from '@sentry/types';
import type { ReplayContainer } from '../types';
/**
 * Returns a listener to be added to `addGlobalEventProcessor(listener)`.
 */
export declare function handleGlobalEventListener(replay: ReplayContainer, includeAfterSendEventHandling?: boolean): (event: Event, hint: EventHint) => Event | null;
//# sourceMappingURL=handleGlobalEvent.d.ts.map{"version":3,"file":"handleGlobalEvent.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleGlobalEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,eAAe,EACvB,6BAA6B,UAAQ,GACpC,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,KAAK,GAAG,IAAI,CA4CjD"}import type { ReplayContainer } from '../types';
interface HistoryHandlerData {
    from: string;
    to: string;
}
/**
 * Returns a listener to be added to `addInstrumentationHandler('history', listener)`.
 */
export declare function handleHistorySpanListener(replay: ReplayContainer): (handlerData: HistoryHandlerData) => void;
export {};
//# sourceMappingURL=handleHistory.d.ts.map{"version":3,"file":"handleHistory.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,eAAe,EAA0B,MAAM,UAAU,CAAC;AAGrF,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAkBD;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,WAAW,EAAE,kBAAkB,KAAK,IAAI,CAsB5G"}import type { Breadcrumb, BreadcrumbHint, TextEncoderInternal } from '@sentry/types';
import type { ReplayContainer, ReplayNetworkOptions } from '../types';
interface ExtendedNetworkBreadcrumbsOptions extends ReplayNetworkOptions {
    replay: ReplayContainer;
    textEncoder: TextEncoderInternal;
}
/**
 * This method does two things:
 * - It enriches the regular XHR/fetch breadcrumbs with request/response size data
 * - It captures the XHR/fetch breadcrumbs to the replay
 *   (enriching it with further data that is _not_ added to the regular breadcrumbs)
 */
export declare function handleNetworkBreadcrumbs(replay: ReplayContainer): void;
/** just exported for tests */
export declare function beforeAddNetworkBreadcrumb(options: ExtendedNetworkBreadcrumbsOptions, breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
export {};
//# sourceMappingURL=handleNetworkBreadcrumbs.d.ts.map{"version":3,"file":"handleNetworkBreadcrumbs.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleNetworkBreadcrumbs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EAEd,mBAAmB,EAEpB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAa,eAAe,EAAE,oBAAoB,EAAW,MAAM,UAAU,CAAC;AAM1F,UAAU,iCAAkC,SAAQ,oBAAoB;IACtE,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAsBtE;AAED,8BAA8B;AAC9B,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iCAAiC,EAC1C,UAAU,EAAE,UAAU,EACtB,IAAI,CAAC,EAAE,cAAc,GACpB,IAAI,CA0BN"}import type { Breadcrumb, Scope } from '@sentry/types';
import type { ReplayContainer } from '../types';
export declare const handleScopeListener: (replay: ReplayContainer) => (scope: Scope) => void;
/**
 * An event handler to handle scope changes.
 */
export declare function handleScope(scope: Scope): Breadcrumb | null;
//# sourceMappingURL=handleScope.d.ts.map{"version":3,"file":"handleScope.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleScope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMhD,eAAO,MAAM,mBAAmB,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,CAAC,KAAK,EAAE,KAAK,KAAK,IAc9E,CAAC;AAEJ;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,GAAG,IAAI,CAwB3D"}import type { HandlerDataXhr } from '@sentry/types';
import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/** only exported for tests */
export declare function handleXhr(handlerData: HandlerDataXhr): ReplayPerformanceEntry<NetworkRequestData> | null;
/**
 * Returns a listener to be added to `addInstrumentationHandler('xhr', listener)`.
 */
export declare function handleXhrSpanListener(replay: ReplayContainer): (handlerData: HandlerDataXhr) => void;
//# sourceMappingURL=handleXhr.d.ts.map{"version":3,"file":"handleXhr.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/handleXhr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG5F,8BAA8B;AAC9B,wBAAgB,SAAS,CAAC,WAAW,EAAE,cAAc,GAAG,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CA0BxG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,WAAW,EAAE,cAAc,KAAK,IAAI,CAUpG"}import type { ReplayContainer } from '../types';
/**
 * Sets up a PerformanceObserver to listen to all performance entry types.
 */
export declare function setupPerformanceObserver(replay: ReplayContainer): PerformanceObserver;
//# sourceMappingURL=performanceObserver.d.ts.map{"version":3,"file":"performanceObserver.d.ts","sourceRoot":"","sources":["../../../../src/coreHandlers/performanceObserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,eAAe,EAAE,MAAM,UAAU,CAAC;AAGrE;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,mBAAmB,CAoCrF"}import type { Breadcrumb } from '@sentry/types';
import type { ReplayContainer } from '../../types';
/**
 * Add a breadcrumb event to replay.
 */
export declare function addBreadcrumbEvent(replay: ReplayContainer, breadcrumb: Breadcrumb): void;
//# sourceMappingURL=addBreadcrumbEvent.d.ts.map{"version":3,"file":"addBreadcrumbEvent.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addBreadcrumbEvent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CA0BxF"}import type { NetworkRequestData, ReplayContainer, ReplayPerformanceEntry } from '../../types';
/** Add a performance entry breadcrumb */
export declare function addNetworkBreadcrumb(replay: ReplayContainer, result: ReplayPerformanceEntry<NetworkRequestData> | null): void;
//# sourceMappingURL=addNetworkBreadcrumb.d.ts.map{"version":3,"file":"addNetworkBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/addNetworkBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI/F,yCAAyC;AACzC,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,GACxD,IAAI,CAoBN"}import type { Breadcrumb, FetchBreadcrumbData, TextEncoderInternal } from '@sentry/types';
import type { FetchHint, ReplayContainer, ReplayNetworkOptions } from '../../types';
/**
 * Capture a fetch breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
export declare function captureFetchBreadcrumbToReplay(breadcrumb: Breadcrumb & {
    data: FetchBreadcrumbData;
}, hint: FetchHint, options: ReplayNetworkOptions & {
    textEncoder: TextEncoderInternal;
    replay: ReplayContainer;
}): Promise<void>;
/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
export declare function enrichFetchBreadcrumb(breadcrumb: Breadcrumb & {
    data: FetchBreadcrumbData;
}, hint: FetchHint, options: {
    textEncoder: TextEncoderInternal;
}): void;
//# sourceMappingURL=fetchUtils.d.ts.map{"version":3,"file":"fetchUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/fetchUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAG1F,OAAO,KAAK,EACV,SAAS,EAET,eAAe,EACf,oBAAoB,EAGrB,MAAM,aAAa,CAAC;AAYrB;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,oBAAoB,GAAG;IAC9B,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,eAAe,CAAC;CACzB,GACA,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,EACtD,IAAI,EAAE,SAAS,EACf,OAAO,EAAE;IAAE,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAC5C,IAAI,CAcN"}/**
 * Inclusion list of attributes that we want to record from the DOM element
 */
export declare function getAttributesToRecord(attributes: Record<string, unknown>): Record<string, unknown>;
//# sourceMappingURL=getAttributesToRecord.d.ts.map{"version":3,"file":"getAttributesToRecord.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/getAttributesToRecord.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAelG"}import type { TextEncoderInternal } from '@sentry/types';
import type { NetworkBody, NetworkRequestData, ReplayNetworkRequestData, ReplayNetworkRequestOrResponse, ReplayPerformanceEntry } from '../../types';
/** Get the size of a body. */
export declare function getBodySize(body: RequestInit['body'], textEncoder: TextEncoder | TextEncoderInternal): number | undefined;
/** Convert a Content-Length header to number/undefined.  */
export declare function parseContentLengthHeader(header: string | null | undefined): number | undefined;
/** Get the string representation of a body. */
export declare function getBodyString(body: unknown): string | undefined;
/** Convert ReplayNetworkRequestData to a PerformanceEntry. */
export declare function makeNetworkReplayBreadcrumb(type: string, data: ReplayNetworkRequestData | null): ReplayPerformanceEntry<NetworkRequestData> | null;
/** Get either a JSON network body, or a text representation. */
export declare function getNetworkBody(bodyText: string | undefined): NetworkBody | undefined;
/** Build the request or response part of a replay network breadcrumb. */
export declare function buildNetworkRequestOrResponse(headers: Record<string, string>, bodySize: number | undefined, body: NetworkBody | undefined): ReplayNetworkRequestOrResponse | undefined;
/** Filter a set of headers */
export declare function getAllowedHeaders(headers: Record<string, string>, allowedHeaders: string[]): Record<string, string>;
//# sourceMappingURL=networkUtils.d.ts.map{"version":3,"file":"networkUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/networkUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAErB,8BAA8B;AAC9B,wBAAgB,WAAW,CACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EACzB,WAAW,EAAE,WAAW,GAAG,mBAAmB,GAC7C,MAAM,GAAG,SAAS,CAiCpB;AAED,4DAA4D;AAC5D,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAc/D;AAED,8DAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,wBAAwB,GAAG,IAAI,GACpC,sBAAsB,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAqBnD;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAYpF;AAED,yEAAyE;AACzE,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,8BAA8B,GAAG,SAAS,CAgC5C;AAED,8BAA8B;AAC9B,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASnH"}import type { Breadcrumb, TextEncoderInternal, XhrBreadcrumbData } from '@sentry/types';
import type { ReplayContainer, ReplayNetworkOptions, XhrHint } from '../../types';
/**
 * Capture an XHR breadcrumb to a replay.
 * This adds additional data (where approriate).
 */
export declare function captureXhrBreadcrumbToReplay(breadcrumb: Breadcrumb & {
    data: XhrBreadcrumbData;
}, hint: XhrHint, options: ReplayNetworkOptions & {
    replay: ReplayContainer;
}): Promise<void>;
/**
 * Enrich a breadcrumb with additional data.
 * This has to be sync & mutate the given breadcrumb,
 * as the breadcrumb is afterwards consumed by other handlers.
 */
export declare function enrichXhrBreadcrumb(breadcrumb: Breadcrumb & {
    data: XhrBreadcrumbData;
}, hint: XhrHint, options: {
    textEncoder: TextEncoderInternal;
}): void;
//# sourceMappingURL=xhrUtils.d.ts.map{"version":3,"file":"xhrUtils.d.ts","sourceRoot":"","sources":["../../../../../src/coreHandlers/util/xhrUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGxF,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAA4B,OAAO,EAAE,MAAM,aAAa,CAAC;AAY5G;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,oBAAoB,GAAG;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,GAC1D,OAAO,CAAC,IAAI,CAAC,CAUf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,EACpD,IAAI,EAAE,OAAO,EACb,OAAO,EAAE;IAAE,WAAW,EAAE,mBAAmB,CAAA;CAAE,GAC5C,IAAI,CAcN"}import type { AddEventResult, EventBuffer, RecordingEvent } from '../types';
/**
 * A basic event buffer that does not do any compression.
 * Used as fallback if the compression worker cannot be loaded or is disabled.
 */
export declare class EventBufferArray implements EventBuffer {
    /** All the events that are buffered to be sent. */
    events: RecordingEvent[];
    constructor();
    /** @inheritdoc */
    get hasEvents(): boolean;
    /** @inheritdoc */
    destroy(): void;
    /** @inheritdoc */
    addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
    /** @inheritdoc */
    finish(): Promise<string>;
}
//# sourceMappingURL=EventBufferArray.d.ts.map{"version":3,"file":"EventBufferArray.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE5E;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,mDAAmD;IAC5C,MAAM,EAAE,cAAc,EAAE,CAAC;;IAMhC,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAItB,kBAAkB;IACL,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAU3F,kBAAkB;IACX,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;CAUjC"}import type { ReplayRecordingData } from '@sentry/types';
import type { AddEventResult, EventBuffer, RecordingEvent } from '../types';
/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
export declare class EventBufferCompressionWorker implements EventBuffer {
    /** @inheritdoc */
    hasEvents: boolean;
    private _worker;
    constructor(worker: Worker);
    /**
     * Ensure the worker is ready (or not).
     * This will either resolve when the worker is ready, or reject if an error occured.
     */
    ensureReady(): Promise<void>;
    /**
     * Destroy the event buffer.
     */
    destroy(): void;
    /**
     * Add an event to the event buffer.
     *
     * Returns true if event was successfuly received and processed by worker.
     */
    addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
    /**
     * Finish the event buffer and return the compressed data.
     */
    finish(): Promise<ReplayRecordingData>;
    /**
     * Send the event to the worker.
     */
    private _sendEventToWorker;
    /**
     * Finish the request and return the compressed data from the worker.
     */
    private _finishRequest;
    /** Clear any pending events from the worker. */
    private _clear;
}
//# sourceMappingURL=EventBufferCompressionWorker.d.ts.map{"version":3,"file":"EventBufferCompressionWorker.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferCompressionWorker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG5E;;;GAGG;AACH,qBAAa,4BAA6B,YAAW,WAAW;IAC9D,kBAAkB;IACX,SAAS,EAAE,OAAO,CAAC;IAE1B,OAAO,CAAC,OAAO,CAAgB;gBAEZ,MAAM,EAAE,MAAM;IAKjC;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;OAEG;IACI,OAAO,IAAI,IAAI;IAItB;;;;OAIG;IACU,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAY3F;;OAEG;IACI,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAI7C;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;OAEG;YACW,cAAc;IAQ5B,gDAAgD;IAChD,OAAO,CAAC,MAAM;CAGf"}import type { ReplayRecordingData } from '@sentry/types';
import type { AddEventResult, EventBuffer, RecordingEvent } from '../types';
/**
 * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.
 * This can happen e.g. if the worker cannot be loaded.
 * Exported only for testing.
 */
export declare class EventBufferProxy implements EventBuffer {
    private _fallback;
    private _compression;
    private _used;
    private _ensureWorkerIsLoadedPromise;
    constructor(worker: Worker);
    /** @inheritDoc */
    get hasEvents(): boolean;
    /** @inheritDoc */
    destroy(): void;
    /**
     * Add an event to the event buffer.
     *
     * Returns true if event was successfully added.
     */
    addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
    /** @inheritDoc */
    finish(): Promise<ReplayRecordingData>;
    /** Ensure the worker has loaded. */
    ensureWorkerIsLoaded(): Promise<void>;
    /** Actually check if the worker has been loaded. */
    private _ensureWorkerIsLoaded;
    /** Switch the used buffer to the compression worker. */
    private _switchToCompressionWorker;
}
//# sourceMappingURL=EventBufferProxy.d.ts.map{"version":3,"file":"EventBufferProxy.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/EventBufferProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI5E;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,WAAW;IAClD,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,4BAA4B,CAAgB;gBAEjC,MAAM,EAAE,MAAM;IAQjC,kBAAkB;IAClB,IAAW,SAAS,IAAI,OAAO,CAE9B;IAED,kBAAkB;IACX,OAAO,IAAI,IAAI;IAKtB;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAIrF,kBAAkB;IACL,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAOnD,oCAAoC;IAC7B,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C,oDAAoD;YACtC,qBAAqB;IAcnC,wDAAwD;YAC1C,0BAA0B;CAmBzC"}import type { EventBuffer } from '../types';
interface CreateEventBufferParams {
    useCompression: boolean;
}
/**
 * Create an event buffer for replays.
 */
export declare function createEventBuffer({ useCompression }: CreateEventBufferParams): EventBuffer;
export {};
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,UAAU,uBAAuB;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,cAAc,EAAE,EAAE,uBAAuB,GAAG,WAAW,CAiB1F"}import type { WorkerRequest } from '../types';
/**
 * Event buffer that uses a web worker to compress events.
 * Exported only for testing.
 */
export declare class WorkerHandler {
    private _worker;
    private _id;
    private _ensureReadyPromise?;
    constructor(worker: Worker);
    /**
     * Ensure the worker is ready (or not).
     * This will either resolve when the worker is ready, or reject if an error occured.
     */
    ensureReady(): Promise<void>;
    /**
     * Destroy the worker.
     */
    destroy(): void;
    /**
     * Post message to worker and wait for response before resolving promise.
     */
    postMessage<T>(method: WorkerRequest['method'], arg?: WorkerRequest['arg']): Promise<T>;
    /** Get the current ID and increment it for the next call. */
    private _getAndIncrementId;
}
//# sourceMappingURL=WorkerHandler.d.ts.map{"version":3,"file":"WorkerHandler.d.ts","sourceRoot":"","sources":["../../../../src/eventBuffer/WorkerHandler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,UAAU,CAAC;AAE9D;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,mBAAmB,CAAC,CAAgB;gBAEzB,MAAM,EAAE,MAAM;IAKjC;;;OAGG;IACI,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BnC;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB;;OAEG;IACI,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAqC9F,6DAA6D;IAC7D,OAAO,CAAC,kBAAkB;CAG3B"}export { Replay } from './integration';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC"}import type { Integration } from '@sentry/types';
import type { ReplayConfiguration } from './types';
/**
 * The main replay integration class, to be passed to `init({  integrations: [] })`.
 */
export declare class Replay implements Integration {
    /**
     * @inheritDoc
     */
    static id: string;
    /**
     * @inheritDoc
     */
    name: string;
    /**
     * Options to pass to `rrweb.record()`
     */
    private readonly _recordingOptions;
    /**
     * Initial options passed to the replay integration, merged with default values.
     * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they
     * can only be finally set when setupOnce() is called.
     *
     * @private
     */
    private readonly _initialOptions;
    private _replay?;
    constructor({ flushMinDelay, flushMaxDelay, stickySession, useCompression, _experiments, sessionSampleRate, errorSampleRate, maskAllText, maskAllInputs, blockAllMedia, mask, unmask, block, unblock, ignore, maskFn, blockClass, blockSelector, maskInputOptions, maskTextClass, maskTextSelector, ignoreClass, }?: ReplayConfiguration);
    /** If replay has already been initialized */
    protected get _isInitialized(): boolean;
    /** Update _isInitialized */
    protected set _isInitialized(value: boolean);
    /**
     * We previously used to create a transaction in `setupOnce` and it would
     * potentially create a transaction before some native SDK integrations have run
     * and applied their own global event processor. An example is:
     * https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts
     *
     * So we call `replay.setup` in next event loop as a workaround to wait for other
     * global event processors to finish. This is no longer needed, but keeping it
     * here to avoid any future issues.
     */
    setupOnce(): void;
    /**
     * Initializes the plugin.
     *
     * Creates or loads a session, attaches listeners to varying events (DOM,
     * PerformanceObserver, Recording, Sentry SDK, etc)
     */
    start(): void;
    /**
     * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
     * does not support a teardown
     */
    stop(): void;
    /**
     * Immediately send all pending events.
     */
    flush(): Promise<void> | void;
    /**
     * Get the current session ID.
     */
    getReplayId(): string | undefined;
    /** Setup the integration. */
    private _setup;
}
//# sourceMappingURL=integration.d.ts.map{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../../src/integration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8B,WAAW,EAAE,MAAM,eAAe,CAAC;AAK7E,OAAO,KAAK,EAAoB,mBAAmB,EAAuB,MAAM,SAAS,CAAC;AAY1F;;GAEG;AACH,qBAAa,MAAO,YAAW,WAAW;IACxC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAY;IAEpC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAa;IAEhC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA6B;IAE7D,OAAO,CAAC,OAAO,CAAC,CAAkB;gBAEf,EACjB,aAAuC,EACvC,aAAuC,EACvC,aAAoB,EACpB,cAAqB,EACrB,YAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,WAAkB,EAClB,aAAoB,EACpB,aAAoB,EAEpB,IAAS,EACT,MAAW,EACX,KAAU,EACV,OAAY,EACZ,MAAW,EACX,MAAM,EAGN,UAAU,EAEV,aAAa,EAEb,gBAAgB,EAEhB,aAAa,EAEb,gBAAgB,EAEhB,WAAW,GACZ,GAAE,mBAAwB;IAiF3B,6CAA6C;IAC7C,SAAS,KAAK,cAAc,IAAI,OAAO,CAEtC;IAED,4BAA4B;IAC5B,SAAS,KAAK,cAAc,CAAC,KAAK,EAAE,OAAO,EAE1C;IAED;;;;;;;;;OASG;IACI,SAAS,IAAI,IAAI;IAWxB;;;;;OAKG;IACI,KAAK,IAAI,IAAI;IAQpB;;;OAGG;IACI,IAAI,IAAI,IAAI;IAQnB;;OAEG;IACI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAQpC;;OAEG;IACI,WAAW,IAAI,MAAM,GAAG,SAAS;IAQxC,6BAA6B;IAC7B,OAAO,CAAC,MAAM;CASf"}import type { ReplayRecordingMode } from '@sentry/types';
import type { AddUpdateCallback, AllPerformanceEntry, EventBuffer, InternalEventContext, RecordingOptions, ReplayContainer as ReplayContainerInterface, ReplayExperimentalPluginOptions, ReplayPluginOptions, Session, Timeouts } from './types';
/**
 * The main replay container class, which holds all the state and methods for recording and sending replays.
 */
export declare class ReplayContainer implements ReplayContainerInterface {
    eventBuffer: EventBuffer | null;
    /**
     * List of PerformanceEntry from PerformanceObserver
     */
    performanceEvents: AllPerformanceEntry[];
    session: Session | undefined;
    /**
     * Recording can happen in one of two modes:
     * * session: Record the whole session, sending it continuously
     * * error: Always keep the last 60s of recording, and when an error occurs, send it immediately
     */
    recordingMode: ReplayRecordingMode;
    /**
     * These are here so we can overwrite them in tests etc.
     * @hidden
     */
    readonly timeouts: Timeouts;
    private readonly _experimentalOptions;
    /**
     * Options to pass to `rrweb.record()`
     */
    private readonly _recordingOptions;
    private readonly _options;
    private _performanceObserver;
    private _debouncedFlush;
    private _flushLock;
    /**
     * Timestamp of the last user activity. This lives across sessions.
     */
    private _lastActivity;
    /**
     * Is the integration currently active?
     */
    private _isEnabled;
    /**
     * Paused is a state where:
     * - DOM Recording is not listening at all
     * - Nothing will be added to event buffer (e.g. core SDK events)
     */
    private _isPaused;
    /**
     * Have we attached listeners to the core SDK?
     * Note we have to track this as there is no way to remove instrumentation handlers.
     */
    private _hasInitializedCoreListeners;
    /**
     * Function to stop recording
     */
    private _stopRecording;
    private _context;
    constructor({ options, recordingOptions, }: {
        options: ReplayPluginOptions;
        recordingOptions: RecordingOptions;
    });
    /** Get the event context. */
    getContext(): InternalEventContext;
    /** If recording is currently enabled. */
    isEnabled(): boolean;
    /** If recording is currently paused. */
    isPaused(): boolean;
    /** Get the replay integration options. */
    getOptions(): ReplayPluginOptions;
    /**
     * Get the experimental options.
     * THIS IS INTERNAL AND SUBJECT TO CHANGE!
     * @hidden
     */
    getExperimentalOptions(): ReplayExperimentalPluginOptions;
    /**
     * Initializes the plugin.
     *
     * Creates or loads a session, attaches listeners to varying events (DOM,
     * _performanceObserver, Recording, Sentry SDK, etc)
     */
    start(): void;
    /**
     * Start recording.
     *
     * Note that this will cause a new DOM checkout
     */
    startRecording(): void;
    /**
     * Stops the recording, if it was running.
     * Returns true if it was stopped, else false.
     */
    stopRecording(): boolean;
    /**
     * Currently, this needs to be manually called (e.g. for tests). Sentry SDK
     * does not support a teardown
     */
    stop(reason?: string): void;
    /**
     * Pause some replay functionality. See comments for `_isPaused`.
     * This differs from stop as this only stops DOM recording, it is
     * not as thorough of a shutdown as `stop()`.
     */
    pause(): void;
    /**
     * Resumes recording, see notes for `pause().
     *
     * Note that calling `startRecording()` here will cause a
     * new DOM checkout.`
     */
    resume(): void;
    /**
     * We want to batch uploads of replay events. Save events only if
     * `<flushMinDelay>` milliseconds have elapsed since the last event
     * *OR* if `<flushMaxDelay>` milliseconds have elapsed.
     *
     * Accepts a callback to perform side-effects and returns true to stop batch
     * processing and hand back control to caller.
     */
    addUpdate(cb: AddUpdateCallback): void;
    /**
     * Updates the user activity timestamp and resumes recording. This should be
     * called in an event handler for a user action that we consider as the user
     * being "active" (e.g. a mouse click).
     */
    triggerUserActivity(): void;
    /**
     *
     * Always flush via `_debouncedFlush` so that we do not have flushes triggered
     * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be
     * cases of mulitple flushes happening closely together.
     */
    flushImmediate(): Promise<void>;
    /** Get the current sesion (=replay) ID */
    getSessionId(): string | undefined;
    /**
     * Checks if recording should be stopped due to user inactivity. Otherwise
     * check if session is expired and create a new session if so. Triggers a new
     * full snapshot on new session.
     *
     * Returns true if session is not expired, false otherwise.
     * @hidden
     */
    checkAndHandleExpiredSession(): boolean | void;
    /**
     * Capture some initial state that can change throughout the lifespan of the
     * replay. This is required because otherwise they would be captured at the
     * first flush.
     */
    setInitialState(): void;
    /** A wrapper to conditionally capture exceptions. */
    private _handleException;
    /**
     * Loads (or refreshes) the current session.
     * Returns false if session is not recorded.
     */
    private _loadAndCheckSession;
    /**
     * Adds listeners to record events for the replay
     */
    private _addListeners;
    /**
     * Cleans up listeners that were created in `_addListeners`
     */
    private _removeListeners;
    /**
     * Handle when visibility of the page content changes. Opening a new tab will
     * cause the state to change to hidden because of content of current page will
     * be hidden. Likewise, moving a different window to cover the contents of the
     * page will also trigger a change to a hidden state.
     */
    private _handleVisibilityChange;
    /**
     * Handle when page is blurred
     */
    private _handleWindowBlur;
    /**
     * Handle when page is focused
     */
    private _handleWindowFocus;
    /**
     * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
     */
    private _doChangeToBackgroundTasks;
    /**
     * Tasks to run when we consider a page to be visible (via focus and/or visibility)
     */
    private _doChangeToForegroundTasks;
    /**
     * Trigger rrweb to take a full snapshot which will cause this plugin to
     * create a new Replay event.
     */
    private _triggerFullSnapshot;
    /**
     * Update user activity (across session lifespans)
     */
    private _updateUserActivity;
    /**
     * Updates the session's last activity timestamp
     */
    private _updateSessionActivity;
    /**
     * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
     */
    private _createCustomBreadcrumb;
    /**
     * Observed performance events are added to `this.performanceEvents`. These
     * are included in the replay event before it is finished and sent to Sentry.
     */
    private _addPerformanceEntries;
    /**
     * Only flush if `this.recordingMode === 'session'`
     */
    private _conditionalFlush;
    /**
     * Clear _context
     */
    private _clearContext;
    /**
     * Return and clear _context
     */
    private _popEventContext;
    /**
     * Flushes replay event buffer to Sentry.
     *
     * Performance events are only added right before flushing - this is
     * due to the buffered performance observer events.
     *
     * Should never be called directly, only by `flush`
     */
    private _runFlush;
    /**
     * Flush recording data to Sentry. Creates a lock so that only a single flush
     * can be active at a time. Do not call this directly.
     */
    private _flush;
    /** Save the session, if it is sticky */
    private _maybeSaveSession;
    /** Handler for rrweb.record.onMutation */
    private _onMutationHandler;
}
//# sourceMappingURL=replay.d.ts.map{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/replay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAQrE,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EAEpB,gBAAgB,EAChB,eAAe,IAAI,wBAAwB,EAC3C,+BAA+B,EAC/B,mBAAmB,EACnB,OAAO,EACP,QAAQ,EACT,MAAM,SAAS,CAAC;AAajB;;GAEG;AACH,qBAAa,eAAgB,YAAW,wBAAwB;IACvD,WAAW,EAAE,WAAW,GAAG,IAAI,CAAQ;IAE9C;;OAEG;IACI,iBAAiB,EAAE,mBAAmB,EAAE,CAAM;IAE9C,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAEpC;;;;OAIG;IACI,aAAa,EAAE,mBAAmB,CAAa;IAEtD;;;OAGG;IACH,SAAgB,QAAQ,EAAE,QAAQ,CAGvB;IAEX,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAkC;IAEvE;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAE/C,OAAO,CAAC,oBAAoB,CAAoC;IAEhE,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,UAAU,CAAiC;IAEnD;;OAEG;IACH,OAAO,CAAC,aAAa,CAAsB;IAE3C;;OAEG;IACH,OAAO,CAAC,UAAU,CAAkB;IAEpC;;;;OAIG;IACH,OAAO,CAAC,SAAS,CAAkB;IAEnC;;;OAGG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BAAuB,CAM7B;IAEF;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAQvB;IAEF;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAQxB;IAEF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAiBlC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAoBlC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAS5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAI3B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAa/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;OAEG;IACH,OAAO,CAAC,aAAa;IAQrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAkBxB;;;;;;;OAOG;YACW,SAAS;IA0DvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAyCZ;IAEF,wCAAwC;IACxC,OAAO,CAAC,iBAAiB;IAMzB,0CAA0C;IAC1C,OAAO,CAAC,kBAAkB,CA4BxB;CACH"}import type { Session, SessionOptions } from '../types';
/**
 * Create a new session, which in its current implementation is a Sentry event
 * that all replays will be saved to as attachments. Currently, we only expect
 * one of these Sentry events per "replay session".
 */
export declare function createSession({ sessionSampleRate, errorSampleRate, stickySession }: SessionOptions): Session;
//# sourceMappingURL=createSession.d.ts.map{"version":3,"file":"createSession.d.ts","sourceRoot":"","sources":["../../../../src/session/createSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAIxD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAqB,EAAE,EAAE,cAAc,GAAG,OAAO,CAapH"}import type { Session } from '../types';
/**
 * Fetches a session from storage
 */
export declare function fetchSession(): Session | null;
//# sourceMappingURL=fetchSession.d.ts.map{"version":3,"file":"fetchSession.d.ts","sourceRoot":"","sources":["../../../../src/session/fetchSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;GAEG;AACH,wBAAgB,YAAY,IAAI,OAAO,GAAG,IAAI,CAqB7C"}import type { Session, SessionOptions, Timeouts } from '../types';
interface GetSessionParams extends SessionOptions {
    timeouts: Timeouts;
    /**
     * The current session (e.g. if stickySession is off)
     */
    currentSession?: Session;
}
/**
 * Get or create a session
 */
export declare function getSession({ timeouts, currentSession, stickySession, sessionSampleRate, errorSampleRate, }: GetSessionParams): {
    type: 'new' | 'saved';
    session: Session;
};
export {};
//# sourceMappingURL=getSession.d.ts.map{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../src/session/getSession.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAMlE,UAAU,gBAAiB,SAAQ,cAAc;IAC/C,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,eAAe,GAChB,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CA6BhE"}export * from './createSession';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}import type { Session } from '../types';
/**
 * Save a session to session storage.
 */
export declare function saveSession(session: Session): void;
//# sourceMappingURL=saveSession.d.ts.map{"version":3,"file":"saveSession.d.ts","sourceRoot":"","sources":["../../../../src/session/saveSession.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAExC;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAWlD"}import type { Sampled, Session } from '../types';
/**
 * Get a session with defaults & applied sampling.
 */
export declare function makeSession(session: Partial<Session> & {
    sampled: Sampled;
}): Session;
/**
 * Get the sampled status for a session based on sample rates & current sampled status.
 */
export declare function getSessionSampleType(sessionSampleRate: number, errorSampleRate: number): Sampled;
//# sourceMappingURL=Session.d.ts.map{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../../../../src/session/Session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGjD;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAgBrF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAEhG"}import type { FetchBreadcrumbHint, HandlerDataFetch, ReplayRecordingData, ReplayRecordingMode, SentryWrappedXMLHttpRequest, XhrBreadcrumbHint } from '@sentry/types';
import type { eventWithTime, recordOptions } from './types/rrweb';
export declare type RecordingEvent = eventWithTime;
export declare type RecordingOptions = recordOptions;
export declare type AllPerformanceEntry = PerformancePaintTiming | PerformanceResourceTiming | PerformanceNavigationTiming;
export interface SendReplayData {
    recordingData: ReplayRecordingData;
    replayId: string;
    segmentId: number;
    eventContext: PopEventContext;
    timestamp: number;
    session: Session;
    options: ReplayPluginOptions;
}
export interface Timeouts {
    sessionIdle: number;
    maxSessionLife: number;
}
/**
 * The request payload to worker
 */
export interface WorkerRequest {
    id: number;
    method: 'clear' | 'addEvent' | 'finish';
    arg?: string;
}
export declare type PerformancePaintTiming = PerformanceEntry;
export declare type PerformanceNavigationTiming = PerformanceEntry & PerformanceResourceTiming & {
    type: string;
    transferSize: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately before the user agent
     * sets the document's readyState to "interactive".
     */
    domInteractive: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately before the current
     * document's DOMContentLoaded event handler starts.
     */
    domContentLoadedEventStart: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately after the current
     * document's DOMContentLoaded event handler completes.
     */
    domContentLoadedEventEnd: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately before the current
     * document's load event handler starts.
     */
    loadEventStart: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately after the current
     * document's load event handler completes.
     */
    loadEventEnd: number;
    /**
     * A DOMHighResTimeStamp representing the time immediately before the user agent
     * sets the document's readyState to "complete".
     */
    domComplete: number;
    /**
     * A number representing the number of redirects since the last non-redirect
     * navigation in the current browsing context.
     */
    redirectCount: number;
};
export declare type ExperimentalPerformanceResourceTiming = PerformanceResourceTiming & {
    responseStatus?: number;
};
export declare type PaintData = undefined;
/**
 * See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
 *
 * Note `navigation.push` will not have any data
 */
export declare type NavigationData = Partial<Pick<PerformanceNavigationTiming, 'decodedBodySize' | 'encodedBodySize' | 'duration' | 'domInteractive' | 'domContentLoadedEventEnd' | 'domContentLoadedEventStart' | 'loadEventStart' | 'loadEventEnd' | 'domComplete' | 'redirectCount'>> & {
    /**
     * Transfer size of resource
     */
    size?: number;
};
export declare type ResourceData = Pick<PerformanceResourceTiming, 'decodedBodySize' | 'encodedBodySize'> & {
    /**
     * Transfer size of resource
     */
    size: number;
    /**
     * HTTP status code. Note this is experimental and not available on all browsers.
     */
    statusCode?: number;
};
export interface LargestContentfulPaintData {
    /**
     * Render time (in ms) of the LCP
     */
    value: number;
    size: number;
    /**
     * The recording id of the LCP node. -1 if not found
     */
    nodeId?: number;
}
/**
 * Entries that come from window.performance
 */
export declare type AllPerformanceEntryData = PaintData | NavigationData | ResourceData | LargestContentfulPaintData;
export interface MemoryData {
    memory: {
        jsHeapSizeLimit: number;
        totalJSHeapSize: number;
        usedJSHeapSize: number;
    };
}
export interface NetworkRequestData {
    method?: string;
    statusCode?: number;
    requestBodySize?: number;
    responseBodySize?: number;
}
export interface HistoryData {
    previous: string;
}
export declare type AllEntryData = AllPerformanceEntryData | MemoryData | NetworkRequestData | HistoryData;
/**
 * The response from the worker
 */
export interface WorkerResponse {
    id: number;
    method: string;
    success: boolean;
    response: unknown;
}
export declare type AddEventResult = void;
export interface SampleRates {
    /**
     * The sample rate for session-long replays. 1.0 will record all sessions and
     * 0 will record none.
     */
    sessionSampleRate: number;
    /**
     * The sample rate for sessions that has had an error occur. This is
     * independent of `sessionSampleRate`.
     */
    errorSampleRate: number;
}
/**
 * Session options that are configurable by the integration configuration
 */
export interface SessionOptions extends SampleRates {
    /**
     * If false, will create a new session per pageload. Otherwise, saves session
     * to Session Storage.
     */
    stickySession: boolean;
}
export interface ReplayPluginOptions extends SessionOptions {
    /**
     * The amount of time to wait before sending a replay
     */
    flushMinDelay: number;
    /**
     * The max amount of time to wait before sending a replay
     */
    flushMaxDelay: number;
    /**
     * Attempt to use compression when web workers are available
     *
     * (default is true)
     */
    useCompression: boolean;
    /**
     * Block all media (e.g. images, svg, video) in recordings.
     */
    blockAllMedia: boolean;
    /**
     * _experiments allows users to enable experimental or internal features.
     * We don't consider such features as part of the public API and hence we don't guarantee semver for them.
     * Experimental features can be added, changed or removed at any time.
     *
     * Default: undefined
     */
    _experiments: Partial<{
        captureExceptions: boolean;
        traceInternals: boolean;
        mutationLimit: number;
        mutationBreadcrumbLimit: number;
        captureNetworkBodies: boolean;
        captureRequestHeaders: string[];
        captureResponseHeaders: string[];
    }>;
}
export interface ReplayNetworkOptions {
    /**
     * If request & response bodies should be captured.
     */
    captureBodies: boolean;
    /**
     * Capture the following request headers, in addition to the default ones.
     */
    requestHeaders: string[];
    /**
     * Capture the following response headers, in addition to the default ones.
     */
    responseHeaders: string[];
}
export interface ReplayExperimentalPluginOptions {
    network: ReplayNetworkOptions;
}
export interface ReplayIntegrationPrivacyOptions {
    /**
     * Mask text content for elements that match the CSS selectors in the list.
     */
    mask?: string[];
    /**
     * Unmask text content for elements that match the CSS selectors in the list.
     */
    unmask?: string[];
    /**
     * Block elements that match the CSS selectors in the list. Blocking replaces
     * the element with an empty placeholder with the same dimensions.
     */
    block?: string[];
    /**
     * Unblock elements that match the CSS selectors in the list. This is useful when using `blockAllMedia`.
     */
    unblock?: string[];
    /**
     * Ignore input events for elements that match the CSS selectors in the list.
     */
    ignore?: string[];
    /**
     * A callback function to customize how your text is masked.
     */
    maskFn?: Pick<RecordingOptions, 'maskTextFn'>;
}
declare type OptionalReplayPluginOptions = Partial<ReplayPluginOptions>;
export interface DeprecatedPrivacyOptions {
    /**
     * @deprecated Use `block` which accepts an array of CSS selectors
     */
    blockSelector?: RecordingOptions['blockSelector'];
    /**
     * @deprecated Use `block` which accepts an array of CSS selectors
     */
    blockClass?: RecordingOptions['blockClass'];
    /**
     * @deprecated Use `ignore` which accepts an array of CSS selectors
     */
    ignoreClass?: RecordingOptions['ignoreClass'];
    /**
     * @deprecated  Use `mask` which accepts an array of CSS selectors
     */
    maskInputOptions?: RecordingOptions['maskInputOptions'];
    /**
     * @deprecated Use `mask` which accepts an array of CSS selectors
     */
    maskTextClass?: RecordingOptions['maskTextClass'];
    /**
     * @deprecated Use `mask` which accepts an array of CSS selectors
     */
    maskTextSelector?: RecordingOptions['maskTextSelector'];
}
export interface ReplayConfiguration extends ReplayIntegrationPrivacyOptions, OptionalReplayPluginOptions, DeprecatedPrivacyOptions, Pick<RecordingOptions, 'maskAllText' | 'maskAllInputs'> {
}
interface CommonEventContext {
    /**
     * The initial URL of the session
     */
    initialUrl: string;
    /**
     * The initial starting timestamp of the session
     */
    initialTimestamp: number;
    /**
     * Ordered list of URLs that have been visited during a replay segment
     */
    urls: string[];
}
export interface PopEventContext extends CommonEventContext {
    /**
     * List of Sentry error ids that have occurred during a replay segment
     */
    errorIds: Array<string>;
    /**
     * List of Sentry trace ids that have occurred during a replay segment
     */
    traceIds: Array<string>;
}
/**
 * Additional context that will be sent w/ `replay_event`
 */
export interface InternalEventContext extends CommonEventContext {
    /**
     * Set of Sentry error ids that have occurred during a replay segment
     */
    errorIds: Set<string>;
    /**
     * Set of Sentry trace ids that have occurred during a replay segment
     */
    traceIds: Set<string>;
    /**
     * The timestamp of the earliest event that has been added to event buffer. This can happen due to the Performance Observer which buffers events.
     */
    earliestEvent: number | null;
}
export declare type Sampled = false | 'session' | 'error';
export interface Session {
    id: string;
    /**
     * Start time of current session
     */
    started: number;
    /**
     * Last known activity of the session
     */
    lastActivity: number;
    /**
     * Segment ID for replay events
     */
    segmentId: number;
    /**
     * The ID of the previous session.
     * If this is empty, there was no previous session.
     */
    previousSessionId?: string;
    /**
     * Is the session sampled? `false` if not sampled, otherwise, `session` or `error`
     */
    sampled: Sampled;
}
export interface EventBuffer {
    /**
     * If any events have been added to the buffer.
     */
    readonly hasEvents: boolean;
    /**
     * Destroy the event buffer.
     */
    destroy(): void;
    /**
     * Add an event to the event buffer.
     * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
     *
     * Returns a promise that resolves if the event was successfully added, else rejects.
     */
    addEvent(event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult>;
    /**
     * Clears and returns the contents of the buffer.
     */
    finish(): Promise<ReplayRecordingData>;
}
export declare type AddUpdateCallback = () => boolean | void;
export interface ReplayContainer {
    eventBuffer: EventBuffer | null;
    performanceEvents: AllPerformanceEntry[];
    session: Session | undefined;
    recordingMode: ReplayRecordingMode;
    timeouts: {
        sessionIdle: number;
        maxSessionLife: number;
    };
    isEnabled(): boolean;
    isPaused(): boolean;
    getContext(): InternalEventContext;
    start(): void;
    stop(reason?: string): void;
    pause(): void;
    resume(): void;
    startRecording(): void;
    stopRecording(): boolean;
    flushImmediate(): void;
    triggerUserActivity(): void;
    addUpdate(cb: AddUpdateCallback): void;
    getOptions(): ReplayPluginOptions;
    getExperimentalOptions(): ReplayExperimentalPluginOptions;
    getSessionId(): string | undefined;
    checkAndHandleExpiredSession(): boolean | void;
    setInitialState(): void;
}
export interface ReplayPerformanceEntry<T> {
    /**
     * One of these types https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
     */
    type: string;
    /**
     * A more specific description of the performance entry
     */
    name: string;
    /**
     * The start timestamp in seconds
     */
    start: number;
    /**
     * The end timestamp in seconds
     */
    end: number;
    /**
     * Additional unstructured data to be included
     */
    data: T;
}
declare type RequestBody = null | Blob | BufferSource | FormData | URLSearchParams | string;
export declare type XhrHint = XhrBreadcrumbHint & {
    xhr: XMLHttpRequest & SentryWrappedXMLHttpRequest;
    input?: RequestBody;
};
export declare type FetchHint = FetchBreadcrumbHint & {
    input: HandlerDataFetch['args'];
    response: Response;
};
export declare type NetworkBody = Record<string, unknown> | string;
declare type NetworkMetaError = 'MAX_BODY_SIZE_EXCEEDED';
interface NetworkMeta {
    errors?: NetworkMetaError[];
}
export interface ReplayNetworkRequestOrResponse {
    size?: number;
    body?: NetworkBody;
    headers: Record<string, string>;
    _meta?: NetworkMeta;
}
export declare type ReplayNetworkRequestData = {
    startTimestamp: number;
    endTimestamp: number;
    url: string;
    method?: string;
    statusCode: number;
    request?: ReplayNetworkRequestOrResponse;
    response?: ReplayNetworkRequestOrResponse;
};
export {};
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAElE,oBAAY,cAAc,GAAG,aAAa,CAAC;AAC3C,oBAAY,gBAAgB,GAAG,aAAa,CAAC;AAE7C,oBAAY,mBAAmB,GAAG,sBAAsB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C,GAAG,MAAM,CAAC;AAE3D,aAAK,gBAAgB,GAAG,wBAAwB,CAAC;AAEjD,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,8BAA8B;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,oBAAY,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,8BAA8B,CAAC;IACzC,QAAQ,CAAC,EAAE,8BAA8B,CAAC;CAC3C,CAAC"}declare type blockClass = string | RegExp;
declare type maskTextClass = string | RegExp;
declare enum EventType {
    DomContentLoaded = 0,
    Load = 1,
    FullSnapshot = 2,
    IncrementalSnapshot = 3,
    Meta = 4,
    Custom = 5,
    Plugin = 6
}
/**
 * This is a partial copy of rrweb's eventWithTime type which only contains the properties
 * we specifcally need in the SDK.
 */
export declare type eventWithTime = {
    type: EventType;
    data: unknown;
    timestamp: number;
    delay?: number;
};
/**
 * This is a partial copy of rrweb's recording options which only contains the properties
 * we specifically us in the SDK. Users can specify additional properties, hence we add the
 * Record<string, unknown> union type.
 */
export declare type recordOptions = {
    maskAllText?: boolean;
    maskAllInputs?: boolean;
    blockClass?: blockClass;
    ignoreClass?: string;
    maskTextClass?: maskTextClass;
    maskTextSelector?: string;
    blockSelector?: string;
    maskInputOptions?: Record<string, boolean>;
} & Record<string, unknown>;
export {};
//# sourceMappingURL=rrweb.d.ts.map{"version":3,"file":"rrweb.d.ts","sourceRoot":"","sources":["../../../../src/types/rrweb.ts"],"names":[],"mappings":"AAEA,aAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAClC,aAAK,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAErC,aAAK,SAAS;IACZ,gBAAgB,IAAI;IACpB,IAAI,IAAI;IACR,YAAY,IAAI;IAChB,mBAAmB,IAAI;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;CACX;AAED;;;GAGG;AACH,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,oBAAY,aAAa,GAAG;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}import type { AddEventResult, RecordingEvent, ReplayContainer } from '../types';
/**
 * Add an event to the event buffer.
 * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.
 */
export declare function addEvent(replay: ReplayContainer, event: RecordingEvent, isCheckout?: boolean): Promise<AddEventResult | null>;
//# sourceMappingURL=addEvent.d.ts.map{"version":3,"file":"addEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/addEvent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhF;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,cAAc,EACrB,UAAU,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CA2ChC"}import type { ReplayContainer } from '../types';
/**
 * Add global listeners that cannot be removed.
 */
export declare function addGlobalListeners(replay: ReplayContainer): void;
//# sourceMappingURL=addGlobalListeners.d.ts.map{"version":3,"file":"addGlobalListeners.d.ts","sourceRoot":"","sources":["../../../../src/util/addGlobalListeners.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CA0BhE"}import type { AddEventResult, ReplayContainer } from '../types';
/**
 * Create a "span" for the total amount of memory being used by JS objects
 * (including v8 internal objects).
 */
export declare function addMemoryEntry(replay: ReplayContainer): Promise<Array<AddEventResult | null>>;
//# sourceMappingURL=addMemoryEntry.d.ts.map{"version":3,"file":"addMemoryEntry.d.ts","sourceRoot":"","sources":["../../../../src/util/addMemoryEntry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAc,eAAe,EAA0B,MAAM,UAAU,CAAC;AAWpG;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,CAanG"}import type { Breadcrumb } from '@sentry/types';
declare type RequiredProperties = 'category' | 'message';
/**
 * Create a breadcrumb for a replay.
 */
export declare function createBreadcrumb(breadcrumb: Pick<Breadcrumb, RequiredProperties> & Partial<Omit<Breadcrumb, RequiredProperties>>): Breadcrumb;
export {};
//# sourceMappingURL=createBreadcrumb.d.ts.map{"version":3,"file":"createBreadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/util/createBreadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,aAAK,kBAAkB,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC,GAC/F,UAAU,CAMZ"}import type { AllPerformanceEntry, AllPerformanceEntryData, ReplayPerformanceEntry } from '../types';
/**
 * Create replay performance entries from the browser performance entries.
 */
export declare function createPerformanceEntries(entries: AllPerformanceEntry[]): ReplayPerformanceEntry<AllPerformanceEntryData>[];
//# sourceMappingURL=createPerformanceEntries.d.ts.map{"version":3,"file":"createPerformanceEntries.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceEntries.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EAOvB,sBAAsB,EAEvB,MAAM,UAAU,CAAC;AAiBlB;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,mBAAmB,EAAE,GAC7B,sBAAsB,CAAC,uBAAuB,CAAC,EAAE,CAEnD"}import type { AddEventResult, AllEntryData, ReplayContainer, ReplayPerformanceEntry } from '../types';
/**
 * Create a "span" for each performance entry. The parent transaction is `this.replayEvent`.
 */
export declare function createPerformanceSpans(replay: ReplayContainer, entries: ReplayPerformanceEntry<AllEntryData>[]): Promise<AddEventResult | null>[];
//# sourceMappingURL=createPerformanceSpans.d.ts.map{"version":3,"file":"createPerformanceSpans.d.ts","sourceRoot":"","sources":["../../../../src/util/createPerformanceSpans.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGtG;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,sBAAsB,CAAC,YAAY,CAAC,EAAE,GAC9C,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAiBlC"}import type { DsnComponents, ReplayEnvelope, ReplayEvent, ReplayRecordingData } from '@sentry/types';
/**
 * Create a replay envelope ready to be sent.
 * This includes both the replay event, as well as the recording data.
 */
export declare function createReplayEnvelope(replayEvent: ReplayEvent, recordingData: ReplayRecordingData, dsn: DsnComponents, tunnel?: string): ReplayEnvelope;
//# sourceMappingURL=createReplayEnvelope.d.ts.map{"version":3,"file":"createReplayEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/util/createReplayEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGrG;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,mBAAmB,EAClC,GAAG,EAAE,aAAa,EAClB,MAAM,CAAC,EAAE,MAAM,GACd,cAAc,CAkBhB"}declare type DebouncedCallback = {
    (): void | unknown;
    flush: () => void | unknown;
    cancel: () => void;
};
declare type CallbackFunction = () => unknown;
declare type DebounceOptions = {
    maxWait?: number;
};
/**
 * Heavily simplified debounce function based on lodash.debounce.
 *
 * This function takes a callback function (@param fun) and delays its invocation
 * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,
 * which ensures that the callback is invoked at least once after the specified max. wait time.
 *
 * @param func the function whose invocation is to be debounced
 * @param wait the minimum time until the function is invoked after it was called once
 * @param options the options object, which can contain the `maxWait` property
 *
 * @returns the debounced version of the function, which needs to be called at least once to start the
 *          debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc
 *          was already invoked in the meantime, return @param func's return value.
 *          The debounced function has two additional properties:
 *          - `flush`: Invokes the debounced function immediately and returns its return value
 *          - `cancel`: Cancels the debouncing process and resets the debouncing timer
 */
export declare function debounce(func: CallbackFunction, wait: number, options?: DebounceOptions): DebouncedCallback;
export {};
//# sourceMappingURL=debounce.d.ts.map{"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../../../src/util/debounce.ts"],"names":[],"mappings":"AAAA,aAAK,iBAAiB,GAAG;IACvB,IAAI,IAAI,GAAG,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AACF,aAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC;AACtC,aAAK,eAAe,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,iBAAiB,CA2C3G"}/**
 * There are some difficulties diagnosing why there are duplicate navigation
 * entries. We've witnessed several intermittent results:
 * - duplicate entries have duration = 0
 * - duplicate entries are the same object reference
 * - none of the above
 *
 * Compare the values of several keys to determine if the entries are duplicates or not.
 */
export declare function dedupePerformanceEntries(currentList: PerformanceEntryList, newList: PerformanceEntryList): PerformanceEntryList;
//# sourceMappingURL=dedupePerformanceEntries.d.ts.map{"version":3,"file":"dedupePerformanceEntries.d.ts","sourceRoot":"","sources":["../../../../src/util/dedupePerformanceEntries.ts"],"names":[],"mappings":"AAgBA;;;;;;;;GAQG;AAGH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,oBAAoB,EACjC,OAAO,EAAE,oBAAoB,GAC5B,oBAAoB,CA6DtB"}import type { ErrorEvent, Event, ReplayEvent, TransactionEvent } from '@sentry/types';
/** If the event is an error event */
export declare function isErrorEvent(event: Event): event is ErrorEvent;
/** If the event is a transaction event */
export declare function isTransactionEvent(event: Event): event is TransactionEvent;
/** If the event is an replay event */
export declare function isReplayEvent(event: Event): event is ReplayEvent;
//# sourceMappingURL=eventUtils.d.ts.map{"version":3,"file":"eventUtils.d.ts","sourceRoot":"","sources":["../../../../src/util/eventUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtF,qCAAqC;AACrC,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,UAAU,CAE9D;AAED,0CAA0C;AAC1C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,gBAAgB,CAE1E;AAED,sCAAsC;AACtC,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAEhE"}import type { DeprecatedPrivacyOptions, ReplayIntegrationPrivacyOptions } from '../types';
declare type GetPrivacyOptions = Required<Omit<ReplayIntegrationPrivacyOptions, 'maskFn'>> & Omit<DeprecatedPrivacyOptions, 'maskInputOptions'>;
interface GetPrivacyReturn {
    maskTextSelector: string;
    unmaskTextSelector: string;
    maskInputSelector: string;
    unmaskInputSelector: string;
    blockSelector: string;
    unblockSelector: string;
    ignoreSelector: string;
    blockClass?: RegExp;
    maskTextClass?: RegExp;
}
/**
 * Returns privacy related configuration for use in rrweb
 */
export declare function getPrivacyOptions({ mask, unmask, block, unblock, ignore, blockClass, blockSelector, maskTextClass, maskTextSelector, ignoreClass, }: GetPrivacyOptions): GetPrivacyReturn;
export {};
//# sourceMappingURL=getPrivacyOptions.d.ts.map{"version":3,"file":"getPrivacyOptions.d.ts","sourceRoot":"","sources":["../../../../src/util/getPrivacyOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAE1F,aAAK,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC,GAChF,IAAI,CAAC,wBAAwB,EAAE,kBAAkB,CAAC,CAAC;AACrD,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IAEvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmCD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO,EACP,MAAM,EAGN,UAAU,EAEV,aAAa,EAEb,aAAa,EAEb,gBAAgB,EAEhB,WAAW,GACZ,EAAE,iBAAiB,GAAG,gBAAgB,CAgCtC"}import type { RecordingEvent, ReplayContainer } from '../types';
declare type RecordingEmitCallback = (event: RecordingEvent, isCheckout?: boolean) => void;
/**
 * Handler for recording events.
 *
 * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.
 */
export declare function getHandleRecordingEmit(replay: ReplayContainer): RecordingEmitCallback;
export {};
//# sourceMappingURL=handleRecordingEmit.d.ts.map{"version":3,"file":"handleRecordingEmit.d.ts","sourceRoot":"","sources":["../../../../src/util/handleRecordingEmit.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhE,aAAK,qBAAqB,GAAG,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAEnF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,qBAAqB,CAwErF"}/**
 * Returns true if we are in the browser.
 */
export declare function isBrowser(): boolean;
//# sourceMappingURL=isBrowser.d.ts.map{"version":3,"file":"isBrowser.d.ts","sourceRoot":"","sources":["../../../../src/util/isBrowser.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAGnC"}/**
 * Given an initial timestamp and an expiry duration, checks to see if current
 * time should be considered as expired.
 */
export declare function isExpired(initialTime: null | number, expiry: undefined | number, targetTime?: number): boolean;
//# sourceMappingURL=isExpired.d.ts.map{"version":3,"file":"isExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isExpired.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,SAAS,CACvB,WAAW,EAAE,IAAI,GAAG,MAAM,EAC1B,MAAM,EAAE,SAAS,GAAG,MAAM,EAC1B,UAAU,GAAE,MAAoB,GAC/B,OAAO,CAYT"}import type { Event, EventHint } from '@sentry/types';
/**
 * Returns true if we think the given event is an error originating inside of rrweb.
 */
export declare function isRrwebError(event: Event, hint: EventHint): boolean;
//# sourceMappingURL=isRrwebError.d.ts.map{"version":3,"file":"isRrwebError.d.ts","sourceRoot":"","sources":["../../../../src/util/isRrwebError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAkBnE"}/**
 * Given a sample rate, returns true if replay should be sampled.
 *
 * 1.0 = 100% sampling
 * 0.0 = 0% sampling
 */
export declare function isSampled(sampleRate?: number): boolean;
//# sourceMappingURL=isSampled.d.ts.map{"version":3,"file":"isSampled.d.ts","sourceRoot":"","sources":["../../../../src/util/isSampled.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAOtD"}import type { Session, Timeouts } from '../types';
/**
 * Checks to see if session is expired
 */
export declare function isSessionExpired(session: Session, timeouts: Timeouts, targetTime?: number): boolean;
//# sourceMappingURL=isSessionExpired.d.ts.map{"version":3,"file":"isSessionExpired.d.ts","sourceRoot":"","sources":["../../../../src/util/isSessionExpired.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGlD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,GAAE,MAAoB,GAAG,OAAO,CAQhH"}import type { ReplayRecordingData } from '@sentry/types';
/**
 * Prepare the recording data ready to be sent.
 */
export declare function prepareRecordingData({ recordingData, headers, }: {
    recordingData: ReplayRecordingData;
    headers: Record<string, unknown>;
}): ReplayRecordingData;
//# sourceMappingURL=prepareRecordingData.d.ts.map{"version":3,"file":"prepareRecordingData.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareRecordingData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,aAAa,EACb,OAAO,GACR,EAAE;IACD,aAAa,EAAE,mBAAmB,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,GAAG,mBAAmB,CAoBtB"}import type { Scope } from '@sentry/core';
import type { IntegrationIndex } from '@sentry/core/build/types/integration';
import type { Client, ReplayEvent } from '@sentry/types';
/**
 * Prepare a replay event & enrich it with the SDK metadata.
 */
export declare function prepareReplayEvent({ client, scope, replayId: event_id, event, }: {
    client: Client & {
        _integrations?: IntegrationIndex;
    };
    scope: Scope;
    replayId: string;
    event: ReplayEvent;
}): Promise<ReplayEvent | null>;
//# sourceMappingURL=prepareReplayEvent.d.ts.map{"version":3,"file":"prepareReplayEvent.d.ts","sourceRoot":"","sources":["../../../../src/util/prepareReplayEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEzD;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,QAAQ,EAAE,QAAQ,EAClB,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,GAAG;QAAE,aAAa,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IACtD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAiC9B"}import type { SendReplayData } from '../types';
/**
 * Finalize and send the current replay event to Sentry
 */
export declare function sendReplay(replayData: SendReplayData, retryConfig?: {
    count: number;
    interval: number;
}): Promise<unknown>;
//# sourceMappingURL=sendReplay.d.ts.map{"version":3,"file":"sendReplay.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplay.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG/C;;GAEG;AACH,wBAAsB,UAAU,CAC9B,UAAU,EAAE,cAAc,EAC1B,WAAW;;;CAGV,GACA,OAAO,CAAC,OAAO,CAAC,CAuDlB"}import type { TransportMakeRequestResponse } from '@sentry/types';
import type { SendReplayData } from '../types';
/**
 * Send replay attachment using `fetch()`
 */
export declare function sendReplayRequest({ recordingData, replayId, segmentId: segment_id, eventContext, timestamp, session, options, }: SendReplayData): Promise<void | TransportMakeRequestResponse>;
/**
 * This error indicates that the transport returned an invalid status code.
 */
export declare class TransportStatusCodeError extends Error {
    constructor(statusCode: number);
}
//# sourceMappingURL=sendReplayRequest.d.ts.map{"version":3,"file":"sendReplayRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/sendReplayRequest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAI/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK/C;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,aAAa,EACb,QAAQ,EACR,SAAS,EAAE,UAAU,EACrB,YAAY,EACZ,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,GAAG,4BAA4B,CAAC,CAsH/D;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;gBAC9B,UAAU,EAAE,MAAM;CAGtC"}import type { ReplayContainer } from '../types';
/**
 * Check whether a given request URL should be filtered out. This is so we
 * don't log Sentry ingest requests.
 */
export declare function shouldFilterRequest(replay: ReplayContainer, url: string): boolean;
//# sourceMappingURL=shouldFilterRequest.d.ts.map{"version":3,"file":"shouldFilterRequest.d.ts","sourceRoot":"","sources":["../../../../src/util/shouldFilterRequest.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAOjF"}
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/types",
  "version": "7.48.0",
  "description": "Types for all Sentry JavaScript SDKs",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/types",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Sentry JavaScript SDK Types

[![npm version](https://img.shields.io/npm/v/@sentry/types.svg)](https://www.npmjs.com/package/@sentry/types)
[![npm dm](https://img.shields.io/npm/dm/@sentry/types.svg)](https://www.npmjs.com/package/@sentry/types)
[![npm dt](https://img.shields.io/npm/dt/@sentry/types.svg)](https://www.npmjs.com/package/@sentry/types)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

## General

Common types used by the Sentry JavaScript SDKs.
export interface Attachment {
    data: string | Uint8Array;
    filename: string;
    contentType?: string;
    attachmentType?: string;
}
//# sourceMappingURL=attachment.d.ts.map{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/attachment.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}import type { Severity, SeverityLevel } from './severity';
/** JSDoc */
export interface Breadcrumb {
    type?: string;
    level?: Severity | SeverityLevel;
    event_id?: string;
    category?: string;
    message?: string;
    data?: {
        [key: string]: any;
    };
    timestamp?: number;
}
/** JSDoc */
export interface BreadcrumbHint {
    [key: string]: any;
}
export interface FetchBreadcrumbData {
    method: string;
    url: string;
    status_code?: number;
    request_body_size?: number;
    response_body_size?: number;
}
export interface XhrBreadcrumbData {
    method?: string;
    url?: string;
    status_code?: number;
    request_body_size?: number;
    response_body_size?: number;
}
export interface FetchBreadcrumbHint {
    input: any[];
    data?: unknown;
    response?: unknown;
    startTimestamp: number;
    endTimestamp: number;
}
export interface XhrBreadcrumbHint {
    xhr: unknown;
    input: unknown;
    startTimestamp: number;
    endTimestamp: number;
}
//# sourceMappingURL=breadcrumb.d.ts.map{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE1D,YAAY;AACZ,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,YAAY;AACZ,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB"}/**
 * Options added to the Browser SDK's init options that are specific for Replay.
 * Note: This type was moved to @sentry/types to avoid a circular dependency between Browser and Replay.
 */
export declare type BrowserClientReplayOptions = {
    /**
     * The sample rate for session-long replays.
     * 1.0 will record all sessions and 0 will record none.
     */
    replaysSessionSampleRate?: number;
    /**
     * The sample rate for sessions that has had an error occur.
     * This is independent of `sessionSampleRate`.
     * 1.0 will record all sessions and 0 will record none.
     */
    replaysOnErrorSampleRate?: number;
};
//# sourceMappingURL=browseroptions.d.ts.map{"version":3,"file":"browseroptions.d.ts","sourceRoot":"","sources":["../../src/browseroptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,0BAA0B,GAAG;IACvC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,CAAC"}export interface CheckIn {
    check_in_id: string;
    monitor_slug: string;
    status: 'in_progress' | 'ok' | 'error';
    duration?: number;
    release?: string;
    environment?: string;
}
//# sourceMappingURL=checkin.d.ts.map{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../src/checkin.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,OAAO;IAEtB,WAAW,EAAE,MAAM,CAAC;IAEpB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC;IAEvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import type { EventDropReason } from './clientreport';
import type { DataCategory } from './datacategory';
import type { DsnComponents } from './dsn';
import type { DynamicSamplingContext, Envelope } from './envelope';
import type { Event, EventHint } from './event';
import type { Integration, IntegrationClass } from './integration';
import type { ClientOptions } from './options';
import type { Scope } from './scope';
import type { SdkMetadata } from './sdkmetadata';
import type { Session, SessionAggregates } from './session';
import type { Severity, SeverityLevel } from './severity';
import type { Transaction } from './transaction';
import type { Transport, TransportMakeRequestResponse } from './transport';
/**
 * User-Facing Sentry SDK Client.
 *
 * This interface contains all methods to interface with the SDK once it has
 * been installed. It allows to send events to Sentry, record breadcrumbs and
 * set a context included in every event. Since the SDK mutates its environment,
 * there will only be one instance during runtime.
 *
 */
export interface Client<O extends ClientOptions = ClientOptions> {
    /**
     * Captures an exception event and sends it to Sentry.
     *
     * @param exception An exception-like object.
     * @param hint May contain additional information about the original exception.
     * @param scope An optional scope containing event metadata.
     * @returns The event id
     */
    captureException(exception: any, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * Captures a message event and sends it to Sentry.
     *
     * @param message The message to send to Sentry.
     * @param level Define the level of the message.
     * @param hint May contain additional information about the original exception.
     * @param scope An optional scope containing event metadata.
     * @returns The event id
     */
    captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * Captures a manually created event and sends it to Sentry.
     *
     * @param event The event to send to Sentry.
     * @param hint May contain additional information about the original exception.
     * @param scope An optional scope containing event metadata.
     * @returns The event id
     */
    captureEvent(event: Event, hint?: EventHint, scope?: Scope): string | undefined;
    /**
     * Captures a session
     *
     * @param session Session to be delivered
     */
    captureSession?(session: Session): void;
    /** Returns the current Dsn. */
    getDsn(): DsnComponents | undefined;
    /** Returns the current options. */
    getOptions(): O;
    /**
     * @inheritdoc
     *
     * TODO (v8): Make this a required method.
     */
    getSdkMetadata?(): SdkMetadata | undefined;
    /**
     * Returns the transport that is used by the client.
     * Please note that the transport gets lazy initialized so it will only be there once the first event has been sent.
     *
     * @returns The transport.
     */
    getTransport(): Transport | undefined;
    /**
     * Flush the event queue and set the client to `enabled = false`. See {@link Client.flush}.
     *
     * @param timeout Maximum time in ms the client should wait before shutting down. Omitting this parameter will cause
     *   the client to wait until all events are sent before disabling itself.
     * @returns A promise which resolves to `true` if the flush completes successfully before the timeout, or `false` if
     * it doesn't.
     */
    close(timeout?: number): PromiseLike<boolean>;
    /**
     * Wait for all events to be sent or the timeout to expire, whichever comes first.
     *
     * @param timeout Maximum time in ms the client should wait for events to be flushed. Omitting this parameter will
     *   cause the client to wait until all events are sent before resolving the promise.
     * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are
     * still events in the queue when the timeout is reached.
     */
    flush(timeout?: number): PromiseLike<boolean>;
    /** Returns the client's instance of the given integration class, it any. */
    getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
    /**
     * Add an integration to the client.
     * This can be used to e.g. lazy load integrations.
     * In most cases, this should not be necessary, and you're better off just passing the integrations via `integrations: []` at initialization time.
     * However, if you find the need to conditionally load & add an integration, you can use `addIntegration` to do so.
     *
     * TODO (v8): Make this a required method.
     * */
    addIntegration?(integration: Integration): void;
    /** This is an internal function to setup all integrations that should run on the client */
    setupIntegrations(): void;
    /** Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`. */
    eventFromException(exception: any, hint?: EventHint): PromiseLike<Event>;
    /** Creates an {@link Event} from primitive inputs to `captureMessage`. */
    eventFromMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): PromiseLike<Event>;
    /** Submits the event to Sentry */
    sendEvent(event: Event, hint?: EventHint): void;
    /** Submits the session to Sentry */
    sendSession(session: Session | SessionAggregates): void;
    /**
     * Record on the client that an event got dropped (ie, an event that will not be sent to sentry).
     *
     * @param reason The reason why the event got dropped.
     * @param category The data category of the dropped event.
     * @param event The dropped event.
     */
    recordDroppedEvent(reason: EventDropReason, dataCategory: DataCategory, event?: Event): void;
    /**
     * Register a callback for transaction start and finish.
     */
    on?(hook: 'startTransaction' | 'finishTransaction', callback: (transaction: Transaction) => void): void;
    /**
     * Register a callback for transaction start and finish.
     */
    on?(hook: 'beforeEnvelope', callback: (envelope: Envelope) => void): void;
    /**
     * Register a callback for when an event has been sent.
     */
    on?(hook: 'afterSendEvent', callback: (event: Event, sendResponse: TransportMakeRequestResponse | void) => void): void;
    /**
     * Register a callback before a breadcrumb is added.
     */
    on?(hook: 'beforeAddBreadcrumb', callback: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => void): void;
    /**
     * Register a callback whena  DSC (Dynamic Sampling Context) is created.
     */
    on?(hook: 'createDsc', callback: (dsc: DynamicSamplingContext) => void): void;
    /**
     * Fire a hook event for transaction start and finish. Expects to be given a transaction as the
     * second argument.
     */
    emit?(hook: 'startTransaction' | 'finishTransaction', transaction: Transaction): void;
    emit?(hook: 'beforeEnvelope', envelope: Envelope): void;
    emit?(hook: 'afterSendEvent', event: Event, sendResponse: TransportMakeRequestResponse | void): void;
    /**
     * Fire a hook for when a breadcrumb is added. Expects the breadcrumb as second argument.
     */
    emit?(hook: 'beforeAddBreadcrumb', breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
    /**
     * Fire a hook for when a DSC (Dynamic Sampling Context) is created. Expects the DSC as second argument.
     */
    emit?(hook: 'createDsc', dsc: DynamicSamplingContext): void;
}
//# sourceMappingURL=client.d.ts.map{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3E;;;;;;;;GAQG;AACH,MAAM,WAAW,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IAC7D;;;;;;;OAOG;IACH,gBAAgB,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,KAAK,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;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,kBAAkB,GAAG,mBAAmB,EAAE,WAAW,EAAE,WAAW,GAAG,IAAI,CAAC;IAMtF,IAAI,CAAC,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAMxD,IAAI,CAAC,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,4BAA4B,GAAG,IAAI,GAAG,IAAI,CAAC;IAErG;;OAEG;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAExF;;OAEG;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,sBAAsB,GAAG,IAAI,CAAC;CAC7D"}import type { DataCategory } from './datacategory';
export declare type EventDropReason = 'before_send' | 'event_processor' | 'network_error' | 'queue_overflow' | 'ratelimit_backoff' | 'sample_rate' | 'send_error' | 'internal_sdk_error';
export declare type Outcome = {
    reason: EventDropReason;
    category: DataCategory;
    quantity: number;
};
export declare type ClientReport = {
    timestamp: number;
    discarded_events: Outcome[];
};
//# sourceMappingURL=clientreport.d.ts.map{"version":3,"file":"clientreport.d.ts","sourceRoot":"","sources":["../../src/clientreport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,oBAAY,eAAe,GACvB,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,aAAa,GACb,YAAY,GACZ,oBAAoB,CAAC;AAEzB,oBAAY,OAAO,GAAG;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,EAAE,CAAC;CAC7B,CAAC"}import type { Primitive } from './misc';
export declare type Context = Record<string, unknown>;
export interface Contexts extends Record<string, Context | undefined> {
    app?: AppContext;
    device?: DeviceContext;
    os?: OsContext;
    culture?: CultureContext;
    response?: ResponseContext;
}
export interface AppContext extends Record<string, unknown> {
    app_name?: string;
    app_start_time?: string;
    app_version?: string;
    app_identifier?: string;
    build_type?: string;
    app_memory?: number;
}
export interface DeviceContext extends Record<string, unknown> {
    name?: string;
    family?: string;
    model?: string;
    model_id?: string;
    arch?: string;
    battery_level?: number;
    orientation?: 'portrait' | 'landscape';
    manufacturer?: string;
    brand?: string;
    screen_resolution?: string;
    screen_height_pixels?: number;
    screen_width_pixels?: number;
    screen_density?: number;
    screen_dpi?: number;
    online?: boolean;
    charging?: boolean;
    low_memory?: boolean;
    simulator?: boolean;
    memory_size?: number;
    free_memory?: number;
    usable_memory?: number;
    storage_size?: number;
    free_storage?: number;
    external_storage_size?: number;
    external_free_storage?: number;
    boot_time?: string;
    processor_count?: number;
    cpu_description?: string;
    processor_frequency?: number;
    device_type?: string;
    battery_status?: string;
    device_unique_identifier?: string;
    supports_vibration?: boolean;
    supports_accelerometer?: boolean;
    supports_gyroscope?: boolean;
    supports_audio?: boolean;
    supports_location_service?: boolean;
}
export interface OsContext extends Record<string, unknown> {
    name?: string;
    version?: string;
    build?: string;
    kernel_version?: string;
}
export interface CultureContext extends Record<string, unknown> {
    calendar?: string;
    display_name?: string;
    locale?: string;
    is_24_hour_format?: boolean;
    timezone?: string;
}
export interface ResponseContext extends Record<string, unknown> {
    type?: string;
    cookies?: string[][] | Record<string, string>;
    headers?: Record<string, string>;
    status_code?: number;
    body_size?: number;
}
export interface TraceContext extends Record<string, unknown> {
    data?: {
        [key: string]: any;
    };
    description?: string;
    op?: string;
    parent_span_id?: string;
    span_id: string;
    status?: string;
    tags?: {
        [key: string]: Primitive;
    };
    trace_id: string;
}
//# sourceMappingURL=context.d.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AAE,OAAO,CAAC;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAa,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3D,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB"}export declare type DataCategory = 'default' | 'error' | 'transaction' | 'replay' | 'security' | 'attachment' | 'session' | 'internal' | 'profile' | 'monitor';
//# sourceMappingURL=datacategory.d.ts.map{"version":3,"file":"datacategory.d.ts","sourceRoot":"","sources":["../../src/datacategory.ts"],"names":[],"mappings":"AAKA,oBAAY,YAAY,GAEpB,SAAS,GAET,OAAO,GAEP,aAAa,GAEb,QAAQ,GAER,UAAU,GAEV,YAAY,GAEZ,SAAS,GAET,UAAU,GAEV,SAAS,GAET,SAAS,CAAC"}/**
 * Holds meta information to customize the behavior of Sentry's server-side event processing.
 **/
export interface DebugMeta {
    images?: Array<DebugImage>;
}
export declare type DebugImage = WasmDebugImage | SourceMapDebugImage;
interface WasmDebugImage {
    type: 'wasm';
    debug_id: string;
    code_id?: string | null;
    code_file: string;
    debug_file?: string | null;
}
interface SourceMapDebugImage {
    type: 'sourcemap';
    code_file: string;
    debug_id: string;
}
export {};
//# sourceMappingURL=debugMeta.d.ts.map{"version":3,"file":"debugMeta.d.ts","sourceRoot":"","sources":["../../src/debugMeta.ts"],"names":[],"mappings":"AAAA;;IAEI;AACJ,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;CAC5B;AAED,oBAAY,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC;AAE9D,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,UAAU,mBAAmB;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB"}/** Supported Sentry transport protocols in a Dsn. */
export declare type DsnProtocol = 'http' | 'https';
/** Primitive components of a Dsn. */
export interface DsnComponents {
    /** Protocol used to connect to Sentry. */
    protocol: DsnProtocol;
    /** Public authorization key. */
    publicKey?: string;
    /** Private authorization key (deprecated, optional). */
    pass?: string;
    /** Hostname of the Sentry instance. */
    host: string;
    /** Port of the Sentry instance. */
    port?: string;
    /** Sub path/ */
    path?: string;
    /** Project ID */
    projectId: string;
}
/** Anything that can be parsed into a Dsn. */
export declare type DsnLike = string | DsnComponents;
//# sourceMappingURL=dsn.d.ts.map{"version":3,"file":"dsn.d.ts","sourceRoot":"","sources":["../../src/dsn.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3C,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,QAAQ,EAAE,WAAW,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,8CAA8C;AAC9C,oBAAY,OAAO,GAAG,MAAM,GAAG,aAAa,CAAC"}import type { CheckIn } from './checkin';
import type { ClientReport } from './clientreport';
import type { DsnComponents } from './dsn';
import type { Event } from './event';
import type { ReplayEvent, ReplayRecordingData } from './replay';
import type { SdkInfo } from './sdkinfo';
import type { Session, SessionAggregates } from './session';
import type { Transaction } from './transaction';
import type { UserFeedback } from './user';
export declare type DynamicSamplingContext = {
    trace_id: Transaction['traceId'];
    public_key: DsnComponents['publicKey'];
    sample_rate?: string;
    release?: string;
    environment?: string;
    transaction?: string;
    user_segment?: string;
    replay_id?: string;
};
export declare type EnvelopeItemType = 'client_report' | 'user_report' | 'session' | 'sessions' | 'transaction' | 'attachment' | 'event' | 'profile' | 'replay_event' | 'replay_recording' | 'check_in';
export declare type BaseEnvelopeHeaders = {
    [key: string]: unknown;
    dsn?: string;
    sdk?: SdkInfo;
};
export declare type BaseEnvelopeItemHeaders = {
    [key: string]: unknown;
    type: EnvelopeItemType;
    length?: number;
};
declare type BaseEnvelopeItem<ItemHeader, P> = [ItemHeader & BaseEnvelopeItemHeaders, P];
declare type BaseEnvelope<EnvelopeHeader, Item> = [EnvelopeHeader & BaseEnvelopeHeaders, Array<Item & BaseEnvelopeItem<BaseEnvelopeItemHeaders, unknown>>];
declare type EventItemHeaders = {
    type: 'event' | 'transaction' | 'profile';
};
declare type AttachmentItemHeaders = {
    type: 'attachment';
    length: number;
    filename: string;
    content_type?: string;
    attachment_type?: string;
};
declare type UserFeedbackItemHeaders = {
    type: 'user_report';
};
declare type SessionItemHeaders = {
    type: 'session';
};
declare type SessionAggregatesItemHeaders = {
    type: 'sessions';
};
declare type ClientReportItemHeaders = {
    type: 'client_report';
};
declare type ReplayEventItemHeaders = {
    type: 'replay_event';
};
declare type ReplayRecordingItemHeaders = {
    type: 'replay_recording';
    length: number;
};
declare type CheckInItemHeaders = {
    type: 'check_in';
};
export declare type EventItem = BaseEnvelopeItem<EventItemHeaders, Event>;
export declare type AttachmentItem = BaseEnvelopeItem<AttachmentItemHeaders, string | Uint8Array>;
export declare type UserFeedbackItem = BaseEnvelopeItem<UserFeedbackItemHeaders, UserFeedback>;
export declare type SessionItem = BaseEnvelopeItem<SessionItemHeaders, Session> | BaseEnvelopeItem<SessionAggregatesItemHeaders, SessionAggregates>;
export declare type ClientReportItem = BaseEnvelopeItem<ClientReportItemHeaders, ClientReport>;
export declare type CheckInItem = BaseEnvelopeItem<CheckInItemHeaders, CheckIn>;
declare type ReplayEventItem = BaseEnvelopeItem<ReplayEventItemHeaders, ReplayEvent>;
declare type ReplayRecordingItem = BaseEnvelopeItem<ReplayRecordingItemHeaders, ReplayRecordingData>;
export declare type EventEnvelopeHeaders = {
    event_id: string;
    sent_at: string;
    trace?: DynamicSamplingContext;
};
declare type SessionEnvelopeHeaders = {
    sent_at: string;
};
declare type CheckInEnvelopeHeaders = BaseEnvelopeHeaders;
declare type ClientReportEnvelopeHeaders = BaseEnvelopeHeaders;
declare type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
export declare type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem>;
export declare type SessionEnvelope = BaseEnvelope<SessionEnvelopeHeaders, SessionItem>;
export declare type ClientReportEnvelope = BaseEnvelope<ClientReportEnvelopeHeaders, ClientReportItem>;
export declare type ReplayEnvelope = [ReplayEnvelopeHeaders, [ReplayEventItem, ReplayRecordingItem]];
export declare type CheckInEvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
export declare type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ReplayEnvelope | CheckInEvelope;
export declare type EnvelopeItem = Envelope[1][number];
export {};
//# sourceMappingURL=envelope.d.ts.map{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAK3C,oBAAY,sBAAsB,GAAG;IACnC,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,UAAU,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WA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B,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAClD,aAAK,sBAAsB,GAAG,mBAAmB,CAAC;AAClD,aAAK,2BAA2B,GAAG,mBAAmB,CAAC;AACvD,aAAK,qBAAqB,GAAG,mBAAmB,CAAC;AAEjD,oBAAY,aAAa,GAAG,YAAY,CAAC,oBAAoB,EAAE,SAAS,GAAG,cAAc,GAAG,gBAAgB,CAAC,CAAC;AAC9G,oBAAY,eAAe,GAAG,YAAY,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;AAChF,oBAAY,oBAAoB,GAAG,YAAY,CAAC,2BAA2B,EAAE,gBAAgB,CAAC,CAAC;AAC/F,oBAAY,cAAc,GAAG,CAAC,qBAAqB,EAAE,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC7F,oBAAY,cAAc,GAAG,YAAY,CAAC,sBAAsB,EAAE,WAAW,CAAC,CAAC;AAE/E,oBAAY,QAAQ,GAAG,aAAa,GAAG,eAAe,GAAG,oBAAoB,GAAG,cAAc,GAAG,cAAc,CAAC;AAChH,oBAAY,YAAY,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"}/**
 * Just an Error object with arbitrary attributes attached to it.
 */
export interface ExtendedError extends Error {
    [key: string]: any;
}
//# sourceMappingURL=error.d.ts.map{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}import type { Attachment } from './attachment';
import type { Breadcrumb } from './breadcrumb';
import type { Contexts } from './context';
import type { DebugMeta } from './debugMeta';
import type { Exception } from './exception';
import type { Extras } from './extra';
import type { Measurements } from './measurement';
import type { Primitive } from './misc';
import type { Request } from './request';
import type { CaptureContext } from './scope';
import type { SdkInfo } from './sdkinfo';
import type { Severity, SeverityLevel } from './severity';
import type { Span } from './span';
import type { Thread } from './thread';
import type { TransactionSource } from './transaction';
import type { User } from './user';
/** JSDoc */
export interface Event {
    event_id?: string;
    message?: string;
    timestamp?: number;
    start_timestamp?: number;
    level?: Severity | SeverityLevel;
    platform?: string;
    logger?: string;
    server_name?: string;
    release?: string;
    dist?: string;
    environment?: string;
    sdk?: SdkInfo;
    request?: Request;
    transaction?: string;
    modules?: {
        [key: string]: string;
    };
    fingerprint?: string[];
    exception?: {
        values?: Exception[];
    };
    breadcrumbs?: Breadcrumb[];
    contexts?: Contexts;
    tags?: {
        [key: string]: Primitive;
    };
    extra?: Extras;
    user?: User;
    type?: EventType;
    spans?: Span[];
    measurements?: Measurements;
    debug_meta?: DebugMeta;
    sdkProcessingMetadata?: {
        [key: string]: any;
    };
    transaction_info?: {
        source: TransactionSource;
    };
    threads?: {
        values: Thread[];
    };
}
/**
 * The type of an `Event`.
 * Note that `ErrorEvent`s do not have a type (hence its undefined),
 * while all other events are required to have one.
 */
export declare type EventType = 'transaction' | 'profile' | 'replay_event' | undefined;
export interface ErrorEvent extends Event {
    type: undefined;
}
export interface TransactionEvent extends Event {
    type: 'transaction';
}
/** JSDoc */
export interface EventHint {
    event_id?: string;
    captureContext?: CaptureContext;
    syntheticException?: Error | null;
    originalException?: unknown;
    attachments?: Attachment[];
    data?: any;
    integrations?: string[];
}
//# sourceMappingURL=event.d.ts.map{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,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E,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB"}import type { Event, EventHint } from './event';
/**
 * Event processors are used to change the event before it will be send.
 * We strongly advise to make this function sync.
 * Returning a PromiseLike<Event | null> will work just fine, but better be sure that you know what you are doing.
 * Event processing will be deferred until your Promise is resolved.
 */
export interface EventProcessor {
    (event: Event, hint: EventHint): PromiseLike<Event | null> | Event | null;
    id?: string;
}
//# sourceMappingURL=eventprocessor.d.ts.map{"version":3,"file":"eventprocessor.d.ts","sourceRoot":"","sources":["../../src/eventprocessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}import type { Mechanism } from './mechanism';
import type { Stacktrace } from './stacktrace';
/** JSDoc */
export interface Exception {
    type?: string;
    value?: string;
    mechanism?: Mechanism;
    module?: string;
    thread_id?: number;
    stacktrace?: Stacktrace;
}
//# sourceMappingURL=exception.d.ts.map{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../../src/exception.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY;AACZ,MAAM,WAAW,SAAS;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}export declare type Extra = unknown;
export declare type Extras = Record<string, Extra>;
//# sourceMappingURL=extra.d.ts.map{"version":3,"file":"extra.d.ts","sourceRoot":"","sources":["../../src/extra.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK,GAAG,OAAO,CAAC;AAC5B,oBAAY,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}declare global {
    const __DEBUG_BUILD__: boolean;
}
export type {};
//# sourceMappingURL=globals.d.ts.map{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../src/globals.ts"],"names":[],"mappings":"AAYA,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,eAAe,EAAE,OAAO,CAAC;CAChC;AAGD,YAAY,EAAE,CAAC"}import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import type { Client } from './client';
import type { Event, EventHint } from './event';
import type { Extra, Extras } from './extra';
import type { Integration, IntegrationClass } from './integration';
import type { Primitive } from './misc';
import type { Scope } from './scope';
import type { Session } from './session';
import type { Severity, SeverityLevel } from './severity';
import type { CustomSamplingContext, Transaction, TransactionContext } from './transaction';
import type { User } from './user';
/**
 * Internal class used to make sure we always have the latest internal functions
 * working in case we have a version conflict.
 */
export interface Hub {
    /**
     * Checks if this hub's version is older than the given version.
     *
     * @param version A version number to compare to.
     * @return True if the given version is newer; otherwise false.
     *
     * @hidden
     */
    isOlderThan(version: number): boolean;
    /**
     * This binds the given client to the current scope.
     * @param client An SDK client (client) instance.
     */
    bindClient(client?: Client): void;
    /**
     * Create a new scope to store context information.
     *
     * The scope will be layered on top of the current one. It is isolated, i.e. all
     * breadcrumbs and context information added to this scope will be removed once
     * the scope ends. Be sure to always remove this scope with {@link this.popScope}
     * when the operation finishes or throws.
     *
     * @returns Scope, the new cloned scope
     */
    pushScope(): Scope;
    /**
     * Removes a previously pushed scope from the stack.
     *
     * This restores the state before the scope was pushed. All breadcrumbs and
     * context information added since the last call to {@link this.pushScope} are
     * discarded.
     */
    popScope(): boolean;
    /**
     * Creates a new scope with and executes the given operation within.
     * The scope is automatically removed once the operation
     * finishes or throws.
     *
     * This is essentially a convenience function for:
     *
     *     pushScope();
     *     callback();
     *     popScope();
     *
     * @param callback that will be enclosed into push/popScope.
     */
    withScope(callback: (scope: Scope) => void): void;
    /** Returns the client of the top stack. */
    getClient(): Client | undefined;
    /**
     * Captures an exception event and sends it to Sentry.
     *
     * @param exception An exception-like object.
     * @param hint May contain additional information about the original exception.
     * @returns The generated eventId.
     */
    captureException(exception: any, hint?: EventHint): string;
    /**
     * Captures a message event and sends it to Sentry.
     *
     * @param message The message to send to Sentry.
     * @param level Define the level of the message.
     * @param hint May contain additional information about the original exception.
     * @returns The generated eventId.
     */
    captureMessage(message: string, level?: Severity | SeverityLevel, hint?: EventHint): string;
    /**
     * Captures a manually created event and sends it to Sentry.
     *
     * @param event The event to send to Sentry.
     * @param hint May contain additional information about the original exception.
     */
    captureEvent(event: Event, hint?: EventHint): string;
    /**
     * This is the getter for lastEventId.
     *
     * @returns The last event id of a captured event.
     */
    lastEventId(): string | undefined;
    /**
     * Records a new breadcrumb which will be attached to future events.
     *
     * Breadcrumbs will be added to subsequent events to provide more context on
     * user's actions prior to an error or crash.
     *
     * @param breadcrumb The breadcrumb to record.
     * @param hint May contain additional information about the original breadcrumb.
     */
    addBreadcrumb(breadcrumb: Breadcrumb, hint?: BreadcrumbHint): void;
    /**
     * Updates user context information for future events.
     *
     * @param user User context object to be set in the current context. Pass `null` to unset the user.
     */
    setUser(user: User | null): void;
    /**
     * Set an object that will be merged sent as tags data with the event.
     *
     * @param tags Tags context object to merge into current context.
     */
    setTags(tags: {
        [key: string]: Primitive;
    }): void;
    /**
     * Set key:value that will be sent as tags data with the event.
     *
     * Can also be used to unset a tag, by passing `undefined`.
     *
     * @param key String key of tag
     * @param value Value of tag
     */
    setTag(key: string, value: Primitive): void;
    /**
     * Set key:value that will be sent as extra data with the event.
     * @param key String of extra
     * @param extra Any kind of data. This data will be normalized.
     */
    setExtra(key: string, extra: Extra): void;
    /**
     * Set an object that will be merged sent as extra data with the event.
     * @param extras Extras object to merge into current context.
     */
    setExtras(extras: Extras): void;
    /**
     * Sets context data with the given name.
     * @param name of the context
     * @param context Any kind of data. This data will be normalized.
     */
    setContext(name: string, context: {
        [key: string]: any;
    } | null): void;
    /**
     * Callback to set context information onto the scope.
     *
     * @param callback Callback function that receives Scope.
     */
    configureScope(callback: (scope: Scope) => void): void;
    /**
     * For the duration of the callback, this hub will be set as the global current Hub.
     * This function is useful if you want to run your own client and hook into an already initialized one
     * e.g.: Reporting issues to your own sentry when running in your component while still using the users configuration.
     */
    run(callback: (hub: Hub) => void): void;
    /** Returns the integration if installed on the current client. */
    getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
    /** Returns all trace headers that are currently on the top scope. */
    traceHeaders(): {
        [key: string]: string;
    };
    /**
     * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
     *
     * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a
     * new child span within the transaction or any span, call the respective `.startChild()` method.
     *
     * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.
     *
     * The transaction must be finished with a call to its `.finish()` method, at which point the transaction with all its
     * finished child spans will be sent to Sentry.
     *
     * @param context Properties of the new `Transaction`.
     * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent
     * default values). See {@link Options.tracesSampler}.
     *
     * @returns The transaction which was just started
     */
    startTransaction(context: TransactionContext, customSamplingContext?: CustomSamplingContext): Transaction;
    /**
     * Starts a new `Session`, sets on the current scope and returns it.
     *
     * To finish a `session`, it has to be passed directly to `client.captureSession`, which is done automatically
     * when using `hub.endSession()` for the session currently stored on the scope.
     *
     * When there's already an existing session on the scope, it'll be automatically ended.
     *
     * @param context Optional properties of the new `Session`.
     *
     * @returns The session which was just started
     */
    startSession(context?: Session): Session;
    /**
     * Ends the session that lives on the current scope and sends it to Sentry
     */
    endSession(): void;
    /**
     * Sends the current session on the scope to Sentry
     * @param endSession If set the session will be marked as exited and removed from the scope
     */
    captureSession(endSession?: boolean): void;
    /**
     * Returns if default PII should be sent to Sentry and propagated in ourgoing requests
     * when Tracing is used.
     */
    shouldSendDefaultPii(): boolean;
}
//# sourceMappingURL=hub.d.ts.map{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../src/hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;;GAGG;AACH,MAAM,WAAW,GAAG;IAClB;;;;;;;OAOG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC;;;OAGG;IACH,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;;;;;;;;OASG;IACH,SAAS,IAAI,KAAK,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;;;;;;;;;;OAYG;IACH,SAA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,IAAI,GAAG,IAAI,CAAC;IAEvE;;;;OAIG;IACH,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAEvD;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;IAExC,kEAAkE;IAClE,cAAc,CAAC,CAAC,SAAS,WAAW,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAElF,qEAAqE;IACrE,YAAY,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAE1C;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,CAAC,EAAE,qBAAqB,GAAG,WAAW,CAAC;IAE1G;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAEzC;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE3C;;;OAGG;IACH,oBAAoB,IAAI,OAAO,CAAC;CACjC"}export type { Attachment } from './attachment';
export type { Breadcrumb, BreadcrumbHint, FetchBreadcrumbData, XhrBreadcrumbData, FetchBreadcrumbHint, XhrBreadcrumbHint, } from './breadcrumb';
export type { Client } from './client';
export type { ClientReport, Outcome, EventDropReason } from './clientreport';
export type { Context, Contexts, DeviceContext, OsContext, AppContext, CultureContext, TraceContext } from './context';
export type { DataCategory } from './datacategory';
export type { DsnComponents, DsnLike, DsnProtocol } from './dsn';
export type { DebugImage, DebugMeta } from './debugMeta';
export type { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEvelope, } from './envelope';
export type { ExtendedError } from './error';
export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event';
export type { EventProcessor } from './eventprocessor';
export type { Exception } from './exception';
export type { Extra, Extras } from './extra';
export type {} from './globals';
export type { Hub } from './hub';
export type { Integration, IntegrationClass } from './integration';
export type { Mechanism } from './mechanism';
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './misc';
export type { ClientOptions, Options } from './options';
export type { Package } from './package';
export type { PolymorphicEvent, PolymorphicRequest } from './polymorphics';
export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './replay';
export type { QueryParams, Request, SanitizedRequestData } from './request';
export type { Runtime } from './runtime';
export type { CaptureContext, Scope, ScopeContext } from './scope';
export type { SdkInfo } from './sdkinfo';
export type { SdkMetadata } from './sdkmetadata';
export type { SessionAggregates, AggregationCounts, Session, SessionContext, SessionStatus, RequestSession, RequestSessionStatus, SessionFlusherLike, SerializedSession, } from './session';
export type { Severity, SeverityLevel } from './severity';
export type { Span, SpanContext } from './span';
export type { StackFrame } from './stackframe';
export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';
export type { TextEncoderInternal } from './textencoder';
export type { TracePropagationTargets } from './tracing';
export type { CustomSamplingContext, SamplingContext, TraceparentData, Transaction, TransactionContext, TransactionMetadata, TransactionSource, } from './transaction';
export type { DurationUnit, InformationUnit, FractionUnit, MeasurementUnit, NoneUnit, Measurements, } from './measurement';
export type { Thread } from './thread';
export type { Transport, TransportRequest, TransportMakeRequestResponse, InternalBaseTransportOptions, BaseTransportOptions, TransportRequestExecutor, } from './transport';
export type { User, UserFeedback } from './user';
export type { WrappedFunction } from './wrappedfunction';
export type { Instrumenter } from './instrumenter';
export type { HandlerDataFetch, HandlerDataXhr, SentryXhrData, SentryWrappedXMLHttpRequest } from './instrument';
export type { BrowserClientReplayOptions } from './browseroptions';
export type { CheckIn } from './checkin';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EACV,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC7E,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvH,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACjE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACzD,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACzF,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,SAAS,EAAE,MAA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AC/C,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAEjH,YAAY,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}declare type XHRSendInput = unknown;
export interface SentryWrappedXMLHttpRequest {
    __sentry_xhr_v2__?: SentryXhrData;
    __sentry_own_request__?: boolean;
}
export interface SentryXhrData {
    method?: string;
    url?: string;
    status_code?: number;
    body?: XHRSendInput;
    request_body_size?: number;
    response_body_size?: number;
    request_headers: Record<string, string>;
}
export interface HandlerDataXhr {
    args: [string, string];
    xhr: SentryWrappedXMLHttpRequest;
    startTimestamp?: number;
    endTimestamp?: number;
}
interface SentryFetchData {
    method: string;
    url: string;
    request_body_size?: number;
    response_body_size?: number;
}
export interface HandlerDataFetch {
    args: any[];
    fetchData: SentryFetchData;
    startTimestamp: number;
    endTimestamp?: number;
    response?: unknown;
}
export {};
//# sourceMappingURL=instrument.d.ts.map{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../../src/instrument.ts"],"names":[],"mappings":"AAGA,aAAK,YAAY,GAAG,OAAO,CAAC;AAE5B,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAGD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvB,GAAG,EAAE,2BAA2B,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,SAAS,EAAE,eAAe,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}export declare type Instrumenter = 'sentry' | 'otel';
//# sourceMappingURL=instrumenter.d.ts.map{"version":3,"file":"instrumenter.d.ts","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC"}import type { EventProcessor } from './eventprocessor';
import type { Hub } from './hub';
/** Integration Class Interface */
export interface IntegrationClass<T> {
    /**
     * Property that holds the integration name
     */
    id: string;
    new (...args: any[]): T;
}
/** Integration interface */
export interface Integration {
    /**
     * Returns {@link IntegrationClass.id}
     */
    name: string;
    /**
     * Sets the integration up only once.
     * This takes no options on purpose, options should be passed in the constructor
     */
    setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub): void;
}
//# sourceMappingURL=integration.d.ts.map{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,kCAAkC;AAClC,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;CACzB;AAED,4BAA4B;AAC5B,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,GAAG,IAAI,CAAC;CACxG"}/**
 * A time duration.
 */
export declare type DurationUnit = 'nanosecond' | 'microsecond' | 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week';
/**
 * Size of information derived from bytes.
 */
export declare type InformationUnit = 'bit' | 'byte' | 'kilobyte' | 'kibibyte' | 'megabyte' | 'mebibyte' | 'gigabyte' | 'terabyte' | 'tebibyte' | 'petabyte' | 'exabyte' | 'exbibyte';
/**
 * Fractions such as percentages.
 */
export declare type FractionUnit = 'ratio' | 'percent';
/**
 * Untyped value without a unit.
 */
export declare type NoneUnit = '' | 'none';
declare type LiteralUnion<T extends string> = T | Omit<T, T>;
export declare type MeasurementUnit = LiteralUnion<DurationUnit | InformationUnit | FractionUnit | NoneUnit>;
export declare type Measurements = Record<string, {
    value: number;
    unit: MeasurementUnit;
}>;
export {};
//# sourceMappingURL=measurement.d.ts.map{"version":3,"file":"measurement.d.ts","sourceRoot":"","sources":["../../src/measurement.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,YAAY,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAExH;;GAEG;AACH,oBAAY,eAAe,GACvB,KAAK,GACL,MAAM,GACN,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,SAAS,GACT,UAAU,CAAC;AAEf;;GAEG;AACH,oBAAY,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;AAE/C;;GAEG;AACH,oBAAY,QAAQ,GAAG,EAAE,GAAG,MAAM,CAAC;AAKnC,aAAK,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAErD,oBAAY,eAAe,GAAG,YAAY,CAAC,YAAY,GAAG,eAAe,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC;AAErG,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC,CAAC"}/**
 * Metadata about a captured exception, intended to provide a hint as to the means by which it was captured.
 */
export interface Mechanism {
    /**
     * For now, restricted to `onerror`, `onunhandledrejection` (both obvious), `instrument` (the result of
     * auto-instrumentation), and `generic` (everything else). Converted to a tag on ingest.
     */
    type: string;
    /**
     * In theory, whether or not the exception has been handled by the user. In practice, whether or not we see it before
     * it hits the global error/rejection handlers, whether through explicit handling by the user or auto instrumentation.
     * Converted to a tag on ingest and used in various ways in the UI.
     */
    handled: boolean;
    /**
     * Arbitrary data to be associated with the mechanism (for example, errors coming from event handlers include the
     * handler name and the event target. Will show up in the UI directly above the stacktrace.
     */
    data?: {
        [key: string]: string | boolean;
    };
    /**
     * True when `captureException` is called with anything other than an instance of `Error` (or, in the case of browser,
     * an instance of `ErrorEvent`, `DOMError`, or `DOMException`). causing us to create a synthetic error in an attempt
     * to recreate the stacktrace.
     */
    synthetic?: boolean;
}
//# sourceMappingURL=mechanism.d.ts.map{"version":3,"file":"mechanism.d.ts","sourceRoot":"","sources":["../../src/mechanism.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,IAAI,CAAC,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;KACjC,CAAC;IAEF;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}import type { QueryParams } from './request';
/**
 * Data extracted from an incoming request to a node server
 */
export interface ExtractedNodeRequestData {
    [key: string]: any;
    /** Specific headers from the request */
    headers?: {
        [key: string]: string;
    };
    /**  The request's method */
    method?: string;
    /** The request's URL, including query string */
    url?: string;
    /** String representing the cookies sent along with the request */
    cookies?: {
        [key: string]: string;
    };
    /** The request's query params */
    query_string?: QueryParams;
    /** Any data sent in the request's body, as a JSON string */
    data?: string;
}
/**
 * Location object on a service worker's `self` object.
 *
 * See https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation.
 */
export interface WorkerLocation {
    /** The protocol scheme of the URL of the script executed in the Worker, including the final ':'. */
    readonly protocol: string;
    /** The host, that is the hostname, a ':', and the port of the URL of the script executed in the Worker. */
    readonly host: string;
    /** The domain of the URL of the script executed in the Worker. */
    readonly hostname: string;
    /** The canonical form of the origin of the specific location. */
    readonly origin: string;
    /** The port number of the URL of the script executed in the Worker. */
    readonly port: string;
    /** The path of the URL of the script executed in the Worker, beginning with a '/'. */
    readonly pathname: string;
    /** The parameters (query string) of the URL of the script executed in the Worker, beginning with a '?'. */
    readonly search: string;
    /** The fragment identifier of the URL of the script executed in the Worker, beginning with a '#'. */
    readonly hash: string;
    /** Stringifier that returns the whole URL of the script executed in the Worker. */
    readonly href: string;
    /** Synonym for `href` attribute */
    toString(): string;
}
export declare type Primitive = number | string | boolean | bigint | symbol | null | undefined;
export declare type HttpHeaderValue = string | string[] | number | null;
//# sourceMappingURL=misc.d.ts.map{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/misc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB,wCAAwC;IACxC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEpC,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,kEAAkE;IAClE,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAEpC,iCAAiC;IACjC,YAAY,CAAC,EAAE,WAAW,CAAC;IAE3B,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,oGAAoG;IACpG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,2GAA2G;IAC3G,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,2GAA2G;IAC3G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,qGAAqG;IACrG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,mFAAmF;IACnF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,mCAAmC;IACnC,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED,oBAAY,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAEvF,oBAAY,eAAe,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC"}import type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
import type { ErrorEvent, Event, EventHint, TransactionEvent } from './event';
import type { Instrumenter } from './instrumenter';
import type { Integration } from './integration';
import type { CaptureContext } from './scope';
import type { SdkMetadata } from './sdkmetadata';
import type { StackLineParser, StackParser } from './stacktrace';
import type { SamplingContext } from './transaction';
import type { BaseTransportOptions, Transport } from './transport';
export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOptions> {
    /**
     * Enable debug functionality in the SDK itself
     */
    debug?: boolean;
    /**
     * Specifies whether this SDK should send events to Sentry.
     * Defaults to true.
     */
    enabled?: boolean;
    /** Attaches stacktraces to pure capture message / log integrations */
    attachStacktrace?: boolean;
    /**
     * A flag enabling Sessions Tracking feature.
     * By default, Sessions Tracking is enabled.
     */
    autoSessionTracking?: boolean;
    /**
     * Send SDK Client Reports.
     * By default, Client Reports are enabled.
     */
    sendClientReports?: boolean;
    /**
     * The Dsn used to connect to Sentry and identify the project. If omitted, the
     * SDK will not send any data to Sentry.
     */
    dsn?: string;
    /**
     * The release identifier used when uploading respective source maps. Specify
     * this value to allow Sentry to resolve the correct source maps when
     * processing events.
     */
    release?: string;
    /** The current environment of your application (e.g. "production"). */
    environment?: string;
    /** Sets the distribution for all events */
    dist?: string;
    /**
     * List of integrations that should be installed after SDK was initialized.
     */
    integrations: Integration[];
    /**
     * The instrumenter to use. Defaults to `sentry`.
     * When not set to `sentry`, auto-instrumentation inside of Sentry will be disabled,
     * in favor of using external auto instrumentation.
     *
     * NOTE: Any option except for `sentry` is highly experimental and subject to change!
     */
    instrumenter?: Instrumenter;
    /**
     * A function that takes transport options and returns the Transport object which is used to send events to Sentry.
     * The function is invoked internally when the client is initialized.
     */
    transport: (transportOptions: TO) => Transport;
    /**
     * A stack parser implementation
     * By default, a stack parser is supplied for all supported platforms
     */
    stackParser: StackParser;
    /**
     * Options for the default transport that the SDK uses.
     */
    transportOptions?: Partial<TO>;
    /**
     * Sample rate to determine trace sampling.
     *
     * 0.0 = 0% chance of a given trace being sent (send no traces) 1.0 = 100% chance of a given trace being sent (send
     * all traces)
     *
     * Tracing is enabled if either this or `tracesSampler` is defined. If both are defined, `tracesSampleRate` is
     * ignored.
     */
    tracesSampleRate?: number;
    /**
     * If this is enabled, transactions and trace data will be generated and captured.
     * This will set the `tracesSampleRate` to the recommended default of `1.0` if `tracesSampleRate` is undefined.
     * Note that `tracesSampleRate` and `tracesSampler` take precedence over this option.
     */
    enableTracing?: boolean;
    /**
     * Initial data to populate scope.
     */
    initialScope?: CaptureContext;
    /**
     * The maximum number of breadcrumbs sent with events. Defaults to 100.
     * Sentry has a maximum payload size of 1MB and any events exceeding that payload size will be dropped.
     */
    maxBreadcrumbs?: number;
    /**
     * A global sample rate to apply to all events.
     *
     * 0.0 = 0% chance of a given event being sent (send no events) 1.0 = 100% chance of a given event being sent (send
     * all events)
     */
    sampleRate?: number;
    /** Maximum number of chars a single value can have before it will be truncated. */
    maxValueLength?: number;
    /**
     * Maximum number of levels that normalization algorithm will traverse in objects and arrays.
     * Used when normalizing an event before sending, on all of the listed attributes:
     * - `breadcrumbs.data`
     * - `user`
     * - `contexts`
     * - `extra`
     * Defaults to `3`. Set to `0` to disable.
     */
    normalizeDepth?: number;
    /**
     * Maximum number of properties or elements that the normalization algorithm will output in any single array or object included in the normalized event.
     * Used when normalizing an event before sending, on all of the listed attributes:
     * - `breadcrumbs.data`
     * - `user`
     * - `contexts`
     * - `extra`
     * Defaults to `1000`
     */
    normalizeMaxBreadth?: number;
    /**
     * Controls how many milliseconds to wait before shutting down. The default is
     * SDK-specific but typically around 2 seconds. Setting this too low can cause
     * problems for sending events from command line applications. Setting it too
     * high can cause the application to block for users with network connectivity
     * problems.
     */
    shutdownTimeout?: number;
    /**
     * A pattern for error messages which should not be sent to Sentry.
     * By default, all errors will be sent.
     */
    ignoreErrors?: Array<string | RegExp>;
    /**
     * A pattern for transaction names which should not be sent to Sentry.
     * By default, all transactions will be sent.
     */
    ignoreTransactions?: Array<string | RegExp>;
    /**
     * A URL to an envelope tunnel endpoint. An envelope tunnel is an HTTP endpoint
     * that accepts Sentry envelopes for forwarding. This can be used to force data
     * through a custom server independent of the type of data.
     */
    tunnel?: string;
    /**
     * Controls if potentially sensitive data should be sent to Sentry by default.
     * Note that this only applies to data that the SDK is sending by default
     * but not data that was explicitly set (e.g. by calling `Sentry.setUser()`).
     *
     * Defaults to `false`.
     *
     * NOTE: This option currently controls only a few data points in a selected
     * set of SDKs. The goal for this option is to eventually control all sensitive
     * data the SDK sets by default. However, this would be a breaking change so
     * until the next major update this option only controls data points which were
     * added in versions above `7.9.0`.
     */
    sendDefaultPii?: boolean;
    /**
     * Set of metadata about the SDK that can be internally used to enhance envelopes and events,
     * and provide additional data about every request.
     */
    _metadata?: SdkMetadata;
    /**
     * Options which are in beta, or otherwise not guaranteed to be stable.
     */
    _experiments?: {
        [key: string]: any;
    };
    /**
     * A pattern for error URLs which should exclusively be sent to Sentry.
     * This is the opposite of {@link Options.denyUrls}.
     * By default, all errors will be sent.
     *
     * Requires the use of the `InboundFilters` integration.
     */
    allowUrls?: Array<string | RegExp>;
    /**
     * A pattern for error URLs which should not be sent to Sentry.
     * To allow certain errors instead, use {@link Options.allowUrls}.
     * By default, all errors will be sent.
     *
     * Requires the use of the `InboundFilters` integration.
     */
    denyUrls?: Array<string | RegExp>;
    /**
     * Function to compute tracing sample rate dynamically and filter unwanted traces.
     *
     * Tracing is enabled if either this or `tracesSampleRate` is defined. If both are defined, `tracesSampleRate` is
     * ignored.
     *
     * Will automatically be passed a context object of default and optional custom data. See
     * {@link Transaction.samplingContext} and {@link Hub.startTransaction}.
     *
     * @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent). Returning `true` is
     * equivalent to returning 1 and returning `false` is equivalent to returning 0.
     */
    tracesSampler?: (samplingContext: SamplingContext) => number | boolean;
    /**
     * An event-processing callback for error and message events, guaranteed to be invoked after all other event
     * processors, which allows an event to be modified or dropped.
     *
     * Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
     * it at the end. Returning `null` will cause the event to be dropped.
     *
     * @param event The error or message event generated by the SDK.
     * @param hint Event metadata useful for processing.
     * @returns A new event that will be sent | null.
     */
    beforeSend?: (event: ErrorEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
    /**
     * An event-processing callback for transaction events, guaranteed to be invoked after all other event
     * processors. This allows an event to be modified or dropped before it's sent.
     *
     * Note that you must return a valid event from this callback. If you do not wish to modify the event, simply return
     * it at the end. Returning `null` will cause the event to be dropped.
     *
     * @param event The error or message event generated by the SDK.
     * @param hint Event metadata useful for processing.
     * @returns A new event that will be sent | null.
     */
    beforeSendTransaction?: (event: TransactionEvent, hint: EventHint) => PromiseLike<Event | null> | Event | null;
    /**
     * A callback invoked when adding a breadcrumb, allowing to optionally modify
     * it before adding it to future events.
     *
     * Note that you must return a valid breadcrumb from this callback. If you do
     * not wish to modify the breadcrumb, simply return it at the end.
     * Returning null will cause the breadcrumb to be dropped.
     *
     * @param breadcrumb The breadcrumb as created by the SDK.
     * @returns The breadcrumb that will be added | null.
     */
    beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
}
/** Base configuration options for every SDK. */
export interface Options<TO extends BaseTransportOptions = BaseTransportOptions> extends Omit<Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'> {
    /**
     * If this is set to false, default integrations will not be added, otherwise this will internally be set to the
     * recommended default integrations.
     */
    defaultIntegrations?: false | Integration[];
    /**
     * List of integrations that should be installed after SDK was initialized.
     * Accepts either a list of integrations or a function that receives
     * default integrations and returns a new, updated list.
     */
    integrations?: Integration[] | ((integrations: Integration[]) => Integration[]);
    /**
     * A function that takes transport options and returns the Transport object which is used to send events to Sentry.
     * The function is invoked internally during SDK initialization.
     * By default, the SDK initializes its default transports.
     */
    transport?: (transportOptions: TO) => Transport;
    /**
     * A stack parser implementation or an array of stack line parsers
     * By default, a stack parser is supplied for all supported browsers
     */
    stackParser?: StackParser | StackLineParser[];
}
//# sourceMappingURL=options.d.ts.map{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,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AE,SAAS,KAAK,WAAW,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC;IAE/G;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,cAAc,KAAK,UAAU,GAAG,IAAI,CAAC;CACzF;AAED,gDAAgD;AAChD,MAAM,WAAW,OAAO,CAAC,EAAE,SAAS,oBAAoB,GAAG,oBAAoB,CAC7E,SAAQ,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,GAAG,WAAW,GAAG,aAAa,CAAC;IACtF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,KAAK,GAAG,WAAW,EAAE,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,CAAC,CAAC;IAEhF;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,gBAAgB,EAAE,EAAE,KAAK,SAAS,CAAC;IAEhD;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,eAAe,EAAE,CAAC;CAC/C"}/** JSDoc */
export interface Package {
    name: string;
    version: string;
}
//# sourceMappingURL=package.d.ts.map{"version":3,"file":"package.d.ts","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB"}/**
 * Event-like interface that's usable in browser and node.
 *
 * Note: Here we mean the kind of events handled by event listeners, not our `Event` type.
 *
 * Property availability taken from https://developer.mozilla.org/en-US/docs/Web/API/Event#browser_compatibility
 */
export interface PolymorphicEvent {
    [key: string]: unknown;
    readonly type: string;
    readonly target?: unknown;
    readonly currentTarget?: unknown;
}
/** A `Request` type compatible with Node, Express, browser, etc., because everything is optional */
export declare type PolymorphicRequest = BaseRequest & BrowserRequest & NodeRequest & ExpressRequest & KoaRequest & NextjsRequest;
declare type BaseRequest = {
    method?: string;
    url?: string;
};
declare type BrowserRequest = BaseRequest;
declare type NodeRequest = BaseRequest & {
    headers?: {
        [key: string]: string | string[] | undefined;
    };
    protocol?: string;
    socket?: {
        encrypted?: boolean;
        remoteAddress?: string;
    };
};
declare type KoaRequest = NodeRequest & {
    host?: string;
    hostname?: string;
    ip?: string;
    originalUrl?: string;
};
declare type NextjsRequest = NodeRequest & {
    cookies?: {
        [key: string]: string;
    };
    query?: {
        [key: string]: any;
    };
};
declare type ExpressRequest = NodeRequest & {
    baseUrl?: string;
    body?: string | {
        [key: string]: any;
    };
    host?: string;
    hostname?: string;
    ip?: string;
    originalUrl?: string;
    route?: {
        path: string;
        stack: [{
            name: string;
        }];
    };
    query?: {
        [key: string]: any;
    };
    user?: {
        [key: string]: any;
    };
};
export {};
//# sourceMappingURL=polymorphics.d.ts.map{"version":3,"file":"polymorphics.d.ts","sourceRoot":"","sources":["../../src/polymorphics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,oGAAoG;AACpG,oBAAY,kBAAkB,GAAG,WAAW,GAC1C,cAAc,GACd,WAAW,GACX,cAAc,GACd,UAAU,GACV,aAAa,CAAC;AAEhB,aAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,aAAK,cAAc,GAAG,WAAW,CAAC;AAElC,aAAK,WAAW,GAAG,WAAW,GAAG;IAC/B,OAAO,CAAC,EAA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G,GAAG,CAAC;KACpB,CAAC;CACH,CAAC"}import type { Event } from './event';
/**
 * NOTE: These types are still considered Beta and subject to change.
 * @hidden
 */
export interface ReplayEvent extends Event {
    urls: string[];
    replay_start_timestamp?: number;
    error_ids: string[];
    trace_ids: string[];
    replay_id: string;
    segment_id: number;
    replay_type: ReplayRecordingMode;
}
/**
 * NOTE: These types are still considered Beta and subject to change.
 * @hidden
 */
export declare type ReplayRecordingData = string | Uint8Array;
/**
 * NOTE: These types are still considered Beta and subject to change.
 * @hidden
 */
export declare type ReplayRecordingMode = 'session' | 'error';
//# sourceMappingURL=replay.d.ts.map{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../src/replay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,mBAAmB,CAAC;CAClC;AAED;;;GAGG;AACH,oBAAY,mBAAmB,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtD;;;GAGG;AACH,oBAAY,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAAC"}/** Request data included in an event as sent to Sentry */
export interface Request {
    url?: string;
    method?: string;
    data?: any;
    query_string?: QueryParams;
    cookies?: {
        [key: string]: string;
    };
    env?: {
        [key: string]: string;
    };
    headers?: {
        [key: string]: string;
    };
}
export declare type QueryParams = string | {
    [key: string]: string;
} | Array<[string, string]>;
/**
 * Request data that is considered safe for `span.data` on `http.client` spans
 * and for `http` breadcrumbs
 * See https://develop.sentry.dev/sdk/data-handling/#structuring-data
 */
export declare type SanitizedRequestData = {
    url: string;
    method: string;
    'http.fragment'?: string;
    'http.query'?: string;
};
//# sourceMappingURL=request.d.ts.map{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACpC,GAAG,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACrC;AAED,oBAAY,WAAW,GAAG,MAAM,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvF;;;;GAIG;AACH,oBAAY,oBAAoB,GAAG;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC"}/** Runtime Context. */
export interface Runtime {
    name?: string;
    version?: string;
}
//# sourceMappingURL=runtime.d.ts.map{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}import type { Attachment } from './attachment';
import type { Breadcrumb } from './breadcrumb';
import type { Context, Contexts } from './context';
import type { EventProcessor } from './eventprocessor';
import type { Extra, Extras } from './extra';
import type { Primitive } from './misc';
import type { RequestSession, Session } from './session';
import type { Severity, SeverityLevel } from './severity';
import type { Span } from './span';
import type { Transaction } from './transaction';
import type { User } from './user';
/** JSDocs */
export declare type CaptureContext = Scope | Partial<ScopeContext> | ((scope: Scope) => Scope);
/** JSDocs */
export interface ScopeContext {
    user: User;
    level: Severity | SeverityLevel;
    extra: Extras;
    contexts: Contexts;
    tags: {
        [key: string]: Primitive;
    };
    fingerprint: string[];
    requestSession: RequestSession;
}
/**
 * Holds additional event information. {@link Scope.applyToEvent} will be called by the client before an event is sent.
 */
export interface Scope {
    /** Add new event processor that will be called after {@link applyToEvent}. */
    addEventProcessor(callback: EventProcessor): this;
    /**
     * Updates user context information for future events.
     *
     * @param user User context object to be set in the current context. Pass `null` to unset the user.
     */
    setUser(user: User | null): this;
    /**
     * Returns the `User` if there is one
     */
    getUser(): User | undefined;
    /**
     * Set an object that will be merged sent as tags data with the event.
     * @param tags Tags context object to merge into current context.
     */
    setTags(tags: {
        [key: string]: Primitive;
    }): this;
    /**
     * Set key:value that will be sent as tags data with the event.
     *
     * Can also be used to unset a tag by passing `undefined`.
     *
     * @param key String key of tag
     * @param value Value of tag
     */
    setTag(key: string, value: Primitive): this;
    /**
     * Set an object that will be merged sent as extra data with the event.
     * @param extras Extras object to merge into current context.
     */
    setExtras(extras: Extras): this;
    /**
     * Set key:value that will be sent as extra data with the event.
     * @param key String of extra
     * @param extra Any kind of data. This data will be normalized.
     */
    setExtra(key: string, extra: Extra): this;
    /**
     * Sets the fingerprint on the scope to send with the events.
     * @param fingerprint string[] to group events in Sentry.
     */
    setFingerprint(fingerprint: string[]): this;
    /**
     * Sets the level on the scope for future events.
     * @param level string {@link SeverityLevel}
     */
    setLevel(level: Severity | SeverityLevel): this;
    /**
     * Sets the transaction name on the scope for future events.
     */
    setTransactionName(name?: string): this;
    /**
     * Sets context data with the given name.
     * @param name of the context
     * @param context an object containing context data. This data will be normalized. Pass `null` to unset the context.
     */
    setContext(name: string, context: Context | null): this;
    /**
     * Sets the Span on the scope.
     * @param span Span
     */
    setSpan(span?: Span): this;
    /**
     * Returns the `Span` if there is one
     */
    getSpan(): Span | undefined;
    /**
     * Returns the `Transaction` attached to the scope (if there is one)
     */
    getTransaction(): Transaction | undefined;
    /**
     * Returns the `Session` if there is one
     */
    getSession(): Session | undefined;
    /**
     * Sets the `Session` on the scope
     */
    setSession(session?: Session): this;
    /**
     * Returns the `RequestSession` if there is one
     */
    getRequestSession(): RequestSession | undefined;
    /**
     * Sets the `RequestSession` on the scope
     */
    setRequestSession(requestSession?: RequestSession): this;
    /**
     * Updates the scope with provided data. Can work in three variations:
     * - plain object containing updatable attributes
     * - Scope instance that'll extract the attributes from
     * - callback function that'll receive the current scope as an argument and allow for modifications
     * @param captureContext scope modifier to be used
     */
    update(captureContext?: CaptureContext): this;
    /** Clears the current scope and resets its properties. */
    clear(): this;
    /**
     * Sets the breadcrumbs in the scope
     * @param breadcrumbs Breadcrumb
     * @param maxBreadcrumbs number of max breadcrumbs to merged into event.
     */
    addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
    /**
     * Get the last breadcrumb.
     */
    getLastBreadcrumb(): Breadcrumb | undefined;
    /**
     * Clears all currently set Breadcrumbs.
     */
    clearBreadcrumbs(): this;
    /**
     * Adds an attachment to the scope
     * @param attachment Attachment options
     */
    addAttachment(attachment: Attachment): this;
    /**
     * Returns an array of attachments on the scope
     */
    getAttachments(): Attachment[];
    /**
     * Clears attachments from the scope
     */
    clearAttachments(): this;
    /**
     * Add data which will be accessible during event processing but won't get sent to Sentry
     */
    setSDKProcessingMetadata(newData: {
        [key: string]: unknown;
    }): this;
}
//# sourceMappingURL=scope.d.ts.map{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UA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CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAE9C,0DAA0D;IAC1D,KAAK,IAAI,IAAI,CAAC;IAEd;;;;OAIG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErE;;OAEG;IACH,iBAAiB,IAAI,UAAU,GAAG,SAAS,CAAC;IAE5C;;OAEG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAE5C;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE,CAAC;IAE/B;;OAEG;IACH,gBAAgB,IAAI,IAAI,CAAC;IAEzB;;OAEG;IACH,wBAAwB,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;CACrE"}import type { Package } from './package';
export interface SdkInfo {
    name?: string;
    version?: string;
    integrations?: string[];
    packages?: Package[];
}
//# sourceMappingURL=sdkinfo.d.ts.map{"version":3,"file":"sdkinfo.d.ts","sourceRoot":"","sources":["../../src/sdkinfo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,OAAO;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB"}import type { SdkInfo } from './sdkinfo';
export interface SdkMetadata {
    sdk?: SdkInfo;
}
//# sourceMappingURL=sdkmetadata.d.ts.map{"version":3,"file":"sdkmetadata.d.ts","sourceRoot":"","sources":["../../src/sdkmetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,OAAO,CAAC;CACf"}import type { User } from './user';
export interface RequestSession {
    status?: RequestSessionStatus;
}
export interface Session {
    sid: string;
    did?: string;
    init: boolean;
    timestamp: number;
    started: number;
    duration?: number;
    status: SessionStatus;
    release?: string;
    environment?: string;
    userAgent?: string;
    ipAddress?: string;
    errors: number;
    user?: User | null;
    ignoreDuration: boolean;
    /**
     * Overrides default JSON serialization of the Session because
     * the Sentry servers expect a slightly different schema of a session
     * which is described in the interface @see SerializedSession in this file.
     *
     * @return a Sentry-backend conforming JSON object of the session
     */
    toJSON(): SerializedSession;
}
export declare type SessionContext = Partial<Session>;
export declare type SessionStatus = 'ok' | 'exited' | 'crashed' | 'abnormal';
export declare type RequestSessionStatus = 'ok' | 'errored' | 'crashed';
/** JSDoc */
export interface SessionAggregates {
    attrs?: {
        environment?: string;
        release?: string;
    };
    aggregates: Array<AggregationCounts>;
}
export interface SessionFlusherLike {
    /**
     * Increments the Session Status bucket in SessionAggregates Object corresponding to the status of the session
     * captured
     */
    incrementSessionStatusCount(): void;
    /** Empties Aggregate Buckets and Sends them to Transport Buffer */
    flush(): void;
    /** Clears setInterval and calls flush */
    close(): void;
}
export interface AggregationCounts {
    started: string;
    errored?: number;
    exited?: number;
    crashed?: number;
}
export interface SerializedSession {
    init: boolean;
    sid: string;
    did?: string;
    timestamp: string;
    started: string;
    duration?: number;
    status: SessionStatus;
    errors: number;
    attrs?: {
        release?: string;
        environment?: string;
        user_agent?: string;
        ip_address?: string;
    };
}
//# sourceMappingURL=session.d.ts.map{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC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iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}/**
 * @deprecated Please use a `SeverityLevel` string instead of the `Severity` enum. Acceptable values are 'fatal',
 * 'error', 'warning', 'log', 'info', and 'debug'.
 */
export declare enum Severity {
    /** JSDoc */
    Fatal = "fatal",
    /** JSDoc */
    Error = "error",
    /** JSDoc */
    Warning = "warning",
    /** JSDoc */
    Log = "log",
    /** JSDoc */
    Info = "info",
    /** JSDoc */
    Debug = "debug"
}
export declare type SeverityLevel = 'fatal' | 'error' | 'warning' | 'log' | 'info' | 'debug';
//# sourceMappingURL=severity.d.ts.map{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../src/severity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,QAAQ;IAClB,YAAY;IACZ,KAAK,UAAU;IACf,YAAY;IACZ,KAAK,UAAU;IACf,YAAY;IACZ,OAAO,YAAY;IACnB,YAAY;IACZ,GAAG,QAAQ;IACX,YAAY;IACZ,IAAI,SAAS;IACb,YAAY;IACZ,KAAK,UAAU;CAChB;AAID,oBAAY,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC"}import type { Instrumenter } from './instrumenter';
import type { Primitive } from './misc';
import type { Transaction } from './transaction';
/** Interface holding all properties that can be set on a Span on creation. */
export interface SpanContext {
    /**
     * Description of the Span.
     */
    description?: string;
    /**
     * Operation of the Span.
     */
    op?: string;
    /**
     * Completion status of the Span.
     * See: {@sentry/tracing SpanStatus} for possible values
     */
    status?: string;
    /**
     * Parent Span ID
     */
    parentSpanId?: string;
    /**
     * Was this span chosen to be sent as part of the sample?
     */
    sampled?: boolean;
    /**
     * Span ID
     */
    spanId?: string;
    /**
     * Trace ID
     */
    traceId?: string;
    /**
     * Tags of the Span.
     */
    tags?: {
        [key: string]: Primitive;
    };
    /**
     * Data of the Span.
     */
    data?: {
        [key: string]: any;
    };
    /**
     * Timestamp in seconds (epoch time) indicating when the span started.
     */
    startTimestamp?: number;
    /**
     * Timestamp in seconds (epoch time) indicating when the span ended.
     */
    endTimestamp?: number;
    /**
     * The instrumenter that created this span.
     */
    instrumenter?: Instrumenter;
}
/** Span holding trace_id, span_id */
export interface Span extends SpanContext {
    /**
     * @inheritDoc
     */
    spanId: string;
    /**
     * @inheritDoc
     */
    traceId: string;
    /**
     * @inheritDoc
     */
    startTimestamp: number;
    /**
     * @inheritDoc
     */
    tags: {
        [key: string]: Primitive;
    };
    /**
     * @inheritDoc
     */
    data: {
        [key: string]: any;
    };
    /**
     * The transaction containing this span
     */
    transaction?: Transaction;
    /**
     * The instrumenter that created this span.
     */
    instrumenter: Instrumenter;
    /**
     * Sets the finish timestamp on the current span.
     * @param endTimestamp Takes an endTimestamp if the end should not be the time when you call this function.
     */
    finish(endTimestamp?: number): void;
    /**
     * Sets the tag attribute on the current span.
     *
     * Can also be used to unset a tag, by passing `undefined`.
     *
     * @param key Tag key
     * @param value Tag value
     */
    setTag(key: string, value: Primitive): this;
    /**
     * Sets the data attribute on the current span
     * @param key Data key
     * @param value Data value
     */
    setData(key: string, value: any): this;
    /**
     * Sets the status attribute on the current span
     * See: {@sentry/tracing SpanStatus} for possible values
     * @param status http code used to set the status
     */
    setStatus(status: string): this;
    /**
     * Sets the status attribute on the current span based on the http code
     * @param httpStatus http code used to set the status
     */
    setHttpStatus(httpStatus: number): this;
    /**
     * Creates a new `Span` while setting the current `Span.id` as `parentSpanId`.
     * Also the `sampled` decision will be inherited.
     */
    startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
    /**
     * Determines whether span was successful (HTTP200)
     */
    isSuccess(): boolean;
    /** Return a traceparent compatible header string */
    toTraceparent(): string;
    /** Returns the current span properties as a `SpanContext` */
    toContext(): SpanContext;
    /** Updates the current span with a new `SpanContext` */
    updateWithContext(spanContext: SpanContext): this;
    /** Convert the object to JSON for w. spans array info only */
    getTraceContext(): {
        data?: {
            [key: string]: any;
        };
        description?: string;
        op?: string;
        parent_span_id?: string;
        span_id: string;
        status?: string;
        tags?: {
            [key: string]: Primitive;
        };
        trace_id: string;
    };
    /** Convert the object to JSON */
    toJSON(): {
        data?: {
            [key: string]: any;
        };
        description?: string;
        op?: string;
        parent_span_id?: string;
        span_id: string;
        start_timestamp: number;
        status?: string;
        tags?: {
            [key: string]: Primitive;
        };
        timestamp?: number;
        trace_id: string;
    };
}
//# sourceMappingURL=span.d.ts.map{"version":3,"file":"span.d.ts","sourceRoot":"","sources":["../../src/span.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,8EAA8E;AAC9E,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,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CAAA;SAAE,CAAC;QACpC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH"}/** JSDoc */
export interface StackFrame {
    filename?: string;
    function?: string;
    module?: string;
    platform?: string;
    lineno?: number;
    colno?: number;
    abs_path?: string;
    context_line?: string;
    pre_context?: string[];
    post_context?: string[];
    in_app?: boolean;
    instruction_addr?: string;
    addr_mode?: string;
    vars?: {
        [key: string]: any;
    };
    debug_id?: string;
}
//# sourceMappingURL=stackframe.d.ts.map{"version":3,"file":"stackframe.d.ts","sourceRoot":"","sources":["../../src/stackframe.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}import type { StackFrame } from './stackframe';
/** JSDoc */
export interface Stacktrace {
    frames?: StackFrame[];
    frames_omitted?: [number, number];
}
export declare type StackParser = (stack: string, skipFirst?: number) => StackFrame[];
export declare type StackLineParserFn = (line: string) => StackFrame | undefined;
export declare type StackLineParser = [number, StackLineParserFn];
//# sourceMappingURL=stacktrace.d.ts.map{"version":3,"file":"stacktrace.d.ts","sourceRoot":"","sources":["../../src/stacktrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY;AACZ,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,oBAAY,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,UAAU,EAAE,CAAC;AAC9E,oBAAY,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAC;AACzE,oBAAY,eAAe,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC"}/**
 * Vendored type from TS 3.8 `typescript/lib/lib.dom.d.ts`.
 *
 * Type is vendored in so that users don't have to opt-in to DOM types.
 */
export interface TextEncoderCommon {
    /**
     * Returns "utf-8".
     */
    readonly encoding: string;
}
export interface TextEncoderInternal extends TextEncoderCommon {
    encode(input?: string): Uint8Array;
}
//# sourceMappingURL=textencoder.d.ts.map{"version":3,"file":"textencoder.d.ts","sourceRoot":"","sources":["../../src/textencoder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAGD,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;CACpC"}import type { Stacktrace } from './stacktrace';
/** JSDoc */
export interface Thread {
    id?: number;
    name?: string;
    stacktrace?: Stacktrace;
    crashed?: boolean;
    current?: boolean;
}
//# sourceMappingURL=thread.d.ts.map{"version":3,"file":"thread.d.ts","sourceRoot":"","sources":["../../src/thread.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY;AACZ,MAAM,WAAW,MAAM;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}export declare type TracePropagationTargets = (string | RegExp)[];
//# sourceMappingURL=tracing.d.ts.map{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA,oBAAY,uBAAuB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC"}import type { Context } from './context';
import type { DynamicSamplingContext } from './envelope';
import type { Instrumenter } from './instrumenter';
import type { MeasurementUnit } from './measurement';
import type { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
import type { PolymorphicRequest } from './polymorphics';
import type { Span, SpanContext } from './span';
/**
 * Interface holding Transaction-specific properties
 */
export interface TransactionContext extends SpanContext {
    /**
     * Human-readable identifier for the transaction
     */
    name: string;
    /**
     * If true, sets the end timestamp of the transaction to the highest timestamp of child spans, trimming
     * the duration of the transaction. This is useful to discard extra time in the transaction that is not
     * accounted for in child spans, like what happens in the idle transaction Tracing integration, where we finish the
     * transaction after a given "idle time" and we don't want this "idle time" to be part of the transaction.
     */
    trimEnd?: boolean;
    /**
     * If this transaction has a parent, the parent's sampling decision
     */
    parentSampled?: boolean;
    /**
     * Metadata associated with the transaction, for internal SDK use.
     */
    metadata?: Partial<TransactionMetadata>;
}
/**
 * Data pulled from a `sentry-trace` header
 */
export declare type TraceparentData = Pick<TransactionContext, 'traceId' | 'parentSpanId' | 'parentSampled'>;
/**
 * Transaction "Class", inherits Span only has `setName`
 */
export interface Transaction extends TransactionContext, Span {
    /**
     * @inheritDoc
     */
    spanId: string;
    /**
     * @inheritDoc
     */
    traceId: string;
    /**
     * @inheritDoc
     */
    startTimestamp: number;
    /**
     * @inheritDoc
     */
    tags: {
        [key: string]: Primitive;
    };
    /**
     * @inheritDoc
     */
    data: {
        [key: string]: any;
    };
    /**
     * Metadata about the transaction
     */
    metadata: TransactionMetadata;
    /**
     * The instrumenter that created this transaction.
     */
    instrumenter: Instrumenter;
    /**
     * Set the name of the transaction
     */
    setName(name: string, source?: TransactionMetadata['source']): void;
    /**
     * Set the context of a transaction event
     */
    setContext(key: string, context: Context): void;
    /**
     * Set observed measurement for this transaction.
     *
     * @param name Name of the measurement
     * @param value Value of the measurement
     * @param unit Unit of the measurement. (Defaults to an empty string)
     */
    setMeasurement(name: string, value: number, unit: MeasurementUnit): void;
    /** Returns the current transaction properties as a `TransactionContext` */
    toContext(): TransactionContext;
    /** Updates the current transaction with a new `TransactionContext` */
    updateWithContext(transactionContext: TransactionContext): this;
    /**
     * Set metadata for this transaction.
     * @hidden
     */
    setMetadata(newMetadata: Partial<TransactionMetadata>): void;
    /** Return the current Dynamic Sampling Context of this transaction */
    getDynamicSamplingContext(): Partial<DynamicSamplingContext>;
}
/**
 * Context data passed by the user when starting a transaction, to be used by the tracesSampler method.
 */
export interface CustomSamplingContext {
    [key: string]: any;
}
/**
 * Data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.
 *
 * Adds default data to data provided by the user. See {@link Hub.startTransaction}
 */
export interface SamplingContext extends CustomSamplingContext {
    /**
     * Context data with which transaction being sampled was created
     */
    transactionContext: TransactionContext;
    /**
     * Sampling decision from the parent transaction, if any.
     */
    parentSampled?: boolean;
    /**
     * Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
     * integration.
     */
    location?: WorkerLocation;
    /**
     * Object representing the incoming request to a node server. Passed by default when using the TracingHandler.
     */
    request?: ExtractedNodeRequestData;
}
export interface TransactionMetadata {
    /** The sample rate used when sampling this transaction */
    sampleRate?: number;
    /**
     * The Dynamic Sampling Context of a transaction. If provided during transaction creation, its Dynamic Sampling
     * Context Will be frozen
     */
    dynamicSamplingContext?: Partial<DynamicSamplingContext>;
    /** For transactions tracing server-side request handling, the request being tracked. */
    request?: PolymorphicRequest;
    /** Compatibility shim for transitioning to the `RequestData` integration. The options passed to our Express request
     * handler controlling what request data is added to the event.
     * TODO (v8): This should go away
     */
    requestDataOptionsFromExpressHandler?: {
        [key: string]: unknown;
    };
    /** For transactions tracing server-side request handling, the path of the request being tracked. */
    /** TODO: If we rm -rf `instrumentServer`, this can go, too */
    requestPath?: string;
    /** Information on how a transaction name was generated. */
    source: TransactionSource;
    /** Metadata for the transaction's spans, keyed by spanId */
    spanMetadata: {
        [spanId: string]: {
            [key: string]: unknown;
        };
    };
}
/**
 * Contains information about how the name of the transaction was determined. This will be used by the server to decide
 * whether or not to scrub identifiers from the transaction name, or replace the entire name with a placeholder.
 */
export declare type TransactionSource = 
/** User-defined name */
'custom'
/** Raw URL, potentially containing identifiers */
 | 'url'
/** Parametrized URL / route */
 | 'route'
/** Name of the view handling the request */
 | 'view'
/** Named after a software component, such as a function or class name. */
 | 'component'
/** Name of a background task (e.g. a Celery task) */
 | 'task';
//# sourceMappingURL=transaction.d.ts.map{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,QAAQ,C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GAChD,KAAK;AACP,+BAA+B;GAC7B,OAAO;AACT,4CAA4C;GAC1C,MAAM;AACR,0EAA0E;GACxE,WAAW;AACb,qDAAqD;GACnD,MAAM,CAAC"}import type { Client } from './client';
import type { Envelope } from './envelope';
import type { TextEncoderInternal } from './textencoder';
export declare type TransportRequest = {
    body: string | Uint8Array;
};
export declare type TransportMakeRequestResponse = {
    statusCode?: number;
    headers?: {
        [key: string]: string | null;
        'x-sentry-rate-limits': string | null;
        'retry-after': string | null;
    };
};
export interface InternalBaseTransportOptions {
    bufferSize?: number;
    recordDroppedEvent: Client['recordDroppedEvent'];
    textEncoder?: TextEncoderInternal;
}
export interface BaseTransportOptions extends InternalBaseTransportOptions {
    url: string;
}
export interface Transport {
    send(request: Envelope): PromiseLike<void | TransportMakeRequestResponse>;
    flush(timeout?: number): PromiseLike<boolean>;
}
export declare type TransportRequestExecutor = (request: TransportRequest) => PromiseLike<TransportMakeRequestResponse>;
//# sourceMappingURL=transport.d.ts.map{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC3B,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;QAC7B,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC,oBAAoB,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,WAAW,oBAAqB,SAAQ,4BAA4B;IAIxE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IAExB,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,CAAC,IAAI,GAAG,4BAA4B,CAAC,CAAC;IAC1E,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED,oBAAY,wBAAwB,GAAG,CAAC,OAAO,EAAE,gBAAgB,KAAK,WAAW,CAAC,4BAA4B,CAAC,CAAC"}/** JSDoc */
export interface User {
    [key: string]: any;
    id?: string;
    ip_address?: string;
    email?: string;
    username?: string;
    segment?: string;
}
export interface UserFeedback {
    event_id: string;
    email: User['email'];
    name: string;
    comments: string;
}
//# sourceMappingURL=user.d.ts.map{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/user.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB"}/** JSDoc */
export interface WrappedFunction extends Function {
    [key: string]: any;
    __sentry_wrapped__?: WrappedFunction;
    __sentry_original__?: WrappedFunction;
}
//# sourceMappingURL=wrappedfunction.d.ts.map{"version":3,"file":"wrappedfunction.d.ts","sourceRoot":"","sources":["../../src/wrappedfunction.ts"],"names":[],"mappings":"AAAA,YAAY;AACZ,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,kBAAkB,CAAC,EAAE,eAAe,CAAC;IACrC,mBAAmB,CAAC,EAAE,eAAe,CAAC;CACvC"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');
const logger = require('./logger.js');

const BAGGAGE_HEADER_NAME = 'baggage';

const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';

const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;

/**
 * Max length of a serialized baggage string
 *
 * https://www.w3.org/TR/baggage/#limits
 */
const MAX_BAGGAGE_STRING_LENGTH = 8192;

/**
 * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values
 * from it.
 *
 * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.
 * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.
 */
function baggageHeaderToDynamicSamplingContext(
  // Very liberal definition of what any incoming header might look like
  baggageHeader,
) {
  if (!is.isString(baggageHeader) && !Array.isArray(baggageHeader)) {
    return undefined;
  }

  // Intermediary object to store baggage key value pairs of incoming baggage headers on.
  // It is later used to read Sentry-DSC-values from.
  let baggageObject = {};

  if (Array.isArray(baggageHeader)) {
    // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it
    baggageObject = baggageHeader.reduce((acc, curr) => {
      const currBaggageObject = baggageHeaderToObject(curr);
      return {
        ...acc,
        ...currBaggageObject,
      };
    }, {});
  } else {
    // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but
    // this is how we choose to handle it)
    if (!baggageHeader) {
      return undefined;
    }

    baggageObject = baggageHeaderToObject(baggageHeader);
  }

  // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object.
  const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {
    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {
      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);
      acc[nonPrefixedKey] = value;
    }
    return acc;
  }, {});

  // Only return a dynamic sampling context object if there are keys in it.
  // A keyless object means there were no sentry values on the header, which means that there is no DSC.
  if (Object.keys(dynamicSamplingContext).length > 0) {
    return dynamicSamplingContext ;
  } else {
    return undefined;
  }
}

/**
 * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-".
 *
 * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility
 * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is
 * `undefined` the function will return `undefined`.
 * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`
 * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.
 */
function dynamicSamplingContextToSentryBaggageHeader(
  // this also takes undefined for convenience and bundle size in other places
  dynamicSamplingContext,
) {
  // Prefix all DSC keys with "sentry-" and put them into a new object
  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
    (acc, [dscKey, dscValue]) => {
      if (dscValue) {
        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;
      }
      return acc;
    },
    {},
  );

  return objectToBaggageHeader(sentryPrefixedDSC);
}

/**
 * Will parse a baggage header, which is a simple key-value map, into a flat object.
 *
 * @param baggageHeader The baggage header to parse.
 * @returns a flat object containing all the key-value pairs from `baggageHeader`.
 */
function baggageHeaderToObject(baggageHeader) {
  return baggageHeader
    .split(',')
    .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))
    .reduce((acc, [key, value]) => {
      acc[key] = value;
      return acc;
    }, {});
}

/**
 * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.
 *
 * @param object The object to turn into a baggage header.
 * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header
 * is not spec compliant.
 */
function objectToBaggageHeader(object) {
  if (Object.keys(object).length === 0) {
    // An empty baggage header is not spec compliant: We return undefined.
    return undefined;
  }

  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.logger.warn(
          `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,
        );
      return baggageHeader;
    } else {
      return newBaggageHeader;
    }
  }, '');
}

exports.BAGGAGE_HEADER_NAME = BAGGAGE_HEADER_NAME;
exports.MAX_BAGGAGE_STRING_LENGTH = MAX_BAGGAGE_STRING_LENGTH;
exports.SENTRY_BAGGAGE_KEY_PREFIX = SENTRY_BAGGAGE_KEY_PREFIX;
exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = SENTRY_BAGGAGE_KEY_PREFIX_REGEX;
exports.baggageHeaderToDynamicSamplingContext = baggageHeaderToDynamicSamplingContext;
exports.dynamicSamplingContextToSentryBaggageHeader = dynamicSamplingContextToSentryBaggageHeader;
//# sourceMappingURL=baggage.js.map
{"version":3,"file":"baggage.js","sources":["../../src/baggage.ts"],"sourcesContent":["import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n  // Very liberal definition of what any incoming header might look like\n  baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n  if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n    return undefined;\n  }\n\n  // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n  // It is later used to read Sentry-DSC-values from.\n  let baggageObject: Readonly<Record<string, string>> = {};\n\n  if (Array.isArray(baggageHeader)) {\n    // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n    baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n      const currBaggageObject = baggageHeaderToObject(curr);\n      return {\n        ...acc,\n        ...currBaggageObject,\n      };\n    }, {});\n  } else {\n    // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n    // this is how we choose to handle it)\n    if (!baggageHeader) {\n      return undefined;\n    }\n\n    baggageObject = baggageHeaderToObject(baggageHeader);\n  }\n\n  // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n  const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n      acc[nonPrefixedKey] = value;\n    }\n    return acc;\n  }, {});\n\n  // Only return a dynamic sampling context object if there are keys in it.\n  // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n  if (Object.keys(dynamicSamplingContext).length > 0) {\n    return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n  } else {\n    return undefined;\n  }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n  // this also takes undefined for convenience and bundle size in other places\n  dynamicSamplingContext: Partial<DynamicSamplingContext>,\n): string | undefined {\n  // Prefix all DSC keys with \"sentry-\" and put them into a new object\n  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n    (acc, [dscKey, dscValue]) => {\n      if (dscValue) {\n        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n      }\n      return acc;\n    },\n    {},\n  );\n\n  return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n  return baggageHeader\n    .split(',')\n    .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n    .reduce<Record<string, string>>((acc, [key, value]) => {\n      acc[key] = value;\n      return acc;\n    }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record<string, string>): string | undefined {\n  if (Object.keys(object).length === 0) {\n    // An empty baggage header is not spec compliant: We return undefined.\n    return undefined;\n  }\n\n  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n        );\n      return baggageHeader;\n    } else {\n      return newBaggageHeader;\n    }\n  }, '');\n}\n"],"names":["isString","logger"],"mappings":";;;;;AAKA,MAAA,mBAAA,GAAA,UAAA;AACA;AACA,MAAA,yBAAA,GAAA,UAAA;AACA;AACA,MAAA,+BAAA,GAAA,WAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,yBAAA,GAAA,KAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qCAAA;AACA;AACA,EAAA,aAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAAA,WAAA,CAAA,aAAA,CAAA,IAAA,CAAA,KAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,aAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA;AACA;AACA,IAAA,aAAA,GAAA,aAAA,CAAA,MAAA,CAAA,CAAA,GAAA,EAAA,IAAA,KAAA;AACA,MAAA,MAAA,iBAAA,GAAA,qBAAA,CAAA,IAAA,CAAA,CAAA;AACA,MAAA,OAAA;AACA,QAAA,GAAA,GAAA;AACA,QAAA,GAAA,iBAAA;AACA,OAAA,CAAA;AACA,KAAA,EAAA,EAAA,CAAA,CAAA;AACA,GAAA,MAAA;AACA;AACA;AACA,IAAA,IAAA,CAAA,aAAA,EAAA;AACA,MAAA,OAAA,SAAA,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CAAA,gBAAA,EAAA,SAAA,CAAA,WAAA,EAAA,WAAA,CAAA,wDAAA,CAAA;AACA,SAAA,CAAA;AACA,MAAA,OAAA,aAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,OAAA,gBAAA,CAAA;AACA,KAAA;AACA,GAAA,EAAA,EAAA,CAAA,CAAA;AACA;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');
const worldwide = require('./worldwide.js');

// eslint-disable-next-line deprecation/deprecation
const WINDOW = worldwide.getGlobalObject();

const DEFAULT_MAX_STRING_LENGTH = 80;

/**
 * Given a child DOM element, returns a query-selector statement describing that
 * and its ancestors
 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
 * @returns generated DOM path
 */
function htmlTreeAsString(
  elem,
  options = {},
) {

  // try/catch both:
  // - accessing event.target (see getsentry/raven-js#838, #768)
  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
  // - can throw an exception in some circumstances.
  try {
    let currentElem = elem ;
    const MAX_TRAVERSE_HEIGHT = 5;
    const out = [];
    let height = 0;
    let len = 0;
    const separator = ' > ';
    const sepLength = separator.length;
    let nextStr;
    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;
    const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;

    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
      nextStr = _htmlElementAsString(currentElem, keyAttrs);
      // bail out if
      // - nextStr is the 'html' element
      // - the length of the string that would be created exceeds maxStringLength
      //   (ignore this limit if we are on the first iteration)
      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {
        break;
      }

      out.push(nextStr);

      len += nextStr.length;
      currentElem = currentElem.parentNode;
    }

    return out.reverse().join(separator);
  } catch (_oO) {
    return '<unknown>';
  }
}

/**
 * Returns a simple, query-selector representation of a DOM element
 * e.g. [HTMLElement] => input#foo.btn[name=baz]
 * @returns generated DOM path
 */
function _htmlElementAsString(el, keyAttrs) {
  const elem = el

;

  const out = [];
  let className;
  let classes;
  let key;
  let attr;
  let i;

  if (!elem || !elem.tagName) {
    return '';
  }

  out.push(elem.tagName.toLowerCase());

  // Pairs of attribute keys defined in `serializeAttribute` and their values on element.
  const keyAttrPairs =
    keyAttrs && keyAttrs.length
      ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
      : null;

  if (keyAttrPairs && keyAttrPairs.length) {
    keyAttrPairs.forEach(keyAttrPair => {
      out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
    });
  } else {
    if (elem.id) {
      out.push(`#${elem.id}`);
    }

    // eslint-disable-next-line prefer-const
    className = elem.className;
    if (className && is.isString(className)) {
      classes = className.split(/\s+/);
      for (i = 0; i < classes.length; i++) {
        out.push(`.${classes[i]}`);
      }
    }
  }
  const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];
  for (i = 0; i < allowedAttrs.length; i++) {
    key = allowedAttrs[i];
    attr = elem.getAttribute(key);
    if (attr) {
      out.push(`[${key}="${attr}"]`);
    }
  }
  return out.join('');
}

/**
 * A safe form of location.href
 */
function getLocationHref() {
  try {
    return WINDOW.document.location.href;
  } catch (oO) {
    return '';
  }
}

/**
 * Gets a DOM element by using document.querySelector.
 *
 * This wrapper will first check for the existance of the function before
 * actually calling it so that we don't have to take care of this check,
 * every time we want to access the DOM.
 *
 * Reason: DOM/querySelector is not available in all environments.
 *
 * We have to cast to any because utils can be consumed by a variety of environments,
 * and we don't want to break TS users. If you know what element will be selected by
 * `document.querySelector`, specify it as part of the generic call. For example,
 * `const element = getDomElement<Element>('selector');`
 *
 * @param selector the selector string passed on to document.querySelector
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getDomElement(selector) {
  if (WINDOW.document && WINDOW.document.querySelector) {
    return WINDOW.document.querySelector(selector) ;
  }
  return null;
}

exports.getDomElement = getDomElement;
exports.getLocationHref = getLocationHref;
exports.htmlTreeAsString = htmlTreeAsString;
//# sourceMappingURL=browser.js.map
{"version":3,"file":"browser.js","sources":["../../src/browser.ts"],"sourcesContent":["import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n  elem: unknown,\n  options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n  type SimpleNode = {\n    parentNode: SimpleNode;\n  } | null;\n\n  // try/catch both:\n  // - accessing event.target (see getsentry/raven-js#838, #768)\n  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n  // - can throw an exception in some circumstances.\n  try {\n    let currentElem = elem as SimpleNode;\n    const MAX_TRAVERSE_HEIGHT = 5;\n    const out = [];\n    let height = 0;\n    let len = 0;\n    const separator = ' > ';\n    const sepLength = separator.length;\n    let nextStr;\n    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n    const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n      nextStr = _htmlElementAsString(currentElem, keyAttrs);\n      // bail out if\n      // - nextStr is the 'html' element\n      // - the length of the string that would be created exceeds maxStringLength\n      //   (ignore this limit if we are on the first iteration)\n      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n        break;\n      }\n\n      out.push(nextStr);\n\n      len += nextStr.length;\n      currentElem = currentElem.parentNode;\n    }\n\n    return out.reverse().join(separator);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n  const elem = el as {\n    tagName?: string;\n    id?: string;\n    className?: string;\n    getAttribute(key: string): string;\n  };\n\n  const out = [];\n  let className;\n  let classes;\n  let key;\n  let attr;\n  let i;\n\n  if (!elem || !elem.tagName) {\n    return '';\n  }\n\n  out.push(elem.tagName.toLowerCase());\n\n  // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n  const keyAttrPairs =\n    keyAttrs && keyAttrs.length\n      ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n      : null;\n\n  if (keyAttrPairs && keyAttrPairs.length) {\n    keyAttrPairs.forEach(keyAttrPair => {\n      out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n    });\n  } else {\n    if (elem.id) {\n      out.push(`#${elem.id}`);\n    }\n\n    // eslint-disable-next-line prefer-const\n    className = elem.className;\n    if (className && isString(className)) {\n      classes = className.split(/\\s+/);\n      for (i = 0; i < classes.length; i++) {\n        out.push(`.${classes[i]}`);\n      }\n    }\n  }\n  const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n  for (i = 0; i < allowedAttrs.length; i++) {\n    key = allowedAttrs[i];\n    attr = elem.getAttribute(key);\n    if (attr) {\n      out.push(`[${key}=\"${attr}\"]`);\n    }\n  }\n  return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n  try {\n    return WINDOW.document.location.href;\n  } catch (oO) {\n    return '';\n  }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement<E = any>(selector: string): E | null {\n  if (WINDOW.document && WINDOW.document.querySelector) {\n    return WINDOW.document.querySelector(selector) as unknown as E;\n  }\n  return null;\n}\n"],"names":["getGlobalObject","isString"],"mappings":";;;;;AAGA;AACA,MAAA,MAAA,GAAAA,yBAAA,EAAA,CAAA;AACA;AACA,MAAA,yBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA;AACA,EAAA,IAAA;AACA,EAAA,OAAA,GAAA,EAAA;AACA,EAAA;;AAKA;AACA;AACA;AACA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,WAAA,GAAA,IAAA,EAAA;AACA,IAAA,MAAA,mBAAA,GAAA,CAAA,CAAA;AACA,IAAA,MAAA,GAAA,GAAA,EAAA,CAAA;AACA,IAAA,IAAA,MAAA,GAAA,CAAA,CAAA;AACA,IAAA,IAAA,GAAA,GAAA,CAAA,CAAA;AACA,IAAA,MAAA,SAAA,GAAA,KAAA,CAAA;AACA,IAAA,MAAA,SAAA,GAAA,SAAA,CAAA,MAAA,CAAA;AACA,IAAA,IAAA,OAAA,CAAA;AACA,IAAA,MAAA,QAAA,GAAA,KAAA,CAAA,OAAA,CAAA,OAAA,CAAA,GAAA,OAAA,GAAA,OAAA,CAAA,QAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAA,CAAA,CAAA,KAAA,CAAA,OAAA,CAAA,OAAA,CAAA,IAAA,OAAA,CAAA,eAAA,KAAA,yBAAA,CAAA;AACA;AACA,IAAA,OAAA,WAAA,IAAA,MAAA,EAAA,GAAA,mBAAA,EAAA;AACA,MAAA,OAAA,GAAA,oBAAA,CAAA,WAAA,EAAA,QAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAA,OAAA,KAAA,MAAA,KAAA,MAAA,GAAA,CAAA,IAAA,GAAA,GAAA,GAA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,CAAA,EAAA,GAAA,CAAA,EAAA,EAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,GAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,MAAA,CAAA,QAAA,CAAA,QAAA,CAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,EAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA,MAAA,CAAA,QAAA,IAAA,MAAA,CAAA,QAAA,CAAA,aAAA,EAAA;AACA,IAAA,OAAA,MAAA,CAAA,QAAA,CAAA,aAAA,CAAA,QAAA,CAAA,EAAA;AACA,GAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const _nullishCoalesce = require('./_nullishCoalesce.js');

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the
 * result of an async operation.
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
async function _asyncNullishCoalesce(lhs, rhsFn) {
  return _nullishCoalesce._nullishCoalesce(lhs, rhsFn);
}

// Sucrase version:
// async function _asyncNullishCoalesce(lhs, rhsFn) {
//   if (lhs != null) {
//     return lhs;
//   } else {
//     return await rhsFn();
//   }
// }

exports._asyncNullishCoalesce = _asyncNullishCoalesce;
//# sourceMappingURL=_asyncNullishCoalesce.js.map
{"version":3,"file":"_asyncNullishCoalesce.js","sources":["../../../src/buildPolyfills/_asyncNullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _nullishCoalesce } from './_nullishCoalesce';\n\n/**\n * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the\n * result of an async operation.\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport async function _asyncNullishCoalesce(lhs: unknown, rhsFn: () => unknown): Promise<unknown> {\n  return _nullishCoalesce(lhs, rhsFn);\n}\n\n// Sucrase version:\n// async function _asyncNullishCoalesce(lhs, rhsFn) {\n//   if (lhs != null) {\n//     return lhs;\n//   } else {\n//     return await rhsFn();\n//   }\n// }\n"],"names":["_nullishCoalesce"],"mappings":";;;;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,qBAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA,EAAA,OAAAA,iCAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, for situations in which at least one part of the expression is async.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
async function _asyncOptionalChain(ops) {
  let lastAccessLHS = undefined;
  let value = ops[0];
  let i = 1;
  while (i < ops.length) {
    const op = ops[i] ;
    const fn = ops[i + 1] ;
    i += 2;
    // by checking for loose equality to `null`, we catch both `null` and `undefined`
    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
      return;
    }
    if (op === 'access' || op === 'optionalAccess') {
      lastAccessLHS = value;
      value = await fn(value);
    } else if (op === 'call' || op === 'optionalCall') {
      value = await fn((...args) => (value ).call(lastAccessLHS, ...args));
      lastAccessLHS = undefined;
    }
  }
  return value;
}

// Sucrase version:
// async function _asyncOptionalChain(ops) {
//   let lastAccessLHS = undefined;
//   let value = ops[0];
//   let i = 1;
//   while (i < ops.length) {
//     const op = ops[i];
//     const fn = ops[i + 1];
//     i += 2;
//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
//       return undefined;
//     }
//     if (op === 'access' || op === 'optionalAccess') {
//       lastAccessLHS = value;
//       value = await fn(value);
//     } else if (op === 'call' || op === 'optionalCall') {
//       value = await fn((...args) => value.call(lastAccessLHS, ...args));
//       lastAccessLHS = undefined;
//     }
//   }
//   return value;
// }

exports._asyncOptionalChain = _asyncOptionalChain;
//# sourceMappingURL=_asyncOptionalChain.js.map
{"version":3,"file":"_asyncOptionalChain.js","sources":["../../../src/buildPolyfills/_asyncOptionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, for situations in which at least one part of the expression is async.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport async function _asyncOptionalChain(ops: unknown[]): Promise<unknown> {\n  let lastAccessLHS: unknown = undefined;\n  let value = ops[0];\n  let i = 1;\n  while (i < ops.length) {\n    const op = ops[i] as string;\n    const fn = ops[i + 1] as (intermediateValue: unknown) => Promise<unknown>;\n    i += 2;\n    // by checking for loose equality to `null`, we catch both `null` and `undefined`\n    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n      return;\n    }\n    if (op === 'access' || op === 'optionalAccess') {\n      lastAccessLHS = value;\n      value = await fn(value);\n    } else if (op === 'call' || op === 'optionalCall') {\n      value = await fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n      lastAccessLHS = undefined;\n    }\n  }\n  return value;\n}\n\n// Sucrase version:\n// async function _asyncOptionalChain(ops) {\n//   let lastAccessLHS = undefined;\n//   let value = ops[0];\n//   let i = 1;\n//   while (i < ops.length) {\n//     const op = ops[i];\n//     const fn = ops[i + 1];\n//     i += 2;\n//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n//       return undefined;\n//     }\n//     if (op === 'access' || op === 'optionalAccess') {\n//       lastAccessLHS = value;\n//       value = await fn(value);\n//     } else if (op === 'call' || op === 'optionalCall') {\n//       value = await fn((...args) => value.call(lastAccessLHS, ...args));\n//       lastAccessLHS = undefined;\n//     }\n//   }\n//   return value;\n// }\n"],"names":[],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,mBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,aAAA,GAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,GAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,EAAA,KAAA,gBAAA,IAAA,EAAA,KAAA,cAAA,KAAA,KAAA,IAAA,IAAA,EAAA;AACA;AACA,MAAA,OAAA;AACA,KAAA;AACA,IAAA,IAAA,EAAA,KAAA,QAAA,IAAA,EAAA,KAAA,gBAAA,EAAA;AACA,MAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAAA,KAAA,GAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,EAAA,KAAA,MAAA,IAAA,EAAA,KAAA,cAAA,EAAA;AACA,MAAA,KAAA,GAAA,MAAA,EAAA,CAAA,CAAA,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,IAAA,CAAA,aAAA,EAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA,MAAA,aAAA,GAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const _asyncOptionalChain = require('./_asyncOptionalChain.js');

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
async function _asyncOptionalChainDelete(ops) {
  const result = (await _asyncOptionalChain._asyncOptionalChain(ops)) ;
  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
  // which case we return whatever the `delete` returned, which will be a boolean.
  return result == null ? true : (result );
}

// Sucrase version:
// async function asyncOptionalChainDelete(ops) {
//   const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
//   return result == null ? true : result;
// }

exports._asyncOptionalChainDelete = _asyncOptionalChainDelete;
//# sourceMappingURL=_asyncOptionalChainDelete.js.map
{"version":3,"file":"_asyncOptionalChainDelete.js","sources":["../../../src/buildPolyfills/_asyncOptionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _asyncOptionalChain } from './_asyncOptionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport async function _asyncOptionalChainDelete(ops: unknown[]): Promise<boolean> {\n  const result = (await _asyncOptionalChain(ops)) as Promise<boolean | null>;\n  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n  // which case we return whatever the `delete` returned, which will be a boolean.\n  return result == null ? true : (result as Promise<boolean>);\n}\n\n// Sucrase version:\n// async function asyncOptionalChainDelete(ops) {\n//   const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);\n//   return result == null ? true : result;\n// }\n"],"names":["_asyncOptionalChain"],"mappings":";;;;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,yBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,MAAA,IAAA,MAAAA,uCAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,MAAA,IAAA,IAAA,GAAA,IAAA,IAAA,MAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Copy a property from the given object into `exports`, under the given name.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the property to copy.
 * @param localName The name under which to export the property
 * @param importedName The name under which the property lives in `obj`
 */
function _createNamedExportFrom(obj, localName, importedName) {
  exports[localName] = obj[importedName];
}

// Sucrase version:
// function _createNamedExportFrom(obj, localName, importedName) {
//   Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]});
// }

exports._createNamedExportFrom = _createNamedExportFrom;
//# sourceMappingURL=_createNamedExportFrom.js.map
{"version":3,"file":"_createNamedExportFrom.js","sources":["../../../src/buildPolyfills/_createNamedExportFrom.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericObject } from './types';\n\ndeclare const exports: GenericObject;\n\n/**\n * Copy a property from the given object into `exports`, under the given name.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param obj The object containing the property to copy.\n * @param localName The name under which to export the property\n * @param importedName The name under which the property lives in `obj`\n */\nexport function _createNamedExportFrom(obj: GenericObject, localName: string, importedName: string): void {\n  exports[localName] = obj[importedName];\n}\n\n// Sucrase version:\n// function _createNamedExportFrom(obj, localName, importedName) {\n//   Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]});\n// }\n"],"names":[],"mappings":";;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,GAAA,EAAA,SAAA,EAAA,YAAA,EAAA;AACA,EAAA,OAAA,CAAA,SAAA,CAAA,GAAA,GAAA,CAAA,YAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Copy properties from an object into `exports`.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the properties to copy.
 */
function _createStarExport(obj) {
  Object.keys(obj)
    .filter(key => key !== 'default' && key !== '__esModule' && !(key in exports))
    .forEach(key => (exports[key] = obj[key]));
}

// Sucrase version:
// function _createStarExport(obj) {
//   Object.keys(obj)
//     .filter(key => key !== 'default' && key !== '__esModule')
//     .forEach(key => {
//       if (exports.hasOwnProperty(key)) {
//         return;
//       }
//       Object.defineProperty(exports, key, { enumerable: true, get: () => obj[key] });
//     });
// }

exports._createStarExport = _createStarExport;
//# sourceMappingURL=_createStarExport.js.map
{"version":3,"file":"_createStarExport.js","sources":["../../../src/buildPolyfills/_createStarExport.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericObject } from './types';\n\ndeclare const exports: GenericObject;\n\n/**\n * Copy properties from an object into `exports`.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param obj The object containing the properties to copy.\n */\nexport function _createStarExport(obj: GenericObject): void {\n  Object.keys(obj)\n    .filter(key => key !== 'default' && key !== '__esModule' && !(key in exports))\n    .forEach(key => (exports[key] = obj[key]));\n}\n\n// Sucrase version:\n// function _createStarExport(obj) {\n//   Object.keys(obj)\n//     .filter(key => key !== 'default' && key !== '__esModule')\n//     .forEach(key => {\n//       if (exports.hasOwnProperty(key)) {\n//         return;\n//       }\n//       Object.defineProperty(exports, key, { enumerable: true, get: () => obj[key] });\n//     });\n// }\n"],"names":[],"mappings":";;AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,KAAA,MAAA,CAAA,GAAA,IAAA,GAAA,KAAA,SAAA,IAAA,GAAA,KAAA,YAAA,IAAA,EAAA,GAAA,IAAA,OAAA,CAAA,CAAA;AACA,KAAA,OAAA,CAAA,GAAA,KAAA,OAAA,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Unwraps a module if it has been wrapped in an object under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns The full module, unwrapped if necessary.
 */
function _interopDefault$1(requireResult) {
  return requireResult.__esModule ? (requireResult.default ) : requireResult;
}

// Rollup version:
// function _interopDefault(e) {
//   return e && e.__esModule ? e['default'] : e;
// }

exports._interopDefault = _interopDefault$1;
//# sourceMappingURL=_interopDefault.js.map
{"version":3,"file":"_interopDefault.js","sources":["../../../src/buildPolyfills/_interopDefault.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Unwraps a module if it has been wrapped in an object under the key `default`.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns The full module, unwrapped if necessary.\n */\nexport function _interopDefault(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? (requireResult.default as RequireResult) : requireResult;\n}\n\n// Rollup version:\n// function _interopDefault(e) {\n//   return e && e.__esModule ? e['default'] : e;\n// }\n"],"names":["_interopDefault"],"mappings":";;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAAA,iBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,IAAA,aAAA,CAAA,OAAA,KAAA,aAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
function _interopNamespace$1(requireResult) {
  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };
}

// Rollup version (with `output.externalLiveBindings` and `output.freeze` both set to false)
// function _interopNamespace(e) {
//   if (e && e.__esModule) return e;
//   var n = Object.create(null);
//   if (e) {
//     for (var k in e) {
//       n[k] = e[k];
//     }
//   }
//   n["default"] = e;
//   return n;
// }

exports._interopNamespace = _interopNamespace$1;
//# sourceMappingURL=_interopNamespace.js.map
{"version":3,"file":"_interopNamespace.js","sources":["../../../src/buildPolyfills/_interopNamespace.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property\n */\nexport function _interopNamespace(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };\n}\n\n// Rollup version (with `output.externalLiveBindings` and `output.freeze` both set to false)\n// function _interopNamespace(e) {\n//   if (e && e.__esModule) return e;\n//   var n = Object.create(null);\n//   if (e) {\n//     for (var k in e) {\n//       n[k] = e[k];\n//     }\n//   }\n//   n[\"default\"] = e;\n//   return n;\n// }\n"],"names":["_interopNamespace"],"mappings":";;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAAA,mBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,GAAA,aAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Wrap a module in an object, as the value under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns An object containing the key-value pair (`default`, `requireResult`)
 */
function _interopNamespaceDefaultOnly$1(requireResult) {
  return {
    __proto__: null,
    default: requireResult,
  };
}

// Rollup version
// function _interopNamespaceDefaultOnly(e) {
//   return {
//     __proto__: null,
//     'default': e
//   };
// }

exports._interopNamespaceDefaultOnly = _interopNamespaceDefaultOnly$1;
//# sourceMappingURL=_interopNamespaceDefaultOnly.js.map
{"version":3,"file":"_interopNamespaceDefaultOnly.js","sources":["../../../src/buildPolyfills/_interopNamespaceDefaultOnly.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Wrap a module in an object, as the value under the key `default`.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns An object containing the key-value pair (`default`, `requireResult`)\n */\nexport function _interopNamespaceDefaultOnly(requireResult: RequireResult): RequireResult {\n  return {\n    __proto__: null,\n    default: requireResult,\n  };\n}\n\n// Rollup version\n// function _interopNamespaceDefaultOnly(e) {\n//   return {\n//     __proto__: null,\n//     'default': e\n//   };\n// }\n"],"names":["_interopNamespaceDefaultOnly"],"mappings":";;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAAA,8BAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA;AACA,IAAA,SAAA,EAAA,IAAA;AACA,IAAA,OAAA,EAAA,aAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default`
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default`
 */
function _interopRequireDefault(requireResult) {
  return requireResult.__esModule ? requireResult : { default: requireResult };
}

// Sucrase version
// function _interopRequireDefault(obj) {
//   return obj && obj.__esModule ? obj : { default: obj };
// }

exports._interopRequireDefault = _interopRequireDefault;
//# sourceMappingURL=_interopRequireDefault.js.map
{"version":3,"file":"_interopRequireDefault.js","sources":["../../../src/buildPolyfills/_interopRequireDefault.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default`\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default`\n */\nexport function _interopRequireDefault(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { default: requireResult };\n}\n\n// Sucrase version\n// function _interopRequireDefault(obj) {\n//   return obj && obj.__esModule ? obj : { default: obj };\n// }\n"],"names":[],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
function _interopRequireWildcard(requireResult) {
  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };
}

// Sucrase version
// function _interopRequireWildcard(obj) {
//   if (obj && obj.__esModule) {
//     return obj;
//   } else {
//     var newObj = {};
//     if (obj != null) {
//       for (var key in obj) {
//         if (Object.prototype.hasOwnProperty.call(obj, key)) {
//           newObj[key] = obj[key];
//         }
//       }
//     }
//     newObj.default = obj;
//     return newObj;
//   }
// }

exports._interopRequireWildcard = _interopRequireWildcard;
//# sourceMappingURL=_interopRequireWildcard.js.map
{"version":3,"file":"_interopRequireWildcard.js","sources":["../../../src/buildPolyfills/_interopRequireWildcard.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property\n */\nexport function _interopRequireWildcard(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };\n}\n\n// Sucrase version\n// function _interopRequireWildcard(obj) {\n//   if (obj && obj.__esModule) {\n//     return obj;\n//   } else {\n//     var newObj = {};\n//     if (obj != null) {\n//       for (var key in obj) {\n//         if (Object.prototype.hasOwnProperty.call(obj, key)) {\n//           newObj[key] = obj[key];\n//         }\n//       }\n//     }\n//     newObj.default = obj;\n//     return newObj;\n//   }\n// }\n"],"names":[],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,GAAA,aAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
//
// The MIT License (MIT)
//
// Copyright (c) 2012-2018 various contributors (see AUTHORS)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/**
 * Polyfill for the nullish coalescing operator (`??`).
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
function _nullishCoalesce(lhs, rhsFn) {
  // by checking for loose equality to `null`, we catch both `null` and `undefined`
  return lhs != null ? lhs : rhsFn();
}

// Sucrase version:
// function _nullishCoalesce(lhs, rhsFn) {
//   if (lhs != null) {
//     return lhs;
//   } else {
//     return rhsFn();
//   }
// }

exports._nullishCoalesce = _nullishCoalesce;
//# sourceMappingURL=_nullishCoalesce.js.map
{"version":3,"file":"_nullishCoalesce.js","sources":["../../../src/buildPolyfills/_nullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport function _nullishCoalesce(lhs: unknown, rhsFn: () => unknown): unknown {\n  // by checking for loose equality to `null`, we catch both `null` and `undefined`\n  return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n//   if (lhs != null) {\n//     return lhs;\n//   } else {\n//     return rhsFn();\n//   }\n// }\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,IAAA,IAAA,GAAA,GAAA,GAAA,KAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
function _optionalChain(ops) {
  let lastAccessLHS = undefined;
  let value = ops[0];
  let i = 1;
  while (i < ops.length) {
    const op = ops[i] ;
    const fn = ops[i + 1] ;
    i += 2;
    // by checking for loose equality to `null`, we catch both `null` and `undefined`
    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
      return;
    }
    if (op === 'access' || op === 'optionalAccess') {
      lastAccessLHS = value;
      value = fn(value);
    } else if (op === 'call' || op === 'optionalCall') {
      value = fn((...args) => (value ).call(lastAccessLHS, ...args));
      lastAccessLHS = undefined;
    }
  }
  return value;
}

// Sucrase version
// function _optionalChain(ops) {
//   let lastAccessLHS = undefined;
//   let value = ops[0];
//   let i = 1;
//   while (i < ops.length) {
//     const op = ops[i];
//     const fn = ops[i + 1];
//     i += 2;
//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
//       return undefined;
//     }
//     if (op === 'access' || op === 'optionalAccess') {
//       lastAccessLHS = value;
//       value = fn(value);
//     } else if (op === 'call' || op === 'optionalCall') {
//       value = fn((...args) => value.call(lastAccessLHS, ...args));
//       lastAccessLHS = undefined;
//     }
//   }
//   return value;
// }

exports._optionalChain = _optionalChain;
//# sourceMappingURL=_optionalChain.js.map
{"version":3,"file":"_optionalChain.js","sources":["../../../src/buildPolyfills/_optionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport function _optionalChain(ops: unknown[]): unknown {\n  let lastAccessLHS: unknown = undefined;\n  let value = ops[0];\n  let i = 1;\n  while (i < ops.length) {\n    const op = ops[i] as string;\n    const fn = ops[i + 1] as (intermediateValue: unknown) => unknown;\n    i += 2;\n    // by checking for loose equality to `null`, we catch both `null` and `undefined`\n    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n      return;\n    }\n    if (op === 'access' || op === 'optionalAccess') {\n      lastAccessLHS = value;\n      value = fn(value);\n    } else if (op === 'call' || op === 'optionalCall') {\n      value = fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n      lastAccessLHS = undefined;\n    }\n  }\n  return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n//   let lastAccessLHS = undefined;\n//   let value = ops[0];\n//   let i = 1;\n//   while (i < ops.length) {\n//     const op = ops[i];\n//     const fn = ops[i + 1];\n//     i += 2;\n//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n//       return undefined;\n//     }\n//     if (op === 'access' || op === 'optionalAccess') {\n//       lastAccessLHS = value;\n//       value = fn(value);\n//     } else if (op === 'call' || op === 'optionalCall') {\n//       value = fn((...args) => value.call(lastAccessLHS, ...args));\n//       lastAccessLHS = undefined;\n//     }\n//   }\n//   return value;\n// }\n"],"names":[],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,aAAA,GAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,GAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,EAAA,KAAA,gBAAA,IAAA,EAAA,KAAA,cAAA,KAAA,KAAA,IAAA,IAAA,EAAA;AACA;AACA,MAAA,OAAA;AACA,KAAA;AACA,IAAA,IAAA,EAAA,KAAA,QAAA,IAAA,EAAA,KAAA,gBAAA,EAAA;AACA,MAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,EAAA,KAAA,MAAA,IAAA,EAAA,KAAA,cAAA,EAAA;AACA,MAAA,KAAA,GAAA,EAAA,CAAA,CAAA,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,IAAA,CAAA,aAAA,EAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA,MAAA,aAAA,GAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const _optionalChain = require('./_optionalChain.js');

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
function _optionalChainDelete(ops) {
  const result = _optionalChain._optionalChain(ops) ;
  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
  // which case we return whatever the `delete` returned, which will be a boolean.
  return result == null ? true : result;
}

// Sucrase version:
// function _optionalChainDelete(ops) {
//   const result = _optionalChain(ops);
//   // by checking for loose equality to `null`, we catch both `null` and `undefined`
//   return result == null ? true : result;
// }

exports._optionalChainDelete = _optionalChainDelete;
//# sourceMappingURL=_optionalChainDelete.js.map
{"version":3,"file":"_optionalChainDelete.js","sources":["../../../src/buildPolyfills/_optionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _optionalChain } from './_optionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport function _optionalChainDelete(ops: unknown[]): boolean {\n  const result = _optionalChain(ops) as boolean | null;\n  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n  // which case we return whatever the `delete` returned, which will be a boolean.\n  return result == null ? true : result;\n}\n\n// Sucrase version:\n// function _optionalChainDelete(ops) {\n//   const result = _optionalChain(ops);\n//   // by checking for loose equality to `null`, we catch both `null` and `undefined`\n//   return result == null ? true : result;\n// }\n"],"names":["_optionalChain"],"mappings":";;;;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAAA,6BAAA,CAAA,GAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,MAAA,IAAA,IAAA,GAAA,IAAA,GAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const _asyncNullishCoalesce = require('./_asyncNullishCoalesce.js');
const _asyncOptionalChain = require('./_asyncOptionalChain.js');
const _asyncOptionalChainDelete = require('./_asyncOptionalChainDelete.js');
const _createNamedExportFrom = require('./_createNamedExportFrom.js');
const _createStarExport = require('./_createStarExport.js');
const _interopDefault$1 = require('./_interopDefault.js');
const _interopNamespace$1 = require('./_interopNamespace.js');
const _interopNamespaceDefaultOnly$1 = require('./_interopNamespaceDefaultOnly.js');
const _interopRequireDefault = require('./_interopRequireDefault.js');
const _interopRequireWildcard = require('./_interopRequireWildcard.js');
const _nullishCoalesce = require('./_nullishCoalesce.js');
const _optionalChain = require('./_optionalChain.js');
const _optionalChainDelete = require('./_optionalChainDelete.js');



exports._asyncNullishCoalesce = _asyncNullishCoalesce._asyncNullishCoalesce;
exports._asyncOptionalChain = _asyncOptionalChain._asyncOptionalChain;
exports._asyncOptionalChainDelete = _asyncOptionalChainDelete._asyncOptionalChainDelete;
exports._createNamedExportFrom = _createNamedExportFrom._createNamedExportFrom;
exports._createStarExport = _createStarExport._createStarExport;
exports._interopDefault = _interopDefault$1._interopDefault;
exports._interopNamespace = _interopNamespace$1._interopNamespace;
exports._interopNamespaceDefaultOnly = _interopNamespaceDefaultOnly$1._interopNamespaceDefaultOnly;
exports._interopRequireDefault = _interopRequireDefault._interopRequireDefault;
exports._interopRequireWildcard = _interopRequireWildcard._interopRequireWildcard;
exports._nullishCoalesce = _nullishCoalesce._nullishCoalesce;
exports._optionalChain = _optionalChain._optionalChain;
exports._optionalChainDelete = _optionalChainDelete._optionalChainDelete;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}## Build Polyfills

This is a collection of syntax and import/export polyfills either copied directly from or heavily inspired by those used by [Rollup](https://github.com/rollup/rollup) and [Sucrase](https://github.com/alangpierce/sucrase). When either tool uses one of these polyfills during a build, it injects the function source code into each file needing the function, which can lead to a great deal of duplication. For our builds, we have therefore implemented something similar to [`tsc`'s `importHelpers` behavior](https://www.typescriptlang.org/tsconfig#importHelpers): Instead of leaving the polyfills injected in multiple places, we instead replace each injected function with an `import` or `require` statement, pulling from the CJS or ESM builds as appropriate. (In other words, the injected `import` statements import from `@sentry/utils/esm/buildPolyfills` and the injected `require` statements pull from `@sentry/utils/cjs/buildPolyfills/`. Because these functions should never be part of the public API, they're not exported from the package directly.)

Note that not all polyfills are currently used by the SDK, but all are included here for future compatitibility, should they ever be needed. Also, since we're never going to be calling these directly from within another TS file, their types are fairly generic. In some cases testing required more specific types, which can be found in the test files.

--------

_Code from both Rollup and Sucrase is used under the MIT license, copyright 2017 and 2012-2018, respectively._

_Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:_

_The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software._

_THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE._
Object.defineProperty(exports, '__esModule', { value: true });

const envelope = require('./envelope.js');
const time = require('./time.js');

/**
 * Creates client report envelope
 * @param discarded_events An array of discard events
 * @param dsn A DSN that can be set on the header. Optional.
 */
function createClientReportEnvelope(
  discarded_events,
  dsn,
  timestamp,
) {
  const clientReportItem = [
    { type: 'client_report' },
    {
      timestamp: timestamp || time.dateTimestampInSeconds(),
      discarded_events,
    },
  ];
  return envelope.createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
}

exports.createClientReportEnvelope = createClientReportEnvelope;
//# sourceMappingURL=clientreport.js.map
{"version":3,"file":"clientreport.js","sources":["../../src/clientreport.ts"],"sourcesContent":["import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n  discarded_events: ClientReport['discarded_events'],\n  dsn?: string,\n  timestamp?: number,\n): ClientReportEnvelope {\n  const clientReportItem: ClientReportItem = [\n    { type: 'client_report' },\n    {\n      timestamp: timestamp || dateTimestampInSeconds(),\n      discarded_events,\n    },\n  ];\n  return createEnvelope<ClientReportEnvelope>(dsn ? { dsn } : {}, [clientReportItem]);\n}\n"],"names":["dateTimestampInSeconds","createEnvelope"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,gBAAA;AACA,EAAA,GAAA;AACA,EAAA,SAAA;AACA,EAAA;AACA,EAAA,MAAA,gBAAA,GAAA;AACA,IAAA,EAAA,IAAA,EAAA,eAAA,EAAA;AACA,IAAA;AACA,MAAA,SAAA,EAAA,SAAA,IAAAA,2BAAA,EAAA;AACA,MAAA,gBAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAAC,uBAAA,CAAA,GAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const error = require('./error.js');

/** Regular expression used to parse a Dsn. */
const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;

function isValidProtocol(protocol) {
  return protocol === 'http' || protocol === 'https';
}

/**
 * Renders the string representation of this Dsn.
 *
 * By default, this will render the public representation without the password
 * component. To get the deprecated private representation, set `withPassword`
 * to true.
 *
 * @param withPassword When set to true, the password will be included.
 */
function dsnToString(dsn, withPassword = false) {
  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;
  return (
    `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +
    `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`
  );
}

/**
 * Parses a Dsn from a given string.
 *
 * @param str A Dsn as string
 * @returns Dsn as DsnComponents
 */
function dsnFromString(str) {
  const match = DSN_REGEX.exec(str);

  if (!match) {
    throw new error.SentryError(`Invalid Sentry Dsn: ${str}`);
  }

  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);
  let path = '';
  let projectId = lastPath;

  const split = projectId.split('/');
  if (split.length > 1) {
    path = split.slice(0, -1).join('/');
    projectId = split.pop() ;
  }

  if (projectId) {
    const projectMatch = projectId.match(/^\d+/);
    if (projectMatch) {
      projectId = projectMatch[0];
    }
  }

  return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });
}

function dsnFromComponents(components) {
  return {
    protocol: components.protocol,
    publicKey: components.publicKey || '',
    pass: components.pass || '',
    host: components.host,
    port: components.port || '',
    path: components.path || '',
    projectId: components.projectId,
  };
}

function validateDsn(dsn) {
  if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    return;
  }

  const { port, projectId, protocol } = dsn;

  const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
  requiredComponents.forEach(component => {
    if (!dsn[component]) {
      throw new error.SentryError(`Invalid Sentry Dsn: ${component} missing`);
    }
  });

  if (!projectId.match(/^\d+$/)) {
    throw new error.SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
  }

  if (!isValidProtocol(protocol)) {
    throw new error.SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
  }

  if (port && isNaN(parseInt(port, 10))) {
    throw new error.SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);
  }

  return true;
}

/** The Sentry Dsn, identifying a Sentry instance and project. */
function makeDsn(from) {
  const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
  validateDsn(components);
  return components;
}

exports.dsnFromString = dsnFromString;
exports.dsnToString = dsnToString;
exports.makeDsn = makeDsn;
//# sourceMappingURL=dsn.js.map
{"version":3,"file":"dsn.js","sources":["../../src/dsn.ts"],"sourcesContent":["import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { SentryError } from './error';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n  return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n  return (\n    `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n    `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n  );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents\n */\nexport function dsnFromString(str: string): DsnComponents {\n  const match = DSN_REGEX.exec(str);\n\n  if (!match) {\n    throw new SentryError(`Invalid Sentry Dsn: ${str}`);\n  }\n\n  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n  let path = '';\n  let projectId = lastPath;\n\n  const split = projectId.split('/');\n  if (split.length > 1) {\n    path = split.slice(0, -1).join('/');\n    projectId = split.pop() as string;\n  }\n\n  if (projectId) {\n    const projectMatch = projectId.match(/^\\d+/);\n    if (projectMatch) {\n      projectId = projectMatch[0];\n    }\n  }\n\n  return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n  return {\n    protocol: components.protocol,\n    publicKey: components.publicKey || '',\n    pass: components.pass || '',\n    host: components.host,\n    port: components.port || '',\n    path: components.path || '',\n    projectId: components.projectId,\n  };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean | void {\n  if (!__DEBUG_BUILD__) {\n    return;\n  }\n\n  const { port, projectId, protocol } = dsn;\n\n  const requiredComponents: ReadonlyArray<keyof DsnComponents> = ['protocol', 'publicKey', 'host', 'projectId'];\n  requiredComponents.forEach(component => {\n    if (!dsn[component]) {\n      throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);\n    }\n  });\n\n  if (!projectId.match(/^\\d+$/)) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n  }\n\n  if (!isValidProtocol(protocol)) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n  }\n\n  if (port && isNaN(parseInt(port, 10))) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);\n  }\n\n  return true;\n}\n\n/** The Sentry Dsn, identifying a Sentry instance and project. */\nexport function makeDsn(from: DsnLike): DsnComponents {\n  const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n  validateDsn(components);\n  return components;\n}\n"],"names":["SentryError"],"mappings":";;;;AAIA;AACA,MAAA,SAAA,GAAA,iEAAA,CAAA;AACA;AACA,SAAA,eAAA,CAAA,QAAA,EAAA;AACA,EAAA,OAAA,QAAA,KAAA,MAAA,IAAA,QAAA,KAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,GAAA,EAAA,YAAA,GAAA,KAAA,EAAA;AACA,EAAA,MAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,QAAA,EAAA,SAAA,EAAA,GAAA,GAAA,CAAA;AACA,EAAA;AACA,IAAA,CAAA,EAAA,QAAA,CAAA,GAAA,EAAA,SAAA,CAAA,EAAA,YAAA,IAAA,IAAA,GAAA,CAAA,CAAA,EAAA,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IAAA,CAAA,SAAA,CAAA,KAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,MAAA,IAAAA,iBAAA,CAAA,CAAA,sCAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,CAAA,eAAA,CAAA,QAAA,CAAA,EAAA;AACA,IAAA,MAAA,IAAAA,iBAAA,CAAA,CAAA,qCAAA,EAAA,QAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,IAAA,IAAA,KAAA,CAAA,QAAA,CAAA,IAAA,EAAA,EAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,IAAAA,iBAAA,CAAA,CAAA,iCAAA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,OAAA,CAAA,IAAA,EAAA;AACA,EAAA,MAAA,UAAA,GAAA,OAAA,IAAA,KAAA,QAAA,GAAA,aAAA,CAAA,IAAA,CAAA,GAAA,iBAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,WAAA,CAAA,UAAA,CAAA,CAAA;AACA,EAAA,OAAA,UAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/*
 * This module exists for optimizations in the build process through rollup and terser.  We define some global
 * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these
 * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will
 * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to
 * `logger` and preventing node-related code from appearing in browser bundles.
 *
 * Attention:
 * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by
 * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)
 * having issues tree-shaking these constants across package boundaries.
 * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want
 * users to be able to shake away expressions that it guards.
 */

/**
 * Figures out if we're building a browser bundle.
 *
 * @returns true if this is a browser bundle build.
 */
function isBrowserBundle() {
  return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;
}

/**
 * Get source of SDK.
 */
function getSDKSource() {
  // @ts-ignore "npm" is injected by rollup during build process
  return "npm";
}

exports.getSDKSource = getSDKSource;
exports.isBrowserBundle = isBrowserBundle;
//# sourceMappingURL=env.js.map
{"version":3,"file":"env.js","sources":["../../src/env.ts"],"sourcesContent":["/*\n * This module exists for optimizations in the build process through rollup and terser.  We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n  return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n  // @ts-ignore __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n  return __SENTRY_SDK_SOURCE__;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA,EAAA,OAAA,OAAA,yBAAA,KAAA,WAAA,IAAA,CAAA,CAAA,yBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const dsn = require('./dsn.js');
const normalize = require('./normalize.js');
const object = require('./object.js');

/**
 * Creates an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
function createEnvelope(headers, items = []) {
  return [headers, items] ;
}

/**
 * Add an item to an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
function addItemToEnvelope(envelope, newItem) {
  const [headers, items] = envelope;
  return [headers, [...items, newItem]] ;
}

/**
 * Convenience function to loop through the items and item types of an envelope.
 * (This function was mostly created because working with envelope types is painful at the moment)
 *
 * If the callback returns true, the rest of the items will be skipped.
 */
function forEachEnvelopeItem(
  envelope,
  callback,
) {
  const envelopeItems = envelope[1];

  for (const envelopeItem of envelopeItems) {
    const envelopeItemType = envelopeItem[0].type;
    const result = callback(envelopeItem, envelopeItemType);

    if (result) {
      return true;
    }
  }

  return false;
}

/**
 * Returns true if the envelope contains any of the given envelope item types
 */
function envelopeContainsItemType(envelope, types) {
  return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));
}

/**
 * Encode a string to UTF8.
 */
function encodeUTF8(input, textEncoder) {
  const utf8 = textEncoder || new TextEncoder();
  return utf8.encode(input);
}

/**
 * Serializes an envelope.
 */
function serializeEnvelope(envelope, textEncoder) {
  const [envHeaders, items] = envelope;

  // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data
  let parts = JSON.stringify(envHeaders);

  function append(next) {
    if (typeof parts === 'string') {
      parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];
    } else {
      parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);
    }
  }

  for (const item of items) {
    const [itemHeaders, payload] = item;

    append(`\n${JSON.stringify(itemHeaders)}\n`);

    if (typeof payload === 'string' || payload instanceof Uint8Array) {
      append(payload);
    } else {
      let stringifiedPayload;
      try {
        stringifiedPayload = JSON.stringify(payload);
      } catch (e) {
        // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still
        // fails, we try again after normalizing it again with infinite normalization depth. This of course has a
        // performance impact but in this case a performance hit is better than throwing.
        stringifiedPayload = JSON.stringify(normalize.normalize(payload));
      }
      append(stringifiedPayload);
    }
  }

  return typeof parts === 'string' ? parts : concatBuffers(parts);
}

function concatBuffers(buffers) {
  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);

  const merged = new Uint8Array(totalLength);
  let offset = 0;
  for (const buffer of buffers) {
    merged.set(buffer, offset);
    offset += buffer.length;
  }

  return merged;
}

/**
 * Parses an envelope
 */
function parseEnvelope(
  env,
  textEncoder,
  textDecoder,
) {
  let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;

  function readBinary(length) {
    const bin = buffer.subarray(0, length);
    // Replace the buffer with the remaining data excluding trailing newline
    buffer = buffer.subarray(length + 1);
    return bin;
  }

  function readJson() {
    let i = buffer.indexOf(0xa);
    // If we couldn't find a newline, we must have found the end of the buffer
    if (i < 0) {
      i = buffer.length;
    }

    return JSON.parse(textDecoder.decode(readBinary(i))) ;
  }

  const envelopeHeader = readJson();
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const items = [];

  while (buffer.length) {
    const itemHeader = readJson();
    const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;

    items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);
  }

  return [envelopeHeader, items];
}

/**
 * Creates attachment envelope items
 */
function createAttachmentEnvelopeItem(
  attachment,
  textEncoder,
) {
  const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;

  return [
    object.dropUndefinedKeys({
      type: 'attachment',
      length: buffer.length,
      filename: attachment.filename,
      content_type: attachment.contentType,
      attachment_type: attachment.attachmentType,
    }),
    buffer,
  ];
}

const ITEM_TYPE_TO_DATA_CATEGORY_MAP = {
  session: 'session',
  sessions: 'session',
  attachment: 'attachment',
  transaction: 'transaction',
  event: 'error',
  client_report: 'internal',
  user_report: 'default',
  profile: 'profile',
  replay_event: 'replay',
  replay_recording: 'replay',
  check_in: 'monitor',
};

/**
 * Maps the type of an envelope item to a data category.
 */
function envelopeItemTypeToDataCategory(type) {
  return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];
}

/** Extracts the minimal SDK info from from the metadata or an events */
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {
  if (!metadataOrEvent || !metadataOrEvent.sdk) {
    return;
  }
  const { name, version } = metadataOrEvent.sdk;
  return { name, version };
}

/**
 * Creates event envelope headers, based on event, sdk info and tunnel
 * Note: This function was extracted from the core package to make it available in Replay
 */
function createEventEnvelopeHeaders(
  event,
  sdkInfo,
  tunnel,
  dsn$1,
) {
  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;
  return {
    event_id: event.event_id ,
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: dsn.dsnToString(dsn$1) }),
    ...(dynamicSamplingContext && {
      trace: object.dropUndefinedKeys({ ...dynamicSamplingContext }),
    }),
  };
}

exports.addItemToEnvelope = addItemToEnvelope;
exports.createAttachmentEnvelopeItem = createAttachmentEnvelopeItem;
exports.createEnvelope = createEnvelope;
exports.createEventEnvelopeHeaders = createEventEnvelopeHeaders;
exports.envelopeContainsItemType = envelopeContainsItemType;
exports.envelopeItemTypeToDataCategory = envelopeItemTypeToDataCategory;
exports.forEachEnvelopeItem = forEachEnvelopeItem;
exports.getSdkMetadataForEnvelopeHeader = getSdkMetadataForEnvelopeHeader;
exports.parseEnvelope = parseEnvelope;
exports.serializeEnvelope = serializeEnvelope;
//# sourceMappingURL=envelope.js.map
{"version":3,"file":"envelope.js","sources":["../../src/envelope.ts"],"sourcesContent":["import type {\n  Attachment,\n  AttachmentItem,\n  BaseEnvelopeHeaders,\n  BaseEnvelopeItemHeaders,\n  DataCategory,\n  DsnComponents,\n  Envelope,\n  EnvelopeItemType,\n  Event,\n  EventEnvelopeHeaders,\n  SdkInfo,\n  SdkMetadata,\n  TextEncoderInternal,\n} from '@sentry/types';\n\nimport { dsnToString } from './dsn';\nimport { normalize } from './normalize';\nimport { dropUndefinedKeys } from './object';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function createEnvelope<E extends Envelope>(headers: E[0], items: E[1] = []): E {\n  return [headers, items] as E;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function addItemToEnvelope<E extends Envelope>(envelope: E, newItem: E[1][number]): E {\n  const [headers, items] = envelope;\n  return [headers, [...items, newItem]] as E;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nexport function forEachEnvelopeItem<E extends Envelope>(\n  envelope: Envelope,\n  callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,\n): boolean {\n  const envelopeItems = envelope[1];\n\n  for (const envelopeItem of envelopeItems) {\n    const envelopeItemType = envelopeItem[0].type;\n    const result = callback(envelopeItem, envelopeItemType);\n\n    if (result) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nexport function envelopeContainsItemType(envelope: Envelope, types: EnvelopeItemType[]): boolean {\n  return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input: string, textEncoder?: TextEncoderInternal): Uint8Array {\n  const utf8 = textEncoder || new TextEncoder();\n  return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nexport function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array {\n  const [envHeaders, items] = envelope;\n\n  // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n  let parts: string | Uint8Array[] = JSON.stringify(envHeaders);\n\n  function append(next: string | Uint8Array): void {\n    if (typeof parts === 'string') {\n      parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n    } else {\n      parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n    }\n  }\n\n  for (const item of items) {\n    const [itemHeaders, payload] = item;\n\n    append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n    if (typeof payload === 'string' || payload instanceof Uint8Array) {\n      append(payload);\n    } else {\n      let stringifiedPayload: string;\n      try {\n        stringifiedPayload = JSON.stringify(payload);\n      } catch (e) {\n        // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n        // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n        // performance impact but in this case a performance hit is better than throwing.\n        stringifiedPayload = JSON.stringify(normalize(payload));\n      }\n      append(stringifiedPayload);\n    }\n  }\n\n  return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers: Uint8Array[]): Uint8Array {\n  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n  const merged = new Uint8Array(totalLength);\n  let offset = 0;\n  for (const buffer of buffers) {\n    merged.set(buffer, offset);\n    offset += buffer.length;\n  }\n\n  return merged;\n}\n\nexport interface TextDecoderInternal {\n  decode(input?: Uint8Array): string;\n}\n\n/**\n * Parses an envelope\n */\nexport function parseEnvelope(\n  env: string | Uint8Array,\n  textEncoder: TextEncoderInternal,\n  textDecoder: TextDecoderInternal,\n): Envelope {\n  let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n  function readBinary(length: number): Uint8Array {\n    const bin = buffer.subarray(0, length);\n    // Replace the buffer with the remaining data excluding trailing newline\n    buffer = buffer.subarray(length + 1);\n    return bin;\n  }\n\n  function readJson<T>(): T {\n    let i = buffer.indexOf(0xa);\n    // If we couldn't find a newline, we must have found the end of the buffer\n    if (i < 0) {\n      i = buffer.length;\n    }\n\n    return JSON.parse(textDecoder.decode(readBinary(i))) as T;\n  }\n\n  const envelopeHeader = readJson<BaseEnvelopeHeaders>();\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const items: [any, any][] = [];\n\n  while (buffer.length) {\n    const itemHeader = readJson<BaseEnvelopeItemHeaders>();\n    const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n    items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n  }\n\n  return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nexport function createAttachmentEnvelopeItem(\n  attachment: Attachment,\n  textEncoder?: TextEncoderInternal,\n): AttachmentItem {\n  const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n  return [\n    dropUndefinedKeys({\n      type: 'attachment',\n      length: buffer.length,\n      filename: attachment.filename,\n      content_type: attachment.contentType,\n      attachment_type: attachment.attachmentType,\n    }),\n    buffer,\n  ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record<EnvelopeItemType, DataCategory> = {\n  session: 'session',\n  sessions: 'session',\n  attachment: 'attachment',\n  transaction: 'transaction',\n  event: 'error',\n  client_report: 'internal',\n  user_report: 'default',\n  profile: 'profile',\n  replay_event: 'replay',\n  replay_recording: 'replay',\n  check_in: 'monitor',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nexport function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory {\n  return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from from the metadata or an events */\nexport function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined {\n  if (!metadataOrEvent || !metadataOrEvent.sdk) {\n    return;\n  }\n  const { name, version } = metadataOrEvent.sdk;\n  return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nexport function createEventEnvelopeHeaders(\n  event: Event,\n  sdkInfo: SdkInfo | undefined,\n  tunnel: string | undefined,\n  dsn: DsnComponents,\n): EventEnvelopeHeaders {\n  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n  return {\n    event_id: event.event_id as string,\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n    ...(dynamicSamplingContext && {\n      trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n    }),\n  };\n}\n"],"names":["normalize","dropUndefinedKeys","dsn","dsnToString"],"mappings":";;;;;;AAoBA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,OAAA,EAAA,KAAA,GAAA,EAAA,EAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,KAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,QAAA,EAAA,OAAA,EAAA;AACA,EAAA,MAAA,CAAA,OAAA,EAAA,KAAA,CAAA,GAAA,QAAA,CAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,CAAA,GAAA,KAAA,EAAA,OAAA,CAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA;AACA,EAAA,QAAA;AACA,EAAA,QAAA;AACA,EAAA;AACA,EAAA,MAAA,aAAA,GAAA,QAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,KAAA,MAAA,YAAA,IAAA,aAAA,EAAA;AACA,IAAA,MAAA,gBAAA,GAAA,YAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,QAAA,CAAA,YAAA,EAAA,gBAAA,CAAA,CAAA;AACA;AACA,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AAA,GAAA,CAAA;AACA,EAAA,OAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,MAAA;AACA,EAAAC,KAAA;AACA,EAAA;AACA,EAAA,MAAA,sBAAA,GAAA,KAAA,CAAA,qBAAA,IAAA,KAAA,CAAA,qBAAA,CAAA,sBAAA,CAAA;AACA,EAAA,OAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,QAAA;AACA,IAAA,OAAA,EAAA,IAAA,IAAA,EAAA,CAAA,WAAA,EAAA;AACA,IAAA,IAAA,OAAA,IAAA,EAAA,GAAA,EAAA,OAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,CAAA,MAAA,IAAA,EAAA,GAAA,EAAAC,eAAA,CAAAD,KAAA,CAAA,EAAA,CAAA;AACA,IAAA,IAAA,sBAAA,IAAA;AACA,MAAA,KAAA,EAAAD,wBAAA,CAAA,EAAA,GAAA,sBAAA,EAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/** An error emitted by Sentry SDKs and related utilities. */
class SentryError extends Error {
  /** Display name of this error instance. */

   constructor( message, logLevel = 'warn') {
    super(message);this.message = message;
    this.name = new.target.prototype.constructor.name;
    // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
    // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
    // instances of `SentryError` fail `obj instanceof SentryError` checks.
    Object.setPrototypeOf(this, new.target.prototype);
    this.logLevel = logLevel;
  }
}

exports.SentryError = SentryError;
//# sourceMappingURL=error.js.map
{"version":3,"file":"error.js","sources":["../../src/error.ts"],"sourcesContent":["import type { ConsoleLevel } from './logger';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n  /** Display name of this error instance. */\n  public name: string;\n\n  public logLevel: ConsoleLevel;\n\n  public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n    super(message);\n\n    this.name = new.target.prototype.constructor.name;\n    // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n    // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n    // instances of `SentryError` fail `obj instanceof SentryError` checks.\n    Object.setPrototypeOf(this, new.target.prototype);\n    this.logLevel = logLevel;\n  }\n}\n"],"names":[],"mappings":";;AAEA;AACA,MAAA,WAAA,SAAA,KAAA,CAAA;AACA;;AAKA,GAAA,WAAA,EAAA,OAAA,EAAA,QAAA,GAAA,MAAA,EAAA;AACA,IAAA,KAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,OAAA,GAAA,OAAA,CACA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,GAAA,CAAA,MAAA,CAAA,SAAA,CAAA,WAAA,CAAA,IAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,GAAA,CAAA,MAAA,CAAA,SAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,GAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const browser = require('./browser.js');
const dsn = require('./dsn.js');
const error = require('./error.js');
const worldwide = require('./worldwide.js');
const instrument = require('./instrument.js');
const is = require('./is.js');
const logger = require('./logger.js');
const memo = require('./memo.js');
const misc = require('./misc.js');
const node = require('./node.js');
const normalize = require('./normalize.js');
const object = require('./object.js');
const path = require('./path.js');
const promisebuffer = require('./promisebuffer.js');
const requestdata = require('./requestdata.js');
const severity = require('./severity.js');
const stacktrace = require('./stacktrace.js');
const string = require('./string.js');
const supports = require('./supports.js');
const syncpromise = require('./syncpromise.js');
const time = require('./time.js');
const tracing = require('./tracing.js');
const env = require('./env.js');
const envelope = require('./envelope.js');
const clientreport = require('./clientreport.js');
const ratelimit = require('./ratelimit.js');
const baggage = require('./baggage.js');
const url = require('./url.js');
const userIntegrations = require('./userIntegrations.js');
const escapeStringForRegex = require('./vendor/escapeStringForRegex.js');
const supportsHistory = require('./vendor/supportsHistory.js');



exports.getDomElement = browser.getDomElement;
exports.getLocationHref = browser.getLocationHref;
exports.htmlTreeAsString = browser.htmlTreeAsString;
exports.dsnFromString = dsn.dsnFromString;
exports.dsnToString = dsn.dsnToString;
exports.makeDsn = dsn.makeDsn;
exports.SentryError = error.SentryError;
exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ;
exports.getGlobalObject = worldwide.getGlobalObject;
exports.getGlobalSingleton = worldwide.getGlobalSingleton;
exports.SENTRY_XHR_DATA_KEY = instrument.SENTRY_XHR_DATA_KEY;
exports.addInstrumentationHandler = instrument.addInstrumentationHandler;
exports.parseFetchArgs = instrument.parseFetchArgs;
exports.isDOMError = is.isDOMError;
exports.isDOMException = is.isDOMException;
exports.isElement = is.isElement;
exports.isError = is.isError;
exports.isErrorEvent = is.isErrorEvent;
exports.isEvent = is.isEvent;
exports.isInstanceOf = is.isInstanceOf;
exports.isNaN = is.isNaN;
exports.isPlainObject = is.isPlainObject;
exports.isPrimitive = is.isPrimitive;
exports.isRegExp = is.isRegExp;
exports.isString = is.isString;
exports.isSyntheticEvent = is.isSyntheticEvent;
exports.isThenable = is.isThenable;
exports.CONSOLE_LEVELS = logger.CONSOLE_LEVELS;
exports.consoleSandbox = logger.consoleSandbox;
Object.defineProperty(exports, 'logger', {
	enumerable: true,
	get: () => logger.logger
});
exports.memoBuilder = memo.memoBuilder;
exports.addContextToFrame = misc.addContextToFrame;
exports.addExceptionMechanism = misc.addExceptionMechanism;
exports.addExceptionTypeValue = misc.addExceptionTypeValue;
exports.arrayify = misc.arrayify;
exports.checkOrSetAlreadyCaught = misc.checkOrSetAlreadyCaught;
exports.getEventDescription = misc.getEventDescription;
exports.parseSemver = misc.parseSemver;
exports.uuid4 = misc.uuid4;
exports.dynamicRequire = node.dynamicRequire;
exports.isNodeEnv = node.isNodeEnv;
exports.loadModule = node.loadModule;
exports.normalize = normalize.normalize;
exports.normalizeToSize = normalize.normalizeToSize;
exports.walk = normalize.walk;
exports.addNonEnumerableProperty = object.addNonEnumerableProperty;
exports.convertToPlainObject = object.convertToPlainObject;
exports.dropUndefinedKeys = object.dropUndefinedKeys;
exports.extractExceptionKeysForMessage = object.extractExceptionKeysForMessage;
exports.fill = object.fill;
exports.getOriginalFunction = object.getOriginalFunction;
exports.markFunctionWrapped = object.markFunctionWrapped;
exports.objectify = object.objectify;
exports.urlEncode = object.urlEncode;
exports.basename = path.basename;
exports.dirname = path.dirname;
exports.isAbsolute = path.isAbsolute;
exports.join = path.join;
exports.normalizePath = path.normalizePath;
exports.relative = path.relative;
exports.resolve = path.resolve;
exports.makePromiseBuffer = promisebuffer.makePromiseBuffer;
exports.addRequestDataToEvent = requestdata.addRequestDataToEvent;
exports.addRequestDataToTransaction = requestdata.addRequestDataToTransaction;
exports.extractPathForTransaction = requestdata.extractPathForTransaction;
exports.extractRequestData = requestdata.extractRequestData;
exports.severityFromString = severity.severityFromString;
exports.severityLevelFromString = severity.severityLevelFromString;
exports.validSeverityLevels = severity.validSeverityLevels;
exports.createStackParser = stacktrace.createStackParser;
exports.getFunctionName = stacktrace.getFunctionName;
exports.nodeStackLineParser = stacktrace.nodeStackLineParser;
exports.stackParserFromStackParserOptions = stacktrace.stackParserFromStackParserOptions;
exports.stripSentryFramesAndReverse = stacktrace.stripSentryFramesAndReverse;
exports.isMatchingPattern = string.isMatchingPattern;
exports.safeJoin = string.safeJoin;
exports.snipLine = string.snipLine;
exports.stringMatchesSomePattern = string.stringMatchesSomePattern;
exports.truncate = string.truncate;
exports.isNativeFetch = supports.isNativeFetch;
exports.supportsDOMError = supports.supportsDOMError;
exports.supportsDOMException = supports.supportsDOMException;
exports.supportsErrorEvent = supports.supportsErrorEvent;
exports.supportsFetch = supports.supportsFetch;
exports.supportsNativeFetch = supports.supportsNativeFetch;
exports.supportsReferrerPolicy = supports.supportsReferrerPolicy;
exports.supportsReportingObserver = supports.supportsReportingObserver;
exports.SyncPromise = syncpromise.SyncPromise;
exports.rejectedSyncPromise = syncpromise.rejectedSyncPromise;
exports.resolvedSyncPromise = syncpromise.resolvedSyncPromise;
Object.defineProperty(exports, '_browserPerformanceTimeOriginMode', {
	enumerable: true,
	get: () => time._browserPerformanceTimeOriginMode
});
exports.browserPerformanceTimeOrigin = time.browserPerformanceTimeOrigin;
exports.dateTimestampInSeconds = time.dateTimestampInSeconds;
exports.timestampInSeconds = time.timestampInSeconds;
exports.timestampWithMs = time.timestampWithMs;
exports.usingPerformanceAPI = time.usingPerformanceAPI;
exports.TRACEPARENT_REGEXP = tracing.TRACEPARENT_REGEXP;
exports.extractTraceparentData = tracing.extractTraceparentData;
exports.getSDKSource = env.getSDKSource;
exports.isBrowserBundle = env.isBrowserBundle;
exports.addItemToEnvelope = envelope.addItemToEnvelope;
exports.createAttachmentEnvelopeItem = envelope.createAttachmentEnvelopeItem;
exports.createEnvelope = envelope.createEnvelope;
exports.createEventEnvelopeHeaders = envelope.createEventEnvelopeHeaders;
exports.envelopeContainsItemType = envelope.envelopeContainsItemType;
exports.envelopeItemTypeToDataCategory = envelope.envelopeItemTypeToDataCategory;
exports.forEachEnvelopeItem = envelope.forEachEnvelopeItem;
exports.getSdkMetadataForEnvelopeHeader = envelope.getSdkMetadataForEnvelopeHeader;
exports.parseEnvelope = envelope.parseEnvelope;
exports.serializeEnvelope = envelope.serializeEnvelope;
exports.createClientReportEnvelope = clientreport.createClientReportEnvelope;
exports.DEFAULT_RETRY_AFTER = ratelimit.DEFAULT_RETRY_AFTER;
exports.disabledUntil = ratelimit.disabledUntil;
exports.isRateLimited = ratelimit.isRateLimited;
exports.parseRetryAfterHeader = ratelimit.parseRetryAfterHeader;
exports.updateRateLimits = ratelimit.updateRateLimits;
exports.BAGGAGE_HEADER_NAME = baggage.BAGGAGE_HEADER_NAME;
exports.MAX_BAGGAGE_STRING_LENGTH = baggage.MAX_BAGGAGE_STRING_LENGTH;
exports.SENTRY_BAGGAGE_KEY_PREFIX = baggage.SENTRY_BAGGAGE_KEY_PREFIX;
exports.SENTRY_BAGGAGE_KEY_PREFIX_REGEX = baggage.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;
exports.baggageHeaderToDynamicSamplingContext = baggage.baggageHeaderToDynamicSamplingContext;
exports.dynamicSamplingContextToSentryBaggageHeader = baggage.dynamicSamplingContextToSentryBaggageHeader;
exports.getNumberOfUrlSegments = url.getNumberOfUrlSegments;
exports.getSanitizedUrlString = url.getSanitizedUrlString;
exports.parseUrl = url.parseUrl;
exports.stripUrlQueryAndFragment = url.stripUrlQueryAndFragment;
exports.addOrUpdateIntegration = userIntegrations.addOrUpdateIntegration;
exports.escapeStringForRegex = escapeStringForRegex.escapeStringForRegex;
exports.supportsHistory = supportsHistory.supportsHistory;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');
const logger = require('./logger.js');
const object = require('./object.js');
const stacktrace = require('./stacktrace.js');
const supports = require('./supports.js');
const worldwide = require('./worldwide.js');
const supportsHistory = require('./vendor/supportsHistory.js');

// eslint-disable-next-line deprecation/deprecation
const WINDOW = worldwide.getGlobalObject();

const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__';

/**
 * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.
 *  - Console API
 *  - Fetch API
 *  - XHR API
 *  - History API
 *  - DOM API (click/typing)
 *  - Error API
 *  - UnhandledRejection API
 */

const handlers = {};
const instrumented = {};

/** Instruments given API */
function instrument(type) {
  if (instrumented[type]) {
    return;
  }

  instrumented[type] = true;

  switch (type) {
    case 'console':
      instrumentConsole();
      break;
    case 'dom':
      instrumentDOM();
      break;
    case 'xhr':
      instrumentXHR();
      break;
    case 'fetch':
      instrumentFetch();
      break;
    case 'history':
      instrumentHistory();
      break;
    case 'error':
      instrumentError();
      break;
    case 'unhandledrejection':
      instrumentUnhandledRejection();
      break;
    default:
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.logger.warn('unknown instrumentation type:', type);
      return;
  }
}

/**
 * Add handler that will be called when given type of instrumentation triggers.
 * Use at your own risk, this might break without changelog notice, only used internally.
 * @hidden
 */
function addInstrumentationHandler(type, callback) {
  handlers[type] = handlers[type] || [];
  (handlers[type] ).push(callback);
  instrument(type);
}

/** JSDoc */
function triggerHandlers(type, data) {
  if (!type || !handlers[type]) {
    return;
  }

  for (const handler of handlers[type] || []) {
    try {
      handler(data);
    } catch (e) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.logger.error(
          `Error while triggering instrumentation handler.\nType: ${type}\nName: ${stacktrace.getFunctionName(handler)}\nError:`,
          e,
        );
    }
  }
}

/** JSDoc */
function instrumentConsole() {
  if (!('console' in WINDOW)) {
    return;
  }

  logger.CONSOLE_LEVELS.forEach(function (level) {
    if (!(level in WINDOW.console)) {
      return;
    }

    object.fill(WINDOW.console, level, function (originalConsoleMethod) {
      return function (...args) {
        triggerHandlers('console', { args, level });

        // this fails for some browsers. :(
        if (originalConsoleMethod) {
          originalConsoleMethod.apply(WINDOW.console, args);
        }
      };
    });
  });
}

/** JSDoc */
function instrumentFetch() {
  if (!supports.supportsNativeFetch()) {
    return;
  }

  object.fill(WINDOW, 'fetch', function (originalFetch) {
    return function (...args) {
      const { method, url } = parseFetchArgs(args);

      const handlerData = {
        args,
        fetchData: {
          method,
          url,
        },
        startTimestamp: Date.now(),
      };

      triggerHandlers('fetch', {
        ...handlerData,
      });

      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      return originalFetch.apply(WINDOW, args).then(
        (response) => {
          triggerHandlers('fetch', {
            ...handlerData,
            endTimestamp: Date.now(),
            response,
          });
          return response;
        },
        (error) => {
          triggerHandlers('fetch', {
            ...handlerData,
            endTimestamp: Date.now(),
            error,
          });
          // NOTE: If you are a Sentry user, and you are seeing this stack frame,
          //       it means the sentry.javascript SDK caught an error invoking your application code.
          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.
          throw error;
        },
      );
    };
  });
}

function hasProp(obj, prop) {
  return !!obj && typeof obj === 'object' && !!(obj )[prop];
}

function getUrlFromResource(resource) {
  if (typeof resource === 'string') {
    return resource;
  }

  if (!resource) {
    return '';
  }

  if (hasProp(resource, 'url')) {
    return resource.url;
  }

  if (resource.toString) {
    return resource.toString();
  }

  return '';
}

/**
 * Parses the fetch arguments to find the used Http method and the url of the request
 */
function parseFetchArgs(fetchArgs) {
  if (fetchArgs.length === 0) {
    return { method: 'GET', url: '' };
  }

  if (fetchArgs.length === 2) {
    const [url, options] = fetchArgs ;

    return {
      url: getUrlFromResource(url),
      method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',
    };
  }

  const arg = fetchArgs[0];
  return {
    url: getUrlFromResource(arg ),
    method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',
  };
}

/** JSDoc */
function instrumentXHR() {
  if (!('XMLHttpRequest' in WINDOW)) {
    return;
  }

  const xhrproto = XMLHttpRequest.prototype;

  object.fill(xhrproto, 'open', function (originalOpen) {
    return function ( ...args) {
      const url = args[1];
      const xhrInfo = (this[SENTRY_XHR_DATA_KEY] = {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        method: is.isString(args[0]) ? args[0].toUpperCase() : args[0],
        url: args[1],
        request_headers: {},
      });

      // if Sentry key appears in URL, don't capture it as a request
      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      if (is.isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {
        this.__sentry_own_request__ = true;
      }

      const onreadystatechangeHandler = () => {
        // For whatever reason, this is not the same instance here as from the outer method
        const xhrInfo = this[SENTRY_XHR_DATA_KEY];

        if (!xhrInfo) {
          return;
        }

        if (this.readyState === 4) {
          try {
            // touching statusCode in some platforms throws
            // an exception
            xhrInfo.status_code = this.status;
          } catch (e) {
            /* do nothing */
          }

          triggerHandlers('xhr', {
            args: args ,
            endTimestamp: Date.now(),
            startTimestamp: Date.now(),
            xhr: this,
          } );
        }
      };

      if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {
        object.fill(this, 'onreadystatechange', function (original) {
          return function ( ...readyStateArgs) {
            onreadystatechangeHandler();
            return original.apply(this, readyStateArgs);
          };
        });
      } else {
        this.addEventListener('readystatechange', onreadystatechangeHandler);
      }

      // Intercepting `setRequestHeader` to access the request headers of XHR instance.
      // This will only work for user/library defined headers, not for the default/browser-assigned headers.
      // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.
      object.fill(this, 'setRequestHeader', function (original) {
        return function ( ...setRequestHeaderArgs) {
          const [header, value] = setRequestHeaderArgs ;

          const xhrInfo = this[SENTRY_XHR_DATA_KEY];

          if (xhrInfo) {
            xhrInfo.request_headers[header.toLowerCase()] = value;
          }

          return original.apply(this, setRequestHeaderArgs);
        };
      });

      return originalOpen.apply(this, args);
    };
  });

  object.fill(xhrproto, 'send', function (originalSend) {
    return function ( ...args) {
      const sentryXhrData = this[SENTRY_XHR_DATA_KEY];
      if (sentryXhrData && args[0] !== undefined) {
        sentryXhrData.body = args[0];
      }

      triggerHandlers('xhr', {
        args,
        startTimestamp: Date.now(),
        xhr: this,
      });

      return originalSend.apply(this, args);
    };
  });
}

let lastHref;

/** JSDoc */
function instrumentHistory() {
  if (!supportsHistory.supportsHistory()) {
    return;
  }

  const oldOnPopState = WINDOW.onpopstate;
  WINDOW.onpopstate = function ( ...args) {
    const to = WINDOW.location.href;
    // keep track of the current URL state, as we always receive only the updated state
    const from = lastHref;
    lastHref = to;
    triggerHandlers('history', {
      from,
      to,
    });
    if (oldOnPopState) {
      // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.
      // https://github.com/getsentry/sentry-javascript/issues/3344
      // https://github.com/bugsnag/bugsnag-js/issues/469
      try {
        return oldOnPopState.apply(this, args);
      } catch (_oO) {
        // no-empty
      }
    }
  };

  /** @hidden */
  function historyReplacementFunction(originalHistoryFunction) {
    return function ( ...args) {
      const url = args.length > 2 ? args[2] : undefined;
      if (url) {
        // coerce to string (this is what pushState does)
        const from = lastHref;
        const to = String(url);
        // keep track of the current URL state, as we always receive only the updated state
        lastHref = to;
        triggerHandlers('history', {
          from,
          to,
        });
      }
      return originalHistoryFunction.apply(this, args);
    };
  }

  object.fill(WINDOW.history, 'pushState', historyReplacementFunction);
  object.fill(WINDOW.history, 'replaceState', historyReplacementFunction);
}

const debounceDuration = 1000;
let debounceTimerID;
let lastCapturedEvent;

/**
 * Decide whether the current event should finish the debounce of previously captured one.
 * @param previous previously captured event
 * @param current event to be captured
 */
function shouldShortcircuitPreviousDebounce(previous, current) {
  // If there was no previous event, it should always be swapped for the new one.
  if (!previous) {
    return true;
  }

  // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.
  if (previous.type !== current.type) {
    return true;
  }

  try {
    // If both events have the same type, it's still possible that actions were performed on different targets.
    // e.g. 2 clicks on different buttons.
    if (previous.target !== current.target) {
      return true;
    }
  } catch (e) {
    // just accessing `target` property can throw an exception in some rare circumstances
    // see: https://github.com/getsentry/sentry-javascript/issues/838
  }

  // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_
  // to which an event listener was attached), we treat them as the same action, as we want to capture
  // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.
  return false;
}

/**
 * Decide whether an event should be captured.
 * @param event event to be captured
 */
function shouldSkipDOMEvent(event) {
  // We are only interested in filtering `keypress` events for now.
  if (event.type !== 'keypress') {
    return false;
  }

  try {
    const target = event.target ;

    if (!target || !target.tagName) {
      return true;
    }

    // Only consider keypress events on actual input elements. This will disregard keypresses targeting body
    // e.g.tabbing through elements, hotkeys, etc.
    if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
      return false;
    }
  } catch (e) {
    // just accessing `target` property can throw an exception in some rare circumstances
    // see: https://github.com/getsentry/sentry-javascript/issues/838
  }

  return true;
}

/**
 * Wraps addEventListener to capture UI breadcrumbs
 * @param handler function that will be triggered
 * @param globalListener indicates whether event was captured by the global event listener
 * @returns wrapped breadcrumb events handler
 * @hidden
 */
function makeDOMEventHandler(handler, globalListener = false) {
  return (event) => {
    // It's possible this handler might trigger multiple times for the same
    // event (e.g. event propagation through node ancestors).
    // Ignore if we've already captured that event.
    if (!event || lastCapturedEvent === event) {
      return;
    }

    // We always want to skip _some_ events.
    if (shouldSkipDOMEvent(event)) {
      return;
    }

    const name = event.type === 'keypress' ? 'input' : event.type;

    // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.
    if (debounceTimerID === undefined) {
      handler({
        event: event,
        name,
        global: globalListener,
      });
      lastCapturedEvent = event;
    }
    // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.
    // If that's the case, emit the previous event and store locally the newly-captured DOM event.
    else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {
      handler({
        event: event,
        name,
        global: globalListener,
      });
      lastCapturedEvent = event;
    }

    // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.
    clearTimeout(debounceTimerID);
    debounceTimerID = WINDOW.setTimeout(() => {
      debounceTimerID = undefined;
    }, debounceDuration);
  };
}

/** JSDoc */
function instrumentDOM() {
  if (!('document' in WINDOW)) {
    return;
  }

  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom
  // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before
  // we instrument `addEventListener` so that we don't end up attaching this handler twice.
  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');
  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);
  WINDOW.document.addEventListener('click', globalDOMEventHandler, false);
  WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);

  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled
  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That
  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler
  // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still
  // guaranteed to fire at least once.)
  ['EventTarget', 'Node'].forEach((target) => {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    const proto = (WINDOW )[target] && (WINDOW )[target].prototype;
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
      return;
    }

    object.fill(proto, 'addEventListener', function (originalAddEventListener) {
      return function (

        type,
        listener,
        options,
      ) {
        if (type === 'click' || type == 'keypress') {
          try {
            const el = this ;
            const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});
            const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });

            if (!handlerForType.handler) {
              const handler = makeDOMEventHandler(triggerDOMHandler);
              handlerForType.handler = handler;
              originalAddEventListener.call(this, type, handler, options);
            }

            handlerForType.refCount++;
          } catch (e) {
            // Accessing dom properties is always fragile.
            // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
          }
        }

        return originalAddEventListener.call(this, type, listener, options);
      };
    });

    object.fill(
      proto,
      'removeEventListener',
      function (originalRemoveEventListener) {
        return function (

          type,
          listener,
          options,
        ) {
          if (type === 'click' || type == 'keypress') {
            try {
              const el = this ;
              const handlers = el.__sentry_instrumentation_handlers__ || {};
              const handlerForType = handlers[type];

              if (handlerForType) {
                handlerForType.refCount--;
                // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.
                if (handlerForType.refCount <= 0) {
                  originalRemoveEventListener.call(this, type, handlerForType.handler, options);
                  handlerForType.handler = undefined;
                  delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
                }

                // If there are no longer any custom handlers of any type on this element, cleanup everything.
                if (Object.keys(handlers).length === 0) {
                  delete el.__sentry_instrumentation_handlers__;
                }
              }
            } catch (e) {
              // Accessing dom properties is always fragile.
              // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
            }
          }

          return originalRemoveEventListener.call(this, type, listener, options);
        };
      },
    );
  });
}

let _oldOnErrorHandler = null;
/** JSDoc */
function instrumentError() {
  _oldOnErrorHandler = WINDOW.onerror;

  WINDOW.onerror = function (msg, url, line, column, error) {
    triggerHandlers('error', {
      column,
      error,
      line,
      msg,
      url,
    });

    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {
      // eslint-disable-next-line prefer-rest-params
      return _oldOnErrorHandler.apply(this, arguments);
    }

    return false;
  };

  WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true;
}

let _oldOnUnhandledRejectionHandler = null;
/** JSDoc */
function instrumentUnhandledRejection() {
  _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;

  WINDOW.onunhandledrejection = function (e) {
    triggerHandlers('unhandledrejection', e);

    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {
      // eslint-disable-next-line prefer-rest-params
      return _oldOnUnhandledRejectionHandler.apply(this, arguments);
    }

    return true;
  };

  WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
}

exports.SENTRY_XHR_DATA_KEY = SENTRY_XHR_DATA_KEY;
exports.addInstrumentationHandler = addInstrumentationHandler;
exports.parseFetchArgs = parseFetchArgs;
//# sourceMappingURL=instrument.js.map
{"version":3,"file":"instrument.js","sources":["../../src/instrument.ts"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type {\n  HandlerDataFetch,\n  HandlerDataXhr,\n  SentryWrappedXMLHttpRequest,\n  SentryXhrData,\n  WrappedFunction,\n} from '@sentry/types';\n\nimport { isString } from './is';\nimport { CONSOLE_LEVELS, logger } from './logger';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__';\n\nexport type InstrumentHandlerType =\n  | 'console'\n  | 'dom'\n  | 'fetch'\n  | 'history'\n  | 'sentry'\n  | 'xhr'\n  | 'error'\n  | 'unhandledrejection';\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n *  - Console API\n *  - Fetch API\n *  - XHR API\n *  - History API\n *  - DOM API (click/typing)\n *  - Error API\n *  - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n  if (instrumented[type]) {\n    return;\n  }\n\n  instrumented[type] = true;\n\n  switch (type) {\n    case 'console':\n      instrumentConsole();\n      break;\n    case 'dom':\n      instrumentDOM();\n      break;\n    case 'xhr':\n      instrumentXHR();\n      break;\n    case 'fetch':\n      instrumentFetch();\n      break;\n    case 'history':\n      instrumentHistory();\n      break;\n    case 'error':\n      instrumentError();\n      break;\n    case 'unhandledrejection':\n      instrumentUnhandledRejection();\n      break;\n    default:\n      __DEBUG_BUILD__ && logger.warn('unknown instrumentation type:', type);\n      return;\n  }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(type: InstrumentHandlerType, callback: InstrumentHandlerCallback): void {\n  handlers[type] = handlers[type] || [];\n  (handlers[type] as InstrumentHandlerCallback[]).push(callback);\n  instrument(type);\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n  if (!type || !handlers[type]) {\n    return;\n  }\n\n  for (const handler of handlers[type] || []) {\n    try {\n      handler(data);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.error(\n          `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n          e,\n        );\n    }\n  }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n  if (!('console' in WINDOW)) {\n    return;\n  }\n\n  CONSOLE_LEVELS.forEach(function (level: string): void {\n    if (!(level in WINDOW.console)) {\n      return;\n    }\n\n    fill(WINDOW.console, level, function (originalConsoleMethod: () => any): Function {\n      return function (...args: any[]): void {\n        triggerHandlers('console', { args, level });\n\n        // this fails for some browsers. :(\n        if (originalConsoleMethod) {\n          originalConsoleMethod.apply(WINDOW.console, args);\n        }\n      };\n    });\n  });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n  if (!supportsNativeFetch()) {\n    return;\n  }\n\n  fill(WINDOW, 'fetch', function (originalFetch: () => void): () => void {\n    return function (...args: any[]): void {\n      const { method, url } = parseFetchArgs(args);\n\n      const handlerData: HandlerDataFetch = {\n        args,\n        fetchData: {\n          method,\n          url,\n        },\n        startTimestamp: Date.now(),\n      };\n\n      triggerHandlers('fetch', {\n        ...handlerData,\n      });\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalFetch.apply(WINDOW, args).then(\n        (response: Response) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            response,\n          });\n          return response;\n        },\n        (error: Error) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            error,\n          });\n          // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n          //       it means the sentry.javascript SDK caught an error invoking your application code.\n          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.\n          throw error;\n        },\n      );\n    };\n  });\n}\n\nfunction hasProp<T extends string>(obj: unknown, prop: T): obj is Record<string, string> {\n  return !!obj && typeof obj === 'object' && !!(obj as Record<string, string>)[prop];\n}\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\nfunction getUrlFromResource(resource: FetchResource): string {\n  if (typeof resource === 'string') {\n    return resource;\n  }\n\n  if (!resource) {\n    return '';\n  }\n\n  if (hasProp(resource, 'url')) {\n    return resource.url;\n  }\n\n  if (resource.toString) {\n    return resource.toString();\n  }\n\n  return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n  if (fetchArgs.length === 0) {\n    return { method: 'GET', url: '' };\n  }\n\n  if (fetchArgs.length === 2) {\n    const [url, options] = fetchArgs as [FetchResource, object];\n\n    return {\n      url: getUrlFromResource(url),\n      method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n    };\n  }\n\n  const arg = fetchArgs[0];\n  return {\n    url: getUrlFromResource(arg as FetchResource),\n    method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n  };\n}\n\n/** JSDoc */\nfunction instrumentXHR(): void {\n  if (!('XMLHttpRequest' in WINDOW)) {\n    return;\n  }\n\n  const xhrproto = XMLHttpRequest.prototype;\n\n  fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const url = args[1];\n      const xhrInfo: SentryXhrData = (this[SENTRY_XHR_DATA_KEY] = {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n        url: args[1],\n        request_headers: {},\n      });\n\n      // if Sentry key appears in URL, don't capture it as a request\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {\n        this.__sentry_own_request__ = true;\n      }\n\n      const onreadystatechangeHandler: () => void = () => {\n        // For whatever reason, this is not the same instance here as from the outer method\n        const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n        if (!xhrInfo) {\n          return;\n        }\n\n        if (this.readyState === 4) {\n          try {\n            // touching statusCode in some platforms throws\n            // an exception\n            xhrInfo.status_code = this.status;\n          } catch (e) {\n            /* do nothing */\n          }\n\n          triggerHandlers('xhr', {\n            args: args as [string, string],\n            endTimestamp: Date.now(),\n            startTimestamp: Date.now(),\n            xhr: this,\n          } as HandlerDataXhr);\n        }\n      };\n\n      if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n        fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n          return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n            onreadystatechangeHandler();\n            return original.apply(this, readyStateArgs);\n          };\n        });\n      } else {\n        this.addEventListener('readystatechange', onreadystatechangeHandler);\n      }\n\n      // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n      // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n      // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n      fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n        return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n          const [header, value] = setRequestHeaderArgs as [string, string];\n\n          const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n          if (xhrInfo) {\n            xhrInfo.request_headers[header.toLowerCase()] = value;\n          }\n\n          return original.apply(this, setRequestHeaderArgs);\n        };\n      });\n\n      return originalOpen.apply(this, args);\n    };\n  });\n\n  fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n      if (sentryXhrData && args[0] !== undefined) {\n        sentryXhrData.body = args[0];\n      }\n\n      triggerHandlers('xhr', {\n        args,\n        startTimestamp: Date.now(),\n        xhr: this,\n      });\n\n      return originalSend.apply(this, args);\n    };\n  });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n  if (!supportsHistory()) {\n    return;\n  }\n\n  const oldOnPopState = WINDOW.onpopstate;\n  WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n    const to = WINDOW.location.href;\n    // keep track of the current URL state, as we always receive only the updated state\n    const from = lastHref;\n    lastHref = to;\n    triggerHandlers('history', {\n      from,\n      to,\n    });\n    if (oldOnPopState) {\n      // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n      // https://github.com/getsentry/sentry-javascript/issues/3344\n      // https://github.com/bugsnag/bugsnag-js/issues/469\n      try {\n        return oldOnPopState.apply(this, args);\n      } catch (_oO) {\n        // no-empty\n      }\n    }\n  };\n\n  /** @hidden */\n  function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n    return function (this: History, ...args: any[]): void {\n      const url = args.length > 2 ? args[2] : undefined;\n      if (url) {\n        // coerce to string (this is what pushState does)\n        const from = lastHref;\n        const to = String(url);\n        // keep track of the current URL state, as we always receive only the updated state\n        lastHref = to;\n        triggerHandlers('history', {\n          from,\n          to,\n        });\n      }\n      return originalHistoryFunction.apply(this, args);\n    };\n  }\n\n  fill(WINDOW.history, 'pushState', historyReplacementFunction);\n  fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nconst debounceDuration = 1000;\nlet debounceTimerID: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\nfunction shouldShortcircuitPreviousDebounce(previous: Event | undefined, current: Event): boolean {\n  // If there was no previous event, it should always be swapped for the new one.\n  if (!previous) {\n    return true;\n  }\n\n  // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n  if (previous.type !== current.type) {\n    return true;\n  }\n\n  try {\n    // If both events have the same type, it's still possible that actions were performed on different targets.\n    // e.g. 2 clicks on different buttons.\n    if (previous.target !== current.target) {\n      return true;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n  // to which an event listener was attached), we treat them as the same action, as we want to capture\n  // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n  return false;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(event: Event): boolean {\n  // We are only interested in filtering `keypress` events for now.\n  if (event.type !== 'keypress') {\n    return false;\n  }\n\n  try {\n    const target = event.target as HTMLElement;\n\n    if (!target || !target.tagName) {\n      return true;\n    }\n\n    // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n    // e.g.tabbing through elements, hotkeys, etc.\n    if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n      return false;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction makeDOMEventHandler(handler: Function, globalListener: boolean = false): (event: Event) => void {\n  return (event: Event): void => {\n    // It's possible this handler might trigger multiple times for the same\n    // event (e.g. event propagation through node ancestors).\n    // Ignore if we've already captured that event.\n    if (!event || lastCapturedEvent === event) {\n      return;\n    }\n\n    // We always want to skip _some_ events.\n    if (shouldSkipDOMEvent(event)) {\n      return;\n    }\n\n    const name = event.type === 'keypress' ? 'input' : event.type;\n\n    // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n    if (debounceTimerID === undefined) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n    // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n    // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n    else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n\n    // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n    clearTimeout(debounceTimerID);\n    debounceTimerID = WINDOW.setTimeout(() => {\n      debounceTimerID = undefined;\n    }, debounceDuration);\n  };\n}\n\ntype AddEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n  __sentry_instrumentation_handlers__?: {\n    [key in 'click' | 'keypress']?: {\n      handler?: Function;\n      /** The number of custom listeners attached to this element */\n      refCount: number;\n    };\n  };\n};\n\n/** JSDoc */\nfunction instrumentDOM(): void {\n  if (!('document' in WINDOW)) {\n    return;\n  }\n\n  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n  // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n  // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n  WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n  WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n  // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n  // guaranteed to fire at least once.)\n  ['EventTarget', 'Node'].forEach((target: string) => {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n      return;\n    }\n\n    fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n      return function (\n        this: Element,\n        type: string,\n        listener: EventListenerOrEventListenerObject,\n        options?: boolean | AddEventListenerOptions,\n      ): AddEventListener {\n        if (type === 'click' || type == 'keypress') {\n          try {\n            const el = this as InstrumentedElement;\n            const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n            const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n            if (!handlerForType.handler) {\n              const handler = makeDOMEventHandler(triggerDOMHandler);\n              handlerForType.handler = handler;\n              originalAddEventListener.call(this, type, handler, options);\n            }\n\n            handlerForType.refCount++;\n          } catch (e) {\n            // Accessing dom properties is always fragile.\n            // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n          }\n        }\n\n        return originalAddEventListener.call(this, type, listener, options);\n      };\n    });\n\n    fill(\n      proto,\n      'removeEventListener',\n      function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n        return function (\n          this: Element,\n          type: string,\n          listener: EventListenerOrEventListenerObject,\n          options?: boolean | EventListenerOptions,\n        ): () => void {\n          if (type === 'click' || type == 'keypress') {\n            try {\n              const el = this as InstrumentedElement;\n              const handlers = el.__sentry_instrumentation_handlers__ || {};\n              const handlerForType = handlers[type];\n\n              if (handlerForType) {\n                handlerForType.refCount--;\n                // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n                if (handlerForType.refCount <= 0) {\n                  originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n                  handlerForType.handler = undefined;\n                  delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n                }\n\n                // If there are no longer any custom handlers of any type on this element, cleanup everything.\n                if (Object.keys(handlers).length === 0) {\n                  delete el.__sentry_instrumentation_handlers__;\n                }\n              }\n            } catch (e) {\n              // Accessing dom properties is always fragile.\n              // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n            }\n          }\n\n          return originalRemoveEventListener.call(this, type, listener, options);\n        };\n      },\n    );\n  });\n}\n\nlet _oldOnErrorHandler: (typeof WINDOW)['onerror'] | null = null;\n/** JSDoc */\nfunction instrumentError(): void {\n  _oldOnErrorHandler = WINDOW.onerror;\n\n  WINDOW.onerror = function (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean {\n    triggerHandlers('error', {\n      column,\n      error,\n      line,\n      msg,\n      url,\n    });\n\n    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnErrorHandler.apply(this, arguments);\n    }\n\n    return false;\n  };\n\n  WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nlet _oldOnUnhandledRejectionHandler: (typeof WINDOW)['onunhandledrejection'] | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n  _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;\n\n  WINDOW.onunhandledrejection = function (e: any): boolean {\n    triggerHandlers('unhandledrejection', e);\n\n    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n    }\n\n    return true;\n  };\n\n  WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n"],"names":["getGlobalObject","logger","getFunctionName","CONSOLE_LEVELS","fill","supportsNativeFetch","isString","supportsHistory"],"mappings":";;;;;;;;;;AAkBA;AACA,MAAA,MAAA,GAAAA,yBAAA,EAAA,CAAA;AACA;AACA,MAAA,mBAAA,GAAA,oBAAA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,QAAA,GAAA,EAA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;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,CAAA,oBAAA,CAAA,uBAAA,GAAA,IAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// eslint-disable-next-line @typescript-eslint/unbound-method
const objectToString = Object.prototype.toString;

/**
 * Checks whether given value's type is one of a few Error or Error-like
 * {@link isError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isError(wat) {
  switch (objectToString.call(wat)) {
    case '[object Error]':
    case '[object Exception]':
    case '[object DOMException]':
      return true;
    default:
      return isInstanceOf(wat, Error);
  }
}
/**
 * Checks whether given value is an instance of the given built-in class.
 *
 * @param wat The value to be checked
 * @param className
 * @returns A boolean representing the result.
 */
function isBuiltin(wat, className) {
  return objectToString.call(wat) === `[object ${className}]`;
}

/**
 * Checks whether given value's type is ErrorEvent
 * {@link isErrorEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isErrorEvent(wat) {
  return isBuiltin(wat, 'ErrorEvent');
}

/**
 * Checks whether given value's type is DOMError
 * {@link isDOMError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isDOMError(wat) {
  return isBuiltin(wat, 'DOMError');
}

/**
 * Checks whether given value's type is DOMException
 * {@link isDOMException}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isDOMException(wat) {
  return isBuiltin(wat, 'DOMException');
}

/**
 * Checks whether given value's type is a string
 * {@link isString}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isString(wat) {
  return isBuiltin(wat, 'String');
}

/**
 * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
 * {@link isPrimitive}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isPrimitive(wat) {
  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
}

/**
 * Checks whether given value's type is an object literal
 * {@link isPlainObject}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isPlainObject(wat) {
  return isBuiltin(wat, 'Object');
}

/**
 * Checks whether given value's type is an Event instance
 * {@link isEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isEvent(wat) {
  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
}

/**
 * Checks whether given value's type is an Element instance
 * {@link isElement}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isElement(wat) {
  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
}

/**
 * Checks whether given value's type is an regexp
 * {@link isRegExp}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isRegExp(wat) {
  return isBuiltin(wat, 'RegExp');
}

/**
 * Checks whether given value has a then function.
 * @param wat A value to be checked.
 */
function isThenable(wat) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return Boolean(wat && wat.then && typeof wat.then === 'function');
}

/**
 * Checks whether given value's type is a SyntheticEvent
 * {@link isSyntheticEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isSyntheticEvent(wat) {
  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
}

/**
 * Checks whether given value is NaN
 * {@link isNaN}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isNaN(wat) {
  return typeof wat === 'number' && wat !== wat;
}

/**
 * Checks whether given value's type is an instance of provided constructor.
 * {@link isInstanceOf}.
 *
 * @param wat A value to be checked.
 * @param base A constructor to be used in a check.
 * @returns A boolean representing the result.
 */
function isInstanceOf(wat, base) {
  try {
    return wat instanceof base;
  } catch (_e) {
    return false;
  }
}

exports.isDOMError = isDOMError;
exports.isDOMException = isDOMException;
exports.isElement = isElement;
exports.isError = isError;
exports.isErrorEvent = isErrorEvent;
exports.isEvent = isEvent;
exports.isInstanceOf = isInstanceOf;
exports.isNaN = isNaN;
exports.isPlainObject = isPlainObject;
exports.isPrimitive = isPrimitive;
exports.isRegExp = isRegExp;
exports.isString = isString;
exports.isSyntheticEvent = isSyntheticEvent;
exports.isThenable = isThenable;
//# sourceMappingURL=is.js.map
{"version":3,"file":"is.js","sources":["../../src/is.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n  switch (objectToString.call(wat)) {\n    case '[object Error]':\n    case '[object Exception]':\n    case '[object DOMException]':\n      return true;\n    default:\n      return isInstanceOf(wat, Error);\n  }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n  return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n  return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n  return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record<string, unknown> {\n  return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n  return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike<any> {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n  return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n  try {\n    return wat instanceof base;\n  } catch (_e) {\n    return false;\n  }\n}\n"],"names":[],"mappings":";;AAKA;AACA,MAAA,cAAA,GAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,OAAA,CAAA,GAAA,EAAA;AACA,EAAA,QAAA,cAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,IAAA,KAAA,gBAAA,CAAA;AACA,IAAA,KAAA,oBAAA,CAAA;AACA,IAAA,KAAA,uBAAA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,IAAA;AACA,MAAA,OAAA,YAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,GAAA,EAAA,SAAA,EAAA;AACA,EAAA,OAAA,cAAA,CAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA,QAAA,EAAA,SAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,SAAA,CAAA,GAAA,EAAA,YAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,UAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,SAAA,CAAA,GAAA,EAAA,UAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA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;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,GAAA,CAAA,IAAA,aAAA,IAAA,GAAA,IAAA,gBAAA,IAAA,GAAA,IAAA,iBAAA,IAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,GAAA,KAAA,QAAA,IAAA,GAAA,KAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,GAAA,EAAA,IAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,GAAA,YAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,EAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;;;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const worldwide = require('./worldwide.js');

/** Prefix for logging strings */
const PREFIX = 'Sentry Logger ';

const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;

/**
 * Temporarily disable sentry console instrumentations.
 *
 * @param callback The function to run against the original `console` messages
 * @returns The results of the callback
 */
function consoleSandbox(callback) {
  if (!('console' in worldwide.GLOBAL_OBJ)) {
    return callback();
  }

  const originalConsole = worldwide.GLOBAL_OBJ.console ;
  const wrappedLevels = {};

  // Restore all wrapped console methods
  CONSOLE_LEVELS.forEach(level => {
    // TODO(v7): Remove this check as it's only needed for Node 6
    const originalWrappedFunc =
      originalConsole[level] && (originalConsole[level] ).__sentry_original__;
    if (level in originalConsole && originalWrappedFunc) {
      wrappedLevels[level] = originalConsole[level] ;
      originalConsole[level] = originalWrappedFunc ;
    }
  });

  try {
    return callback();
  } finally {
    // Revert restoration to wrapped state
    Object.keys(wrappedLevels).forEach(level => {
      originalConsole[level] = wrappedLevels[level ];
    });
  }
}

function makeLogger() {
  let enabled = false;
  const logger = {
    enable: () => {
      enabled = true;
    },
    disable: () => {
      enabled = false;
    },
  };

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    CONSOLE_LEVELS.forEach(name => {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      logger[name] = (...args) => {
        if (enabled) {
          consoleSandbox(() => {
            worldwide.GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
          });
        }
      };
    });
  } else {
    CONSOLE_LEVELS.forEach(name => {
      logger[name] = () => undefined;
    });
  }

  return logger ;
}

// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
exports.logger = void 0;
if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
  exports.logger = worldwide.getGlobalSingleton('logger', makeLogger);
} else {
  exports.logger = makeLogger();
}

exports.CONSOLE_LEVELS = CONSOLE_LEVELS;
exports.consoleSandbox = consoleSandbox;
//# sourceMappingURL=logger.js.map
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import type { WrappedFunction } from '@sentry/types';\n\nimport { getGlobalSingleton, GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] as const;\nexport type ConsoleLevel = (typeof CONSOLE_LEVELS)[number];\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record<(typeof CONSOLE_LEVELS)[number], LoggerMethod>;\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n  disable(): void;\n  enable(): void;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox<T>(callback: () => T): T {\n  if (!('console' in GLOBAL_OBJ)) {\n    return callback();\n  }\n\n  const originalConsole = GLOBAL_OBJ.console as Console & Record<string, unknown>;\n  const wrappedLevels: Partial<LoggerConsoleMethods> = {};\n\n  // Restore all wrapped console methods\n  CONSOLE_LEVELS.forEach(level => {\n    // TODO(v7): Remove this check as it's only needed for Node 6\n    const originalWrappedFunc =\n      originalConsole[level] && (originalConsole[level] as WrappedFunction).__sentry_original__;\n    if (level in originalConsole && originalWrappedFunc) {\n      wrappedLevels[level] = originalConsole[level] as LoggerConsoleMethods[typeof level];\n      originalConsole[level] = originalWrappedFunc as Console[typeof level];\n    }\n  });\n\n  try {\n    return callback();\n  } finally {\n    // Revert restoration to wrapped state\n    Object.keys(wrappedLevels).forEach(level => {\n      originalConsole[level] = wrappedLevels[level as (typeof CONSOLE_LEVELS)[number]];\n    });\n  }\n}\n\nfunction makeLogger(): Logger {\n  let enabled = false;\n  const logger: Partial<Logger> = {\n    enable: () => {\n      enabled = true;\n    },\n    disable: () => {\n      enabled = false;\n    },\n  };\n\n  if (__DEBUG_BUILD__) {\n    CONSOLE_LEVELS.forEach(name => {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      logger[name] = (...args: any[]) => {\n        if (enabled) {\n          consoleSandbox(() => {\n            GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n          });\n        }\n      };\n    });\n  } else {\n    CONSOLE_LEVELS.forEach(name => {\n      logger[name] = () => undefined;\n    });\n  }\n\n  return logger as Logger;\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nlet logger: Logger;\nif (__DEBUG_BUILD__) {\n  logger = getGlobalSingleton('logger', makeLogger);\n} else {\n  logger = makeLogger();\n}\n\nexport { logger };\n"],"names":["GLOBAL_OBJ","logger","getGlobalSingleton"],"mappings":";;;;AAIA;AACA,MAAA,MAAA,GAAA,gBAAA,CAAA;AACA;AACA,MAAA,cAAA,GAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,KAAA,EAAA,QAAA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KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,IAAA,cAAA,CAAA,OAAA,CAAA,IAAA,IAAA;AACA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CAAA,GAAA,IAAA,KAAA;AACA,QAAA,IAAA,OAAA,EAAA;AACA,UAAA,cAAA,CAAA,MAAA;AACA,YAAAA,oBAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,EAAA,IAAA,CAAA,EAAA,CAAA,EAAA,GAAA,IAAA,CAAA,CAAA;AACA,WAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,cAAA,CAAA,OAAA,CAAA,IAAA,IAAA;AACA,MAAA,MAAA,CAAA,IAAA,CAAA,GAAA,MAAA,SAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,MAAA,EAAA;AACA,CAAA;AACA;AACA;AACAC,wBAAA;AACA,KAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,GAAA;AACA,EAAAA,cAAA,GAAAC,4BAAA,CAAA,QAAA,EAAA,UAAA,CAAA,CAAA;AACA,CAAA,MAAA;AACA,EAAAD,cAAA,GAAA,UAAA,EAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-explicit-any */

/**
 * Helper to decycle json objects
 */
function memoBuilder() {
  const hasWeakSet = typeof WeakSet === 'function';
  const inner = hasWeakSet ? new WeakSet() : [];
  function memoize(obj) {
    if (hasWeakSet) {
      if (inner.has(obj)) {
        return true;
      }
      inner.add(obj);
      return false;
    }
    // eslint-disable-next-line @typescript-eslint/prefer-for-of
    for (let i = 0; i < inner.length; i++) {
      const value = inner[i];
      if (value === obj) {
        return true;
      }
    }
    inner.push(obj);
    return false;
  }

  function unmemoize(obj) {
    if (hasWeakSet) {
      inner.delete(obj);
    } else {
      for (let i = 0; i < inner.length; i++) {
        if (inner[i] === obj) {
          inner.splice(i, 1);
          break;
        }
      }
    }
  }
  return [memoize, unmemoize];
}

exports.memoBuilder = memoBuilder;
//# sourceMappingURL=memo.js.map
{"version":3,"file":"memo.js","sources":["../../src/memo.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n  // memoize\n  (obj: any) => boolean,\n  // unmemoize\n  (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n  const hasWeakSet = typeof WeakSet === 'function';\n  const inner: any = hasWeakSet ? new WeakSet() : [];\n  function memoize(obj: any): boolean {\n    if (hasWeakSet) {\n      if (inner.has(obj)) {\n        return true;\n      }\n      inner.add(obj);\n      return false;\n    }\n    // eslint-disable-next-line @typescript-eslint/prefer-for-of\n    for (let i = 0; i < inner.length; i++) {\n      const value = inner[i];\n      if (value === obj) {\n        return true;\n      }\n    }\n    inner.push(obj);\n    return false;\n  }\n\n  function unmemoize(obj: any): void {\n    if (hasWeakSet) {\n      inner.delete(obj);\n    } else {\n      for (let i = 0; i < inner.length; i++) {\n        if (inner[i] === obj) {\n          inner.splice(i, 1);\n          break;\n        }\n      }\n    }\n  }\n  return [memoize, unmemoize];\n}\n"],"names":[],"mappings":";;AAAA;AACA;;AASA;AACA;AACA;AACA,SAAA,WAAA,GAAA;AACA,EAAA,MAAA,UAAA,GAAA,OAAA,OAAA,KAAA,UAAA,CAAA;AACA,EAAA,MAAA,KAAA,GAAA,UAAA,GAAA,IAAA,OAAA,EAAA,GAAA,EAAA,CAAA;AACA,EAAA,SAAA,OAAA,CAAA,GAAA,EAAA;AACA,IAAA,IAAA,UAAA,EAAA;AACA,MAAA,IAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA,EAAA;AACA,QAAA,OAAA,IAAA,CAAA;AACA,OAAA;AACA,MAAA,KAAA,CAAA,GAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,OAAA,KAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,KAAA,IAAA,CAAA,GAAA,CAAA,EAAA,CAAA,GAAA,KAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,MAAA,MAAA,KAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,MAAA,IAAA,KAAA,KAAA,GAAA,EAAA;AACA,QAAA,OAAA,IAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA,IAAA,KAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,SAAA,SAAA,CAAA,GAAA,EAAA;AACA,IAAA,IAAA,UAAA,EAAA;AACA,MAAA,KAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,KAAA,IAAA,CAAA,GAAA,CAAA,EAAA,CAAA,GAAA,KAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,QAAA,IAAA,KAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,UAAA,KAAA,CAAA,MAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA;AACA,UAAA,MAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,SAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const object = require('./object.js');
const string = require('./string.js');
const worldwide = require('./worldwide.js');

/**
 * UUID4 generator
 *
 * @returns string Generated UUID4.
 */
function uuid4() {
  const gbl = worldwide.GLOBAL_OBJ ;
  const crypto = gbl.crypto || gbl.msCrypto;

  if (crypto && crypto.randomUUID) {
    return crypto.randomUUID().replace(/-/g, '');
  }

  const getRandomByte =
    crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;

  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
  // Concatenating the following numbers as strings results in '10000000100040008000100000000000'
  return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>
    // eslint-disable-next-line no-bitwise
    ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),
  );
}

function getFirstException(event) {
  return event.exception && event.exception.values ? event.exception.values[0] : undefined;
}

/**
 * Extracts either message or type+value from an event that can be used for user-facing logs
 * @returns event's description
 */
function getEventDescription(event) {
  const { message, event_id: eventId } = event;
  if (message) {
    return message;
  }

  const firstException = getFirstException(event);
  if (firstException) {
    if (firstException.type && firstException.value) {
      return `${firstException.type}: ${firstException.value}`;
    }
    return firstException.type || firstException.value || eventId || '<unknown>';
  }
  return eventId || '<unknown>';
}

/**
 * Adds exception values, type and value to an synthetic Exception.
 * @param event The event to modify.
 * @param value Value of the exception.
 * @param type Type of the exception.
 * @hidden
 */
function addExceptionTypeValue(event, value, type) {
  const exception = (event.exception = event.exception || {});
  const values = (exception.values = exception.values || []);
  const firstException = (values[0] = values[0] || {});
  if (!firstException.value) {
    firstException.value = value || '';
  }
  if (!firstException.type) {
    firstException.type = type || 'Error';
  }
}

/**
 * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.
 *
 * @param event The event to modify.
 * @param newMechanism Mechanism data to add to the event.
 * @hidden
 */
function addExceptionMechanism(event, newMechanism) {
  const firstException = getFirstException(event);
  if (!firstException) {
    return;
  }

  const defaultMechanism = { type: 'generic', handled: true };
  const currentMechanism = firstException.mechanism;
  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };

  if (newMechanism && 'data' in newMechanism) {
    const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };
    firstException.mechanism.data = mergedData;
  }
}

// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
const SEMVER_REGEXP =
  /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;

/**
 * Represents Semantic Versioning object
 */

/**
 * Parses input into a SemVer interface
 * @param input string representation of a semver version
 */
function parseSemver(input) {
  const match = input.match(SEMVER_REGEXP) || [];
  const major = parseInt(match[1], 10);
  const minor = parseInt(match[2], 10);
  const patch = parseInt(match[3], 10);
  return {
    buildmetadata: match[5],
    major: isNaN(major) ? undefined : major,
    minor: isNaN(minor) ? undefined : minor,
    patch: isNaN(patch) ? undefined : patch,
    prerelease: match[4],
  };
}

/**
 * This function adds context (pre/post/line) lines to the provided frame
 *
 * @param lines string[] containing all lines
 * @param frame StackFrame that will be mutated
 * @param linesOfContext number of context lines we want to add pre/post
 */
function addContextToFrame(lines, frame, linesOfContext = 5) {
  // When there is no line number in the frame, attaching context is nonsensical and will even break grouping
  if (frame.lineno === undefined) {
    return;
  }

  const maxLines = lines.length;
  const sourceLine = Math.max(Math.min(maxLines, frame.lineno - 1), 0);

  frame.pre_context = lines
    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)
    .map((line) => string.snipLine(line, 0));

  frame.context_line = string.snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);

  frame.post_context = lines
    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)
    .map((line) => string.snipLine(line, 0));
}

/**
 * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object
 * in question), and marks it captured if not.
 *
 * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and
 * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so
 * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because
 * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not
 * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This
 * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we
 * see it.
 *
 * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on
 * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent
 * object wrapper forms so that this check will always work. However, because we need to flag the exact object which
 * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification
 * must be done before the exception captured.
 *
 * @param A thrown exception to check or flag as having been seen
 * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
 */
function checkOrSetAlreadyCaught(exception) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  if (exception && (exception ).__sentry_captured__) {
    return true;
  }

  try {
    // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the
    // `ExtraErrorData` integration
    object.addNonEnumerableProperty(exception , '__sentry_captured__', true);
  } catch (err) {
    // `exception` is a primitive, so we can't mark it seen
  }

  return false;
}

/**
 * Checks whether the given input is already an array, and if it isn't, wraps it in one.
 *
 * @param maybeArray Input to turn into an array, if necessary
 * @returns The input, if already an array, or an array with the input as the only element, if not
 */
function arrayify(maybeArray) {
  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
}

exports.addContextToFrame = addContextToFrame;
exports.addExceptionMechanism = addExceptionMechanism;
exports.addExceptionTypeValue = addExceptionTypeValue;
exports.arrayify = arrayify;
exports.checkOrSetAlreadyCaught = checkOrSetAlreadyCaught;
exports.getEventDescription = getEventDescription;
exports.parseSemver = parseSemver;
exports.uuid4 = uuid4;
//# sourceMappingURL=misc.js.map
{"version":3,"file":"misc.js","sources":["../../src/misc.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n  getRandomValues(array: Uint8Array): Uint8Array;\n  randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n  msCrypto?: CryptoInternal;\n  crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n  const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n  const crypto = gbl.crypto || gbl.msCrypto;\n\n  if (crypto && crypto.randomUUID) {\n    return crypto.randomUUID().replace(/-/g, '');\n  }\n\n  const getRandomByte =\n    crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;\n\n  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n  // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n  return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n    // eslint-disable-next-line no-bitwise\n    ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n  );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n  return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n  const { message, event_id: eventId } = event;\n  if (message) {\n    return message;\n  }\n\n  const firstException = getFirstException(event);\n  if (firstException) {\n    if (firstException.type && firstException.value) {\n      return `${firstException.type}: ${firstException.value}`;\n    }\n    return firstException.type || firstException.value || eventId || '<unknown>';\n  }\n  return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n  const exception = (event.exception = event.exception || {});\n  const values = (exception.values = exception.values || []);\n  const firstException = (values[0] = values[0] || {});\n  if (!firstException.value) {\n    firstException.value = value || '';\n  }\n  if (!firstException.type) {\n    firstException.type = type || 'Error';\n  }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void {\n  const firstException = getFirstException(event);\n  if (!firstException) {\n    return;\n  }\n\n  const defaultMechanism = { type: 'generic', handled: true };\n  const currentMechanism = firstException.mechanism;\n  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n  if (newMechanism && 'data' in newMechanism) {\n    const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n    firstException.mechanism.data = mergedData;\n  }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n  /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n  major?: number;\n  minor?: number;\n  patch?: number;\n  prerelease?: string;\n  buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n  const match = input.match(SEMVER_REGEXP) || [];\n  const major = parseInt(match[1], 10);\n  const minor = parseInt(match[2], 10);\n  const patch = parseInt(match[3], 10);\n  return {\n    buildmetadata: match[5],\n    major: isNaN(major) ? undefined : major,\n    minor: isNaN(minor) ? undefined : minor,\n    patch: isNaN(patch) ? undefined : patch,\n    prerelease: match[4],\n  };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n  // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n  if (frame.lineno === undefined) {\n    return;\n  }\n\n  const maxLines = lines.length;\n  const sourceLine = Math.max(Math.min(maxLines, frame.lineno - 1), 0);\n\n  frame.pre_context = lines\n    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n    .map((line: string) => snipLine(line, 0));\n\n  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n  frame.post_context = lines\n    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n    .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  if (exception && (exception as any).__sentry_captured__) {\n    return true;\n  }\n\n  try {\n    // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n    // `ExtraErrorData` integration\n    addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n  } catch (err) {\n    // `exception` is a primitive, so we can't mark it seen\n  }\n\n  return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify<T = unknown>(maybeArray: T | T[]): T[] {\n  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n"],"names":["GLOBAL_OBJ","snipLine","addNonEnumerableProperty"],"mappings":";;;;;;AAkBA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,GAAA;AACA,EAAA,MAAA,GAAA,GAAAA,oBAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,MAAA,IAAA,GAAA,CAAA,QAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA,MAAA,CAAA,UAAA,EAAA,CAAA,OAAA,CAAA,IAAA,EAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,aAAA;AACA,IAAA,MAAA,IAAA,MAAA,CAAA,eAAA,GAAA,MAAA,MAAA,CAAA,eAAA,CAAA,IAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,MAAA,IAAA,CAAA,MAAA,EAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,CAAA,CAAA,CAAA,GAAA,CAAA,KAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,IAAA,EAAA,OAAA,CAAA,QAAA,EAAA,CAAA;AACA;AACA,IAAA,CAAA,CAAA,CAAA,MAAA,CAAA,aAAA,EAAA,GAAA,EAAA,MAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,EAAA,QAAA,CAAA,EAAA,C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AA,KAAA,CAAA,YAAA,GAAAA,eAAA,CAAA,KAAA,CAAA,IAAA,CAAA,GAAA,CAAA,QAAA,GAAA,CAAA,EAAA,UAAA,CAAA,CAAA,EAAA,KAAA,CAAA,KAAA,IAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,KAAA,CAAA,YAAA,GAAA,KAAA;AACA,KAAA,KAAA,CAAA,IAAA,CAAA,GAAA,CAAA,UAAA,GAAA,CAAA,EAAA,QAAA,CAAA,EAAA,UAAA,GAAA,CAAA,GAAA,cAAA,CAAA;AACA,KAAA,GAAA,CAAA,CAAA,IAAA,KAAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,SAAA,EAAA;AACA;AACA,EAAA,IAAA,SAAA,IAAA,CAAA,SAAA,GAAA,mBAAA,EAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA;AACA;AACA,IAAAC,+BAAA,CAAA,SAAA,GAAA,qBAAA,EAAA,IAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,UAAA,EAAA;AACA,EAAA,OAAA,KAAA,CAAA,OAAA,CAAA,UAAA,CAAA,GAAA,UAAA,GAAA,CAAA,UAAA,CAAA,CAAA;AACA;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/** Node Stack line parser */
// eslint-disable-next-line complexity
function node(getModule) {
  const FILENAME_MATCH = /^\s*[-]{4,}$/;
  const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;

  // eslint-disable-next-line complexity
  return (line) => {
    const lineMatch = line.match(FULL_MATCH);

    if (lineMatch) {
      let object;
      let method;
      let functionName;
      let typeName;
      let methodName;

      if (lineMatch[1]) {
        functionName = lineMatch[1];

        let methodStart = functionName.lastIndexOf('.');
        if (functionName[methodStart - 1] === '.') {
          methodStart--;
        }

        if (methodStart > 0) {
          object = functionName.slice(0, methodStart);
          method = functionName.slice(methodStart + 1);
          const objectEnd = object.indexOf('.Module');
          if (objectEnd > 0) {
            functionName = functionName.slice(objectEnd + 1);
            object = object.slice(0, objectEnd);
          }
        }
        typeName = undefined;
      }

      if (method) {
        typeName = object;
        methodName = method;
      }

      if (method === '<anonymous>') {
        methodName = undefined;
        functionName = undefined;
      }

      if (functionName === undefined) {
        methodName = methodName || '<anonymous>';
        functionName = typeName ? `${typeName}.${methodName}` : methodName;
      }

      let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];
      const isNative = lineMatch[5] === 'native';

      if (!filename && lineMatch[5] && !isNative) {
        filename = lineMatch[5];
      }

      const isInternal =
        isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && !filename.includes(':\\'));

      // in_app is all that's not an internal Node function or a module within node_modules
      // note that isNative appears to return true even for node core libraries
      // see https://github.com/getsentry/raven-node/issues/176

      const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');

      return {
        filename,
        module: getModule ? getModule(filename) : undefined,
        function: functionName,
        lineno: parseInt(lineMatch[3], 10) || undefined,
        colno: parseInt(lineMatch[4], 10) || undefined,
        in_app,
      };
    }

    if (line.match(FILENAME_MATCH)) {
      return {
        filename: line,
      };
    }

    return undefined;
  };
}

exports.node = node;
//# sourceMappingURL=node-stack-trace.js.map
{"version":3,"file":"node-stack-trace.js","sources":["../../src/node-stack-trace.ts"],"sourcesContent":["// This code was originally forked from https://github.com/felixge/node-stack-trace\n// Since then it has been highly modified to fit our needs.\n\n// Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)//\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions://\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.//\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport type { StackLineParserFn } from '@sentry/types';\n\nexport type GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/** Node Stack line parser */\n// eslint-disable-next-line complexity\nexport function node(getModule?: GetModuleFn): StackLineParserFn {\n  const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n  const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n  // eslint-disable-next-line complexity\n  return (line: string) => {\n    const lineMatch = line.match(FULL_MATCH);\n\n    if (lineMatch) {\n      let object: string | undefined;\n      let method: string | undefined;\n      let functionName: string | undefined;\n      let typeName: string | undefined;\n      let methodName: string | undefined;\n\n      if (lineMatch[1]) {\n        functionName = lineMatch[1];\n\n        let methodStart = functionName.lastIndexOf('.');\n        if (functionName[methodStart - 1] === '.') {\n          methodStart--;\n        }\n\n        if (methodStart > 0) {\n          object = functionName.slice(0, methodStart);\n          method = functionName.slice(methodStart + 1);\n          const objectEnd = object.indexOf('.Module');\n          if (objectEnd > 0) {\n            functionName = functionName.slice(objectEnd + 1);\n            object = object.slice(0, objectEnd);\n          }\n        }\n        typeName = undefined;\n      }\n\n      if (method) {\n        typeName = object;\n        methodName = method;\n      }\n\n      if (method === '<anonymous>') {\n        methodName = undefined;\n        functionName = undefined;\n      }\n\n      if (functionName === undefined) {\n        methodName = methodName || '<anonymous>';\n        functionName = typeName ? `${typeName}.${methodName}` : methodName;\n      }\n\n      let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n      const isNative = lineMatch[5] === 'native';\n\n      if (!filename && lineMatch[5] && !isNative) {\n        filename = lineMatch[5];\n      }\n\n      const isInternal =\n        isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && !filename.includes(':\\\\'));\n\n      // in_app is all that's not an internal Node function or a module within node_modules\n      // note that isNative appears to return true even for node core libraries\n      // see https://github.com/getsentry/raven-node/issues/176\n\n      const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');\n\n      return {\n        filename,\n        module: getModule ? getModule(filename) : undefined,\n        function: functionName,\n        lineno: parseInt(lineMatch[3], 10) || undefined,\n        colno: parseInt(lineMatch[4], 10) || undefined,\n        in_app,\n      };\n    }\n\n    if (line.match(FILENAME_MATCH)) {\n      return {\n        filename: line,\n      };\n    }\n\n    return undefined;\n  };\n}\n"],"names":[],"mappings":";;AA2BA;AACA;AACA,SAAA,IAAA,CAAA,SAAA,EAAA;AACA,EAAA,MAAA,cAAA,GAAA,cAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,+DAAA,CAAA;AACA;AACA;AACA,EAAA,OAAA,CAAA,IAAA,KAAA;AACA,IAAA,MAAA,SAAA,GAAA,IAAA,CAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,SAAA,EAAA;AACA,MAAA,IAAA,MAAA,CAAA;AACA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A,EAAA,EAAA,CAAA,IAAA,SAAA;AACA,QAAA,MAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,EAAA;AACA,MAAA,OAAA;AACA,QAAA,QAAA,EAAA,IAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const env = require('./env.js');

/**
 * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
 * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
 */

/**
 * Checks whether we're in the Node.js or Browser environment
 *
 * @returns Answer to given question
 */
function isNodeEnv() {
  // explicitly check for browser bundles as those can be optimized statically
  // by terser/rollup.
  return (
    !env.isBrowserBundle() &&
    Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'
  );
}

/**
 * Requires a module which is protected against bundler minification.
 *
 * @param request The module path to resolve
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
function dynamicRequire(mod, request) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return mod.require(request);
}

/**
 * Helper for dynamically loading module that should work with linked dependencies.
 * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`
 * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during
 * build time. `require.resolve` is also not available in any other way, so we cannot create,
 * a fake helper like we do with `dynamicRequire`.
 *
 * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.
 * That is to mimic the behavior of `require.resolve` exactly.
 *
 * @param moduleName module name to require
 * @returns possibly required module
 */
function loadModule(moduleName) {
  let mod;

  try {
    mod = dynamicRequire(module, moduleName);
  } catch (e) {
    // no-empty
  }

  try {
    const { cwd } = dynamicRequire(module, 'process');
    mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ;
  } catch (e) {
    // no-empty
  }

  return mod;
}

exports.dynamicRequire = dynamicRequire;
exports.isNodeEnv = isNodeEnv;
exports.loadModule = loadModule;
//# sourceMappingURL=node.js.map
{"version":3,"file":"node.js","sources":["../../src/node.ts"],"sourcesContent":["/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\nimport { isBrowserBundle } from './env';\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n  // explicitly check for browser bundles as those can be optimized statically\n  // by terser/rollup.\n  return (\n    !isBrowserBundle() &&\n    Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n  );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function dynamicRequire(mod: any, request: string): any {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nexport function loadModule<T>(moduleName: string): T | undefined {\n  let mod: T | undefined;\n\n  try {\n    mod = dynamicRequire(module, moduleName);\n  } catch (e) {\n    // no-empty\n  }\n\n  try {\n    const { cwd } = dynamicRequire(module, 'process');\n    mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;\n  } catch (e) {\n    // no-empty\n  }\n\n  return mod;\n}\n"],"names":["isBrowserBundle"],"mappings":";;;;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,GAAA;AACA;AACA;AACA,EAAA;AACA,IAAA,CAAAA,mBAAA,EAAA;AACA,IAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA,IAAA,CAAA,OAAA,OAAA,KAAA,WAAA,GAAA,OAAA,GAAA,CAAA,CAAA,KAAA,kBAAA;AACA,IAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,GAAA,EAAA,OAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,UAAA,CAAA,UAAA,EAAA;AACA,EAAA,IAAA,GAAA,CAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,GAAA,GAAA,cAAA,CAAA,MAAA,EAAA,UAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,GAAA,EAAA,GAAA,cAAA,CAAA,MAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,GAAA,GAAA,cAAA,CAAA,MAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,cAAA,EAAA,UAAA,CAAA,CAAA,CAAA,EAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');
const memo = require('./memo.js');
const object = require('./object.js');
const stacktrace = require('./stacktrace.js');

/**
 * Recursively normalizes the given object.
 *
 * - Creates a copy to prevent original input mutation
 * - Skips non-enumerable properties
 * - When stringifying, calls `toJSON` if implemented
 * - Removes circular references
 * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format
 * - Translates known global objects/classes to a string representations
 * - Takes care of `Error` object serialization
 * - Optionally limits depth of final output
 * - Optionally limits number of properties/elements included in any single object/array
 *
 * @param input The object to be normalized.
 * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)
 * @param maxProperties The max number of elements or properties to be included in any single array or
 * object in the normallized output.
 * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function normalize(input, depth = +Infinity, maxProperties = +Infinity) {
  try {
    // since we're at the outermost level, we don't provide a key
    return visit('', input, depth, maxProperties);
  } catch (err) {
    return { ERROR: `**non-serializable** (${err})` };
  }
}

/** JSDoc */
function normalizeToSize(
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  object,
  // Default Node.js REPL depth
  depth = 3,
  // 100kB, as 200kB is max payload size, so half sounds reasonable
  maxSize = 100 * 1024,
) {
  const normalized = normalize(object, depth);

  if (jsonSize(normalized) > maxSize) {
    return normalizeToSize(object, depth - 1, maxSize);
  }

  return normalized ;
}

/**
 * Visits a node to perform normalization on it
 *
 * @param key The key corresponding to the given node
 * @param value The node to be visited
 * @param depth Optional number indicating the maximum recursion depth
 * @param maxProperties Optional maximum number of properties/elements included in any single object/array
 * @param memo Optional Memo class handling decycling
 */
function visit(
  key,
  value,
  depth = +Infinity,
  maxProperties = +Infinity,
  memo$1 = memo.memoBuilder(),
) {
  const [memoize, unmemoize] = memo$1;

  // Get the simple cases out of the way first
  if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !is.isNaN(value))) {
    return value ;
  }

  const stringified = stringifyValue(key, value);

  // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`.
  // Everything else will have already been serialized, so if we don't see that pattern, we're done.
  if (!stringified.startsWith('[object ')) {
    return stringified;
  }

  // From here on, we can assert that `value` is either an object or an array.

  // Do not normalize objects that we know have already been normalized. As a general rule, the
  // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that
  // have already been normalized.
  if ((value )['__sentry_skip_normalization__']) {
    return value ;
  }

  // Do not normalize objects that we know have already been normalized. As a general rule, the
  // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that
  // have already been normalized.
  let overriddenDepth = depth;

  if (typeof (value )['__sentry_override_normalization_depth__'] === 'number') {
    overriddenDepth = (value )['__sentry_override_normalization_depth__'] ;
  }

  // We're also done if we've reached the max depth
  if (overriddenDepth === 0) {
    // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`.
    return stringified.replace('object ', '');
  }

  // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.
  if (memoize(value)) {
    return '[Circular ~]';
  }

  // If the value has a `toJSON` method, we call it to extract more information
  const valueWithToJSON = value ;
  if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {
    try {
      const jsonValue = valueWithToJSON.toJSON();
      // We need to normalize the return value of `.toJSON()` in case it has circular references
      return visit('', jsonValue, overriddenDepth - 1, maxProperties, memo$1);
    } catch (err) {
      // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)
    }
  }

  // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse
  // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each
  // property/entry, and keep track of the number of items we add to it.
  const normalized = (Array.isArray(value) ? [] : {}) ;
  let numAdded = 0;

  // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant
  // properties are non-enumerable and otherwise would get missed.
  const visitable = object.convertToPlainObject(value );

  for (const visitKey in visitable) {
    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {
      continue;
    }

    if (numAdded >= maxProperties) {
      normalized[visitKey] = '[MaxProperties ~]';
      break;
    }

    // Recursively visit all the child nodes
    const visitValue = visitable[visitKey];
    normalized[visitKey] = visit(visitKey, visitValue, overriddenDepth - 1, maxProperties, memo$1);

    numAdded++;
  }

  // Once we've visited all the branches, remove the parent from memo storage
  unmemoize(value);

  // Return accumulated values
  return normalized;
}

/**
 * Stringify the given value. Handles various known special values and types.
 *
 * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn
 * the number 1231 into "[Object Number]", nor on `null`, as it will throw.
 *
 * @param value The value to stringify
 * @returns A stringified representation of the given value
 */
function stringifyValue(
  key,
  // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for
  // our internal use, it'll do
  value,
) {
  try {
    if (key === 'domain' && value && typeof value === 'object' && (value )._events) {
      return '[Domain]';
    }

    if (key === 'domainEmitter') {
      return '[DomainEmitter]';
    }

    // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first
    // which won't throw if they are not present.

    if (typeof global !== 'undefined' && value === global) {
      return '[Global]';
    }

    // eslint-disable-next-line no-restricted-globals
    if (typeof window !== 'undefined' && value === window) {
      return '[Window]';
    }

    // eslint-disable-next-line no-restricted-globals
    if (typeof document !== 'undefined' && value === document) {
      return '[Document]';
    }

    // React's SyntheticEvent thingy
    if (is.isSyntheticEvent(value)) {
      return '[SyntheticEvent]';
    }

    if (typeof value === 'number' && value !== value) {
      return '[NaN]';
    }

    // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)
    if (value === void 0) {
      return '[undefined]';
    }

    if (typeof value === 'function') {
      return `[Function: ${stacktrace.getFunctionName(value)}]`;
    }

    if (typeof value === 'symbol') {
      return `[${String(value)}]`;
    }

    // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion
    if (typeof value === 'bigint') {
      return `[BigInt: ${String(value)}]`;
    }

    // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting
    // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as
    // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class),
    // we can make sure that only plain objects come out that way.
    return `[object ${getConstructorName(value)}]`;
  } catch (err) {
    return `**non-serializable** (${err})`;
  }
}

function getConstructorName(value) {
  const prototype = Object.getPrototypeOf(value);

  return prototype ? prototype.constructor.name : 'null prototype';
}

/** Calculates bytes size of input string */
function utf8Length(value) {
  // eslint-disable-next-line no-bitwise
  return ~-encodeURI(value).split(/%..|./).length;
}

/** Calculates bytes size of input object */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function jsonSize(value) {
  return utf8Length(JSON.stringify(value));
}

exports.normalize = normalize;
exports.normalizeToSize = normalizeToSize;
exports.walk = visit;
//# sourceMappingURL=normalize.js.map
{"version":3,"file":"normalize.js","sources":["../../src/normalize.ts"],"sourcesContent":["import type { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent } from './is';\nimport type { MemoFunc } from './memo';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray<T> = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = +Infinity, maxProperties: number = +Infinity): any {\n  try {\n    // since we're at the outermost level, we don't provide a key\n    return visit('', input, depth, maxProperties);\n  } catch (err) {\n    return { ERROR: `**non-serializable** (${err})` };\n  }\n}\n\n/** JSDoc */\nexport function normalizeToSize<T>(\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  object: { [key: string]: any },\n  // Default Node.js REPL depth\n  depth: number = 3,\n  // 100kB, as 200kB is max payload size, so half sounds reasonable\n  maxSize: number = 100 * 1024,\n): T {\n  const normalized = normalize(object, depth);\n\n  if (jsonSize(normalized) > maxSize) {\n    return normalizeToSize(object, depth - 1, maxSize);\n  }\n\n  return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n  key: string,\n  value: unknown,\n  depth: number = +Infinity,\n  maxProperties: number = +Infinity,\n  memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray<unknown> {\n  const [memoize, unmemoize] = memo;\n\n  // Get the simple cases out of the way first\n  if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))) {\n    return value as Primitive;\n  }\n\n  const stringified = stringifyValue(key, value);\n\n  // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n  // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n  if (!stringified.startsWith('[object ')) {\n    return stringified;\n  }\n\n  // From here on, we can assert that `value` is either an object or an array.\n\n  // Do not normalize objects that we know have already been normalized. As a general rule, the\n  // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n  // have already been normalized.\n  if ((value as ObjOrArray<unknown>)['__sentry_skip_normalization__']) {\n    return value as ObjOrArray<unknown>;\n  }\n\n  // Do not normalize objects that we know have already been normalized. As a general rule, the\n  // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n  // have already been normalized.\n  let overriddenDepth = depth;\n\n  if (typeof (value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] === 'number') {\n    overriddenDepth = (value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] as number;\n  }\n\n  // We're also done if we've reached the max depth\n  if (overriddenDepth === 0) {\n    // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n    return stringified.replace('object ', '');\n  }\n\n  // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n  if (memoize(value)) {\n    return '[Circular ~]';\n  }\n\n  // If the value has a `toJSON` method, we call it to extract more information\n  const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n  if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n    try {\n      const jsonValue = valueWithToJSON.toJSON();\n      // We need to normalize the return value of `.toJSON()` in case it has circular references\n      return visit('', jsonValue, overriddenDepth - 1, maxProperties, memo);\n    } catch (err) {\n      // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n    }\n  }\n\n  // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n  // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n  // property/entry, and keep track of the number of items we add to it.\n  const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray<unknown>;\n  let numAdded = 0;\n\n  // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n  // properties are non-enumerable and otherwise would get missed.\n  const visitable = convertToPlainObject(value as ObjOrArray<unknown>);\n\n  for (const visitKey in visitable) {\n    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n      continue;\n    }\n\n    if (numAdded >= maxProperties) {\n      normalized[visitKey] = '[MaxProperties ~]';\n      break;\n    }\n\n    // Recursively visit all the child nodes\n    const visitValue = visitable[visitKey];\n    normalized[visitKey] = visit(visitKey, visitValue, overriddenDepth - 1, maxProperties, memo);\n\n    numAdded++;\n  }\n\n  // Once we've visited all the branches, remove the parent from memo storage\n  unmemoize(value);\n\n  // Return accumulated values\n  return normalized;\n}\n\n// TODO remove this in v7 (this means the method will no longer be exported, under any name)\nexport { visit as walk };\n\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n  key: unknown,\n  // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n  // our internal use, it'll do\n  value: Exclude<unknown, string | number | boolean | null>,\n): string {\n  try {\n    if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n      return '[Domain]';\n    }\n\n    if (key === 'domainEmitter') {\n      return '[DomainEmitter]';\n    }\n\n    // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n    // which won't throw if they are not present.\n\n    if (typeof global !== 'undefined' && value === global) {\n      return '[Global]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof window !== 'undefined' && value === window) {\n      return '[Window]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof document !== 'undefined' && value === document) {\n      return '[Document]';\n    }\n\n    // React's SyntheticEvent thingy\n    if (isSyntheticEvent(value)) {\n      return '[SyntheticEvent]';\n    }\n\n    if (typeof value === 'number' && value !== value) {\n      return '[NaN]';\n    }\n\n    // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)\n    if (value === void 0) {\n      return '[undefined]';\n    }\n\n    if (typeof value === 'function') {\n      return `[Function: ${getFunctionName(value)}]`;\n    }\n\n    if (typeof value === 'symbol') {\n      return `[${String(value)}]`;\n    }\n\n    // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n    if (typeof value === 'bigint') {\n      return `[BigInt: ${String(value)}]`;\n    }\n\n    // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n    // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n    // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n    // we can make sure that only plain objects come out that way.\n    return `[object ${getConstructorName(value)}]`;\n  } catch (err) {\n    return `**non-serializable** (${err})`;\n  }\n}\n\nfunction getConstructorName(value: unknown): string {\n  const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n  return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n  // eslint-disable-next-line no-bitwise\n  return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n  return utf8Length(JSON.stringify(value));\n}\n"],"names":["memo","memoBuilder","isNaN","convertToPlainObject","isSyntheticEvent","getFunctionName"],"mappings":";;;;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,KAAA,EAAA,KAAA,GAAA,CAAA,QAAA,EAAA,aAAA,GAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA,EAAA,EAAA,KAAA,EAAA,KAAA,EAAA,aAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,OAAA,EAAA,KAAA,EAAA,CAAA,sBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,eAAA;AACA;AACA,EAAA,MAAA;AACA;AACA,EAAA,KAAA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,GAAA,GAAA,GAAA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,UAAA,GAAA,SAAA,CAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,OAAA,EAAA;AACA,IAAA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ser = require('./browser.js');
const is = require('./is.js');
const string = require('./string.js');

/**
 * Replace a method in an object with a wrapped version of itself.
 *
 * @param source An object that contains a method to be wrapped.
 * @param name The name of the method to be wrapped.
 * @param replacementFactory A higher-order function that takes the original version of the given method and returns a
 * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to
 * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other
 * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.
 * @returns void
 */
function fill(source, name, replacementFactory) {
  if (!(name in source)) {
    return;
  }

  const original = source[name] ;
  const wrapped = replacementFactory(original) ;

  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work
  // otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
  if (typeof wrapped === 'function') {
    try {
      markFunctionWrapped(wrapped, original);
    } catch (_Oo) {
      // This can throw if multiple fill happens on a global object like XMLHttpRequest
      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043
    }
  }

  source[name] = wrapped;
}

/**
 * Defines a non-enumerable property on the given object.
 *
 * @param obj The object on which to set the property
 * @param name The name of the property to be set
 * @param value The value to which to set the property
 */
function addNonEnumerableProperty(obj, name, value) {
  Object.defineProperty(obj, name, {
    // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
    value: value,
    writable: true,
    configurable: true,
  });
}

/**
 * Remembers the original function on the wrapped function and
 * patches up the prototype.
 *
 * @param wrapped the wrapper function
 * @param original the original function that gets wrapped
 */
function markFunctionWrapped(wrapped, original) {
  const proto = original.prototype || {};
  wrapped.prototype = original.prototype = proto;
  addNonEnumerableProperty(wrapped, '__sentry_original__', original);
}

/**
 * This extracts the original function if available.  See
 * `markFunctionWrapped` for more information.
 *
 * @param func the function to unwrap
 * @returns the unwrapped version of the function if available.
 */
function getOriginalFunction(func) {
  return func.__sentry_original__;
}

/**
 * Encodes given object into url-friendly format
 *
 * @param object An object that contains serializable values
 * @returns string Encoded
 */
function urlEncode(object) {
  return Object.keys(object)
    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)
    .join('&');
}

/**
 * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their
 * non-enumerable properties attached.
 *
 * @param value Initial source that we have to transform in order for it to be usable by the serializer
 * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor
 *  an Error.
 */
function convertToPlainObject(value)

 {
  if (is.isError(value)) {
    return {
      message: value.message,
      name: value.name,
      stack: value.stack,
      ...getOwnProperties(value),
    };
  } else if (is.isEvent(value)) {
    const newObj

 = {
      type: value.type,
      target: serializeEventTarget(value.target),
      currentTarget: serializeEventTarget(value.currentTarget),
      ...getOwnProperties(value),
    };

    if (typeof CustomEvent !== 'undefined' && is.isInstanceOf(value, CustomEvent)) {
      newObj.detail = value.detail;
    }

    return newObj;
  } else {
    return value;
  }
}

/** Creates a string representation of the target of an `Event` object */
function serializeEventTarget(target) {
  try {
    return is.isElement(target) ? browser.htmlTreeAsString(target) : Object.prototype.toString.call(target);
  } catch (_oO) {
    return '<unknown>';
  }
}

/** Filters out all but an object's own properties */
function getOwnProperties(obj) {
  if (typeof obj === 'object' && obj !== null) {
    const extractedProps = {};
    for (const property in obj) {
      if (Object.prototype.hasOwnProperty.call(obj, property)) {
        extractedProps[property] = (obj )[property];
      }
    }
    return extractedProps;
  } else {
    return {};
  }
}

/**
 * Given any captured exception, extract its keys and create a sorted
 * and truncated list that will be used inside the event message.
 * eg. `Non-error exception captured with keys: foo, bar, baz`
 */
function extractExceptionKeysForMessage(exception, maxLength = 40) {
  const keys = Object.keys(convertToPlainObject(exception));
  keys.sort();

  if (!keys.length) {
    return '[object has no keys]';
  }

  if (keys[0].length >= maxLength) {
    return string.truncate(keys[0], maxLength);
  }

  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
    const serialized = keys.slice(0, includedKeys).join(', ');
    if (serialized.length > maxLength) {
      continue;
    }
    if (includedKeys === keys.length) {
      return serialized;
    }
    return string.truncate(serialized, maxLength);
  }

  return '';
}

/**
 * Given any object, return a new object having removed all fields whose value was `undefined`.
 * Works recursively on objects and arrays.
 *
 * Attention: This function keeps circular references in the returned object.
 */
function dropUndefinedKeys(inputValue) {
  // This map keeps track of what already visited nodes map to.
  // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular
  // references as the input object.
  const memoizationMap = new Map();

  // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API
  return _dropUndefinedKeys(inputValue, memoizationMap);
}

function _dropUndefinedKeys(inputValue, memoizationMap) {
  if (is.isPlainObject(inputValue)) {
    // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== undefined) {
      return memoVal ;
    }

    const returnValue = {};
    // Store the mapping of this value in case we visit it again, in case of circular data
    memoizationMap.set(inputValue, returnValue);

    for (const key of Object.keys(inputValue)) {
      if (typeof inputValue[key] !== 'undefined') {
        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);
      }
    }

    return returnValue ;
  }

  if (Array.isArray(inputValue)) {
    // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== undefined) {
      return memoVal ;
    }

    const returnValue = [];
    // Store the mapping of this value in case we visit it again, in case of circular data
    memoizationMap.set(inputValue, returnValue);

    inputValue.forEach((item) => {
      returnValue.push(_dropUndefinedKeys(item, memoizationMap));
    });

    return returnValue ;
  }

  return inputValue;
}

/**
 * Ensure that something is an object.
 *
 * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper
 * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.
 *
 * @param wat The subject of the objectification
 * @returns A version of `wat` which can safely be used with `Object` class methods
 */
function objectify(wat) {
  let objectified;
  switch (true) {
    case wat === undefined || wat === null:
      objectified = new String(wat);
      break;

    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason
    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as
    // an object in order to wrap it.
    case typeof wat === 'symbol' || typeof wat === 'bigint':
      objectified = Object(wat);
      break;

    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`
    case is.isPrimitive(wat):
      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      objectified = new (wat ).constructor(wat);
      break;

    // by process of elimination, at this point we know that `wat` must already be an object
    default:
      objectified = wat;
      break;
  }
  return objectified;
}

exports.addNonEnumerableProperty = addNonEnumerableProperty;
exports.convertToPlainObject = convertToPlainObject;
exports.dropUndefinedKeys = dropUndefinedKeys;
exports.extractExceptionKeysForMessage = extractExceptionKeysForMessage;
exports.fill = fill;
exports.getOriginalFunction = getOriginalFunction;
exports.markFunctionWrapped = markFunctionWrapped;
exports.objectify = objectify;
exports.urlEncode = urlEncode;
//# sourceMappingURL=object.js.map
{"version":3,"file":"object.js","sources":["../../src/object.ts"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n  if (!(name in source)) {\n    return;\n  }\n\n  const original = source[name] as () => any;\n  const wrapped = replacementFactory(original) as WrappedFunction;\n\n  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n  // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n  if (typeof wrapped === 'function') {\n    try {\n      markFunctionWrapped(wrapped, original);\n    } catch (_Oo) {\n      // This can throw if multiple fill happens on a global object like XMLHttpRequest\n      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n    }\n  }\n\n  source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: { [key: string]: unknown }, name: string, value: unknown): void {\n  Object.defineProperty(obj, name, {\n    // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n    value: value,\n    writable: true,\n    configurable: true,\n  });\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n  const proto = original.prototype || {};\n  wrapped.prototype = original.prototype = proto;\n  addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n}\n\n/**\n * This extracts the original function if available.  See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n  return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n  return Object.keys(object)\n    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n    .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n *  an Error.\n */\nexport function convertToPlainObject<V>(value: V):\n  | {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    }\n  | {\n      [ownProps: string]: unknown;\n      message: string;\n      name: string;\n      stack?: string;\n    }\n  | V {\n  if (isError(value)) {\n    return {\n      message: value.message,\n      name: value.name,\n      stack: value.stack,\n      ...getOwnProperties(value),\n    };\n  } else if (isEvent(value)) {\n    const newObj: {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    } = {\n      type: value.type,\n      target: serializeEventTarget(value.target),\n      currentTarget: serializeEventTarget(value.currentTarget),\n      ...getOwnProperties(value),\n    };\n\n    if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n      newObj.detail = value.detail;\n    }\n\n    return newObj;\n  } else {\n    return value;\n  }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n  try {\n    return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n  if (typeof obj === 'object' && obj !== null) {\n    const extractedProps: { [key: string]: unknown } = {};\n    for (const property in obj) {\n      if (Object.prototype.hasOwnProperty.call(obj, property)) {\n        extractedProps[property] = (obj as Record<string, unknown>)[property];\n      }\n    }\n    return extractedProps;\n  } else {\n    return {};\n  }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string {\n  const keys = Object.keys(convertToPlainObject(exception));\n  keys.sort();\n\n  if (!keys.length) {\n    return '[object has no keys]';\n  }\n\n  if (keys[0].length >= maxLength) {\n    return truncate(keys[0], maxLength);\n  }\n\n  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n    const serialized = keys.slice(0, includedKeys).join(', ');\n    if (serialized.length > maxLength) {\n      continue;\n    }\n    if (includedKeys === keys.length) {\n      return serialized;\n    }\n    return truncate(serialized, maxLength);\n  }\n\n  return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys<T>(inputValue: T): T {\n  // This map keeps track of what already visited nodes map to.\n  // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n  // references as the input object.\n  const memoizationMap = new Map<unknown, unknown>();\n\n  // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n  return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys<T>(inputValue: T, memoizationMap: Map<unknown, unknown>): T {\n  if (isPlainObject(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: { [key: string]: any } = {};\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    for (const key of Object.keys(inputValue)) {\n      if (typeof inputValue[key] !== 'undefined') {\n        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n      }\n    }\n\n    return returnValue as T;\n  }\n\n  if (Array.isArray(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: unknown[] = [];\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    inputValue.forEach((item: unknown) => {\n      returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n    });\n\n    return returnValue as unknown as T;\n  }\n\n  return inputValue;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n  let objectified;\n  switch (true) {\n    case wat === undefined || wat === null:\n      objectified = new String(wat);\n      break;\n\n    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n    // an object in order to wrap it.\n    case typeof wat === 'symbol' || typeof wat === 'bigint':\n      objectified = Object(wat);\n      break;\n\n    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n    case isPrimitive(wat):\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      objectified = new (wat as any).constructor(wat);\n      break;\n\n    // by process of elimination, at this point we know that `wat` must already be an object\n    default:\n      objectified = wat;\n      break;\n  }\n  return objectified;\n}\n"],"names":["isError","isEvent","isInstanceOf","isElement","htmlTreeAsString","truncate","isPlainObject","isPrimitive"],"mappings":";;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,MAAA,EAAA,IAAA,EAAA,kBAAA,EAAA;AACA,EAAA,IAAA,EAAA,IAAA,IAAA,MAAA,CAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,MAAA,CAAA,IAAA,CAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,kBAAA,CAAA,QAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,OAAA,OAAA,KAAA,UAAA,EAAA;AACA,IAAA,IAAA;AACA,MAAA,mBAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,GAAA,EAAA;AACA;AACA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,CAAA,IAAA,CAAA,GAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,GAAA,E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AAA,CAAA,IAAA,KAAA;AACA,MAAA,WAAA,CAAA,IAAA,CAAA,kBAAA,CAAA,IAAA,EAAA,cAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAA,OAAA,WAAA,EAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,UAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,WAAA,CAAA;AACA,EAAA,QAAA,IAAA;AACA,IAAA,KAAA,GAAA,KAAA,SAAA,IAAA,GAAA,KAAA,IAAA;AACA,MAAA,WAAA,GAAA,IAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA;AACA;AACA,IAAA,KAAA,OAAA,GAAA,KAAA,QAAA,IAAA,OAAA,GAAA,KAAA,QAAA;AACA,MAAA,WAAA,GAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA,IAAA,KAAAC,cAAA,CAAA,GAAA,CAAA;AACA;AACA,MAAA,WAAA,GAAA,IAAA,CAAA,GAAA,GAAA,WAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA,IAAA;AACA,MAAA,WAAA,GAAA,GAAA,CAAA;AACA,MAAA,MAAA;AACA,GAAA;AACA,EAAA,OAAA,WAAA,CAAA;AACA;;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript
// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js
//
// Copyright Joyent, Inc.and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/** JSDoc */
function normalizeArray(parts, allowAboveRoot) {
  // if the path tries to go above the root, `up` ends up > 0
  let up = 0;
  for (let i = parts.length - 1; i >= 0; i--) {
    const last = parts[i];
    if (last === '.') {
      parts.splice(i, 1);
    } else if (last === '..') {
      parts.splice(i, 1);
      up++;
    } else if (up) {
      parts.splice(i, 1);
      up--;
    }
  }

  // if the path is allowed to go above the root, restore leading ..s
  if (allowAboveRoot) {
    for (; up--; up) {
      parts.unshift('..');
    }
  }

  return parts;
}

// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;
/** JSDoc */
function splitPath(filename) {
  const parts = splitPathRe.exec(filename);
  return parts ? parts.slice(1) : [];
}

// path.resolve([from ...], to)
// posix version
/** JSDoc */
function resolve(...args) {
  let resolvedPath = '';
  let resolvedAbsolute = false;

  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
    const path = i >= 0 ? args[i] : '/';

    // Skip empty entries
    if (!path) {
      continue;
    }

    resolvedPath = `${path}/${resolvedPath}`;
    resolvedAbsolute = path.charAt(0) === '/';
  }

  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when process.cwd() fails)

  // Normalize the path
  resolvedPath = normalizeArray(
    resolvedPath.split('/').filter(p => !!p),
    !resolvedAbsolute,
  ).join('/');

  return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
}

/** JSDoc */
function trim(arr) {
  let start = 0;
  for (; start < arr.length; start++) {
    if (arr[start] !== '') {
      break;
    }
  }

  let end = arr.length - 1;
  for (; end >= 0; end--) {
    if (arr[end] !== '') {
      break;
    }
  }

  if (start > end) {
    return [];
  }
  return arr.slice(start, end - start + 1);
}

// path.relative(from, to)
// posix version
/** JSDoc */
function relative(from, to) {
  /* eslint-disable no-param-reassign */
  from = resolve(from).slice(1);
  to = resolve(to).slice(1);
  /* eslint-enable no-param-reassign */

  const fromParts = trim(from.split('/'));
  const toParts = trim(to.split('/'));

  const length = Math.min(fromParts.length, toParts.length);
  let samePartsLength = length;
  for (let i = 0; i < length; i++) {
    if (fromParts[i] !== toParts[i]) {
      samePartsLength = i;
      break;
    }
  }

  let outputParts = [];
  for (let i = samePartsLength; i < fromParts.length; i++) {
    outputParts.push('..');
  }

  outputParts = outputParts.concat(toParts.slice(samePartsLength));

  return outputParts.join('/');
}

// path.normalize(path)
// posix version
/** JSDoc */
function normalizePath(path) {
  const isPathAbsolute = isAbsolute(path);
  const trailingSlash = path.slice(-1) === '/';

  // Normalize the path
  let normalizedPath = normalizeArray(
    path.split('/').filter(p => !!p),
    !isPathAbsolute,
  ).join('/');

  if (!normalizedPath && !isPathAbsolute) {
    normalizedPath = '.';
  }
  if (normalizedPath && trailingSlash) {
    normalizedPath += '/';
  }

  return (isPathAbsolute ? '/' : '') + normalizedPath;
}

// posix version
/** JSDoc */
function isAbsolute(path) {
  return path.charAt(0) === '/';
}

// posix version
/** JSDoc */
function join(...args) {
  return normalizePath(args.join('/'));
}

/** JSDoc */
function dirname(path) {
  const result = splitPath(path);
  const root = result[0];
  let dir = result[1];

  if (!root && !dir) {
    // No dirname whatsoever
    return '.';
  }

  if (dir) {
    // It has a dirname, strip trailing slash
    dir = dir.slice(0, dir.length - 1);
  }

  return root + dir;
}

/** JSDoc */
function basename(path, ext) {
  let f = splitPath(path)[2];
  if (ext && f.slice(ext.length * -1) === ext) {
    f = f.slice(0, f.length - ext.length);
  }
  return f;
}

exports.basename = basename;
exports.dirname = dirname;
exports.isAbsolute = isAbsolute;
exports.join = join;
exports.normalizePath = normalizePath;
exports.relative = relative;
exports.resolve = resolve;
//# sourceMappingURL=path.js.map
{"version":3,"file":"path.js","sources":["../../src/path.ts"],"sourcesContent":["// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js\n//\n// Copyright Joyent, Inc.and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** JSDoc */\nfunction normalizeArray(parts: string[], allowAboveRoot?: boolean): string[] {\n  // if the path tries to go above the root, `up` ends up > 0\n  let up = 0;\n  for (let i = parts.length - 1; i >= 0; i--) {\n    const last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^/]+?|)(\\.[^./]*|))(?:[/]*)$/;\n/** JSDoc */\nfunction splitPath(filename: string): string[] {\n  const parts = splitPathRe.exec(filename);\n  return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nexport function resolve(...args: string[]): string {\n  let resolvedPath = '';\n  let resolvedAbsolute = false;\n\n  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    const path = i >= 0 ? args[i] : '/';\n\n    // Skip empty entries\n    if (!path) {\n      continue;\n    }\n\n    resolvedPath = `${path}/${resolvedPath}`;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(\n    resolvedPath.split('/').filter(p => !!p),\n    !resolvedAbsolute,\n  ).join('/');\n\n  return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr: string[]): string[] {\n  let start = 0;\n  for (; start < arr.length; start++) {\n    if (arr[start] !== '') {\n      break;\n    }\n  }\n\n  let end = arr.length - 1;\n  for (; end >= 0; end--) {\n    if (arr[end] !== '') {\n      break;\n    }\n  }\n\n  if (start > end) {\n    return [];\n  }\n  return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nexport function relative(from: string, to: string): string {\n  /* eslint-disable no-param-reassign */\n  from = resolve(from).slice(1);\n  to = resolve(to).slice(1);\n  /* eslint-enable no-param-reassign */\n\n  const fromParts = trim(from.split('/'));\n  const toParts = trim(to.split('/'));\n\n  const length = Math.min(fromParts.length, toParts.length);\n  let samePartsLength = length;\n  for (let i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  let outputParts = [];\n  for (let i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nexport function normalizePath(path: string): string {\n  const isPathAbsolute = isAbsolute(path);\n  const trailingSlash = path.slice(-1) === '/';\n\n  // Normalize the path\n  let normalizedPath = normalizeArray(\n    path.split('/').filter(p => !!p),\n    !isPathAbsolute,\n  ).join('/');\n\n  if (!normalizedPath && !isPathAbsolute) {\n    normalizedPath = '.';\n  }\n  if (normalizedPath && trailingSlash) {\n    normalizedPath += '/';\n  }\n\n  return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nexport function isAbsolute(path: string): boolean {\n  return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nexport function join(...args: string[]): string {\n  return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nexport function dirname(path: string): string {\n  const result = splitPath(path);\n  const root = result[0];\n  let dir = result[1];\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    return '.';\n  }\n\n  if (dir) {\n    // It has a dirname, strip trailing slash\n    dir = dir.slice(0, dir.length - 1);\n  }\n\n  return root + dir;\n}\n\n/** JSDoc */\nexport function basename(path: string, ext?: string): string {\n  let f = splitPath(path)[2];\n  if (ext && f.slice(ext.length * -1) === ext) {\n    f = f.slice(0, f.length - ext.length);\n  }\n  return f;\n}\n"],"names":[],"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,IAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,IAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,OAAA,CAAA,IAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,SAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,MAAA,IAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,GAAA,GAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,IAAA,IAAA,CAAA,GAAA,EAAA;AACA;AACA,IAAA,OAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,GAAA,EAAA;AACA;AACA,IAAA,GAAA,GAAA,GAAA,CAAA,KAAA,CAAA,CAAA,EAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,IAAA,GAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,QAAA,CAAA,IAAA,EAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,GAAA,IAAA,CAAA,CAAA,KAAA,CAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,CAAA,CAAA,MAAA,GAAA,GAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,CAAA,CAAA;AACA;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const error = require('./error.js');
const syncpromise = require('./syncpromise.js');

/**
 * Creates an new PromiseBuffer object with the specified limit
 * @param limit max number of promises that can be stored in the buffer
 */
function makePromiseBuffer(limit) {
  const buffer = [];

  function isReady() {
    return limit === undefined || buffer.length < limit;
  }

  /**
   * Remove a promise from the queue.
   *
   * @param task Can be any PromiseLike<T>
   * @returns Removed promise.
   */
  function remove(task) {
    return buffer.splice(buffer.indexOf(task), 1)[0];
  }

  /**
   * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.
   *
   * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:
   *        PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor
   *        functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By
   *        requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer
   *        limit check.
   * @returns The original promise.
   */
  function add(taskProducer) {
    if (!isReady()) {
      return syncpromise.rejectedSyncPromise(new error.SentryError('Not adding Promise because buffer limit was reached.'));
    }

    // start the task and add its promise to the queue
    const task = taskProducer();
    if (buffer.indexOf(task) === -1) {
      buffer.push(task);
    }
    void task
      .then(() => remove(task))
      // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`
      // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't
      // have promises, so TS has to polyfill when down-compiling.)
      .then(null, () =>
        remove(task).then(null, () => {
          // We have to add another catch here because `remove()` starts a new promise chain.
        }),
      );
    return task;
  }

  /**
   * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.
   *
   * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or
   * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to
   * `true`.
   * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and
   * `false` otherwise
   */
  function drain(timeout) {
    return new syncpromise.SyncPromise((resolve, reject) => {
      let counter = buffer.length;

      if (!counter) {
        return resolve(true);
      }

      // wait for `timeout` ms and then resolve to `false` (if not cancelled first)
      const capturedSetTimeout = setTimeout(() => {
        if (timeout && timeout > 0) {
          resolve(false);
        }
      }, timeout);

      // if all promises resolve in time, cancel the timer and resolve to `true`
      buffer.forEach(item => {
        void syncpromise.resolvedSyncPromise(item).then(() => {
          if (!--counter) {
            clearTimeout(capturedSetTimeout);
            resolve(true);
          }
        }, reject);
      });
    });
  }

  return {
    $: buffer,
    add,
    drain,
  };
}

exports.makePromiseBuffer = makePromiseBuffer;
//# sourceMappingURL=promisebuffer.js.map
{"version":3,"file":"promisebuffer.js","sources":["../../src/promisebuffer.ts"],"sourcesContent":["import { SentryError } from './error';\nimport { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer<T> {\n  // exposes the internal array so tests can assert on the state of it.\n  // XXX: this really should not be public api.\n  $: Array<PromiseLike<T>>;\n  add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;\n  drain(timeout?: number): PromiseLike<boolean>;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {\n  const buffer: Array<PromiseLike<T>> = [];\n\n  function isReady(): boolean {\n    return limit === undefined || buffer.length < limit;\n  }\n\n  /**\n   * Remove a promise from the queue.\n   *\n   * @param task Can be any PromiseLike<T>\n   * @returns Removed promise.\n   */\n  function remove(task: PromiseLike<T>): PromiseLike<T> {\n    return buffer.splice(buffer.indexOf(task), 1)[0];\n  }\n\n  /**\n   * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n   *\n   * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n   *        PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n   *        functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n   *        requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n   *        limit check.\n   * @returns The original promise.\n   */\n  function add(taskProducer: () => PromiseLike<T>): PromiseLike<T> {\n    if (!isReady()) {\n      return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n    }\n\n    // start the task and add its promise to the queue\n    const task = taskProducer();\n    if (buffer.indexOf(task) === -1) {\n      buffer.push(task);\n    }\n    void task\n      .then(() => remove(task))\n      // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n      // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n      // have promises, so TS has to polyfill when down-compiling.)\n      .then(null, () =>\n        remove(task).then(null, () => {\n          // We have to add another catch here because `remove()` starts a new promise chain.\n        }),\n      );\n    return task;\n  }\n\n  /**\n   * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n   * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n   * `false` otherwise\n   */\n  function drain(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise<boolean>((resolve, reject) => {\n      let counter = buffer.length;\n\n      if (!counter) {\n        return resolve(true);\n      }\n\n      // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n      const capturedSetTimeout = setTimeout(() => {\n        if (timeout && timeout > 0) {\n          resolve(false);\n        }\n      }, timeout);\n\n      // if all promises resolve in time, cancel the timer and resolve to `true`\n      buffer.forEach(item => {\n        void resolvedSyncPromise(item).then(() => {\n          if (!--counter) {\n            clearTimeout(capturedSetTimeout);\n            resolve(true);\n          }\n        }, reject);\n      });\n    });\n  }\n\n  return {\n    $: buffer,\n    add,\n    drain,\n  };\n}\n"],"names":["rejectedSyncPromise","SentryError","SyncPromise","resolvedSyncPromise"],"mappings":";;;;;AAWA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,SAAA,OAAA,GAAA;AACA,IAAA,OAAA,KAAA,KAAA,SAAA,IAAA,MAAA,CAAA,MAAA,GAAA,KAAA,CAAA;AACA,GAAA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,MAAA,kBAAA,GAAA,UAAA,CAAA,MAAA;AACA,QAAA,IAAA,OAAA,IAAA,OAAA,GAAA,CAAA,EAAA;AACA,UAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AACA,SAAA;AACA,OAAA,EAAA,OAAA,CAAA,CAAA;AACA;AACA;AACA,MAAA,MAAA,CAAA,OAAA,CAAA,IAAA,IAAA;AACA,QAAA,KAAAC,+BAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,MAAA;AACA,UAAA,IAAA,CAAA,EAAA,OAAA,EAAA;AACA,YAAA,YAAA,CAAA,kBAAA,CAAA,CAAA;AACA,YAAA,OAAA,CAAA,IAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA,EAAA,MAAA,CAAA,CAAA;AACA,OAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,CAAA,EAAA,MAAA;AACA,IAAA,GAAA;AACA,IAAA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend

const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds

/**
 * Extracts Retry-After value from the request header or returns default value
 * @param header string representation of 'Retry-After' header
 * @param now current unix timestamp
 *
 */
function parseRetryAfterHeader(header, now = Date.now()) {
  const headerDelay = parseInt(`${header}`, 10);
  if (!isNaN(headerDelay)) {
    return headerDelay * 1000;
  }

  const headerDate = Date.parse(`${header}`);
  if (!isNaN(headerDate)) {
    return headerDate - now;
  }

  return DEFAULT_RETRY_AFTER;
}

/**
 * Gets the time that the given category is disabled until for rate limiting.
 * In case no category-specific limit is set but a general rate limit across all categories is active,
 * that time is returned.
 *
 * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.
 */
function disabledUntil(limits, category) {
  return limits[category] || limits.all || 0;
}

/**
 * Checks if a category is rate limited
 */
function isRateLimited(limits, category, now = Date.now()) {
  return disabledUntil(limits, category) > now;
}

/**
 * Update ratelimits from incoming headers.
 *
 * @return the updated RateLimits object.
 */
function updateRateLimits(
  limits,
  { statusCode, headers },
  now = Date.now(),
) {
  const updatedRateLimits = {
    ...limits,
  };

  // "The name is case-insensitive."
  // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get
  const rateLimitHeader = headers && headers['x-sentry-rate-limits'];
  const retryAfterHeader = headers && headers['retry-after'];

  if (rateLimitHeader) {
    /**
     * rate limit headers are of the form
     *     <header>,<header>,..
     * where each <header> is of the form
     *     <retry_after>: <categories>: <scope>: <reason_code>
     * where
     *     <retry_after> is a delay in seconds
     *     <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form
     *         <category>;<category>;...
     *     <scope> is what's being limited (org, project, or key) - ignored by SDK
     *     <reason_code> is an arbitrary string like "org_quota" - ignored by SDK
     */
    for (const limit of rateLimitHeader.trim().split(',')) {
      const [retryAfter, categories] = limit.split(':', 2);
      const headerDelay = parseInt(retryAfter, 10);
      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default
      if (!categories) {
        updatedRateLimits.all = now + delay;
      } else {
        for (const category of categories.split(';')) {
          updatedRateLimits[category] = now + delay;
        }
      }
    }
  } else if (retryAfterHeader) {
    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);
  } else if (statusCode === 429) {
    updatedRateLimits.all = now + 60 * 1000;
  }

  return updatedRateLimits;
}

exports.DEFAULT_RETRY_AFTER = DEFAULT_RETRY_AFTER;
exports.disabledUntil = disabledUntil;
exports.isRateLimited = isRateLimited;
exports.parseRetryAfterHeader = parseRetryAfterHeader;
exports.updateRateLimits = updateRateLimits;
//# sourceMappingURL=ratelimit.js.map
{"version":3,"file":"ratelimit.js","sources":["../../src/ratelimit.ts"],"sourcesContent":["import type { TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record<string, number>;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n  const headerDelay = parseInt(`${header}`, 10);\n  if (!isNaN(headerDelay)) {\n    return headerDelay * 1000;\n  }\n\n  const headerDate = Date.parse(`${header}`);\n  if (!isNaN(headerDate)) {\n    return headerDate - now;\n  }\n\n  return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, category: string): number {\n  return limits[category] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, category: string, now: number = Date.now()): boolean {\n  return disabledUntil(limits, category) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n  limits: RateLimits,\n  { statusCode, headers }: TransportMakeRequestResponse,\n  now: number = Date.now(),\n): RateLimits {\n  const updatedRateLimits: RateLimits = {\n    ...limits,\n  };\n\n  // \"The name is case-insensitive.\"\n  // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n  const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n  const retryAfterHeader = headers && headers['retry-after'];\n\n  if (rateLimitHeader) {\n    /**\n     * rate limit headers are of the form\n     *     <header>,<header>,..\n     * where each <header> is of the form\n     *     <retry_after>: <categories>: <scope>: <reason_code>\n     * where\n     *     <retry_after> is a delay in seconds\n     *     <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n     *         <category>;<category>;...\n     *     <scope> is what's being limited (org, project, or key) - ignored by SDK\n     *     <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n     */\n    for (const limit of rateLimitHeader.trim().split(',')) {\n      const [retryAfter, categories] = limit.split(':', 2);\n      const headerDelay = parseInt(retryAfter, 10);\n      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n      if (!categories) {\n        updatedRateLimits.all = now + delay;\n      } else {\n        for (const category of categories.split(';')) {\n          updatedRateLimits[category] = now + delay;\n        }\n      }\n    }\n  } else if (retryAfterHeader) {\n    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n  } else if (statusCode === 429) {\n    updatedRateLimits.all = now + 60 * 1000;\n  }\n\n  return updatedRateLimits;\n}\n"],"names":[],"mappings":";;AAEA;;AAGA,MAAA,mBAAA,GAAA,EAAA,GAAA,KAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,MAAA,EAAA,GAAA,GAAA,IAAA,CAAA,GAAA,EAAA,EAAA;AACA,EAAA,MAAA,WAAA,GAAA,QAAA,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,KAAA,CAAA,WAAA,CAAA,EAAA;AACA,IAAA,OAAA,WAAA,GAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,UAAA,GAAA,IAAA,CAAA,KAAA,CAAA,CAAA,EAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,KAAA,CAAA,UAAA,CAAA,EAAA;AACA,IAAA,OAAA,UAAA,GAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,mBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,MAAA,EAAA,QAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,QAAA,CAAA,IAAA,MAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,MAAA,EAAA,QAAA,EAAA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AAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,MAAA,IAAA,gBAAA,EAAA;AACA,IAAA,iBAAA,CAAA,GAAA,GAAA,GAAA,GAAA,qBAAA,CAAA,gBAAA,EAAA,GAAA,CAAA,CAAA;AACA,GAAA,MAAA,IAAA,UAAA,KAAA,GAAA,EAAA;AACA,IAAA,iBAAA,CAAA,GAAA,GAAA,GAAA,GAAA,EAAA,GAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,iBAAA,CAAA;AACA;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');
const normalize = require('./normalize.js');
const url = require('./url.js');

const DEFAULT_INCLUDES = {
  ip: false,
  request: true,
  transaction: true,
  user: true,
};
const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];
const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];

/**
 * Sets parameterized route as transaction name e.g.: `GET /users/:id`
 * Also adds more context data on the transaction from the request
 */
function addRequestDataToTransaction(
  transaction,
  req,
  deps,
) {
  if (!transaction) return;
  if (!transaction.metadata.source || transaction.metadata.source === 'url') {
    // Attempt to grab a parameterized route off of the request
    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));
  }
  transaction.setData('url', req.originalUrl || req.url);
  if (req.baseUrl) {
    transaction.setData('baseUrl', req.baseUrl);
  }
  transaction.setData('query', extractQueryParams(req, deps));
}

/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
function extractPathForTransaction(
  req,
  options = {},
) {
  const method = req.method && req.method.toUpperCase();

  let path = '';
  let source = 'url';

  // Check to see if there's a parameterized route we can use (as there is in Express)
  if (options.customRoute || req.route) {
    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;
    source = 'route';
  }

  // Otherwise, just take the original URL
  else if (req.originalUrl || req.url) {
    path = url.stripUrlQueryAndFragment(req.originalUrl || req.url || '');
  }

  let name = '';
  if (options.method && method) {
    name += method;
  }
  if (options.method && options.path) {
    name += ' ';
  }
  if (options.path && path) {
    name += path;
  }

  return [name, source];
}

/** JSDoc */
function extractTransaction(req, type) {
  switch (type) {
    case 'path': {
      return extractPathForTransaction(req, { path: true })[0];
    }
    case 'handler': {
      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';
    }
    case 'methodPath':
    default: {
      return extractPathForTransaction(req, { path: true, method: true })[0];
    }
  }
}

/** JSDoc */
function extractUserData(
  user

,
  keys,
) {
  const extractedUser = {};
  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;

  attributes.forEach(key => {
    if (user && key in user) {
      extractedUser[key] = user[key];
    }
  });

  return extractedUser;
}

/**
 * Normalize data from the request object, accounting for framework differences.
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 * @returns An object containing normalized request data
 */
function extractRequestData(
  req,
  options

,
) {
  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};
  const requestData = {};

  // headers:
  //   node, express, koa, nextjs: req.headers
  const headers = (req.headers || {})

;
  // method:
  //   node, express, koa, nextjs: req.method
  const method = req.method;
  // host:
  //   express: req.hostname in > 4 and req.host in < 4
  //   koa: req.host
  //   node, nextjs: req.headers.host
  const host = req.hostname || req.host || headers.host || '<no host>';
  // protocol:
  //   node, nextjs: <n/a>
  //   express, koa: req.protocol
  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  const originalUrl = req.originalUrl || req.url || '';
  // absolute url
  const absoluteUrl = `${protocol}://${host}${originalUrl}`;
  include.forEach(key => {
    switch (key) {
      case 'headers': {
        requestData.headers = headers;
        break;
      }
      case 'method': {
        requestData.method = method;
        break;
      }
      case 'url': {
        requestData.url = absoluteUrl;
        break;
      }
      case 'cookies': {
        // cookies:
        //   node, express, koa: req.headers.cookie
        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.cookies =
          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
          // come off in v8
          req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {};
        break;
      }
      case 'query_string': {
        // query string:
        //   node: req.url (raw)
        //   express, koa, nextjs: req.query
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.query_string = extractQueryParams(req, deps);
        break;
      }
      case 'data': {
        if (method === 'GET' || method === 'HEAD') {
          break;
        }
        // body data:
        //   express, koa, nextjs: req.body
        //
        //   when using node by itself, you have to read the incoming stream(see
        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know
        //   where they're going to store the final result, so they'll have to capture this data themselves
        if (req.body !== undefined) {
          requestData.data = is.isString(req.body) ? req.body : JSON.stringify(normalize.normalize(req.body));
        }
        break;
      }
      default: {
        if ({}.hasOwnProperty.call(req, key)) {
          requestData[key] = (req )[key];
        }
      }
    }
  });

  return requestData;
}

/**
 * Options deciding what parts of the request to use when enhancing an event
 */

/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 * @param options.deps Injected platform-specific dependencies
 * @hidden
 */
function addRequestDataToEvent(
  event,
  req,
  options,
) {
  const include = {
    ...DEFAULT_INCLUDES,
    ...(options && options.include),
  };

  if (include.request) {
    const extractedRequestData = Array.isArray(include.request)
      ? extractRequestData(req, { include: include.request, deps: options && options.deps })
      : extractRequestData(req, { deps: options && options.deps });

    event.request = {
      ...event.request,
      ...extractedRequestData,
    };
  }

  if (include.user) {
    const extractedUser = req.user && is.isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};

    if (Object.keys(extractedUser).length) {
      event.user = {
        ...event.user,
        ...extractedUser,
      };
    }
  }

  // client ip:
  //   node, nextjs: req.socket.remoteAddress
  //   express, koa: req.ip
  if (include.ip) {
    const ip = req.ip || (req.socket && req.socket.remoteAddress);
    if (ip) {
      event.user = {
        ...event.user,
        ip_address: ip,
      };
    }
  }

  if (include.transaction && !event.transaction) {
    // TODO do we even need this anymore?
    // TODO make this work for nextjs
    event.transaction = extractTransaction(req, include.transaction);
  }

  return event;
}

function extractQueryParams(
  req,
  deps,
) {
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  let originalUrl = req.originalUrl || req.url || '';

  if (!originalUrl) {
    return;
  }

  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and
  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.
  if (originalUrl.startsWith('/')) {
    originalUrl = `http://dogs.are.great${originalUrl}`;
  }

  return (
    req.query ||
    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||
    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
    (deps && deps.url && deps.url.parse(originalUrl).query) ||
    undefined
  );
}

exports.addRequestDataToEvent = addRequestDataToEvent;
exports.addRequestDataToTransaction = addRequestDataToTransaction;
exports.extractPathForTransaction = extractPathForTransaction;
exports.extractRequestData = extractRequestData;
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../src/requestdata.ts"],"sourcesContent":["// TODO: Remove this file once equivalent integration is used everywhere\n\n/* eslint-disable complexity */\n/**\n * The functions here, which enrich an event with request data, are mostly for use in Node, but are safe for use in a\n * browser context. They live here in `@sentry/utils` rather than in `@sentry/node` so that they can be used in\n * frameworks (like nextjs), which, because of SSR, run the same code in both Node and browser contexts.\n *\n * TODO (v8 / #5257): Remove the note below\n * Note that for now, the tests for this code have to live in `@sentry/node`, since they test both these functions and\n * the backwards-compatibility-preserving wrappers which still live in `handlers.ts` there.\n */\n\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {\n  Event,\n  ExtractedNodeRequestData,\n  PolymorphicRequest,\n  Transaction,\n  TransactionSource,\n} from '@sentry/types';\n\nimport { isPlainObject, isString } from './is';\nimport { normalize } from './normalize';\nimport { stripUrlQueryAndFragment } from './url';\n\nconst DEFAULT_INCLUDES = {\n  ip: false,\n  request: true,\n  transaction: true,\n  user: true,\n};\nconst DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\nconst DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];\n\ntype InjectedNodeDeps = {\n  cookie: {\n    parse: (cookieStr: string) => Record<string, string>;\n  };\n  url: {\n    parse: (urlStr: string) => {\n      query: string | null;\n    };\n  };\n};\n\n/**\n * Sets parameterized route as transaction name e.g.: `GET /users/:id`\n * Also adds more context data on the transaction from the request\n */\nexport function addRequestDataToTransaction(\n  transaction: Transaction | undefined,\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): void {\n  if (!transaction) return;\n  if (!transaction.metadata.source || transaction.metadata.source === 'url') {\n    // Attempt to grab a parameterized route off of the request\n    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));\n  }\n  transaction.setData('url', req.originalUrl || req.url);\n  if (req.baseUrl) {\n    transaction.setData('baseUrl', req.baseUrl);\n  }\n  transaction.setData('query', extractQueryParams(req, deps));\n}\n\n/**\n * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.\n * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.\n *\n * Additionally, this function determines and returns the transaction name source\n *\n * eg. GET /mountpoint/user/:id\n *\n * @param req A request object\n * @param options What to include in the transaction name (method, path, or a custom route name to be\n *                used instead of the request's route)\n *\n * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')\n */\nexport function extractPathForTransaction(\n  req: PolymorphicRequest,\n  options: { path?: boolean; method?: boolean; customRoute?: string } = {},\n): [string, TransactionSource] {\n  const method = req.method && req.method.toUpperCase();\n\n  let path = '';\n  let source: TransactionSource = 'url';\n\n  // Check to see if there's a parameterized route we can use (as there is in Express)\n  if (options.customRoute || req.route) {\n    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;\n    source = 'route';\n  }\n\n  // Otherwise, just take the original URL\n  else if (req.originalUrl || req.url) {\n    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n  }\n\n  let name = '';\n  if (options.method && method) {\n    name += method;\n  }\n  if (options.method && options.path) {\n    name += ' ';\n  }\n  if (options.path && path) {\n    name += path;\n  }\n\n  return [name, source];\n}\n\ntype TransactionNamingScheme = 'path' | 'methodPath' | 'handler';\n\n/** JSDoc */\nfunction extractTransaction(req: PolymorphicRequest, type: boolean | TransactionNamingScheme): string {\n  switch (type) {\n    case 'path': {\n      return extractPathForTransaction(req, { path: true })[0];\n    }\n    case 'handler': {\n      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';\n    }\n    case 'methodPath':\n    default: {\n      return extractPathForTransaction(req, { path: true, method: true })[0];\n    }\n  }\n}\n\n/** JSDoc */\nfunction extractUserData(\n  user: {\n    [key: string]: any;\n  },\n  keys: boolean | string[],\n): { [key: string]: any } {\n  const extractedUser: { [key: string]: any } = {};\n  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;\n\n  attributes.forEach(key => {\n    if (user && key in user) {\n      extractedUser[key] = user[key];\n    }\n  });\n\n  return extractedUser;\n}\n\n/**\n * Normalize data from the request object, accounting for framework differences.\n *\n * @param req The request object from which to extract data\n * @param options.include An optional array of keys to include in the normalized data. Defaults to\n * DEFAULT_REQUEST_INCLUDES if not provided.\n * @param options.deps Injected, platform-specific dependencies\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(\n  req: PolymorphicRequest,\n  options?: {\n    include?: string[];\n    deps?: InjectedNodeDeps;\n  },\n): ExtractedNodeRequestData {\n  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};\n  const requestData: { [key: string]: any } = {};\n\n  // headers:\n  //   node, express, koa, nextjs: req.headers\n  const headers = (req.headers || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa, nextjs: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node, nextjs: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node, nextjs: <n/a>\n  //   express, koa: req.protocol\n  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  const originalUrl = req.originalUrl || req.url || '';\n  // absolute url\n  const absoluteUrl = `${protocol}://${host}${originalUrl}`;\n  include.forEach(key => {\n    switch (key) {\n      case 'headers': {\n        requestData.headers = headers;\n        break;\n      }\n      case 'method': {\n        requestData.method = method;\n        break;\n      }\n      case 'url': {\n        requestData.url = absoluteUrl;\n        break;\n      }\n      case 'cookies': {\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies =\n          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can\n          // come off in v8\n          req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {};\n        break;\n      }\n      case 'query_string': {\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa, nextjs: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = extractQueryParams(req, deps);\n        break;\n      }\n      case 'data': {\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   express, koa, nextjs: req.body\n        //\n        //   when using node by itself, you have to read the incoming stream(see\n        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n        //   where they're going to store the final result, so they'll have to capture this data themselves\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      }\n      default: {\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: any })[key];\n        }\n      }\n    }\n  });\n\n  return requestData;\n}\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n */\nexport interface AddRequestDataToEventOptions {\n  /** Flags controlling whether each type of data should be added to the event */\n  include?: {\n    ip?: boolean;\n    request?: boolean | string[];\n    transaction?: boolean | TransactionNamingScheme;\n    user?: boolean | string[];\n  };\n\n  /** Injected platform-specific dependencies */\n  deps?: {\n    cookie: {\n      parse: (cookieStr: string) => Record<string, string>;\n    };\n    url: {\n      parse: (urlStr: string) => {\n        query: string | null;\n      };\n    };\n  };\n}\n\n/**\n * Add data from the given request to the given event\n *\n * @param event The event to which the request data will be added\n * @param req Request object\n * @param options.include Flags to control what data is included\n * @param options.deps Injected platform-specific dependencies\n * @hidden\n */\nexport function addRequestDataToEvent(\n  event: Event,\n  req: PolymorphicRequest,\n  options?: AddRequestDataToEventOptions,\n): Event {\n  const include = {\n    ...DEFAULT_INCLUDES,\n    ...(options && options.include),\n  };\n\n  if (include.request) {\n    const extractedRequestData = Array.isArray(include.request)\n      ? extractRequestData(req, { include: include.request, deps: options && options.deps })\n      : extractRequestData(req, { deps: options && options.deps });\n\n    event.request = {\n      ...event.request,\n      ...extractedRequestData,\n    };\n  }\n\n  if (include.user) {\n    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};\n\n    if (Object.keys(extractedUser).length) {\n      event.user = {\n        ...event.user,\n        ...extractedUser,\n      };\n    }\n  }\n\n  // client ip:\n  //   node, nextjs: req.socket.remoteAddress\n  //   express, koa: req.ip\n  if (include.ip) {\n    const ip = req.ip || (req.socket && req.socket.remoteAddress);\n    if (ip) {\n      event.user = {\n        ...event.user,\n        ip_address: ip,\n      };\n    }\n  }\n\n  if (include.transaction && !event.transaction) {\n    // TODO do we even need this anymore?\n    // TODO make this work for nextjs\n    event.transaction = extractTransaction(req, include.transaction);\n  }\n\n  return event;\n}\n\nfunction extractQueryParams(\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): string | Record<string, unknown> | undefined {\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  let originalUrl = req.originalUrl || req.url || '';\n\n  if (!originalUrl) {\n    return;\n  }\n\n  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and\n  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.\n  if (originalUrl.startsWith('/')) {\n    originalUrl = `http://dogs.are.great${originalUrl}`;\n  }\n\n  return (\n    req.query ||\n    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||\n    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node\n    (deps && deps.url && deps.url.parse(originalUrl).query) ||\n    undefined\n  );\n}\n"],"names":["stripUrlQueryAndFragment","isString","normalize","isPlainObject"],"mappings":";;;;;;AA4BA,MAAA,gBAAA,GAAA;AACA,EAAA,EAAA,EAAA,KAAA;AACA,EAAA,OAAA,EAAA,IAAA;AACA,EAAA,WAAA,EAAA,IAAA;AACA,EAAA,IAAA,EAAA,IAAA;AACA,CAAA,CAAA;AACA,MAAA,wBAAA,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,SAAA,EAAA,QAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA;AACA,MAAA,qBAAA,GAAA,CAAA,IAAA,EAAA,UAAA,EAAA,OAAA,CAAA,CAAA;;AAaA;AACA;AACA;AACA;AACA,SAAA,2BAAA;AACA,EAAA,WAAA;AACA,EAAA,GAAA;AAC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CAAA,GAAA,IAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,CAAA,EAAA;AACA,IAAA,WAAA,GAAA,CAAA,qBAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA;AACA,IAAA,GAAA,CAAA,KAAA;AACA,KAAA,OAAA,GAAA,KAAA,SAAA,IAAA,IAAA,GAAA,CAAA,WAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,GAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,KAAA,IAAA,IAAA,IAAA,CAAA,GAAA,IAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA,KAAA,CAAA;AACA,IAAA,SAAA;AACA,IAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either
//
// a) moving `validSeverityLevels` to `@sentry/types`,
// b) moving the`SeverityLevel` type here, or
// c) importing `validSeverityLevels` from here into `@sentry/types`.
//
// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would
// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the
// type, reminding anyone who changes it to change this list also, will have to do.

const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];

/**
 * Converts a string-based level into a member of the deprecated {@link Severity} enum.
 *
 * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.
 *
 * @param level String representation of Severity
 * @returns Severity
 */
function severityFromString(level) {
  return severityLevelFromString(level) ;
}

/**
 * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.
 *
 * @param level String representation of desired `SeverityLevel`.
 * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
 */
function severityLevelFromString(level) {
  return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;
}

exports.severityFromString = severityFromString;
exports.severityLevelFromString = severityLevelFromString;
exports.validSeverityLevels = validSeverityLevels;
//# sourceMappingURL=severity.js.map
{"version":3,"file":"severity.js","sources":["../../src/severity.ts"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport type { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n  return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n  return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,CAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,KAAA,EAAA,MAAA,EAAA,OAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,uBAAA,CAAA,KAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,KAAA,EAAA;AACA,EAAA,QAAA,KAAA,KAAA,MAAA,GAAA,SAAA,GAAA,mBAAA,CAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const nodeStackTrace = require('./node-stack-trace.js');

const STACKTRACE_FRAME_LIMIT = 50;
// Used to sanitize webpack (error: *) wrapped stack errors
const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;

/**
 * Creates a stack parser with the supplied line parsers
 *
 * StackFrames are returned in the correct order for Sentry Exception
 * frames and with Sentry SDK internal frames removed from the top and bottom
 *
 */
function createStackParser(...parsers) {
  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);

  return (stack, skipFirst = 0) => {
    const frames = [];
    const lines = stack.split('\n');

    for (let i = skipFirst; i < lines.length; i++) {
      const line = lines[i];
      // Ignore lines over 1kb as they are unlikely to be stack frames.
      // Many of the regular expressions use backtracking which results in run time that increases exponentially with
      // input size. Huge strings can result in hangs/Denial of Service:
      // https://github.com/getsentry/sentry-javascript/issues/2286
      if (line.length > 1024) {
        continue;
      }

      // https://github.com/getsentry/sentry-javascript/issues/5459
      // Remove webpack (error: *) wrappers
      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;

      // https://github.com/getsentry/sentry-javascript/issues/7813
      // Skip Error: lines
      if (cleanedLine.match(/\S*Error: /)) {
        continue;
      }

      for (const parser of sortedParsers) {
        const frame = parser(cleanedLine);

        if (frame) {
          frames.push(frame);
          break;
        }
      }

      if (frames.length >= STACKTRACE_FRAME_LIMIT) {
        break;
      }
    }

    return stripSentryFramesAndReverse(frames);
  };
}

/**
 * Gets a stack parser implementation from Options.stackParser
 * @see Options
 *
 * If options contains an array of line parsers, it is converted into a parser
 */
function stackParserFromStackParserOptions(stackParser) {
  if (Array.isArray(stackParser)) {
    return createStackParser(...stackParser);
  }
  return stackParser;
}

/**
 * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.
 * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the
 * function that caused the crash is the last frame in the array.
 * @hidden
 */
function stripSentryFramesAndReverse(stack) {
  if (!stack.length) {
    return [];
  }

  const localStack = stack.slice(0, STACKTRACE_FRAME_LIMIT);

  const lastFrameFunction = localStack[localStack.length - 1].function;
  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
  if (lastFrameFunction && /sentryWrapped/.test(lastFrameFunction)) {
    localStack.pop();
  }

  // Reversing in the middle of the procedure allows us to just pop the values off the stack
  localStack.reverse();

  const firstFrameFunction = localStack[localStack.length - 1].function;
  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)
  if (firstFrameFunction && /captureMessage|captureException/.test(firstFrameFunction)) {
    localStack.pop();
  }

  return localStack.map(frame => ({
    ...frame,
    filename: frame.filename || localStack[localStack.length - 1].filename,
    function: frame.function || '?',
  }));
}

const defaultFunctionName = '<anonymous>';

/**
 * Safely extract function name from itself
 */
function getFunctionName(fn) {
  try {
    if (!fn || typeof fn !== 'function') {
      return defaultFunctionName;
    }
    return fn.name || defaultFunctionName;
  } catch (e) {
    // Just accessing custom props in some Selenium environments
    // can cause a "Permission denied" exception (see raven-js#495).
    return defaultFunctionName;
  }
}

/**
 * Node.js stack line parser
 *
 * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.
 * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain
 */
function nodeStackLineParser(getModule) {
  return [90, nodeStackTrace.node(getModule)];
}

exports.createStackParser = createStackParser;
exports.getFunctionName = getFunctionName;
exports.nodeStackLineParser = nodeStackLineParser;
exports.stackParserFromStackParserOptions = stackParserFromStackParserOptions;
exports.stripSentryFramesAndReverse = stripSentryFramesAndReverse;
//# sourceMappingURL=stacktrace.js.map
{"version":3,"file":"stacktrace.js","sources":["../../src/stacktrace.ts"],"sourcesContent":["import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';\n\nimport type { GetModuleFn } from './node-stack-trace';\nimport { node } from './node-stack-trace';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n  return (stack: string, skipFirst: number = 0): StackFrame[] => {\n    const frames: StackFrame[] = [];\n    const lines = stack.split('\\n');\n\n    for (let i = skipFirst; i < lines.length; i++) {\n      const line = lines[i];\n      // Ignore lines over 1kb as they are unlikely to be stack frames.\n      // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n      // input size. Huge strings can result in hangs/Denial of Service:\n      // https://github.com/getsentry/sentry-javascript/issues/2286\n      if (line.length > 1024) {\n        continue;\n      }\n\n      // https://github.com/getsentry/sentry-javascript/issues/5459\n      // Remove webpack (error: *) wrappers\n      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n      // https://github.com/getsentry/sentry-javascript/issues/7813\n      // Skip Error: lines\n      if (cleanedLine.match(/\\S*Error: /)) {\n        continue;\n      }\n\n      for (const parser of sortedParsers) {\n        const frame = parser(cleanedLine);\n\n        if (frame) {\n          frames.push(frame);\n          break;\n        }\n      }\n\n      if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n        break;\n      }\n    }\n\n    return stripSentryFramesAndReverse(frames);\n  };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n  if (Array.isArray(stackParser)) {\n    return createStackParser(...stackParser);\n  }\n  return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): StackFrame[] {\n  if (!stack.length) {\n    return [];\n  }\n\n  const localStack = stack.slice(0, STACKTRACE_FRAME_LIMIT);\n\n  const lastFrameFunction = localStack[localStack.length - 1].function;\n  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n  if (lastFrameFunction && /sentryWrapped/.test(lastFrameFunction)) {\n    localStack.pop();\n  }\n\n  // Reversing in the middle of the procedure allows us to just pop the values off the stack\n  localStack.reverse();\n\n  const firstFrameFunction = localStack[localStack.length - 1].function;\n  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n  if (firstFrameFunction && /captureMessage|captureException/.test(firstFrameFunction)) {\n    localStack.pop();\n  }\n\n  return localStack.map(frame => ({\n    ...frame,\n    filename: frame.filename || localStack[localStack.length - 1].filename,\n    function: frame.function || '?',\n  }));\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n  try {\n    if (!fn || typeof fn !== 'function') {\n      return defaultFunctionName;\n    }\n    return fn.name || defaultFunctionName;\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    return defaultFunctionName;\n  }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n  return [90, node(getModule)];\n}\n"],"names":["node"],"mappings":";;;;AAKA,MAAA,sBAAA,GAAA,EAAA,CAAA;AACA;AACA,MAAA,oBAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,GAAA,OAAA,EAAA;AACA,EAAA,MAAA,aAAA,GAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,KAAA,EAAA,SAAA,GAAA,CAAA,KAAA;AACA,IAAA,MAAA,MAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,KAAA,IAAA,CAAA,GAAA,SAAA,EAAA,CAAA,GAAA,KAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,MAAA,MAAA,IAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,GAAA,IAAA,EAAA;AACA,QAAA,SAAA;AACA,OAAA;AACA;AACA;AACA;AACA,MAAA,MAAA,WAAA,GAAA,oBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,GAAA,IAAA,CAAA,OAAA,CAAA,oBAAA,EAAA,IAAA,CAAA,GAAA,IAAA,CAAA;AACA;AACA;AACA;AACA,MAAA,IAAA,WAAA,CAAA,KAAA,CAAA,YAAA,CAAA,EAAA;AACA,QAAA,SAAA;AACA,OAAA;AACA;AACA,MAAA,KAAA,MAAA,MAAA,IAAA,aA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;AACA;AACA,EAAA,IAAA,kBAAA,IAAA,iCAAA,CAAA,IAAA,CAAA,kBAAA,CAAA,EAAA;AACA,IAAA,UAAA,CAAA,GAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,UAAA,CAAA,GAAA,CAAA,KAAA,KAAA;AACA,IAAA,GAAA,KAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,QAAA,IAAA,UAAA,CAAA,UAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,QAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,QAAA,IAAA,GAAA;AACA,GAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,mBAAA,GAAA,aAAA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,EAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,CAAA,EAAA,IAAA,OAAA,EAAA,KAAA,UAAA,EAAA;AACA,MAAA,OAAA,mBAAA,CAAA;AACA,KAAA;AACA,IAAA,OAAA,EAAA,CAAA,IAAA,IAAA,mBAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA;AACA,IAAA,OAAA,mBAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,SAAA,EAAA;AACA,EAAA,OAAA,CAAA,EAAA,EAAAA,mBAAA,CAAA,SAAA,CAAA,CAAA,CAAA;AACA;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');

/**
 * Truncates given string to the maximum characters count
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string (0 = unlimited)
 * @returns string Encoded
 */
function truncate(str, max = 0) {
  if (typeof str !== 'string' || max === 0) {
    return str;
  }
  return str.length <= max ? str : `${str.slice(0, max)}...`;
}

/**
 * This is basically just `trim_line` from
 * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string
 * @returns string Encoded
 */
function snipLine(line, colno) {
  let newLine = line;
  const lineLength = newLine.length;
  if (lineLength <= 150) {
    return newLine;
  }
  if (colno > lineLength) {
    // eslint-disable-next-line no-param-reassign
    colno = lineLength;
  }

  let start = Math.max(colno - 60, 0);
  if (start < 5) {
    start = 0;
  }

  let end = Math.min(start + 140, lineLength);
  if (end > lineLength - 5) {
    end = lineLength;
  }
  if (end === lineLength) {
    start = Math.max(end - 140, 0);
  }

  newLine = newLine.slice(start, end);
  if (start > 0) {
    newLine = `'{snip} ${newLine}`;
  }
  if (end < lineLength) {
    newLine += ' {snip}';
  }

  return newLine;
}

/**
 * Join values in array
 * @param input array of values to be joined together
 * @param delimiter string to be placed in-between values
 * @returns Joined values
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function safeJoin(input, delimiter) {
  if (!Array.isArray(input)) {
    return '';
  }

  const output = [];
  // eslint-disable-next-line @typescript-eslint/prefer-for-of
  for (let i = 0; i < input.length; i++) {
    const value = input[i];
    try {
      output.push(String(value));
    } catch (e) {
      output.push('[value cannot be serialized]');
    }
  }

  return output.join(delimiter);
}

/**
 * Checks if the given value matches a regex or string
 *
 * @param value The string to test
 * @param pattern Either a regex or a string against which `value` will be matched
 * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match
 * `pattern` if it contains `pattern`. Only applies to string-type patterns.
 */
function isMatchingPattern(
  value,
  pattern,
  requireExactStringMatch = false,
) {
  if (!is.isString(value)) {
    return false;
  }

  if (is.isRegExp(pattern)) {
    return pattern.test(value);
  }
  if (is.isString(pattern)) {
    return requireExactStringMatch ? value === pattern : value.includes(pattern);
  }

  return false;
}

/**
 * Test the given string against an array of strings and regexes. By default, string matching is done on a
 * substring-inclusion basis rather than a strict equality basis
 *
 * @param testString The string to test
 * @param patterns The patterns against which to test the string
 * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to
 * count. If false, `testString` will match a string pattern if it contains that pattern.
 * @returns
 */
function stringMatchesSomePattern(
  testString,
  patterns = [],
  requireExactStringMatch = false,
) {
  return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));
}

exports.isMatchingPattern = isMatchingPattern;
exports.safeJoin = safeJoin;
exports.snipLine = snipLine;
exports.stringMatchesSomePattern = stringMatchesSomePattern;
exports.truncate = truncate;
//# sourceMappingURL=string.js.map
{"version":3,"file":"string.js","sources":["../../src/string.ts"],"sourcesContent":["import { isRegExp, isString } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n  if (typeof str !== 'string' || max === 0) {\n    return str;\n  }\n  return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n  let newLine = line;\n  const lineLength = newLine.length;\n  if (lineLength <= 150) {\n    return newLine;\n  }\n  if (colno > lineLength) {\n    // eslint-disable-next-line no-param-reassign\n    colno = lineLength;\n  }\n\n  let start = Math.max(colno - 60, 0);\n  if (start < 5) {\n    start = 0;\n  }\n\n  let end = Math.min(start + 140, lineLength);\n  if (end > lineLength - 5) {\n    end = lineLength;\n  }\n  if (end === lineLength) {\n    start = Math.max(end - 140, 0);\n  }\n\n  newLine = newLine.slice(start, end);\n  if (start > 0) {\n    newLine = `'{snip} ${newLine}`;\n  }\n  if (end < lineLength) {\n    newLine += ' {snip}';\n  }\n\n  return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n  if (!Array.isArray(input)) {\n    return '';\n  }\n\n  const output = [];\n  // eslint-disable-next-line @typescript-eslint/prefer-for-of\n  for (let i = 0; i < input.length; i++) {\n    const value = input[i];\n    try {\n      output.push(String(value));\n    } catch (e) {\n      output.push('[value cannot be serialized]');\n    }\n  }\n\n  return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n  value: string,\n  pattern: RegExp | string,\n  requireExactStringMatch: boolean = false,\n): boolean {\n  if (!isString(value)) {\n    return false;\n  }\n\n  if (isRegExp(pattern)) {\n    return pattern.test(value);\n  }\n  if (isString(pattern)) {\n    return requireExactStringMatch ? value === pattern : value.includes(pattern);\n  }\n\n  return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n  testString: string,\n  patterns: Array<string | RegExp> = [],\n  requireExactStringMatch: boolean = false,\n): boolean {\n  return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n"],"names":["isString","isRegExp"],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA,GAAA,GAAA,CAAA,EAAA;AACA,EAAA,IAAA,OAAA,GAAA,KAAA,QAAA,IAAA,GAAA,KAAA,CAAA,EAAA;AACA,IAAA,OAAA,GAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,GAAA,CAAA,MAAA,IAAA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A,CAAA,QAAA,CAAA,OAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA;AACA,EAAA,UAAA;AACA,EAAA,QAAA,GAAA,EAAA;AACA,EAAA,uBAAA,GAAA,KAAA;AACA,EAAA;AACA,EAAA,OAAA,QAAA,CAAA,IAAA,CAAA,OAAA,IAAA,iBAAA,CAAA,UAAA,EAAA,OAAA,EAAA,uBAAA,CAAA,CAAA,CAAA;AACA;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const logger = require('./logger.js');
const worldwide = require('./worldwide.js');

// eslint-disable-next-line deprecation/deprecation
const WINDOW = worldwide.getGlobalObject();

/**
 * Tells whether current environment supports ErrorEvent objects
 * {@link supportsErrorEvent}.
 *
 * @returns Answer to the given question.
 */
function supportsErrorEvent() {
  try {
    new ErrorEvent('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports DOMError objects
 * {@link supportsDOMError}.
 *
 * @returns Answer to the given question.
 */
function supportsDOMError() {
  try {
    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':
    // 1 argument required, but only 0 present.
    // @ts-ignore It really needs 1 argument, not 0.
    new DOMError('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports DOMException objects
 * {@link supportsDOMException}.
 *
 * @returns Answer to the given question.
 */
function supportsDOMException() {
  try {
    new DOMException('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports Fetch API
 * {@link supportsFetch}.
 *
 * @returns Answer to the given question.
 */
function supportsFetch() {
  if (!('fetch' in WINDOW)) {
    return false;
  }

  try {
    new Headers();
    new Request('http://www.example.com');
    new Response();
    return true;
  } catch (e) {
    return false;
  }
}
/**
 * isNativeFetch checks if the given function is a native implementation of fetch()
 */
// eslint-disable-next-line @typescript-eslint/ban-types
function isNativeFetch(func) {
  return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
}

/**
 * Tells whether current environment supports Fetch API natively
 * {@link supportsNativeFetch}.
 *
 * @returns true if `window.fetch` is natively implemented, false otherwise
 */
function supportsNativeFetch() {
  if (!supportsFetch()) {
    return false;
  }

  // Fast path to avoid DOM I/O
  // eslint-disable-next-line @typescript-eslint/unbound-method
  if (isNativeFetch(WINDOW.fetch)) {
    return true;
  }

  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)
  // so create a "pure" iframe to see if that has native fetch
  let result = false;
  const doc = WINDOW.document;
  // eslint-disable-next-line deprecation/deprecation
  if (doc && typeof (doc.createElement ) === 'function') {
    try {
      const sandbox = doc.createElement('iframe');
      sandbox.hidden = true;
      doc.head.appendChild(sandbox);
      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        result = isNativeFetch(sandbox.contentWindow.fetch);
      }
      doc.head.removeChild(sandbox);
    } catch (err) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);
    }
  }

  return result;
}

/**
 * Tells whether current environment supports ReportingObserver API
 * {@link supportsReportingObserver}.
 *
 * @returns Answer to the given question.
 */
function supportsReportingObserver() {
  return 'ReportingObserver' in WINDOW;
}

/**
 * Tells whether current environment supports Referrer Policy API
 * {@link supportsReferrerPolicy}.
 *
 * @returns Answer to the given question.
 */
function supportsReferrerPolicy() {
  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
  // (see https://caniuse.com/#feat=referrer-policy),
  // it doesn't. And it throws an exception instead of ignoring this parameter...
  // REF: https://github.com/getsentry/raven-js/issues/1233

  if (!supportsFetch()) {
    return false;
  }

  try {
    new Request('_', {
      referrerPolicy: 'origin' ,
    });
    return true;
  } catch (e) {
    return false;
  }
}

exports.isNativeFetch = isNativeFetch;
exports.supportsDOMError = supportsDOMError;
exports.supportsDOMException = supportsDOMException;
exports.supportsErrorEvent = supportsErrorEvent;
exports.supportsFetch = supportsFetch;
exports.supportsNativeFetch = supportsNativeFetch;
exports.supportsReferrerPolicy = supportsReferrerPolicy;
exports.supportsReportingObserver = supportsReportingObserver;
//# sourceMappingURL=supports.js.map
{"version":3,"file":"supports.js","sources":["../../src/supports.ts"],"sourcesContent":["import { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nexport { supportsHistory } from './vendor/supportsHistory';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n  try {\n    new ErrorEvent('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n  try {\n    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n    // 1 argument required, but only 0 present.\n    // @ts-ignore It really needs 1 argument, not 0.\n    new DOMError('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n  try {\n    new DOMException('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n  if (!('fetch' in WINDOW)) {\n    return false;\n  }\n\n  try {\n    new Headers();\n    new Request('http://www.example.com');\n    new Response();\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n  return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  // Fast path to avoid DOM I/O\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  if (isNativeFetch(WINDOW.fetch)) {\n    return true;\n  }\n\n  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n  // so create a \"pure\" iframe to see if that has native fetch\n  let result = false;\n  const doc = WINDOW.document;\n  // eslint-disable-next-line deprecation/deprecation\n  if (doc && typeof (doc.createElement as unknown) === 'function') {\n    try {\n      const sandbox = doc.createElement('iframe');\n      sandbox.hidden = true;\n      doc.head.appendChild(sandbox);\n      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n        // eslint-disable-next-line @typescript-eslint/unbound-method\n        result = isNativeFetch(sandbox.contentWindow.fetch);\n      }\n      doc.head.removeChild(sandbox);\n    } catch (err) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n    }\n  }\n\n  return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n  return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n  // (see https://caniuse.com/#feat=referrer-policy),\n  // it doesn't. And it throws an exception instead of ignoring this parameter...\n  // REF: https://github.com/getsentry/raven-js/issues/1233\n\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  try {\n    new Request('_', {\n      referrerPolicy: 'origin' as ReferrerPolicy,\n    });\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n"],"names":["getGlobalObject","logger"],"mappings":";;;;;AAGA;AACA,MAAA,MAAA,GAAAA,yBAAA,EAAA,CAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,UAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,GAAA;AACA,EAAA,IAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,QAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,GAAA;AACA,EAAA,IAAA,EAAA,OAAA,IAAA,MAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,OAAA,EAAA,CAAA;AACA,IAAA,IAAA,OAAA,CAAA,wBAAA,CAAA,CAAA;AACA,IAAA,IAAA,QAAA,EAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AAC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A,CAAA,iFAAA,EAAA,GAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,yBAAA,GAAA;AACA,EAAA,OAAA,mBAAA,IAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,CAAA,aAAA,EAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,OAAA,CAAA,GAAA,EAAA;AACA,MAAA,cAAA,EAAA,QAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const is = require('./is.js');

/* eslint-disable @typescript-eslint/explicit-function-return-type */

/** SyncPromise internal states */
var States; (function (States) {
  /** Pending */
  const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING";
  /** Resolved / OK */
  const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED";
  /** Rejected / Error */
  const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED";
})(States || (States = {}));

// Overloads so we can call resolvedSyncPromise without arguments and generic argument

/**
 * Creates a resolved sync promise.
 *
 * @param value the value to resolve the promise with
 * @returns the resolved sync promise
 */
function resolvedSyncPromise(value) {
  return new SyncPromise(resolve => {
    resolve(value);
  });
}

/**
 * Creates a rejected sync promise.
 *
 * @param value the value to reject the promise with
 * @returns the rejected sync promise
 */
function rejectedSyncPromise(reason) {
  return new SyncPromise((_, reject) => {
    reject(reason);
  });
}

/**
 * Thenable class that behaves like a Promise and follows it's interface
 * but is not async internally
 */
class SyncPromise {
   __init() {this._state = States.PENDING;}
   __init2() {this._handlers = [];}

   constructor(
    executor,
  ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);SyncPromise.prototype.__init5.call(this);SyncPromise.prototype.__init6.call(this);
    try {
      executor(this._resolve, this._reject);
    } catch (e) {
      this._reject(e);
    }
  }

  /** JSDoc */
   then(
    onfulfilled,
    onrejected,
  ) {
    return new SyncPromise((resolve, reject) => {
      this._handlers.push([
        false,
        result => {
          if (!onfulfilled) {
            // TODO: ¯\_(ツ)_/¯
            // TODO: FIXME
            resolve(result );
          } else {
            try {
              resolve(onfulfilled(result));
            } catch (e) {
              reject(e);
            }
          }
        },
        reason => {
          if (!onrejected) {
            reject(reason);
          } else {
            try {
              resolve(onrejected(reason));
            } catch (e) {
              reject(e);
            }
          }
        },
      ]);
      this._executeHandlers();
    });
  }

  /** JSDoc */
   catch(
    onrejected,
  ) {
    return this.then(val => val, onrejected);
  }

  /** JSDoc */
   finally(onfinally) {
    return new SyncPromise((resolve, reject) => {
      let val;
      let isRejected;

      return this.then(
        value => {
          isRejected = false;
          val = value;
          if (onfinally) {
            onfinally();
          }
        },
        reason => {
          isRejected = true;
          val = reason;
          if (onfinally) {
            onfinally();
          }
        },
      ).then(() => {
        if (isRejected) {
          reject(val);
          return;
        }

        resolve(val );
      });
    });
  }

  /** JSDoc */
    __init3() {this._resolve = (value) => {
    this._setResult(States.RESOLVED, value);
  };}

  /** JSDoc */
    __init4() {this._reject = (reason) => {
    this._setResult(States.REJECTED, reason);
  };}

  /** JSDoc */
    __init5() {this._setResult = (state, value) => {
    if (this._state !== States.PENDING) {
      return;
    }

    if (is.isThenable(value)) {
      void (value ).then(this._resolve, this._reject);
      return;
    }

    this._state = state;
    this._value = value;

    this._executeHandlers();
  };}

  /** JSDoc */
    __init6() {this._executeHandlers = () => {
    if (this._state === States.PENDING) {
      return;
    }

    const cachedHandlers = this._handlers.slice();
    this._handlers = [];

    cachedHandlers.forEach(handler => {
      if (handler[0]) {
        return;
      }

      if (this._state === States.RESOLVED) {
        // eslint-disable-next-line @typescript-eslint/no-floating-promises
        handler[1](this._value );
      }

      if (this._state === States.REJECTED) {
        handler[2](this._value);
      }

      handler[0] = true;
    });
  };}
}

exports.SyncPromise = SyncPromise;
exports.rejectedSyncPromise = rejectedSyncPromise;
exports.resolvedSyncPromise = resolvedSyncPromise;
//# sourceMappingURL=syncpromise.js.map
{"version":3,"file":"syncpromise.js","sources":["../../src/syncpromise.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n  /** Pending */\n  PENDING = 0,\n  /** Resolved / OK */\n  RESOLVED = 1,\n  /** Rejected / Error */\n  REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike<void>;\nexport function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise<T>(value?: T | PromiseLike<T>): PromiseLike<T> {\n  return new SyncPromise(resolve => {\n    resolve(value);\n  });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T> {\n  return new SyncPromise((_, reject) => {\n    reject(reason);\n  });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise<T> implements PromiseLike<T> {\n  private _state: States = States.PENDING;\n  private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]> = [];\n  private _value: any;\n\n  public constructor(\n    executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void,\n  ) {\n    try {\n      executor(this._resolve, this._reject);\n    } catch (e) {\n      this._reject(e);\n    }\n  }\n\n  /** JSDoc */\n  public then<TResult1 = T, TResult2 = never>(\n    onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n    onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n  ): PromiseLike<TResult1 | TResult2> {\n    return new SyncPromise((resolve, reject) => {\n      this._handlers.push([\n        false,\n        result => {\n          if (!onfulfilled) {\n            // TODO: ¯\\_(ツ)_/¯\n            // TODO: FIXME\n            resolve(result as any);\n          } else {\n            try {\n              resolve(onfulfilled(result));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n        reason => {\n          if (!onrejected) {\n            reject(reason);\n          } else {\n            try {\n              resolve(onrejected(reason));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n      ]);\n      this._executeHandlers();\n    });\n  }\n\n  /** JSDoc */\n  public catch<TResult = never>(\n    onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n  ): PromiseLike<T | TResult> {\n    return this.then(val => val, onrejected);\n  }\n\n  /** JSDoc */\n  public finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult> {\n    return new SyncPromise<TResult>((resolve, reject) => {\n      let val: TResult | any;\n      let isRejected: boolean;\n\n      return this.then(\n        value => {\n          isRejected = false;\n          val = value;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n        reason => {\n          isRejected = true;\n          val = reason;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n      ).then(() => {\n        if (isRejected) {\n          reject(val);\n          return;\n        }\n\n        resolve(val as unknown as any);\n      });\n    });\n  }\n\n  /** JSDoc */\n  private readonly _resolve = (value?: T | PromiseLike<T> | null) => {\n    this._setResult(States.RESOLVED, value);\n  };\n\n  /** JSDoc */\n  private readonly _reject = (reason?: any) => {\n    this._setResult(States.REJECTED, reason);\n  };\n\n  /** JSDoc */\n  private readonly _setResult = (state: States, value?: T | PromiseLike<T> | any) => {\n    if (this._state !== States.PENDING) {\n      return;\n    }\n\n    if (isThenable(value)) {\n      void (value as PromiseLike<T>).then(this._resolve, this._reject);\n      return;\n    }\n\n    this._state = state;\n    this._value = value;\n\n    this._executeHandlers();\n  };\n\n  /** JSDoc */\n  private readonly _executeHandlers = () => {\n    if (this._state === States.PENDING) {\n      return;\n    }\n\n    const cachedHandlers = this._handlers.slice();\n    this._handlers = [];\n\n    cachedHandlers.forEach(handler => {\n      if (handler[0]) {\n        return;\n      }\n\n      if (this._state === States.RESOLVED) {\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        handler[1](this._value as unknown as any);\n      }\n\n      if (this._state === States.REJECTED) {\n        handler[2](this._value);\n      }\n\n      handler[0] = true;\n    });\n  };\n}\n\nexport { SyncPromise };\n"],"names":["isThenable"],"mappings":";;;;AAAA;AAKA;AACA;AACA,IAAA,MAAA,CAAA,CAAA,CAAA,UAAA,MAAA,EAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA,GAAA,SAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA,GAAA,UAAA,CAAA;AACA,CAAA,EAAA,MAAA,KAAA,MAAA,GAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,IAAA,WAAA,CAAA,OAAA,IAAA;AACA,IAAA,OAAA,CAAA,KAAA,CAAA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AAA;AACA,IAAA,IAAA,CAAA,MAAA,GAAA,KAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,gBAAA,EAAA,CAAA;AACA,IAAA,CAAA;AACA;AACA;AACA,IAAA,OAAA,GAAA,CAAA,IAAA,CAAA,gBAAA,GAAA,MAAA;AACA,IAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,OAAA,EAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,CAAA,SAAA,CAAA,KAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,SAAA,GAAA,EAAA,CAAA;AACA;AACA,IAAA,cAAA,CAAA,OAAA,CAAA,OAAA,IAAA;AACA,MAAA,IAAA,OAAA,CAAA,CAAA,CAAA,EAAA;AACA,QAAA,OAAA;AACA,OAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,QAAA,EAAA;AACA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,MAAA,EAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,QAAA,EAAA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,OAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,CAAA;AACA;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const node = require('./node.js');
const worldwide = require('./worldwide.js');

// eslint-disable-next-line deprecation/deprecation
const WINDOW = worldwide.getGlobalObject();

/**
 * An object that can return the current timestamp in seconds since the UNIX epoch.
 */

/**
 * A TimestampSource implementation for environments that do not support the Performance Web API natively.
 *
 * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier
 * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It
 * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration".
 */
const dateTimestampSource = {
  nowSeconds: () => Date.now() / 1000,
};

/**
 * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}
 * for accessing a high-resolution monotonic clock.
 */

/**
 * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not
 * support the API.
 *
 * Wrapping the native API works around differences in behavior from different browsers.
 */
function getBrowserPerformance() {
  const { performance } = WINDOW;
  if (!performance || !performance.now) {
    return undefined;
  }

  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().
  //
  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +
  // performance.now() gives a date arbitrarily in the past.
  //
  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is
  // undefined.
  //
  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to
  // interact with data coming out of performance entries.
  //
  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that
  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes
  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have
  // observed skews that can be as long as days, weeks or months.
  //
  // See https://github.com/getsentry/sentry-javascript/issues/2590.
  //
  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload
  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation
  // transactions of long-lived web pages.
  const timeOrigin = Date.now() - performance.now();

  return {
    now: () => performance.now(),
    timeOrigin,
  };
}

/**
 * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't
 * implement the API.
 */
function getNodePerformance() {
  try {
    const perfHooks = node.dynamicRequire(module, 'perf_hooks') ;
    return perfHooks.performance;
  } catch (_) {
    return undefined;
  }
}

/**
 * The Performance API implementation for the current platform, if available.
 */
const platformPerformance = node.isNodeEnv() ? getNodePerformance() : getBrowserPerformance();

const timestampSource =
  platformPerformance === undefined
    ? dateTimestampSource
    : {
        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,
      };

/**
 * Returns a timestamp in seconds since the UNIX epoch using the Date API.
 */
const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);

/**
 * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
 * availability of the Performance API.
 *
 * See `usingPerformanceAPI` to test whether the Performance API is used.
 *
 * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
 * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
 * skew can grow to arbitrary amounts like days, weeks or months.
 * See https://github.com/getsentry/sentry-javascript/issues/2590.
 */
const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);

// Re-exported with an old name for backwards-compatibility.
const timestampWithMs = timestampInSeconds;

/**
 * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.
 */
const usingPerformanceAPI = platformPerformance !== undefined;

/**
 * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
 */
exports._browserPerformanceTimeOriginMode = void 0;

/**
 * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
 * performance API is available.
 */
const browserPerformanceTimeOrigin = (() => {
  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or
  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin
  // data as reliable if they are within a reasonable threshold of the current time.

  const { performance } = WINDOW;
  if (!performance || !performance.now) {
    exports._browserPerformanceTimeOriginMode = 'none';
    return undefined;
  }

  const threshold = 3600 * 1000;
  const performanceNow = performance.now();
  const dateNow = Date.now();

  // if timeOrigin isn't available set delta to threshold so it isn't used
  const timeOriginDelta = performance.timeOrigin
    ? Math.abs(performance.timeOrigin + performanceNow - dateNow)
    : threshold;
  const timeOriginIsReliable = timeOriginDelta < threshold;

  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin
  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.
  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always
  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the
  // Date API.
  // eslint-disable-next-line deprecation/deprecation
  const navigationStart = performance.timing && performance.timing.navigationStart;
  const hasNavigationStart = typeof navigationStart === 'number';
  // if navigationStart isn't available set delta to threshold so it isn't used
  const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
  const navigationStartIsReliable = navigationStartDelta < threshold;

  if (timeOriginIsReliable || navigationStartIsReliable) {
    // Use the more reliable time origin
    if (timeOriginDelta <= navigationStartDelta) {
      exports._browserPerformanceTimeOriginMode = 'timeOrigin';
      return performance.timeOrigin;
    } else {
      exports._browserPerformanceTimeOriginMode = 'navigationStart';
      return navigationStart;
    }
  }

  // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.
  exports._browserPerformanceTimeOriginMode = 'dateNow';
  return dateNow;
})();

exports.browserPerformanceTimeOrigin = browserPerformanceTimeOrigin;
exports.dateTimestampInSeconds = dateTimestampInSeconds;
exports.timestampInSeconds = timestampInSeconds;
exports.timestampWithMs = timestampWithMs;
exports.usingPerformanceAPI = usingPerformanceAPI;
//# sourceMappingURL=time.js.map
{"version":3,"file":"time.js","sources":["../../src/time.ts"],"sourcesContent":["import { dynamicRequire, isNodeEnv } from './node';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * An object that can return the current timestamp in seconds since the UNIX epoch.\n */\ninterface TimestampSource {\n  nowSeconds(): number;\n}\n\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\nconst dateTimestampSource: TimestampSource = {\n  nowSeconds: () => Date.now() / 1000,\n};\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n  /**\n   * The millisecond timestamp at which measurement began, measured in Unix time.\n   */\n  timeOrigin: number;\n  /**\n   * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n   */\n  now(): number;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction getBrowserPerformance(): Performance | undefined {\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    return undefined;\n  }\n\n  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n  //\n  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n  // performance.now() gives a date arbitrarily in the past.\n  //\n  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n  // undefined.\n  //\n  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n  // interact with data coming out of performance entries.\n  //\n  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n  // observed skews that can be as long as days, weeks or months.\n  //\n  // See https://github.com/getsentry/sentry-javascript/issues/2590.\n  //\n  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n  // transactions of long-lived web pages.\n  const timeOrigin = Date.now() - performance.now();\n\n  return {\n    now: () => performance.now(),\n    timeOrigin,\n  };\n}\n\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\nfunction getNodePerformance(): Performance | undefined {\n  try {\n    const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n    return perfHooks.performance;\n  } catch (_) {\n    return undefined;\n  }\n}\n\n/**\n * The Performance API implementation for the current platform, if available.\n */\nconst platformPerformance: Performance | undefined = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\n\nconst timestampSource: TimestampSource =\n  platformPerformance === undefined\n    ? dateTimestampSource\n    : {\n        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,\n      };\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport const dateTimestampInSeconds: () => number = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds: () => number = timestampSource.nowSeconds.bind(timestampSource);\n\n// Re-exported with an old name for backwards-compatibility.\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\nexport const usingPerformanceAPI = platformPerformance !== undefined;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n  // data as reliable if they are within a reasonable threshold of the current time.\n\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    _browserPerformanceTimeOriginMode = 'none';\n    return undefined;\n  }\n\n  const threshold = 3600 * 1000;\n  const performanceNow = performance.now();\n  const dateNow = Date.now();\n\n  // if timeOrigin isn't available set delta to threshold so it isn't used\n  const timeOriginDelta = performance.timeOrigin\n    ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n    : threshold;\n  const timeOriginIsReliable = timeOriginDelta < threshold;\n\n  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n  // Date API.\n  // eslint-disable-next-line deprecation/deprecation\n  const navigationStart = performance.timing && performance.timing.navigationStart;\n  const hasNavigationStart = typeof navigationStart === 'number';\n  // if navigationStart isn't available set delta to threshold so it isn't used\n  const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n  const navigationStartIsReliable = navigationStartDelta < threshold;\n\n  if (timeOriginIsReliable || navigationStartIsReliable) {\n    // Use the more reliable time origin\n    if (timeOriginDelta <= navigationStartDelta) {\n      _browserPerformanceTimeOriginMode = 'timeOrigin';\n      return performance.timeOrigin;\n    } else {\n      _browserPerformanceTimeOriginMode = 'navigationStart';\n      return navigationStart;\n    }\n  }\n\n  // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n  _browserPerformanceTimeOriginMode = 'dateNow';\n  return dateNow;\n})();\n"],"names":["getGlobalObject","dynamicRequire","isNodeEnv","_browserPerformanceTimeOriginMode"],"mappings":";;;;;AAGA;AACA,MAAA,MAAA,GAAAA,yBAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA;AACA,EAAA,UAAA,EAAA,MAAA,IAAA,CAAA,GAAA,EAAA,GAAA,IAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,q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AAA,yBAAA,EAAA;AACA;AACA,IAAA,IAAA,eAAA,IAAA,oBAAA,EAAA;AACA,MAAAA,yCAAA,GAAA,YAAA,CAAA;AACA,MAAA,OAAA,WAAA,CAAA,UAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAAA,yCAAA,GAAA,iBAAA,CAAA;AACA,MAAA,OAAA,eAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA;AACA,EAAAA,yCAAA,GAAA,SAAA,CAAA;AACA,EAAA,OAAA,OAAA,CAAA;AACA,CAAA;;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const TRACEPARENT_REGEXP = new RegExp(
  '^[ \\t]*' + // whitespace
    '([0-9a-f]{32})?' + // trace_id
    '-?([0-9a-f]{16})?' + // span_id
    '-?([01])?' + // sampled
    '[ \\t]*$', // whitespace
);

/**
 * Extract transaction context data from a `sentry-trace` header.
 *
 * @param traceparent Traceparent string
 *
 * @returns Object containing data from the header, or undefined if traceparent string is malformed
 */
function extractTraceparentData(traceparent) {
  const matches = traceparent.match(TRACEPARENT_REGEXP);

  if (!traceparent || !matches) {
    // empty string or no matches is invalid traceparent data
    return undefined;
  }

  let parentSampled;
  if (matches[3] === '1') {
    parentSampled = true;
  } else if (matches[3] === '0') {
    parentSampled = false;
  }

  return {
    traceId: matches[1],
    parentSampled,
    parentSpanId: matches[2],
  };
}

exports.TRACEPARENT_REGEXP = TRACEPARENT_REGEXP;
exports.extractTraceparentData = extractTraceparentData;
//# sourceMappingURL=tracing.js.map
{"version":3,"file":"tracing.js","sources":["../../src/tracing.ts"],"sourcesContent":["import type { TraceparentData } from '@sentry/types';\n\nexport const TRACEPARENT_REGEXP = new RegExp(\n  '^[ \\\\t]*' + // whitespace\n    '([0-9a-f]{32})?' + // trace_id\n    '-?([0-9a-f]{16})?' + // span_id\n    '-?([01])?' + // sampled\n    '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent: string): TraceparentData | undefined {\n  const matches = traceparent.match(TRACEPARENT_REGEXP);\n\n  if (!traceparent || !matches) {\n    // empty string or no matches is invalid traceparent data\n    return undefined;\n  }\n\n  let parentSampled: boolean | undefined;\n  if (matches[3] === '1') {\n    parentSampled = true;\n  } else if (matches[3] === '0') {\n    parentSampled = false;\n  }\n\n  return {\n    traceId: matches[1],\n    parentSampled,\n    parentSpanId: matches[2],\n  };\n}\n"],"names":[],"mappings":";;AAEA,MAAA,kBAAA,GAAA,IAAA,MAAA;AACA,EAAA,UAAA;AACA,IAAA,iBAAA;AACA,IAAA,mBAAA;AACA,IAAA,WAAA;AACA,IAAA,UAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,WAAA,CAAA,KAAA,CAAA,kBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,WAAA,IAAA,CAAA,OAAA,EAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,aAAA,CAAA;AACA,EAAA,IAAA,OAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,aAAA,GAAA,IAAA,CAAA;AACA,GAAA,MAAA,IAAA,OAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,aAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,OAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA,IAAA,aAAA;AACA,IAAA,YAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Parses string form of URL into an object
 * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
 * // intentionally using regex and not <a/> href parsing trick because React Native and other
 * // environments where DOM might not be available
 * @returns parsed URL object
 */
function parseUrl(url) {
  if (!url) {
    return {};
  }

  const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);

  if (!match) {
    return {};
  }

  // coerce to undefined values to empty string so we don't get 'undefined'
  const query = match[6] || '';
  const fragment = match[8] || '';
  return {
    host: match[4],
    path: match[5],
    protocol: match[2],
    search: query,
    hash: fragment,
    relative: match[5] + query + fragment, // everything minus origin
  };
}

/**
 * Strip the query string and fragment off of a given URL or path (if present)
 *
 * @param urlPath Full URL or path, including possible query string and/or fragment
 * @returns URL or path without query string or fragment
 */
function stripUrlQueryAndFragment(urlPath) {
  // eslint-disable-next-line no-useless-escape
  return urlPath.split(/[\?#]/, 1)[0];
}

/**
 * Returns number of URL segments of a passed string URL.
 */
function getNumberOfUrlSegments(url) {
  // split at '/' or at '\/' to split regex urls correctly
  return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length;
}

/**
 * Takes a URL object and returns a sanitized string which is safe to use as span description
 * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data
 */
function getSanitizedUrlString(url) {
  const { protocol, host, path } = url;

  const filteredHost =
    (host &&
      host
        // Always filter out authority
        .replace(/^.*@/, '[filtered]:[filtered]@')
        // Don't show standard :80 (http) and :443 (https) ports to reduce the noise
        .replace(':80', '')
        .replace(':443', '')) ||
    '';

  return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;
}

exports.getNumberOfUrlSegments = getNumberOfUrlSegments;
exports.getSanitizedUrlString = getSanitizedUrlString;
exports.parseUrl = parseUrl;
exports.stripUrlQueryAndFragment = stripUrlQueryAndFragment;
//# sourceMappingURL=url.js.map
{"version":3,"file":"url.js","sources":["../../src/url.ts"],"sourcesContent":["type PartialURL = {\n  host?: string;\n  path?: string;\n  protocol?: string;\n  relative?: string;\n  search?: string;\n  hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n  if (!url) {\n    return {};\n  }\n\n  const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n  if (!match) {\n    return {};\n  }\n\n  // coerce to undefined values to empty string so we don't get 'undefined'\n  const query = match[6] || '';\n  const fragment = match[8] || '';\n  return {\n    host: match[4],\n    path: match[5],\n    protocol: match[2],\n    search: query,\n    hash: fragment,\n    relative: match[5] + query + fragment, // everything minus origin\n  };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n  // eslint-disable-next-line no-useless-escape\n  return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n  // split at '/' or at '\\/' to split regex urls correctly\n  return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n  const { protocol, host, path } = url;\n\n  const filteredHost =\n    (host &&\n      host\n        // Always filter out authority\n        .replace(/^.*@/, '[filtered]:[filtered]@')\n        // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n        .replace(':80', '')\n        .replace(':443', '')) ||\n    '';\n\n  return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,GAAA,EAAA;AACA,IAAA,OAA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AA,IAAA;AACA,MAAA,IAAA;AACA;AACA,SAAA,OAAA,CAAA,MAAA,EAAA,wBAAA,CAAA;AACA;AACA,SAAA,OAAA,CAAA,KAAA,EAAA,EAAA,CAAA;AACA,SAAA,OAAA,CAAA,MAAA,EAAA,EAAA,CAAA;AACA,IAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,GAAA,CAAA,EAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,CAAA,EAAA,YAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;;;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/**
 * Recursively traverses an object to update an existing nested key.
 * Note: The provided key path must include existing properties,
 * the function will not create objects while traversing.
 *
 * @param obj An object to update
 * @param value The value to update the nested key with
 * @param keyPath The path to the key to update ex. fizz.buzz.foo
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setNestedKey(obj, keyPath, value) {
  // Ex. foo.bar.zoop will extract foo and bar.zoop
  const match = keyPath.match(/([a-z_]+)\.(.*)/i);
  // The match will be null when there's no more recursing to do, i.e., when we've reached the right level of the object
  if (match === null) {
    obj[keyPath] = value;
  } else {
    // `match[1]` is the initial segment of the path, and `match[2]` is the remainder of the path
    const innerObj = obj[match[1]];
    setNestedKey(innerObj, match[2], value);
  }
}

/**
 * Enforces inclusion of a given integration with specified options in an integration array originally determined by the
 * user, by either including the given default instance or by patching an existing user instance with the given options.
 *
 * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging
 * options from a default integration instance with those from a user-provided instance of the same integration, only
 * for allowing the user to override a default instance entirely. (TODO: Fix that.)
 *
 * @param defaultIntegrationInstance An instance of the integration with the correct options already set
 * @param userIntegrations Integrations defined by the user.
 * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.
 * @returns A final integrations array.
 */
function addOrUpdateIntegration(
  defaultIntegrationInstance,
  userIntegrations,
  forcedOptions = {},
) {
  return (
    Array.isArray(userIntegrations)
      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)
      : addOrUpdateIntegrationInFunction(
          defaultIntegrationInstance,
          // Somehow TS can't figure out that not being an array makes this necessarily a function
          userIntegrations ,
          forcedOptions,
        )
  ) ;
}

function addOrUpdateIntegrationInArray(
  defaultIntegrationInstance,
  userIntegrations,
  forcedOptions,
) {
  const userInstance = userIntegrations.find(integration => integration.name === defaultIntegrationInstance.name);

  if (userInstance) {
    for (const [keyPath, value] of Object.entries(forcedOptions)) {
      setNestedKey(userInstance, keyPath, value);
    }

    return userIntegrations;
  }

  return [...userIntegrations, defaultIntegrationInstance];
}

function addOrUpdateIntegrationInFunction(
  defaultIntegrationInstance,
  userIntegrationsFunc,
  forcedOptions,
) {
  const wrapper = defaultIntegrations => {
    const userFinalIntegrations = userIntegrationsFunc(defaultIntegrations);

    // There are instances where we want the user to be able to prevent an integration from appearing at all, which they
    // would do by providing a function which filters out the integration in question. If that's happened in one of
    // those cases, don't add our default back in.
    if (defaultIntegrationInstance.allowExclusionByUser) {
      const userFinalInstance = userFinalIntegrations.find(
        integration => integration.name === defaultIntegrationInstance.name,
      );
      if (!userFinalInstance) {
        return userFinalIntegrations;
      }
    }

    return addOrUpdateIntegrationInArray(defaultIntegrationInstance, userFinalIntegrations, forcedOptions);
  };

  return wrapper;
}

exports.addOrUpdateIntegration = addOrUpdateIntegration;
//# sourceMappingURL=userIntegrations.js.map
{"version":3,"file":"userIntegrations.js","sources":["../../src/userIntegrations.ts"],"sourcesContent":["import type { Integration } from '@sentry/types';\n\nexport type UserIntegrationsFunction = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserIntegrationsFunction;\nexport type IntegrationWithExclusionOption = Integration & {\n  /**\n   * Allow the user to exclude this integration by not returning it from a function provided as the `integrations` option\n   * in `Sentry.init()`. Meant to be used with default integrations, the idea being that if a user has actively filtered\n   * an integration out, we should be able to respect that choice if we wish.\n   */\n  allowExclusionByUser?: boolean;\n};\n\ntype ForcedIntegrationOptions = {\n  [keyPath: string]: unknown;\n};\n\n/**\n * Recursively traverses an object to update an existing nested key.\n * Note: The provided key path must include existing properties,\n * the function will not create objects while traversing.\n *\n * @param obj An object to update\n * @param value The value to update the nested key with\n * @param keyPath The path to the key to update ex. fizz.buzz.foo\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setNestedKey(obj: Record<string, any>, keyPath: string, value: unknown): void {\n  // Ex. foo.bar.zoop will extract foo and bar.zoop\n  const match = keyPath.match(/([a-z_]+)\\.(.*)/i);\n  // The match will be null when there's no more recursing to do, i.e., when we've reached the right level of the object\n  if (match === null) {\n    obj[keyPath] = value;\n  } else {\n    // `match[1]` is the initial segment of the path, and `match[2]` is the remainder of the path\n    const innerObj = obj[match[1]];\n    setNestedKey(innerObj, match[2], value);\n  }\n}\n\n/**\n * Enforces inclusion of a given integration with specified options in an integration array originally determined by the\n * user, by either including the given default instance or by patching an existing user instance with the given options.\n *\n * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging\n * options from a default integration instance with those from a user-provided instance of the same integration, only\n * for allowing the user to override a default instance entirely. (TODO: Fix that.)\n *\n * @param defaultIntegrationInstance An instance of the integration with the correct options already set\n * @param userIntegrations Integrations defined by the user.\n * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.\n * @returns A final integrations array.\n */\nexport function addOrUpdateIntegration<T extends UserIntegrations>(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: T,\n  forcedOptions: ForcedIntegrationOptions = {},\n): T {\n  return (\n    Array.isArray(userIntegrations)\n      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)\n      : addOrUpdateIntegrationInFunction(\n          defaultIntegrationInstance,\n          // Somehow TS can't figure out that not being an array makes this necessarily a function\n          userIntegrations as UserIntegrationsFunction,\n          forcedOptions,\n        )\n  ) as T;\n}\n\nfunction addOrUpdateIntegrationInArray(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: Integration[],\n  forcedOptions: ForcedIntegrationOptions,\n): Integration[] {\n  const userInstance = userIntegrations.find(integration => integration.name === defaultIntegrationInstance.name);\n\n  if (userInstance) {\n    for (const [keyPath, value] of Object.entries(forcedOptions)) {\n      setNestedKey(userInstance, keyPath, value);\n    }\n\n    return userIntegrations;\n  }\n\n  return [...userIntegrations, defaultIntegrationInstance];\n}\n\nfunction addOrUpdateIntegrationInFunction(\n  defaultIntegrationInstance: IntegrationWithExclusionOption,\n  userIntegrationsFunc: UserIntegrationsFunction,\n  forcedOptions: ForcedIntegrationOptions,\n): UserIntegrationsFunction {\n  const wrapper: UserIntegrationsFunction = defaultIntegrations => {\n    const userFinalIntegrations = userIntegrationsFunc(defaultIntegrations);\n\n    // There are instances where we want the user to be able to prevent an integration from appearing at all, which they\n    // would do by providing a function which filters out the integration in question. If that's happened in one of\n    // those cases, don't add our default back in.\n    if (defaultIntegrationInstance.allowExclusionByUser) {\n      const userFinalInstance = userFinalIntegrations.find(\n        integration => integration.name === defaultIntegrationInstance.name,\n      );\n      if (!userFinalInstance) {\n        return userFinalIntegrations;\n      }\n    }\n\n    return addOrUpdateIntegrationInArray(defaultIntegrationInstance, userFinalIntegrations, forcedOptions);\n  };\n\n  return wrapper;\n}\n"],"names":[],"mappings":";;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,GAAA,EAAA,OAAA,EAAA,KAAA,EAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,CAAA,KAAA,CAAA,kBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,KAAA,IAAA,EAAA;AACA,IAAA,GAAA,CAAA,OAAA,CAAA,GAAA,KAAA,CAAA;AACA,GAAA,MAAA;AACA;AACA,IAAA,MAAA,QAAA,GAAA,GAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,YAAA,CAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA,EAAA,KAAA,CAAA,C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AAA,GAAA,qBAAA,CAAA,IAAA;AACA,QAAA,WAAA,IAAA,WAAA,CAAA,IAAA,KAAA,0BAAA,CAAA,IAAA;AACA,OAAA,CAAA;AACA,MAAA,IAAA,CAAA,iBAAA,EAAA;AACA,QAAA,OAAA,qBAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,6BAAA,CAAA,0BAAA,EAAA,qBAAA,EAAA,aAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to:
//   a) reduce the size by skipping the runtime type - checking
//   b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+).
//
// MIT License
//
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files(the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of
// the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.

/**
 * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to
 * `new RegExp()`.
 *
 * @param regexString The string to escape
 * @returns An version of the string with all special regex characters escaped
 */
function escapeStringForRegex(regexString) {
  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems
  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.
  return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
}

exports.escapeStringForRegex = escapeStringForRegex;
//# sourceMappingURL=escapeStringForRegex.js.map
{"version":3,"file":"escapeStringForRegex.js","sources":["../../../src/vendor/escapeStringForRegex.ts"],"sourcesContent":["// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to:\n//   a) reduce the size by skipping the runtime type - checking\n//   b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+).\n//\n// MIT License\n//\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and\n// to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n// the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\nexport function escapeStringForRegex(regexString: string): string {\n  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n  return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,WAAA,EAAA;AACA;AACA;AACA,EAAA,OAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,MAAA,CAAA,CAAA,OAAA,CAAA,IAAA,EAAA,OAAA,CAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

const worldwide = require('../worldwide.js');

// Based on https://github.com/angular/angular.js/pull/13945/files

// eslint-disable-next-line deprecation/deprecation
const WINDOW = worldwide.getGlobalObject();

/**
 * Tells whether current environment supports History API
 * {@link supportsHistory}.
 *
 * @returns Answer to the given question.
 */
function supportsHistory() {
  // NOTE: in Chrome App environment, touching history.pushState, *even inside
  //       a try/catch block*, will cause Chrome to output an error to console.error
  // borrowed from: https://github.com/angular/angular.js/pull/13945/files
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const chrome = (WINDOW ).chrome;
  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
  /* eslint-enable @typescript-eslint/no-unsafe-member-access */
  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;

  return !isChromePackagedApp && hasHistoryApi;
}

exports.supportsHistory = supportsHistory;
//# sourceMappingURL=supportsHistory.js.map
{"version":3,"file":"supportsHistory.js","sources":["../../../src/vendor/supportsHistory.ts"],"sourcesContent":["// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n  // NOTE: in Chrome App environment, touching history.pushState, *even inside\n  //       a try/catch block*, will cause Chrome to output an error to console.error\n  // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const chrome = (WINDOW as any).chrome;\n  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n  return !isChromePackagedApp && hasHistoryApi;\n}\n"],"names":["getGlobalObject"],"mappings":";;;;AAAA;AAwBA;AACA;AACA,MAAA,MAAA,GAAAA,yBAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AACA,EAAA,MAAA,mBAAA,GAAA,MAAA,IAAA,MAAA,CAAA,GAAA,IAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,SAAA,IAAA,MAAA,IAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,SAAA,IAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,YAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,mBAAA,IAAA,aAAA,CAAA;AACA;;;;"}Object.defineProperty(exports, '__esModule', { value: true });

/** Internal global with common properties and Sentry extensions  */

// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification
// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js
// core-js has the following licence:
//
// Copyright (c) 2014-2022 Denis Pushkarev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/** Returns 'obj' if it's the global object, otherwise returns undefined */
function isGlobalObj(obj) {
  return obj && obj.Math == Math ? obj : undefined;
}

/** Get's the global object for the current JavaScript runtime */
const GLOBAL_OBJ =
  (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||
  // eslint-disable-next-line no-restricted-globals
  (typeof window == 'object' && isGlobalObj(window)) ||
  (typeof self == 'object' && isGlobalObj(self)) ||
  (typeof global == 'object' && isGlobalObj(global)) ||
  (function () {
    return this;
  })() ||
  {};

/**
 * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8
 */
function getGlobalObject() {
  return GLOBAL_OBJ ;
}

/**
 * Returns a global singleton contained in the global `__SENTRY__` object.
 *
 * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
 * function and added to the `__SENTRY__` object.
 *
 * @param name name of the global singleton on __SENTRY__
 * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
 * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value
 * @returns the singleton
 */
function getGlobalSingleton(name, creator, obj) {
  const gbl = (obj || GLOBAL_OBJ) ;
  const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});
  const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());
  return singleton;
}

exports.GLOBAL_OBJ = GLOBAL_OBJ;
exports.getGlobalObject = getGlobalObject;
exports.getGlobalSingleton = getGlobalSingleton;
//# sourceMappingURL=worldwide.js.map
{"version":3,"file":"worldwide.js","sources":["../../src/worldwide.ts"],"sourcesContent":["/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Integration } from '@sentry/types';\n\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions  */\nexport interface InternalGlobal {\n  navigator?: { userAgent?: string };\n  console: Console;\n  Sentry?: {\n    Integrations?: Integration[];\n  };\n  onerror?: {\n    (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean;\n    __SENTRY_INSTRUMENTED__?: true;\n    __SENTRY_LOADER__?: true;\n  };\n  onunhandledrejection?: {\n    (event: unknown): boolean;\n    __SENTRY_INSTRUMENTED__?: true;\n    __SENTRY_LOADER__?: true;\n  };\n  SENTRY_ENVIRONMENT?: string;\n  SENTRY_DSN?: string;\n  SENTRY_RELEASE?: {\n    id?: string;\n  };\n  SENTRY_SDK_SOURCE?: SdkSource;\n  /**\n   * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n   * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n   * file.\n   */\n  _sentryDebugIds?: Record<string, string>;\n  __SENTRY__: {\n    globalEventProcessors: any;\n    hub: any;\n    logger: any;\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n  return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n  (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n  // eslint-disable-next-line no-restricted-globals\n  (typeof window == 'object' && isGlobalObj(window)) ||\n  (typeof self == 'object' && isGlobalObj(self)) ||\n  (typeof global == 'object' && isGlobalObj(global)) ||\n  (function (this: any) {\n    return this;\n  })() ||\n  {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject<T>(): T & InternalGlobal {\n  return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton<T>(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n  const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n  const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n  const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n  return singleton;\n}\n"],"names":[],"mappings":";;AAkBA;;AAyCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,GAAA,IAAA,GAAA,CAAA,IAAA,IAAA,IAAA,GAAA,GAAA,GAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,UAAA;AACA,EAAA,CAAA,OAAA,UAAA,IAAA,QAAA,IAAA,WAAA,CAAA,UAAA,CAAA;AACA;AACA,GAAA,OAAA,MAAA,IAAA,QAAA,IAAA,WAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA,OAAA,IAAA,IAAA,QAAA,IAAA,WAAA,CAAA,IAAA,CAAA,CAAA;AACA,GAAA,OAAA,MAAA,IAAA,QAAA,IAAA,WAAA,CAAA,MAAA,CAAA,CAAA;AACA,EAAA,CAAA,YAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,GAAA;AACA,EAAA,GAAA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA,EAAA,OAAA,UAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,EAAA;AACA,EAAA,MAAA,GAAA,IAAA,GAAA,IAAA,UAAA,CAAA,EAAA;AACA,EAAA,MAAA,UAAA,IAAA,GAAA,CAAA,UAAA,GAAA,GAAA,CAAA,UAAA,IAAA,EAAA,CAAA,CAAA;AACA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,IAAA,CAAA,KAAA,UAAA,CAAA,IAAA,CAAA,GAAA,OAAA,EAAA,CAAA,CAAA;AACA,EAAA,OAAA,SAAA,CAAA;AACA;;;;;;"}import { isString } from './is.js';
import { logger } from './logger.js';

const BAGGAGE_HEADER_NAME = 'baggage';

const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';

const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;

/**
 * Max length of a serialized baggage string
 *
 * https://www.w3.org/TR/baggage/#limits
 */
const MAX_BAGGAGE_STRING_LENGTH = 8192;

/**
 * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values
 * from it.
 *
 * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.
 * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.
 */
function baggageHeaderToDynamicSamplingContext(
  // Very liberal definition of what any incoming header might look like
  baggageHeader,
) {
  if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {
    return undefined;
  }

  // Intermediary object to store baggage key value pairs of incoming baggage headers on.
  // It is later used to read Sentry-DSC-values from.
  let baggageObject = {};

  if (Array.isArray(baggageHeader)) {
    // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it
    baggageObject = baggageHeader.reduce((acc, curr) => {
      const currBaggageObject = baggageHeaderToObject(curr);
      return {
        ...acc,
        ...currBaggageObject,
      };
    }, {});
  } else {
    // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but
    // this is how we choose to handle it)
    if (!baggageHeader) {
      return undefined;
    }

    baggageObject = baggageHeaderToObject(baggageHeader);
  }

  // Read all "sentry-" prefixed values out of the baggage object and put it onto a dynamic sampling context object.
  const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => {
    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {
      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);
      acc[nonPrefixedKey] = value;
    }
    return acc;
  }, {});

  // Only return a dynamic sampling context object if there are keys in it.
  // A keyless object means there were no sentry values on the header, which means that there is no DSC.
  if (Object.keys(dynamicSamplingContext).length > 0) {
    return dynamicSamplingContext ;
  } else {
    return undefined;
  }
}

/**
 * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-".
 *
 * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility
 * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is
 * `undefined` the function will return `undefined`.
 * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`
 * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.
 */
function dynamicSamplingContextToSentryBaggageHeader(
  // this also takes undefined for convenience and bundle size in other places
  dynamicSamplingContext,
) {
  // Prefix all DSC keys with "sentry-" and put them into a new object
  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
    (acc, [dscKey, dscValue]) => {
      if (dscValue) {
        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;
      }
      return acc;
    },
    {},
  );

  return objectToBaggageHeader(sentryPrefixedDSC);
}

/**
 * Will parse a baggage header, which is a simple key-value map, into a flat object.
 *
 * @param baggageHeader The baggage header to parse.
 * @returns a flat object containing all the key-value pairs from `baggageHeader`.
 */
function baggageHeaderToObject(baggageHeader) {
  return baggageHeader
    .split(',')
    .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))
    .reduce((acc, [key, value]) => {
      acc[key] = value;
      return acc;
    }, {});
}

/**
 * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.
 *
 * @param object The object to turn into a baggage header.
 * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header
 * is not spec compliant.
 */
function objectToBaggageHeader(object) {
  if (Object.keys(object).length === 0) {
    // An empty baggage header is not spec compliant: We return undefined.
    return undefined;
  }

  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn(
          `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,
        );
      return baggageHeader;
    } else {
      return newBaggageHeader;
    }
  }, '');
}

export { BAGGAGE_HEADER_NAME, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader };
//# sourceMappingURL=baggage.js.map
{"version":3,"file":"baggage.js","sources":["../../src/baggage.ts"],"sourcesContent":["import type { DynamicSamplingContext } from '@sentry/types';\n\nimport { isString } from './is';\nimport { logger } from './logger';\n\nexport const BAGGAGE_HEADER_NAME = 'baggage';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX = 'sentry-';\n\nexport const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;\n\n/**\n * Max length of a serialized baggage string\n *\n * https://www.w3.org/TR/baggage/#limits\n */\nexport const MAX_BAGGAGE_STRING_LENGTH = 8192;\n\n/**\n * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the \"sentry-\" prefixed values\n * from it.\n *\n * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.\n * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.\n */\nexport function baggageHeaderToDynamicSamplingContext(\n  // Very liberal definition of what any incoming header might look like\n  baggageHeader: string | string[] | number | null | undefined | boolean,\n): Partial<DynamicSamplingContext> | undefined {\n  if (!isString(baggageHeader) && !Array.isArray(baggageHeader)) {\n    return undefined;\n  }\n\n  // Intermediary object to store baggage key value pairs of incoming baggage headers on.\n  // It is later used to read Sentry-DSC-values from.\n  let baggageObject: Readonly<Record<string, string>> = {};\n\n  if (Array.isArray(baggageHeader)) {\n    // Combine all baggage headers into one object containing the baggage values so we can later read the Sentry-DSC-values from it\n    baggageObject = baggageHeader.reduce<Record<string, string>>((acc, curr) => {\n      const currBaggageObject = baggageHeaderToObject(curr);\n      return {\n        ...acc,\n        ...currBaggageObject,\n      };\n    }, {});\n  } else {\n    // Return undefined if baggage header is an empty string (technically an empty baggage header is not spec conform but\n    // this is how we choose to handle it)\n    if (!baggageHeader) {\n      return undefined;\n    }\n\n    baggageObject = baggageHeaderToObject(baggageHeader);\n  }\n\n  // Read all \"sentry-\" prefixed values out of the baggage object and put it onto a dynamic sampling context object.\n  const dynamicSamplingContext = Object.entries(baggageObject).reduce<Record<string, string>>((acc, [key, value]) => {\n    if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {\n      const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);\n      acc[nonPrefixedKey] = value;\n    }\n    return acc;\n  }, {});\n\n  // Only return a dynamic sampling context object if there are keys in it.\n  // A keyless object means there were no sentry values on the header, which means that there is no DSC.\n  if (Object.keys(dynamicSamplingContext).length > 0) {\n    return dynamicSamplingContext as Partial<DynamicSamplingContext>;\n  } else {\n    return undefined;\n  }\n}\n\n/**\n * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with \"sentry-\".\n *\n * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility\n * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is\n * `undefined` the function will return `undefined`.\n * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`\n * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.\n */\nexport function dynamicSamplingContextToSentryBaggageHeader(\n  // this also takes undefined for convenience and bundle size in other places\n  dynamicSamplingContext: Partial<DynamicSamplingContext>,\n): string | undefined {\n  // Prefix all DSC keys with \"sentry-\" and put them into a new object\n  const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce<Record<string, string>>(\n    (acc, [dscKey, dscValue]) => {\n      if (dscValue) {\n        acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;\n      }\n      return acc;\n    },\n    {},\n  );\n\n  return objectToBaggageHeader(sentryPrefixedDSC);\n}\n\n/**\n * Will parse a baggage header, which is a simple key-value map, into a flat object.\n *\n * @param baggageHeader The baggage header to parse.\n * @returns a flat object containing all the key-value pairs from `baggageHeader`.\n */\nfunction baggageHeaderToObject(baggageHeader: string): Record<string, string> {\n  return baggageHeader\n    .split(',')\n    .map(baggageEntry => baggageEntry.split('=').map(keyOrValue => decodeURIComponent(keyOrValue.trim())))\n    .reduce<Record<string, string>>((acc, [key, value]) => {\n      acc[key] = value;\n      return acc;\n    }, {});\n}\n\n/**\n * Turns a flat object (key-value pairs) into a baggage header, which is also just key-value pairs.\n *\n * @param object The object to turn into a baggage header.\n * @returns a baggage header string, or `undefined` if the object didn't have any values, since an empty baggage header\n * is not spec compliant.\n */\nfunction objectToBaggageHeader(object: Record<string, string>): string | undefined {\n  if (Object.keys(object).length === 0) {\n    // An empty baggage header is not spec compliant: We return undefined.\n    return undefined;\n  }\n\n  return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {\n    const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;\n    const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;\n    if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {\n      __DEBUG_BUILD__ &&\n        logger.warn(\n          `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`,\n        );\n      return baggageHeader;\n    } else {\n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,EAAA,KAAA,CAAA,KAAA;AACA,MAAA,GAAA,CAAA,GAAA,CAAA,GAAA,KAAA,CAAA;AACA,MAAA,OAAA,GAAA,CAAA;AACA,KAAA,EAAA,EAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,MAAA,EAAA;AACA,EAAA,IAAA,MAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,MAAA,KAAA,CAAA,EAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,MAAA,CAAA,OAAA,CAAA,MAAA,CAAA,CAAA,MAAA,CAAA,CAAA,aAAA,EAAA,CAAA,SAAA,EAAA,WAAA,CAAA,EAAA,YAAA,KAAA;AACA,IAAA,MAAA,YAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAA,kBAAA,CAAA,WAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,gBAAA,GAAA,YAAA,KAAA,CAAA,GAAA,YAAA,GAAA,CAAA,EAAA,aAAA,CAAA,CAAA,EAAA,YAAA,CAAA,CAAA,CAAA;AACA,IAAA,IAAA,gBAAA,CAAA,MAAA,GAAA,yBAAA,EAAA;AACA,MAAA,CAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;AACA,QAAA,MAAA,CAAA,IAAA;AACA,UAAA,CAAA,gBAAA,EAAA,SAAA,CAAA,WAAA,EAAA,WAAA,CAAA,wDAAA,CAAA;AACA,SAAA,CAAA;AACA,MAAA,OAAA,aAAA,CAAA;AACA,KAAA,MAAA;AACA,MAAA,OAAA,gBAAA,CAAA;AACA,KAAA;AACA,GAAA,EAAA,EAAA,CAAA,CAAA;AACA;;;;"}import { isString } from './is.js';
import { getGlobalObject } from './worldwide.js';

// eslint-disable-next-line deprecation/deprecation
const WINDOW = getGlobalObject();

const DEFAULT_MAX_STRING_LENGTH = 80;

/**
 * Given a child DOM element, returns a query-selector statement describing that
 * and its ancestors
 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
 * @returns generated DOM path
 */
function htmlTreeAsString(
  elem,
  options = {},
) {

  // try/catch both:
  // - accessing event.target (see getsentry/raven-js#838, #768)
  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly
  // - can throw an exception in some circumstances.
  try {
    let currentElem = elem ;
    const MAX_TRAVERSE_HEIGHT = 5;
    const out = [];
    let height = 0;
    let len = 0;
    const separator = ' > ';
    const sepLength = separator.length;
    let nextStr;
    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;
    const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;

    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {
      nextStr = _htmlElementAsString(currentElem, keyAttrs);
      // bail out if
      // - nextStr is the 'html' element
      // - the length of the string that would be created exceeds maxStringLength
      //   (ignore this limit if we are on the first iteration)
      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {
        break;
      }

      out.push(nextStr);

      len += nextStr.length;
      currentElem = currentElem.parentNode;
    }

    return out.reverse().join(separator);
  } catch (_oO) {
    return '<unknown>';
  }
}

/**
 * Returns a simple, query-selector representation of a DOM element
 * e.g. [HTMLElement] => input#foo.btn[name=baz]
 * @returns generated DOM path
 */
function _htmlElementAsString(el, keyAttrs) {
  const elem = el

;

  const out = [];
  let className;
  let classes;
  let key;
  let attr;
  let i;

  if (!elem || !elem.tagName) {
    return '';
  }

  out.push(elem.tagName.toLowerCase());

  // Pairs of attribute keys defined in `serializeAttribute` and their values on element.
  const keyAttrPairs =
    keyAttrs && keyAttrs.length
      ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
      : null;

  if (keyAttrPairs && keyAttrPairs.length) {
    keyAttrPairs.forEach(keyAttrPair => {
      out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
    });
  } else {
    if (elem.id) {
      out.push(`#${elem.id}`);
    }

    // eslint-disable-next-line prefer-const
    className = elem.className;
    if (className && isString(className)) {
      classes = className.split(/\s+/);
      for (i = 0; i < classes.length; i++) {
        out.push(`.${classes[i]}`);
      }
    }
  }
  const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];
  for (i = 0; i < allowedAttrs.length; i++) {
    key = allowedAttrs[i];
    attr = elem.getAttribute(key);
    if (attr) {
      out.push(`[${key}="${attr}"]`);
    }
  }
  return out.join('');
}

/**
 * A safe form of location.href
 */
function getLocationHref() {
  try {
    return WINDOW.document.location.href;
  } catch (oO) {
    return '';
  }
}

/**
 * Gets a DOM element by using document.querySelector.
 *
 * This wrapper will first check for the existance of the function before
 * actually calling it so that we don't have to take care of this check,
 * every time we want to access the DOM.
 *
 * Reason: DOM/querySelector is not available in all environments.
 *
 * We have to cast to any because utils can be consumed by a variety of environments,
 * and we don't want to break TS users. If you know what element will be selected by
 * `document.querySelector`, specify it as part of the generic call. For example,
 * `const element = getDomElement<Element>('selector');`
 *
 * @param selector the selector string passed on to document.querySelector
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function getDomElement(selector) {
  if (WINDOW.document && WINDOW.document.querySelector) {
    return WINDOW.document.querySelector(selector) ;
  }
  return null;
}

export { getDomElement, getLocationHref, htmlTreeAsString };
//# sourceMappingURL=browser.js.map
{"version":3,"file":"browser.js","sources":["../../src/browser.ts"],"sourcesContent":["import { isString } from './is';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nexport function htmlTreeAsString(\n  elem: unknown,\n  options: string[] | { keyAttrs?: string[]; maxStringLength?: number } = {},\n): string {\n  type SimpleNode = {\n    parentNode: SimpleNode;\n  } | null;\n\n  // try/catch both:\n  // - accessing event.target (see getsentry/raven-js#838, #768)\n  // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n  // - can throw an exception in some circumstances.\n  try {\n    let currentElem = elem as SimpleNode;\n    const MAX_TRAVERSE_HEIGHT = 5;\n    const out = [];\n    let height = 0;\n    let len = 0;\n    const separator = ' > ';\n    const sepLength = separator.length;\n    let nextStr;\n    const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n    const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n    while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n      nextStr = _htmlElementAsString(currentElem, keyAttrs);\n      // bail out if\n      // - nextStr is the 'html' element\n      // - the length of the string that would be created exceeds maxStringLength\n      //   (ignore this limit if we are on the first iteration)\n      if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n        break;\n      }\n\n      out.push(nextStr);\n\n      len += nextStr.length;\n      currentElem = currentElem.parentNode;\n    }\n\n    return out.reverse().join(separator);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {\n  const elem = el as {\n    tagName?: string;\n    id?: string;\n    className?: string;\n    getAttribute(key: string): string;\n  };\n\n  const out = [];\n  let className;\n  let classes;\n  let key;\n  let attr;\n  let i;\n\n  if (!elem || !elem.tagName) {\n    return '';\n  }\n\n  out.push(elem.tagName.toLowerCase());\n\n  // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n  const keyAttrPairs =\n    keyAttrs && keyAttrs.length\n      ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n      : null;\n\n  if (keyAttrPairs && keyAttrPairs.length) {\n    keyAttrPairs.forEach(keyAttrPair => {\n      out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n    });\n  } else {\n    if (elem.id) {\n      out.push(`#${elem.id}`);\n    }\n\n    // eslint-disable-next-line prefer-const\n    className = elem.className;\n    if (className && isString(className)) {\n      classes = className.split(/\\s+/);\n      for (i = 0; i < classes.length; i++) {\n        out.push(`.${classes[i]}`);\n      }\n    }\n  }\n  const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n  for (i = 0; i < allowedAttrs.length; i++) {\n    key = allowedAttrs[i];\n    attr = elem.getAttribute(key);\n    if (attr) {\n      out.push(`[${key}=\"${attr}\"]`);\n    }\n  }\n  return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nexport function getLocationHref(): string {\n  try {\n    return WINDOW.document.location.href;\n  } catch (oO) {\n    return '';\n  }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement<Element>('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getDomElement<E = any>(selector: string): E | null {\n  if (WINDOW.document && WINDOW.document.querySelector) {\n    return WINDOW.document.querySelector(selector) as unknown as E;\n  }\n  return null;\n}\n"],"names":[],"mappings":";;;AAGA;AACA,MAAA,MAAA,GAAA,eAAA,EAAA,CAAA;AACA;AACA,MAAA,yBAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA;AACA,EAAA,IAAA;AACA,EAAA,OAAA,GAAA,EAAA;AACA,EAAA;;AAKA;AACA;AACA;AAC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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA,MAAA,CAAA,QAAA,IAAA,MAAA,CAAA,QAAA,CAAA,aAAA,EAAA;AACA,IAAA,OAAA,MAAA,CAAA,QAAA,CAAA,aAAA,CAAA,QAAA,CAAA,EAAA;AACA,GAAA;AACA,EAAA,OAAA,IAAA,CAAA;AACA;;;;"}import { _nullishCoalesce } from './_nullishCoalesce.js';

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the
 * result of an async operation.
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
async function _asyncNullishCoalesce(lhs, rhsFn) {
  return _nullishCoalesce(lhs, rhsFn);
}

// Sucrase version:
// async function _asyncNullishCoalesce(lhs, rhsFn) {
//   if (lhs != null) {
//     return lhs;
//   } else {
//     return await rhsFn();
//   }
// }

export { _asyncNullishCoalesce };
//# sourceMappingURL=_asyncNullishCoalesce.js.map
{"version":3,"file":"_asyncNullishCoalesce.js","sources":["../../../src/buildPolyfills/_asyncNullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _nullishCoalesce } from './_nullishCoalesce';\n\n/**\n * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the\n * result of an async operation.\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport async function _asyncNullishCoalesce(lhs: unknown, rhsFn: () => unknown): Promise<unknown> {\n  return _nullishCoalesce(lhs, rhsFn);\n}\n\n// Sucrase version:\n// async function _asyncNullishCoalesce(lhs, rhsFn) {\n//   if (lhs != null) {\n//     return lhs;\n//   } else {\n//     return await rhsFn();\n//   }\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,qBAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA,EAAA,OAAA,gBAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, for situations in which at least one part of the expression is async.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
async function _asyncOptionalChain(ops) {
  let lastAccessLHS = undefined;
  let value = ops[0];
  let i = 1;
  while (i < ops.length) {
    const op = ops[i] ;
    const fn = ops[i + 1] ;
    i += 2;
    // by checking for loose equality to `null`, we catch both `null` and `undefined`
    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
      return;
    }
    if (op === 'access' || op === 'optionalAccess') {
      lastAccessLHS = value;
      value = await fn(value);
    } else if (op === 'call' || op === 'optionalCall') {
      value = await fn((...args) => (value ).call(lastAccessLHS, ...args));
      lastAccessLHS = undefined;
    }
  }
  return value;
}

// Sucrase version:
// async function _asyncOptionalChain(ops) {
//   let lastAccessLHS = undefined;
//   let value = ops[0];
//   let i = 1;
//   while (i < ops.length) {
//     const op = ops[i];
//     const fn = ops[i + 1];
//     i += 2;
//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
//       return undefined;
//     }
//     if (op === 'access' || op === 'optionalAccess') {
//       lastAccessLHS = value;
//       value = await fn(value);
//     } else if (op === 'call' || op === 'optionalCall') {
//       value = await fn((...args) => value.call(lastAccessLHS, ...args));
//       lastAccessLHS = undefined;
//     }
//   }
//   return value;
// }

export { _asyncOptionalChain };
//# sourceMappingURL=_asyncOptionalChain.js.map
{"version":3,"file":"_asyncOptionalChain.js","sources":["../../../src/buildPolyfills/_asyncOptionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, for situations in which at least one part of the expression is async.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport async function _asyncOptionalChain(ops: unknown[]): Promise<unknown> {\n  let lastAccessLHS: unknown = undefined;\n  let value = ops[0];\n  let i = 1;\n  while (i < ops.length) {\n    const op = ops[i] as string;\n    const fn = ops[i + 1] as (intermediateValue: unknown) => Promise<unknown>;\n    i += 2;\n    // by checking for loose equality to `null`, we catch both `null` and `undefined`\n    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n      return;\n    }\n    if (op === 'access' || op === 'optionalAccess') {\n      lastAccessLHS = value;\n      value = await fn(value);\n    } else if (op === 'call' || op === 'optionalCall') {\n      value = await fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n      lastAccessLHS = undefined;\n    }\n  }\n  return value;\n}\n\n// Sucrase version:\n// async function _asyncOptionalChain(ops) {\n//   let lastAccessLHS = undefined;\n//   let value = ops[0];\n//   let i = 1;\n//   while (i < ops.length) {\n//     const op = ops[i];\n//     const fn = ops[i + 1];\n//     i += 2;\n//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n//       return undefined;\n//     }\n//     if (op === 'access' || op === 'optionalAccess') {\n//       lastAccessLHS = value;\n//       value = await fn(value);\n//     } else if (op === 'call' || op === 'optionalCall') {\n//       value = await fn((...args) => value.call(lastAccessLHS, ...args));\n//       lastAccessLHS = undefined;\n//     }\n//   }\n//   return value;\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,mBAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,aAAA,GAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,GAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,EAAA,KAAA,gBAAA,IAAA,EAAA,KAAA,cAAA,KAAA,KAAA,IAAA,IAAA,EAAA;AACA;AACA,MAAA,OAAA;AACA,KAAA;AACA,IAAA,IAAA,EAAA,KAAA,QAAA,IAAA,EAAA,KAAA,gBAAA,EAAA;AACA,MAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAAA,KAAA,GAAA,MAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,EAAA,KAAA,MAAA,IAAA,EAAA,KAAA,cAAA,EAAA;AACA,MAAA,KAAA,GAAA,MAAA,EAAA,CAAA,CAAA,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,IAAA,CAAA,aAAA,EAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA,MAAA,aAAA,GAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}import { _asyncOptionalChain } from './_asyncOptionalChain.js';

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
async function _asyncOptionalChainDelete(ops) {
  const result = (await _asyncOptionalChain(ops)) ;
  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
  // which case we return whatever the `delete` returned, which will be a boolean.
  return result == null ? true : (result );
}

// Sucrase version:
// async function asyncOptionalChainDelete(ops) {
//   const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
//   return result == null ? true : result;
// }

export { _asyncOptionalChainDelete };
//# sourceMappingURL=_asyncOptionalChainDelete.js.map
{"version":3,"file":"_asyncOptionalChainDelete.js","sources":["../../../src/buildPolyfills/_asyncOptionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _asyncOptionalChain } from './_asyncOptionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport async function _asyncOptionalChainDelete(ops: unknown[]): Promise<boolean> {\n  const result = (await _asyncOptionalChain(ops)) as Promise<boolean | null>;\n  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n  // which case we return whatever the `delete` returned, which will be a boolean.\n  return result == null ? true : (result as Promise<boolean>);\n}\n\n// Sucrase version:\n// async function asyncOptionalChainDelete(ops) {\n//   const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);\n//   return result == null ? true : result;\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAA,yBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,MAAA,IAAA,MAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,MAAA,IAAA,IAAA,GAAA,IAAA,IAAA,MAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Copy a property from the given object into `exports`, under the given name.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the property to copy.
 * @param localName The name under which to export the property
 * @param importedName The name under which the property lives in `obj`
 */
function _createNamedExportFrom(obj, localName, importedName) {
  exports[localName] = obj[importedName];
}

// Sucrase version:
// function _createNamedExportFrom(obj, localName, importedName) {
//   Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]});
// }

export { _createNamedExportFrom };
//# sourceMappingURL=_createNamedExportFrom.js.map
{"version":3,"file":"_createNamedExportFrom.js","sources":["../../../src/buildPolyfills/_createNamedExportFrom.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericObject } from './types';\n\ndeclare const exports: GenericObject;\n\n/**\n * Copy a property from the given object into `exports`, under the given name.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param obj The object containing the property to copy.\n * @param localName The name under which to export the property\n * @param importedName The name under which the property lives in `obj`\n */\nexport function _createNamedExportFrom(obj: GenericObject, localName: string, importedName: string): void {\n  exports[localName] = obj[importedName];\n}\n\n// Sucrase version:\n// function _createNamedExportFrom(obj, localName, importedName) {\n//   Object.defineProperty(exports, localName, {enumerable: true, get: () => obj[importedName]});\n// }\n"],"names":[],"mappings":"AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,GAAA,EAAA,SAAA,EAAA,YAAA,EAAA;AACA,EAAA,OAAA,CAAA,SAAA,CAAA,GAAA,GAAA,CAAA,YAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Copy properties from an object into `exports`.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the properties to copy.
 */
function _createStarExport(obj) {
  Object.keys(obj)
    .filter(key => key !== 'default' && key !== '__esModule' && !(key in exports))
    .forEach(key => (exports[key] = obj[key]));
}

// Sucrase version:
// function _createStarExport(obj) {
//   Object.keys(obj)
//     .filter(key => key !== 'default' && key !== '__esModule')
//     .forEach(key => {
//       if (exports.hasOwnProperty(key)) {
//         return;
//       }
//       Object.defineProperty(exports, key, { enumerable: true, get: () => obj[key] });
//     });
// }

export { _createStarExport };
//# sourceMappingURL=_createStarExport.js.map
{"version":3,"file":"_createStarExport.js","sources":["../../../src/buildPolyfills/_createStarExport.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericObject } from './types';\n\ndeclare const exports: GenericObject;\n\n/**\n * Copy properties from an object into `exports`.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param obj The object containing the properties to copy.\n */\nexport function _createStarExport(obj: GenericObject): void {\n  Object.keys(obj)\n    .filter(key => key !== 'default' && key !== '__esModule' && !(key in exports))\n    .forEach(key => (exports[key] = obj[key]));\n}\n\n// Sucrase version:\n// function _createStarExport(obj) {\n//   Object.keys(obj)\n//     .filter(key => key !== 'default' && key !== '__esModule')\n//     .forEach(key => {\n//       if (exports.hasOwnProperty(key)) {\n//         return;\n//       }\n//       Object.defineProperty(exports, key, { enumerable: true, get: () => obj[key] });\n//     });\n// }\n"],"names":[],"mappings":"AA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,KAAA,MAAA,CAAA,GAAA,IAAA,GAAA,KAAA,SAAA,IAAA,GAAA,KAAA,YAAA,IAAA,EAAA,GAAA,IAAA,OAAA,CAAA,CAAA;AACA,KAAA,OAAA,CAAA,GAAA,KAAA,OAAA,CAAA,GAAA,CAAA,GAAA,GAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Unwraps a module if it has been wrapped in an object under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns The full module, unwrapped if necessary.
 */
function _interopDefault(requireResult) {
  return requireResult.__esModule ? (requireResult.default ) : requireResult;
}

// Rollup version:
// function _interopDefault(e) {
//   return e && e.__esModule ? e['default'] : e;
// }

export { _interopDefault };
//# sourceMappingURL=_interopDefault.js.map
{"version":3,"file":"_interopDefault.js","sources":["../../../src/buildPolyfills/_interopDefault.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Unwraps a module if it has been wrapped in an object under the key `default`.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns The full module, unwrapped if necessary.\n */\nexport function _interopDefault(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? (requireResult.default as RequireResult) : requireResult;\n}\n\n// Rollup version:\n// function _interopDefault(e) {\n//   return e && e.__esModule ? e['default'] : e;\n// }\n"],"names":[],"mappings":"AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,IAAA,aAAA,CAAA,OAAA,KAAA,aAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
function _interopNamespace(requireResult) {
  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };
}

// Rollup version (with `output.externalLiveBindings` and `output.freeze` both set to false)
// function _interopNamespace(e) {
//   if (e && e.__esModule) return e;
//   var n = Object.create(null);
//   if (e) {
//     for (var k in e) {
//       n[k] = e[k];
//     }
//   }
//   n["default"] = e;
//   return n;
// }

export { _interopNamespace };
//# sourceMappingURL=_interopNamespace.js.map
{"version":3,"file":"_interopNamespace.js","sources":["../../../src/buildPolyfills/_interopNamespace.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property\n */\nexport function _interopNamespace(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };\n}\n\n// Rollup version (with `output.externalLiveBindings` and `output.freeze` both set to false)\n// function _interopNamespace(e) {\n//   if (e && e.__esModule) return e;\n//   var n = Object.create(null);\n//   if (e) {\n//     for (var k in e) {\n//       n[k] = e[k];\n//     }\n//   }\n//   n[\"default\"] = e;\n//   return n;\n// }\n"],"names":[],"mappings":"AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,GAAA,aAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Wrap a module in an object, as the value under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns An object containing the key-value pair (`default`, `requireResult`)
 */
function _interopNamespaceDefaultOnly(requireResult) {
  return {
    __proto__: null,
    default: requireResult,
  };
}

// Rollup version
// function _interopNamespaceDefaultOnly(e) {
//   return {
//     __proto__: null,
//     'default': e
//   };
// }

export { _interopNamespaceDefaultOnly };
//# sourceMappingURL=_interopNamespaceDefaultOnly.js.map
{"version":3,"file":"_interopNamespaceDefaultOnly.js","sources":["../../../src/buildPolyfills/_interopNamespaceDefaultOnly.ts"],"sourcesContent":["// https://github.com/rollup/rollup/tree/c2cda424e69686671ba010d628c0f70c43a563f8\n// The MIT License (MIT)\n//\n// Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions\n// of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT\n// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\n// OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Wrap a module in an object, as the value under the key `default`.\n *\n * Adapted from Rollup (https://github.com/rollup/rollup)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns An object containing the key-value pair (`default`, `requireResult`)\n */\nexport function _interopNamespaceDefaultOnly(requireResult: RequireResult): RequireResult {\n  return {\n    __proto__: null,\n    default: requireResult,\n  };\n}\n\n// Rollup version\n// function _interopNamespaceDefaultOnly(e) {\n//   return {\n//     __proto__: null,\n//     'default': e\n//   };\n// }\n"],"names":[],"mappings":"AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA;AACA,IAAA,SAAA,EAAA,IAAA;AACA,IAAA,OAAA,EAAA,aAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default`
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default`
 */
function _interopRequireDefault(requireResult) {
  return requireResult.__esModule ? requireResult : { default: requireResult };
}

// Sucrase version
// function _interopRequireDefault(obj) {
//   return obj && obj.__esModule ? obj : { default: obj };
// }

export { _interopRequireDefault };
//# sourceMappingURL=_interopRequireDefault.js.map
{"version":3,"file":"_interopRequireDefault.js","sources":["../../../src/buildPolyfills/_interopRequireDefault.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default`\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default`\n */\nexport function _interopRequireDefault(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { default: requireResult };\n}\n\n// Sucrase version\n// function _interopRequireDefault(obj) {\n//   return obj && obj.__esModule ? obj : { default: obj };\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
function _interopRequireWildcard(requireResult) {
  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };
}

// Sucrase version
// function _interopRequireWildcard(obj) {
//   if (obj && obj.__esModule) {
//     return obj;
//   } else {
//     var newObj = {};
//     if (obj != null) {
//       for (var key in obj) {
//         if (Object.prototype.hasOwnProperty.call(obj, key)) {
//           newObj[key] = obj[key];
//         }
//       }
//     }
//     newObj.default = obj;
//     return newObj;
//   }
// }

export { _interopRequireWildcard };
//# sourceMappingURL=_interopRequireWildcard.js.map
{"version":3,"file":"_interopRequireWildcard.js","sources":["../../../src/buildPolyfills/_interopRequireWildcard.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { RequireResult } from './types';\n\n/**\n * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param requireResult The result of calling `require` on a module\n * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property\n */\nexport function _interopRequireWildcard(requireResult: RequireResult): RequireResult {\n  return requireResult.__esModule ? requireResult : { ...requireResult, default: requireResult };\n}\n\n// Sucrase version\n// function _interopRequireWildcard(obj) {\n//   if (obj && obj.__esModule) {\n//     return obj;\n//   } else {\n//     var newObj = {};\n//     if (obj != null) {\n//       for (var key in obj) {\n//         if (Object.prototype.hasOwnProperty.call(obj, key)) {\n//           newObj[key] = obj[key];\n//         }\n//       }\n//     }\n//     newObj.default = obj;\n//     return newObj;\n//   }\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,aAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,UAAA,GAAA,aAAA,GAAA,EAAA,GAAA,aAAA,EAAA,OAAA,EAAA,aAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
//
// The MIT License (MIT)
//
// Copyright (c) 2012-2018 various contributors (see AUTHORS)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

/**
 * Polyfill for the nullish coalescing operator (`??`).
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
function _nullishCoalesce(lhs, rhsFn) {
  // by checking for loose equality to `null`, we catch both `null` and `undefined`
  return lhs != null ? lhs : rhsFn();
}

// Sucrase version:
// function _nullishCoalesce(lhs, rhsFn) {
//   if (lhs != null) {
//     return lhs;
//   } else {
//     return rhsFn();
//   }
// }

export { _nullishCoalesce };
//# sourceMappingURL=_nullishCoalesce.js.map
{"version":3,"file":"_nullishCoalesce.js","sources":["../../../src/buildPolyfills/_nullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport function _nullishCoalesce(lhs: unknown, rhsFn: () => unknown): unknown {\n  // by checking for loose equality to `null`, we catch both `null` and `undefined`\n  return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n//   if (lhs != null) {\n//     return lhs;\n//   } else {\n//     return rhsFn();\n//   }\n// }\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,GAAA,EAAA,KAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,IAAA,IAAA,GAAA,GAAA,GAAA,KAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
function _optionalChain(ops) {
  let lastAccessLHS = undefined;
  let value = ops[0];
  let i = 1;
  while (i < ops.length) {
    const op = ops[i] ;
    const fn = ops[i + 1] ;
    i += 2;
    // by checking for loose equality to `null`, we catch both `null` and `undefined`
    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
      return;
    }
    if (op === 'access' || op === 'optionalAccess') {
      lastAccessLHS = value;
      value = fn(value);
    } else if (op === 'call' || op === 'optionalCall') {
      value = fn((...args) => (value ).call(lastAccessLHS, ...args));
      lastAccessLHS = undefined;
    }
  }
  return value;
}

// Sucrase version
// function _optionalChain(ops) {
//   let lastAccessLHS = undefined;
//   let value = ops[0];
//   let i = 1;
//   while (i < ops.length) {
//     const op = ops[i];
//     const fn = ops[i + 1];
//     i += 2;
//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
//       return undefined;
//     }
//     if (op === 'access' || op === 'optionalAccess') {
//       lastAccessLHS = value;
//       value = fn(value);
//     } else if (op === 'call' || op === 'optionalCall') {
//       value = fn((...args) => value.call(lastAccessLHS, ...args));
//       lastAccessLHS = undefined;
//     }
//   }
//   return value;
// }

export { _optionalChain };
//# sourceMappingURL=_optionalChain.js.map
{"version":3,"file":"_optionalChain.js","sources":["../../../src/buildPolyfills/_optionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport function _optionalChain(ops: unknown[]): unknown {\n  let lastAccessLHS: unknown = undefined;\n  let value = ops[0];\n  let i = 1;\n  while (i < ops.length) {\n    const op = ops[i] as string;\n    const fn = ops[i + 1] as (intermediateValue: unknown) => unknown;\n    i += 2;\n    // by checking for loose equality to `null`, we catch both `null` and `undefined`\n    if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n      // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n      return;\n    }\n    if (op === 'access' || op === 'optionalAccess') {\n      lastAccessLHS = value;\n      value = fn(value);\n    } else if (op === 'call' || op === 'optionalCall') {\n      value = fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n      lastAccessLHS = undefined;\n    }\n  }\n  return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n//   let lastAccessLHS = undefined;\n//   let value = ops[0];\n//   let i = 1;\n//   while (i < ops.length) {\n//     const op = ops[i];\n//     const fn = ops[i + 1];\n//     i += 2;\n//     if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n//       return undefined;\n//     }\n//     if (op === 'access' || op === 'optionalAccess') {\n//       lastAccessLHS = value;\n//       value = fn(value);\n//     } else if (op === 'call' || op === 'optionalCall') {\n//       value = fn((...args) => value.call(lastAccessLHS, ...args));\n//       lastAccessLHS = undefined;\n//     }\n//   }\n//   return value;\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,aAAA,GAAA,SAAA,CAAA;AACA,EAAA,IAAA,KAAA,GAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,OAAA,CAAA,GAAA,GAAA,CAAA,MAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,CAAA,EAAA;AACA,IAAA,MAAA,EAAA,GAAA,GAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAA;AACA,IAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,CAAA,EAAA,KAAA,gBAAA,IAAA,EAAA,KAAA,cAAA,KAAA,KAAA,IAAA,IAAA,EAAA;AACA;AACA,MAAA,OAAA;AACA,KAAA;AACA,IAAA,IAAA,EAAA,KAAA,QAAA,IAAA,EAAA,KAAA,gBAAA,EAAA;AACA,MAAA,aAAA,GAAA,KAAA,CAAA;AACA,MAAA,KAAA,GAAA,EAAA,CAAA,KAAA,CAAA,CAAA;AACA,KAAA,MAAA,IAAA,EAAA,KAAA,MAAA,IAAA,EAAA,KAAA,cAAA,EAAA;AACA,MAAA,KAAA,GAAA,EAAA,CAAA,CAAA,GAAA,IAAA,KAAA,CAAA,KAAA,GAAA,IAAA,CAAA,aAAA,EAAA,GAAA,IAAA,CAAA,CAAA,CAAA;AACA,MAAA,aAAA,GAAA,SAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}import { _optionalChain } from './_optionalChain.js';

// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f

/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
function _optionalChainDelete(ops) {
  const result = _optionalChain(ops) ;
  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
  // which case we return whatever the `delete` returned, which will be a boolean.
  return result == null ? true : result;
}

// Sucrase version:
// function _optionalChainDelete(ops) {
//   const result = _optionalChain(ops);
//   // by checking for loose equality to `null`, we catch both `null` and `undefined`
//   return result == null ? true : result;
// }

export { _optionalChainDelete };
//# sourceMappingURL=_optionalChainDelete.js.map
{"version":3,"file":"_optionalChainDelete.js","sources":["../../../src/buildPolyfills/_optionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _optionalChain } from './_optionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport function _optionalChainDelete(ops: unknown[]): boolean {\n  const result = _optionalChain(ops) as boolean | null;\n  // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n  // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n  // which case we return whatever the `delete` returned, which will be a boolean.\n  return result == null ? true : result;\n}\n\n// Sucrase version:\n// function _optionalChainDelete(ops) {\n//   const result = _optionalChain(ops);\n//   // by checking for loose equality to `null`, we catch both `null` and `undefined`\n//   return result == null ? true : result;\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,cAAA,CAAA,GAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,MAAA,IAAA,IAAA,GAAA,IAAA,GAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}export { _asyncNullishCoalesce } from './_asyncNullishCoalesce.js';
export { _asyncOptionalChain } from './_asyncOptionalChain.js';
export { _asyncOptionalChainDelete } from './_asyncOptionalChainDelete.js';
export { _createNamedExportFrom } from './_createNamedExportFrom.js';
export { _createStarExport } from './_createStarExport.js';
export { _interopDefault } from './_interopDefault.js';
export { _interopNamespace } from './_interopNamespace.js';
export { _interopNamespaceDefaultOnly } from './_interopNamespaceDefaultOnly.js';
export { _interopRequireDefault } from './_interopRequireDefault.js';
export { _interopRequireWildcard } from './_interopRequireWildcard.js';
export { _nullishCoalesce } from './_nullishCoalesce.js';
export { _optionalChain } from './_optionalChain.js';
export { _optionalChainDelete } from './_optionalChainDelete.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}## Build Polyfills

This is a collection of syntax and import/export polyfills either copied directly from or heavily inspired by those used by [Rollup](https://github.com/rollup/rollup) and [Sucrase](https://github.com/alangpierce/sucrase). When either tool uses one of these polyfills during a build, it injects the function source code into each file needing the function, which can lead to a great deal of duplication. For our builds, we have therefore implemented something similar to [`tsc`'s `importHelpers` behavior](https://www.typescriptlang.org/tsconfig#importHelpers): Instead of leaving the polyfills injected in multiple places, we instead replace each injected function with an `import` or `require` statement, pulling from the CJS or ESM builds as appropriate. (In other words, the injected `import` statements import from `@sentry/utils/esm/buildPolyfills` and the injected `require` statements pull from `@sentry/utils/cjs/buildPolyfills/`. Because these functions should never be part of the public API, they're not exported from the package directly.)

Note that not all polyfills are currently used by the SDK, but all are included here for future compatitibility, should they ever be needed. Also, since we're never going to be calling these directly from within another TS file, their types are fairly generic. In some cases testing required more specific types, which can be found in the test files.

--------

_Code from both Rollup and Sucrase is used under the MIT license, copyright 2017 and 2012-2018, respectively._

_Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:_

_The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software._

_THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE._
import { createEnvelope } from './envelope.js';
import { dateTimestampInSeconds } from './time.js';

/**
 * Creates client report envelope
 * @param discarded_events An array of discard events
 * @param dsn A DSN that can be set on the header. Optional.
 */
function createClientReportEnvelope(
  discarded_events,
  dsn,
  timestamp,
) {
  const clientReportItem = [
    { type: 'client_report' },
    {
      timestamp: timestamp || dateTimestampInSeconds(),
      discarded_events,
    },
  ];
  return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
}

export { createClientReportEnvelope };
//# sourceMappingURL=clientreport.js.map
{"version":3,"file":"clientreport.js","sources":["../../src/clientreport.ts"],"sourcesContent":["import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '@sentry/types';\n\nimport { createEnvelope } from './envelope';\nimport { dateTimestampInSeconds } from './time';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nexport function createClientReportEnvelope(\n  discarded_events: ClientReport['discarded_events'],\n  dsn?: string,\n  timestamp?: number,\n): ClientReportEnvelope {\n  const clientReportItem: ClientReportItem = [\n    { type: 'client_report' },\n    {\n      timestamp: timestamp || dateTimestampInSeconds(),\n      discarded_events,\n    },\n  ];\n  return createEnvelope<ClientReportEnvelope>(dsn ? { dsn } : {}, [clientReportItem]);\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,gBAAA;AACA,EAAA,GAAA;AACA,EAAA,SAAA;AACA,EAAA;AACA,EAAA,MAAA,gBAAA,GAAA;AACA,IAAA,EAAA,IAAA,EAAA,eAAA,EAAA;AACA,IAAA;AACA,MAAA,SAAA,EAAA,SAAA,IAAA,sBAAA,EAAA;AACA,MAAA,gBAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,OAAA,cAAA,CAAA,GAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA,EAAA,CAAA,gBAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { SentryError } from './error.js';

/** Regular expression used to parse a Dsn. */
const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;

function isValidProtocol(protocol) {
  return protocol === 'http' || protocol === 'https';
}

/**
 * Renders the string representation of this Dsn.
 *
 * By default, this will render the public representation without the password
 * component. To get the deprecated private representation, set `withPassword`
 * to true.
 *
 * @param withPassword When set to true, the password will be included.
 */
function dsnToString(dsn, withPassword = false) {
  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;
  return (
    `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +
    `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`
  );
}

/**
 * Parses a Dsn from a given string.
 *
 * @param str A Dsn as string
 * @returns Dsn as DsnComponents
 */
function dsnFromString(str) {
  const match = DSN_REGEX.exec(str);

  if (!match) {
    throw new SentryError(`Invalid Sentry Dsn: ${str}`);
  }

  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);
  let path = '';
  let projectId = lastPath;

  const split = projectId.split('/');
  if (split.length > 1) {
    path = split.slice(0, -1).join('/');
    projectId = split.pop() ;
  }

  if (projectId) {
    const projectMatch = projectId.match(/^\d+/);
    if (projectMatch) {
      projectId = projectMatch[0];
    }
  }

  return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });
}

function dsnFromComponents(components) {
  return {
    protocol: components.protocol,
    publicKey: components.publicKey || '',
    pass: components.pass || '',
    host: components.host,
    port: components.port || '',
    path: components.path || '',
    projectId: components.projectId,
  };
}

function validateDsn(dsn) {
  if (!(typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    return;
  }

  const { port, projectId, protocol } = dsn;

  const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
  requiredComponents.forEach(component => {
    if (!dsn[component]) {
      throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);
    }
  });

  if (!projectId.match(/^\d+$/)) {
    throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
  }

  if (!isValidProtocol(protocol)) {
    throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
  }

  if (port && isNaN(parseInt(port, 10))) {
    throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);
  }

  return true;
}

/** The Sentry Dsn, identifying a Sentry instance and project. */
function makeDsn(from) {
  const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);
  validateDsn(components);
  return components;
}

export { dsnFromString, dsnToString, makeDsn };
//# sourceMappingURL=dsn.js.map
{"version":3,"file":"dsn.js","sources":["../../src/dsn.ts"],"sourcesContent":["import type { DsnComponents, DsnLike, DsnProtocol } from '@sentry/types';\n\nimport { SentryError } from './error';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol?: string): protocol is DsnProtocol {\n  return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nexport function dsnToString(dsn: DsnComponents, withPassword: boolean = false): string {\n  const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n  return (\n    `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n    `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n  );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents\n */\nexport function dsnFromString(str: string): DsnComponents {\n  const match = DSN_REGEX.exec(str);\n\n  if (!match) {\n    throw new SentryError(`Invalid Sentry Dsn: ${str}`);\n  }\n\n  const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n  let path = '';\n  let projectId = lastPath;\n\n  const split = projectId.split('/');\n  if (split.length > 1) {\n    path = split.slice(0, -1).join('/');\n    projectId = split.pop() as string;\n  }\n\n  if (projectId) {\n    const projectMatch = projectId.match(/^\\d+/);\n    if (projectMatch) {\n      projectId = projectMatch[0];\n    }\n  }\n\n  return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol as DsnProtocol, publicKey });\n}\n\nfunction dsnFromComponents(components: DsnComponents): DsnComponents {\n  return {\n    protocol: components.protocol,\n    publicKey: components.publicKey || '',\n    pass: components.pass || '',\n    host: components.host,\n    port: components.port || '',\n    path: components.path || '',\n    projectId: components.projectId,\n  };\n}\n\nfunction validateDsn(dsn: DsnComponents): boolean | void {\n  if (!__DEBUG_BUILD__) {\n    return;\n  }\n\n  const { port, projectId, protocol } = dsn;\n\n  const requiredComponents: ReadonlyArray<keyof DsnComponents> = ['protocol', 'publicKey', 'host', 'projectId'];\n  requiredComponents.forEach(component => {\n    if (!dsn[component]) {\n      throw new SentryError(`Invalid Sentry Dsn: ${component} missing`);\n    }\n  });\n\n  if (!projectId.match(/^\\d+$/)) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n  }\n\n  if (!isValidProtocol(protocol)) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n  }\n\n  if (port && isNaN(parseInt(port, 10))) {\n    throw new SentryError(`Invalid Sentry Dsn: Invalid port ${port}`);\n  }\n\n  return true;\n}\n\n/** The Sentry Dsn, identifying a Sentry instance and project. */\nexport function makeDsn(from: DsnLike): DsnComponents {\n  const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n  validateDsn(components);\n  return components;\n}\n"],"names":[],"mappings":";;AAIA;AACA,MAAA,SAAA,GAAA,iEAAA,CAAA;AACA;AACA,SAAA,eAAA,CAAA,QAAA,EAAA;AACA,EAAA,OAAA,QAAA,KAAA,MAAA,IAAA,QAAA,KAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,GAAA,EAAA,YAAA,GAAA,KAAA,EAAA;AACA,EAAA,MAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,SAAA,EAAA,QAAA,EAAA,SAAA,EAAA,GAAA,GAAA,CAAA;AACA,EAAA;AACA,IAAA,CAAA,EAAA,QAAA,CAAA,GAAA,EAAA,SAAA,CAAA,EAAA,YAAA,IAAA,IAAA,GAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA;AACA,IAAA,CAAA,CAAA,EAAA,IAAA,CAAA,EAAA,IAAA,GAAA,CAAA,CAAA,EAAA,IAAA,CAAA,CAAA,GAAA,EAAA,CAAA,CAAA,EAAA,IAAA,GAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,SAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,EAAA;AACA,IAAA,MAAA,IAAA,WAAA,CAAA,CAAA,oBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,CAAA,QAAA,EAAA,SAAA,EAAA,IAAA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IAAA,KAAA,QAAA,GAAA,aAAA,CAAA,IAAA,CAAA,GAAA,iBAAA,CAAA,IAAA,CAAA,CAAA;AACA,EAAA,WAAA,CAAA,UAAA,CAAA,CAAA;AACA,EAAA,OAAA,UAAA,CAAA;AACA;;;;"}/*
 * This module exists for optimizations in the build process through rollup and terser.  We define some global
 * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these
 * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will
 * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to
 * `logger` and preventing node-related code from appearing in browser bundles.
 *
 * Attention:
 * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by
 * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)
 * having issues tree-shaking these constants across package boundaries.
 * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want
 * users to be able to shake away expressions that it guards.
 */

/**
 * Figures out if we're building a browser bundle.
 *
 * @returns true if this is a browser bundle build.
 */
function isBrowserBundle() {
  return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;
}

/**
 * Get source of SDK.
 */
function getSDKSource() {
  // @ts-ignore "npm" is injected by rollup during build process
  return "npm";
}

export { getSDKSource, isBrowserBundle };
//# sourceMappingURL=env.js.map
{"version":3,"file":"env.js","sources":["../../src/env.ts"],"sourcesContent":["/*\n * This module exists for optimizations in the build process through rollup and terser.  We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\ndeclare const __SENTRY_BROWSER_BUNDLE__: boolean | undefined;\n\nexport type SdkSource = 'npm' | 'cdn' | 'loader';\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nexport function isBrowserBundle(): boolean {\n  return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nexport function getSDKSource(): SdkSource {\n  // @ts-ignore __SENTRY_SDK_SOURCE__ is injected by rollup during build process\n  return __SENTRY_SDK_SOURCE__;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA,EAAA,OAAA,OAAA,yBAAA,KAAA,WAAA,IAAA,CAAA,CAAA,yBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA;;;;"}import { dsnToString } from './dsn.js';
import { normalize } from './normalize.js';
import { dropUndefinedKeys } from './object.js';

/**
 * Creates an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
function createEnvelope(headers, items = []) {
  return [headers, items] ;
}

/**
 * Add an item to an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
function addItemToEnvelope(envelope, newItem) {
  const [headers, items] = envelope;
  return [headers, [...items, newItem]] ;
}

/**
 * Convenience function to loop through the items and item types of an envelope.
 * (This function was mostly created because working with envelope types is painful at the moment)
 *
 * If the callback returns true, the rest of the items will be skipped.
 */
function forEachEnvelopeItem(
  envelope,
  callback,
) {
  const envelopeItems = envelope[1];

  for (const envelopeItem of envelopeItems) {
    const envelopeItemType = envelopeItem[0].type;
    const result = callback(envelopeItem, envelopeItemType);

    if (result) {
      return true;
    }
  }

  return false;
}

/**
 * Returns true if the envelope contains any of the given envelope item types
 */
function envelopeContainsItemType(envelope, types) {
  return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));
}

/**
 * Encode a string to UTF8.
 */
function encodeUTF8(input, textEncoder) {
  const utf8 = textEncoder || new TextEncoder();
  return utf8.encode(input);
}

/**
 * Serializes an envelope.
 */
function serializeEnvelope(envelope, textEncoder) {
  const [envHeaders, items] = envelope;

  // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data
  let parts = JSON.stringify(envHeaders);

  function append(next) {
    if (typeof parts === 'string') {
      parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];
    } else {
      parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);
    }
  }

  for (const item of items) {
    const [itemHeaders, payload] = item;

    append(`\n${JSON.stringify(itemHeaders)}\n`);

    if (typeof payload === 'string' || payload instanceof Uint8Array) {
      append(payload);
    } else {
      let stringifiedPayload;
      try {
        stringifiedPayload = JSON.stringify(payload);
      } catch (e) {
        // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still
        // fails, we try again after normalizing it again with infinite normalization depth. This of course has a
        // performance impact but in this case a performance hit is better than throwing.
        stringifiedPayload = JSON.stringify(normalize(payload));
      }
      append(stringifiedPayload);
    }
  }

  return typeof parts === 'string' ? parts : concatBuffers(parts);
}

function concatBuffers(buffers) {
  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);

  const merged = new Uint8Array(totalLength);
  let offset = 0;
  for (const buffer of buffers) {
    merged.set(buffer, offset);
    offset += buffer.length;
  }

  return merged;
}

/**
 * Parses an envelope
 */
function parseEnvelope(
  env,
  textEncoder,
  textDecoder,
) {
  let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;

  function readBinary(length) {
    const bin = buffer.subarray(0, length);
    // Replace the buffer with the remaining data excluding trailing newline
    buffer = buffer.subarray(length + 1);
    return bin;
  }

  function readJson() {
    let i = buffer.indexOf(0xa);
    // If we couldn't find a newline, we must have found the end of the buffer
    if (i < 0) {
      i = buffer.length;
    }

    return JSON.parse(textDecoder.decode(readBinary(i))) ;
  }

  const envelopeHeader = readJson();
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const items = [];

  while (buffer.length) {
    const itemHeader = readJson();
    const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;

    items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);
  }

  return [envelopeHeader, items];
}

/**
 * Creates attachment envelope items
 */
function createAttachmentEnvelopeItem(
  attachment,
  textEncoder,
) {
  const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;

  return [
    dropUndefinedKeys({
      type: 'attachment',
      length: buffer.length,
      filename: attachment.filename,
      content_type: attachment.contentType,
      attachment_type: attachment.attachmentType,
    }),
    buffer,
  ];
}

const ITEM_TYPE_TO_DATA_CATEGORY_MAP = {
  session: 'session',
  sessions: 'session',
  attachment: 'attachment',
  transaction: 'transaction',
  event: 'error',
  client_report: 'internal',
  user_report: 'default',
  profile: 'profile',
  replay_event: 'replay',
  replay_recording: 'replay',
  check_in: 'monitor',
};

/**
 * Maps the type of an envelope item to a data category.
 */
function envelopeItemTypeToDataCategory(type) {
  return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];
}

/** Extracts the minimal SDK info from from the metadata or an events */
function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {
  if (!metadataOrEvent || !metadataOrEvent.sdk) {
    return;
  }
  const { name, version } = metadataOrEvent.sdk;
  return { name, version };
}

/**
 * Creates event envelope headers, based on event, sdk info and tunnel
 * Note: This function was extracted from the core package to make it available in Replay
 */
function createEventEnvelopeHeaders(
  event,
  sdkInfo,
  tunnel,
  dsn,
) {
  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;
  return {
    event_id: event.event_id ,
    sent_at: new Date().toISOString(),
    ...(sdkInfo && { sdk: sdkInfo }),
    ...(!!tunnel && { dsn: dsnToString(dsn) }),
    ...(dynamicSamplingContext && {
      trace: dropUndefinedKeys({ ...dynamicSamplingContext }),
    }),
  };
}

export { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };
//# sourceMappingURL=envelope.js.map
{"version":3,"file":"envelope.js","sources":["../../src/envelope.ts"],"sourcesContent":["import type {\n  Attachment,\n  AttachmentItem,\n  BaseEnvelopeHeaders,\n  BaseEnvelopeItemHeaders,\n  DataCategory,\n  DsnComponents,\n  Envelope,\n  EnvelopeItemType,\n  Event,\n  EventEnvelopeHeaders,\n  SdkInfo,\n  SdkMetadata,\n  TextEncoderInternal,\n} from '@sentry/types';\n\nimport { dsnToString } from './dsn';\nimport { normalize } from './normalize';\nimport { dropUndefinedKeys } from './object';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function createEnvelope<E extends Envelope>(headers: E[0], items: E[1] = []): E {\n  return [headers, items] as E;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nexport function addItemToEnvelope<E extends Envelope>(envelope: E, newItem: E[1][number]): E {\n  const [headers, items] = envelope;\n  return [headers, [...items, newItem]] as E;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nexport function forEachEnvelopeItem<E extends Envelope>(\n  envelope: Envelope,\n  callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void,\n): boolean {\n  const envelopeItems = envelope[1];\n\n  for (const envelopeItem of envelopeItems) {\n    const envelopeItemType = envelopeItem[0].type;\n    const result = callback(envelopeItem, envelopeItemType);\n\n    if (result) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nexport function envelopeContainsItemType(envelope: Envelope, types: EnvelopeItemType[]): boolean {\n  return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input: string, textEncoder?: TextEncoderInternal): Uint8Array {\n  const utf8 = textEncoder || new TextEncoder();\n  return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nexport function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array {\n  const [envHeaders, items] = envelope;\n\n  // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n  let parts: string | Uint8Array[] = JSON.stringify(envHeaders);\n\n  function append(next: string | Uint8Array): void {\n    if (typeof parts === 'string') {\n      parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n    } else {\n      parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n    }\n  }\n\n  for (const item of items) {\n    const [itemHeaders, payload] = item;\n\n    append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n    if (typeof payload === 'string' || payload instanceof Uint8Array) {\n      append(payload);\n    } else {\n      let stringifiedPayload: string;\n      try {\n        stringifiedPayload = JSON.stringify(payload);\n      } catch (e) {\n        // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n        // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n        // performance impact but in this case a performance hit is better than throwing.\n        stringifiedPayload = JSON.stringify(normalize(payload));\n      }\n      append(stringifiedPayload);\n    }\n  }\n\n  return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers: Uint8Array[]): Uint8Array {\n  const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n  const merged = new Uint8Array(totalLength);\n  let offset = 0;\n  for (const buffer of buffers) {\n    merged.set(buffer, offset);\n    offset += buffer.length;\n  }\n\n  return merged;\n}\n\nexport interface TextDecoderInternal {\n  decode(input?: Uint8Array): string;\n}\n\n/**\n * Parses an envelope\n */\nexport function parseEnvelope(\n  env: string | Uint8Array,\n  textEncoder: TextEncoderInternal,\n  textDecoder: TextDecoderInternal,\n): Envelope {\n  let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n  function readBinary(length: number): Uint8Array {\n    const bin = buffer.subarray(0, length);\n    // Replace the buffer with the remaining data excluding trailing newline\n    buffer = buffer.subarray(length + 1);\n    return bin;\n  }\n\n  function readJson<T>(): T {\n    let i = buffer.indexOf(0xa);\n    // If we couldn't find a newline, we must have found the end of the buffer\n    if (i < 0) {\n      i = buffer.length;\n    }\n\n    return JSON.parse(textDecoder.decode(readBinary(i))) as T;\n  }\n\n  const envelopeHeader = readJson<BaseEnvelopeHeaders>();\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const items: [any, any][] = [];\n\n  while (buffer.length) {\n    const itemHeader = readJson<BaseEnvelopeItemHeaders>();\n    const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n    items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n  }\n\n  return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nexport function createAttachmentEnvelopeItem(\n  attachment: Attachment,\n  textEncoder?: TextEncoderInternal,\n): AttachmentItem {\n  const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n  return [\n    dropUndefinedKeys({\n      type: 'attachment',\n      length: buffer.length,\n      filename: attachment.filename,\n      content_type: attachment.contentType,\n      attachment_type: attachment.attachmentType,\n    }),\n    buffer,\n  ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP: Record<EnvelopeItemType, DataCategory> = {\n  session: 'session',\n  sessions: 'session',\n  attachment: 'attachment',\n  transaction: 'transaction',\n  event: 'error',\n  client_report: 'internal',\n  user_report: 'default',\n  profile: 'profile',\n  replay_event: 'replay',\n  replay_recording: 'replay',\n  check_in: 'monitor',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nexport function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory {\n  return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from from the metadata or an events */\nexport function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined {\n  if (!metadataOrEvent || !metadataOrEvent.sdk) {\n    return;\n  }\n  const { name, version } = metadataOrEvent.sdk;\n  return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nexport function createEventEnvelopeHeaders(\n  event: Event,\n  sdkInfo: SdkInfo | undefined,\n  tunnel: string | undefined,\n  dsn: DsnComponents,\n): EventEnvelopeHeaders {\n  const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n  return {\n    event_id: event.event_id as string,\n    sent_at: new Date().toISOString(),\n    ...(sdkInfo && { sdk: sdkInfo }),\n    ...(!!tunnel && { dsn: dsnToString(dsn) }),\n    ...(dynamicSamplingContext && {\n      trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n    }),\n  };\n}\n"],"names":[],"mappings":";;;;AAoBA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,OAAA,EAAA,KAAA,GAAA,EAAA,EAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,KAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,QAAA,EAAA,OAAA,EAAA;AACA,EAAA,MAAA,CAAA,OAAA,EAAA,KAAA,CAAA,GAAA,QAAA,CAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,CAAA,GAAA,KAAA,EAAA,OAAA,CAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA;AACA,EAAA,QAAA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,SAAA,8BAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,8BAAA,CAAA,IAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,+BAAA,CAAA,eAAA,EAAA;AACA,EAAA,IAAA,CAAA,eAAA,IAAA,CAAA,eAAA,CAAA,GAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA,EAAA,MAAA,EAAA,IAAA,EAAA,OAAA,EAAA,GAAA,eAAA,CAAA,GAAA,CAAA;AACA,EAAA,OAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,0BAAA;AACA,EAAA,KAAA;AACA,EAAA,OAAA;AACA,EAAA,MAAA;AACA,EAAA,GAAA;AACA,EAAA;AACA,EAAA,MAAA,sBAAA,GAAA,KAAA,CAAA,qBAAA,IAAA,KAAA,CAAA,qBAAA,CAAA,sBAAA,CAAA;AACA,EAAA,OAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,QAAA;AACA,IAAA,OAAA,EAAA,IAAA,IAAA,EAAA,CAAA,WAAA,EAAA;AACA,IAAA,IAAA,OAAA,IAAA,EAAA,GAAA,EAAA,OAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,CAAA,MAAA,IAAA,EAAA,GAAA,EAAA,WAAA,CAAA,GAAA,CAAA,EAAA,CAAA;AACA,IAAA,IAAA,sBAAA,IAAA;AACA,MAAA,KAAA,EAAA,iBAAA,CAAA,EAAA,GAAA,sBAAA,EAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}/** An error emitted by Sentry SDKs and related utilities. */
class SentryError extends Error {
  /** Display name of this error instance. */

   constructor( message, logLevel = 'warn') {
    super(message);this.message = message;
    this.name = new.target.prototype.constructor.name;
    // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line
    // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes
    // instances of `SentryError` fail `obj instanceof SentryError` checks.
    Object.setPrototypeOf(this, new.target.prototype);
    this.logLevel = logLevel;
  }
}

export { SentryError };
//# sourceMappingURL=error.js.map
{"version":3,"file":"error.js","sources":["../../src/error.ts"],"sourcesContent":["import type { ConsoleLevel } from './logger';\n\n/** An error emitted by Sentry SDKs and related utilities. */\nexport class SentryError extends Error {\n  /** Display name of this error instance. */\n  public name: string;\n\n  public logLevel: ConsoleLevel;\n\n  public constructor(public message: string, logLevel: ConsoleLevel = 'warn') {\n    super(message);\n\n    this.name = new.target.prototype.constructor.name;\n    // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n    // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n    // instances of `SentryError` fail `obj instanceof SentryError` checks.\n    Object.setPrototypeOf(this, new.target.prototype);\n    this.logLevel = logLevel;\n  }\n}\n"],"names":[],"mappings":"AAEA;AACA,MAAA,WAAA,SAAA,KAAA,CAAA;AACA;;AAKA,GAAA,WAAA,EAAA,OAAA,EAAA,QAAA,GAAA,MAAA,EAAA;AACA,IAAA,KAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,OAAA,GAAA,OAAA,CACA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,GAAA,CAAA,MAAA,CAAA,SAAA,CAAA,WAAA,CAAA,IAAA,CAAA;AACA;AACA;AACA;AACA,IAAA,MAAA,CAAA,cAAA,CAAA,IAAA,EAAA,GAAA,CAAA,MAAA,CAAA,SAAA,CAAA,CAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,GAAA;AACA;;;;"}export { getDomElement, getLocationHref, htmlTreeAsString } from './browser.js';
export { dsnFromString, dsnToString, makeDsn } from './dsn.js';
export { SentryError } from './error.js';
export { GLOBAL_OBJ, getGlobalObject, getGlobalSingleton } from './worldwide.js';
export { SENTRY_XHR_DATA_KEY, addInstrumentationHandler, parseFetchArgs } from './instrument.js';
export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable } from './is.js';
export { CONSOLE_LEVELS, consoleSandbox, logger } from './logger.js';
export { memoBuilder } from './memo.js';
export { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 } from './misc.js';
export { dynamicRequire, isNodeEnv, loadModule } from './node.js';
export { normalize, normalizeToSize, walk } from './normalize.js';
export { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, urlEncode } from './object.js';
export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve } from './path.js';
export { makePromiseBuffer } from './promisebuffer.js';
export { addRequestDataToEvent, addRequestDataToTransaction, extractPathForTransaction, extractRequestData } from './requestdata.js';
export { severityFromString, severityLevelFromString, validSeverityLevels } from './severity.js';
export { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse } from './stacktrace.js';
export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate } from './string.js';
export { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver } from './supports.js';
export { SyncPromise, rejectedSyncPromise, resolvedSyncPromise } from './syncpromise.js';
export { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds, timestampWithMs, usingPerformanceAPI } from './time.js';
export { TRACEPARENT_REGEXP, extractTraceparentData } from './tracing.js';
export { getSDKSource, isBrowserBundle } from './env.js';
export { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope } from './envelope.js';
export { createClientReportEnvelope } from './clientreport.js';
export { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits } from './ratelimit.js';
export { BAGGAGE_HEADER_NAME, MAX_BAGGAGE_STRING_LENGTH, SENTRY_BAGGAGE_KEY_PREFIX, SENTRY_BAGGAGE_KEY_PREFIX_REGEX, baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader } from './baggage.js';
export { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from './url.js';
export { addOrUpdateIntegration } from './userIntegrations.js';
export { escapeStringForRegex } from './vendor/escapeStringForRegex.js';
export { supportsHistory } from './vendor/supportsHistory.js';
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}import { isString } from './is.js';
import { logger, CONSOLE_LEVELS } from './logger.js';
import { fill } from './object.js';
import { getFunctionName } from './stacktrace.js';
import { supportsNativeFetch } from './supports.js';
import { getGlobalObject } from './worldwide.js';
import { supportsHistory } from './vendor/supportsHistory.js';

// eslint-disable-next-line deprecation/deprecation
const WINDOW = getGlobalObject();

const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__';

/**
 * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.
 *  - Console API
 *  - Fetch API
 *  - XHR API
 *  - History API
 *  - DOM API (click/typing)
 *  - Error API
 *  - UnhandledRejection API
 */

const handlers = {};
const instrumented = {};

/** Instruments given API */
function instrument(type) {
  if (instrumented[type]) {
    return;
  }

  instrumented[type] = true;

  switch (type) {
    case 'console':
      instrumentConsole();
      break;
    case 'dom':
      instrumentDOM();
      break;
    case 'xhr':
      instrumentXHR();
      break;
    case 'fetch':
      instrumentFetch();
      break;
    case 'history':
      instrumentHistory();
      break;
    case 'error':
      instrumentError();
      break;
    case 'unhandledrejection':
      instrumentUnhandledRejection();
      break;
    default:
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && logger.warn('unknown instrumentation type:', type);
      return;
  }
}

/**
 * Add handler that will be called when given type of instrumentation triggers.
 * Use at your own risk, this might break without changelog notice, only used internally.
 * @hidden
 */
function addInstrumentationHandler(type, callback) {
  handlers[type] = handlers[type] || [];
  (handlers[type] ).push(callback);
  instrument(type);
}

/** JSDoc */
function triggerHandlers(type, data) {
  if (!type || !handlers[type]) {
    return;
  }

  for (const handler of handlers[type] || []) {
    try {
      handler(data);
    } catch (e) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.error(
          `Error while triggering instrumentation handler.\nType: ${type}\nName: ${getFunctionName(handler)}\nError:`,
          e,
        );
    }
  }
}

/** JSDoc */
function instrumentConsole() {
  if (!('console' in WINDOW)) {
    return;
  }

  CONSOLE_LEVELS.forEach(function (level) {
    if (!(level in WINDOW.console)) {
      return;
    }

    fill(WINDOW.console, level, function (originalConsoleMethod) {
      return function (...args) {
        triggerHandlers('console', { args, level });

        // this fails for some browsers. :(
        if (originalConsoleMethod) {
          originalConsoleMethod.apply(WINDOW.console, args);
        }
      };
    });
  });
}

/** JSDoc */
function instrumentFetch() {
  if (!supportsNativeFetch()) {
    return;
  }

  fill(WINDOW, 'fetch', function (originalFetch) {
    return function (...args) {
      const { method, url } = parseFetchArgs(args);

      const handlerData = {
        args,
        fetchData: {
          method,
          url,
        },
        startTimestamp: Date.now(),
      };

      triggerHandlers('fetch', {
        ...handlerData,
      });

      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      return originalFetch.apply(WINDOW, args).then(
        (response) => {
          triggerHandlers('fetch', {
            ...handlerData,
            endTimestamp: Date.now(),
            response,
          });
          return response;
        },
        (error) => {
          triggerHandlers('fetch', {
            ...handlerData,
            endTimestamp: Date.now(),
            error,
          });
          // NOTE: If you are a Sentry user, and you are seeing this stack frame,
          //       it means the sentry.javascript SDK caught an error invoking your application code.
          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.
          throw error;
        },
      );
    };
  });
}

function hasProp(obj, prop) {
  return !!obj && typeof obj === 'object' && !!(obj )[prop];
}

function getUrlFromResource(resource) {
  if (typeof resource === 'string') {
    return resource;
  }

  if (!resource) {
    return '';
  }

  if (hasProp(resource, 'url')) {
    return resource.url;
  }

  if (resource.toString) {
    return resource.toString();
  }

  return '';
}

/**
 * Parses the fetch arguments to find the used Http method and the url of the request
 */
function parseFetchArgs(fetchArgs) {
  if (fetchArgs.length === 0) {
    return { method: 'GET', url: '' };
  }

  if (fetchArgs.length === 2) {
    const [url, options] = fetchArgs ;

    return {
      url: getUrlFromResource(url),
      method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',
    };
  }

  const arg = fetchArgs[0];
  return {
    url: getUrlFromResource(arg ),
    method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',
  };
}

/** JSDoc */
function instrumentXHR() {
  if (!('XMLHttpRequest' in WINDOW)) {
    return;
  }

  const xhrproto = XMLHttpRequest.prototype;

  fill(xhrproto, 'open', function (originalOpen) {
    return function ( ...args) {
      const url = args[1];
      const xhrInfo = (this[SENTRY_XHR_DATA_KEY] = {
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        method: isString(args[0]) ? args[0].toUpperCase() : args[0],
        url: args[1],
        request_headers: {},
      });

      // if Sentry key appears in URL, don't capture it as a request
      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {
        this.__sentry_own_request__ = true;
      }

      const onreadystatechangeHandler = () => {
        // For whatever reason, this is not the same instance here as from the outer method
        const xhrInfo = this[SENTRY_XHR_DATA_KEY];

        if (!xhrInfo) {
          return;
        }

        if (this.readyState === 4) {
          try {
            // touching statusCode in some platforms throws
            // an exception
            xhrInfo.status_code = this.status;
          } catch (e) {
            /* do nothing */
          }

          triggerHandlers('xhr', {
            args: args ,
            endTimestamp: Date.now(),
            startTimestamp: Date.now(),
            xhr: this,
          } );
        }
      };

      if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {
        fill(this, 'onreadystatechange', function (original) {
          return function ( ...readyStateArgs) {
            onreadystatechangeHandler();
            return original.apply(this, readyStateArgs);
          };
        });
      } else {
        this.addEventListener('readystatechange', onreadystatechangeHandler);
      }

      // Intercepting `setRequestHeader` to access the request headers of XHR instance.
      // This will only work for user/library defined headers, not for the default/browser-assigned headers.
      // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.
      fill(this, 'setRequestHeader', function (original) {
        return function ( ...setRequestHeaderArgs) {
          const [header, value] = setRequestHeaderArgs ;

          const xhrInfo = this[SENTRY_XHR_DATA_KEY];

          if (xhrInfo) {
            xhrInfo.request_headers[header.toLowerCase()] = value;
          }

          return original.apply(this, setRequestHeaderArgs);
        };
      });

      return originalOpen.apply(this, args);
    };
  });

  fill(xhrproto, 'send', function (originalSend) {
    return function ( ...args) {
      const sentryXhrData = this[SENTRY_XHR_DATA_KEY];
      if (sentryXhrData && args[0] !== undefined) {
        sentryXhrData.body = args[0];
      }

      triggerHandlers('xhr', {
        args,
        startTimestamp: Date.now(),
        xhr: this,
      });

      return originalSend.apply(this, args);
    };
  });
}

let lastHref;

/** JSDoc */
function instrumentHistory() {
  if (!supportsHistory()) {
    return;
  }

  const oldOnPopState = WINDOW.onpopstate;
  WINDOW.onpopstate = function ( ...args) {
    const to = WINDOW.location.href;
    // keep track of the current URL state, as we always receive only the updated state
    const from = lastHref;
    lastHref = to;
    triggerHandlers('history', {
      from,
      to,
    });
    if (oldOnPopState) {
      // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.
      // https://github.com/getsentry/sentry-javascript/issues/3344
      // https://github.com/bugsnag/bugsnag-js/issues/469
      try {
        return oldOnPopState.apply(this, args);
      } catch (_oO) {
        // no-empty
      }
    }
  };

  /** @hidden */
  function historyReplacementFunction(originalHistoryFunction) {
    return function ( ...args) {
      const url = args.length > 2 ? args[2] : undefined;
      if (url) {
        // coerce to string (this is what pushState does)
        const from = lastHref;
        const to = String(url);
        // keep track of the current URL state, as we always receive only the updated state
        lastHref = to;
        triggerHandlers('history', {
          from,
          to,
        });
      }
      return originalHistoryFunction.apply(this, args);
    };
  }

  fill(WINDOW.history, 'pushState', historyReplacementFunction);
  fill(WINDOW.history, 'replaceState', historyReplacementFunction);
}

const debounceDuration = 1000;
let debounceTimerID;
let lastCapturedEvent;

/**
 * Decide whether the current event should finish the debounce of previously captured one.
 * @param previous previously captured event
 * @param current event to be captured
 */
function shouldShortcircuitPreviousDebounce(previous, current) {
  // If there was no previous event, it should always be swapped for the new one.
  if (!previous) {
    return true;
  }

  // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.
  if (previous.type !== current.type) {
    return true;
  }

  try {
    // If both events have the same type, it's still possible that actions were performed on different targets.
    // e.g. 2 clicks on different buttons.
    if (previous.target !== current.target) {
      return true;
    }
  } catch (e) {
    // just accessing `target` property can throw an exception in some rare circumstances
    // see: https://github.com/getsentry/sentry-javascript/issues/838
  }

  // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_
  // to which an event listener was attached), we treat them as the same action, as we want to capture
  // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.
  return false;
}

/**
 * Decide whether an event should be captured.
 * @param event event to be captured
 */
function shouldSkipDOMEvent(event) {
  // We are only interested in filtering `keypress` events for now.
  if (event.type !== 'keypress') {
    return false;
  }

  try {
    const target = event.target ;

    if (!target || !target.tagName) {
      return true;
    }

    // Only consider keypress events on actual input elements. This will disregard keypresses targeting body
    // e.g.tabbing through elements, hotkeys, etc.
    if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
      return false;
    }
  } catch (e) {
    // just accessing `target` property can throw an exception in some rare circumstances
    // see: https://github.com/getsentry/sentry-javascript/issues/838
  }

  return true;
}

/**
 * Wraps addEventListener to capture UI breadcrumbs
 * @param handler function that will be triggered
 * @param globalListener indicates whether event was captured by the global event listener
 * @returns wrapped breadcrumb events handler
 * @hidden
 */
function makeDOMEventHandler(handler, globalListener = false) {
  return (event) => {
    // It's possible this handler might trigger multiple times for the same
    // event (e.g. event propagation through node ancestors).
    // Ignore if we've already captured that event.
    if (!event || lastCapturedEvent === event) {
      return;
    }

    // We always want to skip _some_ events.
    if (shouldSkipDOMEvent(event)) {
      return;
    }

    const name = event.type === 'keypress' ? 'input' : event.type;

    // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.
    if (debounceTimerID === undefined) {
      handler({
        event: event,
        name,
        global: globalListener,
      });
      lastCapturedEvent = event;
    }
    // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.
    // If that's the case, emit the previous event and store locally the newly-captured DOM event.
    else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {
      handler({
        event: event,
        name,
        global: globalListener,
      });
      lastCapturedEvent = event;
    }

    // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.
    clearTimeout(debounceTimerID);
    debounceTimerID = WINDOW.setTimeout(() => {
      debounceTimerID = undefined;
    }, debounceDuration);
  };
}

/** JSDoc */
function instrumentDOM() {
  if (!('document' in WINDOW)) {
    return;
  }

  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom
  // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before
  // we instrument `addEventListener` so that we don't end up attaching this handler twice.
  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');
  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);
  WINDOW.document.addEventListener('click', globalDOMEventHandler, false);
  WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);

  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled
  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That
  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler
  // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still
  // guaranteed to fire at least once.)
  ['EventTarget', 'Node'].forEach((target) => {
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
    const proto = (WINDOW )[target] && (WINDOW )[target].prototype;
    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
      return;
    }

    fill(proto, 'addEventListener', function (originalAddEventListener) {
      return function (

        type,
        listener,
        options,
      ) {
        if (type === 'click' || type == 'keypress') {
          try {
            const el = this ;
            const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});
            const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });

            if (!handlerForType.handler) {
              const handler = makeDOMEventHandler(triggerDOMHandler);
              handlerForType.handler = handler;
              originalAddEventListener.call(this, type, handler, options);
            }

            handlerForType.refCount++;
          } catch (e) {
            // Accessing dom properties is always fragile.
            // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
          }
        }

        return originalAddEventListener.call(this, type, listener, options);
      };
    });

    fill(
      proto,
      'removeEventListener',
      function (originalRemoveEventListener) {
        return function (

          type,
          listener,
          options,
        ) {
          if (type === 'click' || type == 'keypress') {
            try {
              const el = this ;
              const handlers = el.__sentry_instrumentation_handlers__ || {};
              const handlerForType = handlers[type];

              if (handlerForType) {
                handlerForType.refCount--;
                // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.
                if (handlerForType.refCount <= 0) {
                  originalRemoveEventListener.call(this, type, handlerForType.handler, options);
                  handlerForType.handler = undefined;
                  delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete
                }

                // If there are no longer any custom handlers of any type on this element, cleanup everything.
                if (Object.keys(handlers).length === 0) {
                  delete el.__sentry_instrumentation_handlers__;
                }
              }
            } catch (e) {
              // Accessing dom properties is always fragile.
              // Also allows us to skip `addEventListenrs` calls with no proper `this` context.
            }
          }

          return originalRemoveEventListener.call(this, type, listener, options);
        };
      },
    );
  });
}

let _oldOnErrorHandler = null;
/** JSDoc */
function instrumentError() {
  _oldOnErrorHandler = WINDOW.onerror;

  WINDOW.onerror = function (msg, url, line, column, error) {
    triggerHandlers('error', {
      column,
      error,
      line,
      msg,
      url,
    });

    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {
      // eslint-disable-next-line prefer-rest-params
      return _oldOnErrorHandler.apply(this, arguments);
    }

    return false;
  };

  WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true;
}

let _oldOnUnhandledRejectionHandler = null;
/** JSDoc */
function instrumentUnhandledRejection() {
  _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;

  WINDOW.onunhandledrejection = function (e) {
    triggerHandlers('unhandledrejection', e);

    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {
      // eslint-disable-next-line prefer-rest-params
      return _oldOnUnhandledRejectionHandler.apply(this, arguments);
    }

    return true;
  };

  WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
}

export { SENTRY_XHR_DATA_KEY, addInstrumentationHandler, parseFetchArgs };
//# sourceMappingURL=instrument.js.map
{"version":3,"file":"instrument.js","sources":["../../src/instrument.ts"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/ban-types */\nimport type {\n  HandlerDataFetch,\n  HandlerDataXhr,\n  SentryWrappedXMLHttpRequest,\n  SentryXhrData,\n  WrappedFunction,\n} from '@sentry/types';\n\nimport { isString } from './is';\nimport { CONSOLE_LEVELS, logger } from './logger';\nimport { fill } from './object';\nimport { getFunctionName } from './stacktrace';\nimport { supportsHistory, supportsNativeFetch } from './supports';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nexport const SENTRY_XHR_DATA_KEY = '__sentry_xhr_v2__';\n\nexport type InstrumentHandlerType =\n  | 'console'\n  | 'dom'\n  | 'fetch'\n  | 'history'\n  | 'sentry'\n  | 'xhr'\n  | 'error'\n  | 'unhandledrejection';\nexport type InstrumentHandlerCallback = (data: any) => void;\n\n/**\n * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.\n *  - Console API\n *  - Fetch API\n *  - XHR API\n *  - History API\n *  - DOM API (click/typing)\n *  - Error API\n *  - UnhandledRejection API\n */\n\nconst handlers: { [key in InstrumentHandlerType]?: InstrumentHandlerCallback[] } = {};\nconst instrumented: { [key in InstrumentHandlerType]?: boolean } = {};\n\n/** Instruments given API */\nfunction instrument(type: InstrumentHandlerType): void {\n  if (instrumented[type]) {\n    return;\n  }\n\n  instrumented[type] = true;\n\n  switch (type) {\n    case 'console':\n      instrumentConsole();\n      break;\n    case 'dom':\n      instrumentDOM();\n      break;\n    case 'xhr':\n      instrumentXHR();\n      break;\n    case 'fetch':\n      instrumentFetch();\n      break;\n    case 'history':\n      instrumentHistory();\n      break;\n    case 'error':\n      instrumentError();\n      break;\n    case 'unhandledrejection':\n      instrumentUnhandledRejection();\n      break;\n    default:\n      __DEBUG_BUILD__ && logger.warn('unknown instrumentation type:', type);\n      return;\n  }\n}\n\n/**\n * Add handler that will be called when given type of instrumentation triggers.\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nexport function addInstrumentationHandler(type: InstrumentHandlerType, callback: InstrumentHandlerCallback): void {\n  handlers[type] = handlers[type] || [];\n  (handlers[type] as InstrumentHandlerCallback[]).push(callback);\n  instrument(type);\n}\n\n/** JSDoc */\nfunction triggerHandlers(type: InstrumentHandlerType, data: any): void {\n  if (!type || !handlers[type]) {\n    return;\n  }\n\n  for (const handler of handlers[type] || []) {\n    try {\n      handler(data);\n    } catch (e) {\n      __DEBUG_BUILD__ &&\n        logger.error(\n          `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n          e,\n        );\n    }\n  }\n}\n\n/** JSDoc */\nfunction instrumentConsole(): void {\n  if (!('console' in WINDOW)) {\n    return;\n  }\n\n  CONSOLE_LEVELS.forEach(function (level: string): void {\n    if (!(level in WINDOW.console)) {\n      return;\n    }\n\n    fill(WINDOW.console, level, function (originalConsoleMethod: () => any): Function {\n      return function (...args: any[]): void {\n        triggerHandlers('console', { args, level });\n\n        // this fails for some browsers. :(\n        if (originalConsoleMethod) {\n          originalConsoleMethod.apply(WINDOW.console, args);\n        }\n      };\n    });\n  });\n}\n\n/** JSDoc */\nfunction instrumentFetch(): void {\n  if (!supportsNativeFetch()) {\n    return;\n  }\n\n  fill(WINDOW, 'fetch', function (originalFetch: () => void): () => void {\n    return function (...args: any[]): void {\n      const { method, url } = parseFetchArgs(args);\n\n      const handlerData: HandlerDataFetch = {\n        args,\n        fetchData: {\n          method,\n          url,\n        },\n        startTimestamp: Date.now(),\n      };\n\n      triggerHandlers('fetch', {\n        ...handlerData,\n      });\n\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      return originalFetch.apply(WINDOW, args).then(\n        (response: Response) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            response,\n          });\n          return response;\n        },\n        (error: Error) => {\n          triggerHandlers('fetch', {\n            ...handlerData,\n            endTimestamp: Date.now(),\n            error,\n          });\n          // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n          //       it means the sentry.javascript SDK caught an error invoking your application code.\n          //       This is expected behavior and NOT indicative of a bug with sentry.javascript.\n          throw error;\n        },\n      );\n    };\n  });\n}\n\nfunction hasProp<T extends string>(obj: unknown, prop: T): obj is Record<string, string> {\n  return !!obj && typeof obj === 'object' && !!(obj as Record<string, string>)[prop];\n}\n\ntype FetchResource = string | { toString(): string } | { url: string };\n\nfunction getUrlFromResource(resource: FetchResource): string {\n  if (typeof resource === 'string') {\n    return resource;\n  }\n\n  if (!resource) {\n    return '';\n  }\n\n  if (hasProp(resource, 'url')) {\n    return resource.url;\n  }\n\n  if (resource.toString) {\n    return resource.toString();\n  }\n\n  return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request\n */\nexport function parseFetchArgs(fetchArgs: unknown[]): { method: string; url: string } {\n  if (fetchArgs.length === 0) {\n    return { method: 'GET', url: '' };\n  }\n\n  if (fetchArgs.length === 2) {\n    const [url, options] = fetchArgs as [FetchResource, object];\n\n    return {\n      url: getUrlFromResource(url),\n      method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n    };\n  }\n\n  const arg = fetchArgs[0];\n  return {\n    url: getUrlFromResource(arg as FetchResource),\n    method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n  };\n}\n\n/** JSDoc */\nfunction instrumentXHR(): void {\n  if (!('XMLHttpRequest' in WINDOW)) {\n    return;\n  }\n\n  const xhrproto = XMLHttpRequest.prototype;\n\n  fill(xhrproto, 'open', function (originalOpen: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const url = args[1];\n      const xhrInfo: SentryXhrData = (this[SENTRY_XHR_DATA_KEY] = {\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        method: isString(args[0]) ? args[0].toUpperCase() : args[0],\n        url: args[1],\n        request_headers: {},\n      });\n\n      // if Sentry key appears in URL, don't capture it as a request\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      if (isString(url) && xhrInfo.method === 'POST' && url.match(/sentry_key/)) {\n        this.__sentry_own_request__ = true;\n      }\n\n      const onreadystatechangeHandler: () => void = () => {\n        // For whatever reason, this is not the same instance here as from the outer method\n        const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n        if (!xhrInfo) {\n          return;\n        }\n\n        if (this.readyState === 4) {\n          try {\n            // touching statusCode in some platforms throws\n            // an exception\n            xhrInfo.status_code = this.status;\n          } catch (e) {\n            /* do nothing */\n          }\n\n          triggerHandlers('xhr', {\n            args: args as [string, string],\n            endTimestamp: Date.now(),\n            startTimestamp: Date.now(),\n            xhr: this,\n          } as HandlerDataXhr);\n        }\n      };\n\n      if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n        fill(this, 'onreadystatechange', function (original: WrappedFunction): Function {\n          return function (this: SentryWrappedXMLHttpRequest, ...readyStateArgs: any[]): void {\n            onreadystatechangeHandler();\n            return original.apply(this, readyStateArgs);\n          };\n        });\n      } else {\n        this.addEventListener('readystatechange', onreadystatechangeHandler);\n      }\n\n      // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n      // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n      // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n      fill(this, 'setRequestHeader', function (original: WrappedFunction): Function {\n        return function (this: SentryWrappedXMLHttpRequest, ...setRequestHeaderArgs: unknown[]): void {\n          const [header, value] = setRequestHeaderArgs as [string, string];\n\n          const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n          if (xhrInfo) {\n            xhrInfo.request_headers[header.toLowerCase()] = value;\n          }\n\n          return original.apply(this, setRequestHeaderArgs);\n        };\n      });\n\n      return originalOpen.apply(this, args);\n    };\n  });\n\n  fill(xhrproto, 'send', function (originalSend: () => void): () => void {\n    return function (this: XMLHttpRequest & SentryWrappedXMLHttpRequest, ...args: any[]): void {\n      const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n      if (sentryXhrData && args[0] !== undefined) {\n        sentryXhrData.body = args[0];\n      }\n\n      triggerHandlers('xhr', {\n        args,\n        startTimestamp: Date.now(),\n        xhr: this,\n      });\n\n      return originalSend.apply(this, args);\n    };\n  });\n}\n\nlet lastHref: string;\n\n/** JSDoc */\nfunction instrumentHistory(): void {\n  if (!supportsHistory()) {\n    return;\n  }\n\n  const oldOnPopState = WINDOW.onpopstate;\n  WINDOW.onpopstate = function (this: WindowEventHandlers, ...args: any[]): any {\n    const to = WINDOW.location.href;\n    // keep track of the current URL state, as we always receive only the updated state\n    const from = lastHref;\n    lastHref = to;\n    triggerHandlers('history', {\n      from,\n      to,\n    });\n    if (oldOnPopState) {\n      // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n      // https://github.com/getsentry/sentry-javascript/issues/3344\n      // https://github.com/bugsnag/bugsnag-js/issues/469\n      try {\n        return oldOnPopState.apply(this, args);\n      } catch (_oO) {\n        // no-empty\n      }\n    }\n  };\n\n  /** @hidden */\n  function historyReplacementFunction(originalHistoryFunction: () => void): () => void {\n    return function (this: History, ...args: any[]): void {\n      const url = args.length > 2 ? args[2] : undefined;\n      if (url) {\n        // coerce to string (this is what pushState does)\n        const from = lastHref;\n        const to = String(url);\n        // keep track of the current URL state, as we always receive only the updated state\n        lastHref = to;\n        triggerHandlers('history', {\n          from,\n          to,\n        });\n      }\n      return originalHistoryFunction.apply(this, args);\n    };\n  }\n\n  fill(WINDOW.history, 'pushState', historyReplacementFunction);\n  fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nconst debounceDuration = 1000;\nlet debounceTimerID: number | undefined;\nlet lastCapturedEvent: Event | undefined;\n\n/**\n * Decide whether the current event should finish the debounce of previously captured one.\n * @param previous previously captured event\n * @param current event to be captured\n */\nfunction shouldShortcircuitPreviousDebounce(previous: Event | undefined, current: Event): boolean {\n  // If there was no previous event, it should always be swapped for the new one.\n  if (!previous) {\n    return true;\n  }\n\n  // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n  if (previous.type !== current.type) {\n    return true;\n  }\n\n  try {\n    // If both events have the same type, it's still possible that actions were performed on different targets.\n    // e.g. 2 clicks on different buttons.\n    if (previous.target !== current.target) {\n      return true;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n  // to which an event listener was attached), we treat them as the same action, as we want to capture\n  // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n  return false;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(event: Event): boolean {\n  // We are only interested in filtering `keypress` events for now.\n  if (event.type !== 'keypress') {\n    return false;\n  }\n\n  try {\n    const target = event.target as HTMLElement;\n\n    if (!target || !target.tagName) {\n      return true;\n    }\n\n    // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n    // e.g.tabbing through elements, hotkeys, etc.\n    if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n      return false;\n    }\n  } catch (e) {\n    // just accessing `target` property can throw an exception in some rare circumstances\n    // see: https://github.com/getsentry/sentry-javascript/issues/838\n  }\n\n  return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n * @param handler function that will be triggered\n * @param globalListener indicates whether event was captured by the global event listener\n * @returns wrapped breadcrumb events handler\n * @hidden\n */\nfunction makeDOMEventHandler(handler: Function, globalListener: boolean = false): (event: Event) => void {\n  return (event: Event): void => {\n    // It's possible this handler might trigger multiple times for the same\n    // event (e.g. event propagation through node ancestors).\n    // Ignore if we've already captured that event.\n    if (!event || lastCapturedEvent === event) {\n      return;\n    }\n\n    // We always want to skip _some_ events.\n    if (shouldSkipDOMEvent(event)) {\n      return;\n    }\n\n    const name = event.type === 'keypress' ? 'input' : event.type;\n\n    // If there is no debounce timer, it means that we can safely capture the new event and store it for future comparisons.\n    if (debounceTimerID === undefined) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n    // If there is a debounce awaiting, see if the new event is different enough to treat it as a unique one.\n    // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n    else if (shouldShortcircuitPreviousDebounce(lastCapturedEvent, event)) {\n      handler({\n        event: event,\n        name,\n        global: globalListener,\n      });\n      lastCapturedEvent = event;\n    }\n\n    // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n    clearTimeout(debounceTimerID);\n    debounceTimerID = WINDOW.setTimeout(() => {\n      debounceTimerID = undefined;\n    }, debounceDuration);\n  };\n}\n\ntype AddEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | AddEventListenerOptions,\n) => void;\ntype RemoveEventListener = (\n  type: string,\n  listener: EventListenerOrEventListenerObject,\n  options?: boolean | EventListenerOptions,\n) => void;\n\ntype InstrumentedElement = Element & {\n  __sentry_instrumentation_handlers__?: {\n    [key in 'click' | 'keypress']?: {\n      handler?: Function;\n      /** The number of custom listeners attached to this element */\n      refCount: number;\n    };\n  };\n};\n\n/** JSDoc */\nfunction instrumentDOM(): void {\n  if (!('document' in WINDOW)) {\n    return;\n  }\n\n  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n  // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n  // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n  WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n  WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n  // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n  // guaranteed to fire at least once.)\n  ['EventTarget', 'Node'].forEach((target: string) => {\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n    const proto = (WINDOW as any)[target] && (WINDOW as any)[target].prototype;\n    // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n    if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n      return;\n    }\n\n    fill(proto, 'addEventListener', function (originalAddEventListener: AddEventListener): AddEventListener {\n      return function (\n        this: Element,\n        type: string,\n        listener: EventListenerOrEventListenerObject,\n        options?: boolean | AddEventListenerOptions,\n      ): AddEventListener {\n        if (type === 'click' || type == 'keypress') {\n          try {\n            const el = this as InstrumentedElement;\n            const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n            const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n            if (!handlerForType.handler) {\n              const handler = makeDOMEventHandler(triggerDOMHandler);\n              handlerForType.handler = handler;\n              originalAddEventListener.call(this, type, handler, options);\n            }\n\n            handlerForType.refCount++;\n          } catch (e) {\n            // Accessing dom properties is always fragile.\n            // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n          }\n        }\n\n        return originalAddEventListener.call(this, type, listener, options);\n      };\n    });\n\n    fill(\n      proto,\n      'removeEventListener',\n      function (originalRemoveEventListener: RemoveEventListener): RemoveEventListener {\n        return function (\n          this: Element,\n          type: string,\n          listener: EventListenerOrEventListenerObject,\n          options?: boolean | EventListenerOptions,\n        ): () => void {\n          if (type === 'click' || type == 'keypress') {\n            try {\n              const el = this as InstrumentedElement;\n              const handlers = el.__sentry_instrumentation_handlers__ || {};\n              const handlerForType = handlers[type];\n\n              if (handlerForType) {\n                handlerForType.refCount--;\n                // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n                if (handlerForType.refCount <= 0) {\n                  originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n                  handlerForType.handler = undefined;\n                  delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n                }\n\n                // If there are no longer any custom handlers of any type on this element, cleanup everything.\n                if (Object.keys(handlers).length === 0) {\n                  delete el.__sentry_instrumentation_handlers__;\n                }\n              }\n            } catch (e) {\n              // Accessing dom properties is always fragile.\n              // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n            }\n          }\n\n          return originalRemoveEventListener.call(this, type, listener, options);\n        };\n      },\n    );\n  });\n}\n\nlet _oldOnErrorHandler: (typeof WINDOW)['onerror'] | null = null;\n/** JSDoc */\nfunction instrumentError(): void {\n  _oldOnErrorHandler = WINDOW.onerror;\n\n  WINDOW.onerror = function (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean {\n    triggerHandlers('error', {\n      column,\n      error,\n      line,\n      msg,\n      url,\n    });\n\n    if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnErrorHandler.apply(this, arguments);\n    }\n\n    return false;\n  };\n\n  WINDOW.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nlet _oldOnUnhandledRejectionHandler: (typeof WINDOW)['onunhandledrejection'] | null = null;\n/** JSDoc */\nfunction instrumentUnhandledRejection(): void {\n  _oldOnUnhandledRejectionHandler = WINDOW.onunhandledrejection;\n\n  WINDOW.onunhandledrejection = function (e: any): boolean {\n    triggerHandlers('unhandledrejection', e);\n\n    if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n      // eslint-disable-next-line prefer-rest-params\n      return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n    }\n\n    return true;\n  };\n\n  WINDOW.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n"],"names":[],"mappings":";;;;;;;;AAkBA;AACA,MAAA,MAAA,GAAA,eAAA,EAAA,CAAA;AACA;AACA,MAAA,mBAAA,GAAA,oBAAA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,QAAA,GAAA,EAAA,CAAA;AACA,MAAA,YAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,SAAA,UAAA,CAAA,IAAA,EAAA;AACA,EAAA,IAAA,YAAA,CAAA,IAAA,CAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,YAAA,CAAA,IAAA,CAAA,GAAA,IAAA,CAAA;AACA;AACA,EAAA,QAAA,IAAA;AACA,IAAA,KAAA,SAAA;AACA,MAAA,iBAAA,EAAA,CAAA;AACA,MAAA,MAAA;AACA,IAAA,KAAA,KAAA;AACA,MAAA,aAAA,EAAA,CAAA;AACA,MAAA,MAAA;AACA,IAAA,KAAA,KAAA;AACA,MAAA,aAAA,EAAA,CAAA;AACA,MAAA,MAAA;AACA,IAAA,KAAA,OAAA;AACA,MAAA,eAAA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;AACA,MAAA,GAAA;AACA,KAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,kBAAA,IAAA,CAAA,kBAAA,CAAA,iBAAA,EAAA;AACA;AACA,MAAA,OAAA,kBAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,CAAA,OAAA,CAAA,uBAAA,GAAA,IAAA,CAAA;AACA,CAAA;AACA;AACA,IAAA,+BAAA,GAAA,IAAA,CAAA;AACA;AACA,SAAA,4BAAA,GAAA;AACA,EAAA,+BAAA,GAAA,MAAA,CAAA,oBAAA,CAAA;AACA;AACA,EAAA,MAAA,CAAA,oBAAA,GAAA,UAAA,CAAA,EAAA;AACA,IAAA,eAAA,CAAA,oBAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA,IAAA,IAAA,+BAAA,IAAA,CAAA,+BAAA,CAAA,iBAAA,EAAA;AACA;AACA,MAAA,OAAA,+BAAA,CAAA,KAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,CAAA,oBAAA,CAAA,uBAAA,GAAA,IAAA,CAAA;AACA;;;;"}// eslint-disable-next-line @typescript-eslint/unbound-method
const objectToString = Object.prototype.toString;

/**
 * Checks whether given value's type is one of a few Error or Error-like
 * {@link isError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isError(wat) {
  switch (objectToString.call(wat)) {
    case '[object Error]':
    case '[object Exception]':
    case '[object DOMException]':
      return true;
    default:
      return isInstanceOf(wat, Error);
  }
}
/**
 * Checks whether given value is an instance of the given built-in class.
 *
 * @param wat The value to be checked
 * @param className
 * @returns A boolean representing the result.
 */
function isBuiltin(wat, className) {
  return objectToString.call(wat) === `[object ${className}]`;
}

/**
 * Checks whether given value's type is ErrorEvent
 * {@link isErrorEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isErrorEvent(wat) {
  return isBuiltin(wat, 'ErrorEvent');
}

/**
 * Checks whether given value's type is DOMError
 * {@link isDOMError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isDOMError(wat) {
  return isBuiltin(wat, 'DOMError');
}

/**
 * Checks whether given value's type is DOMException
 * {@link isDOMException}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isDOMException(wat) {
  return isBuiltin(wat, 'DOMException');
}

/**
 * Checks whether given value's type is a string
 * {@link isString}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isString(wat) {
  return isBuiltin(wat, 'String');
}

/**
 * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
 * {@link isPrimitive}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isPrimitive(wat) {
  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');
}

/**
 * Checks whether given value's type is an object literal
 * {@link isPlainObject}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isPlainObject(wat) {
  return isBuiltin(wat, 'Object');
}

/**
 * Checks whether given value's type is an Event instance
 * {@link isEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isEvent(wat) {
  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);
}

/**
 * Checks whether given value's type is an Element instance
 * {@link isElement}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isElement(wat) {
  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);
}

/**
 * Checks whether given value's type is an regexp
 * {@link isRegExp}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isRegExp(wat) {
  return isBuiltin(wat, 'RegExp');
}

/**
 * Checks whether given value has a then function.
 * @param wat A value to be checked.
 */
function isThenable(wat) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return Boolean(wat && wat.then && typeof wat.then === 'function');
}

/**
 * Checks whether given value's type is a SyntheticEvent
 * {@link isSyntheticEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isSyntheticEvent(wat) {
  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;
}

/**
 * Checks whether given value is NaN
 * {@link isNaN}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
function isNaN(wat) {
  return typeof wat === 'number' && wat !== wat;
}

/**
 * Checks whether given value's type is an instance of provided constructor.
 * {@link isInstanceOf}.
 *
 * @param wat A value to be checked.
 * @param base A constructor to be used in a check.
 * @returns A boolean representing the result.
 */
function isInstanceOf(wat, base) {
  try {
    return wat instanceof base;
  } catch (_e) {
    return false;
  }
}

export { isDOMError, isDOMException, isElement, isError, isErrorEvent, isEvent, isInstanceOf, isNaN, isPlainObject, isPrimitive, isRegExp, isString, isSyntheticEvent, isThenable };
//# sourceMappingURL=is.js.map
{"version":3,"file":"is.js","sources":["../../src/is.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\nimport type { PolymorphicEvent, Primitive } from '@sentry/types';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst objectToString = Object.prototype.toString;\n\n/**\n * Checks whether given value's type is one of a few Error or Error-like\n * {@link isError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isError(wat: unknown): wat is Error {\n  switch (objectToString.call(wat)) {\n    case '[object Error]':\n    case '[object Exception]':\n    case '[object DOMException]':\n      return true;\n    default:\n      return isInstanceOf(wat, Error);\n  }\n}\n/**\n * Checks whether given value is an instance of the given built-in class.\n *\n * @param wat The value to be checked\n * @param className\n * @returns A boolean representing the result.\n */\nfunction isBuiltin(wat: unknown, className: string): boolean {\n  return objectToString.call(wat) === `[object ${className}]`;\n}\n\n/**\n * Checks whether given value's type is ErrorEvent\n * {@link isErrorEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isErrorEvent(wat: unknown): boolean {\n  return isBuiltin(wat, 'ErrorEvent');\n}\n\n/**\n * Checks whether given value's type is DOMError\n * {@link isDOMError}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMError(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMError');\n}\n\n/**\n * Checks whether given value's type is DOMException\n * {@link isDOMException}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isDOMException(wat: unknown): boolean {\n  return isBuiltin(wat, 'DOMException');\n}\n\n/**\n * Checks whether given value's type is a string\n * {@link isString}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isString(wat: unknown): wat is string {\n  return isBuiltin(wat, 'String');\n}\n\n/**\n * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)\n * {@link isPrimitive}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPrimitive(wat: unknown): wat is Primitive {\n  return wat === null || (typeof wat !== 'object' && typeof wat !== 'function');\n}\n\n/**\n * Checks whether given value's type is an object literal\n * {@link isPlainObject}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isPlainObject(wat: unknown): wat is Record<string, unknown> {\n  return isBuiltin(wat, 'Object');\n}\n\n/**\n * Checks whether given value's type is an Event instance\n * {@link isEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isEvent(wat: unknown): wat is PolymorphicEvent {\n  return typeof Event !== 'undefined' && isInstanceOf(wat, Event);\n}\n\n/**\n * Checks whether given value's type is an Element instance\n * {@link isElement}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isElement(wat: unknown): boolean {\n  return typeof Element !== 'undefined' && isInstanceOf(wat, Element);\n}\n\n/**\n * Checks whether given value's type is an regexp\n * {@link isRegExp}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isRegExp(wat: unknown): wat is RegExp {\n  return isBuiltin(wat, 'RegExp');\n}\n\n/**\n * Checks whether given value has a then function.\n * @param wat A value to be checked.\n */\nexport function isThenable(wat: any): wat is PromiseLike<any> {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return Boolean(wat && wat.then && typeof wat.then === 'function');\n}\n\n/**\n * Checks whether given value's type is a SyntheticEvent\n * {@link isSyntheticEvent}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isSyntheticEvent(wat: unknown): boolean {\n  return isPlainObject(wat) && 'nativeEvent' in wat && 'preventDefault' in wat && 'stopPropagation' in wat;\n}\n\n/**\n * Checks whether given value is NaN\n * {@link isNaN}.\n *\n * @param wat A value to be checked.\n * @returns A boolean representing the result.\n */\nexport function isNaN(wat: unknown): boolean {\n  return typeof wat === 'number' && wat !== wat;\n}\n\n/**\n * Checks whether given value's type is an instance of provided constructor.\n * {@link isInstanceOf}.\n *\n * @param wat A value to be checked.\n * @param base A constructor to be used in a check.\n * @returns A boolean representing the result.\n */\nexport function isInstanceOf(wat: any, base: any): boolean {\n  try {\n    return wat instanceof base;\n  } catch (_e) {\n    return false;\n  }\n}\n"],"names":[],"mappings":"AAKA;AACA,MAAA,cAAA,GAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,OAAA,CAAA,GAAA,EAAA;AACA,EAAA,QAAA,cAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,IAAA,KAAA,gBAAA,CAAA;AACA,IAAA,KAAA,oBAAA,CAAA;AACA,IAAA,KAAA,uBAAA;AACA,MAAA,OAAA,IAAA,CAAA;AACA,IAAA;AACA,MAAA,OAAA,YAAA,CAAA,GAAA,EAAA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AAC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A,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,OAAA,KAAA,WAAA,IAAA,YAAA,CAAA,GAAA,EAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,SAAA,CAAA,GAAA,EAAA,QAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,UAAA,CAAA,GAAA,EAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA,GAAA,IAAA,GAAA,CAAA,IAAA,IAAA,OAAA,GAAA,CAAA,IAAA,KAAA,UAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,aAAA,CAAA,GAAA,CAAA,IAAA,aAAA,IAAA,GAAA,IAAA,gBAAA,IAAA,GAAA,IAAA,iBAAA,IAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,OAAA,GAAA,KAAA,QAAA,IAAA,GAAA,KAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,GAAA,EAAA,IAAA,EAAA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,GAAA,YAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,EAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}import { getGlobalSingleton, GLOBAL_OBJ } from './worldwide.js';

/** Prefix for logging strings */
const PREFIX = 'Sentry Logger ';

const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] ;

/**
 * Temporarily disable sentry console instrumentations.
 *
 * @param callback The function to run against the original `console` messages
 * @returns The results of the callback
 */
function consoleSandbox(callback) {
  if (!('console' in GLOBAL_OBJ)) {
    return callback();
  }

  const originalConsole = GLOBAL_OBJ.console ;
  const wrappedLevels = {};

  // Restore all wrapped console methods
  CONSOLE_LEVELS.forEach(level => {
    // TODO(v7): Remove this check as it's only needed for Node 6
    const originalWrappedFunc =
      originalConsole[level] && (originalConsole[level] ).__sentry_original__;
    if (level in originalConsole && originalWrappedFunc) {
      wrappedLevels[level] = originalConsole[level] ;
      originalConsole[level] = originalWrappedFunc ;
    }
  });

  try {
    return callback();
  } finally {
    // Revert restoration to wrapped state
    Object.keys(wrappedLevels).forEach(level => {
      originalConsole[level] = wrappedLevels[level ];
    });
  }
}

function makeLogger() {
  let enabled = false;
  const logger = {
    enable: () => {
      enabled = true;
    },
    disable: () => {
      enabled = false;
    },
  };

  if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
    CONSOLE_LEVELS.forEach(name => {
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      logger[name] = (...args) => {
        if (enabled) {
          consoleSandbox(() => {
            GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);
          });
        }
      };
    });
  } else {
    CONSOLE_LEVELS.forEach(name => {
      logger[name] = () => undefined;
    });
  }

  return logger ;
}

// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
let logger;
if ((typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__)) {
  logger = getGlobalSingleton('logger', makeLogger);
} else {
  logger = makeLogger();
}

export { CONSOLE_LEVELS, consoleSandbox, logger };
//# sourceMappingURL=logger.js.map
{"version":3,"file":"logger.js","sources":["../../src/logger.ts"],"sourcesContent":["import type { WrappedFunction } from '@sentry/types';\n\nimport { getGlobalSingleton, GLOBAL_OBJ } from './worldwide';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nexport const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert', 'trace'] as const;\nexport type ConsoleLevel = (typeof CONSOLE_LEVELS)[number];\n\ntype LoggerMethod = (...args: unknown[]) => void;\ntype LoggerConsoleMethods = Record<(typeof CONSOLE_LEVELS)[number], LoggerMethod>;\n\n/** JSDoc */\ninterface Logger extends LoggerConsoleMethods {\n  disable(): void;\n  enable(): void;\n}\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nexport function consoleSandbox<T>(callback: () => T): T {\n  if (!('console' in GLOBAL_OBJ)) {\n    return callback();\n  }\n\n  const originalConsole = GLOBAL_OBJ.console as Console & Record<string, unknown>;\n  const wrappedLevels: Partial<LoggerConsoleMethods> = {};\n\n  // Restore all wrapped console methods\n  CONSOLE_LEVELS.forEach(level => {\n    // TODO(v7): Remove this check as it's only needed for Node 6\n    const originalWrappedFunc =\n      originalConsole[level] && (originalConsole[level] as WrappedFunction).__sentry_original__;\n    if (level in originalConsole && originalWrappedFunc) {\n      wrappedLevels[level] = originalConsole[level] as LoggerConsoleMethods[typeof level];\n      originalConsole[level] = originalWrappedFunc as Console[typeof level];\n    }\n  });\n\n  try {\n    return callback();\n  } finally {\n    // Revert restoration to wrapped state\n    Object.keys(wrappedLevels).forEach(level => {\n      originalConsole[level] = wrappedLevels[level as (typeof CONSOLE_LEVELS)[number]];\n    });\n  }\n}\n\nfunction makeLogger(): Logger {\n  let enabled = false;\n  const logger: Partial<Logger> = {\n    enable: () => {\n      enabled = true;\n    },\n    disable: () => {\n      enabled = false;\n    },\n  };\n\n  if (__DEBUG_BUILD__) {\n    CONSOLE_LEVELS.forEach(name => {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      logger[name] = (...args: any[]) => {\n        if (enabled) {\n          consoleSandbox(() => {\n            GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n          });\n        }\n      };\n    });\n  } else {\n    CONSOLE_LEVELS.forEach(name => {\n      logger[name] = () => undefined;\n    });\n  }\n\n  return logger as Logger;\n}\n\n// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used\nlet logger: Logger;\nif (__DEBUG_BUILD__) {\n  logger = getGlobalSingleton('logger', makeLogger);\n} else {\n  logger = makeLogger();\n}\n\nexport { logger };\n"],"names":[],"mappings":";;AAIA;AACA,MAAA,MAAA,GAAA,gBAAA,CAAA;AACA;AACA,MAAA,cAAA,GAAA,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,KAAA,EAAA,QAAA,EAAA,OAAA,CAAA,EAAA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA,EAAA,SAAA,IAAA,UAAA,CAAA,EAAA;AACA,IAAA,OAAA,QAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA,UAAA,CAAA,OAAA,EAAA;AACA,EAAA,MAAA,aAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA,EAAA,cAAA,CAAA,OAAA,CAAA,KAAA,IAAA;AACA;AACA,IAAA,MAAA,mBAAA;AACA,MAAA,eAAA,CAAA,KAAA,CAAA,IAAA,CAAA,eAAA,CAAA,KAAA,CAAA,GAAA,mBAAA,CAAA;AACA,IAAA,IAAA,KAAA,IAAA,eAAA,IAAA,mBAAA,EAAA;AACA,MAAA,aAAA,CAAA,KAAA,CAAA,GAAA,eAAA,CAAA,KAAA,CAAA,EAAA;AACA,MAAA,eAAA,CAAA,KAAA,CAAA,GAAA,mBAAA,EAAA;AACA,KAAA;AACA,GAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,OAAA,QAAA,EAAA,CAAA;AACA,GAAA,SAAA;AACA;AACA,IAAA,MAAA,CAAA,IAAA,CAAA,aAAA,CAAA,CAAA,OAAA,CAAA,KAAA,IAAA;AACA,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CAAA;AACA;;;;"}/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-explicit-any */

/**
 * Helper to decycle json objects
 */
function memoBuilder() {
  const hasWeakSet = typeof WeakSet === 'function';
  const inner = hasWeakSet ? new WeakSet() : [];
  function memoize(obj) {
    if (hasWeakSet) {
      if (inner.has(obj)) {
        return true;
      }
      inner.add(obj);
      return false;
    }
    // eslint-disable-next-line @typescript-eslint/prefer-for-of
    for (let i = 0; i < inner.length; i++) {
      const value = inner[i];
      if (value === obj) {
        return true;
      }
    }
    inner.push(obj);
    return false;
  }

  function unmemoize(obj) {
    if (hasWeakSet) {
      inner.delete(obj);
    } else {
      for (let i = 0; i < inner.length; i++) {
        if (inner[i] === obj) {
          inner.splice(i, 1);
          break;
        }
      }
    }
  }
  return [memoize, unmemoize];
}

export { memoBuilder };
//# sourceMappingURL=memo.js.map
{"version":3,"file":"memo.js","sources":["../../src/memo.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nexport type MemoFunc = [\n  // memoize\n  (obj: any) => boolean,\n  // unmemoize\n  (obj: any) => void,\n];\n\n/**\n * Helper to decycle json objects\n */\nexport function memoBuilder(): MemoFunc {\n  const hasWeakSet = typeof WeakSet === 'function';\n  const inner: any = hasWeakSet ? new WeakSet() : [];\n  function memoize(obj: any): boolean {\n    if (hasWeakSet) {\n      if (inner.has(obj)) {\n        return true;\n      }\n      inner.add(obj);\n      return false;\n    }\n    // eslint-disable-next-line @typescript-eslint/prefer-for-of\n    for (let i = 0; i < inner.length; i++) {\n      const value = inner[i];\n      if (value === obj) {\n        return true;\n      }\n    }\n    inner.push(obj);\n    return false;\n  }\n\n  function unmemoize(obj: any): void {\n    if (hasWeakSet) {\n      inner.delete(obj);\n    } else {\n      for (let i = 0; i < inner.length; i++) {\n        if (inner[i] === obj) {\n          inner.splice(i, 1);\n          break;\n        }\n      }\n    }\n  }\n  return [mem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AA;AACA,KAAA;AACA,GAAA;AACA,EAAA,OAAA,CAAA,OAAA,EAAA,SAAA,CAAA,CAAA;AACA;;;;"}import { addNonEnumerableProperty } from './object.js';
import { snipLine } from './string.js';
import { GLOBAL_OBJ } from './worldwide.js';

/**
 * UUID4 generator
 *
 * @returns string Generated UUID4.
 */
function uuid4() {
  const gbl = GLOBAL_OBJ ;
  const crypto = gbl.crypto || gbl.msCrypto;

  if (crypto && crypto.randomUUID) {
    return crypto.randomUUID().replace(/-/g, '');
  }

  const getRandomByte =
    crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;

  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523
  // Concatenating the following numbers as strings results in '10000000100040008000100000000000'
  return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>
    // eslint-disable-next-line no-bitwise
    ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),
  );
}

function getFirstException(event) {
  return event.exception && event.exception.values ? event.exception.values[0] : undefined;
}

/**
 * Extracts either message or type+value from an event that can be used for user-facing logs
 * @returns event's description
 */
function getEventDescription(event) {
  const { message, event_id: eventId } = event;
  if (message) {
    return message;
  }

  const firstException = getFirstException(event);
  if (firstException) {
    if (firstException.type && firstException.value) {
      return `${firstException.type}: ${firstException.value}`;
    }
    return firstException.type || firstException.value || eventId || '<unknown>';
  }
  return eventId || '<unknown>';
}

/**
 * Adds exception values, type and value to an synthetic Exception.
 * @param event The event to modify.
 * @param value Value of the exception.
 * @param type Type of the exception.
 * @hidden
 */
function addExceptionTypeValue(event, value, type) {
  const exception = (event.exception = event.exception || {});
  const values = (exception.values = exception.values || []);
  const firstException = (values[0] = values[0] || {});
  if (!firstException.value) {
    firstException.value = value || '';
  }
  if (!firstException.type) {
    firstException.type = type || 'Error';
  }
}

/**
 * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.
 *
 * @param event The event to modify.
 * @param newMechanism Mechanism data to add to the event.
 * @hidden
 */
function addExceptionMechanism(event, newMechanism) {
  const firstException = getFirstException(event);
  if (!firstException) {
    return;
  }

  const defaultMechanism = { type: 'generic', handled: true };
  const currentMechanism = firstException.mechanism;
  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };

  if (newMechanism && 'data' in newMechanism) {
    const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };
    firstException.mechanism.data = mergedData;
  }
}

// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
const SEMVER_REGEXP =
  /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;

/**
 * Represents Semantic Versioning object
 */

/**
 * Parses input into a SemVer interface
 * @param input string representation of a semver version
 */
function parseSemver(input) {
  const match = input.match(SEMVER_REGEXP) || [];
  const major = parseInt(match[1], 10);
  const minor = parseInt(match[2], 10);
  const patch = parseInt(match[3], 10);
  return {
    buildmetadata: match[5],
    major: isNaN(major) ? undefined : major,
    minor: isNaN(minor) ? undefined : minor,
    patch: isNaN(patch) ? undefined : patch,
    prerelease: match[4],
  };
}

/**
 * This function adds context (pre/post/line) lines to the provided frame
 *
 * @param lines string[] containing all lines
 * @param frame StackFrame that will be mutated
 * @param linesOfContext number of context lines we want to add pre/post
 */
function addContextToFrame(lines, frame, linesOfContext = 5) {
  // When there is no line number in the frame, attaching context is nonsensical and will even break grouping
  if (frame.lineno === undefined) {
    return;
  }

  const maxLines = lines.length;
  const sourceLine = Math.max(Math.min(maxLines, frame.lineno - 1), 0);

  frame.pre_context = lines
    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)
    .map((line) => snipLine(line, 0));

  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);

  frame.post_context = lines
    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)
    .map((line) => snipLine(line, 0));
}

/**
 * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object
 * in question), and marks it captured if not.
 *
 * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and
 * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so
 * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because
 * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not
 * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This
 * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we
 * see it.
 *
 * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on
 * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent
 * object wrapper forms so that this check will always work. However, because we need to flag the exact object which
 * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification
 * must be done before the exception captured.
 *
 * @param A thrown exception to check or flag as having been seen
 * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
 */
function checkOrSetAlreadyCaught(exception) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  if (exception && (exception ).__sentry_captured__) {
    return true;
  }

  try {
    // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the
    // `ExtraErrorData` integration
    addNonEnumerableProperty(exception , '__sentry_captured__', true);
  } catch (err) {
    // `exception` is a primitive, so we can't mark it seen
  }

  return false;
}

/**
 * Checks whether the given input is already an array, and if it isn't, wraps it in one.
 *
 * @param maybeArray Input to turn into an array, if necessary
 * @returns The input, if already an array, or an array with the input as the only element, if not
 */
function arrayify(maybeArray) {
  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
}

export { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };
//# sourceMappingURL=misc.js.map
{"version":3,"file":"misc.js","sources":["../../src/misc.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Event, Exception, Mechanism, StackFrame } from '@sentry/types';\n\nimport { addNonEnumerableProperty } from './object';\nimport { snipLine } from './string';\nimport { GLOBAL_OBJ } from './worldwide';\n\ninterface CryptoInternal {\n  getRandomValues(array: Uint8Array): Uint8Array;\n  randomUUID?(): string;\n}\n\n/** An interface for common properties on global */\ninterface CryptoGlobal {\n  msCrypto?: CryptoInternal;\n  crypto?: CryptoInternal;\n}\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nexport function uuid4(): string {\n  const gbl = GLOBAL_OBJ as typeof GLOBAL_OBJ & CryptoGlobal;\n  const crypto = gbl.crypto || gbl.msCrypto;\n\n  if (crypto && crypto.randomUUID) {\n    return crypto.randomUUID().replace(/-/g, '');\n  }\n\n  const getRandomByte =\n    crypto && crypto.getRandomValues ? () => crypto.getRandomValues(new Uint8Array(1))[0] : () => Math.random() * 16;\n\n  // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n  // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n  return (([1e7] as unknown as string) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n    // eslint-disable-next-line no-bitwise\n    ((c as unknown as number) ^ ((getRandomByte() & 15) >> ((c as unknown as number) / 4))).toString(16),\n  );\n}\n\nfunction getFirstException(event: Event): Exception | undefined {\n  return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nexport function getEventDescription(event: Event): string {\n  const { message, event_id: eventId } = event;\n  if (message) {\n    return message;\n  }\n\n  const firstException = getFirstException(event);\n  if (firstException) {\n    if (firstException.type && firstException.value) {\n      return `${firstException.type}: ${firstException.value}`;\n    }\n    return firstException.type || firstException.value || eventId || '<unknown>';\n  }\n  return eventId || '<unknown>';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nexport function addExceptionTypeValue(event: Event, value?: string, type?: string): void {\n  const exception = (event.exception = event.exception || {});\n  const values = (exception.values = exception.values || []);\n  const firstException = (values[0] = values[0] || {});\n  if (!firstException.value) {\n    firstException.value = value || '';\n  }\n  if (!firstException.type) {\n    firstException.type = type || 'Error';\n  }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nexport function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void {\n  const firstException = getFirstException(event);\n  if (!firstException) {\n    return;\n  }\n\n  const defaultMechanism = { type: 'generic', handled: true };\n  const currentMechanism = firstException.mechanism;\n  firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n  if (newMechanism && 'data' in newMechanism) {\n    const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n    firstException.mechanism.data = mergedData;\n  }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n  /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\ninterface SemVer {\n  major?: number;\n  minor?: number;\n  patch?: number;\n  prerelease?: string;\n  buildmetadata?: string;\n}\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nexport function parseSemver(input: string): SemVer {\n  const match = input.match(SEMVER_REGEXP) || [];\n  const major = parseInt(match[1], 10);\n  const minor = parseInt(match[2], 10);\n  const patch = parseInt(match[3], 10);\n  return {\n    buildmetadata: match[5],\n    major: isNaN(major) ? undefined : major,\n    minor: isNaN(minor) ? undefined : minor,\n    patch: isNaN(patch) ? undefined : patch,\n    prerelease: match[4],\n  };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nexport function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext: number = 5): void {\n  // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n  if (frame.lineno === undefined) {\n    return;\n  }\n\n  const maxLines = lines.length;\n  const sourceLine = Math.max(Math.min(maxLines, frame.lineno - 1), 0);\n\n  frame.pre_context = lines\n    .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n    .map((line: string) => snipLine(line, 0));\n\n  frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n  frame.post_context = lines\n    .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n    .map((line: string) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nexport function checkOrSetAlreadyCaught(exception: unknown): boolean {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  if (exception && (exception as any).__sentry_captured__) {\n    return true;\n  }\n\n  try {\n    // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n    // `ExtraErrorData` integration\n    addNonEnumerableProperty(exception as { [key: string]: unknown }, '__sentry_captured__', true);\n  } catch (err) {\n    // `exception` is a primitive, so we can't mark it seen\n  }\n\n  return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nexport function arrayify<T = unknown>(maybeArray: T | T[]): T[] {\n  return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n"],"names":[],"mappings":";;;;AAkBA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,GAAA;AACA,EAAA,MAAA,GAAA,GAAA,UAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,GAAA,CAAA,MAAA,IAAA,GAAA,CAAA,QAAA,CAAA;AACA;AACA,EAAA,IAAA,MAAA,IAAA,MAAA,CAAA,UAAA,EAAA;AACA,IAAA,OAAA,MAAA,CAAA,UAAA,EAAA,CAAA,OAAA,CAAA,IAAA,EAAA,EAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,aAAA;AACA,IAAA,MAAA,IAAA,MAAA,CAAA,eAAA,GAAA,MAAA,MAAA,CAAA,eAAA,CAAA,IAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,MAAA,IAAA,CAAA,MAAA,EAAA,GAAA,EAAA,CAAA;AACA;AACA;AACA;AACA,EAAA,OAAA,CAAA,CAAA,CAAA,GAAA,CAAA,KAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,IAAA,EA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ser */
// eslint-disable-next-line complexity
function node(getModule) {
  const FILENAME_MATCH = /^\s*[-]{4,}$/;
  const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;

  // eslint-disable-next-line complexity
  return (line) => {
    const lineMatch = line.match(FULL_MATCH);

    if (lineMatch) {
      let object;
      let method;
      let functionName;
      let typeName;
      let methodName;

      if (lineMatch[1]) {
        functionName = lineMatch[1];

        let methodStart = functionName.lastIndexOf('.');
        if (functionName[methodStart - 1] === '.') {
          methodStart--;
        }

        if (methodStart > 0) {
          object = functionName.slice(0, methodStart);
          method = functionName.slice(methodStart + 1);
          const objectEnd = object.indexOf('.Module');
          if (objectEnd > 0) {
            functionName = functionName.slice(objectEnd + 1);
            object = object.slice(0, objectEnd);
          }
        }
        typeName = undefined;
      }

      if (method) {
        typeName = object;
        methodName = method;
      }

      if (method === '<anonymous>') {
        methodName = undefined;
        functionName = undefined;
      }

      if (functionName === undefined) {
        methodName = methodName || '<anonymous>';
        functionName = typeName ? `${typeName}.${methodName}` : methodName;
      }

      let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];
      const isNative = lineMatch[5] === 'native';

      if (!filename && lineMatch[5] && !isNative) {
        filename = lineMatch[5];
      }

      const isInternal =
        isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && !filename.includes(':\\'));

      // in_app is all that's not an internal Node function or a module within node_modules
      // note that isNative appears to return true even for node core libraries
      // see https://github.com/getsentry/raven-node/issues/176

      const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');

      return {
        filename,
        module: getModule ? getModule(filename) : undefined,
        function: functionName,
        lineno: parseInt(lineMatch[3], 10) || undefined,
        colno: parseInt(lineMatch[4], 10) || undefined,
        in_app,
      };
    }

    if (line.match(FILENAME_MATCH)) {
      return {
        filename: line,
      };
    }

    return undefined;
  };
}

export { node };
//# sourceMappingURL=node-stack-trace.js.map
{"version":3,"file":"node-stack-trace.js","sources":["../../src/node-stack-trace.ts"],"sourcesContent":["// This code was originally forked from https://github.com/felixge/node-stack-trace\n// Since then it has been highly modified to fit our needs.\n\n// Copyright (c) 2011 Felix Geisendörfer (felix@debuggable.com)//\n//\n//  Permission is hereby granted, free of charge, to any person obtaining a copy\n//  of this software and associated documentation files (the \"Software\"), to deal\n//  in the Software without restriction, including without limitation the rights\n//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n//  copies of the Software, and to permit persons to whom the Software is\n//  furnished to do so, subject to the following conditions://\n//\n//  The above copyright notice and this permission notice shall be included in\n//  all copies or substantial portions of the Software.//\n//\n//  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n//  THE SOFTWARE.\n\nimport type { StackLineParserFn } from '@sentry/types';\n\nexport type GetModuleFn = (filename: string | undefined) => string | undefined;\n\n/** Node Stack line parser */\n// eslint-disable-next-line complexity\nexport function node(getModule?: GetModuleFn): StackLineParserFn {\n  const FILENAME_MATCH = /^\\s*[-]{4,}$/;\n  const FULL_MATCH = /at (?:async )?(?:(.+?)\\s+\\()?(?:(.+):(\\d+):(\\d+)?|([^)]+))\\)?/;\n\n  // eslint-disable-next-line complexity\n  return (line: string) => {\n    const lineMatch = line.match(FULL_MATCH);\n\n    if (lineMatch) {\n      let object: string | undefined;\n      let method: string | undefined;\n      let functionName: string | undefined;\n      let typeName: string | undefined;\n      let methodName: string | undefined;\n\n      if (lineMatch[1]) {\n        functionName = lineMatch[1];\n\n        let methodStart = functionName.lastIndexOf('.');\n        if (functionName[methodStart - 1] === '.') {\n          methodStart--;\n        }\n\n        if (methodStart > 0) {\n          object = functionName.slice(0, methodStart);\n          method = functionName.slice(methodStart + 1);\n          const objectEnd = object.indexOf('.Module');\n          if (objectEnd > 0) {\n            functionName = functionName.slice(objectEnd + 1);\n            object = object.slice(0, objectEnd);\n          }\n        }\n        typeName = undefined;\n      }\n\n      if (method) {\n        typeName = object;\n        methodName = method;\n      }\n\n      if (method === '<anonymous>') {\n        methodName = undefined;\n        functionName = undefined;\n      }\n\n      if (functionName === undefined) {\n        methodName = methodName || '<anonymous>';\n        functionName = typeName ? `${typeName}.${methodName}` : methodName;\n      }\n\n      let filename = lineMatch[2] && lineMatch[2].startsWith('file://') ? lineMatch[2].slice(7) : lineMatch[2];\n      const isNative = lineMatch[5] === 'native';\n\n      if (!filename && lineMatch[5] && !isNative) {\n        filename = lineMatch[5];\n      }\n\n      const isInternal =\n        isNative || (filename && !filename.startsWith('/') && !filename.startsWith('.') && !filename.includes(':\\\\'));\n\n      // in_app is all that's not an internal Node function or a module within node_modules\n      // note that isNative appears to return true even for node core libraries\n      // see https://github.com/getsentry/raven-node/issues/176\n\n      const in_app = !isInternal && filename !== undefined && !filename.includes('node_modules/');\n\n      return {\n        filename,\n        module: getModule ? getModule(filename) : undefined,\n        function: functionName,\n        lineno: parseInt(lineMatch[3], 10) || undefined,\n        colno: parseInt(lineMatch[4], 10) || undefined,\n        in_app,\n      };\n    }\n\n    if (line.match(FILENAME_MATCH)) {\n      return {\n        filename: line,\n      };\n    }\n\n    return undefined;\n  };\n}\n"],"names":[],"mappings":"AA2BA;AACA;AACA,SAAA,IAAA,CAAA,SAAA,EAAA;AACA,EAAA,MAAA,cAAA,GAAA,cAAA,CAAA;AACA,EAAA,MAAA,UAAA,GAAA,+DAAA,CAAA;AACA;AACA;AACA,EAAA,OAAA,CAAA,IAAA,KAAA;AACA,IAAA,MA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,QAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,IAAA,SAAA;AACA,QAAA,KAAA,EAAA,QAAA,CAAA,SAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,IAAA,SAAA;AACA,QAAA,MAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,EAAA;AACA,MAAA,OAAA;AACA,QAAA,QAAA,EAAA,IAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}import { isBrowserBundle } from './env.js';

/**
 * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
 * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
 */

/**
 * Checks whether we're in the Node.js or Browser environment
 *
 * @returns Answer to given question
 */
function isNodeEnv() {
  // explicitly check for browser bundles as those can be optimized statically
  // by terser/rollup.
  return (
    !isBrowserBundle() &&
    Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'
  );
}

/**
 * Requires a module which is protected against bundler minification.
 *
 * @param request The module path to resolve
 */
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
function dynamicRequire(mod, request) {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
  return mod.require(request);
}

/**
 * Helper for dynamically loading module that should work with linked dependencies.
 * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`
 * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during
 * build time. `require.resolve` is also not available in any other way, so we cannot create,
 * a fake helper like we do with `dynamicRequire`.
 *
 * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.
 * That is to mimic the behavior of `require.resolve` exactly.
 *
 * @param moduleName module name to require
 * @returns possibly required module
 */
function loadModule(moduleName) {
  let mod;

  try {
    mod = dynamicRequire(module, moduleName);
  } catch (e) {
    // no-empty
  }

  try {
    const { cwd } = dynamicRequire(module, 'process');
    mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ;
  } catch (e) {
    // no-empty
  }

  return mod;
}

export { dynamicRequire, isNodeEnv, loadModule };
//# sourceMappingURL=node.js.map
{"version":3,"file":"node.js","sources":["../../src/node.ts"],"sourcesContent":["/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\nimport { isBrowserBundle } from './env';\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nexport function isNodeEnv(): boolean {\n  // explicitly check for browser bundles as those can be optimized statically\n  // by terser/rollup.\n  return (\n    !isBrowserBundle() &&\n    Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n  );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport function dynamicRequire(mod: any, request: string): any {\n  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n  return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nexport function loadModule<T>(moduleName: string): T | undefined {\n  let mod: T | undefined;\n\n  try {\n    mod = dynamicRequire(module, moduleName);\n  } catch (e) {\n    // no-empty\n  }\n\n  try {\n    const { cwd } = dynamicRequire(module, 'process');\n    mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) as T;\n  } catch (e) {\n    // no-empty\n  }\n\n  return mod;\n}\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,GAAA;AACA;AACA;AACA,EAAA;AACA,IAAA,CAAA,eAAA,EAAA;AACA,IAAA,MAAA,CAAA,SAAA,CAAA,QAAA,CAAA,IAAA,CAAA,OAAA,OAAA,KAAA,WAAA,GAAA,OAAA,GAAA,CAAA,CAAA,KAAA,kBAAA;AACA,IAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,GAAA,EAAA,OAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA,OAAA,CAAA,OAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,UAAA,CAAA,UAAA,EAAA;AACA,EAAA,IAAA,GAAA,CAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,GAAA,GAAA,cAAA,CAAA,MAAA,EAAA,UAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,GAAA,EAAA,GAAA,cAAA,CAAA,MAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,GAAA,GAAA,cAAA,CAAA,MAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,cAAA,EAAA,UAAA,CAAA,CAAA,CAAA,EAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,GAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA;AACA;;;;"}import { isNaN, isSyntheticEvent } from './is.js';
import { memoBuilder } from './memo.js';
import { convertToPlainObject } from './object.js';
import { getFunctionName } from './stacktrace.js';

/**
 * Recursively normalizes the given object.
 *
 * - Creates a copy to prevent original input mutation
 * - Skips non-enumerable properties
 * - When stringifying, calls `toJSON` if implemented
 * - Removes circular references
 * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format
 * - Translates known global objects/classes to a string representations
 * - Takes care of `Error` object serialization
 * - Optionally limits depth of final output
 * - Optionally limits number of properties/elements included in any single object/array
 *
 * @param input The object to be normalized.
 * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)
 * @param maxProperties The max number of elements or properties to be included in any single array or
 * object in the normallized output.
 * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function normalize(input, depth = +Infinity, maxProperties = +Infinity) {
  try {
    // since we're at the outermost level, we don't provide a key
    return visit('', input, depth, maxProperties);
  } catch (err) {
    return { ERROR: `**non-serializable** (${err})` };
  }
}

/** JSDoc */
function normalizeToSize(
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  object,
  // Default Node.js REPL depth
  depth = 3,
  // 100kB, as 200kB is max payload size, so half sounds reasonable
  maxSize = 100 * 1024,
) {
  const normalized = normalize(object, depth);

  if (jsonSize(normalized) > maxSize) {
    return normalizeToSize(object, depth - 1, maxSize);
  }

  return normalized ;
}

/**
 * Visits a node to perform normalization on it
 *
 * @param key The key corresponding to the given node
 * @param value The node to be visited
 * @param depth Optional number indicating the maximum recursion depth
 * @param maxProperties Optional maximum number of properties/elements included in any single object/array
 * @param memo Optional Memo class handling decycling
 */
function visit(
  key,
  value,
  depth = +Infinity,
  maxProperties = +Infinity,
  memo = memoBuilder(),
) {
  const [memoize, unmemoize] = memo;

  // Get the simple cases out of the way first
  if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))) {
    return value ;
  }

  const stringified = stringifyValue(key, value);

  // Anything we could potentially dig into more (objects or arrays) will have come back as `"[object XXXX]"`.
  // Everything else will have already been serialized, so if we don't see that pattern, we're done.
  if (!stringified.startsWith('[object ')) {
    return stringified;
  }

  // From here on, we can assert that `value` is either an object or an array.

  // Do not normalize objects that we know have already been normalized. As a general rule, the
  // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that
  // have already been normalized.
  if ((value )['__sentry_skip_normalization__']) {
    return value ;
  }

  // Do not normalize objects that we know have already been normalized. As a general rule, the
  // "__sentry_skip_normalization__" property should only be used sparingly and only should only be set on objects that
  // have already been normalized.
  let overriddenDepth = depth;

  if (typeof (value )['__sentry_override_normalization_depth__'] === 'number') {
    overriddenDepth = (value )['__sentry_override_normalization_depth__'] ;
  }

  // We're also done if we've reached the max depth
  if (overriddenDepth === 0) {
    // At this point we know `serialized` is a string of the form `"[object XXXX]"`. Clean it up so it's just `"[XXXX]"`.
    return stringified.replace('object ', '');
  }

  // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.
  if (memoize(value)) {
    return '[Circular ~]';
  }

  // If the value has a `toJSON` method, we call it to extract more information
  const valueWithToJSON = value ;
  if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {
    try {
      const jsonValue = valueWithToJSON.toJSON();
      // We need to normalize the return value of `.toJSON()` in case it has circular references
      return visit('', jsonValue, overriddenDepth - 1, maxProperties, memo);
    } catch (err) {
      // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)
    }
  }

  // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse
  // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each
  // property/entry, and keep track of the number of items we add to it.
  const normalized = (Array.isArray(value) ? [] : {}) ;
  let numAdded = 0;

  // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant
  // properties are non-enumerable and otherwise would get missed.
  const visitable = convertToPlainObject(value );

  for (const visitKey in visitable) {
    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.
    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {
      continue;
    }

    if (numAdded >= maxProperties) {
      normalized[visitKey] = '[MaxProperties ~]';
      break;
    }

    // Recursively visit all the child nodes
    const visitValue = visitable[visitKey];
    normalized[visitKey] = visit(visitKey, visitValue, overriddenDepth - 1, maxProperties, memo);

    numAdded++;
  }

  // Once we've visited all the branches, remove the parent from memo storage
  unmemoize(value);

  // Return accumulated values
  return normalized;
}

/**
 * Stringify the given value. Handles various known special values and types.
 *
 * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn
 * the number 1231 into "[Object Number]", nor on `null`, as it will throw.
 *
 * @param value The value to stringify
 * @returns A stringified representation of the given value
 */
function stringifyValue(
  key,
  // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for
  // our internal use, it'll do
  value,
) {
  try {
    if (key === 'domain' && value && typeof value === 'object' && (value )._events) {
      return '[Domain]';
    }

    if (key === 'domainEmitter') {
      return '[DomainEmitter]';
    }

    // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first
    // which won't throw if they are not present.

    if (typeof global !== 'undefined' && value === global) {
      return '[Global]';
    }

    // eslint-disable-next-line no-restricted-globals
    if (typeof window !== 'undefined' && value === window) {
      return '[Window]';
    }

    // eslint-disable-next-line no-restricted-globals
    if (typeof document !== 'undefined' && value === document) {
      return '[Document]';
    }

    // React's SyntheticEvent thingy
    if (isSyntheticEvent(value)) {
      return '[SyntheticEvent]';
    }

    if (typeof value === 'number' && value !== value) {
      return '[NaN]';
    }

    // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)
    if (value === void 0) {
      return '[undefined]';
    }

    if (typeof value === 'function') {
      return `[Function: ${getFunctionName(value)}]`;
    }

    if (typeof value === 'symbol') {
      return `[${String(value)}]`;
    }

    // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion
    if (typeof value === 'bigint') {
      return `[BigInt: ${String(value)}]`;
    }

    // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting
    // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as
    // `"[object Object]"`. If we instead look at the constructor's name (which is the same as the name of the class),
    // we can make sure that only plain objects come out that way.
    return `[object ${getConstructorName(value)}]`;
  } catch (err) {
    return `**non-serializable** (${err})`;
  }
}

function getConstructorName(value) {
  const prototype = Object.getPrototypeOf(value);

  return prototype ? prototype.constructor.name : 'null prototype';
}

/** Calculates bytes size of input string */
function utf8Length(value) {
  // eslint-disable-next-line no-bitwise
  return ~-encodeURI(value).split(/%..|./).length;
}

/** Calculates bytes size of input object */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function jsonSize(value) {
  return utf8Length(JSON.stringify(value));
}

export { normalize, normalizeToSize, visit as walk };
//# sourceMappingURL=normalize.js.map
{"version":3,"file":"normalize.js","sources":["../../src/normalize.ts"],"sourcesContent":["import type { Primitive } from '@sentry/types';\n\nimport { isNaN, isSyntheticEvent } from './is';\nimport type { MemoFunc } from './memo';\nimport { memoBuilder } from './memo';\nimport { convertToPlainObject } from './object';\nimport { getFunctionName } from './stacktrace';\n\ntype Prototype = { constructor: (...args: unknown[]) => unknown };\n// This is a hack to placate TS, relying on the fact that technically, arrays are objects with integer keys. Normally we\n// think of those keys as actual numbers, but `arr['0']` turns out to work just as well as `arr[0]`, and doing it this\n// way lets us use a single type in the places where behave as if we are only dealing with objects, even if some of them\n// might be arrays.\ntype ObjOrArray<T> = { [key: string]: T };\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function normalize(input: unknown, depth: number = +Infinity, maxProperties: number = +Infinity): any {\n  try {\n    // since we're at the outermost level, we don't provide a key\n    return visit('', input, depth, maxProperties);\n  } catch (err) {\n    return { ERROR: `**non-serializable** (${err})` };\n  }\n}\n\n/** JSDoc */\nexport function normalizeToSize<T>(\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  object: { [key: string]: any },\n  // Default Node.js REPL depth\n  depth: number = 3,\n  // 100kB, as 200kB is max payload size, so half sounds reasonable\n  maxSize: number = 100 * 1024,\n): T {\n  const normalized = normalize(object, depth);\n\n  if (jsonSize(normalized) > maxSize) {\n    return normalizeToSize(object, depth - 1, maxSize);\n  }\n\n  return normalized as T;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n  key: string,\n  value: unknown,\n  depth: number = +Infinity,\n  maxProperties: number = +Infinity,\n  memo: MemoFunc = memoBuilder(),\n): Primitive | ObjOrArray<unknown> {\n  const [memoize, unmemoize] = memo;\n\n  // Get the simple cases out of the way first\n  if (value === null || (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))) {\n    return value as Primitive;\n  }\n\n  const stringified = stringifyValue(key, value);\n\n  // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n  // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n  if (!stringified.startsWith('[object ')) {\n    return stringified;\n  }\n\n  // From here on, we can assert that `value` is either an object or an array.\n\n  // Do not normalize objects that we know have already been normalized. As a general rule, the\n  // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n  // have already been normalized.\n  if ((value as ObjOrArray<unknown>)['__sentry_skip_normalization__']) {\n    return value as ObjOrArray<unknown>;\n  }\n\n  // Do not normalize objects that we know have already been normalized. As a general rule, the\n  // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n  // have already been normalized.\n  let overriddenDepth = depth;\n\n  if (typeof (value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] === 'number') {\n    overriddenDepth = (value as ObjOrArray<unknown>)['__sentry_override_normalization_depth__'] as number;\n  }\n\n  // We're also done if we've reached the max depth\n  if (overriddenDepth === 0) {\n    // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n    return stringified.replace('object ', '');\n  }\n\n  // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n  if (memoize(value)) {\n    return '[Circular ~]';\n  }\n\n  // If the value has a `toJSON` method, we call it to extract more information\n  const valueWithToJSON = value as unknown & { toJSON?: () => unknown };\n  if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n    try {\n      const jsonValue = valueWithToJSON.toJSON();\n      // We need to normalize the return value of `.toJSON()` in case it has circular references\n      return visit('', jsonValue, overriddenDepth - 1, maxProperties, memo);\n    } catch (err) {\n      // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n    }\n  }\n\n  // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n  // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n  // property/entry, and keep track of the number of items we add to it.\n  const normalized = (Array.isArray(value) ? [] : {}) as ObjOrArray<unknown>;\n  let numAdded = 0;\n\n  // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n  // properties are non-enumerable and otherwise would get missed.\n  const visitable = convertToPlainObject(value as ObjOrArray<unknown>);\n\n  for (const visitKey in visitable) {\n    // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n    if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n      continue;\n    }\n\n    if (numAdded >= maxProperties) {\n      normalized[visitKey] = '[MaxProperties ~]';\n      break;\n    }\n\n    // Recursively visit all the child nodes\n    const visitValue = visitable[visitKey];\n    normalized[visitKey] = visit(visitKey, visitValue, overriddenDepth - 1, maxProperties, memo);\n\n    numAdded++;\n  }\n\n  // Once we've visited all the branches, remove the parent from memo storage\n  unmemoize(value);\n\n  // Return accumulated values\n  return normalized;\n}\n\n// TODO remove this in v7 (this means the method will no longer be exported, under any name)\nexport { visit as walk };\n\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n  key: unknown,\n  // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n  // our internal use, it'll do\n  value: Exclude<unknown, string | number | boolean | null>,\n): string {\n  try {\n    if (key === 'domain' && value && typeof value === 'object' && (value as { _events: unknown })._events) {\n      return '[Domain]';\n    }\n\n    if (key === 'domainEmitter') {\n      return '[DomainEmitter]';\n    }\n\n    // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n    // which won't throw if they are not present.\n\n    if (typeof global !== 'undefined' && value === global) {\n      return '[Global]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof window !== 'undefined' && value === window) {\n      return '[Window]';\n    }\n\n    // eslint-disable-next-line no-restricted-globals\n    if (typeof document !== 'undefined' && value === document) {\n      return '[Document]';\n    }\n\n    // React's SyntheticEvent thingy\n    if (isSyntheticEvent(value)) {\n      return '[SyntheticEvent]';\n    }\n\n    if (typeof value === 'number' && value !== value) {\n      return '[NaN]';\n    }\n\n    // this catches `undefined` (but not `null`, which is a primitive and can be serialized on its own)\n    if (value === void 0) {\n      return '[undefined]';\n    }\n\n    if (typeof value === 'function') {\n      return `[Function: ${getFunctionName(value)}]`;\n    }\n\n    if (typeof value === 'symbol') {\n      return `[${String(value)}]`;\n    }\n\n    // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n    if (typeof value === 'bigint') {\n      return `[BigInt: ${String(value)}]`;\n    }\n\n    // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n    // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n    // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n    // we can make sure that only plain objects come out that way.\n    return `[object ${getConstructorName(value)}]`;\n  } catch (err) {\n    return `**non-serializable** (${err})`;\n  }\n}\n\nfunction getConstructorName(value: unknown): string {\n  const prototype: Prototype | null = Object.getPrototypeOf(value);\n\n  return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value: string): number {\n  // eslint-disable-next-line no-bitwise\n  return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value: any): number {\n  return utf8Length(JSON.stringify(value));\n}\n"],"names":[],"mappings":";;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,SAAA,CAAA,KAAA,EAAA,KAAA,GAAA,CAAA,QAAA,EAAA,aAAA,GAAA,CAAA,QAAA,EAAA;AACA,EAAA,IAAA;AACA;AACA,IAAA,OAAA,KAAA,CAAA,EAAA,EAAA,KAAA,EAAA,KAAA,EAAA,aAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,OAAA,EAAA,KAAA,EAAA,CAAA,sBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,eAAA;AACA;AACA,EAAA,MAAA;AACA;AACA,EAAA,KAAA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,GAAA,GAAA,GAAA,IAAA;AACA,EAAA;AACA,EAAA,MAAA,UAAA,GAAA,SAAA,CAAA,MAAA,EAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,CAAA,UAAA,CAAA,GAAA,OAAA,EAAA;AACA,IAAA,OAAA,eAAA,CAAA,MAAA,EAAA,KAAA,GAAA,CAAA,EAAA,OA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A;AACA,MAAA,OAAA,CAAA,WAAA,EAAA,eAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,IAAA,OAAA,KAAA,KAAA,QAAA,EAAA;AACA,MAAA,OAAA,CAAA,CAAA,EAAA,MAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,IAAA,OAAA,KAAA,KAAA,QAAA,EAAA;AACA,MAAA,OAAA,CAAA,SAAA,EAAA,MAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA;AACA;AACA;AACA,IAAA,OAAA,CAAA,QAAA,EAAA,kBAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,GAAA,EAAA;AACA,IAAA,OAAA,CAAA,sBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA,MAAA,CAAA,cAAA,CAAA,KAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,SAAA,GAAA,SAAA,CAAA,WAAA,CAAA,IAAA,GAAA,gBAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,UAAA,CAAA,KAAA,EAAA;AACA;AACA,EAAA,OAAA,CAAA,CAAA,SAAA,CAAA,KAAA,CAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,UAAA,CAAA,IAAA,CAAA,SAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { htmlTreeAsString } from './browser.js';
import { isError, isEvent, isInstanceOf, isElement, isPlainObject, isPrimitive } from './is.js';
import { truncate } from './string.js';

/**
 * Replace a method in an object with a wrapped version of itself.
 *
 * @param source An object that contains a method to be wrapped.
 * @param name The name of the method to be wrapped.
 * @param replacementFactory A higher-order function that takes the original version of the given method and returns a
 * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to
 * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other
 * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.
 * @returns void
 */
function fill(source, name, replacementFactory) {
  if (!(name in source)) {
    return;
  }

  const original = source[name] ;
  const wrapped = replacementFactory(original) ;

  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work
  // otherwise it'll throw "TypeError: Object.defineProperties called on non-object"
  if (typeof wrapped === 'function') {
    try {
      markFunctionWrapped(wrapped, original);
    } catch (_Oo) {
      // This can throw if multiple fill happens on a global object like XMLHttpRequest
      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043
    }
  }

  source[name] = wrapped;
}

/**
 * Defines a non-enumerable property on the given object.
 *
 * @param obj The object on which to set the property
 * @param name The name of the property to be set
 * @param value The value to which to set the property
 */
function addNonEnumerableProperty(obj, name, value) {
  Object.defineProperty(obj, name, {
    // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
    value: value,
    writable: true,
    configurable: true,
  });
}

/**
 * Remembers the original function on the wrapped function and
 * patches up the prototype.
 *
 * @param wrapped the wrapper function
 * @param original the original function that gets wrapped
 */
function markFunctionWrapped(wrapped, original) {
  const proto = original.prototype || {};
  wrapped.prototype = original.prototype = proto;
  addNonEnumerableProperty(wrapped, '__sentry_original__', original);
}

/**
 * This extracts the original function if available.  See
 * `markFunctionWrapped` for more information.
 *
 * @param func the function to unwrap
 * @returns the unwrapped version of the function if available.
 */
function getOriginalFunction(func) {
  return func.__sentry_original__;
}

/**
 * Encodes given object into url-friendly format
 *
 * @param object An object that contains serializable values
 * @returns string Encoded
 */
function urlEncode(object) {
  return Object.keys(object)
    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)
    .join('&');
}

/**
 * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their
 * non-enumerable properties attached.
 *
 * @param value Initial source that we have to transform in order for it to be usable by the serializer
 * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor
 *  an Error.
 */
function convertToPlainObject(value)

 {
  if (isError(value)) {
    return {
      message: value.message,
      name: value.name,
      stack: value.stack,
      ...getOwnProperties(value),
    };
  } else if (isEvent(value)) {
    const newObj

 = {
      type: value.type,
      target: serializeEventTarget(value.target),
      currentTarget: serializeEventTarget(value.currentTarget),
      ...getOwnProperties(value),
    };

    if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {
      newObj.detail = value.detail;
    }

    return newObj;
  } else {
    return value;
  }
}

/** Creates a string representation of the target of an `Event` object */
function serializeEventTarget(target) {
  try {
    return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);
  } catch (_oO) {
    return '<unknown>';
  }
}

/** Filters out all but an object's own properties */
function getOwnProperties(obj) {
  if (typeof obj === 'object' && obj !== null) {
    const extractedProps = {};
    for (const property in obj) {
      if (Object.prototype.hasOwnProperty.call(obj, property)) {
        extractedProps[property] = (obj )[property];
      }
    }
    return extractedProps;
  } else {
    return {};
  }
}

/**
 * Given any captured exception, extract its keys and create a sorted
 * and truncated list that will be used inside the event message.
 * eg. `Non-error exception captured with keys: foo, bar, baz`
 */
function extractExceptionKeysForMessage(exception, maxLength = 40) {
  const keys = Object.keys(convertToPlainObject(exception));
  keys.sort();

  if (!keys.length) {
    return '[object has no keys]';
  }

  if (keys[0].length >= maxLength) {
    return truncate(keys[0], maxLength);
  }

  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {
    const serialized = keys.slice(0, includedKeys).join(', ');
    if (serialized.length > maxLength) {
      continue;
    }
    if (includedKeys === keys.length) {
      return serialized;
    }
    return truncate(serialized, maxLength);
  }

  return '';
}

/**
 * Given any object, return a new object having removed all fields whose value was `undefined`.
 * Works recursively on objects and arrays.
 *
 * Attention: This function keeps circular references in the returned object.
 */
function dropUndefinedKeys(inputValue) {
  // This map keeps track of what already visited nodes map to.
  // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular
  // references as the input object.
  const memoizationMap = new Map();

  // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API
  return _dropUndefinedKeys(inputValue, memoizationMap);
}

function _dropUndefinedKeys(inputValue, memoizationMap) {
  if (isPlainObject(inputValue)) {
    // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== undefined) {
      return memoVal ;
    }

    const returnValue = {};
    // Store the mapping of this value in case we visit it again, in case of circular data
    memoizationMap.set(inputValue, returnValue);

    for (const key of Object.keys(inputValue)) {
      if (typeof inputValue[key] !== 'undefined') {
        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);
      }
    }

    return returnValue ;
  }

  if (Array.isArray(inputValue)) {
    // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object
    const memoVal = memoizationMap.get(inputValue);
    if (memoVal !== undefined) {
      return memoVal ;
    }

    const returnValue = [];
    // Store the mapping of this value in case we visit it again, in case of circular data
    memoizationMap.set(inputValue, returnValue);

    inputValue.forEach((item) => {
      returnValue.push(_dropUndefinedKeys(item, memoizationMap));
    });

    return returnValue ;
  }

  return inputValue;
}

/**
 * Ensure that something is an object.
 *
 * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper
 * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.
 *
 * @param wat The subject of the objectification
 * @returns A version of `wat` which can safely be used with `Object` class methods
 */
function objectify(wat) {
  let objectified;
  switch (true) {
    case wat === undefined || wat === null:
      objectified = new String(wat);
      break;

    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason
    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as
    // an object in order to wrap it.
    case typeof wat === 'symbol' || typeof wat === 'bigint':
      objectified = Object(wat);
      break;

    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`
    case isPrimitive(wat):
      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
      objectified = new (wat ).constructor(wat);
      break;

    // by process of elimination, at this point we know that `wat` must already be an object
    default:
      objectified = wat;
      break;
  }
  return objectified;
}

export { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, urlEncode };
//# sourceMappingURL=object.js.map
{"version":3,"file":"object.js","sources":["../../src/object.ts"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { WrappedFunction } from '@sentry/types';\n\nimport { htmlTreeAsString } from './browser';\nimport { isElement, isError, isEvent, isInstanceOf, isPlainObject, isPrimitive } from './is';\nimport { truncate } from './string';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other\n * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nexport function fill(source: { [key: string]: any }, name: string, replacementFactory: (...args: any[]) => any): void {\n  if (!(name in source)) {\n    return;\n  }\n\n  const original = source[name] as () => any;\n  const wrapped = replacementFactory(original) as WrappedFunction;\n\n  // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n  // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n  if (typeof wrapped === 'function') {\n    try {\n      markFunctionWrapped(wrapped, original);\n    } catch (_Oo) {\n      // This can throw if multiple fill happens on a global object like XMLHttpRequest\n      // Fixes https://github.com/getsentry/sentry-javascript/issues/2043\n    }\n  }\n\n  source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nexport function addNonEnumerableProperty(obj: { [key: string]: unknown }, name: string, value: unknown): void {\n  Object.defineProperty(obj, name, {\n    // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n    value: value,\n    writable: true,\n    configurable: true,\n  });\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nexport function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void {\n  const proto = original.prototype || {};\n  wrapped.prototype = original.prototype = proto;\n  addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n}\n\n/**\n * This extracts the original function if available.  See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nexport function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined {\n  return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nexport function urlEncode(object: { [key: string]: any }): string {\n  return Object.keys(object)\n    .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n    .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n *  an Error.\n */\nexport function convertToPlainObject<V>(value: V):\n  | {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    }\n  | {\n      [ownProps: string]: unknown;\n      message: string;\n      name: string;\n      stack?: string;\n    }\n  | V {\n  if (isError(value)) {\n    return {\n      message: value.message,\n      name: value.name,\n      stack: value.stack,\n      ...getOwnProperties(value),\n    };\n  } else if (isEvent(value)) {\n    const newObj: {\n      [ownProps: string]: unknown;\n      type: string;\n      target: string;\n      currentTarget: string;\n      detail?: unknown;\n    } = {\n      type: value.type,\n      target: serializeEventTarget(value.target),\n      currentTarget: serializeEventTarget(value.currentTarget),\n      ...getOwnProperties(value),\n    };\n\n    if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n      newObj.detail = value.detail;\n    }\n\n    return newObj;\n  } else {\n    return value;\n  }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target: unknown): string {\n  try {\n    return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n  } catch (_oO) {\n    return '<unknown>';\n  }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj: unknown): { [key: string]: unknown } {\n  if (typeof obj === 'object' && obj !== null) {\n    const extractedProps: { [key: string]: unknown } = {};\n    for (const property in obj) {\n      if (Object.prototype.hasOwnProperty.call(obj, property)) {\n        extractedProps[property] = (obj as Record<string, unknown>)[property];\n      }\n    }\n    return extractedProps;\n  } else {\n    return {};\n  }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nexport function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string {\n  const keys = Object.keys(convertToPlainObject(exception));\n  keys.sort();\n\n  if (!keys.length) {\n    return '[object has no keys]';\n  }\n\n  if (keys[0].length >= maxLength) {\n    return truncate(keys[0], maxLength);\n  }\n\n  for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n    const serialized = keys.slice(0, includedKeys).join(', ');\n    if (serialized.length > maxLength) {\n      continue;\n    }\n    if (includedKeys === keys.length) {\n      return serialized;\n    }\n    return truncate(serialized, maxLength);\n  }\n\n  return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nexport function dropUndefinedKeys<T>(inputValue: T): T {\n  // This map keeps track of what already visited nodes map to.\n  // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n  // references as the input object.\n  const memoizationMap = new Map<unknown, unknown>();\n\n  // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n  return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys<T>(inputValue: T, memoizationMap: Map<unknown, unknown>): T {\n  if (isPlainObject(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: { [key: string]: any } = {};\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    for (const key of Object.keys(inputValue)) {\n      if (typeof inputValue[key] !== 'undefined') {\n        returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n      }\n    }\n\n    return returnValue as T;\n  }\n\n  if (Array.isArray(inputValue)) {\n    // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n    const memoVal = memoizationMap.get(inputValue);\n    if (memoVal !== undefined) {\n      return memoVal as T;\n    }\n\n    const returnValue: unknown[] = [];\n    // Store the mapping of this value in case we visit it again, in case of circular data\n    memoizationMap.set(inputValue, returnValue);\n\n    inputValue.forEach((item: unknown) => {\n      returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n    });\n\n    return returnValue as unknown as T;\n  }\n\n  return inputValue;\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nexport function objectify(wat: unknown): typeof Object {\n  let objectified;\n  switch (true) {\n    case wat === undefined || wat === null:\n      objectified = new String(wat);\n      break;\n\n    // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n    // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n    // an object in order to wrap it.\n    case typeof wat === 'symbol' || typeof wat === 'bigint':\n      objectified = Object(wat);\n      break;\n\n    // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n    case isPrimitive(wat):\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n      objectified = new (wat as any).constructor(wat);\n      break;\n\n    // by process of elimination, at this point we know that `wat` must already be an object\n    default:\n      objectified = wat;\n      break;\n  }\n  return objectified;\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,MAAA,EAAA,IAAA,EAAA,kBAAA,EAAA;AACA,EAAA,IAAA,EAAA,IAAA,IAAA,MAAA,CAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,MAAA,CAAA,IAAA,CAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,kBAAA,CAAA,QAAA,CAAA,EAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,OAAA,OAAA,KAAA,UAAA,EAAA;AACA,IAAA,IAAA;AACA,MAAA,mBAAA,CAAA,OAAA,EAAA,QAAA,CAAA,CAAA;AACA,KAAA,CAAA,OAAA,GAAA,EAAA;AACA;AACA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,CAAA,IAAA,CAAA,GAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,GAAA,EAAA,IAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,CAAA,cAAA,CAAA,GAAA,EAAA,IAAA,EAAA;AACA;AACA,IAAA,KAAA,EAAA,KAAA;AACA,IAAA,QAAA,EAAA,IAAA;AACA,IAAA,YAAA,EAAA,IAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,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AA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,WAAA,CAAA;AACA,EAAA,QAAA,IAAA;AACA,IAAA,KAAA,GAAA,KAAA,SAAA,IAAA,GAAA,KAAA,IAAA;AACA,MAAA,WAAA,GAAA,IAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA;AACA;AACA,IAAA,KAAA,OAAA,GAAA,KAAA,QAAA,IAAA,OAAA,GAAA,KAAA,QAAA;AACA,MAAA,WAAA,GAAA,MAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA,IAAA,KAAA,WAAA,CAAA,GAAA,CAAA;AACA;AACA,MAAA,WAAA,GAAA,IAAA,CAAA,GAAA,GAAA,WAAA,CAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA;AACA;AACA,IAAA;AACA,MAAA,WAAA,GAAA,GAAA,CAAA;AACA,MAAA,MAAA;AACA,GAAA;AACA,EAAA,OAAA,WAAA,CAAA;AACA;;;;"}// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript
// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js
//
// Copyright Joyent, Inc.and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

/** JSDoc */
function normalizeArray(parts, allowAboveRoot) {
  // if the path tries to go above the root, `up` ends up > 0
  let up = 0;
  for (let i = parts.length - 1; i >= 0; i--) {
    const last = parts[i];
    if (last === '.') {
      parts.splice(i, 1);
    } else if (last === '..') {
      parts.splice(i, 1);
      up++;
    } else if (up) {
      parts.splice(i, 1);
      up--;
    }
  }

  // if the path is allowed to go above the root, restore leading ..s
  if (allowAboveRoot) {
    for (; up--; up) {
      parts.unshift('..');
    }
  }

  return parts;
}

// Split a filename into [root, dir, basename, ext], unix version
// 'root' is just a slash, or nothing.
const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;
/** JSDoc */
function splitPath(filename) {
  const parts = splitPathRe.exec(filename);
  return parts ? parts.slice(1) : [];
}

// path.resolve([from ...], to)
// posix version
/** JSDoc */
function resolve(...args) {
  let resolvedPath = '';
  let resolvedAbsolute = false;

  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
    const path = i >= 0 ? args[i] : '/';

    // Skip empty entries
    if (!path) {
      continue;
    }

    resolvedPath = `${path}/${resolvedPath}`;
    resolvedAbsolute = path.charAt(0) === '/';
  }

  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when process.cwd() fails)

  // Normalize the path
  resolvedPath = normalizeArray(
    resolvedPath.split('/').filter(p => !!p),
    !resolvedAbsolute,
  ).join('/');

  return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';
}

/** JSDoc */
function trim(arr) {
  let start = 0;
  for (; start < arr.length; start++) {
    if (arr[start] !== '') {
      break;
    }
  }

  let end = arr.length - 1;
  for (; end >= 0; end--) {
    if (arr[end] !== '') {
      break;
    }
  }

  if (start > end) {
    return [];
  }
  return arr.slice(start, end - start + 1);
}

// path.relative(from, to)
// posix version
/** JSDoc */
function relative(from, to) {
  /* eslint-disable no-param-reassign */
  from = resolve(from).slice(1);
  to = resolve(to).slice(1);
  /* eslint-enable no-param-reassign */

  const fromParts = trim(from.split('/'));
  const toParts = trim(to.split('/'));

  const length = Math.min(fromParts.length, toParts.length);
  let samePartsLength = length;
  for (let i = 0; i < length; i++) {
    if (fromParts[i] !== toParts[i]) {
      samePartsLength = i;
      break;
    }
  }

  let outputParts = [];
  for (let i = samePartsLength; i < fromParts.length; i++) {
    outputParts.push('..');
  }

  outputParts = outputParts.concat(toParts.slice(samePartsLength));

  return outputParts.join('/');
}

// path.normalize(path)
// posix version
/** JSDoc */
function normalizePath(path) {
  const isPathAbsolute = isAbsolute(path);
  const trailingSlash = path.slice(-1) === '/';

  // Normalize the path
  let normalizedPath = normalizeArray(
    path.split('/').filter(p => !!p),
    !isPathAbsolute,
  ).join('/');

  if (!normalizedPath && !isPathAbsolute) {
    normalizedPath = '.';
  }
  if (normalizedPath && trailingSlash) {
    normalizedPath += '/';
  }

  return (isPathAbsolute ? '/' : '') + normalizedPath;
}

// posix version
/** JSDoc */
function isAbsolute(path) {
  return path.charAt(0) === '/';
}

// posix version
/** JSDoc */
function join(...args) {
  return normalizePath(args.join('/'));
}

/** JSDoc */
function dirname(path) {
  const result = splitPath(path);
  const root = result[0];
  let dir = result[1];

  if (!root && !dir) {
    // No dirname whatsoever
    return '.';
  }

  if (dir) {
    // It has a dirname, strip trailing slash
    dir = dir.slice(0, dir.length - 1);
  }

  return root + dir;
}

/** JSDoc */
function basename(path, ext) {
  let f = splitPath(path)[2];
  if (ext && f.slice(ext.length * -1) === ext) {
    f = f.slice(0, f.length - ext.length);
  }
  return f;
}

export { basename, dirname, isAbsolute, join, normalizePath, relative, resolve };
//# sourceMappingURL=path.js.map
{"version":3,"file":"path.js","sources":["../../src/path.ts"],"sourcesContent":["// Slightly modified (no IE8 support, ES6) and transcribed to TypeScript\n// https://github.com/calvinmetcalf/rollup-plugin-node-builtins/blob/63ab8aacd013767445ca299e468d9a60a95328d7/src/es6/path.js\n//\n// Copyright Joyent, Inc.and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n/** JSDoc */\nfunction normalizeArray(parts: string[], allowAboveRoot?: boolean): string[] {\n  // if the path tries to go above the root, `up` ends up > 0\n  let up = 0;\n  for (let i = parts.length - 1; i >= 0; i--) {\n    const last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nconst splitPathRe = /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^/]+?|)(\\.[^./]*|))(?:[/]*)$/;\n/** JSDoc */\nfunction splitPath(filename: string): string[] {\n  const parts = splitPathRe.exec(filename);\n  return parts ? parts.slice(1) : [];\n}\n\n// path.resolve([from ...], to)\n// posix version\n/** JSDoc */\nexport function resolve(...args: string[]): string {\n  let resolvedPath = '';\n  let resolvedAbsolute = false;\n\n  for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    const path = i >= 0 ? args[i] : '/';\n\n    // Skip empty entries\n    if (!path) {\n      continue;\n    }\n\n    resolvedPath = `${path}/${resolvedPath}`;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(\n    resolvedPath.split('/').filter(p => !!p),\n    !resolvedAbsolute,\n  ).join('/');\n\n  return (resolvedAbsolute ? '/' : '') + resolvedPath || '.';\n}\n\n/** JSDoc */\nfunction trim(arr: string[]): string[] {\n  let start = 0;\n  for (; start < arr.length; start++) {\n    if (arr[start] !== '') {\n      break;\n    }\n  }\n\n  let end = arr.length - 1;\n  for (; end >= 0; end--) {\n    if (arr[end] !== '') {\n      break;\n    }\n  }\n\n  if (start > end) {\n    return [];\n  }\n  return arr.slice(start, end - start + 1);\n}\n\n// path.relative(from, to)\n// posix version\n/** JSDoc */\nexport function relative(from: string, to: string): string {\n  /* eslint-disable no-param-reassign */\n  from = resolve(from).slice(1);\n  to = resolve(to).slice(1);\n  /* eslint-enable no-param-reassign */\n\n  const fromParts = trim(from.split('/'));\n  const toParts = trim(to.split('/'));\n\n  const length = Math.min(fromParts.length, toParts.length);\n  let samePartsLength = length;\n  for (let i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  let outputParts = [];\n  for (let i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n}\n\n// path.normalize(path)\n// posix version\n/** JSDoc */\nexport function normalizePath(path: string): string {\n  const isPathAbsolute = isAbsolute(path);\n  const trailingSlash = path.slice(-1) === '/';\n\n  // Normalize the path\n  let normalizedPath = normalizeArray(\n    path.split('/').filter(p => !!p),\n    !isPathAbsolute,\n  ).join('/');\n\n  if (!normalizedPath && !isPathAbsolute) {\n    normalizedPath = '.';\n  }\n  if (normalizedPath && trailingSlash) {\n    normalizedPath += '/';\n  }\n\n  return (isPathAbsolute ? '/' : '') + normalizedPath;\n}\n\n// posix version\n/** JSDoc */\nexport function isAbsolute(path: string): boolean {\n  return path.charAt(0) === '/';\n}\n\n// posix version\n/** JSDoc */\nexport function join(...args: string[]): string {\n  return normalizePath(args.join('/'));\n}\n\n/** JSDoc */\nexport function dirname(path: string): string {\n  const result = splitPath(path);\n  const root = result[0];\n  let dir = result[1];\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    return '.';\n  }\n\n  if (dir) {\n    // It has a dirname, strip trailing slash\n    dir = dir.slice(0, dir.length - 1);\n  }\n\n  return root + dir;\n}\n\n/** JSDoc */\nexport function basename(path: string, ext?: string): string {\n  let f = splitPath(path)[2];\n  if (ext && f.slice(ext.length * -1) === ext) {\n    f = f.slice(0, f.length - ext.length);\n  }\n  return f;\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,cAAA,CAAA,KAAA,EAAA,cAAA,EAAA;AACA;AACA,EAAA,IAAA,EAAA,GAAA,CAAA,CAAA;AACA,EAAA,KAAA,IAAA,CAAA,GAAA,KAAA,CAAA,MAAA,GAAA,CAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,EAAA,EAAA;AACA,IAAA,MAAA,IAAA,GAAA,KAAA,CAAA,CAAA,CAAA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GAAA,EAAA;AACA;AACA,IAAA,OAAA,GAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,GAAA,EAAA;AACA;AACA,IAAA,GAAA,GAAA,GAAA,CAAA,KAAA,CAAA,CAAA,EAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,IAAA,GAAA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,QAAA,CAAA,IAAA,EAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,EAAA,IAAA,GAAA,IAAA,CAAA,CAAA,KAAA,CAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,CAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,CAAA,CAAA,MAAA,GAAA,GAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,OAAA,CAAA,CAAA;AACA;;;;"}import { SentryError } from './error.js';
import { rejectedSyncPromise, SyncPromise, resolvedSyncPromise } from './syncpromise.js';

/**
 * Creates an new PromiseBuffer object with the specified limit
 * @param limit max number of promises that can be stored in the buffer
 */
function makePromiseBuffer(limit) {
  const buffer = [];

  function isReady() {
    return limit === undefined || buffer.length < limit;
  }

  /**
   * Remove a promise from the queue.
   *
   * @param task Can be any PromiseLike<T>
   * @returns Removed promise.
   */
  function remove(task) {
    return buffer.splice(buffer.indexOf(task), 1)[0];
  }

  /**
   * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.
   *
   * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:
   *        PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor
   *        functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By
   *        requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer
   *        limit check.
   * @returns The original promise.
   */
  function add(taskProducer) {
    if (!isReady()) {
      return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));
    }

    // start the task and add its promise to the queue
    const task = taskProducer();
    if (buffer.indexOf(task) === -1) {
      buffer.push(task);
    }
    void task
      .then(() => remove(task))
      // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`
      // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't
      // have promises, so TS has to polyfill when down-compiling.)
      .then(null, () =>
        remove(task).then(null, () => {
          // We have to add another catch here because `remove()` starts a new promise chain.
        }),
      );
    return task;
  }

  /**
   * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.
   *
   * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or
   * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to
   * `true`.
   * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and
   * `false` otherwise
   */
  function drain(timeout) {
    return new SyncPromise((resolve, reject) => {
      let counter = buffer.length;

      if (!counter) {
        return resolve(true);
      }

      // wait for `timeout` ms and then resolve to `false` (if not cancelled first)
      const capturedSetTimeout = setTimeout(() => {
        if (timeout && timeout > 0) {
          resolve(false);
        }
      }, timeout);

      // if all promises resolve in time, cancel the timer and resolve to `true`
      buffer.forEach(item => {
        void resolvedSyncPromise(item).then(() => {
          if (!--counter) {
            clearTimeout(capturedSetTimeout);
            resolve(true);
          }
        }, reject);
      });
    });
  }

  return {
    $: buffer,
    add,
    drain,
  };
}

export { makePromiseBuffer };
//# sourceMappingURL=promisebuffer.js.map
{"version":3,"file":"promisebuffer.js","sources":["../../src/promisebuffer.ts"],"sourcesContent":["import { SentryError } from './error';\nimport { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './syncpromise';\n\nexport interface PromiseBuffer<T> {\n  // exposes the internal array so tests can assert on the state of it.\n  // XXX: this really should not be public api.\n  $: Array<PromiseLike<T>>;\n  add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;\n  drain(timeout?: number): PromiseLike<boolean>;\n}\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nexport function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T> {\n  const buffer: Array<PromiseLike<T>> = [];\n\n  function isReady(): boolean {\n    return limit === undefined || buffer.length < limit;\n  }\n\n  /**\n   * Remove a promise from the queue.\n   *\n   * @param task Can be any PromiseLike<T>\n   * @returns Removed promise.\n   */\n  function remove(task: PromiseLike<T>): PromiseLike<T> {\n    return buffer.splice(buffer.indexOf(task), 1)[0];\n  }\n\n  /**\n   * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n   *\n   * @param taskProducer A function producing any PromiseLike<T>; In previous versions this used to be `task:\n   *        PromiseLike<T>`, but under that model, Promises were instantly created on the call-site and their executor\n   *        functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n   *        requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n   *        limit check.\n   * @returns The original promise.\n   */\n  function add(taskProducer: () => PromiseLike<T>): PromiseLike<T> {\n    if (!isReady()) {\n      return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n    }\n\n    // start the task and add its promise to the queue\n    const task = taskProducer();\n    if (buffer.indexOf(task) === -1) {\n      buffer.push(task);\n    }\n    void task\n      .then(() => remove(task))\n      // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n      // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n      // have promises, so TS has to polyfill when down-compiling.)\n      .then(null, () =>\n        remove(task).then(null, () => {\n          // We have to add another catch here because `remove()` starts a new promise chain.\n        }),\n      );\n    return task;\n  }\n\n  /**\n   * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n   *\n   * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n   * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n   * `true`.\n   * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n   * `false` otherwise\n   */\n  function drain(timeout?: number): PromiseLike<boolean> {\n    return new SyncPromise<boolean>((resolve, reject) => {\n      let counter = buffer.length;\n\n      if (!counter) {\n        return resolve(true);\n      }\n\n      // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n      const capturedSetTimeout = setTimeout(() => {\n        if (timeout && timeout > 0) {\n          resolve(false);\n        }\n      }, timeout);\n\n      // if all promises resolve in time, cancel the timer and resolve to `true`\n      buffer.forEach(item => {\n        void resolvedSyncPromise(item).then(() => {\n          if (!--counter) {\n            clearTimeout(capturedSetTimeout);\n            resolve(true);\n          }\n        }, reject);\n      });\n    });\n  }\n\n  return {\n    $: buffer,\n    add,\n    drain,\n  };\n}\n"],"names":[],"mappings":";;;AAWA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,KAAA,EAAA;AACA,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA;AACA;AACA,EAAA,SAAA,OAAA,GAAA;AACA,IAAA,OAAA,KAAA,KAAA,SAAA,IAAA,MAAA,CAAA,MAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,SAAA,MAAA,CAAA,IAAA,EAAA;AACA,IAAA,OAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,OAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,SAAA,GAAA,CAAA,YAAA,EAAA;AACA,IAAA,IAAA,CAAA,OAAA,EAAA,EAAA;AACA,MAAA,OAAA,mBAAA,CAAA,IAAA,WAAA,CAAA,sDAAA,CAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA;AACA,IAAA,MAAA,IAAA,GAAA,YAAA,EA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AA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,CAAA,EAAA,MAAA;AACA,IAAA,GAAA;AACA,IAAA,KAAA;AACA,GAAA,CAAA;AACA;;;;"}// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend

const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds

/**
 * Extracts Retry-After value from the request header or returns default value
 * @param header string representation of 'Retry-After' header
 * @param now current unix timestamp
 *
 */
function parseRetryAfterHeader(header, now = Date.now()) {
  const headerDelay = parseInt(`${header}`, 10);
  if (!isNaN(headerDelay)) {
    return headerDelay * 1000;
  }

  const headerDate = Date.parse(`${header}`);
  if (!isNaN(headerDate)) {
    return headerDate - now;
  }

  return DEFAULT_RETRY_AFTER;
}

/**
 * Gets the time that the given category is disabled until for rate limiting.
 * In case no category-specific limit is set but a general rate limit across all categories is active,
 * that time is returned.
 *
 * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.
 */
function disabledUntil(limits, category) {
  return limits[category] || limits.all || 0;
}

/**
 * Checks if a category is rate limited
 */
function isRateLimited(limits, category, now = Date.now()) {
  return disabledUntil(limits, category) > now;
}

/**
 * Update ratelimits from incoming headers.
 *
 * @return the updated RateLimits object.
 */
function updateRateLimits(
  limits,
  { statusCode, headers },
  now = Date.now(),
) {
  const updatedRateLimits = {
    ...limits,
  };

  // "The name is case-insensitive."
  // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get
  const rateLimitHeader = headers && headers['x-sentry-rate-limits'];
  const retryAfterHeader = headers && headers['retry-after'];

  if (rateLimitHeader) {
    /**
     * rate limit headers are of the form
     *     <header>,<header>,..
     * where each <header> is of the form
     *     <retry_after>: <categories>: <scope>: <reason_code>
     * where
     *     <retry_after> is a delay in seconds
     *     <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form
     *         <category>;<category>;...
     *     <scope> is what's being limited (org, project, or key) - ignored by SDK
     *     <reason_code> is an arbitrary string like "org_quota" - ignored by SDK
     */
    for (const limit of rateLimitHeader.trim().split(',')) {
      const [retryAfter, categories] = limit.split(':', 2);
      const headerDelay = parseInt(retryAfter, 10);
      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default
      if (!categories) {
        updatedRateLimits.all = now + delay;
      } else {
        for (const category of categories.split(';')) {
          updatedRateLimits[category] = now + delay;
        }
      }
    }
  } else if (retryAfterHeader) {
    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);
  } else if (statusCode === 429) {
    updatedRateLimits.all = now + 60 * 1000;
  }

  return updatedRateLimits;
}

export { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };
//# sourceMappingURL=ratelimit.js.map
{"version":3,"file":"ratelimit.js","sources":["../../src/ratelimit.ts"],"sourcesContent":["import type { TransportMakeRequestResponse } from '@sentry/types';\n\n// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\nexport type RateLimits = Record<string, number>;\n\nexport const DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nexport function parseRetryAfterHeader(header: string, now: number = Date.now()): number {\n  const headerDelay = parseInt(`${header}`, 10);\n  if (!isNaN(headerDelay)) {\n    return headerDelay * 1000;\n  }\n\n  const headerDate = Date.parse(`${header}`);\n  if (!isNaN(headerDate)) {\n    return headerDate - now;\n  }\n\n  return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nexport function disabledUntil(limits: RateLimits, category: string): number {\n  return limits[category] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nexport function isRateLimited(limits: RateLimits, category: string, now: number = Date.now()): boolean {\n  return disabledUntil(limits, category) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nexport function updateRateLimits(\n  limits: RateLimits,\n  { statusCode, headers }: TransportMakeRequestResponse,\n  now: number = Date.now(),\n): RateLimits {\n  const updatedRateLimits: RateLimits = {\n    ...limits,\n  };\n\n  // \"The name is case-insensitive.\"\n  // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n  const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n  const retryAfterHeader = headers && headers['retry-after'];\n\n  if (rateLimitHeader) {\n    /**\n     * rate limit headers are of the form\n     *     <header>,<header>,..\n     * where each <header> is of the form\n     *     <retry_after>: <categories>: <scope>: <reason_code>\n     * where\n     *     <retry_after> is a delay in seconds\n     *     <categories> is the event type(s) (error, transaction, etc) being rate limited and is of the form\n     *         <category>;<category>;...\n     *     <scope> is what's being limited (org, project, or key) - ignored by SDK\n     *     <reason_code> is an arbitrary string like \"org_quota\" - ignored by SDK\n     */\n    for (const limit of rateLimitHeader.trim().split(',')) {\n      const [retryAfter, categories] = limit.split(':', 2);\n      const headerDelay = parseInt(retryAfter, 10);\n      const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n      if (!categories) {\n        updatedRateLimits.all = now + delay;\n      } else {\n        for (const category of categories.split(';')) {\n          updatedRateLimits[category] = now + delay;\n        }\n      }\n    }\n  } else if (retryAfterHeader) {\n    updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n  } else if (statusCode === 429) {\n    updatedRateLimits.all = now + 60 * 1000;\n  }\n\n  return updatedRateLimits;\n}\n"],"names":[],"mappings":"AAEA;;AAGA,MAAA,mBAAA,GAAA,EAAA,GAAA,KAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,MAAA,EAAA,GAAA,GAAA,IAAA,CAAA,GAAA,EAAA,EAAA;AACA,EAAA,MAAA,WAAA,GAAA,QAAA,CAAA,CAAA,EAAA,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A;AACA;AACA;AACA;AACA,IAAA,KAAA,MAAA,KAAA,IAAA,eAAA,CAAA,IAAA,EAAA,CAAA,KAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,MAAA,CAAA,UAAA,EAAA,UAAA,CAAA,GAAA,KAAA,CAAA,KAAA,CAAA,GAAA,EAAA,CAAA,CAAA,CAAA;AACA,MAAA,MAAA,WAAA,GAAA,QAAA,CAAA,UAAA,EAAA,EAAA,CAAA,CAAA;AACA,MAAA,MAAA,KAAA,GAAA,CAAA,CAAA,KAAA,CAAA,WAAA,CAAA,GAAA,WAAA,GAAA,EAAA,IAAA,IAAA,CAAA;AACA,MAAA,IAAA,CAAA,UAAA,EAAA;AACA,QAAA,iBAAA,CAAA,GAAA,GAAA,GAAA,GAAA,KAAA,CAAA;AACA,OAAA,MAAA;AACA,QAAA,KAAA,MAAA,QAAA,IAAA,UAAA,CAAA,KAAA,CAAA,GAAA,CAAA,EAAA;AACA,UAAA,iBAAA,CAAA,QAAA,CAAA,GAAA,GAAA,GAAA,KAAA,CAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA;AACA,GAAA,MAAA,IAAA,gBAAA,EAAA;AACA,IAAA,iBAAA,CAAA,GAAA,GAAA,GAAA,GAAA,qBAAA,CAAA,gBAAA,EAAA,GAAA,CAAA,CAAA;AACA,GAAA,MAAA,IAAA,UAAA,KAAA,GAAA,EAAA;AACA,IAAA,iBAAA,CAAA,GAAA,GAAA,GAAA,GAAA,EAAA,GAAA,IAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,iBAAA,CAAA;AACA;;;;"}import { isString, isPlainObject } from './is.js';
import { normalize } from './normalize.js';
import { stripUrlQueryAndFragment } from './url.js';

const DEFAULT_INCLUDES = {
  ip: false,
  request: true,
  transaction: true,
  user: true,
};
const DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];
const DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];

/**
 * Sets parameterized route as transaction name e.g.: `GET /users/:id`
 * Also adds more context data on the transaction from the request
 */
function addRequestDataToTransaction(
  transaction,
  req,
  deps,
) {
  if (!transaction) return;
  if (!transaction.metadata.source || transaction.metadata.source === 'url') {
    // Attempt to grab a parameterized route off of the request
    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));
  }
  transaction.setData('url', req.originalUrl || req.url);
  if (req.baseUrl) {
    transaction.setData('baseUrl', req.baseUrl);
  }
  transaction.setData('query', extractQueryParams(req, deps));
}

/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
function extractPathForTransaction(
  req,
  options = {},
) {
  const method = req.method && req.method.toUpperCase();

  let path = '';
  let source = 'url';

  // Check to see if there's a parameterized route we can use (as there is in Express)
  if (options.customRoute || req.route) {
    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;
    source = 'route';
  }

  // Otherwise, just take the original URL
  else if (req.originalUrl || req.url) {
    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');
  }

  let name = '';
  if (options.method && method) {
    name += method;
  }
  if (options.method && options.path) {
    name += ' ';
  }
  if (options.path && path) {
    name += path;
  }

  return [name, source];
}

/** JSDoc */
function extractTransaction(req, type) {
  switch (type) {
    case 'path': {
      return extractPathForTransaction(req, { path: true })[0];
    }
    case 'handler': {
      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';
    }
    case 'methodPath':
    default: {
      return extractPathForTransaction(req, { path: true, method: true })[0];
    }
  }
}

/** JSDoc */
function extractUserData(
  user

,
  keys,
) {
  const extractedUser = {};
  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;

  attributes.forEach(key => {
    if (user && key in user) {
      extractedUser[key] = user[key];
    }
  });

  return extractedUser;
}

/**
 * Normalize data from the request object, accounting for framework differences.
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 * @returns An object containing normalized request data
 */
function extractRequestData(
  req,
  options

,
) {
  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};
  const requestData = {};

  // headers:
  //   node, express, koa, nextjs: req.headers
  const headers = (req.headers || {})

;
  // method:
  //   node, express, koa, nextjs: req.method
  const method = req.method;
  // host:
  //   express: req.hostname in > 4 and req.host in < 4
  //   koa: req.host
  //   node, nextjs: req.headers.host
  const host = req.hostname || req.host || headers.host || '<no host>';
  // protocol:
  //   node, nextjs: <n/a>
  //   express, koa: req.protocol
  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  const originalUrl = req.originalUrl || req.url || '';
  // absolute url
  const absoluteUrl = `${protocol}://${host}${originalUrl}`;
  include.forEach(key => {
    switch (key) {
      case 'headers': {
        requestData.headers = headers;
        break;
      }
      case 'method': {
        requestData.method = method;
        break;
      }
      case 'url': {
        requestData.url = absoluteUrl;
        break;
      }
      case 'cookies': {
        // cookies:
        //   node, express, koa: req.headers.cookie
        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.cookies =
          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
          // come off in v8
          req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {};
        break;
      }
      case 'query_string': {
        // query string:
        //   node: req.url (raw)
        //   express, koa, nextjs: req.query
        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
        requestData.query_string = extractQueryParams(req, deps);
        break;
      }
      case 'data': {
        if (method === 'GET' || method === 'HEAD') {
          break;
        }
        // body data:
        //   express, koa, nextjs: req.body
        //
        //   when using node by itself, you have to read the incoming stream(see
        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know
        //   where they're going to store the final result, so they'll have to capture this data themselves
        if (req.body !== undefined) {
          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));
        }
        break;
      }
      default: {
        if ({}.hasOwnProperty.call(req, key)) {
          requestData[key] = (req )[key];
        }
      }
    }
  });

  return requestData;
}

/**
 * Options deciding what parts of the request to use when enhancing an event
 */

/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 * @param options.deps Injected platform-specific dependencies
 * @hidden
 */
function addRequestDataToEvent(
  event,
  req,
  options,
) {
  const include = {
    ...DEFAULT_INCLUDES,
    ...(options && options.include),
  };

  if (include.request) {
    const extractedRequestData = Array.isArray(include.request)
      ? extractRequestData(req, { include: include.request, deps: options && options.deps })
      : extractRequestData(req, { deps: options && options.deps });

    event.request = {
      ...event.request,
      ...extractedRequestData,
    };
  }

  if (include.user) {
    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};

    if (Object.keys(extractedUser).length) {
      event.user = {
        ...event.user,
        ...extractedUser,
      };
    }
  }

  // client ip:
  //   node, nextjs: req.socket.remoteAddress
  //   express, koa: req.ip
  if (include.ip) {
    const ip = req.ip || (req.socket && req.socket.remoteAddress);
    if (ip) {
      event.user = {
        ...event.user,
        ip_address: ip,
      };
    }
  }

  if (include.transaction && !event.transaction) {
    // TODO do we even need this anymore?
    // TODO make this work for nextjs
    event.transaction = extractTransaction(req, include.transaction);
  }

  return event;
}

function extractQueryParams(
  req,
  deps,
) {
  // url (including path and query string):
  //   node, express: req.originalUrl
  //   koa, nextjs: req.url
  let originalUrl = req.originalUrl || req.url || '';

  if (!originalUrl) {
    return;
  }

  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and
  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.
  if (originalUrl.startsWith('/')) {
    originalUrl = `http://dogs.are.great${originalUrl}`;
  }

  return (
    req.query ||
    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||
    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
    (deps && deps.url && deps.url.parse(originalUrl).query) ||
    undefined
  );
}

export { addRequestDataToEvent, addRequestDataToTransaction, extractPathForTransaction, extractRequestData };
//# sourceMappingURL=requestdata.js.map
{"version":3,"file":"requestdata.js","sources":["../../src/requestdata.ts"],"sourcesContent":["// TODO: Remove this file once equivalent integration is used everywhere\n\n/* eslint-disable complexity */\n/**\n * The functions here, which enrich an event with request data, are mostly for use in Node, but are safe for use in a\n * browser context. They live here in `@sentry/utils` rather than in `@sentry/node` so that they can be used in\n * frameworks (like nextjs), which, because of SSR, run the same code in both Node and browser contexts.\n *\n * TODO (v8 / #5257): Remove the note below\n * Note that for now, the tests for this code have to live in `@sentry/node`, since they test both these functions and\n * the backwards-compatibility-preserving wrappers which still live in `handlers.ts` there.\n */\n\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type {\n  Event,\n  ExtractedNodeRequestData,\n  PolymorphicRequest,\n  Transaction,\n  TransactionSource,\n} from '@sentry/types';\n\nimport { isPlainObject, isString } from './is';\nimport { normalize } from './normalize';\nimport { stripUrlQueryAndFragment } from './url';\n\nconst DEFAULT_INCLUDES = {\n  ip: false,\n  request: true,\n  transaction: true,\n  user: true,\n};\nconst DEFAULT_REQUEST_INCLUDES = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];\nconst DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];\n\ntype InjectedNodeDeps = {\n  cookie: {\n    parse: (cookieStr: string) => Record<string, string>;\n  };\n  url: {\n    parse: (urlStr: string) => {\n      query: string | null;\n    };\n  };\n};\n\n/**\n * Sets parameterized route as transaction name e.g.: `GET /users/:id`\n * Also adds more context data on the transaction from the request\n */\nexport function addRequestDataToTransaction(\n  transaction: Transaction | undefined,\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): void {\n  if (!transaction) return;\n  if (!transaction.metadata.source || transaction.metadata.source === 'url') {\n    // Attempt to grab a parameterized route off of the request\n    transaction.setName(...extractPathForTransaction(req, { path: true, method: true }));\n  }\n  transaction.setData('url', req.originalUrl || req.url);\n  if (req.baseUrl) {\n    transaction.setData('baseUrl', req.baseUrl);\n  }\n  transaction.setData('query', extractQueryParams(req, deps));\n}\n\n/**\n * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.\n * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.\n *\n * Additionally, this function determines and returns the transaction name source\n *\n * eg. GET /mountpoint/user/:id\n *\n * @param req A request object\n * @param options What to include in the transaction name (method, path, or a custom route name to be\n *                used instead of the request's route)\n *\n * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')\n */\nexport function extractPathForTransaction(\n  req: PolymorphicRequest,\n  options: { path?: boolean; method?: boolean; customRoute?: string } = {},\n): [string, TransactionSource] {\n  const method = req.method && req.method.toUpperCase();\n\n  let path = '';\n  let source: TransactionSource = 'url';\n\n  // Check to see if there's a parameterized route we can use (as there is in Express)\n  if (options.customRoute || req.route) {\n    path = options.customRoute || `${req.baseUrl || ''}${req.route && req.route.path}`;\n    source = 'route';\n  }\n\n  // Otherwise, just take the original URL\n  else if (req.originalUrl || req.url) {\n    path = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n  }\n\n  let name = '';\n  if (options.method && method) {\n    name += method;\n  }\n  if (options.method && options.path) {\n    name += ' ';\n  }\n  if (options.path && path) {\n    name += path;\n  }\n\n  return [name, source];\n}\n\ntype TransactionNamingScheme = 'path' | 'methodPath' | 'handler';\n\n/** JSDoc */\nfunction extractTransaction(req: PolymorphicRequest, type: boolean | TransactionNamingScheme): string {\n  switch (type) {\n    case 'path': {\n      return extractPathForTransaction(req, { path: true })[0];\n    }\n    case 'handler': {\n      return (req.route && req.route.stack && req.route.stack[0] && req.route.stack[0].name) || '<anonymous>';\n    }\n    case 'methodPath':\n    default: {\n      return extractPathForTransaction(req, { path: true, method: true })[0];\n    }\n  }\n}\n\n/** JSDoc */\nfunction extractUserData(\n  user: {\n    [key: string]: any;\n  },\n  keys: boolean | string[],\n): { [key: string]: any } {\n  const extractedUser: { [key: string]: any } = {};\n  const attributes = Array.isArray(keys) ? keys : DEFAULT_USER_INCLUDES;\n\n  attributes.forEach(key => {\n    if (user && key in user) {\n      extractedUser[key] = user[key];\n    }\n  });\n\n  return extractedUser;\n}\n\n/**\n * Normalize data from the request object, accounting for framework differences.\n *\n * @param req The request object from which to extract data\n * @param options.include An optional array of keys to include in the normalized data. Defaults to\n * DEFAULT_REQUEST_INCLUDES if not provided.\n * @param options.deps Injected, platform-specific dependencies\n * @returns An object containing normalized request data\n */\nexport function extractRequestData(\n  req: PolymorphicRequest,\n  options?: {\n    include?: string[];\n    deps?: InjectedNodeDeps;\n  },\n): ExtractedNodeRequestData {\n  const { include = DEFAULT_REQUEST_INCLUDES, deps } = options || {};\n  const requestData: { [key: string]: any } = {};\n\n  // headers:\n  //   node, express, koa, nextjs: req.headers\n  const headers = (req.headers || {}) as {\n    host?: string;\n    cookie?: string;\n  };\n  // method:\n  //   node, express, koa, nextjs: req.method\n  const method = req.method;\n  // host:\n  //   express: req.hostname in > 4 and req.host in < 4\n  //   koa: req.host\n  //   node, nextjs: req.headers.host\n  const host = req.hostname || req.host || headers.host || '<no host>';\n  // protocol:\n  //   node, nextjs: <n/a>\n  //   express, koa: req.protocol\n  const protocol = req.protocol === 'https' || (req.socket && req.socket.encrypted) ? 'https' : 'http';\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  const originalUrl = req.originalUrl || req.url || '';\n  // absolute url\n  const absoluteUrl = `${protocol}://${host}${originalUrl}`;\n  include.forEach(key => {\n    switch (key) {\n      case 'headers': {\n        requestData.headers = headers;\n        break;\n      }\n      case 'method': {\n        requestData.method = method;\n        break;\n      }\n      case 'url': {\n        requestData.url = absoluteUrl;\n        break;\n      }\n      case 'cookies': {\n        // cookies:\n        //   node, express, koa: req.headers.cookie\n        //   vercel, sails.js, express (w/ cookie middleware), nextjs: req.cookies\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.cookies =\n          // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can\n          // come off in v8\n          req.cookies || (headers.cookie && deps && deps.cookie && deps.cookie.parse(headers.cookie)) || {};\n        break;\n      }\n      case 'query_string': {\n        // query string:\n        //   node: req.url (raw)\n        //   express, koa, nextjs: req.query\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n        requestData.query_string = extractQueryParams(req, deps);\n        break;\n      }\n      case 'data': {\n        if (method === 'GET' || method === 'HEAD') {\n          break;\n        }\n        // body data:\n        //   express, koa, nextjs: req.body\n        //\n        //   when using node by itself, you have to read the incoming stream(see\n        //   https://nodejs.dev/learn/get-http-request-body-data-using-nodejs); if a user is doing that, we can't know\n        //   where they're going to store the final result, so they'll have to capture this data themselves\n        if (req.body !== undefined) {\n          requestData.data = isString(req.body) ? req.body : JSON.stringify(normalize(req.body));\n        }\n        break;\n      }\n      default: {\n        if ({}.hasOwnProperty.call(req, key)) {\n          requestData[key] = (req as { [key: string]: any })[key];\n        }\n      }\n    }\n  });\n\n  return requestData;\n}\n\n/**\n * Options deciding what parts of the request to use when enhancing an event\n */\nexport interface AddRequestDataToEventOptions {\n  /** Flags controlling whether each type of data should be added to the event */\n  include?: {\n    ip?: boolean;\n    request?: boolean | string[];\n    transaction?: boolean | TransactionNamingScheme;\n    user?: boolean | string[];\n  };\n\n  /** Injected platform-specific dependencies */\n  deps?: {\n    cookie: {\n      parse: (cookieStr: string) => Record<string, string>;\n    };\n    url: {\n      parse: (urlStr: string) => {\n        query: string | null;\n      };\n    };\n  };\n}\n\n/**\n * Add data from the given request to the given event\n *\n * @param event The event to which the request data will be added\n * @param req Request object\n * @param options.include Flags to control what data is included\n * @param options.deps Injected platform-specific dependencies\n * @hidden\n */\nexport function addRequestDataToEvent(\n  event: Event,\n  req: PolymorphicRequest,\n  options?: AddRequestDataToEventOptions,\n): Event {\n  const include = {\n    ...DEFAULT_INCLUDES,\n    ...(options && options.include),\n  };\n\n  if (include.request) {\n    const extractedRequestData = Array.isArray(include.request)\n      ? extractRequestData(req, { include: include.request, deps: options && options.deps })\n      : extractRequestData(req, { deps: options && options.deps });\n\n    event.request = {\n      ...event.request,\n      ...extractedRequestData,\n    };\n  }\n\n  if (include.user) {\n    const extractedUser = req.user && isPlainObject(req.user) ? extractUserData(req.user, include.user) : {};\n\n    if (Object.keys(extractedUser).length) {\n      event.user = {\n        ...event.user,\n        ...extractedUser,\n      };\n    }\n  }\n\n  // client ip:\n  //   node, nextjs: req.socket.remoteAddress\n  //   express, koa: req.ip\n  if (include.ip) {\n    const ip = req.ip || (req.socket && req.socket.remoteAddress);\n    if (ip) {\n      event.user = {\n        ...event.user,\n        ip_address: ip,\n      };\n    }\n  }\n\n  if (include.transaction && !event.transaction) {\n    // TODO do we even need this anymore?\n    // TODO make this work for nextjs\n    event.transaction = extractTransaction(req, include.transaction);\n  }\n\n  return event;\n}\n\nfunction extractQueryParams(\n  req: PolymorphicRequest,\n  deps?: InjectedNodeDeps,\n): string | Record<string, unknown> | undefined {\n  // url (including path and query string):\n  //   node, express: req.originalUrl\n  //   koa, nextjs: req.url\n  let originalUrl = req.originalUrl || req.url || '';\n\n  if (!originalUrl) {\n    return;\n  }\n\n  // The `URL` constructor can't handle internal URLs of the form `/some/path/here`, so stick a dummy protocol and\n  // hostname on the beginning. Since the point here is just to grab the query string, it doesn't matter what we use.\n  if (originalUrl.startsWith('/')) {\n    originalUrl = `http://dogs.are.great${originalUrl}`;\n  }\n\n  return (\n    req.query ||\n    (typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||\n    // In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node\n    (deps && deps.url && deps.url.parse(originalUrl).query) ||\n    undefined\n  );\n}\n"],"names":[],"mappings":";;;;AA4BA,MAAA,gBAAA,GAAA;AACA,EAAA,EAAA,EAAA,KAAA;AACA,EAAA,OAAA,EAAA,IAAA;AACA,EAAA,WAAA,EAAA,IAAA;AACA,EAAA,IAAA,EAAA,IAAA;AACA,CAAA,CAAA;AACA,MAAA,wBAAA,GAAA,CAAA,SAAA,EAAA,MAAA,EAAA,SAAA,EAAA,QAAA,EAAA,cAAA,EAAA,KAAA,CAAA,CAAA;AACA,MAAA,qBAAA,GAAA,CAAA,IAAA,EAAA,UAAA,EAAA,OAAA,CAAA,CAAA;;AAaA;AACA;AACA;AACA;AACA,SAAA,2BAAA;AACA,EAAA,WAAA;AACA,EAAA,GAAA;AACA,EAAA,IAAA;AACA,EAAA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA,OAAA;AACA,EAAA,IAAA,CAAA,WAAA,CAAA,QAAA,CAAA,MAAA,IAAA,WAAA,CAAA,QAAA,CAAA,MAAA,KAAA,KAAA,EAAA;AACA;AACA,IAAA,WAAA,CAAA,OAAA,CAAA,GAAA,yBAAA,CAAA,GAAA,EAAA,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,WAAA,CAAA,OAAA,CAAA,KAAA,EAAA,GAAA,CAAA,WAAA,IAAA,GAAA,CAAA,GAAA,CAAA,CAAA;AACA,EAAA,IAAA,GAAA,CAAA,OAAA,EAAA;AACA,IAAA,WAAA,CAAA,OAAA,CAAA,SAAA,EAAA,GAAA,CAAA,OAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,WAAA,CAAA,OAAA,CAAA,OAAA,EAAA,kBAAA,CAAA,GAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AA;AACA,MAAA,KAAA,CAAA,IAAA,GAAA;AACA,QAAA,GAAA,KAAA,CAAA,IAAA;AACA,QAAA,UAAA,EAAA,EAAA;AACA,OAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,OAAA,CAAA,WAAA,IAAA,CAAA,KAAA,CAAA,WAAA,EAAA;AACA;AACA;AACA,IAAA,KAAA,CAAA,WAAA,GAAA,kBAAA,CAAA,GAAA,EAAA,OAAA,CAAA,WAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,kBAAA;AACA,EAAA,GAAA;AACA,EAAA,IAAA;AACA,EAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,WAAA,GAAA,GAAA,CAAA,WAAA,IAAA,GAAA,CAAA,GAAA,IAAA,EAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,WAAA,EAAA;AACA,IAAA,OAAA;AACA,GAAA;AACA;AACA;AACA;AACA,EAAA,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,CAAA,EAAA;AACA,IAAA,WAAA,GAAA,CAAA,qBAAA,EAAA,WAAA,CAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA;AACA,IAAA,GAAA,CAAA,KAAA;AACA,KAAA,OAAA,GAAA,KAAA,SAAA,IAAA,IAAA,GAAA,CAAA,WAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,GAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA,KAAA,IAAA,IAAA,IAAA,CAAA,GAAA,IAAA,IAAA,CAAA,GAAA,CAAA,KAAA,CAAA,WAAA,CAAA,CAAA,KAAA,CAAA;AACA,IAAA,SAAA;AACA,IAAA;AACA;;;;"}// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either
//
// a) moving `validSeverityLevels` to `@sentry/types`,
// b) moving the`SeverityLevel` type here, or
// c) importing `validSeverityLevels` from here into `@sentry/types`.
//
// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would
// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the
// type, reminding anyone who changes it to change this list also, will have to do.

const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];

/**
 * Converts a string-based level into a member of the deprecated {@link Severity} enum.
 *
 * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.
 *
 * @param level String representation of Severity
 * @returns Severity
 */
function severityFromString(level) {
  return severityLevelFromString(level) ;
}

/**
 * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.
 *
 * @param level String representation of desired `SeverityLevel`.
 * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
 */
function severityLevelFromString(level) {
  return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;
}

export { severityFromString, severityLevelFromString, validSeverityLevels };
//# sourceMappingURL=severity.js.map
{"version":3,"file":"severity.js","sources":["../../src/severity.ts"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport type { Severity, SeverityLevel } from '@sentry/types';\n\n// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nexport const validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nexport function severityFromString(level: Severity | SeverityLevel | string): Severity {\n  return severityLevelFromString(level) as Severity;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nexport function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {\n  return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') as SeverityLevel;\n}\n"],"names":[],"mappings":"AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA,CAAA,OAAA,EAAA,OAAA,EAAA,SAAA,EAAA,KAAA,EAAA,MAAA,EAAA,OAAA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,uBAAA,CAAA,KAAA,CAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,uBAAA,CAAA,KAAA,EAAA;AACA,EAAA,QAAA,KAAA,KAAA,MAAA,GAAA,SAAA,GAAA,mBAAA,CAAA,QAAA,CAAA,KAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA;AACA;;;;"}import { node } from './node-stack-trace.js';

const STACKTRACE_FRAME_LIMIT = 50;
// Used to sanitize webpack (error: *) wrapped stack errors
const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;

/**
 * Creates a stack parser with the supplied line parsers
 *
 * StackFrames are returned in the correct order for Sentry Exception
 * frames and with Sentry SDK internal frames removed from the top and bottom
 *
 */
function createStackParser(...parsers) {
  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);

  return (stack, skipFirst = 0) => {
    const frames = [];
    const lines = stack.split('\n');

    for (let i = skipFirst; i < lines.length; i++) {
      const line = lines[i];
      // Ignore lines over 1kb as they are unlikely to be stack frames.
      // Many of the regular expressions use backtracking which results in run time that increases exponentially with
      // input size. Huge strings can result in hangs/Denial of Service:
      // https://github.com/getsentry/sentry-javascript/issues/2286
      if (line.length > 1024) {
        continue;
      }

      // https://github.com/getsentry/sentry-javascript/issues/5459
      // Remove webpack (error: *) wrappers
      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;

      // https://github.com/getsentry/sentry-javascript/issues/7813
      // Skip Error: lines
      if (cleanedLine.match(/\S*Error: /)) {
        continue;
      }

      for (const parser of sortedParsers) {
        const frame = parser(cleanedLine);

        if (frame) {
          frames.push(frame);
          break;
        }
      }

      if (frames.length >= STACKTRACE_FRAME_LIMIT) {
        break;
      }
    }

    return stripSentryFramesAndReverse(frames);
  };
}

/**
 * Gets a stack parser implementation from Options.stackParser
 * @see Options
 *
 * If options contains an array of line parsers, it is converted into a parser
 */
function stackParserFromStackParserOptions(stackParser) {
  if (Array.isArray(stackParser)) {
    return createStackParser(...stackParser);
  }
  return stackParser;
}

/**
 * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.
 * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the
 * function that caused the crash is the last frame in the array.
 * @hidden
 */
function stripSentryFramesAndReverse(stack) {
  if (!stack.length) {
    return [];
  }

  const localStack = stack.slice(0, STACKTRACE_FRAME_LIMIT);

  const lastFrameFunction = localStack[localStack.length - 1].function;
  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)
  if (lastFrameFunction && /sentryWrapped/.test(lastFrameFunction)) {
    localStack.pop();
  }

  // Reversing in the middle of the procedure allows us to just pop the values off the stack
  localStack.reverse();

  const firstFrameFunction = localStack[localStack.length - 1].function;
  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)
  if (firstFrameFunction && /captureMessage|captureException/.test(firstFrameFunction)) {
    localStack.pop();
  }

  return localStack.map(frame => ({
    ...frame,
    filename: frame.filename || localStack[localStack.length - 1].filename,
    function: frame.function || '?',
  }));
}

const defaultFunctionName = '<anonymous>';

/**
 * Safely extract function name from itself
 */
function getFunctionName(fn) {
  try {
    if (!fn || typeof fn !== 'function') {
      return defaultFunctionName;
    }
    return fn.name || defaultFunctionName;
  } catch (e) {
    // Just accessing custom props in some Selenium environments
    // can cause a "Permission denied" exception (see raven-js#495).
    return defaultFunctionName;
  }
}

/**
 * Node.js stack line parser
 *
 * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.
 * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain
 */
function nodeStackLineParser(getModule) {
  return [90, node(getModule)];
}

export { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse };
//# sourceMappingURL=stacktrace.js.map
{"version":3,"file":"stacktrace.js","sources":["../../src/stacktrace.ts"],"sourcesContent":["import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';\n\nimport type { GetModuleFn } from './node-stack-trace';\nimport { node } from './node-stack-trace';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nexport function createStackParser(...parsers: StackLineParser[]): StackParser {\n  const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n  return (stack: string, skipFirst: number = 0): StackFrame[] => {\n    const frames: StackFrame[] = [];\n    const lines = stack.split('\\n');\n\n    for (let i = skipFirst; i < lines.length; i++) {\n      const line = lines[i];\n      // Ignore lines over 1kb as they are unlikely to be stack frames.\n      // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n      // input size. Huge strings can result in hangs/Denial of Service:\n      // https://github.com/getsentry/sentry-javascript/issues/2286\n      if (line.length > 1024) {\n        continue;\n      }\n\n      // https://github.com/getsentry/sentry-javascript/issues/5459\n      // Remove webpack (error: *) wrappers\n      const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n      // https://github.com/getsentry/sentry-javascript/issues/7813\n      // Skip Error: lines\n      if (cleanedLine.match(/\\S*Error: /)) {\n        continue;\n      }\n\n      for (const parser of sortedParsers) {\n        const frame = parser(cleanedLine);\n\n        if (frame) {\n          frames.push(frame);\n          break;\n        }\n      }\n\n      if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n        break;\n      }\n    }\n\n    return stripSentryFramesAndReverse(frames);\n  };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nexport function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser {\n  if (Array.isArray(stackParser)) {\n    return createStackParser(...stackParser);\n  }\n  return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nexport function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): StackFrame[] {\n  if (!stack.length) {\n    return [];\n  }\n\n  const localStack = stack.slice(0, STACKTRACE_FRAME_LIMIT);\n\n  const lastFrameFunction = localStack[localStack.length - 1].function;\n  // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n  if (lastFrameFunction && /sentryWrapped/.test(lastFrameFunction)) {\n    localStack.pop();\n  }\n\n  // Reversing in the middle of the procedure allows us to just pop the values off the stack\n  localStack.reverse();\n\n  const firstFrameFunction = localStack[localStack.length - 1].function;\n  // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n  if (firstFrameFunction && /captureMessage|captureException/.test(firstFrameFunction)) {\n    localStack.pop();\n  }\n\n  return localStack.map(frame => ({\n    ...frame,\n    filename: frame.filename || localStack[localStack.length - 1].filename,\n    function: frame.function || '?',\n  }));\n}\n\nconst defaultFunctionName = '<anonymous>';\n\n/**\n * Safely extract function name from itself\n */\nexport function getFunctionName(fn: unknown): string {\n  try {\n    if (!fn || typeof fn !== 'function') {\n      return defaultFunctionName;\n    }\n    return fn.name || defaultFunctionName;\n  } catch (e) {\n    // Just accessing custom props in some Selenium environments\n    // can cause a \"Permission denied\" exception (see raven-js#495).\n    return defaultFunctionName;\n  }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nexport function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser {\n  return [90, node(getModule)];\n}\n"],"names":[],"mappings":";;AAKA,MAAA,sBAAA,GAAA,EAAA,CAAA;AACA;AACA,MAAA,oBAAA,GAAA,iBAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,iBAAA,CAAA,GAAA,OAAA,EAAA;AACA,EAAA,MAAA,aAAA,GAAA,OAAA,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,KAAA,EAAA,SAAA,GAAA,CAAA,KAAA;AACA,IAAA,MAAA,MAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,KAAA,GAAA,KAAA,CAAA,KAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,IAAA,KAAA,IAAA,CAAA,GAAA,SAAA,EAAA,CAAA,GAAA,KAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA;AACA,MAAA,MAAA,IAAA,GAAA,KAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,GAAA,IAAA,EAAA;AACA,QAAA,SAAA;AACA,O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"}import { isString, isRegExp } from './is.js';

/**
 * Truncates given string to the maximum characters count
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string (0 = unlimited)
 * @returns string Encoded
 */
function truncate(str, max = 0) {
  if (typeof str !== 'string' || max === 0) {
    return str;
  }
  return str.length <= max ? str : `${str.slice(0, max)}...`;
}

/**
 * This is basically just `trim_line` from
 * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string
 * @returns string Encoded
 */
function snipLine(line, colno) {
  let newLine = line;
  const lineLength = newLine.length;
  if (lineLength <= 150) {
    return newLine;
  }
  if (colno > lineLength) {
    // eslint-disable-next-line no-param-reassign
    colno = lineLength;
  }

  let start = Math.max(colno - 60, 0);
  if (start < 5) {
    start = 0;
  }

  let end = Math.min(start + 140, lineLength);
  if (end > lineLength - 5) {
    end = lineLength;
  }
  if (end === lineLength) {
    start = Math.max(end - 140, 0);
  }

  newLine = newLine.slice(start, end);
  if (start > 0) {
    newLine = `'{snip} ${newLine}`;
  }
  if (end < lineLength) {
    newLine += ' {snip}';
  }

  return newLine;
}

/**
 * Join values in array
 * @param input array of values to be joined together
 * @param delimiter string to be placed in-between values
 * @returns Joined values
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function safeJoin(input, delimiter) {
  if (!Array.isArray(input)) {
    return '';
  }

  const output = [];
  // eslint-disable-next-line @typescript-eslint/prefer-for-of
  for (let i = 0; i < input.length; i++) {
    const value = input[i];
    try {
      output.push(String(value));
    } catch (e) {
      output.push('[value cannot be serialized]');
    }
  }

  return output.join(delimiter);
}

/**
 * Checks if the given value matches a regex or string
 *
 * @param value The string to test
 * @param pattern Either a regex or a string against which `value` will be matched
 * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match
 * `pattern` if it contains `pattern`. Only applies to string-type patterns.
 */
function isMatchingPattern(
  value,
  pattern,
  requireExactStringMatch = false,
) {
  if (!isString(value)) {
    return false;
  }

  if (isRegExp(pattern)) {
    return pattern.test(value);
  }
  if (isString(pattern)) {
    return requireExactStringMatch ? value === pattern : value.includes(pattern);
  }

  return false;
}

/**
 * Test the given string against an array of strings and regexes. By default, string matching is done on a
 * substring-inclusion basis rather than a strict equality basis
 *
 * @param testString The string to test
 * @param patterns The patterns against which to test the string
 * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to
 * count. If false, `testString` will match a string pattern if it contains that pattern.
 * @returns
 */
function stringMatchesSomePattern(
  testString,
  patterns = [],
  requireExactStringMatch = false,
) {
  return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));
}

export { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };
//# sourceMappingURL=string.js.map
{"version":3,"file":"string.js","sources":["../../src/string.ts"],"sourcesContent":["import { isRegExp, isString } from './is';\n\nexport { escapeStringForRegex } from './vendor/escapeStringForRegex';\n\n/**\n * Truncates given string to the maximum characters count\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string (0 = unlimited)\n * @returns string Encoded\n */\nexport function truncate(str: string, max: number = 0): string {\n  if (typeof str !== 'string' || max === 0) {\n    return str;\n  }\n  return str.length <= max ? str : `${str.slice(0, max)}...`;\n}\n\n/**\n * This is basically just `trim_line` from\n * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67\n *\n * @param str An object that contains serializable values\n * @param max Maximum number of characters in truncated string\n * @returns string Encoded\n */\nexport function snipLine(line: string, colno: number): string {\n  let newLine = line;\n  const lineLength = newLine.length;\n  if (lineLength <= 150) {\n    return newLine;\n  }\n  if (colno > lineLength) {\n    // eslint-disable-next-line no-param-reassign\n    colno = lineLength;\n  }\n\n  let start = Math.max(colno - 60, 0);\n  if (start < 5) {\n    start = 0;\n  }\n\n  let end = Math.min(start + 140, lineLength);\n  if (end > lineLength - 5) {\n    end = lineLength;\n  }\n  if (end === lineLength) {\n    start = Math.max(end - 140, 0);\n  }\n\n  newLine = newLine.slice(start, end);\n  if (start > 0) {\n    newLine = `'{snip} ${newLine}`;\n  }\n  if (end < lineLength) {\n    newLine += ' {snip}';\n  }\n\n  return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function safeJoin(input: any[], delimiter?: string): string {\n  if (!Array.isArray(input)) {\n    return '';\n  }\n\n  const output = [];\n  // eslint-disable-next-line @typescript-eslint/prefer-for-of\n  for (let i = 0; i < input.length; i++) {\n    const value = input[i];\n    try {\n      output.push(String(value));\n    } catch (e) {\n      output.push('[value cannot be serialized]');\n    }\n  }\n\n  return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nexport function isMatchingPattern(\n  value: string,\n  pattern: RegExp | string,\n  requireExactStringMatch: boolean = false,\n): boolean {\n  if (!isString(value)) {\n    return false;\n  }\n\n  if (isRegExp(pattern)) {\n    return pattern.test(value);\n  }\n  if (isString(pattern)) {\n    return requireExactStringMatch ? value === pattern : value.includes(pattern);\n  }\n\n  return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nexport function stringMatchesSomePattern(\n  testString: string,\n  patterns: Array<string | RegExp> = [],\n  requireExactStringMatch: boolean = false,\n): boolean {\n  return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CA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CAAA,EAAA;AACA,IAAA,OAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,EAAA,IAAA,QAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,uBAAA,GAAA,KAAA,KAAA,OAAA,GAAA,KAAA,CAAA,QAAA,CAAA,OAAA,CAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,KAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA;AACA,EAAA,UAAA;AACA,EAAA,QAAA,GAAA,EAAA;AACA,EAAA,uBAAA,GAAA,KAAA;AACA,EAAA;AACA,EAAA,OAAA,QAAA,CAAA,IAAA,CAAA,OAAA,IAAA,iBAAA,CAAA,UAAA,EAAA,OAAA,EAAA,uBAAA,CAAA,CAAA,CAAA;AACA;;;;"}import { logger } from './logger.js';
import { getGlobalObject } from './worldwide.js';

// eslint-disable-next-line deprecation/deprecation
const WINDOW = getGlobalObject();

/**
 * Tells whether current environment supports ErrorEvent objects
 * {@link supportsErrorEvent}.
 *
 * @returns Answer to the given question.
 */
function supportsErrorEvent() {
  try {
    new ErrorEvent('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports DOMError objects
 * {@link supportsDOMError}.
 *
 * @returns Answer to the given question.
 */
function supportsDOMError() {
  try {
    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':
    // 1 argument required, but only 0 present.
    // @ts-ignore It really needs 1 argument, not 0.
    new DOMError('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports DOMException objects
 * {@link supportsDOMException}.
 *
 * @returns Answer to the given question.
 */
function supportsDOMException() {
  try {
    new DOMException('');
    return true;
  } catch (e) {
    return false;
  }
}

/**
 * Tells whether current environment supports Fetch API
 * {@link supportsFetch}.
 *
 * @returns Answer to the given question.
 */
function supportsFetch() {
  if (!('fetch' in WINDOW)) {
    return false;
  }

  try {
    new Headers();
    new Request('http://www.example.com');
    new Response();
    return true;
  } catch (e) {
    return false;
  }
}
/**
 * isNativeFetch checks if the given function is a native implementation of fetch()
 */
// eslint-disable-next-line @typescript-eslint/ban-types
function isNativeFetch(func) {
  return func && /^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString());
}

/**
 * Tells whether current environment supports Fetch API natively
 * {@link supportsNativeFetch}.
 *
 * @returns true if `window.fetch` is natively implemented, false otherwise
 */
function supportsNativeFetch() {
  if (!supportsFetch()) {
    return false;
  }

  // Fast path to avoid DOM I/O
  // eslint-disable-next-line @typescript-eslint/unbound-method
  if (isNativeFetch(WINDOW.fetch)) {
    return true;
  }

  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)
  // so create a "pure" iframe to see if that has native fetch
  let result = false;
  const doc = WINDOW.document;
  // eslint-disable-next-line deprecation/deprecation
  if (doc && typeof (doc.createElement ) === 'function') {
    try {
      const sandbox = doc.createElement('iframe');
      sandbox.hidden = true;
      doc.head.appendChild(sandbox);
      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        result = isNativeFetch(sandbox.contentWindow.fetch);
      }
      doc.head.removeChild(sandbox);
    } catch (err) {
      (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) &&
        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);
    }
  }

  return result;
}

/**
 * Tells whether current environment supports ReportingObserver API
 * {@link supportsReportingObserver}.
 *
 * @returns Answer to the given question.
 */
function supportsReportingObserver() {
  return 'ReportingObserver' in WINDOW;
}

/**
 * Tells whether current environment supports Referrer Policy API
 * {@link supportsReferrerPolicy}.
 *
 * @returns Answer to the given question.
 */
function supportsReferrerPolicy() {
  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'
  // (see https://caniuse.com/#feat=referrer-policy),
  // it doesn't. And it throws an exception instead of ignoring this parameter...
  // REF: https://github.com/getsentry/raven-js/issues/1233

  if (!supportsFetch()) {
    return false;
  }

  try {
    new Request('_', {
      referrerPolicy: 'origin' ,
    });
    return true;
  } catch (e) {
    return false;
  }
}

export { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver };
//# sourceMappingURL=supports.js.map
{"version":3,"file":"supports.js","sources":["../../src/supports.ts"],"sourcesContent":["import { logger } from './logger';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\nexport { supportsHistory } from './vendor/supportsHistory';\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsErrorEvent(): boolean {\n  try {\n    new ErrorEvent('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMError(): boolean {\n  try {\n    // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n    // 1 argument required, but only 0 present.\n    // @ts-ignore It really needs 1 argument, not 0.\n    new DOMError('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsDOMException(): boolean {\n  try {\n    new DOMException('');\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsFetch(): boolean {\n  if (!('fetch' in WINDOW)) {\n    return false;\n  }\n\n  try {\n    new Headers();\n    new Request('http://www.example.com');\n    new Response();\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isNativeFetch(func: Function): boolean {\n  return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nexport function supportsNativeFetch(): boolean {\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  // Fast path to avoid DOM I/O\n  // eslint-disable-next-line @typescript-eslint/unbound-method\n  if (isNativeFetch(WINDOW.fetch)) {\n    return true;\n  }\n\n  // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n  // so create a \"pure\" iframe to see if that has native fetch\n  let result = false;\n  const doc = WINDOW.document;\n  // eslint-disable-next-line deprecation/deprecation\n  if (doc && typeof (doc.createElement as unknown) === 'function') {\n    try {\n      const sandbox = doc.createElement('iframe');\n      sandbox.hidden = true;\n      doc.head.appendChild(sandbox);\n      if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n        // eslint-disable-next-line @typescript-eslint/unbound-method\n        result = isNativeFetch(sandbox.contentWindow.fetch);\n      }\n      doc.head.removeChild(sandbox);\n    } catch (err) {\n      __DEBUG_BUILD__ &&\n        logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n    }\n  }\n\n  return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReportingObserver(): boolean {\n  return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsReferrerPolicy(): boolean {\n  // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n  // (see https://caniuse.com/#feat=referrer-policy),\n  // it doesn't. And it throws an exception instead of ignoring this parameter...\n  // REF: https://github.com/getsentry/raven-js/issues/1233\n\n  if (!supportsFetch()) {\n    return false;\n  }\n\n  try {\n    new Request('_', {\n      referrerPolicy: 'origin' as ReferrerPolicy,\n    });\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n"],"names":[],"mappings":";;;AAGA;AACA,MAAA,MAAA,GAAA,eAAA,EAAA,CAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,UAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,gBAAA,GAAA;AACA,EAAA,IAAA;AACA;AACA;AACA;AACA,IAAA,IAAA,QAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,aAAA,GAAA;AACA,EAAA,IAAA,EAAA,OAAA,IAAA,MAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,OAAA,EAAA,CAAA;AACA,IAAA,IAAA,OAAA,CAAA,wBAAA,CAAA,CAAA;AACA,IAAA,IAAA,QAAA,EAAA,CAAA;AACA,IAAA,OAAA,IAAA,CA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,IAAA,CAAA,iFAAA,EAAA,GAAA,CAAA,CAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,yBAAA,GAAA;AACA,EAAA,OAAA,mBAAA,IAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,IAAA,CAAA,aAAA,EAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA;AACA,IAAA,IAAA,OAAA,CAAA,GAAA,EAAA;AACA,MAAA,cAAA,EAAA,QAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}import { isThenable } from './is.js';

/* eslint-disable @typescript-eslint/explicit-function-return-type */

/** SyncPromise internal states */
var States; (function (States) {
  /** Pending */
  const PENDING = 0; States[States["PENDING"] = PENDING] = "PENDING";
  /** Resolved / OK */
  const RESOLVED = 1; States[States["RESOLVED"] = RESOLVED] = "RESOLVED";
  /** Rejected / Error */
  const REJECTED = 2; States[States["REJECTED"] = REJECTED] = "REJECTED";
})(States || (States = {}));

// Overloads so we can call resolvedSyncPromise without arguments and generic argument

/**
 * Creates a resolved sync promise.
 *
 * @param value the value to resolve the promise with
 * @returns the resolved sync promise
 */
function resolvedSyncPromise(value) {
  return new SyncPromise(resolve => {
    resolve(value);
  });
}

/**
 * Creates a rejected sync promise.
 *
 * @param value the value to reject the promise with
 * @returns the rejected sync promise
 */
function rejectedSyncPromise(reason) {
  return new SyncPromise((_, reject) => {
    reject(reason);
  });
}

/**
 * Thenable class that behaves like a Promise and follows it's interface
 * but is not async internally
 */
class SyncPromise {
   __init() {this._state = States.PENDING;}
   __init2() {this._handlers = [];}

   constructor(
    executor,
  ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);SyncPromise.prototype.__init5.call(this);SyncPromise.prototype.__init6.call(this);
    try {
      executor(this._resolve, this._reject);
    } catch (e) {
      this._reject(e);
    }
  }

  /** JSDoc */
   then(
    onfulfilled,
    onrejected,
  ) {
    return new SyncPromise((resolve, reject) => {
      this._handlers.push([
        false,
        result => {
          if (!onfulfilled) {
            // TODO: ¯\_(ツ)_/¯
            // TODO: FIXME
            resolve(result );
          } else {
            try {
              resolve(onfulfilled(result));
            } catch (e) {
              reject(e);
            }
          }
        },
        reason => {
          if (!onrejected) {
            reject(reason);
          } else {
            try {
              resolve(onrejected(reason));
            } catch (e) {
              reject(e);
            }
          }
        },
      ]);
      this._executeHandlers();
    });
  }

  /** JSDoc */
   catch(
    onrejected,
  ) {
    return this.then(val => val, onrejected);
  }

  /** JSDoc */
   finally(onfinally) {
    return new SyncPromise((resolve, reject) => {
      let val;
      let isRejected;

      return this.then(
        value => {
          isRejected = false;
          val = value;
          if (onfinally) {
            onfinally();
          }
        },
        reason => {
          isRejected = true;
          val = reason;
          if (onfinally) {
            onfinally();
          }
        },
      ).then(() => {
        if (isRejected) {
          reject(val);
          return;
        }

        resolve(val );
      });
    });
  }

  /** JSDoc */
    __init3() {this._resolve = (value) => {
    this._setResult(States.RESOLVED, value);
  };}

  /** JSDoc */
    __init4() {this._reject = (reason) => {
    this._setResult(States.REJECTED, reason);
  };}

  /** JSDoc */
    __init5() {this._setResult = (state, value) => {
    if (this._state !== States.PENDING) {
      return;
    }

    if (isThenable(value)) {
      void (value ).then(this._resolve, this._reject);
      return;
    }

    this._state = state;
    this._value = value;

    this._executeHandlers();
  };}

  /** JSDoc */
    __init6() {this._executeHandlers = () => {
    if (this._state === States.PENDING) {
      return;
    }

    const cachedHandlers = this._handlers.slice();
    this._handlers = [];

    cachedHandlers.forEach(handler => {
      if (handler[0]) {
        return;
      }

      if (this._state === States.RESOLVED) {
        // eslint-disable-next-line @typescript-eslint/no-floating-promises
        handler[1](this._value );
      }

      if (this._state === States.REJECTED) {
        handler[2](this._value);
      }

      handler[0] = true;
    });
  };}
}

export { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };
//# sourceMappingURL=syncpromise.js.map
{"version":3,"file":"syncpromise.js","sources":["../../src/syncpromise.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/typedef */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isThenable } from './is';\n\n/** SyncPromise internal states */\nconst enum States {\n  /** Pending */\n  PENDING = 0,\n  /** Resolved / OK */\n  RESOLVED = 1,\n  /** Rejected / Error */\n  REJECTED = 2,\n}\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\nexport function resolvedSyncPromise(): PromiseLike<void>;\nexport function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nexport function resolvedSyncPromise<T>(value?: T | PromiseLike<T>): PromiseLike<T> {\n  return new SyncPromise(resolve => {\n    resolve(value);\n  });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nexport function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T> {\n  return new SyncPromise((_, reject) => {\n    reject(reason);\n  });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise<T> implements PromiseLike<T> {\n  private _state: States = States.PENDING;\n  private _handlers: Array<[boolean, (value: T) => void, (reason: any) => any]> = [];\n  private _value: any;\n\n  public constructor(\n    executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void,\n  ) {\n    try {\n      executor(this._resolve, this._reject);\n    } catch (e) {\n      this._reject(e);\n    }\n  }\n\n  /** JSDoc */\n  public then<TResult1 = T, TResult2 = never>(\n    onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,\n    onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null,\n  ): PromiseLike<TResult1 | TResult2> {\n    return new SyncPromise((resolve, reject) => {\n      this._handlers.push([\n        false,\n        result => {\n          if (!onfulfilled) {\n            // TODO: ¯\\_(ツ)_/¯\n            // TODO: FIXME\n            resolve(result as any);\n          } else {\n            try {\n              resolve(onfulfilled(result));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n        reason => {\n          if (!onrejected) {\n            reject(reason);\n          } else {\n            try {\n              resolve(onrejected(reason));\n            } catch (e) {\n              reject(e);\n            }\n          }\n        },\n      ]);\n      this._executeHandlers();\n    });\n  }\n\n  /** JSDoc */\n  public catch<TResult = never>(\n    onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null,\n  ): PromiseLike<T | TResult> {\n    return this.then(val => val, onrejected);\n  }\n\n  /** JSDoc */\n  public finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult> {\n    return new SyncPromise<TResult>((resolve, reject) => {\n      let val: TResult | any;\n      let isRejected: boolean;\n\n      return this.then(\n        value => {\n          isRejected = false;\n          val = value;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n        reason => {\n          isRejected = true;\n          val = reason;\n          if (onfinally) {\n            onfinally();\n          }\n        },\n      ).then(() => {\n        if (isRejected) {\n          reject(val);\n          return;\n        }\n\n        resolve(val as unknown as any);\n      });\n    });\n  }\n\n  /** JSDoc */\n  private readonly _resolve = (value?: T | PromiseLike<T> | null) => {\n    this._setResult(States.RESOLVED, value);\n  };\n\n  /** JSDoc */\n  private readonly _reject = (reason?: any) => {\n    this._setResult(States.REJECTED, reason);\n  };\n\n  /** JSDoc */\n  private readonly _setResult = (state: States, value?: T | PromiseLike<T> | any) => {\n    if (this._state !== States.PENDING) {\n      return;\n    }\n\n    if (isThenable(value)) {\n      void (value as PromiseLike<T>).then(this._resolve, this._reject);\n      return;\n    }\n\n    this._state = state;\n    this._value = value;\n\n    this._executeHandlers();\n  };\n\n  /** JSDoc */\n  private readonly _executeHandlers = () => {\n    if (this._state === States.PENDING) {\n      return;\n    }\n\n    const cachedHandlers = this._handlers.slice();\n    this._handlers = [];\n\n    cachedHandlers.forEach(handler => {\n      if (handler[0]) {\n        return;\n      }\n\n      if (this._state === States.RESOLVED) {\n        // eslint-disable-next-line @typescript-eslint/no-floating-promises\n        handler[1](this._value as unknown as any);\n      }\n\n      if (this._state === States.REJECTED) {\n        handler[2](this._value);\n      }\n\n      handler[0] = true;\n    });\n  };\n}\n\nexport { SyncPromise };\n"],"names":[],"mappings":";;AAAA;AAKA;AACA;AACA,IAAA,MAAA,CAAA,CAAA,CAAA,UAAA,MAAA,EAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,SAAA,CAAA,GAAA,OAAA,CAAA,GAAA,SAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA,GAAA,UAAA,CAAA;AACA;AACA,EAAA,MAAA,QAAA,GAAA,CAAA,CAAA,CAAA,MAAA,CAAA,MAAA,CAAA,UAAA,CAAA,GAAA,QAAA,CAAA,GAAA,UAAA,CAAA;AACA,CAAA,EAAA,MAAA,KAAA,MAAA,GAAA,EAAA,CAAA,CAAA,CAAA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,KAAA,EAAA;AACA,EAAA,OAAA,IAAA,WAAA,CAAA,OAAA,IAAA;AACA,IAAA,OAAA,CAAA,KAAA,CAAA,CAAA;AACA,GAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,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EAAA,CAAA;AACA,IAAA,CAAA;AACA;AACA;AACA,IAAA,OAAA,GAAA,CAAA,IAAA,CAAA,gBAAA,GAAA,MAAA;AACA,IAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,OAAA,EAAA;AACA,MAAA,OAAA;AACA,KAAA;AACA;AACA,IAAA,MAAA,cAAA,GAAA,IAAA,CAAA,SAAA,CAAA,KAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,SAAA,GAAA,EAAA,CAAA;AACA;AACA,IAAA,cAAA,CAAA,OAAA,CAAA,OAAA,IAAA;AACA,MAAA,IAAA,OAAA,CAAA,CAAA,CAAA,EAAA;AACA,QAAA,OAAA;AACA,OAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,QAAA,EAAA;AACA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,MAAA,EAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,IAAA,IAAA,CAAA,MAAA,KAAA,MAAA,CAAA,QAAA,EAAA;AACA,QAAA,OAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA;AACA,OAAA;AACA;AACA,MAAA,OAAA,CAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,IAAA,CAAA;AACA;;;;"}import { isNodeEnv, dynamicRequire } from './node.js';
import { getGlobalObject } from './worldwide.js';

// eslint-disable-next-line deprecation/deprecation
const WINDOW = getGlobalObject();

/**
 * An object that can return the current timestamp in seconds since the UNIX epoch.
 */

/**
 * A TimestampSource implementation for environments that do not support the Performance Web API natively.
 *
 * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier
 * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It
 * is more obvious to explain "why does my span have negative duration" than "why my spans have zero duration".
 */
const dateTimestampSource = {
  nowSeconds: () => Date.now() / 1000,
};

/**
 * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}
 * for accessing a high-resolution monotonic clock.
 */

/**
 * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not
 * support the API.
 *
 * Wrapping the native API works around differences in behavior from different browsers.
 */
function getBrowserPerformance() {
  const { performance } = WINDOW;
  if (!performance || !performance.now) {
    return undefined;
  }

  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().
  //
  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +
  // performance.now() gives a date arbitrarily in the past.
  //
  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is
  // undefined.
  //
  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to
  // interact with data coming out of performance entries.
  //
  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that
  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes
  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have
  // observed skews that can be as long as days, weeks or months.
  //
  // See https://github.com/getsentry/sentry-javascript/issues/2590.
  //
  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload
  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation
  // transactions of long-lived web pages.
  const timeOrigin = Date.now() - performance.now();

  return {
    now: () => performance.now(),
    timeOrigin,
  };
}

/**
 * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't
 * implement the API.
 */
function getNodePerformance() {
  try {
    const perfHooks = dynamicRequire(module, 'perf_hooks') ;
    return perfHooks.performance;
  } catch (_) {
    return undefined;
  }
}

/**
 * The Performance API implementation for the current platform, if available.
 */
const platformPerformance = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();

const timestampSource =
  platformPerformance === undefined
    ? dateTimestampSource
    : {
        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,
      };

/**
 * Returns a timestamp in seconds since the UNIX epoch using the Date API.
 */
const dateTimestampInSeconds = dateTimestampSource.nowSeconds.bind(dateTimestampSource);

/**
 * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
 * availability of the Performance API.
 *
 * See `usingPerformanceAPI` to test whether the Performance API is used.
 *
 * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
 * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
 * skew can grow to arbitrary amounts like days, weeks or months.
 * See https://github.com/getsentry/sentry-javascript/issues/2590.
 */
const timestampInSeconds = timestampSource.nowSeconds.bind(timestampSource);

// Re-exported with an old name for backwards-compatibility.
const timestampWithMs = timestampInSeconds;

/**
 * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.
 */
const usingPerformanceAPI = platformPerformance !== undefined;

/**
 * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
 */
let _browserPerformanceTimeOriginMode;

/**
 * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
 * performance API is available.
 */
const browserPerformanceTimeOrigin = (() => {
  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or
  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin
  // data as reliable if they are within a reasonable threshold of the current time.

  const { performance } = WINDOW;
  if (!performance || !performance.now) {
    _browserPerformanceTimeOriginMode = 'none';
    return undefined;
  }

  const threshold = 3600 * 1000;
  const performanceNow = performance.now();
  const dateNow = Date.now();

  // if timeOrigin isn't available set delta to threshold so it isn't used
  const timeOriginDelta = performance.timeOrigin
    ? Math.abs(performance.timeOrigin + performanceNow - dateNow)
    : threshold;
  const timeOriginIsReliable = timeOriginDelta < threshold;

  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin
  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.
  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always
  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the
  // Date API.
  // eslint-disable-next-line deprecation/deprecation
  const navigationStart = performance.timing && performance.timing.navigationStart;
  const hasNavigationStart = typeof navigationStart === 'number';
  // if navigationStart isn't available set delta to threshold so it isn't used
  const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;
  const navigationStartIsReliable = navigationStartDelta < threshold;

  if (timeOriginIsReliable || navigationStartIsReliable) {
    // Use the more reliable time origin
    if (timeOriginDelta <= navigationStartDelta) {
      _browserPerformanceTimeOriginMode = 'timeOrigin';
      return performance.timeOrigin;
    } else {
      _browserPerformanceTimeOriginMode = 'navigationStart';
      return navigationStart;
    }
  }

  // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.
  _browserPerformanceTimeOriginMode = 'dateNow';
  return dateNow;
})();

export { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds, timestampWithMs, usingPerformanceAPI };
//# sourceMappingURL=time.js.map
{"version":3,"file":"time.js","sources":["../../src/time.ts"],"sourcesContent":["import { dynamicRequire, isNodeEnv } from './node';\nimport { getGlobalObject } from './worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * An object that can return the current timestamp in seconds since the UNIX epoch.\n */\ninterface TimestampSource {\n  nowSeconds(): number;\n}\n\n/**\n * A TimestampSource implementation for environments that do not support the Performance Web API natively.\n *\n * Note that this TimestampSource does not use a monotonic clock. A call to `nowSeconds` may return a timestamp earlier\n * than a previously returned value. We do not try to emulate a monotonic behavior in order to facilitate debugging. It\n * is more obvious to explain \"why does my span have negative duration\" than \"why my spans have zero duration\".\n */\nconst dateTimestampSource: TimestampSource = {\n  nowSeconds: () => Date.now() / 1000,\n};\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\ninterface Performance {\n  /**\n   * The millisecond timestamp at which measurement began, measured in Unix time.\n   */\n  timeOrigin: number;\n  /**\n   * Returns the current millisecond timestamp, where 0 represents the start of measurement.\n   */\n  now(): number;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction getBrowserPerformance(): Performance | undefined {\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    return undefined;\n  }\n\n  // Replace performance.timeOrigin with our own timeOrigin based on Date.now().\n  //\n  // This is a partial workaround for browsers reporting performance.timeOrigin such that performance.timeOrigin +\n  // performance.now() gives a date arbitrarily in the past.\n  //\n  // Additionally, computing timeOrigin in this way fills the gap for browsers where performance.timeOrigin is\n  // undefined.\n  //\n  // The assumption that performance.timeOrigin + performance.now() ~= Date.now() is flawed, but we depend on it to\n  // interact with data coming out of performance entries.\n  //\n  // Note that despite recommendations against it in the spec, browsers implement the Performance API with a clock that\n  // might stop when the computer is asleep (and perhaps under other circumstances). Such behavior causes\n  // performance.timeOrigin + performance.now() to have an arbitrary skew over Date.now(). In laptop computers, we have\n  // observed skews that can be as long as days, weeks or months.\n  //\n  // See https://github.com/getsentry/sentry-javascript/issues/2590.\n  //\n  // BUG: despite our best intentions, this workaround has its limitations. It mostly addresses timings of pageload\n  // transactions, but ignores the skew built up over time that can aversely affect timestamps of navigation\n  // transactions of long-lived web pages.\n  const timeOrigin = Date.now() - performance.now();\n\n  return {\n    now: () => performance.now(),\n    timeOrigin,\n  };\n}\n\n/**\n * Returns the native Performance API implementation from Node.js. Returns undefined in old Node.js versions that don't\n * implement the API.\n */\nfunction getNodePerformance(): Performance | undefined {\n  try {\n    const perfHooks = dynamicRequire(module, 'perf_hooks') as { performance: Performance };\n    return perfHooks.performance;\n  } catch (_) {\n    return undefined;\n  }\n}\n\n/**\n * The Performance API implementation for the current platform, if available.\n */\nconst platformPerformance: Performance | undefined = isNodeEnv() ? getNodePerformance() : getBrowserPerformance();\n\nconst timestampSource: TimestampSource =\n  platformPerformance === undefined\n    ? dateTimestampSource\n    : {\n        nowSeconds: () => (platformPerformance.timeOrigin + platformPerformance.now()) / 1000,\n      };\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n */\nexport const dateTimestampInSeconds: () => number = dateTimestampSource.nowSeconds.bind(dateTimestampSource);\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * See `usingPerformanceAPI` to test whether the Performance API is used.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nexport const timestampInSeconds: () => number = timestampSource.nowSeconds.bind(timestampSource);\n\n// Re-exported with an old name for backwards-compatibility.\nexport const timestampWithMs = timestampInSeconds;\n\n/**\n * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.\n */\nexport const usingPerformanceAPI = platformPerformance !== undefined;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nexport let _browserPerformanceTimeOriginMode: string;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nexport const browserPerformanceTimeOrigin = ((): number | undefined => {\n  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n  // data as reliable if they are within a reasonable threshold of the current time.\n\n  const { performance } = WINDOW;\n  if (!performance || !performance.now) {\n    _browserPerformanceTimeOriginMode = 'none';\n    return undefined;\n  }\n\n  const threshold = 3600 * 1000;\n  const performanceNow = performance.now();\n  const dateNow = Date.now();\n\n  // if timeOrigin isn't available set delta to threshold so it isn't used\n  const timeOriginDelta = performance.timeOrigin\n    ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n    : threshold;\n  const timeOriginIsReliable = timeOriginDelta < threshold;\n\n  // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n  // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n  // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n  // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n  // Date API.\n  // eslint-disable-next-line deprecation/deprecation\n  const navigationStart = performance.timing && performance.timing.navigationStart;\n  const hasNavigationStart = typeof navigationStart === 'number';\n  // if navigationStart isn't available set delta to threshold so it isn't used\n  const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n  const navigationStartIsReliable = navigationStartDelta < threshold;\n\n  if (timeOriginIsReliable || navigationStartIsReliable) {\n    // Use the more reliable time origin\n    if (timeOriginDelta <= navigationStartDelta) {\n      _browserPerformanceTimeOriginMode = 'timeOrigin';\n      return performance.timeOrigin;\n    } else {\n      _browserPerformanceTimeOriginMode = 'navigationStart';\n      return navigationStart;\n    }\n  }\n\n  // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n  _browserPerformanceTimeOriginMode = 'dateNow';\n  return dateNow;\n})();\n"],"names":[],"mappings":";;;AAGA;AACA,MAAA,MAAA,GAAA,eAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,mBAAA,GAAA;AACA,EAAA,UAAA,EAAA,MAAA,IAAA,CAAA,GAAA,EAAA,GAAA,IAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,GAAA;AACA,EAAA,MAAA,EAAA,WAAA,EAAA,GAAA,MAAA,CAAA;AACA,EAAA,IAAA,CAAA,WAAA,IAAA,CAAA,WAAA,CAAA,GAAA,EAAA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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A;AACA;AACA;AACA,EAAA,iCAAA,GAAA,SAAA,CAAA;AACA,EAAA,OAAA,OAAA,CAAA;AACA,CAAA;;;;"}const TRACEPARENT_REGEXP = new RegExp(
  '^[ \\t]*' + // whitespace
    '([0-9a-f]{32})?' + // trace_id
    '-?([0-9a-f]{16})?' + // span_id
    '-?([01])?' + // sampled
    '[ \\t]*$', // whitespace
);

/**
 * Extract transaction context data from a `sentry-trace` header.
 *
 * @param traceparent Traceparent string
 *
 * @returns Object containing data from the header, or undefined if traceparent string is malformed
 */
function extractTraceparentData(traceparent) {
  const matches = traceparent.match(TRACEPARENT_REGEXP);

  if (!traceparent || !matches) {
    // empty string or no matches is invalid traceparent data
    return undefined;
  }

  let parentSampled;
  if (matches[3] === '1') {
    parentSampled = true;
  } else if (matches[3] === '0') {
    parentSampled = false;
  }

  return {
    traceId: matches[1],
    parentSampled,
    parentSpanId: matches[2],
  };
}

export { TRACEPARENT_REGEXP, extractTraceparentData };
//# sourceMappingURL=tracing.js.map
{"version":3,"file":"tracing.js","sources":["../../src/tracing.ts"],"sourcesContent":["import type { TraceparentData } from '@sentry/types';\n\nexport const TRACEPARENT_REGEXP = new RegExp(\n  '^[ \\\\t]*' + // whitespace\n    '([0-9a-f]{32})?' + // trace_id\n    '-?([0-9a-f]{16})?' + // span_id\n    '-?([01])?' + // sampled\n    '[ \\\\t]*$', // whitespace\n);\n\n/**\n * Extract transaction context data from a `sentry-trace` header.\n *\n * @param traceparent Traceparent string\n *\n * @returns Object containing data from the header, or undefined if traceparent string is malformed\n */\nexport function extractTraceparentData(traceparent: string): TraceparentData | undefined {\n  const matches = traceparent.match(TRACEPARENT_REGEXP);\n\n  if (!traceparent || !matches) {\n    // empty string or no matches is invalid traceparent data\n    return undefined;\n  }\n\n  let parentSampled: boolean | undefined;\n  if (matches[3] === '1') {\n    parentSampled = true;\n  } else if (matches[3] === '0') {\n    parentSampled = false;\n  }\n\n  return {\n    traceId: matches[1],\n    parentSampled,\n    parentSpanId: matches[2],\n  };\n}\n"],"names":[],"mappings":"AAEA,MAAA,kBAAA,GAAA,IAAA,MAAA;AACA,EAAA,UAAA;AACA,IAAA,iBAAA;AACA,IAAA,mBAAA;AACA,IAAA,WAAA;AACA,IAAA,UAAA;AACA,EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,WAAA,CAAA,KAAA,CAAA,kBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,WAAA,IAAA,CAAA,OAAA,EAAA;AACA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,IAAA,aAAA,CAAA;AACA,EAAA,IAAA,OAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,aAAA,GAAA,IAAA,CAAA;AACA,GAAA,MAAA,IAAA,OAAA,CAAA,CAAA,CAAA,KAAA,GAAA,EAAA;AACA,IAAA,aAAA,GAAA,KAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA;AACA,IAAA,OAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA,IAAA,aAAA;AACA,IAAA,YAAA,EAAA,OAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;"}/**
 * Parses string form of URL into an object
 * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
 * // intentionally using regex and not <a/> href parsing trick because React Native and other
 * // environments where DOM might not be available
 * @returns parsed URL object
 */
function parseUrl(url) {
  if (!url) {
    return {};
  }

  const match = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);

  if (!match) {
    return {};
  }

  // coerce to undefined values to empty string so we don't get 'undefined'
  const query = match[6] || '';
  const fragment = match[8] || '';
  return {
    host: match[4],
    path: match[5],
    protocol: match[2],
    search: query,
    hash: fragment,
    relative: match[5] + query + fragment, // everything minus origin
  };
}

/**
 * Strip the query string and fragment off of a given URL or path (if present)
 *
 * @param urlPath Full URL or path, including possible query string and/or fragment
 * @returns URL or path without query string or fragment
 */
function stripUrlQueryAndFragment(urlPath) {
  // eslint-disable-next-line no-useless-escape
  return urlPath.split(/[\?#]/, 1)[0];
}

/**
 * Returns number of URL segments of a passed string URL.
 */
function getNumberOfUrlSegments(url) {
  // split at '/' or at '\/' to split regex urls correctly
  return url.split(/\\?\//).filter(s => s.length > 0 && s !== ',').length;
}

/**
 * Takes a URL object and returns a sanitized string which is safe to use as span description
 * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data
 */
function getSanitizedUrlString(url) {
  const { protocol, host, path } = url;

  const filteredHost =
    (host &&
      host
        // Always filter out authority
        .replace(/^.*@/, '[filtered]:[filtered]@')
        // Don't show standard :80 (http) and :443 (https) ports to reduce the noise
        .replace(':80', '')
        .replace(':443', '')) ||
    '';

  return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;
}

export { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment };
//# sourceMappingURL=url.js.map
{"version":3,"file":"url.js","sources":["../../src/url.ts"],"sourcesContent":["type PartialURL = {\n  host?: string;\n  path?: string;\n  protocol?: string;\n  relative?: string;\n  search?: string;\n  hash?: string;\n};\n\n/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not <a/> href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nexport function parseUrl(url: string): PartialURL {\n  if (!url) {\n    return {};\n  }\n\n  const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n  if (!match) {\n    return {};\n  }\n\n  // coerce to undefined values to empty string so we don't get 'undefined'\n  const query = match[6] || '';\n  const fragment = match[8] || '';\n  return {\n    host: match[4],\n    path: match[5],\n    protocol: match[2],\n    search: query,\n    hash: fragment,\n    relative: match[5] + query + fragment, // everything minus origin\n  };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nexport function stripUrlQueryAndFragment(urlPath: string): string {\n  // eslint-disable-next-line no-useless-escape\n  return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n  // split at '/' or at '\\/' to split regex urls correctly\n  return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nexport function getSanitizedUrlString(url: PartialURL): string {\n  const { protocol, host, path } = url;\n\n  const filteredHost =\n    (host &&\n      host\n        // Always filter out authority\n        .replace(/^.*@/, '[filtered]:[filtered]@')\n        // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n        .replace(':80', '')\n        .replace(':443', '')) ||\n    '';\n\n  return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n"],"names":[],"mappings":"AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,IAAA,CAAA,GAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,GAAA,CAAA,KAAA,CAAA,8DAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,CAAA,KAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,KAAA,CAAA,CAAA,CAAA,IAAA,EAAA,CAAA;AACA,EAAA,MAAA,QAAA,GAAA,KAAA,CAAA,CAAA,CAAA,IAAA,EAAA,CAAA;AACA,EAAA,OAAA;AACA,IAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,KAAA;AACA,IAAA,IAAA,EAAA,QAAA;AACA,IAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA,GAAA,KAAA,GAAA,QAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,wBAAA,CAAA,OAAA,EAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA,KAAA,CAAA,OAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,GAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,MAAA,CAAA,CAAA,IAAA,CAAA,CAAA,MAAA,GAAA,CAAA,IAAA,CAAA,KAAA,GAAA,CAAA,CAAA,MAAA,CAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA,CAAA,GAAA,EAAA;AACA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,IAAA,EAAA,GAAA,GAAA,CAAA;AACA;AACA,EAAA,MAAA,YAAA;AACA,IAAA,CAAA,IAAA;AACA,MAAA,IAAA;AACA;AACA,SAAA,OAAA,CAAA,MAAA,EAAA,wBAAA,CAAA;AACA;AACA,SAAA,OAAA,CAAA,KAAA,EAAA,EAAA,CAAA;AACA,SAAA,OAAA,CAAA,MAAA,EAAA,EAAA,CAAA;AACA,IAAA,EAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,EAAA,QAAA,GAAA,CAAA,EAAA,QAAA,CAAA,GAAA,CAAA,GAAA,EAAA,CAAA,EAAA,YAAA,CAAA,EAAA,IAAA,CAAA,CAAA,CAAA;AACA;;;;"}/**
 * Recursively traverses an object to update an existing nested key.
 * Note: The provided key path must include existing properties,
 * the function will not create objects while traversing.
 *
 * @param obj An object to update
 * @param value The value to update the nested key with
 * @param keyPath The path to the key to update ex. fizz.buzz.foo
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function setNestedKey(obj, keyPath, value) {
  // Ex. foo.bar.zoop will extract foo and bar.zoop
  const match = keyPath.match(/([a-z_]+)\.(.*)/i);
  // The match will be null when there's no more recursing to do, i.e., when we've reached the right level of the object
  if (match === null) {
    obj[keyPath] = value;
  } else {
    // `match[1]` is the initial segment of the path, and `match[2]` is the remainder of the path
    const innerObj = obj[match[1]];
    setNestedKey(innerObj, match[2], value);
  }
}

/**
 * Enforces inclusion of a given integration with specified options in an integration array originally determined by the
 * user, by either including the given default instance or by patching an existing user instance with the given options.
 *
 * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging
 * options from a default integration instance with those from a user-provided instance of the same integration, only
 * for allowing the user to override a default instance entirely. (TODO: Fix that.)
 *
 * @param defaultIntegrationInstance An instance of the integration with the correct options already set
 * @param userIntegrations Integrations defined by the user.
 * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.
 * @returns A final integrations array.
 */
function addOrUpdateIntegration(
  defaultIntegrationInstance,
  userIntegrations,
  forcedOptions = {},
) {
  return (
    Array.isArray(userIntegrations)
      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)
      : addOrUpdateIntegrationInFunction(
          defaultIntegrationInstance,
          // Somehow TS can't figure out that not being an array makes this necessarily a function
          userIntegrations ,
          forcedOptions,
        )
  ) ;
}

function addOrUpdateIntegrationInArray(
  defaultIntegrationInstance,
  userIntegrations,
  forcedOptions,
) {
  const userInstance = userIntegrations.find(integration => integration.name === defaultIntegrationInstance.name);

  if (userInstance) {
    for (const [keyPath, value] of Object.entries(forcedOptions)) {
      setNestedKey(userInstance, keyPath, value);
    }

    return userIntegrations;
  }

  return [...userIntegrations, defaultIntegrationInstance];
}

function addOrUpdateIntegrationInFunction(
  defaultIntegrationInstance,
  userIntegrationsFunc,
  forcedOptions,
) {
  const wrapper = defaultIntegrations => {
    const userFinalIntegrations = userIntegrationsFunc(defaultIntegrations);

    // There are instances where we want the user to be able to prevent an integration from appearing at all, which they
    // would do by providing a function which filters out the integration in question. If that's happened in one of
    // those cases, don't add our default back in.
    if (defaultIntegrationInstance.allowExclusionByUser) {
      const userFinalInstance = userFinalIntegrations.find(
        integration => integration.name === defaultIntegrationInstance.name,
      );
      if (!userFinalInstance) {
        return userFinalIntegrations;
      }
    }

    return addOrUpdateIntegrationInArray(defaultIntegrationInstance, userFinalIntegrations, forcedOptions);
  };

  return wrapper;
}

export { addOrUpdateIntegration };
//# sourceMappingURL=userIntegrations.js.map
{"version":3,"file":"userIntegrations.js","sources":["../../src/userIntegrations.ts"],"sourcesContent":["import type { Integration } from '@sentry/types';\n\nexport type UserIntegrationsFunction = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserIntegrationsFunction;\nexport type IntegrationWithExclusionOption = Integration & {\n  /**\n   * Allow the user to exclude this integration by not returning it from a function provided as the `integrations` option\n   * in `Sentry.init()`. Meant to be used with default integrations, the idea being that if a user has actively filtered\n   * an integration out, we should be able to respect that choice if we wish.\n   */\n  allowExclusionByUser?: boolean;\n};\n\ntype ForcedIntegrationOptions = {\n  [keyPath: string]: unknown;\n};\n\n/**\n * Recursively traverses an object to update an existing nested key.\n * Note: The provided key path must include existing properties,\n * the function will not create objects while traversing.\n *\n * @param obj An object to update\n * @param value The value to update the nested key with\n * @param keyPath The path to the key to update ex. fizz.buzz.foo\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setNestedKey(obj: Record<string, any>, keyPath: string, value: unknown): void {\n  // Ex. foo.bar.zoop will extract foo and bar.zoop\n  const match = keyPath.match(/([a-z_]+)\\.(.*)/i);\n  // The match will be null when there's no more recursing to do, i.e., when we've reached the right level of the object\n  if (match === null) {\n    obj[keyPath] = value;\n  } else {\n    // `match[1]` is the initial segment of the path, and `match[2]` is the remainder of the path\n    const innerObj = obj[match[1]];\n    setNestedKey(innerObj, match[2], value);\n  }\n}\n\n/**\n * Enforces inclusion of a given integration with specified options in an integration array originally determined by the\n * user, by either including the given default instance or by patching an existing user instance with the given options.\n *\n * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging\n * options from a default integration instance with those from a user-provided instance of the same integration, only\n * for allowing the user to override a default instance entirely. (TODO: Fix that.)\n *\n * @param defaultIntegrationInstance An instance of the integration with the correct options already set\n * @param userIntegrations Integrations defined by the user.\n * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.\n * @returns A final integrations array.\n */\nexport function addOrUpdateIntegration<T extends UserIntegrations>(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: T,\n  forcedOptions: ForcedIntegrationOptions = {},\n): T {\n  return (\n    Array.isArray(userIntegrations)\n      ? addOrUpdateIntegrationInArray(defaultIntegrationInstance, userIntegrations, forcedOptions)\n      : addOrUpdateIntegrationInFunction(\n          defaultIntegrationInstance,\n          // Somehow TS can't figure out that not being an array makes this necessarily a function\n          userIntegrations as UserIntegrationsFunction,\n          forcedOptions,\n        )\n  ) as T;\n}\n\nfunction addOrUpdateIntegrationInArray(\n  defaultIntegrationInstance: Integration,\n  userIntegrations: Integration[],\n  forcedOptions: ForcedIntegrationOptions,\n): Integration[] {\n  const userInstance = userIntegrations.find(integration => integration.name === defaultIntegrationInstance.name);\n\n  if (userInstance) {\n    for (const [keyPath, value] of Object.entries(forcedOptions)) {\n      setNestedKey(userInstance, keyPath, value);\n    }\n\n    return userIntegrations;\n  }\n\n  return [...userIntegrations, defaultIntegrationInstance];\n}\n\nfunction addOrUpdateIntegrationInFunction(\n  defaultIntegrationInstance: IntegrationWithExclusionOption,\n  userIntegrationsFunc: UserIntegrationsFunction,\n  forcedOptions: ForcedIntegrationOptions,\n): UserIntegrationsFunction {\n  const wrapper: UserIntegrationsFunction = defaultIntegrations => {\n    const userFinalIntegrations = userIntegrationsFunc(defaultIntegrations);\n\n    // There are instances where we want the user to be able to prevent an integration from appearing at all, which they\n    // would do by providing a function which filters out the integration in question. If that's happened in one of\n    // those cases, don't add our default back in.\n    if (defaultIntegrationInstance.allowExclusionByUser) {\n      const userFinalInstance = userFinalIntegrations.find(\n        integration => integration.name === defaultIntegrationInstance.name,\n      );\n      if (!userFinalInstance) {\n        return userFinalIntegrations;\n      }\n    }\n\n    return addOrUpdateIntegrationInArray(defaultIntegrationInstance, userFinalIntegrations, forcedOptions);\n  };\n\n  return wrapper;\n}\n"],"names":[],"mappings":"AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,YAAA,CAAA,GAAA,EAAA,OAAA,EAAA,KAAA,EAAA;AACA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,CAAA,KAAA,CAAA,kBAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,KAAA,IAAA,EAAA;AACA,IAAA,GAAA,CAAA,OAAA,CAAA,GAAA,KAAA,CAAA;AACA,GAAA,MAAA;AACA;AACA,IAAA,MAAA,QAAA,GAAA,GAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,YAAA,CAAA,QAAA,EAAA,KAAA,CAAA,CAAA,CAAA,EAAA,KAAA,CAAA,CAAA;AACA,GAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,sBAAA;AACA,EAAA,0BAAA;AACA,EAAA,gBAAA;AACA,EAAA,aAAA,GAAA,EAAA;AACA,EAAA;AACA,EAAA;AACA,IAAA,KAAA,CAAA,OAAA,CAAA,gBAAA,CAAA;AACA,QAAA,6BAAA,CAAA,0BAAA,EAAA,gBAAA,EAAA,aAAA,CAAA;AACA,QAAA,gCAAA;AACA,UAAA,0BAAA;AACA;AACA,UAAA,gBAAA;AACA,UAAA,aAAA;AACA,SAAA;AACA,KAAA;AACA,CAAA;AACA;AACA,SAAA,6BAAA;AACA,EAAA,0BAAA;AACA,EAAA,gBAAA;AACA,EAAA,aAAA;AACA,EAAA;AACA,EAAA,MAAA,YAAA,GAAA,gBAAA,CAAA,IAAA,CAAA,WAAA,IAAA,WAAA,CAAA,IAAA,KAAA,0BAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,YAAA,EAAA;AACA,IAAA,KAAA,MAAA,CAAA,OAAA,EAAA,KAAA,CAAA,IAAA,MAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA;AACA,MAAA,YAAA,CAAA,YAAA,EAAA,OAAA,EAAA,KAAA,CAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,gBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,CAAA,GAAA,gBAAA,EAAA,0BAAA,CAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,gCAAA;AACA,EAAA,0BAAA;AACA,EAAA,oBAAA;AACA,EAAA,aAAA;AACA,EAAA;AACA,EAAA,MAAA,OAAA,GAAA,mBAAA,IAAA;AACA,IAAA,MAAA,qBAAA,GAAA,oBAAA,CAAA,mBAAA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA,IAAA,IAAA,0BAAA,CAAA,oBAAA,EAAA;AACA,MAAA,MAAA,iBAAA,GAAA,qBAAA,CAAA,IAAA;AACA,QAAA,WAAA,IAAA,WAAA,CAAA,IAAA,KAAA,0BAAA,CAAA,IAAA;AACA,OAAA,CAAA;AACA,MAAA,IAAA,CAAA,iBAAA,EAAA;AACA,QAAA,OAAA,qBAAA,CAAA;AACA,OAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,6BAAA,CAAA,0BAAA,EAAA,qBAAA,EAAA,aAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA;AACA;;;;"}// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to:
//   a) reduce the size by skipping the runtime type - checking
//   b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+).
//
// MIT License
//
// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files(the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and
// to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of
// the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.

/**
 * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to
 * `new RegExp()`.
 *
 * @param regexString The string to escape
 * @returns An version of the string with all special regex characters escaped
 */
function escapeStringForRegex(regexString) {
  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems
  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.
  return regexString.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
}

export { escapeStringForRegex };
//# sourceMappingURL=escapeStringForRegex.js.map
{"version":3,"file":"escapeStringForRegex.js","sources":["../../../src/vendor/escapeStringForRegex.ts"],"sourcesContent":["// Based on https://github.com/sindresorhus/escape-string-regexp but with modifications to:\n//   a) reduce the size by skipping the runtime type - checking\n//   b) ensure it gets down - compiled for old versions of Node(the published package only supports Node 12+).\n//\n// MIT License\n//\n// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files(the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and / or sell copies of the Software, and\n// to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n// the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n// THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\n/**\n * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to\n * `new RegExp()`.\n *\n * @param regexString The string to escape\n * @returns An version of the string with all special regex characters escaped\n */\nexport function escapeStringForRegex(regexString: string): string {\n  // escape the hyphen separately so we can also replace it with a unicode literal hyphen, to avoid the problems\n  // discussed in https://github.com/sindresorhus/escape-string-regexp/issues/20.\n  return regexString.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&').replace(/-/g, '\\\\x2d');\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,oBAAA,CAAA,WAAA,EAAA;AACA;AACA;AACA,EAAA,OAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,MAAA,CAAA,CAAA,OAAA,CAAA,IAAA,EAAA,OAAA,CAAA,CAAA;AACA;;;;"}import { getGlobalObject } from '../worldwide.js';

// Based on https://github.com/angular/angular.js/pull/13945/files

// eslint-disable-next-line deprecation/deprecation
const WINDOW = getGlobalObject();

/**
 * Tells whether current environment supports History API
 * {@link supportsHistory}.
 *
 * @returns Answer to the given question.
 */
function supportsHistory() {
  // NOTE: in Chrome App environment, touching history.pushState, *even inside
  //       a try/catch block*, will cause Chrome to output an error to console.error
  // borrowed from: https://github.com/angular/angular.js/pull/13945/files
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
  const chrome = (WINDOW ).chrome;
  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;
  /* eslint-enable @typescript-eslint/no-unsafe-member-access */
  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;

  return !isChromePackagedApp && hasHistoryApi;
}

export { supportsHistory };
//# sourceMappingURL=supportsHistory.js.map
{"version":3,"file":"supportsHistory.js","sources":["../../../src/vendor/supportsHistory.ts"],"sourcesContent":["// Based on https://github.com/angular/angular.js/pull/13945/files\n// The MIT License\n\n// Copyright (c) 2010-2016 Google, Inc. http://angularjs.org\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { getGlobalObject } from '../worldwide';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject<Window>();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nexport function supportsHistory(): boolean {\n  // NOTE: in Chrome App environment, touching history.pushState, *even inside\n  //       a try/catch block*, will cause Chrome to output an error to console.error\n  // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n  /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const chrome = (WINDOW as any).chrome;\n  const isChromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n  /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n  const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n  return !isChromePackagedApp && hasHistoryApi;\n}\n"],"names":[],"mappings":";;AAAA;AAwBA;AACA;AACA,MAAA,MAAA,GAAA,eAAA,EAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,MAAA,MAAA,GAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AACA,EAAA,MAAA,mBAAA,GAAA,MAAA,IAAA,MAAA,CAAA,GAAA,IAAA,MAAA,CAAA,GAAA,CAAA,OAAA,CAAA;AACA;AACA,EAAA,MAAA,aAAA,GAAA,SAAA,IAAA,MAAA,IAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,SAAA,IAAA,CAAA,CAAA,MAAA,CAAA,OAAA,CAAA,YAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,mBAAA,IAAA,aAAA,CAAA;AACA;;;;"}/** Internal global with common properties and Sentry extensions  */

// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification
// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js
// core-js has the following licence:
//
// Copyright (c) 2014-2022 Denis Pushkarev
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

/** Returns 'obj' if it's the global object, otherwise returns undefined */
function isGlobalObj(obj) {
  return obj && obj.Math == Math ? obj : undefined;
}

/** Get's the global object for the current JavaScript runtime */
const GLOBAL_OBJ =
  (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||
  // eslint-disable-next-line no-restricted-globals
  (typeof window == 'object' && isGlobalObj(window)) ||
  (typeof self == 'object' && isGlobalObj(self)) ||
  (typeof global == 'object' && isGlobalObj(global)) ||
  (function () {
    return this;
  })() ||
  {};

/**
 * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8
 */
function getGlobalObject() {
  return GLOBAL_OBJ ;
}

/**
 * Returns a global singleton contained in the global `__SENTRY__` object.
 *
 * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
 * function and added to the `__SENTRY__` object.
 *
 * @param name name of the global singleton on __SENTRY__
 * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
 * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value
 * @returns the singleton
 */
function getGlobalSingleton(name, creator, obj) {
  const gbl = (obj || GLOBAL_OBJ) ;
  const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});
  const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());
  return singleton;
}

export { GLOBAL_OBJ, getGlobalObject, getGlobalSingleton };
//# sourceMappingURL=worldwide.js.map
{"version":3,"file":"worldwide.js","sources":["../../src/worldwide.ts"],"sourcesContent":["/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n *\n * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing\n * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).\n *\n * Why worldwide?\n *\n * Why not?\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Integration } from '@sentry/types';\n\nimport type { SdkSource } from './env';\n\n/** Internal global with common properties and Sentry extensions  */\nexport interface InternalGlobal {\n  navigator?: { userAgent?: string };\n  console: Console;\n  Sentry?: {\n    Integrations?: Integration[];\n  };\n  onerror?: {\n    (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean;\n    __SENTRY_INSTRUMENTED__?: true;\n    __SENTRY_LOADER__?: true;\n  };\n  onunhandledrejection?: {\n    (event: unknown): boolean;\n    __SENTRY_INSTRUMENTED__?: true;\n    __SENTRY_LOADER__?: true;\n  };\n  SENTRY_ENVIRONMENT?: string;\n  SENTRY_DSN?: string;\n  SENTRY_RELEASE?: {\n    id?: string;\n  };\n  SENTRY_SDK_SOURCE?: SdkSource;\n  /**\n   * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map\n   * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS\n   * file.\n   */\n  _sentryDebugIds?: Record<string, string>;\n  __SENTRY__: {\n    globalEventProcessors: any;\n    hub: any;\n    logger: any;\n    extensions?: {\n      /** Extension methods for the hub, which are bound to the current Hub instance */\n      // eslint-disable-next-line @typescript-eslint/ban-types\n      [key: string]: Function;\n    };\n  };\n}\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj: { Math?: Math }): any | undefined {\n  return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nexport const GLOBAL_OBJ: InternalGlobal =\n  (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n  // eslint-disable-next-line no-restricted-globals\n  (typeof window == 'object' && isGlobalObj(window)) ||\n  (typeof self == 'object' && isGlobalObj(self)) ||\n  (typeof global == 'object' && isGlobalObj(global)) ||\n  (function (this: any) {\n    return this;\n  })() ||\n  {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nexport function getGlobalObject<T>(): T & InternalGlobal {\n  return GLOBAL_OBJ as T & InternalGlobal;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nexport function getGlobalSingleton<T>(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T {\n  const gbl = (obj || GLOBAL_OBJ) as InternalGlobal;\n  const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n  const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n  return singleton;\n}\n"],"names":[],"mappings":"AAkBA;;AAyCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,WAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,GAAA,IAAA,GAAA,CAAA,IAAA,IAAA,IAAA,GAAA,GAAA,GAAA,SAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,MAAA,UAAA;AACA,EAAA,CAAA,OAAA,UAAA,IAAA,QAAA,IAAA,WAAA,CAAA,UAAA,CAAA;AACA;AACA,GAAA,OAAA,MAAA,IAAA,QAAA,IAAA,WAAA,CAAA,MAAA,CAAA,CAAA;AACA,GAAA,OAAA,IAAA,IAAA,QAAA,IAAA,WAAA,CAAA,IAAA,CAAA,CAAA;AACA,GAAA,OAAA,MAAA,IAAA,QAAA,IAAA,WAAA,CAAA,MAAA,CAAA,CAAA;AACA,EAAA,CAAA,YAAA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,GAAA;AACA,EAAA,GAAA;AACA;AACA;AACA;AACA;AACA,SAAA,eAAA,GAAA;AACA,EAAA,OAAA,UAAA,EAAA;AACA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,kBAAA,CAAA,IAAA,EAAA,OAAA,EAAA,GAAA,EAAA;AACA,EAAA,MAAA,GAAA,IAAA,GAAA,IAAA,UAAA,CAAA,EAAA;AACA,EAAA,MAAA,UAAA,IAAA,GAAA,CAAA,UAAA,GAAA,GAAA,CAAA,UAAA,IAAA,EAAA,CAAA,CAAA;AACA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,IAAA,CAAA,KAAA,UAAA,CAAA,IAAA,CAAA,GAAA,OAAA,EAAA,CAAA,CAAA;AACA,EAAA,OAAA,SAAA,CAAA;AACA;;;;"}Copyright (c) 2019 Sentry (https://sentry.io) and individual contributors. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
  "name": "@sentry/utils",
  "version": "7.48.0",
  "description": "Utilities for all Sentry JavaScript SDKs",
  "repository": "git://github.com/getsentry/sentry-javascript.git",
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/utils",
  "author": "Sentry",
  "license": "MIT",
  "engines": {
    "node": ">=8"
  },
  "main": "cjs/index.js",
  "module": "esm/index.js",
  "types": "types/index.d.ts",
  "publishConfig": {
    "access": "public"
  },
  "dependencies": {
    "@sentry/types": "7.48.0",
    "tslib": "^1.9.3"
  },
  "devDependencies": {
    "@types/array.prototype.flat": "^1.2.1",
    "array.prototype.flat": "^1.3.0",
    "chai": "^4.1.2"
  },
  "sideEffects": false
}<p align="center">
  <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
    <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
  </a>
</p>

# Sentry JavaScript SDK Utilities

[![npm version](https://img.shields.io/npm/v/@sentry/utils.svg)](https://www.npmjs.com/package/@sentry/utils)
[![npm dm](https://img.shields.io/npm/dm/@sentry/utils.svg)](https://www.npmjs.com/package/@sentry/utils)
[![npm dt](https://img.shields.io/npm/dt/@sentry/utils.svg)](https://www.npmjs.com/package/@sentry/utils)

## Links

- [Official SDK Docs](https://docs.sentry.io/quickstart/)
- [TypeDoc](http://getsentry.github.io/sentry-javascript/)

## General

Common utilities used by the Sentry JavaScript SDKs.

Note: This package is only meant to be used internally, and as such is not part of our public API contract and does not follow semver.
import type { DynamicSamplingContext } from '@sentry/types';
export declare const BAGGAGE_HEADER_NAME = "baggage";
export declare const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-";
export declare const SENTRY_BAGGAGE_KEY_PREFIX_REGEX: RegExp;
/**
 * Max length of a serialized baggage string
 *
 * https://www.w3.org/TR/baggage/#limits
 */
export declare const MAX_BAGGAGE_STRING_LENGTH = 8192;
/**
 * Takes a baggage header and turns it into Dynamic Sampling Context, by extracting all the "sentry-" prefixed values
 * from it.
 *
 * @param baggageHeader A very bread definition of a baggage header as it might appear in various frameworks.
 * @returns The Dynamic Sampling Context that was found on `baggageHeader`, if there was any, `undefined` otherwise.
 */
export declare function baggageHeaderToDynamicSamplingContext(baggageHeader: string | string[] | number | null | undefined | boolean): Partial<DynamicSamplingContext> | undefined;
/**
 * Turns a Dynamic Sampling Object into a baggage header by prefixing all the keys on the object with "sentry-".
 *
 * @param dynamicSamplingContext The Dynamic Sampling Context to turn into a header. For convenience and compatibility
 * with the `getDynamicSamplingContext` method on the Transaction class ,this argument can also be `undefined`. If it is
 * `undefined` the function will return `undefined`.
 * @returns a baggage header, created from `dynamicSamplingContext`, or `undefined` either if `dynamicSamplingContext`
 * was `undefined`, or if `dynamicSamplingContext` didn't contain any values.
 */
export declare function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext: Partial<DynamicSamplingContext>): string | undefined;
//# sourceMappingURL=baggage.d.ts.map{"version":3,"file":"baggage.d.ts","sourceRoot":"","sources":["../../src/baggage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAK5D,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,yBAAyB,YAAY,CAAC;AAEnD,eAAO,MAAM,+BAA+B,QAAa,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CAEnD,aAAa,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GACrE,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,CA4C7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,2CAA2C,CAEzD,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,CAAC,GACtD,MAAM,GAAG,SAAS,CAapB"}/**
 * Given a child DOM element, returns a query-selector statement describing that
 * and its ancestors
 * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]
 * @returns generated DOM path
 */
export declare function htmlTreeAsString(elem: unknown, options?: string[] | {
    keyAttrs?: string[];
    maxStringLength?: number;
}): string;
/**
 * A safe form of location.href
 */
export declare function getLocationHref(): string;
/**
 * Gets a DOM element by using document.querySelector.
 *
 * This wrapper will first check for the existance of the function before
 * actually calling it so that we don't have to take care of this check,
 * every time we want to access the DOM.
 *
 * Reason: DOM/querySelector is not available in all environments.
 *
 * We have to cast to any because utils can be consumed by a variety of environments,
 * and we don't want to break TS users. If you know what element will be selected by
 * `document.querySelector`, specify it as part of the generic call. For example,
 * `const element = getDomElement<Element>('selector');`
 *
 * @param selector the selector string passed on to document.querySelector
 */
export declare function getDomElement<E = any>(selector: string): E | null;
//# sourceMappingURL=browser.d.ts.map{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,MAAM,EAAE,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAO,GACzE,MAAM,CAyCR;AA+DD;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAMxC;AAED;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAKjE"}/**
 * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the
 * result of an async operation.
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
export declare function _asyncNullishCoalesce(lhs: unknown, rhsFn: () => unknown): Promise<unknown>;
//# sourceMappingURL=_asyncNullishCoalesce.d.ts.map{"version":3,"file":"_asyncNullishCoalesce.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_asyncNullishCoalesce.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAEhG"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, for situations in which at least one part of the expression is async.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
export declare function _asyncOptionalChain(ops: unknown[]): Promise<unknown>;
//# sourceMappingURL=_asyncOptionalChain.d.ts.map{"version":3,"file":"_asyncOptionalChain.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_asyncOptionalChain.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB1E"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
export declare function _asyncOptionalChainDelete(ops: unknown[]): Promise<boolean>;
//# sourceMappingURL=_asyncOptionalChainDelete.d.ts.map{"version":3,"file":"_asyncOptionalChainDelete.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_asyncOptionalChainDelete.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAMhF"}import type { GenericObject } from './types';
/**
 * Copy a property from the given object into `exports`, under the given name.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the property to copy.
 * @param localName The name under which to export the property
 * @param importedName The name under which the property lives in `obj`
 */
export declare function _createNamedExportFrom(obj: GenericObject, localName: string, importedName: string): void;
//# sourceMappingURL=_createNamedExportFrom.d.ts.map{"version":3,"file":"_createNamedExportFrom.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_createNamedExportFrom.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,CAExG"}import type { GenericObject } from './types';
/**
 * Copy properties from an object into `exports`.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param obj The object containing the properties to copy.
 */
export declare function _createStarExport(obj: GenericObject): void;
//# sourceMappingURL=_createStarExport.d.ts.map{"version":3,"file":"_createStarExport.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_createStarExport.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAI1D"}import type { RequireResult } from './types';
/**
 * Unwraps a module if it has been wrapped in an object under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns The full module, unwrapped if necessary.
 */
export declare function _interopDefault(requireResult: RequireResult): RequireResult;
//# sourceMappingURL=_interopDefault.d.ts.map{"version":3,"file":"_interopDefault.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_interopDefault.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAE3E"}import type { RequireResult } from './types';
/**
 * Adds a self-referential `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
export declare function _interopNamespace(requireResult: RequireResult): RequireResult;
//# sourceMappingURL=_interopNamespace.d.ts.map{"version":3,"file":"_interopNamespace.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_interopNamespace.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAE7E"}import type { RequireResult } from './types';
/**
 * Wrap a module in an object, as the value under the key `default`.
 *
 * Adapted from Rollup (https://github.com/rollup/rollup)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns An object containing the key-value pair (`default`, `requireResult`)
 */
export declare function _interopNamespaceDefaultOnly(requireResult: RequireResult): RequireResult;
//# sourceMappingURL=_interopNamespaceDefaultOnly.d.ts.map{"version":3,"file":"_interopNamespaceDefaultOnly.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_interopNamespaceDefaultOnly.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAKxF"}import type { RequireResult } from './types';
/**
 * Wraps modules which aren't the result of transpiling an ESM module in an object under the key `default`
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns `requireResult` or `requireResult` wrapped in an object, keyed as `default`
 */
export declare function _interopRequireDefault(requireResult: RequireResult): RequireResult;
//# sourceMappingURL=_interopRequireDefault.d.ts.map{"version":3,"file":"_interopRequireDefault.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_interopRequireDefault.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAElF"}import type { RequireResult } from './types';
/**
 * Adds a `default` property to CJS modules which aren't the result of transpilation from ESM modules.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param requireResult The result of calling `require` on a module
 * @returns Either `requireResult` or a copy of `requireResult` with an added self-referential `default` property
 */
export declare function _interopRequireWildcard(requireResult: RequireResult): RequireResult;
//# sourceMappingURL=_interopRequireWildcard.d.ts.map{"version":3,"file":"_interopRequireWildcard.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_interopRequireWildcard.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAEnF"}/**
 * Polyfill for the nullish coalescing operator (`??`).
 *
 * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
 * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 *
 * @param lhs The value of the expression to the left of the `??`
 * @param rhsFn A function returning the value of the expression to the right of the `??`
 * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
 */
export declare function _nullishCoalesce(lhs: unknown, rhsFn: () => unknown): unknown;
//# sourceMappingURL=_nullishCoalesce.d.ts.map{"version":3,"file":"_nullishCoalesce.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_nullishCoalesce.ts"],"names":[],"mappings":"AAwBA;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,GAAG,OAAO,CAG5E"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase)
 * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The value of the expression
 */
export declare function _optionalChain(ops: unknown[]): unknown;
//# sourceMappingURL=_optionalChain.d.ts.map{"version":3,"file":"_optionalChain.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_optionalChain.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CAsBtD"}/**
 * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
 * descriptors, and functions, in cases where the value of the expression is to be deleted.
 *
 * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
 * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
 *
 * @param ops Array result of expression conversion
 * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
 * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
 * case `false`.
 */
export declare function _optionalChainDelete(ops: unknown[]): boolean;
//# sourceMappingURL=_optionalChainDelete.d.ts.map{"version":3,"file":"_optionalChainDelete.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/_optionalChainDelete.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,OAAO,CAM5D"}export { _asyncNullishCoalesce } from './_asyncNullishCoalesce';
export { _asyncOptionalChain } from './_asyncOptionalChain';
export { _asyncOptionalChainDelete } from './_asyncOptionalChainDelete';
export { _createNamedExportFrom } from './_createNamedExportFrom';
export { _createStarExport } from './_createStarExport';
export { _interopDefault } from './_interopDefault';
export { _interopNamespace } from './_interopNamespace';
export { _interopNamespaceDefaultOnly } from './_interopNamespaceDefaultOnly';
export { _interopRequireDefault } from './_interopRequireDefault';
export { _interopRequireWildcard } from './_interopRequireWildcard';
export { _nullishCoalesce } from './_nullishCoalesce';
export { _optionalChain } from './_optionalChain';
export { _optionalChainDelete } from './_optionalChainDelete';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}import type { Primitive } from '@sentry/types';
export declare type GenericObject = {
    [key: string]: Value;
};
export declare type GenericFunction = (...args: unknown[]) => Value;
export declare type Value = Primitive | GenericFunction | GenericObject;
export declare type RequireResult = GenericObject | (GenericFunction & GenericObject);
//# sourceMappingURL=types.d.ts.map{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/buildPolyfills/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,oBAAY,aAAa,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,CAAC;AACrD,oBAAY,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,KAAK,CAAC;AAC5D,oBAAY,KAAK,GAAG,SAAS,GAAG,eAAe,GAAG,aAAa,CAAC;AAEhE,oBAAY,aAAa,GAAG,aAAa,GAAG,CAAC,eAAe,GAAG,aAAa,CAAC,CAAC"}import type { ClientReport, ClientReportEnvelope } from '@sentry/types';
/**
 * Creates client report envelope
 * @param discarded_events An array of discard events
 * @param dsn A DSN that can be set on the header. Optional.
 */
export declare function createClientReportEnvelope(discarded_events: ClientReport['discarded_events'], dsn?: string, timestamp?: number): ClientReportEnvelope;
//# sourceMappingURL=clientreport.d.ts.map{"version":3,"file":"clientreport.d.ts","sourceRoot":"","sources":["../../src/clientreport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAoB,MAAM,eAAe,CAAC;AAK1F;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,gBAAgB,EAAE,YAAY,CAAC,kBAAkB,CAAC,EAClD,GAAG,CAAC,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB,oBAAoB,CAStB"}import type { DsnComponents, DsnLike } from '@sentry/types';
/**
 * Renders the string representation of this Dsn.
 *
 * By default, this will render the public representation without the password
 * component. To get the deprecated private representation, set `withPassword`
 * to true.
 *
 * @param withPassword When set to true, the password will be included.
 */
export declare function dsnToString(dsn: DsnComponents, withPassword?: boolean): string;
/**
 * Parses a Dsn from a given string.
 *
 * @param str A Dsn as string
 * @returns Dsn as DsnComponents
 */
export declare function dsnFromString(str: string): DsnComponents;
/** The Sentry Dsn, identifying a Sentry instance and project. */
export declare function makeDsn(from: DsnLike): DsnComponents;
//# sourceMappingURL=dsn.d.ts.map{"version":3,"file":"dsn.d.ts","sourceRoot":"","sources":["../../src/dsn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;AAWzE;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,EAAE,YAAY,GAAE,OAAe,GAAG,MAAM,CAMrF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAyBxD;AA2CD,iEAAiE;AACjE,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,CAIpD"}export declare type SdkSource = 'npm' | 'cdn' | 'loader';
/**
 * Figures out if we're building a browser bundle.
 *
 * @returns true if this is a browser bundle build.
 */
export declare function isBrowserBundle(): boolean;
/**
 * Get source of SDK.
 */
export declare function getSDKSource(): SdkSource;
//# sourceMappingURL=env.d.ts.map{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/env.ts"],"names":[],"mappings":"AAiBA,oBAAY,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAGxC"}import type { Attachment, AttachmentItem, DataCategory, DsnComponents, Envelope, EnvelopeItemType, Event, EventEnvelopeHeaders, SdkInfo, SdkMetadata, TextEncoderInternal } from '@sentry/types';
/**
 * Creates an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
export declare function createEnvelope<E extends Envelope>(headers: E[0], items?: E[1]): E;
/**
 * Add an item to an envelope.
 * Make sure to always explicitly provide the generic to this function
 * so that the envelope types resolve correctly.
 */
export declare function addItemToEnvelope<E extends Envelope>(envelope: E, newItem: E[1][number]): E;
/**
 * Convenience function to loop through the items and item types of an envelope.
 * (This function was mostly created because working with envelope types is painful at the moment)
 *
 * If the callback returns true, the rest of the items will be skipped.
 */
export declare function forEachEnvelopeItem<E extends Envelope>(envelope: Envelope, callback: (envelopeItem: E[1][number], envelopeItemType: E[1][number][0]['type']) => boolean | void): boolean;
/**
 * Returns true if the envelope contains any of the given envelope item types
 */
export declare function envelopeContainsItemType(envelope: Envelope, types: EnvelopeItemType[]): boolean;
/**
 * Serializes an envelope.
 */
export declare function serializeEnvelope(envelope: Envelope, textEncoder?: TextEncoderInternal): string | Uint8Array;
export interface TextDecoderInternal {
    decode(input?: Uint8Array): string;
}
/**
 * Parses an envelope
 */
export declare function parseEnvelope(env: string | Uint8Array, textEncoder: TextEncoderInternal, textDecoder: TextDecoderInternal): Envelope;
/**
 * Creates attachment envelope items
 */
export declare function createAttachmentEnvelopeItem(attachment: Attachment, textEncoder?: TextEncoderInternal): AttachmentItem;
/**
 * Maps the type of an envelope item to a data category.
 */
export declare function envelopeItemTypeToDataCategory(type: EnvelopeItemType): DataCategory;
/** Extracts the minimal SDK info from from the metadata or an events */
export declare function getSdkMetadataForEnvelopeHeader(metadataOrEvent?: SdkMetadata | Event): SdkInfo | undefined;
/**
 * Creates event envelope headers, based on event, sdk info and tunnel
 * Note: This function was extracted from the core package to make it available in Replay
 */
export declare function createEventEnvelopeHeaders(event: Event, sdkInfo: SdkInfo | undefined, tunnel: string | undefined, dsn: DsnComponents): EventEnvelopeHeaders;
//# sourceMappingURL=envelope.d.ts.map{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/envelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EAGd,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAMvB;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,GAAE,CAAC,CAAC,CAAC,CAAM,GAAG,CAAC,CAErF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAG3F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,QAAQ,EACpD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,OAAO,GAAG,IAAI,GAClG,OAAO,CAaT;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAE/F;AAUD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,UAAU,CAoC5G;AAeD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CACpC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,WAAW,EAAE,mBAAmB,EAChC,WAAW,EAAE,mBAAmB,GAC/B,QAAQ,CAgCV;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,UAAU,EACtB,WAAW,CAAC,EAAE,mBAAmB,GAChC,cAAc,CAahB;AAgBD;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAEnF;AAED,wEAAwE;AACxE,wBAAgB,+BAA+B,CAAC,eAAe,CAAC,EAAE,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAM1G;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,GAAG,EAAE,aAAa,GACjB,oBAAoB,CAWtB"}import type { ConsoleLevel } from './logger';
/** An error emitted by Sentry SDKs and related utilities. */
export declare class SentryError extends Error {
    message: string;
    /** Display name of this error instance. */
    name: string;
    logLevel: ConsoleLevel;
    constructor(message: string, logLevel?: ConsoleLevel);
}
//# sourceMappingURL=error.d.ts.map{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,6DAA6D;AAC7D,qBAAa,WAAY,SAAQ,KAAK;IAMV,OAAO,EAAE,MAAM;IALzC,2CAA2C;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,YAAY,CAAC;gBAEJ,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAqB;CAU3E"}export * from './browser';
export * from './dsn';
export * from './error';
export * from './worldwide';
export * from './instrument';
export * from './is';
export * from './logger';
export * from './memo';
export * from './misc';
export * from './node';
export * from './normalize';
export * from './object';
export * from './path';
export * from './promisebuffer';
export * from './requestdata';
export * from './severity';
export * from './stacktrace';
export * from './string';
export * from './supports';
export * from './syncpromise';
export * from './time';
export * from './tracing';
export * from './env';
export * from './envelope';
export * from './clientreport';
export * from './ratelimit';
export * from './baggage';
export * from './url';
export * from './userIntegrations';
//# sourceMappingURL=index.d.ts.map{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC"}export declare const SENTRY_XHR_DATA_KEY = "__sentry_xhr_v2__";
export declare type InstrumentHandlerType = 'console' | 'dom' | 'fetch' | 'history' | 'sentry' | 'xhr' | 'error' | 'unhandledrejection';
export declare type InstrumentHandlerCallback = (data: any) => void;
/**
 * Add handler that will be called when given type of instrumentation triggers.
 * Use at your own risk, this might break without changelog notice, only used internally.
 * @hidden
 */
export declare function addInstrumentationHandler(type: InstrumentHandlerType, callback: InstrumentHandlerCallback): void;
/**
 * Parses the fetch arguments to find the used Http method and the url of the request
 */
export declare function parseFetchArgs(fetchArgs: unknown[]): {
    method: string;
    url: string;
};
//# sourceMappingURL=instrument.d.ts.map{"version":3,"file":"instrument.d.ts","sourceRoot":"","sources":["../../src/instrument.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,oBAAY,qBAAqB,GAC7B,SAAS,GACT,KAAK,GACL,OAAO,GACP,SAAS,GACT,QAAQ,GACR,KAAK,GACL,OAAO,GACP,oBAAoB,CAAC;AACzB,oBAAY,yBAAyB,GAAG,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;AAoD5D;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,yBAAyB,GAAG,IAAI,CAIhH;AAwHD;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAmBpF"}import type { PolymorphicEvent, Primitive } from '@sentry/types';
/**
 * Checks whether given value's type is one of a few Error or Error-like
 * {@link isError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isError(wat: unknown): wat is Error;
/**
 * Checks whether given value's type is ErrorEvent
 * {@link isErrorEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isErrorEvent(wat: unknown): boolean;
/**
 * Checks whether given value's type is DOMError
 * {@link isDOMError}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isDOMError(wat: unknown): boolean;
/**
 * Checks whether given value's type is DOMException
 * {@link isDOMException}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isDOMException(wat: unknown): boolean;
/**
 * Checks whether given value's type is a string
 * {@link isString}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isString(wat: unknown): wat is string;
/**
 * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
 * {@link isPrimitive}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isPrimitive(wat: unknown): wat is Primitive;
/**
 * Checks whether given value's type is an object literal
 * {@link isPlainObject}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isPlainObject(wat: unknown): wat is Record<string, unknown>;
/**
 * Checks whether given value's type is an Event instance
 * {@link isEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isEvent(wat: unknown): wat is PolymorphicEvent;
/**
 * Checks whether given value's type is an Element instance
 * {@link isElement}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isElement(wat: unknown): boolean;
/**
 * Checks whether given value's type is an regexp
 * {@link isRegExp}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isRegExp(wat: unknown): wat is RegExp;
/**
 * Checks whether given value has a then function.
 * @param wat A value to be checked.
 */
export declare function isThenable(wat: any): wat is PromiseLike<any>;
/**
 * Checks whether given value's type is a SyntheticEvent
 * {@link isSyntheticEvent}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isSyntheticEvent(wat: unknown): boolean;
/**
 * Checks whether given value is NaN
 * {@link isNaN}.
 *
 * @param wat A value to be checked.
 * @returns A boolean representing the result.
 */
export declare function isNaN(wat: unknown): boolean;
/**
 * Checks whether given value's type is an instance of provided constructor.
 * {@link isInstanceOf}.
 *
 * @param wat A value to be checked.
 * @param base A constructor to be used in a check.
 * @returns A boolean representing the result.
 */
export declare function isInstanceOf(wat: any, base: any): boolean;
//# sourceMappingURL=is.d.ts.map{"version":3,"file":"is.d.ts","sourceRoot":"","sources":["../../src/is.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAKjE;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK,CASlD;AAYD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,SAAS,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,gBAAgB,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAEpD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC,CAG5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEtD;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAE3C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAMzD"}export declare const CONSOLE_LEVELS: readonly ["debug", "info", "warn", "error", "log", "assert", "trace"];
export declare type ConsoleLevel = (typeof CONSOLE_LEVELS)[number];
declare type LoggerMethod = (...args: unknown[]) => void;
declare type LoggerConsoleMethods = Record<(typeof CONSOLE_LEVELS)[number], LoggerMethod>;
/** JSDoc */
interface Logger extends LoggerConsoleMethods {
    disable(): void;
    enable(): void;
}
/**
 * Temporarily disable sentry console instrumentations.
 *
 * @param callback The function to run against the original `console` messages
 * @returns The results of the callback
 */
export declare function consoleSandbox<T>(callback: () => T): T;
declare let logger: Logger;
export { logger };
//# sourceMappingURL=logger.d.ts.map{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,uEAAwE,CAAC;AACpG,oBAAY,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,aAAK,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AACjD,aAAK,oBAAoB,GAAG,MAAM,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC;AAElF,YAAY;AACZ,UAAU,MAAO,SAAQ,oBAAoB;IAC3C,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,IAAI,IAAI,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CA2BtD;AAkCD,QAAA,IAAI,MAAM,EAAE,MAAM,CAAC;AAOnB,OAAO,EAAE,MAAM,EAAE,CAAC"}export declare type MemoFunc = [(obj: any) => boolean, (obj: any) => void];
/**
 * Helper to decycle json objects
 */
export declare function memoBuilder(): MemoFunc;
//# sourceMappingURL=memo.d.ts.map{"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/memo.ts"],"names":[],"mappings":"AAGA,oBAAY,QAAQ,GAAG,CAErB,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,EAErB,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CACnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAmCtC"}import type { Event, Mechanism, StackFrame } from '@sentry/types';
/**
 * UUID4 generator
 *
 * @returns string Generated UUID4.
 */
export declare function uuid4(): string;
/**
 * Extracts either message or type+value from an event that can be used for user-facing logs
 * @returns event's description
 */
export declare function getEventDescription(event: Event): string;
/**
 * Adds exception values, type and value to an synthetic Exception.
 * @param event The event to modify.
 * @param value Value of the exception.
 * @param type Type of the exception.
 * @hidden
 */
export declare function addExceptionTypeValue(event: Event, value?: string, type?: string): void;
/**
 * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.
 *
 * @param event The event to modify.
 * @param newMechanism Mechanism data to add to the event.
 * @hidden
 */
export declare function addExceptionMechanism(event: Event, newMechanism?: Partial<Mechanism>): void;
/**
 * Represents Semantic Versioning object
 */
interface SemVer {
    major?: number;
    minor?: number;
    patch?: number;
    prerelease?: string;
    buildmetadata?: string;
}
/**
 * Parses input into a SemVer interface
 * @param input string representation of a semver version
 */
export declare function parseSemver(input: string): SemVer;
/**
 * This function adds context (pre/post/line) lines to the provided frame
 *
 * @param lines string[] containing all lines
 * @param frame StackFrame that will be mutated
 * @param linesOfContext number of context lines we want to add pre/post
 */
export declare function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext?: number): void;
/**
 * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object
 * in question), and marks it captured if not.
 *
 * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and
 * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so
 * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because
 * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not
 * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This
 * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we
 * see it.
 *
 * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on
 * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent
 * object wrapper forms so that this check will always work. However, because we need to flag the exact object which
 * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification
 * must be done before the exception captured.
 *
 * @param A thrown exception to check or flag as having been seen
 * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)
 */
export declare function checkOrSetAlreadyCaught(exception: unknown): boolean;
/**
 * Checks whether the given input is already an array, and if it isn't, wraps it in one.
 *
 * @param maybeArray Input to turn into an array, if necessary
 * @returns The input, if already an array, or an array with the input as the only element, if not
 */
export declare function arrayify<T = unknown>(maybeArray: T | T[]): T[];
export {};
//# sourceMappingURL=misc.d.ts.map{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/misc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAa,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiB7E;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAiB9B;AAMD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAcxD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAUvF;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAc3F;AAMD;;GAEG;AACH,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYjD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,GAAE,MAAU,GAAG,IAAI,CAkBtG;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,OAAO,GAAG,OAAO,CAenE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,CAE9D"}import type { StackLineParserFn } from '@sentry/types';
export declare type GetModuleFn = (filename: string | undefined) => string | undefined;
/** Node Stack line parser */
export declare function node(getModule?: GetModuleFn): StackLineParserFn;
//# sourceMappingURL=node-stack-trace.d.ts.map{"version":3,"file":"node-stack-trace.d.ts","sourceRoot":"","sources":["../../src/node-stack-trace.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,oBAAY,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAAC;AAE/E,6BAA6B;AAE7B,wBAAgB,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAoF/D"}/**
 * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
 * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
 */
/**
 * Checks whether we're in the Node.js or Browser environment
 *
 * @returns Answer to given question
 */
export declare function isNodeEnv(): boolean;
/**
 * Requires a module which is protected against bundler minification.
 *
 * @param request The module path to resolve
 */
export declare function dynamicRequire(mod: any, request: string): any;
/**
 * Helper for dynamically loading module that should work with linked dependencies.
 * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`
 * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during
 * build time. `require.resolve` is also not available in any other way, so we cannot create,
 * a fake helper like we do with `dynamicRequire`.
 *
 * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.
 * That is to mimic the behavior of `require.resolve` exactly.
 *
 * @param moduleName module name to require
 * @returns possibly required module
 */
export declare function loadModule<T>(moduleName: string): T | undefined;
//# sourceMappingURL=node.d.ts.map{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAOnC;AAED;;;;GAIG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,GAAG,CAG7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAiB/D"}import type { Primitive } from '@sentry/types';
import type { MemoFunc } from './memo';
declare type ObjOrArray<T> = {
    [key: string]: T;
};
/**
 * Recursively normalizes the given object.
 *
 * - Creates a copy to prevent original input mutation
 * - Skips non-enumerable properties
 * - When stringifying, calls `toJSON` if implemented
 * - Removes circular references
 * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format
 * - Translates known global objects/classes to a string representations
 * - Takes care of `Error` object serialization
 * - Optionally limits depth of final output
 * - Optionally limits number of properties/elements included in any single object/array
 *
 * @param input The object to be normalized.
 * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)
 * @param maxProperties The max number of elements or properties to be included in any single array or
 * object in the normallized output.
 * @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
 */
export declare function normalize(input: unknown, depth?: number, maxProperties?: number): any;
/** JSDoc */
export declare function normalizeToSize<T>(object: {
    [key: string]: any;
}, depth?: number, maxSize?: number): T;
/**
 * Visits a node to perform normalization on it
 *
 * @param key The key corresponding to the given node
 * @param value The node to be visited
 * @param depth Optional number indicating the maximum recursion depth
 * @param maxProperties Optional maximum number of properties/elements included in any single object/array
 * @param memo Optional Memo class handling decycling
 */
declare function visit(key: string, value: unknown, depth?: number, maxProperties?: number, memo?: MemoFunc): Primitive | ObjOrArray<unknown>;
export { visit as walk };
//# sourceMappingURL=normalize.d.ts.map{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAUvC,aAAK,UAAU,CAAC,CAAC,IAAI;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;CAAE,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,GAAE,MAAkB,EAAE,aAAa,GAAE,MAAkB,GAAG,GAAG,CAO3G;AAED,YAAY;AACZ,wBAAgB,eAAe,CAAC,CAAC,EAE/B,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAE9B,KAAK,GAAE,MAAU,EAEjB,OAAO,GAAE,MAAmB,GAC3B,CAAC,CAQH;AAED;;;;;;;;GAQG;AACH,iBAAS,KAAK,CACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,KAAK,GAAE,MAAkB,EACzB,aAAa,GAAE,MAAkB,EACjC,IAAI,GAAE,QAAwB,GAC7B,SAAS,GAAG,UAAU,CAAC,OAAO,CAAC,CA0FjC;AAGD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC"}import type { WrappedFunction } from '@sentry/types';
/**
 * Replace a method in an object with a wrapped version of itself.
 *
 * @param source An object that contains a method to be wrapped.
 * @param name The name of the method to be wrapped.
 * @param replacementFactory A higher-order function that takes the original version of the given method and returns a
 * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to
 * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, <other
 * args>)` or `origMethod.apply(this, [<other args>])` (rather than being called directly), again to preserve `this`.
 * @returns void
 */
export declare function fill(source: {
    [key: string]: any;
}, name: string, replacementFactory: (...args: any[]) => any): void;
/**
 * Defines a non-enumerable property on the given object.
 *
 * @param obj The object on which to set the property
 * @param name The name of the property to be set
 * @param value The value to which to set the property
 */
export declare function addNonEnumerableProperty(obj: {
    [key: string]: unknown;
}, name: string, value: unknown): void;
/**
 * Remembers the original function on the wrapped function and
 * patches up the prototype.
 *
 * @param wrapped the wrapper function
 * @param original the original function that gets wrapped
 */
export declare function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void;
/**
 * This extracts the original function if available.  See
 * `markFunctionWrapped` for more information.
 *
 * @param func the function to unwrap
 * @returns the unwrapped version of the function if available.
 */
export declare function getOriginalFunction(func: WrappedFunction): WrappedFunction | undefined;
/**
 * Encodes given object into url-friendly format
 *
 * @param object An object that contains serializable values
 * @returns string Encoded
 */
export declare function urlEncode(object: {
    [key: string]: any;
}): string;
/**
 * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their
 * non-enumerable properties attached.
 *
 * @param value Initial source that we have to transform in order for it to be usable by the serializer
 * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor
 *  an Error.
 */
export declare function convertToPlainObject<V>(value: V): {
    [ownProps: string]: unknown;
    type: string;
    target: string;
    currentTarget: string;
    detail?: unknown;
} | {
    [ownProps: string]: unknown;
    message: string;
    name: string;
    stack?: string;
} | V;
/**
 * Given any captured exception, extract its keys and create a sorted
 * and truncated list that will be used inside the event message.
 * eg. `Non-error exception captured with keys: foo, bar, baz`
 */
export declare function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength?: number): string;
/**
 * Given any object, return a new object having removed all fields whose value was `undefined`.
 * Works recursively on objects and arrays.
 *
 * Attention: This function keeps circular references in the returned object.
 */
export declare function dropUndefinedKeys<T>(inputValue: T): T;
/**
 * Ensure that something is an object.
 *
 * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper
 * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.
 *
 * @param wat The subject of the objectification
 * @returns A version of `wat` which can safely be used with `Object` class methods
 */
export declare function objectify(wat: unknown): typeof Object;
//# sourceMappingURL=object.d.ts.map{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/object.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMrD;;;;;;;;;;GAUG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,CAoBpH;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAO5G;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAI7F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,GAAG,SAAS,CAEtF;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,MAAM,CAIhE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAC5C;IACE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GACD;IACE,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD,CAAC,CA8BJ;AA0BD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CAwBjH;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAQrD;AA4CD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,MAAM,CA0BrD"}/** JSDoc */
export declare function resolve(...args: string[]): string;
/** JSDoc */
export declare function relative(from: string, to: string): string;
/** JSDoc */
export declare function normalizePath(path: string): string;
/** JSDoc */
export declare function isAbsolute(path: string): boolean;
/** JSDoc */
export declare function join(...args: string[]): string;
/** JSDoc */
export declare function dirname(path: string): string;
/** JSDoc */
export declare function basename(path: string, ext?: string): string;
//# sourceMappingURL=path.d.ts.map{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/path.ts"],"names":[],"mappings":"AA8DA,YAAY;AACZ,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CA0BjD;AA0BD,YAAY;AACZ,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CA0BzD;AAID,YAAY;AACZ,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBlD;AAGD,YAAY;AACZ,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAGD,YAAY;AACZ,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9C;AAED,YAAY;AACZ,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgB5C;AAED,YAAY;AACZ,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3D"}export interface PromiseBuffer<T> {
    $: Array<PromiseLike<T>>;
    add(taskProducer: () => PromiseLike<T>): PromiseLike<T>;
    drain(timeout?: number): PromiseLike<boolean>;
}
/**
 * Creates an new PromiseBuffer object with the specified limit
 * @param limit max number of promises that can be stored in the buffer
 */
export declare function makePromiseBuffer<T>(limit?: number): PromiseBuffer<T>;
//# sourceMappingURL=promisebuffer.d.ts.map{"version":3,"file":"promisebuffer.d.ts","sourceRoot":"","sources":["../../src/promisebuffer.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa,CAAC,CAAC;IAG9B,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzB,GAAG,CAAC,YAAY,EAAE,MAAM,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACxD,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,CA2FrE"}import type { TransportMakeRequestResponse } from '@sentry/types';
export declare type RateLimits = Record<string, number>;
export declare const DEFAULT_RETRY_AFTER: number;
/**
 * Extracts Retry-After value from the request header or returns default value
 * @param header string representation of 'Retry-After' header
 * @param now current unix timestamp
 *
 */
export declare function parseRetryAfterHeader(header: string, now?: number): number;
/**
 * Gets the time that the given category is disabled until for rate limiting.
 * In case no category-specific limit is set but a general rate limit across all categories is active,
 * that time is returned.
 *
 * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.
 */
export declare function disabledUntil(limits: RateLimits, category: string): number;
/**
 * Checks if a category is rate limited
 */
export declare function isRateLimited(limits: RateLimits, category: string, now?: number): boolean;
/**
 * Update ratelimits from incoming headers.
 *
 * @return the updated RateLimits object.
 */
export declare function updateRateLimits(limits: RateLimits, { statusCode, headers }: TransportMakeRequestResponse, now?: number): RateLimits;
//# sourceMappingURL=ratelimit.d.ts.map{"version":3,"file":"ratelimit.d.ts","sourceRoot":"","sources":["../../src/ratelimit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAGlE,oBAAY,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhD,eAAO,MAAM,mBAAmB,QAAY,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,CAYtF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,OAAO,CAErG;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAClB,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,4BAA4B,EACrD,GAAG,GAAE,MAAmB,GACvB,UAAU,CA0CZ"}/**
 * The functions here, which enrich an event with request data, are mostly for use in Node, but are safe for use in a
 * browser context. They live here in `@sentry/utils` rather than in `@sentry/node` so that they can be used in
 * frameworks (like nextjs), which, because of SSR, run the same code in both Node and browser contexts.
 *
 * TODO (v8 / #5257): Remove the note below
 * Note that for now, the tests for this code have to live in `@sentry/node`, since they test both these functions and
 * the backwards-compatibility-preserving wrappers which still live in `handlers.ts` there.
 */
import type { Event, ExtractedNodeRequestData, PolymorphicRequest, Transaction, TransactionSource } from '@sentry/types';
declare type InjectedNodeDeps = {
    cookie: {
        parse: (cookieStr: string) => Record<string, string>;
    };
    url: {
        parse: (urlStr: string) => {
            query: string | null;
        };
    };
};
/**
 * Sets parameterized route as transaction name e.g.: `GET /users/:id`
 * Also adds more context data on the transaction from the request
 */
export declare function addRequestDataToTransaction(transaction: Transaction | undefined, req: PolymorphicRequest, deps?: InjectedNodeDeps): void;
/**
 * Extracts a complete and parameterized path from the request object and uses it to construct transaction name.
 * If the parameterized transaction name cannot be extracted, we fall back to the raw URL.
 *
 * Additionally, this function determines and returns the transaction name source
 *
 * eg. GET /mountpoint/user/:id
 *
 * @param req A request object
 * @param options What to include in the transaction name (method, path, or a custom route name to be
 *                used instead of the request's route)
 *
 * @returns A tuple of the fully constructed transaction name [0] and its source [1] (can be either 'route' or 'url')
 */
export declare function extractPathForTransaction(req: PolymorphicRequest, options?: {
    path?: boolean;
    method?: boolean;
    customRoute?: string;
}): [string, TransactionSource];
declare type TransactionNamingScheme = 'path' | 'methodPath' | 'handler';
/**
 * Normalize data from the request object, accounting for framework differences.
 *
 * @param req The request object from which to extract data
 * @param options.include An optional array of keys to include in the normalized data. Defaults to
 * DEFAULT_REQUEST_INCLUDES if not provided.
 * @param options.deps Injected, platform-specific dependencies
 * @returns An object containing normalized request data
 */
export declare function extractRequestData(req: PolymorphicRequest, options?: {
    include?: string[];
    deps?: InjectedNodeDeps;
}): ExtractedNodeRequestData;
/**
 * Options deciding what parts of the request to use when enhancing an event
 */
export interface AddRequestDataToEventOptions {
    /** Flags controlling whether each type of data should be added to the event */
    include?: {
        ip?: boolean;
        request?: boolean | string[];
        transaction?: boolean | TransactionNamingScheme;
        user?: boolean | string[];
    };
    /** Injected platform-specific dependencies */
    deps?: {
        cookie: {
            parse: (cookieStr: string) => Record<string, string>;
        };
        url: {
            parse: (urlStr: string) => {
                query: string | null;
            };
        };
    };
}
/**
 * Add data from the given request to the given event
 *
 * @param event The event to which the request data will be added
 * @param req Request object
 * @param options.include Flags to control what data is included
 * @param options.deps Injected platform-specific dependencies
 * @hidden
 */
export declare function addRequestDataToEvent(event: Event, req: PolymorphicRequest, options?: AddRequestDataToEventOptions): Event;
export {};
//# sourceMappingURL=requestdata.d.ts.map{"version":3,"file":"requestdata.d.ts","sourceRoot":"","sources":["../../src/requestdata.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EACV,KAAK,EACL,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAevB,aAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACtD,CAAC;IACF,GAAG,EAAE;QACH,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK;YACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;SACtB,CAAC;KACH,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,G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,KAAK,EACZ,GAAG,EAAE,kBAAkB,EACvB,OAAO,CAAC,EAAE,4BAA4B,GACrC,KAAK,CAgDP"}import type { Severity, SeverityLevel } from '@sentry/types';
export declare const validSeverityLevels: string[];
/**
 * Converts a string-based level into a member of the deprecated {@link Severity} enum.
 *
 * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.
 *
 * @param level String representation of Severity
 * @returns Severity
 */
export declare function severityFromString(level: Severity | SeverityLevel | string): Severity;
/**
 * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.
 *
 * @param level String representation of desired `SeverityLevel`.
 * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
 */
export declare function severityLevelFromString(level: SeverityLevel | string): SeverityLevel;
//# sourceMappingURL=severity.d.ts.map{"version":3,"file":"severity.d.ts","sourceRoot":"","sources":["../../src/severity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAY7D,eAAO,MAAM,mBAAmB,UAAwD,CAAC;AAEzF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ,GAAG,aAAa,GAAG,MAAM,GAAG,QAAQ,CAErF;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,aAAa,CAEpF"}import type { StackFrame, StackLineParser, StackParser } from '@sentry/types';
import type { GetModuleFn } from './node-stack-trace';
/**
 * Creates a stack parser with the supplied line parsers
 *
 * StackFrames are returned in the correct order for Sentry Exception
 * frames and with Sentry SDK internal frames removed from the top and bottom
 *
 */
export declare function createStackParser(...parsers: StackLineParser[]): StackParser;
/**
 * Gets a stack parser implementation from Options.stackParser
 * @see Options
 *
 * If options contains an array of line parsers, it is converted into a parser
 */
export declare function stackParserFromStackParserOptions(stackParser: StackParser | StackLineParser[]): StackParser;
/**
 * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.
 * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the
 * function that caused the crash is the last frame in the array.
 * @hidden
 */
export declare function stripSentryFramesAndReverse(stack: ReadonlyArray<StackFrame>): StackFrame[];
/**
 * Safely extract function name from itself
 */
export declare function getFunctionName(fn: unknown): string;
/**
 * Node.js stack line parser
 *
 * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.
 * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain
 */
export declare function nodeStackLineParser(getModule?: GetModuleFn): StackLineParser;
//# sourceMappingURL=stacktrace.d.ts.map{"version":3,"file":"stacktrace.d.ts","sourceRoot":"","sources":["../../src/stacktrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOtD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,WAAW,CA2C5E;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe,EAAE,GAAG,WAAW,CAK3G;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CA2B1F;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAWnD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,WAAW,GAAG,eAAe,CAE5E"}export { escapeStringForRegex } from './vendor/escapeStringForRegex';
/**
 * Truncates given string to the maximum characters count
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string (0 = unlimited)
 * @returns string Encoded
 */
export declare function truncate(str: string, max?: number): string;
/**
 * This is basically just `trim_line` from
 * https://github.com/getsentry/sentry/blob/master/src/sentry/lang/javascript/processor.py#L67
 *
 * @param str An object that contains serializable values
 * @param max Maximum number of characters in truncated string
 * @returns string Encoded
 */
export declare function snipLine(line: string, colno: number): string;
/**
 * Join values in array
 * @param input array of values to be joined together
 * @param delimiter string to be placed in-between values
 * @returns Joined values
 */
export declare function safeJoin(input: any[], delimiter?: string): string;
/**
 * Checks if the given value matches a regex or string
 *
 * @param value The string to test
 * @param pattern Either a regex or a string against which `value` will be matched
 * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match
 * `pattern` if it contains `pattern`. Only applies to string-type patterns.
 */
export declare function isMatchingPattern(value: string, pattern: RegExp | string, requireExactStringMatch?: boolean): boolean;
/**
 * Test the given string against an array of strings and regexes. By default, string matching is done on a
 * substring-inclusion basis rather than a strict equality basis
 *
 * @param testString The string to test
 * @param patterns The patterns against which to test the string
 * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to
 * count. If false, `testString` will match a string pattern if it contains that pattern.
 * @returns
 */
export declare function stringMatchesSomePattern(testString: string, patterns?: Array<string | RegExp>, requireExactStringMatch?: boolean): boolean;
//# sourceMappingURL=string.d.ts.map{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU,GAAG,MAAM,CAK7D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiC5D;AAED;;;;;GAKG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAiBjE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,uBAAuB,GAAE,OAAe,GACvC,OAAO,CAaT;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAM,EACrC,uBAAuB,GAAE,OAAe,GACvC,OAAO,CAET"}export { supportsHistory } from './vendor/supportsHistory';
/**
 * Tells whether current environment supports ErrorEvent objects
 * {@link supportsErrorEvent}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsErrorEvent(): boolean;
/**
 * Tells whether current environment supports DOMError objects
 * {@link supportsDOMError}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsDOMError(): boolean;
/**
 * Tells whether current environment supports DOMException objects
 * {@link supportsDOMException}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsDOMException(): boolean;
/**
 * Tells whether current environment supports Fetch API
 * {@link supportsFetch}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsFetch(): boolean;
/**
 * isNativeFetch checks if the given function is a native implementation of fetch()
 */
export declare function isNativeFetch(func: Function): boolean;
/**
 * Tells whether current environment supports Fetch API natively
 * {@link supportsNativeFetch}.
 *
 * @returns true if `window.fetch` is natively implemented, false otherwise
 */
export declare function supportsNativeFetch(): boolean;
/**
 * Tells whether current environment supports ReportingObserver API
 * {@link supportsReportingObserver}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsReportingObserver(): boolean;
/**
 * Tells whether current environment supports Referrer Policy API
 * {@link supportsReferrerPolicy}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsReferrerPolicy(): boolean;
//# sourceMappingURL=supports.d.ts.map{"version":3,"file":"supports.d.ts","sourceRoot":"","sources":["../../src/supports.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAO5C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAU1C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAO9C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAavC;AACD;;GAEG;AAEH,wBAAgB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAiC7C;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,OAAO,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAkBhD"}export declare function resolvedSyncPromise(): PromiseLike<void>;
export declare function resolvedSyncPromise<T>(value: T | PromiseLike<T>): PromiseLike<T>;
/**
 * Creates a rejected sync promise.
 *
 * @param value the value to reject the promise with
 * @returns the rejected sync promise
 */
export declare function rejectedSyncPromise<T = never>(reason?: any): PromiseLike<T>;
/**
 * Thenable class that behaves like a Promise and follows it's interface
 * but is not async internally
 */
declare class SyncPromise<T> implements PromiseLike<T> {
    private _state;
    private _handlers;
    private _value;
    constructor(executor: (resolve: (value?: T | PromiseLike<T> | null) => void, reject: (reason?: any) => void) => void);
    /** JSDoc */
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
    /** JSDoc */
    catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): PromiseLike<T | TResult>;
    /** JSDoc */
    finally<TResult>(onfinally?: (() => void) | null): PromiseLike<TResult>;
    /** JSDoc */
    private readonly _resolve;
    /** JSDoc */
    private readonly _reject;
    /** JSDoc */
    private readonly _setResult;
    /** JSDoc */
    private readonly _executeHandlers;
}
export { SyncPromise };
//# sourceMappingURL=syncpromise.d.ts.map{"version":3,"file":"syncpromise.d.ts","sourceRoot":"","sources":["../../src/syncprom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,CAAC,CAAC,GAAG,OAAO,CAAC;IAI3B,YAAY;IACL,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC;IA+B9E,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAEvB;IAEF,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,OAAO,CAEtB;IAEF,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,UAAU,CAczB;IAEF,YAAY;IACZ,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAwB/B;CACH;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}/**
 * Returns a timestamp in seconds since the UNIX epoch using the Date API.
 */
export declare const dateTimestampInSeconds: () => number;
/**
 * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the
 * availability of the Performance API.
 *
 * See `usingPerformanceAPI` to test whether the Performance API is used.
 *
 * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is
 * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The
 * skew can grow to arbitrary amounts like days, weeks or months.
 * See https://github.com/getsentry/sentry-javascript/issues/2590.
 */
export declare const timestampInSeconds: () => number;
export declare const timestampWithMs: () => number;
/**
 * A boolean that is true when timestampInSeconds uses the Performance API to produce monotonic timestamps.
 */
export declare const usingPerformanceAPI: boolean;
/**
 * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.
 */
export declare let _browserPerformanceTimeOriginMode: string;
/**
 * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
 * performance API is available.
 */
export declare const browserPerformanceTimeOrigin: number | undefined;
//# sourceMappingURL=time.d.ts.map{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/time.ts"],"names":[],"mappings":"AAyGA;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,MAAiE,CAAC;AAE7G;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,MAAyD,CAAC;AAGjG,eAAO,MAAM,eAAe,cAAqB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,mBAAmB,SAAoC,CAAC;AAErE;;GAEG;AACH,eAAO,IAAI,iCAAiC,EAAE,MAAM,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,oBA+CrC,CAAC"}import type { TraceparentData } from '@sentry/types';
export declare const TRACEPARENT_REGEXP: RegExp;
/**
 * Extract transaction context data from a `sentry-trace` header.
 *
 * @param traceparent Traceparent string
 *
 * @returns Object containing data from the header, or undefined if traceparent string is malformed
 */
export declare function extractTraceparentData(traceparent: string): TraceparentData | undefined;
//# sourceMappingURL=tracing.d.ts.map{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,eAAO,MAAM,kBAAkB,QAM9B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAoBvF"}declare type PartialURL = {
    host?: string;
    path?: string;
    protocol?: string;
    relative?: string;
    search?: string;
    hash?: string;
};
/**
 * Parses string form of URL into an object
 * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B
 * // intentionally using regex and not <a/> href parsing trick because React Native and other
 * // environments where DOM might not be available
 * @returns parsed URL object
 */
export declare function parseUrl(url: string): PartialURL;
/**
 * Strip the query string and fragment off of a given URL or path (if present)
 *
 * @param urlPath Full URL or path, including possible query string and/or fragment
 * @returns URL or path without query string or fragment
 */
export declare function stripUrlQueryAndFragment(urlPath: string): string;
/**
 * Returns number of URL segments of a passed string URL.
 */
export declare function getNumberOfUrlSegments(url: string): number;
/**
 * Takes a URL object and returns a sanitized string which is safe to use as span description
 * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data
 */
export declare function getSanitizedUrlString(url: PartialURL): string;
export {};
//# sourceMappingURL=url.d.ts.map{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/url.ts"],"names":[],"mappings":"AAAA,aAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAsBhD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,CAc7D"}import type { Integration } from '@sentry/types';
export declare type UserIntegrationsFunction = (integrations: Integration[]) => Integration[];
export declare type UserIntegrations = Integration[] | UserIntegrationsFunction;
export declare type IntegrationWithExclusionOption = Integration & {
    /**
     * Allow the user to exclude this integration by not returning it from a function provided as the `integrations` option
     * in `Sentry.init()`. Meant to be used with default integrations, the idea being that if a user has actively filtered
     * an integration out, we should be able to respect that choice if we wish.
     */
    allowExclusionByUser?: boolean;
};
declare type ForcedIntegrationOptions = {
    [keyPath: string]: unknown;
};
/**
 * Enforces inclusion of a given integration with specified options in an integration array originally determined by the
 * user, by either including the given default instance or by patching an existing user instance with the given options.
 *
 * Ideally this would happen when integrations are set up, but there isn't currently a mechanism there for merging
 * options from a default integration instance with those from a user-provided instance of the same integration, only
 * for allowing the user to override a default instance entirely. (TODO: Fix that.)
 *
 * @param defaultIntegrationInstance An instance of the integration with the correct options already set
 * @param userIntegrations Integrations defined by the user.
 * @param forcedOptions Options with which to patch an existing user-derived instance on the integration.
 * @returns A final integrations array.
 */
export declare function addOrUpdateIntegration<T extends UserIntegrations>(defaultIntegrationInstance: Integration, userIntegrations: T, forcedOptions?: ForcedIntegrationOptions): T;
export {};
//# sourceMappingURL=userIntegrations.d.ts.map{"version":3,"file":"userIntegrations.d.ts","sourceRoot":"","sources":["../../src/userIntegrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,wBAAwB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,CAAC;AACtF,oBAAY,gBAAgB,GAAG,WAAW,EAAE,GAAG,wBAAwB,CAAC;AACxE,oBAAY,8BAA8B,GAAG,WAAW,GAAG;IACzD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,aAAK,wBAAwB,GAAG;IAC9B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B,CAAC;AAyBF;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,gBAAgB,EAC/D,0BAA0B,EAAE,WAAW,EACvC,gBAAgB,EAAE,CAAC,EACnB,aAAa,GAAE,wBAA6B,GAC3C,CAAC,CAWH"}/**
 * Given a string, escape characters which have meaning in the regex grammar, such that the result is safe to feed to
 * `new RegExp()`.
 *
 * @param regexString The string to escape
 * @returns An version of the string with all special regex characters escaped
 */
export declare function escapeStringForRegex(regexString: string): string;
//# sourceMappingURL=escapeStringForRegex.d.ts.map{"version":3,"file":"escapeStringForRegex.d.ts","sourceRoot":"","sources":["../../../src/vendor/escapeStringForRegex.ts"],"names":[],"mappings":"AAsBA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIhE"}/**
 * Tells whether current environment supports History API
 * {@link supportsHistory}.
 *
 * @returns Answer to the given question.
 */
export declare function supportsHistory(): boolean;
//# sourceMappingURL=supportsHistory.d.ts.map{"version":3,"file":"supportsHistory.d.ts","sourceRoot":"","sources":["../../../src/vendor/supportsHistory.ts"],"names":[],"mappings":"AA4BA;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAYzC"}/**
 * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,
 * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.
 *
 * Note: This file was originally called `global.ts`, but was changed to unblock users which might be doing
 * string replaces with bundlers like Vite for `global` (would break imports that rely on importing from utils/src/global).
 *
 * Why worldwide?
 *
 * Why not?
 */
import type { Integration } from '@sentry/types';
import type { SdkSource } from './env';
/** Internal global with common properties and Sentry extensions  */
export interface InternalGlobal {
    navigator?: {
        userAgent?: string;
    };
    console: Console;
    Sentry?: {
        Integrations?: Integration[];
    };
    onerror?: {
        (msg: unknown, url: unknown, line: unknown, column: unknown, error: unknown): boolean;
        __SENTRY_INSTRUMENTED__?: true;
        __SENTRY_LOADER__?: true;
    };
    onunhandledrejection?: {
        (event: unknown): boolean;
        __SENTRY_INSTRUMENTED__?: true;
        __SENTRY_LOADER__?: true;
    };
    SENTRY_ENVIRONMENT?: string;
    SENTRY_DSN?: string;
    SENTRY_RELEASE?: {
        id?: string;
    };
    SENTRY_SDK_SOURCE?: SdkSource;
    /**
     * Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map
     * for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS
     * file.
     */
    _sentryDebugIds?: Record<string, string>;
    __SENTRY__: {
        globalEventProcessors: any;
        hub: any;
        logger: any;
        extensions?: {
            /** Extension methods for the hub, which are bound to the current Hub instance */
            [key: string]: Function;
        };
    };
}
/** Get's the global object for the current JavaScript runtime */
export declare const GLOBAL_OBJ: InternalGlobal;
/**
 * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8
 */
export declare function getGlobalObject<T>(): T & InternalGlobal;
/**
 * Returns a global singleton contained in the global `__SENTRY__` object.
 *
 * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
 * function and added to the `__SENTRY__` object.
 *
 * @param name name of the global singleton on __SENTRY__
 * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
 * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value
 * @returns the singleton
 */
export declare function getGlobalSingleton<T>(name: keyof InternalGlobal['__SENTRY__'], creator: () => T, obj?: unknown): T;
//# sourceMappingURL=worldwide.d.ts.map{"version":3,"file":"worldwide.d.ts","sourceRoot":"","sources":["../../src/worldwide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE;QACP,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;KAC9B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;QACtF,uBAAuB,CAAC,EAAE,IAAI,CAAC;QAC/B,iBAAiB,CAAC,EAAE,IAAI,CAAC;KAC1B,CAAC;IACF,oBAAoB,CAAC,EAAE;QACrB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;QAC1B,uBAAuB,CAAC,EAAE,IAAI,CAAC;QAC/B,iBAAiB,CAAC,EAAE,IAAI,CAAC;KAC1B,CAAC;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;IACF,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,UAAU,EAAE;QACV,qBAAqB,EAAE,GAAG,CAAC;QAC3B,GAAG,EAAE,GAAG,CAAC;QACT,MAAM,EAAE,GAAG,CAAC;QACZ,UAAU,CAAC,EAAE;YACX,iFAAiF;YAEjF,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC;SACzB,CAAC;KACH,CAAC;CACH;AA+BD,iEAAiE;AACjE,eAAO,MAAM,UAAU,EAAE,cASrB,CAAC;AAEL;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,KAAK,CAAC,GAAG,cAAc,CAEvD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,CAKlH"}/// <reference types="node" />
import net from 'net';
import http from 'http';
import https from 'https';
import { Duplex } from 'stream';
import { EventEmitter } from 'events';
declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent;
declare namespace createAgent {
    interface ClientRequest extends http.ClientRequest {
        _last?: boolean;
        _hadError?: boolean;
        method: string;
    }
    interface AgentRequestOptions {
        host?: string;
        path?: string;
        port: number;
    }
    interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> {
        secureEndpoint: false;
    }
    interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> {
        secureEndpoint: true;
    }
    type RequestOptions = HttpRequestOptions | HttpsRequestOptions;
    type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;
    type AgentCallbackReturn = Duplex | AgentLike;
    type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void;
    type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
    type AgentCallback = typeof Agent.prototype.callback;
    type AgentOptions = {
        timeout?: number;
    };
    /**
     * Base `http.Agent` implementation.
     * No pooling/keep-alive is implemented by default.
     *
     * @param {Function} callback
     * @api public
     */
    class Agent extends EventEmitter {
        timeout: number | null;
        maxFreeSockets: number;
        maxTotalSockets: number;
        maxSockets: number;
        sockets: {
            [key: string]: net.Socket[];
        };
        freeSockets: {
            [key: string]: net.Socket[];
        };
        requests: {
            [key: string]: http.IncomingMessage[];
        };
        options: https.AgentOptions;
        private promisifiedCallback?;
        private explicitDefaultPort?;
        private explicitProtocol?;
        constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions);
        get defaultPort(): number;
        set defaultPort(v: number);
        get protocol(): string;
        set protocol(v: string);
        callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void;
        callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
        /**
         * Called by node-core's "_http_client.js" module when creating
         * a new HTTP request with this Agent instance.
         *
         * @api public
         */
        addRequest(req: ClientRequest, _opts: RequestOptions): void;
        freeSocket(socket: net.Socket, opts: AgentOptions): void;
        destroy(): void;
    }
}
export = createAgent;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const events_1 = require("events");
const debug_1 = __importDefault(require("debug"));
const promisify_1 = __importDefault(require("./promisify"));
const debug = debug_1.default('agent-base');
function isAgent(v) {
    return Boolean(v) && typeof v.addRequest === 'function';
}
function isSecureEndpoint() {
    const { stack } = new Error();
    if (typeof stack !== 'string')
        return false;
    return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
}
function createAgent(callback, opts) {
    return new createAgent.Agent(callback, opts);
}
(function (createAgent) {
    /**
     * Base `http.Agent` implementation.
     * No pooling/keep-alive is implemented by default.
     *
     * @param {Function} callback
     * @api public
     */
    class Agent extends events_1.EventEmitter {
        constructor(callback, _opts) {
            super();
            let opts = _opts;
            if (typeof callback === 'function') {
                this.callback = callback;
            }
            else if (callback) {
                opts = callback;
            }
            // Timeout for the socket to be returned from the callback
            this.timeout = null;
            if (opts && typeof opts.timeout === 'number') {
                this.timeout = opts.timeout;
            }
            // These aren't actually used by `agent-base`, but are required
            // for the TypeScript definition files in `@types/node` :/
            this.maxFreeSockets = 1;
            this.maxSockets = 1;
            this.maxTotalSockets = Infinity;
            this.sockets = {};
            this.freeSockets = {};
            this.requests = {};
            this.options = {};
        }
        get defaultPort() {
            if (typeof this.explicitDefaultPort === 'number') {
                return this.explicitDefaultPort;
            }
            return isSecureEndpoint() ? 443 : 80;
        }
        set defaultPort(v) {
            this.explicitDefaultPort = v;
        }
        get protocol() {
            if (typeof this.explicitProtocol === 'string') {
                return this.explicitProtocol;
            }
            return isSecureEndpoint() ? 'https:' : 'http:';
        }
        set protocol(v) {
            this.explicitProtocol = v;
        }
        callback(req, opts, fn) {
            throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
        }
        /**
         * Called by node-core's "_http_client.js" module when creating
         * a new HTTP request with this Agent instance.
         *
         * @api public
         */
        addRequest(req, _opts) {
            const opts = Object.assign({}, _opts);
            if (typeof opts.secureEndpoint !== 'boolean') {
                opts.secureEndpoint = isSecureEndpoint();
            }
            if (opts.host == null) {
                opts.host = 'localhost';
            }
            if (opts.port == null) {
                opts.port = opts.secureEndpoint ? 443 : 80;
            }
            if (opts.protocol == null) {
                opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
            }
            if (opts.host && opts.path) {
                // If both a `host` and `path` are specified then it's most
                // likely the result of a `url.parse()` call... we need to
                // remove the `path` portion so that `net.connect()` doesn't
                // attempt to open that as a unix socket file.
                delete opts.path;
            }
            delete opts.agent;
            delete opts.hostname;
            delete opts._defaultAgent;
            delete opts.defaultPort;
            delete opts.createConnection;
            // Hint to use "Connection: close"
            // XXX: non-documented `http` module API :(
            req._last = true;
            req.shouldKeepAlive = false;
            let timedOut = false;
            let timeoutId = null;
            const timeoutMs = opts.timeout || this.timeout;
            const onerror = (err) => {
                if (req._hadError)
                    return;
                req.emit('error', err);
                // For Safety. Some additional errors might fire later on
                // and we need to make sure we don't double-fire the error event.
                req._hadError = true;
            };
            const ontimeout = () => {
                timeoutId = null;
                timedOut = true;
                const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
                err.code = 'ETIMEOUT';
                onerror(err);
            };
            const callbackError = (err) => {
                if (timedOut)
                    return;
                if (timeoutId !== null) {
                    clearTimeout(timeoutId);
                    timeoutId = null;
                }
                onerror(err);
            };
            const onsocket = (socket) => {
                if (timedOut)
                    return;
                if (timeoutId != null) {
                    clearTimeout(timeoutId);
                    timeoutId = null;
                }
                if (isAgent(socket)) {
                    // `socket` is actually an `http.Agent` instance, so
                    // relinquish responsibility for this `req` to the Agent
                    // from here on
                    debug('Callback returned another Agent instance %o', socket.constructor.name);
                    socket.addRequest(req, opts);
                    return;
                }
                if (socket) {
                    socket.once('free', () => {
                        this.freeSocket(socket, opts);
                    });
                    req.onSocket(socket);
                    return;
                }
                const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
                onerror(err);
            };
            if (typeof this.callback !== 'function') {
                onerror(new Error('`callback` is not defined'));
                return;
            }
            if (!this.promisifiedCallback) {
                if (this.callback.length >= 3) {
                    debug('Converting legacy callback function to promise');
                    this.promisifiedCallback = promisify_1.default(this.callback);
                }
                else {
                    this.promisifiedCallback = this.callback;
                }
            }
            if (typeof timeoutMs === 'number' && timeoutMs > 0) {
                timeoutId = setTimeout(ontimeout, timeoutMs);
            }
            if ('port' in opts && typeof opts.port !== 'number') {
                opts.port = Number(opts.port);
            }
            try {
                debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
                Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
            }
            catch (err) {
                Promise.reject(err).catch(callbackError);
            }
        }
        freeSocket(socket, opts) {
            debug('Freeing socket %o %o', socket.constructor.name, opts);
            socket.destroy();
        }
        destroy() {
            debug('Destroying agent %o', this.constructor.name);
        }
    }
    createAgent.Agent = Agent;
    // So that `instanceof` works correctly
    createAgent.prototype = createAgent.Agent.prototype;
})(createAgent || (createAgent = {}));
module.exports = createAgent;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAOD,SAAS,WAAW,CACnB,QAA+D,EAC/D,IAA+B;IAE/B,OAAO,IAAI,WAAW,C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BACzC;aACD;YAED,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,CAAC,EAAE;gBACnD,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAED,IAAI;gBACH,KAAK,CACJ,qCAAqC,EACrC,IAAI,CAAC,QAAQ,EACb,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAC3B,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CACxD,QAAQ,EACR,aAAa,CACb,CAAC;aACF;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACzC;QACF,CAAC;QAED,UAAU,CAAC,MAAkB,EAAE,IAAkB;YAChD,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAxPY,iBAAK,QAwPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAtTS,WAAW,KAAX,WAAW,QAsTpB;AAED,iBAAS,WAAW,CAAC"}import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index';
declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void;
export default function promisify(fn: LegacyCallback): AgentCallbackPromise;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function promisify(fn) {
    return function (req, opts) {
        return new Promise((resolve, reject) => {
            fn.call(this, req, opts, (err, rtn) => {
                if (err) {
                    reject(err);
                }
                else {
                    resolve(rtn);
                }
            });
        });
    };
}
exports.default = promisify;
//# sourceMappingURL=promisify.js.map{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"}{
  "name": "agent-base",
  "version": "6.0.2",
  "description": "Turn a function into an `http.Agent` instance",
  "main": "dist/src/index",
  "typings": "dist/src/index",
  "files": [
    "dist/src",
    "src"
  ],
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "tsc",
    "postbuild": "cpy --parents src test '!**/*.ts' dist",
    "test": "mocha --reporter spec dist/test/*.js",
    "test-lint": "eslint src --ext .js,.ts",
    "prepublishOnly": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/TooTallNate/node-agent-base.git"
  },
  "keywords": [
    "http",
    "agent",
    "base",
    "barebones",
    "https"
  ],
  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/TooTallNate/node-agent-base/issues"
  },
  "dependencies": {
    "debug": "4"
  },
  "devDependencies": {
    "@types/debug": "4",
    "@types/mocha": "^5.2.7",
    "@types/node": "^14.0.20",
    "@types/semver": "^7.1.0",
    "@types/ws": "^6.0.3",
    "@typescript-eslint/eslint-plugin": "1.6.0",
    "@typescript-eslint/parser": "1.1.0",
    "async-listen": "^1.2.0",
    "cpy-cli": "^2.0.0",
    "eslint": "5.16.0",
    "eslint-config-airbnb": "17.1.0",
    "eslint-config-prettier": "4.1.0",
    "eslint-import-resolver-typescript": "1.1.1",
    "eslint-plugin-import": "2.16.0",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-react": "7.12.4",
    "mocha": "^6.2.0",
    "rimraf": "^3.0.0",
    "semver": "^7.1.2",
    "typescript": "^3.5.3",
    "ws": "^3.0.0"
  },
  "engines": {
    "node": ">= 6.0.0"
  }
}
agent-base
==========
### Turn a function into an [`http.Agent`][http.Agent] instance
[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)

This module provides an `http.Agent` generator. That is, you pass it an async
callback function, and it returns a new `http.Agent` instance that will invoke the
given callback function when sending outbound HTTP requests.

#### Some subclasses:

Here's some more interesting uses of `agent-base`.
Send a pull request to list yours!

 * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
 * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
 * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
 * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS


Installation
------------

Install with `npm`:

``` bash
$ npm install agent-base
```


Example
-------

Here's a minimal example that creates a new `net.Socket` connection to the server
for every HTTP request (i.e. the equivalent of `agent: false` option):

```js
var net = require('net');
var tls = require('tls');
var url = require('url');
var http = require('http');
var agent = require('agent-base');

var endpoint = 'http://nodejs.org/api/';
var parsed = url.parse(endpoint);

// This is the important part!
parsed.agent = agent(function (req, opts) {
  var socket;
  // `secureEndpoint` is true when using the https module
  if (opts.secureEndpoint) {
    socket = tls.connect(opts);
  } else {
    socket = net.connect(opts);
  }
  return socket;
});

// Everything else works just like normal...
http.get(parsed, function (res) {
  console.log('"response" event!', res.headers);
  res.pipe(process.stdout);
});
```

Returning a Promise or using an `async` function is also supported:

```js
agent(async function (req, opts) {
  await sleep(1000);
  // etc…
});
```

Return another `http.Agent` instance to "pass through" the responsibility
for that HTTP request to that agent:

```js
agent(function (req, opts) {
  return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
});
```


API
---

## Agent(Function callback[, Object options]) → [http.Agent][]

Creates a base `http.Agent` that will execute the callback function `callback`
for every HTTP request that it is used as the `agent` for. The callback function
is responsible for creating a `stream.Duplex` instance of some kind that will be
used as the underlying socket in the HTTP request.

The `options` object accepts the following properties:

  * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).

The callback function should have the following signature:

### callback(http.ClientRequest req, Object options, Function cb) → undefined

The ClientRequest `req` can be accessed to read request headers and
and the path, etc. The `options` object contains the options passed
to the `http.request()`/`https.request()` function call, and is formatted
to be directly passed to `net.connect()`/`tls.connect()`, or however
else you want a Socket to be created. Pass the created socket to
the callback function `cb` once created, and the HTTP request will
continue to proceed.

If the `https` module is used to invoke the HTTP request, then the
`secureEndpoint` property on `options` _will be set to `true`_.


License
-------

(The MIT License)

Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
import net from 'net';
import http from 'http';
import https from 'https';
import { Duplex } from 'stream';
import { EventEmitter } from 'events';
import createDebug from 'debug';
import promisify from './promisify';

const debug = createDebug('agent-base');

function isAgent(v: any): v is createAgent.AgentLike {
	return Boolean(v) && typeof v.addRequest === 'function';
}

function isSecureEndpoint(): boolean {
	const { stack } = new Error();
	if (typeof stack !== 'string') return false;
	return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1  || l.indexOf('node:https:') !== -1);
}

function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
function createAgent(
	callback: createAgent.AgentCallback,
	opts?: createAgent.AgentOptions
): createAgent.Agent;
function createAgent(
	callback?: createAgent.AgentCallback | createAgent.AgentOptions,
	opts?: createAgent.AgentOptions
) {
	return new createAgent.Agent(callback, opts);
}

namespace createAgent {
	export interface ClientRequest extends http.ClientRequest {
		_last?: boolean;
		_hadError?: boolean;
		method: string;
	}

	export interface AgentRequestOptions {
		host?: string;
		path?: string;
		// `port` on `http.RequestOptions` can be a string or undefined,
		// but `net.TcpNetConnectOpts` expects only a number
		port: number;
	}

	export interface HttpRequestOptions
		extends AgentRequestOptions,
			Omit<http.RequestOptions, keyof AgentRequestOptions> {
		secureEndpoint: false;
	}

	export interface HttpsRequestOptions
		extends AgentRequestOptions,
			Omit<https.RequestOptions, keyof AgentRequestOptions> {
		secureEndpoint: true;
	}

	export type RequestOptions = HttpRequestOptions | HttpsRequestOptions;

	export type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;

	export type AgentCallbackReturn = Duplex | AgentLike;

	export type AgentCallbackCallback = (
		err?: Error | null,
		socket?: createAgent.AgentCallbackReturn
	) => void;

	export type AgentCallbackPromise = (
		req: createAgent.ClientRequest,
		opts: createAgent.RequestOptions
	) =>
		| createAgent.AgentCallbackReturn
		| Promise<createAgent.AgentCallbackReturn>;

	export type AgentCallback = typeof Agent.prototype.callback;

	export type AgentOptions = {
		timeout?: number;
	};

	/**
	 * Base `http.Agent` implementation.
	 * No pooling/keep-alive is implemented by default.
	 *
	 * @param {Function} callback
	 * @api public
	 */
	export class Agent extends EventEmitter {
		public timeout: number | null;
		public maxFreeSockets: number;
		public maxTotalSockets: number;
		public maxSockets: number;
		public sockets: {
			[key: string]: net.Socket[];
		};
		public freeSockets: {
			[key: string]: net.Socket[];
		};
		public requests: {
			[key: string]: http.IncomingMessage[];
		};
		public options: https.AgentOptions;
		private promisifiedCallback?: createAgent.AgentCallbackPromise;
		private explicitDefaultPort?: number;
		private explicitProtocol?: string;

		constructor(
			callback?: createAgent.AgentCallback | createAgent.AgentOptions,
			_opts?: createAgent.AgentOptions
		) {
			super();

			let opts = _opts;
			if (typeof callback === 'function') {
				this.callback = callback;
			} else if (callback) {
				opts = callback;
			}

			// Timeout for the socket to be returned from the callback
			this.timeout = null;
			if (opts && typeof opts.timeout === 'number') {
				this.timeout = opts.timeout;
			}

			// These aren't actually used by `agent-base`, but are required
			// for the TypeScript definition files in `@types/node` :/
			this.maxFreeSockets = 1;
			this.maxSockets = 1;
			this.maxTotalSockets = Infinity;
			this.sockets = {};
			this.freeSockets = {};
			this.requests = {};
			this.options = {};
		}

		get defaultPort(): number {
			if (typeof this.explicitDefaultPort === 'number') {
				return this.explicitDefaultPort;
			}
			return isSecureEndpoint() ? 443 : 80;
		}

		set defaultPort(v: number) {
			this.explicitDefaultPort = v;
		}

		get protocol(): string {
			if (typeof this.explicitProtocol === 'string') {
				return this.explicitProtocol;
			}
			return isSecureEndpoint() ? 'https:' : 'http:';
		}

		set protocol(v: string) {
			this.explicitProtocol = v;
		}

		callback(
			req: createAgent.ClientRequest,
			opts: createAgent.RequestOptions,
			fn: createAgent.AgentCallbackCallback
		): void;
		callback(
			req: createAgent.ClientRequest,
			opts: createAgent.RequestOptions
		):
			| createAgent.AgentCallbackReturn
			| Promise<createAgent.AgentCallbackReturn>;
		callback(
			req: createAgent.ClientRequest,
			opts: createAgent.AgentOptions,
			fn?: createAgent.AgentCallbackCallback
		):
			| createAgent.AgentCallbackReturn
			| Promise<createAgent.AgentCallbackReturn>
			| void {
			throw new Error(
				'"agent-base" has no default implementation, you must subclass and override `callback()`'
			);
		}

		/**
		 * Called by node-core's "_http_client.js" module when creating
		 * a new HTTP request with this Agent instance.
		 *
		 * @api public
		 */
		addRequest(req: ClientRequest, _opts: RequestOptions): void {
			const opts: RequestOptions = { ..._opts };

			if (typeof opts.secureEndpoint !== 'boolean') {
				opts.secureEndpoint = isSecureEndpoint();
			}

			if (opts.host == null) {
				opts.host = 'localhost';
			}

			if (opts.port == null) {
				opts.port = opts.secureEndpoint ? 443 : 80;
			}

			if (opts.protocol == null) {
				opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
			}

			if (opts.host && opts.path) {
				// If both a `host` and `path` are specified then it's most
				// likely the result of a `url.parse()` call... we need to
				// remove the `path` portion so that `net.connect()` doesn't
				// attempt to open that as a unix socket file.
				delete opts.path;
			}

			delete opts.agent;
			delete opts.hostname;
			delete opts._defaultAgent;
			delete opts.defaultPort;
			delete opts.createConnection;

			// Hint to use "Connection: close"
			// XXX: non-documented `http` module API :(
			req._last = true;
			req.shouldKeepAlive = false;

			let timedOut = false;
			let timeoutId: ReturnType<typeof setTimeout> | null = null;
			const timeoutMs = opts.timeout || this.timeout;

			const onerror = (err: NodeJS.ErrnoException) => {
				if (req._hadError) return;
				req.emit('error', err);
				// For Safety. Some additional errors might fire later on
				// and we need to make sure we don't double-fire the error event.
				req._hadError = true;
			};

			const ontimeout = () => {
				timeoutId = null;
				timedOut = true;
				const err: NodeJS.ErrnoException = new Error(
					`A "socket" was not created for HTTP request before ${timeoutMs}ms`
				);
				err.code = 'ETIMEOUT';
				onerror(err);
			};

			const callbackError = (err: NodeJS.ErrnoException) => {
				if (timedOut) return;
				if (timeoutId !== null) {
					clearTimeout(timeoutId);
					timeoutId = null;
				}
				onerror(err);
			};

			const onsocket = (socket: AgentCallbackReturn) => {
				if (timedOut) return;
				if (timeoutId != null) {
					clearTimeout(timeoutId);
					timeoutId = null;
				}

				if (isAgent(socket)) {
					// `socket` is actually an `http.Agent` instance, so
					// relinquish responsibility for this `req` to the Agent
					// from here on
					debug(
						'Callback returned another Agent instance %o',
						socket.constructor.name
					);
					(socket as createAgent.Agent).addRequest(req, opts);
					return;
				}

				if (socket) {
					socket.once('free', () => {
						this.freeSocket(socket as net.Socket, opts);
					});
					req.onSocket(socket as net.Socket);
					return;
				}

				const err = new Error(
					`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``
				);
				onerror(err);
			};

			if (typeof this.callback !== 'function') {
				onerror(new Error('`callback` is not defined'));
				return;
			}

			if (!this.promisifiedCallback) {
				if (this.callback.length >= 3) {
					debug('Converting legacy callback function to promise');
					this.promisifiedCallback = promisify(this.callback);
				} else {
					this.promisifiedCallback = this.callback;
				}
			}

			if (typeof timeoutMs === 'number' && timeoutMs > 0) {
				timeoutId = setTimeout(ontimeout, timeoutMs);
			}

			if ('port' in opts && typeof opts.port !== 'number') {
				opts.port = Number(opts.port);
			}

			try {
				debug(
					'Resolving socket for %o request: %o',
					opts.protocol,
					`${req.method} ${req.path}`
				);
				Promise.resolve(this.promisifiedCallback(req, opts)).then(
					onsocket,
					callbackError
				);
			} catch (err) {
				Promise.reject(err).catch(callbackError);
			}
		}

		freeSocket(socket: net.Socket, opts: AgentOptions) {
			debug('Freeing socket %o %o', socket.constructor.name, opts);
			socket.destroy();
		}

		destroy() {
			debug('Destroying agent %o', this.constructor.name);
		}
	}

	// So that `instanceof` works correctly
	createAgent.prototype = createAgent.Agent.prototype;
}

export = createAgent;
import {
	Agent,
	ClientRequest,
	RequestOptions,
	AgentCallbackCallback,
	AgentCallbackPromise,
	AgentCallbackReturn
} from './index';

type LegacyCallback = (
	req: ClientRequest,
	opts: RequestOptions,
	fn: AgentCallbackCallback
) => void;

export default function promisify(fn: LegacyCallback): AgentCallbackPromise {
	return function(this: Agent, req: ClientRequest, opts: RequestOptions) {
		return new Promise((resolve, reject) => {
			fn.call(
				this,
				req,
				opts,
				(err: Error | null | undefined, rtn?: AgentCallbackReturn) => {
					if (err) {
						reject(err);
					} else {
						resolve(rtn);
					}
				}
			);
		});
	};
}
import type { Format } from "ajv";
export declare type FormatMode = "fast" | "full";
export declare type FormatName = "date" | "time" | "date-time" | "duration" | "uri" | "uri-reference" | "uri-template" | "url" | "email" | "hostname" | "ipv4" | "ipv6" | "regex" | "uuid" | "json-pointer" | "json-pointer-uri-fragment" | "relative-json-pointer" | "byte" | "int32" | "int64" | "float" | "double" | "password" | "binary";
export declare type DefinedFormats = {
    [key in FormatName]: Format;
};
export declare const fullFormats: DefinedFormats;
export declare const fastFormats: DefinedFormats;
export declare const formatNames: FormatName[];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
function fmtDef(validate, compare) {
    return { validate, compare };
}
exports.fullFormats = {
    // date: http://tools.ietf.org/html/rfc3339#section-5.6
    date: fmtDef(date, compareDate),
    // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
    time: fmtDef(time, compareTime),
    "date-time": fmtDef(date_time, compareDateTime),
    // duration: https://tools.ietf.org/html/rfc3339#appendix-A
    duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
    uri,
    "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
    // uri-template: https://tools.ietf.org/html/rfc6570
    "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
    // For the source: https://gist.github.com/dperini/729294
    // For test cases: https://mathiasbynens.be/demo/url-regex
    url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
    email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
    hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
    // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
    ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
    ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
    regex,
    // uuid: http://tools.ietf.org/html/rfc4122
    uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
    // JSON-pointer: https://tools.ietf.org/html/rfc6901
    // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
    "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
    "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
    // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
    "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
    // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
    // byte: https://github.com/miguelmota/is-base64
    byte,
    // signed 32 bit integer
    int32: { type: "number", validate: validateInt32 },
    // signed 64 bit integer
    int64: { type: "number", validate: validateInt64 },
    // C-type float
    float: { type: "number", validate: validateNumber },
    // C-type double
    double: { type: "number", validate: validateNumber },
    // hint to the UI to hide input strings
    password: true,
    // unchecked string payload
    binary: true,
};
exports.fastFormats = {
    ...exports.fullFormats,
    date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
    time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareTime),
    "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
    // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
    uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
    "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
    // email (sources from jsen validator):
    // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
    // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
    email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
};
exports.formatNames = Object.keys(exports.fullFormats);
function isLeapYear(year) {
    // https://tools.ietf.org/html/rfc3339#appendix-C
    return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function date(str) {
    // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
    const matches = DATE.exec(str);
    if (!matches)
        return false;
    const year = +matches[1];
    const month = +matches[2];
    const day = +matches[3];
    return (month >= 1 &&
        month <= 12 &&
        day >= 1 &&
        day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]));
}
function compareDate(d1, d2) {
    if (!(d1 && d2))
        return undefined;
    if (d1 > d2)
        return 1;
    if (d1 < d2)
        return -1;
    return 0;
}
const TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
function time(str, withTimeZone) {
    const matches = TIME.exec(str);
    if (!matches)
        return false;
    const hour = +matches[1];
    const minute = +matches[2];
    const second = +matches[3];
    const timeZone = matches[5];
    return (((hour <= 23 && minute <= 59 && second <= 59) ||
        (hour === 23 && minute === 59 && second === 60)) &&
        (!withTimeZone || timeZone !== ""));
}
function compareTime(t1, t2) {
    if (!(t1 && t2))
        return undefined;
    const a1 = TIME.exec(t1);
    const a2 = TIME.exec(t2);
    if (!(a1 && a2))
        return undefined;
    t1 = a1[1] + a1[2] + a1[3] + (a1[4] || "");
    t2 = a2[1] + a2[2] + a2[3] + (a2[4] || "");
    if (t1 > t2)
        return 1;
    if (t1 < t2)
        return -1;
    return 0;
}
const DATE_TIME_SEPARATOR = /t|\s/i;
function date_time(str) {
    // http://tools.ietf.org/html/rfc3339#section-5.6
    const dateTime = str.split(DATE_TIME_SEPARATOR);
    return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true);
}
function compareDateTime(dt1, dt2) {
    if (!(dt1 && dt2))
        return undefined;
    const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
    const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
    const res = compareDate(d1, d2);
    if (res === undefined)
        return undefined;
    return res || compareTime(t1, t2);
}
const NOT_URI_FRAGMENT = /\/|:/;
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
function uri(str) {
    // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
    return NOT_URI_FRAGMENT.test(str) && URI.test(str);
}
const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
function byte(str) {
    BYTE.lastIndex = 0;
    return BYTE.test(str);
}
const MIN_INT32 = -(2 ** 31);
const MAX_INT32 = 2 ** 31 - 1;
function validateInt32(value) {
    return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
}
function validateInt64(value) {
    // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64
    return Number.isInteger(value);
}
function validateNumber() {
    return true;
}
const Z_ANCHOR = /[^\\]\\Z/;
function regex(str) {
    if (Z_ANCHOR.test(str))
        return false;
    try {
        new RegExp(str);
        return true;
    }
    catch (e) {
        return false;
    }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OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,QAAQ,GAAG,UAAU,CAAA;AAC3B,SAAS,KAAK,CAAC,GAAW;IACxB,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACpC,IAAI;QACF,IAAI,MAAM,CAAC,GAAG,CAAC,CAAA;QACf,OAAO,IAAI,CAAA;KACZ;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAA;KACb;AACH,CAAC"}import { FormatMode, FormatName } from "./formats";
import type { Plugin, Format } from "ajv";
export { FormatMode, FormatName } from "./formats";
export { LimitFormatError } from "./limit";
export interface FormatOptions {
    mode?: FormatMode;
    formats?: FormatName[];
    keywords?: boolean;
}
export declare type FormatsPluginOptions = FormatName[] | FormatOptions;
export interface FormatsPlugin extends Plugin<FormatsPluginOptions> {
    get: (format: FormatName, mode?: FormatMode) => Format;
}
declare const formatsPlugin: FormatsPlugin;
export default formatsPlugin;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const formats_1 = require("./formats");
const limit_1 = require("./limit");
const codegen_1 = require("ajv/dist/compile/codegen");
const fullName = new codegen_1.Name("fullFormats");
const fastName = new codegen_1.Name("fastFormats");
const formatsPlugin = (ajv, opts = { keywords: true }) => {
    if (Array.isArray(opts)) {
        addFormats(ajv, opts, formats_1.fullFormats, fullName);
        return ajv;
    }
    const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
    const list = opts.formats || formats_1.formatNames;
    addFormats(ajv, list, formats, exportName);
    if (opts.keywords)
        limit_1.default(ajv);
    return ajv;
};
formatsPlugin.get = (name, mode = "full") => {
    const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
    const f = formats[name];
    if (!f)
        throw new Error(`Unknown format "${name}"`);
    return f;
};
function addFormats(ajv, list, fs, exportName) {
    var _a;
    var _b;
    (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = codegen_1._ `require("ajv-formats/dist/formats").${exportName}`);
    for (const f of list)
        ajv.addFormat(f, fs[f]);
}
module.exports = exports = formatsPlugin;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = formatsPlugin;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,uCAOkB;AAClB,mCAAiC;AAGjC,sDAAgD;AAgBhD,MAAM,QAAQ,GAAG,IAAI,cAAI,CAAC,aAAa,CAAC,CAAA;AACxC,MAAM,QAAQ,GAAG,IAAI,cAAI,CAAC,aAAa,CAAC,CAAA;AAExC,MAAM,aAAa,GAAkB,CACnC,GAAQ,EACR,OAA6B,EAAC,QAAQ,EAAE,IAAI,EAAC,EACxC,EAAE;IACP,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACvB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,qBAAW,EAAE,QAAQ,CAAC,CAAA;QAC5C,OAAO,GAAG,CAAA;KACX;IACD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GACzB,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,qBAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAW,EAAE,QAAQ,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,IAAI,qBAAW,CAAA;IACxC,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;IAC1C,IAAI,IAAI,CAAC,QAAQ;QAAE,eAAW,CAAC,GAAG,CAAC,CAAA;IACnC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,aAAa,CAAC,GAAG,GAAG,CAAC,IAAgB,EAAE,OAAmB,MAAM,EAAU,EAAE;IAC1E,MAAM,OAAO,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,qBAAW,CAAC,CAAC,CAAC,qBAAW,CAAA;IAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,IAAI,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAA;IACnD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAkB,EAAE,EAAkB,EAAE,UAAgB;;;IACpF,YAAA,GAAG,CAAC,IAAI,CAAC,IAAI,EAAC,OAAO,uCAAP,OAAO,GAAK,WAAC,CAAA,uCAAuC,UAAU,EAAE,EAAA;IAC9E,KAAK,MAAM,CAAC,IAAI,IAAI;QAAE,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/C,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,aAAa,CAAA;AACxC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,aAAa,CAAA"}import type { Plugin, CodeKeywordDefinition, ErrorObject } from "ajv";
declare type Kwd = "formatMaximum" | "formatMinimum" | "formatExclusiveMaximum" | "formatExclusiveMinimum";
declare type Comparison = "<=" | ">=" | "<" | ">";
export declare type LimitFormatError = ErrorObject<Kwd, {
    limit: string;
    comparison: Comparison;
}>;
export declare const formatLimitDefinition: CodeKeywordDefinition;
declare const formatLimitPlugin: Plugin<undefined>;
export default formatLimitPlugin;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatLimitDefinition = void 0;
const ajv_1 = require("ajv");
const codegen_1 = require("ajv/dist/compile/codegen");
const ops = codegen_1.operators;
const KWDs = {
    formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
    formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
    formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
    formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
};
const error = {
    message: ({ keyword, schemaCode }) => codegen_1.str `should be ${KWDs[keyword].okStr} ${schemaCode}`,
    params: ({ keyword, schemaCode }) => codegen_1._ `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
};
exports.formatLimitDefinition = {
    keyword: Object.keys(KWDs),
    type: "string",
    schemaType: "string",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, schemaCode, keyword, it } = cxt;
        const { opts, self } = it;
        if (!opts.validateFormats)
            return;
        const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format");
        if (fCxt.$data)
            validate$DataFormat();
        else
            validateFormat();
        function validate$DataFormat() {
            const fmts = gen.scopeValue("formats", {
                ref: self.formats,
                code: opts.code.formats,
            });
            const fmt = gen.const("fmt", codegen_1._ `${fmts}[${fCxt.schemaCode}]`);
            cxt.fail$data(codegen_1.or(codegen_1._ `typeof ${fmt} != "object"`, codegen_1._ `${fmt} instanceof RegExp`, codegen_1._ `typeof ${fmt}.compare != "function"`, compareCode(fmt)));
        }
        function validateFormat() {
            const format = fCxt.schema;
            const fmtDef = self.formats[format];
            if (!fmtDef || fmtDef === true)
                return;
            if (typeof fmtDef != "object" ||
                fmtDef instanceof RegExp ||
                typeof fmtDef.compare != "function") {
                throw new Error(`"${keyword}": format "${format}" does not define "compare" function`);
            }
            const fmt = gen.scopeValue("formats", {
                key: format,
                ref: fmtDef,
                code: opts.code.formats ? codegen_1._ `${opts.code.formats}${codegen_1.getProperty(format)}` : undefined,
            });
            cxt.fail$data(compareCode(fmt));
        }
        function compareCode(fmt) {
            return codegen_1._ `${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
        }
    },
    dependencies: ["format"],
};
const formatLimitPlugin = (ajv) => {
    ajv.addKeyword(exports.formatLimitDefinition);
    return ajv;
};
exports.default = formatLimitPlugin;
//# sourceMappingURL=limit.js.map{"version":3,"file":"limit.js","sourceRoot":"","sources":["../src/limit.ts"],"names":[],"mappings":";;;AAWA,6BAA8B;AAC9B,sDAA2E;AAM3E,MAAM,GAAG,GAAG,mBAAS,CAAA;AAErB,MAAM,IAAI,GAA4D;IACpE,aAAa,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACvD,aAAa,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACvD,sBAAsB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;IAC/D,sBAAsB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;CAChE,CAAA;AAID,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,aAAG,CAAA,aAAa,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;IAC9F,MAAM,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAChC,WAAC,CAAA,gBAAgB,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,YAAY,UAAU,GAAG;CACvE,CAAA;AAEY,QAAA,qBAAqB,GAA0B;IAC1D,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAA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IAAI,UAAU,EACnC;gBACA,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,cAAc,MAAM,sCAAsC,CAAC,CAAA;aACvF;YACD,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,SAAS,EAAE;gBACpC,GAAG,EAAE,MAAM;gBACX,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,WAAC,CAAA,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,GAAG,qBAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;aACpF,CAAC,CAAA;YAEF,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QACjC,CAAC;QAED,SAAS,WAAW,CAAC,GAAS;YAC5B,OAAO,WAAC,CAAA,GAAG,GAAG,YAAY,IAAI,KAAK,UAAU,KAAK,IAAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,CAAA;QACjF,CAAC;IACH,CAAC;IACD,YAAY,EAAE,CAAC,QAAQ,CAAC;CACzB,CAAA;AAED,MAAM,iBAAiB,GAAsB,CAAC,GAAQ,EAAO,EAAE;IAC7D,GAAG,CAAC,UAAU,CAAC,6BAAqB,CAAC,CAAA;IACrC,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA;AAED,kBAAe,iBAAiB,CAAA"}MIT License

Copyright (c) 2020 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "ajv-formats",
  "version": "2.1.1",
  "description": "Format validation for Ajv v7+",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "files": [
    "src/",
    "dist/"
  ],
  "scripts": {
    "build": "tsc",
    "prettier:write": "prettier --write \"./**/*.{md,json,yaml,js,ts}\"",
    "prettier:check": "prettier --list-different \"./**/*.{md,json,yaml,js,ts}\"",
    "eslint": "eslint --ext .ts ./src/**/*",
    "test-spec": "jest",
    "test-cov": "jest --coverage",
    "test": "npm run prettier:check && npm run build && npm run eslint && npm run test-cov",
    "ci-test": "npm run test"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/ajv-validator/ajv-formats.git"
  },
  "keywords": [
    "Ajv",
    "JSON-Schema",
    "format",
    "validation"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/ajv-validator/ajv-formats/issues"
  },
  "homepage": "https://github.com/ajv-validator/ajv-formats#readme",
  "dependencies": {
    "ajv": "^8.0.0"
  },
  "peerDependencies": {
    "ajv": "^8.0.0"
  },
  "peerDependenciesMeta": {
    "ajv": {
      "optional": true
    }
  },
  "devDependencies": {
    "@ajv-validator/config": "^0.3.0",
    "@types/jest": "^26.0.5",
    "@types/node": "^14.10.1",
    "@typescript-eslint/eslint-plugin": "^3.7.0",
    "@typescript-eslint/parser": "^3.7.0",
    "ajv": "^8.0.0",
    "eslint": "^7.5.0",
    "eslint-config-prettier": "^6.11.0",
    "husky": "^4.2.5",
    "jest": "^26.1.0",
    "json-schema-test": "^2.0.0",
    "lint-staged": "^10.2.11",
    "prettier": "^2.3.2",
    "ts-jest": "^26.1.3",
    "typescript": "^4.0.0"
  },
  "prettier": "@ajv-validator/config/prettierrc.json",
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged && npm test"
    }
  },
  "lint-staged": {
    "*.{md,json,yaml,js,ts}": "prettier --write"
  }
}
# ajv-formats

JSON Schema formats for Ajv

[![Build Status](https://travis-ci.org/ajv-validator/ajv-formats.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv-formats)
[![npm](https://img.shields.io/npm/v/ajv-formats.svg)](https://www.npmjs.com/package/ajv-formats)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)

## Usage

```javascript
// ESM/TypeScript import
import Ajv from "ajv"
import addFormats from "ajv-formats"
// Node.js require:
const Ajv = require("ajv")
const addFormats = require("ajv-formats")

const ajv = new Ajv()
addFormats(ajv)
```

## Formats

The package defines these formats:

- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6).
- _time_: time with optional time-zone.
- _date-time_: date-time from the same source (time-zone is mandatory).
- _duration_: duration from [RFC3339](https://tools.ietf.org/html/rfc3339#appendix-A)
- _uri_: full URI.
- _uri-reference_: URI reference, including full and relative URIs.
- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570)
- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url).
- _email_: email address.
- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5).
- _ipv4_: IP address v4.
- _ipv6_: IP address v6.
- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor.
- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122).
- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901).
- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00).
- _byte_: base64 encoded data according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _int32_: signed 32 bits integer according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _int64_: signed 64 bits according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _float_: float according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _double_: double according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _password_: password string according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)
- _binary_: binary string according to the [openApi 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0#data-types)

See regular expressions used for format validation and the sources that were used in [formats.ts](https://github.com/ajv-validator/ajv-formats/blob/master/src/formats.ts).

**Please note**: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. These formats are available in [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) plugin.

## Keywords to compare values: `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum`

These keywords allow to define minimum/maximum constraints when the format keyword defines ordering (`compare` function in format definition).

These keywords are added to ajv instance when ajv-formats is used without options or with option `keywords: true`.

These keywords apply only to strings. If the data is not a string, the validation succeeds.

The value of keywords `formatMaximum`/`formatMinimum` and `formatExclusiveMaximum`/`formatExclusiveMinimum` should be a string or [\$data reference](https://github.com/ajv-validator/ajv/blob/master/docs/validation.md#data-reference). This value is the maximum (minimum) allowed value for the data to be valid as determined by `format` keyword. If `format` keyword is not present schema compilation will throw exception.

When these keyword are added, they also add comparison functions to formats `"date"`, `"time"` and `"date-time"`. User-defined formats also can have comparison functions. See [addFormat](https://github.com/ajv-validator/ajv/blob/master/docs/api.md#api-addformat) method.

```javascript
require("ajv-formats")(ajv)

const schema = {
  type: "string",
  format: "date",
  formatMinimum: "2016-02-06",
  formatExclusiveMaximum: "2016-12-27",
}

const validDataList = ["2016-02-06", "2016-12-26"]

const invalidDataList = ["2016-02-05", "2016-12-27", "abc"]
```

## Options

Options can be passed via the second parameter. Options value can be

1. The list of format names that will be added to ajv instance:

```javascript
addFormats(ajv, ["date", "time"])
```

**Please note**: when ajv encounters an undefined format it throws exception (unless ajv instance was configured with `strict: false` option). To allow specific undefined formats they have to be passed to ajv instance via `formats` option with `true` value:

```javascript
const ajv = new Ajv((formats: {date: true, time: true})) // to ignore "date" and "time" formats in schemas.
```

2. Format validation mode (default is `"full"`) with optional list of format names and `keywords` option to add additional format comparison keywords:

```javascript
addFormats(ajv, {mode: "fast"})
```

or

```javascript
addFormats(ajv, {mode: "fast", formats: ["date", "time"], keywords: true})
```

In `"fast"` mode the following formats are simplified: `"date"`, `"time"`, `"date-time"`, `"uri"`, `"uri-reference"`, `"email"`. For example `"date"`, `"time"` and `"date-time"` do not validate ranges in `"fast"` mode, only string structure, and other formats have simplified regular expressions.

## Tests

```bash
npm install
git submodule update --init
npm test
```

## License

[MIT](https://github.com/ajv-validator/ajv-formats/blob/master/LICENSE)
import type {Format, FormatDefinition} from "ajv"
import type {FormatValidator, FormatCompare} from "ajv/dist/types"

export type FormatMode = "fast" | "full"

export type FormatName =
  | "date"
  | "time"
  | "date-time"
  | "duration"
  | "uri"
  | "uri-reference"
  | "uri-template"
  | "url"
  | "email"
  | "hostname"
  | "ipv4"
  | "ipv6"
  | "regex"
  | "uuid"
  | "json-pointer"
  | "json-pointer-uri-fragment"
  | "relative-json-pointer"
  | "byte"
  | "int32"
  | "int64"
  | "float"
  | "double"
  | "password"
  | "binary"

export type DefinedFormats = {
  [key in FormatName]: Format
}

function fmtDef(
  validate: RegExp | FormatValidator<string>,
  compare: FormatCompare<string>
): FormatDefinition<string> {
  return {validate, compare}
}

export const fullFormats: DefinedFormats = {
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
  date: fmtDef(date, compareDate),
  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
  time: fmtDef(time, compareTime),
  "date-time": fmtDef(date_time, compareDateTime),
  // duration: https://tools.ietf.org/html/rfc3339#appendix-A
  duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
  uri,
  "uri-reference":
    /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
  // uri-template: https://tools.ietf.org/html/rfc6570
  "uri-template":
    /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
  // For the source: https://gist.github.com/dperini/729294
  // For test cases: https://mathiasbynens.be/demo/url-regex
  url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
  email:
    /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
  hostname:
    /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
  // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
  regex,
  // uuid: http://tools.ietf.org/html/rfc4122
  uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
  // JSON-pointer: https://tools.ietf.org/html/rfc6901
  // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
  "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
  "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
  // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
  "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
  // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
  // byte: https://github.com/miguelmota/is-base64
  byte,
  // signed 32 bit integer
  int32: {type: "number", validate: validateInt32},
  // signed 64 bit integer
  int64: {type: "number", validate: validateInt64},
  // C-type float
  float: {type: "number", validate: validateNumber},
  // C-type double
  double: {type: "number", validate: validateNumber},
  // hint to the UI to hide input strings
  password: true,
  // unchecked string payload
  binary: true,
}

export const fastFormats: DefinedFormats = {
  ...fullFormats,
  date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
  time: fmtDef(
    /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
    compareTime
  ),
  "date-time": fmtDef(
    /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
    compareDateTime
  ),
  // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
  uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
  "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
  // email (sources from jsen validator):
  // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
  email:
    /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
}

export const formatNames = Object.keys(fullFormats) as FormatName[]

function isLeapYear(year: number): boolean {
  // https://tools.ietf.org/html/rfc3339#appendix-C
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0)
}

const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

function date(str: string): boolean {
  // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
  const matches: string[] | null = DATE.exec(str)
  if (!matches) return false
  const year: number = +matches[1]
  const month: number = +matches[2]
  const day: number = +matches[3]
  return (
    month >= 1 &&
    month <= 12 &&
    day >= 1 &&
    day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month])
  )
}

function compareDate(d1: string, d2: string): number | undefined {
  if (!(d1 && d2)) return undefined
  if (d1 > d2) return 1
  if (d1 < d2) return -1
  return 0
}

const TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i

function time(str: string, withTimeZone?: boolean): boolean {
  const matches: string[] | null = TIME.exec(str)
  if (!matches) return false

  const hour: number = +matches[1]
  const minute: number = +matches[2]
  const second: number = +matches[3]
  const timeZone: string = matches[5]
  return (
    ((hour <= 23 && minute <= 59 && second <= 59) ||
      (hour === 23 && minute === 59 && second === 60)) &&
    (!withTimeZone || timeZone !== "")
  )
}

function compareTime(t1: string, t2: string): number | undefined {
  if (!(t1 && t2)) return undefined
  const a1 = TIME.exec(t1)
  const a2 = TIME.exec(t2)
  if (!(a1 && a2)) return undefined
  t1 = a1[1] + a1[2] + a1[3] + (a1[4] || "")
  t2 = a2[1] + a2[2] + a2[3] + (a2[4] || "")
  if (t1 > t2) return 1
  if (t1 < t2) return -1
  return 0
}

const DATE_TIME_SEPARATOR = /t|\s/i
function date_time(str: string): boolean {
  // http://tools.ietf.org/html/rfc3339#section-5.6
  const dateTime: string[] = str.split(DATE_TIME_SEPARATOR)
  return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1], true)
}

function compareDateTime(dt1: string, dt2: string): number | undefined {
  if (!(dt1 && dt2)) return undefined
  const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR)
  const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR)
  const res = compareDate(d1, d2)
  if (res === undefined) return undefined
  return res || compareTime(t1, t2)
}

const NOT_URI_FRAGMENT = /\/|:/
const URI =
  /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i

function uri(str: string): boolean {
  // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
  return NOT_URI_FRAGMENT.test(str) && URI.test(str)
}

const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm

function byte(str: string): boolean {
  BYTE.lastIndex = 0
  return BYTE.test(str)
}

const MIN_INT32 = -(2 ** 31)
const MAX_INT32 = 2 ** 31 - 1

function validateInt32(value: number): boolean {
  return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32
}

function validateInt64(value: number): boolean {
  // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64
  return Number.isInteger(value)
}

function validateNumber(): boolean {
  return true
}

const Z_ANCHOR = /[^\\]\\Z/
function regex(str: string): boolean {
  if (Z_ANCHOR.test(str)) return false
  try {
    new RegExp(str)
    return true
  } catch (e) {
    return false
  }
}
import {
  DefinedFormats,
  FormatMode,
  FormatName,
  formatNames,
  fastFormats,
  fullFormats,
} from "./formats"
import formatLimit from "./limit"
import type Ajv from "ajv"
import type {Plugin, Format} from "ajv"
import {_, Name} from "ajv/dist/compile/codegen"

export {FormatMode, FormatName} from "./formats"
export {LimitFormatError} from "./limit"
export interface FormatOptions {
  mode?: FormatMode
  formats?: FormatName[]
  keywords?: boolean
}

export type FormatsPluginOptions = FormatName[] | FormatOptions

export interface FormatsPlugin extends Plugin<FormatsPluginOptions> {
  get: (format: FormatName, mode?: FormatMode) => Format
}

const fullName = new Name("fullFormats")
const fastName = new Name("fastFormats")

const formatsPlugin: FormatsPlugin = (
  ajv: Ajv,
  opts: FormatsPluginOptions = {keywords: true}
): Ajv => {
  if (Array.isArray(opts)) {
    addFormats(ajv, opts, fullFormats, fullName)
    return ajv
  }
  const [formats, exportName] =
    opts.mode === "fast" ? [fastFormats, fastName] : [fullFormats, fullName]
  const list = opts.formats || formatNames
  addFormats(ajv, list, formats, exportName)
  if (opts.keywords) formatLimit(ajv)
  return ajv
}

formatsPlugin.get = (name: FormatName, mode: FormatMode = "full"): Format => {
  const formats = mode === "fast" ? fastFormats : fullFormats
  const f = formats[name]
  if (!f) throw new Error(`Unknown format "${name}"`)
  return f
}

function addFormats(ajv: Ajv, list: FormatName[], fs: DefinedFormats, exportName: Name): void {
  ajv.opts.code.formats ??= _`require("ajv-formats/dist/formats").${exportName}`
  for (const f of list) ajv.addFormat(f, fs[f])
}

module.exports = exports = formatsPlugin
Object.defineProperty(exports, "__esModule", {value: true})

export default formatsPlugin
import type Ajv from "ajv"
import type {
  Plugin,
  CodeKeywordDefinition,
  KeywordErrorDefinition,
  Code,
  Name,
  ErrorObject,
} from "ajv"
import type {AddedFormat} from "ajv/dist/types"
import type {Rule} from "ajv/dist/compile/rules"
import {KeywordCxt} from "ajv"
import {_, str, or, getProperty, operators} from "ajv/dist/compile/codegen"

type Kwd = "formatMaximum" | "formatMinimum" | "formatExclusiveMaximum" | "formatExclusiveMinimum"

type Comparison = "<=" | ">=" | "<" | ">"

const ops = operators

const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {
  formatMaximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT},
  formatMinimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT},
  formatExclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE},
  formatExclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE},
}

export type LimitFormatError = ErrorObject<Kwd, {limit: string; comparison: Comparison}>

const error: KeywordErrorDefinition = {
  message: ({keyword, schemaCode}) => str`should be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,
  params: ({keyword, schemaCode}) =>
    _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,
}

export const formatLimitDefinition: CodeKeywordDefinition = {
  keyword: Object.keys(KWDs),
  type: "string",
  schemaType: "string",
  $data: true,
  error,
  code(cxt) {
    const {gen, data, schemaCode, keyword, it} = cxt
    const {opts, self} = it
    if (!opts.validateFormats) return

    const fCxt = new KeywordCxt(it, (self.RULES.all.format as Rule).definition, "format")
    if (fCxt.$data) validate$DataFormat()
    else validateFormat()

    function validate$DataFormat(): void {
      const fmts = gen.scopeValue("formats", {
        ref: self.formats,
        code: opts.code.formats,
      })
      const fmt = gen.const("fmt", _`${fmts}[${fCxt.schemaCode}]`)
      cxt.fail$data(
        or(
          _`typeof ${fmt} != "object"`,
          _`${fmt} instanceof RegExp`,
          _`typeof ${fmt}.compare != "function"`,
          compareCode(fmt)
        )
      )
    }

    function validateFormat(): void {
      const format = fCxt.schema as string
      const fmtDef: AddedFormat | undefined = self.formats[format]
      if (!fmtDef || fmtDef === true) return
      if (
        typeof fmtDef != "object" ||
        fmtDef instanceof RegExp ||
        typeof fmtDef.compare != "function"
      ) {
        throw new Error(`"${keyword}": format "${format}" does not define "compare" function`)
      }
      const fmt = gen.scopeValue("formats", {
        key: format,
        ref: fmtDef,
        code: opts.code.formats ? _`${opts.code.formats}${getProperty(format)}` : undefined,
      })

      cxt.fail$data(compareCode(fmt))
    }

    function compareCode(fmt: Name): Code {
      return _`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword as Kwd].fail} 0`
    }
  },
  dependencies: ["format"],
}

const formatLimitPlugin: Plugin<undefined> = (ajv: Ajv): Ajv => {
  ajv.addKeyword(formatLimitDefinition)
  return ajv
}

export default formatLimitPlugin
const Ajv = require("ajv")
const ajv = new Ajv({allErrors: true})

const schema = {
  type: "object",
  properties: {
    foo: {type: "string"},
    bar: {type: "number", maximum: 3},
  },
  required: ["foo", "bar"],
  additionalProperties: false,
}

const validate = ajv.compile(schema)

test({foo: "abc", bar: 2})
test({foo: 2, bar: 4})

function test(data) {
  const valid = validate(data)
  if (valid) console.log("Valid!")
  else console.log("Invalid: " + ajv.errorsText(validate.errors))
}
import type { AnySchemaObject } from "./types";
import AjvCore, { Options } from "./core";
export declare class Ajv2019 extends AjvCore {
    constructor(opts?: Options);
    _addVocabularies(): void;
    _addDefaultMetaSchema(): void;
    defaultMeta(): string | AnySchemaObject | undefined;
}
export default Ajv2019;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { DefinedError } from "./vocabularies/errors";
export { JSONType } from "./compile/rules";
export { JSONSchemaType } from "./types/json-schema";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2019 = void 0;
const core_1 = require("./core");
const draft7_1 = require("./vocabularies/draft7");
const dynamic_1 = require("./vocabularies/dynamic");
const next_1 = require("./vocabularies/next");
const unevaluated_1 = require("./vocabularies/unevaluated");
const discriminator_1 = require("./vocabularies/discriminator");
const json_schema_2019_09_1 = require("./refs/json-schema-2019-09");
const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema";
class Ajv2019 extends core_1.default {
    constructor(opts = {}) {
        super({
            ...opts,
            dynamicRef: true,
            next: true,
            unevaluated: true,
        });
    }
    _addVocabularies() {
        super._addVocabularies();
        this.addVocabulary(dynamic_1.default);
        draft7_1.default.forEach((v) => this.addVocabulary(v));
        this.addVocabulary(next_1.default);
        this.addVocabulary(unevaluated_1.default);
        if (this.opts.discriminator)
            this.addKeyword(discriminator_1.default);
    }
    _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        const { $data, meta } = this.opts;
        if (!meta)
            return;
        json_schema_2019_09_1.default.call(this, $data);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
    }
    defaultMeta() {
        return (this.opts.defaultMeta =
            super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
    }
}
exports.Ajv2019 = Ajv2019;
module.exports = exports = Ajv2019;
module.exports.Ajv2019 = Ajv2019;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Ajv2019;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
var validation_error_1 = require("./runtime/validation_error");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } });
var ref_error_1 = require("./compile/ref_error");
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } });
//# sourceMappingURL=2019.js.map{"version":3,"file":"2019.js","sourceRoot":"","sources":["../lib/2019.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,kDAAsD;AACtD,oDAAsD;AACtD,8CAAgD;AAChD,4DAA8D;AAC9D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAA;QACrC,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAA;QAClC,IAAI,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAA;QACzC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,UAAU,CAAC,uBAAa,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,MAAM,EAAC,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,6BAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,+BAA+B,CAAC,GAAG,cAAc,CAAA;IAC7D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IACzF,CAAC;CACF;AA/BD,0BA+BC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAA;AAChC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,OAAO,CAAA;AAyBtB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAIlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AACnD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}import type { AnySchemaObject } from "./types";
import AjvCore, { Options } from "./core";
export declare class Ajv2020 extends AjvCore {
    constructor(opts?: Options);
    _addVocabularies(): void;
    _addDefaultMetaSchema(): void;
    defaultMeta(): string | AnySchemaObject | undefined;
}
export default Ajv2020;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { DefinedError } from "./vocabularies/errors";
export { JSONType } from "./compile/rules";
export { JSONSchemaType } from "./types/json-schema";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv2020 = void 0;
const core_1 = require("./core");
const draft2020_1 = require("./vocabularies/draft2020");
const discriminator_1 = require("./vocabularies/discriminator");
const json_schema_2020_12_1 = require("./refs/json-schema-2020-12");
const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema";
class Ajv2020 extends core_1.default {
    constructor(opts = {}) {
        super({
            ...opts,
            dynamicRef: true,
            next: true,
            unevaluated: true,
        });
    }
    _addVocabularies() {
        super._addVocabularies();
        draft2020_1.default.forEach((v) => this.addVocabulary(v));
        if (this.opts.discriminator)
            this.addKeyword(discriminator_1.default);
    }
    _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        const { $data, meta } = this.opts;
        if (!meta)
            return;
        json_schema_2020_12_1.default.call(this, $data);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
    }
    defaultMeta() {
        return (this.opts.defaultMeta =
            super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
    }
}
exports.Ajv2020 = Ajv2020;
module.exports = exports = Ajv2020;
module.exports.Ajv2020 = Ajv2020;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Ajv2020;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
var validation_error_1 = require("./runtime/validation_error");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } });
var ref_error_1 = require("./compile/ref_error");
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } });
//# sourceMappingURL=2020.js.map{"version":3,"file":"2020.js","sourceRoot":"","sources":["../lib/2020.ts"],"names":[],"mappings":";;;AACA,iCAAuC;AAEvC,wDAA4D;AAC5D,gEAAwD;AACxD,oEAA0D;AAE1D,MAAM,cAAc,GAAG,8CAA8C,CAAA;AAErE,MAAa,OAAQ,SAAQ,cAAO;IAClC,YAAY,OAAgB,EAAE;QAC5B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,mBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAA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vCore from "./core";
export declare class Ajv extends AjvCore {
    _addVocabularies(): void;
    _addDefaultMetaSchema(): void;
    defaultMeta(): string | AnySchemaObject | undefined;
}
export default Ajv;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, SchemaValidateFunction, ErrorObject, ErrorNoParams, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { DefinedError } from "./vocabularies/errors";
export { JSONType } from "./compile/rules";
export { JSONSchemaType } from "./types/json-schema";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
const core_1 = require("./core");
const draft7_1 = require("./vocabularies/draft7");
const discriminator_1 = require("./vocabularies/discriminator");
const draft7MetaSchema = require("./refs/json-schema-draft-07.json");
const META_SUPPORT_DATA = ["/properties"];
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
class Ajv extends core_1.default {
    _addVocabularies() {
        super._addVocabularies();
        draft7_1.default.forEach((v) => this.addVocabulary(v));
        if (this.opts.discriminator)
            this.addKeyword(discriminator_1.default);
    }
    _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        if (!this.opts.meta)
            return;
        const metaSchema = this.opts.$data
            ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
            : draft7MetaSchema;
        this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
        this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
    }
    defaultMeta() {
        return (this.opts.defaultMeta =
            super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
    }
}
exports.Ajv = Ajv;
module.exports = exports = Ajv;
module.exports.Ajv = Ajv;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Ajv;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
var validation_error_1 = require("./runtime/validation_error");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } });
var ref_error_1 = require("./compile/ref_error");
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } });
//# sourceMappingURL=ajv.js.map{"version":3,"file":"ajv.js","sourceRoot":"","sources":["../lib/ajv.ts"],"names":[],"mappings":";;;AACA,iCAA4B;AAC5B,kDAAsD;AACtD,gEAAwD;AACxD,qEAAoE;AAEpE,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,MAAM,cAAc,GAAG,wCAAwC,CAAA;AAE/D,MAAa,GAAI,SAAQ,cAAO;IAC9B,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,gBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACx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,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}export declare abstract class _CodeOrName {
    abstract readonly str: string;
    abstract readonly names: UsedNames;
    abstract toString(): string;
    abstract emptyStr(): boolean;
}
export declare const IDENTIFIER: RegExp;
export declare class Name extends _CodeOrName {
    readonly str: string;
    constructor(s: string);
    toString(): string;
    emptyStr(): boolean;
    get names(): UsedNames;
}
export declare class _Code extends _CodeOrName {
    readonly _items: readonly CodeItem[];
    private _str?;
    private _names?;
    constructor(code: string | readonly CodeItem[]);
    toString(): string;
    emptyStr(): boolean;
    get str(): string;
    get names(): UsedNames;
}
export type CodeItem = Name | string | number | boolean | null;
export type UsedNames = Record<string, number | undefined>;
export type Code = _Code | Name;
export type SafeExpr = Code | number | boolean | null;
export declare const nil: _Code;
type CodeArg = SafeExpr | string | undefined;
export declare function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code;
export declare function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code;
export declare function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void;
export declare function strConcat(c1: Code, c2: Code): Code;
export declare function stringify(x: unknown): Code;
export declare function safeStringify(x: unknown): string;
export declare function getProperty(key: Code | string | number): Code;
export declare function getEsmExportName(key: Code | string | number): Code;
export declare function regexpCode(rx: RegExp): Code;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
class _CodeOrName {
}
exports._CodeOrName = _CodeOrName;
exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
class Name extends _CodeOrName {
    constructor(s) {
        super();
        if (!exports.IDENTIFIER.test(s))
            throw new Error("CodeGen: name must be a valid identifier");
        this.str = s;
    }
    toString() {
        return this.str;
    }
    emptyStr() {
        return false;
    }
    get names() {
        return { [this.str]: 1 };
    }
}
exports.Name = Name;
class _Code extends _CodeOrName {
    constructor(code) {
        super();
        this._items = typeof code === "string" ? [code] : code;
    }
    toString() {
        return this.str;
    }
    emptyStr() {
        if (this._items.length > 1)
            return false;
        const item = this._items[0];
        return item === "" || item === '""';
    }
    get str() {
        var _a;
        return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
    }
    get names() {
        var _a;
        return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
            if (c instanceof Name)
                names[c.str] = (names[c.str] || 0) + 1;
            return names;
        }, {})));
    }
}
exports._Code = _Code;
exports.nil = new _Code("");
function _(strs, ...args) {
    const code = [strs[0]];
    let i = 0;
    while (i < args.length) {
        addCodeArg(code, args[i]);
        code.push(strs[++i]);
    }
    return new _Code(code);
}
exports._ = _;
const plus = new _Code("+");
function str(strs, ...args) {
    const expr = [safeStringify(strs[0])];
    let i = 0;
    while (i < args.length) {
        expr.push(plus);
        addCodeArg(expr, args[i]);
        expr.push(plus, safeStringify(strs[++i]));
    }
    optimize(expr);
    return new _Code(expr);
}
exports.str = str;
function addCodeArg(code, arg) {
    if (arg instanceof _Code)
        code.push(...arg._items);
    else if (arg instanceof Name)
        code.push(arg);
    else
        code.push(interpolate(arg));
}
exports.addCodeArg = addCodeArg;
function optimize(expr) {
    let i = 1;
    while (i < expr.length - 1) {
        if (expr[i] === plus) {
            const res = mergeExprItems(expr[i - 1], expr[i + 1]);
            if (res !== undefined) {
                expr.splice(i - 1, 3, res);
                continue;
            }
            expr[i++] = "+";
        }
        i++;
    }
}
function mergeExprItems(a, b) {
    if (b === '""')
        return a;
    if (a === '""')
        return b;
    if (typeof a == "string") {
        if (b instanceof Name || a[a.length - 1] !== '"')
            return;
        if (typeof b != "string")
            return `${a.slice(0, -1)}${b}"`;
        if (b[0] === '"')
            return a.slice(0, -1) + b.slice(1);
        return;
    }
    if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
        return `"${a}${b.slice(1)}`;
    return;
}
function strConcat(c1, c2) {
    return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
}
exports.strConcat = strConcat;
// TODO do not allow arrays here
function interpolate(x) {
    return typeof x == "number" || typeof x == "boolean" || x === null
        ? x
        : safeStringify(Array.isArray(x) ? x.join(",") : x);
}
function stringify(x) {
    return new _Code(safeStringify(x));
}
exports.stringify = stringify;
function safeStringify(x) {
    return JSON.stringify(x)
        .replace(/\u2028/g, "\\u2028")
        .replace(/\u2029/g, "\\u2029");
}
exports.safeStringify = safeStringify;
function getProperty(key) {
    return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
}
exports.getProperty = getProperty;
//Does best effort to format the name properly
function getEsmExportName(key) {
    if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
        return new _Code(`${key}`);
    }
    throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
}
exports.getEsmExportName = getEsmExportName;
function regexpCode(rx) {
    return new _Code(rx.toString());
}
exports.regexpCode = regexpCode;
//# sourceMappingURL=code.js.map{"version":3,"file":"code.js","sourceRoot":"","sources":["../../../lib/compile/codegen/code.ts"],"names":[],"mappings":";;;AAAA,kEAAkE;AAClE,MAAsB,WAAW;CAKhC;AALD,kCAKC;AAEY,QAAA,UAAU,GAAG,uBAAuB,CAAA;AAEjD,MAAa,IAAK,SAAQ,WAAW;IAEnC,YAAY,CAAS;QACnB,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QACpF,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;IACd,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAA;IACd,C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O,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAClC,CAAC;AAJD,sCAIC;AAED,SAAgB,WAAW,CAAC,GAA2B;IACrD,OAAO,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,IAAI,GAAG,GAAG,CAAA;AAC5F,CAAC;AAFD,kCAEC;AAED,8CAA8C;AAC9C,SAAgB,gBAAgB,CAAC,GAA2B;IAC1D,IAAI,OAAO,GAAG,IAAI,QAAQ,IAAI,kBAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACnD,OAAO,IAAI,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAA;IAC5B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,iCAAiC,GAAG,iCAAiC,CAAC,CAAA;AACxF,CAAC;AALD,4CAKC;AAED,SAAgB,UAAU,CAAC,EAAU;IACnC,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACjC,CAAC;AAFD,gCAEC"}import type { ScopeValueSets, NameValue, ValueScope, ValueScopeName } from "./scope";
import { _Code, Code, Name } from "./code";
import { Scope } from "./scope";
export { _, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code } from "./code";
export { Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds } from "./scope";
export type SafeExpr = Code | number | boolean | null;
export type Block = Code | (() => void);
export declare const operators: {
    GT: _Code;
    GTE: _Code;
    LT: _Code;
    LTE: _Code;
    EQ: _Code;
    NEQ: _Code;
    NOT: _Code;
    OR: _Code;
    AND: _Code;
    ADD: _Code;
};
export interface CodeGenOptions {
    es5?: boolean;
    lines?: boolean;
    ownProperties?: boolean;
}
export declare class CodeGen {
    readonly _scope: Scope;
    readonly _extScope: ValueScope;
    readonly _values: ScopeValueSets;
    private readonly _nodes;
    private readonly _blockStarts;
    private readonly _constants;
    private readonly opts;
    constructor(extScope: ValueScope, opts?: CodeGenOptions);
    toString(): string;
    name(prefix: string): Name;
    scopeName(prefix: string): ValueScopeName;
    scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name;
    getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined;
    scopeRefs(scopeName: Name): Code;
    scopeCode(): Code;
    private _def;
    const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name;
    let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name;
    var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name;
    assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen;
    add(lhs: Code, rhs: SafeExpr): CodeGen;
    code(c: Block | SafeExpr): CodeGen;
    object(...keyValues: [Name | string, SafeExpr | string][]): _Code;
    if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen;
    elseIf(condition: Code | boolean): CodeGen;
    else(): CodeGen;
    endIf(): CodeGen;
    private _for;
    for(iteration: Code, forBody?: Block): CodeGen;
    forRange(nameOrPrefix: Name | string, from: SafeExpr, to: SafeExpr, forBody: (index: Name) => void, varKind?: Code): CodeGen;
    forOf(nameOrPrefix: Name | string, iterable: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen;
    forIn(nameOrPrefix: Name | string, obj: Code, forBody: (item: Name) => void, varKind?: Code): CodeGen;
    endFor(): CodeGen;
    label(label: Name): CodeGen;
    break(label?: Code): CodeGen;
    return(value: Block | SafeExpr): CodeGen;
    try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen;
    throw(error: Code): CodeGen;
    block(body?: Block, nodeCount?: number): CodeGen;
    endBlock(nodeCount?: number): CodeGen;
    func(name: Name, args?: Code, async?: boolean, funcBody?: Block): CodeGen;
    endFunc(): CodeGen;
    optimize(n?: number): void;
    private _leafNode;
    private _blockNode;
    private _endBlockNode;
    private _elseNode;
    private get _root();
    private get _currNode();
    private set _currNode(value);
}
export declare function not<T extends Code | SafeExpr>(x: T): T;
export declare function and(...args: Code[]): Code;
export declare function or(...args: Code[]): Code;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
const code_1 = require("./code");
const scope_1 = require("./scope");
var code_2 = require("./code");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return code_2._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return code_2.str; } });
Object.defineProperty(exports, "strConcat", { enumerable: true, get: function () { return code_2.strConcat; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return code_2.nil; } });
Object.defineProperty(exports, "getProperty", { enumerable: true, get: function () { return code_2.getProperty; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return code_2.stringify; } });
Object.defineProperty(exports, "regexpCode", { enumerable: true, get: function () { return code_2.regexpCode; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return code_2.Name; } });
var scope_2 = require("./scope");
Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return scope_2.Scope; } });
Object.defineProperty(exports, "ValueScope", { enumerable: true, get: function () { return scope_2.ValueScope; } });
Object.defineProperty(exports, "ValueScopeName", { enumerable: true, get: function () { return scope_2.ValueScopeName; } });
Object.defineProperty(exports, "varKinds", { enumerable: true, get: function () { return scope_2.varKinds; } });
exports.operators = {
    GT: new code_1._Code(">"),
    GTE: new code_1._Code(">="),
    LT: new code_1._Code("<"),
    LTE: new code_1._Code("<="),
    EQ: new code_1._Code("==="),
    NEQ: new code_1._Code("!=="),
    NOT: new code_1._Code("!"),
    OR: new code_1._Code("||"),
    AND: new code_1._Code("&&"),
    ADD: new code_1._Code("+"),
};
class Node {
    optimizeNodes() {
        return this;
    }
    optimizeNames(_names, _constants) {
        return this;
    }
}
class Def extends Node {
    constructor(varKind, name, rhs) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.rhs = rhs;
    }
    render({ es5, _n }) {
        const varKind = es5 ? scope_1.varKinds.var : this.varKind;
        const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
        return `${varKind} ${this.name}${rhs};` + _n;
    }
    optimizeNames(names, constants) {
        if (!names[this.name.str])
            return;
        if (this.rhs)
            this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
    }
    get names() {
        return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
    }
}
class Assign extends Node {
    constructor(lhs, rhs, sideEffects) {
        super();
        this.lhs = lhs;
        this.rhs = rhs;
        this.sideEffects = sideEffects;
    }
    render({ _n }) {
        return `${this.lhs} = ${this.rhs};` + _n;
    }
    optimizeNames(names, constants) {
        if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
            return;
        this.rhs = optimizeExpr(this.rhs, names, constants);
        return this;
    }
    get names() {
        const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
        return addExprNames(names, this.rhs);
    }
}
class AssignOp extends Assign {
    constructor(lhs, op, rhs, sideEffects) {
        super(lhs, rhs, sideEffects);
        this.op = op;
    }
    render({ _n }) {
        return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
    }
}
class Label extends Node {
    constructor(label) {
        super();
        this.label = label;
        this.names = {};
    }
    render({ _n }) {
        return `${this.label}:` + _n;
    }
}
class Break extends Node {
    constructor(label) {
        super();
        this.label = label;
        this.names = {};
    }
    render({ _n }) {
        const label = this.label ? ` ${this.label}` : "";
        return `break${label};` + _n;
    }
}
class Throw extends Node {
    constructor(error) {
        super();
        this.error = error;
    }
    render({ _n }) {
        return `throw ${this.error};` + _n;
    }
    get names() {
        return this.error.names;
    }
}
class AnyCode extends Node {
    constructor(code) {
        super();
        this.code = code;
    }
    render({ _n }) {
        return `${this.code};` + _n;
    }
    optimizeNodes() {
        return `${this.code}` ? this : undefined;
    }
    optimizeNames(names, constants) {
        this.code = optimizeExpr(this.code, names, constants);
        return this;
    }
    get names() {
        return this.code instanceof code_1._CodeOrName ? this.code.names : {};
    }
}
class ParentNode extends Node {
    constructor(nodes = []) {
        super();
        this.nodes = nodes;
    }
    render(opts) {
        return this.nodes.reduce((code, n) => code + n.render(opts), "");
    }
    optimizeNodes() {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
            const n = nodes[i].optimizeNodes();
            if (Array.isArray(n))
                nodes.splice(i, 1, ...n);
            else if (n)
                nodes[i] = n;
            else
                nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : undefined;
    }
    optimizeNames(names, constants) {
        const { nodes } = this;
        let i = nodes.length;
        while (i--) {
            // iterating backwards improves 1-pass optimization
            const n = nodes[i];
            if (n.optimizeNames(names, constants))
                continue;
            subtractNames(names, n.names);
            nodes.splice(i, 1);
        }
        return nodes.length > 0 ? this : undefined;
    }
    get names() {
        return this.nodes.reduce((names, n) => addNames(names, n.names), {});
    }
}
class BlockNode extends ParentNode {
    render(opts) {
        return "{" + opts._n + super.render(opts) + "}" + opts._n;
    }
}
class Root extends ParentNode {
}
class Else extends BlockNode {
}
Else.kind = "else";
class If extends BlockNode {
    constructor(condition, nodes) {
        super(nodes);
        this.condition = condition;
    }
    render(opts) {
        let code = `if(${this.condition})` + super.render(opts);
        if (this.else)
            code += "else " + this.else.render(opts);
        return code;
    }
    optimizeNodes() {
        super.optimizeNodes();
        const cond = this.condition;
        if (cond === true)
            return this.nodes; // else is ignored here
        let e = this.else;
        if (e) {
            const ns = e.optimizeNodes();
            e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
        }
        if (e) {
            if (cond === false)
                return e instanceof If ? e : e.nodes;
            if (this.nodes.length)
                return this;
            return new If(not(cond), e instanceof If ? [e] : e.nodes);
        }
        if (cond === false || !this.nodes.length)
            return undefined;
        return this;
    }
    optimizeNames(names, constants) {
        var _a;
        this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
        if (!(super.optimizeNames(names, constants) || this.else))
            return;
        this.condition = optimizeExpr(this.condition, names, constants);
        return this;
    }
    get names() {
        const names = super.names;
        addExprNames(names, this.condition);
        if (this.else)
            addNames(names, this.else.names);
        return names;
    }
}
If.kind = "if";
class For extends BlockNode {
}
For.kind = "for";
class ForLoop extends For {
    constructor(iteration) {
        super();
        this.iteration = iteration;
    }
    render(opts) {
        return `for(${this.iteration})` + super.render(opts);
    }
    optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
            return;
        this.iteration = optimizeExpr(this.iteration, names, constants);
        return this;
    }
    get names() {
        return addNames(super.names, this.iteration.names);
    }
}
class ForRange extends For {
    constructor(varKind, name, from, to) {
        super();
        this.varKind = varKind;
        this.name = name;
        this.from = from;
        this.to = to;
    }
    render(opts) {
        const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
        const { name, from, to } = this;
        return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
    }
    get names() {
        const names = addExprNames(super.names, this.from);
        return addExprNames(names, this.to);
    }
}
class ForIter extends For {
    constructor(loop, varKind, name, iterable) {
        super();
        this.loop = loop;
        this.varKind = varKind;
        this.name = name;
        this.iterable = iterable;
    }
    render(opts) {
        return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
    }
    optimizeNames(names, constants) {
        if (!super.optimizeNames(names, constants))
            return;
        this.iterable = optimizeExpr(this.iterable, names, constants);
        return this;
    }
    get names() {
        return addNames(super.names, this.iterable.names);
    }
}
class Func extends BlockNode {
    constructor(name, args, async) {
        super();
        this.name = name;
        this.args = args;
        this.async = async;
    }
    render(opts) {
        const _async = this.async ? "async " : "";
        return `${_async}function ${this.name}(${this.args})` + super.render(opts);
    }
}
Func.kind = "func";
class Return extends ParentNode {
    render(opts) {
        return "return " + super.render(opts);
    }
}
Return.kind = "return";
class Try extends BlockNode {
    render(opts) {
        let code = "try" + super.render(opts);
        if (this.catch)
            code += this.catch.render(opts);
        if (this.finally)
            code += this.finally.render(opts);
        return code;
    }
    optimizeNodes() {
        var _a, _b;
        super.optimizeNodes();
        (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
        return this;
    }
    optimizeNames(names, constants) {
        var _a, _b;
        super.optimizeNames(names, constants);
        (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
        (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
        return this;
    }
    get names() {
        const names = super.names;
        if (this.catch)
            addNames(names, this.catch.names);
        if (this.finally)
            addNames(names, this.finally.names);
        return names;
    }
}
class Catch extends BlockNode {
    constructor(error) {
        super();
        this.error = error;
    }
    render(opts) {
        return `catch(${this.error})` + super.render(opts);
    }
}
Catch.kind = "catch";
class Finally extends BlockNode {
    render(opts) {
        return "finally" + super.render(opts);
    }
}
Finally.kind = "finally";
class CodeGen {
    constructor(extScope, opts = {}) {
        this._values = {};
        this._blockStarts = [];
        this._constants = {};
        this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
        this._extScope = extScope;
        this._scope = new scope_1.Scope({ parent: extScope });
        this._nodes = [new Root()];
    }
    toString() {
        return this._root.render(this.opts);
    }
    // returns unique name in the internal scope
    name(prefix) {
        return this._scope.name(prefix);
    }
    // reserves unique name in the external scope
    scopeName(prefix) {
        return this._extScope.name(prefix);
    }
    // reserves unique name in the external scope and assigns value to it
    scopeValue(prefixOrName, value) {
        const name = this._extScope.value(prefixOrName, value);
        const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());
        vs.add(name);
        return name;
    }
    getScopeValue(prefix, keyOrRef) {
        return this._extScope.getValue(prefix, keyOrRef);
    }
    // return code that assigns values in the external scope to the names that are used internally
    // (same names that were returned by gen.scopeName or gen.scopeValue)
    scopeRefs(scopeName) {
        return this._extScope.scopeRefs(scopeName, this._values);
    }
    scopeCode() {
        return this._extScope.scopeCode(this._values);
    }
    _def(varKind, nameOrPrefix, rhs, constant) {
        const name = this._scope.toName(nameOrPrefix);
        if (rhs !== undefined && constant)
            this._constants[name.str] = rhs;
        this._leafNode(new Def(varKind, name, rhs));
        return name;
    }
    // `const` declaration (`var` in es5 mode)
    const(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
    }
    // `let` declaration with optional assignment (`var` in es5 mode)
    let(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
    }
    // `var` declaration with optional assignment
    var(nameOrPrefix, rhs, _constant) {
        return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
    }
    // assignment code
    assign(lhs, rhs, sideEffects) {
        return this._leafNode(new Assign(lhs, rhs, sideEffects));
    }
    // `+=` code
    add(lhs, rhs) {
        return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));
    }
    // appends passed SafeExpr to code or executes Block
    code(c) {
        if (typeof c == "function")
            c();
        else if (c !== code_1.nil)
            this._leafNode(new AnyCode(c));
        return this;
    }
    // returns code for object literal for the passed argument list of key-value pairs
    object(...keyValues) {
        const code = ["{"];
        for (const [key, value] of keyValues) {
            if (code.length > 1)
                code.push(",");
            code.push(key);
            if (key !== value || this.opts.es5) {
                code.push(":");
                (0, code_1.addCodeArg)(code, value);
            }
        }
        code.push("}");
        return new code_1._Code(code);
    }
    // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
    if(condition, thenBody, elseBody) {
        this._blockNode(new If(condition));
        if (thenBody && elseBody) {
            this.code(thenBody).else().code(elseBody).endIf();
        }
        else if (thenBody) {
            this.code(thenBody).endIf();
        }
        else if (elseBody) {
            throw new Error('CodeGen: "else" body without "then" body');
        }
        return this;
    }
    // `else if` clause - invalid without `if` or after `else` clauses
    elseIf(condition) {
        return this._elseNode(new If(condition));
    }
    // `else` clause - only valid after `if` or `else if` clauses
    else() {
        return this._elseNode(new Else());
    }
    // end `if` statement (needed if gen.if was used only with condition)
    endIf() {
        return this._endBlockNode(If, Else);
    }
    _for(node, forBody) {
        this._blockNode(node);
        if (forBody)
            this.code(forBody).endFor();
        return this;
    }
    // a generic `for` clause (or statement if `forBody` is passed)
    for(iteration, forBody) {
        return this._for(new ForLoop(iteration), forBody);
    }
    // `for` statement for a range of values
    forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
    }
    // `for-of` statement (in es5 mode replace with a normal for loop)
    forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
        const name = this._scope.toName(nameOrPrefix);
        if (this.opts.es5) {
            const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
            return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => {
                this.var(name, (0, code_1._) `${arr}[${i}]`);
                forBody(name);
            });
        }
        return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
    }
    // `for-in` statement.
    // With option `ownProperties` replaced with a `for-of` loop for object keys
    forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
        if (this.opts.ownProperties) {
            return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);
        }
        const name = this._scope.toName(nameOrPrefix);
        return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
    }
    // end `for` loop
    endFor() {
        return this._endBlockNode(For);
    }
    // `label` statement
    label(label) {
        return this._leafNode(new Label(label));
    }
    // `break` statement
    break(label) {
        return this._leafNode(new Break(label));
    }
    // `return` statement
    return(value) {
        const node = new Return();
        this._blockNode(node);
        this.code(value);
        if (node.nodes.length !== 1)
            throw new Error('CodeGen: "return" should have one node');
        return this._endBlockNode(Return);
    }
    // `try` statement
    try(tryBody, catchCode, finallyCode) {
        if (!catchCode && !finallyCode)
            throw new Error('CodeGen: "try" without "catch" and "finally"');
        const node = new Try();
        this._blockNode(node);
        this.code(tryBody);
        if (catchCode) {
            const error = this.name("e");
            this._currNode = node.catch = new Catch(error);
            catchCode(error);
        }
        if (finallyCode) {
            this._currNode = node.finally = new Finally();
            this.code(finallyCode);
        }
        return this._endBlockNode(Catch, Finally);
    }
    // `throw` statement
    throw(error) {
        return this._leafNode(new Throw(error));
    }
    // start self-balancing block
    block(body, nodeCount) {
        this._blockStarts.push(this._nodes.length);
        if (body)
            this.code(body).endBlock(nodeCount);
        return this;
    }
    // end the current self-balancing block
    endBlock(nodeCount) {
        const len = this._blockStarts.pop();
        if (len === undefined)
            throw new Error("CodeGen: not in self-balancing block");
        const toClose = this._nodes.length - len;
        if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
            throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
        }
        this._nodes.length = len;
        return this;
    }
    // `function` heading (or definition if funcBody is passed)
    func(name, args = code_1.nil, async, funcBody) {
        this._blockNode(new Func(name, args, async));
        if (funcBody)
            this.code(funcBody).endFunc();
        return this;
    }
    // end function definition
    endFunc() {
        return this._endBlockNode(Func);
    }
    optimize(n = 1) {
        while (n-- > 0) {
            this._root.optimizeNodes();
            this._root.optimizeNames(this._root.names, this._constants);
        }
    }
    _leafNode(node) {
        this._currNode.nodes.push(node);
        return this;
    }
    _blockNode(node) {
        this._currNode.nodes.push(node);
        this._nodes.push(node);
    }
    _endBlockNode(N1, N2) {
        const n = this._currNode;
        if (n instanceof N1 || (N2 && n instanceof N2)) {
            this._nodes.pop();
            return this;
        }
        throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
    }
    _elseNode(node) {
        const n = this._currNode;
        if (!(n instanceof If)) {
            throw new Error('CodeGen: "else" without "if"');
        }
        this._currNode = n.else = node;
        return this;
    }
    get _root() {
        return this._nodes[0];
    }
    get _currNode() {
        const ns = this._nodes;
        return ns[ns.length - 1];
    }
    set _currNode(node) {
        const ns = this._nodes;
        ns[ns.length - 1] = node;
    }
}
exports.CodeGen = CodeGen;
function addNames(names, from) {
    for (const n in from)
        names[n] = (names[n] || 0) + (from[n] || 0);
    return names;
}
function addExprNames(names, from) {
    return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
}
function optimizeExpr(expr, names, constants) {
    if (expr instanceof code_1.Name)
        return replaceName(expr);
    if (!canOptimize(expr))
        return expr;
    return new code_1._Code(expr._items.reduce((items, c) => {
        if (c instanceof code_1.Name)
            c = replaceName(c);
        if (c instanceof code_1._Code)
            items.push(...c._items);
        else
            items.push(c);
        return items;
    }, []));
    function replaceName(n) {
        const c = constants[n.str];
        if (c === undefined || names[n.str] !== 1)
            return n;
        delete names[n.str];
        return c;
    }
    function canOptimize(e) {
        return (e instanceof code_1._Code &&
            e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));
    }
}
function subtractNames(names, from) {
    for (const n in from)
        names[n] = (names[n] || 0) - (from[n] || 0);
}
function not(x) {
    return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`;
}
exports.not = not;
const andCode = mappend(exports.operators.AND);
// boolean AND (&&) expression with the passed arguments
function and(...args) {
    return args.reduce(andCode);
}
exports.and = and;
const orCode = mappend(exports.operators.OR);
// boolean OR (||) expression with the passed arguments
function or(...args) {
    return args.reduce(orCode);
}
exports.or = or;
function mappend(op) {
    return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);
}
function par(x) {
    return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;
}
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/codegen/index.ts"],"names":[],"mappings":";;;AACA,iCAA8F;AAC9F,mCAAuC;AAEvC,+BAA6F;AAArF,yFAAA,CAAC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AM,OAAO,GAAG,OAAO,CAAC,iBAAS,CAAC,GAAG,CAAC,CAAA;AAEtC,wDAAwD;AACxD,SAAgB,GAAG,CAAC,GAAG,IAAY;IACjC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,CAAC;AAFD,kBAEC;AAED,MAAM,MAAM,GAAG,OAAO,CAAC,iBAAS,CAAC,EAAE,CAAC,CAAA;AAEpC,uDAAuD;AACvD,SAAgB,EAAE,CAAC,GAAG,IAAY;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAFD,gBAEC;AAID,SAAS,OAAO,CAAC,EAAQ;IACvB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,UAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACjF,CAAC;AAED,SAAS,GAAG,CAAC,CAAO;IAClB,OAAO,CAAC,YAAY,WAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,QAAC,EAAA,IAAI,CAAC,GAAG,CAAA;AAC1C,CAAC"}import { Code, Name } from "./code";
interface NameGroup {
    prefix: string;
    index: number;
}
export interface NameValue {
    ref: ValueReference;
    key?: unknown;
    code?: Code;
}
export type ValueReference = unknown;
interface ScopeOptions {
    prefixes?: Set<string>;
    parent?: Scope;
}
interface ValueScopeOptions extends ScopeOptions {
    scope: ScopeStore;
    es5?: boolean;
    lines?: boolean;
}
export type ScopeStore = Record<string, ValueReference[] | undefined>;
type ScopeValues = {
    [Prefix in string]?: Map<unknown, ValueScopeName>;
};
export type ScopeValueSets = {
    [Prefix in string]?: Set<ValueScopeName>;
};
export declare enum UsedValueState {
    Started = 0,
    Completed = 1
}
export type UsedScopeValues = {
    [Prefix in string]?: Map<ValueScopeName, UsedValueState | undefined>;
};
export declare const varKinds: {
    const: Name;
    let: Name;
    var: Name;
};
export declare class Scope {
    protected readonly _names: {
        [Prefix in string]?: NameGroup;
    };
    protected readonly _prefixes?: Set<string>;
    protected readonly _parent?: Scope;
    constructor({ prefixes, parent }?: ScopeOptions);
    toName(nameOrPrefix: Name | string): Name;
    name(prefix: string): Name;
    protected _newName(prefix: string): string;
    private _nameGroup;
}
interface ScopePath {
    property: string;
    itemIndex: number;
}
export declare class ValueScopeName extends Name {
    readonly prefix: string;
    value?: NameValue;
    scopePath?: Code;
    constructor(prefix: string, nameStr: string);
    setValue(value: NameValue, { property, itemIndex }: ScopePath): void;
}
interface VSOptions extends ValueScopeOptions {
    _n: Code;
}
export declare class ValueScope extends Scope {
    protected readonly _values: ScopeValues;
    protected readonly _scope: ScopeStore;
    readonly opts: VSOptions;
    constructor(opts: ValueScopeOptions);
    get(): ScopeStore;
    name(prefix: string): ValueScopeName;
    value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName;
    getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined;
    scopeRefs(scopeName: Name, values?: ScopeValues | ScopeValueSets): Code;
    scopeCode(values?: ScopeValues | ScopeValueSets, usedValues?: UsedScopeValues, getCode?: (n: ValueScopeName) => Code | undefined): Code;
    private _reduceValues;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
const code_1 = require("./code");
class ValueError extends Error {
    constructor(name) {
        super(`CodeGen: "code" for ${name} not defined`);
        this.value = name.value;
    }
}
var UsedValueState;
(function (UsedValueState) {
    UsedValueState[UsedValueState["Started"] = 0] = "Started";
    UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
exports.varKinds = {
    const: new code_1.Name("const"),
    let: new code_1.Name("let"),
    var: new code_1.Name("var"),
};
class Scope {
    constructor({ prefixes, parent } = {}) {
        this._names = {};
        this._prefixes = prefixes;
        this._parent = parent;
    }
    toName(nameOrPrefix) {
        return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
    }
    name(prefix) {
        return new code_1.Name(this._newName(prefix));
    }
    _newName(prefix) {
        const ng = this._names[prefix] || this._nameGroup(prefix);
        return `${prefix}${ng.index++}`;
    }
    _nameGroup(prefix) {
        var _a, _b;
        if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
            throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
        }
        return (this._names[prefix] = { prefix, index: 0 });
    }
}
exports.Scope = Scope;
class ValueScopeName extends code_1.Name {
    constructor(prefix, nameStr) {
        super(nameStr);
        this.prefix = prefix;
    }
    setValue(value, { property, itemIndex }) {
        this.value = value;
        this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;
    }
}
exports.ValueScopeName = ValueScopeName;
const line = (0, code_1._) `\n`;
class ValueScope extends Scope {
    constructor(opts) {
        super(opts);
        this._values = {};
        this._scope = opts.scope;
        this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
    }
    get() {
        return this._scope;
    }
    name(prefix) {
        return new ValueScopeName(prefix, this._newName(prefix));
    }
    value(nameOrPrefix, value) {
        var _a;
        if (value.ref === undefined)
            throw new Error("CodeGen: ref must be passed in value");
        const name = this.toName(nameOrPrefix);
        const { prefix } = name;
        const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
        let vs = this._values[prefix];
        if (vs) {
            const _name = vs.get(valueKey);
            if (_name)
                return _name;
        }
        else {
            vs = this._values[prefix] = new Map();
        }
        vs.set(valueKey, name);
        const s = this._scope[prefix] || (this._scope[prefix] = []);
        const itemIndex = s.length;
        s[itemIndex] = value.ref;
        name.setValue(value, { property: prefix, itemIndex });
        return name;
    }
    getValue(prefix, keyOrRef) {
        const vs = this._values[prefix];
        if (!vs)
            return;
        return vs.get(keyOrRef);
    }
    scopeRefs(scopeName, values = this._values) {
        return this._reduceValues(values, (name) => {
            if (name.scopePath === undefined)
                throw new Error(`CodeGen: name "${name}" has no value`);
            return (0, code_1._) `${scopeName}${name.scopePath}`;
        });
    }
    scopeCode(values = this._values, usedValues, getCode) {
        return this._reduceValues(values, (name) => {
            if (name.value === undefined)
                throw new Error(`CodeGen: name "${name}" has no value`);
            return name.value.code;
        }, usedValues, getCode);
    }
    _reduceValues(values, valueCode, usedValues = {}, getCode) {
        let code = code_1.nil;
        for (const prefix in values) {
            const vs = values[prefix];
            if (!vs)
                continue;
            const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
            vs.forEach((name) => {
                if (nameSet.has(name))
                    return;
                nameSet.set(name, UsedValueState.Started);
                let c = valueCode(name);
                if (c) {
                    const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
                    code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;
                }
                else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
                    code = (0, code_1._) `${code}${c}${this.opts._n}`;
                }
                else {
                    throw new ValueError(name);
                }
                nameSet.set(name, UsedValueState.Completed);
            });
        }
        return code;
    }
}
exports.ValueScope = ValueScope;
//# sourceMappingURL=scope.js.map{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../lib/compile/codegen/scope.ts"],"names":[],"mappings":";;;AAAA,iCAAyC;AAezC,MAAM,UAAW,SAAQ,KAAK;IAE5B,YAAY,IAAoB;QAC9B,KAAK,CAAC,uBAAuB,IAAI,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;IACzB,CAAC;CACF;AAuBD,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,yDAAO,CAAA;IACP,6DAAS,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CAAC,IAAI,CAAC,CAAA;gBACvB,IAAI,CAAC,EAAE,CAAC;oBACN,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAQ,CAAC,KAAK,CAAA;oBACzD,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;gBACxD,CAAC;qBAAM,IAAI,CAAC,CAAC,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC,EAAE,CAAC;oBACjC,IAAI,GAAG,IAAA,QAAC,EAAA,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAA;gBACtC,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;gBAC5B,CAAC;gBACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;YAC7C,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAjGD,gCAiGC"}import type { KeywordErrorCxt, KeywordErrorDefinition } from "../types";
import { CodeGen, Code, Name } from "./codegen";
export declare const keywordError: KeywordErrorDefinition;
export declare const keyword$DataError: KeywordErrorDefinition;
export interface ErrorPaths {
    instancePath?: Code;
    schemaPath?: string;
    parentSchema?: boolean;
}
export declare function reportError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths, overrideAllErrors?: boolean): void;
export declare function reportExtraError(cxt: KeywordErrorCxt, error?: KeywordErrorDefinition, errorPaths?: ErrorPaths): void;
export declare function resetErrorsCount(gen: CodeGen, errsCount: Name): void;
export declare function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }: KeywordErrorCxt): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
const codegen_1 = require("./codegen");
const util_1 = require("./util");
const names_1 = require("./names");
exports.keywordError = {
    message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
};
exports.keyword$DataError = {
    message: ({ keyword, schemaType }) => schemaType
        ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
        : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
};
function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
    const { it } = cxt;
    const { gen, compositeRule, allErrors } = it;
    const errObj = errorObjectCode(cxt, error, errorPaths);
    if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
        addError(gen, errObj);
    }
    else {
        returnErrors(it, (0, codegen_1._) `[${errObj}]`);
    }
}
exports.reportError = reportError;
function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
    const { it } = cxt;
    const { gen, compositeRule, allErrors } = it;
    const errObj = errorObjectCode(cxt, error, errorPaths);
    addError(gen, errObj);
    if (!(compositeRule || allErrors)) {
        returnErrors(it, names_1.default.vErrors);
    }
}
exports.reportExtraError = reportExtraError;
function resetErrorsCount(gen, errsCount) {
    gen.assign(names_1.default.errors, errsCount);
    gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
}
exports.resetErrorsCount = resetErrorsCount;
function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
    /* istanbul ignore if */
    if (errsCount === undefined)
        throw new Error("ajv implementation error");
    const err = gen.name("err");
    gen.forRange("i", errsCount, names_1.default.errors, (i) => {
        gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
        gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
        gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
        if (it.opts.verbose) {
            gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
            gen.assign((0, codegen_1._) `${err}.data`, data);
        }
    });
}
exports.extendErrors = extendErrors;
function addError(gen, errObj) {
    const err = gen.const("err", errObj);
    gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
    gen.code((0, codegen_1._) `${names_1.default.errors}++`);
}
function returnErrors(it, errs) {
    const { gen, validateName, schemaEnv } = it;
    if (schemaEnv.$async) {
        gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
        gen.return(false);
    }
}
const E = {
    keyword: new codegen_1.Name("keyword"),
    schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
    params: new codegen_1.Name("params"),
    propertyName: new codegen_1.Name("propertyName"),
    message: new codegen_1.Name("message"),
    schema: new codegen_1.Name("schema"),
    parentSchema: new codegen_1.Name("parentSchema"),
};
function errorObjectCode(cxt, error, errorPaths) {
    const { createErrors } = cxt.it;
    if (createErrors === false)
        return (0, codegen_1._) `{}`;
    return errorObject(cxt, error, errorPaths);
}
function errorObject(cxt, error, errorPaths = {}) {
    const { gen, it } = cxt;
    const keyValues = [
        errorInstancePath(it, errorPaths),
        errorSchemaPath(cxt, errorPaths),
    ];
    extraErrorProps(cxt, error, keyValues);
    return gen.object(...keyValues);
}
function errorInstancePath({ errorPath }, { instancePath }) {
    const instPath = instancePath
        ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
        : errorPath;
    return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
}
function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
    let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
    if (schemaPath) {
        schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
    }
    return [E.schemaPath, schPath];
}
function extraErrorProps(cxt, { params, message }, keyValues) {
    const { keyword, data, schemaValue, it } = cxt;
    const { opts, propertyName, topSchemaRef, schemaPath } = it;
    keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
    if (opts.messages) {
        keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
    }
    if (opts.verbose) {
        keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
    }
    if (propertyName)
        keyValues.push([E.propertyName, propertyName]);
}
//# sourceMappingURL=errors.js.map{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/compile/errors.ts"],"names":[],"mappings":";;;AAEA,uCAAgE;AAEhE,iCAAyC;AACzC,mCAAuB;AAEV,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,cAAc,OAAO,sBAAsB;CACvE,CAAA;AAEY,QAAA,iBAAiB,GAA2B;IACvD,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CACjC,UAAU;QACR,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,qBAAqB,UAAU,UAAU;QACzD,CAAC,CAAC,IAAA,aAAG,EAAA,IAAI,OAAO,8BAA8B;CACnD,CAAA;AAQD,SAAgB,WAAW,CACzB,GAAoB,EACpB,QAAgC,oBAAY,EAC5C,UAAuB,EACvB,iBAA2B;IAE3B,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,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,SAAS,CAAC,IAAI,CACZ,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,CAAC,EACvB,CAAC,CAAC,CAAC,YAAY,EAAE,IAAA,WAAC,EAAA,GAAG,YAAY,GAAG,UAAU,EAAE,CAAC,EACjD,CAAC,eAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CACf,CAAA;IACH,CAAC;IACD,IAAI,YAAY;QAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAClE,CAAC"}import type { AnySchema, AnySchemaObject, AnyValidateFunction, EvaluatedProperties, EvaluatedItems } from "../types";
import type Ajv from "../core";
import type { InstanceOptions } from "../core";
import { CodeGen, Name, Code, ValueScopeName } from "./codegen";
import { LocalRefs } from "./resolve";
import { JSONType } from "./rules";
export type SchemaRefs = {
    [Ref in string]?: SchemaEnv | AnySchema;
};
export interface SchemaCxt {
    readonly gen: CodeGen;
    readonly allErrors?: boolean;
    readonly data: Name;
    readonly parentData: Name;
    readonly parentDataProperty: Code | number;
    readonly dataNames: Name[];
    readonly dataPathArr: (Code | number)[];
    readonly dataLevel: number;
    dataTypes: JSONType[];
    definedProperties: Set<string>;
    readonly topSchemaRef: Code;
    readonly validateName: Name;
    evaluated?: Name;
    readonly ValidationError?: Name;
    readonly schema: AnySchema;
    readonly schemaEnv: SchemaEnv;
    readonly rootId: string;
    baseId: string;
    readonly schemaPath: Code;
    readonly errSchemaPath: string;
    readonly errorPath: Code;
    readonly propertyName?: Name;
    readonly compositeRule?: boolean;
    props?: EvaluatedProperties | Name;
    items?: EvaluatedItems | Name;
    jtdDiscriminator?: string;
    jtdMetadata?: boolean;
    readonly createErrors?: boolean;
    readonly opts: InstanceOptions;
    readonly self: Ajv;
}
export interface SchemaObjCxt extends SchemaCxt {
    readonly schema: AnySchemaObject;
}
interface SchemaEnvArgs {
    readonly schema: AnySchema;
    readonly schemaId?: "$id" | "id";
    readonly root?: SchemaEnv;
    readonly baseId?: string;
    readonly schemaPath?: string;
    readonly localRefs?: LocalRefs;
    readonly meta?: boolean;
}
export declare class SchemaEnv implements SchemaEnvArgs {
    readonly schema: AnySchema;
    readonly schemaId?: "$id" | "id";
    readonly root: SchemaEnv;
    baseId: string;
    schemaPath?: string;
    localRefs?: LocalRefs;
    readonly meta?: boolean;
    readonly $async?: boolean;
    readonly refs: SchemaRefs;
    readonly dynamicAnchors: {
        [Ref in string]?: true;
    };
    validate?: AnyValidateFunction;
    validateName?: ValueScopeName;
    serialize?: (data: unknown) => string;
    serializeName?: ValueScopeName;
    parse?: (data: string) => unknown;
    parseName?: ValueScopeName;
    constructor(env: SchemaEnvArgs);
}
export declare function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv;
export declare function resolveRef(this: Ajv, root: SchemaEnv, baseId: string, ref: string): AnySchema | SchemaEnv | undefined;
export declare function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void;
export declare function resolveSchema(this: Ajv, root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
ref: string): SchemaEnv | undefined;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
const codegen_1 = require("./codegen");
const validation_error_1 = require("../runtime/validation_error");
const names_1 = require("./names");
const resolve_1 = require("./resolve");
const util_1 = require("./util");
const validate_1 = require("./validate");
class SchemaEnv {
    constructor(env) {
        var _a;
        this.refs = {};
        this.dynamicAnchors = {};
        let schema;
        if (typeof env.schema == "object")
            schema = env.schema;
        this.schema = env.schema;
        this.schemaId = env.schemaId;
        this.root = env.root || this;
        this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
        this.schemaPath = env.schemaPath;
        this.localRefs = env.localRefs;
        this.meta = env.meta;
        this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
        this.refs = {};
    }
}
exports.SchemaEnv = SchemaEnv;
// let codeSize = 0
// let nodeCount = 0
// Compiles schema in SchemaEnv
function compileSchema(sch) {
    // TODO refactor - remove compilations
    const _sch = getCompilingSchema.call(this, sch);
    if (_sch)
        return _sch;
    const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails
    const { es5, lines } = this.opts.code;
    const { ownProperties } = this.opts;
    const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
    let _ValidationError;
    if (sch.$async) {
        _ValidationError = gen.scopeValue("Error", {
            ref: validation_error_1.default,
            code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`,
        });
    }
    const validateName = gen.scopeName("validate");
    sch.validateName = validateName;
    const schemaCxt = {
        gen,
        allErrors: this.opts.allErrors,
        data: names_1.default.data,
        parentData: names_1.default.parentData,
        parentDataProperty: names_1.default.parentDataProperty,
        dataNames: [names_1.default.data],
        dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?
        dataLevel: 0,
        dataTypes: [],
        definedProperties: new Set(),
        topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
            ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }
            : { ref: sch.schema }),
        validateName,
        ValidationError: _ValidationError,
        schema: sch.schema,
        schemaEnv: sch,
        rootId,
        baseId: sch.baseId || rootId,
        schemaPath: codegen_1.nil,
        errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
        errorPath: (0, codegen_1._) `""`,
        opts: this.opts,
        self: this,
    };
    let sourceCode;
    try {
        this._compilations.add(sch);
        (0, validate_1.validateFunctionCode)(schemaCxt);
        gen.optimize(this.opts.code.optimize);
        // gen.optimize(1)
        const validateCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
        // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
        if (this.opts.code.process)
            sourceCode = this.opts.code.process(sourceCode, sch);
        // console.log("\n\n\n *** \n", sourceCode)
        const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
        const validate = makeValidate(this, this.scope.get());
        this.scope.value(validateName, { ref: validate });
        validate.errors = null;
        validate.schema = sch.schema;
        validate.schemaEnv = sch;
        if (sch.$async)
            validate.$async = true;
        if (this.opts.code.source === true) {
            validate.source = { validateName, validateCode, scopeValues: gen._values };
        }
        if (this.opts.unevaluated) {
            const { props, items } = schemaCxt;
            validate.evaluated = {
                props: props instanceof codegen_1.Name ? undefined : props,
                items: items instanceof codegen_1.Name ? undefined : items,
                dynamicProps: props instanceof codegen_1.Name,
                dynamicItems: items instanceof codegen_1.Name,
            };
            if (validate.source)
                validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
        }
        sch.validate = validate;
        return sch;
    }
    catch (e) {
        delete sch.validate;
        delete sch.validateName;
        if (sourceCode)
            this.logger.error("Error compiling schema, function code:", sourceCode);
        // console.log("\n\n\n *** \n", sourceCode, this.opts)
        throw e;
    }
    finally {
        this._compilations.delete(sch);
    }
}
exports.compileSchema = compileSchema;
function resolveRef(root, baseId, ref) {
    var _a;
    ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
    const schOrFunc = root.refs[ref];
    if (schOrFunc)
        return schOrFunc;
    let _sch = resolve.call(this, root, ref);
    if (_sch === undefined) {
        const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
        const { schemaId } = this.opts;
        if (schema)
            _sch = new SchemaEnv({ schema, schemaId, root, baseId });
    }
    if (_sch === undefined)
        return;
    return (root.refs[ref] = inlineOrCompile.call(this, _sch));
}
exports.resolveRef = resolveRef;
function inlineOrCompile(sch) {
    if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
        return sch.schema;
    return sch.validate ? sch : compileSchema.call(this, sch);
}
// Index of schema compilation in the currently compiled list
function getCompilingSchema(schEnv) {
    for (const sch of this._compilations) {
        if (sameSchemaEnv(sch, schEnv))
            return sch;
    }
}
exports.getCompilingSchema = getCompilingSchema;
function sameSchemaEnv(s1, s2) {
    return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
}
// resolve and compile the references ($ref)
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
function resolve(root, // information about the root schema for the current schema
ref // reference to resolve
) {
    let sch;
    while (typeof (sch = this.refs[ref]) == "string")
        ref = sch;
    return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
}
// Resolve schema, its root and baseId
function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
ref // reference to resolve
) {
    const p = this.opts.uriResolver.parse(ref);
    const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
    let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);
    // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
    if (Object.keys(root.schema).length > 0 && refPath === baseId) {
        return getJsonPointer.call(this, p, root);
    }
    const id = (0, resolve_1.normalizeId)(refPath);
    const schOrRef = this.refs[id] || this.schemas[id];
    if (typeof schOrRef == "string") {
        const sch = resolveSchema.call(this, root, schOrRef);
        if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
            return;
        return getJsonPointer.call(this, p, sch);
    }
    if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
        return;
    if (!schOrRef.validate)
        compileSchema.call(this, schOrRef);
    if (id === (0, resolve_1.normalizeId)(ref)) {
        const { schema } = schOrRef;
        const { schemaId } = this.opts;
        const schId = schema[schemaId];
        if (schId)
            baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        return new SchemaEnv({ schema, schemaId, root, baseId });
    }
    return getJsonPointer.call(this, p, schOrRef);
}
exports.resolveSchema = resolveSchema;
const PREVENT_SCOPE_CHANGE = new Set([
    "properties",
    "patternProperties",
    "enum",
    "dependencies",
    "definitions",
]);
function getJsonPointer(parsedRef, { baseId, schema, root }) {
    var _a;
    if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
        return;
    for (const part of parsedRef.fragment.slice(1).split("/")) {
        if (typeof schema === "boolean")
            return;
        const partSchema = schema[(0, util_1.unescapeFragment)(part)];
        if (partSchema === undefined)
            return;
        schema = partSchema;
        // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
        const schId = typeof schema === "object" && schema[this.opts.schemaId];
        if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
            baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
        }
    }
    let env;
    if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
        const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
        env = resolveSchema.call(this, root, $ref);
    }
    // even though resolution failed we need to return SchemaEnv to throw exception
    // so that compileAsync loads missing schema.
    const { schemaId } = this.opts;
    env = env || new SchemaEnv({ schema, schemaId, root, baseId });
    if (env.schema !== env.root.schema)
        return env;
    return undefined;
}
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/compile/index.ts"],"names":[],"mappings":";;;AAUA,uCAAgF;AAChF,kEAAyD;AACzD,mCAAuB;AACvB,uCAAkG;AAClG,iCAA6D;AAC7D,yCAA+C;AA0D/C,MAAa,SAAS;IAkBpB,YAAY,GAAkB;;QATrB,SAAI,GAAe,EAAE,CAAA;QACrB,mBAAc,GAA6B,EAAE,CAAA;QASpD,IAAI,MAAmC,CAAA;QACvC,IAAI,OAAO,GAAG,CAAC,MAAM,IAAI,QAAQ;YAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACtD,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACxB,IAAI,CAAC,QAAQ,G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AAI,MAAM,CAAC,IAAI,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3F,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QACnE,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAC5C,CAAC;IACD,+EAA+E;IAC/E,6CAA6C;IAC7C,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,GAAG,GAAG,GAAG,IAAI,IAAI,SAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAC,CAAC,CAAA;IAC5D,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,GAAG,CAAA;IAC9C,OAAO,SAAS,CAAA;AAClB,CAAC"}import type Ajv from "../../core";
import { SchemaObjectMap } from "./types";
import { SchemaEnv } from "..";
export default function compileParser(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("./types");
const __1 = require("..");
const codegen_1 = require("../codegen");
const ref_error_1 = require("../ref_error");
const names_1 = require("../names");
const code_1 = require("../../vocabularies/code");
const ref_1 = require("../../vocabularies/jtd/ref");
const type_1 = require("../../vocabularies/jtd/type");
const parseJson_1 = require("../../runtime/parseJson");
const util_1 = require("../util");
const timestamp_1 = require("../../runtime/timestamp");
const genParse = {
    elements: parseElements,
    values: parseValues,
    discriminator: parseDiscriminator,
    properties: parseProperties,
    optionalProperties: parseProperties,
    enum: parseEnum,
    type: parseType,
    ref: parseRef,
};
function compileParser(sch, definitions) {
    const _sch = __1.getCompilingSchema.call(this, sch);
    if (_sch)
        return _sch;
    const { es5, lines } = this.opts.code;
    const { ownProperties } = this.opts;
    const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
    const parseName = gen.scopeName("parse");
    const cxt = {
        self: this,
        gen,
        schema: sch.schema,
        schemaEnv: sch,
        definitions,
        data: names_1.default.data,
        parseName,
        char: gen.name("c"),
    };
    let sourceCode;
    try {
        this._compilations.add(sch);
        sch.parseName = parseName;
        parserFunction(cxt);
        gen.optimize(this.opts.code.optimize);
        const parseFuncCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`;
        const makeParse = new Function(`${names_1.default.scope}`, sourceCode);
        const parse = makeParse(this.scope.get());
        this.scope.value(parseName, { ref: parse });
        sch.parse = parse;
    }
    catch (e) {
        if (sourceCode)
            this.logger.error("Error compiling parser, function code:", sourceCode);
        delete sch.parse;
        delete sch.parseName;
        throw e;
    }
    finally {
        this._compilations.delete(sch);
    }
    return sch;
}
exports.default = compileParser;
const undef = (0, codegen_1._) `undefined`;
function parserFunction(cxt) {
    const { gen, parseName, char } = cxt;
    gen.func(parseName, (0, codegen_1._) `${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => {
        gen.let(names_1.default.data);
        gen.let(char);
        gen.assign((0, codegen_1._) `${parseName}.message`, undef);
        gen.assign((0, codegen_1._) `${parseName}.position`, undef);
        gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${names_1.default.jsonPos} || 0`);
        gen.const(names_1.default.jsonLen, (0, codegen_1._) `${names_1.default.json}.length`);
        parseCode(cxt);
        skipWhitespace(cxt);
        gen.if(names_1.default.jsonPart, () => {
            gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos);
            gen.return(names_1.default.data);
        });
        gen.if((0, codegen_1._) `${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen.return(names_1.default.data));
        jsonSyntaxError(cxt);
    });
}
function parseCode(cxt) {
    let form;
    for (const key of types_1.jtdForms) {
        if (key in cxt.schema) {
            form = key;
            break;
        }
    }
    if (form)
        parseNullable(cxt, genParse[form]);
    else
        parseEmpty(cxt);
}
const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError));
function parseNullable(cxt, parseForm) {
    const { gen, schema, data } = cxt;
    if (!schema.nullable)
        return parseForm(cxt);
    tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null));
}
function parseElements(cxt) {
    const { gen, schema, data } = cxt;
    parseToken(cxt, "[");
    const ix = gen.let("i", 0);
    gen.assign(data, (0, codegen_1._) `[]`);
    parseItems(cxt, "]", () => {
        const el = gen.let("el");
        parseCode({ ...cxt, schema: schema.elements, data: el });
        gen.assign((0, codegen_1._) `${data}[${ix}++]`, el);
    });
}
function parseValues(cxt) {
    const { gen, schema, data } = cxt;
    parseToken(cxt, "{");
    gen.assign(data, (0, codegen_1._) `{}`);
    parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values));
}
function parseItems(cxt, endToken, block) {
    tryParseItems(cxt, endToken, block);
    parseToken(cxt, endToken);
}
function tryParseItems(cxt, endToken, block) {
    const { gen } = cxt;
    gen.for((0, codegen_1._) `;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => {
        block();
        tryParseToken(cxt, ",", () => gen.break(), hasItem);
    });
    function hasItem() {
        tryParseToken(cxt, endToken, () => { }, jsonSyntaxError);
    }
}
function parseKeyValue(cxt, schema) {
    const { gen } = cxt;
    const key = gen.let("key");
    parseString({ ...cxt, data: key });
    parseToken(cxt, ":");
    parsePropertyValue(cxt, key, schema);
}
function parseDiscriminator(cxt) {
    const { gen, data, schema } = cxt;
    const { discriminator, mapping } = schema;
    parseToken(cxt, "{");
    gen.assign(data, (0, codegen_1._) `{}`);
    const startPos = gen.const("pos", names_1.default.jsonPos);
    const value = gen.let("value");
    const tag = gen.let("tag");
    tryParseItems(cxt, "}", () => {
        const key = gen.let("key");
        parseString({ ...cxt, data: key });
        parseToken(cxt, ":");
        gen.if((0, codegen_1._) `${key} === ${discriminator}`, () => {
            parseString({ ...cxt, data: tag });
            gen.assign((0, codegen_1._) `${data}[${key}]`, tag);
            gen.break();
        }, () => parseEmpty({ ...cxt, data: value }) // can be discarded/skipped
        );
    });
    gen.assign(names_1.default.jsonPos, startPos);
    gen.if((0, codegen_1._) `${tag} === undefined`);
    parsingError(cxt, (0, codegen_1.str) `discriminator tag not found`);
    for (const tagValue in mapping) {
        gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
        parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator);
    }
    gen.else();
    parsingError(cxt, (0, codegen_1.str) `discriminator value not in schema`);
    gen.endIf();
}
function parseProperties(cxt) {
    const { gen, data } = cxt;
    parseToken(cxt, "{");
    gen.assign(data, (0, codegen_1._) `{}`);
    parseSchemaProperties(cxt);
}
function parseSchemaProperties(cxt, discriminator) {
    const { gen, schema, data } = cxt;
    const { properties, optionalProperties, additionalProperties } = schema;
    parseItems(cxt, "}", () => {
        const key = gen.let("key");
        parseString({ ...cxt, data: key });
        parseToken(cxt, ":");
        gen.if(false);
        parseDefinedProperty(cxt, key, properties);
        parseDefinedProperty(cxt, key, optionalProperties);
        if (discriminator) {
            gen.elseIf((0, codegen_1._) `${key} === ${discriminator}`);
            const tag = gen.let("tag");
            parseString({ ...cxt, data: tag }); // can be discarded, it is already assigned
        }
        gen.else();
        if (additionalProperties) {
            parseEmpty({ ...cxt, data: (0, codegen_1._) `${data}[${key}]` });
        }
        else {
            parsingError(cxt, (0, codegen_1.str) `property ${key} not allowed`);
        }
        gen.endIf();
    });
    if (properties) {
        const hasProp = (0, code_1.hasPropFunc)(gen);
        const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._) `${hasProp}.call(${data}, ${p})`));
        gen.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str) `missing required properties`));
    }
}
function parseDefinedProperty(cxt, key, schemas = {}) {
    const { gen } = cxt;
    for (const prop in schemas) {
        gen.elseIf((0, codegen_1._) `${key} === ${prop}`);
        parsePropertyValue(cxt, key, schemas[prop]);
    }
}
function parsePropertyValue(cxt, key, schema) {
    parseCode({ ...cxt, schema, data: (0, codegen_1._) `${cxt.data}[${key}]` });
}
function parseType(cxt) {
    const { gen, schema, data, self } = cxt;
    switch (schema.type) {
        case "boolean":
            parseBoolean(cxt);
            break;
        case "string":
            parseString(cxt);
            break;
        case "timestamp": {
            parseString(cxt);
            const vts = (0, util_1.useFunc)(gen, timestamp_1.default);
            const { allowDate, parseDate } = self.opts;
            const notValid = allowDate ? (0, codegen_1._) `!${vts}(${data}, true)` : (0, codegen_1._) `!${vts}(${data})`;
            const fail = parseDate
                ? (0, codegen_1.or)(notValid, (0, codegen_1._) `(${data} = new Date(${data}), false)`, (0, codegen_1._) `isNaN(${data}.valueOf())`)
                : notValid;
            gen.if(fail, () => parsingError(cxt, (0, codegen_1.str) `invalid timestamp`));
            break;
        }
        case "float32":
        case "float64":
            parseNumber(cxt);
            break;
        default: {
            const t = schema.type;
            if (!self.opts.int32range && (t === "int32" || t === "uint32")) {
                parseNumber(cxt, 16); // 2 ** 53 - max safe integer
                if (t === "uint32") {
                    gen.if((0, codegen_1._) `${data} < 0`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`));
                }
            }
            else {
                const [min, max, maxDigits] = type_1.intRange[t];
                parseNumber(cxt, maxDigits);
                gen.if((0, codegen_1._) `${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str) `integer out of range`));
            }
        }
    }
}
function parseString(cxt) {
    parseToken(cxt, '"');
    parseWith(cxt, parseJson_1.parseJsonString);
}
function parseEnum(cxt) {
    const { gen, data, schema } = cxt;
    const enumSch = schema.enum;
    parseToken(cxt, '"');
    // TODO loopEnum
    gen.if(false);
    for (const value of enumSch) {
        const valueStr = JSON.stringify(value).slice(1); // remove starting quote
        gen.elseIf((0, codegen_1._) `${jsonSlice(valueStr.length)} === ${valueStr}`);
        gen.assign(data, (0, codegen_1.str) `${value}`);
        gen.add(names_1.default.jsonPos, valueStr.length);
    }
    gen.else();
    jsonSyntaxError(cxt);
    gen.endIf();
}
function parseNumber(cxt, maxDigits) {
    const { gen } = cxt;
    skipWhitespace(cxt);
    gen.if((0, codegen_1._) `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits));
}
function parseBooleanToken(bool, fail) {
    return (cxt) => {
        const { gen, data } = cxt;
        tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool));
    };
}
function parseRef(cxt) {
    const { gen, self, definitions, schema, schemaEnv } = cxt;
    const { ref } = schema;
    const refSchema = definitions[ref];
    if (!refSchema)
        throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`);
    if (!(0, ref_1.hasRef)(refSchema))
        return parseCode({ ...cxt, schema: refSchema });
    const { root } = schemaEnv;
    const sch = compileParser.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
    partialParse(cxt, getParser(gen, sch), true);
}
function getParser(gen, sch) {
    return sch.parse
        ? gen.scopeValue("parse", { ref: sch.parse })
        : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.parse`;
}
function parseEmpty(cxt) {
    parseWith(cxt, parseJson_1.parseJson);
}
function parseWith(cxt, parseFunc, args) {
    partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args);
}
function partialParse(cxt, parseFunc, args) {
    const { gen, data } = cxt;
    gen.assign(data, (0, codegen_1._) `${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._) `, ${args}` : codegen_1.nil})`);
    gen.assign(names_1.default.jsonPos, (0, codegen_1._) `${parseFunc}.position`);
    gen.if((0, codegen_1._) `${data} === undefined`, () => parsingError(cxt, (0, codegen_1._) `${parseFunc}.message`));
}
function parseToken(cxt, tok) {
    tryParseToken(cxt, tok, jsonSyntaxError);
}
function tryParseToken(cxt, tok, fail, success) {
    const { gen } = cxt;
    const n = tok.length;
    skipWhitespace(cxt);
    gen.if((0, codegen_1._) `${jsonSlice(n)} === ${tok}`, () => {
        gen.add(names_1.default.jsonPos, n);
        success === null || success === void 0 ? void 0 : success(cxt);
    }, () => fail(cxt));
}
function skipWhitespace({ gen, char: c }) {
    gen.code((0, codegen_1._) `while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`);
}
function jsonSlice(len) {
    return len === 1
        ? (0, codegen_1._) `${names_1.default.json}[${names_1.default.jsonPos}]`
        : (0, codegen_1._) `${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`;
}
function jsonSyntaxError(cxt) {
    parsingError(cxt, (0, codegen_1._) `"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`);
}
function parsingError({ gen, parseName }, msg) {
    gen.assign((0, codegen_1._) `${parseName}.message`, msg);
    gen.assign((0, codegen_1._) `${parseName}.position`, names_1.default.jsonPos);
    gen.return(undef);
}
//# sourceMappingURL=parse.js.map{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../lib/compile/jtd/parse.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAmF;AACnF,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAmD;AACnD,oDAAiD;AACjD,sDAA6D;AAC7D,uDAAmF;AACnF,kCAA+B;AAC/B,uDAAoD;AAIpD,MAAM,QAAQ,GAA+B;IAC3C,QAAQ,EAAE,aAAa;IACvB,MAAM,EAAE,WAAW;IACnB,aAAa,EAAE,kBAAkB;IACjC,UAAU,EAAE,eAAe;IAC3B,kBAAkB,EAAE,eAAe;IACnC,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,QAAQ;CACd,CAAA;AAaD,SAAwB,aAAa,CAEnC,GAAc,EACd,WAA4B;IAE5B,MA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AC,OAAO,KAAK,CAC7G,CAAA;AACH,CAAC;AAED,SAAS,SAAS,CAAC,GAAkB;IACnC,OAAO,GAAG,KAAK,CAAC;QACd,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG;QAC5B,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,IAAI,UAAU,eAAC,CAAC,OAAO,KAAK,eAAC,CAAC,OAAO,IAAI,GAAG,GAAG,CAAA;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,GAAa;IACpC,YAAY,CAAC,GAAG,EAAE,IAAA,WAAC,EAAA,yBAAyB,eAAC,CAAC,IAAI,IAAI,eAAC,CAAC,OAAO,GAAG,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,YAAY,CAAC,EAAC,GAAG,EAAE,SAAS,EAAW,EAAE,GAAS;IACzD,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,UAAU,EAAE,GAAG,CAAC,CAAA;IACxC,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,SAAS,WAAW,EAAE,eAAC,CAAC,OAAO,CAAC,CAAA;IAC/C,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACnB,CAAC"}import type Ajv from "../../core";
import { SchemaObjectMap } from "./types";
import { SchemaEnv } from "..";
export default function compileSerializer(this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap): SchemaEnv;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("./types");
const __1 = require("..");
const codegen_1 = require("../codegen");
const ref_error_1 = require("../ref_error");
const names_1 = require("../names");
const code_1 = require("../../vocabularies/code");
const ref_1 = require("../../vocabularies/jtd/ref");
const util_1 = require("../util");
const quote_1 = require("../../runtime/quote");
const genSerialize = {
    elements: serializeElements,
    values: serializeValues,
    discriminator: serializeDiscriminator,
    properties: serializeProperties,
    optionalProperties: serializeProperties,
    enum: serializeString,
    type: serializeType,
    ref: serializeRef,
};
function compileSerializer(sch, definitions) {
    const _sch = __1.getCompilingSchema.call(this, sch);
    if (_sch)
        return _sch;
    const { es5, lines } = this.opts.code;
    const { ownProperties } = this.opts;
    const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
    const serializeName = gen.scopeName("serialize");
    const cxt = {
        self: this,
        gen,
        schema: sch.schema,
        schemaEnv: sch,
        definitions,
        data: names_1.default.data,
    };
    let sourceCode;
    try {
        this._compilations.add(sch);
        sch.serializeName = serializeName;
        gen.func(serializeName, names_1.default.data, false, () => {
            gen.let(names_1.default.json, (0, codegen_1.str) ``);
            serializeCode(cxt);
            gen.return(names_1.default.json);
        });
        gen.optimize(this.opts.code.optimize);
        const serializeFuncCode = gen.toString();
        sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`;
        const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode);
        const serialize = makeSerialize(this.scope.get());
        this.scope.value(serializeName, { ref: serialize });
        sch.serialize = serialize;
    }
    catch (e) {
        if (sourceCode)
            this.logger.error("Error compiling serializer, function code:", sourceCode);
        delete sch.serialize;
        delete sch.serializeName;
        throw e;
    }
    finally {
        this._compilations.delete(sch);
    }
    return sch;
}
exports.default = compileSerializer;
function serializeCode(cxt) {
    let form;
    for (const key of types_1.jtdForms) {
        if (key in cxt.schema) {
            form = key;
            break;
        }
    }
    serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty);
}
function serializeNullable(cxt, serializeForm) {
    const { gen, schema, data } = cxt;
    if (!schema.nullable)
        return serializeForm(cxt);
    gen.if((0, codegen_1._) `${data} === undefined || ${data} === null`, () => gen.add(names_1.default.json, (0, codegen_1._) `"null"`), () => serializeForm(cxt));
}
function serializeElements(cxt) {
    const { gen, schema, data } = cxt;
    gen.add(names_1.default.json, (0, codegen_1.str) `[`);
    const first = gen.let("first", true);
    gen.forOf("el", data, (el) => {
        addComma(cxt, first);
        serializeCode({ ...cxt, schema: schema.elements, data: el });
    });
    gen.add(names_1.default.json, (0, codegen_1.str) `]`);
}
function serializeValues(cxt) {
    const { gen, schema, data } = cxt;
    gen.add(names_1.default.json, (0, codegen_1.str) `{`);
    const first = gen.let("first", true);
    gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first));
    gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeKeyValue(cxt, key, schema, first) {
    const { gen, data } = cxt;
    addComma(cxt, first);
    serializeString({ ...cxt, data: key });
    gen.add(names_1.default.json, (0, codegen_1.str) `:`);
    const value = gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`);
    serializeCode({ ...cxt, schema, data: value });
}
function serializeDiscriminator(cxt) {
    const { gen, schema, data } = cxt;
    const { discriminator } = schema;
    gen.add(names_1.default.json, (0, codegen_1.str) `{${JSON.stringify(discriminator)}:`);
    const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(discriminator)}`);
    serializeString({ ...cxt, data: tag });
    gen.if(false);
    for (const tagValue in schema.mapping) {
        gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
        const sch = schema.mapping[tagValue];
        serializeSchemaProperties({ ...cxt, schema: sch }, discriminator);
    }
    gen.endIf();
    gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeProperties(cxt) {
    const { gen } = cxt;
    gen.add(names_1.default.json, (0, codegen_1.str) `{`);
    serializeSchemaProperties(cxt);
    gen.add(names_1.default.json, (0, codegen_1.str) `}`);
}
function serializeSchemaProperties(cxt, discriminator) {
    const { gen, schema, data } = cxt;
    const { properties, optionalProperties } = schema;
    const props = keys(properties);
    const optProps = keys(optionalProperties);
    const allProps = allProperties(props.concat(optProps));
    let first = !discriminator;
    let firstProp;
    for (const key of props) {
        if (first)
            first = false;
        else
            gen.add(names_1.default.json, (0, codegen_1.str) `,`);
        serializeProperty(key, properties[key], keyValue(key));
    }
    if (first)
        firstProp = gen.let("first", true);
    for (const key of optProps) {
        const value = keyValue(key);
        gen.if((0, codegen_1.and)((0, codegen_1._) `${value} !== undefined`, (0, code_1.isOwnProperty)(gen, data, key)), () => {
            addComma(cxt, firstProp);
            serializeProperty(key, optionalProperties[key], value);
        });
    }
    if (schema.additionalProperties) {
        gen.forIn("key", data, (key) => gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp)));
    }
    function keys(ps) {
        return ps ? Object.keys(ps) : [];
    }
    function allProperties(ps) {
        if (discriminator)
            ps.push(discriminator);
        if (new Set(ps).size !== ps.length) {
            throw new Error("JTD: properties/optionalProperties/disciminator overlap");
        }
        return ps;
    }
    function keyValue(key) {
        return gen.const("value", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(key)}`);
    }
    function serializeProperty(key, propSchema, value) {
        gen.add(names_1.default.json, (0, codegen_1.str) `${JSON.stringify(key)}:`);
        serializeCode({ ...cxt, schema: propSchema, data: value });
    }
    function isAdditional(key, ps) {
        return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`)) : true;
    }
}
function serializeType(cxt) {
    const { gen, schema, data } = cxt;
    switch (schema.type) {
        case "boolean":
            gen.add(names_1.default.json, (0, codegen_1._) `${data} ? "true" : "false"`);
            break;
        case "string":
            serializeString(cxt);
            break;
        case "timestamp":
            gen.if((0, codegen_1._) `${data} instanceof Date`, () => gen.add(names_1.default.json, (0, codegen_1._) `'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt));
            break;
        default:
            serializeNumber(cxt);
    }
}
function serializeString({ gen, data }) {
    gen.add(names_1.default.json, (0, codegen_1._) `${(0, util_1.useFunc)(gen, quote_1.default)}(${data})`);
}
function serializeNumber({ gen, data }) {
    gen.add(names_1.default.json, (0, codegen_1._) `"" + ${data}`);
}
function serializeRef(cxt) {
    const { gen, self, data, definitions, schema, schemaEnv } = cxt;
    const { ref } = schema;
    const refSchema = definitions[ref];
    if (!refSchema)
        throw new ref_error_1.default(self.opts.uriResolver, "", ref, `No definition ${ref}`);
    if (!(0, ref_1.hasRef)(refSchema))
        return serializeCode({ ...cxt, schema: refSchema });
    const { root } = schemaEnv;
    const sch = compileSerializer.call(self, new __1.SchemaEnv({ schema: refSchema, root }), definitions);
    gen.add(names_1.default.json, (0, codegen_1._) `${getSerialize(gen, sch)}(${data})`);
}
function getSerialize(gen, sch) {
    return sch.serialize
        ? gen.scopeValue("serialize", { ref: sch.serialize })
        : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.serialize`;
}
function serializeEmpty({ gen, data }) {
    gen.add(names_1.default.json, (0, codegen_1._) `JSON.stringify(${data})`);
}
function addComma({ gen }, first) {
    if (first) {
        gen.if(first, () => gen.assign(first, false), () => gen.add(names_1.default.json, (0, codegen_1.str) `,`));
    }
    else {
        gen.add(names_1.default.json, (0, codegen_1.str) `,`);
    }
}
//# sourceMappingURL=serialize.js.map{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../lib/compile/jtd/serialize.ts"],"names":[],"mappings":";;AAEA,mCAA0D;AAC1D,0BAAgD;AAChD,wCAAwE;AACxE,4CAA0C;AAC1C,oCAAwB;AACxB,kDAAqD;AACrD,oDAAiD;AACjD,kCAA+B;AAC/B,+CAAuC;AAEvC,MAAM,YAAY,GAAkD;IAClE,QAAQ,EAAE,iBAAiB;IAC3B,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,sBAAsB;IACrC,UAAU,EAAE,mBAAmB;IAC/B,kBAAkB,EAAE,mBAAmB;IACvC,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,YAAY;CAClB,CAAA;AAWD,SAAwB,iBAAiB,CAEvC,GAAc,EACd,WAA4B;IAE5B,MAAM,IAAI,GAAG,sBAAkB,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC/C,IAAI,IAAI;QAAE,OAAO,IAAI,CAAA;IACrB,MAAM,EAAC,GAAG,EAAE,KAAK,EAAC,GAAG,IAAI,CAAC,IA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G,CAAC,EAAE,CACJ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9B,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAC9B,CAAA;IACH,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,eAAC,CAAC,IAAI,EAAE,IAAA,aAAG,EAAA,GAAG,CAAC,CAAA;IACzB,CAAC;AACH,CAAC"}import type { SchemaObject } from "../../types";
export type SchemaObjectMap = {
    [Ref in string]?: SchemaObject;
};
export declare const jtdForms: readonly ["elements", "values", "discriminator", "properties", "optionalProperties", "enum", "type", "ref"];
export type JTDForm = (typeof jtdForms)[number];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.jtdForms = void 0;
exports.jtdForms = [
    "elements",
    "values",
    "discriminator",
    "properties",
    "optionalProperties",
    "enum",
    "type",
    "ref",
];
//# sourceMappingURL=types.js.map{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/compile/jtd/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAG;IACtB,UAAU;IACV,QAAQ;IACR,eAAe;IACf,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,MAAM;IACN,KAAK;CACG,CAAA"}import { Name } from "./codegen";
declare const names: {
    data: Name;
    valCxt: Name;
    instancePath: Name;
    parentData: Name;
    parentDataProperty: Name;
    rootData: Name;
    dynamicAnchors: Name;
    vErrors: Name;
    errors: Name;
    this: Name;
    self: Name;
    scope: Name;
    json: Name;
    jsonPos: Name;
    jsonLen: Name;
    jsonPart: Name;
};
export default names;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("./codegen");
const names = {
    // validation function arguments
    data: new codegen_1.Name("data"), // data passed to validation function
    // args passed from referencing schema
    valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
    instancePath: new codegen_1.Name("instancePath"),
    parentData: new codegen_1.Name("parentData"),
    parentDataProperty: new codegen_1.Name("parentDataProperty"),
    rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function
    dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
    // function scoped variables
    vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors
    errors: new codegen_1.Name("errors"), // counter of validation errors
    this: new codegen_1.Name("this"),
    // "globals"
    self: new codegen_1.Name("self"),
    scope: new codegen_1.Name("scope"),
    // JTD serialize/parse name for JSON string and position
    json: new codegen_1.Name("json"),
    jsonPos: new codegen_1.Name("jsonPos"),
    jsonLen: new codegen_1.Name("jsonLen"),
    jsonPart: new codegen_1.Name("jsonPart"),
};
exports.default = names;
//# sourceMappingURL=names.js.map{"version":3,"file":"names.js","sourceRoot":"","sources":["../../lib/compile/names.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAE9B,MAAM,KAAK,GAAG;IACZ,gCAAgC;IAChC,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC,EAAE,qCAAqC;IAC7D,sCAAsC;IACtC,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+FAA+F;IAC3H,YAAY,EAAE,IAAI,cAAI,CAAC,cAAc,CAAC;IACtC,UAAU,EAAE,IAAI,cAAI,CAAC,YAAY,CAAC;IAClC,kBAAkB,EAAE,IAAI,cAAI,CAAC,oBAAoB,CAAC;IAClD,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC,EAAE,2EAA2E;IAC3G,cAAc,EAAE,IAAI,cAAI,CAAC,gBAAgB,CAAC,EAAE,8CAA8C;IAC1F,4BAA4B;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC,EAAE,qCAAqC;IACnE,MAAM,EAAE,IAAI,cAAI,CAAC,QAAQ,CAAC,EAAE,+BAA+B;IAC3D,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,YAAY;IACZ,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,IAAI,cAAI,CAAC,OAAO,CAAC;IACxB,wDAAwD;IACxD,IAAI,EAAE,IAAI,cAAI,CAAC,MAAM,CAAC;IACtB,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,OAAO,EAAE,IAAI,cAAI,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,IAAI,cAAI,CAAC,UAAU,CAAC;CAC/B,CAAA;AAED,kBAAe,KAAK,CAAA"}import type { UriResolver } from "../types";
export default class MissingRefError extends Error {
    readonly missingRef: string;
    readonly missingSchema: string;
    constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const resolve_1 = require("./resolve");
class MissingRefError extends Error {
    constructor(resolver, baseId, ref, msg) {
        super(msg || `can't resolve reference ${ref} from id ${baseId}`);
        this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
        this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
    }
}
exports.default = MissingRefError;
//# sourceMappingURL=ref_error.js.map{"version":3,"file":"ref_error.js","sourceRoot":"","sources":["../../lib/compile/ref_error.ts"],"names":[],"mappings":";;AAAA,uCAA8D;AAG9D,MAAqB,eAAgB,SAAQ,KAAK;IAIhD,YAAY,QAAqB,EAAE,MAAc,EAAE,GAAW,EAAE,GAAY;QAC1E,KAAK,CAAC,GAAG,IAAI,2BAA2B,GAAG,YAAY,MAAM,EAAE,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAU,EAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;QACnD,IAAI,CAAC,aAAa,GAAG,IAAA,qBAAW,EAAC,IAAA,qBAAW,EAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF;AATD,kCASC"}import type { AnySchema, AnySchemaObject, UriResolver } from "../types";
import type Ajv from "../ajv";
import type { URIComponent } from "fast-uri";
export type LocalRefs = {
    [Ref in string]?: AnySchemaObject;
};
export declare function inlineRef(schema: AnySchema, limit?: boolean | number): boolean;
export declare function getFullPath(resolver: UriResolver, id?: string, normalize?: boolean): string;
export declare function _getFullPath(resolver: UriResolver, p: URIComponent): string;
export declare function normalizeId(id: string | undefined): string;
export declare function resolveUrl(resolver: UriResolver, baseId: string, id: string): string;
export declare function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
const util_1 = require("./util");
const equal = require("fast-deep-equal");
const traverse = require("json-schema-traverse");
// TODO refactor to use keyword definitions
const SIMPLE_INLINED = new Set([
    "type",
    "format",
    "pattern",
    "maxLength",
    "minLength",
    "maxProperties",
    "minProperties",
    "maxItems",
    "minItems",
    "maximum",
    "minimum",
    "uniqueItems",
    "multipleOf",
    "required",
    "enum",
    "const",
]);
function inlineRef(schema, limit = true) {
    if (typeof schema == "boolean")
        return true;
    if (limit === true)
        return !hasRef(schema);
    if (!limit)
        return false;
    return countKeys(schema) <= limit;
}
exports.inlineRef = inlineRef;
const REF_KEYWORDS = new Set([
    "$ref",
    "$recursiveRef",
    "$recursiveAnchor",
    "$dynamicRef",
    "$dynamicAnchor",
]);
function hasRef(schema) {
    for (const key in schema) {
        if (REF_KEYWORDS.has(key))
            return true;
        const sch = schema[key];
        if (Array.isArray(sch) && sch.some(hasRef))
            return true;
        if (typeof sch == "object" && hasRef(sch))
            return true;
    }
    return false;
}
function countKeys(schema) {
    let count = 0;
    for (const key in schema) {
        if (key === "$ref")
            return Infinity;
        count++;
        if (SIMPLE_INLINED.has(key))
            continue;
        if (typeof schema[key] == "object") {
            (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));
        }
        if (count === Infinity)
            return Infinity;
    }
    return count;
}
function getFullPath(resolver, id = "", normalize) {
    if (normalize !== false)
        id = normalizeId(id);
    const p = resolver.parse(id);
    return _getFullPath(resolver, p);
}
exports.getFullPath = getFullPath;
function _getFullPath(resolver, p) {
    const serialized = resolver.serialize(p);
    return serialized.split("#")[0] + "#";
}
exports._getFullPath = _getFullPath;
const TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
    return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
}
exports.normalizeId = normalizeId;
function resolveUrl(resolver, baseId, id) {
    id = normalizeId(id);
    return resolver.resolve(baseId, id);
}
exports.resolveUrl = resolveUrl;
const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
function getSchemaRefs(schema, baseId) {
    if (typeof schema == "boolean")
        return {};
    const { schemaId, uriResolver } = this.opts;
    const schId = normalizeId(schema[schemaId] || baseId);
    const baseIds = { "": schId };
    const pathPrefix = getFullPath(uriResolver, schId, false);
    const localRefs = {};
    const schemaRefs = new Set();
    traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
        if (parentJsonPtr === undefined)
            return;
        const fullPath = pathPrefix + jsonPtr;
        let innerBaseId = baseIds[parentJsonPtr];
        if (typeof sch[schemaId] == "string")
            innerBaseId = addRef.call(this, sch[schemaId]);
        addAnchor.call(this, sch.$anchor);
        addAnchor.call(this, sch.$dynamicAnchor);
        baseIds[jsonPtr] = innerBaseId;
        function addRef(ref) {
            // eslint-disable-next-line @typescript-eslint/unbound-method
            const _resolve = this.opts.uriResolver.resolve;
            ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
            if (schemaRefs.has(ref))
                throw ambiguos(ref);
            schemaRefs.add(ref);
            let schOrRef = this.refs[ref];
            if (typeof schOrRef == "string")
                schOrRef = this.refs[schOrRef];
            if (typeof schOrRef == "object") {
                checkAmbiguosRef(sch, schOrRef.schema, ref);
            }
            else if (ref !== normalizeId(fullPath)) {
                if (ref[0] === "#") {
                    checkAmbiguosRef(sch, localRefs[ref], ref);
                    localRefs[ref] = sch;
                }
                else {
                    this.refs[ref] = fullPath;
                }
            }
            return ref;
        }
        function addAnchor(anchor) {
            if (typeof anchor == "string") {
                if (!ANCHOR.test(anchor))
                    throw new Error(`invalid anchor "${anchor}"`);
                addRef.call(this, `#${anchor}`);
            }
        }
    });
    return localRefs;
    function checkAmbiguosRef(sch1, sch2, ref) {
        if (sch2 !== undefined && !equal(sch1, sch2))
            throw ambiguos(ref);
    }
    function ambiguos(ref) {
        return new Error(`reference "${ref}" resolves to more than one schema`);
    }
}
exports.getSchemaRefs = getSchemaRefs;
//# sourceMappingURL=resolve.js.map{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../lib/compile/resolve.ts"],"names":[],"mappings":";;;AAGA,iCAA+B;AAC/B,yCAAwC;AACxC,iDAAgD;AAKhD,2CAA2C;AAC3C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,eAAe;IACf,eAAe;IACf,UAAU;IACV,UAAU;IACV,SAAS;IACT,SAAS;IACT,aAAa;IACb,YAAY;IACZ,UAAU;IACV,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF,SAAgB,SAAS,CAAC,MAAiB,EAAE,QAA0B,IAAI;IACzE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,IAAI,CAAA;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC1C,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,CAAA;AACnC,CAAC;AALD,8BAKC;AAED,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,MAAM;IACN,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,gBA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"../types";
declare const _jsonTypes: readonly ["string", "number", "integer", "boolean", "null", "object", "array"];
export type JSONType = (typeof _jsonTypes)[number];
export declare function isJSONType(x: unknown): x is JSONType;
type ValidationTypes = {
    [K in JSONType]: boolean | RuleGroup | undefined;
};
export interface ValidationRules {
    rules: RuleGroup[];
    post: RuleGroup;
    all: {
        [Key in string]?: boolean | Rule;
    };
    keywords: {
        [Key in string]?: boolean;
    };
    types: ValidationTypes;
}
export interface RuleGroup {
    type?: JSONType;
    rules: Rule[];
}
export interface Rule {
    keyword: string;
    definition: AddedKeywordDefinition;
}
export declare function getRules(): ValidationRules;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRules = exports.isJSONType = void 0;
const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
const jsonTypes = new Set(_jsonTypes);
function isJSONType(x) {
    return typeof x == "string" && jsonTypes.has(x);
}
exports.isJSONType = isJSONType;
function getRules() {
    const groups = {
        number: { type: "number", rules: [] },
        string: { type: "string", rules: [] },
        array: { type: "array", rules: [] },
        object: { type: "object", rules: [] },
    };
    return {
        types: { ...groups, integer: true, boolean: true, null: true },
        rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
        post: { rules: [] },
        all: {},
        keywords: {},
    };
}
exports.getRules = getRules;
//# sourceMappingURL=rules.js.map{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../lib/compile/rules.ts"],"names":[],"mappings":";;;AAEA,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAA;AAIjG,MAAM,SAAS,GAAgB,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;AAElD,SAAgB,UAAU,CAAC,CAAU;IACnC,OAAO,OAAO,CAAC,IAAI,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAFD,gCAEC;AAyBD,SAAgB,QAAQ;IACtB,MAAM,MAAM,GAAgE;QAC1E,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;QACnC,KAAK,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAC;QACjC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAC;KACpC,CAAA;IACD,OAAO;QACL,KAAK,EAAE,EAAC,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC;QAC5D,KAAK,EAAE,CAAC,EAAC,KAAK,EAAE,EAAE,EAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;QAC/E,IAAI,EAAE,EAAC,KAAK,EAAE,EAAE,EAAC;QACjB,GAAG,EAAE,EAAE;QACP,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC;AAdD,4BAcC"}import type { AnySchema, EvaluatedProperties, EvaluatedItems } from "../types";
import type { SchemaCxt, SchemaObjCxt } from ".";
import { Code, Name, CodeGen } from "./codegen";
import type { Rule, ValidationRules } from "./rules";
export declare function toHash<T extends string = string>(arr: T[]): {
    [K in T]?: true;
};
export declare function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void;
export declare function checkUnknownRules(it: SchemaCxt, schema?: AnySchema): void;
export declare function schemaHasRules(schema: AnySchema, rules: {
    [Key in string]?: boolean | Rule;
}): boolean;
export declare function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean;
export declare function schemaRefOrVal({ topSchemaRef, schemaPath }: SchemaObjCxt, schema: unknown, keyword: string, $data?: string | false): Code | number | boolean;
export declare function unescapeFragment(str: string): string;
export declare function escapeFragment(str: string | number): string;
export declare function escapeJsonPointer(str: string | number): string;
export declare function unescapeJsonPointer(str: string): string;
export declare function eachItem<T>(xs: T | T[], f: (x: T) => void): void;
type SomeEvaluated = EvaluatedProperties | EvaluatedItems;
type MergeEvaluatedFunc<T extends SomeEvaluated> = (gen: CodeGen, from: Name | T, to: Name | Exclude<T, true> | undefined, toName?: typeof Name) => Name | T;
interface MergeEvaluated {
    props: MergeEvaluatedFunc<EvaluatedProperties>;
    items: MergeEvaluatedFunc<EvaluatedItems>;
}
export declare const mergeEvaluated: MergeEvaluated;
export declare function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name;
export declare function setEvaluated(gen: CodeGen, props: Name, ps: {
    [K in string]?: true;
}): void;
export declare function useFunc(gen: CodeGen, f: {
    code: string;
}): Name;
export declare enum Type {
    Num = 0,
    Str = 1
}
export declare function getErrorPath(dataProp: Name | string | number, dataPropType?: Type, jsPropertySyntax?: boolean): Code | string;
export declare function checkStrictMode(it: SchemaCxt, msg: string, mode?: boolean | "log"): void;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
const codegen_1 = require("./codegen");
const code_1 = require("./codegen/code");
// TODO refactor to use Set
function toHash(arr) {
    const hash = {};
    for (const item of arr)
        hash[item] = true;
    return hash;
}
exports.toHash = toHash;
function alwaysValidSchema(it, schema) {
    if (typeof schema == "boolean")
        return schema;
    if (Object.keys(schema).length === 0)
        return true;
    checkUnknownRules(it, schema);
    return !schemaHasRules(schema, it.self.RULES.all);
}
exports.alwaysValidSchema = alwaysValidSchema;
function checkUnknownRules(it, schema = it.schema) {
    const { opts, self } = it;
    if (!opts.strictSchema)
        return;
    if (typeof schema === "boolean")
        return;
    const rules = self.RULES.keywords;
    for (const key in schema) {
        if (!rules[key])
            checkStrictMode(it, `unknown keyword: "${key}"`);
    }
}
exports.checkUnknownRules = checkUnknownRules;
function schemaHasRules(schema, rules) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (rules[key])
            return true;
    return false;
}
exports.schemaHasRules = schemaHasRules;
function schemaHasRulesButRef(schema, RULES) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (key !== "$ref" && RULES.all[key])
            return true;
    return false;
}
exports.schemaHasRulesButRef = schemaHasRulesButRef;
function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
    if (!$data) {
        if (typeof schema == "number" || typeof schema == "boolean")
            return schema;
        if (typeof schema == "string")
            return (0, codegen_1._) `${schema}`;
    }
    return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
}
exports.schemaRefOrVal = schemaRefOrVal;
function unescapeFragment(str) {
    return unescapeJsonPointer(decodeURIComponent(str));
}
exports.unescapeFragment = unescapeFragment;
function escapeFragment(str) {
    return encodeURIComponent(escapeJsonPointer(str));
}
exports.escapeFragment = escapeFragment;
function escapeJsonPointer(str) {
    if (typeof str == "number")
        return `${str}`;
    return str.replace(/~/g, "~0").replace(/\//g, "~1");
}
exports.escapeJsonPointer = escapeJsonPointer;
function unescapeJsonPointer(str) {
    return str.replace(/~1/g, "/").replace(/~0/g, "~");
}
exports.unescapeJsonPointer = unescapeJsonPointer;
function eachItem(xs, f) {
    if (Array.isArray(xs)) {
        for (const x of xs)
            f(x);
    }
    else {
        f(xs);
    }
}
exports.eachItem = eachItem;
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
    return (gen, from, to, toName) => {
        const res = to === undefined
            ? from
            : to instanceof codegen_1.Name
                ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
                : from instanceof codegen_1.Name
                    ? (mergeToName(gen, to, from), from)
                    : mergeValues(from, to);
        return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
    };
}
exports.mergeEvaluated = {
    props: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {
            gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));
        }),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {
            if (from === true) {
                gen.assign(to, true);
            }
            else {
                gen.assign(to, (0, codegen_1._) `${to} || {}`);
                setEvaluated(gen, to, from);
            }
        }),
        mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),
        resultToName: evaluatedPropsToName,
    }),
    items: makeMergeEvaluated({
        mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
        mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),
        mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
        resultToName: (gen, items) => gen.var("items", items),
    }),
};
function evaluatedPropsToName(gen, ps) {
    if (ps === true)
        return gen.var("props", true);
    const props = gen.var("props", (0, codegen_1._) `{}`);
    if (ps !== undefined)
        setEvaluated(gen, props, ps);
    return props;
}
exports.evaluatedPropsToName = evaluatedPropsToName;
function setEvaluated(gen, props, ps) {
    Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));
}
exports.setEvaluated = setEvaluated;
const snippets = {};
function useFunc(gen, f) {
    return gen.scopeValue("func", {
        ref: f,
        code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),
    });
}
exports.useFunc = useFunc;
var Type;
(function (Type) {
    Type[Type["Num"] = 0] = "Num";
    Type[Type["Str"] = 1] = "Str";
})(Type || (exports.Type = Type = {}));
function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
    // let path
    if (dataProp instanceof codegen_1.Name) {
        const isNumber = dataPropType === Type.Num;
        return jsPropertySyntax
            ? isNumber
                ? (0, codegen_1._) `"[" + ${dataProp} + "]"`
                : (0, codegen_1._) `"['" + ${dataProp} + "']"`
            : isNumber
                ? (0, codegen_1._) `"/" + ${dataProp}`
                : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
    }
    return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
}
exports.getErrorPath = getErrorPath;
function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
    if (!mode)
        return;
    msg = `strict mode: ${msg}`;
    if (mode === true)
        throw new Error(msg);
    it.self.logger.warn(msg);
}
exports.checkStrictMode = checkStrictMode;
//# sourceMappingURL=util.js.map{"version":3,"file":"util.js","sourceRoot":"","sources":["../../lib/compile/util.ts"],"names":[],"mappings":";;;AAEA,uCAA6D;AAC7D,yCAAoC;AAGpC,2BAA2B;AAC3B,SAAgB,MAAM,CAA4B,GAAQ;IACxD,MAAM,IAAI,GAAsB,EAAE,CAAA;IAClC,KAAK,MAAM,IAAI,IAAI,GAAG;QAAE,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,wBAIC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,MAAiB;IAChE,IAAI,OAAO,MAAM,IAAI,SAAS;QAAE,OAAO,MAAM,CAAA;IAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,C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,CAAC,CAAC,CAAC,GAAG,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAChG,CAAC;AAjBD,oCAiBC;AAED,SAAgB,eAAe,CAC7B,EAAa,EACb,GAAW,EACX,OAAwB,EAAE,CAAC,IAAI,CAAC,YAAY;IAE5C,IAAI,CAAC,IAAI;QAAE,OAAM;IACjB,GAAG,GAAG,gBAAgB,GAAG,EAAE,CAAA;IAC3B,IAAI,IAAI,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,CAAC;AATD,0CASC"}import type { AnySchemaObject } from "../../types";
import type { SchemaObjCxt } from "..";
import type { JSONType, RuleGroup, Rule } from "../rules";
export declare function schemaHasRulesForType({ schema, self }: SchemaObjCxt, type: JSONType): boolean | undefined;
export declare function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean;
export declare function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
function schemaHasRulesForType({ schema, self }, type) {
    const group = self.RULES.types[type];
    return group && group !== true && shouldUseGroup(schema, group);
}
exports.schemaHasRulesForType = schemaHasRulesForType;
function shouldUseGroup(schema, group) {
    return group.rules.some((rule) => shouldUseRule(schema, rule));
}
exports.shouldUseGroup = shouldUseGroup;
function shouldUseRule(schema, rule) {
    var _a;
    return (schema[rule.keyword] !== undefined ||
        ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
}
exports.shouldUseRule = shouldUseRule;
//# sourceMappingURL=applicability.js.map{"version":3,"file":"applicability.js","sourceRoot":"","sources":["../../../lib/compile/validate/applicability.ts"],"names":[],"mappings":";;;AAIA,SAAgB,qBAAqB,CACnC,EAAC,MAAM,EAAE,IAAI,EAAe,EAC5B,IAAc;IAEd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,OAAO,KAAK,IAAI,KAAK,KAAK,IAAI,IAAI,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACjE,CAAC;AAND,sDAMC;AAED,SAAgB,cAAc,CAAC,MAAuB,EAAE,KAAgB;IACtE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;AAChE,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,MAAuB,EAAE,IAAU;;IAC/D,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,SAAS;SAClC,MAAA,IAAI,CAAC,UAAU,CAAC,UAAU,0CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAA,CACrE,CAAA;AACH,CAAC;AALD,sCAKC"}import type { SchemaCxt } from "..";
import { Name } from "../codegen";
export declare function topBoolOrEmptySchema(it: SchemaCxt): void;
export declare function boolOrEmptySchema(it: SchemaCxt, valid: Name): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
const errors_1 = require("../errors");
const codegen_1 = require("../codegen");
const names_1 = require("../names");
const boolError = {
    message: "boolean schema is false",
};
function topBoolOrEmptySchema(it) {
    const { gen, schema, validateName } = it;
    if (schema === false) {
        falseSchemaError(it, false);
    }
    else if (typeof schema == "object" && schema.$async === true) {
        gen.return(names_1.default.data);
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, null);
        gen.return(true);
    }
}
exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
function boolOrEmptySchema(it, valid) {
    const { gen, schema } = it;
    if (schema === false) {
        gen.var(valid, false); // TODO var
        falseSchemaError(it);
    }
    else {
        gen.var(valid, true); // TODO var
    }
}
exports.boolOrEmptySchema = boolOrEmptySchema;
function falseSchemaError(it, overrideAllErrors) {
    const { gen, data } = it;
    // TODO maybe some other interface should be used for non-keyword validation errors...
    const cxt = {
        gen,
        keyword: "false schema",
        data,
        schema: false,
        schemaCode: false,
        schemaValue: false,
        params: {},
        it,
    };
    (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);
}
//# sourceMappingURL=boolSchema.js.map{"version":3,"file":"boolSchema.js","sourceRoot":"","sources":["../../../lib/compile/validate/boolSchema.ts"],"names":[],"mappings":";;;AAEA,sCAAqC;AACrC,wCAAkC;AAClC,oCAAwB;AAExB,MAAM,SAAS,GAA2B;IACxC,OAAO,EAAE,yBAAyB;CACnC,CAAA;AAED,SAAgB,oBAAoB,CAAC,EAAa;IAChD,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAC,GAAG,EAAE,CAAA;IACtC,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,gBAAgB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAA;IAC7B,CAAC;SAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;QAC/D,GAAG,CAAC,MAAM,CAAC,eAAC,CAAC,IAAI,CAAC,CAAA;IACpB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,YAAY,SAAS,EAAE,IAAI,CAAC,CAAA;QAC3C,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;AACH,CAAC;AAVD,oDAUC;AAED,SAAgB,iBAAiB,CAAC,EAAa,EAAE,KAAW;IAC1D,MAAM,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IACxB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA,CAAC,WAAW;QACjC,gBAAgB,CAAC,EAAE,CAAC,CAAA;IACtB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAC,WAAW;IAClC,CAAC;AACH,CAAC;AARD,8CAQC;AAED,SAAS,gBAAgB,CAAC,EAAa,EAAE,iBAA2B;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IACtB,sFAAsF;IACtF,MAAM,GAAG,GAAoB;QAC3B,GAAG;QACH,OAAO,EAAE,cAAc;QACvB,IAAI;QACJ,MAAM,EAAE,KAAK;QACb,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;IACD,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAA;AAC3D,CAAC"}import type { ErrorObject, AnySchemaObject } from "../../types";
import type { SchemaObjCxt } from "..";
import { JSONType } from "../rules";
import { Code, Name } from "../codegen";
export declare enum DataType {
    Correct = 0,
    Wrong = 1
}
export declare function getSchemaTypes(schema: AnySchemaObject): JSONType[];
export declare function getJSONTypes(ts: unknown | unknown[]): JSONType[];
export declare function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean;
export declare function checkDataType(dataType: JSONType, data: Name, strictNums?: boolean | "log", correct?: DataType): Code;
export declare function checkDataTypes(dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType): Code;
export type TypeError = ErrorObject<"type", {
    type: string;
}>;
export declare function reportTypeError(it: SchemaObjCxt): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
const rules_1 = require("../rules");
const applicability_1 = require("./applicability");
const errors_1 = require("../errors");
const codegen_1 = require("../codegen");
const util_1 = require("../util");
var DataType;
(function (DataType) {
    DataType[DataType["Correct"] = 0] = "Correct";
    DataType[DataType["Wrong"] = 1] = "Wrong";
})(DataType || (exports.DataType = DataType = {}));
function getSchemaTypes(schema) {
    const types = getJSONTypes(schema.type);
    const hasNull = types.includes("null");
    if (hasNull) {
        if (schema.nullable === false)
            throw new Error("type: null contradicts nullable: false");
    }
    else {
        if (!types.length && schema.nullable !== undefined) {
            throw new Error('"nullable" cannot be used without "type"');
        }
        if (schema.nullable === true)
            types.push("null");
    }
    return types;
}
exports.getSchemaTypes = getSchemaTypes;
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
function getJSONTypes(ts) {
    const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
    if (types.every(rules_1.isJSONType))
        return types;
    throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
}
exports.getJSONTypes = getJSONTypes;
function coerceAndCheckDataType(it, types) {
    const { gen, data, opts } = it;
    const coerceTo = coerceToTypes(types, opts.coerceTypes);
    const checkTypes = types.length > 0 &&
        !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
    if (checkTypes) {
        const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
        gen.if(wrongType, () => {
            if (coerceTo.length)
                coerceData(it, types, coerceTo);
            else
                reportTypeError(it);
        });
    }
    return checkTypes;
}
exports.coerceAndCheckDataType = coerceAndCheckDataType;
const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
function coerceToTypes(types, coerceTypes) {
    return coerceTypes
        ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
        : [];
}
function coerceData(it, types, coerceTo) {
    const { gen, data, opts } = it;
    const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`);
    const coerced = gen.let("coerced", (0, codegen_1._) `undefined`);
    if (opts.coerceTypes === "array") {
        gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
            .assign(data, (0, codegen_1._) `${data}[0]`)
            .assign(dataType, (0, codegen_1._) `typeof ${data}`)
            .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
    }
    gen.if((0, codegen_1._) `${coerced} !== undefined`);
    for (const t of coerceTo) {
        if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
            coerceSpecificType(t);
        }
    }
    gen.else();
    reportTypeError(it);
    gen.endIf();
    gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
        gen.assign(data, coerced);
        assignParentData(it, coerced);
    });
    function coerceSpecificType(t) {
        switch (t) {
            case "string":
                gen
                    .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`)
                    .assign(coerced, (0, codegen_1._) `"" + ${data}`)
                    .elseIf((0, codegen_1._) `${data} === null`)
                    .assign(coerced, (0, codegen_1._) `""`);
                return;
            case "number":
                gen
                    .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
              || (${dataType} == "string" && ${data} && ${data} == +${data})`)
                    .assign(coerced, (0, codegen_1._) `+${data}`);
                return;
            case "integer":
                gen
                    .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
              || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
                    .assign(coerced, (0, codegen_1._) `+${data}`);
                return;
            case "boolean":
                gen
                    .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
                    .assign(coerced, false)
                    .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
                    .assign(coerced, true);
                return;
            case "null":
                gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
                gen.assign(coerced, null);
                return;
            case "array":
                gen
                    .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
              || ${dataType} === "boolean" || ${data} === null`)
                    .assign(coerced, (0, codegen_1._) `[${data}]`);
        }
    }
}
function assignParentData({ gen, parentData, parentDataProperty }, expr) {
    // TODO use gen.property
    gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
}
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
    const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
    let cond;
    switch (dataType) {
        case "null":
            return (0, codegen_1._) `${data} ${EQ} null`;
        case "array":
            cond = (0, codegen_1._) `Array.isArray(${data})`;
            break;
        case "object":
            cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
            break;
        case "integer":
            cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
            break;
        case "number":
            cond = numCond();
            break;
        default:
            return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
    }
    return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
    function numCond(_cond = codegen_1.nil) {
        return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);
    }
}
exports.checkDataType = checkDataType;
function checkDataTypes(dataTypes, data, strictNums, correct) {
    if (dataTypes.length === 1) {
        return checkDataType(dataTypes[0], data, strictNums, correct);
    }
    let cond;
    const types = (0, util_1.toHash)(dataTypes);
    if (types.array && types.object) {
        const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
        cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
        delete types.null;
        delete types.array;
        delete types.object;
    }
    else {
        cond = codegen_1.nil;
    }
    if (types.number)
        delete types.integer;
    for (const t in types)
        cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
    return cond;
}
exports.checkDataTypes = checkDataTypes;
const typeError = {
    message: ({ schema }) => `must be ${schema}`,
    params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
};
function reportTypeError(it) {
    const cxt = getTypeErrorContext(it);
    (0, errors_1.reportError)(cxt, typeError);
}
exports.reportTypeError = reportTypeError;
function getTypeErrorContext(it) {
    const { gen, data, schema } = it;
    const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
    return {
        gen,
        keyword: "type",
        data,
        schema: schema.type,
        schemaCode,
        schemaValue: schemaCode,
        parentSchema: schema,
        params: {},
        it,
    };
}
//# sourceMappingURL=dataType.js.map{"version":3,"file":"dataType.js","sourceRoot":"","sources":["../../../lib/compile/validate/dataType.ts"],"names":[],"mappings":";;;AAOA,oCAA6C;AAC7C,mDAAqD;AACrD,sCAAqC;AACrC,wCAAkE;AAClE,kCAA8C;AAE9C,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,6CAAO,CAAA;IACP,yCAAK,CAAA;AACP,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAED,SAAgB,cAAc,CAAC,MAAuB;IACpD,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACtC,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,MAAM,CAAC,QAAQ,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IAC1F,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACnD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;QAC7D,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAClD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAZD,wCAYC;AAED,6EAA6E;AAC7E,SAAgB,YAAY,CAAC,EAAuB;IAClD,MAAM,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C,WAAW,MAAM,EAAE;IAC1C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,WAAW,EAAC,EAAE,EAAE,CAChC,OAAO,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,UAAU,MAAM,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,UAAU,WAAW,GAAG;CAC/E,CAAA;AAED,SAAgB,eAAe,CAAC,EAAgB;IAC9C,MAAM,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAA;IACnC,IAAA,oBAAW,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;AAC7B,CAAC;AAHD,0CAGC;AAED,SAAS,mBAAmB,CAAC,EAAgB;IAC3C,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAC,GAAG,EAAE,CAAA;IAC9B,MAAM,UAAU,GAAG,IAAA,qBAAc,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACrD,OAAO;QACL,GAAG;QACH,OAAO,EAAE,MAAM;QACf,IAAI;QACJ,MAAM,EAAE,MAAM,CAAC,IAAI;QACnB,UAAU;QACV,WAAW,EAAE,UAAU;QACvB,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,EAAE;QACV,EAAE;KACH,CAAA;AACH,CAAC"}import type { SchemaObjCxt } from "..";
export declare function assignDefaults(it: SchemaObjCxt, ty?: string): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assignDefaults = void 0;
const codegen_1 = require("../codegen");
const util_1 = require("../util");
function assignDefaults(it, ty) {
    const { properties, items } = it.schema;
    if (ty === "object" && properties) {
        for (const key in properties) {
            assignDefault(it, key, properties[key].default);
        }
    }
    else if (ty === "array" && Array.isArray(items)) {
        items.forEach((sch, i) => assignDefault(it, i, sch.default));
    }
}
exports.assignDefaults = assignDefaults;
function assignDefault(it, prop, defaultValue) {
    const { gen, compositeRule, data, opts } = it;
    if (defaultValue === undefined)
        return;
    const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;
    if (compositeRule) {
        (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
        return;
    }
    let condition = (0, codegen_1._) `${childData} === undefined`;
    if (opts.useDefaults === "empty") {
        condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`;
    }
    // `${childData} === undefined` +
    // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "")
    gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
}
//# sourceMappingURL=defaults.js.map{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../lib/compile/validate/defaults.ts"],"names":[],"mappings":";;;AACA,wCAAoD;AACpD,kCAAuC;AAEvC,SAAgB,cAAc,CAAC,EAAgB,EAAE,EAAW;IAC1D,MAAM,EAAC,UAAU,EAAE,KAAK,EAAC,GAAG,EAAE,CAAC,MAAM,CAAA;IACrC,IAAI,EAAE,KAAK,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC7B,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;SAAM,IAAI,EAAE,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IACtE,CAAC;AACH,CAAC;AATD,wCASC;AAED,SAAS,aAAa,CAAC,EAAgB,EAAE,IAAqB,EAAE,YAAqB;IACnF,MAAM,EAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;IAC3C,IAAI,YAAY,KAAK,SAAS;QAAE,OAAM;IACtC,MAAM,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAI,CAAC,EAAE,CAAA;IAChD,IAAI,aAAa,EAAE,CAAC;QAClB,IAAA,sBAAe,EAAC,EAAE,EAAE,2BAA2B,SAAS,EAAE,CAAC,CAAA;QAC3D,OAAM;IACR,CAAC;IAED,IAAI,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,gBAAgB,CAAA;IAC7C,IAAI,IAAI,CAAC,WAAW,KAAK,OAAO,EAAE,CAAC;QACjC,SAAS,GAAG,IAAA,WAAC,EAAA,GAAG,SAAS,OAAO,SAAS,gBAAgB,SAAS,SAAS,CAAA;IAC7E,CAAC;IACD,iCAAiC;IACjC,2FAA2F;IAC3F,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,IAAA,WAAC,EAAA,GAAG,SAAS,MAAM,IAAA,mBAAS,EAAC,YAAY,CAAC,EAAE,CAAC,CAAA;AACjE,CAAC"}import type { AddedKeywordDefinition, AnySchemaObject, KeywordErrorCxt, KeywordCxtParams } from "../../types";
import type { SchemaCxt, SchemaObjCxt } from "..";
import { SubschemaArgs } from "./subschema";
import { Code, Name, CodeGen } from "../codegen";
import type { JSONType } from "../rules";
import { ErrorPaths } from "../errors";
export declare function validateFunctionCode(it: SchemaCxt): void;
export declare class KeywordCxt implements KeywordErrorCxt {
    readonly gen: CodeGen;
    readonly allErrors?: boolean;
    readonly keyword: string;
    readonly data: Name;
    readonly $data?: string | false;
    schema: any;
    readonly schemaValue: Code | number | boolean;
    readonly schemaCode: Code | number | boolean;
    readonly schemaType: JSONType[];
    readonly parentSchema: AnySchemaObject;
    readonly errsCount?: Name;
    params: KeywordCxtParams;
    readonly it: SchemaObjCxt;
    readonly def: AddedKeywordDefinition;
    constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string);
    result(condition: Code, successAction?: () => void, failAction?: () => void): void;
    failResult(condition: Code, successAction?: () => void, failAction?: () => void): void;
    pass(condition: Code, failAction?: () => void): void;
    fail(condition?: Code): void;
    fail$data(condition: Code): void;
    error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void;
    private _error;
    $dataError(): void;
    reset(): void;
    ok(cond: Code | boolean): void;
    setParams(obj: KeywordCxtParams, assign?: true): void;
    block$data(valid: Name, codeBlock: () => void, $dataValid?: Code): void;
    check$data(valid?: Name, $dataValid?: Code): void;
    invalid$data(): Code;
    subschema(appl: SubschemaArgs, valid: Name): SchemaCxt;
    mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void;
    mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void;
}
export declare function getData($data: string, { dataLevel, dataNames, dataPathArr }: SchemaCxt): Code | number;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
const boolSchema_1 = require("./boolSchema");
const dataType_1 = require("./dataType");
const applicability_1 = require("./applicability");
const dataType_2 = require("./dataType");
const defaults_1 = require("./defaults");
const keyword_1 = require("./keyword");
const subschema_1 = require("./subschema");
const codegen_1 = require("../codegen");
const names_1 = require("../names");
const resolve_1 = require("../resolve");
const util_1 = require("../util");
const errors_1 = require("../errors");
// schema compilation - generates validation function, subschemaCode (below) is used for subschemas
function validateFunctionCode(it) {
    if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
            topSchemaObjCode(it);
            return;
        }
    }
    validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
}
exports.validateFunctionCode = validateFunctionCode;
function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
    if (opts.code.es5) {
        gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
            gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`);
            destructureValCxtES5(gen, opts);
            gen.code(body);
        });
    }
    else {
        gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
    }
}
function destructureValCxt(opts) {
    return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
}
function destructureValCxtES5(gen, opts) {
    gen.if(names_1.default.valCxt, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);
        gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
        gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);
        if (opts.dynamicRef)
            gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
    }, () => {
        gen.var(names_1.default.instancePath, (0, codegen_1._) `""`);
        gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);
        gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);
        gen.var(names_1.default.rootData, names_1.default.data);
        if (opts.dynamicRef)
            gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);
    });
}
function topSchemaObjCode(it) {
    const { schema, opts, gen } = it;
    validateFunction(it, () => {
        if (opts.$comment && schema.$comment)
            commentKeyword(it);
        checkNoDefault(it);
        gen.let(names_1.default.vErrors, null);
        gen.let(names_1.default.errors, 0);
        if (opts.unevaluated)
            resetEvaluated(it);
        typeAndKeywords(it);
        returnResults(it);
    });
    return;
}
function resetEvaluated(it) {
    // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated
    const { gen, validateName } = it;
    it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`);
    gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));
    gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));
}
function funcSourceUrl(schema, opts) {
    const schId = typeof schema == "object" && schema[opts.schemaId];
    return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;
}
// schema compilation - this function is used recursively to generate code for sub-schemas
function subschemaCode(it, valid) {
    if (isSchemaObj(it)) {
        checkKeywords(it);
        if (schemaCxtHasRules(it)) {
            subSchemaObjCode(it, valid);
            return;
        }
    }
    (0, boolSchema_1.boolOrEmptySchema)(it, valid);
}
function schemaCxtHasRules({ schema, self }) {
    if (typeof schema == "boolean")
        return !schema;
    for (const key in schema)
        if (self.RULES.all[key])
            return true;
    return false;
}
function isSchemaObj(it) {
    return typeof it.schema != "boolean";
}
function subSchemaObjCode(it, valid) {
    const { schema, gen, opts } = it;
    if (opts.$comment && schema.$comment)
        commentKeyword(it);
    updateContext(it);
    checkAsyncSchema(it);
    const errsCount = gen.const("_errs", names_1.default.errors);
    typeAndKeywords(it, errsCount);
    // TODO var
    gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
}
function checkKeywords(it) {
    (0, util_1.checkUnknownRules)(it);
    checkRefsAndKeywords(it);
}
function typeAndKeywords(it, errsCount) {
    if (it.opts.jtd)
        return schemaKeywords(it, [], false, errsCount);
    const types = (0, dataType_1.getSchemaTypes)(it.schema);
    const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
    schemaKeywords(it, types, !checkedTypes, errsCount);
}
function checkRefsAndKeywords(it) {
    const { schema, errSchemaPath, opts, self } = it;
    if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
        self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
    }
}
function checkNoDefault(it) {
    const { schema, opts } = it;
    if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {
        (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
    }
}
function updateContext(it) {
    const schId = it.schema[it.opts.schemaId];
    if (schId)
        it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
}
function checkAsyncSchema(it) {
    if (it.schema.$async && !it.schemaEnv.$async)
        throw new Error("async schema in sync schema");
}
function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
    const msg = schema.$comment;
    if (opts.$comment === true) {
        gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);
    }
    else if (typeof opts.$comment == "function") {
        const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;
        const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
        gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
    }
}
function returnResults(it) {
    const { gen, schemaEnv, validateName, ValidationError, opts } = it;
    if (schemaEnv.$async) {
        // TODO assign unevaluated
        gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));
    }
    else {
        gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);
        if (opts.unevaluated)
            assignEvaluated(it);
        gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);
    }
}
function assignEvaluated({ gen, evaluated, props, items }) {
    if (props instanceof codegen_1.Name)
        gen.assign((0, codegen_1._) `${evaluated}.props`, props);
    if (items instanceof codegen_1.Name)
        gen.assign((0, codegen_1._) `${evaluated}.items`, items);
}
function schemaKeywords(it, types, typeErrors, errsCount) {
    const { gen, schema, data, allErrors, opts, self } = it;
    const { RULES } = self;
    if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
        gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast
        return;
    }
    if (!opts.jtd)
        checkStrictTypes(it, types);
    gen.block(() => {
        for (const group of RULES.rules)
            groupKeywords(group);
        groupKeywords(RULES.post);
    });
    function groupKeywords(group) {
        if (!(0, applicability_1.shouldUseGroup)(schema, group))
            return;
        if (group.type) {
            gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
            iterateKeywords(it, group);
            if (types.length === 1 && types[0] === group.type && typeErrors) {
                gen.else();
                (0, dataType_2.reportTypeError)(it);
            }
            gen.endIf();
        }
        else {
            iterateKeywords(it, group);
        }
        // TODO make it "ok" call?
        if (!allErrors)
            gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);
    }
}
function iterateKeywords(it, group) {
    const { gen, schema, opts: { useDefaults }, } = it;
    if (useDefaults)
        (0, defaults_1.assignDefaults)(it, group.type);
    gen.block(() => {
        for (const rule of group.rules) {
            if ((0, applicability_1.shouldUseRule)(schema, rule)) {
                keywordCode(it, rule.keyword, rule.definition, group.type);
            }
        }
    });
}
function checkStrictTypes(it, types) {
    if (it.schemaEnv.meta || !it.opts.strictTypes)
        return;
    checkContextTypes(it, types);
    if (!it.opts.allowUnionTypes)
        checkMultipleTypes(it, types);
    checkKeywordTypes(it, it.dataTypes);
}
function checkContextTypes(it, types) {
    if (!types.length)
        return;
    if (!it.dataTypes.length) {
        it.dataTypes = types;
        return;
    }
    types.forEach((t) => {
        if (!includesType(it.dataTypes, t)) {
            strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
        }
    });
    narrowSchemaTypes(it, types);
}
function checkMultipleTypes(it, ts) {
    if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
        strictTypesError(it, "use allowUnionTypes to allow union type keyword");
    }
}
function checkKeywordTypes(it, ts) {
    const rules = it.self.RULES.all;
    for (const keyword in rules) {
        const rule = rules[keyword];
        if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
            const { type } = rule.definition;
            if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
                strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
            }
        }
    }
}
function hasApplicableType(schTs, kwdT) {
    return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer"));
}
function includesType(ts, t) {
    return ts.includes(t) || (t === "integer" && ts.includes("number"));
}
function narrowSchemaTypes(it, withTypes) {
    const ts = [];
    for (const t of it.dataTypes) {
        if (includesType(withTypes, t))
            ts.push(t);
        else if (withTypes.includes("integer") && t === "number")
            ts.push("integer");
    }
    it.dataTypes = ts;
}
function strictTypesError(it, msg) {
    const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
    msg += ` at "${schemaPath}" (strictTypes)`;
    (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
}
class KeywordCxt {
    constructor(it, def, keyword) {
        (0, keyword_1.validateKeywordUsage)(it, def, keyword);
        this.gen = it.gen;
        this.allErrors = it.allErrors;
        this.keyword = keyword;
        this.data = it.data;
        this.schema = it.schema[keyword];
        this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
        this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
        this.schemaType = def.schemaType;
        this.parentSchema = it.schema;
        this.params = {};
        this.it = it;
        this.def = def;
        if (this.$data) {
            this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
        }
        else {
            this.schemaCode = this.schemaValue;
            if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
                throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
            }
        }
        if ("code" in def ? def.trackErrors : def.errors !== false) {
            this.errsCount = it.gen.const("_errs", names_1.default.errors);
        }
    }
    result(condition, successAction, failAction) {
        this.failResult((0, codegen_1.not)(condition), successAction, failAction);
    }
    failResult(condition, successAction, failAction) {
        this.gen.if(condition);
        if (failAction)
            failAction();
        else
            this.error();
        if (successAction) {
            this.gen.else();
            successAction();
            if (this.allErrors)
                this.gen.endIf();
        }
        else {
            if (this.allErrors)
                this.gen.endIf();
            else
                this.gen.else();
        }
    }
    pass(condition, failAction) {
        this.failResult((0, codegen_1.not)(condition), undefined, failAction);
    }
    fail(condition) {
        if (condition === undefined) {
            this.error();
            if (!this.allErrors)
                this.gen.if(false); // this branch will be removed by gen.optimize
            return;
        }
        this.gen.if(condition);
        this.error();
        if (this.allErrors)
            this.gen.endIf();
        else
            this.gen.else();
    }
    fail$data(condition) {
        if (!this.$data)
            return this.fail(condition);
        const { schemaCode } = this;
        this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
    }
    error(append, errorParams, errorPaths) {
        if (errorParams) {
            this.setParams(errorParams);
            this._error(append, errorPaths);
            this.setParams({});
            return;
        }
        this._error(append, errorPaths);
    }
    _error(append, errorPaths) {
        ;
        (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
    }
    $dataError() {
        (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
    }
    reset() {
        if (this.errsCount === undefined)
            throw new Error('add "trackErrors" to keyword definition');
        (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
    }
    ok(cond) {
        if (!this.allErrors)
            this.gen.if(cond);
    }
    setParams(obj, assign) {
        if (assign)
            Object.assign(this.params, obj);
        else
            this.params = obj;
    }
    block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
        this.gen.block(() => {
            this.check$data(valid, $dataValid);
            codeBlock();
        });
    }
    check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
        if (!this.$data)
            return;
        const { gen, schemaCode, schemaType, def } = this;
        gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));
        if (valid !== codegen_1.nil)
            gen.assign(valid, true);
        if (schemaType.length || def.validateSchema) {
            gen.elseIf(this.invalid$data());
            this.$dataError();
            if (valid !== codegen_1.nil)
                gen.assign(valid, false);
        }
        gen.else();
    }
    invalid$data() {
        const { gen, schemaCode, schemaType, def, it } = this;
        return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
        function wrong$DataType() {
            if (schemaType.length) {
                /* istanbul ignore if */
                if (!(schemaCode instanceof codegen_1.Name))
                    throw new Error("ajv implementation error");
                const st = Array.isArray(schemaType) ? schemaType : [schemaType];
                return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
            }
            return codegen_1.nil;
        }
        function invalid$DataSchema() {
            if (def.validateSchema) {
                const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone
                return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;
            }
            return codegen_1.nil;
        }
    }
    subschema(appl, valid) {
        const subschema = (0, subschema_1.getSubschema)(this.it, appl);
        (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
        (0, subschema_1.extendSubschemaMode)(subschema, appl);
        const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };
        subschemaCode(nextContext, valid);
        return nextContext;
    }
    mergeEvaluated(schemaCxt, toName) {
        const { it, gen } = this;
        if (!it.opts.unevaluated)
            return;
        if (it.props !== true && schemaCxt.props !== undefined) {
            it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
        }
        if (it.items !== true && schemaCxt.items !== undefined) {
            it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
        }
    }
    mergeValidEvaluated(schemaCxt, valid) {
        const { it, gen } = this;
        if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
            gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
            return true;
        }
    }
}
exports.KeywordCxt = KeywordCxt;
function keywordCode(it, keyword, def, ruleType) {
    const cxt = new KeywordCxt(it, def, keyword);
    if ("code" in def) {
        def.code(cxt, ruleType);
    }
    else if (cxt.$data && def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
    }
    else if ("macro" in def) {
        (0, keyword_1.macroKeywordCode)(cxt, def);
    }
    else if (def.compile || def.validate) {
        (0, keyword_1.funcKeywordCode)(cxt, def);
    }
}
const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
function getData($data, { dataLevel, dataNames, dataPathArr }) {
    let jsonPointer;
    let data;
    if ($data === "")
        return names_1.default.rootData;
    if ($data[0] === "/") {
        if (!JSON_POINTER.test($data))
            throw new Error(`Invalid JSON-pointer: ${$data}`);
        jsonPointer = $data;
        data = names_1.default.rootData;
    }
    else {
        const matches = RELATIVE_JSON_POINTER.exec($data);
        if (!matches)
            throw new Error(`Invalid JSON-pointer: ${$data}`);
        const up = +matches[1];
        jsonPointer = matches[2];
        if (jsonPointer === "#") {
            if (up >= dataLevel)
                throw new Error(errorMsg("property/index", up));
            return dataPathArr[dataLevel - up];
        }
        if (up > dataLevel)
            throw new Error(errorMsg("data", up));
        data = dataNames[dataLevel - up];
        if (!jsonPointer)
            return data;
    }
    let expr = data;
    const segments = jsonPointer.split("/");
    for (const segment of segments) {
        if (segment) {
            data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
            expr = (0, codegen_1._) `${expr} && ${data}`;
        }
    }
    return expr;
    function errorMsg(pointerType, up) {
        return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
    }
}
exports.getData = getData;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/compile/validate/index.ts"],"names":[],"mappings":";;;AASA,6CAAoE;AACpE,yCAAiE;AACjE,mDAA6D;AAC7D,yCAAmF;AACnF,yCAAyC;AACzC,uCAAkG;AAClG,2CAAiG;AACjG,wCAAwF;AACxF,oCAAwB;AACxB,wCAAqC;AACrC,kCAOg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QAC/B,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,GAAG,IAAA,qBAAW,EAAC,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC,EAAE,CAAA;YAC7D,IAAI,GAAG,IAAA,WAAC,EAAA,GAAG,IAAI,OAAO,IAAI,EAAE,CAAA;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;IAEX,SAAS,QAAQ,CAAC,WAAmB,EAAE,EAAU;QAC/C,OAAO,iBAAiB,WAAW,IAAI,EAAE,gCAAgC,SAAS,EAAE,CAAA;IACtF,CAAC;AACH,CAAC;AAtCD,0BAsCC"}import type { KeywordCxt } from ".";
import type { AddedKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition } from "../../types";
import type { SchemaObjCxt } from "..";
import type { JSONType } from "../rules";
export declare function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void;
export declare function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void;
export declare function validSchemaType(schema: unknown, schemaType: JSONType[], allowUndefined?: boolean): boolean;
export declare function validateKeywordUsage({ schema, opts, self, errSchemaPath }: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
const codegen_1 = require("../codegen");
const names_1 = require("../names");
const code_1 = require("../../vocabularies/code");
const errors_1 = require("../errors");
function macroKeywordCode(cxt, def) {
    const { gen, keyword, schema, parentSchema, it } = cxt;
    const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
    const schemaRef = useKeyword(gen, keyword, macroSchema);
    if (it.opts.validateSchema !== false)
        it.self.validateSchema(macroSchema, true);
    const valid = gen.name("valid");
    cxt.subschema({
        schema: macroSchema,
        schemaPath: codegen_1.nil,
        errSchemaPath: `${it.errSchemaPath}/${keyword}`,
        topSchemaRef: schemaRef,
        compositeRule: true,
    }, valid);
    cxt.pass(valid, () => cxt.error(true));
}
exports.macroKeywordCode = macroKeywordCode;
function funcKeywordCode(cxt, def) {
    var _a;
    const { gen, keyword, schema, parentSchema, $data, it } = cxt;
    checkAsyncKeyword(it, def);
    const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
    const validateRef = useKeyword(gen, keyword, validate);
    const valid = gen.let("valid");
    cxt.block$data(valid, validateKeyword);
    cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
    function validateKeyword() {
        if (def.errors === false) {
            assignValid();
            if (def.modifying)
                modifyData(cxt);
            reportErrs(() => cxt.error());
        }
        else {
            const ruleErrs = def.async ? validateAsync() : validateSync();
            if (def.modifying)
                modifyData(cxt);
            reportErrs(() => addErrs(cxt, ruleErrs));
        }
    }
    function validateAsync() {
        const ruleErrs = gen.let("ruleErrs", null);
        gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));
        return ruleErrs;
    }
    function validateSync() {
        const validateErrs = (0, codegen_1._) `${validateRef}.errors`;
        gen.assign(validateErrs, null);
        assignValid(codegen_1.nil);
        return validateErrs;
    }
    function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {
        const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
        const passSchema = !(("compile" in def && !$data) || def.schema === false);
        gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
    }
    function reportErrs(errors) {
        var _a;
        gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);
    }
}
exports.funcKeywordCode = funcKeywordCode;
function modifyData(cxt) {
    const { gen, data, it } = cxt;
    gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));
}
function addErrs(cxt, errs) {
    const { gen } = cxt;
    gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {
        gen
            .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)
            .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
        (0, errors_1.extendErrors)(cxt);
    }, () => cxt.error());
}
function checkAsyncKeyword({ schemaEnv }, def) {
    if (def.async && !schemaEnv.$async)
        throw new Error("async keyword in sync schema");
}
function useKeyword(gen, keyword, result) {
    if (result === undefined)
        throw new Error(`keyword "${keyword}" failed to compile`);
    return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
}
function validSchemaType(schema, schemaType, allowUndefined = false) {
    // TODO add tests
    return (!schemaType.length ||
        schemaType.some((st) => st === "array"
            ? Array.isArray(schema)
            : st === "object"
                ? schema && typeof schema == "object" && !Array.isArray(schema)
                : typeof schema == st || (allowUndefined && typeof schema == "undefined")));
}
exports.validSchemaType = validSchemaType;
function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
    /* istanbul ignore if */
    if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
        throw new Error("ajv implementation error");
    }
    const deps = def.dependencies;
    if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
        throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
    }
    if (def.validateSchema) {
        const valid = def.validateSchema(schema[keyword]);
        if (!valid) {
            const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` +
                self.errorsText(def.validateSchema.errors);
            if (opts.validateSchema === "log")
                self.logger.error(msg);
            else
                throw new Error(msg);
        }
    }
}
exports.validateKeywordUsage = validateKeywordUsage;
//# sourceMappingURL=keyword.js.map{"version":3,"file":"keyword.js","sourceRoot":"","sources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CAAC;IAED,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAA;IAC7B,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1F,CAAC;IAED,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;QACjD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,GAAG,GACP,YAAY,OAAO,+BAA+B,aAAa,KAAK;gBACpE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;YAC5C,IAAI,IAAI,CAAC,cAAc,KAAK,KAAK;gBAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;;gBACpD,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC;IACH,CAAC;AACH,CAAC;AAzBD,oDAyBC"}import type { AnySchema } from "../../types";
import type { SchemaObjCxt } from "..";
import { Code, Name } from "../codegen";
import { Type } from "../util";
import type { JSONType } from "../rules";
export interface SubschemaContext {
    schema: AnySchema;
    schemaPath: Code;
    errSchemaPath: string;
    topSchemaRef?: Code;
    errorPath?: Code;
    dataLevel?: number;
    dataTypes?: JSONType[];
    data?: Name;
    parentData?: Name;
    parentDataProperty?: Code | number;
    dataNames?: Name[];
    dataPathArr?: (Code | number)[];
    propertyName?: Name;
    jtdDiscriminator?: string;
    jtdMetadata?: boolean;
    compositeRule?: true;
    createErrors?: boolean;
    allErrors?: boolean;
}
export type SubschemaArgs = Partial<{
    keyword: string;
    schemaProp: string | number;
    schema: AnySchema;
    schemaPath: Code;
    errSchemaPath: string;
    topSchemaRef: Code;
    data: Name | Code;
    dataProp: Code | string | number;
    dataTypes: JSONType[];
    definedProperties: Set<string>;
    propertyName: Name;
    dataPropType: Type;
    jtdDiscriminator: string;
    jtdMetadata: boolean;
    compositeRule: true;
    createErrors: boolean;
    allErrors: boolean;
}>;
export declare function getSubschema(it: SchemaObjCxt, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }: SubschemaArgs): SubschemaContext;
export declare function extendSubschemaData(subschema: SubschemaContext, it: SchemaObjCxt, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }: SubschemaArgs): void;
export declare function extendSubschemaMode(subschema: SubschemaContext, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }: SubschemaArgs): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
const codegen_1 = require("../codegen");
const util_1 = require("../util");
function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
    if (keyword !== undefined && schema !== undefined) {
        throw new Error('both "keyword" and "schema" passed, only one allowed');
    }
    if (keyword !== undefined) {
        const sch = it.schema[keyword];
        return schemaProp === undefined
            ? {
                schema: sch,
                schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
                errSchemaPath: `${it.errSchemaPath}/${keyword}`,
            }
            : {
                schema: sch[schemaProp],
                schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
                errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,
            };
    }
    if (schema !== undefined) {
        if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
            throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
        }
        return {
            schema,
            schemaPath,
            topSchemaRef,
            errSchemaPath,
        };
    }
    throw new Error('either "keyword" or "schema" must be passed');
}
exports.getSubschema = getSubschema;
function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
    if (data !== undefined && dataProp !== undefined) {
        throw new Error('both "data" and "dataProp" passed, only one allowed');
    }
    const { gen } = it;
    if (dataProp !== undefined) {
        const { errorPath, dataPathArr, opts } = it;
        const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
        dataContextProps(nextData);
        subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
        subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;
        subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
    }
    if (data !== undefined) {
        const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once?
        dataContextProps(nextData);
        if (propertyName !== undefined)
            subschema.propertyName = propertyName;
        // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
    }
    if (dataTypes)
        subschema.dataTypes = dataTypes;
    function dataContextProps(_nextData) {
        subschema.data = _nextData;
        subschema.dataLevel = it.dataLevel + 1;
        subschema.dataTypes = [];
        it.definedProperties = new Set();
        subschema.parentData = it.data;
        subschema.dataNames = [...it.dataNames, _nextData];
    }
}
exports.extendSubschemaData = extendSubschemaData;
function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
    if (compositeRule !== undefined)
        subschema.compositeRule = compositeRule;
    if (createErrors !== undefined)
        subschema.createErrors = createErrors;
    if (allErrors !== undefined)
        subschema.allErrors = allErrors;
    subschema.jtdDiscriminator = jtdDiscriminator; // not inherited
    subschema.jtdMetadata = jtdMetadata; // not inherited
}
exports.extendSubschemaMode = extendSubschemaMode;
//# sourceMappingURL=subschema.js.map{"version":3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ition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, AnyValidateFunction, ErrorObject, ErrorNoParams, } from "./types";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export interface Plugin<Opts> {
    (ajv: Ajv, options?: Opts): Ajv;
    [prop: string]: any;
}
export { KeywordCxt } from "./compile/validate";
export { DefinedError } from "./vocabularies/errors";
export { JSONType } from "./compile/rules";
export { JSONSchemaType } from "./types/json-schema";
export { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
import type { Schema, AnySchema, AnySchemaObject, SchemaObject, AsyncSchema, Vocabulary, KeywordDefinition, AddedKeywordDefinition, AnyValidateFunction, ValidateFunction, AsyncValidateFunction, ErrorObject, Format, AddedFormat, RegExpEngine, UriResolver } from "./types";
import type { JSONSchemaType } from "./types/json-schema";
import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
import ValidationError from "./runtime/validation_error";
import MissingRefError from "./compile/ref_error";
import { ValidationRules } from "./compile/rules";
import { SchemaEnv } from "./compile";
import { Code, ValueScope } from "./compile/codegen";
export type Options = CurrentOptions & DeprecatedOptions;
export interface CurrentOptions {
    strict?: boolean | "log";
    strictSchema?: boolean | "log";
    strictNumbers?: boolean | "log";
    strictTypes?: boolean | "log";
    strictTuples?: boolean | "log";
    strictRequired?: boolean | "log";
    allowMatchingProperties?: boolean;
    allowUnionTypes?: boolean;
    validateFormats?: boolean;
    $data?: boolean;
    allErrors?: boolean;
    verbose?: boolean;
    discriminator?: boolean;
    unicodeRegExp?: boolean;
    timestamp?: "string" | "date";
    parseDate?: boolean;
    allowDate?: boolean;
    $comment?: true | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown);
    formats?: {
        [Name in string]?: Format;
    };
    keywords?: Vocabulary;
    schemas?: AnySchema[] | {
        [Key in string]?: AnySchema;
    };
    logger?: Logger | false;
    loadSchema?: (uri: string) => Promise<AnySchemaObject>;
    removeAdditional?: boolean | "all" | "failing";
    useDefaults?: boolean | "empty";
    coerceTypes?: boolean | "array";
    next?: boolean;
    unevaluated?: boolean;
    dynamicRef?: boolean;
    schemaId?: "id" | "$id";
    jtd?: boolean;
    meta?: SchemaObject | boolean;
    defaultMeta?: string | AnySchemaObject;
    validateSchema?: boolean | "log";
    addUsedSchema?: boolean;
    inlineRefs?: boolean | number;
    passContext?: boolean;
    loopRequired?: number;
    loopEnum?: number;
    ownProperties?: boolean;
    multipleOfPrecision?: number;
    int32range?: boolean;
    messages?: boolean;
    code?: CodeOptions;
    uriResolver?: UriResolver;
}
export interface CodeOptions {
    es5?: boolean;
    esm?: boolean;
    lines?: boolean;
    optimize?: boolean | number;
    formats?: Code;
    source?: boolean;
    process?: (code: string, schema?: SchemaEnv) => string;
    regExp?: RegExpEngine;
}
interface InstanceCodeOptions extends CodeOptions {
    regExp: RegExpEngine;
    optimize: number;
}
interface DeprecatedOptions {
    /** @deprecated */
    ignoreKeywordsWithRef?: boolean;
    /** @deprecated */
    jsPropertySyntax?: boolean;
    /** @deprecated */
    unicode?: boolean;
}
type RequiredInstanceOptions = {
    [K in "strictSchema" | "strictNumbers" | "strictTypes" | "strictTuples" | "strictRequired" | "inlineRefs" | "loopRequired" | "loopEnum" | "meta" | "messages" | "schemaId" | "addUsedSchema" | "validateSchema" | "validateFormats" | "int32range" | "unicodeRegExp" | "uriResolver"]: NonNullable<Options[K]>;
} & {
    code: InstanceCodeOptions;
};
export type InstanceOptions = Options & RequiredInstanceOptions;
export interface Logger {
    log(...args: unknown[]): unknown;
    warn(...args: unknown[]): unknown;
    error(...args: unknown[]): unknown;
}
export default class Ajv {
    opts: InstanceOptions;
    errors?: ErrorObject[] | null;
    logger: Logger;
    readonly scope: ValueScope;
    readonly schemas: {
        [Key in string]?: SchemaEnv;
    };
    readonly refs: {
        [Ref in string]?: SchemaEnv | string;
    };
    readonly formats: {
        [Name in string]?: AddedFormat;
    };
    readonly RULES: ValidationRules;
    readonly _compilations: Set<SchemaEnv>;
    private readonly _loading;
    private readonly _cache;
    private readonly _metaOpts;
    static ValidationError: typeof ValidationError;
    static MissingRefError: typeof MissingRefError;
    constructor(opts?: Options);
    _addVocabularies(): void;
    _addDefaultMetaSchema(): void;
    defaultMeta(): string | AnySchemaObject | undefined;
    validate(schema: Schema | string, data: unknown): boolean;
    validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>;
    validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T;
    validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T;
    validate<N extends never, T extends SomeJTDSchemaType>(schema: T, data: unknown): data is JTDDataType<T>;
    validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>;
    validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>;
    compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>;
    compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>;
    compile<N extends never, T extends SomeJTDSchemaType>(schema: T, _meta?: boolean): ValidateFunction<JTDDataType<T>>;
    compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>;
    compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>;
    compileAsync<T = unknown>(schema: SchemaObject | JSONSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>;
    compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>;
    compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>;
    compileAsync<T = unknown>(schema: AnySchemaObject, meta?: boolean): Promise<AnyValidateFunction<T>>;
    addSchema(schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored
    key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
    _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
    _validateSchema?: boolean | "log"): Ajv;
    addMetaSchema(schema: AnySchemaObject, key?: string, // schema key
    _validateSchema?: boolean | "log"): Ajv;
    validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown>;
    getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined;
    removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv;
    addVocabulary(definitions: Vocabulary): Ajv;
    addKeyword(kwdOrDef: string | KeywordDefinition, def?: KeywordDefinition): Ajv;
    getKeyword(keyword: string): AddedKeywordDefinition | boolean;
    removeKeyword(keyword: string): Ajv;
    addFormat(name: string, format: Format): Ajv;
    errorsText(errors?: ErrorObject[] | null | undefined, // optional array of validation errors
    { separator, dataVar }?: ErrorsTextOptions): string;
    $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject;
    private _removeAllSchemas;
    _addSchema(schema: AnySchema, meta?: boolean, baseId?: string, validateSchema?: boolean | "log", addSchema?: boolean): SchemaEnv;
    private _checkUnique;
    private _compileSchemaEnv;
    private _compileMetaSchema;
}
export interface ErrorsTextOptions {
    separator?: string;
    dataVar?: string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
const validation_error_1 = require("./runtime/validation_error");
const ref_error_1 = require("./compile/ref_error");
const rules_1 = require("./compile/rules");
const compile_1 = require("./compile");
const codegen_2 = require("./compile/codegen");
const resolve_1 = require("./compile/resolve");
const dataType_1 = require("./compile/validate/dataType");
const util_1 = require("./compile/util");
const $dataRefSchema = require("./refs/data.json");
const uri_1 = require("./runtime/uri");
const defaultRegExp = (str, flags) => new RegExp(str, flags);
defaultRegExp.code = "new RegExp";
const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
const EXT_SCOPE_NAMES = new Set([
    "validate",
    "serialize",
    "parse",
    "wrapper",
    "root",
    "schema",
    "keyword",
    "pattern",
    "formats",
    "validate$data",
    "func",
    "obj",
    "Error",
]);
const removedOptions = {
    errorDataPath: "",
    format: "`validateFormats: false` can be used instead.",
    nullable: '"nullable" keyword is supported by default.',
    jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
    extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
    missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
    processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
    sourceCode: "Use option `code: {source: true}`",
    strictDefaults: "It is default now, see option `strict`.",
    strictKeywords: "It is default now, see option `strict`.",
    uniqueItems: '"uniqueItems" keyword is always validated.',
    unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
    cache: "Map is used as cache, schema object as key.",
    serialize: "Map is used as cache, schema object as key.",
    ajvErrors: "It is default now.",
};
const deprecatedOptions = {
    ignoreKeywordsWithRef: "",
    jsPropertySyntax: "",
    unicode: '"minLength"/"maxLength" account for unicode characters by default.',
};
const MAX_EXPRESSION = 200;
// eslint-disable-next-line complexity
function requiredOptions(o) {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
    const s = o.strict;
    const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
    const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;
    const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
    const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
    return {
        strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
        strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
        strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
        strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
        strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
        code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
        loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
        loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
        meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
        messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
        inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
        schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
        addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
        validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
        validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
        unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
        int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
        uriResolver: uriResolver,
    };
}
class Ajv {
    constructor(opts = {}) {
        this.schemas = {};
        this.refs = {};
        this.formats = {};
        this._compilations = new Set();
        this._loading = {};
        this._cache = new Map();
        opts = this.opts = { ...opts, ...requiredOptions(opts) };
        const { es5, lines } = this.opts.code;
        this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
        this.logger = getLogger(opts.logger);
        const formatOpt = opts.validateFormats;
        opts.validateFormats = false;
        this.RULES = (0, rules_1.getRules)();
        checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
        checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
        this._metaOpts = getMetaSchemaOptions.call(this);
        if (opts.formats)
            addInitialFormats.call(this);
        this._addVocabularies();
        this._addDefaultMetaSchema();
        if (opts.keywords)
            addInitialKeywords.call(this, opts.keywords);
        if (typeof opts.meta == "object")
            this.addMetaSchema(opts.meta);
        addInitialSchemas.call(this);
        opts.validateFormats = formatOpt;
    }
    _addVocabularies() {
        this.addKeyword("$async");
    }
    _addDefaultMetaSchema() {
        const { $data, meta, schemaId } = this.opts;
        let _dataRefSchema = $dataRefSchema;
        if (schemaId === "id") {
            _dataRefSchema = { ...$dataRefSchema };
            _dataRefSchema.id = _dataRefSchema.$id;
            delete _dataRefSchema.$id;
        }
        if (meta && $data)
            this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
    }
    defaultMeta() {
        const { meta, schemaId } = this.opts;
        return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
    }
    validate(schemaKeyRef, // key, ref or schema object
    // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
    data // to be validated
    ) {
        let v;
        if (typeof schemaKeyRef == "string") {
            v = this.getSchema(schemaKeyRef);
            if (!v)
                throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
        }
        else {
            v = this.compile(schemaKeyRef);
        }
        const valid = v(data);
        if (!("$async" in v))
            this.errors = v.errors;
        return valid;
    }
    compile(schema, _meta) {
        const sch = this._addSchema(schema, _meta);
        return (sch.validate || this._compileSchemaEnv(sch));
    }
    compileAsync(schema, meta) {
        if (typeof this.opts.loadSchema != "function") {
            throw new Error("options.loadSchema should be a function");
        }
        const { loadSchema } = this.opts;
        return runCompileAsync.call(this, schema, meta);
        async function runCompileAsync(_schema, _meta) {
            await loadMetaSchema.call(this, _schema.$schema);
            const sch = this._addSchema(_schema, _meta);
            return sch.validate || _compileAsync.call(this, sch);
        }
        async function loadMetaSchema($ref) {
            if ($ref && !this.getSchema($ref)) {
                await runCompileAsync.call(this, { $ref }, true);
            }
        }
        async function _compileAsync(sch) {
            try {
                return this._compileSchemaEnv(sch);
            }
            catch (e) {
                if (!(e instanceof ref_error_1.default))
                    throw e;
                checkLoaded.call(this, e);
                await loadMissingSchema.call(this, e.missingSchema);
                return _compileAsync.call(this, sch);
            }
        }
        function checkLoaded({ missingSchema: ref, missingRef }) {
            if (this.refs[ref]) {
                throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
            }
        }
        async function loadMissingSchema(ref) {
            const _schema = await _loadSchema.call(this, ref);
            if (!this.refs[ref])
                await loadMetaSchema.call(this, _schema.$schema);
            if (!this.refs[ref])
                this.addSchema(_schema, ref, meta);
        }
        async function _loadSchema(ref) {
            const p = this._loading[ref];
            if (p)
                return p;
            try {
                return await (this._loading[ref] = loadSchema(ref));
            }
            finally {
                delete this._loading[ref];
            }
        }
    }
    // Adds schema to the instance
    addSchema(schema, // If array is passed, `key` will be ignored
    key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
    _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
    _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
    ) {
        if (Array.isArray(schema)) {
            for (const sch of schema)
                this.addSchema(sch, undefined, _meta, _validateSchema);
            return this;
        }
        let id;
        if (typeof schema === "object") {
            const { schemaId } = this.opts;
            id = schema[schemaId];
            if (id !== undefined && typeof id != "string") {
                throw new Error(`schema ${schemaId} must be string`);
            }
        }
        key = (0, resolve_1.normalizeId)(key || id);
        this._checkUnique(key);
        this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
        return this;
    }
    // Add schema that will be used to validate other schemas
    // options in META_IGNORE_OPTIONS are alway set to false
    addMetaSchema(schema, key, // schema key
    _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
    ) {
        this.addSchema(schema, key, true, _validateSchema);
        return this;
    }
    //  Validate schema against its meta-schema
    validateSchema(schema, throwOrLogError) {
        if (typeof schema == "boolean")
            return true;
        let $schema;
        $schema = schema.$schema;
        if ($schema !== undefined && typeof $schema != "string") {
            throw new Error("$schema must be a string");
        }
        $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
        if (!$schema) {
            this.logger.warn("meta-schema not available");
            this.errors = null;
            return true;
        }
        const valid = this.validate($schema, schema);
        if (!valid && throwOrLogError) {
            const message = "schema is invalid: " + this.errorsText();
            if (this.opts.validateSchema === "log")
                this.logger.error(message);
            else
                throw new Error(message);
        }
        return valid;
    }
    // Get compiled schema by `key` or `ref`.
    // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
    getSchema(keyRef) {
        let sch;
        while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
            keyRef = sch;
        if (sch === undefined) {
            const { schemaId } = this.opts;
            const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
            sch = compile_1.resolveSchema.call(this, root, keyRef);
            if (!sch)
                return;
            this.refs[keyRef] = sch;
        }
        return (sch.validate || this._compileSchemaEnv(sch));
    }
    // Remove cached schema(s).
    // If no parameter is passed all schemas but meta-schemas are removed.
    // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
    // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
    removeSchema(schemaKeyRef) {
        if (schemaKeyRef instanceof RegExp) {
            this._removeAllSchemas(this.schemas, schemaKeyRef);
            this._removeAllSchemas(this.refs, schemaKeyRef);
            return this;
        }
        switch (typeof schemaKeyRef) {
            case "undefined":
                this._removeAllSchemas(this.schemas);
                this._removeAllSchemas(this.refs);
                this._cache.clear();
                return this;
            case "string": {
                const sch = getSchEnv.call(this, schemaKeyRef);
                if (typeof sch == "object")
                    this._cache.delete(sch.schema);
                delete this.schemas[schemaKeyRef];
                delete this.refs[schemaKeyRef];
                return this;
            }
            case "object": {
                const cacheKey = schemaKeyRef;
                this._cache.delete(cacheKey);
                let id = schemaKeyRef[this.opts.schemaId];
                if (id) {
                    id = (0, resolve_1.normalizeId)(id);
                    delete this.schemas[id];
                    delete this.refs[id];
                }
                return this;
            }
            default:
                throw new Error("ajv.removeSchema: invalid parameter");
        }
    }
    // add "vocabulary" - a collection of keywords
    addVocabulary(definitions) {
        for (const def of definitions)
            this.addKeyword(def);
        return this;
    }
    addKeyword(kwdOrDef, def // deprecated
    ) {
        let keyword;
        if (typeof kwdOrDef == "string") {
            keyword = kwdOrDef;
            if (typeof def == "object") {
                this.logger.warn("these parameters are deprecated, see docs for addKeyword");
                def.keyword = keyword;
            }
        }
        else if (typeof kwdOrDef == "object" && def === undefined) {
            def = kwdOrDef;
            keyword = def.keyword;
            if (Array.isArray(keyword) && !keyword.length) {
                throw new Error("addKeywords: keyword must be string or non-empty array");
            }
        }
        else {
            throw new Error("invalid addKeywords parameters");
        }
        checkKeyword.call(this, keyword, def);
        if (!def) {
            (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
            return this;
        }
        keywordMetaschema.call(this, def);
        const definition = {
            ...def,
            type: (0, dataType_1.getJSONTypes)(def.type),
            schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),
        };
        (0, util_1.eachItem)(keyword, definition.type.length === 0
            ? (k) => addRule.call(this, k, definition)
            : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
        return this;
    }
    getKeyword(keyword) {
        const rule = this.RULES.all[keyword];
        return typeof rule == "object" ? rule.definition : !!rule;
    }
    // Remove keyword
    removeKeyword(keyword) {
        // TODO return type should be Ajv
        const { RULES } = this;
        delete RULES.keywords[keyword];
        delete RULES.all[keyword];
        for (const group of RULES.rules) {
            const i = group.rules.findIndex((rule) => rule.keyword === keyword);
            if (i >= 0)
                group.rules.splice(i, 1);
        }
        return this;
    }
    // Add format
    addFormat(name, format) {
        if (typeof format == "string")
            format = new RegExp(format);
        this.formats[name] = format;
        return this;
    }
    errorsText(errors = this.errors, // optional array of validation errors
    { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar`
    ) {
        if (!errors || errors.length === 0)
            return "No errors";
        return errors
            .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
            .reduce((text, msg) => text + separator + msg);
    }
    $dataMetaSchema(metaSchema, keywordsJsonPointers) {
        const rules = this.RULES.all;
        metaSchema = JSON.parse(JSON.stringify(metaSchema));
        for (const jsonPointer of keywordsJsonPointers) {
            const segments = jsonPointer.split("/").slice(1); // first segment is an empty string
            let keywords = metaSchema;
            for (const seg of segments)
                keywords = keywords[seg];
            for (const key in rules) {
                const rule = rules[key];
                if (typeof rule != "object")
                    continue;
                const { $data } = rule.definition;
                const schema = keywords[key];
                if ($data && schema)
                    keywords[key] = schemaOrData(schema);
            }
        }
        return metaSchema;
    }
    _removeAllSchemas(schemas, regex) {
        for (const keyRef in schemas) {
            const sch = schemas[keyRef];
            if (!regex || regex.test(keyRef)) {
                if (typeof sch == "string") {
                    delete schemas[keyRef];
                }
                else if (sch && !sch.meta) {
                    this._cache.delete(sch.schema);
                    delete schemas[keyRef];
                }
            }
        }
    }
    _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
        let id;
        const { schemaId } = this.opts;
        if (typeof schema == "object") {
            id = schema[schemaId];
        }
        else {
            if (this.opts.jtd)
                throw new Error("schema must be object");
            else if (typeof schema != "boolean")
                throw new Error("schema must be object or boolean");
        }
        let sch = this._cache.get(schema);
        if (sch !== undefined)
            return sch;
        baseId = (0, resolve_1.normalizeId)(id || baseId);
        const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
        sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });
        this._cache.set(sch.schema, sch);
        if (addSchema && !baseId.startsWith("#")) {
            // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
            if (baseId)
                this._checkUnique(baseId);
            this.refs[baseId] = sch;
        }
        if (validateSchema)
            this.validateSchema(schema, true);
        return sch;
    }
    _checkUnique(id) {
        if (this.schemas[id] || this.refs[id]) {
            throw new Error(`schema with key or id "${id}" already exists`);
        }
    }
    _compileSchemaEnv(sch) {
        if (sch.meta)
            this._compileMetaSchema(sch);
        else
            compile_1.compileSchema.call(this, sch);
        /* istanbul ignore if */
        if (!sch.validate)
            throw new Error("ajv implementation error");
        return sch.validate;
    }
    _compileMetaSchema(sch) {
        const currentOpts = this.opts;
        this.opts = this._metaOpts;
        try {
            compile_1.compileSchema.call(this, sch);
        }
        finally {
            this.opts = currentOpts;
        }
    }
}
Ajv.ValidationError = validation_error_1.default;
Ajv.MissingRefError = ref_error_1.default;
exports.default = Ajv;
function checkOptions(checkOpts, options, msg, log = "error") {
    for (const key in checkOpts) {
        const opt = key;
        if (opt in options)
            this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
    }
}
function getSchEnv(keyRef) {
    keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line
    return this.schemas[keyRef] || this.refs[keyRef];
}
function addInitialSchemas() {
    const optsSchemas = this.opts.schemas;
    if (!optsSchemas)
        return;
    if (Array.isArray(optsSchemas))
        this.addSchema(optsSchemas);
    else
        for (const key in optsSchemas)
            this.addSchema(optsSchemas[key], key);
}
function addInitialFormats() {
    for (const name in this.opts.formats) {
        const format = this.opts.formats[name];
        if (format)
            this.addFormat(name, format);
    }
}
function addInitialKeywords(defs) {
    if (Array.isArray(defs)) {
        this.addVocabulary(defs);
        return;
    }
    this.logger.warn("keywords option as map is deprecated, pass array");
    for (const keyword in defs) {
        const def = defs[keyword];
        if (!def.keyword)
            def.keyword = keyword;
        this.addKeyword(def);
    }
}
function getMetaSchemaOptions() {
    const metaOpts = { ...this.opts };
    for (const opt of META_IGNORE_OPTIONS)
        delete metaOpts[opt];
    return metaOpts;
}
const noLogs = { log() { }, warn() { }, error() { } };
function getLogger(logger) {
    if (logger === false)
        return noLogs;
    if (logger === undefined)
        return console;
    if (logger.log && logger.warn && logger.error)
        return logger;
    throw new Error("logger must implement log, warn and error methods");
}
const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
function checkKeyword(keyword, def) {
    const { RULES } = this;
    (0, util_1.eachItem)(keyword, (kwd) => {
        if (RULES.keywords[kwd])
            throw new Error(`Keyword ${kwd} is already defined`);
        if (!KEYWORD_NAME.test(kwd))
            throw new Error(`Keyword ${kwd} has invalid name`);
    });
    if (!def)
        return;
    if (def.$data && !("code" in def || "validate" in def)) {
        throw new Error('$data keyword must have "code" or "validate" function');
    }
}
function addRule(keyword, definition, dataType) {
    var _a;
    const post = definition === null || definition === void 0 ? void 0 : definition.post;
    if (dataType && post)
        throw new Error('keyword with "post" flag cannot have "type"');
    const { RULES } = this;
    let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
    if (!ruleGroup) {
        ruleGroup = { type: dataType, rules: [] };
        RULES.rules.push(ruleGroup);
    }
    RULES.keywords[keyword] = true;
    if (!definition)
        return;
    const rule = {
        keyword,
        definition: {
            ...definition,
            type: (0, dataType_1.getJSONTypes)(definition.type),
            schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),
        },
    };
    if (definition.before)
        addBeforeRule.call(this, ruleGroup, rule, definition.before);
    else
        ruleGroup.rules.push(rule);
    RULES.all[keyword] = rule;
    (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
}
function addBeforeRule(ruleGroup, rule, before) {
    const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
    if (i >= 0) {
        ruleGroup.rules.splice(i, 0, rule);
    }
    else {
        ruleGroup.rules.push(rule);
        this.logger.warn(`rule ${before} is not defined`);
    }
}
function keywordMetaschema(def) {
    let { metaSchema } = def;
    if (metaSchema === undefined)
        return;
    if (def.$data && this.opts.$data)
        metaSchema = schemaOrData(metaSchema);
    def.validateSchema = this.compile(metaSchema, true);
}
const $dataRef = {
    $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
};
function schemaOrData(schema) {
    return { anyOf: [schema, $dataRef] };
}
//# sourceMappingURL=core.js.map{"version":3,"file":"core.js","sourceRoot":"","sources":["../lib/core.ts"],"names":[],"mappings":";;;AA4BA,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAKlB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAsBnD,iEAAwD;AACxD,mDAAiD;AACjD,2CAAoF;AACpF,uCAAiE;AACjE,+CAAkD;AAClD,+CAA4D;AAC5D,0DAAwD;AACxD,yCAAuC;AACvC,mDAAkD;AAElD,uCAA8C;AAE9C,MAAM,aAAa,GAAiB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAC1E,aAAa,CAAC,IAAI,GAAG,YAAY,CAAA;AAEjC,MAAM,mBAAmB,GAAsB,CAAC,kBAAkB,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;AACjG,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,UAAU;IACV,WAAW;IACX,OAAO;IACP,SAAS;IACT,MAAM;IACN,QAAQ;IACR,SAAS;IACT,SAAS;IACT,SAAS;IACT,eAAe;IACf,MAAM;IACN,KAAK;IACL,OAAO;CACR,CAAC,CAAA;AAyGF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QAAQ,CAAC,EAAC,CAAA;AACpC,CAAC"}import type { AnySchemaObject, SchemaObject, JTDParser } from "./types";
import type { JTDSchemaType, SomeJTDSchemaType, JTDDataType } from "./types/jtd-schema";
import AjvCore, { CurrentOptions } from "./core";
type JTDOptions = CurrentOptions & {
    strict?: never;
    allowMatchingProperties?: never;
    allowUnionTypes?: never;
    validateFormats?: never;
    $data?: never;
    verbose?: boolean;
    $comment?: never;
    formats?: never;
    loadSchema?: never;
    useDefaults?: never;
    coerceTypes?: never;
    next?: never;
    unevaluated?: never;
    dynamicRef?: never;
    meta?: boolean;
    defaultMeta?: never;
    inlineRefs?: boolean;
    loopRequired?: never;
    multipleOfPrecision?: never;
};
export declare class Ajv extends AjvCore {
    constructor(opts?: JTDOptions);
    _addVocabularies(): void;
    _addDefaultMetaSchema(): void;
    defaultMeta(): string | AnySchemaObject | undefined;
    compileSerializer<T = unknown>(schema: SchemaObject): (data: T) => string;
    compileSerializer<T = unknown>(schema: JTDSchemaType<T>): (data: T) => string;
    compileParser<T = unknown>(schema: SchemaObject): JTDParser<T>;
    compileParser<T = unknown>(schema: JTDSchemaType<T>): JTDParser<T>;
    private _compileSerializer;
    private _compileParser;
}
export default Ajv;
export { Format, FormatDefinition, AsyncFormatDefinition, KeywordDefinition, KeywordErrorDefinition, CodeKeywordDefinition, MacroKeywordDefinition, FuncKeywordDefinition, Vocabulary, Schema, SchemaObject, AnySchemaObject, AsyncSchema, AnySchema, ValidateFunction, AsyncValidateFunction, ErrorObject, ErrorNoParams, JTDParser, } from "./types";
export { Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions } from "./core";
export { SchemaCxt, SchemaObjCxt } from "./compile";
export { KeywordCxt } from "./compile/validate";
export { JTDErrorObject } from "./vocabularies/jtd";
export { _, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions } from "./compile/codegen";
export { JTDSchemaType, SomeJTDSchemaType, JTDDataType };
export { JTDOptions };
export { default as ValidationError } from "./runtime/validation_error";
export { default as MissingRefError } from "./compile/ref_error";
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
const core_1 = require("./core");
const jtd_1 = require("./vocabularies/jtd");
const jtd_schema_1 = require("./refs/jtd-schema");
const serialize_1 = require("./compile/jtd/serialize");
const parse_1 = require("./compile/jtd/parse");
const META_SCHEMA_ID = "JTD-meta-schema";
class Ajv extends core_1.default {
    constructor(opts = {}) {
        super({
            ...opts,
            jtd: true,
        });
    }
    _addVocabularies() {
        super._addVocabularies();
        this.addVocabulary(jtd_1.default);
    }
    _addDefaultMetaSchema() {
        super._addDefaultMetaSchema();
        if (!this.opts.meta)
            return;
        this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false);
    }
    defaultMeta() {
        return (this.opts.defaultMeta =
            super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
    }
    compileSerializer(schema) {
        const sch = this._addSchema(schema);
        return sch.serialize || this._compileSerializer(sch);
    }
    compileParser(schema) {
        const sch = this._addSchema(schema);
        return (sch.parse || this._compileParser(sch));
    }
    _compileSerializer(sch) {
        serialize_1.default.call(this, sch, sch.schema.definitions || {});
        /* istanbul ignore if */
        if (!sch.serialize)
            throw new Error("ajv implementation error");
        return sch.serialize;
    }
    _compileParser(sch) {
        parse_1.default.call(this, sch, sch.schema.definitions || {});
        /* istanbul ignore if */
        if (!sch.parse)
            throw new Error("ajv implementation error");
        return sch.parse;
    }
}
exports.Ajv = Ajv;
module.exports = exports = Ajv;
module.exports.Ajv = Ajv;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Ajv;
var validate_1 = require("./compile/validate");
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
var codegen_1 = require("./compile/codegen");
Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
var validation_error_1 = require("./runtime/validation_error");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return validation_error_1.default; } });
var ref_error_1 = require("./compile/ref_error");
Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } });
//# sourceMappingURL=jtd.js.map{"version":3,"file":"jtd.js","sourceRoot":"","sources":["../lib/jtd.ts"],"names":[],"mappings":";;;AAEA,iCAA8C;AAC9C,4CAA8C;AAC9C,kDAA6C;AAC7C,uDAAuD;AACvD,+CAA+C;AAG/C,MAAM,cAAc,GAAG,iBAAiB,CAAA;AA4BxC,MAAa,GAAI,SAAQ,cAAO;IAC9B,YAAY,OAAmB,EAAE;QAC/B,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,GAAG,EAAE,IAAI;SACV,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,gBAAgB,EAAE,CAAA;QACxB,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;IACnC,CAAC;IAED,qBAAqB;QACnB,KAAK,CAAC,qBAAqB,EAAE,CAAA;QAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAM;QAC3B,IAAI,CAAC,aAAa,CAAC,oBAAa,EAAE,cAAc,EAAE,KAAK,CAAC,CAAA;IAC1D,CAAC;IAED,WAAW;QACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW;YAC3B,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,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AC,CAAC,CAAA;AAE3D,kBAAe,GAAG,CAAA;AA0BlB,+CAA6C;AAArC,sGAAA,UAAU,OAAA;AAElB,6CAA6F;AAArF,4FAAA,CAAC,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,8FAAA,GAAG,OAAA;AAAE,+FAAA,IAAI,OAAA;AAAQ,kGAAA,OAAO,OAAA;AAInD,+DAAqE;AAA7D,mHAAA,OAAO,OAAmB;AAClC,iDAA8D;AAAtD,4GAAA,OAAO,OAAmB"}{
  "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
  "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)",
  "type": "object",
  "required": ["$data"],
  "properties": {
    "$data": {
      "type": "string",
      "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}]
    }
  },
  "additionalProperties": false
}
import type Ajv from "../../core";
export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const metaSchema = require("./schema.json");
const applicator = require("./meta/applicator.json");
const content = require("./meta/content.json");
const core = require("./meta/core.json");
const format = require("./meta/format.json");
const metadata = require("./meta/meta-data.json");
const validation = require("./meta/validation.json");
const META_SUPPORT_DATA = ["/properties"];
function addMetaSchema2019($data) {
    ;
    [
        metaSchema,
        applicator,
        content,
        core,
        with$data(this, format),
        metadata,
        with$data(this, validation),
    ].forEach((sch) => this.addMetaSchema(sch, undefined, false));
    return this;
    function with$data(ajv, sch) {
        return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
    }
}
exports.default = addMetaSchema2019;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"}{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/applicator": true
  },
  "$recursiveAnchor": true,

  "title": "Applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "additionalItems": {"$recursiveRef": "#"},
    "unevaluatedItems": {"$recursiveRef": "#"},
    "items": {
      "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}]
    },
    "contains": {"$recursiveRef": "#"},
    "additionalProperties": {"$recursiveRef": "#"},
    "unevaluatedProperties": {"$recursiveRef": "#"},
    "properties": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependentSchemas": {
      "type": "object",
      "additionalProperties": {
        "$recursiveRef": "#"
      }
    },
    "propertyNames": {"$recursiveRef": "#"},
    "if": {"$recursiveRef": "#"},
    "then": {"$recursiveRef": "#"},
    "else": {"$recursiveRef": "#"},
    "allOf": {"$ref": "#/$defs/schemaArray"},
    "anyOf": {"$ref": "#/$defs/schemaArray"},
    "oneOf": {"$ref": "#/$defs/schemaArray"},
    "not": {"$recursiveRef": "#"}
  },
  "$defs": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$recursiveRef": "#"}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/content",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/content": true
  },
  "$recursiveAnchor": true,

  "title": "Content vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "contentMediaType": {"type": "string"},
    "contentEncoding": {"type": "string"},
    "contentSchema": {"$recursiveRef": "#"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/core",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/core": true
  },
  "$recursiveAnchor": true,

  "title": "Core vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference",
      "$comment": "Non-empty fragments not allowed.",
      "pattern": "^[^#]*#?$"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$anchor": {
      "type": "string",
      "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "$recursiveRef": {
      "type": "string",
      "format": "uri-reference"
    },
    "$recursiveAnchor": {
      "type": "boolean",
      "default": false
    },
    "$vocabulary": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "format": "uri"
      },
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "$comment": {
      "type": "string"
    },
    "$defs": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/format",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/format": true
  },
  "$recursiveAnchor": true,

  "title": "Format vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "format": {"type": "string"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/meta-data": true
  },
  "$recursiveAnchor": true,

  "title": "Meta-data vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "deprecated": {
      "type": "boolean",
      "default": false
    },
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "writeOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/validation",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/validation": true
  },
  "$recursiveAnchor": true,

  "title": "Validation vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/$defs/nonNegativeInteger"},
    "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "maxItems": {"$ref": "#/$defs/nonNegativeInteger"},
    "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "maxContains": {"$ref": "#/$defs/nonNegativeInteger"},
    "minContains": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 1
    },
    "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"},
    "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/$defs/stringArray"},
    "dependentRequired": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/stringArray"
      }
    },
    "const": true,
    "enum": {
      "type": "array",
      "items": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/$defs/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/$defs/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    }
  },
  "$defs": {
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 0
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/schema",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/core": true,
    "https://json-schema.org/draft/2019-09/vocab/applicator": true,
    "https://json-schema.org/draft/2019-09/vocab/validation": true,
    "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
    "https://json-schema.org/draft/2019-09/vocab/format": false,
    "https://json-schema.org/draft/2019-09/vocab/content": true
  },
  "$recursiveAnchor": true,

  "title": "Core and Validation specifications meta-schema",
  "allOf": [
    {"$ref": "meta/core"},
    {"$ref": "meta/applicator"},
    {"$ref": "meta/validation"},
    {"$ref": "meta/meta-data"},
    {"$ref": "meta/format"},
    {"$ref": "meta/content"}
  ],
  "type": ["object", "boolean"],
  "properties": {
    "definitions": {
      "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    },
    "dependencies": {
      "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"",
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}]
      }
    }
  }
}
import type Ajv from "../../core";
export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const metaSchema = require("./schema.json");
const applicator = require("./meta/applicator.json");
const unevaluated = require("./meta/unevaluated.json");
const content = require("./meta/content.json");
const core = require("./meta/core.json");
const format = require("./meta/format-annotation.json");
const metadata = require("./meta/meta-data.json");
const validation = require("./meta/validation.json");
const META_SUPPORT_DATA = ["/properties"];
function addMetaSchema2020($data) {
    ;
    [
        metaSchema,
        applicator,
        unevaluated,
        content,
        core,
        with$data(this, format),
        metadata,
        with$data(this, validation),
    ].forEach((sch) => this.addMetaSchema(sch, undefined, false));
    return this;
    function with$data(ajv, sch) {
        return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
    }
}
exports.default = addMetaSchema2020;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2020-12/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,uDAAsD;AACtD,+CAA8C;AAC9C,yCAAwC;AACxC,wDAAuD;AACvD,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,WAAW;QACX,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAhBD,oCAgBC"}{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/applicator": true
  },
  "$dynamicAnchor": "meta",

  "title": "Applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "prefixItems": {"$ref": "#/$defs/schemaArray"},
    "items": {"$dynamicRef": "#meta"},
    "contains": {"$dynamicRef": "#meta"},
    "additionalProperties": {"$dynamicRef": "#meta"},
    "properties": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependentSchemas": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "default": {}
    },
    "propertyNames": {"$dynamicRef": "#meta"},
    "if": {"$dynamicRef": "#meta"},
    "then": {"$dynamicRef": "#meta"},
    "else": {"$dynamicRef": "#meta"},
    "allOf": {"$ref": "#/$defs/schemaArray"},
    "anyOf": {"$ref": "#/$defs/schemaArray"},
    "oneOf": {"$ref": "#/$defs/schemaArray"},
    "not": {"$dynamicRef": "#meta"}
  },
  "$defs": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$dynamicRef": "#meta"}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/content",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/content": true
  },
  "$dynamicAnchor": "meta",

  "title": "Content vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "contentEncoding": {"type": "string"},
    "contentMediaType": {"type": "string"},
    "contentSchema": {"$dynamicRef": "#meta"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/core",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/core": true
  },
  "$dynamicAnchor": "meta",

  "title": "Core vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "$ref": "#/$defs/uriReferenceString",
      "$comment": "Non-empty fragments not allowed.",
      "pattern": "^[^#]*#?$"
    },
    "$schema": {"$ref": "#/$defs/uriString"},
    "$ref": {"$ref": "#/$defs/uriReferenceString"},
    "$anchor": {"$ref": "#/$defs/anchorString"},
    "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"},
    "$dynamicAnchor": {"$ref": "#/$defs/anchorString"},
    "$vocabulary": {
      "type": "object",
      "propertyNames": {"$ref": "#/$defs/uriString"},
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "$comment": {
      "type": "string"
    },
    "$defs": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"}
    }
  },
  "$defs": {
    "anchorString": {
      "type": "string",
      "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
    },
    "uriString": {
      "type": "string",
      "format": "uri"
    },
    "uriReferenceString": {
      "type": "string",
      "format": "uri-reference"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
  },
  "$dynamicAnchor": "meta",

  "title": "Format vocabulary meta-schema for annotation results",
  "type": ["object", "boolean"],
  "properties": {
    "format": {"type": "string"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/meta-data": true
  },
  "$dynamicAnchor": "meta",

  "title": "Meta-data vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "deprecated": {
      "type": "boolean",
      "default": false
    },
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "writeOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
  },
  "$dynamicAnchor": "meta",

  "title": "Unevaluated applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "unevaluatedItems": {"$dynamicRef": "#meta"},
    "unevaluatedProperties": {"$dynamicRef": "#meta"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/validation",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/validation": true
  },
  "$dynamicAnchor": "meta",

  "title": "Validation vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "type": {
      "anyOf": [
        {"$ref": "#/$defs/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/$defs/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "const": true,
    "enum": {
      "type": "array",
      "items": true
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/$defs/nonNegativeInteger"},
    "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "maxItems": {"$ref": "#/$defs/nonNegativeInteger"},
    "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "maxContains": {"$ref": "#/$defs/nonNegativeInteger"},
    "minContains": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 1
    },
    "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"},
    "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/$defs/stringArray"},
    "dependentRequired": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/stringArray"
      }
    }
  },
  "$defs": {
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 0
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/schema",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/core": true,
    "https://json-schema.org/draft/2020-12/vocab/applicator": true,
    "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
    "https://json-schema.org/draft/2020-12/vocab/validation": true,
    "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
    "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
    "https://json-schema.org/draft/2020-12/vocab/content": true
  },
  "$dynamicAnchor": "meta",

  "title": "Core and Validation specifications meta-schema",
  "allOf": [
    {"$ref": "meta/core"},
    {"$ref": "meta/applicator"},
    {"$ref": "meta/unevaluated"},
    {"$ref": "meta/validation"},
    {"$ref": "meta/meta-data"},
    {"$ref": "meta/format-annotation"},
    {"$ref": "meta/content"}
  ],
  "type": ["object", "boolean"],
  "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
  "properties": {
    "definitions": {
      "$comment": "\"definitions\" has been replaced by \"$defs\".",
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "deprecated": true,
      "default": {}
    },
    "dependencies": {
      "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}]
      },
      "deprecated": true,
      "default": {}
    },
    "$recursiveAnchor": {
      "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
      "$ref": "meta/core#/$defs/anchorString",
      "deprecated": true
    },
    "$recursiveRef": {
      "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
      "$ref": "meta/core#/$defs/uriReferenceString",
      "deprecated": true
    }
  }
}
{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://json-schema.org/draft-06/schema#",
  "title": "Core schema meta-schema",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    },
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  },
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": {},
    "examples": {
      "type": "array",
      "items": {}
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
    "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "additionalItems": {"$ref": "#"},
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
      "default": {}
    },
    "maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
    "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "contains": {"$ref": "#"},
    "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
    "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/definitions/stringArray"},
    "additionalProperties": {"$ref": "#"},
    "definitions": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "properties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
      }
    },
    "propertyNames": {"$ref": "#"},
    "const": {},
    "enum": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/definitions/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/definitions/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "format": {"type": "string"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"}
  },
  "default": {}
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://json-schema.org/draft-07/schema#",
  "title": "Core schema meta-schema",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    },
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  },
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "$comment": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
    "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "additionalItems": {"$ref": "#"},
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
      "default": true
    },
    "maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
    "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "contains": {"$ref": "#"},
    "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
    "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/definitions/stringArray"},
    "additionalProperties": {"$ref": "#"},
    "definitions": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "properties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
      }
    },
    "propertyNames": {"$ref": "#"},
    "const": true,
    "enum": {
      "type": "array",
      "items": true,
      "minItems": 1,
      "uniqueItems": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/definitions/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/definitions/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "format": {"type": "string"},
    "contentMediaType": {"type": "string"},
    "contentEncoding": {"type": "string"},
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"}
  },
  "default": true
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
  "title": "Meta-schema for the security assessment of JSON Schemas",
  "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    }
  },
  "dependencies": {
    "patternProperties": {
      "description": "prevent slow validation of large property names",
      "required": ["propertyNames"],
      "properties": {
        "propertyNames": {
          "required": ["maxLength"]
        }
      }
    },
    "uniqueItems": {
      "description": "prevent slow validation of large non-scalar arrays",
      "if": {
        "properties": {
          "uniqueItems": {"const": true},
          "items": {
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "enum": ["object", "array"]
                  },
                  {
                    "type": "array",
                    "contains": {"enum": ["object", "array"]}
                  }
                ]
              }
            }
          }
        }
      },
      "then": {
        "required": ["maxItems"]
      }
    },
    "pattern": {
      "description": "prevent slow pattern matching of large strings",
      "required": ["maxLength"]
    },
    "format": {
      "description": "prevent slow format validation of large strings",
      "required": ["maxLength"]
    }
  },
  "properties": {
    "additionalItems": {"$ref": "#"},
    "additionalProperties": {"$ref": "#"},
    "dependencies": {
      "additionalProperties": {
        "anyOf": [{"type": "array"}, {"$ref": "#"}]
      }
    },
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}]
    },
    "definitions": {
      "additionalProperties": {"$ref": "#"}
    },
    "patternProperties": {
      "additionalProperties": {"$ref": "#"}
    },
    "properties": {
      "additionalProperties": {"$ref": "#"}
    },
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"},
    "contains": {"$ref": "#"},
    "propertyNames": {"$ref": "#"}
  }
}
import { SchemaObject } from "../types";
declare const jtdMetaSchema: SchemaObject;
export default jtdMetaSchema;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const shared = (root) => {
    const sch = {
        nullable: { type: "boolean" },
        metadata: {
            optionalProperties: {
                union: { elements: { ref: "schema" } },
            },
            additionalProperties: true,
        },
    };
    if (root)
        sch.definitions = { values: { ref: "schema" } };
    return sch;
};
const emptyForm = (root) => ({
    optionalProperties: shared(root),
});
const refForm = (root) => ({
    properties: {
        ref: { type: "string" },
    },
    optionalProperties: shared(root),
});
const typeForm = (root) => ({
    properties: {
        type: {
            enum: [
                "boolean",
                "timestamp",
                "string",
                "float32",
                "float64",
                "int8",
                "uint8",
                "int16",
                "uint16",
                "int32",
                "uint32",
            ],
        },
    },
    optionalProperties: shared(root),
});
const enumForm = (root) => ({
    properties: {
        enum: { elements: { type: "string" } },
    },
    optionalProperties: shared(root),
});
const elementsForm = (root) => ({
    properties: {
        elements: { ref: "schema" },
    },
    optionalProperties: shared(root),
});
const propertiesForm = (root) => ({
    properties: {
        properties: { values: { ref: "schema" } },
    },
    optionalProperties: {
        optionalProperties: { values: { ref: "schema" } },
        additionalProperties: { type: "boolean" },
        ...shared(root),
    },
});
const optionalPropertiesForm = (root) => ({
    properties: {
        optionalProperties: { values: { ref: "schema" } },
    },
    optionalProperties: {
        additionalProperties: { type: "boolean" },
        ...shared(root),
    },
});
const discriminatorForm = (root) => ({
    properties: {
        discriminator: { type: "string" },
        mapping: {
            values: {
                metadata: {
                    union: [propertiesForm(false), optionalPropertiesForm(false)],
                },
            },
        },
    },
    optionalProperties: shared(root),
});
const valuesForm = (root) => ({
    properties: {
        values: { ref: "schema" },
    },
    optionalProperties: shared(root),
});
const schema = (root) => ({
    metadata: {
        union: [
            emptyForm,
            refForm,
            typeForm,
            enumForm,
            elementsForm,
            propertiesForm,
            optionalPropertiesForm,
            discriminatorForm,
            valuesForm,
        ].map((s) => s(root)),
    },
});
const jtdMetaSchema = {
    definitions: {
        schema: schema(false),
    },
    ...schema(true),
};
exports.default = jtdMetaSchema;
//# sourceMappingURL=jtd-schema.js.map{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/refs/jtd-schema.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE;IAClC,MAAM,GAAG,GAAiB;QACxB,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC;QAC3B,QAAQ,EAAE;YACR,kBAAkB,EAAE;gBAClB,KAAK,EAAE,EAAC,QAAQ,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC;aACnC;YACD,oBAAoB,EAAE,IAAI;SAC3B;KACF,CAAA;IACD,IAAI,IAAI;QAAE,GAAG,CAAC,WAAW,GAAG,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,QAAQ,EAAC,EAAC,CAAA;IACrD,OAA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d,sBAAsB;YACtB,iBAAiB;YACjB,UAAU;SACX,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;KACtB;CACF,CAAC,CAAA;AAEF,MAAM,aAAa,GAAiB;IAClC,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;KACtB;IACD,GAAG,MAAM,CAAC,IAAI,CAAC;CAChB,CAAA;AAED,kBAAe,aAAa,CAAA"}import * as equal from "fast-deep-equal";
type Equal = typeof equal & {
    code: string;
};
declare const _default: Equal;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// https://github.com/ajv-validator/ajv/issues/889
const equal = require("fast-deep-equal");
equal.code = 'require("ajv/dist/runtime/equal").default';
exports.default = equal;
//# sourceMappingURL=equal.js.map{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../lib/runtime/equal.ts"],"names":[],"mappings":";;AAAA,kDAAkD;AAClD,yCAAwC;AAGtC,KAAe,CAAC,IAAI,GAAG,2CAA2C,CAAA;AAEpE,kBAAe,KAAc,CAAA"}export declare function parseJson(s: string, pos: number): unknown;
export declare namespace parseJson {
    var message: string | undefined;
    var position: number;
    var code: string;
}
export declare function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined;
export declare namespace parseJsonNumber {
    var message: string | undefined;
    var position: number;
    var code: string;
}
export declare function parseJsonString(s: string, pos: number): string | undefined;
export declare namespace parseJsonString {
    var message: string | undefined;
    var position: number;
    var code: string;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseJsonString = exports.parseJsonNumber = exports.parseJson = void 0;
const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/;
function parseJson(s, pos) {
    let endPos;
    parseJson.message = undefined;
    let matches;
    if (pos)
        s = s.slice(pos);
    try {
        parseJson.position = pos + s.length;
        return JSON.parse(s);
    }
    catch (e) {
        matches = rxParseJson.exec(e.message);
        if (!matches) {
            parseJson.message = "unexpected end";
            return undefined;
        }
        endPos = +matches[1];
        const c = s[endPos];
        s = s.slice(0, endPos);
        parseJson.position = pos + endPos;
        try {
            return JSON.parse(s);
        }
        catch (e1) {
            parseJson.message = `unexpected token ${c}`;
            return undefined;
        }
    }
}
exports.parseJson = parseJson;
parseJson.message = undefined;
parseJson.position = 0;
parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson';
function parseJsonNumber(s, pos, maxDigits) {
    let numStr = "";
    let c;
    parseJsonNumber.message = undefined;
    if (s[pos] === "-") {
        numStr += "-";
        pos++;
    }
    if (s[pos] === "0") {
        numStr += "0";
        pos++;
    }
    else {
        if (!parseDigits(maxDigits)) {
            errorMessage();
            return undefined;
        }
    }
    if (maxDigits) {
        parseJsonNumber.position = pos;
        return +numStr;
    }
    if (s[pos] === ".") {
        numStr += ".";
        pos++;
        if (!parseDigits()) {
            errorMessage();
            return undefined;
        }
    }
    if (((c = s[pos]), c === "e" || c === "E")) {
        numStr += "e";
        pos++;
        if (((c = s[pos]), c === "+" || c === "-")) {
            numStr += c;
            pos++;
        }
        if (!parseDigits()) {
            errorMessage();
            return undefined;
        }
    }
    parseJsonNumber.position = pos;
    return +numStr;
    function parseDigits(maxLen) {
        let digit = false;
        while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) {
            digit = true;
            numStr += c;
            pos++;
        }
        return digit;
    }
    function errorMessage() {
        parseJsonNumber.position = pos;
        parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end";
    }
}
exports.parseJsonNumber = parseJsonNumber;
parseJsonNumber.message = undefined;
parseJsonNumber.position = 0;
parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber';
const escapedChars = {
    b: "\b",
    f: "\f",
    n: "\n",
    r: "\r",
    t: "\t",
    '"': '"',
    "/": "/",
    "\\": "\\",
};
const CODE_A = "a".charCodeAt(0);
const CODE_0 = "0".charCodeAt(0);
function parseJsonString(s, pos) {
    let str = "";
    let c;
    parseJsonString.message = undefined;
    // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
    while (true) {
        c = s[pos++];
        if (c === '"')
            break;
        if (c === "\\") {
            c = s[pos];
            if (c in escapedChars) {
                str += escapedChars[c];
                pos++;
            }
            else if (c === "u") {
                pos++;
                let count = 4;
                let code = 0;
                while (count--) {
                    code <<= 4;
                    c = s[pos];
                    // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
                    if (c === undefined) {
                        errorMessage("unexpected end");
                        return undefined;
                    }
                    c = c.toLowerCase();
                    if (c >= "a" && c <= "f") {
                        code += c.charCodeAt(0) - CODE_A + 10;
                    }
                    else if (c >= "0" && c <= "9") {
                        code += c.charCodeAt(0) - CODE_0;
                    }
                    else {
                        errorMessage(`unexpected token ${c}`);
                        return undefined;
                    }
                    pos++;
                }
                str += String.fromCharCode(code);
            }
            else {
                errorMessage(`unexpected token ${c}`);
                return undefined;
            }
            // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
        }
        else if (c === undefined) {
            errorMessage("unexpected end");
            return undefined;
        }
        else {
            if (c.charCodeAt(0) >= 0x20) {
                str += c;
            }
            else {
                errorMessage(`unexpected token ${c}`);
                return undefined;
            }
        }
    }
    parseJsonString.position = pos;
    return str;
    function errorMessage(msg) {
        parseJsonString.position = pos;
        parseJsonString.message = msg;
    }
}
exports.parseJsonString = parseJsonString;
parseJsonString.message = undefined;
parseJsonString.position = 0;
parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString';
//# sourceMappingURL=parseJson.js.map{"version":3,"file":"parseJson.js","sourceRoot":"","sources":["../../lib/runtime/parseJson.ts"],"names":[],"mappings":";;;AAAA,MAAM,WAAW,GAAG,+CAA+C,CAAA;AAEnE,SAAgB,SAAS,CAAC,CAAS,EAAE,GAAW;IAC9C,IAAI,MAA0B,CAAA;IAC9B,SAAS,CAAC,OAAO,GAAG,SAAS,CAAA;IAC7B,IAAI,OAA+B,CAAA;IACnC,IAAI,GAAG;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AAA;wBACrC,OAAO,SAAS,CAAA;oBAClB,CAAC;oBACD,GAAG,EAAE,CAAA;gBACP,CAAC;gBACD,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;YAClC,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;YAClB,CAAC;YACD,uEAAuE;QACzE,CAAC;aAAM,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3B,YAAY,CAAC,gBAAgB,CAAC,CAAA;YAC9B,OAAO,SAAS,CAAA;QAClB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;gBAC5B,GAAG,IAAI,CAAC,CAAA;YACV,CAAC;iBAAM,CAAC;gBACN,YAAY,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAA;gBACrC,OAAO,SAAS,CAAA;YAClB,CAAC;QACH,CAAC;IACH,CAAC;IACD,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;IAC9B,OAAO,GAAG,CAAA;IAEV,SAAS,YAAY,CAAC,GAAW;QAC/B,eAAe,CAAC,QAAQ,GAAG,GAAG,CAAA;QAC9B,eAAe,CAAC,OAAO,GAAG,GAAG,CAAA;IAC/B,CAAC;AACH,CAAC;AA7DD,0CA6DC;AAED,eAAe,CAAC,OAAO,GAAG,SAA+B,CAAA;AACzD,eAAe,CAAC,QAAQ,GAAG,CAAW,CAAA;AACtC,eAAe,CAAC,IAAI,GAAG,uDAAuD,CAAA"}declare function quote(s: string): string;
declare namespace quote {
    var code: string;
}
export default quote;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const rxEscapable = 
// eslint-disable-next-line no-control-regex, no-misleading-character-class
/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
const escaped = {
    "\b": "\\b",
    "\t": "\\t",
    "\n": "\\n",
    "\f": "\\f",
    "\r": "\\r",
    '"': '\\"',
    "\\": "\\\\",
};
function quote(s) {
    rxEscapable.lastIndex = 0;
    return ('"' +
        (rxEscapable.test(s)
            ? s.replace(rxEscapable, (a) => {
                const c = escaped[a];
                return typeof c === "string"
                    ? c
                    : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
            })
            : s) +
        '"');
}
exports.default = quote;
quote.code = 'require("ajv/dist/runtime/quote").default';
//# sourceMappingURL=quote.js.map{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../lib/runtime/quote.ts"],"names":[],"mappings":";;AAAA,MAAM,WAAW;AACf,2EAA2E;AAC3E,iIAAiI,CAAA;AAEnI,MAAM,OAAO,GAA6B;IACxC,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAA;AAED,SAAwB,KAAK,CAAC,CAAS;IACrC,WAAW,CAAC,SAAS,GAAG,CAAC,CAAA;IACzB,OAAO,CACL,GAAG;QACH,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC3B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;gBACpB,OAAO,OAAO,CAAC,KAAK,QAAQ;oBAC1B,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;YAC/D,CAAC,CAAC;YACJ,CAAC,CAAC,CAAC,CAAC;QACN,GAAG,CACJ,CAAA;AACH,CAAC;AAdD,wBAcC;AAED,KAAK,CAAC,IAAI,GAAG,2CAA2C,CAAA"}import * as re2 from "re2";
type Re2 = typeof re2 & {
    code: string;
};
declare const _default: Re2;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const re2 = require("re2");
re2.code = 'require("ajv/dist/runtime/re2").default';
exports.default = re2;
//# sourceMappingURL=re2.js.map{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"}declare function validTimestamp(str: string, allowDate: boolean): boolean;
declare namespace validTimestamp {
    var code: string;
}
export default validTimestamp;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const DT_SEPARATOR = /t|\s/i;
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i;
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function validTimestamp(str, allowDate) {
    // http://tools.ietf.org/html/rfc3339#section-5.6
    const dt = str.split(DT_SEPARATOR);
    return ((dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) ||
        (allowDate && dt.length === 1 && validDate(dt[0])));
}
exports.default = validTimestamp;
function validDate(str) {
    const matches = DATE.exec(str);
    if (!matches)
        return false;
    const y = +matches[1];
    const m = +matches[2];
    const d = +matches[3];
    return (m >= 1 &&
        m <= 12 &&
        d >= 1 &&
        (d <= DAYS[m] ||
            // leap year: https://tools.ietf.org/html/rfc3339#appendix-C
            (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0))));
}
function validTime(str) {
    const matches = TIME.exec(str);
    if (!matches)
        return false;
    const hr = +matches[1];
    const min = +matches[2];
    const sec = +matches[3];
    const tzH = +(matches[4] || 0);
    const tzM = +(matches[5] || 0);
    return ((hr <= 23 && min <= 59 && sec <= 59) ||
        // leap second
        (hr - tzH === 23 && min - tzM === 59 && sec === 60));
}
validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default';
//# sourceMappingURL=timestamp.js.map{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../lib/runtime/timestamp.ts"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,IAAI,GAAG,4BAA4B,CAAA;AACzC,MAAM,IAAI,GAAG,gEAAgE,CAAA;AAC7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;AAEhE,SAAwB,cAAc,CAAC,GAAW,EAAE,SAAkB;IACpE,iDAAiD;IACjD,MAAM,EAAE,GAAa,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC5C,OAAO,CACL,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzD,CAAC,SAAS,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CACnD,CAAA;AACH,CAAC;AAPD,iCAOC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAC1B,MAAM,CAAC,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAW,CAAC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AAG,+CAA+C,CAAA"}declare function ucs2length(str: string): number;
declare namespace ucs2length {
    var code: string;
}
export default ucs2length;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
function ucs2length(str) {
    const len = str.length;
    let length = 0;
    let pos = 0;
    let value;
    while (pos < len) {
        length++;
        value = str.charCodeAt(pos++);
        if (value >= 0xd800 && value <= 0xdbff && pos < len) {
            // high surrogate, and there is a next character
            value = str.charCodeAt(pos);
            if ((value & 0xfc00) === 0xdc00)
                pos++; // low surrogate
        }
    }
    return length;
}
exports.default = ucs2length;
ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
//# sourceMappingURL=ucs2length.js.map{"version":3,"file":"ucs2length.js","sourceRoot":"","sources":["../../lib/runtime/ucs2length.ts"],"names":[],"mappings":";;AAAA,qDAAqD;AACrD,iEAAiE;AACjE,SAAwB,UAAU,CAAC,GAAW;IAC5C,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAA;IACtB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAa,CAAA;IACjB,OAAO,GAAG,GAAG,GAAG,EAAE,CAAC;QACjB,MAAM,EAAE,CAAA;QACR,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAA;QAC7B,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;YACpD,gDAAgD;YAChD,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM;gBAAE,GAAG,EAAE,CAAA,CAAC,gBAAgB;QACzD,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAfD,6BAeC;AAED,UAAU,CAAC,IAAI,GAAG,gDAAgD,CAAA"}import * as uri from "fast-uri";
type URI = typeof uri & {
    code: string;
};
declare const _default: URI;
export default _default;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const uri = require("fast-uri");
uri.code = 'require("ajv/dist/runtime/uri").default';
exports.default = uri;
//# sourceMappingURL=uri.js.map{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../lib/runtime/uri.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAG7B,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"}import type { ErrorObject } from "../types";
export default class ValidationError extends Error {
    readonly errors: Partial<ErrorObject>[];
    readonly ajv: true;
    readonly validation: true;
    constructor(errors: Partial<ErrorObject>[]);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ValidationError extends Error {
    constructor(errors) {
        super("validation failed");
        this.errors = errors;
        this.ajv = this.validation = true;
    }
}
exports.default = ValidationError;
//# sourceMappingURL=validation_error.js.map{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../lib/runtime/validation_error.ts"],"names":[],"mappings":";;AAEA,MAAqB,eAAgB,SAAQ,KAAK;IAKhD,YAAY,MAA8B;QACxC,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;CACF;AAVD,kCAUC"}import type AjvCore from "../core";
import type { AnyValidateFunction } from "../types";
declare function standaloneCode(ajv: AjvCore, refsOrFunc?: {
    [K in string]?: string;
} | AnyValidateFunction): string;
export default standaloneCode;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const scope_1 = require("../compile/codegen/scope");
const code_1 = require("../compile/codegen/code");
function standaloneCode(ajv, refsOrFunc) {
    if (!ajv.opts.code.source) {
        throw new Error("moduleCode: ajv instance must have code.source option");
    }
    const { _n } = ajv.scope.opts;
    return typeof refsOrFunc == "function"
        ? funcExportCode(refsOrFunc.source)
        : refsOrFunc !== undefined
            ? multiExportsCode(refsOrFunc, getValidate)
            : multiExportsCode(ajv.schemas, (sch) => sch.meta ? undefined : ajv.compile(sch.schema));
    function getValidate(id) {
        const v = ajv.getSchema(id);
        if (!v)
            throw new Error(`moduleCode: no schema with id ${id}`);
        return v;
    }
    function funcExportCode(source) {
        const usedValues = {};
        const n = source === null || source === void 0 ? void 0 : source.validateName;
        const vCode = validateCode(usedValues, source);
        if (ajv.opts.code.esm) {
            // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value
            return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`;
        }
        return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`;
    }
    function multiExportsCode(schemas, getValidateFunc) {
        var _a;
        const usedValues = {};
        let code = (0, code_1._) `"use strict";`;
        for (const name in schemas) {
            const v = getValidateFunc(schemas[name]);
            if (v) {
                const vCode = validateCode(usedValues, v.source);
                const exportSyntax = ajv.opts.code.esm
                    ? (0, code_1._) `export const ${(0, code_1.getEsmExportName)(name)}`
                    : (0, code_1._) `exports${(0, code_1.getProperty)(name)}`;
                code = (0, code_1._) `${code}${_n}${exportSyntax} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`;
            }
        }
        return `${code}`;
    }
    function validateCode(usedValues, s) {
        if (!s)
            throw new Error('moduleCode: function does not have "source" property');
        if (usedState(s.validateName) === scope_1.UsedValueState.Completed)
            return code_1.nil;
        setUsedState(s.validateName, scope_1.UsedValueState.Started);
        const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode);
        const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`);
        return s.evaluated ? (0, code_1._) `${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code;
        function refValidateCode(n) {
            var _a;
            const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref;
            if (n.prefix === "validate" && typeof vRef == "function") {
                const v = vRef;
                return validateCode(usedValues, v.source);
            }
            else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") {
                const { validate, validateName } = vRef;
                if (!validateName)
                    throw new Error("ajv internal error");
                const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const;
                const wrapper = (0, code_1._) `${def} ${n} = {validate: ${validateName}};`;
                if (usedState(validateName) === scope_1.UsedValueState.Started)
                    return wrapper;
                const vCode = validateCode(usedValues, validate === null || validate === void 0 ? void 0 : validate.source);
                return (0, code_1._) `${wrapper}${_n}${vCode}`;
            }
            return undefined;
        }
        function usedState(name) {
            var _a;
            return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name);
        }
        function setUsedState(name, state) {
            const { prefix } = name;
            const names = (usedValues[prefix] = usedValues[prefix] || new Map());
            names.set(name, state);
        }
    }
}
module.exports = exports = standaloneCode;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = standaloneCode;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/standalone/index.ts"],"names":[],"mappings":";;AAGA,oDAAkG;AAClG,kDAA0F;AAE1F,SAAS,cAAc,CACrB,GAAY,EACZ,UAA2D;IAE3D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAA;IAC1E,CAAC;IACD,MAAM,EAAC,EAAE,EAAC,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAA;IAC3B,OAAO,OAAO,UAAU,IAAI,UAAU;QACpC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,UAAU,KAAK,SAAS;YAC1B,CAAC,CAAC,gBAAgB,CAAS,UAAU,EAAE,WAAW,CAAC;YACnD,CAAC,CAAC,gBAAgB,CAAY,GAAG,CAAC,OAAO,E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QAC3C,CAAC;QAED,SAAS,YAAY,CAAC,IAAoB,EAAE,KAAqB;YAC/D,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAA;YACrB,MAAM,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,OAAO,GAAG,OAAO,GAAG,cAAc,CAAA;AACzC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAA;AAE3D,kBAAe,cAAc,CAAA"}import Ajv, { AnySchema, AnyValidateFunction, ErrorObject } from "../core";
export default class AjvPack {
    readonly ajv: Ajv;
    errors?: ErrorObject[] | null;
    constructor(ajv: Ajv);
    validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>;
    compile<T = unknown>(schema: AnySchema, meta?: boolean): AnyValidateFunction<T>;
    getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined;
    private getStandalone;
    addSchema(...args: Parameters<typeof Ajv.prototype.addSchema>): AjvPack;
    addKeyword(...args: Parameters<typeof Ajv.prototype.addKeyword>): AjvPack;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("../core");
const _1 = require(".");
const requireFromString = require("require-from-string");
class AjvPack {
    constructor(ajv) {
        this.ajv = ajv;
    }
    validate(schemaKeyRef, data) {
        return core_1.default.prototype.validate.call(this, schemaKeyRef, data);
    }
    compile(schema, meta) {
        return this.getStandalone(this.ajv.compile(schema, meta));
    }
    getSchema(keyRef) {
        const v = this.ajv.getSchema(keyRef);
        if (!v)
            return undefined;
        return this.getStandalone(v);
    }
    getStandalone(v) {
        return requireFromString((0, _1.default)(this.ajv, v));
    }
    addSchema(...args) {
        this.ajv.addSchema.call(this.ajv, ...args);
        return this;
    }
    addKeyword(...args) {
        this.ajv.addKeyword.call(this.ajv, ...args);
        return this;
    }
}
exports.default = AjvPack;
//# sourceMappingURL=instance.js.map{"version":3,"file":"instance.js","sourceRoot":"","sources":["../../lib/standalone/instance.ts"],"names":[],"mappings":";;AAAA,kCAAwE;AACxE,wBAA8B;AAC9B,yDAAwD;AAExD,MAAqB,OAAO;IAE1B,YAAqB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;IAAG,CAAC;IAEjC,QAAQ,CAAC,YAAgC,EAAE,IAAa;QACtD,OAAO,cAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,CAAc,MAAiB,EAAE,IAAc;QACpD,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAI,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IAC9D,CAAC;IAED,SAAS,CAAc,MAAc;QACnC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAI,MAAM,CAAC,CAAA;QACvC,IAAI,CAAC,CAAC;YAAE,OAAO,SAAS,CAAA;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAA;IAC9B,CAAC;IAEO,aAAa,CAAc,CAAyB;QAC1D,OAAO,iBAAiB,CAAC,IAAA,UAAc,EAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAA2B,CAAA;IACjF,CAAC;IAED,SAAS,CAAC,GAAG,IAAgD;QAC3D,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,UAAU,CAAC,GAAG,IAAiD;QAC7D,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA/BD,0BA+BC"}import { URIComponent } from "fast-uri";
import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from "../compile/codegen";
import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from "../compile";
import type { JSONType } from "../compile/rules";
import type { KeywordCxt } from "../compile/validate";
import type Ajv from "../core";
interface _SchemaObject {
    id?: string;
    $id?: string;
    $schema?: string;
    [x: string]: any;
}
export interface SchemaObject extends _SchemaObject {
    id?: string;
    $id?: string;
    $schema?: string;
    $async?: false;
    [x: string]: any;
}
export interface AsyncSchema extends _SchemaObject {
    $async: true;
}
export type AnySchemaObject = SchemaObject | AsyncSchema;
export type Schema = SchemaObject | boolean;
export type AnySchema = Schema | AsyncSchema;
export type SchemaMap = {
    [Key in string]?: AnySchema;
};
export interface SourceCode {
    validateName: ValueScopeName;
    validateCode: string;
    scopeValues: ScopeValueSets;
    evaluated?: Code;
}
export interface DataValidationCxt<T extends string | number = string | number> {
    instancePath: string;
    parentData: {
        [K in T]: any;
    };
    parentDataProperty: T;
    rootData: Record<string, any> | any[];
    dynamicAnchors: {
        [Ref in string]?: ValidateFunction;
    };
}
export interface ValidateFunction<T = unknown> {
    (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T;
    errors?: null | ErrorObject[];
    evaluated?: Evaluated;
    schema: AnySchema;
    schemaEnv: SchemaEnv;
    source?: SourceCode;
}
export interface JTDParser<T = unknown> {
    (json: string): T | undefined;
    message?: string;
    position?: number;
}
export type EvaluatedProperties = {
    [K in string]?: true;
} | true;
export type EvaluatedItems = number | true;
export interface Evaluated {
    props?: EvaluatedProperties;
    items?: EvaluatedItems;
    dynamicProps: boolean;
    dynamicItems: boolean;
}
export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
    (...args: Parameters<ValidateFunction<T>>): Promise<T>;
    $async: true;
}
export type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
    keyword: K;
    instancePath: string;
    schemaPath: string;
    params: P;
    propertyName?: string;
    message?: string;
    schema?: S;
    parentSchema?: AnySchemaObject;
    data?: unknown;
}
export type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
interface _KeywordDef {
    keyword: string | string[];
    type?: JSONType | JSONType[];
    schemaType?: JSONType | JSONType[];
    allowUndefined?: boolean;
    $data?: boolean;
    implements?: string[];
    before?: string;
    post?: boolean;
    metaSchema?: AnySchemaObject;
    validateSchema?: AnyValidateFunction;
    dependencies?: string[];
    error?: KeywordErrorDefinition;
    $dataError?: KeywordErrorDefinition;
}
export interface CodeKeywordDefinition extends _KeywordDef {
    code: (cxt: KeywordCxt, ruleType?: string) => void;
    trackErrors?: boolean;
}
export type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
export type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
export interface DataValidateFunction {
    (...args: Parameters<ValidateFunction>): boolean | Promise<any>;
    errors?: Partial<ErrorObject>[];
}
export interface SchemaValidateFunction {
    (schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise<any>;
    errors?: Partial<ErrorObject>[];
}
export interface FuncKeywordDefinition extends _KeywordDef {
    validate?: SchemaValidateFunction | DataValidateFunction;
    compile?: CompileKeywordFunc;
    schema?: boolean;
    modifying?: boolean;
    async?: boolean;
    valid?: boolean;
    errors?: boolean | "full";
}
export interface MacroKeywordDefinition extends FuncKeywordDefinition {
    macro: MacroKeywordFunc;
}
export type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
export type AddedKeywordDefinition = KeywordDefinition & {
    type: JSONType[];
    schemaType: JSONType[];
};
export interface KeywordErrorDefinition {
    message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
    params?: Code | ((cxt: KeywordErrorCxt) => Code);
}
export type Vocabulary = (KeywordDefinition | string)[];
export interface KeywordErrorCxt {
    gen: CodeGen;
    keyword: string;
    data: Name;
    $data?: string | false;
    schema: any;
    parentSchema?: AnySchemaObject;
    schemaCode: Code | number | boolean;
    schemaValue: Code | number | boolean;
    schemaType?: JSONType[];
    errsCount?: Name;
    params: KeywordCxtParams;
    it: SchemaCxt;
}
export type KeywordCxtParams = {
    [P in string]?: Code | string | number;
};
export type FormatValidator<T extends string | number> = (data: T) => boolean;
export type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
export type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
export interface FormatDefinition<T extends string | number> {
    type?: T extends string ? "string" | undefined : "number";
    validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
    async?: false | undefined;
    compare?: FormatCompare<T>;
}
export interface AsyncFormatDefinition<T extends string | number> {
    type?: T extends string ? "string" | undefined : "number";
    validate: AsyncFormatValidator<T>;
    async: true;
    compare?: FormatCompare<T>;
}
export type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
export type Format = AddedFormat | string;
export interface RegExpEngine {
    (pattern: string, u: string): RegExpLike;
    code: string;
}
export interface RegExpLike {
    test: (s: string) => boolean;
}
export interface UriResolver {
    parse(uri: string): URIComponent;
    resolve(base: string, path: string): string;
    serialize(component: URIComponent): string;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":""}type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
export type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
export type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
interface NumberKeywords {
    minimum?: number;
    maximum?: number;
    exclusiveMinimum?: number;
    exclusiveMaximum?: number;
    multipleOf?: number;
    format?: string;
}
interface StringKeywords {
    minLength?: number;
    maxLength?: number;
    pattern?: string;
    format?: string;
}
type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
{
    anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
} | {
    oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
} | ({
    type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[];
} & UnionToIntersection<T extends number ? NumberKeywords : T extends string ? StringKeywords : T extends boolean ? {} : never>) | ((T extends number ? {
    type: JSONType<"number" | "integer", IsPartial>;
} & NumberKeywords : T extends string ? {
    type: JSONType<"string", IsPartial>;
} & StringKeywords : T extends boolean ? {
    type: JSONType<"boolean", IsPartial>;
} : T extends readonly [any, ...any[]] ? {
    type: JSONType<"array", IsPartial>;
    items: {
        readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>;
    } & {
        length: T["length"];
    };
    minItems: T["length"];
} & ({
    maxItems: T["length"];
} | {
    additionalItems: false;
}) : T extends readonly any[] ? {
    type: JSONType<"array", IsPartial>;
    items: UncheckedJSONSchemaType<T[0], false>;
    contains?: UncheckedPartialSchema<T[0]>;
    minItems?: number;
    maxItems?: number;
    minContains?: number;
    maxContains?: number;
    uniqueItems?: true;
    additionalItems?: never;
} : T extends Record<string, any> ? {
    type: JSONType<"object", IsPartial>;
    additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
    unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
    properties?: IsPartial extends true ? Partial<UncheckedPropertiesSchema<T>> : UncheckedPropertiesSchema<T>;
    patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>;
    propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {
        type?: "string";
    };
    dependencies?: {
        [K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T>;
    };
    dependentRequired?: {
        [K in keyof T]?: readonly (keyof T)[];
    };
    dependentSchemas?: {
        [K in keyof T]?: UncheckedPartialSchema<T>;
    };
    minProperties?: number;
    maxProperties?: number;
} & (IsPartial extends true ? {
    required: readonly (keyof T)[];
} : [UncheckedRequiredMembers<T>] extends [never] ? {
    required?: readonly UncheckedRequiredMembers<T>[];
} : {
    required: readonly UncheckedRequiredMembers<T>[];
}) : T extends null ? {
    type: JSONType<"null", IsPartial>;
    nullable: true;
} : never) & {
    allOf?: readonly UncheckedPartialSchema<T>[];
    anyOf?: readonly UncheckedPartialSchema<T>[];
    oneOf?: readonly UncheckedPartialSchema<T>[];
    if?: UncheckedPartialSchema<T>;
    then?: UncheckedPartialSchema<T>;
    else?: UncheckedPartialSchema<T>;
    not?: UncheckedPartialSchema<T>;
})) & {
    [keyword: string]: any;
    $id?: string;
    $ref?: string;
    $defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
    definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
};
export type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
type Known = {
    [key: string]: Known;
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
type UncheckedPropertiesSchema<T> = {
    [K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
        $ref: string;
    };
};
export type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
type UncheckedRequiredMembers<T> = {
    [K in keyof T]-?: undefined extends T[K] ? never : K;
}[keyof T];
export type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
type Nullable<T> = undefined extends T ? {
    nullable: true;
    const?: null;
    enum?: readonly (T | null)[];
    default?: T | null;
} : {
    nullable?: false;
    const?: T;
    enum?: readonly T[];
    default?: T;
};
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=json-schema.js.map{"version":3,"file":"json-schema.js","sourceRoot":"","sources":["../../lib/types/json-schema.ts"],"names":[],"mappings":""}/** numeric strings */
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
/** string strings */
type StringType = "string" | "timestamp";
/** Generic JTD Schema without inference of the represented type */
export type SomeJTDSchemaType = (// ref
{
    ref: string;
} | {
    type: NumberType | StringType | "boolean";
} | {
    enum: string[];
} | {
    elements: SomeJTDSchemaType;
} | {
    values: SomeJTDSchemaType;
} | {
    properties: Record<string, SomeJTDSchemaType>;
    optionalProperties?: Record<string, SomeJTDSchemaType>;
    additionalProperties?: boolean;
} | {
    properties?: Record<string, SomeJTDSchemaType>;
    optionalProperties: Record<string, SomeJTDSchemaType>;
    additionalProperties?: boolean;
} | {
    discriminator: string;
    mapping: Record<string, SomeJTDSchemaType>;
} | {}) & {
    nullable?: boolean;
    metadata?: Record<string, unknown>;
    definitions?: Record<string, SomeJTDSchemaType>;
};
/** required keys of an object, not undefined */
type RequiredKeys<T> = {
    [K in keyof T]-?: undefined extends T[K] ? never : K;
}[keyof T];
/** optional or undifined-able keys of an object */
type OptionalKeys<T> = {
    [K in keyof T]-?: undefined extends T[K] ? K : never;
}[keyof T];
/** type is true if T is a union type */
type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
type IsUnion<T> = IsUnion_<T>;
/** type is true if T is identically E */
type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
/** type is true if T or null is identically E or null*/
type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
/** gets only the string literals of a type or null if a type isn't a string literal */
type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
/** true if type is a union of string literals */
type IsEnum<T> = null extends EnumString<T> ? false : true;
/** true only if all types are array types (not tuples) */
type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
/** true if the the type is a values type */
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false;
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T> ? null extends EnumString<keyof T> ? false : true : false;
/** true if type represents an empty record */
type IsEmptyRecord<T> = [T] extends [Record<string, never>] ? [T] extends [never] ? false : true : false;
/** actual schema */
export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
(null extends EnumString<keyof D> ? never : ({
    [K in keyof D]: [T] extends [D[K]] ? {
        ref: K;
    } : never;
}[keyof D] & {
    nullable?: false;
}) | (null extends T ? {
    [K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>] ? {
        ref: K;
    } : never;
}[keyof D] & {
    nullable: true;
} : never)) | (unknown extends T ? {
    nullable?: boolean;
} : never) | ((true extends NullTypeEquality<T, number> ? {
    type: NumberType;
} : true extends NullTypeEquality<T, boolean> ? {
    type: "boolean";
} : true extends NullTypeEquality<T, string> ? {
    type: StringType;
} : true extends NullTypeEquality<T, Date> ? {
    type: "timestamp";
} : true extends IsEnum<Exclude<T, null>> ? {
    enum: EnumString<Exclude<T, null>>[];
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
    elements: JTDSchemaType<E, D>;
} : never : true extends IsEmptyRecord<Exclude<T, null>> ? {
    properties: Record<string, never>;
    optionalProperties?: Record<string, never>;
} | {
    optionalProperties: Record<string, never>;
} : true extends IsValues<Exclude<T, null>> ? T extends Record<string, infer V> ? {
    values: JTDSchemaType<V, D>;
} : never : true extends IsRecord<Exclude<T, null>, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
    properties?: Record<string, never>;
} : {
    properties: {
        [K in RequiredKeys<T>]: JTDSchemaType<T[K], D>;
    };
}) & ([OptionalKeys<Exclude<T, null>>] extends [never] ? {
    optionalProperties?: Record<string, never>;
} : {
    optionalProperties: {
        [K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D>;
    };
}) & {
    additionalProperties?: boolean;
} : true extends IsRecord<Exclude<T, null>, true> ? {
    [K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
        discriminator: K;
        mapping: {
            [M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends Record<K, M> ? T : never, K>, D>;
        };
    } : never;
}[keyof Exclude<T, null>] : never) & (null extends T ? {
    nullable: true;
} : {
    nullable?: false;
}))) & {
    metadata?: Record<string, unknown>;
    definitions?: {
        [K in keyof D]: JTDSchemaType<D[K], D>;
    };
};
type JTDDataDef<S, D extends Record<string, unknown>> = // ref
(S extends {
    ref: string;
} ? D extends {
    [K in S["ref"]]: infer V;
} ? JTDDataDef<V, D> : never : S extends {
    type: NumberType;
} ? number : S extends {
    type: "boolean";
} ? boolean : S extends {
    type: "string";
} ? string : S extends {
    type: "timestamp";
} ? string | Date : S extends {
    enum: readonly (infer E)[];
} ? string extends E ? never : [E] extends [string] ? E : never : S extends {
    elements: infer E;
} ? JTDDataDef<E, D>[] : S extends {
    properties: Record<string, unknown>;
    optionalProperties?: Record<string, unknown>;
    additionalProperties?: boolean;
} ? {
    -readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
} & {
    -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
    properties?: Record<string, unknown>;
    optionalProperties: Record<string, unknown>;
    additionalProperties?: boolean;
} ? {
    -readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
} & {
    -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
    values: infer V;
} ? Record<string, JTDDataDef<V, D>> : S extends {
    discriminator: infer M;
    mapping: Record<string, unknown>;
} ? [M] extends [string] ? {
    [K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & {
        [KM in M]: K;
    };
}[keyof S["mapping"]] : never : unknown) | (S extends {
    nullable: true;
} ? null : never);
export type JTDDataType<S> = S extends {
    definitions: Record<string, unknown>;
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=jtd-schema.js.map{"version":3,"file":"jtd-schema.js","sourceRoot":"","sources":["../../lib/types/jtd-schema.ts"],"names":[],"mappings":""}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
export type AdditionalItemsError = ErrorObject<"additionalItems", {
    limit: number;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export declare function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateAdditionalItems = void 0;
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
    params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
    keyword: "additionalItems",
    type: "array",
    schemaType: ["boolean", "object"],
    before: "uniqueItems",
    error,
    code(cxt) {
        const { parentSchema, it } = cxt;
        const { items } = parentSchema;
        if (!Array.isArray(items)) {
            (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
            return;
        }
        validateAdditionalItems(cxt, items);
    },
};
function validateAdditionalItems(cxt, items) {
    const { gen, schema, data, keyword, it } = cxt;
    it.items = true;
    const len = gen.const("len", (0, codegen_1._) `${data}.length`);
    if (schema === false) {
        cxt.setParams({ len: items.length });
        cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);
    }
    else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
        const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var
        gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
        cxt.ok(valid);
    }
    function validateItems(valid) {
        gen.forRange("i", items.length, len, (i) => {
            cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
            if (!it.allErrors)
                gen.if((0, codegen_1.not)(valid), () => gen.break());
        });
    }
}
exports.validateAdditionalItems = validateAdditionalItems;
exports.default = def;
//# sourceMappingURL=additionalItems.js.map{"version":3,"file":"additionalItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/additionalItems.ts"],"names":[],"mappings":";;;AAOA,mDAAuD;AACvD,6CAA2E;AAI3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,iBAA0B;IACnC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9B,MAAM,EAAC,KAAK,EAAC,GAAG,YAAY,CAAA;QAC5B,IAAI,CAAC,KAAK,CAAC,OAAO,CA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MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YACzC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;YACpE,IAAI,CAAC,EAAE,CAAC,SAAS;gBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;QAC1D,CAAC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC;AAnBD,0DAmBC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, AddedKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type AdditionalPropertiesError = ErrorObject<"additionalProperties", {
    additionalProperty: string;
}, AnySchema>;
declare const def: CodeKeywordDefinition & AddedKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const util_1 = require("../../compile/util");
const error = {
    message: "must NOT have additional properties",
    params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,
};
const def = {
    keyword: "additionalProperties",
    type: ["object"],
    schemaType: ["boolean", "object"],
    allowUndefined: true,
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, data, errsCount, it } = cxt;
        /* istanbul ignore if */
        if (!errsCount)
            throw new Error("ajv implementation error");
        const { allErrors, opts } = it;
        it.props = true;
        if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
            return;
        const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
        const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
        checkAdditionalProperties();
        cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
        function checkAdditionalProperties() {
            gen.forIn("key", data, (key) => {
                if (!props.length && !patProps.length)
                    additionalPropertyCode(key);
                else
                    gen.if(isAdditional(key), () => additionalPropertyCode(key));
            });
        }
        function isAdditional(key) {
            let definedProp;
            if (props.length > 8) {
                // TODO maybe an option instead of hard-coded 8?
                const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
                definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
            }
            else if (props.length) {
                definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));
            }
            else {
                definedProp = codegen_1.nil;
            }
            if (patProps.length) {
                definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
            }
            return (0, codegen_1.not)(definedProp);
        }
        function deleteAdditional(key) {
            gen.code((0, codegen_1._) `delete ${data}[${key}]`);
        }
        function additionalPropertyCode(key) {
            if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
                deleteAdditional(key);
                return;
            }
            if (schema === false) {
                cxt.setParams({ additionalProperty: key });
                cxt.error();
                if (!allErrors)
                    gen.break();
                return;
            }
            if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
                const valid = gen.name("valid");
                if (opts.removeAdditional === "failing") {
                    applyAdditionalSchema(key, valid, false);
                    gen.if((0, codegen_1.not)(valid), () => {
                        cxt.reset();
                        deleteAdditional(key);
                    });
                }
                else {
                    applyAdditionalSchema(key, valid);
                    if (!allErrors)
                        gen.if((0, codegen_1.not)(valid), () => gen.break());
                }
            }
        }
        function applyAdditionalSchema(key, valid, errors) {
            const subschema = {
                keyword: "additionalProperties",
                dataProp: key,
                dataPropType: util_1.Type.Str,
            };
            if (errors === false) {
                Object.assign(subschema, {
                    compositeRule: true,
                    createErrors: false,
                    allErrors: false,
                });
            }
            cxt.subschema(subschema, valid);
        }
    },
};
exports.default = def;
//# sourceMappingURL=additionalProperties.js.map{"version":3,"file":"additionalProperties.js","sourceRoot":"","sources":["../../../lib/v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AAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;gBACvD,CAAC;YACH,CAAC;QACH,CAAC;QAED,SAAS,qBAAqB,CAAC,GAAS,EAAE,KAAW,EAAE,MAAc;YACnE,MAAM,SAAS,GAAkB;gBAC/B,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,GAAG;gBACb,YAAY,EAAE,WAAI,CAAC,GAAG;aACvB,CAAA;YACD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE;oBACvB,aAAa,EAAE,IAAI;oBACnB,YAAY,EAAE,KAAK;oBACnB,SAAS,EAAE,KAAK;iBACjB,CAAC,CAAA;YACJ,CAAC;YACD,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;QACjC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
    keyword: "allOf",
    schemaType: "array",
    code(cxt) {
        const { gen, schema, it } = cxt;
        /* istanbul ignore if */
        if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
        const valid = gen.name("valid");
        schema.forEach((sch, i) => {
            if ((0, util_1.alwaysValidSchema)(it, sch))
                return;
            const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
            cxt.ok(valid);
            cxt.mergeEvaluated(schCxt);
        });
    },
};
exports.default = def;
//# sourceMappingURL=allOf.js.map{"version":3,"file":"allOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/allOf.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;YAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;gBAAE,OAAM;YACtC,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAAC,EAAE,KAAK,CAAC,CAAA;YACtE,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;YACb,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const def = {
    keyword: "anyOf",
    schemaType: "array",
    trackErrors: true,
    code: code_1.validateUnion,
    error: { message: "must match a schema in anyOf" },
};
exports.default = def;
//# sourceMappingURL=anyOf.js.map{"version":3,"file":"anyOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/anyOf.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAIrC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type ContainsError = ErrorObject<"contains", {
    minContains: number;
    maxContains?: number;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { min, max } }) => max === undefined
        ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`
        : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,
    params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,
};
const def = {
    keyword: "contains",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        let min;
        let max;
        const { minContains, maxContains } = parentSchema;
        if (it.opts.next) {
            min = minContains === undefined ? 1 : minContains;
            max = maxContains;
        }
        else {
            min = 1;
        }
        const len = gen.const("len", (0, codegen_1._) `${data}.length`);
        cxt.setParams({ min, max });
        if (max === undefined && min === 0) {
            (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
            return;
        }
        if (max !== undefined && min > max) {
            (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
            cxt.fail();
            return;
        }
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
            let cond = (0, codegen_1._) `${len} >= ${min}`;
            if (max !== undefined)
                cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;
            cxt.pass(cond);
            return;
        }
        it.items = true;
        const valid = gen.name("valid");
        if (max === undefined && min === 1) {
            validateItems(valid, () => gen.if(valid, () => gen.break()));
        }
        else if (min === 0) {
            gen.let(valid, true);
            if (max !== undefined)
                gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);
        }
        else {
            gen.let(valid, false);
            validateItemsWithCount();
        }
        cxt.result(valid, () => cxt.reset());
        function validateItemsWithCount() {
            const schValid = gen.name("_valid");
            const count = gen.let("count", 0);
            validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
        }
        function validateItems(_valid, block) {
            gen.forRange("i", 0, len, (i) => {
                cxt.subschema({
                    keyword: "contains",
                    dataProp: i,
                    dataPropType: util_1.Type.Num,
                    compositeRule: true,
                }, _valid);
                block();
            });
        }
        function checkLimits(count) {
            gen.code((0, codegen_1._) `${count}++`);
            if (max === undefined) {
                gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());
            }
            else {
                gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());
                if (min === 1)
                    gen.assign(valid, true);
                else
                    gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));
            }
        }
    },
};
exports.default = def;
//# sourceMappingURL=contains.js.map{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/contains.ts"],"names":[],"mappings":";;AAOA,mDAAkD;AAClD,6CAA2E;AAQ3E,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAAC,EAAE,EAAE,CAChC,GAAG,KAAK,SAAS;QACf,CAAC,CAAC,IAAA,aAAG,EAAA,yBAAyB,GAAG,gBAAgB;QACjD,CAAC,CAAC,IAAA,aAAG,EAAA,yBAAyB,GAAG,qBAAqB,GAAG,gBAAgB;IAC7E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAE,GAAG,EAAC,EAAC,EAAE,EAAE,CAC/B,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,iBAAiB,GAAG,kBAAkB,GAAG,GAAG;CAC/F,CAAA;AAED,M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CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;YACnE,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaMap, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
export type PropertyDependencies = {
    [K in string]?: string[];
};
export interface DependenciesErrorParams {
    property: string;
    missingProperty: string;
    depsCount: number;
    deps: string;
}
export type DependenciesError = ErrorObject<"dependencies", DependenciesErrorParams, {
    [K in string]?: string[] | AnySchema;
}>;
export declare const error: KeywordErrorDefinition;
declare const def: CodeKeywordDefinition;
export declare function validatePropertyDeps(cxt: KeywordCxt, propertyDeps?: {
    [K in string]?: string[];
}): void;
export declare function validateSchemaDeps(cxt: KeywordCxt, schemaDeps?: SchemaMap): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
exports.error = {
    message: ({ params: { property, depsCount, deps } }) => {
        const property_ies = depsCount === 1 ? "property" : "properties";
        return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;
    },
    params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},
    missingProperty: ${missingProperty},
    depsCount: ${depsCount},
    deps: ${deps}}`, // TODO change to reference
};
const def = {
    keyword: "dependencies",
    type: "object",
    schemaType: "object",
    error: exports.error,
    code(cxt) {
        const [propDeps, schDeps] = splitDependencies(cxt);
        validatePropertyDeps(cxt, propDeps);
        validateSchemaDeps(cxt, schDeps);
    },
};
function splitDependencies({ schema }) {
    const propertyDeps = {};
    const schemaDeps = {};
    for (const key in schema) {
        if (key === "__proto__")
            continue;
        const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
        deps[key] = schema[key];
    }
    return [propertyDeps, schemaDeps];
}
function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
    const { gen, data, it } = cxt;
    if (Object.keys(propertyDeps).length === 0)
        return;
    const missing = gen.let("missing");
    for (const prop in propertyDeps) {
        const deps = propertyDeps[prop];
        if (deps.length === 0)
            continue;
        const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
        cxt.setParams({
            property: prop,
            depsCount: deps.length,
            deps: deps.join(", "),
        });
        if (it.allErrors) {
            gen.if(hasProperty, () => {
                for (const depProp of deps) {
                    (0, code_1.checkReportMissingProp)(cxt, depProp);
                }
            });
        }
        else {
            gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
            (0, code_1.reportMissingProp)(cxt, missing);
            gen.else();
        }
    }
}
exports.validatePropertyDeps = validatePropertyDeps;
function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
    const { gen, data, keyword, it } = cxt;
    const valid = gen.name("valid");
    for (const prop in schemaDeps) {
        if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
            continue;
        gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {
            const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
            cxt.mergeValidEvaluated(schCxt, valid);
        }, () => gen.var(valid, true) // TODO var
        );
        cxt.ok(valid);
    }
}
exports.validateSchemaDeps = validateSchemaDeps;
exports.default = def;
//# sourceMappingURL=dependencies.js.map{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependencies.ts"],"names":[],"mappings":";;;AAQA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAmG;AAmBtF,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAC,EAAC,EAAE,EAAE;QACjD,MAAM,YAAY,GAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,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B,CAAC,GAAe,EAAE,aAAwB,GAAG,CAAC,MAAM;IACpF,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAc,CAAC;YAAE,SAAQ;QAClE,GAAG,CAAC,EAAE,CACJ,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EACtD,GAAG,EAAE;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;YAChE,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;QACxC,CAAC,EACD,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,WAAW;SACvC,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;AACH,CAAC;AAfD,gDAeC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependencies_1 = require("./dependencies");
const def = {
    keyword: "dependentSchemas",
    type: "object",
    schemaType: "object",
    code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt),
};
exports.default = def;
//# sourceMappingURL=dependentSchemas.js.map{"version":3,"file":"dependentSchemas.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/dependentSchemas.ts"],"names":[],"mappings":";;AACA,iDAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAkB,EAAC,GAAG,CAAC;CACvC,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type IfKeywordError = ErrorObject<"if", {
    failingKeyword: string;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`,
    params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,
};
const def = {
    keyword: "if",
    schemaType: ["object", "boolean"],
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, parentSchema, it } = cxt;
        if (parentSchema.then === undefined && parentSchema.else === undefined) {
            (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
        }
        const hasThen = hasSchema(it, "then");
        const hasElse = hasSchema(it, "else");
        if (!hasThen && !hasElse)
            return;
        const valid = gen.let("valid", true);
        const schValid = gen.name("_valid");
        validateIf();
        cxt.reset();
        if (hasThen && hasElse) {
            const ifClause = gen.let("ifClause");
            cxt.setParams({ ifClause });
            gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
        }
        else if (hasThen) {
            gen.if(schValid, validateClause("then"));
        }
        else {
            gen.if((0, codegen_1.not)(schValid), validateClause("else"));
        }
        cxt.pass(valid, () => cxt.error(true));
        function validateIf() {
            const schCxt = cxt.subschema({
                keyword: "if",
                compositeRule: true,
                createErrors: false,
                allErrors: false,
            }, schValid);
            cxt.mergeEvaluated(schCxt);
        }
        function validateClause(keyword, ifClause) {
            return () => {
                const schCxt = cxt.subschema({ keyword }, schValid);
                gen.assign(valid, schValid);
                cxt.mergeValidEvaluated(schCxt, valid);
                if (ifClause)
                    gen.assign(ifClause, (0, codegen_1._) `${keyword}`);
                else
                    cxt.setParams({ ifClause: keyword });
            };
        }
    },
};
function hasSchema(it, keyword) {
    const schema = it.schema[keyword];
    return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);
}
exports.default = def;
//# sourceMappingURL=if.js.map{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/if.ts"],"names":[],"mappings":";;AAQA,mDAAuD;AACvD,6CAAqE;AAIrE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,eAAe,MAAM,CAAC,QAAQ,UAAU;IAClE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAAoB,MAAM,CAAC,QAAQ,GAAG;CAC9D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACvE,IAAA,sBAAe,EAAC,EAAE,EAAE,2CAA2C,CAAC,CAAA;QAClE,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QACrC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO;YAAE,OAAM;QAEhC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACpC,MAAM,QA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C,KAAK,EAAE,QAAQ,CAAC,CAAA;gBAC3B,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;gBACtC,IAAI,QAAQ;oBAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAA,WAAC,EAAA,GAAG,OAAO,EAAE,CAAC,CAAA;;oBAC5C,GAAG,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,CAAC,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAS,SAAS,CAAC,EAAgB,EAAE,OAAe;IAClD,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO,MAAM,KAAK,SAAS,IAAI,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAA;AAC/D,CAAC;AAED,kBAAe,GAAG,CAAA"}import type { ErrorNoParams, Vocabulary } from "../../types";
import { AdditionalItemsError } from "./additionalItems";
import { ItemsError } from "./items2020";
import { ContainsError } from "./contains";
import { DependenciesError } from "./dependencies";
import { PropertyNamesError } from "./propertyNames";
import { AdditionalPropertiesError } from "./additionalProperties";
import { NotKeywordError } from "./not";
import { AnyOfError } from "./anyOf";
import { OneOfError } from "./oneOf";
import { IfKeywordError } from "./if";
export default function getApplicator(draft2020?: boolean): Vocabulary;
export type ApplicatorKeywordError = ErrorNoParams<"false schema"> | AdditionalItemsError | ItemsError | ContainsError | AdditionalPropertiesError | DependenciesError | IfKeywordError | AnyOfError | OneOfError | NotKeywordError | PropertyNamesError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const additionalItems_1 = require("./additionalItems");
const prefixItems_1 = require("./prefixItems");
const items_1 = require("./items");
const items2020_1 = require("./items2020");
const contains_1 = require("./contains");
const dependencies_1 = require("./dependencies");
const propertyNames_1 = require("./propertyNames");
const additionalProperties_1 = require("./additionalProperties");
const properties_1 = require("./properties");
const patternProperties_1 = require("./patternProperties");
const not_1 = require("./not");
const anyOf_1 = require("./anyOf");
const oneOf_1 = require("./oneOf");
const allOf_1 = require("./allOf");
const if_1 = require("./if");
const thenElse_1 = require("./thenElse");
function getApplicator(draft2020 = false) {
    const applicator = [
        // any
        not_1.default,
        anyOf_1.default,
        oneOf_1.default,
        allOf_1.default,
        if_1.default,
        thenElse_1.default,
        // object
        propertyNames_1.default,
        additionalProperties_1.default,
        dependencies_1.default,
        properties_1.default,
        patternProperties_1.default,
    ];
    // array
    if (draft2020)
        applicator.push(prefixItems_1.default, items2020_1.default);
    else
        applicator.push(additionalItems_1.default, items_1.default);
    applicator.push(contains_1.default);
    return applicator;
}
exports.default = getApplicator;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/index.ts"],"names":[],"mappings":";;AACA,uDAAuE;AACvE,+CAAuC;AACvC,mCAA2B;AAC3B,2CAAiD;AACjD,yCAAkD;AAClD,iDAA8D;AAC9D,mDAAiE;AACjE,iEAAsF;AACtF,6CAAqC;AACrC,2DAAmD;AACnD,+BAAiD;AACjD,mCAAyC;AACzC,mCAAyC;AACzC,mCAA2B;AAC3B,6BAA8C;AAC9C,yCAAiC;AAEjC,SAAwB,aAAa,CAAC,SAAS,GAAG,KAAK;IACrD,MAAM,UAAU,GAAG;QACjB,MAAM;QACN,aAAU;QACV,eAAK;QACL,eAAK;QACL,eAAK;QACL,YAAS;QACT,kBAAQ;QACR,SAAS;QACT,uBAAa;QACb,8BAAoB;QACpB,sBAAY;QACZ,oBAAU;QACV,2BAAiB;KAClB,CAAA;IACD,QAAQ;IACR,IAAI,SAAS;QAAE,UAAU,CAAC,IAAI,CAAC,qBAAW,EAAE,mBAAS,CAAC,CAAA;;QACjD,UAAU,CAAC,IAAI,CAAC,yBAAe,EAAE,eAAK,CAAC,CAAA;IAC5C,UAAU,CAAC,IAAI,CAAC,kBAAQ,CAAC,CAAA;IACzB,OAAO,UAAU,CAAA;AACnB,CAAC;AArBD,gCAqBC"}import type { CodeKeywordDefinition, AnySchema } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function validateTuple(cxt: KeywordCxt, extraItems: string, schArr?: AnySchema[]): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateTuple = void 0;
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
const def = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "array", "boolean"],
    before: "uniqueItems",
    code(cxt) {
        const { schema, it } = cxt;
        if (Array.isArray(schema))
            return validateTuple(cxt, "additionalItems", schema);
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        cxt.ok((0, code_1.validateArray)(cxt));
    },
};
function validateTuple(cxt, extraItems, schArr = cxt.schema) {
    const { gen, parentSchema, data, keyword, it } = cxt;
    checkStrictTuple(parentSchema);
    if (it.opts.unevaluated && schArr.length && it.items !== true) {
        it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
    }
    const valid = gen.name("valid");
    const len = gen.const("len", (0, codegen_1._) `${data}.length`);
    schArr.forEach((sch, i) => {
        if ((0, util_1.alwaysValidSchema)(it, sch))
            return;
        gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({
            keyword,
            schemaProp: i,
            dataProp: i,
        }, valid));
        cxt.ok(valid);
    });
    function checkStrictTuple(sch) {
        const { opts, errSchemaPath } = it;
        const l = schArr.length;
        const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
        if (opts.strictTuples && !fullTuple) {
            const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
            (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
        }
    }
}
exports.validateTuple = validateTuple;
exports.default = def;
//# sourceMappingURL=items.js.map{"version":3,"file":"items.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items.ts"],"names":[],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,IAAI,SAAS,CAAC,CAAA;IAC/C,MAAM,CAAC,OAAO,CAAC,CAAC,GAAc,EAAE,CAAS,EAAE,EAAE;QAC3C,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,GAAG,CAAC;YAAE,OAAM;QACtC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAC5B,GAAG,CAAC,SAAS,CACX;YACE,OAAO;YACP,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE,CAAC;SACZ,EACD,KAAK,CACN,CACF,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC,CAAC,CAAA;IAEF,SAAS,gBAAgB,CAAC,GAAoB;QAC5C,MAAM,EAAC,IAAI,EAAE,aAAa,EAAC,GAAG,EAAE,CAAA;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAA;QACvB,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,KAAK,CAAC,CAAA;QACzF,IAAI,IAAI,CAAC,YAAY,IAAI,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,GAAG,GAAG,IAAI,OAAO,QAAQ,CAAC,oCAAoC,UAAU,4CAA4C,aAAa,GAAG,CAAA;YAC1I,IAAA,sBAAe,EAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAA;QAC7C,CAAC;IACH,CAAC;AACH,CAAC;AApCD,sCAoCC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type ItemsError = ErrorObject<"items", {
    limit: number;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const code_1 = require("../code");
const additionalItems_1 = require("./additionalItems");
const error = {
    message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
    params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
    keyword: "items",
    type: "array",
    schemaType: ["object", "boolean"],
    before: "uniqueItems",
    error,
    code(cxt) {
        const { schema, parentSchema, it } = cxt;
        const { prefixItems } = parentSchema;
        it.items = true;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        if (prefixItems)
            (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
        else
            cxt.ok((0, code_1.validateArray)(cxt));
    },
};
exports.default = def;
//# sourceMappingURL=items2020.js.map{"version":3,"file":"items2020.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/items2020.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AACpD,kCAAqC;AACrC,uDAAyD;AAIzD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,2BAA2B,GAAG,QAAQ;IACvE,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,GAAG,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,GAAG,GAAG;CAChD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,MAAM,EAAE,aAAa;IACrB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtC,MAAM,EAAC,WAAW,EAAC,GAAG,YAAY,CAAA;QAClC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QACf,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,IAAI,WAAW;YAAE,IAAA,yCAAuB,EAAC,GAAG,EAAE,WAAW,CAAC,CAAA;;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,CAAA;IACjC,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorNoParams, AnySchema } from "../../types";
export type NotKeywordError = ErrorNoParams<"not", AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
    keyword: "not",
    schemaType: ["object", "boolean"],
    trackErrors: true,
    code(cxt) {
        const { gen, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
            cxt.fail();
            return;
        }
        const valid = gen.name("valid");
        cxt.subschema({
            keyword: "not",
            compositeRule: true,
            createErrors: false,
            allErrors: false,
        }, valid);
        cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
    },
    error: { message: "must NOT be valid" },
};
exports.default = def;
//# sourceMappingURL=not.js.map{"version":3,"file":"not.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/not.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AAIpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,WAAW,EAAE,IAAI;IACjB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,IAAI,EAAE,CAAA;YACV,OAAM;QACR,CAAC;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CACX;YACE,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;YACnB,SAAS,EAAE,KAAK;SACjB,EACD,KAAK,CACN,CAAA;QAED,GAAG,CAAC,UAAU,CACZ,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CAAA;IACH,CAAC;IACD,KAAK,EAAE,EAAC,OAAO,EAAE,mBAAmB,EAAC;CACtC,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type OneOfError = ErrorObject<"oneOf", {
    passingSchemas: [number, number] | null;
}, AnySchema[]>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: "must match exactly one schema in oneOf",
    params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,
};
const def = {
    keyword: "oneOf",
    schemaType: "array",
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, parentSchema, it } = cxt;
        /* istanbul ignore if */
        if (!Array.isArray(schema))
            throw new Error("ajv implementation error");
        if (it.opts.discriminator && parentSchema.discriminator)
            return;
        const schArr = schema;
        const valid = gen.let("valid", false);
        const passing = gen.let("passing", null);
        const schValid = gen.name("_valid");
        cxt.setParams({ passing });
        // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas
        gen.block(validateOneOf);
        cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
        function validateOneOf() {
            schArr.forEach((sch, i) => {
                let schCxt;
                if ((0, util_1.alwaysValidSchema)(it, sch)) {
                    gen.var(schValid, true);
                }
                else {
                    schCxt = cxt.subschema({
                        keyword: "oneOf",
                        schemaProp: i,
                        compositeRule: true,
                    }, schValid);
                }
                if (i > 0) {
                    gen
                        .if((0, codegen_1._) `${schValid} && ${valid}`)
                        .assign(valid, false)
                        .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)
                        .else();
                }
                gen.if(schValid, () => {
                    gen.assign(valid, true);
                    gen.assign(passing, i);
                    if (schCxt)
                        cxt.mergeEvaluated(schCxt, codegen_1.Name);
                });
            });
        }
    },
};
exports.default = def;
//# sourceMappingURL=oneOf.js.map{"version":3,"file":"oneOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/oneOf.ts"],"names":[],"mappings":";;AAOA,mDAA6C;AAC7C,6CAAoD;AASpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,wCAAwC;IACjD,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,oBAAoB,MAAM,CAAC,OAAO,GAAG;CAC7D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,wBAAwB;QACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;QACvE,IAAI,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,YAAY,CAAC,aAAa;YAAE,OAAM;QAC/D,MAAM,MAAM,GAAgB,MAAM,CAAA;QAClC,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,MAAM,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACnC,GAAG,CAAC,SAAS,CAAC,EAAC,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CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const util_2 = require("../../compile/util");
const def = {
    keyword: "patternProperties",
    type: "object",
    schemaType: "object",
    code(cxt) {
        const { gen, schema, data, parentSchema, it } = cxt;
        const { opts } = it;
        const patterns = (0, code_1.allSchemaProperties)(schema);
        const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
        if (patterns.length === 0 ||
            (alwaysValidPatterns.length === patterns.length &&
                (!it.opts.unevaluated || it.props === true))) {
            return;
        }
        const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
        const valid = gen.name("valid");
        if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
            it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
        }
        const { props } = it;
        validatePatternProperties();
        function validatePatternProperties() {
            for (const pat of patterns) {
                if (checkProperties)
                    checkMatchingProperties(pat);
                if (it.allErrors) {
                    validateProperties(pat);
                }
                else {
                    gen.var(valid, true); // TODO var
                    validateProperties(pat);
                    gen.if(valid);
                }
            }
        }
        function checkMatchingProperties(pat) {
            for (const prop in checkProperties) {
                if (new RegExp(pat).test(prop)) {
                    (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
                }
            }
        }
        function validateProperties(pat) {
            gen.forIn("key", data, (key) => {
                gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
                    const alwaysValid = alwaysValidPatterns.includes(pat);
                    if (!alwaysValid) {
                        cxt.subschema({
                            keyword: "patternProperties",
                            schemaProp: pat,
                            dataProp: key,
                            dataPropType: util_2.Type.Str,
                        }, valid);
                    }
                    if (it.opts.unevaluated && props !== true) {
                        gen.assign((0, codegen_1._) `${props}[${key}]`, true);
                    }
                    else if (!alwaysValid && !it.allErrors) {
                        // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)
                        // or if all properties were evaluated (props === true)
                        gen.if((0, codegen_1.not)(valid), () => gen.break());
                    }
                });
            });
        }
    },
};
exports.default = def;
//# sourceMappingURL=patternProperties.js.map{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBAC7C,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAC9C,CAAC;YACD,OAAM;QACR,CAAC;QAED,MAAM,eAAe,GACnB,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,YAAY,CAAC,UAAU,CAA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AAA,GAAG,IAAA,iBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,EAAE;oBACnD,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;oBACrD,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,GAAG,CAAC,SAAS,CACX;4BACE,OAAO,EAAE,mBAAmB;4BAC5B,UAAU,EAAE,GAAG;4BACf,QAAQ,EAAE,GAAG;4BACb,YAAY,EAAE,WAAI,CAAC,GAAG;yBACvB,EACD,KAAK,CACN,CAAA;oBACH,CAAC;oBAED,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;wBAC1C,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;oBACvC,CAAC;yBAAM,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC;wBACzC,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;oBACvC,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const items_1 = require("./items");
const def = {
    keyword: "prefixItems",
    type: "array",
    schemaType: ["array"],
    before: "uniqueItems",
    code: (cxt) => (0, items_1.validateTuple)(cxt, "items"),
};
exports.default = def;
//# sourceMappingURL=prefixItems.js.map{"version":3,"file":"prefixItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/prefixItems.ts"],"names":[],"mappings":";;AACA,mCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,qBAAa,EAAC,GAAG,EAAE,OAAO,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const validate_1 = require("../../compile/validate");
const code_1 = require("../code");
const util_1 = require("../../compile/util");
const additionalProperties_1 = require("./additionalProperties");
const def = {
    keyword: "properties",
    type: "object",
    schemaType: "object",
    code(cxt) {
        const { gen, schema, parentSchema, data, it } = cxt;
        if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
            additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
        }
        const allProps = (0, code_1.allSchemaProperties)(schema);
        for (const prop of allProps) {
            it.definedProperties.add(prop);
        }
        if (it.opts.unevaluated && allProps.length && it.props !== true) {
            it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
        }
        const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
        if (properties.length === 0)
            return;
        const valid = gen.name("valid");
        for (const prop of properties) {
            if (hasDefault(prop)) {
                applyPropertySchema(prop);
            }
            else {
                gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
                applyPropertySchema(prop);
                if (!it.allErrors)
                    gen.else().var(valid, true);
                gen.endIf();
            }
            cxt.it.definedProperties.add(prop);
            cxt.ok(valid);
        }
        function hasDefault(prop) {
            return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;
        }
        function applyPropertySchema(prop) {
            cxt.subschema({
                keyword: "properties",
                schemaProp: prop,
                dataProp: prop,
            }, valid);
        }
    },
};
exports.default = def;
//# sourceMappingURL=properties.js.map{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/properties.ts"],"names":[],"mappings":";;AACA,qDAAiD;AACjD,kCAA2D;AAC3D,6CAA4E;AAC5E,iEAA0C;AAE1C,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,YAAY,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAC1F,8BAAK,CAAC,IAAI,CAAC,IAAI,qBAAU,CAAC,EAAE,EAAE,8BAAK,EAAE,sBAAsB,CAAC,CAAC,CAAA;QAC/D,CAAC;QACD,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QACD,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YAChE,EAAE,CAAC,KAAK,GAAG,qBAAc,CAAC,KAAK,CAAC,GAAG,EAAE,IAAA,aAAM,EAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;QAClE,CAAC;QACD,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAA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ames", {
    propertyName: string;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: "property name must be valid",
    params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,
};
const def = {
    keyword: "propertyNames",
    type: "object",
    schemaType: ["object", "boolean"],
    error,
    code(cxt) {
        const { gen, schema, data, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        const valid = gen.name("valid");
        gen.forIn("key", data, (key) => {
            cxt.setParams({ propertyName: key });
            cxt.subschema({
                keyword: "propertyNames",
                data: key,
                dataTypes: ["string"],
                propertyName: key,
                compositeRule: true,
            }, valid);
            gen.if((0, codegen_1.not)(valid), () => {
                cxt.error(true);
                if (!it.allErrors)
                    gen.break();
            });
        });
        cxt.ok(valid);
    },
};
exports.default = def;
//# sourceMappingURL=propertyNames.js.map{"version":3,"file":"propertyNames.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/propertyNames.ts"],"names":[],"mappings":";;AAOA,mDAA4C;AAC5C,6CAAoD;AAIpD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,MAAM,CAAC,YAAY,GAAG;CAChE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAE/B,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC7B,GAAG,CAAC,SAAS,CAAC,EAAC,YAAY,EAAE,GAAG,EAAC,CAAC,CAAA;YAClC,GAAG,CAAC,SAAS,CACX;gBACE,OAAO,EAAE,eAAe;gBACxB,IAAI,EAAE,GAAG;gBACT,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,YAAY,EAAE,GAAG;gBACjB,aAAa,EAAE,IAAI;aACpB,EACD,KAAK,CACN,CAAA;YACD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;gBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACf,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,KAAK,EAAE,CAAA;YAChC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;QAEF,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
    keyword: ["then", "else"],
    schemaType: ["object", "boolean"],
    code({ keyword, parentSchema, it }) {
        if (parentSchema.if === undefined)
            (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
    },
};
exports.default = def;
//# sourceMappingURL=thenElse.js.map{"version":3,"file":"thenElse.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/thenElse.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACjC,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,EAAE,KAAK,SAAS;YAAE,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,2BAA2B,CAAC,CAAA;IAChG,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { SchemaMap } from "../types";
import type { SchemaCxt } from "../compile";
import type { KeywordCxt } from "../compile/validate";
import { CodeGen, Code, Name } from "../compile/codegen";
export declare function checkReportMissingProp(cxt: KeywordCxt, prop: string): void;
export declare function checkMissingProp({ gen, data, it: { opts } }: KeywordCxt, properties: string[], missing: Name): Code;
export declare function reportMissingProp(cxt: KeywordCxt, missing: Name): void;
export declare function hasPropFunc(gen: CodeGen): Name;
export declare function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code;
export declare function propertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code;
export declare function noPropertyInData(gen: CodeGen, data: Name, property: Name | string, ownProperties?: boolean): Code;
export declare function allSchemaProperties(schemaMap?: SchemaMap): string[];
export declare function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[];
export declare function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }: KeywordCxt, func: Code, context: Code, passSchema?: boolean): Code;
export declare function usePattern({ gen, it: { opts } }: KeywordCxt, pattern: string): Name;
export declare function validateArray(cxt: KeywordCxt): Name;
export declare function validateUnion(cxt: KeywordCxt): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
const codegen_1 = require("../compile/codegen");
const util_1 = require("../compile/util");
const names_1 = require("../compile/names");
const util_2 = require("../compile/util");
function checkReportMissingProp(cxt, prop) {
    const { gen, data, it } = cxt;
    gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
        cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);
        cxt.error();
    });
}
exports.checkReportMissingProp = checkReportMissingProp;
function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
    return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));
}
exports.checkMissingProp = checkMissingProp;
function reportMissingProp(cxt, missing) {
    cxt.setParams({ missingProperty: missing }, true);
    cxt.error();
}
exports.reportMissingProp = reportMissingProp;
function hasPropFunc(gen) {
    return gen.scopeValue("func", {
        // eslint-disable-next-line @typescript-eslint/unbound-method
        ref: Object.prototype.hasOwnProperty,
        code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,
    });
}
exports.hasPropFunc = hasPropFunc;
function isOwnProperty(gen, data, property) {
    return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;
}
exports.isOwnProperty = isOwnProperty;
function propertyInData(gen, data, property, ownProperties) {
    const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
    return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
}
exports.propertyInData = propertyInData;
function noPropertyInData(gen, data, property, ownProperties) {
    const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;
    return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
}
exports.noPropertyInData = noPropertyInData;
function allSchemaProperties(schemaMap) {
    return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
}
exports.allSchemaProperties = allSchemaProperties;
function schemaProperties(it, schemaMap) {
    return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
}
exports.schemaProperties = schemaProperties;
function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
    const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
    const valCxt = [
        [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
        [names_1.default.parentData, it.parentData],
        [names_1.default.parentDataProperty, it.parentDataProperty],
        [names_1.default.rootData, names_1.default.rootData],
    ];
    if (it.opts.dynamicRef)
        valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
    const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;
    return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;
}
exports.callValidateCode = callValidateCode;
const newRegExp = (0, codegen_1._) `new RegExp`;
function usePattern({ gen, it: { opts } }, pattern) {
    const u = opts.unicodeRegExp ? "u" : "";
    const { regExp } = opts.code;
    const rx = regExp(pattern, u);
    return gen.scopeValue("pattern", {
        key: rx.toString(),
        ref: rx,
        code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,
    });
}
exports.usePattern = usePattern;
function validateArray(cxt) {
    const { gen, data, keyword, it } = cxt;
    const valid = gen.name("valid");
    if (it.allErrors) {
        const validArr = gen.let("valid", true);
        validateItems(() => gen.assign(validArr, false));
        return validArr;
    }
    gen.var(valid, true);
    validateItems(() => gen.break());
    return valid;
    function validateItems(notValid) {
        const len = gen.const("len", (0, codegen_1._) `${data}.length`);
        gen.forRange("i", 0, len, (i) => {
            cxt.subschema({
                keyword,
                dataProp: i,
                dataPropType: util_1.Type.Num,
            }, valid);
            gen.if((0, codegen_1.not)(valid), notValid);
        });
    }
}
exports.validateArray = validateArray;
function validateUnion(cxt) {
    const { gen, schema, keyword, it } = cxt;
    /* istanbul ignore if */
    if (!Array.isArray(schema))
        throw new Error("ajv implementation error");
    const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
    if (alwaysValid && !it.opts.unevaluated)
        return;
    const valid = gen.let("valid", false);
    const schValid = gen.name("_valid");
    gen.block(() => schema.forEach((_sch, i) => {
        const schCxt = cxt.subschema({
            keyword,
            schemaProp: i,
            compositeRule: true,
        }, schValid);
        gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);
        const merged = cxt.mergeValidEvaluated(schCxt, schValid);
        // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
        // or if all properties and items were evaluated (it.props === true && it.items === true)
        if (!merged)
            gen.if((0, codegen_1.not)(valid));
    }));
    cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
}
exports.validateUnion = validateUnion;
//# sourceMappingURL=code.js.map{"version":3,"file":"code.js","sourceRoot":"","sources":["../../lib/vocabularies/code.ts"],"names":[],"mappings":";;;AAGA,gDAAoG;AACpG,0CAAuD;AACvD,4CAAgC;AAChC,0CAAuC;AACvC,SAAgB,sBAAsB,CAAC,GAAe,EAAE,IAAY;IAClE,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC3B,GAAG,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE;QACpE,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,EAAE,EAAC,EAAE,IAAI,CAAC,CAAA;QAClD,GAAG,CAAC,KAAK,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC;AAND,wDAMC;AAED,SAAgB,gBAAgB,CAC9B,EAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAC,IAAI,EAAC,EAAa,EACnC,UAAoB,EACpB,OAAa;IAEb,OAAO,IAAA,YAAE,EACP,GAAG,UAAU,CAAC,GAAG,CAAC,C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CAAC,MAAM,CACR,KAAK,EACL,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,EACjB,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CACtB,CAAA;AACH,CAAC;AAjCD,sCAiCC"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const def = {
    keyword: "id",
    code() {
        throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
    },
};
exports.default = def;
//# sourceMappingURL=id.js.map{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/id.ts"],"names":[],"mappings":";;AAEA,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,IAAI;IACb,IAAI;QACF,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { Vocabulary } from "../../types";
declare const core: Vocabulary;
export default core;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const id_1 = require("./id");
const ref_1 = require("./ref");
const core = [
    "$schema",
    "$id",
    "$defs",
    "$vocabulary",
    { keyword: "$comment" },
    "definitions",
    id_1.default,
    ref_1.default,
];
exports.default = core;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/index.ts"],"names":[],"mappings":";;AACA,6BAA4B;AAC5B,+BAA8B;AAE9B,MAAM,IAAI,GAAe;IACvB,SAAS;IACT,KAAK;IACL,OAAO;IACP,aAAa;IACb,EAAC,OAAO,EAAE,UAAU,EAAC;IACrB,aAAa;IACb,YAAS;IACT,aAAU;CACX,CAAA;AAED,kBAAe,IAAI,CAAA"}import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
import { Code } from "../../compile/codegen";
import { SchemaEnv } from "../../compile";
declare const def: CodeKeywordDefinition;
export declare function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code;
export declare function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.callRef = exports.getValidate = void 0;
const ref_error_1 = require("../../compile/ref_error");
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const compile_1 = require("../../compile");
const util_1 = require("../../compile/util");
const def = {
    keyword: "$ref",
    schemaType: "string",
    code(cxt) {
        const { gen, schema: $ref, it } = cxt;
        const { baseId, schemaEnv: env, validateName, opts, self } = it;
        const { root } = env;
        if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
            return callRootRef();
        const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
        if (schOrEnv === undefined)
            throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
        if (schOrEnv instanceof compile_1.SchemaEnv)
            return callValidate(schOrEnv);
        return inlineRefSchema(schOrEnv);
        function callRootRef() {
            if (env === root)
                return callRef(cxt, validateName, env, env.$async);
            const rootName = gen.scopeValue("root", { ref: root });
            return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);
        }
        function callValidate(sch) {
            const v = getValidate(cxt, sch);
            callRef(cxt, v, sch, sch.$async);
        }
        function inlineRefSchema(sch) {
            const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
            const valid = gen.name("valid");
            const schCxt = cxt.subschema({
                schema: sch,
                dataTypes: [],
                schemaPath: codegen_1.nil,
                topSchemaRef: schName,
                errSchemaPath: $ref,
            }, valid);
            cxt.mergeEvaluated(schCxt);
            cxt.ok(valid);
        }
    },
};
function getValidate(cxt, sch) {
    const { gen } = cxt;
    return sch.validate
        ? gen.scopeValue("validate", { ref: sch.validate })
        : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`;
}
exports.getValidate = getValidate;
function callRef(cxt, v, sch, $async) {
    const { gen, it } = cxt;
    const { allErrors, schemaEnv: env, opts } = it;
    const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
    if ($async)
        callAsyncRef();
    else
        callSyncRef();
    function callAsyncRef() {
        if (!env.$async)
            throw new Error("async schema referenced by sync schema");
        const valid = gen.let("valid");
        gen.try(() => {
            gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
            addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result
            if (!allErrors)
                gen.assign(valid, true);
        }, (e) => {
            gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
            addErrorsFrom(e);
            if (!allErrors)
                gen.assign(valid, false);
        });
        cxt.ok(valid);
    }
    function callSyncRef() {
        cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
    }
    function addErrorsFrom(source) {
        const errs = (0, codegen_1._) `${source}.errors`;
        gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged
        gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
    }
    function addEvaluatedFrom(source) {
        var _a;
        if (!it.opts.unevaluated)
            return;
        const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
        // TODO refactor
        if (it.props !== true) {
            if (schEvaluated && !schEvaluated.dynamicProps) {
                if (schEvaluated.props !== undefined) {
                    it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
                }
            }
            else {
                const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`);
                it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
            }
        }
        if (it.items !== true) {
            if (schEvaluated && !schEvaluated.dynamicItems) {
                if (schEvaluated.items !== undefined) {
                    it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
                }
            }
            else {
                const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`);
                it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
            }
        }
    }
}
exports.callRef = callRef;
exports.default = def;
//# sourceMappingURL=ref.js.map{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/core/ref.ts"],"names":[],"mappings":";;;AAEA,uDAAqD;AACrD,kCAAwC;AACxC,mDAAmE;AACnE,+CAAmC;AACnC,2CAAmD;AACnD,6CAAiD;AAEjD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,EAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QAC7D,MAAM,EAAC,IAAI,EAAC,GAAG,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM;YAAE,OAAO,WAAW,EAAE,CAAA;QACnF,MAAM,QAAQ,GAAG,oBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QAC1D,IAAI,QAAQ,KAAK,SAAS;YAAE,MAAM,IAAI,mBAAe,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;QACxF,IAAI,QAAQ,YAAY,mBAAS;YAAE,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAA;QAChE,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAA;QAEhC,SAAS,WAAW;YAClB,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAO,OAAO,CAAC,GAAG,EAAE,YAAY,EAAE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discriminator/types";
export type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const types_1 = require("../discriminator/types");
const compile_1 = require("../../compile");
const ref_error_1 = require("../../compile/ref_error");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
        ? `tag "${tagName}" must be string`
        : `value of tag "${tagName}" must be in oneOf`,
    params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
};
const def = {
    keyword: "discriminator",
    type: "object",
    schemaType: "object",
    error,
    code(cxt) {
        const { gen, data, schema, parentSchema, it } = cxt;
        const { oneOf } = parentSchema;
        if (!it.opts.discriminator) {
            throw new Error("discriminator: requires discriminator option");
        }
        const tagName = schema.propertyName;
        if (typeof tagName != "string")
            throw new Error("discriminator: requires propertyName");
        if (schema.mapping)
            throw new Error("discriminator: mapping is not supported");
        if (!oneOf)
            throw new Error("discriminator: requires oneOf keyword");
        const valid = gen.let("valid", false);
        const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
        gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
        cxt.ok(valid);
        function validateMapping() {
            const mapping = getMapping();
            gen.if(false);
            for (const tagValue in mapping) {
                gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
                gen.assign(valid, applyTagSchema(mapping[tagValue]));
            }
            gen.else();
            cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
            gen.endIf();
        }
        function applyTagSchema(schemaProp) {
            const _valid = gen.name("valid");
            const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
            cxt.mergeEvaluated(schCxt, codegen_1.Name);
            return _valid;
        }
        function getMapping() {
            var _a;
            const oneOfMapping = {};
            const topRequired = hasRequired(parentSchema);
            let tagRequired = true;
            for (let i = 0; i < oneOf.length; i++) {
                let sch = oneOf[i];
                if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
                    const ref = sch.$ref;
                    sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
                    if (sch instanceof compile_1.SchemaEnv)
                        sch = sch.schema;
                    if (sch === undefined)
                        throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
                }
                const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
                if (typeof propSch != "object") {
                    throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
                }
                tagRequired = tagRequired && (topRequired || hasRequired(sch));
                addMappings(propSch, i);
            }
            if (!tagRequired)
                throw new Error(`discriminator: "${tagName}" must be required`);
            return oneOfMapping;
            function hasRequired({ required }) {
                return Array.isArray(required) && required.includes(tagName);
            }
            function addMappings(sch, i) {
                if (sch.const) {
                    addMapping(sch.const, i);
                }
                else if (sch.enum) {
                    for (const tagValue of sch.enum) {
                        addMapping(tagValue, i);
                    }
                }
                else {
                    throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
                }
            }
            function addMapping(tagValue, i) {
                if (typeof tagValue != "string" || tagValue in oneOfMapping) {
                    throw new Error(`discriminator: "${tagName}" values must be unique strings`);
                }
                oneOfMapping[tagValue] = i;
            }
        }
    },
};
exports.default = def;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/index.ts"],"names":[],"mappings":";;AAEA,mDAA0D;AAC1D,kDAAgE;AAChE,2CAAmD;AACnD,uDAAqD;AACrD,6CAAuD;AAIvD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EA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,CAAC;YACD,IAAI,CAAC,WAAW;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,oBAAoB,CAAC,CAAA;YACjF,OAAO,YAAY,CAAA;YAEnB,SAAS,WAAW,CAAC,EAAC,QAAQ,EAAkB;gBAC9C,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,CAAC;YAED,SAAS,WAAW,CAAC,GAAoB,EAAE,CAAS;gBAClD,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;oBACd,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;gBAC1B,CAAC;qBAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;oBACpB,KAAK,MAAM,QAAQ,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;wBAChC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,+BAA+B,CAAC,CAAA;gBACvF,CAAC;YACH,CAAC;YAED,SAAS,UAAU,CAAC,QAAiB,EAAE,CAAS;gBAC9C,IAAI,OAAO,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC;oBAC5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,OAAO,iCAAiC,CAAC,CAAA;gBAC9E,CAAC;gBACD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;YAC5B,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { ErrorObject } from "../../types";
export declare enum DiscrError {
    Tag = "tag",
    Mapping = "mapping"
}
export type DiscrErrorObj<E extends DiscrError> = ErrorObject<"discriminator", {
    error: E;
    tag: string;
    tagValue: unknown;
}, string>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiscrError = void 0;
var DiscrError;
(function (DiscrError) {
    DiscrError["Tag"] = "tag";
    DiscrError["Mapping"] = "mapping";
})(DiscrError || (exports.DiscrError = DiscrError = {}));
//# sourceMappingURL=types.js.map{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/vocabularies/discriminator/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,iCAAmB,CAAA;AACrB,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB"}import type { Vocabulary } from "../types";
declare const draft2020Vocabularies: Vocabulary[];
export default draft2020Vocabularies;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const validation_1 = require("./validation");
const applicator_1 = require("./applicator");
const dynamic_1 = require("./dynamic");
const next_1 = require("./next");
const unevaluated_1 = require("./unevaluated");
const format_1 = require("./format");
const metadata_1 = require("./metadata");
const draft2020Vocabularies = [
    dynamic_1.default,
    core_1.default,
    validation_1.default,
    (0, applicator_1.default)(true),
    format_1.default,
    metadata_1.metadataVocabulary,
    metadata_1.contentVocabulary,
    next_1.default,
    unevaluated_1.default,
];
exports.default = draft2020Vocabularies;
//# sourceMappingURL=draft2020.js.map{"version":3,"file":"draft2020.js","sourceRoot":"","sources":["../../lib/vocabularies/draft2020.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,uCAAyC;AACzC,iCAAmC;AACnC,+CAAiD;AACjD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,qBAAqB,GAAiB;IAC1C,iBAAiB;IACjB,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,EAAC,IAAI,CAAC;IAC7B,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;IACjB,cAAc;IACd,qBAAqB;CACtB,CAAA;AAED,kBAAe,qBAAqB,CAAA"}import type { Vocabulary } from "../types";
declare const draft7Vocabularies: Vocabulary[];
export default draft7Vocabularies;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("./core");
const validation_1 = require("./validation");
const applicator_1 = require("./applicator");
const format_1 = require("./format");
const metadata_1 = require("./metadata");
const draft7Vocabularies = [
    core_1.default,
    validation_1.default,
    (0, applicator_1.default)(),
    format_1.default,
    metadata_1.metadataVocabulary,
    metadata_1.contentVocabulary,
];
exports.default = draft7Vocabularies;
//# sourceMappingURL=draft7.js.map{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"}import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicAnchor(cxt: KeywordCxt, anchor: string): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicAnchor = void 0;
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const compile_1 = require("../../compile");
const ref_1 = require("../core/ref");
const def = {
    keyword: "$dynamicAnchor",
    schemaType: "string",
    code: (cxt) => dynamicAnchor(cxt, cxt.schema),
};
function dynamicAnchor(cxt, anchor) {
    const { gen, it } = cxt;
    it.schemaEnv.root.dynamicAnchors[anchor] = true;
    const v = (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`;
    const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt);
    gen.if((0, codegen_1._) `!${v}`, () => gen.assign(v, validate));
}
exports.dynamicAnchor = dynamicAnchor;
function _getValidate(cxt) {
    const { schemaEnv, schema, self } = cxt.it;
    const { root, baseId, localRefs, meta } = schemaEnv.root;
    const { schemaId } = self.opts;
    const sch = new compile_1.SchemaEnv({ schema, schemaId, root, baseId, localRefs, meta });
    compile_1.compileSchema.call(self, sch);
    return (0, ref_1.getValidate)(cxt, sch);
}
exports.default = def;
//# sourceMappingURL=dynamicAnchor.js.map{"version":3,"file":"dynamicAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicAnchor.ts"],"names":[],"mappings":";;;AAEA,mDAA0D;AAC1D,+CAAmC;AACnC,2CAAsD;AACtD,qCAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,gBAAgB;IACzB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC9C,CAAA;AAED,SAAgB,aAAa,CAAC,GAAe,EAAE,MAAc;IAC3D,MAAM,EAAC,GAAG,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IACrB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;IAC/C,MAAM,CAAC,GAAG,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAA;IACtD,MAAM,QAAQ,GAAG,EAAE,CAAC,aAAa,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC/E,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;AACjD,CAAC;AAND,sCAMC;AAED,SAAS,YAAY,CAAC,GAAe;IACnC,MAAM,EAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAC,GAAG,GAAG,CAAC,EAAE,CAAA;IACxC,MAAM,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,SAAS,CAAC,IAAI,CAAA;IACtD,MAAM,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,IAAI,CAAA;IAC5B,MAAM,GAAG,GAAG,IAAI,mBAAS,CAAC,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC,CAAA;IAC5E,uBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAC7B,OAAO,IAAA,iBAAW,EAAC,GAAG,EAAE,GAAG,CAAC,CAAA;AAC9B,CAAC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
declare const def: CodeKeywordDefinition;
export declare function dynamicRef(cxt: KeywordCxt, ref: string): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.dynamicRef = void 0;
const codegen_1 = require("../../compile/codegen");
const names_1 = require("../../compile/names");
const ref_1 = require("../core/ref");
const def = {
    keyword: "$dynamicRef",
    schemaType: "string",
    code: (cxt) => dynamicRef(cxt, cxt.schema),
};
function dynamicRef(cxt, ref) {
    const { gen, keyword, it } = cxt;
    if (ref[0] !== "#")
        throw new Error(`"${keyword}" only supports hash fragment reference`);
    const anchor = ref.slice(1);
    if (it.allErrors) {
        _dynamicRef();
    }
    else {
        const valid = gen.let("valid", false);
        _dynamicRef(valid);
        cxt.ok(valid);
    }
    function _dynamicRef(valid) {
        // TODO the assumption here is that `recursiveRef: #` always points to the root
        // of the schema object, which is not correct, because there may be $id that
        // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
        // Because of that 2 tests in recursiveRef.json fail.
        // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
        // (This problem is not tested in JSON-Schema-Test-Suite)
        if (it.schemaEnv.root.dynamicAnchors[anchor]) {
            const v = gen.let("_v", (0, codegen_1._) `${names_1.default.dynamicAnchors}${(0, codegen_1.getProperty)(anchor)}`);
            gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid));
        }
        else {
            _callRef(it.validateName, valid)();
        }
    }
    function _callRef(validate, valid) {
        return valid
            ? () => gen.block(() => {
                (0, ref_1.callRef)(cxt, validate);
                gen.let(valid, true);
            })
            : () => (0, ref_1.callRef)(cxt, validate);
    }
}
exports.dynamicRef = dynamicRef;
exports.default = def;
//# sourceMappingURL=dynamicRef.js.map{"version":3,"file":"dynamicRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/dynamicRef.ts"],"names":[],"mappings":";;;AAEA,mDAAgE;AAChE,+CAAmC;AACnC,qCAAmC;AAEnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,SAAgB,UAAU,CAAC,GAAe,EAAE,GAAW;IACrD,MAAM,EAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;IAC9B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,IAAI,OAAO,yCAAyC,CAAC,CAAA;IACzF,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;QACjB,WAAW,EAAE,CAAA;IACf,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACrC,WAAW,CAAC,KAAK,CAAC,CAAA;QAClB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;IAED,SAAS,WAAW,CAAC,KAAY;QAC/B,+EAA+E;QAC/E,4EAA4E;QAC5E,sFAAsF;QACtF,qDAAqD;QACrD,kGAAkG;QAClG,yDAAyD;QACzD,IAAI,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAA,WAAC,EAAA,GAAG,eAAC,CAAC,cAAc,GAAG,IAAA,qBAAW,EAAC,MAAM,CAAC,EAAE,CAAC,CAAA;YACrE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAA;QACjE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;QACpC,CAAC;IACH,CAAC;IAED,SAAS,QAAQ,CAAC,QAAc,EAAE,KAAY;QAC5C,OAAO,KAAK;YACV,CAAC,CAAC,GAAG,EAAE,CACH,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE;gBACb,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;gBACtB,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;YACtB,CAAC,CAAC;YACN,CAAC,CAAC,GAAG,EAAE,CAAC,IAAA,aAAO,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAClC,CAAC;AACH,CAAC;AApCD,gCAoCC;AAED,kBAAe,GAAG,CAAA"}import type { Vocabulary } from "../../types";
declare const dynamic: Vocabulary;
export default dynamic;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicAnchor_1 = require("./dynamicAnchor");
const dynamicRef_1 = require("./dynamicRef");
const recursiveAnchor_1 = require("./recursiveAnchor");
const recursiveRef_1 = require("./recursiveRef");
const dynamic = [dynamicAnchor_1.default, dynamicRef_1.default, recursiveAnchor_1.default, recursiveRef_1.default];
exports.default = dynamic;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/index.ts"],"names":[],"mappings":";;AACA,mDAA2C;AAC3C,6CAAqC;AACrC,uDAA+C;AAC/C,iDAAyC;AAEzC,MAAM,OAAO,GAAe,CAAC,uBAAa,EAAE,oBAAU,EAAE,yBAAe,EAAE,sBAAY,CAAC,CAAA;AAEtF,kBAAe,OAAO,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicAnchor_1 = require("./dynamicAnchor");
const util_1 = require("../../compile/util");
const def = {
    keyword: "$recursiveAnchor",
    schemaType: "boolean",
    code(cxt) {
        if (cxt.schema)
            (0, dynamicAnchor_1.dynamicAnchor)(cxt, "");
        else
            (0, util_1.checkStrictMode)(cxt.it, "$recursiveAnchor: false is ignored");
    },
};
exports.default = def;
//# sourceMappingURL=recursiveAnchor.js.map{"version":3,"file":"recursiveAnchor.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveAnchor.ts"],"names":[],"mappings":";;AACA,mDAA6C;AAC7C,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,kBAAkB;IAC3B,UAAU,EAAE,SAAS;IACrB,IAAI,CAAC,GAAG;QACN,IAAI,GAAG,CAAC,MAAM;YAAE,IAAA,6BAAa,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;;YACjC,IAAA,sBAAe,EAAC,GAAG,CAAC,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACpE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dynamicRef_1 = require("./dynamicRef");
const def = {
    keyword: "$recursiveRef",
    schemaType: "string",
    code: (cxt) => (0, dynamicRef_1.dynamicRef)(cxt, cxt.schema),
};
exports.default = def;
//# sourceMappingURL=recursiveRef.js.map{"version":3,"file":"recursiveRef.js","sourceRoot":"","sources":["../../../lib/vocabularies/dynamic/recursiveRef.ts"],"names":[],"mappings":";;AACA,6CAAuC;AAEvC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,QAAQ;IACpB,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;CAC3C,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { TypeError } from "../compile/validate/dataType";
import type { ApplicatorKeywordError } from "./applicator";
import type { ValidationKeywordError } from "./validation";
import type { FormatError } from "./format/format";
import type { UnevaluatedPropertiesError } from "./unevaluated/unevaluatedProperties";
import type { UnevaluatedItemsError } from "./unevaluated/unevaluatedItems";
import type { DependentRequiredError } from "./validation/dependentRequired";
import type { DiscriminatorError } from "./discriminator";
export type DefinedError = TypeError | ApplicatorKeywordError | ValidationKeywordError | FormatError | UnevaluatedPropertiesError | UnevaluatedItemsError | DependentRequiredError | DiscriminatorError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=errors.js.map{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../lib/vocabularies/errors.ts"],"names":[],"mappings":""}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type FormatError = ErrorObject<"format", {
    format: string;
}, string | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`,
    params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,
};
const def = {
    keyword: "format",
    type: ["number", "string"],
    schemaType: "string",
    $data: true,
    error,
    code(cxt, ruleType) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        const { opts, errSchemaPath, schemaEnv, self } = it;
        if (!opts.validateFormats)
            return;
        if ($data)
            validate$DataFormat();
        else
            validateFormat();
        function validate$DataFormat() {
            const fmts = gen.scopeValue("formats", {
                ref: self.formats,
                code: opts.code.formats,
            });
            const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`);
            const fType = gen.let("fType");
            const format = gen.let("format");
            // TODO simplify
            gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef));
            cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
            function unknownFmt() {
                if (opts.strictSchema === false)
                    return codegen_1.nil;
                return (0, codegen_1._) `${schemaCode} && !${format}`;
            }
            function invalidFmt() {
                const callFormat = schemaEnv.$async
                    ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
                    : (0, codegen_1._) `${format}(${data})`;
                const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
                return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
            }
        }
        function validateFormat() {
            const formatDef = self.formats[schema];
            if (!formatDef) {
                unknownFormat();
                return;
            }
            if (formatDef === true)
                return;
            const [fmtType, format, fmtRef] = getFormat(formatDef);
            if (fmtType === ruleType)
                cxt.pass(validCondition());
            function unknownFormat() {
                if (opts.strictSchema === false) {
                    self.logger.warn(unknownMsg());
                    return;
                }
                throw new Error(unknownMsg());
                function unknownMsg() {
                    return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
                }
            }
            function getFormat(fmtDef) {
                const code = fmtDef instanceof RegExp
                    ? (0, codegen_1.regexpCode)(fmtDef)
                    : opts.code.formats
                        ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`
                        : undefined;
                const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
                if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
                    return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];
                }
                return ["string", fmtDef, fmt];
            }
            function validCondition() {
                if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
                    if (!schemaEnv.$async)
                        throw new Error("async format in sync schema");
                    return (0, codegen_1._) `await ${fmtRef}(${data})`;
                }
                return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;
            }
        }
    },
};
exports.default = def;
//# sourceMappingURL=format.js.map{"version":3,"file":"format.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/format.ts"],"names":[],"mappings":";;AASA,mDAAoF;AAapF,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,sBAAsB,UAAU,GAAG;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,YAAY,UAAU,GAAG;CACrD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe,EAAE,QAAiB;QACrC,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAC,GAAG,EAAE,CAAA;QACjD,IAAI,CAAC,IAAI,CAAC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AAA;AAED,kBAAe,GAAG,CAAA"}import type { Vocabulary } from "../../types";
declare const format: Vocabulary;
export default format;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const format_1 = require("./format");
const format = [format_1.default];
exports.default = format;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/format/index.ts"],"names":[],"mappings":";;AACA,qCAAoC;AAEpC,MAAM,MAAM,GAAe,CAAC,gBAAa,CAAC,CAAA;AAE1C,kBAAe,MAAM,CAAA"}import type { CodeKeywordDefinition } from "../../types";
import { _JTDTypeError } from "./error";
import { DiscrError, DiscrErrorObj } from "../discriminator/types";
export type JTDDiscriminatorError = _JTDTypeError<"discriminator", "object", string> | DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error_1 = require("./error");
const types_1 = require("../discriminator/types");
const error = {
    message: (cxt) => {
        const { schema, params } = cxt;
        return params.discrError
            ? params.discrError === types_1.DiscrError.Tag
                ? `tag "${schema}" must be string`
                : `value of tag "${schema}" must be in mapping`
            : (0, error_1.typeErrorMessage)(cxt, "object");
    },
    params: (cxt) => {
        const { schema, params } = cxt;
        return params.discrError
            ? (0, codegen_1._) `{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}`
            : (0, error_1.typeErrorParams)(cxt, "object");
    },
};
const def = {
    keyword: "discriminator",
    schemaType: "string",
    implements: ["mapping"],
    error,
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { gen, data, schema, parentSchema } = cxt;
        const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
        gen.if(cond);
        validateDiscriminator();
        gen.elseIf((0, codegen_1.not)(valid));
        cxt.error();
        gen.endIf();
        cxt.ok(valid);
        function validateDiscriminator() {
            const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(schema)}`);
            gen.if((0, codegen_1._) `${tag} === undefined`);
            cxt.error(false, { discrError: types_1.DiscrError.Tag, tag });
            gen.elseIf((0, codegen_1._) `typeof ${tag} == "string"`);
            validateMapping(tag);
            gen.else();
            cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema });
            gen.endIf();
        }
        function validateMapping(tag) {
            gen.if(false);
            for (const tagValue in parentSchema.mapping) {
                gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
                gen.assign(valid, applyTagSchema(tagValue));
            }
            gen.else();
            cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true });
            gen.endIf();
        }
        function applyTagSchema(schemaProp) {
            const _valid = gen.name("valid");
            cxt.subschema({
                keyword: "mapping",
                schemaProp,
                jtdDiscriminator: schema,
            }, _valid);
            return _valid;
        }
    },
};
exports.default = def;
//# sourceMappingURL=discriminator.js.map{"version":3,"file":"discriminator.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/discriminator.ts"],"names":[],"mappings":";;AAEA,mDAA+D;AAC/D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AACxE,kDAAgE;AAOhE,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAC5B,OAAO,MAAM,CAAC,UAAU;YACtB,CAAC,CAAC,MAAM,CAAC,UAAU,KAAK,kBAAU,CAAC,GAAG;gBACpC,CAAC,CAAC,QAAQ,MAAM,kBAAkB;gBAClC,CAAC,CAAC,iBAAiB,MAAM,sBAAsB;YACjD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IACrC,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,EAAC,MAAM,EAA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AA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error_1 = require("./error");
const def = {
    keyword: "elements",
    schemaType: "object",
    error: (0, error_1.typeError)("array"),
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { gen, data, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        const [valid] = (0, nullable_1.checkNullable)(cxt);
        gen.if((0, codegen_1.not)(valid), () => gen.if((0, codegen_1._) `Array.isArray(${data})`, () => gen.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error()));
        cxt.ok(valid);
    },
};
exports.default = def;
//# sourceMappingURL=elements.js.map{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/elements.ts"],"names":[],"mappings":";;AAEA,6CAAoD;AACpD,kCAAqC;AACrC,mDAA4C;AAC5C,yCAAwC;AACxC,yCAAwC;AACxC,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,OAAO,CAAC;IACzB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CACtB,GAAG,CAAC,EAAE,CACJ,IAAA,WAAC,EAAA,iBAAiB,IAAI,GAAG,EACzB,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC,EAC3C,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAClB,CACF,CAAA;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type JTDEnumError = ErrorObject<"enum", {
    allowedValues: string[];
}, string[]>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error = {
    message: "must be equal to one of the allowed values",
    params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
    keyword: "enum",
    schemaType: "array",
    error,
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { gen, data, schema, schemaValue, parentSchema, it } = cxt;
        if (schema.length === 0)
            throw new Error("enum must have non-empty array");
        if (schema.length !== new Set(schema).size)
            throw new Error("enum items must be unique");
        let valid;
        const isString = (0, codegen_1._) `typeof ${data} == "string"`;
        if (schema.length >= it.opts.loopEnum) {
            let cond;
            [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString);
            gen.if(cond, loopEnum);
        }
        else {
            /* istanbul ignore if */
            if (!Array.isArray(schema))
                throw new Error("ajv implementation error");
            valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._) `${data} === ${value}`)));
            if (parentSchema.nullable)
                valid = (0, codegen_1.or)((0, codegen_1._) `${data} === null`, valid);
        }
        cxt.pass(valid);
        function loopEnum() {
            gen.forOf("v", schemaValue, (v) => gen.if((0, codegen_1._) `${valid} = ${data} === ${v}`, () => gen.break()));
        }
    },
};
exports.default = def;
//# sourceMappingURL=enum.js.map{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/enum.ts"],"names":[],"mappings":";;AAEA,mDAAsD;AACtD,yCAAwC;AACxC,yCAAwC;AAIxC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;QAC1E,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;QACxF,IAAI,KAAW,CAAA;QACf,MAAM,QAAQ,GAAG,IAAA,WAAC,EAAA,UAAU,IAAI,cAAc,CAAA;QAC9C,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtC,IAAI,IAAU,CACb;YAAA,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,wBAAa,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC7C,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,wBAAwB;YACxB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAA;YACvE,KAAK,GAAG,IAAA,aAAG,EAAC,QAAQ,EAAE,IAAA,YAAE,EAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,KAAK,EAAE,CAAC,CAAC,CAAC,CAAA;YACpF,IAAI,YAAY,CAAC,QAAQ;gBAAE,KAAK,GAAG,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,KAAK,CAAC,CAAA;QACnE,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAEf,SAAS,QAAQ;YACf,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,WAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAC1D,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { KeywordErrorDefinition, KeywordErrorCxt, ErrorObject } from "../../types";
import { Code } from "../../compile/codegen";
export type _JTDTypeError<K extends string, T extends string, S> = ErrorObject<K, {
    type: T;
    nullable: boolean;
}, S>;
export declare function typeError(t: string): KeywordErrorDefinition;
export declare function typeErrorMessage({ parentSchema }: KeywordErrorCxt, t: string): string;
export declare function typeErrorParams({ parentSchema }: KeywordErrorCxt, t: string): Code;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.typeErrorParams = exports.typeErrorMessage = exports.typeError = void 0;
const codegen_1 = require("../../compile/codegen");
function typeError(t) {
    return {
        message: (cxt) => typeErrorMessage(cxt, t),
        params: (cxt) => typeErrorParams(cxt, t),
    };
}
exports.typeError = typeError;
function typeErrorMessage({ parentSchema }, t) {
    return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`;
}
exports.typeErrorMessage = typeErrorMessage;
function typeErrorParams({ parentSchema }, t) {
    return (0, codegen_1._) `{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`;
}
exports.typeErrorParams = typeErrorParams;
//# sourceMappingURL=error.js.map{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/error.ts"],"names":[],"mappings":";;;AACA,mDAA6C;AAQ7C,SAAgB,SAAS,CAAC,CAAS;IACjC,OAAO;QACL,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;QAC1C,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;KACzC,CAAA;AACH,CAAC;AALD,8BAKC;AAED,SAAgB,gBAAgB,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACzE,OAAO,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,EAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAA;AACzE,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe,CAAC,EAAC,YAAY,EAAkB,EAAE,CAAS;IACxE,OAAO,IAAA,WAAC,EAAA,UAAU,CAAC,eAAe,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAA,GAAG,CAAA;AAC/D,CAAC;AAFD,0CAEC"}import type { Vocabulary } from "../../types";
import { JTDTypeError } from "./type";
import { JTDEnumError } from "./enum";
import { JTDElementsError } from "./elements";
import { JTDPropertiesError } from "./properties";
import { JTDDiscriminatorError } from "./discriminator";
import { JTDValuesError } from "./values";
declare const jtdVocabulary: Vocabulary;
export default jtdVocabulary;
export type JTDErrorObject = JTDTypeError | JTDEnumError | JTDElementsError | JTDPropertiesError | JTDDiscriminatorError | JTDValuesError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ref_1 = require("./ref");
const type_1 = require("./type");
const enum_1 = require("./enum");
const elements_1 = require("./elements");
const properties_1 = require("./properties");
const optionalProperties_1 = require("./optionalProperties");
const discriminator_1 = require("./discriminator");
const values_1 = require("./values");
const union_1 = require("./union");
const metadata_1 = require("./metadata");
const jtdVocabulary = [
    "definitions",
    ref_1.default,
    type_1.default,
    enum_1.default,
    elements_1.default,
    properties_1.default,
    optionalProperties_1.default,
    discriminator_1.default,
    values_1.default,
    union_1.default,
    metadata_1.default,
    { keyword: "additionalProperties", schemaType: "boolean" },
    { keyword: "nullable", schemaType: "boolean" },
];
exports.default = jtdVocabulary;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/index.ts"],"names":[],"mappings":";;AACA,+BAA8B;AAC9B,iCAAgD;AAChD,iCAAgD;AAChD,yCAAqD;AACrD,6CAA2D;AAC3D,6DAAqD;AACrD,mDAAoE;AACpE,qCAA+C;AAC/C,mCAA2B;AAC3B,yCAAiC;AAEjC,MAAM,aAAa,GAAe;IAChC,aAAa;IACb,aAAU;IACV,cAAW;IACX,cAAW;IACX,kBAAQ;IACR,oBAAU;IACV,4BAAkB;IAClB,uBAAa;IACb,gBAAM;IACN,eAAK;IACL,kBAAQ;IACR,EAAC,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,SAAS,EAAC;IACxD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;CAC7C,CAAA;AAED,kBAAe,aAAa,CAAA"}import { KeywordCxt } from "../../ajv";
import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export declare function checkMetadata({ it, keyword }: KeywordCxt, metadata?: boolean): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkMetadata = void 0;
const util_1 = require("../../compile/util");
const def = {
    keyword: "metadata",
    schemaType: "object",
    code(cxt) {
        checkMetadata(cxt);
        const { gen, schema, it } = cxt;
        if ((0, util_1.alwaysValidSchema)(it, schema))
            return;
        const valid = gen.name("valid");
        cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid);
        cxt.ok(valid);
    },
};
function checkMetadata({ it, keyword }, metadata) {
    if (it.jtdMetadata !== metadata) {
        throw new Error(`JTD: "${keyword}" cannot be used in this schema location`);
    }
}
exports.checkMetadata = checkMetadata;
exports.default = def;
//# sourceMappingURL=metadata.js.map{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/metadata.ts"],"names":[],"mappings":";;;AAEA,6CAAoD;AAEpD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,aAAa,CAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC7B,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC;YAAE,OAAM;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;QAC9D,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;IACf,CAAC;CACF,CAAA;AAED,SAAgB,aAAa,CAAC,EAAC,EAAE,EAAE,OAAO,EAAa,EAAE,QAAkB;IACzE,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,0CAA0C,CAAC,CAAA;IAC7E,CAAC;AACH,CAAC;AAJD,sCAIC;AAED,kBAAe,GAAG,CAAA"}import type { KeywordCxt } from "../../compile/validate";
import { Code, Name } from "../../compile/codegen";
export declare function checkNullable({ gen, data, parentSchema }: KeywordCxt, cond?: Code): [Name, Code];
export declare function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkNullableObject = exports.checkNullable = void 0;
const codegen_1 = require("../../compile/codegen");
function checkNullable({ gen, data, parentSchema }, cond = codegen_1.nil) {
    const valid = gen.name("valid");
    if (parentSchema.nullable) {
        gen.let(valid, (0, codegen_1._) `${data} === null`);
        cond = (0, codegen_1.not)(valid);
    }
    else {
        gen.let(valid, false);
    }
    return [valid, cond];
}
exports.checkNullable = checkNullable;
function checkNullableObject(cxt, cond) {
    const [valid, cond_] = checkNullable(cxt, cond);
    return [valid, (0, codegen_1._) `${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`];
}
exports.checkNullableObject = checkNullableObject;
//# sourceMappingURL=nullable.js.map{"version":3,"file":"nullable.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/nullable.ts"],"names":[],"mappings":";;;AACA,mDAA6D;AAE7D,SAAgB,aAAa,CAC3B,EAAC,GAAG,EAAE,IAAI,EAAE,YAAY,EAAa,EACrC,OAAa,aAAG;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;QACnC,IAAI,GAAG,IAAA,aAAG,EAAC,KAAK,CAAC,CAAA;IACnB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAZD,sCAYC;AAED,SAAgB,mBAAmB,CAAC,GAAe,EAAE,IAAU;IAC7D,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC/C,OAAO,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,KAAK,cAAc,GAAG,CAAC,IAAI,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAA;AAC9F,CAAC;AAHD,kDAGC"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const properties_1 = require("./properties");
const def = {
    keyword: "optionalProperties",
    schemaType: "object",
    error: properties_1.error,
    code(cxt) {
        if (cxt.parentSchema.properties)
            return;
        (0, properties_1.validateProperties)(cxt);
    },
};
exports.default = def;
//# sourceMappingURL=optionalProperties.js.map{"version":3,"file":"optionalProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/optionalProperties.ts"],"names":[],"mappings":";;AAEA,6CAAsD;AAEtD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,oBAAoB;IAC7B,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,kBAAK;IACL,IAAI,CAAC,GAAe;QAClB,IAAI,GAAG,CAAC,YAAY,CAAC,UAAU;YAAE,OAAM;QACvC,IAAA,+BAAkB,EAAC,GAAG,CAAC,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition, SchemaObject } from "../../types";
import type { KeywordCxt } from "../../compile/validate";
import { _JTDTypeError } from "./error";
declare enum PropError {
    Additional = "additional",
    Missing = "missing"
}
type PropKeyword = "properties" | "optionalProperties";
type PropSchema = {
    [P in string]?: SchemaObject;
};
export type JTDPropertiesError = _JTDTypeError<PropKeyword, "object", PropSchema> | ErrorObject<PropKeyword, {
    error: PropError.Additional;
    additionalProperty: string;
}, PropSchema> | ErrorObject<PropKeyword, {
    error: PropError.Missing;
    missingProperty: string;
}, PropSchema>;
export declare const error: KeywordErrorDefinition;
declare const def: CodeKeywordDefinition;
export declare function validateProperties(cxt: KeywordCxt): void;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateProperties = exports.error = void 0;
const code_1 = require("../code");
const util_1 = require("../../compile/util");
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error_1 = require("./error");
var PropError;
(function (PropError) {
    PropError["Additional"] = "additional";
    PropError["Missing"] = "missing";
})(PropError || (PropError = {}));
exports.error = {
    message: (cxt) => {
        const { params } = cxt;
        return params.propError
            ? params.propError === PropError.Additional
                ? "must NOT have additional properties"
                : `must have property '${params.missingProperty}'`
            : (0, error_1.typeErrorMessage)(cxt, "object");
    },
    params: (cxt) => {
        const { params } = cxt;
        return params.propError
            ? params.propError === PropError.Additional
                ? (0, codegen_1._) `{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}`
                : (0, codegen_1._) `{error: ${params.propError}, missingProperty: ${params.missingProperty}}`
            : (0, error_1.typeErrorParams)(cxt, "object");
    },
};
const def = {
    keyword: "properties",
    schemaType: "object",
    error: exports.error,
    code: validateProperties,
};
// const error: KeywordErrorDefinition = {
//   message: "should NOT have additional properties",
//   params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`,
// }
function validateProperties(cxt) {
    (0, metadata_1.checkMetadata)(cxt);
    const { gen, data, parentSchema, it } = cxt;
    const { additionalProperties, nullable } = parentSchema;
    if (it.jtdDiscriminator && nullable)
        throw new Error("JTD: nullable inside discriminator mapping");
    if (commonProperties()) {
        throw new Error("JTD: properties and optionalProperties have common members");
    }
    const [allProps, properties] = schemaProperties("properties");
    const [allOptProps, optProperties] = schemaProperties("optionalProperties");
    if (properties.length === 0 && optProperties.length === 0 && additionalProperties) {
        return;
    }
    const [valid, cond] = it.jtdDiscriminator === undefined
        ? (0, nullable_1.checkNullableObject)(cxt, data)
        : [gen.let("valid", false), true];
    gen.if(cond, () => gen.assign(valid, true).block(() => {
        validateProps(properties, "properties", true);
        validateProps(optProperties, "optionalProperties");
        if (!additionalProperties)
            validateAdditional();
    }));
    cxt.pass(valid);
    function commonProperties() {
        const props = parentSchema.properties;
        const optProps = parentSchema.optionalProperties;
        if (!(props && optProps))
            return false;
        for (const p in props) {
            if (Object.prototype.hasOwnProperty.call(optProps, p))
                return true;
        }
        return false;
    }
    function schemaProperties(keyword) {
        const schema = parentSchema[keyword];
        const allPs = schema ? (0, code_1.allSchemaProperties)(schema) : [];
        if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) {
            throw new Error(`JTD: discriminator tag used in ${keyword}`);
        }
        const ps = allPs.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
        return [allPs, ps];
    }
    function validateProps(props, keyword, required) {
        const _valid = gen.var("valid");
        for (const prop of props) {
            gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop));
            cxt.ok(_valid);
        }
        function missingProperty(prop) {
            if (required) {
                gen.assign(_valid, false);
                cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop });
            }
            else {
                gen.assign(_valid, true);
            }
        }
    }
    function applyPropertySchema(prop, keyword, _valid) {
        cxt.subschema({
            keyword,
            schemaProp: prop,
            dataProp: prop,
        }, _valid);
    }
    function validateAdditional() {
        gen.forIn("key", data, (key) => {
            const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator);
            const addOptProp = isAdditional(key, allOptProps, "optionalProperties");
            const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp);
            gen.if(extra, () => {
                if (it.opts.removeAdditional) {
                    gen.code((0, codegen_1._) `delete ${data}[${key}]`);
                }
                else {
                    cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true });
                    if (!it.opts.allErrors)
                        gen.break();
                }
            });
        });
    }
    function isAdditional(key, props, keyword, jtdDiscriminator) {
        let additional;
        if (props.length > 8) {
            // TODO maybe an option instead of hard-coded 8?
            const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword);
            additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen, propsSchema, key));
            if (jtdDiscriminator !== undefined) {
                additional = (0, codegen_1.and)(additional, (0, codegen_1._) `${key} !== ${jtdDiscriminator}`);
            }
        }
        else if (props.length || jtdDiscriminator !== undefined) {
            const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props);
            additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._) `${key} !== ${p}`));
        }
        else {
            additional = true;
        }
        return additional;
    }
}
exports.validateProperties = validateProperties;
exports.default = def;
//# sourceMappingURL=properties.js.map{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/properties.ts"],"names":[],"mappings":";;;AAOA,kCAA0E;AAC1E,6CAAoE;AACpE,mDAA6D;AAC7D,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAwE;AAExE,IAAK,SAGJ;AAHD,WAAK,SAAS;IACZ,sCAAyB,CAAA;IACzB,gCAAmB,CAAA;AACrB,CAAC,EAHI,SAAS,KAAT,SAAS,QAGb;AAWY,QAAA,KAAK,GAA2B;IAC3C,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,MAAM,EAAC,MAAM,EAAC,GAAG,GAAG,CAAA;QACpB,OAAO,MAAM,CAAC,SAAS;YACrB,CAAC,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC,UAAU;gBACzC,CAAC,CAAC,qCAAqC;gBACvC,CAAC,CAAC,uBAAuB,MAAM,CAAC,eAAe,GAAG;YACpD,CAAC,CAAC,IAAA,wBAAgB,EAAC,GAAG,EAAE,QAAQ,CAA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U,CAAA;IACnB,CAAC;AACH,CAAC;AA1HD,gDA0HC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, AnySchemaObject } from "../../types";
declare const def: CodeKeywordDefinition;
export declare function hasRef(schema: AnySchemaObject): boolean;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasRef = void 0;
const compile_1 = require("../../compile");
const codegen_1 = require("../../compile/codegen");
const ref_error_1 = require("../../compile/ref_error");
const names_1 = require("../../compile/names");
const ref_1 = require("../core/ref");
const metadata_1 = require("./metadata");
const def = {
    keyword: "ref",
    schemaType: "string",
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { gen, data, schema: ref, parentSchema, it } = cxt;
        const { schemaEnv: { root }, } = it;
        const valid = gen.name("valid");
        if (parentSchema.nullable) {
            gen.var(valid, (0, codegen_1._) `${data} === null`);
            gen.if((0, codegen_1.not)(valid), validateJtdRef);
        }
        else {
            gen.var(valid, false);
            validateJtdRef();
        }
        cxt.ok(valid);
        function validateJtdRef() {
            var _a;
            const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref];
            if (!refSchema) {
                throw new ref_error_1.default(it.opts.uriResolver, "", ref, `No definition ${ref}`);
            }
            if (hasRef(refSchema) || !it.opts.inlineRefs)
                callValidate(refSchema);
            else
                inlineRefSchema(refSchema);
        }
        function callValidate(schema) {
            const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root, schemaPath: `/definitions/${ref}` }));
            const v = (0, ref_1.getValidate)(cxt, sch);
            const errsCount = gen.const("_errs", names_1.default.errors);
            (0, ref_1.callRef)(cxt, v, sch, sch.$async);
            gen.assign(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
        }
        function inlineRefSchema(schema) {
            const schName = gen.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, codegen_1.stringify)(schema) } : { ref: schema });
            cxt.subschema({
                schema,
                dataTypes: [],
                schemaPath: codegen_1.nil,
                topSchemaRef: schName,
                errSchemaPath: `/definitions/${ref}`,
            }, valid);
        }
    },
};
function hasRef(schema) {
    for (const key in schema) {
        let sch;
        if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch)))
            return true;
    }
    return false;
}
exports.hasRef = hasRef;
exports.default = def;
//# sourceMappingURL=ref.js.map{"version":3,"file":"ref.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/ref.ts"],"names":[],"mappings":";;;AAEA,2CAAsD;AACtD,mDAA4D;AAC5D,uDAAqD;AACrD,+CAAmC;AACnC,qCAAgD;AAChD,yCAAwC;AAExC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EACJ,SAAS,EAAE,EAAC,IAAI,EAAC,GAClB,GAAG,EAAE,CAAA;QACN,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC1B,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,CAAC,CAAA;YACnC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,cAAc,CAAC,CAAA;QACpC,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACrB,cAAc,EAAE,CAAA;QAClB,CAAC;QACD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QAEb,SAAS,cAAc;;YACrB,MAAM,SAAS,GAAG,MAAC,IAAI,CAAC,MAA0B,CAAC,WAAW,0CAAG,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M,EAAC,CACtF,CAAA;YACD,GAAG,CAAC,SAAS,CACX;gBACE,MAAM;gBACN,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,aAAG;gBACf,YAAY,EAAE,OAAO;gBACrB,aAAa,EAAE,gBAAgB,GAAG,EAAE;aACrC,EACD,KAAK,CACN,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,SAAgB,MAAM,CAAC,MAAuB;IAC5C,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,IAAI,GAAoB,CAAA;QACxB,IAAI,GAAG,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,IAAI,CAAA;IAC3F,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAND,wBAMC;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
import { _JTDTypeError } from "./error";
export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>;
export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
export declare const intRange: {
    [T in IntType]: [number, number, number];
};
export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.intRange = void 0;
const codegen_1 = require("../../compile/codegen");
const timestamp_1 = require("../../runtime/timestamp");
const util_1 = require("../../compile/util");
const metadata_1 = require("./metadata");
const error_1 = require("./error");
exports.intRange = {
    int8: [-128, 127, 3],
    uint8: [0, 255, 3],
    int16: [-32768, 32767, 5],
    uint16: [0, 65535, 5],
    int32: [-2147483648, 2147483647, 10],
    uint32: [0, 4294967295, 10],
};
const error = {
    message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema),
    params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema),
};
function timestampCode(cxt) {
    const { gen, data, it } = cxt;
    const { timestamp, allowDate } = it.opts;
    if (timestamp === "date")
        return (0, codegen_1._) `${data} instanceof Date `;
    const vts = (0, util_1.useFunc)(gen, timestamp_1.default);
    const allowDateArg = allowDate ? (0, codegen_1._) `, true` : codegen_1.nil;
    const validString = (0, codegen_1._) `typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`;
    return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._) `${data} instanceof Date`, validString);
}
const def = {
    keyword: "type",
    schemaType: "string",
    error,
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { data, schema, parentSchema, it } = cxt;
        let cond;
        switch (schema) {
            case "boolean":
            case "string":
                cond = (0, codegen_1._) `typeof ${data} == ${schema}`;
                break;
            case "timestamp": {
                cond = timestampCode(cxt);
                break;
            }
            case "float32":
            case "float64":
                cond = (0, codegen_1._) `typeof ${data} == "number"`;
                break;
            default: {
                const sch = schema;
                cond = (0, codegen_1._) `typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`;
                if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) {
                    if (sch === "uint32")
                        cond = (0, codegen_1._) `${cond} && ${data} >= 0`;
                }
                else {
                    const [min, max] = exports.intRange[sch];
                    cond = (0, codegen_1._) `${cond} && ${data} >= ${min} && ${data} <= ${max}`;
                }
            }
        }
        cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, codegen_1._) `${data} === null`, cond) : cond);
    },
};
exports.default = def;
//# sourceMappingURL=type.js.map{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/type.ts"],"names":[],"mappings":";;;AAEA,mDAAsD;AACtD,uDAAoD;AACpD,6CAA0C;AAC1C,yCAAwC;AACxC,mCAAwE;AAM3D,QAAA,QAAQ,GAA+C;IAClE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACpB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EA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,EAAE,CAAA;gBAC7D,CAAC;YACH,CAAC;QACH,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,YAAE,EAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACxE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const def = {
    keyword: "union",
    schemaType: "array",
    trackErrors: true,
    code: code_1.validateUnion,
    error: { message: "must match a schema in union" },
};
exports.default = def;
//# sourceMappingURL=union.js.map{"version":3,"file":"union.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/union.ts"],"names":[],"mappings":";;AACA,kCAAqC;AAErC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,OAAO;IACnB,WAAW,EAAE,IAAI;IACjB,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE,EAAC,OAAO,EAAE,8BAA8B,EAAC;CACjD,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, SchemaObject } from "../../types";
import { _JTDTypeError } from "./error";
export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const codegen_1 = require("../../compile/codegen");
const metadata_1 = require("./metadata");
const nullable_1 = require("./nullable");
const error_1 = require("./error");
const def = {
    keyword: "values",
    schemaType: "object",
    error: (0, error_1.typeError)("object"),
    code(cxt) {
        (0, metadata_1.checkMetadata)(cxt);
        const { gen, data, schema, it } = cxt;
        const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data);
        if ((0, util_1.alwaysValidSchema)(it, schema)) {
            gen.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error());
        }
        else {
            gen.if(cond);
            gen.assign(valid, validateMap());
            gen.elseIf((0, codegen_1.not)(valid));
            cxt.error();
            gen.endIf();
        }
        cxt.ok(valid);
        function validateMap() {
            const _valid = gen.name("valid");
            if (it.allErrors) {
                const validMap = gen.let("valid", true);
                validateValues(() => gen.assign(validMap, false));
                return validMap;
            }
            gen.var(_valid, true);
            validateValues(() => gen.break());
            return _valid;
            function validateValues(notValid) {
                gen.forIn("key", data, (key) => {
                    cxt.subschema({
                        keyword: "values",
                        dataProp: key,
                        dataPropType: util_1.Type.Str,
                    }, _valid);
                    gen.if((0, codegen_1.not)(_valid), notValid);
                });
            }
        }
    },
};
exports.default = def;
//# sourceMappingURL=values.js.map{"version":3,"file":"values.js","sourceRoot":"","sources":["../../../lib/vocabularies/jtd/values.ts"],"names":[],"mappings":";;AAEA,6CAA0D;AAC1D,mDAAmD;AACnD,yCAAwC;AACxC,yCAA8C;AAC9C,mCAAgD;AAIhD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAA,iBAAS,EAAC,QAAQ,CAAC;IAC1B,IAAI,CAAC,GAAe;QAClB,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAA;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACnC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,IAAA,8BAAmB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACpD,IAAI,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;YAClC,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,IAAA,YAAE,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,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CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { Vocabulary } from "../types";
export declare const metadataVocabulary: Vocabulary;
export declare const contentVocabulary: Vocabulary;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contentVocabulary = exports.metadataVocabulary = void 0;
exports.metadataVocabulary = [
    "title",
    "description",
    "default",
    "deprecated",
    "readOnly",
    "writeOnly",
    "examples",
];
exports.contentVocabulary = [
    "contentMediaType",
    "contentEncoding",
    "contentSchema",
];
//# sourceMappingURL=metadata.js.map{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../lib/vocabularies/metadata.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAe;IAC5C,OAAO;IACP,aAAa;IACb,SAAS;IACT,YAAY;IACZ,UAAU;IACV,WAAW;IACX,UAAU;CACX,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,kBAAkB;IAClB,iBAAiB;IACjB,eAAe;CAChB,CAAA"}import type { Vocabulary } from "../types";
declare const next: Vocabulary;
export default next;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependentRequired_1 = require("./validation/dependentRequired");
const dependentSchemas_1 = require("./applicator/dependentSchemas");
const limitContains_1 = require("./validation/limitContains");
const next = [dependentRequired_1.default, dependentSchemas_1.default, limitContains_1.default];
exports.default = next;
//# sourceMappingURL=next.js.map{"version":3,"file":"next.js","sourceRoot":"","sources":["../../lib/vocabularies/next.ts"],"names":[],"mappings":";;AACA,sEAA8D;AAC9D,oEAA4D;AAC5D,8DAAsD;AAEtD,MAAM,IAAI,GAAe,CAAC,2BAAiB,EAAE,0BAAgB,EAAE,uBAAa,CAAC,CAAA;AAE7E,kBAAe,IAAI,CAAA"}import type { Vocabulary } from "../../types";
declare const unevaluated: Vocabulary;
export default unevaluated;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const unevaluatedProperties_1 = require("./unevaluatedProperties");
const unevaluatedItems_1 = require("./unevaluatedItems");
const unevaluated = [unevaluatedProperties_1.default, unevaluatedItems_1.default];
exports.default = unevaluated;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/index.ts"],"names":[],"mappings":";;AACA,mEAA2D;AAC3D,yDAAiD;AAEjD,MAAM,WAAW,GAAe,CAAC,+BAAqB,EAAE,0BAAgB,CAAC,CAAA;AAEzE,kBAAe,WAAW,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {
    limit: number;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
    params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
};
const def = {
    keyword: "unevaluatedItems",
    type: "array",
    schemaType: ["boolean", "object"],
    error,
    code(cxt) {
        const { gen, schema, data, it } = cxt;
        const items = it.items || 0;
        if (items === true)
            return;
        const len = gen.const("len", (0, codegen_1._) `${data}.length`);
        if (schema === false) {
            cxt.setParams({ len: items });
            cxt.fail((0, codegen_1._) `${len} > ${items}`);
        }
        else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
            const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items}`);
            gen.if((0, codegen_1.not)(valid), () => validateItems(valid, items));
            cxt.ok(valid);
        }
        it.items = true;
        function validateItems(valid, from) {
            gen.forRange("i", from, len, (i) => {
                cxt.subschema({ keyword: "unevaluatedItems", dataProp: i, dataPropType: util_1.Type.Num }, valid);
                if (!it.allErrors)
                    gen.if((0, codegen_1.not)(valid), () => gen.break());
            });
        }
    },
};
exports.default = def;
//# sourceMappingURL=unevaluatedItems.js.map{"version":3,"file":"unevaluatedItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/un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AC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAA;YACrD,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QACf,CAAC;QACD,EAAE,CAAC,KAAK,GAAG,IAAI,CAAA;QAEf,SAAS,aAAa,CAAC,KAAW,EAAE,IAAmB;YACrD,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;gBACjC,GAAG,CAAC,SAAS,CAAC,EAAC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAY,EAAE,WAAI,CAAC,GAAG,EAAC,EAAE,KAAK,CAAC,CAAA;gBACxF,IAAI,CAAC,EAAE,CAAC,SAAS;oBAAE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAC1D,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject, AnySchema } from "../../types";
export type UnevaluatedPropertiesError = ErrorObject<"unevaluatedProperties", {
    unevaluatedProperty: string;
}, AnySchema>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const names_1 = require("../../compile/names");
const error = {
    message: "must NOT have unevaluated properties",
    params: ({ params }) => (0, codegen_1._) `{unevaluatedProperty: ${params.unevaluatedProperty}}`,
};
const def = {
    keyword: "unevaluatedProperties",
    type: "object",
    schemaType: ["boolean", "object"],
    trackErrors: true,
    error,
    code(cxt) {
        const { gen, schema, data, errsCount, it } = cxt;
        /* istanbul ignore if */
        if (!errsCount)
            throw new Error("ajv implementation error");
        const { allErrors, props } = it;
        if (props instanceof codegen_1.Name) {
            gen.if((0, codegen_1._) `${props} !== true`, () => gen.forIn("key", data, (key) => gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))));
        }
        else if (props !== true) {
            gen.forIn("key", data, (key) => props === undefined
                ? unevaluatedPropCode(key)
                : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key)));
        }
        it.props = true;
        cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
        function unevaluatedPropCode(key) {
            if (schema === false) {
                cxt.setParams({ unevaluatedProperty: key });
                cxt.error();
                if (!allErrors)
                    gen.break();
                return;
            }
            if (!(0, util_1.alwaysValidSchema)(it, schema)) {
                const valid = gen.name("valid");
                cxt.subschema({
                    keyword: "unevaluatedProperties",
                    dataProp: key,
                    dataPropType: util_1.Type.Str,
                }, valid);
                if (!allErrors)
                    gen.if((0, codegen_1.not)(valid), () => gen.break());
            }
        }
        function unevaluatedDynamic(evaluatedProps, key) {
            return (0, codegen_1._) `!${evaluatedProps} || !${evaluatedProps}[${key}]`;
        }
        function unevaluatedStatic(evaluatedProps, key) {
            const ps = [];
            for (const p in evaluatedProps) {
                if (evaluatedProps[p] === true)
                    ps.push((0, codegen_1._) `${key} !== ${p}`);
            }
            return (0, codegen_1.and)(...ps);
        }
    },
};
exports.default = def;
//# sourceMappingURL=unevaluatedProperties.js.map{"version":3,"file":"unevaluatedProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/unevaluated/unevaluatedProperties.ts"],"names":[],"mappings":";;AAMA,mDAA6D;AAC7D,6CAA0D;AAC1D,+CAAmC;AAQnC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,sCAAsC;IAC/C,MAAM,EAAE,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,yBAAyB,MAAM,CAAC,mBAAmB,GAAG;CAC9E,CAAA;AAED,MAAM,GAAG,GAA0B;I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C,CAAA;QACnB,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type ConstError = ErrorObject<"const", {
    allowedValue: any;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const equal_1 = require("../../runtime/equal");
const error = {
    message: "must be equal to constant",
    params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,
};
const def = {
    keyword: "const",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schemaCode, schema } = cxt;
        if ($data || (schema && typeof schema == "object")) {
            cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
        }
        else {
            cxt.fail((0, codegen_1._) `${schema} !== ${data}`);
        }
    },
};
exports.default = def;
//# sourceMappingURL=const.js.map{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/const.ts"],"names":[],"mappings":";;AAEA,mDAAuC;AACvC,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,kBAAkB,UAAU,GAAG;CAC3D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAC,GAAG,GAAG,CAAA;QAClD,IAAI,KAAK,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,IAAA,cAAO,EAAC,GAAG,EAAE,eAAK,CAAC,IAAI,IAAI,KAAK,UAAU,GAAG,CAAC,CAAA;QACnE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
import { DependenciesErrorParams, PropertyDependencies } from "../applicator/dependencies";
export type DependentRequiredError = ErrorObject<"dependentRequired", DependenciesErrorParams, PropertyDependencies>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependencies_1 = require("../applicator/dependencies");
const def = {
    keyword: "dependentRequired",
    type: "object",
    schemaType: "object",
    error: dependencies_1.error,
    code: (cxt) => (0, dependencies_1.validatePropertyDeps)(cxt),
};
exports.default = def;
//# sourceMappingURL=dependentRequired.js.map{"version":3,"file":"dependentRequired.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/dependentRequired.ts"],"names":[],"mappings":";;AACA,6DAKmC;AAQnC,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAL,oBAAK;IACL,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,mCAAoB,EAAC,GAAG,CAAC;CACzC,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type EnumError = ErrorObject<"enum", {
    allowedValues: any[];
}, any[] | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const equal_1 = require("../../runtime/equal");
const error = {
    message: "must be equal to one of the allowed values",
    params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
};
const def = {
    keyword: "enum",
    schemaType: "array",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schema, schemaCode, it } = cxt;
        if (!$data && schema.length === 0)
            throw new Error("enum must have non-empty array");
        const useLoop = schema.length >= it.opts.loopEnum;
        let eql;
        const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));
        let valid;
        if (useLoop || $data) {
            valid = gen.let("valid");
            cxt.block$data(valid, loopEnum);
        }
        else {
            /* istanbul ignore if */
            if (!Array.isArray(schema))
                throw new Error("ajv implementation error");
            const vSchema = gen.const("vSchema", schemaCode);
            valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
        }
        cxt.pass(valid);
        function loopEnum() {
            gen.assign(valid, false);
            gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
        }
        function equalCode(vSchema, i) {
            const sch = schema[i];
            return typeof sch === "object" && sch !== null
                ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`
                : (0, codegen_1._) `${data} === ${sch}`;
        }
    },
};
exports.default = def;
//# sourceMappingURL=enum.js.map{"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/enum.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,+CAAuC;AAIvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,4CAA4C;IACrD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,mBAAmB,UAAU,GAAG;CAC5D,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,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GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAC7E,CAAA;QACH,CAAC;QAED,SAAS,SAAS,CAAC,OAAa,EAAE,CAAS;YACzC,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;YACrB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;gBAC5C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,MAAM,EAAE,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI;gBAC3C,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,QAAQ,GAAG,EAAE,CAAA;QAC3B,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { ErrorObject, Vocabulary } from "../../types";
import { LimitNumberError } from "./limitNumber";
import { MultipleOfError } from "./multipleOf";
import { PatternError } from "./pattern";
import { RequiredError } from "./required";
import { UniqueItemsError } from "./uniqueItems";
import { ConstError } from "./const";
import { EnumError } from "./enum";
declare const validation: Vocabulary;
export default validation;
type LimitError = ErrorObject<"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength", {
    limit: number;
}, number | {
    $data: string;
}>;
export type ValidationKeywordError = LimitError | LimitNumberError | MultipleOfError | PatternError | RequiredError | UniqueItemsError | ConstError | EnumError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const limitNumber_1 = require("./limitNumber");
const multipleOf_1 = require("./multipleOf");
const limitLength_1 = require("./limitLength");
const pattern_1 = require("./pattern");
const limitProperties_1 = require("./limitProperties");
const required_1 = require("./required");
const limitItems_1 = require("./limitItems");
const uniqueItems_1 = require("./uniqueItems");
const const_1 = require("./const");
const enum_1 = require("./enum");
const validation = [
    // number
    limitNumber_1.default,
    multipleOf_1.default,
    // string
    limitLength_1.default,
    pattern_1.default,
    // object
    limitProperties_1.default,
    required_1.default,
    // array
    limitItems_1.default,
    uniqueItems_1.default,
    // any
    { keyword: "type", schemaType: ["string", "array"] },
    { keyword: "nullable", schemaType: "boolean" },
    const_1.default,
    enum_1.default,
];
exports.default = validation;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/index.ts"],"names":[],"mappings":";;AACA,+CAA2D;AAC3D,6CAAwD;AACxD,+CAAuC;AACvC,uCAA+C;AAC/C,uDAA+C;AAC/C,yCAAkD;AAClD,6CAAqC;AACrC,+CAA2D;AAC3D,mCAAgD;AAChD,iCAA6C;AAE7C,MAAM,UAAU,GAAe;IAC7B,SAAS;IACT,qBAAW;IACX,oBAAU;IACV,SAAS;IACT,qBAAW;IACX,iBAAO;IACP,SAAS;IACT,yBAAe;IACf,kBAAQ;IACR,QAAQ;IACR,oBAAU;IACV,qBAAW;IACX,MAAM;IACN,EAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;IAClD,EAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAC;IAC5C,eAAY;IACZ,cAAW;CACZ,CAAA;AAED,kBAAe,UAAU,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../../compile/util");
const def = {
    keyword: ["maxContains", "minContains"],
    type: "array",
    schemaType: "number",
    code({ keyword, parentSchema, it }) {
        if (parentSchema.contains === undefined) {
            (0, util_1.checkStrictMode)(it, `"${keyword}" without "contains" is ignored`);
        }
    },
};
exports.default = def;
//# sourceMappingURL=limitContains.js.map{"version":3,"file":"limitContains.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitContains.ts"],"names":[],"mappings":";;AAEA,6CAAkD;AAElD,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,CAAC;IACvC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,EAAC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAa;QAC1C,IAAI,YAAY,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACxC,IAAA,sBAAe,EAAC,EAAE,EAAE,IAAI,OAAO,iCAAiC,CAAC,CAAA;QACnE,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxItems" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxItems", "minItems"],
    type: "array",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);
    },
};
exports.default = def;
//# sourceMappingURL=limitItems.js.map{"version":3,"file":"limitItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitItems.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACtD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,QAAQ,CAAA;IAC5D,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IACjC,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAC/D,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,WAAW,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACtD,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const ucs2length_1 = require("../../runtime/ucs2length");
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxLength" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxLength", "minLength"],
    type: "string",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode, it } = cxt;
        const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
        const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
        cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);
    },
};
exports.default = def;
//# sourceMappingURL=limitLength.js.map{"version":3,"file":"limitLength.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitLength.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AACvD,6CAA0C;AAC1C,yDAAiD;AAEjD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QACvD,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QAC3C,MAAM,EAAE,GAAG,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QAChE,MAAM,GAAG,GACP,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,cAAO,EAAC,GAAG,CAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,IAAI,GAAG,CAAA;QAC7F,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum";
type Comparison = "<=" | ">=" | "<" | ">";
export type LimitNumberError = ErrorObject<Kwd, {
    limit: number;
    comparison: Comparison;
}, number | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const ops = codegen_1.operators;
const KWDs = {
    maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
    minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
    exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
    exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
};
const error = {
    message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,
    params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
};
const def = {
    keyword: Object.keys(KWDs),
    type: "number",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
    },
};
exports.default = def;
//# sourceMappingURL=limitNumber.js.map{"version":3,"file":"limitNumber.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitNumber.ts"],"names":[],"mappings":";;AAEA,mDAA6D;AAE7D,MAAM,GAAG,GAAG,mBAAS,CAAA;AAMrB,MAAM,IAAI,GAA4D;IACpE,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,OAAO,EAAE,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,EAAC;IACjD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;IACzD,gBAAgB,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,EAAC;CAC1D,CAAA;AAQD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,WAAW,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,IAAI,UAAU,EAAE;IAC5F,MAAM,EAAE,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC,EAAE,EAAE,CAChC,IAAA,WAAC,EAAA,gBAAgB,IAAI,CAAC,OAAc,CAAC,CAAC,KAAK,YAAY,UAAU,GAAG;CACvE,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;IAC1B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,GAAG,IAAI,IAAI,IAAI,CAAC,OAAc,CAAC,CAAC,IAAI,IAAI,UAAU,aAAa,IAAI,GAAG,CAAC,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition } from "../../types";
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const error = {
    message({ keyword, schemaCode }) {
        const comp = keyword === "maxProperties" ? "more" : "fewer";
        return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;
    },
    params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
};
const def = {
    keyword: ["maxProperties", "minProperties"],
    type: "object",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { keyword, data, schemaCode } = cxt;
        const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
        cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);
    },
};
exports.default = def;
//# sourceMappingURL=limitProperties.js.map{"version":3,"file":"limitProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/limitProperties.ts"],"names":[],"mappings":";;AAEA,mDAAuD;AAEvD,MAAM,KAAK,GAA2B;IACpC,OAAO,CAAC,EAAC,OAAO,EAAE,UAAU,EAAC;QAC3B,MAAM,IAAI,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAC3D,OAAO,IAAA,aAAG,EAAA,iBAAiB,IAAI,SAAS,UAAU,aAAa,CAAA;IACjE,CAAC;IACD,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,WAAW,UAAU,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;IAC3C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,GAAG,GAAG,CAAA;QACvC,MAAM,EAAE,GAAG,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAC,CAAC,CAAC,mBAAS,CAAC,EAAE,CAAA;QACpE,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,eAAe,IAAI,YAAY,EAAE,IAAI,UAAU,EAAE,CAAC,CAAA;IACnE,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type MultipleOfError = ErrorObject<"multipleOf", {
    multipleOf: number;
}, number | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,
    params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,
};
const def = {
    keyword: "multipleOf",
    type: "number",
    schemaType: "number",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, schemaCode, it } = cxt;
        // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
        const prec = it.opts.multipleOfPrecision;
        const res = gen.let("res");
        const invalid = prec
            ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
            : (0, codegen_1._) `${res} !== parseInt(${res})`;
        cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
    },
};
exports.default = def;
//# sourceMappingURL=multipleOf.js.map{"version":3,"file":"multipleOf.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/multipleOf.ts"],"names":[],"mappings":";;AAEA,mDAA4C;AAQ5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,EAAE;IACjE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,gBAAgB,UAAU,GAAG;CACzD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACvC,sEAAsE;QACtE,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAA;QACxC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAC1B,MAAM,OAAO,GAAG,IAAI;YAClB,CAAC,CAAC,IAAA,WAAC,EAAA,uBAAuB,GAAG,OAAO,GAAG,UAAU,IAAI,EAAE;YACvD,CAAC,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,iBAAiB,GAAG,GAAG,CAAA;QAClC,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI,UAAU,KAAK,OAAO,IAAI,CAAC,CAAA;IACzF,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type PatternError = ErrorObject<"pattern", {
    pattern: string;
}, string | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const error = {
    message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`,
    params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,
};
const def = {
    keyword: "pattern",
    type: "string",
    schemaType: "string",
    $data: true,
    error,
    code(cxt) {
        const { data, $data, schema, schemaCode, it } = cxt;
        // TODO regexp should be wrapped in try/catchs
        const u = it.opts.unicodeRegExp ? "u" : "";
        const regExp = $data ? (0, codegen_1._) `(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
        cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);
    },
};
exports.default = def;
//# sourceMappingURL=pattern.js.map{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/pattern.ts"],"names":[],"mappings":";;AAEA,kCAAkC;AAClC,mDAA4C;AAI5C,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,uBAAuB,UAAU,GAAG;IAClE,MAAM,EAAE,CAAC,EAAC,UAAU,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,aAAa,UAAU,GAAG;CACtD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,8CAA8C;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QAC1C,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,IAAA,WAAC,EAAA,eAAe,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,iBAAU,EAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QACrF,GAAG,CAAC,SAAS,CAAC,IAAA,WAAC,EAAA,IAAI,MAAM,SAAS,IAAI,GAAG,CAAC,CAAA;IAC5C,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type RequiredError = ErrorObject<"required", {
    missingProperty: string;
}, string[] | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const code_1 = require("../code");
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const error = {
    message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,
    params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,
};
const def = {
    keyword: "required",
    type: "object",
    schemaType: "array",
    $data: true,
    error,
    code(cxt) {
        const { gen, schema, schemaCode, data, $data, it } = cxt;
        const { opts } = it;
        if (!$data && schema.length === 0)
            return;
        const useLoop = schema.length >= opts.loopRequired;
        if (it.allErrors)
            allErrorsMode();
        else
            exitOnErrorMode();
        if (opts.strictRequired) {
            const props = cxt.parentSchema.properties;
            const { definedProperties } = cxt.it;
            for (const requiredKey of schema) {
                if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {
                    const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
                    const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
                    (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
                }
            }
        }
        function allErrorsMode() {
            if (useLoop || $data) {
                cxt.block$data(codegen_1.nil, loopAllRequired);
            }
            else {
                for (const prop of schema) {
                    (0, code_1.checkReportMissingProp)(cxt, prop);
                }
            }
        }
        function exitOnErrorMode() {
            const missing = gen.let("missing");
            if (useLoop || $data) {
                const valid = gen.let("valid", true);
                cxt.block$data(valid, () => loopUntilMissing(missing, valid));
                cxt.ok(valid);
            }
            else {
                gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
                (0, code_1.reportMissingProp)(cxt, missing);
                gen.else();
            }
        }
        function loopAllRequired() {
            gen.forOf("prop", schemaCode, (prop) => {
                cxt.setParams({ missingProperty: prop });
                gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
            });
        }
        function loopUntilMissing(missing, valid) {
            cxt.setParams({ missingProperty: missing });
            gen.forOf(missing, schemaCode, () => {
                gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
                gen.if((0, codegen_1.not)(valid), () => {
                    cxt.error();
                    gen.break();
                });
            }, codegen_1.nil);
        }
    },
};
exports.default = def;
//# sourceMappingURL=required.js.map{"version":3,"file":"required.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/required.ts"],"names":[],"mappings":";;AAEA,kCAMgB;AAChB,mDAAkE;AAClE,6CAAkD;AAQlD,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,aAAG,EAAA,gCAAgC,eAAe,GAAG;IAC/F,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,eAAe,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,qBAAqB,eAAe,GAAG;CAClF,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,OAAO;IACnB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACtD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,OAAM;QACzC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,YAAY,CAAA;QAClD,IAAI,EAAE,CAAC,SAAS;YAAE,aAAa,EAAE,CAAA;;YAC5B,eAAe,EAAE,CAAA;QAEtB,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,UAAU,CAAA;YACzC,MAAM,EAAC,iBAAiB,EA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AAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;gBAC9C,IAAA,wBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,CAAA;gBAC/B,GAAG,CAAC,IAAI,EAAE,CAAA;YACZ,CAAC;QACH,CAAC;QAED,SAAS,eAAe;YACtB,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,UAAkB,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC7C,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAA;gBACtC,GAAG,CAAC,EAAE,CAAC,IAAA,uBAAgB,EAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;YAClF,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,SAAS,gBAAgB,CAAC,OAAa,EAAE,KAAW;YAClD,GAAG,CAAC,SAAS,CAAC,EAAC,eAAe,EAAE,OAAO,EAAC,CAAC,CAAA;YACzC,GAAG,CAAC,KAAK,CACP,OAAO,EACP,UAAkB,EAClB,GAAG,EAAE;gBACH,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAA,qBAAc,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAA;gBACzE,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE;oBACtB,GAAG,CAAC,KAAK,EAAE,CAAA;oBACX,GAAG,CAAC,KAAK,EAAE,CAAA;gBACb,CAAC,CAAC,CAAA;YACJ,CAAC,EACD,aAAG,CACJ,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type UniqueItemsError = ErrorObject<"uniqueItems", {
    i: number;
    j: number;
}, boolean | {
    $data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dataType_1 = require("../../compile/validate/dataType");
const codegen_1 = require("../../compile/codegen");
const util_1 = require("../../compile/util");
const equal_1 = require("../../runtime/equal");
const error = {
    message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
    params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,
};
const def = {
    keyword: "uniqueItems",
    type: "array",
    schemaType: "boolean",
    $data: true,
    error,
    code(cxt) {
        const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
        if (!$data && !schema)
            return;
        const valid = gen.let("valid");
        const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
        cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);
        cxt.ok(valid);
        function validateUniqueItems() {
            const i = gen.let("i", (0, codegen_1._) `${data}.length`);
            const j = gen.let("j");
            cxt.setParams({ i, j });
            gen.assign(valid, true);
            gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
        }
        function canOptimize() {
            return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
        }
        function loopN(i, j) {
            const item = gen.name("item");
            const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
            const indices = gen.const("indices", (0, codegen_1._) `{}`);
            gen.for((0, codegen_1._) `;${i}--;`, () => {
                gen.let(item, (0, codegen_1._) `${data}[${i}]`);
                gen.if(wrongType, (0, codegen_1._) `continue`);
                if (itemTypes.length > 1)
                    gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`);
                gen
                    .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => {
                    gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);
                    cxt.error();
                    gen.assign(valid, false).break();
                })
                    .code((0, codegen_1._) `${indices}[${item}] = ${i}`);
            });
        }
        function loopN2(i, j) {
            const eql = (0, util_1.useFunc)(gen, equal_1.default);
            const outer = gen.name("outer");
            gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {
                cxt.error();
                gen.assign(valid, false).break(outer);
            })));
        }
    },
};
exports.default = def;
//# sourceMappingURL=uniqueItems.js.map{"version":3,"file":"uniqueItems.js","sourceRoot":"","sources":["../../../lib/vocabularies/validation/uniqueItems.ts"],"names":[],"mappings":";;AAEA,8DAAwF;AACxF,mDAAkD;AAClD,6CAA0C;AAC1C,+CAAuC;AAQvC,MAAM,KAAK,GAA2B;IACpC,OAAO,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAC5B,IAAA,aAAG,EAAA,2CAA2C,CAAC,QAAQ,CAAC,iBAAiB;IAC3E,MAAM,EAAE,CAAC,EAAC,MAAM,EAAE,EAAC,CAAC,EAAE,CAAC,EAAC,EAAC,EAAE,EAAE,CAAC,IAAA,WAAC,EAAA,OAAO,CAAC,QAAQ,CAAC,GAAG;CACpD,CAAA;AAED,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,IAAI;IACX,KAAK;IACL,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACpE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;YAAE,OAAM;QAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9B,MAAM,SAAS,GAAG,Y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CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,CACrC,GAAG,CAAC,GAAG,CAAC,IAAA,WAAC,EAAA,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CACpC,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE;gBACnD,GAAG,CAAC,KAAK,EAAE,CAAA;gBACX,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,CACH,CACF,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}import type {AnySchemaObject} from "./types"
import AjvCore, {Options} from "./core"

import draft7Vocabularies from "./vocabularies/draft7"
import dynamicVocabulary from "./vocabularies/dynamic"
import nextVocabulary from "./vocabularies/next"
import unevaluatedVocabulary from "./vocabularies/unevaluated"
import discriminator from "./vocabularies/discriminator"
import addMetaSchema2019 from "./refs/json-schema-2019-09"

const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema"

export class Ajv2019 extends AjvCore {
  constructor(opts: Options = {}) {
    super({
      ...opts,
      dynamicRef: true,
      next: true,
      unevaluated: true,
    })
  }

  _addVocabularies(): void {
    super._addVocabularies()
    this.addVocabulary(dynamicVocabulary)
    draft7Vocabularies.forEach((v) => this.addVocabulary(v))
    this.addVocabulary(nextVocabulary)
    this.addVocabulary(unevaluatedVocabulary)
    if (this.opts.discriminator) this.addKeyword(discriminator)
  }

  _addDefaultMetaSchema(): void {
    super._addDefaultMetaSchema()
    const {$data, meta} = this.opts
    if (!meta) return
    addMetaSchema2019.call(this, $data)
    this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID
  }

  defaultMeta(): string | AnySchemaObject | undefined {
    return (this.opts.defaultMeta =
      super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))
  }
}

module.exports = exports = Ajv2019
module.exports.Ajv2019 = Ajv2019
Object.defineProperty(exports, "__esModule", {value: true})

export default Ajv2019

export {
  Format,
  FormatDefinition,
  AsyncFormatDefinition,
  KeywordDefinition,
  KeywordErrorDefinition,
  CodeKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
  Vocabulary,
  Schema,
  SchemaObject,
  AnySchemaObject,
  AsyncSchema,
  AnySchema,
  ValidateFunction,
  AsyncValidateFunction,
  ErrorObject,
  ErrorNoParams,
} from "./types"

export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
export {default as ValidationError} from "./runtime/validation_error"
export {default as MissingRefError} from "./compile/ref_error"
import type {AnySchemaObject} from "./types"
import AjvCore, {Options} from "./core"

import draft2020Vocabularies from "./vocabularies/draft2020"
import discriminator from "./vocabularies/discriminator"
import addMetaSchema2020 from "./refs/json-schema-2020-12"

const META_SCHEMA_ID = "https://json-schema.org/draft/2020-12/schema"

export class Ajv2020 extends AjvCore {
  constructor(opts: Options = {}) {
    super({
      ...opts,
      dynamicRef: true,
      next: true,
      unevaluated: true,
    })
  }

  _addVocabularies(): void {
    super._addVocabularies()
    draft2020Vocabularies.forEach((v) => this.addVocabulary(v))
    if (this.opts.discriminator) this.addKeyword(discriminator)
  }

  _addDefaultMetaSchema(): void {
    super._addDefaultMetaSchema()
    const {$data, meta} = this.opts
    if (!meta) return
    addMetaSchema2020.call(this, $data)
    this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID
  }

  defaultMeta(): string | AnySchemaObject | undefined {
    return (this.opts.defaultMeta =
      super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))
  }
}

module.exports = exports = Ajv2020
module.exports.Ajv2020 = Ajv2020
Object.defineProperty(exports, "__esModule", {value: true})

export default Ajv2020

export {
  Format,
  FormatDefinition,
  AsyncFormatDefinition,
  KeywordDefinition,
  KeywordErrorDefinition,
  CodeKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
  Vocabulary,
  Schema,
  SchemaObject,
  AnySchemaObject,
  AsyncSchema,
  AnySchema,
  ValidateFunction,
  AsyncValidateFunction,
  ErrorObject,
  ErrorNoParams,
} from "./types"

export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
export {default as ValidationError} from "./runtime/validation_error"
export {default as MissingRefError} from "./compile/ref_error"
import type {AnySchemaObject} from "./types"
import AjvCore from "./core"
import draft7Vocabularies from "./vocabularies/draft7"
import discriminator from "./vocabularies/discriminator"
import * as draft7MetaSchema from "./refs/json-schema-draft-07.json"

const META_SUPPORT_DATA = ["/properties"]

const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"

export class Ajv extends AjvCore {
  _addVocabularies(): void {
    super._addVocabularies()
    draft7Vocabularies.forEach((v) => this.addVocabulary(v))
    if (this.opts.discriminator) this.addKeyword(discriminator)
  }

  _addDefaultMetaSchema(): void {
    super._addDefaultMetaSchema()
    if (!this.opts.meta) return
    const metaSchema = this.opts.$data
      ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
      : draft7MetaSchema
    this.addMetaSchema(metaSchema, META_SCHEMA_ID, false)
    this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID
  }

  defaultMeta(): string | AnySchemaObject | undefined {
    return (this.opts.defaultMeta =
      super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))
  }
}

module.exports = exports = Ajv
module.exports.Ajv = Ajv
Object.defineProperty(exports, "__esModule", {value: true})

export default Ajv

export {
  Format,
  FormatDefinition,
  AsyncFormatDefinition,
  KeywordDefinition,
  KeywordErrorDefinition,
  CodeKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
  Vocabulary,
  Schema,
  SchemaObject,
  AnySchemaObject,
  AsyncSchema,
  AnySchema,
  ValidateFunction,
  AsyncValidateFunction,
  SchemaValidateFunction,
  ErrorObject,
  ErrorNoParams,
} from "./types"

export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
export {default as ValidationError} from "./runtime/validation_error"
export {default as MissingRefError} from "./compile/ref_error"
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
export abstract class _CodeOrName {
  abstract readonly str: string
  abstract readonly names: UsedNames
  abstract toString(): string
  abstract emptyStr(): boolean
}

export const IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i

export class Name extends _CodeOrName {
  readonly str: string
  constructor(s: string) {
    super()
    if (!IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier")
    this.str = s
  }

  toString(): string {
    return this.str
  }

  emptyStr(): boolean {
    return false
  }

  get names(): UsedNames {
    return {[this.str]: 1}
  }
}

export class _Code extends _CodeOrName {
  readonly _items: readonly CodeItem[]
  private _str?: string
  private _names?: UsedNames

  constructor(code: string | readonly CodeItem[]) {
    super()
    this._items = typeof code === "string" ? [code] : code
  }

  toString(): string {
    return this.str
  }

  emptyStr(): boolean {
    if (this._items.length > 1) return false
    const item = this._items[0]
    return item === "" || item === '""'
  }

  get str(): string {
    return (this._str ??= this._items.reduce((s: string, c: CodeItem) => `${s}${c}`, ""))
  }

  get names(): UsedNames {
    return (this._names ??= this._items.reduce((names: UsedNames, c) => {
      if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1
      return names
    }, {}))
  }
}

export type CodeItem = Name | string | number | boolean | null

export type UsedNames = Record<string, number | undefined>

export type Code = _Code | Name

export type SafeExpr = Code | number | boolean | null

export const nil = new _Code("")

type CodeArg = SafeExpr | string | undefined

export function _(strs: TemplateStringsArray, ...args: CodeArg[]): _Code {
  const code: CodeItem[] = [strs[0]]
  let i = 0
  while (i < args.length) {
    addCodeArg(code, args[i])
    code.push(strs[++i])
  }
  return new _Code(code)
}

const plus = new _Code("+")

export function str(strs: TemplateStringsArray, ...args: (CodeArg | string[])[]): _Code {
  const expr: CodeItem[] = [safeStringify(strs[0])]
  let i = 0
  while (i < args.length) {
    expr.push(plus)
    addCodeArg(expr, args[i])
    expr.push(plus, safeStringify(strs[++i]))
  }
  optimize(expr)
  return new _Code(expr)
}

export function addCodeArg(code: CodeItem[], arg: CodeArg | string[]): void {
  if (arg instanceof _Code) code.push(...arg._items)
  else if (arg instanceof Name) code.push(arg)
  else code.push(interpolate(arg))
}

function optimize(expr: CodeItem[]): void {
  let i = 1
  while (i < expr.length - 1) {
    if (expr[i] === plus) {
      const res = mergeExprItems(expr[i - 1], expr[i + 1])
      if (res !== undefined) {
        expr.splice(i - 1, 3, res)
        continue
      }
      expr[i++] = "+"
    }
    i++
  }
}

function mergeExprItems(a: CodeItem, b: CodeItem): CodeItem | undefined {
  if (b === '""') return a
  if (a === '""') return b
  if (typeof a == "string") {
    if (b instanceof Name || a[a.length - 1] !== '"') return
    if (typeof b != "string") return `${a.slice(0, -1)}${b}"`
    if (b[0] === '"') return a.slice(0, -1) + b.slice(1)
    return
  }
  if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}`
  return
}

export function strConcat(c1: Code, c2: Code): Code {
  return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`
}

// TODO do not allow arrays here
function interpolate(x?: string | string[] | number | boolean | null): SafeExpr | string {
  return typeof x == "number" || typeof x == "boolean" || x === null
    ? x
    : safeStringify(Array.isArray(x) ? x.join(",") : x)
}

export function stringify(x: unknown): Code {
  return new _Code(safeStringify(x))
}

export function safeStringify(x: unknown): string {
  return JSON.stringify(x)
    .replace(/\u2028/g, "\\u2028")
    .replace(/\u2029/g, "\\u2029")
}

export function getProperty(key: Code | string | number): Code {
  return typeof key == "string" && IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`
}

//Does best effort to format the name properly
export function getEsmExportName(key: Code | string | number): Code {
  if (typeof key == "string" && IDENTIFIER.test(key)) {
    return new _Code(`${key}`)
  }
  throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`)
}

export function regexpCode(rx: RegExp): Code {
  return new _Code(rx.toString())
}
import type {ScopeValueSets, NameValue, ValueScope, ValueScopeName} from "./scope"
import {_, nil, _Code, Code, Name, UsedNames, CodeItem, addCodeArg, _CodeOrName} from "./code"
import {Scope, varKinds} from "./scope"

export {_, str, strConcat, nil, getProperty, stringify, regexpCode, Name, Code} from "./code"
export {Scope, ScopeStore, ValueScope, ValueScopeName, ScopeValueSets, varKinds} from "./scope"

// type for expressions that can be safely inserted in code without quotes
export type SafeExpr = Code | number | boolean | null

// type that is either Code of function that adds code to CodeGen instance using its methods
export type Block = Code | (() => void)

export const operators = {
  GT: new _Code(">"),
  GTE: new _Code(">="),
  LT: new _Code("<"),
  LTE: new _Code("<="),
  EQ: new _Code("==="),
  NEQ: new _Code("!=="),
  NOT: new _Code("!"),
  OR: new _Code("||"),
  AND: new _Code("&&"),
  ADD: new _Code("+"),
}

abstract class Node {
  abstract readonly names: UsedNames

  optimizeNodes(): this | ChildNode | ChildNode[] | undefined {
    return this
  }

  optimizeNames(_names: UsedNames, _constants: Constants): this | undefined {
    return this
  }

  // get count(): number {
  //   return 1
  // }
}

class Def extends Node {
  constructor(
    private readonly varKind: Name,
    private readonly name: Name,
    private rhs?: SafeExpr
  ) {
    super()
  }

  render({es5, _n}: CGOptions): string {
    const varKind = es5 ? varKinds.var : this.varKind
    const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`
    return `${varKind} ${this.name}${rhs};` + _n
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    if (!names[this.name.str]) return
    if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants)
    return this
  }

  get names(): UsedNames {
    return this.rhs instanceof _CodeOrName ? this.rhs.names : {}
  }
}

class Assign extends Node {
  constructor(
    readonly lhs: Code,
    public rhs: SafeExpr,
    private readonly sideEffects?: boolean
  ) {
    super()
  }

  render({_n}: CGOptions): string {
    return `${this.lhs} = ${this.rhs};` + _n
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    if (this.lhs instanceof Name && !names[this.lhs.str] && !this.sideEffects) return
    this.rhs = optimizeExpr(this.rhs, names, constants)
    return this
  }

  get names(): UsedNames {
    const names = this.lhs instanceof Name ? {} : {...this.lhs.names}
    return addExprNames(names, this.rhs)
  }
}

class AssignOp extends Assign {
  constructor(
    lhs: Code,
    private readonly op: Code,
    rhs: SafeExpr,
    sideEffects?: boolean
  ) {
    super(lhs, rhs, sideEffects)
  }

  render({_n}: CGOptions): string {
    return `${this.lhs} ${this.op}= ${this.rhs};` + _n
  }
}

class Label extends Node {
  readonly names: UsedNames = {}
  constructor(readonly label: Name) {
    super()
  }

  render({_n}: CGOptions): string {
    return `${this.label}:` + _n
  }
}

class Break extends Node {
  readonly names: UsedNames = {}
  constructor(readonly label?: Code) {
    super()
  }

  render({_n}: CGOptions): string {
    const label = this.label ? ` ${this.label}` : ""
    return `break${label};` + _n
  }
}

class Throw extends Node {
  constructor(readonly error: Code) {
    super()
  }

  render({_n}: CGOptions): string {
    return `throw ${this.error};` + _n
  }

  get names(): UsedNames {
    return this.error.names
  }
}

class AnyCode extends Node {
  constructor(private code: SafeExpr) {
    super()
  }

  render({_n}: CGOptions): string {
    return `${this.code};` + _n
  }

  optimizeNodes(): this | undefined {
    return `${this.code}` ? this : undefined
  }

  optimizeNames(names: UsedNames, constants: Constants): this {
    this.code = optimizeExpr(this.code, names, constants)
    return this
  }

  get names(): UsedNames {
    return this.code instanceof _CodeOrName ? this.code.names : {}
  }
}

abstract class ParentNode extends Node {
  constructor(readonly nodes: ChildNode[] = []) {
    super()
  }

  render(opts: CGOptions): string {
    return this.nodes.reduce((code, n) => code + n.render(opts), "")
  }

  optimizeNodes(): this | ChildNode | ChildNode[] | undefined {
    const {nodes} = this
    let i = nodes.length
    while (i--) {
      const n = nodes[i].optimizeNodes()
      if (Array.isArray(n)) nodes.splice(i, 1, ...n)
      else if (n) nodes[i] = n
      else nodes.splice(i, 1)
    }
    return nodes.length > 0 ? this : undefined
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    const {nodes} = this
    let i = nodes.length
    while (i--) {
      // iterating backwards improves 1-pass optimization
      const n = nodes[i]
      if (n.optimizeNames(names, constants)) continue
      subtractNames(names, n.names)
      nodes.splice(i, 1)
    }
    return nodes.length > 0 ? this : undefined
  }

  get names(): UsedNames {
    return this.nodes.reduce((names: UsedNames, n) => addNames(names, n.names), {})
  }

  // get count(): number {
  //   return this.nodes.reduce((c, n) => c + n.count, 1)
  // }
}

abstract class BlockNode extends ParentNode {
  render(opts: CGOptions): string {
    return "{" + opts._n + super.render(opts) + "}" + opts._n
  }
}

class Root extends ParentNode {}

class Else extends BlockNode {
  static readonly kind = "else"
}

class If extends BlockNode {
  static readonly kind = "if"
  else?: If | Else
  constructor(
    private condition: Code | boolean,
    nodes?: ChildNode[]
  ) {
    super(nodes)
  }

  render(opts: CGOptions): string {
    let code = `if(${this.condition})` + super.render(opts)
    if (this.else) code += "else " + this.else.render(opts)
    return code
  }

  optimizeNodes(): If | ChildNode[] | undefined {
    super.optimizeNodes()
    const cond = this.condition
    if (cond === true) return this.nodes // else is ignored here
    let e = this.else
    if (e) {
      const ns = e.optimizeNodes()
      e = this.else = Array.isArray(ns) ? new Else(ns) : (ns as Else | undefined)
    }
    if (e) {
      if (cond === false) return e instanceof If ? e : e.nodes
      if (this.nodes.length) return this
      return new If(not(cond), e instanceof If ? [e] : e.nodes)
    }
    if (cond === false || !this.nodes.length) return undefined
    return this
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    this.else = this.else?.optimizeNames(names, constants)
    if (!(super.optimizeNames(names, constants) || this.else)) return
    this.condition = optimizeExpr(this.condition, names, constants)
    return this
  }

  get names(): UsedNames {
    const names = super.names
    addExprNames(names, this.condition)
    if (this.else) addNames(names, this.else.names)
    return names
  }

  // get count(): number {
  //   return super.count + (this.else?.count || 0)
  // }
}

abstract class For extends BlockNode {
  static readonly kind = "for"
}

class ForLoop extends For {
  constructor(private iteration: Code) {
    super()
  }

  render(opts: CGOptions): string {
    return `for(${this.iteration})` + super.render(opts)
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    if (!super.optimizeNames(names, constants)) return
    this.iteration = optimizeExpr(this.iteration, names, constants)
    return this
  }

  get names(): UsedNames {
    return addNames(super.names, this.iteration.names)
  }
}

class ForRange extends For {
  constructor(
    private readonly varKind: Name,
    private readonly name: Name,
    private readonly from: SafeExpr,
    private readonly to: SafeExpr
  ) {
    super()
  }

  render(opts: CGOptions): string {
    const varKind = opts.es5 ? varKinds.var : this.varKind
    const {name, from, to} = this
    return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts)
  }

  get names(): UsedNames {
    const names = addExprNames(super.names, this.from)
    return addExprNames(names, this.to)
  }
}

class ForIter extends For {
  constructor(
    private readonly loop: "of" | "in",
    private readonly varKind: Name,
    private readonly name: Name,
    private iterable: Code
  ) {
    super()
  }

  render(opts: CGOptions): string {
    return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts)
  }

  optimizeNames(names: UsedNames, constants: Constants): this | undefined {
    if (!super.optimizeNames(names, constants)) return
    this.iterable = optimizeExpr(this.iterable, names, constants)
    return this
  }

  get names(): UsedNames {
    return addNames(super.names, this.iterable.names)
  }
}

class Func extends BlockNode {
  static readonly kind = "func"
  constructor(
    public name: Name,
    public args: Code,
    public async?: boolean
  ) {
    super()
  }

  render(opts: CGOptions): string {
    const _async = this.async ? "async " : ""
    return `${_async}function ${this.name}(${this.args})` + super.render(opts)
  }
}

class Return extends ParentNode {
  static readonly kind = "return"

  render(opts: CGOptions): string {
    return "return " + super.render(opts)
  }
}

class Try extends BlockNode {
  catch?: Catch
  finally?: Finally

  render(opts: CGOptions): string {
    let code = "try" + super.render(opts)
    if (this.catch) code += this.catch.render(opts)
    if (this.finally) code += this.finally.render(opts)
    return code
  }

  optimizeNodes(): this {
    super.optimizeNodes()
    this.catch?.optimizeNodes() as Catch | undefined
    this.finally?.optimizeNodes() as Finally | undefined
    return this
  }

  optimizeNames(names: UsedNames, constants: Constants): this {
    super.optimizeNames(names, constants)
    this.catch?.optimizeNames(names, constants)
    this.finally?.optimizeNames(names, constants)
    return this
  }

  get names(): UsedNames {
    const names = super.names
    if (this.catch) addNames(names, this.catch.names)
    if (this.finally) addNames(names, this.finally.names)
    return names
  }

  // get count(): number {
  //   return super.count + (this.catch?.count || 0) + (this.finally?.count || 0)
  // }
}

class Catch extends BlockNode {
  static readonly kind = "catch"
  constructor(readonly error: Name) {
    super()
  }

  render(opts: CGOptions): string {
    return `catch(${this.error})` + super.render(opts)
  }
}

class Finally extends BlockNode {
  static readonly kind = "finally"
  render(opts: CGOptions): string {
    return "finally" + super.render(opts)
  }
}

type StartBlockNode = If | For | Func | Return | Try

type LeafNode = Def | Assign | Label | Break | Throw | AnyCode

type ChildNode = StartBlockNode | LeafNode

type EndBlockNodeType =
  | typeof If
  | typeof Else
  | typeof For
  | typeof Func
  | typeof Return
  | typeof Catch
  | typeof Finally

type Constants = Record<string, SafeExpr | undefined>

export interface CodeGenOptions {
  es5?: boolean
  lines?: boolean
  ownProperties?: boolean
}

interface CGOptions extends CodeGenOptions {
  _n: "\n" | ""
}

export class CodeGen {
  readonly _scope: Scope
  readonly _extScope: ValueScope
  readonly _values: ScopeValueSets = {}
  private readonly _nodes: ParentNode[]
  private readonly _blockStarts: number[] = []
  private readonly _constants: Constants = {}
  private readonly opts: CGOptions

  constructor(extScope: ValueScope, opts: CodeGenOptions = {}) {
    this.opts = {...opts, _n: opts.lines ? "\n" : ""}
    this._extScope = extScope
    this._scope = new Scope({parent: extScope})
    this._nodes = [new Root()]
  }

  toString(): string {
    return this._root.render(this.opts)
  }

  // returns unique name in the internal scope
  name(prefix: string): Name {
    return this._scope.name(prefix)
  }

  // reserves unique name in the external scope
  scopeName(prefix: string): ValueScopeName {
    return this._extScope.name(prefix)
  }

  // reserves unique name in the external scope and assigns value to it
  scopeValue(prefixOrName: ValueScopeName | string, value: NameValue): Name {
    const name = this._extScope.value(prefixOrName, value)
    const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set())
    vs.add(name)
    return name
  }

  getScopeValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined {
    return this._extScope.getValue(prefix, keyOrRef)
  }

  // return code that assigns values in the external scope to the names that are used internally
  // (same names that were returned by gen.scopeName or gen.scopeValue)
  scopeRefs(scopeName: Name): Code {
    return this._extScope.scopeRefs(scopeName, this._values)
  }

  scopeCode(): Code {
    return this._extScope.scopeCode(this._values)
  }

  private _def(
    varKind: Name,
    nameOrPrefix: Name | string,
    rhs?: SafeExpr,
    constant?: boolean
  ): Name {
    const name = this._scope.toName(nameOrPrefix)
    if (rhs !== undefined && constant) this._constants[name.str] = rhs
    this._leafNode(new Def(varKind, name, rhs))
    return name
  }

  // `const` declaration (`var` in es5 mode)
  const(nameOrPrefix: Name | string, rhs: SafeExpr, _constant?: boolean): Name {
    return this._def(varKinds.const, nameOrPrefix, rhs, _constant)
  }

  // `let` declaration with optional assignment (`var` in es5 mode)
  let(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name {
    return this._def(varKinds.let, nameOrPrefix, rhs, _constant)
  }

  // `var` declaration with optional assignment
  var(nameOrPrefix: Name | string, rhs?: SafeExpr, _constant?: boolean): Name {
    return this._def(varKinds.var, nameOrPrefix, rhs, _constant)
  }

  // assignment code
  assign(lhs: Code, rhs: SafeExpr, sideEffects?: boolean): CodeGen {
    return this._leafNode(new Assign(lhs, rhs, sideEffects))
  }

  // `+=` code
  add(lhs: Code, rhs: SafeExpr): CodeGen {
    return this._leafNode(new AssignOp(lhs, operators.ADD, rhs))
  }

  // appends passed SafeExpr to code or executes Block
  code(c: Block | SafeExpr): CodeGen {
    if (typeof c == "function") c()
    else if (c !== nil) this._leafNode(new AnyCode(c))
    return this
  }

  // returns code for object literal for the passed argument list of key-value pairs
  object(...keyValues: [Name | string, SafeExpr | string][]): _Code {
    const code: CodeItem[] = ["{"]
    for (const [key, value] of keyValues) {
      if (code.length > 1) code.push(",")
      code.push(key)
      if (key !== value || this.opts.es5) {
        code.push(":")
        addCodeArg(code, value)
      }
    }
    code.push("}")
    return new _Code(code)
  }

  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
  if(condition: Code | boolean, thenBody?: Block, elseBody?: Block): CodeGen {
    this._blockNode(new If(condition))

    if (thenBody && elseBody) {
      this.code(thenBody).else().code(elseBody).endIf()
    } else if (thenBody) {
      this.code(thenBody).endIf()
    } else if (elseBody) {
      throw new Error('CodeGen: "else" body without "then" body')
    }
    return this
  }

  // `else if` clause - invalid without `if` or after `else` clauses
  elseIf(condition: Code | boolean): CodeGen {
    return this._elseNode(new If(condition))
  }

  // `else` clause - only valid after `if` or `else if` clauses
  else(): CodeGen {
    return this._elseNode(new Else())
  }

  // end `if` statement (needed if gen.if was used only with condition)
  endIf(): CodeGen {
    return this._endBlockNode(If, Else)
  }

  private _for(node: For, forBody?: Block): CodeGen {
    this._blockNode(node)
    if (forBody) this.code(forBody).endFor()
    return this
  }

  // a generic `for` clause (or statement if `forBody` is passed)
  for(iteration: Code, forBody?: Block): CodeGen {
    return this._for(new ForLoop(iteration), forBody)
  }

  // `for` statement for a range of values
  forRange(
    nameOrPrefix: Name | string,
    from: SafeExpr,
    to: SafeExpr,
    forBody: (index: Name) => void,
    varKind: Code = this.opts.es5 ? varKinds.var : varKinds.let
  ): CodeGen {
    const name = this._scope.toName(nameOrPrefix)
    return this._for(new ForRange(varKind, name, from, to), () => forBody(name))
  }

  // `for-of` statement (in es5 mode replace with a normal for loop)
  forOf(
    nameOrPrefix: Name | string,
    iterable: Code,
    forBody: (item: Name) => void,
    varKind: Code = varKinds.const
  ): CodeGen {
    const name = this._scope.toName(nameOrPrefix)
    if (this.opts.es5) {
      const arr = iterable instanceof Name ? iterable : this.var("_arr", iterable)
      return this.forRange("_i", 0, _`${arr}.length`, (i) => {
        this.var(name, _`${arr}[${i}]`)
        forBody(name)
      })
    }
    return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name))
  }

  // `for-in` statement.
  // With option `ownProperties` replaced with a `for-of` loop for object keys
  forIn(
    nameOrPrefix: Name | string,
    obj: Code,
    forBody: (item: Name) => void,
    varKind: Code = this.opts.es5 ? varKinds.var : varKinds.const
  ): CodeGen {
    if (this.opts.ownProperties) {
      return this.forOf(nameOrPrefix, _`Object.keys(${obj})`, forBody)
    }
    const name = this._scope.toName(nameOrPrefix)
    return this._for(new ForIter("in", varKind, name, obj), () => forBody(name))
  }

  // end `for` loop
  endFor(): CodeGen {
    return this._endBlockNode(For)
  }

  // `label` statement
  label(label: Name): CodeGen {
    return this._leafNode(new Label(label))
  }

  // `break` statement
  break(label?: Code): CodeGen {
    return this._leafNode(new Break(label))
  }

  // `return` statement
  return(value: Block | SafeExpr): CodeGen {
    const node = new Return()
    this._blockNode(node)
    this.code(value)
    if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node')
    return this._endBlockNode(Return)
  }

  // `try` statement
  try(tryBody: Block, catchCode?: (e: Name) => void, finallyCode?: Block): CodeGen {
    if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"')
    const node = new Try()
    this._blockNode(node)
    this.code(tryBody)
    if (catchCode) {
      const error = this.name("e")
      this._currNode = node.catch = new Catch(error)
      catchCode(error)
    }
    if (finallyCode) {
      this._currNode = node.finally = new Finally()
      this.code(finallyCode)
    }
    return this._endBlockNode(Catch, Finally)
  }

  // `throw` statement
  throw(error: Code): CodeGen {
    return this._leafNode(new Throw(error))
  }

  // start self-balancing block
  block(body?: Block, nodeCount?: number): CodeGen {
    this._blockStarts.push(this._nodes.length)
    if (body) this.code(body).endBlock(nodeCount)
    return this
  }

  // end the current self-balancing block
  endBlock(nodeCount?: number): CodeGen {
    const len = this._blockStarts.pop()
    if (len === undefined) throw new Error("CodeGen: not in self-balancing block")
    const toClose = this._nodes.length - len
    if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
      throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`)
    }
    this._nodes.length = len
    return this
  }

  // `function` heading (or definition if funcBody is passed)
  func(name: Name, args: Code = nil, async?: boolean, funcBody?: Block): CodeGen {
    this._blockNode(new Func(name, args, async))
    if (funcBody) this.code(funcBody).endFunc()
    return this
  }

  // end function definition
  endFunc(): CodeGen {
    return this._endBlockNode(Func)
  }

  optimize(n = 1): void {
    while (n-- > 0) {
      this._root.optimizeNodes()
      this._root.optimizeNames(this._root.names, this._constants)
    }
  }

  private _leafNode(node: LeafNode): CodeGen {
    this._currNode.nodes.push(node)
    return this
  }

  private _blockNode(node: StartBlockNode): void {
    this._currNode.nodes.push(node)
    this._nodes.push(node)
  }

  private _endBlockNode(N1: EndBlockNodeType, N2?: EndBlockNodeType): CodeGen {
    const n = this._currNode
    if (n instanceof N1 || (N2 && n instanceof N2)) {
      this._nodes.pop()
      return this
    }
    throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`)
  }

  private _elseNode(node: If | Else): CodeGen {
    const n = this._currNode
    if (!(n instanceof If)) {
      throw new Error('CodeGen: "else" without "if"')
    }
    this._currNode = n.else = node
    return this
  }

  private get _root(): Root {
    return this._nodes[0] as Root
  }

  private get _currNode(): ParentNode {
    const ns = this._nodes
    return ns[ns.length - 1]
  }

  private set _currNode(node: ParentNode) {
    const ns = this._nodes
    ns[ns.length - 1] = node
  }

  // get nodeCount(): number {
  //   return this._root.count
  // }
}

function addNames(names: UsedNames, from: UsedNames): UsedNames {
  for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0)
  return names
}

function addExprNames(names: UsedNames, from: SafeExpr): UsedNames {
  return from instanceof _CodeOrName ? addNames(names, from.names) : names
}

function optimizeExpr<T extends SafeExpr | Code>(expr: T, names: UsedNames, constants: Constants): T
function optimizeExpr(expr: SafeExpr, names: UsedNames, constants: Constants): SafeExpr {
  if (expr instanceof Name) return replaceName(expr)
  if (!canOptimize(expr)) return expr
  return new _Code(
    expr._items.reduce((items: CodeItem[], c: SafeExpr | string) => {
      if (c instanceof Name) c = replaceName(c)
      if (c instanceof _Code) items.push(...c._items)
      else items.push(c)
      return items
    }, [])
  )

  function replaceName(n: Name): SafeExpr {
    const c = constants[n.str]
    if (c === undefined || names[n.str] !== 1) return n
    delete names[n.str]
    return c
  }

  function canOptimize(e: SafeExpr): e is _Code {
    return (
      e instanceof _Code &&
      e._items.some(
        (c) => c instanceof Name && names[c.str] === 1 && constants[c.str] !== undefined
      )
    )
  }
}

function subtractNames(names: UsedNames, from: UsedNames): void {
  for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0)
}

export function not<T extends Code | SafeExpr>(x: T): T
export function not(x: Code | SafeExpr): Code | SafeExpr {
  return typeof x == "boolean" || typeof x == "number" || x === null ? !x : _`!${par(x)}`
}

const andCode = mappend(operators.AND)

// boolean AND (&&) expression with the passed arguments
export function and(...args: Code[]): Code {
  return args.reduce(andCode)
}

const orCode = mappend(operators.OR)

// boolean OR (||) expression with the passed arguments
export function or(...args: Code[]): Code {
  return args.reduce(orCode)
}

type MAppend = (x: Code, y: Code) => Code

function mappend(op: Code): MAppend {
  return (x, y) => (x === nil ? y : y === nil ? x : _`${par(x)} ${op} ${par(y)}`)
}

function par(x: Code): Code {
  return x instanceof Name ? x : _`(${x})`
}
import {_, nil, Code, Name} from "./code"

interface NameGroup {
  prefix: string
  index: number
}

export interface NameValue {
  ref: ValueReference // this is the reference to any value that can be referred to from generated code via `globals` var in the closure
  key?: unknown // any key to identify a global to avoid duplicates, if not passed ref is used
  code?: Code // this is the code creating the value needed for standalone code wit_out closure - can be a primitive value, function or import (`require`)
}

export type ValueReference = unknown // possibly make CodeGen parameterized type on this type

class ValueError extends Error {
  readonly value?: NameValue
  constructor(name: ValueScopeName) {
    super(`CodeGen: "code" for ${name} not defined`)
    this.value = name.value
  }
}

interface ScopeOptions {
  prefixes?: Set<string>
  parent?: Scope
}

interface ValueScopeOptions extends ScopeOptions {
  scope: ScopeStore
  es5?: boolean
  lines?: boolean
}

export type ScopeStore = Record<string, ValueReference[] | undefined>

type ScopeValues = {
  [Prefix in string]?: Map<unknown, ValueScopeName>
}

export type ScopeValueSets = {
  [Prefix in string]?: Set<ValueScopeName>
}

export enum UsedValueState {
  Started,
  Completed,
}

export type UsedScopeValues = {
  [Prefix in string]?: Map<ValueScopeName, UsedValueState | undefined>
}

export const varKinds = {
  const: new Name("const"),
  let: new Name("let"),
  var: new Name("var"),
}

export class Scope {
  protected readonly _names: {[Prefix in string]?: NameGroup} = {}
  protected readonly _prefixes?: Set<string>
  protected readonly _parent?: Scope

  constructor({prefixes, parent}: ScopeOptions = {}) {
    this._prefixes = prefixes
    this._parent = parent
  }

  toName(nameOrPrefix: Name | string): Name {
    return nameOrPrefix instanceof Name ? nameOrPrefix : this.name(nameOrPrefix)
  }

  name(prefix: string): Name {
    return new Name(this._newName(prefix))
  }

  protected _newName(prefix: string): string {
    const ng = this._names[prefix] || this._nameGroup(prefix)
    return `${prefix}${ng.index++}`
  }

  private _nameGroup(prefix: string): NameGroup {
    if (this._parent?._prefixes?.has(prefix) || (this._prefixes && !this._prefixes.has(prefix))) {
      throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`)
    }
    return (this._names[prefix] = {prefix, index: 0})
  }
}

interface ScopePath {
  property: string
  itemIndex: number
}

export class ValueScopeName extends Name {
  readonly prefix: string
  value?: NameValue
  scopePath?: Code

  constructor(prefix: string, nameStr: string) {
    super(nameStr)
    this.prefix = prefix
  }

  setValue(value: NameValue, {property, itemIndex}: ScopePath): void {
    this.value = value
    this.scopePath = _`.${new Name(property)}[${itemIndex}]`
  }
}

interface VSOptions extends ValueScopeOptions {
  _n: Code
}

const line = _`\n`

export class ValueScope extends Scope {
  protected readonly _values: ScopeValues = {}
  protected readonly _scope: ScopeStore
  readonly opts: VSOptions

  constructor(opts: ValueScopeOptions) {
    super(opts)
    this._scope = opts.scope
    this.opts = {...opts, _n: opts.lines ? line : nil}
  }

  get(): ScopeStore {
    return this._scope
  }

  name(prefix: string): ValueScopeName {
    return new ValueScopeName(prefix, this._newName(prefix))
  }

  value(nameOrPrefix: ValueScopeName | string, value: NameValue): ValueScopeName {
    if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value")
    const name = this.toName(nameOrPrefix) as ValueScopeName
    const {prefix} = name
    const valueKey = value.key ?? value.ref
    let vs = this._values[prefix]
    if (vs) {
      const _name = vs.get(valueKey)
      if (_name) return _name
    } else {
      vs = this._values[prefix] = new Map()
    }
    vs.set(valueKey, name)

    const s = this._scope[prefix] || (this._scope[prefix] = [])
    const itemIndex = s.length
    s[itemIndex] = value.ref
    name.setValue(value, {property: prefix, itemIndex})
    return name
  }

  getValue(prefix: string, keyOrRef: unknown): ValueScopeName | undefined {
    const vs = this._values[prefix]
    if (!vs) return
    return vs.get(keyOrRef)
  }

  scopeRefs(scopeName: Name, values: ScopeValues | ScopeValueSets = this._values): Code {
    return this._reduceValues(values, (name: ValueScopeName) => {
      if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`)
      return _`${scopeName}${name.scopePath}`
    })
  }

  scopeCode(
    values: ScopeValues | ScopeValueSets = this._values,
    usedValues?: UsedScopeValues,
    getCode?: (n: ValueScopeName) => Code | undefined
  ): Code {
    return this._reduceValues(
      values,
      (name: ValueScopeName) => {
        if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`)
        return name.value.code
      },
      usedValues,
      getCode
    )
  }

  private _reduceValues(
    values: ScopeValues | ScopeValueSets,
    valueCode: (n: ValueScopeName) => Code | undefined,
    usedValues: UsedScopeValues = {},
    getCode?: (n: ValueScopeName) => Code | undefined
  ): Code {
    let code: Code = nil
    for (const prefix in values) {
      const vs = values[prefix]
      if (!vs) continue
      const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map())
      vs.forEach((name: ValueScopeName) => {
        if (nameSet.has(name)) return
        nameSet.set(name, UsedValueState.Started)
        let c = valueCode(name)
        if (c) {
          const def = this.opts.es5 ? varKinds.var : varKinds.const
          code = _`${code}${def} ${name} = ${c};${this.opts._n}`
        } else if ((c = getCode?.(name))) {
          code = _`${code}${c}${this.opts._n}`
        } else {
          throw new ValueError(name)
        }
        nameSet.set(name, UsedValueState.Completed)
      })
    }
    return code
  }
}
import type {KeywordErrorCxt, KeywordErrorDefinition} from "../types"
import type {SchemaCxt} from "./index"
import {CodeGen, _, str, strConcat, Code, Name} from "./codegen"
import {SafeExpr} from "./codegen/code"
import {getErrorPath, Type} from "./util"
import N from "./names"

export const keywordError: KeywordErrorDefinition = {
  message: ({keyword}) => str`must pass "${keyword}" keyword validation`,
}

export const keyword$DataError: KeywordErrorDefinition = {
  message: ({keyword, schemaType}) =>
    schemaType
      ? str`"${keyword}" keyword must be ${schemaType} ($data)`
      : str`"${keyword}" keyword is invalid ($data)`,
}

export interface ErrorPaths {
  instancePath?: Code
  schemaPath?: string
  parentSchema?: boolean
}

export function reportError(
  cxt: KeywordErrorCxt,
  error: KeywordErrorDefinition = keywordError,
  errorPaths?: ErrorPaths,
  overrideAllErrors?: boolean
): void {
  const {it} = cxt
  const {gen, compositeRule, allErrors} = it
  const errObj = errorObjectCode(cxt, error, errorPaths)
  if (overrideAllErrors ?? (compositeRule || allErrors)) {
    addError(gen, errObj)
  } else {
    returnErrors(it, _`[${errObj}]`)
  }
}

export function reportExtraError(
  cxt: KeywordErrorCxt,
  error: KeywordErrorDefinition = keywordError,
  errorPaths?: ErrorPaths
): void {
  const {it} = cxt
  const {gen, compositeRule, allErrors} = it
  const errObj = errorObjectCode(cxt, error, errorPaths)
  addError(gen, errObj)
  if (!(compositeRule || allErrors)) {
    returnErrors(it, N.vErrors)
  }
}

export function resetErrorsCount(gen: CodeGen, errsCount: Name): void {
  gen.assign(N.errors, errsCount)
  gen.if(_`${N.vErrors} !== null`, () =>
    gen.if(
      errsCount,
      () => gen.assign(_`${N.vErrors}.length`, errsCount),
      () => gen.assign(N.vErrors, null)
    )
  )
}

export function extendErrors({
  gen,
  keyword,
  schemaValue,
  data,
  errsCount,
  it,
}: KeywordErrorCxt): void {
  /* istanbul ignore if */
  if (errsCount === undefined) throw new Error("ajv implementation error")
  const err = gen.name("err")
  gen.forRange("i", errsCount, N.errors, (i) => {
    gen.const(err, _`${N.vErrors}[${i}]`)
    gen.if(_`${err}.instancePath === undefined`, () =>
      gen.assign(_`${err}.instancePath`, strConcat(N.instancePath, it.errorPath))
    )
    gen.assign(_`${err}.schemaPath`, str`${it.errSchemaPath}/${keyword}`)
    if (it.opts.verbose) {
      gen.assign(_`${err}.schema`, schemaValue)
      gen.assign(_`${err}.data`, data)
    }
  })
}

function addError(gen: CodeGen, errObj: Code): void {
  const err = gen.const("err", errObj)
  gen.if(
    _`${N.vErrors} === null`,
    () => gen.assign(N.vErrors, _`[${err}]`),
    _`${N.vErrors}.push(${err})`
  )
  gen.code(_`${N.errors}++`)
}

function returnErrors(it: SchemaCxt, errs: Code): void {
  const {gen, validateName, schemaEnv} = it
  if (schemaEnv.$async) {
    gen.throw(_`new ${it.ValidationError as Name}(${errs})`)
  } else {
    gen.assign(_`${validateName}.errors`, errs)
    gen.return(false)
  }
}

const E = {
  keyword: new Name("keyword"),
  schemaPath: new Name("schemaPath"), // also used in JTD errors
  params: new Name("params"),
  propertyName: new Name("propertyName"),
  message: new Name("message"),
  schema: new Name("schema"),
  parentSchema: new Name("parentSchema"),
}

function errorObjectCode(
  cxt: KeywordErrorCxt,
  error: KeywordErrorDefinition,
  errorPaths?: ErrorPaths
): Code {
  const {createErrors} = cxt.it
  if (createErrors === false) return _`{}`
  return errorObject(cxt, error, errorPaths)
}

function errorObject(
  cxt: KeywordErrorCxt,
  error: KeywordErrorDefinition,
  errorPaths: ErrorPaths = {}
): Code {
  const {gen, it} = cxt
  const keyValues: [Name, SafeExpr | string][] = [
    errorInstancePath(it, errorPaths),
    errorSchemaPath(cxt, errorPaths),
  ]
  extraErrorProps(cxt, error, keyValues)
  return gen.object(...keyValues)
}

function errorInstancePath({errorPath}: SchemaCxt, {instancePath}: ErrorPaths): [Name, Code] {
  const instPath = instancePath
    ? str`${errorPath}${getErrorPath(instancePath, Type.Str)}`
    : errorPath
  return [N.instancePath, strConcat(N.instancePath, instPath)]
}

function errorSchemaPath(
  {keyword, it: {errSchemaPath}}: KeywordErrorCxt,
  {schemaPath, parentSchema}: ErrorPaths
): [Name, string | Code] {
  let schPath = parentSchema ? errSchemaPath : str`${errSchemaPath}/${keyword}`
  if (schemaPath) {
    schPath = str`${schPath}${getErrorPath(schemaPath, Type.Str)}`
  }
  return [E.schemaPath, schPath]
}

function extraErrorProps(
  cxt: KeywordErrorCxt,
  {params, message}: KeywordErrorDefinition,
  keyValues: [Name, SafeExpr | string][]
): void {
  const {keyword, data, schemaValue, it} = cxt
  const {opts, propertyName, topSchemaRef, schemaPath} = it
  keyValues.push(
    [E.keyword, keyword],
    [E.params, typeof params == "function" ? params(cxt) : params || _`{}`]
  )
  if (opts.messages) {
    keyValues.push([E.message, typeof message == "function" ? message(cxt) : message])
  }
  if (opts.verbose) {
    keyValues.push(
      [E.schema, schemaValue],
      [E.parentSchema, _`${topSchemaRef}${schemaPath}`],
      [N.data, data]
    )
  }
  if (propertyName) keyValues.push([E.propertyName, propertyName])
}
import type {
  AnySchema,
  AnySchemaObject,
  AnyValidateFunction,
  AsyncValidateFunction,
  EvaluatedProperties,
  EvaluatedItems,
} from "../types"
import type Ajv from "../core"
import type {InstanceOptions} from "../core"
import {CodeGen, _, nil, stringify, Name, Code, ValueScopeName} from "./codegen"
import ValidationError from "../runtime/validation_error"
import N from "./names"
import {LocalRefs, getFullPath, _getFullPath, inlineRef, normalizeId, resolveUrl} from "./resolve"
import {schemaHasRulesButRef, unescapeFragment} from "./util"
import {validateFunctionCode} from "./validate"
import {URIComponent} from "fast-uri"
import {JSONType} from "./rules"

export type SchemaRefs = {
  [Ref in string]?: SchemaEnv | AnySchema
}

export interface SchemaCxt {
  readonly gen: CodeGen
  readonly allErrors?: boolean // validation mode - whether to collect all errors or break on error
  readonly data: Name // Name with reference to the current part of data instance
  readonly parentData: Name // should be used in keywords modifying data
  readonly parentDataProperty: Code | number // should be used in keywords modifying data
  readonly dataNames: Name[]
  readonly dataPathArr: (Code | number)[]
  readonly dataLevel: number // the level of the currently validated data,
  // it can be used to access both the property names and the data on all levels from the top.
  dataTypes: JSONType[] // data types applied to the current part of data instance
  definedProperties: Set<string> // set of properties to keep track of for required checks
  readonly topSchemaRef: Code
  readonly validateName: Name
  evaluated?: Name
  readonly ValidationError?: Name
  readonly schema: AnySchema // current schema object - equal to parentSchema passed via KeywordCxt
  readonly schemaEnv: SchemaEnv
  readonly rootId: string
  baseId: string // the current schema base URI that should be used as the base for resolving URIs in references (\$ref)
  readonly schemaPath: Code // the run-time expression that evaluates to the property name of the current schema
  readonly errSchemaPath: string // this is actual string, should not be changed to Code
  readonly errorPath: Code
  readonly propertyName?: Name
  readonly compositeRule?: boolean // true indicates that the current schema is inside the compound keyword,
  // where failing some rule doesn't mean validation failure (`anyOf`, `oneOf`, `not`, `if`).
  // This flag is used to determine whether you can return validation result immediately after any error in case the option `allErrors` is not `true.
  // You only need to use it if you have many steps in your keywords and potentially can define multiple errors.
  props?: EvaluatedProperties | Name // properties evaluated by this schema - used by parent schema or assigned to validation function
  items?: EvaluatedItems | Name // last item evaluated by this schema - used by parent schema or assigned to validation function
  jtdDiscriminator?: string
  jtdMetadata?: boolean
  readonly createErrors?: boolean
  readonly opts: InstanceOptions // Ajv instance option.
  readonly self: Ajv // current Ajv instance
}

export interface SchemaObjCxt extends SchemaCxt {
  readonly schema: AnySchemaObject
}
interface SchemaEnvArgs {
  readonly schema: AnySchema
  readonly schemaId?: "$id" | "id"
  readonly root?: SchemaEnv
  readonly baseId?: string
  readonly schemaPath?: string
  readonly localRefs?: LocalRefs
  readonly meta?: boolean
}

export class SchemaEnv implements SchemaEnvArgs {
  readonly schema: AnySchema
  readonly schemaId?: "$id" | "id"
  readonly root: SchemaEnv
  baseId: string // TODO possibly, it should be readonly
  schemaPath?: string
  localRefs?: LocalRefs
  readonly meta?: boolean
  readonly $async?: boolean // true if the current schema is asynchronous.
  readonly refs: SchemaRefs = {}
  readonly dynamicAnchors: {[Ref in string]?: true} = {}
  validate?: AnyValidateFunction
  validateName?: ValueScopeName
  serialize?: (data: unknown) => string
  serializeName?: ValueScopeName
  parse?: (data: string) => unknown
  parseName?: ValueScopeName

  constructor(env: SchemaEnvArgs) {
    let schema: AnySchemaObject | undefined
    if (typeof env.schema == "object") schema = env.schema
    this.schema = env.schema
    this.schemaId = env.schemaId
    this.root = env.root || this
    this.baseId = env.baseId ?? normalizeId(schema?.[env.schemaId || "$id"])
    this.schemaPath = env.schemaPath
    this.localRefs = env.localRefs
    this.meta = env.meta
    this.$async = schema?.$async
    this.refs = {}
  }
}

// let codeSize = 0
// let nodeCount = 0

// Compiles schema in SchemaEnv
export function compileSchema(this: Ajv, sch: SchemaEnv): SchemaEnv {
  // TODO refactor - remove compilations
  const _sch = getCompilingSchema.call(this, sch)
  if (_sch) return _sch
  const rootId = getFullPath(this.opts.uriResolver, sch.root.baseId) // TODO if getFullPath removed 1 tests fails
  const {es5, lines} = this.opts.code
  const {ownProperties} = this.opts
  const gen = new CodeGen(this.scope, {es5, lines, ownProperties})
  let _ValidationError
  if (sch.$async) {
    _ValidationError = gen.scopeValue("Error", {
      ref: ValidationError,
      code: _`require("ajv/dist/runtime/validation_error").default`,
    })
  }

  const validateName = gen.scopeName("validate")
  sch.validateName = validateName

  const schemaCxt: SchemaCxt = {
    gen,
    allErrors: this.opts.allErrors,
    data: N.data,
    parentData: N.parentData,
    parentDataProperty: N.parentDataProperty,
    dataNames: [N.data],
    dataPathArr: [nil], // TODO can its length be used as dataLevel if nil is removed?
    dataLevel: 0,
    dataTypes: [],
    definedProperties: new Set<string>(),
    topSchemaRef: gen.scopeValue(
      "schema",
      this.opts.code.source === true
        ? {ref: sch.schema, code: stringify(sch.schema)}
        : {ref: sch.schema}
    ),
    validateName,
    ValidationError: _ValidationError,
    schema: sch.schema,
    schemaEnv: sch,
    rootId,
    baseId: sch.baseId || rootId,
    schemaPath: nil,
    errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
    errorPath: _`""`,
    opts: this.opts,
    self: this,
  }

  let sourceCode: string | undefined
  try {
    this._compilations.add(sch)
    validateFunctionCode(schemaCxt)
    gen.optimize(this.opts.code.optimize)
    // gen.optimize(1)
    const validateCode = gen.toString()
    sourceCode = `${gen.scopeRefs(N.scope)}return ${validateCode}`
    // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
    if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch)
    // console.log("\n\n\n *** \n", sourceCode)
    const makeValidate = new Function(`${N.self}`, `${N.scope}`, sourceCode)
    const validate: AnyValidateFunction = makeValidate(this, this.scope.get())
    this.scope.value(validateName, {ref: validate})

    validate.errors = null
    validate.schema = sch.schema
    validate.schemaEnv = sch
    if (sch.$async) (validate as AsyncValidateFunction).$async = true
    if (this.opts.code.source === true) {
      validate.source = {validateName, validateCode, scopeValues: gen._values}
    }
    if (this.opts.unevaluated) {
      const {props, items} = schemaCxt
      validate.evaluated = {
        props: props instanceof Name ? undefined : props,
        items: items instanceof Name ? undefined : items,
        dynamicProps: props instanceof Name,
        dynamicItems: items instanceof Name,
      }
      if (validate.source) validate.source.evaluated = stringify(validate.evaluated)
    }
    sch.validate = validate
    return sch
  } catch (e) {
    delete sch.validate
    delete sch.validateName
    if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode)
    // console.log("\n\n\n *** \n", sourceCode, this.opts)
    throw e
  } finally {
    this._compilations.delete(sch)
  }
}

export function resolveRef(
  this: Ajv,
  root: SchemaEnv,
  baseId: string,
  ref: string
): AnySchema | SchemaEnv | undefined {
  ref = resolveUrl(this.opts.uriResolver, baseId, ref)
  const schOrFunc = root.refs[ref]
  if (schOrFunc) return schOrFunc

  let _sch = resolve.call(this, root, ref)
  if (_sch === undefined) {
    const schema = root.localRefs?.[ref] // TODO maybe localRefs should hold SchemaEnv
    const {schemaId} = this.opts
    if (schema) _sch = new SchemaEnv({schema, schemaId, root, baseId})
  }

  if (_sch === undefined) return
  return (root.refs[ref] = inlineOrCompile.call(this, _sch))
}

function inlineOrCompile(this: Ajv, sch: SchemaEnv): AnySchema | SchemaEnv {
  if (inlineRef(sch.schema, this.opts.inlineRefs)) return sch.schema
  return sch.validate ? sch : compileSchema.call(this, sch)
}

// Index of schema compilation in the currently compiled list
export function getCompilingSchema(this: Ajv, schEnv: SchemaEnv): SchemaEnv | void {
  for (const sch of this._compilations) {
    if (sameSchemaEnv(sch, schEnv)) return sch
  }
}

function sameSchemaEnv(s1: SchemaEnv, s2: SchemaEnv): boolean {
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId
}

// resolve and compile the references ($ref)
// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
function resolve(
  this: Ajv,
  root: SchemaEnv, // information about the root schema for the current schema
  ref: string // reference to resolve
): SchemaEnv | undefined {
  let sch
  while (typeof (sch = this.refs[ref]) == "string") ref = sch
  return sch || this.schemas[ref] || resolveSchema.call(this, root, ref)
}

// Resolve schema, its root and baseId
export function resolveSchema(
  this: Ajv,
  root: SchemaEnv, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
  ref: string // reference to resolve
): SchemaEnv | undefined {
  const p = this.opts.uriResolver.parse(ref)
  const refPath = _getFullPath(this.opts.uriResolver, p)
  let baseId = getFullPath(this.opts.uriResolver, root.baseId, undefined)
  // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
  if (Object.keys(root.schema).length > 0 && refPath === baseId) {
    return getJsonPointer.call(this, p, root)
  }

  const id = normalizeId(refPath)
  const schOrRef = this.refs[id] || this.schemas[id]
  if (typeof schOrRef == "string") {
    const sch = resolveSchema.call(this, root, schOrRef)
    if (typeof sch?.schema !== "object") return
    return getJsonPointer.call(this, p, sch)
  }

  if (typeof schOrRef?.schema !== "object") return
  if (!schOrRef.validate) compileSchema.call(this, schOrRef)
  if (id === normalizeId(ref)) {
    const {schema} = schOrRef
    const {schemaId} = this.opts
    const schId = schema[schemaId]
    if (schId) baseId = resolveUrl(this.opts.uriResolver, baseId, schId)
    return new SchemaEnv({schema, schemaId, root, baseId})
  }
  return getJsonPointer.call(this, p, schOrRef)
}

const PREVENT_SCOPE_CHANGE = new Set([
  "properties",
  "patternProperties",
  "enum",
  "dependencies",
  "definitions",
])

function getJsonPointer(
  this: Ajv,
  parsedRef: URIComponent,
  {baseId, schema, root}: SchemaEnv
): SchemaEnv | undefined {
  if (parsedRef.fragment?.[0] !== "/") return
  for (const part of parsedRef.fragment.slice(1).split("/")) {
    if (typeof schema === "boolean") return
    const partSchema = schema[unescapeFragment(part)]
    if (partSchema === undefined) return
    schema = partSchema
    // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
    const schId = typeof schema === "object" && schema[this.opts.schemaId]
    if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
      baseId = resolveUrl(this.opts.uriResolver, baseId, schId)
    }
  }
  let env: SchemaEnv | undefined
  if (typeof schema != "boolean" && schema.$ref && !schemaHasRulesButRef(schema, this.RULES)) {
    const $ref = resolveUrl(this.opts.uriResolver, baseId, schema.$ref)
    env = resolveSchema.call(this, root, $ref)
  }
  // even though resolution failed we need to return SchemaEnv to throw exception
  // so that compileAsync loads missing schema.
  const {schemaId} = this.opts
  env = env || new SchemaEnv({schema, schemaId, root, baseId})
  if (env.schema !== env.root.schema) return env
  return undefined
}
import type Ajv from "../../core"
import type {SchemaObject} from "../../types"
import {jtdForms, JTDForm, SchemaObjectMap} from "./types"
import {SchemaEnv, getCompilingSchema} from ".."
import {_, str, and, or, nil, not, CodeGen, Code, Name, SafeExpr} from "../codegen"
import MissingRefError from "../ref_error"
import N from "../names"
import {hasPropFunc} from "../../vocabularies/code"
import {hasRef} from "../../vocabularies/jtd/ref"
import {intRange, IntType} from "../../vocabularies/jtd/type"
import {parseJson, parseJsonNumber, parseJsonString} from "../../runtime/parseJson"
import {useFunc} from "../util"
import validTimestamp from "../../runtime/timestamp"

type GenParse = (cxt: ParseCxt) => void

const genParse: {[F in JTDForm]: GenParse} = {
  elements: parseElements,
  values: parseValues,
  discriminator: parseDiscriminator,
  properties: parseProperties,
  optionalProperties: parseProperties,
  enum: parseEnum,
  type: parseType,
  ref: parseRef,
}

interface ParseCxt {
  readonly gen: CodeGen
  readonly self: Ajv // current Ajv instance
  readonly schemaEnv: SchemaEnv
  readonly definitions: SchemaObjectMap
  schema: SchemaObject
  data: Code
  parseName: Name
  char: Name
}

export default function compileParser(
  this: Ajv,
  sch: SchemaEnv,
  definitions: SchemaObjectMap
): SchemaEnv {
  const _sch = getCompilingSchema.call(this, sch)
  if (_sch) return _sch
  const {es5, lines} = this.opts.code
  const {ownProperties} = this.opts
  const gen = new CodeGen(this.scope, {es5, lines, ownProperties})
  const parseName = gen.scopeName("parse")
  const cxt: ParseCxt = {
    self: this,
    gen,
    schema: sch.schema as SchemaObject,
    schemaEnv: sch,
    definitions,
    data: N.data,
    parseName,
    char: gen.name("c"),
  }

  let sourceCode: string | undefined
  try {
    this._compilations.add(sch)
    sch.parseName = parseName
    parserFunction(cxt)
    gen.optimize(this.opts.code.optimize)
    const parseFuncCode = gen.toString()
    sourceCode = `${gen.scopeRefs(N.scope)}return ${parseFuncCode}`
    const makeParse = new Function(`${N.scope}`, sourceCode)
    const parse: (json: string) => unknown = makeParse(this.scope.get())
    this.scope.value(parseName, {ref: parse})
    sch.parse = parse
  } catch (e) {
    if (sourceCode) this.logger.error("Error compiling parser, function code:", sourceCode)
    delete sch.parse
    delete sch.parseName
    throw e
  } finally {
    this._compilations.delete(sch)
  }
  return sch
}

const undef = _`undefined`

function parserFunction(cxt: ParseCxt): void {
  const {gen, parseName, char} = cxt
  gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => {
    gen.let(N.data)
    gen.let(char)
    gen.assign(_`${parseName}.message`, undef)
    gen.assign(_`${parseName}.position`, undef)
    gen.assign(N.jsonPos, _`${N.jsonPos} || 0`)
    gen.const(N.jsonLen, _`${N.json}.length`)
    parseCode(cxt)
    skipWhitespace(cxt)
    gen.if(N.jsonPart, () => {
      gen.assign(_`${parseName}.position`, N.jsonPos)
      gen.return(N.data)
    })
    gen.if(_`${N.jsonPos} === ${N.jsonLen}`, () => gen.return(N.data))
    jsonSyntaxError(cxt)
  })
}

function parseCode(cxt: ParseCxt): void {
  let form: JTDForm | undefined
  for (const key of jtdForms) {
    if (key in cxt.schema) {
      form = key
      break
    }
  }
  if (form) parseNullable(cxt, genParse[form])
  else parseEmpty(cxt)
}

const parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError))

function parseNullable(cxt: ParseCxt, parseForm: GenParse): void {
  const {gen, schema, data} = cxt
  if (!schema.nullable) return parseForm(cxt)
  tryParseToken(cxt, "null", parseForm, () => gen.assign(data, null))
}

function parseElements(cxt: ParseCxt): void {
  const {gen, schema, data} = cxt
  parseToken(cxt, "[")
  const ix = gen.let("i", 0)
  gen.assign(data, _`[]`)
  parseItems(cxt, "]", () => {
    const el = gen.let("el")
    parseCode({...cxt, schema: schema.elements, data: el})
    gen.assign(_`${data}[${ix}++]`, el)
  })
}

function parseValues(cxt: ParseCxt): void {
  const {gen, schema, data} = cxt
  parseToken(cxt, "{")
  gen.assign(data, _`{}`)
  parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values))
}

function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void {
  tryParseItems(cxt, endToken, block)
  parseToken(cxt, endToken)
}

function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void {
  const {gen} = cxt
  gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => {
    block()
    tryParseToken(cxt, ",", () => gen.break(), hasItem)
  })

  function hasItem(): void {
    tryParseToken(cxt, endToken, () => {}, jsonSyntaxError)
  }
}

function parseKeyValue(cxt: ParseCxt, schema: SchemaObject): void {
  const {gen} = cxt
  const key = gen.let("key")
  parseString({...cxt, data: key})
  parseToken(cxt, ":")
  parsePropertyValue(cxt, key, schema)
}

function parseDiscriminator(cxt: ParseCxt): void {
  const {gen, data, schema} = cxt
  const {discriminator, mapping} = schema
  parseToken(cxt, "{")
  gen.assign(data, _`{}`)
  const startPos = gen.const("pos", N.jsonPos)
  const value = gen.let("value")
  const tag = gen.let("tag")
  tryParseItems(cxt, "}", () => {
    const key = gen.let("key")
    parseString({...cxt, data: key})
    parseToken(cxt, ":")
    gen.if(
      _`${key} === ${discriminator}`,
      () => {
        parseString({...cxt, data: tag})
        gen.assign(_`${data}[${key}]`, tag)
        gen.break()
      },
      () => parseEmpty({...cxt, data: value}) // can be discarded/skipped
    )
  })
  gen.assign(N.jsonPos, startPos)
  gen.if(_`${tag} === undefined`)
  parsingError(cxt, str`discriminator tag not found`)
  for (const tagValue in mapping) {
    gen.elseIf(_`${tag} === ${tagValue}`)
    parseSchemaProperties({...cxt, schema: mapping[tagValue]}, discriminator)
  }
  gen.else()
  parsingError(cxt, str`discriminator value not in schema`)
  gen.endIf()
}

function parseProperties(cxt: ParseCxt): void {
  const {gen, data} = cxt
  parseToken(cxt, "{")
  gen.assign(data, _`{}`)
  parseSchemaProperties(cxt)
}

function parseSchemaProperties(cxt: ParseCxt, discriminator?: string): void {
  const {gen, schema, data} = cxt
  const {properties, optionalProperties, additionalProperties} = schema
  parseItems(cxt, "}", () => {
    const key = gen.let("key")
    parseString({...cxt, data: key})
    parseToken(cxt, ":")
    gen.if(false)
    parseDefinedProperty(cxt, key, properties)
    parseDefinedProperty(cxt, key, optionalProperties)
    if (discriminator) {
      gen.elseIf(_`${key} === ${discriminator}`)
      const tag = gen.let("tag")
      parseString({...cxt, data: tag}) // can be discarded, it is already assigned
    }
    gen.else()
    if (additionalProperties) {
      parseEmpty({...cxt, data: _`${data}[${key}]`})
    } else {
      parsingError(cxt, str`property ${key} not allowed`)
    }
    gen.endIf()
  })
  if (properties) {
    const hasProp = hasPropFunc(gen)
    const allProps: Code = and(
      ...Object.keys(properties).map((p): Code => _`${hasProp}.call(${data}, ${p})`)
    )
    gen.if(not(allProps), () => parsingError(cxt, str`missing required properties`))
  }
}

function parseDefinedProperty(cxt: ParseCxt, key: Name, schemas: SchemaObjectMap = {}): void {
  const {gen} = cxt
  for (const prop in schemas) {
    gen.elseIf(_`${key} === ${prop}`)
    parsePropertyValue(cxt, key, schemas[prop] as SchemaObject)
  }
}

function parsePropertyValue(cxt: ParseCxt, key: Name, schema: SchemaObject): void {
  parseCode({...cxt, schema, data: _`${cxt.data}[${key}]`})
}

function parseType(cxt: ParseCxt): void {
  const {gen, schema, data, self} = cxt
  switch (schema.type) {
    case "boolean":
      parseBoolean(cxt)
      break
    case "string":
      parseString(cxt)
      break
    case "timestamp": {
      parseString(cxt)
      const vts = useFunc(gen, validTimestamp)
      const {allowDate, parseDate} = self.opts
      const notValid = allowDate ? _`!${vts}(${data}, true)` : _`!${vts}(${data})`
      const fail: Code = parseDate
        ? or(notValid, _`(${data} = new Date(${data}), false)`, _`isNaN(${data}.valueOf())`)
        : notValid
      gen.if(fail, () => parsingError(cxt, str`invalid timestamp`))
      break
    }
    case "float32":
    case "float64":
      parseNumber(cxt)
      break
    default: {
      const t = schema.type as IntType
      if (!self.opts.int32range && (t === "int32" || t === "uint32")) {
        parseNumber(cxt, 16) // 2 ** 53 - max safe integer
        if (t === "uint32") {
          gen.if(_`${data} < 0`, () => parsingError(cxt, str`integer out of range`))
        }
      } else {
        const [min, max, maxDigits] = intRange[t]
        parseNumber(cxt, maxDigits)
        gen.if(_`${data} < ${min} || ${data} > ${max}`, () =>
          parsingError(cxt, str`integer out of range`)
        )
      }
    }
  }
}

function parseString(cxt: ParseCxt): void {
  parseToken(cxt, '"')
  parseWith(cxt, parseJsonString)
}

function parseEnum(cxt: ParseCxt): void {
  const {gen, data, schema} = cxt
  const enumSch = schema.enum
  parseToken(cxt, '"')
  // TODO loopEnum
  gen.if(false)
  for (const value of enumSch) {
    const valueStr = JSON.stringify(value).slice(1) // remove starting quote
    gen.elseIf(_`${jsonSlice(valueStr.length)} === ${valueStr}`)
    gen.assign(data, str`${value}`)
    gen.add(N.jsonPos, valueStr.length)
  }
  gen.else()
  jsonSyntaxError(cxt)
  gen.endIf()
}

function parseNumber(cxt: ParseCxt, maxDigits?: number): void {
  const {gen} = cxt
  skipWhitespace(cxt)
  gen.if(
    _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`,
    () => jsonSyntaxError(cxt),
    () => parseWith(cxt, parseJsonNumber, maxDigits)
  )
}

function parseBooleanToken(bool: boolean, fail: GenParse): GenParse {
  return (cxt) => {
    const {gen, data} = cxt
    tryParseToken(
      cxt,
      `${bool}`,
      () => fail(cxt),
      () => gen.assign(data, bool)
    )
  }
}

function parseRef(cxt: ParseCxt): void {
  const {gen, self, definitions, schema, schemaEnv} = cxt
  const {ref} = schema
  const refSchema = definitions[ref]
  if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`)
  if (!hasRef(refSchema)) return parseCode({...cxt, schema: refSchema})
  const {root} = schemaEnv
  const sch = compileParser.call(self, new SchemaEnv({schema: refSchema, root}), definitions)
  partialParse(cxt, getParser(gen, sch), true)
}

function getParser(gen: CodeGen, sch: SchemaEnv): Code {
  return sch.parse
    ? gen.scopeValue("parse", {ref: sch.parse})
    : _`${gen.scopeValue("wrapper", {ref: sch})}.parse`
}

function parseEmpty(cxt: ParseCxt): void {
  parseWith(cxt, parseJson)
}

function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void {
  partialParse(cxt, useFunc(cxt.gen, parseFunc), args)
}

function partialParse(cxt: ParseCxt, parseFunc: Name, args?: SafeExpr): void {
  const {gen, data} = cxt
  gen.assign(data, _`${parseFunc}(${N.json}, ${N.jsonPos}${args ? _`, ${args}` : nil})`)
  gen.assign(N.jsonPos, _`${parseFunc}.position`)
  gen.if(_`${data} === undefined`, () => parsingError(cxt, _`${parseFunc}.message`))
}

function parseToken(cxt: ParseCxt, tok: string): void {
  tryParseToken(cxt, tok, jsonSyntaxError)
}

function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void {
  const {gen} = cxt
  const n = tok.length
  skipWhitespace(cxt)
  gen.if(
    _`${jsonSlice(n)} === ${tok}`,
    () => {
      gen.add(N.jsonPos, n)
      success?.(cxt)
    },
    () => fail(cxt)
  )
}

function skipWhitespace({gen, char: c}: ParseCxt): void {
  gen.code(
    _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;`
  )
}

function jsonSlice(len: number | Name): Code {
  return len === 1
    ? _`${N.json}[${N.jsonPos}]`
    : _`${N.json}.slice(${N.jsonPos}, ${N.jsonPos}+${len})`
}

function jsonSyntaxError(cxt: ParseCxt): void {
  parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`)
}

function parsingError({gen, parseName}: ParseCxt, msg: Code): void {
  gen.assign(_`${parseName}.message`, msg)
  gen.assign(_`${parseName}.position`, N.jsonPos)
  gen.return(undef)
}
import type Ajv from "../../core"
import type {SchemaObject} from "../../types"
import {jtdForms, JTDForm, SchemaObjectMap} from "./types"
import {SchemaEnv, getCompilingSchema} from ".."
import {_, str, and, getProperty, CodeGen, Code, Name} from "../codegen"
import MissingRefError from "../ref_error"
import N from "../names"
import {isOwnProperty} from "../../vocabularies/code"
import {hasRef} from "../../vocabularies/jtd/ref"
import {useFunc} from "../util"
import quote from "../../runtime/quote"

const genSerialize: {[F in JTDForm]: (cxt: SerializeCxt) => void} = {
  elements: serializeElements,
  values: serializeValues,
  discriminator: serializeDiscriminator,
  properties: serializeProperties,
  optionalProperties: serializeProperties,
  enum: serializeString,
  type: serializeType,
  ref: serializeRef,
}

interface SerializeCxt {
  readonly gen: CodeGen
  readonly self: Ajv // current Ajv instance
  readonly schemaEnv: SchemaEnv
  readonly definitions: SchemaObjectMap
  schema: SchemaObject
  data: Code
}

export default function compileSerializer(
  this: Ajv,
  sch: SchemaEnv,
  definitions: SchemaObjectMap
): SchemaEnv {
  const _sch = getCompilingSchema.call(this, sch)
  if (_sch) return _sch
  const {es5, lines} = this.opts.code
  const {ownProperties} = this.opts
  const gen = new CodeGen(this.scope, {es5, lines, ownProperties})
  const serializeName = gen.scopeName("serialize")
  const cxt: SerializeCxt = {
    self: this,
    gen,
    schema: sch.schema as SchemaObject,
    schemaEnv: sch,
    definitions,
    data: N.data,
  }

  let sourceCode: string | undefined
  try {
    this._compilations.add(sch)
    sch.serializeName = serializeName
    gen.func(serializeName, N.data, false, () => {
      gen.let(N.json, str``)
      serializeCode(cxt)
      gen.return(N.json)
    })
    gen.optimize(this.opts.code.optimize)
    const serializeFuncCode = gen.toString()
    sourceCode = `${gen.scopeRefs(N.scope)}return ${serializeFuncCode}`
    const makeSerialize = new Function(`${N.scope}`, sourceCode)
    const serialize: (data: unknown) => string = makeSerialize(this.scope.get())
    this.scope.value(serializeName, {ref: serialize})
    sch.serialize = serialize
  } catch (e) {
    if (sourceCode) this.logger.error("Error compiling serializer, function code:", sourceCode)
    delete sch.serialize
    delete sch.serializeName
    throw e
  } finally {
    this._compilations.delete(sch)
  }
  return sch
}

function serializeCode(cxt: SerializeCxt): void {
  let form: JTDForm | undefined
  for (const key of jtdForms) {
    if (key in cxt.schema) {
      form = key
      break
    }
  }
  serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty)
}

function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void {
  const {gen, schema, data} = cxt
  if (!schema.nullable) return serializeForm(cxt)
  gen.if(
    _`${data} === undefined || ${data} === null`,
    () => gen.add(N.json, _`"null"`),
    () => serializeForm(cxt)
  )
}

function serializeElements(cxt: SerializeCxt): void {
  const {gen, schema, data} = cxt
  gen.add(N.json, str`[`)
  const first = gen.let("first", true)
  gen.forOf("el", data, (el) => {
    addComma(cxt, first)
    serializeCode({...cxt, schema: schema.elements, data: el})
  })
  gen.add(N.json, str`]`)
}

function serializeValues(cxt: SerializeCxt): void {
  const {gen, schema, data} = cxt
  gen.add(N.json, str`{`)
  const first = gen.let("first", true)
  gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first))
  gen.add(N.json, str`}`)
}

function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void {
  const {gen, data} = cxt
  addComma(cxt, first)
  serializeString({...cxt, data: key})
  gen.add(N.json, str`:`)
  const value = gen.const("value", _`${data}${getProperty(key)}`)
  serializeCode({...cxt, schema, data: value})
}

function serializeDiscriminator(cxt: SerializeCxt): void {
  const {gen, schema, data} = cxt
  const {discriminator} = schema
  gen.add(N.json, str`{${JSON.stringify(discriminator)}:`)
  const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`)
  serializeString({...cxt, data: tag})
  gen.if(false)
  for (const tagValue in schema.mapping) {
    gen.elseIf(_`${tag} === ${tagValue}`)
    const sch = schema.mapping[tagValue]
    serializeSchemaProperties({...cxt, schema: sch}, discriminator)
  }
  gen.endIf()
  gen.add(N.json, str`}`)
}

function serializeProperties(cxt: SerializeCxt): void {
  const {gen} = cxt
  gen.add(N.json, str`{`)
  serializeSchemaProperties(cxt)
  gen.add(N.json, str`}`)
}

function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void {
  const {gen, schema, data} = cxt
  const {properties, optionalProperties} = schema
  const props = keys(properties)
  const optProps = keys(optionalProperties)
  const allProps = allProperties(props.concat(optProps))
  let first = !discriminator
  let firstProp: Name | undefined

  for (const key of props) {
    if (first) first = false
    else gen.add(N.json, str`,`)
    serializeProperty(key, properties[key], keyValue(key))
  }
  if (first) firstProp = gen.let("first", true)
  for (const key of optProps) {
    const value = keyValue(key)
    gen.if(and(_`${value} !== undefined`, isOwnProperty(gen, data, key)), () => {
      addComma(cxt, firstProp)
      serializeProperty(key, optionalProperties[key], value)
    })
  }
  if (schema.additionalProperties) {
    gen.forIn("key", data, (key) =>
      gen.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))
    )
  }

  function keys(ps?: SchemaObjectMap): string[] {
    return ps ? Object.keys(ps) : []
  }

  function allProperties(ps: string[]): string[] {
    if (discriminator) ps.push(discriminator)
    if (new Set(ps).size !== ps.length) {
      throw new Error("JTD: properties/optionalProperties/disciminator overlap")
    }
    return ps
  }

  function keyValue(key: string): Name {
    return gen.const("value", _`${data}${getProperty(key)}`)
  }

  function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void {
    gen.add(N.json, str`${JSON.stringify(key)}:`)
    serializeCode({...cxt, schema: propSchema, data: value})
  }

  function isAdditional(key: Name, ps: string[]): Code | true {
    return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true
  }
}

function serializeType(cxt: SerializeCxt): void {
  const {gen, schema, data} = cxt
  switch (schema.type) {
    case "boolean":
      gen.add(N.json, _`${data} ? "true" : "false"`)
      break
    case "string":
      serializeString(cxt)
      break
    case "timestamp":
      gen.if(
        _`${data} instanceof Date`,
        () => gen.add(N.json, _`'"' + ${data}.toISOString() + '"'`),
        () => serializeString(cxt)
      )
      break
    default:
      serializeNumber(cxt)
  }
}

function serializeString({gen, data}: SerializeCxt): void {
  gen.add(N.json, _`${useFunc(gen, quote)}(${data})`)
}

function serializeNumber({gen, data}: SerializeCxt): void {
  gen.add(N.json, _`"" + ${data}`)
}

function serializeRef(cxt: SerializeCxt): void {
  const {gen, self, data, definitions, schema, schemaEnv} = cxt
  const {ref} = schema
  const refSchema = definitions[ref]
  if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`)
  if (!hasRef(refSchema)) return serializeCode({...cxt, schema: refSchema})
  const {root} = schemaEnv
  const sch = compileSerializer.call(self, new SchemaEnv({schema: refSchema, root}), definitions)
  gen.add(N.json, _`${getSerialize(gen, sch)}(${data})`)
}

function getSerialize(gen: CodeGen, sch: SchemaEnv): Code {
  return sch.serialize
    ? gen.scopeValue("serialize", {ref: sch.serialize})
    : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize`
}

function serializeEmpty({gen, data}: SerializeCxt): void {
  gen.add(N.json, _`JSON.stringify(${data})`)
}

function addComma({gen}: SerializeCxt, first?: Name): void {
  if (first) {
    gen.if(
      first,
      () => gen.assign(first, false),
      () => gen.add(N.json, str`,`)
    )
  } else {
    gen.add(N.json, str`,`)
  }
}
import type {SchemaObject} from "../../types"

export type SchemaObjectMap = {[Ref in string]?: SchemaObject}

export const jtdForms = [
  "elements",
  "values",
  "discriminator",
  "properties",
  "optionalProperties",
  "enum",
  "type",
  "ref",
] as const

export type JTDForm = (typeof jtdForms)[number]
import {Name} from "./codegen"

const names = {
  // validation function arguments
  data: new Name("data"), // data passed to validation function
  // args passed from referencing schema
  valCxt: new Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
  instancePath: new Name("instancePath"),
  parentData: new Name("parentData"),
  parentDataProperty: new Name("parentDataProperty"),
  rootData: new Name("rootData"), // root data - same as the data passed to the first/top validation function
  dynamicAnchors: new Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
  // function scoped variables
  vErrors: new Name("vErrors"), // null or array of validation errors
  errors: new Name("errors"), // counter of validation errors
  this: new Name("this"),
  // "globals"
  self: new Name("self"),
  scope: new Name("scope"),
  // JTD serialize/parse name for JSON string and position
  json: new Name("json"),
  jsonPos: new Name("jsonPos"),
  jsonLen: new Name("jsonLen"),
  jsonPart: new Name("jsonPart"),
}

export default names
import {resolveUrl, normalizeId, getFullPath} from "./resolve"
import type {UriResolver} from "../types"

export default class MissingRefError extends Error {
  readonly missingRef: string
  readonly missingSchema: string

  constructor(resolver: UriResolver, baseId: string, ref: string, msg?: string) {
    super(msg || `can't resolve reference ${ref} from id ${baseId}`)
    this.missingRef = resolveUrl(resolver, baseId, ref)
    this.missingSchema = normalizeId(getFullPath(resolver, this.missingRef))
  }
}
import type {AnySchema, AnySchemaObject, UriResolver} from "../types"
import type Ajv from "../ajv"
import type {URIComponent} from "fast-uri"
import {eachItem} from "./util"
import * as equal from "fast-deep-equal"
import * as traverse from "json-schema-traverse"

// the hash of local references inside the schema (created by getSchemaRefs), used for inline resolution
export type LocalRefs = {[Ref in string]?: AnySchemaObject}

// TODO refactor to use keyword definitions
const SIMPLE_INLINED = new Set([
  "type",
  "format",
  "pattern",
  "maxLength",
  "minLength",
  "maxProperties",
  "minProperties",
  "maxItems",
  "minItems",
  "maximum",
  "minimum",
  "uniqueItems",
  "multipleOf",
  "required",
  "enum",
  "const",
])

export function inlineRef(schema: AnySchema, limit: boolean | number = true): boolean {
  if (typeof schema == "boolean") return true
  if (limit === true) return !hasRef(schema)
  if (!limit) return false
  return countKeys(schema) <= limit
}

const REF_KEYWORDS = new Set([
  "$ref",
  "$recursiveRef",
  "$recursiveAnchor",
  "$dynamicRef",
  "$dynamicAnchor",
])

function hasRef(schema: AnySchemaObject): boolean {
  for (const key in schema) {
    if (REF_KEYWORDS.has(key)) return true
    const sch = schema[key]
    if (Array.isArray(sch) && sch.some(hasRef)) return true
    if (typeof sch == "object" && hasRef(sch)) return true
  }
  return false
}

function countKeys(schema: AnySchemaObject): number {
  let count = 0
  for (const key in schema) {
    if (key === "$ref") return Infinity
    count++
    if (SIMPLE_INLINED.has(key)) continue
    if (typeof schema[key] == "object") {
      eachItem(schema[key], (sch) => (count += countKeys(sch)))
    }
    if (count === Infinity) return Infinity
  }
  return count
}

export function getFullPath(resolver: UriResolver, id = "", normalize?: boolean): string {
  if (normalize !== false) id = normalizeId(id)
  const p = resolver.parse(id)
  return _getFullPath(resolver, p)
}

export function _getFullPath(resolver: UriResolver, p: URIComponent): string {
  const serialized = resolver.serialize(p)
  return serialized.split("#")[0] + "#"
}

const TRAILING_SLASH_HASH = /#\/?$/
export function normalizeId(id: string | undefined): string {
  return id ? id.replace(TRAILING_SLASH_HASH, "") : ""
}

export function resolveUrl(resolver: UriResolver, baseId: string, id: string): string {
  id = normalizeId(id)
  return resolver.resolve(baseId, id)
}

const ANCHOR = /^[a-z_][-a-z0-9._]*$/i

export function getSchemaRefs(this: Ajv, schema: AnySchema, baseId: string): LocalRefs {
  if (typeof schema == "boolean") return {}
  const {schemaId, uriResolver} = this.opts
  const schId = normalizeId(schema[schemaId] || baseId)
  const baseIds: {[JsonPtr in string]?: string} = {"": schId}
  const pathPrefix = getFullPath(uriResolver, schId, false)
  const localRefs: LocalRefs = {}
  const schemaRefs: Set<string> = new Set()

  traverse(schema, {allKeys: true}, (sch, jsonPtr, _, parentJsonPtr) => {
    if (parentJsonPtr === undefined) return
    const fullPath = pathPrefix + jsonPtr
    let innerBaseId = baseIds[parentJsonPtr]
    if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId])
    addAnchor.call(this, sch.$anchor)
    addAnchor.call(this, sch.$dynamicAnchor)
    baseIds[jsonPtr] = innerBaseId

    function addRef(this: Ajv, ref: string): string {
      // eslint-disable-next-line @typescript-eslint/unbound-method
      const _resolve = this.opts.uriResolver.resolve
      ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref)
      if (schemaRefs.has(ref)) throw ambiguos(ref)
      schemaRefs.add(ref)
      let schOrRef = this.refs[ref]
      if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef]
      if (typeof schOrRef == "object") {
        checkAmbiguosRef(sch, schOrRef.schema, ref)
      } else if (ref !== normalizeId(fullPath)) {
        if (ref[0] === "#") {
          checkAmbiguosRef(sch, localRefs[ref], ref)
          localRefs[ref] = sch
        } else {
          this.refs[ref] = fullPath
        }
      }
      return ref
    }

    function addAnchor(this: Ajv, anchor: unknown): void {
      if (typeof anchor == "string") {
        if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`)
        addRef.call(this, `#${anchor}`)
      }
    }
  })

  return localRefs

  function checkAmbiguosRef(sch1: AnySchema, sch2: AnySchema | undefined, ref: string): void {
    if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref)
  }

  function ambiguos(ref: string): Error {
    return new Error(`reference "${ref}" resolves to more than one schema`)
  }
}
import type {AddedKeywordDefinition} from "../types"

const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"] as const

export type JSONType = (typeof _jsonTypes)[number]

const jsonTypes: Set<string> = new Set(_jsonTypes)

export function isJSONType(x: unknown): x is JSONType {
  return typeof x == "string" && jsonTypes.has(x)
}

type ValidationTypes = {
  [K in JSONType]: boolean | RuleGroup | undefined
}

export interface ValidationRules {
  rules: RuleGroup[]
  post: RuleGroup
  all: {[Key in string]?: boolean | Rule} // rules that have to be validated
  keywords: {[Key in string]?: boolean} // all known keywords (superset of "all")
  types: ValidationTypes
}

export interface RuleGroup {
  type?: JSONType
  rules: Rule[]
}

// This interface wraps KeywordDefinition because definition can have multiple keywords
export interface Rule {
  keyword: string
  definition: AddedKeywordDefinition
}

export function getRules(): ValidationRules {
  const groups: Record<"number" | "string" | "array" | "object", RuleGroup> = {
    number: {type: "number", rules: []},
    string: {type: "string", rules: []},
    array: {type: "array", rules: []},
    object: {type: "object", rules: []},
  }
  return {
    types: {...groups, integer: true, boolean: true, null: true},
    rules: [{rules: []}, groups.number, groups.string, groups.array, groups.object],
    post: {rules: []},
    all: {},
    keywords: {},
  }
}
import type {AnySchema, EvaluatedProperties, EvaluatedItems} from "../types"
import type {SchemaCxt, SchemaObjCxt} from "."
import {_, getProperty, Code, Name, CodeGen} from "./codegen"
import {_Code} from "./codegen/code"
import type {Rule, ValidationRules} from "./rules"

// TODO refactor to use Set
export function toHash<T extends string = string>(arr: T[]): {[K in T]?: true} {
  const hash: {[K in T]?: true} = {}
  for (const item of arr) hash[item] = true
  return hash
}

export function alwaysValidSchema(it: SchemaCxt, schema: AnySchema): boolean | void {
  if (typeof schema == "boolean") return schema
  if (Object.keys(schema).length === 0) return true
  checkUnknownRules(it, schema)
  return !schemaHasRules(schema, it.self.RULES.all)
}

export function checkUnknownRules(it: SchemaCxt, schema: AnySchema = it.schema): void {
  const {opts, self} = it
  if (!opts.strictSchema) return
  if (typeof schema === "boolean") return
  const rules = self.RULES.keywords
  for (const key in schema) {
    if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`)
  }
}

export function schemaHasRules(
  schema: AnySchema,
  rules: {[Key in string]?: boolean | Rule}
): boolean {
  if (typeof schema == "boolean") return !schema
  for (const key in schema) if (rules[key]) return true
  return false
}

export function schemaHasRulesButRef(schema: AnySchema, RULES: ValidationRules): boolean {
  if (typeof schema == "boolean") return !schema
  for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true
  return false
}

export function schemaRefOrVal(
  {topSchemaRef, schemaPath}: SchemaObjCxt,
  schema: unknown,
  keyword: string,
  $data?: string | false
): Code | number | boolean {
  if (!$data) {
    if (typeof schema == "number" || typeof schema == "boolean") return schema
    if (typeof schema == "string") return _`${schema}`
  }
  return _`${topSchemaRef}${schemaPath}${getProperty(keyword)}`
}

export function unescapeFragment(str: string): string {
  return unescapeJsonPointer(decodeURIComponent(str))
}

export function escapeFragment(str: string | number): string {
  return encodeURIComponent(escapeJsonPointer(str))
}

export function escapeJsonPointer(str: string | number): string {
  if (typeof str == "number") return `${str}`
  return str.replace(/~/g, "~0").replace(/\//g, "~1")
}

export function unescapeJsonPointer(str: string): string {
  return str.replace(/~1/g, "/").replace(/~0/g, "~")
}

export function eachItem<T>(xs: T | T[], f: (x: T) => void): void {
  if (Array.isArray(xs)) {
    for (const x of xs) f(x)
  } else {
    f(xs)
  }
}

type SomeEvaluated = EvaluatedProperties | EvaluatedItems

type MergeEvaluatedFunc<T extends SomeEvaluated> = (
  gen: CodeGen,
  from: Name | T,
  to: Name | Exclude<T, true> | undefined,
  toName?: typeof Name
) => Name | T

interface MakeMergeFuncArgs<T extends SomeEvaluated> {
  mergeNames: (gen: CodeGen, from: Name, to: Name) => void
  mergeToName: (gen: CodeGen, from: T, to: Name) => void
  mergeValues: (from: T, to: Exclude<T, true>) => T
  resultToName: (gen: CodeGen, res?: T) => Name
}

function makeMergeEvaluated<T extends SomeEvaluated>({
  mergeNames,
  mergeToName,
  mergeValues,
  resultToName,
}: MakeMergeFuncArgs<T>): MergeEvaluatedFunc<T> {
  return (gen, from, to, toName) => {
    const res =
      to === undefined
        ? from
        : to instanceof Name
        ? (from instanceof Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
        : from instanceof Name
        ? (mergeToName(gen, to, from), from)
        : mergeValues(from, to)
    return toName === Name && !(res instanceof Name) ? resultToName(gen, res) : res
  }
}

interface MergeEvaluated {
  props: MergeEvaluatedFunc<EvaluatedProperties>
  items: MergeEvaluatedFunc<EvaluatedItems>
}

export const mergeEvaluated: MergeEvaluated = {
  props: makeMergeEvaluated({
    mergeNames: (gen, from, to) =>
      gen.if(_`${to} !== true && ${from} !== undefined`, () => {
        gen.if(
          _`${from} === true`,
          () => gen.assign(to, true),
          () => gen.assign(to, _`${to} || {}`).code(_`Object.assign(${to}, ${from})`)
        )
      }),
    mergeToName: (gen, from, to) =>
      gen.if(_`${to} !== true`, () => {
        if (from === true) {
          gen.assign(to, true)
        } else {
          gen.assign(to, _`${to} || {}`)
          setEvaluated(gen, to, from)
        }
      }),
    mergeValues: (from, to) => (from === true ? true : {...from, ...to}),
    resultToName: evaluatedPropsToName,
  }),
  items: makeMergeEvaluated({
    mergeNames: (gen, from, to) =>
      gen.if(_`${to} !== true && ${from} !== undefined`, () =>
        gen.assign(to, _`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)
      ),
    mergeToName: (gen, from, to) =>
      gen.if(_`${to} !== true`, () =>
        gen.assign(to, from === true ? true : _`${to} > ${from} ? ${to} : ${from}`)
      ),
    mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
    resultToName: (gen, items) => gen.var("items", items),
  }),
}

export function evaluatedPropsToName(gen: CodeGen, ps?: EvaluatedProperties): Name {
  if (ps === true) return gen.var("props", true)
  const props = gen.var("props", _`{}`)
  if (ps !== undefined) setEvaluated(gen, props, ps)
  return props
}

export function setEvaluated(gen: CodeGen, props: Name, ps: {[K in string]?: true}): void {
  Object.keys(ps).forEach((p) => gen.assign(_`${props}${getProperty(p)}`, true))
}

const snippets: {[S in string]?: _Code} = {}

export function useFunc(gen: CodeGen, f: {code: string}): Name {
  return gen.scopeValue("func", {
    ref: f,
    code: snippets[f.code] || (snippets[f.code] = new _Code(f.code)),
  })
}

export enum Type {
  Num,
  Str,
}

export function getErrorPath(
  dataProp: Name | string | number,
  dataPropType?: Type,
  jsPropertySyntax?: boolean
): Code | string {
  // let path
  if (dataProp instanceof Name) {
    const isNumber = dataPropType === Type.Num
    return jsPropertySyntax
      ? isNumber
        ? _`"[" + ${dataProp} + "]"`
        : _`"['" + ${dataProp} + "']"`
      : isNumber
      ? _`"/" + ${dataProp}`
      : _`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")` // TODO maybe use global escapePointer
  }
  return jsPropertySyntax ? getProperty(dataProp).toString() : "/" + escapeJsonPointer(dataProp)
}

export function checkStrictMode(
  it: SchemaCxt,
  msg: string,
  mode: boolean | "log" = it.opts.strictSchema
): void {
  if (!mode) return
  msg = `strict mode: ${msg}`
  if (mode === true) throw new Error(msg)
  it.self.logger.warn(msg)
}
import type {AnySchemaObject} from "../../types"
import type {SchemaObjCxt} from ".."
import type {JSONType, RuleGroup, Rule} from "../rules"

export function schemaHasRulesForType(
  {schema, self}: SchemaObjCxt,
  type: JSONType
): boolean | undefined {
  const group = self.RULES.types[type]
  return group && group !== true && shouldUseGroup(schema, group)
}

export function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean {
  return group.rules.some((rule) => shouldUseRule(schema, rule))
}

export function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined {
  return (
    schema[rule.keyword] !== undefined ||
    rule.definition.implements?.some((kwd) => schema[kwd] !== undefined)
  )
}
import type {KeywordErrorDefinition, KeywordErrorCxt} from "../../types"
import type {SchemaCxt} from ".."
import {reportError} from "../errors"
import {_, Name} from "../codegen"
import N from "../names"

const boolError: KeywordErrorDefinition = {
  message: "boolean schema is false",
}

export function topBoolOrEmptySchema(it: SchemaCxt): void {
  const {gen, schema, validateName} = it
  if (schema === false) {
    falseSchemaError(it, false)
  } else if (typeof schema == "object" && schema.$async === true) {
    gen.return(N.data)
  } else {
    gen.assign(_`${validateName}.errors`, null)
    gen.return(true)
  }
}

export function boolOrEmptySchema(it: SchemaCxt, valid: Name): void {
  const {gen, schema} = it
  if (schema === false) {
    gen.var(valid, false) // TODO var
    falseSchemaError(it)
  } else {
    gen.var(valid, true) // TODO var
  }
}

function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void {
  const {gen, data} = it
  // TODO maybe some other interface should be used for non-keyword validation errors...
  const cxt: KeywordErrorCxt = {
    gen,
    keyword: "false schema",
    data,
    schema: false,
    schemaCode: false,
    schemaValue: false,
    params: {},
    it,
  }
  reportError(cxt, boolError, undefined, overrideAllErrors)
}
import type {
  KeywordErrorDefinition,
  KeywordErrorCxt,
  ErrorObject,
  AnySchemaObject,
} from "../../types"
import type {SchemaObjCxt} from ".."
import {isJSONType, JSONType} from "../rules"
import {schemaHasRulesForType} from "./applicability"
import {reportError} from "../errors"
import {_, nil, and, not, operators, Code, Name} from "../codegen"
import {toHash, schemaRefOrVal} from "../util"

export enum DataType {
  Correct,
  Wrong,
}

export function getSchemaTypes(schema: AnySchemaObject): JSONType[] {
  const types = getJSONTypes(schema.type)
  const hasNull = types.includes("null")
  if (hasNull) {
    if (schema.nullable === false) throw new Error("type: null contradicts nullable: false")
  } else {
    if (!types.length && schema.nullable !== undefined) {
      throw new Error('"nullable" cannot be used without "type"')
    }
    if (schema.nullable === true) types.push("null")
  }
  return types
}

// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
export function getJSONTypes(ts: unknown | unknown[]): JSONType[] {
  const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : []
  if (types.every(isJSONType)) return types
  throw new Error("type must be JSONType or JSONType[]: " + types.join(","))
}

export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean {
  const {gen, data, opts} = it
  const coerceTo = coerceToTypes(types, opts.coerceTypes)
  const checkTypes =
    types.length > 0 &&
    !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0]))
  if (checkTypes) {
    const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong)
    gen.if(wrongType, () => {
      if (coerceTo.length) coerceData(it, types, coerceTo)
      else reportTypeError(it)
    })
  }
  return checkTypes
}

const COERCIBLE: Set<JSONType> = new Set(["string", "number", "integer", "boolean", "null"])
function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] {
  return coerceTypes
    ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
    : []
}

function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void {
  const {gen, data, opts} = it
  const dataType = gen.let("dataType", _`typeof ${data}`)
  const coerced = gen.let("coerced", _`undefined`)
  if (opts.coerceTypes === "array") {
    gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () =>
      gen
        .assign(data, _`${data}[0]`)
        .assign(dataType, _`typeof ${data}`)
        .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))
    )
  }
  gen.if(_`${coerced} !== undefined`)
  for (const t of coerceTo) {
    if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
      coerceSpecificType(t)
    }
  }
  gen.else()
  reportTypeError(it)
  gen.endIf()

  gen.if(_`${coerced} !== undefined`, () => {
    gen.assign(data, coerced)
    assignParentData(it, coerced)
  })

  function coerceSpecificType(t: string): void {
    switch (t) {
      case "string":
        gen
          .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`)
          .assign(coerced, _`"" + ${data}`)
          .elseIf(_`${data} === null`)
          .assign(coerced, _`""`)
        return
      case "number":
        gen
          .elseIf(
            _`${dataType} == "boolean" || ${data} === null
              || (${dataType} == "string" && ${data} && ${data} == +${data})`
          )
          .assign(coerced, _`+${data}`)
        return
      case "integer":
        gen
          .elseIf(
            _`${dataType} === "boolean" || ${data} === null
              || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`
          )
          .assign(coerced, _`+${data}`)
        return
      case "boolean":
        gen
          .elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`)
          .assign(coerced, false)
          .elseIf(_`${data} === "true" || ${data} === 1`)
          .assign(coerced, true)
        return
      case "null":
        gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`)
        gen.assign(coerced, null)
        return

      case "array":
        gen
          .elseIf(
            _`${dataType} === "string" || ${dataType} === "number"
              || ${dataType} === "boolean" || ${data} === null`
          )
          .assign(coerced, _`[${data}]`)
    }
  }
}

function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void {
  // TODO use gen.property
  gen.if(_`${parentData} !== undefined`, () =>
    gen.assign(_`${parentData}[${parentDataProperty}]`, expr)
  )
}

export function checkDataType(
  dataType: JSONType,
  data: Name,
  strictNums?: boolean | "log",
  correct = DataType.Correct
): Code {
  const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ
  let cond: Code
  switch (dataType) {
    case "null":
      return _`${data} ${EQ} null`
    case "array":
      cond = _`Array.isArray(${data})`
      break
    case "object":
      cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})`
      break
    case "integer":
      cond = numCond(_`!(${data} % 1) && !isNaN(${data})`)
      break
    case "number":
      cond = numCond()
      break
    default:
      return _`typeof ${data} ${EQ} ${dataType}`
  }
  return correct === DataType.Correct ? cond : not(cond)

  function numCond(_cond: Code = nil): Code {
    return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil)
  }
}

export function checkDataTypes(
  dataTypes: JSONType[],
  data: Name,
  strictNums?: boolean | "log",
  correct?: DataType
): Code {
  if (dataTypes.length === 1) {
    return checkDataType(dataTypes[0], data, strictNums, correct)
  }
  let cond: Code
  const types = toHash(dataTypes)
  if (types.array && types.object) {
    const notObj = _`typeof ${data} != "object"`
    cond = types.null ? notObj : _`!${data} || ${notObj}`
    delete types.null
    delete types.array
    delete types.object
  } else {
    cond = nil
  }
  if (types.number) delete types.integer
  for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct))
  return cond
}

export type TypeError = ErrorObject<"type", {type: string}>

const typeError: KeywordErrorDefinition = {
  message: ({schema}) => `must be ${schema}`,
  params: ({schema, schemaValue}) =>
    typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`,
}

export function reportTypeError(it: SchemaObjCxt): void {
  const cxt = getTypeErrorContext(it)
  reportError(cxt, typeError)
}

function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt {
  const {gen, data, schema} = it
  const schemaCode = schemaRefOrVal(it, schema, "type")
  return {
    gen,
    keyword: "type",
    data,
    schema: schema.type,
    schemaCode,
    schemaValue: schemaCode,
    parentSchema: schema,
    params: {},
    it,
  }
}
import type {SchemaObjCxt} from ".."
import {_, getProperty, stringify} from "../codegen"
import {checkStrictMode} from "../util"

export function assignDefaults(it: SchemaObjCxt, ty?: string): void {
  const {properties, items} = it.schema
  if (ty === "object" && properties) {
    for (const key in properties) {
      assignDefault(it, key, properties[key].default)
    }
  } else if (ty === "array" && Array.isArray(items)) {
    items.forEach((sch, i: number) => assignDefault(it, i, sch.default))
  }
}

function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void {
  const {gen, compositeRule, data, opts} = it
  if (defaultValue === undefined) return
  const childData = _`${data}${getProperty(prop)}`
  if (compositeRule) {
    checkStrictMode(it, `default is ignored for: ${childData}`)
    return
  }

  let condition = _`${childData} === undefined`
  if (opts.useDefaults === "empty") {
    condition = _`${condition} || ${childData} === null || ${childData} === ""`
  }
  // `${childData} === undefined` +
  // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "")
  gen.if(condition, _`${childData} = ${stringify(defaultValue)}`)
}
import type {
  AddedKeywordDefinition,
  AnySchema,
  AnySchemaObject,
  KeywordErrorCxt,
  KeywordCxtParams,
} from "../../types"
import type {SchemaCxt, SchemaObjCxt} from ".."
import type {InstanceOptions} from "../../core"
import {boolOrEmptySchema, topBoolOrEmptySchema} from "./boolSchema"
import {coerceAndCheckDataType, getSchemaTypes} from "./dataType"
import {shouldUseGroup, shouldUseRule} from "./applicability"
import {checkDataType, checkDataTypes, reportTypeError, DataType} from "./dataType"
import {assignDefaults} from "./defaults"
import {funcKeywordCode, macroKeywordCode, validateKeywordUsage, validSchemaType} from "./keyword"
import {getSubschema, extendSubschemaData, SubschemaArgs, extendSubschemaMode} from "./subschema"
import {_, nil, str, or, not, getProperty, Block, Code, Name, CodeGen} from "../codegen"
import N from "../names"
import {resolveUrl} from "../resolve"
import {
  schemaRefOrVal,
  schemaHasRulesButRef,
  checkUnknownRules,
  checkStrictMode,
  unescapeJsonPointer,
  mergeEvaluated,
} from "../util"
import type {JSONType, Rule, RuleGroup} from "../rules"
import {
  ErrorPaths,
  reportError,
  reportExtraError,
  resetErrorsCount,
  keyword$DataError,
} from "../errors"

// schema compilation - generates validation function, subschemaCode (below) is used for subschemas
export function validateFunctionCode(it: SchemaCxt): void {
  if (isSchemaObj(it)) {
    checkKeywords(it)
    if (schemaCxtHasRules(it)) {
      topSchemaObjCode(it)
      return
    }
  }
  validateFunction(it, () => topBoolOrEmptySchema(it))
}

function validateFunction(
  {gen, validateName, schema, schemaEnv, opts}: SchemaCxt,
  body: Block
): void {
  if (opts.code.es5) {
    gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => {
      gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`)
      destructureValCxtES5(gen, opts)
      gen.code(body)
    })
  } else {
    gen.func(validateName, _`${N.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () =>
      gen.code(funcSourceUrl(schema, opts)).code(body)
    )
  }
}

function destructureValCxt(opts: InstanceOptions): Code {
  return _`{${N.instancePath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${
    N.data
  }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}`
}

function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void {
  gen.if(
    N.valCxt,
    () => {
      gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`)
      gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`)
      gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`)
      gen.var(N.rootData, _`${N.valCxt}.${N.rootData}`)
      if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`${N.valCxt}.${N.dynamicAnchors}`)
    },
    () => {
      gen.var(N.instancePath, _`""`)
      gen.var(N.parentData, _`undefined`)
      gen.var(N.parentDataProperty, _`undefined`)
      gen.var(N.rootData, N.data)
      if (opts.dynamicRef) gen.var(N.dynamicAnchors, _`{}`)
    }
  )
}

function topSchemaObjCode(it: SchemaObjCxt): void {
  const {schema, opts, gen} = it
  validateFunction(it, () => {
    if (opts.$comment && schema.$comment) commentKeyword(it)
    checkNoDefault(it)
    gen.let(N.vErrors, null)
    gen.let(N.errors, 0)
    if (opts.unevaluated) resetEvaluated(it)
    typeAndKeywords(it)
    returnResults(it)
  })
  return
}

function resetEvaluated(it: SchemaObjCxt): void {
  // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated
  const {gen, validateName} = it
  it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`)
  gen.if(_`${it.evaluated}.dynamicProps`, () => gen.assign(_`${it.evaluated}.props`, _`undefined`))
  gen.if(_`${it.evaluated}.dynamicItems`, () => gen.assign(_`${it.evaluated}.items`, _`undefined`))
}

function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code {
  const schId = typeof schema == "object" && schema[opts.schemaId]
  return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil
}

// schema compilation - this function is used recursively to generate code for sub-schemas
function subschemaCode(it: SchemaCxt, valid: Name): void {
  if (isSchemaObj(it)) {
    checkKeywords(it)
    if (schemaCxtHasRules(it)) {
      subSchemaObjCode(it, valid)
      return
    }
  }
  boolOrEmptySchema(it, valid)
}

function schemaCxtHasRules({schema, self}: SchemaCxt): boolean {
  if (typeof schema == "boolean") return !schema
  for (const key in schema) if (self.RULES.all[key]) return true
  return false
}

function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt {
  return typeof it.schema != "boolean"
}

function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void {
  const {schema, gen, opts} = it
  if (opts.$comment && schema.$comment) commentKeyword(it)
  updateContext(it)
  checkAsyncSchema(it)
  const errsCount = gen.const("_errs", N.errors)
  typeAndKeywords(it, errsCount)
  // TODO var
  gen.var(valid, _`${errsCount} === ${N.errors}`)
}

function checkKeywords(it: SchemaObjCxt): void {
  checkUnknownRules(it)
  checkRefsAndKeywords(it)
}

function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void {
  if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount)
  const types = getSchemaTypes(it.schema)
  const checkedTypes = coerceAndCheckDataType(it, types)
  schemaKeywords(it, types, !checkedTypes, errsCount)
}

function checkRefsAndKeywords(it: SchemaObjCxt): void {
  const {schema, errSchemaPath, opts, self} = it
  if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) {
    self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`)
  }
}

function checkNoDefault(it: SchemaObjCxt): void {
  const {schema, opts} = it
  if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {
    checkStrictMode(it, "default is ignored in the schema root")
  }
}

function updateContext(it: SchemaObjCxt): void {
  const schId = it.schema[it.opts.schemaId]
  if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId)
}

function checkAsyncSchema(it: SchemaObjCxt): void {
  if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema")
}

function commentKeyword({gen, schemaEnv, schema, errSchemaPath, opts}: SchemaObjCxt): void {
  const msg = schema.$comment
  if (opts.$comment === true) {
    gen.code(_`${N.self}.logger.log(${msg})`)
  } else if (typeof opts.$comment == "function") {
    const schemaPath = str`${errSchemaPath}/$comment`
    const rootName = gen.scopeValue("root", {ref: schemaEnv.root})
    gen.code(_`${N.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`)
  }
}

function returnResults(it: SchemaCxt): void {
  const {gen, schemaEnv, validateName, ValidationError, opts} = it
  if (schemaEnv.$async) {
    // TODO assign unevaluated
    gen.if(
      _`${N.errors} === 0`,
      () => gen.return(N.data),
      () => gen.throw(_`new ${ValidationError as Name}(${N.vErrors})`)
    )
  } else {
    gen.assign(_`${validateName}.errors`, N.vErrors)
    if (opts.unevaluated) assignEvaluated(it)
    gen.return(_`${N.errors} === 0`)
  }
}

function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void {
  if (props instanceof Name) gen.assign(_`${evaluated}.props`, props)
  if (items instanceof Name) gen.assign(_`${evaluated}.items`, items)
}

function schemaKeywords(
  it: SchemaObjCxt,
  types: JSONType[],
  typeErrors: boolean,
  errsCount?: Name
): void {
  const {gen, schema, data, allErrors, opts, self} = it
  const {RULES} = self
  if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) {
    gen.block(() => keywordCode(it, "$ref", (RULES.all.$ref as Rule).definition)) // TODO typecast
    return
  }
  if (!opts.jtd) checkStrictTypes(it, types)
  gen.block(() => {
    for (const group of RULES.rules) groupKeywords(group)
    groupKeywords(RULES.post)
  })

  function groupKeywords(group: RuleGroup): void {
    if (!shouldUseGroup(schema, group)) return
    if (group.type) {
      gen.if(checkDataType(group.type, data, opts.strictNumbers))
      iterateKeywords(it, group)
      if (types.length === 1 && types[0] === group.type && typeErrors) {
        gen.else()
        reportTypeError(it)
      }
      gen.endIf()
    } else {
      iterateKeywords(it, group)
    }
    // TODO make it "ok" call?
    if (!allErrors) gen.if(_`${N.errors} === ${errsCount || 0}`)
  }
}

function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void {
  const {
    gen,
    schema,
    opts: {useDefaults},
  } = it
  if (useDefaults) assignDefaults(it, group.type)
  gen.block(() => {
    for (const rule of group.rules) {
      if (shouldUseRule(schema, rule)) {
        keywordCode(it, rule.keyword, rule.definition, group.type)
      }
    }
  })
}

function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void {
  if (it.schemaEnv.meta || !it.opts.strictTypes) return
  checkContextTypes(it, types)
  if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types)
  checkKeywordTypes(it, it.dataTypes)
}

function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void {
  if (!types.length) return
  if (!it.dataTypes.length) {
    it.dataTypes = types
    return
  }
  types.forEach((t) => {
    if (!includesType(it.dataTypes, t)) {
      strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`)
    }
  })
  narrowSchemaTypes(it, types)
}

function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void {
  if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
    strictTypesError(it, "use allowUnionTypes to allow union type keyword")
  }
}

function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void {
  const rules = it.self.RULES.all
  for (const keyword in rules) {
    const rule = rules[keyword]
    if (typeof rule == "object" && shouldUseRule(it.schema, rule)) {
      const {type} = rule.definition
      if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
        strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`)
      }
    }
  }
}

function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean {
  return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer"))
}

function includesType(ts: JSONType[], t: JSONType): boolean {
  return ts.includes(t) || (t === "integer" && ts.includes("number"))
}

function narrowSchemaTypes(it: SchemaObjCxt, withTypes: JSONType[]): void {
  const ts: JSONType[] = []
  for (const t of it.dataTypes) {
    if (includesType(withTypes, t)) ts.push(t)
    else if (withTypes.includes("integer") && t === "number") ts.push("integer")
  }
  it.dataTypes = ts
}

function strictTypesError(it: SchemaObjCxt, msg: string): void {
  const schemaPath = it.schemaEnv.baseId + it.errSchemaPath
  msg += ` at "${schemaPath}" (strictTypes)`
  checkStrictMode(it, msg, it.opts.strictTypes)
}

export class KeywordCxt implements KeywordErrorCxt {
  readonly gen: CodeGen
  readonly allErrors?: boolean
  readonly keyword: string
  readonly data: Name // Name referencing the current level of the data instance
  readonly $data?: string | false
  schema: any // keyword value in the schema
  readonly schemaValue: Code | number | boolean // Code reference to keyword schema value or primitive value
  readonly schemaCode: Code | number | boolean // Code reference to resolved schema value (different if schema is $data)
  readonly schemaType: JSONType[] // allowed type(s) of keyword value in the schema
  readonly parentSchema: AnySchemaObject
  readonly errsCount?: Name // Name reference to the number of validation errors collected before this keyword,
  // requires option trackErrors in keyword definition
  params: KeywordCxtParams // object to pass parameters to error messages from keyword code
  readonly it: SchemaObjCxt // schema compilation context (schema is guaranteed to be an object, not boolean)
  readonly def: AddedKeywordDefinition

  constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) {
    validateKeywordUsage(it, def, keyword)
    this.gen = it.gen
    this.allErrors = it.allErrors
    this.keyword = keyword
    this.data = it.data
    this.schema = it.schema[keyword]
    this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data
    this.schemaValue = schemaRefOrVal(it, this.schema, keyword, this.$data)
    this.schemaType = def.schemaType
    this.parentSchema = it.schema
    this.params = {}
    this.it = it
    this.def = def

    if (this.$data) {
      this.schemaCode = it.gen.const("vSchema", getData(this.$data, it))
    } else {
      this.schemaCode = this.schemaValue
      if (!validSchemaType(this.schema, def.schemaType, def.allowUndefined)) {
        throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`)
      }
    }

    if ("code" in def ? def.trackErrors : def.errors !== false) {
      this.errsCount = it.gen.const("_errs", N.errors)
    }
  }

  result(condition: Code, successAction?: () => void, failAction?: () => void): void {
    this.failResult(not(condition), successAction, failAction)
  }

  failResult(condition: Code, successAction?: () => void, failAction?: () => void): void {
    this.gen.if(condition)
    if (failAction) failAction()
    else this.error()
    if (successAction) {
      this.gen.else()
      successAction()
      if (this.allErrors) this.gen.endIf()
    } else {
      if (this.allErrors) this.gen.endIf()
      else this.gen.else()
    }
  }

  pass(condition: Code, failAction?: () => void): void {
    this.failResult(not(condition), undefined, failAction)
  }

  fail(condition?: Code): void {
    if (condition === undefined) {
      this.error()
      if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize
      return
    }
    this.gen.if(condition)
    this.error()
    if (this.allErrors) this.gen.endIf()
    else this.gen.else()
  }

  fail$data(condition: Code): void {
    if (!this.$data) return this.fail(condition)
    const {schemaCode} = this
    this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`)
  }

  error(append?: boolean, errorParams?: KeywordCxtParams, errorPaths?: ErrorPaths): void {
    if (errorParams) {
      this.setParams(errorParams)
      this._error(append, errorPaths)
      this.setParams({})
      return
    }
    this._error(append, errorPaths)
  }

  private _error(append?: boolean, errorPaths?: ErrorPaths): void {
    ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths)
  }

  $dataError(): void {
    reportError(this, this.def.$dataError || keyword$DataError)
  }

  reset(): void {
    if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition')
    resetErrorsCount(this.gen, this.errsCount)
  }

  ok(cond: Code | boolean): void {
    if (!this.allErrors) this.gen.if(cond)
  }

  setParams(obj: KeywordCxtParams, assign?: true): void {
    if (assign) Object.assign(this.params, obj)
    else this.params = obj
  }

  block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void {
    this.gen.block(() => {
      this.check$data(valid, $dataValid)
      codeBlock()
    })
  }

  check$data(valid: Name = nil, $dataValid: Code = nil): void {
    if (!this.$data) return
    const {gen, schemaCode, schemaType, def} = this
    gen.if(or(_`${schemaCode} === undefined`, $dataValid))
    if (valid !== nil) gen.assign(valid, true)
    if (schemaType.length || def.validateSchema) {
      gen.elseIf(this.invalid$data())
      this.$dataError()
      if (valid !== nil) gen.assign(valid, false)
    }
    gen.else()
  }

  invalid$data(): Code {
    const {gen, schemaCode, schemaType, def, it} = this
    return or(wrong$DataType(), invalid$DataSchema())

    function wrong$DataType(): Code {
      if (schemaType.length) {
        /* istanbul ignore if */
        if (!(schemaCode instanceof Name)) throw new Error("ajv implementation error")
        const st = Array.isArray(schemaType) ? schemaType : [schemaType]
        return _`${checkDataTypes(st, schemaCode, it.opts.strictNumbers, DataType.Wrong)}`
      }
      return nil
    }

    function invalid$DataSchema(): Code {
      if (def.validateSchema) {
        const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone
        return _`!${validateSchemaRef}(${schemaCode})`
      }
      return nil
    }
  }

  subschema(appl: SubschemaArgs, valid: Name): SchemaCxt {
    const subschema = getSubschema(this.it, appl)
    extendSubschemaData(subschema, this.it, appl)
    extendSubschemaMode(subschema, appl)
    const nextContext = {...this.it, ...subschema, items: undefined, props: undefined}
    subschemaCode(nextContext, valid)
    return nextContext
  }

  mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void {
    const {it, gen} = this
    if (!it.opts.unevaluated) return
    if (it.props !== true && schemaCxt.props !== undefined) {
      it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName)
    }
    if (it.items !== true && schemaCxt.items !== undefined) {
      it.items = mergeEvaluated.items(gen, schemaCxt.items, it.items, toName)
    }
  }

  mergeValidEvaluated(schemaCxt: SchemaCxt, valid: Name): boolean | void {
    const {it, gen} = this
    if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
      gen.if(valid, () => this.mergeEvaluated(schemaCxt, Name))
      return true
    }
  }
}

function keywordCode(
  it: SchemaObjCxt,
  keyword: string,
  def: AddedKeywordDefinition,
  ruleType?: JSONType
): void {
  const cxt = new KeywordCxt(it, def, keyword)
  if ("code" in def) {
    def.code(cxt, ruleType)
  } else if (cxt.$data && def.validate) {
    funcKeywordCode(cxt, def)
  } else if ("macro" in def) {
    macroKeywordCode(cxt, def)
  } else if (def.compile || def.validate) {
    funcKeywordCode(cxt, def)
  }
}

const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/
const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/
export function getData(
  $data: string,
  {dataLevel, dataNames, dataPathArr}: SchemaCxt
): Code | number {
  let jsonPointer
  let data: Code
  if ($data === "") return N.rootData
  if ($data[0] === "/") {
    if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`)
    jsonPointer = $data
    data = N.rootData
  } else {
    const matches = RELATIVE_JSON_POINTER.exec($data)
    if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`)
    const up: number = +matches[1]
    jsonPointer = matches[2]
    if (jsonPointer === "#") {
      if (up >= dataLevel) throw new Error(errorMsg("property/index", up))
      return dataPathArr[dataLevel - up]
    }
    if (up > dataLevel) throw new Error(errorMsg("data", up))
    data = dataNames[dataLevel - up]
    if (!jsonPointer) return data
  }

  let expr = data
  const segments = jsonPointer.split("/")
  for (const segment of segments) {
    if (segment) {
      data = _`${data}${getProperty(unescapeJsonPointer(segment))}`
      expr = _`${expr} && ${data}`
    }
  }
  return expr

  function errorMsg(pointerType: string, up: number): string {
    return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`
  }
}
import type {KeywordCxt} from "."
import type {
  AnySchema,
  SchemaValidateFunction,
  AnyValidateFunction,
  AddedKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
} from "../../types"
import type {SchemaObjCxt} from ".."
import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen"
import N from "../names"
import type {JSONType} from "../rules"
import {callValidateCode} from "../../vocabularies/code"
import {extendErrors} from "../errors"

type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction

export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void {
  const {gen, keyword, schema, parentSchema, it} = cxt
  const macroSchema = def.macro.call(it.self, schema, parentSchema, it)
  const schemaRef = useKeyword(gen, keyword, macroSchema)
  if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true)

  const valid = gen.name("valid")
  cxt.subschema(
    {
      schema: macroSchema,
      schemaPath: nil,
      errSchemaPath: `${it.errSchemaPath}/${keyword}`,
      topSchemaRef: schemaRef,
      compositeRule: true,
    },
    valid
  )
  cxt.pass(valid, () => cxt.error(true))
}

export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void {
  const {gen, keyword, schema, parentSchema, $data, it} = cxt
  checkAsyncKeyword(it, def)
  const validate =
    !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate
  const validateRef = useKeyword(gen, keyword, validate)
  const valid = gen.let("valid")
  cxt.block$data(valid, validateKeyword)
  cxt.ok(def.valid ?? valid)

  function validateKeyword(): void {
    if (def.errors === false) {
      assignValid()
      if (def.modifying) modifyData(cxt)
      reportErrs(() => cxt.error())
    } else {
      const ruleErrs = def.async ? validateAsync() : validateSync()
      if (def.modifying) modifyData(cxt)
      reportErrs(() => addErrs(cxt, ruleErrs))
    }
  }

  function validateAsync(): Name {
    const ruleErrs = gen.let("ruleErrs", null)
    gen.try(
      () => assignValid(_`await `),
      (e) =>
        gen.assign(valid, false).if(
          _`${e} instanceof ${it.ValidationError as Name}`,
          () => gen.assign(ruleErrs, _`${e}.errors`),
          () => gen.throw(e)
        )
    )
    return ruleErrs
  }

  function validateSync(): Code {
    const validateErrs = _`${validateRef}.errors`
    gen.assign(validateErrs, null)
    assignValid(nil)
    return validateErrs
  }

  function assignValid(_await: Code = def.async ? _`await ` : nil): void {
    const passCxt = it.opts.passContext ? N.this : N.self
    const passSchema = !(("compile" in def && !$data) || def.schema === false)
    gen.assign(
      valid,
      _`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`,
      def.modifying
    )
  }

  function reportErrs(errors: () => void): void {
    gen.if(not(def.valid ?? valid), errors)
  }
}

function modifyData(cxt: KeywordCxt): void {
  const {gen, data, it} = cxt
  gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`))
}

function addErrs(cxt: KeywordCxt, errs: Code): void {
  const {gen} = cxt
  gen.if(
    _`Array.isArray(${errs})`,
    () => {
      gen
        .assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`)
        .assign(N.errors, _`${N.vErrors}.length`)
      extendErrors(cxt)
    },
    () => cxt.error()
  )
}

function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void {
  if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema")
}

function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name {
  if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`)
  return gen.scopeValue(
    "keyword",
    typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)}
  )
}

export function validSchemaType(
  schema: unknown,
  schemaType: JSONType[],
  allowUndefined = false
): boolean {
  // TODO add tests
  return (
    !schemaType.length ||
    schemaType.some((st) =>
      st === "array"
        ? Array.isArray(schema)
        : st === "object"
        ? schema && typeof schema == "object" && !Array.isArray(schema)
        : typeof schema == st || (allowUndefined && typeof schema == "undefined")
    )
  )
}

export function validateKeywordUsage(
  {schema, opts, self, errSchemaPath}: SchemaObjCxt,
  def: AddedKeywordDefinition,
  keyword: string
): void {
  /* istanbul ignore if */
  if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
    throw new Error("ajv implementation error")
  }

  const deps = def.dependencies
  if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
    throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`)
  }

  if (def.validateSchema) {
    const valid = def.validateSchema(schema[keyword])
    if (!valid) {
      const msg =
        `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` +
        self.errorsText(def.validateSchema.errors)
      if (opts.validateSchema === "log") self.logger.error(msg)
      else throw new Error(msg)
    }
  }
}
import type {AnySchema} from "../../types"
import type {SchemaObjCxt} from ".."
import {_, str, getProperty, Code, Name} from "../codegen"
import {escapeFragment, getErrorPath, Type} from "../util"
import type {JSONType} from "../rules"

export interface SubschemaContext {
  // TODO use Optional? align with SchemCxt property types
  schema: AnySchema
  schemaPath: Code
  errSchemaPath: string
  topSchemaRef?: Code
  errorPath?: Code
  dataLevel?: number
  dataTypes?: JSONType[]
  data?: Name
  parentData?: Name
  parentDataProperty?: Code | number
  dataNames?: Name[]
  dataPathArr?: (Code | number)[]
  propertyName?: Name
  jtdDiscriminator?: string
  jtdMetadata?: boolean
  compositeRule?: true
  createErrors?: boolean
  allErrors?: boolean
}

export type SubschemaArgs = Partial<{
  keyword: string
  schemaProp: string | number
  schema: AnySchema
  schemaPath: Code
  errSchemaPath: string
  topSchemaRef: Code
  data: Name | Code
  dataProp: Code | string | number
  dataTypes: JSONType[]
  definedProperties: Set<string>
  propertyName: Name
  dataPropType: Type
  jtdDiscriminator: string
  jtdMetadata: boolean
  compositeRule: true
  createErrors: boolean
  allErrors: boolean
}>

export function getSubschema(
  it: SchemaObjCxt,
  {keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs
): SubschemaContext {
  if (keyword !== undefined && schema !== undefined) {
    throw new Error('both "keyword" and "schema" passed, only one allowed')
  }

  if (keyword !== undefined) {
    const sch = it.schema[keyword]
    return schemaProp === undefined
      ? {
          schema: sch,
          schemaPath: _`${it.schemaPath}${getProperty(keyword)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}`,
        }
      : {
          schema: sch[schemaProp],
          schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`,
          errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`,
        }
  }

  if (schema !== undefined) {
    if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
      throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')
    }
    return {
      schema,
      schemaPath,
      topSchemaRef,
      errSchemaPath,
    }
  }

  throw new Error('either "keyword" or "schema" must be passed')
}

export function extendSubschemaData(
  subschema: SubschemaContext,
  it: SchemaObjCxt,
  {dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs
): void {
  if (data !== undefined && dataProp !== undefined) {
    throw new Error('both "data" and "dataProp" passed, only one allowed')
  }

  const {gen} = it

  if (dataProp !== undefined) {
    const {errorPath, dataPathArr, opts} = it
    const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true)
    dataContextProps(nextData)
    subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`
    subschema.parentDataProperty = _`${dataProp}`
    subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]
  }

  if (data !== undefined) {
    const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once?
    dataContextProps(nextData)
    if (propertyName !== undefined) subschema.propertyName = propertyName
    // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
  }

  if (dataTypes) subschema.dataTypes = dataTypes

  function dataContextProps(_nextData: Name): void {
    subschema.data = _nextData
    subschema.dataLevel = it.dataLevel + 1
    subschema.dataTypes = []
    it.definedProperties = new Set<string>()
    subschema.parentData = it.data
    subschema.dataNames = [...it.dataNames, _nextData]
  }
}

export function extendSubschemaMode(
  subschema: SubschemaContext,
  {jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs
): void {
  if (compositeRule !== undefined) subschema.compositeRule = compositeRule
  if (createErrors !== undefined) subschema.createErrors = createErrors
  if (allErrors !== undefined) subschema.allErrors = allErrors
  subschema.jtdDiscriminator = jtdDiscriminator // not inherited
  subschema.jtdMetadata = jtdMetadata // not inherited
}
export {
  Format,
  FormatDefinition,
  AsyncFormatDefinition,
  KeywordDefinition,
  KeywordErrorDefinition,
  CodeKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
  Vocabulary,
  Schema,
  SchemaObject,
  AnySchemaObject,
  AsyncSchema,
  AnySchema,
  ValidateFunction,
  AsyncValidateFunction,
  AnyValidateFunction,
  ErrorObject,
  ErrorNoParams,
} from "./types"

export {SchemaCxt, SchemaObjCxt} from "./compile"
export interface Plugin<Opts> {
  (ajv: Ajv, options?: Opts): Ajv
  [prop: string]: any
}

export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"

import type {
  Schema,
  AnySchema,
  AnySchemaObject,
  SchemaObject,
  AsyncSchema,
  Vocabulary,
  KeywordDefinition,
  AddedKeywordDefinition,
  AnyValidateFunction,
  ValidateFunction,
  AsyncValidateFunction,
  ErrorObject,
  Format,
  AddedFormat,
  RegExpEngine,
  UriResolver,
} from "./types"
import type {JSONSchemaType} from "./types/json-schema"
import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
import ValidationError from "./runtime/validation_error"
import MissingRefError from "./compile/ref_error"
import {getRules, ValidationRules, Rule, RuleGroup, JSONType} from "./compile/rules"
import {SchemaEnv, compileSchema, resolveSchema} from "./compile"
import {Code, ValueScope} from "./compile/codegen"
import {normalizeId, getSchemaRefs} from "./compile/resolve"
import {getJSONTypes} from "./compile/validate/dataType"
import {eachItem} from "./compile/util"
import * as $dataRefSchema from "./refs/data.json"

import DefaultUriResolver from "./runtime/uri"

const defaultRegExp: RegExpEngine = (str, flags) => new RegExp(str, flags)
defaultRegExp.code = "new RegExp"

const META_IGNORE_OPTIONS: (keyof Options)[] = ["removeAdditional", "useDefaults", "coerceTypes"]
const EXT_SCOPE_NAMES = new Set([
  "validate",
  "serialize",
  "parse",
  "wrapper",
  "root",
  "schema",
  "keyword",
  "pattern",
  "formats",
  "validate$data",
  "func",
  "obj",
  "Error",
])

export type Options = CurrentOptions & DeprecatedOptions

export interface CurrentOptions {
  // strict mode options (NEW)
  strict?: boolean | "log"
  strictSchema?: boolean | "log"
  strictNumbers?: boolean | "log"
  strictTypes?: boolean | "log"
  strictTuples?: boolean | "log"
  strictRequired?: boolean | "log"
  allowMatchingProperties?: boolean // disables a strict mode restriction
  allowUnionTypes?: boolean
  validateFormats?: boolean
  // validation and reporting options:
  $data?: boolean
  allErrors?: boolean
  verbose?: boolean
  discriminator?: boolean
  unicodeRegExp?: boolean
  timestamp?: "string" | "date" // JTD only
  parseDate?: boolean // JTD only
  allowDate?: boolean // JTD only
  $comment?:
    | true
    | ((comment: string, schemaPath?: string, rootSchema?: AnySchemaObject) => unknown)
  formats?: {[Name in string]?: Format}
  keywords?: Vocabulary
  schemas?: AnySchema[] | {[Key in string]?: AnySchema}
  logger?: Logger | false
  loadSchema?: (uri: string) => Promise<AnySchemaObject>
  // options to modify validated data:
  removeAdditional?: boolean | "all" | "failing"
  useDefaults?: boolean | "empty"
  coerceTypes?: boolean | "array"
  // advanced options:
  next?: boolean // NEW
  unevaluated?: boolean // NEW
  dynamicRef?: boolean // NEW
  schemaId?: "id" | "$id"
  jtd?: boolean // NEW
  meta?: SchemaObject | boolean
  defaultMeta?: string | AnySchemaObject
  validateSchema?: boolean | "log"
  addUsedSchema?: boolean
  inlineRefs?: boolean | number
  passContext?: boolean
  loopRequired?: number
  loopEnum?: number // NEW
  ownProperties?: boolean
  multipleOfPrecision?: number
  int32range?: boolean // JTD only
  messages?: boolean
  code?: CodeOptions // NEW
  uriResolver?: UriResolver
}

export interface CodeOptions {
  es5?: boolean
  esm?: boolean
  lines?: boolean
  optimize?: boolean | number
  formats?: Code // code to require (or construct) map of available formats - for standalone code
  source?: boolean
  process?: (code: string, schema?: SchemaEnv) => string
  regExp?: RegExpEngine
}

interface InstanceCodeOptions extends CodeOptions {
  regExp: RegExpEngine
  optimize: number
}

interface DeprecatedOptions {
  /** @deprecated */
  ignoreKeywordsWithRef?: boolean
  /** @deprecated */
  jsPropertySyntax?: boolean // added instead of jsonPointers
  /** @deprecated */
  unicode?: boolean
}

interface RemovedOptions {
  format?: boolean
  errorDataPath?: "object" | "property"
  nullable?: boolean // "nullable" keyword is supported by default
  jsonPointers?: boolean
  extendRefs?: true | "ignore" | "fail"
  missingRefs?: true | "ignore" | "fail"
  processCode?: (code: string, schema?: SchemaEnv) => string
  sourceCode?: boolean
  strictDefaults?: boolean
  strictKeywords?: boolean
  uniqueItems?: boolean
  unknownFormats?: true | string[] | "ignore"
  cache?: any
  serialize?: (schema: AnySchema) => unknown
  ajvErrors?: boolean
}

type OptionsInfo<T extends RemovedOptions | DeprecatedOptions> = {
  [K in keyof T]-?: string | undefined
}

const removedOptions: OptionsInfo<RemovedOptions> = {
  errorDataPath: "",
  format: "`validateFormats: false` can be used instead.",
  nullable: '"nullable" keyword is supported by default.',
  jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
  extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
  missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
  processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
  sourceCode: "Use option `code: {source: true}`",
  strictDefaults: "It is default now, see option `strict`.",
  strictKeywords: "It is default now, see option `strict`.",
  uniqueItems: '"uniqueItems" keyword is always validated.',
  unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
  cache: "Map is used as cache, schema object as key.",
  serialize: "Map is used as cache, schema object as key.",
  ajvErrors: "It is default now.",
}

const deprecatedOptions: OptionsInfo<DeprecatedOptions> = {
  ignoreKeywordsWithRef: "",
  jsPropertySyntax: "",
  unicode: '"minLength"/"maxLength" account for unicode characters by default.',
}

type RequiredInstanceOptions = {
  [K in
    | "strictSchema"
    | "strictNumbers"
    | "strictTypes"
    | "strictTuples"
    | "strictRequired"
    | "inlineRefs"
    | "loopRequired"
    | "loopEnum"
    | "meta"
    | "messages"
    | "schemaId"
    | "addUsedSchema"
    | "validateSchema"
    | "validateFormats"
    | "int32range"
    | "unicodeRegExp"
    | "uriResolver"]: NonNullable<Options[K]>
} & {code: InstanceCodeOptions}

export type InstanceOptions = Options & RequiredInstanceOptions

const MAX_EXPRESSION = 200

// eslint-disable-next-line complexity
function requiredOptions(o: Options): RequiredInstanceOptions {
  const s = o.strict
  const _optz = o.code?.optimize
  const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0
  const regExp = o.code?.regExp ?? defaultRegExp
  const uriResolver = o.uriResolver ?? DefaultUriResolver
  return {
    strictSchema: o.strictSchema ?? s ?? true,
    strictNumbers: o.strictNumbers ?? s ?? true,
    strictTypes: o.strictTypes ?? s ?? "log",
    strictTuples: o.strictTuples ?? s ?? "log",
    strictRequired: o.strictRequired ?? s ?? false,
    code: o.code ? {...o.code, optimize, regExp} : {optimize, regExp},
    loopRequired: o.loopRequired ?? MAX_EXPRESSION,
    loopEnum: o.loopEnum ?? MAX_EXPRESSION,
    meta: o.meta ?? true,
    messages: o.messages ?? true,
    inlineRefs: o.inlineRefs ?? true,
    schemaId: o.schemaId ?? "$id",
    addUsedSchema: o.addUsedSchema ?? true,
    validateSchema: o.validateSchema ?? true,
    validateFormats: o.validateFormats ?? true,
    unicodeRegExp: o.unicodeRegExp ?? true,
    int32range: o.int32range ?? true,
    uriResolver: uriResolver,
  }
}

export interface Logger {
  log(...args: unknown[]): unknown
  warn(...args: unknown[]): unknown
  error(...args: unknown[]): unknown
}

export default class Ajv {
  opts: InstanceOptions
  errors?: ErrorObject[] | null // errors from the last validation
  logger: Logger
  // shared external scope values for compiled functions
  readonly scope: ValueScope
  readonly schemas: {[Key in string]?: SchemaEnv} = {}
  readonly refs: {[Ref in string]?: SchemaEnv | string} = {}
  readonly formats: {[Name in string]?: AddedFormat} = {}
  readonly RULES: ValidationRules
  readonly _compilations: Set<SchemaEnv> = new Set()
  private readonly _loading: {[Ref in string]?: Promise<AnySchemaObject>} = {}
  private readonly _cache: Map<AnySchema, SchemaEnv> = new Map()
  private readonly _metaOpts: InstanceOptions

  static ValidationError = ValidationError
  static MissingRefError = MissingRefError

  constructor(opts: Options = {}) {
    opts = this.opts = {...opts, ...requiredOptions(opts)}
    const {es5, lines} = this.opts.code

    this.scope = new ValueScope({scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines})
    this.logger = getLogger(opts.logger)
    const formatOpt = opts.validateFormats
    opts.validateFormats = false

    this.RULES = getRules()
    checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED")
    checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn")
    this._metaOpts = getMetaSchemaOptions.call(this)

    if (opts.formats) addInitialFormats.call(this)
    this._addVocabularies()
    this._addDefaultMetaSchema()
    if (opts.keywords) addInitialKeywords.call(this, opts.keywords)
    if (typeof opts.meta == "object") this.addMetaSchema(opts.meta)
    addInitialSchemas.call(this)
    opts.validateFormats = formatOpt
  }

  _addVocabularies(): void {
    this.addKeyword("$async")
  }

  _addDefaultMetaSchema(): void {
    const {$data, meta, schemaId} = this.opts
    let _dataRefSchema: SchemaObject = $dataRefSchema
    if (schemaId === "id") {
      _dataRefSchema = {...$dataRefSchema}
      _dataRefSchema.id = _dataRefSchema.$id
      delete _dataRefSchema.$id
    }
    if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false)
  }

  defaultMeta(): string | AnySchemaObject | undefined {
    const {meta, schemaId} = this.opts
    return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined)
  }

  // Validate data using schema
  // AnySchema will be compiled and cached using schema itself as a key for Map
  validate(schema: Schema | string, data: unknown): boolean
  validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown>
  validate<T>(schema: Schema | JSONSchemaType<T> | string, data: unknown): data is T
  // Separated for type inference to work
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  validate<T>(schema: JTDSchemaType<T>, data: unknown): data is T
  // This overload is only intended for typescript inference, the first
  // argument prevents manual type annotation from matching this overload
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  validate<N extends never, T extends SomeJTDSchemaType>(
    schema: T,
    data: unknown
  ): data is JTDDataType<T>
  // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
  validate<T>(schema: AsyncSchema, data: unknown | T): Promise<T>
  validate<T>(schemaKeyRef: AnySchema | string, data: unknown): data is T | Promise<T>
  validate<T>(
    schemaKeyRef: AnySchema | string, // key, ref or schema object
    // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
    data: unknown | T // to be validated
  ): boolean | Promise<T> {
    let v: AnyValidateFunction | undefined
    if (typeof schemaKeyRef == "string") {
      v = this.getSchema<T>(schemaKeyRef)
      if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`)
    } else {
      v = this.compile<T>(schemaKeyRef)
    }

    const valid = v(data)
    if (!("$async" in v)) this.errors = v.errors
    return valid
  }

  // Create validation function for passed schema
  // _meta: true if schema is a meta-schema. Used internally to compile meta schemas of user-defined keywords.
  compile<T = unknown>(schema: Schema | JSONSchemaType<T>, _meta?: boolean): ValidateFunction<T>
  // Separated for type inference to work
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  compile<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): ValidateFunction<T>
  // This overload is only intended for typescript inference, the first
  // argument prevents manual type annotation from matching this overload
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  compile<N extends never, T extends SomeJTDSchemaType>(
    schema: T,
    _meta?: boolean
  ): ValidateFunction<JTDDataType<T>>
  compile<T = unknown>(schema: AsyncSchema, _meta?: boolean): AsyncValidateFunction<T>
  compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T>
  compile<T = unknown>(schema: AnySchema, _meta?: boolean): AnyValidateFunction<T> {
    const sch = this._addSchema(schema, _meta)
    return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T>
  }

  // Creates validating function for passed schema with asynchronous loading of missing schemas.
  // `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
  // TODO allow passing schema URI
  // meta - optional true to compile meta-schema
  compileAsync<T = unknown>(
    schema: SchemaObject | JSONSchemaType<T>,
    _meta?: boolean
  ): Promise<ValidateFunction<T>>
  // Separated for type inference to work
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  compileAsync<T = unknown>(schema: JTDSchemaType<T>, _meta?: boolean): Promise<ValidateFunction<T>>
  compileAsync<T = unknown>(schema: AsyncSchema, meta?: boolean): Promise<AsyncValidateFunction<T>>
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  compileAsync<T = unknown>(
    schema: AnySchemaObject,
    meta?: boolean
  ): Promise<AnyValidateFunction<T>>
  compileAsync<T = unknown>(
    schema: AnySchemaObject,
    meta?: boolean
  ): Promise<AnyValidateFunction<T>> {
    if (typeof this.opts.loadSchema != "function") {
      throw new Error("options.loadSchema should be a function")
    }
    const {loadSchema} = this.opts
    return runCompileAsync.call(this, schema, meta)

    async function runCompileAsync(
      this: Ajv,
      _schema: AnySchemaObject,
      _meta?: boolean
    ): Promise<AnyValidateFunction> {
      await loadMetaSchema.call(this, _schema.$schema)
      const sch = this._addSchema(_schema, _meta)
      return sch.validate || _compileAsync.call(this, sch)
    }

    async function loadMetaSchema(this: Ajv, $ref?: string): Promise<void> {
      if ($ref && !this.getSchema($ref)) {
        await runCompileAsync.call(this, {$ref}, true)
      }
    }

    async function _compileAsync(this: Ajv, sch: SchemaEnv): Promise<AnyValidateFunction> {
      try {
        return this._compileSchemaEnv(sch)
      } catch (e) {
        if (!(e instanceof MissingRefError)) throw e
        checkLoaded.call(this, e)
        await loadMissingSchema.call(this, e.missingSchema)
        return _compileAsync.call(this, sch)
      }
    }

    function checkLoaded(this: Ajv, {missingSchema: ref, missingRef}: MissingRefError): void {
      if (this.refs[ref]) {
        throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`)
      }
    }

    async function loadMissingSchema(this: Ajv, ref: string): Promise<void> {
      const _schema = await _loadSchema.call(this, ref)
      if (!this.refs[ref]) await loadMetaSchema.call(this, _schema.$schema)
      if (!this.refs[ref]) this.addSchema(_schema, ref, meta)
    }

    async function _loadSchema(this: Ajv, ref: string): Promise<AnySchemaObject> {
      const p = this._loading[ref]
      if (p) return p
      try {
        return await (this._loading[ref] = loadSchema(ref))
      } finally {
        delete this._loading[ref]
      }
    }
  }

  // Adds schema to the instance
  addSchema(
    schema: AnySchema | AnySchema[], // If array is passed, `key` will be ignored
    key?: string, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
    _meta?: boolean, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
    _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
  ): Ajv {
    if (Array.isArray(schema)) {
      for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema)
      return this
    }
    let id: string | undefined
    if (typeof schema === "object") {
      const {schemaId} = this.opts
      id = schema[schemaId]
      if (id !== undefined && typeof id != "string") {
        throw new Error(`schema ${schemaId} must be string`)
      }
    }
    key = normalizeId(key || id)
    this._checkUnique(key)
    this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true)
    return this
  }

  // Add schema that will be used to validate other schemas
  // options in META_IGNORE_OPTIONS are alway set to false
  addMetaSchema(
    schema: AnySchemaObject,
    key?: string, // schema key
    _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
  ): Ajv {
    this.addSchema(schema, key, true, _validateSchema)
    return this
  }

  //  Validate schema against its meta-schema
  validateSchema(schema: AnySchema, throwOrLogError?: boolean): boolean | Promise<unknown> {
    if (typeof schema == "boolean") return true
    let $schema: string | AnySchemaObject | undefined
    $schema = schema.$schema
    if ($schema !== undefined && typeof $schema != "string") {
      throw new Error("$schema must be a string")
    }
    $schema = $schema || this.opts.defaultMeta || this.defaultMeta()
    if (!$schema) {
      this.logger.warn("meta-schema not available")
      this.errors = null
      return true
    }
    const valid = this.validate($schema, schema)
    if (!valid && throwOrLogError) {
      const message = "schema is invalid: " + this.errorsText()
      if (this.opts.validateSchema === "log") this.logger.error(message)
      else throw new Error(message)
    }
    return valid
  }

  // Get compiled schema by `key` or `ref`.
  // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
  getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {
    let sch
    while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch
    if (sch === undefined) {
      const {schemaId} = this.opts
      const root = new SchemaEnv({schema: {}, schemaId})
      sch = resolveSchema.call(this, root, keyRef)
      if (!sch) return
      this.refs[keyRef] = sch
    }
    return (sch.validate || this._compileSchemaEnv(sch)) as AnyValidateFunction<T> | undefined
  }

  // Remove cached schema(s).
  // If no parameter is passed all schemas but meta-schemas are removed.
  // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
  // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
  removeSchema(schemaKeyRef?: AnySchema | string | RegExp): Ajv {
    if (schemaKeyRef instanceof RegExp) {
      this._removeAllSchemas(this.schemas, schemaKeyRef)
      this._removeAllSchemas(this.refs, schemaKeyRef)
      return this
    }
    switch (typeof schemaKeyRef) {
      case "undefined":
        this._removeAllSchemas(this.schemas)
        this._removeAllSchemas(this.refs)
        this._cache.clear()
        return this
      case "string": {
        const sch = getSchEnv.call(this, schemaKeyRef)
        if (typeof sch == "object") this._cache.delete(sch.schema)
        delete this.schemas[schemaKeyRef]
        delete this.refs[schemaKeyRef]
        return this
      }
      case "object": {
        const cacheKey = schemaKeyRef
        this._cache.delete(cacheKey)
        let id = schemaKeyRef[this.opts.schemaId]
        if (id) {
          id = normalizeId(id)
          delete this.schemas[id]
          delete this.refs[id]
        }
        return this
      }
      default:
        throw new Error("ajv.removeSchema: invalid parameter")
    }
  }

  // add "vocabulary" - a collection of keywords
  addVocabulary(definitions: Vocabulary): Ajv {
    for (const def of definitions) this.addKeyword(def)
    return this
  }

  addKeyword(
    kwdOrDef: string | KeywordDefinition,
    def?: KeywordDefinition // deprecated
  ): Ajv {
    let keyword: string | string[]
    if (typeof kwdOrDef == "string") {
      keyword = kwdOrDef
      if (typeof def == "object") {
        this.logger.warn("these parameters are deprecated, see docs for addKeyword")
        def.keyword = keyword
      }
    } else if (typeof kwdOrDef == "object" && def === undefined) {
      def = kwdOrDef
      keyword = def.keyword
      if (Array.isArray(keyword) && !keyword.length) {
        throw new Error("addKeywords: keyword must be string or non-empty array")
      }
    } else {
      throw new Error("invalid addKeywords parameters")
    }

    checkKeyword.call(this, keyword, def)
    if (!def) {
      eachItem(keyword, (kwd) => addRule.call(this, kwd))
      return this
    }
    keywordMetaschema.call(this, def)
    const definition: AddedKeywordDefinition = {
      ...def,
      type: getJSONTypes(def.type),
      schemaType: getJSONTypes(def.schemaType),
    }
    eachItem(
      keyword,
      definition.type.length === 0
        ? (k) => addRule.call(this, k, definition)
        : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))
    )
    return this
  }

  getKeyword(keyword: string): AddedKeywordDefinition | boolean {
    const rule = this.RULES.all[keyword]
    return typeof rule == "object" ? rule.definition : !!rule
  }

  // Remove keyword
  removeKeyword(keyword: string): Ajv {
    // TODO return type should be Ajv
    const {RULES} = this
    delete RULES.keywords[keyword]
    delete RULES.all[keyword]
    for (const group of RULES.rules) {
      const i = group.rules.findIndex((rule) => rule.keyword === keyword)
      if (i >= 0) group.rules.splice(i, 1)
    }
    return this
  }

  // Add format
  addFormat(name: string, format: Format): Ajv {
    if (typeof format == "string") format = new RegExp(format)
    this.formats[name] = format
    return this
  }

  errorsText(
    errors: ErrorObject[] | null | undefined = this.errors, // optional array of validation errors
    {separator = ", ", dataVar = "data"}: ErrorsTextOptions = {} // optional options with properties `separator` and `dataVar`
  ): string {
    if (!errors || errors.length === 0) return "No errors"
    return errors
      .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
      .reduce((text, msg) => text + separator + msg)
  }

  $dataMetaSchema(metaSchema: AnySchemaObject, keywordsJsonPointers: string[]): AnySchemaObject {
    const rules = this.RULES.all
    metaSchema = JSON.parse(JSON.stringify(metaSchema))
    for (const jsonPointer of keywordsJsonPointers) {
      const segments = jsonPointer.split("/").slice(1) // first segment is an empty string
      let keywords = metaSchema
      for (const seg of segments) keywords = keywords[seg] as AnySchemaObject

      for (const key in rules) {
        const rule = rules[key]
        if (typeof rule != "object") continue
        const {$data} = rule.definition
        const schema = keywords[key] as AnySchemaObject | undefined
        if ($data && schema) keywords[key] = schemaOrData(schema)
      }
    }

    return metaSchema
  }

  private _removeAllSchemas(schemas: {[Ref in string]?: SchemaEnv | string}, regex?: RegExp): void {
    for (const keyRef in schemas) {
      const sch = schemas[keyRef]
      if (!regex || regex.test(keyRef)) {
        if (typeof sch == "string") {
          delete schemas[keyRef]
        } else if (sch && !sch.meta) {
          this._cache.delete(sch.schema)
          delete schemas[keyRef]
        }
      }
    }
  }

  _addSchema(
    schema: AnySchema,
    meta?: boolean,
    baseId?: string,
    validateSchema = this.opts.validateSchema,
    addSchema = this.opts.addUsedSchema
  ): SchemaEnv {
    let id: string | undefined
    const {schemaId} = this.opts
    if (typeof schema == "object") {
      id = schema[schemaId]
    } else {
      if (this.opts.jtd) throw new Error("schema must be object")
      else if (typeof schema != "boolean") throw new Error("schema must be object or boolean")
    }
    let sch = this._cache.get(schema)
    if (sch !== undefined) return sch

    baseId = normalizeId(id || baseId)
    const localRefs = getSchemaRefs.call(this, schema, baseId)
    sch = new SchemaEnv({schema, schemaId, meta, baseId, localRefs})
    this._cache.set(sch.schema, sch)
    if (addSchema && !baseId.startsWith("#")) {
      // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
      if (baseId) this._checkUnique(baseId)
      this.refs[baseId] = sch
    }
    if (validateSchema) this.validateSchema(schema, true)
    return sch
  }

  private _checkUnique(id: string): void {
    if (this.schemas[id] || this.refs[id]) {
      throw new Error(`schema with key or id "${id}" already exists`)
    }
  }

  private _compileSchemaEnv(sch: SchemaEnv): AnyValidateFunction {
    if (sch.meta) this._compileMetaSchema(sch)
    else compileSchema.call(this, sch)

    /* istanbul ignore if */
    if (!sch.validate) throw new Error("ajv implementation error")
    return sch.validate
  }

  private _compileMetaSchema(sch: SchemaEnv): void {
    const currentOpts = this.opts
    this.opts = this._metaOpts
    try {
      compileSchema.call(this, sch)
    } finally {
      this.opts = currentOpts
    }
  }
}

export interface ErrorsTextOptions {
  separator?: string
  dataVar?: string
}

function checkOptions(
  this: Ajv,
  checkOpts: OptionsInfo<RemovedOptions | DeprecatedOptions>,
  options: Options & RemovedOptions,
  msg: string,
  log: "warn" | "error" = "error"
): void {
  for (const key in checkOpts) {
    const opt = key as keyof typeof checkOpts
    if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`)
  }
}

function getSchEnv(this: Ajv, keyRef: string): SchemaEnv | string | undefined {
  keyRef = normalizeId(keyRef) // TODO tests fail without this line
  return this.schemas[keyRef] || this.refs[keyRef]
}

function addInitialSchemas(this: Ajv): void {
  const optsSchemas = this.opts.schemas
  if (!optsSchemas) return
  if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas)
  else for (const key in optsSchemas) this.addSchema(optsSchemas[key] as AnySchema, key)
}

function addInitialFormats(this: Ajv): void {
  for (const name in this.opts.formats) {
    const format = this.opts.formats[name]
    if (format) this.addFormat(name, format)
  }
}

function addInitialKeywords(
  this: Ajv,
  defs: Vocabulary | {[K in string]?: KeywordDefinition}
): void {
  if (Array.isArray(defs)) {
    this.addVocabulary(defs)
    return
  }
  this.logger.warn("keywords option as map is deprecated, pass array")
  for (const keyword in defs) {
    const def = defs[keyword] as KeywordDefinition
    if (!def.keyword) def.keyword = keyword
    this.addKeyword(def)
  }
}

function getMetaSchemaOptions(this: Ajv): InstanceOptions {
  const metaOpts = {...this.opts}
  for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]
  return metaOpts
}

const noLogs = {log() {}, warn() {}, error() {}}

function getLogger(logger?: Partial<Logger> | false): Logger {
  if (logger === false) return noLogs
  if (logger === undefined) return console
  if (logger.log && logger.warn && logger.error) return logger as Logger
  throw new Error("logger must implement log, warn and error methods")
}

const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i

function checkKeyword(this: Ajv, keyword: string | string[], def?: KeywordDefinition): void {
  const {RULES} = this
  eachItem(keyword, (kwd) => {
    if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`)
    if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`)
  })
  if (!def) return
  if (def.$data && !("code" in def || "validate" in def)) {
    throw new Error('$data keyword must have "code" or "validate" function')
  }
}

function addRule(
  this: Ajv,
  keyword: string,
  definition?: AddedKeywordDefinition,
  dataType?: JSONType
): void {
  const post = definition?.post
  if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"')
  const {RULES} = this
  let ruleGroup = post ? RULES.post : RULES.rules.find(({type: t}) => t === dataType)
  if (!ruleGroup) {
    ruleGroup = {type: dataType, rules: []}
    RULES.rules.push(ruleGroup)
  }
  RULES.keywords[keyword] = true
  if (!definition) return

  const rule: Rule = {
    keyword,
    definition: {
      ...definition,
      type: getJSONTypes(definition.type),
      schemaType: getJSONTypes(definition.schemaType),
    },
  }
  if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before)
  else ruleGroup.rules.push(rule)
  RULES.all[keyword] = rule
  definition.implements?.forEach((kwd) => this.addKeyword(kwd))
}

function addBeforeRule(this: Ajv, ruleGroup: RuleGroup, rule: Rule, before: string): void {
  const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before)
  if (i >= 0) {
    ruleGroup.rules.splice(i, 0, rule)
  } else {
    ruleGroup.rules.push(rule)
    this.logger.warn(`rule ${before} is not defined`)
  }
}

function keywordMetaschema(this: Ajv, def: KeywordDefinition): void {
  let {metaSchema} = def
  if (metaSchema === undefined) return
  if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema)
  def.validateSchema = this.compile(metaSchema, true)
}

const $dataRef = {
  $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
}

function schemaOrData(schema: AnySchema): AnySchemaObject {
  return {anyOf: [schema, $dataRef]}
}
import type {AnySchemaObject, SchemaObject, JTDParser} from "./types"
import type {JTDSchemaType, SomeJTDSchemaType, JTDDataType} from "./types/jtd-schema"
import AjvCore, {CurrentOptions} from "./core"
import jtdVocabulary from "./vocabularies/jtd"
import jtdMetaSchema from "./refs/jtd-schema"
import compileSerializer from "./compile/jtd/serialize"
import compileParser from "./compile/jtd/parse"
import {SchemaEnv} from "./compile"

const META_SCHEMA_ID = "JTD-meta-schema"

type JTDOptions = CurrentOptions & {
  // strict mode options not supported with JTD:
  strict?: never
  allowMatchingProperties?: never
  allowUnionTypes?: never
  validateFormats?: never
  // validation and reporting options not supported with JTD:
  $data?: never
  verbose?: boolean
  $comment?: never
  formats?: never
  loadSchema?: never
  // options to modify validated data:
  useDefaults?: never
  coerceTypes?: never
  // advanced options:
  next?: never
  unevaluated?: never
  dynamicRef?: never
  meta?: boolean
  defaultMeta?: never
  inlineRefs?: boolean
  loopRequired?: never
  multipleOfPrecision?: never
}

export class Ajv extends AjvCore {
  constructor(opts: JTDOptions = {}) {
    super({
      ...opts,
      jtd: true,
    })
  }

  _addVocabularies(): void {
    super._addVocabularies()
    this.addVocabulary(jtdVocabulary)
  }

  _addDefaultMetaSchema(): void {
    super._addDefaultMetaSchema()
    if (!this.opts.meta) return
    this.addMetaSchema(jtdMetaSchema, META_SCHEMA_ID, false)
  }

  defaultMeta(): string | AnySchemaObject | undefined {
    return (this.opts.defaultMeta =
      super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))
  }

  compileSerializer<T = unknown>(schema: SchemaObject): (data: T) => string
  // Separated for type inference to work
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  compileSerializer<T = unknown>(schema: JTDSchemaType<T>): (data: T) => string
  compileSerializer<T = unknown>(schema: SchemaObject): (data: T) => string {
    const sch = this._addSchema(schema)
    return sch.serialize || this._compileSerializer(sch)
  }

  compileParser<T = unknown>(schema: SchemaObject): JTDParser<T>
  // Separated for type inference to work
  // eslint-disable-next-line @typescript-eslint/unified-signatures
  compileParser<T = unknown>(schema: JTDSchemaType<T>): JTDParser<T>
  compileParser<T = unknown>(schema: SchemaObject): JTDParser<T> {
    const sch = this._addSchema(schema)
    return (sch.parse || this._compileParser(sch)) as JTDParser<T>
  }

  private _compileSerializer<T>(sch: SchemaEnv): (data: T) => string {
    compileSerializer.call(this, sch, (sch.schema as AnySchemaObject).definitions || {})
    /* istanbul ignore if */
    if (!sch.serialize) throw new Error("ajv implementation error")
    return sch.serialize
  }

  private _compileParser(sch: SchemaEnv): JTDParser {
    compileParser.call(this, sch, (sch.schema as AnySchemaObject).definitions || {})
    /* istanbul ignore if */
    if (!sch.parse) throw new Error("ajv implementation error")
    return sch.parse
  }
}

module.exports = exports = Ajv
module.exports.Ajv = Ajv
Object.defineProperty(exports, "__esModule", {value: true})

export default Ajv

export {
  Format,
  FormatDefinition,
  AsyncFormatDefinition,
  KeywordDefinition,
  KeywordErrorDefinition,
  CodeKeywordDefinition,
  MacroKeywordDefinition,
  FuncKeywordDefinition,
  Vocabulary,
  Schema,
  SchemaObject,
  AnySchemaObject,
  AsyncSchema,
  AnySchema,
  ValidateFunction,
  AsyncValidateFunction,
  ErrorObject,
  ErrorNoParams,
  JTDParser,
} from "./types"

export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export {KeywordCxt} from "./compile/validate"
export {JTDErrorObject} from "./vocabularies/jtd"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"

export {JTDSchemaType, SomeJTDSchemaType, JTDDataType}
export {JTDOptions}
export {default as ValidationError} from "./runtime/validation_error"
export {default as MissingRefError} from "./compile/ref_error"
{
  "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
  "description": "Meta-schema for $data reference (JSON AnySchema extension proposal)",
  "type": "object",
  "required": ["$data"],
  "properties": {
    "$data": {
      "type": "string",
      "anyOf": [{"format": "relative-json-pointer"}, {"format": "json-pointer"}]
    }
  },
  "additionalProperties": false
}
import type Ajv from "../../core"
import type {AnySchemaObject} from "../../types"
import * as metaSchema from "./schema.json"
import * as applicator from "./meta/applicator.json"
import * as content from "./meta/content.json"
import * as core from "./meta/core.json"
import * as format from "./meta/format.json"
import * as metadata from "./meta/meta-data.json"
import * as validation from "./meta/validation.json"

const META_SUPPORT_DATA = ["/properties"]

export default function addMetaSchema2019(this: Ajv, $data?: boolean): Ajv {
  ;[
    metaSchema,
    applicator,
    content,
    core,
    with$data(this, format),
    metadata,
    with$data(this, validation),
  ].forEach((sch) => this.addMetaSchema(sch, undefined, false))
  return this

  function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject {
    return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/applicator",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/applicator": true
  },
  "$recursiveAnchor": true,

  "title": "Applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "additionalItems": {"$recursiveRef": "#"},
    "unevaluatedItems": {"$recursiveRef": "#"},
    "items": {
      "anyOf": [{"$recursiveRef": "#"}, {"$ref": "#/$defs/schemaArray"}]
    },
    "contains": {"$recursiveRef": "#"},
    "additionalProperties": {"$recursiveRef": "#"},
    "unevaluatedProperties": {"$recursiveRef": "#"},
    "properties": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependentSchemas": {
      "type": "object",
      "additionalProperties": {
        "$recursiveRef": "#"
      }
    },
    "propertyNames": {"$recursiveRef": "#"},
    "if": {"$recursiveRef": "#"},
    "then": {"$recursiveRef": "#"},
    "else": {"$recursiveRef": "#"},
    "allOf": {"$ref": "#/$defs/schemaArray"},
    "anyOf": {"$ref": "#/$defs/schemaArray"},
    "oneOf": {"$ref": "#/$defs/schemaArray"},
    "not": {"$recursiveRef": "#"}
  },
  "$defs": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$recursiveRef": "#"}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/content",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/content": true
  },
  "$recursiveAnchor": true,

  "title": "Content vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "contentMediaType": {"type": "string"},
    "contentEncoding": {"type": "string"},
    "contentSchema": {"$recursiveRef": "#"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/core",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/core": true
  },
  "$recursiveAnchor": true,

  "title": "Core vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference",
      "$comment": "Non-empty fragments not allowed.",
      "pattern": "^[^#]*#?$"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$anchor": {
      "type": "string",
      "pattern": "^[A-Za-z][-A-Za-z0-9.:_]*$"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "$recursiveRef": {
      "type": "string",
      "format": "uri-reference"
    },
    "$recursiveAnchor": {
      "type": "boolean",
      "default": false
    },
    "$vocabulary": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "format": "uri"
      },
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "$comment": {
      "type": "string"
    },
    "$defs": {
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/format",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/format": true
  },
  "$recursiveAnchor": true,

  "title": "Format vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "format": {"type": "string"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/meta-data",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/meta-data": true
  },
  "$recursiveAnchor": true,

  "title": "Meta-data vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "deprecated": {
      "type": "boolean",
      "default": false
    },
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "writeOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/meta/validation",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/validation": true
  },
  "$recursiveAnchor": true,

  "title": "Validation vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/$defs/nonNegativeInteger"},
    "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "maxItems": {"$ref": "#/$defs/nonNegativeInteger"},
    "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "maxContains": {"$ref": "#/$defs/nonNegativeInteger"},
    "minContains": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 1
    },
    "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"},
    "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/$defs/stringArray"},
    "dependentRequired": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/stringArray"
      }
    },
    "const": true,
    "enum": {
      "type": "array",
      "items": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/$defs/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/$defs/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    }
  },
  "$defs": {
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 0
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "https://json-schema.org/draft/2019-09/schema",
  "$vocabulary": {
    "https://json-schema.org/draft/2019-09/vocab/core": true,
    "https://json-schema.org/draft/2019-09/vocab/applicator": true,
    "https://json-schema.org/draft/2019-09/vocab/validation": true,
    "https://json-schema.org/draft/2019-09/vocab/meta-data": true,
    "https://json-schema.org/draft/2019-09/vocab/format": false,
    "https://json-schema.org/draft/2019-09/vocab/content": true
  },
  "$recursiveAnchor": true,

  "title": "Core and Validation specifications meta-schema",
  "allOf": [
    {"$ref": "meta/core"},
    {"$ref": "meta/applicator"},
    {"$ref": "meta/validation"},
    {"$ref": "meta/meta-data"},
    {"$ref": "meta/format"},
    {"$ref": "meta/content"}
  ],
  "type": ["object", "boolean"],
  "properties": {
    "definitions": {
      "$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
      "type": "object",
      "additionalProperties": {"$recursiveRef": "#"},
      "default": {}
    },
    "dependencies": {
      "$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"",
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$recursiveRef": "#"}, {"$ref": "meta/validation#/$defs/stringArray"}]
      }
    }
  }
}
import type Ajv from "../../core"
import type {AnySchemaObject} from "../../types"
import * as metaSchema from "./schema.json"
import * as applicator from "./meta/applicator.json"
import * as unevaluated from "./meta/unevaluated.json"
import * as content from "./meta/content.json"
import * as core from "./meta/core.json"
import * as format from "./meta/format-annotation.json"
import * as metadata from "./meta/meta-data.json"
import * as validation from "./meta/validation.json"

const META_SUPPORT_DATA = ["/properties"]

export default function addMetaSchema2020(this: Ajv, $data?: boolean): Ajv {
  ;[
    metaSchema,
    applicator,
    unevaluated,
    content,
    core,
    with$data(this, format),
    metadata,
    with$data(this, validation),
  ].forEach((sch) => this.addMetaSchema(sch, undefined, false))
  return this

  function with$data(ajv: Ajv, sch: AnySchemaObject): AnySchemaObject {
    return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/applicator",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/applicator": true
  },
  "$dynamicAnchor": "meta",

  "title": "Applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "prefixItems": {"$ref": "#/$defs/schemaArray"},
    "items": {"$dynamicRef": "#meta"},
    "contains": {"$dynamicRef": "#meta"},
    "additionalProperties": {"$dynamicRef": "#meta"},
    "properties": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependentSchemas": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "default": {}
    },
    "propertyNames": {"$dynamicRef": "#meta"},
    "if": {"$dynamicRef": "#meta"},
    "then": {"$dynamicRef": "#meta"},
    "else": {"$dynamicRef": "#meta"},
    "allOf": {"$ref": "#/$defs/schemaArray"},
    "anyOf": {"$ref": "#/$defs/schemaArray"},
    "oneOf": {"$ref": "#/$defs/schemaArray"},
    "not": {"$dynamicRef": "#meta"}
  },
  "$defs": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$dynamicRef": "#meta"}
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/content",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/content": true
  },
  "$dynamicAnchor": "meta",

  "title": "Content vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "contentEncoding": {"type": "string"},
    "contentMediaType": {"type": "string"},
    "contentSchema": {"$dynamicRef": "#meta"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/core",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/core": true
  },
  "$dynamicAnchor": "meta",

  "title": "Core vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "$ref": "#/$defs/uriReferenceString",
      "$comment": "Non-empty fragments not allowed.",
      "pattern": "^[^#]*#?$"
    },
    "$schema": {"$ref": "#/$defs/uriString"},
    "$ref": {"$ref": "#/$defs/uriReferenceString"},
    "$anchor": {"$ref": "#/$defs/anchorString"},
    "$dynamicRef": {"$ref": "#/$defs/uriReferenceString"},
    "$dynamicAnchor": {"$ref": "#/$defs/anchorString"},
    "$vocabulary": {
      "type": "object",
      "propertyNames": {"$ref": "#/$defs/uriString"},
      "additionalProperties": {
        "type": "boolean"
      }
    },
    "$comment": {
      "type": "string"
    },
    "$defs": {
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"}
    }
  },
  "$defs": {
    "anchorString": {
      "type": "string",
      "pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
    },
    "uriString": {
      "type": "string",
      "format": "uri"
    },
    "uriReferenceString": {
      "type": "string",
      "format": "uri-reference"
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/format-annotation": true
  },
  "$dynamicAnchor": "meta",

  "title": "Format vocabulary meta-schema for annotation results",
  "type": ["object", "boolean"],
  "properties": {
    "format": {"type": "string"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/meta-data": true
  },
  "$dynamicAnchor": "meta",

  "title": "Meta-data vocabulary meta-schema",

  "type": ["object", "boolean"],
  "properties": {
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "deprecated": {
      "type": "boolean",
      "default": false
    },
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "writeOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/unevaluated": true
  },
  "$dynamicAnchor": "meta",

  "title": "Unevaluated applicator vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "unevaluatedItems": {"$dynamicRef": "#meta"},
    "unevaluatedProperties": {"$dynamicRef": "#meta"}
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/meta/validation",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/validation": true
  },
  "$dynamicAnchor": "meta",

  "title": "Validation vocabulary meta-schema",
  "type": ["object", "boolean"],
  "properties": {
    "type": {
      "anyOf": [
        {"$ref": "#/$defs/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/$defs/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "const": true,
    "enum": {
      "type": "array",
      "items": true
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/$defs/nonNegativeInteger"},
    "minLength": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "maxItems": {"$ref": "#/$defs/nonNegativeInteger"},
    "minItems": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "maxContains": {"$ref": "#/$defs/nonNegativeInteger"},
    "minContains": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 1
    },
    "maxProperties": {"$ref": "#/$defs/nonNegativeInteger"},
    "minProperties": {"$ref": "#/$defs/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/$defs/stringArray"},
    "dependentRequired": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/stringArray"
      }
    }
  },
  "$defs": {
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "$ref": "#/$defs/nonNegativeInteger",
      "default": 0
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  }
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://json-schema.org/draft/2020-12/schema",
  "$vocabulary": {
    "https://json-schema.org/draft/2020-12/vocab/core": true,
    "https://json-schema.org/draft/2020-12/vocab/applicator": true,
    "https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
    "https://json-schema.org/draft/2020-12/vocab/validation": true,
    "https://json-schema.org/draft/2020-12/vocab/meta-data": true,
    "https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
    "https://json-schema.org/draft/2020-12/vocab/content": true
  },
  "$dynamicAnchor": "meta",

  "title": "Core and Validation specifications meta-schema",
  "allOf": [
    {"$ref": "meta/core"},
    {"$ref": "meta/applicator"},
    {"$ref": "meta/unevaluated"},
    {"$ref": "meta/validation"},
    {"$ref": "meta/meta-data"},
    {"$ref": "meta/format-annotation"},
    {"$ref": "meta/content"}
  ],
  "type": ["object", "boolean"],
  "$comment": "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",
  "properties": {
    "definitions": {
      "$comment": "\"definitions\" has been replaced by \"$defs\".",
      "type": "object",
      "additionalProperties": {"$dynamicRef": "#meta"},
      "deprecated": true,
      "default": {}
    },
    "dependencies": {
      "$comment": "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$dynamicRef": "#meta"}, {"$ref": "meta/validation#/$defs/stringArray"}]
      },
      "deprecated": true,
      "default": {}
    },
    "$recursiveAnchor": {
      "$comment": "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
      "$ref": "meta/core#/$defs/anchorString",
      "deprecated": true
    },
    "$recursiveRef": {
      "$comment": "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
      "$ref": "meta/core#/$defs/uriReferenceString",
      "deprecated": true
    }
  }
}
{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "$id": "http://json-schema.org/draft-06/schema#",
  "title": "Core schema meta-schema",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    },
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  },
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": {},
    "examples": {
      "type": "array",
      "items": {}
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
    "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "additionalItems": {"$ref": "#"},
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
      "default": {}
    },
    "maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
    "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "contains": {"$ref": "#"},
    "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
    "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/definitions/stringArray"},
    "additionalProperties": {"$ref": "#"},
    "definitions": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "properties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
      }
    },
    "propertyNames": {"$ref": "#"},
    "const": {},
    "enum": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/definitions/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/definitions/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "format": {"type": "string"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"}
  },
  "default": {}
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://json-schema.org/draft-07/schema#",
  "title": "Core schema meta-schema",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    },
    "nonNegativeInteger": {
      "type": "integer",
      "minimum": 0
    },
    "nonNegativeIntegerDefault0": {
      "allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
    },
    "simpleTypes": {
      "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
    },
    "stringArray": {
      "type": "array",
      "items": {"type": "string"},
      "uniqueItems": true,
      "default": []
    }
  },
  "type": ["object", "boolean"],
  "properties": {
    "$id": {
      "type": "string",
      "format": "uri-reference"
    },
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "$ref": {
      "type": "string",
      "format": "uri-reference"
    },
    "$comment": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": true,
    "readOnly": {
      "type": "boolean",
      "default": false
    },
    "examples": {
      "type": "array",
      "items": true
    },
    "multipleOf": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "maximum": {
      "type": "number"
    },
    "exclusiveMaximum": {
      "type": "number"
    },
    "minimum": {
      "type": "number"
    },
    "exclusiveMinimum": {
      "type": "number"
    },
    "maxLength": {"$ref": "#/definitions/nonNegativeInteger"},
    "minLength": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "pattern": {
      "type": "string",
      "format": "regex"
    },
    "additionalItems": {"$ref": "#"},
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}],
      "default": true
    },
    "maxItems": {"$ref": "#/definitions/nonNegativeInteger"},
    "minItems": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "uniqueItems": {
      "type": "boolean",
      "default": false
    },
    "contains": {"$ref": "#"},
    "maxProperties": {"$ref": "#/definitions/nonNegativeInteger"},
    "minProperties": {"$ref": "#/definitions/nonNegativeIntegerDefault0"},
    "required": {"$ref": "#/definitions/stringArray"},
    "additionalProperties": {"$ref": "#"},
    "definitions": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "properties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "default": {}
    },
    "patternProperties": {
      "type": "object",
      "additionalProperties": {"$ref": "#"},
      "propertyNames": {"format": "regex"},
      "default": {}
    },
    "dependencies": {
      "type": "object",
      "additionalProperties": {
        "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/stringArray"}]
      }
    },
    "propertyNames": {"$ref": "#"},
    "const": true,
    "enum": {
      "type": "array",
      "items": true,
      "minItems": 1,
      "uniqueItems": true
    },
    "type": {
      "anyOf": [
        {"$ref": "#/definitions/simpleTypes"},
        {
          "type": "array",
          "items": {"$ref": "#/definitions/simpleTypes"},
          "minItems": 1,
          "uniqueItems": true
        }
      ]
    },
    "format": {"type": "string"},
    "contentMediaType": {"type": "string"},
    "contentEncoding": {"type": "string"},
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"}
  },
  "default": true
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
  "title": "Meta-schema for the security assessment of JSON Schemas",
  "description": "If a JSON AnySchema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    }
  },
  "dependencies": {
    "patternProperties": {
      "description": "prevent slow validation of large property names",
      "required": ["propertyNames"],
      "properties": {
        "propertyNames": {
          "required": ["maxLength"]
        }
      }
    },
    "uniqueItems": {
      "description": "prevent slow validation of large non-scalar arrays",
      "if": {
        "properties": {
          "uniqueItems": {"const": true},
          "items": {
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "enum": ["object", "array"]
                  },
                  {
                    "type": "array",
                    "contains": {"enum": ["object", "array"]}
                  }
                ]
              }
            }
          }
        }
      },
      "then": {
        "required": ["maxItems"]
      }
    },
    "pattern": {
      "description": "prevent slow pattern matching of large strings",
      "required": ["maxLength"]
    },
    "format": {
      "description": "prevent slow format validation of large strings",
      "required": ["maxLength"]
    }
  },
  "properties": {
    "additionalItems": {"$ref": "#"},
    "additionalProperties": {"$ref": "#"},
    "dependencies": {
      "additionalProperties": {
        "anyOf": [{"type": "array"}, {"$ref": "#"}]
      }
    },
    "items": {
      "anyOf": [{"$ref": "#"}, {"$ref": "#/definitions/schemaArray"}]
    },
    "definitions": {
      "additionalProperties": {"$ref": "#"}
    },
    "patternProperties": {
      "additionalProperties": {"$ref": "#"}
    },
    "properties": {
      "additionalProperties": {"$ref": "#"}
    },
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"},
    "contains": {"$ref": "#"},
    "propertyNames": {"$ref": "#"}
  }
}
import {SchemaObject} from "../types"

type MetaSchema = (root: boolean) => SchemaObject

const shared: MetaSchema = (root) => {
  const sch: SchemaObject = {
    nullable: {type: "boolean"},
    metadata: {
      optionalProperties: {
        union: {elements: {ref: "schema"}},
      },
      additionalProperties: true,
    },
  }
  if (root) sch.definitions = {values: {ref: "schema"}}
  return sch
}

const emptyForm: MetaSchema = (root) => ({
  optionalProperties: shared(root),
})

const refForm: MetaSchema = (root) => ({
  properties: {
    ref: {type: "string"},
  },
  optionalProperties: shared(root),
})

const typeForm: MetaSchema = (root) => ({
  properties: {
    type: {
      enum: [
        "boolean",
        "timestamp",
        "string",
        "float32",
        "float64",
        "int8",
        "uint8",
        "int16",
        "uint16",
        "int32",
        "uint32",
      ],
    },
  },
  optionalProperties: shared(root),
})

const enumForm: MetaSchema = (root) => ({
  properties: {
    enum: {elements: {type: "string"}},
  },
  optionalProperties: shared(root),
})

const elementsForm: MetaSchema = (root) => ({
  properties: {
    elements: {ref: "schema"},
  },
  optionalProperties: shared(root),
})

const propertiesForm: MetaSchema = (root) => ({
  properties: {
    properties: {values: {ref: "schema"}},
  },
  optionalProperties: {
    optionalProperties: {values: {ref: "schema"}},
    additionalProperties: {type: "boolean"},
    ...shared(root),
  },
})

const optionalPropertiesForm: MetaSchema = (root) => ({
  properties: {
    optionalProperties: {values: {ref: "schema"}},
  },
  optionalProperties: {
    additionalProperties: {type: "boolean"},
    ...shared(root),
  },
})

const discriminatorForm: MetaSchema = (root) => ({
  properties: {
    discriminator: {type: "string"},
    mapping: {
      values: {
        metadata: {
          union: [propertiesForm(false), optionalPropertiesForm(false)],
        },
      },
    },
  },
  optionalProperties: shared(root),
})

const valuesForm: MetaSchema = (root) => ({
  properties: {
    values: {ref: "schema"},
  },
  optionalProperties: shared(root),
})

const schema: MetaSchema = (root) => ({
  metadata: {
    union: [
      emptyForm,
      refForm,
      typeForm,
      enumForm,
      elementsForm,
      propertiesForm,
      optionalPropertiesForm,
      discriminatorForm,
      valuesForm,
    ].map((s) => s(root)),
  },
})

const jtdMetaSchema: SchemaObject = {
  definitions: {
    schema: schema(false),
  },
  ...schema(true),
}

export default jtdMetaSchema
// https://github.com/ajv-validator/ajv/issues/889
import * as equal from "fast-deep-equal"

type Equal = typeof equal & {code: string}
;(equal as Equal).code = 'require("ajv/dist/runtime/equal").default'

export default equal as Equal
const rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/

export function parseJson(s: string, pos: number): unknown {
  let endPos: number | undefined
  parseJson.message = undefined
  let matches: RegExpExecArray | null
  if (pos) s = s.slice(pos)
  try {
    parseJson.position = pos + s.length
    return JSON.parse(s)
  } catch (e) {
    matches = rxParseJson.exec((e as Error).message)
    if (!matches) {
      parseJson.message = "unexpected end"
      return undefined
    }
    endPos = +matches[1]
    const c = s[endPos]
    s = s.slice(0, endPos)
    parseJson.position = pos + endPos
    try {
      return JSON.parse(s)
    } catch (e1) {
      parseJson.message = `unexpected token ${c}`
      return undefined
    }
  }
}

parseJson.message = undefined as string | undefined
parseJson.position = 0 as number
parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'

export function parseJsonNumber(s: string, pos: number, maxDigits?: number): number | undefined {
  let numStr = ""
  let c: string
  parseJsonNumber.message = undefined
  if (s[pos] === "-") {
    numStr += "-"
    pos++
  }
  if (s[pos] === "0") {
    numStr += "0"
    pos++
  } else {
    if (!parseDigits(maxDigits)) {
      errorMessage()
      return undefined
    }
  }
  if (maxDigits) {
    parseJsonNumber.position = pos
    return +numStr
  }
  if (s[pos] === ".") {
    numStr += "."
    pos++
    if (!parseDigits()) {
      errorMessage()
      return undefined
    }
  }
  if (((c = s[pos]), c === "e" || c === "E")) {
    numStr += "e"
    pos++
    if (((c = s[pos]), c === "+" || c === "-")) {
      numStr += c
      pos++
    }
    if (!parseDigits()) {
      errorMessage()
      return undefined
    }
  }
  parseJsonNumber.position = pos
  return +numStr

  function parseDigits(maxLen?: number): boolean {
    let digit = false
    while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) {
      digit = true
      numStr += c
      pos++
    }
    return digit
  }

  function errorMessage(): void {
    parseJsonNumber.position = pos
    parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"
  }
}

parseJsonNumber.message = undefined as string | undefined
parseJsonNumber.position = 0 as number
parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'

const escapedChars: {[X in string]?: string} = {
  b: "\b",
  f: "\f",
  n: "\n",
  r: "\r",
  t: "\t",
  '"': '"',
  "/": "/",
  "\\": "\\",
}

const CODE_A: number = "a".charCodeAt(0)
const CODE_0: number = "0".charCodeAt(0)

export function parseJsonString(s: string, pos: number): string | undefined {
  let str = ""
  let c: string | undefined
  parseJsonString.message = undefined
  // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
  while (true) {
    c = s[pos++]
    if (c === '"') break
    if (c === "\\") {
      c = s[pos]
      if (c in escapedChars) {
        str += escapedChars[c]
        pos++
      } else if (c === "u") {
        pos++
        let count = 4
        let code = 0
        while (count--) {
          code <<= 4
          c = s[pos]
          // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
          if (c === undefined) {
            errorMessage("unexpected end")
            return undefined
          }
          c = c.toLowerCase()
          if (c >= "a" && c <= "f") {
            code += c.charCodeAt(0) - CODE_A + 10
          } else if (c >= "0" && c <= "9") {
            code += c.charCodeAt(0) - CODE_0
          } else {
            errorMessage(`unexpected token ${c}`)
            return undefined
          }
          pos++
        }
        str += String.fromCharCode(code)
      } else {
        errorMessage(`unexpected token ${c}`)
        return undefined
      }
      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
    } else if (c === undefined) {
      errorMessage("unexpected end")
      return undefined
    } else {
      if (c.charCodeAt(0) >= 0x20) {
        str += c
      } else {
        errorMessage(`unexpected token ${c}`)
        return undefined
      }
    }
  }
  parseJsonString.position = pos
  return str

  function errorMessage(msg: string): void {
    parseJsonString.position = pos
    parseJsonString.message = msg
  }
}

parseJsonString.message = undefined as string | undefined
parseJsonString.position = 0 as number
parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'
const rxEscapable =
  // eslint-disable-next-line no-control-regex, no-misleading-character-class
  /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g

const escaped: {[K in string]?: string} = {
  "\b": "\\b",
  "\t": "\\t",
  "\n": "\\n",
  "\f": "\\f",
  "\r": "\\r",
  '"': '\\"',
  "\\": "\\\\",
}

export default function quote(s: string): string {
  rxEscapable.lastIndex = 0
  return (
    '"' +
    (rxEscapable.test(s)
      ? s.replace(rxEscapable, (a) => {
          const c = escaped[a]
          return typeof c === "string"
            ? c
            : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
        })
      : s) +
    '"'
  )
}

quote.code = 'require("ajv/dist/runtime/quote").default'
import * as re2 from "re2"

type Re2 = typeof re2 & {code: string}
;(re2 as Re2).code = 'require("ajv/dist/runtime/re2").default'

export default re2 as Re2
const DT_SEPARATOR = /t|\s/i
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/
const TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

export default function validTimestamp(str: string, allowDate: boolean): boolean {
  // http://tools.ietf.org/html/rfc3339#section-5.6
  const dt: string[] = str.split(DT_SEPARATOR)
  return (
    (dt.length === 2 && validDate(dt[0]) && validTime(dt[1])) ||
    (allowDate && dt.length === 1 && validDate(dt[0]))
  )
}

function validDate(str: string): boolean {
  const matches: string[] | null = DATE.exec(str)
  if (!matches) return false
  const y: number = +matches[1]
  const m: number = +matches[2]
  const d: number = +matches[3]
  return (
    m >= 1 &&
    m <= 12 &&
    d >= 1 &&
    (d <= DAYS[m] ||
      // leap year: https://tools.ietf.org/html/rfc3339#appendix-C
      (m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)))
  )
}

function validTime(str: string): boolean {
  const matches: string[] | null = TIME.exec(str)
  if (!matches) return false
  const hr: number = +matches[1]
  const min: number = +matches[2]
  const sec: number = +matches[3]
  const tzH: number = +(matches[4] || 0)
  const tzM: number = +(matches[5] || 0)
  return (
    (hr <= 23 && min <= 59 && sec <= 59) ||
    // leap second
    (hr - tzH === 23 && min - tzM === 59 && sec === 60)
  )
}

validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'
// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
export default function ucs2length(str: string): number {
  const len = str.length
  let length = 0
  let pos = 0
  let value: number
  while (pos < len) {
    length++
    value = str.charCodeAt(pos++)
    if (value >= 0xd800 && value <= 0xdbff && pos < len) {
      // high surrogate, and there is a next character
      value = str.charCodeAt(pos)
      if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate
    }
  }
  return length
}

ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'
import * as uri from "fast-uri"

type URI = typeof uri & {code: string}
;(uri as URI).code = 'require("ajv/dist/runtime/uri").default'

export default uri as URI
import type {ErrorObject} from "../types"

export default class ValidationError extends Error {
  readonly errors: Partial<ErrorObject>[]
  readonly ajv: true
  readonly validation: true

  constructor(errors: Partial<ErrorObject>[]) {
    super("validation failed")
    this.errors = errors
    this.ajv = this.validation = true
  }
}
import type AjvCore from "../core"
import type {AnyValidateFunction, SourceCode} from "../types"
import type {SchemaEnv} from "../compile"
import {UsedScopeValues, UsedValueState, ValueScopeName, varKinds} from "../compile/codegen/scope"
import {_, nil, _Code, Code, getProperty, getEsmExportName} from "../compile/codegen/code"

function standaloneCode(
  ajv: AjvCore,
  refsOrFunc?: {[K in string]?: string} | AnyValidateFunction
): string {
  if (!ajv.opts.code.source) {
    throw new Error("moduleCode: ajv instance must have code.source option")
  }
  const {_n} = ajv.scope.opts
  return typeof refsOrFunc == "function"
    ? funcExportCode(refsOrFunc.source)
    : refsOrFunc !== undefined
    ? multiExportsCode<string>(refsOrFunc, getValidate)
    : multiExportsCode<SchemaEnv>(ajv.schemas, (sch) =>
        sch.meta ? undefined : ajv.compile(sch.schema)
      )

  function getValidate(id: string): AnyValidateFunction {
    const v = ajv.getSchema(id)
    if (!v) throw new Error(`moduleCode: no schema with id ${id}`)
    return v
  }

  function funcExportCode(source?: SourceCode): string {
    const usedValues: UsedScopeValues = {}
    const n = source?.validateName
    const vCode = validateCode(usedValues, source)
    if (ajv.opts.code.esm) {
      // Always do named export as `validate` rather than the variable `n` which is `validateXX` for known export value
      return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`
    }
    return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`
  }

  function multiExportsCode<T extends SchemaEnv | string>(
    schemas: {[K in string]?: T},
    getValidateFunc: (schOrId: T) => AnyValidateFunction | undefined
  ): string {
    const usedValues: UsedScopeValues = {}
    let code = _`"use strict";`
    for (const name in schemas) {
      const v = getValidateFunc(schemas[name] as T)
      if (v) {
        const vCode = validateCode(usedValues, v.source)
        const exportSyntax = ajv.opts.code.esm
          ? _`export const ${getEsmExportName(name)}`
          : _`exports${getProperty(name)}`
        code = _`${code}${_n}${exportSyntax} = ${v.source?.validateName};${_n}${vCode}`
      }
    }
    return `${code}`
  }

  function validateCode(usedValues: UsedScopeValues, s?: SourceCode): Code {
    if (!s) throw new Error('moduleCode: function does not have "source" property')
    if (usedState(s.validateName) === UsedValueState.Completed) return nil
    setUsedState(s.validateName, UsedValueState.Started)

    const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode)
    const code = new _Code(`${scopeCode}${_n}${s.validateCode}`)
    return s.evaluated ? _`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code

    function refValidateCode(n: ValueScopeName): Code | undefined {
      const vRef = n.value?.ref
      if (n.prefix === "validate" && typeof vRef == "function") {
        const v = vRef as AnyValidateFunction
        return validateCode(usedValues, v.source)
      } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") {
        const {validate, validateName} = vRef as SchemaEnv
        if (!validateName) throw new Error("ajv internal error")
        const def = ajv.opts.code.es5 ? varKinds.var : varKinds.const
        const wrapper = _`${def} ${n} = {validate: ${validateName}};`
        if (usedState(validateName) === UsedValueState.Started) return wrapper
        const vCode = validateCode(usedValues, validate?.source)
        return _`${wrapper}${_n}${vCode}`
      }
      return undefined
    }

    function usedState(name: ValueScopeName): UsedValueState | undefined {
      return usedValues[name.prefix]?.get(name)
    }

    function setUsedState(name: ValueScopeName, state: UsedValueState): void {
      const {prefix} = name
      const names = (usedValues[prefix] = usedValues[prefix] || new Map())
      names.set(name, state)
    }
  }
}

module.exports = exports = standaloneCode
Object.defineProperty(exports, "__esModule", {value: true})

export default standaloneCode
import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core"
import standaloneCode from "."
import * as requireFromString from "require-from-string"

export default class AjvPack {
  errors?: ErrorObject[] | null // errors from the last validation
  constructor(readonly ajv: Ajv) {}

  validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown> {
    return Ajv.prototype.validate.call(this, schemaKeyRef, data)
  }

  compile<T = unknown>(schema: AnySchema, meta?: boolean): AnyValidateFunction<T> {
    return this.getStandalone(this.ajv.compile<T>(schema, meta))
  }

  getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {
    const v = this.ajv.getSchema<T>(keyRef)
    if (!v) return undefined
    return this.getStandalone(v)
  }

  private getStandalone<T = unknown>(v: AnyValidateFunction<T>): AnyValidateFunction<T> {
    return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction<T>
  }

  addSchema(...args: Parameters<typeof Ajv.prototype.addSchema>): AjvPack {
    this.ajv.addSchema.call(this.ajv, ...args)
    return this
  }

  addKeyword(...args: Parameters<typeof Ajv.prototype.addKeyword>): AjvPack {
    this.ajv.addKeyword.call(this.ajv, ...args)
    return this
  }
}
import {URIComponent} from "fast-uri"
import type {CodeGen, Code, Name, ScopeValueSets, ValueScopeName} from "../compile/codegen"
import type {SchemaEnv, SchemaCxt, SchemaObjCxt} from "../compile"
import type {JSONType} from "../compile/rules"
import type {KeywordCxt} from "../compile/validate"
import type Ajv from "../core"

interface _SchemaObject {
  id?: string
  $id?: string
  $schema?: string
  [x: string]: any // TODO
}

export interface SchemaObject extends _SchemaObject {
  id?: string
  $id?: string
  $schema?: string
  $async?: false
  [x: string]: any // TODO
}

export interface AsyncSchema extends _SchemaObject {
  $async: true
}

export type AnySchemaObject = SchemaObject | AsyncSchema

export type Schema = SchemaObject | boolean

export type AnySchema = Schema | AsyncSchema

export type SchemaMap = {[Key in string]?: AnySchema}

export interface SourceCode {
  validateName: ValueScopeName
  validateCode: string
  scopeValues: ScopeValueSets
  evaluated?: Code
}

export interface DataValidationCxt<T extends string | number = string | number> {
  instancePath: string
  parentData: {[K in T]: any} // object or array
  parentDataProperty: T // string or number
  rootData: Record<string, any> | any[]
  dynamicAnchors: {[Ref in string]?: ValidateFunction}
}

export interface ValidateFunction<T = unknown> {
  // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
  (this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T
  errors?: null | ErrorObject[]
  evaluated?: Evaluated
  schema: AnySchema
  schemaEnv: SchemaEnv
  source?: SourceCode
}

export interface JTDParser<T = unknown> {
  (json: string): T | undefined
  message?: string
  position?: number
}

export type EvaluatedProperties = {[K in string]?: true} | true

export type EvaluatedItems = number | true

export interface Evaluated {
  // determined at compile time if staticProps/Items is true
  props?: EvaluatedProperties
  items?: EvaluatedItems
  // whether props/items determined at compile time
  dynamicProps: boolean
  dynamicItems: boolean
}

export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
  (...args: Parameters<ValidateFunction<T>>): Promise<T>
  $async: true
}

export type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>

export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
  keyword: K
  instancePath: string
  schemaPath: string
  params: P
  // Added to validation errors of "propertyNames" keyword schema
  propertyName?: string
  // Excluded if option `messages` set to false.
  message?: string
  // These are added with the `verbose` option.
  schema?: S
  parentSchema?: AnySchemaObject
  data?: unknown
}

export type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>

interface _KeywordDef {
  keyword: string | string[]
  type?: JSONType | JSONType[] // data types that keyword applies to
  schemaType?: JSONType | JSONType[] // allowed type(s) of keyword value in the schema
  allowUndefined?: boolean // used for keywords that can be invoked by other keywords, not being present in the schema
  $data?: boolean // keyword supports [$data reference](../../docs/guide/combining-schemas.md#data-reference)
  implements?: string[] // other schema keywords that this keyword implements
  before?: string // keyword should be executed before this keyword (should be applicable to the same type)
  post?: boolean // keyword should be executed after other keywords without post flag
  metaSchema?: AnySchemaObject // meta-schema for keyword schema value - it is better to use schemaType where applicable
  validateSchema?: AnyValidateFunction // compiled keyword metaSchema - should not be passed
  dependencies?: string[] // keywords that must be present in the same schema
  error?: KeywordErrorDefinition
  $dataError?: KeywordErrorDefinition
}

export interface CodeKeywordDefinition extends _KeywordDef {
  code: (cxt: KeywordCxt, ruleType?: string) => void
  trackErrors?: boolean
}

export type MacroKeywordFunc = (
  schema: any,
  parentSchema: AnySchemaObject,
  it: SchemaCxt
) => AnySchema

export type CompileKeywordFunc = (
  schema: any,
  parentSchema: AnySchemaObject,
  it: SchemaObjCxt
) => DataValidateFunction

export interface DataValidateFunction {
  (...args: Parameters<ValidateFunction>): boolean | Promise<any>
  errors?: Partial<ErrorObject>[]
}

export interface SchemaValidateFunction {
  (
    schema: any,
    data: any,
    parentSchema?: AnySchemaObject,
    dataCxt?: DataValidationCxt
  ): boolean | Promise<any>
  errors?: Partial<ErrorObject>[]
}

export interface FuncKeywordDefinition extends _KeywordDef {
  validate?: SchemaValidateFunction | DataValidateFunction
  compile?: CompileKeywordFunc
  // schema: false makes validate not to expect schema (DataValidateFunction)
  schema?: boolean // requires "validate"
  modifying?: boolean
  async?: boolean
  valid?: boolean
  errors?: boolean | "full"
}

export interface MacroKeywordDefinition extends FuncKeywordDefinition {
  macro: MacroKeywordFunc
}

export type KeywordDefinition =
  | CodeKeywordDefinition
  | FuncKeywordDefinition
  | MacroKeywordDefinition

export type AddedKeywordDefinition = KeywordDefinition & {
  type: JSONType[]
  schemaType: JSONType[]
}

export interface KeywordErrorDefinition {
  message: string | Code | ((cxt: KeywordErrorCxt) => string | Code)
  params?: Code | ((cxt: KeywordErrorCxt) => Code)
}

export type Vocabulary = (KeywordDefinition | string)[]

export interface KeywordErrorCxt {
  gen: CodeGen
  keyword: string
  data: Name
  $data?: string | false
  schema: any // TODO
  parentSchema?: AnySchemaObject
  schemaCode: Code | number | boolean
  schemaValue: Code | number | boolean
  schemaType?: JSONType[]
  errsCount?: Name
  params: KeywordCxtParams
  it: SchemaCxt
}

export type KeywordCxtParams = {[P in string]?: Code | string | number}

export type FormatValidator<T extends string | number> = (data: T) => boolean

export type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined

export type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>

export interface FormatDefinition<T extends string | number> {
  type?: T extends string ? "string" | undefined : "number"
  validate: FormatValidator<T> | (T extends string ? string | RegExp : never)
  async?: false | undefined
  compare?: FormatCompare<T>
}

export interface AsyncFormatDefinition<T extends string | number> {
  type?: T extends string ? "string" | undefined : "number"
  validate: AsyncFormatValidator<T>
  async: true
  compare?: FormatCompare<T>
}

export type AddedFormat =
  | true
  | RegExp
  | FormatValidator<string>
  | FormatDefinition<string>
  | FormatDefinition<number>
  | AsyncFormatDefinition<string>
  | AsyncFormatDefinition<number>

export type Format = AddedFormat | string

export interface RegExpEngine {
  (pattern: string, u: string): RegExpLike
  code: string
}

export interface RegExpLike {
  test: (s: string) => boolean
}

export interface UriResolver {
  parse(uri: string): URIComponent
  resolve(base: string, path: string): string
  serialize(component: URIComponent): string
}
/* eslint-disable @typescript-eslint/no-empty-interface */
type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null
  ? `strictNullChecks must be true in tsconfig to use ${Name}`
  : Type

type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void
  ? I
  : never

export type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>

type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>

export type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>

type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true
  ? T | undefined
  : T

interface NumberKeywords {
  minimum?: number
  maximum?: number
  exclusiveMinimum?: number
  exclusiveMaximum?: number
  multipleOf?: number
  format?: string
}

interface StringKeywords {
  minLength?: number
  maxLength?: number
  pattern?: string
  format?: string
}

type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (
  | // these two unions allow arbitrary unions of types
  {
      anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[]
    }
  | {
      oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[]
    }
  // this union allows for { type: (primitive)[] } style schemas
  | ({
      type: readonly (T extends number
        ? JSONType<"number" | "integer", IsPartial>
        : T extends string
        ? JSONType<"string", IsPartial>
        : T extends boolean
        ? JSONType<"boolean", IsPartial>
        : never)[]
    } & UnionToIntersection<
      T extends number
        ? NumberKeywords
        : T extends string
        ? StringKeywords
        : T extends boolean
        ? // eslint-disable-next-line @typescript-eslint/ban-types
          {}
        : never
    >)
  // this covers "normal" types; it's last so typescript looks to it first for errors
  | ((T extends number
      ? {
          type: JSONType<"number" | "integer", IsPartial>
        } & NumberKeywords
      : T extends string
      ? {
          type: JSONType<"string", IsPartial>
        } & StringKeywords
      : T extends boolean
      ? {
          type: JSONType<"boolean", IsPartial>
        }
      : T extends readonly [any, ...any[]]
      ? {
          // JSON AnySchema for tuple
          type: JSONType<"array", IsPartial>
          items: {
            readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>
          } & {length: T["length"]}
          minItems: T["length"]
        } & ({maxItems: T["length"]} | {additionalItems: false})
      : T extends readonly any[]
      ? {
          type: JSONType<"array", IsPartial>
          items: UncheckedJSONSchemaType<T[0], false>
          contains?: UncheckedPartialSchema<T[0]>
          minItems?: number
          maxItems?: number
          minContains?: number
          maxContains?: number
          uniqueItems?: true
          additionalItems?: never
        }
      : T extends Record<string, any>
      ? {
          // JSON AnySchema for records and dictionaries
          // "required" is not optional because it is often forgotten
          // "properties" are optional for more concise dictionary schemas
          // "patternProperties" and can be only used with interfaces that have string index
          type: JSONType<"object", IsPartial>
          additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>
          unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>
          properties?: IsPartial extends true
            ? Partial<UncheckedPropertiesSchema<T>>
            : UncheckedPropertiesSchema<T>
          patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>
          propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {type?: "string"}
          dependencies?: {[K in keyof T]?: readonly (keyof T)[] | UncheckedPartialSchema<T>}
          dependentRequired?: {[K in keyof T]?: readonly (keyof T)[]}
          dependentSchemas?: {[K in keyof T]?: UncheckedPartialSchema<T>}
          minProperties?: number
          maxProperties?: number
        } & (IsPartial extends true // "required" is not necessary if it's a non-partial type with no required keys // are listed it only asserts that optional cannot be listed. // "required" type does not guarantee that all required properties
          ? {required: readonly (keyof T)[]}
          : [UncheckedRequiredMembers<T>] extends [never]
          ? {required?: readonly UncheckedRequiredMembers<T>[]}
          : {required: readonly UncheckedRequiredMembers<T>[]})
      : T extends null
      ? {
          type: JSONType<"null", IsPartial>
          nullable: true
        }
      : never) & {
      allOf?: readonly UncheckedPartialSchema<T>[]
      anyOf?: readonly UncheckedPartialSchema<T>[]
      oneOf?: readonly UncheckedPartialSchema<T>[]
      if?: UncheckedPartialSchema<T>
      then?: UncheckedPartialSchema<T>
      else?: UncheckedPartialSchema<T>
      not?: UncheckedPartialSchema<T>
    })
) & {
  [keyword: string]: any
  $id?: string
  $ref?: string
  $defs?: Record<string, UncheckedJSONSchemaType<Known, true>>
  definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>
}

export type JSONSchemaType<T> = StrictNullChecksWrapper<
  "JSONSchemaType",
  UncheckedJSONSchemaType<T, false>
>

type Known =
  | {[key: string]: Known}
  | [Known, ...Known[]]
  | Known[]
  | number
  | string
  | boolean
  | null

type UncheckedPropertiesSchema<T> = {
  [K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {$ref: string}
}

export type PropertiesSchema<T> = StrictNullChecksWrapper<
  "PropertiesSchema",
  UncheckedPropertiesSchema<T>
>

type UncheckedRequiredMembers<T> = {
  [K in keyof T]-?: undefined extends T[K] ? never : K
}[keyof T]

export type RequiredMembers<T> = StrictNullChecksWrapper<
  "RequiredMembers",
  UncheckedRequiredMembers<T>
>

type Nullable<T> = undefined extends T
  ? {
      nullable: true
      const?: null // any non-null value would fail `const: null`, `null` would fail any other value in const
      enum?: readonly (T | null)[] // `null` must be explicitly included in "enum" for `null` to pass
      default?: T | null
    }
  : {
      nullable?: false
      const?: T
      enum?: readonly T[]
      default?: T
    }
/** numeric strings */
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"

/** string strings */
type StringType = "string" | "timestamp"

/** Generic JTD Schema without inference of the represented type */
export type SomeJTDSchemaType = (
  | // ref
  {ref: string}
  // primitives
  | {type: NumberType | StringType | "boolean"}
  // enum
  | {enum: string[]}
  // elements
  | {elements: SomeJTDSchemaType}
  // values
  | {values: SomeJTDSchemaType}
  // properties
  | {
      properties: Record<string, SomeJTDSchemaType>
      optionalProperties?: Record<string, SomeJTDSchemaType>
      additionalProperties?: boolean
    }
  | {
      properties?: Record<string, SomeJTDSchemaType>
      optionalProperties: Record<string, SomeJTDSchemaType>
      additionalProperties?: boolean
    }
  // discriminator
  | {discriminator: string; mapping: Record<string, SomeJTDSchemaType>}
  // empty
  // NOTE see the end of
  // https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
  // eslint-disable-next-line @typescript-eslint/ban-types
  | {}
) & {
  nullable?: boolean
  metadata?: Record<string, unknown>
  definitions?: Record<string, SomeJTDSchemaType>
}

/** required keys of an object, not undefined */
type RequiredKeys<T> = {
  [K in keyof T]-?: undefined extends T[K] ? never : K
}[keyof T]

/** optional or undifined-able keys of an object */
type OptionalKeys<T> = {
  [K in keyof T]-?: undefined extends T[K] ? K : never
}[keyof T]

/** type is true if T is a union type */
type IsUnion_<T, U extends T = T> = false extends (
  T extends unknown ? ([U] extends [T] ? false : true) : never
)
  ? false
  : true
type IsUnion<T> = IsUnion_<T>

/** type is true if T is identically E */
type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false

/** type is true if T or null is identically E or null*/
type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>

/** gets only the string literals of a type or null if a type isn't a string literal */
type EnumString<T> = [T] extends [never]
  ? null
  : T extends string
  ? string extends T
    ? null
    : T
  : null

/** true if type is a union of string literals */
type IsEnum<T> = null extends EnumString<T> ? false : true

/** true only if all types are array types (not tuples) */
// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays
// have an index at every number
type IsElements<T> = false extends IsUnion<T>
  ? [T] extends [readonly unknown[]]
    ? undefined extends T[0.5]
      ? false
      : true
    : false
  : false

/** true if the the type is a values type */
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false

/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T>
  ? null extends EnumString<keyof T>
    ? false
    : true
  : false

/** true if type represents an empty record */
type IsEmptyRecord<T> = [T] extends [Record<string, never>]
  ? [T] extends [never]
    ? false
    : true
  : false

/** actual schema */
export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (
  | // refs - where null wasn't specified, must match exactly
  (null extends EnumString<keyof D>
      ? never
      :
          | ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false})
          // nulled refs - if ref is nullable and nullable is specified, then it can
          // match either null or non-null definitions
          | (null extends T
              ? {
                  [K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>]
                    ? {ref: K}
                    : never
                }[keyof D] & {nullable: true}
              : never))
  // empty - empty schemas also treat nullable differently in that it's now fully ignored
  | (unknown extends T ? {nullable?: boolean} : never)
  // all other types // numbers - only accepts the type number
  | ((true extends NullTypeEquality<T, number>
      ? {type: NumberType}
      : // booleans - accepts the type boolean
      true extends NullTypeEquality<T, boolean>
      ? {type: "boolean"}
      : // strings - only accepts the type string
      true extends NullTypeEquality<T, string>
      ? {type: StringType}
      : // strings - only accepts the type Date
      true extends NullTypeEquality<T, Date>
      ? {type: "timestamp"}
      : // enums - only accepts union of string literals
      // TODO we can't actually check that everything in the union was specified
      true extends IsEnum<Exclude<T, null>>
      ? {enum: EnumString<Exclude<T, null>>[]}
      : // arrays - only accepts arrays, could be array of unions to be resolved later
      true extends IsElements<Exclude<T, null>>
      ? T extends readonly (infer E)[]
        ? {
            elements: JTDSchemaType<E, D>
          }
        : never
      : // empty properties
      true extends IsEmptyRecord<Exclude<T, null>>
      ?
          | {properties: Record<string, never>; optionalProperties?: Record<string, never>}
          | {optionalProperties: Record<string, never>}
      : // values
      true extends IsValues<Exclude<T, null>>
      ? T extends Record<string, infer V>
        ? {
            values: JTDSchemaType<V, D>
          }
        : never
      : // properties
      true extends IsRecord<Exclude<T, null>, false>
      ? ([RequiredKeys<Exclude<T, null>>] extends [never]
          ? {
              properties?: Record<string, never>
            }
          : {
              properties: {[K in RequiredKeys<T>]: JTDSchemaType<T[K], D>}
            }) &
          ([OptionalKeys<Exclude<T, null>>] extends [never]
            ? {
                optionalProperties?: Record<string, never>
              }
            : {
                optionalProperties: {
                  [K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D>
                }
              }) & {
            additionalProperties?: boolean
          }
      : // discriminator
      true extends IsRecord<Exclude<T, null>, true>
      ? {
          [K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string
            ? {
                discriminator: K
                mapping: {
                  // TODO currently allows descriminator to be present in schema
                  [M in Exclude<T, null>[K]]: JTDSchemaType<
                    Omit<T extends Record<K, M> ? T : never, K>,
                    D
                  >
                }
              }
            : never
        }[keyof Exclude<T, null>]
      : never) &
      (null extends T
        ? {
            nullable: true
          }
        : {nullable?: false}))
) & {
  // extra properties
  metadata?: Record<string, unknown>
  // TODO these should only be allowed at the top level
  definitions?: {[K in keyof D]: JTDSchemaType<D[K], D>}
}

type JTDDataDef<S, D extends Record<string, unknown>> =
  | // ref
  (S extends {ref: string}
      ? D extends {[K in S["ref"]]: infer V}
        ? JTDDataDef<V, D>
        : never
      : // type
      S extends {type: NumberType}
      ? number
      : S extends {type: "boolean"}
      ? boolean
      : S extends {type: "string"}
      ? string
      : S extends {type: "timestamp"}
      ? string | Date
      : // enum
      S extends {enum: readonly (infer E)[]}
      ? string extends E
        ? never
        : [E] extends [string]
        ? E
        : never
      : // elements
      S extends {elements: infer E}
      ? JTDDataDef<E, D>[]
      : // properties
      S extends {
          properties: Record<string, unknown>
          optionalProperties?: Record<string, unknown>
          additionalProperties?: boolean
        }
      ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>} & {
          -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<
            S["optionalProperties"][K],
            D
          >
        } & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown)
      : S extends {
          properties?: Record<string, unknown>
          optionalProperties: Record<string, unknown>
          additionalProperties?: boolean
        }
      ? {-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>} & {
          -readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<
            S["optionalProperties"][K],
            D
          >
        } & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown)
      : // values
      S extends {values: infer V}
      ? Record<string, JTDDataDef<V, D>>
      : // discriminator
      S extends {discriminator: infer M; mapping: Record<string, unknown>}
      ? [M] extends [string]
        ? {
            [K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & {[KM in M]: K}
          }[keyof S["mapping"]]
        : never
      : // empty
        unknown)
  | (S extends {nullable: true} ? null : never)

export type JTDDataType<S> = S extends {definitions: Record<string, unknown>}
  ? JTDDataDef<S, S["definitions"]>
  : JTDDataDef<S, Record<string, never>>
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util"

export type AdditionalItemsError = ErrorObject<"additionalItems", {limit: number}, AnySchema>

const error: KeywordErrorDefinition = {
  message: ({params: {len}}) => str`must NOT have more than ${len} items`,
  params: ({params: {len}}) => _`{limit: ${len}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "additionalItems" as const,
  type: "array",
  schemaType: ["boolean", "object"],
  before: "uniqueItems",
  error,
  code(cxt: KeywordCxt) {
    const {parentSchema, it} = cxt
    const {items} = parentSchema
    if (!Array.isArray(items)) {
      checkStrictMode(it, '"additionalItems" is ignored when "items" is not an array of schemas')
      return
    }
    validateAdditionalItems(cxt, items)
  },
}

export function validateAdditionalItems(cxt: KeywordCxt, items: AnySchema[]): void {
  const {gen, schema, data, keyword, it} = cxt
  it.items = true
  const len = gen.const("len", _`${data}.length`)
  if (schema === false) {
    cxt.setParams({len: items.length})
    cxt.pass(_`${len} <= ${items.length}`)
  } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) {
    const valid = gen.var("valid", _`${len} <= ${items.length}`) // TODO var
    gen.if(not(valid), () => validateItems(valid))
    cxt.ok(valid)
  }

  function validateItems(valid: Name): void {
    gen.forRange("i", items.length, len, (i) => {
      cxt.subschema({keyword, dataProp: i, dataPropType: Type.Num}, valid)
      if (!it.allErrors) gen.if(not(valid), () => gen.break())
    })
  }
}

export default def
import type {
  CodeKeywordDefinition,
  AddedKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import {allSchemaProperties, usePattern, isOwnProperty} from "../code"
import {_, nil, or, not, Code, Name} from "../../compile/codegen"
import N from "../../compile/names"
import type {SubschemaArgs} from "../../compile/validate/subschema"
import {alwaysValidSchema, schemaRefOrVal, Type} from "../../compile/util"

export type AdditionalPropertiesError = ErrorObject<
  "additionalProperties",
  {additionalProperty: string},
  AnySchema
>

const error: KeywordErrorDefinition = {
  message: "must NOT have additional properties",
  params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`,
}

const def: CodeKeywordDefinition & AddedKeywordDefinition = {
  keyword: "additionalProperties",
  type: ["object"],
  schemaType: ["boolean", "object"],
  allowUndefined: true,
  trackErrors: true,
  error,
  code(cxt) {
    const {gen, schema, parentSchema, data, errsCount, it} = cxt
    /* istanbul ignore if */
    if (!errsCount) throw new Error("ajv implementation error")
    const {allErrors, opts} = it
    it.props = true
    if (opts.removeAdditional !== "all" && alwaysValidSchema(it, schema)) return
    const props = allSchemaProperties(parentSchema.properties)
    const patProps = allSchemaProperties(parentSchema.patternProperties)
    checkAdditionalProperties()
    cxt.ok(_`${errsCount} === ${N.errors}`)

    function checkAdditionalProperties(): void {
      gen.forIn("key", data, (key: Name) => {
        if (!props.length && !patProps.length) additionalPropertyCode(key)
        else gen.if(isAdditional(key), () => additionalPropertyCode(key))
      })
    }

    function isAdditional(key: Name): Code {
      let definedProp: Code
      if (props.length > 8) {
        // TODO maybe an option instead of hard-coded 8?
        const propsSchema = schemaRefOrVal(it, parentSchema.properties, "properties")
        definedProp = isOwnProperty(gen, propsSchema as Code, key)
      } else if (props.length) {
        definedProp = or(...props.map((p) => _`${key} === ${p}`))
      } else {
        definedProp = nil
      }
      if (patProps.length) {
        definedProp = or(definedProp, ...patProps.map((p) => _`${usePattern(cxt, p)}.test(${key})`))
      }
      return not(definedProp)
    }

    function deleteAdditional(key: Name): void {
      gen.code(_`delete ${data}[${key}]`)
    }

    function additionalPropertyCode(key: Name): void {
      if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
        deleteAdditional(key)
        return
      }

      if (schema === false) {
        cxt.setParams({additionalProperty: key})
        cxt.error()
        if (!allErrors) gen.break()
        return
      }

      if (typeof schema == "object" && !alwaysValidSchema(it, schema)) {
        const valid = gen.name("valid")
        if (opts.removeAdditional === "failing") {
          applyAdditionalSchema(key, valid, false)
          gen.if(not(valid), () => {
            cxt.reset()
            deleteAdditional(key)
          })
        } else {
          applyAdditionalSchema(key, valid)
          if (!allErrors) gen.if(not(valid), () => gen.break())
        }
      }
    }

    function applyAdditionalSchema(key: Name, valid: Name, errors?: false): void {
      const subschema: SubschemaArgs = {
        keyword: "additionalProperties",
        dataProp: key,
        dataPropType: Type.Str,
      }
      if (errors === false) {
        Object.assign(subschema, {
          compositeRule: true,
          createErrors: false,
          allErrors: false,
        })
      }
      cxt.subschema(subschema, valid)
    }
  },
}

export default def
import type {CodeKeywordDefinition, AnySchema} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: "allOf",
  schemaType: "array",
  code(cxt: KeywordCxt) {
    const {gen, schema, it} = cxt
    /* istanbul ignore if */
    if (!Array.isArray(schema)) throw new Error("ajv implementation error")
    const valid = gen.name("valid")
    schema.forEach((sch: AnySchema, i: number) => {
      if (alwaysValidSchema(it, sch)) return
      const schCxt = cxt.subschema({keyword: "allOf", schemaProp: i}, valid)
      cxt.ok(valid)
      cxt.mergeEvaluated(schCxt)
    })
  },
}

export default def
import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types"
import {validateUnion} from "../code"

export type AnyOfError = ErrorNoParams<"anyOf", AnySchema[]>

const def: CodeKeywordDefinition = {
  keyword: "anyOf",
  schemaType: "array",
  trackErrors: true,
  code: validateUnion,
  error: {message: "must match a schema in anyOf"},
}

export default def
import type {
  CodeKeywordDefinition,
  KeywordErrorDefinition,
  ErrorObject,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode, Type} from "../../compile/util"

export type ContainsError = ErrorObject<
  "contains",
  {minContains: number; maxContains?: number},
  AnySchema
>

const error: KeywordErrorDefinition = {
  message: ({params: {min, max}}) =>
    max === undefined
      ? str`must contain at least ${min} valid item(s)`
      : str`must contain at least ${min} and no more than ${max} valid item(s)`,
  params: ({params: {min, max}}) =>
    max === undefined ? _`{minContains: ${min}}` : _`{minContains: ${min}, maxContains: ${max}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "contains",
  type: "array",
  schemaType: ["object", "boolean"],
  before: "uniqueItems",
  trackErrors: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, schema, parentSchema, data, it} = cxt
    let min: number
    let max: number | undefined
    const {minContains, maxContains} = parentSchema
    if (it.opts.next) {
      min = minContains === undefined ? 1 : minContains
      max = maxContains
    } else {
      min = 1
    }
    const len = gen.const("len", _`${data}.length`)
    cxt.setParams({min, max})
    if (max === undefined && min === 0) {
      checkStrictMode(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`)
      return
    }
    if (max !== undefined && min > max) {
      checkStrictMode(it, `"minContains" > "maxContains" is always invalid`)
      cxt.fail()
      return
    }
    if (alwaysValidSchema(it, schema)) {
      let cond = _`${len} >= ${min}`
      if (max !== undefined) cond = _`${cond} && ${len} <= ${max}`
      cxt.pass(cond)
      return
    }

    it.items = true
    const valid = gen.name("valid")
    if (max === undefined && min === 1) {
      validateItems(valid, () => gen.if(valid, () => gen.break()))
    } else if (min === 0) {
      gen.let(valid, true)
      if (max !== undefined) gen.if(_`${data}.length > 0`, validateItemsWithCount)
    } else {
      gen.let(valid, false)
      validateItemsWithCount()
    }
    cxt.result(valid, () => cxt.reset())

    function validateItemsWithCount(): void {
      const schValid = gen.name("_valid")
      const count = gen.let("count", 0)
      validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)))
    }

    function validateItems(_valid: Name, block: () => void): void {
      gen.forRange("i", 0, len, (i) => {
        cxt.subschema(
          {
            keyword: "contains",
            dataProp: i,
            dataPropType: Type.Num,
            compositeRule: true,
          },
          _valid
        )
        block()
      })
    }

    function checkLimits(count: Name): void {
      gen.code(_`${count}++`)
      if (max === undefined) {
        gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true).break())
      } else {
        gen.if(_`${count} > ${max}`, () => gen.assign(valid, false).break())
        if (min === 1) gen.assign(valid, true)
        else gen.if(_`${count} >= ${min}`, () => gen.assign(valid, true))
      }
    }
  },
}

export default def
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  SchemaMap,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str} from "../../compile/codegen"
import {alwaysValidSchema} from "../../compile/util"
import {checkReportMissingProp, checkMissingProp, reportMissingProp, propertyInData} from "../code"

export type PropertyDependencies = {[K in string]?: string[]}

export interface DependenciesErrorParams {
  property: string
  missingProperty: string
  depsCount: number
  deps: string // TODO change to string[]
}

type SchemaDependencies = SchemaMap

export type DependenciesError = ErrorObject<
  "dependencies",
  DependenciesErrorParams,
  {[K in string]?: string[] | AnySchema}
>

export const error: KeywordErrorDefinition = {
  message: ({params: {property, depsCount, deps}}) => {
    const property_ies = depsCount === 1 ? "property" : "properties"
    return str`must have ${property_ies} ${deps} when property ${property} is present`
  },
  params: ({params: {property, depsCount, deps, missingProperty}}) =>
    _`{property: ${property},
    missingProperty: ${missingProperty},
    depsCount: ${depsCount},
    deps: ${deps}}`, // TODO change to reference
}

const def: CodeKeywordDefinition = {
  keyword: "dependencies",
  type: "object",
  schemaType: "object",
  error,
  code(cxt: KeywordCxt) {
    const [propDeps, schDeps] = splitDependencies(cxt)
    validatePropertyDeps(cxt, propDeps)
    validateSchemaDeps(cxt, schDeps)
  },
}

function splitDependencies({schema}: KeywordCxt): [PropertyDependencies, SchemaDependencies] {
  const propertyDeps: PropertyDependencies = {}
  const schemaDeps: SchemaDependencies = {}
  for (const key in schema) {
    if (key === "__proto__") continue
    const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps
    deps[key] = schema[key]
  }
  return [propertyDeps, schemaDeps]
}

export function validatePropertyDeps(
  cxt: KeywordCxt,
  propertyDeps: {[K in string]?: string[]} = cxt.schema
): void {
  const {gen, data, it} = cxt
  if (Object.keys(propertyDeps).length === 0) return
  const missing = gen.let("missing")
  for (const prop in propertyDeps) {
    const deps = propertyDeps[prop] as string[]
    if (deps.length === 0) continue
    const hasProperty = propertyInData(gen, data, prop, it.opts.ownProperties)
    cxt.setParams({
      property: prop,
      depsCount: deps.length,
      deps: deps.join(", "),
    })
    if (it.allErrors) {
      gen.if(hasProperty, () => {
        for (const depProp of deps) {
          checkReportMissingProp(cxt, depProp)
        }
      })
    } else {
      gen.if(_`${hasProperty} && (${checkMissingProp(cxt, deps, missing)})`)
      reportMissingProp(cxt, missing)
      gen.else()
    }
  }
}

export function validateSchemaDeps(cxt: KeywordCxt, schemaDeps: SchemaMap = cxt.schema): void {
  const {gen, data, keyword, it} = cxt
  const valid = gen.name("valid")
  for (const prop in schemaDeps) {
    if (alwaysValidSchema(it, schemaDeps[prop] as AnySchema)) continue
    gen.if(
      propertyInData(gen, data, prop, it.opts.ownProperties),
      () => {
        const schCxt = cxt.subschema({keyword, schemaProp: prop}, valid)
        cxt.mergeValidEvaluated(schCxt, valid)
      },
      () => gen.var(valid, true) // TODO var
    )
    cxt.ok(valid)
  }
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import {validateSchemaDeps} from "./dependencies"

const def: CodeKeywordDefinition = {
  keyword: "dependentSchemas",
  type: "object",
  schemaType: "object",
  code: (cxt) => validateSchemaDeps(cxt),
}

export default def
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import type {SchemaObjCxt} from "../../compile"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode} from "../../compile/util"

export type IfKeywordError = ErrorObject<"if", {failingKeyword: string}, AnySchema>

const error: KeywordErrorDefinition = {
  message: ({params}) => str`must match "${params.ifClause}" schema`,
  params: ({params}) => _`{failingKeyword: ${params.ifClause}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "if",
  schemaType: ["object", "boolean"],
  trackErrors: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, parentSchema, it} = cxt
    if (parentSchema.then === undefined && parentSchema.else === undefined) {
      checkStrictMode(it, '"if" without "then" and "else" is ignored')
    }
    const hasThen = hasSchema(it, "then")
    const hasElse = hasSchema(it, "else")
    if (!hasThen && !hasElse) return

    const valid = gen.let("valid", true)
    const schValid = gen.name("_valid")
    validateIf()
    cxt.reset()

    if (hasThen && hasElse) {
      const ifClause = gen.let("ifClause")
      cxt.setParams({ifClause})
      gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause))
    } else if (hasThen) {
      gen.if(schValid, validateClause("then"))
    } else {
      gen.if(not(schValid), validateClause("else"))
    }

    cxt.pass(valid, () => cxt.error(true))

    function validateIf(): void {
      const schCxt = cxt.subschema(
        {
          keyword: "if",
          compositeRule: true,
          createErrors: false,
          allErrors: false,
        },
        schValid
      )
      cxt.mergeEvaluated(schCxt)
    }

    function validateClause(keyword: string, ifClause?: Name): () => void {
      return () => {
        const schCxt = cxt.subschema({keyword}, schValid)
        gen.assign(valid, schValid)
        cxt.mergeValidEvaluated(schCxt, valid)
        if (ifClause) gen.assign(ifClause, _`${keyword}`)
        else cxt.setParams({ifClause: keyword})
      }
    }
  },
}

function hasSchema(it: SchemaObjCxt, keyword: string): boolean {
  const schema = it.schema[keyword]
  return schema !== undefined && !alwaysValidSchema(it, schema)
}

export default def
import type {ErrorNoParams, Vocabulary} from "../../types"
import additionalItems, {AdditionalItemsError} from "./additionalItems"
import prefixItems from "./prefixItems"
import items from "./items"
import items2020, {ItemsError} from "./items2020"
import contains, {ContainsError} from "./contains"
import dependencies, {DependenciesError} from "./dependencies"
import propertyNames, {PropertyNamesError} from "./propertyNames"
import additionalProperties, {AdditionalPropertiesError} from "./additionalProperties"
import properties from "./properties"
import patternProperties from "./patternProperties"
import notKeyword, {NotKeywordError} from "./not"
import anyOf, {AnyOfError} from "./anyOf"
import oneOf, {OneOfError} from "./oneOf"
import allOf from "./allOf"
import ifKeyword, {IfKeywordError} from "./if"
import thenElse from "./thenElse"

export default function getApplicator(draft2020 = false): Vocabulary {
  const applicator = [
    // any
    notKeyword,
    anyOf,
    oneOf,
    allOf,
    ifKeyword,
    thenElse,
    // object
    propertyNames,
    additionalProperties,
    dependencies,
    properties,
    patternProperties,
  ]
  // array
  if (draft2020) applicator.push(prefixItems, items2020)
  else applicator.push(additionalItems, items)
  applicator.push(contains)
  return applicator
}

export type ApplicatorKeywordError =
  | ErrorNoParams<"false schema">
  | AdditionalItemsError
  | ItemsError
  | ContainsError
  | AdditionalPropertiesError
  | DependenciesError
  | IfKeywordError
  | AnyOfError
  | OneOfError
  | NotKeywordError
  | PropertyNamesError
import type {CodeKeywordDefinition, AnySchema, AnySchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_} from "../../compile/codegen"
import {alwaysValidSchema, mergeEvaluated, checkStrictMode} from "../../compile/util"
import {validateArray} from "../code"

const def: CodeKeywordDefinition = {
  keyword: "items",
  type: "array",
  schemaType: ["object", "array", "boolean"],
  before: "uniqueItems",
  code(cxt: KeywordCxt) {
    const {schema, it} = cxt
    if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema)
    it.items = true
    if (alwaysValidSchema(it, schema)) return
    cxt.ok(validateArray(cxt))
  },
}

export function validateTuple(
  cxt: KeywordCxt,
  extraItems: string,
  schArr: AnySchema[] = cxt.schema
): void {
  const {gen, parentSchema, data, keyword, it} = cxt
  checkStrictTuple(parentSchema)
  if (it.opts.unevaluated && schArr.length && it.items !== true) {
    it.items = mergeEvaluated.items(gen, schArr.length, it.items)
  }
  const valid = gen.name("valid")
  const len = gen.const("len", _`${data}.length`)
  schArr.forEach((sch: AnySchema, i: number) => {
    if (alwaysValidSchema(it, sch)) return
    gen.if(_`${len} > ${i}`, () =>
      cxt.subschema(
        {
          keyword,
          schemaProp: i,
          dataProp: i,
        },
        valid
      )
    )
    cxt.ok(valid)
  })

  function checkStrictTuple(sch: AnySchemaObject): void {
    const {opts, errSchemaPath} = it
    const l = schArr.length
    const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false)
    if (opts.strictTuples && !fullTuple) {
      const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`
      checkStrictMode(it, msg, opts.strictTuples)
    }
  }
}

export default def
import type {
  CodeKeywordDefinition,
  KeywordErrorDefinition,
  ErrorObject,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str} from "../../compile/codegen"
import {alwaysValidSchema} from "../../compile/util"
import {validateArray} from "../code"
import {validateAdditionalItems} from "./additionalItems"

export type ItemsError = ErrorObject<"items", {limit: number}, AnySchema>

const error: KeywordErrorDefinition = {
  message: ({params: {len}}) => str`must NOT have more than ${len} items`,
  params: ({params: {len}}) => _`{limit: ${len}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "items",
  type: "array",
  schemaType: ["object", "boolean"],
  before: "uniqueItems",
  error,
  code(cxt: KeywordCxt) {
    const {schema, parentSchema, it} = cxt
    const {prefixItems} = parentSchema
    it.items = true
    if (alwaysValidSchema(it, schema)) return
    if (prefixItems) validateAdditionalItems(cxt, prefixItems)
    else cxt.ok(validateArray(cxt))
  },
}

export default def
import type {CodeKeywordDefinition, ErrorNoParams, AnySchema} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema} from "../../compile/util"

export type NotKeywordError = ErrorNoParams<"not", AnySchema>

const def: CodeKeywordDefinition = {
  keyword: "not",
  schemaType: ["object", "boolean"],
  trackErrors: true,
  code(cxt: KeywordCxt) {
    const {gen, schema, it} = cxt
    if (alwaysValidSchema(it, schema)) {
      cxt.fail()
      return
    }

    const valid = gen.name("valid")
    cxt.subschema(
      {
        keyword: "not",
        compositeRule: true,
        createErrors: false,
        allErrors: false,
      },
      valid
    )

    cxt.failResult(
      valid,
      () => cxt.reset(),
      () => cxt.error()
    )
  },
  error: {message: "must NOT be valid"},
}

export default def
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, Name} from "../../compile/codegen"
import {alwaysValidSchema} from "../../compile/util"
import {SchemaCxt} from "../../compile"

export type OneOfError = ErrorObject<
  "oneOf",
  {passingSchemas: [number, number] | null},
  AnySchema[]
>

const error: KeywordErrorDefinition = {
  message: "must match exactly one schema in oneOf",
  params: ({params}) => _`{passingSchemas: ${params.passing}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "oneOf",
  schemaType: "array",
  trackErrors: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, schema, parentSchema, it} = cxt
    /* istanbul ignore if */
    if (!Array.isArray(schema)) throw new Error("ajv implementation error")
    if (it.opts.discriminator && parentSchema.discriminator) return
    const schArr: AnySchema[] = schema
    const valid = gen.let("valid", false)
    const passing = gen.let("passing", null)
    const schValid = gen.name("_valid")
    cxt.setParams({passing})
    // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas

    gen.block(validateOneOf)

    cxt.result(
      valid,
      () => cxt.reset(),
      () => cxt.error(true)
    )

    function validateOneOf(): void {
      schArr.forEach((sch: AnySchema, i: number) => {
        let schCxt: SchemaCxt | undefined
        if (alwaysValidSchema(it, sch)) {
          gen.var(schValid, true)
        } else {
          schCxt = cxt.subschema(
            {
              keyword: "oneOf",
              schemaProp: i,
              compositeRule: true,
            },
            schValid
          )
        }

        if (i > 0) {
          gen
            .if(_`${schValid} && ${valid}`)
            .assign(valid, false)
            .assign(passing, _`[${passing}, ${i}]`)
            .else()
        }

        gen.if(schValid, () => {
          gen.assign(valid, true)
          gen.assign(passing, i)
          if (schCxt) cxt.mergeEvaluated(schCxt, Name)
        })
      })
    }
  },
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {allSchemaProperties, usePattern} from "../code"
import {_, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, checkStrictMode} from "../../compile/util"
import {evaluatedPropsToName, Type} from "../../compile/util"
import {AnySchema} from "../../types"

const def: CodeKeywordDefinition = {
  keyword: "patternProperties",
  type: "object",
  schemaType: "object",
  code(cxt: KeywordCxt) {
    const {gen, schema, data, parentSchema, it} = cxt
    const {opts} = it
    const patterns = allSchemaProperties(schema)
    const alwaysValidPatterns = patterns.filter((p) =>
      alwaysValidSchema(it, schema[p] as AnySchema)
    )

    if (
      patterns.length === 0 ||
      (alwaysValidPatterns.length === patterns.length &&
        (!it.opts.unevaluated || it.props === true))
    ) {
      return
    }

    const checkProperties =
      opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties
    const valid = gen.name("valid")
    if (it.props !== true && !(it.props instanceof Name)) {
      it.props = evaluatedPropsToName(gen, it.props)
    }
    const {props} = it
    validatePatternProperties()

    function validatePatternProperties(): void {
      for (const pat of patterns) {
        if (checkProperties) checkMatchingProperties(pat)
        if (it.allErrors) {
          validateProperties(pat)
        } else {
          gen.var(valid, true) // TODO var
          validateProperties(pat)
          gen.if(valid)
        }
      }
    }

    function checkMatchingProperties(pat: string): void {
      for (const prop in checkProperties) {
        if (new RegExp(pat).test(prop)) {
          checkStrictMode(
            it,
            `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`
          )
        }
      }
    }

    function validateProperties(pat: string): void {
      gen.forIn("key", data, (key) => {
        gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => {
          const alwaysValid = alwaysValidPatterns.includes(pat)
          if (!alwaysValid) {
            cxt.subschema(
              {
                keyword: "patternProperties",
                schemaProp: pat,
                dataProp: key,
                dataPropType: Type.Str,
              },
              valid
            )
          }

          if (it.opts.unevaluated && props !== true) {
            gen.assign(_`${props}[${key}]`, true)
          } else if (!alwaysValid && !it.allErrors) {
            // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)
            // or if all properties were evaluated (props === true)
            gen.if(not(valid), () => gen.break())
          }
        })
      })
    }
  },
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import {validateTuple} from "./items"

const def: CodeKeywordDefinition = {
  keyword: "prefixItems",
  type: "array",
  schemaType: ["array"],
  before: "uniqueItems",
  code: (cxt) => validateTuple(cxt, "items"),
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import {KeywordCxt} from "../../compile/validate"
import {propertyInData, allSchemaProperties} from "../code"
import {alwaysValidSchema, toHash, mergeEvaluated} from "../../compile/util"
import apDef from "./additionalProperties"

const def: CodeKeywordDefinition = {
  keyword: "properties",
  type: "object",
  schemaType: "object",
  code(cxt: KeywordCxt) {
    const {gen, schema, parentSchema, data, it} = cxt
    if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
      apDef.code(new KeywordCxt(it, apDef, "additionalProperties"))
    }
    const allProps = allSchemaProperties(schema)
    for (const prop of allProps) {
      it.definedProperties.add(prop)
    }
    if (it.opts.unevaluated && allProps.length && it.props !== true) {
      it.props = mergeEvaluated.props(gen, toHash(allProps), it.props)
    }
    const properties = allProps.filter((p) => !alwaysValidSchema(it, schema[p]))
    if (properties.length === 0) return
    const valid = gen.name("valid")

    for (const prop of properties) {
      if (hasDefault(prop)) {
        applyPropertySchema(prop)
      } else {
        gen.if(propertyInData(gen, data, prop, it.opts.ownProperties))
        applyPropertySchema(prop)
        if (!it.allErrors) gen.else().var(valid, true)
        gen.endIf()
      }
      cxt.it.definedProperties.add(prop)
      cxt.ok(valid)
    }

    function hasDefault(prop: string): boolean | undefined {
      return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined
    }

    function applyPropertySchema(prop: string): void {
      cxt.subschema(
        {
          keyword: "properties",
          schemaProp: prop,
          dataProp: prop,
        },
        valid
      )
    }
  },
}

export default def
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, not} from "../../compile/codegen"
import {alwaysValidSchema} from "../../compile/util"

export type PropertyNamesError = ErrorObject<"propertyNames", {propertyName: string}, AnySchema>

const error: KeywordErrorDefinition = {
  message: "property name must be valid",
  params: ({params}) => _`{propertyName: ${params.propertyName}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "propertyNames",
  type: "object",
  schemaType: ["object", "boolean"],
  error,
  code(cxt: KeywordCxt) {
    const {gen, schema, data, it} = cxt
    if (alwaysValidSchema(it, schema)) return
    const valid = gen.name("valid")

    gen.forIn("key", data, (key) => {
      cxt.setParams({propertyName: key})
      cxt.subschema(
        {
          keyword: "propertyNames",
          data: key,
          dataTypes: ["string"],
          propertyName: key,
          compositeRule: true,
        },
        valid
      )
      gen.if(not(valid), () => {
        cxt.error(true)
        if (!it.allErrors) gen.break()
      })
    })

    cxt.ok(valid)
  },
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkStrictMode} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: ["then", "else"],
  schemaType: ["object", "boolean"],
  code({keyword, parentSchema, it}: KeywordCxt) {
    if (parentSchema.if === undefined) checkStrictMode(it, `"${keyword}" without "if" is ignored`)
  },
}

export default def
import type {AnySchema, SchemaMap} from "../types"
import type {SchemaCxt} from "../compile"
import type {KeywordCxt} from "../compile/validate"
import {CodeGen, _, and, or, not, nil, strConcat, getProperty, Code, Name} from "../compile/codegen"
import {alwaysValidSchema, Type} from "../compile/util"
import N from "../compile/names"
import {useFunc} from "../compile/util"
export function checkReportMissingProp(cxt: KeywordCxt, prop: string): void {
  const {gen, data, it} = cxt
  gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
    cxt.setParams({missingProperty: _`${prop}`}, true)
    cxt.error()
  })
}

export function checkMissingProp(
  {gen, data, it: {opts}}: KeywordCxt,
  properties: string[],
  missing: Name
): Code {
  return or(
    ...properties.map((prop) =>
      and(noPropertyInData(gen, data, prop, opts.ownProperties), _`${missing} = ${prop}`)
    )
  )
}

export function reportMissingProp(cxt: KeywordCxt, missing: Name): void {
  cxt.setParams({missingProperty: missing}, true)
  cxt.error()
}

export function hasPropFunc(gen: CodeGen): Name {
  return gen.scopeValue("func", {
    // eslint-disable-next-line @typescript-eslint/unbound-method
    ref: Object.prototype.hasOwnProperty,
    code: _`Object.prototype.hasOwnProperty`,
  })
}

export function isOwnProperty(gen: CodeGen, data: Name, property: Name | string): Code {
  return _`${hasPropFunc(gen)}.call(${data}, ${property})`
}

export function propertyInData(
  gen: CodeGen,
  data: Name,
  property: Name | string,
  ownProperties?: boolean
): Code {
  const cond = _`${data}${getProperty(property)} !== undefined`
  return ownProperties ? _`${cond} && ${isOwnProperty(gen, data, property)}` : cond
}

export function noPropertyInData(
  gen: CodeGen,
  data: Name,
  property: Name | string,
  ownProperties?: boolean
): Code {
  const cond = _`${data}${getProperty(property)} === undefined`
  return ownProperties ? or(cond, not(isOwnProperty(gen, data, property))) : cond
}

export function allSchemaProperties(schemaMap?: SchemaMap): string[] {
  return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []
}

export function schemaProperties(it: SchemaCxt, schemaMap: SchemaMap): string[] {
  return allSchemaProperties(schemaMap).filter(
    (p) => !alwaysValidSchema(it, schemaMap[p] as AnySchema)
  )
}

export function callValidateCode(
  {schemaCode, data, it: {gen, topSchemaRef, schemaPath, errorPath}, it}: KeywordCxt,
  func: Code,
  context: Code,
  passSchema?: boolean
): Code {
  const dataAndSchema = passSchema ? _`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data
  const valCxt: [Name, Code | number][] = [
    [N.instancePath, strConcat(N.instancePath, errorPath)],
    [N.parentData, it.parentData],
    [N.parentDataProperty, it.parentDataProperty],
    [N.rootData, N.rootData],
  ]
  if (it.opts.dynamicRef) valCxt.push([N.dynamicAnchors, N.dynamicAnchors])
  const args = _`${dataAndSchema}, ${gen.object(...valCxt)}`
  return context !== nil ? _`${func}.call(${context}, ${args})` : _`${func}(${args})`
}

const newRegExp = _`new RegExp`

export function usePattern({gen, it: {opts}}: KeywordCxt, pattern: string): Name {
  const u = opts.unicodeRegExp ? "u" : ""
  const {regExp} = opts.code
  const rx = regExp(pattern, u)

  return gen.scopeValue("pattern", {
    key: rx.toString(),
    ref: rx,
    code: _`${regExp.code === "new RegExp" ? newRegExp : useFunc(gen, regExp)}(${pattern}, ${u})`,
  })
}

export function validateArray(cxt: KeywordCxt): Name {
  const {gen, data, keyword, it} = cxt
  const valid = gen.name("valid")
  if (it.allErrors) {
    const validArr = gen.let("valid", true)
    validateItems(() => gen.assign(validArr, false))
    return validArr
  }
  gen.var(valid, true)
  validateItems(() => gen.break())
  return valid

  function validateItems(notValid: () => void): void {
    const len = gen.const("len", _`${data}.length`)
    gen.forRange("i", 0, len, (i) => {
      cxt.subschema(
        {
          keyword,
          dataProp: i,
          dataPropType: Type.Num,
        },
        valid
      )
      gen.if(not(valid), notValid)
    })
  }
}

export function validateUnion(cxt: KeywordCxt): void {
  const {gen, schema, keyword, it} = cxt
  /* istanbul ignore if */
  if (!Array.isArray(schema)) throw new Error("ajv implementation error")
  const alwaysValid = schema.some((sch: AnySchema) => alwaysValidSchema(it, sch))
  if (alwaysValid && !it.opts.unevaluated) return

  const valid = gen.let("valid", false)
  const schValid = gen.name("_valid")

  gen.block(() =>
    schema.forEach((_sch: AnySchema, i: number) => {
      const schCxt = cxt.subschema(
        {
          keyword,
          schemaProp: i,
          compositeRule: true,
        },
        schValid
      )
      gen.assign(valid, _`${valid} || ${schValid}`)
      const merged = cxt.mergeValidEvaluated(schCxt, schValid)
      // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
      // or if all properties and items were evaluated (it.props === true && it.items === true)
      if (!merged) gen.if(not(valid))
    })
  )

  cxt.result(
    valid,
    () => cxt.reset(),
    () => cxt.error(true)
  )
}
import type {CodeKeywordDefinition} from "../../types"

const def: CodeKeywordDefinition = {
  keyword: "id",
  code() {
    throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')
  },
}

export default def
import type {Vocabulary} from "../../types"
import idKeyword from "./id"
import refKeyword from "./ref"

const core: Vocabulary = [
  "$schema",
  "$id",
  "$defs",
  "$vocabulary",
  {keyword: "$comment"},
  "definitions",
  idKeyword,
  refKeyword,
]

export default core
import type {CodeKeywordDefinition, AnySchema} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import MissingRefError from "../../compile/ref_error"
import {callValidateCode} from "../code"
import {_, nil, stringify, Code, Name} from "../../compile/codegen"
import N from "../../compile/names"
import {SchemaEnv, resolveRef} from "../../compile"
import {mergeEvaluated} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: "$ref",
  schemaType: "string",
  code(cxt: KeywordCxt): void {
    const {gen, schema: $ref, it} = cxt
    const {baseId, schemaEnv: env, validateName, opts, self} = it
    const {root} = env
    if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef()
    const schOrEnv = resolveRef.call(self, root, baseId, $ref)
    if (schOrEnv === undefined) throw new MissingRefError(it.opts.uriResolver, baseId, $ref)
    if (schOrEnv instanceof SchemaEnv) return callValidate(schOrEnv)
    return inlineRefSchema(schOrEnv)

    function callRootRef(): void {
      if (env === root) return callRef(cxt, validateName, env, env.$async)
      const rootName = gen.scopeValue("root", {ref: root})
      return callRef(cxt, _`${rootName}.validate`, root, root.$async)
    }

    function callValidate(sch: SchemaEnv): void {
      const v = getValidate(cxt, sch)
      callRef(cxt, v, sch, sch.$async)
    }

    function inlineRefSchema(sch: AnySchema): void {
      const schName = gen.scopeValue(
        "schema",
        opts.code.source === true ? {ref: sch, code: stringify(sch)} : {ref: sch}
      )
      const valid = gen.name("valid")
      const schCxt = cxt.subschema(
        {
          schema: sch,
          dataTypes: [],
          schemaPath: nil,
          topSchemaRef: schName,
          errSchemaPath: $ref,
        },
        valid
      )
      cxt.mergeEvaluated(schCxt)
      cxt.ok(valid)
    }
  },
}

export function getValidate(cxt: KeywordCxt, sch: SchemaEnv): Code {
  const {gen} = cxt
  return sch.validate
    ? gen.scopeValue("validate", {ref: sch.validate})
    : _`${gen.scopeValue("wrapper", {ref: sch})}.validate`
}

export function callRef(cxt: KeywordCxt, v: Code, sch?: SchemaEnv, $async?: boolean): void {
  const {gen, it} = cxt
  const {allErrors, schemaEnv: env, opts} = it
  const passCxt = opts.passContext ? N.this : nil
  if ($async) callAsyncRef()
  else callSyncRef()

  function callAsyncRef(): void {
    if (!env.$async) throw new Error("async schema referenced by sync schema")
    const valid = gen.let("valid")
    gen.try(
      () => {
        gen.code(_`await ${callValidateCode(cxt, v, passCxt)}`)
        addEvaluatedFrom(v) // TODO will not work with async, it has to be returned with the result
        if (!allErrors) gen.assign(valid, true)
      },
      (e) => {
        gen.if(_`!(${e} instanceof ${it.ValidationError as Name})`, () => gen.throw(e))
        addErrorsFrom(e)
        if (!allErrors) gen.assign(valid, false)
      }
    )
    cxt.ok(valid)
  }

  function callSyncRef(): void {
    cxt.result(
      callValidateCode(cxt, v, passCxt),
      () => addEvaluatedFrom(v),
      () => addErrorsFrom(v)
    )
  }

  function addErrorsFrom(source: Code): void {
    const errs = _`${source}.errors`
    gen.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`) // TODO tagged
    gen.assign(N.errors, _`${N.vErrors}.length`)
  }

  function addEvaluatedFrom(source: Code): void {
    if (!it.opts.unevaluated) return
    const schEvaluated = sch?.validate?.evaluated
    // TODO refactor
    if (it.props !== true) {
      if (schEvaluated && !schEvaluated.dynamicProps) {
        if (schEvaluated.props !== undefined) {
          it.props = mergeEvaluated.props(gen, schEvaluated.props, it.props)
        }
      } else {
        const props = gen.var("props", _`${source}.evaluated.props`)
        it.props = mergeEvaluated.props(gen, props, it.props, Name)
      }
    }
    if (it.items !== true) {
      if (schEvaluated && !schEvaluated.dynamicItems) {
        if (schEvaluated.items !== undefined) {
          it.items = mergeEvaluated.items(gen, schEvaluated.items, it.items)
        }
      } else {
        const items = gen.var("items", _`${source}.evaluated.items`)
        it.items = mergeEvaluated.items(gen, items, it.items, Name)
      }
    }
  }
}

export default def
import type {CodeKeywordDefinition, AnySchemaObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, getProperty, Name} from "../../compile/codegen"
import {DiscrError, DiscrErrorObj} from "../discriminator/types"
import {resolveRef, SchemaEnv} from "../../compile"
import MissingRefError from "../../compile/ref_error"
import {schemaHasRulesButRef} from "../../compile/util"

export type DiscriminatorError = DiscrErrorObj<DiscrError.Tag> | DiscrErrorObj<DiscrError.Mapping>

const error: KeywordErrorDefinition = {
  message: ({params: {discrError, tagName}}) =>
    discrError === DiscrError.Tag
      ? `tag "${tagName}" must be string`
      : `value of tag "${tagName}" must be in oneOf`,
  params: ({params: {discrError, tag, tagName}}) =>
    _`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "discriminator",
  type: "object",
  schemaType: "object",
  error,
  code(cxt: KeywordCxt) {
    const {gen, data, schema, parentSchema, it} = cxt
    const {oneOf} = parentSchema
    if (!it.opts.discriminator) {
      throw new Error("discriminator: requires discriminator option")
    }
    const tagName = schema.propertyName
    if (typeof tagName != "string") throw new Error("discriminator: requires propertyName")
    if (schema.mapping) throw new Error("discriminator: mapping is not supported")
    if (!oneOf) throw new Error("discriminator: requires oneOf keyword")
    const valid = gen.let("valid", false)
    const tag = gen.const("tag", _`${data}${getProperty(tagName)}`)
    gen.if(
      _`typeof ${tag} == "string"`,
      () => validateMapping(),
      () => cxt.error(false, {discrError: DiscrError.Tag, tag, tagName})
    )
    cxt.ok(valid)

    function validateMapping(): void {
      const mapping = getMapping()
      gen.if(false)
      for (const tagValue in mapping) {
        gen.elseIf(_`${tag} === ${tagValue}`)
        gen.assign(valid, applyTagSchema(mapping[tagValue]))
      }
      gen.else()
      cxt.error(false, {discrError: DiscrError.Mapping, tag, tagName})
      gen.endIf()
    }

    function applyTagSchema(schemaProp?: number): Name {
      const _valid = gen.name("valid")
      const schCxt = cxt.subschema({keyword: "oneOf", schemaProp}, _valid)
      cxt.mergeEvaluated(schCxt, Name)
      return _valid
    }

    function getMapping(): {[T in string]?: number} {
      const oneOfMapping: {[T in string]?: number} = {}
      const topRequired = hasRequired(parentSchema)
      let tagRequired = true
      for (let i = 0; i < oneOf.length; i++) {
        let sch = oneOf[i]
        if (sch?.$ref && !schemaHasRulesButRef(sch, it.self.RULES)) {
          const ref = sch.$ref
          sch = resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref)
          if (sch instanceof SchemaEnv) sch = sch.schema
          if (sch === undefined) throw new MissingRefError(it.opts.uriResolver, it.baseId, ref)
        }
        const propSch = sch?.properties?.[tagName]
        if (typeof propSch != "object") {
          throw new Error(
            `discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`
          )
        }
        tagRequired = tagRequired && (topRequired || hasRequired(sch))
        addMappings(propSch, i)
      }
      if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`)
      return oneOfMapping

      function hasRequired({required}: AnySchemaObject): boolean {
        return Array.isArray(required) && required.includes(tagName)
      }

      function addMappings(sch: AnySchemaObject, i: number): void {
        if (sch.const) {
          addMapping(sch.const, i)
        } else if (sch.enum) {
          for (const tagValue of sch.enum) {
            addMapping(tagValue, i)
          }
        } else {
          throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`)
        }
      }

      function addMapping(tagValue: unknown, i: number): void {
        if (typeof tagValue != "string" || tagValue in oneOfMapping) {
          throw new Error(`discriminator: "${tagName}" values must be unique strings`)
        }
        oneOfMapping[tagValue] = i
      }
    }
  },
}

export default def
import type {ErrorObject} from "../../types"

export enum DiscrError {
  Tag = "tag",
  Mapping = "mapping",
}

export type DiscrErrorObj<E extends DiscrError> = ErrorObject<
  "discriminator",
  {error: E; tag: string; tagValue: unknown},
  string
>
import type {Vocabulary} from "../types"
import coreVocabulary from "./core"
import validationVocabulary from "./validation"
import getApplicatorVocabulary from "./applicator"
import dynamicVocabulary from "./dynamic"
import nextVocabulary from "./next"
import unevaluatedVocabulary from "./unevaluated"
import formatVocabulary from "./format"
import {metadataVocabulary, contentVocabulary} from "./metadata"

const draft2020Vocabularies: Vocabulary[] = [
  dynamicVocabulary,
  coreVocabulary,
  validationVocabulary,
  getApplicatorVocabulary(true),
  formatVocabulary,
  metadataVocabulary,
  contentVocabulary,
  nextVocabulary,
  unevaluatedVocabulary,
]

export default draft2020Vocabularies
import type {Vocabulary} from "../types"
import coreVocabulary from "./core"
import validationVocabulary from "./validation"
import getApplicatorVocabulary from "./applicator"
import formatVocabulary from "./format"
import {metadataVocabulary, contentVocabulary} from "./metadata"

const draft7Vocabularies: Vocabulary[] = [
  coreVocabulary,
  validationVocabulary,
  getApplicatorVocabulary(),
  formatVocabulary,
  metadataVocabulary,
  contentVocabulary,
]

export default draft7Vocabularies
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, getProperty, Code} from "../../compile/codegen"
import N from "../../compile/names"
import {SchemaEnv, compileSchema} from "../../compile"
import {getValidate} from "../core/ref"

const def: CodeKeywordDefinition = {
  keyword: "$dynamicAnchor",
  schemaType: "string",
  code: (cxt) => dynamicAnchor(cxt, cxt.schema),
}

export function dynamicAnchor(cxt: KeywordCxt, anchor: string): void {
  const {gen, it} = cxt
  it.schemaEnv.root.dynamicAnchors[anchor] = true
  const v = _`${N.dynamicAnchors}${getProperty(anchor)}`
  const validate = it.errSchemaPath === "#" ? it.validateName : _getValidate(cxt)
  gen.if(_`!${v}`, () => gen.assign(v, validate))
}

function _getValidate(cxt: KeywordCxt): Code {
  const {schemaEnv, schema, self} = cxt.it
  const {root, baseId, localRefs, meta} = schemaEnv.root
  const {schemaId} = self.opts
  const sch = new SchemaEnv({schema, schemaId, root, baseId, localRefs, meta})
  compileSchema.call(self, sch)
  return getValidate(cxt, sch)
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, getProperty, Code, Name} from "../../compile/codegen"
import N from "../../compile/names"
import {callRef} from "../core/ref"

const def: CodeKeywordDefinition = {
  keyword: "$dynamicRef",
  schemaType: "string",
  code: (cxt) => dynamicRef(cxt, cxt.schema),
}

export function dynamicRef(cxt: KeywordCxt, ref: string): void {
  const {gen, keyword, it} = cxt
  if (ref[0] !== "#") throw new Error(`"${keyword}" only supports hash fragment reference`)
  const anchor = ref.slice(1)
  if (it.allErrors) {
    _dynamicRef()
  } else {
    const valid = gen.let("valid", false)
    _dynamicRef(valid)
    cxt.ok(valid)
  }

  function _dynamicRef(valid?: Name): void {
    // TODO the assumption here is that `recursiveRef: #` always points to the root
    // of the schema object, which is not correct, because there may be $id that
    // makes # point to it, and the target schema may not contain dynamic/recursiveAnchor.
    // Because of that 2 tests in recursiveRef.json fail.
    // This is a similar problem to #815 (`$id` doesn't alter resolution scope for `{ "$ref": "#" }`).
    // (This problem is not tested in JSON-Schema-Test-Suite)
    if (it.schemaEnv.root.dynamicAnchors[anchor]) {
      const v = gen.let("_v", _`${N.dynamicAnchors}${getProperty(anchor)}`)
      gen.if(v, _callRef(v, valid), _callRef(it.validateName, valid))
    } else {
      _callRef(it.validateName, valid)()
    }
  }

  function _callRef(validate: Code, valid?: Name): () => void {
    return valid
      ? () =>
          gen.block(() => {
            callRef(cxt, validate)
            gen.let(valid, true)
          })
      : () => callRef(cxt, validate)
  }
}

export default def
import type {Vocabulary} from "../../types"
import dynamicAnchor from "./dynamicAnchor"
import dynamicRef from "./dynamicRef"
import recursiveAnchor from "./recursiveAnchor"
import recursiveRef from "./recursiveRef"

const dynamic: Vocabulary = [dynamicAnchor, dynamicRef, recursiveAnchor, recursiveRef]

export default dynamic
import type {CodeKeywordDefinition} from "../../types"
import {dynamicAnchor} from "./dynamicAnchor"
import {checkStrictMode} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: "$recursiveAnchor",
  schemaType: "boolean",
  code(cxt) {
    if (cxt.schema) dynamicAnchor(cxt, "")
    else checkStrictMode(cxt.it, "$recursiveAnchor: false is ignored")
  },
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import {dynamicRef} from "./dynamicRef"

const def: CodeKeywordDefinition = {
  keyword: "$recursiveRef",
  schemaType: "string",
  code: (cxt) => dynamicRef(cxt, cxt.schema),
}

export default def
import type {TypeError} from "../compile/validate/dataType"
import type {ApplicatorKeywordError} from "./applicator"
import type {ValidationKeywordError} from "./validation"
import type {FormatError} from "./format/format"
import type {UnevaluatedPropertiesError} from "./unevaluated/unevaluatedProperties"
import type {UnevaluatedItemsError} from "./unevaluated/unevaluatedItems"
import type {DependentRequiredError} from "./validation/dependentRequired"
import type {DiscriminatorError} from "./discriminator"

export type DefinedError =
  | TypeError
  | ApplicatorKeywordError
  | ValidationKeywordError
  | FormatError
  | UnevaluatedPropertiesError
  | UnevaluatedItemsError
  | DependentRequiredError
  | DiscriminatorError
import type {
  AddedFormat,
  FormatValidator,
  AsyncFormatValidator,
  CodeKeywordDefinition,
  KeywordErrorDefinition,
  ErrorObject,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, nil, or, Code, getProperty, regexpCode} from "../../compile/codegen"

type FormatValidate =
  | FormatValidator<string>
  | FormatValidator<number>
  | AsyncFormatValidator<string>
  | AsyncFormatValidator<number>
  | RegExp
  | string
  | true

export type FormatError = ErrorObject<"format", {format: string}, string | {$data: string}>

const error: KeywordErrorDefinition = {
  message: ({schemaCode}) => str`must match format "${schemaCode}"`,
  params: ({schemaCode}) => _`{format: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "format",
  type: ["number", "string"],
  schemaType: "string",
  $data: true,
  error,
  code(cxt: KeywordCxt, ruleType?: string) {
    const {gen, data, $data, schema, schemaCode, it} = cxt
    const {opts, errSchemaPath, schemaEnv, self} = it
    if (!opts.validateFormats) return

    if ($data) validate$DataFormat()
    else validateFormat()

    function validate$DataFormat(): void {
      const fmts = gen.scopeValue("formats", {
        ref: self.formats,
        code: opts.code.formats,
      })
      const fDef = gen.const("fDef", _`${fmts}[${schemaCode}]`)
      const fType = gen.let("fType")
      const format = gen.let("format")
      // TODO simplify
      gen.if(
        _`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`,
        () => gen.assign(fType, _`${fDef}.type || "string"`).assign(format, _`${fDef}.validate`),
        () => gen.assign(fType, _`"string"`).assign(format, fDef)
      )
      cxt.fail$data(or(unknownFmt(), invalidFmt()))

      function unknownFmt(): Code {
        if (opts.strictSchema === false) return nil
        return _`${schemaCode} && !${format}`
      }

      function invalidFmt(): Code {
        const callFormat = schemaEnv.$async
          ? _`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
          : _`${format}(${data})`
        const validData = _`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`
        return _`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`
      }
    }

    function validateFormat(): void {
      const formatDef: AddedFormat | undefined = self.formats[schema]
      if (!formatDef) {
        unknownFormat()
        return
      }
      if (formatDef === true) return
      const [fmtType, format, fmtRef] = getFormat(formatDef)
      if (fmtType === ruleType) cxt.pass(validCondition())

      function unknownFormat(): void {
        if (opts.strictSchema === false) {
          self.logger.warn(unknownMsg())
          return
        }
        throw new Error(unknownMsg())

        function unknownMsg(): string {
          return `unknown format "${schema as string}" ignored in schema at path "${errSchemaPath}"`
        }
      }

      function getFormat(fmtDef: AddedFormat): [string, FormatValidate, Code] {
        const code =
          fmtDef instanceof RegExp
            ? regexpCode(fmtDef)
            : opts.code.formats
            ? _`${opts.code.formats}${getProperty(schema)}`
            : undefined
        const fmt = gen.scopeValue("formats", {key: schema, ref: fmtDef, code})
        if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
          return [fmtDef.type || "string", fmtDef.validate, _`${fmt}.validate`]
        }

        return ["string", fmtDef, fmt]
      }

      function validCondition(): Code {
        if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
          if (!schemaEnv.$async) throw new Error("async format in sync schema")
          return _`await ${fmtRef}(${data})`
        }
        return typeof format == "function" ? _`${fmtRef}(${data})` : _`${fmtRef}.test(${data})`
      }
    }
  },
}

export default def
import type {Vocabulary} from "../../types"
import formatKeyword from "./format"

const format: Vocabulary = [formatKeyword]

export default format
import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, not, getProperty, Name} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullableObject} from "./nullable"
import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error"
import {DiscrError, DiscrErrorObj} from "../discriminator/types"

export type JTDDiscriminatorError =
  | _JTDTypeError<"discriminator", "object", string>
  | DiscrErrorObj<DiscrError.Tag>
  | DiscrErrorObj<DiscrError.Mapping>

const error: KeywordErrorDefinition = {
  message: (cxt) => {
    const {schema, params} = cxt
    return params.discrError
      ? params.discrError === DiscrError.Tag
        ? `tag "${schema}" must be string`
        : `value of tag "${schema}" must be in mapping`
      : typeErrorMessage(cxt, "object")
  },
  params: (cxt) => {
    const {schema, params} = cxt
    return params.discrError
      ? _`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}`
      : typeErrorParams(cxt, "object")
  },
}

const def: CodeKeywordDefinition = {
  keyword: "discriminator",
  schemaType: "string",
  implements: ["mapping"],
  error,
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, data, schema, parentSchema} = cxt
    const [valid, cond] = checkNullableObject(cxt, data)

    gen.if(cond)
    validateDiscriminator()
    gen.elseIf(not(valid))
    cxt.error()
    gen.endIf()
    cxt.ok(valid)

    function validateDiscriminator(): void {
      const tag = gen.const("tag", _`${data}${getProperty(schema)}`)
      gen.if(_`${tag} === undefined`)
      cxt.error(false, {discrError: DiscrError.Tag, tag})
      gen.elseIf(_`typeof ${tag} == "string"`)
      validateMapping(tag)
      gen.else()
      cxt.error(false, {discrError: DiscrError.Tag, tag}, {instancePath: schema})
      gen.endIf()
    }

    function validateMapping(tag: Name): void {
      gen.if(false)
      for (const tagValue in parentSchema.mapping) {
        gen.elseIf(_`${tag} === ${tagValue}`)
        gen.assign(valid, applyTagSchema(tagValue))
      }
      gen.else()
      cxt.error(
        false,
        {discrError: DiscrError.Mapping, tag},
        {instancePath: schema, schemaPath: "mapping", parentSchema: true}
      )
      gen.endIf()
    }

    function applyTagSchema(schemaProp: string): Name {
      const _valid = gen.name("valid")
      cxt.subschema(
        {
          keyword: "mapping",
          schemaProp,
          jtdDiscriminator: schema,
        },
        _valid
      )
      return _valid
    }
  },
}

export default def
import type {CodeKeywordDefinition, SchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema} from "../../compile/util"
import {validateArray} from "../code"
import {_, not} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullable} from "./nullable"
import {typeError, _JTDTypeError} from "./error"

export type JTDElementsError = _JTDTypeError<"elements", "array", SchemaObject>

const def: CodeKeywordDefinition = {
  keyword: "elements",
  schemaType: "object",
  error: typeError("array"),
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, data, schema, it} = cxt
    if (alwaysValidSchema(it, schema)) return
    const [valid] = checkNullable(cxt)
    gen.if(not(valid), () =>
      gen.if(
        _`Array.isArray(${data})`,
        () => gen.assign(valid, validateArray(cxt)),
        () => cxt.error()
      )
    )
    cxt.ok(valid)
  },
}

export default def
import type {CodeKeywordDefinition, KeywordErrorDefinition, ErrorObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, or, and, Code} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullable} from "./nullable"

export type JTDEnumError = ErrorObject<"enum", {allowedValues: string[]}, string[]>

const error: KeywordErrorDefinition = {
  message: "must be equal to one of the allowed values",
  params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "enum",
  schemaType: "array",
  error,
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, data, schema, schemaValue, parentSchema, it} = cxt
    if (schema.length === 0) throw new Error("enum must have non-empty array")
    if (schema.length !== new Set(schema).size) throw new Error("enum items must be unique")
    let valid: Code
    const isString = _`typeof ${data} == "string"`
    if (schema.length >= it.opts.loopEnum) {
      let cond: Code
      ;[valid, cond] = checkNullable(cxt, isString)
      gen.if(cond, loopEnum)
    } else {
      /* istanbul ignore if */
      if (!Array.isArray(schema)) throw new Error("ajv implementation error")
      valid = and(isString, or(...schema.map((value: string) => _`${data} === ${value}`)))
      if (parentSchema.nullable) valid = or(_`${data} === null`, valid)
    }
    cxt.pass(valid)

    function loopEnum(): void {
      gen.forOf("v", schemaValue as Code, (v) =>
        gen.if(_`${valid} = ${data} === ${v}`, () => gen.break())
      )
    }
  },
}

export default def
import type {KeywordErrorDefinition, KeywordErrorCxt, ErrorObject} from "../../types"
import {_, Code} from "../../compile/codegen"

export type _JTDTypeError<K extends string, T extends string, S> = ErrorObject<
  K,
  {type: T; nullable: boolean},
  S
>

export function typeError(t: string): KeywordErrorDefinition {
  return {
    message: (cxt) => typeErrorMessage(cxt, t),
    params: (cxt) => typeErrorParams(cxt, t),
  }
}

export function typeErrorMessage({parentSchema}: KeywordErrorCxt, t: string): string {
  return parentSchema?.nullable ? `must be ${t} or null` : `must be ${t}`
}

export function typeErrorParams({parentSchema}: KeywordErrorCxt, t: string): Code {
  return _`{type: ${t}, nullable: ${!!parentSchema?.nullable}}`
}
import type {Vocabulary} from "../../types"
import refKeyword from "./ref"
import typeKeyword, {JTDTypeError} from "./type"
import enumKeyword, {JTDEnumError} from "./enum"
import elements, {JTDElementsError} from "./elements"
import properties, {JTDPropertiesError} from "./properties"
import optionalProperties from "./optionalProperties"
import discriminator, {JTDDiscriminatorError} from "./discriminator"
import values, {JTDValuesError} from "./values"
import union from "./union"
import metadata from "./metadata"

const jtdVocabulary: Vocabulary = [
  "definitions",
  refKeyword,
  typeKeyword,
  enumKeyword,
  elements,
  properties,
  optionalProperties,
  discriminator,
  values,
  union,
  metadata,
  {keyword: "additionalProperties", schemaType: "boolean"},
  {keyword: "nullable", schemaType: "boolean"},
]

export default jtdVocabulary

export type JTDErrorObject =
  | JTDTypeError
  | JTDEnumError
  | JTDElementsError
  | JTDPropertiesError
  | JTDDiscriminatorError
  | JTDValuesError
import {KeywordCxt} from "../../ajv"
import type {CodeKeywordDefinition} from "../../types"
import {alwaysValidSchema} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: "metadata",
  schemaType: "object",
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, schema, it} = cxt
    if (alwaysValidSchema(it, schema)) return
    const valid = gen.name("valid")
    cxt.subschema({keyword: "metadata", jtdMetadata: true}, valid)
    cxt.ok(valid)
  },
}

export function checkMetadata({it, keyword}: KeywordCxt, metadata?: boolean): void {
  if (it.jtdMetadata !== metadata) {
    throw new Error(`JTD: "${keyword}" cannot be used in this schema location`)
  }
}

export default def
import type {KeywordCxt} from "../../compile/validate"
import {_, not, nil, Code, Name} from "../../compile/codegen"

export function checkNullable(
  {gen, data, parentSchema}: KeywordCxt,
  cond: Code = nil
): [Name, Code] {
  const valid = gen.name("valid")
  if (parentSchema.nullable) {
    gen.let(valid, _`${data} === null`)
    cond = not(valid)
  } else {
    gen.let(valid, false)
  }
  return [valid, cond]
}

export function checkNullableObject(cxt: KeywordCxt, cond: Code): [Name, Code] {
  const [valid, cond_] = checkNullable(cxt, cond)
  return [valid, _`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]
}
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {validateProperties, error} from "./properties"

const def: CodeKeywordDefinition = {
  keyword: "optionalProperties",
  schemaType: "object",
  error,
  code(cxt: KeywordCxt) {
    if (cxt.parentSchema.properties) return
    validateProperties(cxt)
  },
}

export default def
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  SchemaObject,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {propertyInData, allSchemaProperties, isOwnProperty} from "../code"
import {alwaysValidSchema, schemaRefOrVal} from "../../compile/util"
import {_, and, not, Code, Name} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullableObject} from "./nullable"
import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error"

enum PropError {
  Additional = "additional",
  Missing = "missing",
}

type PropKeyword = "properties" | "optionalProperties"

type PropSchema = {[P in string]?: SchemaObject}

export type JTDPropertiesError =
  | _JTDTypeError<PropKeyword, "object", PropSchema>
  | ErrorObject<PropKeyword, {error: PropError.Additional; additionalProperty: string}, PropSchema>
  | ErrorObject<PropKeyword, {error: PropError.Missing; missingProperty: string}, PropSchema>

export const error: KeywordErrorDefinition = {
  message: (cxt) => {
    const {params} = cxt
    return params.propError
      ? params.propError === PropError.Additional
        ? "must NOT have additional properties"
        : `must have property '${params.missingProperty}'`
      : typeErrorMessage(cxt, "object")
  },
  params: (cxt) => {
    const {params} = cxt
    return params.propError
      ? params.propError === PropError.Additional
        ? _`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}`
        : _`{error: ${params.propError}, missingProperty: ${params.missingProperty}}`
      : typeErrorParams(cxt, "object")
  },
}

const def: CodeKeywordDefinition = {
  keyword: "properties",
  schemaType: "object",
  error,
  code: validateProperties,
}

// const error: KeywordErrorDefinition = {
//   message: "should NOT have additional properties",
//   params: ({params}) => _`{additionalProperty: ${params.additionalProperty}}`,
// }

export function validateProperties(cxt: KeywordCxt): void {
  checkMetadata(cxt)
  const {gen, data, parentSchema, it} = cxt
  const {additionalProperties, nullable} = parentSchema
  if (it.jtdDiscriminator && nullable) throw new Error("JTD: nullable inside discriminator mapping")
  if (commonProperties()) {
    throw new Error("JTD: properties and optionalProperties have common members")
  }
  const [allProps, properties] = schemaProperties("properties")
  const [allOptProps, optProperties] = schemaProperties("optionalProperties")
  if (properties.length === 0 && optProperties.length === 0 && additionalProperties) {
    return
  }

  const [valid, cond] =
    it.jtdDiscriminator === undefined
      ? checkNullableObject(cxt, data)
      : [gen.let("valid", false), true]
  gen.if(cond, () =>
    gen.assign(valid, true).block(() => {
      validateProps(properties, "properties", true)
      validateProps(optProperties, "optionalProperties")
      if (!additionalProperties) validateAdditional()
    })
  )
  cxt.pass(valid)

  function commonProperties(): boolean {
    const props = parentSchema.properties as Record<string, any> | undefined
    const optProps = parentSchema.optionalProperties as Record<string, any> | undefined
    if (!(props && optProps)) return false
    for (const p in props) {
      if (Object.prototype.hasOwnProperty.call(optProps, p)) return true
    }
    return false
  }

  function schemaProperties(keyword: string): [string[], string[]] {
    const schema = parentSchema[keyword]
    const allPs = schema ? allSchemaProperties(schema) : []
    if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) {
      throw new Error(`JTD: discriminator tag used in ${keyword}`)
    }
    const ps = allPs.filter((p) => !alwaysValidSchema(it, schema[p]))
    return [allPs, ps]
  }

  function validateProps(props: string[], keyword: string, required?: boolean): void {
    const _valid = gen.var("valid")
    for (const prop of props) {
      gen.if(
        propertyInData(gen, data, prop, it.opts.ownProperties),
        () => applyPropertySchema(prop, keyword, _valid),
        () => missingProperty(prop)
      )
      cxt.ok(_valid)
    }

    function missingProperty(prop: string): void {
      if (required) {
        gen.assign(_valid, false)
        cxt.error(false, {propError: PropError.Missing, missingProperty: prop}, {schemaPath: prop})
      } else {
        gen.assign(_valid, true)
      }
    }
  }

  function applyPropertySchema(prop: string, keyword: string, _valid: Name): void {
    cxt.subschema(
      {
        keyword,
        schemaProp: prop,
        dataProp: prop,
      },
      _valid
    )
  }

  function validateAdditional(): void {
    gen.forIn("key", data, (key: Name) => {
      const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator)
      const addOptProp = isAdditional(key, allOptProps, "optionalProperties")
      const extra =
        addProp === true ? addOptProp : addOptProp === true ? addProp : and(addProp, addOptProp)
      gen.if(extra, () => {
        if (it.opts.removeAdditional) {
          gen.code(_`delete ${data}[${key}]`)
        } else {
          cxt.error(
            false,
            {propError: PropError.Additional, additionalProperty: key},
            {instancePath: key, parentSchema: true}
          )
          if (!it.opts.allErrors) gen.break()
        }
      })
    })
  }

  function isAdditional(
    key: Name,
    props: string[],
    keyword: string,
    jtdDiscriminator?: string
  ): Code | true {
    let additional: Code | boolean
    if (props.length > 8) {
      // TODO maybe an option instead of hard-coded 8?
      const propsSchema = schemaRefOrVal(it, parentSchema[keyword], keyword)
      additional = not(isOwnProperty(gen, propsSchema as Code, key))
      if (jtdDiscriminator !== undefined) {
        additional = and(additional, _`${key} !== ${jtdDiscriminator}`)
      }
    } else if (props.length || jtdDiscriminator !== undefined) {
      const ps = jtdDiscriminator === undefined ? props : [jtdDiscriminator].concat(props)
      additional = and(...ps.map((p) => _`${key} !== ${p}`))
    } else {
      additional = true
    }
    return additional
  }
}

export default def
import type {CodeKeywordDefinition, AnySchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {compileSchema, SchemaEnv} from "../../compile"
import {_, not, nil, stringify} from "../../compile/codegen"
import MissingRefError from "../../compile/ref_error"
import N from "../../compile/names"
import {getValidate, callRef} from "../core/ref"
import {checkMetadata} from "./metadata"

const def: CodeKeywordDefinition = {
  keyword: "ref",
  schemaType: "string",
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, data, schema: ref, parentSchema, it} = cxt
    const {
      schemaEnv: {root},
    } = it
    const valid = gen.name("valid")
    if (parentSchema.nullable) {
      gen.var(valid, _`${data} === null`)
      gen.if(not(valid), validateJtdRef)
    } else {
      gen.var(valid, false)
      validateJtdRef()
    }
    cxt.ok(valid)

    function validateJtdRef(): void {
      const refSchema = (root.schema as AnySchemaObject).definitions?.[ref]
      if (!refSchema) {
        throw new MissingRefError(it.opts.uriResolver, "", ref, `No definition ${ref}`)
      }
      if (hasRef(refSchema) || !it.opts.inlineRefs) callValidate(refSchema)
      else inlineRefSchema(refSchema)
    }

    function callValidate(schema: AnySchemaObject): void {
      const sch = compileSchema.call(
        it.self,
        new SchemaEnv({schema, root, schemaPath: `/definitions/${ref}`})
      )
      const v = getValidate(cxt, sch)
      const errsCount = gen.const("_errs", N.errors)
      callRef(cxt, v, sch, sch.$async)
      gen.assign(valid, _`${errsCount} === ${N.errors}`)
    }

    function inlineRefSchema(schema: AnySchemaObject): void {
      const schName = gen.scopeValue(
        "schema",
        it.opts.code.source === true ? {ref: schema, code: stringify(schema)} : {ref: schema}
      )
      cxt.subschema(
        {
          schema,
          dataTypes: [],
          schemaPath: nil,
          topSchemaRef: schName,
          errSchemaPath: `/definitions/${ref}`,
        },
        valid
      )
    }
  },
}

export function hasRef(schema: AnySchemaObject): boolean {
  for (const key in schema) {
    let sch: AnySchemaObject
    if (key === "ref" || (typeof (sch = schema[key]) == "object" && hasRef(sch))) return true
  }
  return false
}

export default def
import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, nil, or, Code} from "../../compile/codegen"
import validTimestamp from "../../runtime/timestamp"
import {useFunc} from "../../compile/util"
import {checkMetadata} from "./metadata"
import {typeErrorMessage, typeErrorParams, _JTDTypeError} from "./error"

export type JTDTypeError = _JTDTypeError<"type", JTDType, JTDType>

export type IntType = "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"

export const intRange: {[T in IntType]: [number, number, number]} = {
  int8: [-128, 127, 3],
  uint8: [0, 255, 3],
  int16: [-32768, 32767, 5],
  uint16: [0, 65535, 5],
  int32: [-2147483648, 2147483647, 10],
  uint32: [0, 4294967295, 10],
}

export type JTDType = "boolean" | "string" | "timestamp" | "float32" | "float64" | IntType

const error: KeywordErrorDefinition = {
  message: (cxt) => typeErrorMessage(cxt, cxt.schema),
  params: (cxt) => typeErrorParams(cxt, cxt.schema),
}

function timestampCode(cxt: KeywordCxt): Code {
  const {gen, data, it} = cxt
  const {timestamp, allowDate} = it.opts
  if (timestamp === "date") return _`${data} instanceof Date `
  const vts = useFunc(gen, validTimestamp)
  const allowDateArg = allowDate ? _`, true` : nil
  const validString = _`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`
  return timestamp === "string" ? validString : or(_`${data} instanceof Date`, validString)
}

const def: CodeKeywordDefinition = {
  keyword: "type",
  schemaType: "string",
  error,
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {data, schema, parentSchema, it} = cxt
    let cond: Code
    switch (schema) {
      case "boolean":
      case "string":
        cond = _`typeof ${data} == ${schema}`
        break
      case "timestamp": {
        cond = timestampCode(cxt)
        break
      }
      case "float32":
      case "float64":
        cond = _`typeof ${data} == "number"`
        break
      default: {
        const sch = schema as IntType
        cond = _`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`
        if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) {
          if (sch === "uint32") cond = _`${cond} && ${data} >= 0`
        } else {
          const [min, max] = intRange[sch]
          cond = _`${cond} && ${data} >= ${min} && ${data} <= ${max}`
        }
      }
    }
    cxt.pass(parentSchema.nullable ? or(_`${data} === null`, cond) : cond)
  },
}

export default def
import type {CodeKeywordDefinition} from "../../types"
import {validateUnion} from "../code"

const def: CodeKeywordDefinition = {
  keyword: "union",
  schemaType: "array",
  trackErrors: true,
  code: validateUnion,
  error: {message: "must match a schema in union"},
}

export default def
import type {CodeKeywordDefinition, SchemaObject} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {alwaysValidSchema, Type} from "../../compile/util"
import {not, or, Name} from "../../compile/codegen"
import {checkMetadata} from "./metadata"
import {checkNullableObject} from "./nullable"
import {typeError, _JTDTypeError} from "./error"

export type JTDValuesError = _JTDTypeError<"values", "object", SchemaObject>

const def: CodeKeywordDefinition = {
  keyword: "values",
  schemaType: "object",
  error: typeError("object"),
  code(cxt: KeywordCxt) {
    checkMetadata(cxt)
    const {gen, data, schema, it} = cxt
    const [valid, cond] = checkNullableObject(cxt, data)
    if (alwaysValidSchema(it, schema)) {
      gen.if(not(or(cond, valid)), () => cxt.error())
    } else {
      gen.if(cond)
      gen.assign(valid, validateMap())
      gen.elseIf(not(valid))
      cxt.error()
      gen.endIf()
    }
    cxt.ok(valid)

    function validateMap(): Name | boolean {
      const _valid = gen.name("valid")
      if (it.allErrors) {
        const validMap = gen.let("valid", true)
        validateValues(() => gen.assign(validMap, false))
        return validMap
      }
      gen.var(_valid, true)
      validateValues(() => gen.break())
      return _valid

      function validateValues(notValid: () => void): void {
        gen.forIn("key", data, (key) => {
          cxt.subschema(
            {
              keyword: "values",
              dataProp: key,
              dataPropType: Type.Str,
            },
            _valid
          )
          gen.if(not(_valid), notValid)
        })
      }
    }
  },
}

export default def
import type {Vocabulary} from "../types"

export const metadataVocabulary: Vocabulary = [
  "title",
  "description",
  "default",
  "deprecated",
  "readOnly",
  "writeOnly",
  "examples",
]

export const contentVocabulary: Vocabulary = [
  "contentMediaType",
  "contentEncoding",
  "contentSchema",
]
import type {Vocabulary} from "../types"
import dependentRequired from "./validation/dependentRequired"
import dependentSchemas from "./applicator/dependentSchemas"
import limitContains from "./validation/limitContains"

const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains]

export default next
import type {Vocabulary} from "../../types"
import unevaluatedProperties from "./unevaluatedProperties"
import unevaluatedItems from "./unevaluatedItems"

const unevaluated: Vocabulary = [unevaluatedProperties, unevaluatedItems]

export default unevaluated
import type {
  CodeKeywordDefinition,
  ErrorObject,
  KeywordErrorDefinition,
  AnySchema,
} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, not, Name} from "../../compile/codegen"
import {alwaysValidSchema, Type} from "../../compile/util"

export type UnevaluatedItemsError = ErrorObject<"unevaluatedItems", {limit: number}, AnySchema>

const error: KeywordErrorDefinition = {
  message: ({params: {len}}) => str`must NOT have more than ${len} items`,
  params: ({params: {len}}) => _`{limit: ${len}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "unevaluatedItems",
  type: "array",
  schemaType: ["boolean", "object"],
  error,
  code(cxt: KeywordCxt) {
    const {gen, schema, data, it} = cxt
    const items = it.items || 0
    if (items === true) return
    const len = gen.const("len", _`${data}.length`)
    if (schema === false) {
      cxt.setParams({len: items})
      cxt.fail(_`${len} > ${items}`)
    } else if (typeof schema == "object" && !alwaysValidSchema(it, schema)) {
      const valid = gen.var("valid", _`${len} <= ${items}`)
      gen.if(not(valid), () => validateItems(valid, items))
      cxt.ok(valid)
    }
    it.items = true

    function validateItems(valid: Name, from: Name | number): void {
      gen.forRange("i", from, len, (i) => {
        cxt.subschema({keyword: "unevaluatedItems", dataProp: i, dataPropType: Type.Num}, valid)
        if (!it.allErrors) gen.if(not(valid), () => gen.break())
      })
    }
  },
}

export default def
import type {
  CodeKeywordDefinition,
  KeywordErrorDefinition,
  ErrorObject,
  AnySchema,
} from "../../types"
import {_, not, and, Name, Code} from "../../compile/codegen"
import {alwaysValidSchema, Type} from "../../compile/util"
import N from "../../compile/names"

export type UnevaluatedPropertiesError = ErrorObject<
  "unevaluatedProperties",
  {unevaluatedProperty: string},
  AnySchema
>

const error: KeywordErrorDefinition = {
  message: "must NOT have unevaluated properties",
  params: ({params}) => _`{unevaluatedProperty: ${params.unevaluatedProperty}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "unevaluatedProperties",
  type: "object",
  schemaType: ["boolean", "object"],
  trackErrors: true,
  error,
  code(cxt) {
    const {gen, schema, data, errsCount, it} = cxt
    /* istanbul ignore if */
    if (!errsCount) throw new Error("ajv implementation error")
    const {allErrors, props} = it
    if (props instanceof Name) {
      gen.if(_`${props} !== true`, () =>
        gen.forIn("key", data, (key: Name) =>
          gen.if(unevaluatedDynamic(props, key), () => unevaluatedPropCode(key))
        )
      )
    } else if (props !== true) {
      gen.forIn("key", data, (key: Name) =>
        props === undefined
          ? unevaluatedPropCode(key)
          : gen.if(unevaluatedStatic(props, key), () => unevaluatedPropCode(key))
      )
    }
    it.props = true
    cxt.ok(_`${errsCount} === ${N.errors}`)

    function unevaluatedPropCode(key: Name): void {
      if (schema === false) {
        cxt.setParams({unevaluatedProperty: key})
        cxt.error()
        if (!allErrors) gen.break()
        return
      }

      if (!alwaysValidSchema(it, schema)) {
        const valid = gen.name("valid")
        cxt.subschema(
          {
            keyword: "unevaluatedProperties",
            dataProp: key,
            dataPropType: Type.Str,
          },
          valid
        )
        if (!allErrors) gen.if(not(valid), () => gen.break())
      }
    }

    function unevaluatedDynamic(evaluatedProps: Name, key: Name): Code {
      return _`!${evaluatedProps} || !${evaluatedProps}[${key}]`
    }

    function unevaluatedStatic(evaluatedProps: {[K in string]?: true}, key: Name): Code {
      const ps: Code[] = []
      for (const p in evaluatedProps) {
        if (evaluatedProps[p] === true) ps.push(_`${key} !== ${p}`)
      }
      return and(...ps)
    }
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_} from "../../compile/codegen"
import {useFunc} from "../../compile/util"
import equal from "../../runtime/equal"

export type ConstError = ErrorObject<"const", {allowedValue: any}>

const error: KeywordErrorDefinition = {
  message: "must be equal to constant",
  params: ({schemaCode}) => _`{allowedValue: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "const",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, data, $data, schemaCode, schema} = cxt
    if ($data || (schema && typeof schema == "object")) {
      cxt.fail$data(_`!${useFunc(gen, equal)}(${data}, ${schemaCode})`)
    } else {
      cxt.fail(_`${schema} !== ${data}`)
    }
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject} from "../../types"
import {
  validatePropertyDeps,
  error,
  DependenciesErrorParams,
  PropertyDependencies,
} from "../applicator/dependencies"

export type DependentRequiredError = ErrorObject<
  "dependentRequired",
  DependenciesErrorParams,
  PropertyDependencies
>

const def: CodeKeywordDefinition = {
  keyword: "dependentRequired",
  type: "object",
  schemaType: "object",
  error,
  code: (cxt) => validatePropertyDeps(cxt),
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, or, Name, Code} from "../../compile/codegen"
import {useFunc} from "../../compile/util"
import equal from "../../runtime/equal"

export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}>

const error: KeywordErrorDefinition = {
  message: "must be equal to one of the allowed values",
  params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "enum",
  schemaType: "array",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, data, $data, schema, schemaCode, it} = cxt
    if (!$data && schema.length === 0) throw new Error("enum must have non-empty array")
    const useLoop = schema.length >= it.opts.loopEnum
    let eql: Name | undefined
    const getEql = (): Name => (eql ??= useFunc(gen, equal))

    let valid: Code
    if (useLoop || $data) {
      valid = gen.let("valid")
      cxt.block$data(valid, loopEnum)
    } else {
      /* istanbul ignore if */
      if (!Array.isArray(schema)) throw new Error("ajv implementation error")
      const vSchema = gen.const("vSchema", schemaCode)
      valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i)))
    }
    cxt.pass(valid)

    function loopEnum(): void {
      gen.assign(valid, false)
      gen.forOf("v", schemaCode as Code, (v) =>
        gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())
      )
    }

    function equalCode(vSchema: Name, i: number): Code {
      const sch = schema[i]
      return typeof sch === "object" && sch !== null
        ? _`${getEql()}(${data}, ${vSchema}[${i}])`
        : _`${data} === ${sch}`
    }
  },
}

export default def
import type {ErrorObject, Vocabulary} from "../../types"
import limitNumber, {LimitNumberError} from "./limitNumber"
import multipleOf, {MultipleOfError} from "./multipleOf"
import limitLength from "./limitLength"
import pattern, {PatternError} from "./pattern"
import limitProperties from "./limitProperties"
import required, {RequiredError} from "./required"
import limitItems from "./limitItems"
import uniqueItems, {UniqueItemsError} from "./uniqueItems"
import constKeyword, {ConstError} from "./const"
import enumKeyword, {EnumError} from "./enum"

const validation: Vocabulary = [
  // number
  limitNumber,
  multipleOf,
  // string
  limitLength,
  pattern,
  // object
  limitProperties,
  required,
  // array
  limitItems,
  uniqueItems,
  // any
  {keyword: "type", schemaType: ["string", "array"]},
  {keyword: "nullable", schemaType: "boolean"},
  constKeyword,
  enumKeyword,
]

export default validation

type LimitError = ErrorObject<
  "maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength",
  {limit: number},
  number | {$data: string}
>

export type ValidationKeywordError =
  | LimitError
  | LimitNumberError
  | MultipleOfError
  | PatternError
  | RequiredError
  | UniqueItemsError
  | ConstError
  | EnumError
import type {CodeKeywordDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkStrictMode} from "../../compile/util"

const def: CodeKeywordDefinition = {
  keyword: ["maxContains", "minContains"],
  type: "array",
  schemaType: "number",
  code({keyword, parentSchema, it}: KeywordCxt) {
    if (parentSchema.contains === undefined) {
      checkStrictMode(it, `"${keyword}" without "contains" is ignored`)
    }
  },
}

export default def
import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, operators} from "../../compile/codegen"

const error: KeywordErrorDefinition = {
  message({keyword, schemaCode}) {
    const comp = keyword === "maxItems" ? "more" : "fewer"
    return str`must NOT have ${comp} than ${schemaCode} items`
  },
  params: ({schemaCode}) => _`{limit: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: ["maxItems", "minItems"],
  type: "array",
  schemaType: "number",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {keyword, data, schemaCode} = cxt
    const op = keyword === "maxItems" ? operators.GT : operators.LT
    cxt.fail$data(_`${data}.length ${op} ${schemaCode}`)
  },
}

export default def
import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, operators} from "../../compile/codegen"
import {useFunc} from "../../compile/util"
import ucs2length from "../../runtime/ucs2length"

const error: KeywordErrorDefinition = {
  message({keyword, schemaCode}) {
    const comp = keyword === "maxLength" ? "more" : "fewer"
    return str`must NOT have ${comp} than ${schemaCode} characters`
  },
  params: ({schemaCode}) => _`{limit: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: ["maxLength", "minLength"],
  type: "string",
  schemaType: "number",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {keyword, data, schemaCode, it} = cxt
    const op = keyword === "maxLength" ? operators.GT : operators.LT
    const len =
      it.opts.unicode === false ? _`${data}.length` : _`${useFunc(cxt.gen, ucs2length)}(${data})`
    cxt.fail$data(_`${len} ${op} ${schemaCode}`)
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, operators, Code} from "../../compile/codegen"

const ops = operators

type Kwd = "maximum" | "minimum" | "exclusiveMaximum" | "exclusiveMinimum"

type Comparison = "<=" | ">=" | "<" | ">"

const KWDs: {[K in Kwd]: {okStr: Comparison; ok: Code; fail: Code}} = {
  maximum: {okStr: "<=", ok: ops.LTE, fail: ops.GT},
  minimum: {okStr: ">=", ok: ops.GTE, fail: ops.LT},
  exclusiveMaximum: {okStr: "<", ok: ops.LT, fail: ops.GTE},
  exclusiveMinimum: {okStr: ">", ok: ops.GT, fail: ops.LTE},
}

export type LimitNumberError = ErrorObject<
  Kwd,
  {limit: number; comparison: Comparison},
  number | {$data: string}
>

const error: KeywordErrorDefinition = {
  message: ({keyword, schemaCode}) => str`must be ${KWDs[keyword as Kwd].okStr} ${schemaCode}`,
  params: ({keyword, schemaCode}) =>
    _`{comparison: ${KWDs[keyword as Kwd].okStr}, limit: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: Object.keys(KWDs),
  type: "number",
  schemaType: "number",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {keyword, data, schemaCode} = cxt
    cxt.fail$data(_`${data} ${KWDs[keyword as Kwd].fail} ${schemaCode} || isNaN(${data})`)
  },
}

export default def
import type {CodeKeywordDefinition, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str, operators} from "../../compile/codegen"

const error: KeywordErrorDefinition = {
  message({keyword, schemaCode}) {
    const comp = keyword === "maxProperties" ? "more" : "fewer"
    return str`must NOT have ${comp} than ${schemaCode} properties`
  },
  params: ({schemaCode}) => _`{limit: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: ["maxProperties", "minProperties"],
  type: "object",
  schemaType: "number",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {keyword, data, schemaCode} = cxt
    const op = keyword === "maxProperties" ? operators.GT : operators.LT
    cxt.fail$data(_`Object.keys(${data}).length ${op} ${schemaCode}`)
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, str} from "../../compile/codegen"

export type MultipleOfError = ErrorObject<
  "multipleOf",
  {multipleOf: number},
  number | {$data: string}
>

const error: KeywordErrorDefinition = {
  message: ({schemaCode}) => str`must be multiple of ${schemaCode}`,
  params: ({schemaCode}) => _`{multipleOf: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "multipleOf",
  type: "number",
  schemaType: "number",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, data, schemaCode, it} = cxt
    // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
    const prec = it.opts.multipleOfPrecision
    const res = gen.let("res")
    const invalid = prec
      ? _`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
      : _`${res} !== parseInt(${res})`
    cxt.fail$data(_`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`)
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {usePattern} from "../code"
import {_, str} from "../../compile/codegen"

export type PatternError = ErrorObject<"pattern", {pattern: string}, string | {$data: string}>

const error: KeywordErrorDefinition = {
  message: ({schemaCode}) => str`must match pattern "${schemaCode}"`,
  params: ({schemaCode}) => _`{pattern: ${schemaCode}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "pattern",
  type: "string",
  schemaType: "string",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {data, $data, schema, schemaCode, it} = cxt
    // TODO regexp should be wrapped in try/catchs
    const u = it.opts.unicodeRegExp ? "u" : ""
    const regExp = $data ? _`(new RegExp(${schemaCode}, ${u}))` : usePattern(cxt, schema)
    cxt.fail$data(_`!${regExp}.test(${data})`)
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {
  checkReportMissingProp,
  checkMissingProp,
  reportMissingProp,
  propertyInData,
  noPropertyInData,
} from "../code"
import {_, str, nil, not, Name, Code} from "../../compile/codegen"
import {checkStrictMode} from "../../compile/util"

export type RequiredError = ErrorObject<
  "required",
  {missingProperty: string},
  string[] | {$data: string}
>

const error: KeywordErrorDefinition = {
  message: ({params: {missingProperty}}) => str`must have required property '${missingProperty}'`,
  params: ({params: {missingProperty}}) => _`{missingProperty: ${missingProperty}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "required",
  type: "object",
  schemaType: "array",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, schema, schemaCode, data, $data, it} = cxt
    const {opts} = it
    if (!$data && schema.length === 0) return
    const useLoop = schema.length >= opts.loopRequired
    if (it.allErrors) allErrorsMode()
    else exitOnErrorMode()

    if (opts.strictRequired) {
      const props = cxt.parentSchema.properties
      const {definedProperties} = cxt.it
      for (const requiredKey of schema) {
        if (props?.[requiredKey] === undefined && !definedProperties.has(requiredKey)) {
          const schemaPath = it.schemaEnv.baseId + it.errSchemaPath
          const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`
          checkStrictMode(it, msg, it.opts.strictRequired)
        }
      }
    }

    function allErrorsMode(): void {
      if (useLoop || $data) {
        cxt.block$data(nil, loopAllRequired)
      } else {
        for (const prop of schema) {
          checkReportMissingProp(cxt, prop)
        }
      }
    }

    function exitOnErrorMode(): void {
      const missing = gen.let("missing")
      if (useLoop || $data) {
        const valid = gen.let("valid", true)
        cxt.block$data(valid, () => loopUntilMissing(missing, valid))
        cxt.ok(valid)
      } else {
        gen.if(checkMissingProp(cxt, schema, missing))
        reportMissingProp(cxt, missing)
        gen.else()
      }
    }

    function loopAllRequired(): void {
      gen.forOf("prop", schemaCode as Code, (prop) => {
        cxt.setParams({missingProperty: prop})
        gen.if(noPropertyInData(gen, data, prop, opts.ownProperties), () => cxt.error())
      })
    }

    function loopUntilMissing(missing: Name, valid: Name): void {
      cxt.setParams({missingProperty: missing})
      gen.forOf(
        missing,
        schemaCode as Code,
        () => {
          gen.assign(valid, propertyInData(gen, data, missing, opts.ownProperties))
          gen.if(not(valid), () => {
            cxt.error()
            gen.break()
          })
        },
        nil
      )
    }
  },
}

export default def
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {checkDataTypes, getSchemaTypes, DataType} from "../../compile/validate/dataType"
import {_, str, Name} from "../../compile/codegen"
import {useFunc} from "../../compile/util"
import equal from "../../runtime/equal"

export type UniqueItemsError = ErrorObject<
  "uniqueItems",
  {i: number; j: number},
  boolean | {$data: string}
>

const error: KeywordErrorDefinition = {
  message: ({params: {i, j}}) =>
    str`must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
  params: ({params: {i, j}}) => _`{i: ${i}, j: ${j}}`,
}

const def: CodeKeywordDefinition = {
  keyword: "uniqueItems",
  type: "array",
  schemaType: "boolean",
  $data: true,
  error,
  code(cxt: KeywordCxt) {
    const {gen, data, $data, schema, parentSchema, schemaCode, it} = cxt
    if (!$data && !schema) return
    const valid = gen.let("valid")
    const itemTypes = parentSchema.items ? getSchemaTypes(parentSchema.items) : []
    cxt.block$data(valid, validateUniqueItems, _`${schemaCode} === false`)
    cxt.ok(valid)

    function validateUniqueItems(): void {
      const i = gen.let("i", _`${data}.length`)
      const j = gen.let("j")
      cxt.setParams({i, j})
      gen.assign(valid, true)
      gen.if(_`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j))
    }

    function canOptimize(): boolean {
      return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array")
    }

    function loopN(i: Name, j: Name): void {
      const item = gen.name("item")
      const wrongType = checkDataTypes(itemTypes, item, it.opts.strictNumbers, DataType.Wrong)
      const indices = gen.const("indices", _`{}`)
      gen.for(_`;${i}--;`, () => {
        gen.let(item, _`${data}[${i}]`)
        gen.if(wrongType, _`continue`)
        if (itemTypes.length > 1) gen.if(_`typeof ${item} == "string"`, _`${item} += "_"`)
        gen
          .if(_`typeof ${indices}[${item}] == "number"`, () => {
            gen.assign(j, _`${indices}[${item}]`)
            cxt.error()
            gen.assign(valid, false).break()
          })
          .code(_`${indices}[${item}] = ${i}`)
      })
    }

    function loopN2(i: Name, j: Name): void {
      const eql = useFunc(gen, equal)
      const outer = gen.name("outer")
      gen.label(outer).for(_`;${i}--;`, () =>
        gen.for(_`${j} = ${i}; ${j}--;`, () =>
          gen.if(_`${eql}(${data}[${i}], ${data}[${j}])`, () => {
            cxt.error()
            gen.assign(valid, false).break(outer)
          })
        )
      )
    }
  },
}

export default def
The MIT License (MIT)

Copyright (c) 2015-2021 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

{
  "name": "ajv",
  "version": "8.17.1",
  "description": "Another JSON Schema Validator",
  "main": "dist/ajv.js",
  "types": "dist/ajv.d.ts",
  "files": [
    "lib/",
    "dist/",
    ".runkit_example.js"
  ],
  "scripts": {
    "eslint": "eslint \"lib/**/*.ts\" \"spec/**/*.*s\" --ignore-pattern spec/JSON-Schema-Test-Suite",
    "prettier:write": "prettier --write \"./**/*.{json,yaml,js,ts}\"",
    "prettier:check": "prettier --list-different \"./**/*.{json,yaml,js,ts}\"",
    "test-spec": "cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register \"spec/**/*.spec.{ts,js}\" -R dot",
    "test-codegen": "nyc cross-env TS_NODE_PROJECT=spec/tsconfig.json mocha -r ts-node/register 'spec/codegen.spec.ts' -R spec",
    "test-debug": "npm run test-spec -- --inspect-brk",
    "test-cov": "nyc npm run test-spec",
    "rollup": "rm -rf bundle && rollup -c",
    "bundle": "rm -rf bundle && node ./scripts/bundle.js ajv ajv7 ajv7 && node ./scripts/bundle.js 2019 ajv2019 ajv2019 && node ./scripts/bundle.js 2020 ajv2020 ajv2020 && node ./scripts/bundle.js jtd ajvJTD ajvJTD",
    "build": "rm -rf dist && tsc && cp -r lib/refs dist && rm dist/refs/json-schema-2019-09/index.ts && rm dist/refs/json-schema-2020-12/index.ts && rm dist/refs/jtd-schema.ts",
    "json-tests": "rm -rf spec/_json/*.js && node scripts/jsontests",
    "test-karma": "karma start",
    "test-browser": "rm -rf .browser && npm run bundle && scripts/prepare-tests && karma start",
    "test-all": "npm run test-cov && if-node-version 12 npm run test-browser",
    "test": "npm run json-tests && npm run prettier:check && npm run eslint && npm link && npm link --legacy-peer-deps ajv && npm run test-cov",
    "test-ci": "AJV_FULL_TEST=true npm test",
    "prepublish": "npm run build",
    "benchmark": "npm i && npm run build && npm link && cd ./benchmark && npm link --legacy-peer-deps ajv && npm i && node ./jtd",
    "docs:dev": "./scripts/prepare-site && vuepress dev docs",
    "docs:build": "./scripts/prepare-site && vuepress build docs"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  },
  "repository": "ajv-validator/ajv",
  "keywords": [
    "JSON",
    "schema",
    "validator",
    "validation",
    "jsonschema",
    "json-schema",
    "json-schema-validator",
    "json-schema-validation"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": "https://github.com/ajv-validator/ajv/issues",
  "homepage": "https://ajv.js.org",
  "runkitExampleFilename": ".runkit_example.js",
  "dependencies": {
    "fast-deep-equal": "^3.1.3",
    "fast-uri": "^3.0.1",
    "json-schema-traverse": "^1.0.0",
    "require-from-string": "^2.0.2"
  },
  "devDependencies": {
    "@ajv-validator/config": "^0.5.0",
    "@rollup/plugin-commonjs": "^25.0.7",
    "@rollup/plugin-json": "^6.1.0",
    "@rollup/plugin-node-resolve": "^15.2.3",
    "@rollup/plugin-typescript": "^11.1.6",
    "@types/chai": "^4.3.11",
    "@types/mocha": "^10.0.6",
    "@types/node": "^20.11.30",
    "@types/require-from-string": "^1.2.3",
    "@typescript-eslint/eslint-plugin": "^7.3.1",
    "@typescript-eslint/parser": "^7.3.1",
    "ajv-formats": "^3.0.1",
    "browserify": "^17.0.0",
    "chai": "^4.4.1",
    "cross-env": "^7.0.3",
    "dayjs": "^1.11.10",
    "dayjs-plugin-utc": "^0.1.2",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "glob": "^10.3.10",
    "husky": "^9.0.11",
    "if-node-version": "^1.1.1",
    "jimp": "^0.22.10",
    "js-beautify": "^1.15.1",
    "json-schema-test": "^2.0.0",
    "karma": "^6.4.2",
    "karma-chrome-launcher": "^3.2.0",
    "karma-mocha": "^2.0.1",
    "lint-staged": "^15.2.2",
    "mocha": "^10.3.0",
    "module-from-string": "^3.3.0",
    "node-fetch": "^3.3.2",
    "nyc": "^15.1.0",
    "prettier": "3.0.3",
    "re2": "^1.20.9",
    "rollup": "^2.79.1",
    "rollup-plugin-terser": "^7.0.2",
    "ts-node": "^10.9.2",
    "tsify": "^5.0.4",
    "typescript": "5.3.3",
    "uri-js": "^4.4.1"
  },
  "collective": {
    "type": "opencollective",
    "url": "https://opencollective.com/ajv"
  },
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/epoberezkin"
  },
  "prettier": "@ajv-validator/config/prettierrc.json",
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged && npm test"
    }
  },
  "lint-staged": {
    "*.{json,yaml,js,ts}": "prettier --write"
  }
}
<img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/img/ajv.svg">

&nbsp;

# Ajv JSON schema validator

The fastest JSON validator for Node.js and browser.

Supports JSON Schema draft-04/06/07/2019-09/2020-12 ([draft-04 support](https://ajv.js.org/json-schema.html#draft-04) requires ajv-draft-04 package) and JSON Type Definition [RFC8927](https://datatracker.ietf.org/doc/rfc8927/).

[![build](https://github.com/ajv-validator/ajv/actions/workflows/build.yml/badge.svg)](https://github.com/ajv-validator/ajv/actions?query=workflow%3Abuild)
[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)
[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)
[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master)
[![SimpleX](https://img.shields.io/badge/chat-on%20SimpleX-70F0F9)](https://simplex.chat/contact#/?v=1-2&smp=smp%3A%2F%2Fu2dS9sG8nMNURyZwqASV4yROM28Er0luVTx5X1CsMrU%3D%40smp4.simplex.im%2F8KvvURM6J38Gdq9dCuPswMOkMny0xCOJ%23%2F%3Fv%3D1-2%26dh%3DMCowBQYDK2VuAyEAr8rPVRuMOXv6kwF2yUAap-eoVg-9ssOFCi1fIrxTUw0%253D%26srv%3Do5vmywmrnaxalvz6wi3zicyftgio6psuvyniis6gco6bp6ekl4cqj4id.onion&data=%7B%22type%22%3A%22group%22%2C%22groupLinkId%22%3A%224pwLRgWHU9tlroMWHz0uOg%3D%3D%22%7D)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)

## Ajv sponsors

[<img src="https://ajv.js.org/img/mozilla.svg" width="45%" alt="Mozilla">](https://www.mozilla.org)<img src="https://ajv.js.org/img/gap.svg" width="9%">[<img src="https://ajv.js.org/img/reserved.svg" width="45%">](https://opencollective.com/ajv)

[<img src="https://ajv.js.org/img/microsoft.png" width="31%" alt="Microsoft">](https://opensource.microsoft.com)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="31%">](https://opencollective.com/ajv)

[<img src="https://ajv.js.org/img/retool.svg" width="22.5%" alt="Retool">](https://retool.com/?utm_source=sponsor&utm_campaign=ajv)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/tidelift.svg" width="22.5%" alt="Tidelift">](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=enterprise)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/simplex.svg" width="22.5%" alt="SimpleX">](https://github.com/simplex-chat/simplex-chat)<img src="https://ajv.js.org/img/gap.svg" width="3%">[<img src="https://ajv.js.org/img/reserved.svg" width="22.5%">](https://opencollective.com/ajv)

## Contributing

More than 100 people contributed to Ajv, and we would love to have you join the development. We welcome implementing new features that will benefit many users and ideas to improve our documentation.

Please review [Contributing guidelines](./CONTRIBUTING.md) and [Code components](https://ajv.js.org/components.html).

## Documentation

All documentation is available on the [Ajv website](https://ajv.js.org).

Some useful site links:

- [Getting started](https://ajv.js.org/guide/getting-started.html)
- [JSON Schema vs JSON Type Definition](https://ajv.js.org/guide/schema-language.html)
- [API reference](https://ajv.js.org/api.html)
- [Strict mode](https://ajv.js.org/strict-mode.html)
- [Standalone validation code](https://ajv.js.org/standalone.html)
- [Security considerations](https://ajv.js.org/security.html)
- [Command line interface](https://ajv.js.org/packages/ajv-cli.html)
- [Frequently Asked Questions](https://ajv.js.org/faq.html)

## <a name="sponsors"></a>Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin)

Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant!

Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released.

Please sponsor Ajv via:

- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it)
- [Ajv Open Collective](https://opencollective.com/ajv)

Thank you.

#### Open Collective sponsors

<a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a>

<a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/10/website"><img src="https://opencollective.com/ajv/organization/10/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/11/website"><img src="https://opencollective.com/ajv/organization/11/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/12/website"><img src="https://opencollective.com/ajv/organization/12/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/13/website"><img src="https://opencollective.com/ajv/organization/13/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/14/website"><img src="https://opencollective.com/ajv/organization/14/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/15/website"><img src="https://opencollective.com/ajv/organization/15/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/16/website"><img src="https://opencollective.com/ajv/organization/16/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/17/website"><img src="https://opencollective.com/ajv/organization/17/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/18/website"><img src="https://opencollective.com/ajv/organization/18/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/19/website"><img src="https://opencollective.com/ajv/organization/19/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/20/website"><img src="https://opencollective.com/ajv/organization/20/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/21/website"><img src="https://opencollective.com/ajv/organization/21/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/22/website"><img src="https://opencollective.com/ajv/organization/22/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/23/website"><img src="https://opencollective.com/ajv/organization/23/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/24/website"><img src="https://opencollective.com/ajv/organization/24/avatar.svg"></a>

## Performance

Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.

Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks:

- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place
- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster
- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)

Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark):

[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=62,4,1&chs=600x416&chxl=-1:|ajv|@exodus/schemasafe|is-my-json-valid|djv|@cfworker/json-schema|jsonschema/=t:100,69.2,51.5,13.1,5.1,1.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)

## Features

- Ajv implements JSON Schema [draft-06/07/2019-09/2020-12](http://json-schema.org/) standards (draft-04 is supported in v6):
  - all validation keywords (see [JSON Schema validation keywords](https://ajv.js.org/json-schema.html))
  - [OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) extensions:
    - NEW: keyword [discriminator](https://ajv.js.org/json-schema.html#discriminator).
    - keyword [nullable](https://ajv.js.org/json-schema.html#nullable).
  - full support of remote references (remote schemas have to be added with `addSchema` or compiled to be available)
  - support of recursive references between schemas
  - correct string lengths for strings with unicode pairs
  - JSON Schema [formats](https://ajv.js.org/guide/formats.html) (with [ajv-formats](https://github.com/ajv-validator/ajv-formats) plugin).
  - [validates schemas against meta-schema](https://ajv.js.org/api.html#api-validateschema)
- NEW: supports [JSON Type Definition](https://datatracker.ietf.org/doc/rfc8927/):
  - all keywords (see [JSON Type Definition schema forms](https://ajv.js.org/json-type-definition.html))
  - meta-schema for JTD schemas
  - "union" keyword and user-defined keywords (can be used inside "metadata" member of the schema)
- supports [browsers](https://ajv.js.org/guide/environments.html#browsers) and Node.js 10.x - current
- [asynchronous loading](https://ajv.js.org/guide/managing-schemas.html#asynchronous-schema-loading) of referenced schemas during compilation
- "All errors" validation mode with [option allErrors](https://ajv.js.org/options.html#allerrors)
- [error messages with parameters](https://ajv.js.org/api.html#validation-errors) describing error reasons to allow error message generation
- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package
- [removing-additional-properties](https://ajv.js.org/guide/modifying-data.html#removing-additional-properties)
- [assigning defaults](https://ajv.js.org/guide/modifying-data.html#assigning-defaults) to missing properties and items
- [coercing data](https://ajv.js.org/guide/modifying-data.html#coercing-data-types) to the types specified in `type` keywords
- [user-defined keywords](https://ajv.js.org/guide/user-keywords.html)
- additional extension keywords with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package
- [\$data reference](https://ajv.js.org/guide/combining-schemas.html#data-reference) to use values from the validated data as values for the schema keywords
- [asynchronous validation](https://ajv.js.org/guide/async-validation.html) of user-defined formats and keywords

## Install

To install version 8:

```
npm install ajv
```

## <a name="usage"></a>Getting started

Try it in the Node.js REPL: https://runkit.com/npm/ajv

In JavaScript:

```javascript
// or ESM/TypeScript import
import Ajv from "ajv"
// Node.js require:
const Ajv = require("ajv")

const ajv = new Ajv() // options can be passed, e.g. {allErrors: true}

const schema = {
  type: "object",
  properties: {
    foo: {type: "integer"},
    bar: {type: "string"},
  },
  required: ["foo"],
  additionalProperties: false,
}

const data = {
  foo: 1,
  bar: "abc",
}

const validate = ajv.compile(schema)
const valid = validate(data)
if (!valid) console.log(validate.errors)
```

Learn how to use Ajv and see more examples in the [Guide: getting started](https://ajv.js.org/guide/getting-started.html)

## Changes history

See [https://github.com/ajv-validator/ajv/releases](https://github.com/ajv-validator/ajv/releases)

**Please note**: [Changes in version 8.0.0](https://github.com/ajv-validator/ajv/releases/tag/v8.0.0)

[Version 7.0.0](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0)

[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0).

## Code of conduct

Please review and follow the [Code of conduct](./CODE_OF_CONDUCT.md).

Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team.

## Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues.

## Open-source software support

Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers.

## License

[MIT](./LICENSE)

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
v10.12.0
declare const DEFAULT_ENCODING = "utf8";
declare const DEFAULT_FILE_MODE = 438;
declare const DEFAULT_FOLDER_MODE = 511;
declare const DEFAULT_READ_OPTIONS: {};
declare const DEFAULT_WRITE_OPTIONS: {};
declare const DEFAULT_TIMEOUT_ASYNC = 5000;
declare const DEFAULT_TIMEOUT_SYNC = 100;
declare const IS_POSIX = true;
declare const IS_USER_ROOT: boolean;
declare const LIMIT_BASENAME_LENGTH = 128;
declare const LIMIT_FILES_DESCRIPTORS = 10000;
declare const NOOP: () => void;
export { DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX, IS_USER_ROOT, LIMIT_BASENAME_LENGTH, LIMIT_FILES_DESCRIPTORS, NOOP };
"use strict";
/* CONSTS */
Object.defineProperty(exports, "__esModule", { value: true });
exports.NOOP = exports.LIMIT_FILES_DESCRIPTORS = exports.LIMIT_BASENAME_LENGTH = exports.IS_USER_ROOT = exports.IS_POSIX = exports.DEFAULT_TIMEOUT_SYNC = exports.DEFAULT_TIMEOUT_ASYNC = exports.DEFAULT_WRITE_OPTIONS = exports.DEFAULT_READ_OPTIONS = exports.DEFAULT_FOLDER_MODE = exports.DEFAULT_FILE_MODE = exports.DEFAULT_ENCODING = void 0;
const DEFAULT_ENCODING = 'utf8';
exports.DEFAULT_ENCODING = DEFAULT_ENCODING;
const DEFAULT_FILE_MODE = 0o666;
exports.DEFAULT_FILE_MODE = DEFAULT_FILE_MODE;
const DEFAULT_FOLDER_MODE = 0o777;
exports.DEFAULT_FOLDER_MODE = DEFAULT_FOLDER_MODE;
const DEFAULT_READ_OPTIONS = {};
exports.DEFAULT_READ_OPTIONS = DEFAULT_READ_OPTIONS;
const DEFAULT_WRITE_OPTIONS = {};
exports.DEFAULT_WRITE_OPTIONS = DEFAULT_WRITE_OPTIONS;
const DEFAULT_TIMEOUT_ASYNC = 5000;
exports.DEFAULT_TIMEOUT_ASYNC = DEFAULT_TIMEOUT_ASYNC;
const DEFAULT_TIMEOUT_SYNC = 100;
exports.DEFAULT_TIMEOUT_SYNC = DEFAULT_TIMEOUT_SYNC;
const IS_POSIX = !!process.getuid;
exports.IS_POSIX = IS_POSIX;
const IS_USER_ROOT = process.getuid ? !process.getuid() : false;
exports.IS_USER_ROOT = IS_USER_ROOT;
const LIMIT_BASENAME_LENGTH = 128; //TODO: fetch the real limit from the filesystem //TODO: fetch the whole-path length limit too
exports.LIMIT_BASENAME_LENGTH = LIMIT_BASENAME_LENGTH;
const LIMIT_FILES_DESCRIPTORS = 10000; //TODO: fetch the real limit from the filesystem
exports.LIMIT_FILES_DESCRIPTORS = LIMIT_FILES_DESCRIPTORS;
const NOOP = () => { };
exports.NOOP = NOOP;
/// <reference types="node" />
import { Callback, Data, Path, ReadOptions, WriteOptions } from './types';
declare function readFile(filePath: Path, options: string | ReadOptions & {
    encoding: string;
}): Promise<string>;
declare function readFile(filePath: Path, options?: ReadOptions): Promise<Buffer>;
declare function readFileSync(filePath: Path, options: string | ReadOptions & {
    encoding: string;
}): string;
declare function readFileSync(filePath: Path, options?: ReadOptions): Buffer;
declare const writeFile: (filePath: Path, data: Data, options?: string | WriteOptions | Callback | undefined, callback?: Callback | undefined) => Promise<void>;
declare const writeFileSync: (filePath: Path, data: Data, options?: string | WriteOptions) => void;
export { readFile, readFileSync, writeFile, writeFileSync };
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
exports.writeFileSync = exports.writeFile = exports.readFileSync = exports.readFile = void 0;
const path = require("path");
const consts_1 = require("./consts");
const fs_1 = require("./utils/fs");
const lang_1 = require("./utils/lang");
const scheduler_1 = require("./utils/scheduler");
const temp_1 = require("./utils/temp");
function readFile(filePath, options = consts_1.DEFAULT_READ_OPTIONS) {
    var _a;
    if (lang_1.default.isString(options))
        return readFile(filePath, { encoding: options });
    const timeout = Date.now() + ((_a = options.timeout) !== null && _a !== void 0 ? _a : consts_1.DEFAULT_TIMEOUT_ASYNC);
    return fs_1.default.readFileRetry(timeout)(filePath, options);
}
exports.readFile = readFile;
;
function readFileSync(filePath, options = consts_1.DEFAULT_READ_OPTIONS) {
    var _a;
    if (lang_1.default.isString(options))
        return readFileSync(filePath, { encoding: options });
    const timeout = Date.now() + ((_a = options.timeout) !== null && _a !== void 0 ? _a : consts_1.DEFAULT_TIMEOUT_SYNC);
    return fs_1.default.readFileSyncRetry(timeout)(filePath, options);
}
exports.readFileSync = readFileSync;
;
const writeFile = (filePath, data, options, callback) => {
    if (lang_1.default.isFunction(options))
        return writeFile(filePath, data, consts_1.DEFAULT_WRITE_OPTIONS, options);
    const promise = writeFileAsync(filePath, data, options);
    if (callback)
        promise.then(callback, callback);
    return promise;
};
exports.writeFile = writeFile;
const writeFileAsync = async (filePath, data, options = consts_1.DEFAULT_WRITE_OPTIONS) => {
    var _a;
    if (lang_1.default.isString(options))
        return writeFileAsync(filePath, data, { encoding: options });
    const timeout = Date.now() + ((_a = options.timeout) !== null && _a !== void 0 ? _a : consts_1.DEFAULT_TIMEOUT_ASYNC);
    let schedulerCustomDisposer = null, schedulerDisposer = null, tempDisposer = null, tempPath = null, fd = null;
    try {
        if (options.schedule)
            schedulerCustomDisposer = await options.schedule(filePath);
        schedulerDisposer = await scheduler_1.default.schedule(filePath);
        filePath = await fs_1.default.realpathAttempt(filePath) || filePath;
        [tempPath, tempDisposer] = temp_1.default.get(filePath, options.tmpCreate || temp_1.default.create, !(options.tmpPurge === false));
        const useStatChown = consts_1.IS_POSIX && lang_1.default.isUndefined(options.chown), useStatMode = lang_1.default.isUndefined(options.mode);
        if (useStatChown || useStatMode) {
            const stat = await fs_1.default.statAttempt(filePath);
            if (stat) {
                options = { ...options };
                if (useStatChown)
                    options.chown = { uid: stat.uid, gid: stat.gid };
                if (useStatMode)
                    options.mode = stat.mode;
            }
        }
        const parentPath = path.dirname(filePath);
        await fs_1.default.mkdirAttempt(parentPath, {
            mode: consts_1.DEFAULT_FOLDER_MODE,
            recursive: true
        });
        fd = await fs_1.default.openRetry(timeout)(tempPath, 'w', options.mode || consts_1.DEFAULT_FILE_MODE);
        if (options.tmpCreated)
            options.tmpCreated(tempPath);
        if (lang_1.default.isString(data)) {
            await fs_1.default.writeRetry(timeout)(fd, data, 0, options.encoding || consts_1.DEFAULT_ENCODING);
        }
        else if (!lang_1.default.isUndefined(data)) {
            await fs_1.default.writeRetry(timeout)(fd, data, 0, data.length, 0);
        }
        if (options.fsync !== false) {
            if (options.fsyncWait !== false) {
                await fs_1.default.fsyncRetry(timeout)(fd);
            }
            else {
                fs_1.default.fsyncAttempt(fd);
            }
        }
        await fs_1.default.closeRetry(timeout)(fd);
        fd = null;
        if (options.chown)
            await fs_1.default.chownAttempt(tempPath, options.chown.uid, options.chown.gid);
        if (options.mode)
            await fs_1.default.chmodAttempt(tempPath, options.mode);
        try {
            await fs_1.default.renameRetry(timeout)(tempPath, filePath);
        }
        catch (error) {
            if (error.code !== 'ENAMETOOLONG')
                throw error;
            await fs_1.default.renameRetry(timeout)(tempPath, temp_1.default.truncate(filePath));
        }
        tempDisposer();
        tempPath = null;
    }
    finally {
        if (fd)
            await fs_1.default.closeAttempt(fd);
        if (tempPath)
            temp_1.default.purge(tempPath);
        if (schedulerCustomDisposer)
            schedulerCustomDisposer();
        if (schedulerDisposer)
            schedulerDisposer();
    }
};
const writeFileSync = (filePath, data, options = consts_1.DEFAULT_WRITE_OPTIONS) => {
    var _a;
    if (lang_1.default.isString(options))
        return writeFileSync(filePath, data, { encoding: options });
    const timeout = Date.now() + ((_a = options.timeout) !== null && _a !== void 0 ? _a : consts_1.DEFAULT_TIMEOUT_SYNC);
    let tempDisposer = null, tempPath = null, fd = null;
    try {
        filePath = fs_1.default.realpathSyncAttempt(filePath) || filePath;
        [tempPath, tempDisposer] = temp_1.default.get(filePath, options.tmpCreate || temp_1.default.create, !(options.tmpPurge === false));
        const useStatChown = consts_1.IS_POSIX && lang_1.default.isUndefined(options.chown), useStatMode = lang_1.default.isUndefined(options.mode);
        if (useStatChown || useStatMode) {
            const stat = fs_1.default.statSyncAttempt(filePath);
            if (stat) {
                options = { ...options };
                if (useStatChown)
                    options.chown = { uid: stat.uid, gid: stat.gid };
                if (useStatMode)
                    options.mode = stat.mode;
            }
        }
        const parentPath = path.dirname(filePath);
        fs_1.default.mkdirSyncAttempt(parentPath, {
            mode: consts_1.DEFAULT_FOLDER_MODE,
            recursive: true
        });
        fd = fs_1.default.openSyncRetry(timeout)(tempPath, 'w', options.mode || consts_1.DEFAULT_FILE_MODE);
        if (options.tmpCreated)
            options.tmpCreated(tempPath);
        if (lang_1.default.isString(data)) {
            fs_1.default.writeSyncRetry(timeout)(fd, data, 0, options.encoding || consts_1.DEFAULT_ENCODING);
        }
        else if (!lang_1.default.isUndefined(data)) {
            fs_1.default.writeSyncRetry(timeout)(fd, data, 0, data.length, 0);
        }
        if (options.fsync !== false) {
            if (options.fsyncWait !== false) {
                fs_1.default.fsyncSyncRetry(timeout)(fd);
            }
            else {
                fs_1.default.fsyncAttempt(fd);
            }
        }
        fs_1.default.closeSyncRetry(timeout)(fd);
        fd = null;
        if (options.chown)
            fs_1.default.chownSyncAttempt(tempPath, options.chown.uid, options.chown.gid);
        if (options.mode)
            fs_1.default.chmodSyncAttempt(tempPath, options.mode);
        try {
            fs_1.default.renameSyncRetry(timeout)(tempPath, filePath);
        }
        catch (error) {
            if (error.code !== 'ENAMETOOLONG')
                throw error;
            fs_1.default.renameSyncRetry(timeout)(tempPath, temp_1.default.truncate(filePath));
        }
        tempDisposer();
        tempPath = null;
    }
    finally {
        if (fd)
            fs_1.default.closeSyncAttempt(fd);
        if (tempPath)
            temp_1.default.purge(tempPath);
    }
};
exports.writeFileSync = writeFileSync;
/// <reference types="node" />
declare type Callback = (error: Exception | void) => any;
declare type Data = Buffer | string | undefined;
declare type Disposer = () => void;
declare type Exception = NodeJS.ErrnoException;
declare type FN<Arguments extends any[] = any[], Return = any> = (...args: Arguments) => Return;
declare type Path = string;
declare type ReadOptions = {
    encoding?: string | null;
    mode?: string | number | false;
    timeout?: number;
};
declare type WriteOptions = {
    chown?: {
        gid: number;
        uid: number;
    } | false;
    encoding?: string | null;
    fsync?: boolean;
    fsyncWait?: boolean;
    mode?: string | number | false;
    schedule?: (filePath: string) => Promise<Disposer>;
    timeout?: number;
    tmpCreate?: (filePath: string) => string;
    tmpCreated?: (filePath: string) => any;
    tmpPurge?: boolean;
};
export { Callback, Data, Disposer, Exception, FN, Path, ReadOptions, WriteOptions };
"use strict";
/* TYPES */
Object.defineProperty(exports, "__esModule", { value: true });
import { Exception, FN } from '../types';
declare const attemptifyAsync: <T extends FN<any[], any>>(fn: T, onError?: FN<[Exception]>) => T;
declare const attemptifySync: <T extends FN<any[], any>>(fn: T, onError?: FN<[Exception]>) => T;
export { attemptifyAsync, attemptifySync };
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
exports.attemptifySync = exports.attemptifyAsync = void 0;
const consts_1 = require("../consts");
/* ATTEMPTIFY */
//TODO: Maybe publish this as a standalone package
//FIXME: The type castings here aren't exactly correct
const attemptifyAsync = (fn, onError = consts_1.NOOP) => {
    return function () {
        return fn.apply(undefined, arguments).catch(onError);
    };
};
exports.attemptifyAsync = attemptifyAsync;
const attemptifySync = (fn, onError = consts_1.NOOP) => {
    return function () {
        try {
            return fn.apply(undefined, arguments);
        }
        catch (error) {
            return onError(error);
        }
    };
};
exports.attemptifySync = attemptifySync;
import { Exception } from '../types';
declare const Handlers: {
    isChangeErrorOk: (error: Exception) => boolean;
    isRetriableError: (error: Exception) => boolean;
    onChangeError: (error: Exception) => void;
};
export default Handlers;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const consts_1 = require("../consts");
/* FS HANDLERS */
const Handlers = {
    isChangeErrorOk: (error) => {
        const { code } = error;
        if (code === 'ENOSYS')
            return true;
        if (!consts_1.IS_USER_ROOT && (code === 'EINVAL' || code === 'EPERM'))
            return true;
        return false;
    },
    isRetriableError: (error) => {
        const { code } = error;
        if (code === 'EMFILE' || code === 'ENFILE' || code === 'EAGAIN' || code === 'EBUSY' || code === 'EACCESS' || code === 'EACCS' || code === 'EPERM')
            return true;
        return false;
    },
    onChangeError: (error) => {
        if (Handlers.isChangeErrorOk(error))
            return;
        throw error;
    }
};
/* EXPORT */
exports.default = Handlers;
/// <reference types="node" />
import * as fs from 'fs';
declare const FS: {
    chmodAttempt: typeof fs.chmod.__promisify__;
    chownAttempt: typeof fs.chown.__promisify__;
    closeAttempt: typeof fs.close.__promisify__;
    fsyncAttempt: typeof fs.fsync.__promisify__;
    mkdirAttempt: typeof fs.mkdir.__promisify__;
    realpathAttempt: typeof fs.realpath.__promisify__;
    statAttempt: typeof fs.stat.__promisify__;
    unlinkAttempt: typeof fs.unlink.__promisify__;
    closeRetry: import("../types").FN<[number], typeof fs.close.__promisify__>;
    fsyncRetry: import("../types").FN<[number], typeof fs.fsync.__promisify__>;
    openRetry: import("../types").FN<[number], typeof fs.open.__promisify__>;
    readFileRetry: import("../types").FN<[number], typeof fs.readFile.__promisify__>;
    renameRetry: import("../types").FN<[number], typeof fs.rename.__promisify__>;
    statRetry: import("../types").FN<[number], typeof fs.stat.__promisify__>;
    writeRetry: import("../types").FN<[number], typeof fs.write.__promisify__>;
    chmodSyncAttempt: typeof fs.chmodSync;
    chownSyncAttempt: typeof fs.chownSync;
    closeSyncAttempt: typeof fs.closeSync;
    mkdirSyncAttempt: typeof fs.mkdirSync;
    realpathSyncAttempt: typeof fs.realpathSync;
    statSyncAttempt: typeof fs.statSync;
    unlinkSyncAttempt: typeof fs.unlinkSync;
    closeSyncRetry: import("../types").FN<[number], typeof fs.closeSync>;
    fsyncSyncRetry: import("../types").FN<[number], typeof fs.fsyncSync>;
    openSyncRetry: import("../types").FN<[number], typeof fs.openSync>;
    readFileSyncRetry: import("../types").FN<[number], typeof fs.readFileSync>;
    renameSyncRetry: import("../types").FN<[number], typeof fs.renameSync>;
    statSyncRetry: import("../types").FN<[number], typeof fs.statSync>;
    writeSyncRetry: import("../types").FN<[number], typeof fs.writeSync>;
};
export default FS;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const util_1 = require("util");
const attemptify_1 = require("./attemptify");
const fs_handlers_1 = require("./fs_handlers");
const retryify_1 = require("./retryify");
/* FS */
const FS = {
    chmodAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.chmod), fs_handlers_1.default.onChangeError),
    chownAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.chown), fs_handlers_1.default.onChangeError),
    closeAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.close)),
    fsyncAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.fsync)),
    mkdirAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.mkdir)),
    realpathAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.realpath)),
    statAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.stat)),
    unlinkAttempt: attemptify_1.attemptifyAsync(util_1.promisify(fs.unlink)),
    closeRetry: retryify_1.retryifyAsync(util_1.promisify(fs.close), fs_handlers_1.default.isRetriableError),
    fsyncRetry: retryify_1.retryifyAsync(util_1.promisify(fs.fsync), fs_handlers_1.default.isRetriableError),
    openRetry: retryify_1.retryifyAsync(util_1.promisify(fs.open), fs_handlers_1.default.isRetriableError),
    readFileRetry: retryify_1.retryifyAsync(util_1.promisify(fs.readFile), fs_handlers_1.default.isRetriableError),
    renameRetry: retryify_1.retryifyAsync(util_1.promisify(fs.rename), fs_handlers_1.default.isRetriableError),
    statRetry: retryify_1.retryifyAsync(util_1.promisify(fs.stat), fs_handlers_1.default.isRetriableError),
    writeRetry: retryify_1.retryifyAsync(util_1.promisify(fs.write), fs_handlers_1.default.isRetriableError),
    chmodSyncAttempt: attemptify_1.attemptifySync(fs.chmodSync, fs_handlers_1.default.onChangeError),
    chownSyncAttempt: attemptify_1.attemptifySync(fs.chownSync, fs_handlers_1.default.onChangeError),
    closeSyncAttempt: attemptify_1.attemptifySync(fs.closeSync),
    mkdirSyncAttempt: attemptify_1.attemptifySync(fs.mkdirSync),
    realpathSyncAttempt: attemptify_1.attemptifySync(fs.realpathSync),
    statSyncAttempt: attemptify_1.attemptifySync(fs.statSync),
    unlinkSyncAttempt: attemptify_1.attemptifySync(fs.unlinkSync),
    closeSyncRetry: retryify_1.retryifySync(fs.closeSync, fs_handlers_1.default.isRetriableError),
    fsyncSyncRetry: retryify_1.retryifySync(fs.fsyncSync, fs_handlers_1.default.isRetriableError),
    openSyncRetry: retryify_1.retryifySync(fs.openSync, fs_handlers_1.default.isRetriableError),
    readFileSyncRetry: retryify_1.retryifySync(fs.readFileSync, fs_handlers_1.default.isRetriableError),
    renameSyncRetry: retryify_1.retryifySync(fs.renameSync, fs_handlers_1.default.isRetriableError),
    statSyncRetry: retryify_1.retryifySync(fs.statSync, fs_handlers_1.default.isRetriableError),
    writeSyncRetry: retryify_1.retryifySync(fs.writeSync, fs_handlers_1.default.isRetriableError)
};
/* EXPORT */
exports.default = FS;
declare const Lang: {
    isFunction: (x: any) => x is Function;
    isString: (x: any) => x is string;
    isUndefined: (x: any) => x is undefined;
};
export default Lang;
"use strict";
/* LANG */
Object.defineProperty(exports, "__esModule", { value: true });
const Lang = {
    isFunction: (x) => {
        return typeof x === 'function';
    },
    isString: (x) => {
        return typeof x === 'string';
    },
    isUndefined: (x) => {
        return typeof x === 'undefined';
    }
};
/* EXPORT */
exports.default = Lang;
/// <reference types="node" />
declare const RetryfyQueue: {
    interval: number;
    intervalId: NodeJS.Timeout | undefined;
    limit: number;
    queueActive: Set<Function>;
    queueWaiting: Set<Function>;
    init: () => void;
    reset: () => void;
    add: (fn: Function) => void;
    remove: (fn: Function) => void;
    schedule: () => Promise<Function>;
    tick: () => void;
};
export default RetryfyQueue;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const consts_1 = require("../consts");
/* RETRYIFY QUEUE */
const RetryfyQueue = {
    interval: 25,
    intervalId: undefined,
    limit: consts_1.LIMIT_FILES_DESCRIPTORS,
    queueActive: new Set(),
    queueWaiting: new Set(),
    init: () => {
        if (RetryfyQueue.intervalId)
            return;
        RetryfyQueue.intervalId = setInterval(RetryfyQueue.tick, RetryfyQueue.interval);
    },
    reset: () => {
        if (!RetryfyQueue.intervalId)
            return;
        clearInterval(RetryfyQueue.intervalId);
        delete RetryfyQueue.intervalId;
    },
    add: (fn) => {
        RetryfyQueue.queueWaiting.add(fn);
        if (RetryfyQueue.queueActive.size < (RetryfyQueue.limit / 2)) { // Active queue not under preassure, executing immediately
            RetryfyQueue.tick();
        }
        else {
            RetryfyQueue.init();
        }
    },
    remove: (fn) => {
        RetryfyQueue.queueWaiting.delete(fn);
        RetryfyQueue.queueActive.delete(fn);
    },
    schedule: () => {
        return new Promise(resolve => {
            const cleanup = () => RetryfyQueue.remove(resolver);
            const resolver = () => resolve(cleanup);
            RetryfyQueue.add(resolver);
        });
    },
    tick: () => {
        if (RetryfyQueue.queueActive.size >= RetryfyQueue.limit)
            return;
        if (!RetryfyQueue.queueWaiting.size)
            return RetryfyQueue.reset();
        for (const fn of RetryfyQueue.queueWaiting) {
            if (RetryfyQueue.queueActive.size >= RetryfyQueue.limit)
                break;
            RetryfyQueue.queueWaiting.delete(fn);
            RetryfyQueue.queueActive.add(fn);
            fn();
        }
    }
};
/* EXPORT */
exports.default = RetryfyQueue;
import { Exception, FN } from '../types';
declare const retryifyAsync: <T extends FN<any[], any>>(fn: T, isRetriableError: FN<[Exception], boolean | void>) => FN<[number], T>;
declare const retryifySync: <T extends FN<any[], any>>(fn: T, isRetriableError: FN<[Exception], boolean | void>) => FN<[number], T>;
export { retryifyAsync, retryifySync };
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
exports.retryifySync = exports.retryifyAsync = void 0;
const retryify_queue_1 = require("./retryify_queue");
/* RETRYIFY */
const retryifyAsync = (fn, isRetriableError) => {
    return function (timestamp) {
        return function attempt() {
            return retryify_queue_1.default.schedule().then(cleanup => {
                return fn.apply(undefined, arguments).then(result => {
                    cleanup();
                    return result;
                }, error => {
                    cleanup();
                    if (Date.now() >= timestamp)
                        throw error;
                    if (isRetriableError(error)) {
                        const delay = Math.round(100 + (400 * Math.random())), delayPromise = new Promise(resolve => setTimeout(resolve, delay));
                        return delayPromise.then(() => attempt.apply(undefined, arguments));
                    }
                    throw error;
                });
            });
        };
    };
};
exports.retryifyAsync = retryifyAsync;
const retryifySync = (fn, isRetriableError) => {
    return function (timestamp) {
        return function attempt() {
            try {
                return fn.apply(undefined, arguments);
            }
            catch (error) {
                if (Date.now() > timestamp)
                    throw error;
                if (isRetriableError(error))
                    return attempt.apply(undefined, arguments);
                throw error;
            }
        };
    };
};
exports.retryifySync = retryifySync;
import { Disposer } from '../types';
declare const Scheduler: {
    next: (id: string) => void;
    schedule: (id: string) => Promise<Disposer>;
};
export default Scheduler;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
/* VARIABLES */
const Queues = {};
/* SCHEDULER */
//TODO: Maybe publish this as a standalone package
const Scheduler = {
    next: (id) => {
        const queue = Queues[id];
        if (!queue)
            return;
        queue.shift();
        const job = queue[0];
        if (job) {
            job(() => Scheduler.next(id));
        }
        else {
            delete Queues[id];
        }
    },
    schedule: (id) => {
        return new Promise(resolve => {
            let queue = Queues[id];
            if (!queue)
                queue = Queues[id] = [];
            queue.push(resolve);
            if (queue.length > 1)
                return;
            resolve(() => Scheduler.next(id));
        });
    }
};
/* EXPORT */
exports.default = Scheduler;
import { Disposer } from '../types';
declare const Temp: {
    store: Record<string, boolean>;
    create: (filePath: string) => string;
    get: (filePath: string, creator: (filePath: string) => string, purge?: boolean) => [string, Disposer];
    purge: (filePath: string) => void;
    purgeSync: (filePath: string) => void;
    purgeSyncAll: () => void;
    truncate: (filePath: string) => string;
};
export default Temp;
"use strict";
/* IMPORT */
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const consts_1 = require("../consts");
const fs_1 = require("./fs");
/* TEMP */
//TODO: Maybe publish this as a standalone package
const Temp = {
    store: {},
    create: (filePath) => {
        const randomness = `000000${Math.floor(Math.random() * 16777215).toString(16)}`.slice(-6), // 6 random-enough hex characters
        timestamp = Date.now().toString().slice(-10), // 10 precise timestamp digits
        prefix = 'tmp-', suffix = `.${prefix}${timestamp}${randomness}`, tempPath = `${filePath}${suffix}`;
        return tempPath;
    },
    get: (filePath, creator, purge = true) => {
        const tempPath = Temp.truncate(creator(filePath));
        if (tempPath in Temp.store)
            return Temp.get(filePath, creator, purge); // Collision found, try again
        Temp.store[tempPath] = purge;
        const disposer = () => delete Temp.store[tempPath];
        return [tempPath, disposer];
    },
    purge: (filePath) => {
        if (!Temp.store[filePath])
            return;
        delete Temp.store[filePath];
        fs_1.default.unlinkAttempt(filePath);
    },
    purgeSync: (filePath) => {
        if (!Temp.store[filePath])
            return;
        delete Temp.store[filePath];
        fs_1.default.unlinkSyncAttempt(filePath);
    },
    purgeSyncAll: () => {
        for (const filePath in Temp.store) {
            Temp.purgeSync(filePath);
        }
    },
    truncate: (filePath) => {
        const basename = path.basename(filePath);
        if (basename.length <= consts_1.LIMIT_BASENAME_LENGTH)
            return filePath; //FIXME: Rough and quick attempt at detecting ok lengths
        const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
        if (!truncable)
            return filePath; //FIXME: No truncable part detected, can't really do much without also changing the parent path, which is unsafe, hoping for the best here
        const truncationLength = basename.length - consts_1.LIMIT_BASENAME_LENGTH;
        return `${filePath.slice(0, -basename.length)}${truncable[1]}${truncable[2].slice(0, -truncationLength)}${truncable[3]}`; //FIXME: The truncable part might be shorter than needed here
    }
};
/* INIT */
process.on('exit', Temp.purgeSyncAll); // Ensuring purgeable temp files are purged on exit
/* EXPORT */
exports.default = Temp;
The MIT License (MIT)

Copyright (c) 2020-present Fabio Spampinato

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
{
  "name": "atomically",
  "description": "Read and write files atomically and reliably.",
  "version": "1.7.0",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "benchmark": "node ./tasks/benchmark.js",
    "clean": "rimraf dist",
    "compile": "tsc --skipLibCheck && tstei",
    "compile:watch": "tsc --skipLibCheck --watch",
    "test": "tap --no-coverage-report",
    "test:watch": "tap --no-coverage-report --watch",
    "prepublishOnly": "npm run clean && npm run compile && npm run test"
  },
  "bugs": {
    "url": "https://github.com/fabiospampinato/atomically/issues"
  },
  "license": "MIT",
  "author": {
    "name": "Fabio Spampinato",
    "email": "spampinabio@gmail.com"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/fabiospampinato/atomically.git"
  },
  "keywords": [
    "atomic",
    "read",
    "write",
    "file",
    "reliable"
  ],
  "engines": {
    "node": ">=10.12.0"
  },
  "dependencies": {},
  "devDependencies": {
    "@types/node": "^12.7.2",
    "lodash": "^4.17.19",
    "mkdirp": "^1.0.4",
    "promise-resolve-timeout": "^1.2.1",
    "require-inject": "^1.4.4",
    "rimraf": "^3.0.2",
    "tap": "^14.10.7",
    "typescript": "^3.5.3",
    "typescript-transform-export-interop": "^1.0.2",
    "write-file-atomic": "^3.0.3"
  }
}
# Atomically

Read and write files atomically and reliably.

## Features

- Overview:
  - This library is a rewrite of [`write-file-atomic`](https://github.com/npm/write-file-atomic), with some important enhancements on top, you can largely use this as a drop-in replacement.
  - This library is written in TypeScript, so types aren't an afterthought but come with library.
  - This library is slightly faster than [`write-file-atomic`](https://github.com/npm/write-file-atomic), and it can be 10x faster, while being essentially just as safe, by using the `fsyncWait` option.
  - This library has 0 dependencies, so there's less code to vet and the entire thing is roughly 20% smaller than [`write-file-atomic`](https://github.com/npm/write-file-atomic).
  - This library tries harder to write files on disk than [`write-file-atomic`](https://github.com/npm/write-file-atomic) does, by default retrying some failed operations and handling some more errors.
- Reliability:
  - Reads are retried, when appropriate, until they succeed or the timeout is reached.
  - Writes are atomic, meaning that first a temporary file containing the new content is written, then this file is renamed to the final path, this way it's impossible to get a corrupt/partially-written file.
  - Writes happening to the same path are queued, ensuring they don't interfere with each other.
  - Temporary files can be configured to not be purged from disk if the write operation fails, which is useful for when keeping the temporary file is better than just losing data.
  - Any needed missing parent folder will be created automatically.
  - Symlinks are resolved automatically.
  - `ENOSYS` errors on `chmod`/`chown` operations are ignored.
  - `EINVAL`/`EPERM` errors on `chmod`/`chown` operations, in POSIX systems where the user is not root, are ignored.
  - `EMFILE`/`ENFILE`/`EAGAIN`/`EBUSY`/`EACCESS`/`EACCS`/`EPERM` errors happening during necessary operations are caught and the operations are retried until they succeed or the timeout is reached.
  - `ENAMETOOLONG` errors, both appening because of the final path or the temporary path, are attempted to be worked around by smartly truncating paths.
- Temporary files:
  - By default they are purged automatically once the write operation is completed or if the process exits (cleanly or not).
  - By default they are created by appending a `.tmp-[timestamp][randomness]` suffix to destination paths:
    - The `tmp-` part gives users a hint about the nature of these files, if they happen to see them.
    - The `[timestamp]` part consists of the 10 least significant digits of a milliseconds-precise timestamp, making it likely that if more than one of these files are kept on disk the user will see them in chronological order.
    - The `[randomness]` part consists of 6 random hex characters.
    - If by any chance a collision is found then another suffix is generated.
- Custom options:
  - `chown`: it allows you to specify custom group and user ids:
    - by default the old file's ids are copied over.
    - if custom ids are provided they will be used.
    - if `false` the default ids are used.
  - `encoding`: it allows you to specify the encoding of the file content:
    - by default when reading no encoding is specified and a raw buffer is returned.
    - by default when writing `utf8` is used when.
  - `fsync`: it allows you to control whether the `fsync` syscall is triggered right after writing the file or not:
    - by default the syscall is triggered immediately after writing the file, increasing the chances that the file will actually be written to disk in case of imminent catastrophic failures, like power outages.
    - if `false` the syscall won't be triggered.
  - `fsyncWait`: it allows you to control whether the triggered `fsync` is waited or not:
    - by default the syscall is waited.
    - if `false` the syscall will still be triggered but not be waited.
      - this increases performance 10x in some cases, and at the end of the day often there's no plan B if `fsync` fails anyway.
  - `mode`: it allows you to specify the mode for the file:
    - by default the old file's mode is copied over.
    - if `false` then `0o666` is used.
  - `schedule`: it's a function that returns a promise that resolves to a disposer function, basically it allows you to provide some custom queueing logic for the writing operation, allowing you to perhaps wire `atomically` with your app's main filesystem job scheduler:
    - even when a custom `schedule` function is provided write operations will still be queued internally by the library too.
  - `timeout`: it allows you to specify the amount of maximum milliseconds within which the library will retry some failed operations:
    - when writing asynchronously by default it will keep retrying for 5000 milliseconds.
    - when writing synchronously by default it will keep retrying for 100 milliseconds.
    - if `0` or `-1` no failed operations will be retried.
    - if another number is provided that will be the timeout interval.
  - `tmpCreate`: it's a function that will be used to create the custom temporary file path in place of the default one:
    - even when a custom function is provided the final temporary path will still be truncated if the library thinks that it may lead to `ENAMETOOLONG` errors.
    - paths by default are truncated in a way that preserves an eventual existing leading dot and trailing extension.
  - `tmpCreated`: it's a function that will be called with the newly created temporary file path.
  - `tmpPurge`: it allows you to control whether the temporary file will be purged from the filesystem or not if the write fails:
    - by default it will be purged.
    - if `false` it will be kept on disk.

## Install

```sh
npm install --save atomically
```

## Usage

This is the shape of the optional options object:

```ts
type Disposer = () => void;

type ReadOptions = string | {
  encoding?: string | null,
  mode?: string | number | false,
  timeout?: number
};

type WriteOptions = string | {
  chown?: { gid: number, uid: number } | false,
  encoding?: string | null,
  fsync?: boolean,
  fsyncWait?: boolean,
  mode?: string | number | false,
  schedule?: ( filePath: string ) => Promise<Disposer>,
  timeout?: number,
  tmpCreate?: ( filePath: string ) => string,
  tmpCreated?: ( filePath: string ) => any,
  tmpPurge?: boolean
};
```

This is the shape of the provided functions:

```ts
function readFile ( filePath: string, options?: ReadOptions ): Promise<Buffer | string>;
function readFileSync ( filePath: string, options?: ReadOptions ): Buffer | string;
function writeFile ( filePath: string, data: Buffer | string | undefined, options?: WriteOptions ): Promise<void>;
function writeFileSync ( filePath: string, data: Buffer | string | undefined, options?: WriteOptions ): void;
```

This is how to use the library:

```ts
import {readFile, readFileSync, writeFile, writeFileSync} from 'atomically';

// Asynchronous read with default option
const buffer = await readFile ( '/foo.txt' );

// Synchronous read assuming the encoding is "utf8"
const string = readFileSync ( '/foo.txt', 'utf8' );

// Asynchronous write with default options
await writeFile ( '/foo.txt', 'my_data' );

// Asynchronous write that doesn't prod the old file for a stat object at all
await writeFile ( '/foo.txt', 'my_data', { chown: false, mode: false } );

// 10x faster asynchronous write that's less resilient against imminent catastrophies
await writeFile ( '/foo.txt', 'my_data', { fsync: false } );

// 10x faster asynchronous write that's essentially still as resilient against imminent catastrophies
await writeFile ( '/foo.txt', 'my_data', { fsyncWait: false } );

// Asynchronous write with a custom schedule function
await writeFile ( '/foo.txt', 'my_data', {
  schedule: filePath => {
    return new Promise ( resolve => { // When this returned promise will resolve the write operation will begin
      MyScheduler.schedule ( filePath, () => { // Hypothetical scheduler function that will eventually tell us to go on with this write operation
        const disposer = () => {}; // Hypothetical function that contains eventual clean-up logic, it will be called after the write operation has been completed (successfully or not)
        resolve ( disposer ); // Resolving the promise with a disposer, beginning the write operation
      })
    });
  }
});

// Synchronous write with default options
writeFileSync ( '/foo.txt', 'my_data' );
```

## License

MIT © Fabio Spampinato

/* CONSTS */

const DEFAULT_ENCODING = 'utf8';

const DEFAULT_FILE_MODE = 0o666;

const DEFAULT_FOLDER_MODE = 0o777;

const DEFAULT_READ_OPTIONS = {};

const DEFAULT_WRITE_OPTIONS = {};

const DEFAULT_TIMEOUT_ASYNC = 5000;

const DEFAULT_TIMEOUT_SYNC = 100;

const IS_POSIX = !!process.getuid;

const IS_USER_ROOT = process.getuid ? !process.getuid () : false;

const LIMIT_BASENAME_LENGTH = 128; //TODO: fetch the real limit from the filesystem //TODO: fetch the whole-path length limit too

const LIMIT_FILES_DESCRIPTORS = 10000; //TODO: fetch the real limit from the filesystem

const NOOP = () => {};

/* EXPORT */

export {DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX, IS_USER_ROOT, LIMIT_BASENAME_LENGTH, LIMIT_FILES_DESCRIPTORS, NOOP};

/* IMPORT */

import * as path from 'path';
import {DEFAULT_ENCODING, DEFAULT_FILE_MODE, DEFAULT_FOLDER_MODE, DEFAULT_READ_OPTIONS, DEFAULT_WRITE_OPTIONS, DEFAULT_TIMEOUT_ASYNC, DEFAULT_TIMEOUT_SYNC, IS_POSIX} from './consts';
import FS from './utils/fs';
import Lang from './utils/lang';
import Scheduler from './utils/scheduler';
import Temp from './utils/temp';
import {Callback, Data, Disposer, Path, ReadOptions, WriteOptions} from './types';

/* ATOMICALLY */

function readFile ( filePath: Path, options: string | ReadOptions & { encoding: string } ): Promise<string>;
function readFile ( filePath: Path, options?: ReadOptions ): Promise<Buffer>;
function readFile ( filePath: Path, options: string | ReadOptions = DEFAULT_READ_OPTIONS ): Promise<Buffer | string> {

  if ( Lang.isString ( options ) ) return readFile ( filePath, { encoding: options } );

  const timeout = Date.now () + ( options.timeout ?? DEFAULT_TIMEOUT_ASYNC );

  return FS.readFileRetry ( timeout )( filePath, options );

};

function readFileSync ( filePath: Path, options: string | ReadOptions & { encoding: string } ): string;
function readFileSync ( filePath: Path, options?: ReadOptions ): Buffer;
function readFileSync ( filePath: Path, options: string | ReadOptions = DEFAULT_READ_OPTIONS ): Buffer | string {

  if ( Lang.isString ( options ) ) return readFileSync ( filePath, { encoding: options } );

  const timeout = Date.now () + ( options.timeout ?? DEFAULT_TIMEOUT_SYNC );

  return FS.readFileSyncRetry ( timeout )( filePath, options );

};

const writeFile = ( filePath: Path, data: Data, options?: string | WriteOptions | Callback, callback?: Callback ): Promise<void> => {

  if ( Lang.isFunction ( options ) ) return writeFile ( filePath, data, DEFAULT_WRITE_OPTIONS, options );

  const promise = writeFileAsync ( filePath, data, options );

  if ( callback ) promise.then ( callback, callback );

  return promise;

};

const writeFileAsync = async ( filePath: Path, data: Data, options: string | WriteOptions = DEFAULT_WRITE_OPTIONS ): Promise<void> => {

  if ( Lang.isString ( options ) ) return writeFileAsync ( filePath, data, { encoding: options } );

  const timeout = Date.now () + ( options.timeout ?? DEFAULT_TIMEOUT_ASYNC );

  let schedulerCustomDisposer: Disposer | null = null,
      schedulerDisposer: Disposer | null = null,
      tempDisposer: Disposer | null = null,
      tempPath: string | null = null,
      fd: number | null = null;

  try {

    if ( options.schedule ) schedulerCustomDisposer = await options.schedule ( filePath );

    schedulerDisposer = await Scheduler.schedule ( filePath );

    filePath = await FS.realpathAttempt ( filePath ) || filePath;

    [tempPath, tempDisposer] = Temp.get ( filePath, options.tmpCreate || Temp.create, !( options.tmpPurge === false ) );

    const useStatChown = IS_POSIX && Lang.isUndefined ( options.chown ),
          useStatMode = Lang.isUndefined ( options.mode );

    if ( useStatChown || useStatMode ) {

      const stat = await FS.statAttempt ( filePath );

      if ( stat ) {

        options = { ...options };

        if ( useStatChown ) options.chown = { uid: stat.uid, gid: stat.gid };

        if ( useStatMode ) options.mode = stat.mode;

      }

    }

    const parentPath = path.dirname ( filePath );

    await FS.mkdirAttempt ( parentPath, {
      mode: DEFAULT_FOLDER_MODE,
      recursive: true
    });

    fd = await FS.openRetry ( timeout )( tempPath, 'w', options.mode || DEFAULT_FILE_MODE );

    if ( options.tmpCreated ) options.tmpCreated ( tempPath );

    if ( Lang.isString ( data ) ) {

      await FS.writeRetry ( timeout )( fd, data, 0, options.encoding || DEFAULT_ENCODING );

    } else if ( !Lang.isUndefined ( data ) ) {

      await FS.writeRetry ( timeout )( fd, data, 0, data.length, 0 );

    }

    if ( options.fsync !== false ) {

      if ( options.fsyncWait !== false ) {

        await FS.fsyncRetry ( timeout )( fd );

      } else {

        FS.fsyncAttempt ( fd );

      }

    }

    await FS.closeRetry ( timeout )( fd );

    fd = null;

    if ( options.chown ) await FS.chownAttempt ( tempPath, options.chown.uid, options.chown.gid );

    if ( options.mode ) await FS.chmodAttempt ( tempPath, options.mode );

    try {

      await FS.renameRetry ( timeout )( tempPath, filePath );

    } catch ( error ) {

      if ( error.code !== 'ENAMETOOLONG' ) throw error;

      await FS.renameRetry ( timeout )( tempPath, Temp.truncate ( filePath ) );

    }

    tempDisposer ();

    tempPath = null;

  } finally {

    if ( fd ) await FS.closeAttempt ( fd );

    if ( tempPath ) Temp.purge ( tempPath );

    if ( schedulerCustomDisposer ) schedulerCustomDisposer ();

    if ( schedulerDisposer ) schedulerDisposer ();

  }

};

const writeFileSync = ( filePath: Path, data: Data, options: string | WriteOptions = DEFAULT_WRITE_OPTIONS ): void => {

  if ( Lang.isString ( options ) ) return writeFileSync ( filePath, data, { encoding: options } );

  const timeout = Date.now () + ( options.timeout ?? DEFAULT_TIMEOUT_SYNC );

  let tempDisposer: Disposer | null = null,
      tempPath: string | null = null,
      fd: number | null = null;

  try {

    filePath = FS.realpathSyncAttempt ( filePath ) || filePath;

    [tempPath, tempDisposer] = Temp.get ( filePath, options.tmpCreate || Temp.create, !( options.tmpPurge === false ) );

    const useStatChown = IS_POSIX && Lang.isUndefined ( options.chown ),
          useStatMode = Lang.isUndefined ( options.mode );

    if ( useStatChown || useStatMode ) {

      const stat = FS.statSyncAttempt ( filePath );

      if ( stat ) {

        options = { ...options };

        if ( useStatChown ) options.chown = { uid: stat.uid, gid: stat.gid };

        if ( useStatMode ) options.mode = stat.mode;

      }

    }

    const parentPath = path.dirname ( filePath );

    FS.mkdirSyncAttempt ( parentPath, {
      mode: DEFAULT_FOLDER_MODE,
      recursive: true
    });

    fd = FS.openSyncRetry ( timeout )( tempPath, 'w', options.mode || DEFAULT_FILE_MODE );

    if ( options.tmpCreated ) options.tmpCreated ( tempPath );

    if ( Lang.isString ( data ) ) {

      FS.writeSyncRetry ( timeout )( fd, data, 0, options.encoding || DEFAULT_ENCODING );

    } else if ( !Lang.isUndefined ( data ) ) {

      FS.writeSyncRetry ( timeout )( fd, data, 0, data.length, 0 );

    }

    if ( options.fsync !== false ) {

      if ( options.fsyncWait !== false ) {

        FS.fsyncSyncRetry ( timeout )( fd );

      } else {

        FS.fsyncAttempt ( fd );

      }

    }

    FS.closeSyncRetry ( timeout )( fd );

    fd = null;

    if ( options.chown ) FS.chownSyncAttempt ( tempPath, options.chown.uid, options.chown.gid );

    if ( options.mode ) FS.chmodSyncAttempt ( tempPath, options.mode );

    try {

      FS.renameSyncRetry ( timeout )( tempPath, filePath );

    } catch ( error ) {

      if ( error.code !== 'ENAMETOOLONG' ) throw error;

      FS.renameSyncRetry ( timeout )( tempPath, Temp.truncate ( filePath ) );

    }

    tempDisposer ();

    tempPath = null;

  } finally {

    if ( fd ) FS.closeSyncAttempt ( fd );

    if ( tempPath ) Temp.purge ( tempPath );

  }

};

/* EXPORT */

export {readFile, readFileSync, writeFile, writeFileSync};

/* TYPES */

type Callback = ( error: Exception | void ) => any;

type Data = Buffer | string | undefined;

type Disposer = () => void;

type Exception = NodeJS.ErrnoException;

type FN<Arguments extends any[] = any[], Return = any> = ( ...args: Arguments ) => Return;

type Path = string;

type ReadOptions = {
  encoding?: string | null,
  mode?: string | number | false,
  timeout?: number
};

type WriteOptions = {
  chown?: { gid: number, uid: number } | false,
  encoding?: string | null,
  fsync?: boolean,
  fsyncWait?: boolean,
  mode?: string | number | false,
  schedule?: ( filePath: string ) => Promise<Disposer>,
  timeout?: number,
  tmpCreate?: ( filePath: string ) => string,
  tmpCreated?: ( filePath: string ) => any,
  tmpPurge?: boolean
};

/* EXPORT */

export {Callback, Data, Disposer, Exception, FN, Path, ReadOptions, WriteOptions};

/* IMPORT */

import {NOOP} from '../consts';
import {Exception, FN} from '../types';

/* ATTEMPTIFY */

//TODO: Maybe publish this as a standalone package
//FIXME: The type castings here aren't exactly correct

const attemptifyAsync = <T extends FN> ( fn: T, onError: FN<[Exception]> = NOOP ): T => {

  return function () {

    return fn.apply ( undefined, arguments ).catch ( onError );

  } as T;

};

const attemptifySync = <T extends FN> ( fn: T, onError: FN<[Exception]> = NOOP ): T => {

  return function () {

    try {

      return fn.apply ( undefined, arguments );

    } catch ( error ) {

      return onError ( error );

    }

  } as T;

};

/* EXPORT */

export {attemptifyAsync, attemptifySync};

/* IMPORT */

import {IS_USER_ROOT} from '../consts';
import {Exception} from '../types';

/* FS HANDLERS */

const Handlers = {

  isChangeErrorOk: ( error: Exception ): boolean => { //URL: https://github.com/isaacs/node-graceful-fs/blob/master/polyfills.js#L315-L342

    const {code} = error;

    if ( code === 'ENOSYS' ) return true;

    if ( !IS_USER_ROOT && ( code === 'EINVAL' || code === 'EPERM' ) ) return true;

    return false;

  },

  isRetriableError: ( error: Exception ): boolean => {

    const {code} = error;

    if ( code === 'EMFILE' || code === 'ENFILE' || code === 'EAGAIN' || code === 'EBUSY' || code === 'EACCESS' || code === 'EACCS' || code === 'EPERM' ) return true;

    return false;

  },

  onChangeError: ( error: Exception ): void => {

    if ( Handlers.isChangeErrorOk ( error ) ) return;

    throw error;

  }

};

/* EXPORT */

export default Handlers;

/* IMPORT */

import * as fs from 'fs';
import {promisify} from 'util';
import {attemptifyAsync, attemptifySync} from './attemptify';
import Handlers from './fs_handlers';
import {retryifyAsync, retryifySync} from './retryify';

/* FS */

const FS = {

  chmodAttempt: attemptifyAsync ( promisify ( fs.chmod ), Handlers.onChangeError ),
  chownAttempt: attemptifyAsync ( promisify ( fs.chown ), Handlers.onChangeError ),
  closeAttempt: attemptifyAsync ( promisify ( fs.close ) ),
  fsyncAttempt: attemptifyAsync ( promisify ( fs.fsync ) ),
  mkdirAttempt: attemptifyAsync ( promisify ( fs.mkdir ) ),
  realpathAttempt: attemptifyAsync ( promisify ( fs.realpath ) ),
  statAttempt: attemptifyAsync ( promisify ( fs.stat ) ),
  unlinkAttempt: attemptifyAsync ( promisify ( fs.unlink ) ),

  closeRetry: retryifyAsync ( promisify ( fs.close ), Handlers.isRetriableError ),
  fsyncRetry: retryifyAsync ( promisify ( fs.fsync ), Handlers.isRetriableError ),
  openRetry: retryifyAsync ( promisify ( fs.open ), Handlers.isRetriableError ),
  readFileRetry: retryifyAsync ( promisify ( fs.readFile ), Handlers.isRetriableError ),
  renameRetry: retryifyAsync ( promisify ( fs.rename ), Handlers.isRetriableError ),
  statRetry: retryifyAsync ( promisify ( fs.stat ), Handlers.isRetriableError ),
  writeRetry: retryifyAsync ( promisify ( fs.write ), Handlers.isRetriableError ),

  chmodSyncAttempt: attemptifySync ( fs.chmodSync, Handlers.onChangeError ),
  chownSyncAttempt: attemptifySync ( fs.chownSync, Handlers.onChangeError ),
  closeSyncAttempt: attemptifySync ( fs.closeSync ),
  mkdirSyncAttempt: attemptifySync ( fs.mkdirSync ),
  realpathSyncAttempt: attemptifySync ( fs.realpathSync ),
  statSyncAttempt: attemptifySync ( fs.statSync ),
  unlinkSyncAttempt: attemptifySync ( fs.unlinkSync ),

  closeSyncRetry: retryifySync ( fs.closeSync, Handlers.isRetriableError ),
  fsyncSyncRetry: retryifySync ( fs.fsyncSync, Handlers.isRetriableError ),
  openSyncRetry: retryifySync ( fs.openSync, Handlers.isRetriableError ),
  readFileSyncRetry: retryifySync ( fs.readFileSync, Handlers.isRetriableError ),
  renameSyncRetry: retryifySync ( fs.renameSync, Handlers.isRetriableError ),
  statSyncRetry: retryifySync ( fs.statSync, Handlers.isRetriableError ),
  writeSyncRetry: retryifySync ( fs.writeSync, Handlers.isRetriableError )

};

/* EXPORT */

export default FS;

/* LANG */

const Lang = {

  isFunction: ( x: any ): x is Function => {

    return typeof x === 'function';

  },

  isString: ( x: any ): x is string => {

    return typeof x === 'string';

  },

  isUndefined: ( x: any ): x is undefined => {

    return typeof x === 'undefined';

  }

};

/* EXPORT */

export default Lang;

/* IMPORT */

import {LIMIT_FILES_DESCRIPTORS} from '../consts';

/* RETRYIFY QUEUE */

const RetryfyQueue = {

  interval: 25,
  intervalId: <NodeJS.Timeout | undefined> undefined,
  limit: LIMIT_FILES_DESCRIPTORS,
  queueActive: new Set<Function> (),
  queueWaiting: new Set<Function> (),

  init: (): void => {

    if ( RetryfyQueue.intervalId ) return;

    RetryfyQueue.intervalId = setInterval ( RetryfyQueue.tick, RetryfyQueue.interval );

  },

  reset: (): void => {

    if ( !RetryfyQueue.intervalId ) return;

    clearInterval ( RetryfyQueue.intervalId );

    delete RetryfyQueue.intervalId;

  },

  add: ( fn: Function ): void => {

    RetryfyQueue.queueWaiting.add ( fn );

    if ( RetryfyQueue.queueActive.size < ( RetryfyQueue.limit / 2 ) ) { // Active queue not under preassure, executing immediately

      RetryfyQueue.tick ();

    } else {

      RetryfyQueue.init ();

    }

  },

  remove: ( fn: Function ): void => {

    RetryfyQueue.queueWaiting.delete ( fn );

    RetryfyQueue.queueActive.delete ( fn );

  },

  schedule: (): Promise<Function> => {

    return new Promise ( resolve => {

      const cleanup = () => RetryfyQueue.remove ( resolver );

      const resolver = () => resolve ( cleanup );

      RetryfyQueue.add ( resolver );

    });

  },

  tick: (): void => {

    if ( RetryfyQueue.queueActive.size >= RetryfyQueue.limit ) return;

    if ( !RetryfyQueue.queueWaiting.size ) return RetryfyQueue.reset ();

    for ( const fn of RetryfyQueue.queueWaiting ) {

      if ( RetryfyQueue.queueActive.size >= RetryfyQueue.limit ) break;

      RetryfyQueue.queueWaiting.delete ( fn );
      RetryfyQueue.queueActive.add ( fn );

      fn ();

    }

  }

};

/* EXPORT */

export default RetryfyQueue;

/* IMPORT */

import {Exception, FN} from '../types';
import RetryfyQueue from './retryify_queue';

/* RETRYIFY */

const retryifyAsync = <T extends FN> ( fn: T, isRetriableError: FN<[Exception], boolean | void> ): FN<[number], T> => {

  return function ( timestamp: number ) {

    return function attempt () {

      return RetryfyQueue.schedule ().then ( cleanup => {

        return fn.apply ( undefined, arguments ).then ( result => {

          cleanup ();

          return result;

        }, error => {

          cleanup ();

          if ( Date.now () >= timestamp ) throw error;

          if ( isRetriableError ( error ) ) {

            const delay = Math.round ( 100 + ( 400 * Math.random () ) ),
                  delayPromise = new Promise ( resolve => setTimeout ( resolve, delay ) );

            return delayPromise.then ( () => attempt.apply ( undefined, arguments ) );

          }

          throw error;

        });

      });

    } as T;

  };

};

const retryifySync = <T extends FN> ( fn: T, isRetriableError: FN<[Exception], boolean | void> ): FN<[number], T> => {

  return function ( timestamp: number ) {

    return function attempt () {

      try {

        return fn.apply ( undefined, arguments );

      } catch ( error ) {

        if ( Date.now () > timestamp ) throw error;

        if ( isRetriableError ( error ) ) return attempt.apply ( undefined, arguments );

        throw error;

      }

    } as T;

  };

};

/* EXPORT */

export {retryifyAsync, retryifySync};

/* IMPORT */

import {Disposer} from '../types';

/* VARIABLES */

const Queues: Record<string, Function[] | undefined> = {};

/* SCHEDULER */

//TODO: Maybe publish this as a standalone package

const Scheduler = {

  next: ( id: string ): void => {

    const queue = Queues[id];

    if ( !queue ) return;

    queue.shift ();

    const job = queue[0];

    if ( job ) {

      job ( () => Scheduler.next ( id ) );

    } else {

      delete Queues[id];

    }

  },

  schedule: ( id: string ): Promise<Disposer> => {

    return new Promise ( resolve => {

      let queue = Queues[id];

      if ( !queue ) queue = Queues[id] = [];

      queue.push ( resolve );

      if ( queue.length > 1 ) return;

      resolve ( () => Scheduler.next ( id ) );

    });

  }

};

/* EXPORT */

export default Scheduler;

/* IMPORT */

import * as path from 'path';
import {LIMIT_BASENAME_LENGTH} from '../consts';
import {Disposer} from '../types';
import FS from './fs';

/* TEMP */

//TODO: Maybe publish this as a standalone package

const Temp = {

  store: <Record<string, boolean>> {}, // filePath => purge

  create: ( filePath: string ): string => {

    const randomness = `000000${Math.floor ( Math.random () * 16777215 ).toString ( 16 )}`.slice ( -6 ), // 6 random-enough hex characters
          timestamp = Date.now ().toString ().slice ( -10 ), // 10 precise timestamp digits
          prefix = 'tmp-',
          suffix = `.${prefix}${timestamp}${randomness}`,
          tempPath = `${filePath}${suffix}`;

    return tempPath;

  },

  get: ( filePath: string, creator: ( filePath: string ) => string, purge: boolean = true ): [string, Disposer] => {

    const tempPath = Temp.truncate ( creator ( filePath ) );

    if ( tempPath in Temp.store ) return Temp.get ( filePath, creator, purge ); // Collision found, try again

    Temp.store[tempPath] = purge;

    const disposer = () => delete Temp.store[tempPath];

    return [tempPath, disposer];

  },

  purge: ( filePath: string ): void => {

    if ( !Temp.store[filePath] ) return;

    delete Temp.store[filePath];

    FS.unlinkAttempt ( filePath );

  },

  purgeSync: ( filePath: string ): void => {

    if ( !Temp.store[filePath] ) return;

    delete Temp.store[filePath];

    FS.unlinkSyncAttempt ( filePath );

  },

  purgeSyncAll: (): void => {

    for ( const filePath in Temp.store ) {

      Temp.purgeSync ( filePath );

    }

  },

  truncate: ( filePath: string ): string => { // Truncating paths to avoid getting an "ENAMETOOLONG" error //FIXME: This doesn't really always work, the actual filesystem limits must be detected for this to be implemented correctly

    const basename = path.basename ( filePath );

    if ( basename.length <= LIMIT_BASENAME_LENGTH ) return filePath; //FIXME: Rough and quick attempt at detecting ok lengths

    const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec ( basename );

    if ( !truncable ) return filePath; //FIXME: No truncable part detected, can't really do much without also changing the parent path, which is unsafe, hoping for the best here

    const truncationLength = basename.length - LIMIT_BASENAME_LENGTH;

    return `${filePath.slice ( 0, - basename.length )}${truncable[1]}${truncable[2].slice ( 0, - truncationLength )}${truncable[3]}`; //FIXME: The truncable part might be shorter than needed here

  }

};

/* INIT */

process.on ( 'exit', Temp.purgeSyncAll ); // Ensuring purgeable temp files are purged on exit

/* EXPORT */

export default Temp;

/* IMPORT */

const fs = require ( 'fs' ),
      os = require ( 'os' ),
      path = require ( 'path' ),
      delay = require ( 'promise-resolve-timeout' ),
      writeFileAtomic = require ( 'write-file-atomic' ),
      {writeFile, writeFileSync} = require ( '../dist' );

/* BENCHMARK */

const TEMP = os.tmpdir (),
      DST = i => path.join ( TEMP, `atomically-temp-${i}.txt` ),
      ITERATIONS = 250;

const runSingleAsync = async ( name, fn, buffer, options ) => {
  console.time ( name );
  for ( let i = 0; i < ITERATIONS; i++ ) {
    await fn ( DST ( i ), buffer, options );
  }
  console.timeEnd ( name );
  await delay ( 1000 );
};

const runSingleSync = async ( name, fn, buffer, options ) => {
  console.time ( name );
  for ( let i = 0; i < ITERATIONS; i++ ) {
    fn ( DST ( i ), buffer, options );
  }
  console.timeEnd ( name );
  await delay ( 1000 );
};

const runAllDummy = () => { // Preparation run
  runSingleSync ( 'dummy', fs.writeFileSync, '' );
};

const runAllAsync = async ( name, buffer ) => {
  await runSingleAsync ( `${name} -> async -> write-file-atomic`, writeFileAtomic, buffer );
  await runSingleAsync ( `${name} -> async -> write-file-atomic (fastest)`, writeFileAtomic, buffer, { fsync: false } );
  await runSingleAsync ( `${name} -> async -> atomically`, writeFile, buffer );
  await runSingleAsync ( `${name} -> async -> atomically (faster)`, writeFile, buffer, { mode: false, chown: false, fsyncWait: false } );
  await runSingleAsync ( `${name} -> async -> atomically (fastest)`, writeFile, buffer, { mode: false, chown: false, fsync: false } );
};

const runAllSync = ( name, buffer ) => {
  runSingleSync ( `${name} -> sync -> write-file-atomic`, writeFileAtomic.sync, buffer );
  runSingleSync ( `${name} -> sync -> write-file-atomic (fastest)`, writeFileAtomic.sync, buffer, { fsync: false } );
  runSingleSync ( `${name} -> sync -> atomically`, writeFileSync, buffer );
  runSingleSync ( `${name} -> sync -> atomically (faster)`, writeFileSync, buffer, { mode: false, chown: false, fsyncWait: false } );
  runSingleSync ( `${name} -> sync -> atomically (fastest)`, writeFileSync, buffer, { mode: false, chown: false, fsync: false } );
};

const runAll = async ( name, buffer ) => {
  await runAllAsync ( name, buffer );
  console.log ( '-------------------' );
  runAllSync ( name, buffer );
};

const run = async () => {
  runAllDummy ();
  console.log ( '===================' );
  await runAll ( '100kb', Buffer.allocUnsafe ( 100 * 1024 ) );
  console.log ( '===================' );
  await runAll ( '10kb', Buffer.allocUnsafe ( 10 * 1024 ) );
  console.log ( '===================' );
  await runAll ( '1kb', Buffer.allocUnsafe ( 1024 ) );
  console.log ( '===================' );
};

run ();
'use strict'

process.setMaxListeners(1000000);

const _ = require('lodash')
const fs = require('fs')
const os = require('os')
const path = require('path')
const {test} = require('tap')
const requireInject = require('require-inject')

let expectClose = 0
let closeCalled = 0
let expectCloseSync = 0
let closeSyncCalled = 0
const createErr = code => Object.assign(new Error(code), { code })

let unlinked = []

const fsMock = Object.assign ( {}, fs, {
  /* ASYNC */
  mkdir (filename, opts, cb) {
    return cb(null);
  },
  realpath (filename, cb) {
    return cb(null, filename)
  },
  open (tmpfile, options, mode, cb) {
    if (/noopen/.test(tmpfile)) return cb(createErr('ENOOPEN'))
    expectClose++
    cb(null, tmpfile)
  },
  write (fd) {
    const cb = arguments[arguments.length - 1]
    if (/nowrite/.test(fd)) return cb(createErr('ENOWRITE'))
    cb()
  },
  fsync (fd, cb) {
    if (/nofsync/.test(fd)) return cb(createErr('ENOFSYNC'))
    cb()
  },
  close (fd, cb) {
    closeCalled++
    cb()
  },
  chown (tmpfile, uid, gid, cb) {
    if (/nochown/.test(tmpfile)) return cb(createErr('ENOCHOWN'))
    if (/enosys/.test(tmpfile)) return cb(createErr('ENOSYS'))
    if (/einval/.test(tmpfile)) return cb(createErr('EINVAL'))
    if (/eperm/.test(tmpfile)) return cb(createErr('EPERM'))
    cb()
  },
  chmod (tmpfile, mode, cb) {
    if (/nochmod/.test(tmpfile)) return cb(createErr('ENOCHMOD'))
    if (/enosys/.test(tmpfile)) return cb(createErr('ENOSYS'))
    if (/eperm/.test(tmpfile)) return cb(createErr('EPERM'))
    if (/einval/.test(tmpfile)) return cb(createErr('EINVAL'))
    cb()
  },
  rename (tmpfile, filename, cb) {
    if (/norename/.test(tmpfile)) return cb(createErr('ENORENAME'))
    cb()
  },
  unlink (tmpfile, cb) {
    if (/nounlink/.test(tmpfile)) return cb(createErr('ENOUNLINK'))
    cb()
  },
  stat (tmpfile, cb) {
    if (/nostat/.test(tmpfile)) return cb(createErr('ENOSTAT'))
    if (/statful/.test(tmpfile)) return cb(null, fs.statSync('/'));
    cb()
  },
  /* SYNC */
  mkdirSync (filename) {},
  realpathSync (filename, cb) {
    return filename
  },
  openSync (tmpfile, options) {
    if (/noopen/.test(tmpfile)) throw createErr('ENOOPEN')
    expectCloseSync++
    return tmpfile
  },
  writeSync (fd) {
    if (/nowrite/.test(fd)) throw createErr('ENOWRITE')
  },
  fsyncSync (fd) {
    if (/nofsync/.test(fd)) throw createErr('ENOFSYNC')
  },
  closeSync (fd) {
    closeSyncCalled++
  },
  chownSync (tmpfile, uid, gid) {
    if (/nochown/.test(tmpfile)) throw createErr('ENOCHOWN')
    if (/enosys/.test(tmpfile)) throw createErr('ENOSYS')
    if (/einval/.test(tmpfile)) throw createErr('EINVAL')
    if (/eperm/.test(tmpfile)) throw createErr('EPERM')
  },
  chmodSync (tmpfile, mode) {
    if (/nochmod/.test(tmpfile)) throw createErr('ENOCHMOD')
    if (/enosys/.test(tmpfile)) throw createErr('ENOSYS')
    if (/einval/.test(tmpfile)) throw createErr('EINVAL')
    if (/eperm/.test(tmpfile)) throw createErr('EPERM')
  },
  renameSync (tmpfile, filename) {
    if (/norename/.test(tmpfile)) throw createErr('ENORENAME')
  },
  unlinkSync (tmpfile) {
    if (/nounlink/.test(tmpfile)) throw createErr('ENOUNLINK')
    unlinked.push(tmpfile)
  },
  statSync (tmpfile) {
    if (/nostat/.test(tmpfile)) throw createErr('ENOSTAT')
    if (/statful/.test(tmpfile)) return fs.statSync('/');
  }
});

const makeUnstableAsyncFn = function () {
  return function () {
    if ( Math.random () <= .75 ) {
      const code = _.shuffle ([ 'EMFILE', 'ENFILE', 'EAGAIN', 'EBUSY', 'EACCESS', 'EPERM' ])[0];
      throw createErr ( code );
    }
    return arguments[arguments.length -1](null, arguments[0]);
  };
};

const makeUnstableSyncFn = function ( fn ) {
  return function () {
    if ( Math.random () <= .75 ) {
      const code = _.shuffle ([ 'EMFILE', 'ENFILE', 'EAGAIN', 'EBUSY', 'EACCESS', 'EPERM' ])[0];
      throw createErr ( code );
    }
    return fn.apply(undefined, arguments)
  };
};

const fsMockUnstable = Object.assign ( {}, fsMock, {
  open: makeUnstableAsyncFn (),
  write: makeUnstableAsyncFn (),
  fsync: makeUnstableAsyncFn (),
  close: makeUnstableAsyncFn (),
  rename: makeUnstableAsyncFn (),
  openSync: makeUnstableSyncFn ( _.identity ),
  writeSync: makeUnstableSyncFn ( _.noop ),
  fsyncSync: makeUnstableSyncFn ( _.noop ),
  closeSync: makeUnstableSyncFn ( _.noop ),
  renameSync: makeUnstableSyncFn ( _.noop )
});

const {writeFile: writeFileAtomic, writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: fsMock });

test('async tests', t => {
  t.plan(2)

  expectClose = 0
  closeCalled = 0
  t.teardown(() => {
    t.parent.equal(closeCalled, expectClose, 'async tests closed all files')
    expectClose = 0
    closeCalled = 0
  })

  t.test('non-root tests', t => {
    t.plan(28)

    writeFileAtomic('good', 'test', { mode: '0777' }, err => {
      t.notOk(err, 'No errors occur when passing in options')
    })
    writeFileAtomic('good', 'test', 'utf8', err => {
      t.notOk(err, 'No errors occur when passing in options as string')
    })
    writeFileAtomic('good', 'test', undefined, err => {
      t.notOk(err, 'No errors occur when NOT passing in options')
    })
    writeFileAtomic('good', 'test', err => {
      t.notOk(err)
    })
    writeFileAtomic('noopen', 'test', err => {
      t.is(err && err.message, 'ENOOPEN', 'fs.open failures propagate')
    })
    writeFileAtomic('nowrite', 'test', err => {
      t.is(err && err.message, 'ENOWRITE', 'fs.writewrite failures propagate')
    })
    writeFileAtomic('nowrite', Buffer.from('test', 'utf8'), err => {
      t.is(err && err.message, 'ENOWRITE', 'fs.writewrite failures propagate for buffers')
    })
    writeFileAtomic('nochown', 'test', { chown: { uid: 100, gid: 100 } }, err => {
      t.is(err && err.message, 'ENOCHOWN', 'Chown failures propagate')
    })
    writeFileAtomic('nochown', 'test', err => {
      t.notOk(err, 'No attempt to chown when no uid/gid passed in')
    })
    writeFileAtomic('nochmod', 'test', { mode: parseInt('741', 8) }, err => {
      t.is(err && err.message, 'ENOCHMOD', 'Chmod failures propagate')
    })
    writeFileAtomic('nofsyncopt', 'test', { fsync: false }, err => {
      t.notOk(err, 'fsync skipped if options.fsync is false')
    })
    writeFileAtomic('norename', 'test', err => {
      t.is(err && err.message, 'ENORENAME', 'Rename errors propagate')
    })
    writeFileAtomic('norename nounlink', 'test', err => {
      t.is(err && err.message, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error')
    })
    writeFileAtomic('nofsync', 'test', err => {
      t.is(err && err.message, 'ENOFSYNC', 'Fsync failures propagate')
    })
    writeFileAtomic('enosys', 'test', err => {
      t.notOk(err, 'No errors on ENOSYS')
    })
    writeFileAtomic('einval', 'test', { mode: 0o741 }, err => {
      t.notOk(err, 'No errors on EINVAL for non root')
    })
    writeFileAtomic('eperm', 'test', { mode: 0o741 }, err => {
      t.notOk(err, 'No errors on EPERM for non root')
    })
    writeFileAtomic('einval', 'test', { chown: { uid: 100, gid: 100 } }, err => {
      t.notOk(err, 'No errors on EINVAL for non root')
    })
    writeFileAtomic('eperm', 'test', { chown: { uid: 100, gid: 100 } }, err => {
      t.notOk(err, 'No errors on EPERM for non root')
    })
    const optionsImmutable = {};
    writeFileAtomic('statful', 'test', optionsImmutable, err => {
      t.notOk(err);
      t.deepEquals(optionsImmutable, {});
    });
    const schedule = filePath => {
      t.is(filePath, 'good');
      return new Promise ( resolve => {
        resolve ( () => {
          t.is(true,true);
        });
      });
    };
    writeFileAtomic('good','test', {schedule}, err => {
      t.notOk(err);
    });
    const tmpCreate = filePath => `.${filePath}.custom`;
    const tmpCreated = filePath => t.is ( filePath, '.good.custom' );
    writeFileAtomic('good','test', {tmpCreate, tmpCreated}, err => {
      t.notOk(err)
    })
    const longPath = path.join(os.tmpdir(),'.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt');
    const {writeFile: writeFileAtomicNative} = requireInject('../dist', { fs });
    writeFileAtomicNative(longPath,'test', err => {
      t.notOk(err)
    })
    const pathMissingFolders = path.join(os.tmpdir(),String(Math.random()),String(Math.random()),String(Math.random()),'foo.txt');
    writeFileAtomicNative(pathMissingFolders,'test', err => {
      t.notOk(err)
    })
  })

  t.test('errors for root', t => {
    const { getuid } = process
    process.getuid = () => 0
    t.teardown(() => {
      process.getuid = getuid
    })
    const {writeFile: writeFileAtomic} = requireInject('../dist', { fs: fsMock });
    t.plan(2)
    writeFileAtomic('einval', 'test', { chown: { uid: 100, gid: 100 } }, err => {
      t.match(err, { code: 'EINVAL' })
    })
    writeFileAtomic('einval', 'test', { mode: 0o741 }, err => {
      t.match(err, { code: 'EINVAL' })
    })
  })
})

test('unstable async tests', t => {
  t.plan(2);
  const {writeFile: writeFileAtomic} = requireInject('../dist', { fs: fsMockUnstable });
  writeFileAtomic('good', 'test', err => {
    t.notOk(err, 'No errors occur when retryable errors are thrown')
  })
  writeFileAtomic('good', 'test', { timeout: 0 }, err => {
    t.is(!!err.code, true, 'Retrying can be disabled')
  })
});

test('sync tests', t => {
  t.plan(2)
  closeSyncCalled = 0
  expectCloseSync = 0
  t.teardown(() => {
    t.parent.equal(closeSyncCalled, expectCloseSync, 'sync closed all files')
    expectCloseSync = 0
    closeSyncCalled = 0
  })

  const throws = function (t, shouldthrow, msg, todo) {
    let err
    try { todo() } catch (e) { err = e }
    t.is(shouldthrow, err && err.message, msg)
  }
  const noexception = function (t, msg, todo) {
    let err
    try { todo() } catch (e) { err = e }
    t.ifError(err, msg)
  }
  let tmpfile

  t.test('non-root', t => {
    t.plan(38)
    noexception(t, 'No errors occur when passing in options', () => {
      writeFileAtomicSync('good', 'test', { mode: '0777' })
    })
    noexception(t, 'No errors occur when passing in options as string', () => {
      writeFileAtomicSync('good', 'test', 'utf8')
    })
    noexception(t, 'No errors occur when NOT passing in options', () => {
      writeFileAtomicSync('good', 'test')
    })
    noexception(t, 'fsync never called if options.fsync is falsy', () => {
      writeFileAtomicSync('good', 'test', { fsync: false })
    })
    noexception(t, 'tmpCreated is called on success', () => {
      writeFileAtomicSync('good', 'test', {
        tmpCreated (gottmpfile) {
          tmpfile = gottmpfile
        }
      })
      t.match(tmpfile, /^good\.tmp-\w+$/, 'tmpCreated called for success')
      t.match(tmpfile, /^good\.tmp-\d{10}[a-f0-9]{6}$/, 'tmpCreated format')
    })

    tmpfile = undefined
    throws(t, 'ENOOPEN', 'fs.openSync failures propagate', () => {
      writeFileAtomicSync('noopen', 'test', {
        tmpCreated (gottmpfile) {
          tmpfile = gottmpfile
        }
      })
    })
    t.is(tmpfile, undefined, 'tmpCreated not called for open failure')

    throws(t, 'ENOWRITE', 'fs.writeSync failures propagate', () => {
      writeFileAtomicSync('nowrite', 'test', {
        tmpCreated (gottmpfile) {
          tmpfile = gottmpfile
        }
      })
    })
    t.match(tmpfile, /^nowrite\.tmp-\w+$/, 'tmpCreated called for failure after open')

    throws(t, 'ENOCHOWN', 'Chown failures propagate', () => {
      writeFileAtomicSync('nochown', 'test', { chown: { uid: 100, gid: 100 } })
    })
    noexception(t, 'No attempt to chown when false passed in', () => {
      writeFileAtomicSync('nochown', 'test', { chown: false })
    })
    noexception(t, 'No errors occured when chown is undefined and original file owner used', () => {
      writeFileAtomicSync('chowncopy', 'test', { chown: undefined })
    })
    throws(t, 'ENORENAME', 'Rename errors propagate', () => {
      writeFileAtomicSync('norename', 'test')
    })
    throws(t, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error', () => {
      writeFileAtomicSync('norename nounlink', 'test')
    })
    throws(t, 'ENOFSYNC', 'Fsync errors propagate', () => {
      writeFileAtomicSync('nofsync', 'test')
    })
    noexception(t, 'No errors on ENOSYS', () => {
      writeFileAtomicSync('enosys', 'test', { chown: { uid: 100, gid: 100 } })
    })
    noexception(t, 'No errors on EINVAL for non root', () => {
      writeFileAtomicSync('einval', 'test', { chown: { uid: 100, gid: 100 } })
    })
    noexception(t, 'No errors on EPERM for non root', () => {
      writeFileAtomicSync('eperm', 'test', { chown: { uid: 100, gid: 100 } })
    })

    throws(t, 'ENOCHMOD', 'Chmod failures propagate', () => {
      writeFileAtomicSync('nochmod', 'test', { mode: 0o741 })
    })
    noexception(t, 'No errors on EPERM for non root', () => {
      writeFileAtomicSync('eperm', 'test', { mode: 0o741 })
    })
    noexception(t, 'No attempt to chmod when no mode provided', () => {
      writeFileAtomicSync('nochmod', 'test', { mode: false })
    })
    const optionsImmutable = {};
    noexception(t, 'options are immutable', () => {
      writeFileAtomicSync('statful', 'test', optionsImmutable)
    })
    t.deepEquals(optionsImmutable, {});
    const tmpCreate = filePath => `.${filePath}.custom`;
    const tmpCreated = filePath => t.is ( filePath, '.good.custom' );
    noexception(t, 'custom temp creator', () => {
      writeFileAtomicSync('good', 'test', {tmpCreate, tmpCreated})
    })
    const path0 = path.join(os.tmpdir(),'atomically-test-0');
    const tmpPath0 = path0 + '.temp';
    noexception(t, 'temp files are purged on success', () => {
      const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs });
      writeFileAtomicSync(path0, 'test', {tmpCreate: () => tmpPath0})
    })
    t.is(true,fs.existsSync(path0));
    t.is(false,fs.existsSync(tmpPath0));
    const path1 = path.join(os.tmpdir(),'atomically-test-norename-1');
    const tmpPath1 = path1 + '.temp';
    throws(t, 'ENORENAME', 'temp files are purged on error', () => {
      const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: Object.assign ( {}, fs, { renameSync: fsMock.renameSync })});
      writeFileAtomicSync(path1, 'test', {tmpCreate: () => tmpPath1})
    })
    t.is(false,fs.existsSync(path1));
    t.is(false,fs.existsSync(tmpPath1));
    const path2 = path.join(os.tmpdir(),'atomically-test-norename-2');
    const tmpPath2 = path2 + '.temp';
    throws(t, 'ENORENAME', 'temp files can also not be purged on error', () => {
      const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: Object.assign ( {}, fs, { renameSync: fsMock.renameSync })});
      writeFileAtomicSync(path2, 'test', {tmpCreate: () => tmpPath2,tmpPurge: false})
    })
    t.is(false,fs.existsSync(path2));
    t.is(true,fs.existsSync(tmpPath2));
    const longPath = path.join(os.tmpdir(),'.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt');
    noexception(t, 'temp files are truncated', () => {
      const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs });
      writeFileAtomicSync(longPath, 'test')
    })
    const pathMissingFolders = path.join(os.tmpdir(),String(Math.random()),String(Math.random()),String(Math.random()),'foo.txt');
    noexception(t, 'parent folders are created', () => {
      const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs });
      writeFileAtomicSync(pathMissingFolders, 'test')
    })
  })

  t.test('errors for root', t => {
    const { getuid } = process
    process.getuid = () => 0
    t.teardown(() => {
      process.getuid = getuid
    })
    const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: fsMock });
    t.plan(2)
    throws(t, 'EINVAL', 'Chown error as root user', () => {
      writeFileAtomicSync('einval', 'test', { chown: { uid: 100, gid: 100 } })
    })
    throws(t, 'EINVAL', 'Chmod error as root user', () => {
      writeFileAtomicSync('einval', 'test', { mode: 0o741 })
    })
  })
})

test('unstable sync tests', t => {
  t.plan(2);

  const throws = function (t, msg, todo) {
    let err
    try { todo() } catch (e) { err = e }
    t.is(!!err.code, true, msg)
  }
  const noexception = function (t, msg, todo) {
    let err
    try { todo() } catch (e) { err = e }
    t.ifError(err, msg)
  }

  noexception(t, 'No errors occur when retryable errors are thrown', () => {
    const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: fsMockUnstable });
    writeFileAtomicSync('good', 'test')
  })

  throws(t, 'retrying can be disabled', () => {
    const {writeFileSync: writeFileAtomicSync} = requireInject('../dist', { fs: fsMockUnstable });
    writeFileAtomicSync('good', 'test', { timeout: 0 })
  })
});

test('promises', async t => {
  let tmpfile
  closeCalled = 0
  expectClose = 0
  t.teardown(() => {
    t.parent.equal(closeCalled, expectClose, 'promises closed all files')
    closeCalled = 0
    expectClose = 0
  })

  await writeFileAtomic('good', 'test', {
    tmpCreated (gottmpfile) {
      tmpfile = gottmpfile
    }
  })
  t.match(tmpfile, /^good\.tmp-\w+$/, 'tmpCreated is called for success')

  await writeFileAtomic('good', 'test', {
    tmpCreated (gottmpfile) {
      return Promise.resolve()
    }
  })

  tmpfile = undefined
  await t.rejects(writeFileAtomic('noopen', 'test', {
    tmpCreated (gottmpfile) {
      tmpfile = gottmpfile
    }
  }))
  t.is(tmpfile, undefined, 'tmpCreated is not called on open failure')

  await t.rejects(writeFileAtomic('nowrite', 'test', {
    tmpCreated (gottmpfile) {
      tmpfile = gottmpfile
    }
  }))
  t.match(tmpfile, /^nowrite\.tmp-\w+$/, 'tmpCreated is called if failure is after open')
})
'use strict'

process.setMaxListeners(1000000);

const fs = require('fs')
const {test} = require('tap')
const requireInject = require('require-inject')

// defining mock for fs so its functions can be modified
const fsMock = Object.assign ( {}, fs, {
  /* ASYNC */
  mkdir (filename, opts, cb) {
    return cb(null);
  },
  realpath (filename, cb) {
    return cb(null, filename)
  },
  open (tmpfile, options, mode, cb) {
    if (/noopen/.test(tmpfile)) return cb(new Error('ENOOPEN'))
    cb(null, tmpfile)
  },
  write (fd) {
    const cb = arguments[arguments.length - 1]
    if (/nowrite/.test(fd)) return cb(new Error('ENOWRITE'))
    cb()
  },
  fsync (fd, cb) {
    if (/nofsync/.test(fd)) return cb(new Error('ENOFSYNC'))
    cb()
  },
  close (fd, cb) {
    cb()
  },
  chown (tmpfile, uid, gid, cb) {
    if (/nochown/.test(tmpfile)) return cb(new Error('ENOCHOWN'))
    cb()
  },
  chmod (tmpfile, mode, cb) {
    if (/nochmod/.test(tmpfile)) return cb(new Error('ENOCHMOD'))
    cb()
  },
  rename (tmpfile, filename, cb) {
    if (/norename/.test(tmpfile)) return cb(new Error('ENORENAME'))
    cb()
  },
  unlink (tmpfile, cb) {
    if (/nounlink/.test(tmpfile)) return cb(new Error('ENOUNLINK'))
    cb()
  },
  stat (tmpfile, cb) {
    if (/nostat/.test(tmpfile)) return cb(new Error('ENOSTAT'))
    cb()
  },
  /* SYNC */
  mkdirSync (filename) {},
  realpathSync (filename, cb) {
    return filename
  },
  openSync (tmpfile, options) {
    if (/noopen/.test(tmpfile)) throw new Error('ENOOPEN')
    return tmpfile
  },
  writeSync (fd) {
    if (/nowrite/.test(fd)) throw new Error('ENOWRITE')
  },
  fsyncSync (fd) {
    if (/nofsync/.test(fd)) throw new Error('ENOFSYNC')
  },
  closeSync () {},
  chownSync (tmpfile, uid, gid) {
    if (/nochown/.test(tmpfile)) throw new Error('ENOCHOWN')
  },
  chmodSync (tmpfile, mode) {
    if (/nochmod/.test(tmpfile)) throw new Error('ENOCHMOD')
  },
  renameSync (tmpfile, filename) {
    if (/norename/.test(tmpfile)) throw new Error('ENORENAME')
  },
  unlinkSync (tmpfile) {
    if (/nounlink/.test(tmpfile)) throw new Error('ENOUNLINK')
  },
  statSync (tmpfile) {
    if (/nostat/.test(tmpfile)) throw new Error('ENOSTAT')
  }
})

const {writeFile: writeFileAtomic} = requireInject('../dist', { fs: fsMock });

// preserve original functions
const oldRealPath = fsMock.realpath
const oldRename = fsMock.rename

test('ensure writes to the same file are serial', t => {
  let fileInUse = false
  const ops = 5 // count for how many concurrent write ops to request
  t.plan(ops * 3 + 3)
  fsMock.realpath = (...args) => {
    t.false(fileInUse, 'file not in use')
    fileInUse = true
    oldRealPath(...args)
  }
  fsMock.rename = (...args) => {
    t.true(fileInUse, 'file in use')
    fileInUse = false
    oldRename(...args)
  }
  const {writeFile: writeFileAtomic} = requireInject('../dist', { fs: fsMock });
  for (let i = 0; i < ops; i++) {
    writeFileAtomic('test', 'test', err => {
      if (err) t.fail(err)
      else t.pass('wrote without error')
    })
  }
  setTimeout(() => {
    writeFileAtomic('test', 'test', err => {
      if (err) t.fail(err)
      else t.pass('successive writes after delay')
    })
  }, 500)
})

test('allow write to multiple files in parallel, but same file writes are serial', t => {
  const filesInUse = []
  const ops = 5
  let wasParallel = false
  fsMock.realpath = (filename, ...args) => {
    filesInUse.push(filename)
    const firstOccurence = filesInUse.indexOf(filename)
    t.equal(filesInUse.indexOf(filename, firstOccurence + 1), -1, 'serial writes') // check for another occurence after the first
    if (filesInUse.length > 1) wasParallel = true // remember that a parallel operation took place
    oldRealPath(filename, ...args)
  }
  fsMock.rename = (filename, ...args) => {
    filesInUse.splice(filesInUse.indexOf(filename), 1)
    oldRename(filename, ...args)
  }
  const {writeFile: writeFileAtomic} = requireInject('../dist', { fs: fsMock });
  t.plan(ops * 2 * 2 + 1)
  let opCount = 0
  for (let i = 0; i < ops; i++) {
    writeFileAtomic('test', 'test', err => {
      if (err) t.fail(err, 'wrote without error')
      else t.pass('wrote without error')
    })
    writeFileAtomic('test2', 'test', err => {
      opCount++
      if (opCount === ops) t.true(wasParallel, 'parallel writes')

      if (err) t.fail(err, 'wrote without error')
      else t.pass('wrote without error')
    })
  }
})
'use strict'

process.setMaxListeners(1000000);

const fs = require('fs')
const path = require('path')
const {test} = require('tap')
const rimraf = require('rimraf')
const requireInject = require('require-inject')

const workdir = path.join(__dirname, path.basename(__filename, '.js'))
let testfiles = 0
function tmpFile () {
  return path.join(workdir, 'test-' + (++testfiles))
}

function readFile (path) {
  return fs.readFileSync(path).toString()
}

function didWriteFileAtomic (t, expected, filename, data, options, callback) {
  if (options instanceof Function) {
    callback = options
    options = null
  }
  if (!options) options = {}
  const actual = {}
  const {writeFile: writeFileAtomic} = requireInject('../dist', {
    fs: Object.assign({}, fs, {
      chown (filename, uid, gid, cb) {
        actual.uid = uid
        actual.gid = gid
        process.nextTick(cb)
      },
      stat (filename, cb) {
        fs.stat(filename, (err, stats) => {
          if (err) return cb(err)
          cb(null, Object.assign(stats, expected || {}))
        })
      }
    })
  })
  return writeFileAtomic(filename, data, options, err => {
    t.isDeeply(actual, expected, 'ownership is as expected')
    callback(err)
  })
}

function didWriteFileAtomicSync (t, expected, filename, data, options) {
  const actual = {}
  const {writeFileSync} = requireInject('../dist', {
    fs: Object.assign({}, fs, {
      chownSync (filename, uid, gid) {
        actual.uid = uid
        actual.gid = gid
      },
      statSync (filename) {
        const stats = fs.statSync(filename)
        return Object.assign(stats, expected || {})
      }
    })
  })
  writeFileSync(filename, data, options)
  t.isDeeply(actual, expected)
}

function currentUser () {
  return {
    uid: process.getuid(),
    gid: process.getgid()
  }
}

test('setup', t => {
  rimraf.sync(workdir)
  fs.mkdirSync(workdir, {recursive: true})
  t.done()
})

test('writes simple file (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, '42', err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '42', 'content ok')
  })
})

test('writes simple file with encoding (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, 'foo', 'utf16le', err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), 'f\u0000o\u0000o\u0000', 'content ok')
  })
})

test('writes buffers to simple file (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, Buffer.from('42'), err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '42', 'content ok')
  })
})

test('writes undefined to simple file (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, undefined, err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '', 'content ok')
  })
})

test('writes to symlinks without clobbering (async)', t => {
  t.plan(5)
  const file = tmpFile()
  const link = tmpFile()
  fs.writeFileSync(file, '42')
  fs.symlinkSync(file, link)
  didWriteFileAtomic(t, currentUser(), link, '43', err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '43', 'target content ok')
    t.is(readFile(link), '43', 'link content ok')
    t.ok(fs.lstatSync(link).isSymbolicLink(), 'link is link')
  })
})

test('runs chown on given file (async)', t => {
  const file = tmpFile()
  didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '42', { chown: { uid: 42, gid: 43 } }, err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '42', 'content ok')
    t.done()
  })
})

test('writes simple file with no chown (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, '42', { chown: false }, err => {
    t.ifError(err, 'no error')
    t.is(readFile(file), '42', 'content ok')
    t.done()
  })
})

test('runs chmod on given file (async)', t => {
  t.plan(5)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, '42', { mode: parseInt('741', 8) }, err => {
    t.ifError(err, 'no error')
    const stat = fs.statSync(file)
    t.is(stat.mode, parseInt('100741', 8))
    didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '23', { chown: { uid: 42, gid: 43 } }, err => {
      t.ifError(err, 'no error')
    })
  })
})

test('run chmod AND chown (async)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '42', { mode: parseInt('741', 8), chown: { uid: 42, gid: 43 } }, err => {
    t.ifError(err, 'no error')
    const stat = fs.statSync(file)
    t.is(stat.mode, parseInt('100741', 8))
  })
})

test('does not change chmod by default (async)', t => {
  t.plan(5)
  const file = tmpFile()
  didWriteFileAtomic(t, {}, file, '42', { mode: parseInt('741', 8) }, err => {
    t.ifError(err, 'no error')

    didWriteFileAtomic(t, currentUser(), file, '43', err => {
      t.ifError(err, 'no error')
      const stat = fs.statSync(file)
      t.is(stat.mode, parseInt('100741', 8))
    })
  })
})

test('does not change chown by default (async)', t => {
  t.plan(6)
  const file = tmpFile()
  didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '42', { chown: { uid: 42, gid: 43 } }, _setModeOnly)

  function _setModeOnly (err) {
    t.ifError(err, 'no error')

    didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '43', { mode: parseInt('741', 8) }, _allDefault)
  }

  function _allDefault (err) {
    t.ifError(err, 'no error')

    didWriteFileAtomic(t, { uid: 42, gid: 43 }, file, '43', _noError)
  }

  function _noError (err) {
    t.ifError(err, 'no error')
  }
})

test('writes simple file (sync)', t => {
  t.plan(2)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, '42')
  t.is(readFile(file), '42')
})

test('writes simple file with encoding (sync)', t => {
  t.plan(2)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, 'foo', 'utf16le')
  t.is(readFile(file), 'f\u0000o\u0000o\u0000')
})

test('writes simple buffer file (sync)', t => {
  t.plan(2)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, Buffer.from('42'))
  t.is(readFile(file), '42')
})

test('writes undefined file (sync)', t => {
  t.plan(2)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, undefined)
  t.is(readFile(file), '')
})

test('writes to symlinks without clobbering (sync)', t => {
  t.plan(4)
  const file = tmpFile()
  const link = tmpFile()
  fs.writeFileSync(file, '42')
  fs.symlinkSync(file, link)
  didWriteFileAtomicSync(t, currentUser(), link, '43')
  t.is(readFile(file), '43', 'target content ok')
  t.is(readFile(link), '43', 'link content ok')
  t.ok(fs.lstatSync(link).isSymbolicLink(), 'link is link')
})

test('runs chown on given file (sync)', t => {
  t.plan(1)
  const file = tmpFile()
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '42', { chown: { uid: 42, gid: 43 } })
})

test('runs chmod on given file (sync)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, '42', { mode: parseInt('741', 8) })
  const stat = fs.statSync(file)
  t.is(stat.mode, parseInt('100741', 8))
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '23', { chown: { uid: 42, gid: 43 } })
})

test('runs chown and chmod (sync)', t => {
  t.plan(2)
  const file = tmpFile()
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '42', { mode: parseInt('741', 8), chown: { uid: 42, gid: 43 } })
  const stat = fs.statSync(file)
  t.is(stat.mode, parseInt('100741', 8))
})

test('does not change chmod by default (sync)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomicSync(t, {}, file, '42', { mode: parseInt('741', 8) })
  didWriteFileAtomicSync(t, currentUser(), file, '43')
  const stat = fs.statSync(file)
  t.is(stat.mode, parseInt('100741', 8))
})

test('does not change chown by default (sync)', t => {
  t.plan(3)
  const file = tmpFile()
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '42', { chown: { uid: 42, gid: 43 } })
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '43', { mode: parseInt('741', 8) })
  didWriteFileAtomicSync(t, { uid: 42, gid: 43 }, file, '44')
})

test('cleanup', t => {
  rimraf.sync(workdir)
  t.done()
})
{
  "compilerOptions": {
    "alwaysStrict": true,
    "declaration": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "forceConsistentCasingInFileNames": true,
    "inlineSourceMap": false,
    "jsx": "react",
    "lib": ["dom", "scripthost", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020"],
    "module": "commonjs",
    "moduleResolution": "node",
    "newLine": "LF",
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "noUnusedParameters": false,
    "outDir": "dist",
    "pretty": true,
    "strictNullChecks": true,
    "target": "es2018"
  },
  "include": [
    "src"
  ],
  "exclude": [
    "node_modules"
  ]
}
/// <reference types="node" />
import { EventEmitter } from 'events';
import { OnDidChangeCallback, Options, Unsubscribe, Schema, OnDidAnyChangeCallback } from './types';
declare class Conf<T extends Record<string, any> = Record<string, unknown>> implements Iterable<[keyof T, T[keyof T]]> {
    #private;
    readonly path: string;
    readonly events: EventEmitter;
    constructor(partialOptions?: Readonly<Partial<Options<T>>>);
    /**
    Get an item.

    @param key - The key of the item to get.
    @param defaultValue - The default value if the item does not exist.
    */
    get<Key extends keyof T>(key: Key): T[Key];
    get<Key extends keyof T>(key: Key, defaultValue: Required<T>[Key]): Required<T>[Key];
    get<Key extends string, Value = unknown>(key: Exclude<Key, keyof T>, defaultValue?: Value): Value;
    /**
    Set an item or multiple items at once.

    @param {key|object} - You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a key to access nested properties. Or a hashmap of items to set at once.
    @param value - Must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a `TypeError`.
    */
    set<Key extends keyof T>(key: Key, value?: T[Key]): void;
    set(key: string, value: unknown): void;
    set(object: Partial<T>): void;
    /**
    Check if an item exists.

    @param key - The key of the item to check.
    */
    has<Key extends keyof T>(key: Key | string): boolean;
    /**
    Reset items to their default values, as defined by the `defaults` or `schema` option.

    @see `clear()` to reset all items.

    @param keys - The keys of the items to reset.
    */
    reset<Key extends keyof T>(...keys: Key[]): void;
    /**
    Delete an item.

    @param key - The key of the item to delete.
    */
    delete<Key extends keyof T>(key: Key): void;
    /**
    Delete all items.

    This resets known items to their default values, if defined by the `defaults` or `schema` option.
    */
    clear(): void;
    /**
    Watches the given `key`, calling `callback` on any changes.

    @param key - The key wo watch.
    @param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
    @returns A function, that when called, will unsubscribe.
    */
    onDidChange<Key extends keyof T>(key: Key, callback: OnDidChangeCallback<T[Key]>): Unsubscribe;
    /**
    Watches the whole config object, calling `callback` on any changes.

    @param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
    @returns A function, that when called, will unsubscribe.
    */
    onDidAnyChange(callback: OnDidAnyChangeCallback<T>): Unsubscribe;
    get size(): number;
    get store(): T;
    set store(value: T);
    [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>;
    private _encryptData;
    private _handleChange;
    private readonly _deserialize;
    private readonly _serialize;
    private _validate;
    private _ensureDirectory;
    private _write;
    private _watch;
    private _migrate;
    private _containsReservedKey;
    private _isVersionInRangeFormat;
    private _shouldPerformMigration;
    private _get;
    private _set;
}
export { Schema, Options };
export default Conf;
"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _a, _b;
var _Conf_validator, _Conf_encryptionKey, _Conf_options, _Conf_defaultValues;
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("util");
const fs = require("fs");
const path = require("path");
const crypto = require("crypto");
const assert = require("assert");
const events_1 = require("events");
const dotProp = require("dot-prop");
const pkgUp = require("pkg-up");
const envPaths = require("env-paths");
const atomically = require("atomically");
const ajv_1 = require("ajv");
const ajv_formats_1 = require("ajv-formats");
const debounceFn = require("debounce-fn");
const semver = require("semver");
const onetime = require("onetime");
const encryptionAlgorithm = 'aes-256-cbc';
const createPlainObject = () => {
    return Object.create(null);
};
const isExist = (data) => {
    return data !== undefined && data !== null;
};
let parentDir = '';
try {
    // Prevent caching of this module so module.parent is always accurate.
    // Note: This trick won't work with ESM or inside a webworker
    // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
    delete require.cache[__filename];
    parentDir = path.dirname((_b = (_a = module.parent) === null || _a === void 0 ? void 0 : _a.filename) !== null && _b !== void 0 ? _b : '.');
}
catch (_c) { }
const checkValueType = (key, value) => {
    const nonJsonTypes = new Set([
        'undefined',
        'symbol',
        'function'
    ]);
    const type = typeof value;
    if (nonJsonTypes.has(type)) {
        throw new TypeError(`Setting a value of type \`${type}\` for key \`${key}\` is not allowed as it's not supported by JSON`);
    }
};
const INTERNAL_KEY = '__internal__';
const MIGRATION_KEY = `${INTERNAL_KEY}.migrations.version`;
class Conf {
    constructor(partialOptions = {}) {
        var _a;
        _Conf_validator.set(this, void 0);
        _Conf_encryptionKey.set(this, void 0);
        _Conf_options.set(this, void 0);
        _Conf_defaultValues.set(this, {});
        this._deserialize = value => JSON.parse(value);
        this._serialize = value => JSON.stringify(value, undefined, '\t');
        const options = {
            configName: 'config',
            fileExtension: 'json',
            projectSuffix: 'nodejs',
            clearInvalidConfig: false,
            accessPropertiesByDotNotation: true,
            configFileMode: 0o666,
            ...partialOptions
        };
        const getPackageData = onetime(() => {
            const packagePath = pkgUp.sync({ cwd: parentDir });
            // Can't use `require` because of Webpack being annoying:
            // https://github.com/webpack/webpack/issues/196
            const packageData = packagePath && JSON.parse(fs.readFileSync(packagePath, 'utf8'));
            return packageData !== null && packageData !== void 0 ? packageData : {};
        });
        if (!options.cwd) {
            if (!options.projectName) {
                options.projectName = getPackageData().name;
            }
            if (!options.projectName) {
                throw new Error('Project name could not be inferred. Please specify the `projectName` option.');
            }
            options.cwd = envPaths(options.projectName, { suffix: options.projectSuffix }).config;
        }
        __classPrivateFieldSet(this, _Conf_options, options, "f");
        if (options.schema) {
            if (typeof options.schema !== 'object') {
                throw new TypeError('The `schema` option must be an object.');
            }
            const ajv = new ajv_1.default({
                allErrors: true,
                useDefaults: true
            });
            (0, ajv_formats_1.default)(ajv);
            const schema = {
                type: 'object',
                properties: options.schema
            };
            __classPrivateFieldSet(this, _Conf_validator, ajv.compile(schema), "f");
            for (const [key, value] of Object.entries(options.schema)) {
                if (value === null || value === void 0 ? void 0 : value.default) {
                    __classPrivateFieldGet(this, _Conf_defaultValues, "f")[key] = value.default;
                }
            }
        }
        if (options.defaults) {
            __classPrivateFieldSet(this, _Conf_defaultValues, {
                ...__classPrivateFieldGet(this, _Conf_defaultValues, "f"),
                ...options.defaults
            }, "f");
        }
        if (options.serialize) {
            this._serialize = options.serialize;
        }
        if (options.deserialize) {
            this._deserialize = options.deserialize;
        }
        this.events = new events_1.EventEmitter();
        __classPrivateFieldSet(this, _Conf_encryptionKey, options.encryptionKey, "f");
        const fileExtension = options.fileExtension ? `.${options.fileExtension}` : '';
        this.path = path.resolve(options.cwd, `${(_a = options.configName) !== null && _a !== void 0 ? _a : 'config'}${fileExtension}`);
        const fileStore = this.store;
        const store = Object.assign(createPlainObject(), options.defaults, fileStore);
        this._validate(store);
        try {
            assert.deepEqual(fileStore, store);
        }
        catch (_b) {
            this.store = store;
        }
        if (options.watch) {
            this._watch();
        }
        if (options.migrations) {
            if (!options.projectVersion) {
                options.projectVersion = getPackageData().version;
            }
            if (!options.projectVersion) {
                throw new Error('Project version could not be inferred. Please specify the `projectVersion` option.');
            }
            this._migrate(options.migrations, options.projectVersion, options.beforeEachMigration);
        }
    }
    get(key, defaultValue) {
        if (__classPrivateFieldGet(this, _Conf_options, "f").accessPropertiesByDotNotation) {
            return this._get(key, defaultValue);
        }
        const { store } = this;
        return key in store ? store[key] : defaultValue;
    }
    set(key, value) {
        if (typeof key !== 'string' && typeof key !== 'object') {
            throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof key}`);
        }
        if (typeof key !== 'object' && value === undefined) {
            throw new TypeError('Use `delete()` to clear values');
        }
        if (this._containsReservedKey(key)) {
            throw new TypeError(`Please don't use the ${INTERNAL_KEY} key, as it's used to manage this module internal operations.`);
        }
        const { store } = this;
        const set = (key, value) => {
            checkValueType(key, value);
            if (__classPrivateFieldGet(this, _Conf_options, "f").accessPropertiesByDotNotation) {
                dotProp.set(store, key, value);
            }
            else {
                store[key] = value;
            }
        };
        if (typeof key === 'object') {
            const object = key;
            for (const [key, value] of Object.entries(object)) {
                set(key, value);
            }
        }
        else {
            set(key, value);
        }
        this.store = store;
    }
    /**
    Check if an item exists.

    @param key - The key of the item to check.
    */
    has(key) {
        if (__classPrivateFieldGet(this, _Conf_options, "f").accessPropertiesByDotNotation) {
            return dotProp.has(this.store, key);
        }
        return key in this.store;
    }
    /**
    Reset items to their default values, as defined by the `defaults` or `schema` option.

    @see `clear()` to reset all items.

    @param keys - The keys of the items to reset.
    */
    reset(...keys) {
        for (const key of keys) {
            if (isExist(__classPrivateFieldGet(this, _Conf_defaultValues, "f")[key])) {
                this.set(key, __classPrivateFieldGet(this, _Conf_defaultValues, "f")[key]);
            }
        }
    }
    /**
    Delete an item.

    @param key - The key of the item to delete.
    */
    delete(key) {
        const { store } = this;
        if (__classPrivateFieldGet(this, _Conf_options, "f").accessPropertiesByDotNotation) {
            dotProp.delete(store, key);
        }
        else {
            // eslint-disable-next-line @typescript-eslint/no-dynamic-delete
            delete store[key];
        }
        this.store = store;
    }
    /**
    Delete all items.

    This resets known items to their default values, if defined by the `defaults` or `schema` option.
    */
    clear() {
        this.store = createPlainObject();
        for (const key of Object.keys(__classPrivateFieldGet(this, _Conf_defaultValues, "f"))) {
            this.reset(key);
        }
    }
    /**
    Watches the given `key`, calling `callback` on any changes.

    @param key - The key wo watch.
    @param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
    @returns A function, that when called, will unsubscribe.
    */
    onDidChange(key, callback) {
        if (typeof key !== 'string') {
            throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof key}`);
        }
        if (typeof callback !== 'function') {
            throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof callback}`);
        }
        return this._handleChange(() => this.get(key), callback);
    }
    /**
    Watches the whole config object, calling `callback` on any changes.

    @param callback - A callback function that is called on any changes. When a `key` is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.
    @returns A function, that when called, will unsubscribe.
    */
    onDidAnyChange(callback) {
        if (typeof callback !== 'function') {
            throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof callback}`);
        }
        return this._handleChange(() => this.store, callback);
    }
    get size() {
        return Object.keys(this.store).length;
    }
    get store() {
        try {
            const data = fs.readFileSync(this.path, __classPrivateFieldGet(this, _Conf_encryptionKey, "f") ? null : 'utf8');
            const dataString = this._encryptData(data);
            const deserializedData = this._deserialize(dataString);
            this._validate(deserializedData);
            return Object.assign(createPlainObject(), deserializedData);
        }
        catch (error) {
            if ((error === null || error === void 0 ? void 0 : error.code) === 'ENOENT') {
                this._ensureDirectory();
                return createPlainObject();
            }
            if (__classPrivateFieldGet(this, _Conf_options, "f").clearInvalidConfig && error.name === 'SyntaxError') {
                return createPlainObject();
            }
            throw error;
        }
    }
    set store(value) {
        this._ensureDirectory();
        this._validate(value);
        this._write(value);
        this.events.emit('change');
    }
    *[(_Conf_validator = new WeakMap(), _Conf_encryptionKey = new WeakMap(), _Conf_options = new WeakMap(), _Conf_defaultValues = new WeakMap(), Symbol.iterator)]() {
        for (const [key, value] of Object.entries(this.store)) {
            yield [key, value];
        }
    }
    _encryptData(data) {
        if (!__classPrivateFieldGet(this, _Conf_encryptionKey, "f")) {
            return data.toString();
        }
        try {
            // Check if an initialization vector has been used to encrypt the data
            if (__classPrivateFieldGet(this, _Conf_encryptionKey, "f")) {
                try {
                    if (data.slice(16, 17).toString() === ':') {
                        const initializationVector = data.slice(0, 16);
                        const password = crypto.pbkdf2Sync(__classPrivateFieldGet(this, _Conf_encryptionKey, "f"), initializationVector.toString(), 10000, 32, 'sha512');
                        const decipher = crypto.createDecipheriv(encryptionAlgorithm, password, initializationVector);
                        data = Buffer.concat([decipher.update(Buffer.from(data.slice(17))), decipher.final()]).toString('utf8');
                    }
                    else {
                        // TODO: Remove this in the next major version.
                        const decipher = crypto.createDecipher(encryptionAlgorithm, __classPrivateFieldGet(this, _Conf_encryptionKey, "f"));
                        data = Buffer.concat([decipher.update(Buffer.from(data)), decipher.final()]).toString('utf8');
                    }
                }
                catch (_a) { }
            }
        }
        catch (_b) { }
        return data.toString();
    }
    _handleChange(getter, callback) {
        let currentValue = getter();
        const onChange = () => {
            const oldValue = currentValue;
            const newValue = getter();
            if ((0, util_1.isDeepStrictEqual)(newValue, oldValue)) {
                return;
            }
            currentValue = newValue;
            callback.call(this, newValue, oldValue);
        };
        this.events.on('change', onChange);
        return () => this.events.removeListener('change', onChange);
    }
    _validate(data) {
        if (!__classPrivateFieldGet(this, _Conf_validator, "f")) {
            return;
        }
        const valid = __classPrivateFieldGet(this, _Conf_validator, "f").call(this, data);
        if (valid || !__classPrivateFieldGet(this, _Conf_validator, "f").errors) {
            return;
        }
        const errors = __classPrivateFieldGet(this, _Conf_validator, "f").errors
            .map(({ instancePath, message = '' }) => `\`${instancePath.slice(1)}\` ${message}`);
        throw new Error('Config schema violation: ' + errors.join('; '));
    }
    _ensureDirectory() {
        // Ensure the directory exists as it could have been deleted in the meantime.
        fs.mkdirSync(path.dirname(this.path), { recursive: true });
    }
    _write(value) {
        let data = this._serialize(value);
        if (__classPrivateFieldGet(this, _Conf_encryptionKey, "f")) {
            const initializationVector = crypto.randomBytes(16);
            const password = crypto.pbkdf2Sync(__classPrivateFieldGet(this, _Conf_encryptionKey, "f"), initializationVector.toString(), 10000, 32, 'sha512');
            const cipher = crypto.createCipheriv(encryptionAlgorithm, password, initializationVector);
            data = Buffer.concat([initializationVector, Buffer.from(':'), cipher.update(Buffer.from(data)), cipher.final()]);
        }
        // Temporary workaround for Conf being packaged in a Ubuntu Snap app.
        // See https://github.com/sindresorhus/conf/pull/82
        if (process.env.SNAP) {
            fs.writeFileSync(this.path, data, { mode: __classPrivateFieldGet(this, _Conf_options, "f").configFileMode });
        }
        else {
            try {
                atomically.writeFileSync(this.path, data, { mode: __classPrivateFieldGet(this, _Conf_options, "f").configFileMode });
            }
            catch (error) {
                // Fix for https://github.com/sindresorhus/electron-store/issues/106
                // Sometimes on Windows, we will get an EXDEV error when atomic writing
                // (even though to the same directory), so we fall back to non atomic write
                if ((error === null || error === void 0 ? void 0 : error.code) === 'EXDEV') {
                    fs.writeFileSync(this.path, data, { mode: __classPrivateFieldGet(this, _Conf_options, "f").configFileMode });
                    return;
                }
                throw error;
            }
        }
    }
    _watch() {
        this._ensureDirectory();
        if (!fs.existsSync(this.path)) {
            this._write(createPlainObject());
        }
        if (process.platform === 'win32') {
            fs.watch(this.path, { persistent: false }, debounceFn(() => {
                // On Linux and Windows, writing to the config file emits a `rename` event, so we skip checking the event type.
                this.events.emit('change');
            }, { wait: 100 }));
        }
        else {
            fs.watchFile(this.path, { persistent: false }, debounceFn(() => {
                this.events.emit('change');
            }, { wait: 5000 }));
        }
    }
    _migrate(migrations, versionToMigrate, beforeEachMigration) {
        let previousMigratedVersion = this._get(MIGRATION_KEY, '0.0.0');
        const newerVersions = Object.keys(migrations)
            .filter(candidateVersion => this._shouldPerformMigration(candidateVersion, previousMigratedVersion, versionToMigrate));
        let storeBackup = { ...this.store };
        for (const version of newerVersions) {
            try {
                if (beforeEachMigration) {
                    beforeEachMigration(this, {
                        fromVersion: previousMigratedVersion,
                        toVersion: version,
                        finalVersion: versionToMigrate,
                        versions: newerVersions
                    });
                }
                const migration = migrations[version];
                migration(this);
                this._set(MIGRATION_KEY, version);
                previousMigratedVersion = version;
                storeBackup = { ...this.store };
            }
            catch (error) {
                this.store = storeBackup;
                throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${error}`);
            }
        }
        if (this._isVersionInRangeFormat(previousMigratedVersion) || !semver.eq(previousMigratedVersion, versionToMigrate)) {
            this._set(MIGRATION_KEY, versionToMigrate);
        }
    }
    _containsReservedKey(key) {
        if (typeof key === 'object') {
            const firsKey = Object.keys(key)[0];
            if (firsKey === INTERNAL_KEY) {
                return true;
            }
        }
        if (typeof key !== 'string') {
            return false;
        }
        if (__classPrivateFieldGet(this, _Conf_options, "f").accessPropertiesByDotNotation) {
            if (key.startsWith(`${INTERNAL_KEY}.`)) {
                return true;
            }
            return false;
        }
        return false;
    }
    _isVersionInRangeFormat(version) {
        return semver.clean(version) === null;
    }
    _shouldPerformMigration(candidateVersion, previousMigratedVersion, versionToMigrate) {
        if (this._isVersionInRangeFormat(candidateVersion)) {
            if (previousMigratedVersion !== '0.0.0' && semver.satisfies(previousMigratedVersion, candidateVersion)) {
                return false;
            }
            return semver.satisfies(versionToMigrate, candidateVersion);
        }
        if (semver.lte(candidateVersion, previousMigratedVersion)) {
            return false;
        }
        if (semver.gt(candidateVersion, versionToMigrate)) {
            return false;
        }
        return true;
    }
    _get(key, defaultValue) {
        return dotProp.get(this.store, key, defaultValue);
    }
    _set(key, value) {
        const { store } = this;
        dotProp.set(store, key, value);
        this.store = store;
    }
}
exports.default = Conf;
// For CommonJS default export support
module.exports = Conf;
module.exports.default = Conf;
/// <reference types="node" />
import { JSONSchema as TypedJSONSchema } from 'json-schema-typed';
import Conf from '.';
import { EventEmitter } from 'events';
export interface Options<T extends Record<string, any>> {
    /**
    Config used if there are no existing config.

    **Note:** The values in `defaults` will overwrite the `default` key in the `schema` option.
    */
    defaults?: Readonly<T>;
    /**
    [JSON Schema](https://json-schema.org) to validate your config data.

    Under the hood, the JSON Schema validator [ajv](https://github.com/epoberezkin/ajv) is used to validate your config. We use [JSON Schema draft-07](https://json-schema.org/latest/json-schema-validation.html) and support all [validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) and [formats](https://github.com/epoberezkin/ajv#formats).

    You should define your schema as an object where each key is the name of your data's property and each value is a JSON schema used to validate that property. See more [here](https://json-schema.org/understanding-json-schema/reference/object.html#properties).

    @example
    ```
    import Conf = require('conf');

    const schema = {
        foo: {
            type: 'number',
            maximum: 100,
            minimum: 1,
            default: 50
        },
        bar: {
            type: 'string',
            format: 'url'
        }
    };

    const config = new Conf({schema});

    console.log(config.get('foo'));
    //=> 50

    config.set('foo', '1');
    // [Error: Config schema violation: `foo` should be number]
    ```

    **Note:** The `default` value will be overwritten by the `defaults` option if set.
    */
    schema?: Schema<T>;
    /**
    Name of the config file (without extension).

    Useful if you need multiple config files for your app or module. For example, different config files between two major versions.

    @default 'config'
    */
    configName?: string;
    /**
    You only need to specify this if you don't have a package.json file in your project or if it doesn't have a name defined within it.

    Default: The name field in the `package.json` closest to where `conf` is imported.
    */
    projectName?: string;
    /**
    You only need to specify this if you don't have a package.json file in your project or if it doesn't have a version defined within it.

    Default: The name field in the `package.json` closest to where `conf` is imported.
    */
    projectVersion?: string;
    /**
    You can use migrations to perform operations to the store whenever a version is changed.

    The `migrations` object should consist of a key-value pair of `'version': handler`. The `version` can also be a [semver range](https://github.com/npm/node-semver#ranges).

    Note: The version the migrations use refers to the __project version__ by default. If you want to change this behavior, specify the `projectVersion` option.

    @example
    ```
    import Conf = require('conf');

    const store = new Conf({
        migrations: {
            '0.0.1': store => {
                store.set('debugPhase', true);
            },
            '1.0.0': store => {
                store.delete('debugPhase');
                store.set('phase', '1.0.0');
            },
            '1.0.2': store => {
                store.set('phase', '1.0.2');
            },
            '>=2.0.0': store => {
                store.set('phase', '>=2.0.0');
            }
        }
    });
    ```
    */
    migrations?: Migrations<T>;
    /**
    The given callback function will be called before each migration step.

    This can be useful for logging purposes, preparing migration data, etc.
    */
    beforeEachMigration?: BeforeEachMigrationCallback<T>;
    /**
    __You most likely don't need this. Please don't use it unless you really have to.__

    The only use-case I can think of is having the config located in the app directory or on some external storage. Default: System default user [config directory](https://github.com/sindresorhus/env-paths#pathsconfig).
    */
    cwd?: string;
    /**
    Note that this is __not intended for security purposes__, since the encryption key would be easily found inside a plain-text Node.js app.

    Its main use is for obscurity. If a user looks through the config directory and finds the config file, since it's just a JSON file, they may be tempted to modify it. By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so.

    It also has the added bonus of ensuring the config file's integrity. If the file is changed in any way, the decryption will not work, in which case the store will just reset back to its default state.

    When specified, the store will be encrypted using the [`aes-256-cbc`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) encryption algorithm.
    */
    encryptionKey?: string | Buffer | NodeJS.TypedArray | DataView;
    /**
    Extension of the config file.

    You would usually not need this, but could be useful if you want to interact with a file with a custom file extension that can be associated with your app. These might be simple save/export/preference files that are intended to be shareable or saved outside of the app.

    @default 'json'
    */
    fileExtension?: string;
    /**
    The config is cleared if reading the config file causes a `SyntaxError`. This is a good behavior for unimportant data, as the config file is not intended to be hand-edited, so it usually means the config is corrupt and there's nothing the user can do about it anyway. However, if you let the user edit the config file directly, mistakes might happen and it could be more useful to throw an error when the config is invalid instead of clearing.

    @default false
    */
    clearInvalidConfig?: boolean;
    /**
    Function to serialize the config object to a UTF-8 string when writing the config file.

    You would usually not need this, but it could be useful if you want to use a format other than JSON.

    @default value => JSON.stringify(value, null, '\t')
    */
    readonly serialize?: Serialize<T>;
    /**
    Function to deserialize the config object from a UTF-8 string when reading the config file.

    You would usually not need this, but it could be useful if you want to use a format other than JSON.

    @default JSON.parse
    */
    readonly deserialize?: Deserialize<T>;
    /**
    __You most likely don't need this. Please don't use it unless you really have to.__

    Suffix appended to `projectName` during config file creation to avoid name conflicts with native apps.

    You can pass an empty string to remove the suffix.

    For example, on macOS, the config file will be stored in the `~/Library/Preferences/foo-nodejs` directory, where `foo` is the `projectName`.

    @default 'nodejs'
    */
    readonly projectSuffix?: string;
    /**
    Access nested properties by dot notation.

    @default true

    @example
    ```
    const config = new Conf();

    config.set({
        foo: {
            bar: {
                foobar: '🦄'
            }
        }
    });

    console.log(config.get('foo.bar.foobar'));
    //=> '🦄'
    ```

    Alternatively, you can set this option to `false` so the whole string would be treated as one key.

    @example
    ```
    const config = new Conf({accessPropertiesByDotNotation: false});

    config.set({
        `foo.bar.foobar`: '🦄'
    });

    console.log(config.get('foo.bar.foobar'));
    //=> '🦄'
    ```

    */
    readonly accessPropertiesByDotNotation?: boolean;
    /**
    Watch for any changes in the config file and call the callback for `onDidChange` or `onDidAnyChange` if set. This is useful if there are multiple processes changing the same config file.

    @default false
    */
    readonly watch?: boolean;
    /**
    The [mode](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) that will be used for the config file.

    You would usually not need this, but it could be useful if you want to restrict the permissions of the config file. Setting a permission such as `0o600` would result in a config file that can only be accessed by the user running the program.

    Note that setting restrictive permissions can cause problems if different users need to read the file. A common problem is a user running your tool with and without `sudo` and then not being able to access the config the second time.

    @default 0o666
    */
    readonly configFileMode?: number;
}
export declare type Migrations<T extends Record<string, any>> = Record<string, (store: Conf<T>) => void>;
export declare type BeforeEachMigrationContext = {
    fromVersion: string;
    toVersion: string;
    finalVersion: string;
    versions: string[];
};
export declare type BeforeEachMigrationCallback<T extends Record<string, any>> = (store: Conf<T>, context: BeforeEachMigrationContext) => void;
export declare type Schema<T> = {
    [Property in keyof T]: ValueSchema;
};
export declare type ValueSchema = TypedJSONSchema;
export declare type Serialize<T> = (value: T) => string;
export declare type Deserialize<T> = (text: string) => T;
export declare type OnDidChangeCallback<T> = (newValue?: T, oldValue?: T) => void;
export declare type OnDidAnyChangeCallback<T> = (newValue?: Readonly<T>, oldValue?: Readonly<T>) => void;
export declare type Unsubscribe = () => EventEmitter;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "conf",
	"version": "10.2.0",
	"description": "Simple config handling for your app or module",
	"license": "MIT",
	"repository": "sindresorhus/conf",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"main": "dist/source",
	"engines": {
		"node": ">=12"
	},
	"scripts": {
		"test": "xo && npm run build && nyc ava",
		"build": "del-cli dist && tsc",
		"prepack": "npm run build"
	},
	"files": [
		"dist/source"
	],
	"keywords": [
		"config",
		"store",
		"app",
		"storage",
		"conf",
		"configuration",
		"settings",
		"preferences",
		"json",
		"data",
		"persist",
		"persistent",
		"save",
		"load",
		"read",
		"write",
		"cache"
	],
	"dependencies": {
		"ajv": "^8.6.3",
		"ajv-formats": "^2.1.1",
		"atomically": "^1.7.0",
		"debounce-fn": "^4.0.0",
		"dot-prop": "^6.0.1",
		"env-paths": "^2.2.1",
		"json-schema-typed": "^7.0.3",
		"onetime": "^5.1.2",
		"pkg-up": "^3.1.0",
		"semver": "^7.3.5"
	},
	"devDependencies": {
		"@ava/typescript": "^1.1.1",
		"@sindresorhus/tsconfig": "^0.7.0",
		"@types/node": "^14.14.41",
		"@types/semver": "^7.3.4",
		"@types/write-file-atomic": "^3.0.1",
		"ava": "^3.15.0",
		"clear-module": "^4.1.1",
		"del": "^6.0.0",
		"del-cli": "^3.0.1",
		"delay": "^5.0.0",
		"nyc": "^15.1.0",
		"p-event": "^4.2.0",
		"tempy": "^1.0.1",
		"tsd": "^0.14.0",
		"typescript": "^4.4.3",
		"xo": "^0.38.2"
	},
	"types": "dist/source",
	"ava": {
		"files": [
			"test/*",
			"!test/index.test-d.ts"
		],
		"timeout": "1m",
		"typescript": {
			"rewritePaths": {
				"test/": "dist/test/"
			}
		}
	},
	"xo": {
		"rules": {
			"@typescript-eslint/no-implicit-any-catch": "off"
		}
	},
	"nyc": {
		"extension": [
			".ts"
		],
		"exclude": [
			"**/test/**"
		]
	}
}
# conf

> Simple config handling for your app or module

All you have to care about is what to persist. This module will handle all the dull details like where and how.

**It does not support multiple processes writing to the same store.**\
I initially made this tool to let command-line tools persist some data.

*If you need this for Electron, check out [`electron-store`](https://github.com/sindresorhus/electron-store) instead.*

## Install

```
$ npm install conf
```

## Usage

```js
const Conf = require('conf');

const config = new Conf();

config.set('unicorn', '🦄');
console.log(config.get('unicorn'));
//=> '🦄'

// Use dot-notation to access nested properties
config.set('foo.bar', true);
console.log(config.get('foo'));
//=> {bar: true}

config.delete('unicorn');
console.log(config.get('unicorn'));
//=> undefined
```

Or [create a subclass](https://github.com/sindresorhus/electron-store/blob/main/index.js).

## API

Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing config.

### Conf(options?)

Returns a new instance.

### options

Type: `object`

#### defaults

Type: `object`

Default values for the config items.

**Note:** The values in `defaults` will overwrite the `default` key in the `schema` option.

#### schema

Type: `object`

[JSON Schema](https://json-schema.org) to validate your config data.

Under the hood, the JSON Schema validator [ajv](https://github.com/epoberezkin/ajv) is used to validate your config. We use [JSON Schema draft-07](https://json-schema.org/latest/json-schema-validation.html) and support all [validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) and [formats](https://github.com/epoberezkin/ajv#formats).

You should define your schema as an object where each key is the name of your data's property and each value is a JSON schema used to validate that property. See more [here](https://json-schema.org/understanding-json-schema/reference/object.html#properties).

Example:

```js
const Conf = require('conf');

const schema = {
	foo: {
		type: 'number',
		maximum: 100,
		minimum: 1,
		default: 50
	},
	bar: {
		type: 'string',
		format: 'url'
	}
};

const config = new Conf({schema});

console.log(config.get('foo'));
//=> 50

config.set('foo', '1');
// [Error: Config schema violation: `foo` should be number]
```

**Note:** The `default` value will be overwritten by the `defaults` option if set.

### migrations

Type: `object`

You can use migrations to perform operations to the store whenever a **project version** is upgraded.

The `migrations` object should consist of a key-value pair of `'version': handler`. The `version` can also be a [semver range](https://github.com/npm/node-semver#ranges).

Example:

```js
const Conf = require('conf');

const store = new Conf({
	migrations: {
		'0.0.1': store => {
			store.set('debugPhase', true);
		},
		'1.0.0': store => {
			store.delete('debugPhase');
			store.set('phase', '1.0.0');
		},
		'1.0.2': store => {
			store.set('phase', '1.0.2');
		},
		'>=2.0.0': store => {
			store.set('phase', '>=2.0.0');
		}
	}
});
```

> Note: The version the migrations use refers to the **project version** by default. If you want to change this behavior, specify the [`projectVersion`](#projectVersion) option.

### beforeEachMigration

Type: `Function`\
Default: `undefined`

The given callback function will be called before each migration step.

The function receives the store as the first argument and a context object as the second argument with the following properties:

- `fromVersion` - The version the migration step is being migrated from.
- `toVersion` - The version the migration step is being migrated to.
- `finalVersion` - The final version after all the migrations are applied.
- `versions` - All the versions with a migration step.

This can be useful for logging purposes, preparing migration data, etc.

Example:

```js
const Conf = require('conf');

console.log = someLogger.log;

const mainConfig = new Conf({
	beforeEachMigration: (store, context) => {
		console.log(`[main-config] migrate from ${context.fromVersion} → ${context.toVersion}`);
	},
	migrations: {
		'0.4.0': store => {
			store.set('debugPhase', true);
		},
	}
});

const secondConfig = new Conf({
	beforeEachMigration: (store, context) => {
		console.log(`[second-config] migrate from ${context.fromVersion} → ${context.toVersion}`);
	},
	migrations: {
		'1.0.1': store => {
			store.set('debugPhase', true);
		},
	}
});
```

#### configName

Type: `string`\
Default: `'config'`

Name of the config file (without extension).

Useful if you need multiple config files for your app or module. For example, different config files between two major versions.

#### projectName

Type: `string`\
Default: The `name` field in the package.json closest to where `conf` is imported.

You only need to specify this if you don't have a package.json file in your project or if it doesn't have a name defined within it.

#### projectVersion

Type: `string`\
Default: The `version` field in the package.json closest to where `conf` is imported.

You only need to specify this if you don't have a package.json file in your project or if it doesn't have a version defined within it.

#### cwd

Type: `string`\
Default: System default [user config directory](https://github.com/sindresorhus/env-paths#pathsconfig)

**You most likely don't need this. Please don't use it unless you really have to. By default, it will pick the optimal location by adhering to system conventions. You are very likely to get this wrong and annoy users.**

Overrides `projectName`.

The only use-case I can think of is having the config located in the app directory or on some external storage.

#### encryptionKey

Type: `string | Buffer | TypedArray | DataView`\
Default: `undefined`

Note that this is **not intended for security purposes**, since the encryption key would be easily found inside a plain-text Node.js app.

Its main use is for obscurity. If a user looks through the config directory and finds the config file, since it's just a JSON file, they may be tempted to modify it. By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so.

When specified, the store will be encrypted using the [`aes-256-cbc`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) encryption algorithm.

#### fileExtension

Type: `string`\
Default: `'json'`

Extension of the config file.

You would usually not need this, but could be useful if you want to interact with a file with a custom file extension that can be associated with your app. These might be simple save/export/preference files that are intended to be shareable or saved outside of the app.

#### clearInvalidConfig

Type: `boolean`\
Default: `false`

The config is cleared if reading the config file causes a `SyntaxError`. This is a good behavior for unimportant data, as the config file is not intended to be hand-edited, so it usually means the config is corrupt and there's nothing the user can do about it anyway. However, if you let the user edit the config file directly, mistakes might happen and it could be more useful to throw an error when the config is invalid instead of clearing.

#### serialize

Type: `Function`\
Default: `value => JSON.stringify(value, null, '\t')`

Function to serialize the config object to a UTF-8 string when writing the config file.

You would usually not need this, but it could be useful if you want to use a format other than JSON.

#### deserialize

Type: `Function`\
Default: `JSON.parse`

Function to deserialize the config object from a UTF-8 string when reading the config file.

You would usually not need this, but it could be useful if you want to use a format other than JSON.

#### projectSuffix

Type: `string`\
Default: `'nodejs'`

**You most likely don't need this. Please don't use it unless you really have to.**

Suffix appended to `projectName` during config file creation to avoid name conflicts with native apps.

You can pass an empty string to remove the suffix.

For example, on macOS, the config file will be stored in the `~/Library/Preferences/foo-nodejs` directory, where `foo` is the `projectName`.

#### accessPropertiesByDotNotation

Type: `boolean`\
Default: `true`

Accessing nested properties by dot notation. For example:

```js
const Conf = require('conf');

const config = new Conf();

config.set({
	foo: {
		bar: {
			foobar: '🦄'
		}
	}
});

console.log(config.get('foo.bar.foobar'));
//=> '🦄'
```

Alternatively, you can set this option to `false` so the whole string would be treated as one key.

```js
const Conf = require('conf');

const config = new Conf({accessPropertiesByDotNotation: false});

config.set({
	`foo.bar.foobar`: '🦄'
});

console.log(config.get('foo.bar.foobar'));
//=> '🦄'
```

#### watch

type: `boolean`\
Default: `false`

Watch for any changes in the config file and call the callback for `onDidChange` or `onDidAnyChange` if set. This is useful if there are multiple processes changing the same config file.

#### configFileMode

Type: `number`\
Default: `0o666`

The [mode](https://en.wikipedia.org/wiki/File-system_permissions#Numeric_notation) that will be used for the config file.

You would usually not need this, but it could be useful if you want to restrict the permissions of the config file. Setting a permission such as `0o600` would result in a config file that can only be accessed by the user running the program.

Note that setting restrictive permissions can cause problems if different users need to read the file. A common problem is a user running your tool with and without `sudo` and then not being able to access the config the second time.

### Instance

You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.

The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.

#### .set(key, value)

Set an item.

The `value` must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a TypeError.

#### .set(object)

Set multiple items at once.

#### .get(key, defaultValue?)

Get an item or `defaultValue` if the item does not exist.

#### .reset(...keys)

Reset items to their default values, as defined by the `defaults` or `schema` option.

Use `.clear()` to reset all items.

#### .has(key)

Check if an item exists.

#### .delete(key)

Delete an item.

#### .clear()

Delete all items.

This resets known items to their default values, if defined by the `defaults` or `schema` option.

#### .onDidChange(key, callback)

`callback`: `(newValue, oldValue) => {}`

Watches the given `key`, calling `callback` on any changes.

When a key is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.

Returns a function which you can use to unsubscribe:

```js
const unsubscribe = conf.onDidChange(key, callback);

unsubscribe();
```

#### .onDidAnyChange(callback)

`callback`: `(newValue, oldValue) => {}`

Watches the whole config object, calling `callback` on any changes.

`oldValue` and `newValue` will be the config object before and after the change, respectively. You must compare `oldValue` to `newValue` to find out what changed.

Returns a function which you can use to unsubscribe:

```js
const unsubscribe = conf.onDidAnyChange(callback);

unsubscribe();
```

#### .size

Get the item count.

#### .store

Get all the config as an object or replace the current config with an object:

```js
conf.store = {
	hello: 'world'
};
```

#### .path

Get the path to the config file.

## FAQ

### How is this different from [`configstore`](https://github.com/yeoman/configstore)?

I'm also the author of `configstore`. While it's pretty good, I did make some mistakes early on that are hard to change at this point. This module is the result of everything I learned from making `configstore`. Mainly where the config is stored. In `configstore`, the config is stored in `~/.config` (which is mainly a Linux convention) on all systems, while `conf` stores config in the system default [user config directory](https://github.com/sindresorhus/env-paths#pathsconfig). The `~/.config` directory, it turns out, often have an incorrect permission on macOS and Windows, which has caused a lot of grief for users.

### Can I use YAML or another serialization format?

The `serialize` and `deserialize` options can be used to customize the format of the config file, as long as the representation is compatible with `utf8` encoding.

Example using YAML:

```js
const Conf = require('conf');
const yaml = require('js-yaml');

const config = new Conf({
	fileExtension: 'yaml',
	serialize: yaml.safeDump,
	deserialize: yaml.safeLoad
});
```

## Related

- [electron-store](https://github.com/sindresorhus/electron-store) - Simple data persistence for your Electron app or module
- [cache-conf](https://github.com/SamVerschueren/cache-conf) - Simple cache config handling for your app or module
0.4.2 / 2022-02-02
==================

  * pref: read value only when assigning in parse
  * pref: remove unnecessary regexp in parse

0.4.1 / 2020-04-21
==================

  * Fix `maxAge` option to reject invalid values

0.4.0 / 2019-05-15
==================

  * Add `SameSite=None` support

0.3.1 / 2016-05-26
==================

  * Fix `sameSite: true` to work with draft-7 clients
    - `true` now sends `SameSite=Strict` instead of `SameSite`

0.3.0 / 2016-05-26
==================

  * Add `sameSite` option
    - Replaces `firstPartyOnly` option, never implemented by browsers
  * Improve error message when `encode` is not a function
  * Improve error message when `expires` is not a `Date`

0.2.4 / 2016-05-20
==================

  * perf: enable strict mode
  * perf: use for loop in parse
  * perf: use string concatination for serialization

0.2.3 / 2015-10-25
==================

  * Fix cookie `Max-Age` to never be a floating point number

0.2.2 / 2015-09-17
==================

  * Fix regression when setting empty cookie value
    - Ease the new restriction, which is just basic header-level validation
  * Fix typo in invalid value errors

0.2.1 / 2015-09-17
==================

  * Throw on invalid values provided to `serialize`
    - Ensures the resulting string is a valid HTTP header value

0.2.0 / 2015-08-13
==================

  * Add `firstPartyOnly` option
  * Throw better error for invalid argument to parse
  * perf: hoist regular expression

0.1.5 / 2015-09-17
==================

  * Fix regression when setting empty cookie value
    - Ease the new restriction, which is just basic header-level validation
  * Fix typo in invalid value errors

0.1.4 / 2015-09-17
==================

  * Throw better error for invalid argument to parse
  * Throw on invalid values provided to `serialize`
    - Ensures the resulting string is a valid HTTP header value

0.1.3 / 2015-05-19
==================

  * Reduce the scope of try-catch deopt
  * Remove argument reassignments

0.1.2 / 2014-04-16
==================

  * Remove unnecessary files from npm package

0.1.1 / 2014-02-23
==================

  * Fix bad parse when cookie value contained a comma
  * Fix support for `maxAge` of `0`

0.1.0 / 2013-05-01
==================

  * Add `decode` option
  * Add `encode` option

0.0.6 / 2013-04-08
==================

  * Ignore cookie parts missing `=`

0.0.5 / 2012-10-29
==================

  * Return raw cookie value if value unescape errors

0.0.4 / 2012-06-21
==================

  * Use encode/decodeURIComponent for cookie encoding/decoding
    - Improve server/client interoperability

0.0.3 / 2012-06-06
==================

  * Only escape special characters per the cookie RFC

0.0.2 / 2012-06-01
==================

  * Fix `maxAge` option to not throw error

0.0.1 / 2012-05-28
==================

  * Add more tests

0.0.0 / 2012-05-28
==================

  * Initial release
/*!
 * cookie
 * Copyright(c) 2012-2014 Roman Shtylman
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */

'use strict';

/**
 * Module exports.
 * @public
 */

exports.parse = parse;
exports.serialize = serialize;

/**
 * Module variables.
 * @private
 */

var decode = decodeURIComponent;
var encode = encodeURIComponent;

/**
 * RegExp to match field-content in RFC 7230 sec 3.2
 *
 * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
 * field-vchar   = VCHAR / obs-text
 * obs-text      = %x80-FF
 */

var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;

/**
 * Parse a cookie header.
 *
 * Parse the given cookie header string into an object
 * The object has the various cookies as keys(names) => values
 *
 * @param {string} str
 * @param {object} [options]
 * @return {object}
 * @public
 */

function parse(str, options) {
  if (typeof str !== 'string') {
    throw new TypeError('argument str must be a string');
  }

  var obj = {}
  var opt = options || {};
  var pairs = str.split(';')
  var dec = opt.decode || decode;

  for (var i = 0; i < pairs.length; i++) {
    var pair = pairs[i];
    var index = pair.indexOf('=')

    // skip things that don't look like key=value
    if (index < 0) {
      continue;
    }

    var key = pair.substring(0, index).trim()

    // only assign once
    if (undefined == obj[key]) {
      var val = pair.substring(index + 1, pair.length).trim()

      // quoted values
      if (val[0] === '"') {
        val = val.slice(1, -1)
      }

      obj[key] = tryDecode(val, dec);
    }
  }

  return obj;
}

/**
 * Serialize data into a cookie header.
 *
 * Serialize the a name value pair into a cookie string suitable for
 * http headers. An optional options object specified cookie parameters.
 *
 * serialize('foo', 'bar', { httpOnly: true })
 *   => "foo=bar; httpOnly"
 *
 * @param {string} name
 * @param {string} val
 * @param {object} [options]
 * @return {string}
 * @public
 */

function serialize(name, val, options) {
  var opt = options || {};
  var enc = opt.encode || encode;

  if (typeof enc !== 'function') {
    throw new TypeError('option encode is invalid');
  }

  if (!fieldContentRegExp.test(name)) {
    throw new TypeError('argument name is invalid');
  }

  var value = enc(val);

  if (value && !fieldContentRegExp.test(value)) {
    throw new TypeError('argument val is invalid');
  }

  var str = name + '=' + value;

  if (null != opt.maxAge) {
    var maxAge = opt.maxAge - 0;

    if (isNaN(maxAge) || !isFinite(maxAge)) {
      throw new TypeError('option maxAge is invalid')
    }

    str += '; Max-Age=' + Math.floor(maxAge);
  }

  if (opt.domain) {
    if (!fieldContentRegExp.test(opt.domain)) {
      throw new TypeError('option domain is invalid');
    }

    str += '; Domain=' + opt.domain;
  }

  if (opt.path) {
    if (!fieldContentRegExp.test(opt.path)) {
      throw new TypeError('option path is invalid');
    }

    str += '; Path=' + opt.path;
  }

  if (opt.expires) {
    if (typeof opt.expires.toUTCString !== 'function') {
      throw new TypeError('option expires is invalid');
    }

    str += '; Expires=' + opt.expires.toUTCString();
  }

  if (opt.httpOnly) {
    str += '; HttpOnly';
  }

  if (opt.secure) {
    str += '; Secure';
  }

  if (opt.sameSite) {
    var sameSite = typeof opt.sameSite === 'string'
      ? opt.sameSite.toLowerCase() : opt.sameSite;

    switch (sameSite) {
      case true:
        str += '; SameSite=Strict';
        break;
      case 'lax':
        str += '; SameSite=Lax';
        break;
      case 'strict':
        str += '; SameSite=Strict';
        break;
      case 'none':
        str += '; SameSite=None';
        break;
      default:
        throw new TypeError('option sameSite is invalid');
    }
  }

  return str;
}

/**
 * Try decoding a string using a decoding function.
 *
 * @param {string} str
 * @param {function} decode
 * @private
 */

function tryDecode(str, decode) {
  try {
    return decode(str);
  } catch (e) {
    return str;
  }
}
(The MIT License)

Copyright (c) 2012-2014 Roman Shtylman <shtylman@gmail.com>
Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

{
  "name": "cookie",
  "description": "HTTP server cookie parsing and serialization",
  "version": "0.4.2",
  "author": "Roman Shtylman <shtylman@gmail.com>",
  "contributors": [
    "Douglas Christopher Wilson <doug@somethingdoug.com>"
  ],
  "license": "MIT",
  "keywords": [
    "cookie",
    "cookies"
  ],
  "repository": "jshttp/cookie",
  "devDependencies": {
    "beautify-benchmark": "0.2.4",
    "benchmark": "2.1.4",
    "eslint": "7.32.0",
    "eslint-plugin-markdown": "2.2.1",
    "mocha": "9.2.0",
    "nyc": "15.1.0",
    "top-sites": "1.1.85"
  },
  "files": [
    "HISTORY.md",
    "LICENSE",
    "README.md",
    "index.js"
  ],
  "engines": {
    "node": ">= 0.6"
  },
  "scripts": {
    "bench": "node benchmark/index.js",
    "lint": "eslint .",
    "test": "mocha --reporter spec --bail --check-leaks --ui qunit test/",
    "test-ci": "nyc --reporter=lcov --reporter=text npm test",
    "test-cov": "nyc --reporter=html --reporter=text npm test",
    "update-bench": "node scripts/update-benchmark.js",
    "version": "node scripts/version-history.js && git add HISTORY.md"
  }
}
# cookie

[![NPM Version][npm-version-image]][npm-url]
[![NPM Downloads][npm-downloads-image]][npm-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][coveralls-image]][coveralls-url]

Basic HTTP cookie parser and serializer for HTTP servers.

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```sh
$ npm install cookie
```

## API

```js
var cookie = require('cookie');
```

### cookie.parse(str, options)

Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs.
The `str` argument is the string representing a `Cookie` header value and `options` is an
optional object containing additional parsing options.

```js
var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2');
// { foo: 'bar', equation: 'E=mc^2' }
```

#### Options

`cookie.parse` accepts these properties in the options object.

##### decode

Specifies a function that will be used to decode a cookie's value. Since the value of a cookie
has a limited character set (and must be a simple string), this function can be used to decode
a previously-encoded cookie value into a JavaScript string or other object.

The default function is the global `decodeURIComponent`, which will decode any URL-encoded
sequences into their byte representations.

**note** if an error is thrown from this function, the original, non-decoded cookie value will
be returned as the cookie's value.

### cookie.serialize(name, value, options)

Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the
name for the cookie, the `value` argument is the value to set the cookie to, and the `options`
argument is an optional object containing additional serialization options.

```js
var setCookie = cookie.serialize('foo', 'bar');
// foo=bar
```

#### Options

`cookie.serialize` accepts these properties in the options object.

##### domain

Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6265-5.2.3]. By default, no
domain is set, and most clients will consider the cookie to apply to only the current domain.

##### encode

Specifies a function that will be used to encode a cookie's value. Since value of a cookie
has a limited character set (and must be a simple string), this function can be used to encode
a value into a string suited for a cookie's value.

The default function is the global `encodeURIComponent`, which will encode a JavaScript string
into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range.

##### expires

Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6265-5.2.1].
By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and
will delete it on a condition like exiting a web browser application.

**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.

##### httpOnly

Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6265-5.2.6]. When truthy,
the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set.

**note** be careful when setting this to `true`, as compliant clients will not allow client-side
JavaScript to see the cookie in `document.cookie`.

##### maxAge

Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6265-5.2.2].
The given number will be converted to an integer by rounding down. By default, no maximum age is set.

**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this,
so if both are set, they should point to the same date and time.

##### path

Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path
is considered the ["default path"][rfc-6265-5.1.4].

##### sameSite

Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-03-4.1.2.7].

  - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
  - `false` will not set the `SameSite` attribute.
  - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
  - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
  - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.

More information about the different enforcement levels can be found in
[the specification][rfc-6265bis-03-4.1.2.7].

**note** This is an attribute that has not yet been fully standardized, and may change in the future.
This also means many clients may ignore this attribute until they understand it.

##### secure

Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6265-5.2.5]. When truthy,
the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.

**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to
the server in the future if the browser does not have an HTTPS connection.

## Example

The following example uses this module in conjunction with the Node.js core HTTP server
to prompt a user for their name and display it back on future visits.

```js
var cookie = require('cookie');
var escapeHtml = require('escape-html');
var http = require('http');
var url = require('url');

function onRequest(req, res) {
  // Parse the query string
  var query = url.parse(req.url, true, true).query;

  if (query && query.name) {
    // Set a new cookie with the name
    res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), {
      httpOnly: true,
      maxAge: 60 * 60 * 24 * 7 // 1 week
    }));

    // Redirect back after setting cookie
    res.statusCode = 302;
    res.setHeader('Location', req.headers.referer || '/');
    res.end();
    return;
  }

  // Parse the cookies on the request
  var cookies = cookie.parse(req.headers.cookie || '');

  // Get the visitor name set in the cookie
  var name = cookies.name;

  res.setHeader('Content-Type', 'text/html; charset=UTF-8');

  if (name) {
    res.write('<p>Welcome back, <b>' + escapeHtml(name) + '</b>!</p>');
  } else {
    res.write('<p>Hello, new visitor!</p>');
  }

  res.write('<form method="GET">');
  res.write('<input placeholder="enter your name" name="name"> <input type="submit" value="Set Name">');
  res.end('</form>');
}

http.createServer(onRequest).listen(3000);
```

## Testing

```sh
$ npm test
```

## Benchmark

```
$ npm run bench

> cookie@0.4.1 bench
> node benchmark/index.js

  node@16.13.1
  v8@9.4.146.24-node.14
  uv@1.42.0
  zlib@1.2.11
  brotli@1.0.9
  ares@1.18.1
  modules@93
  nghttp2@1.45.1
  napi@8
  llhttp@6.0.4
  openssl@1.1.1l+quic
  cldr@39.0
  icu@69.1
  tz@2021a
  unicode@13.0
  ngtcp2@0.1.0-DEV
  nghttp3@0.1.0-DEV

> node benchmark/parse-top.js

  cookie.parse - top sites

  15 tests completed.

  parse accounts.google.com x   504,358 ops/sec ±6.55% (171 runs sampled)
  parse apple.com           x 1,369,991 ops/sec ±0.84% (189 runs sampled)
  parse cloudflare.com      x   360,669 ops/sec ±3.75% (182 runs sampled)
  parse docs.google.com     x   521,496 ops/sec ±4.90% (180 runs sampled)
  parse drive.google.com    x   553,514 ops/sec ±0.59% (189 runs sampled)
  parse en.wikipedia.org    x   286,052 ops/sec ±0.62% (188 runs sampled)
  parse linkedin.com        x   178,817 ops/sec ±0.61% (192 runs sampled)
  parse maps.google.com     x   284,585 ops/sec ±0.68% (188 runs sampled)
  parse microsoft.com       x   161,230 ops/sec ±0.56% (192 runs sampled)
  parse play.google.com     x   352,144 ops/sec ±1.01% (181 runs sampled)
  parse plus.google.com     x   275,204 ops/sec ±7.78% (156 runs sampled)
  parse support.google.com  x   339,493 ops/sec ±1.02% (191 runs sampled)
  parse www.google.com      x   286,110 ops/sec ±0.90% (191 runs sampled)
  parse youtu.be            x   548,557 ops/sec ±0.60% (184 runs sampled)
  parse youtube.com         x   545,293 ops/sec ±0.65% (191 runs sampled)

> node benchmark/parse.js

  cookie.parse - generic

  6 tests completed.

  simple      x 1,266,646 ops/sec ±0.65% (191 runs sampled)
  decode      x   838,413 ops/sec ±0.60% (191 runs sampled)
  unquote     x   877,820 ops/sec ±0.72% (189 runs sampled)
  duplicates  x   516,680 ops/sec ±0.61% (191 runs sampled)
  10 cookies  x   156,874 ops/sec ±0.52% (189 runs sampled)
  100 cookies x    14,663 ops/sec ±0.53% (191 runs sampled)
```

## References

- [RFC 6265: HTTP State Management Mechanism][rfc-6265]
- [Same-site Cookies][rfc-6265bis-03-4.1.2.7]

[rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7
[rfc-6265]: https://tools.ietf.org/html/rfc6265
[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4
[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1
[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2
[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3
[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4
[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5
[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6
[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3

## License

[MIT](LICENSE)

[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master
[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci
[github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
[node-version-image]: https://badgen.net/npm/node/cookie
[node-version-url]: https://nodejs.org/en/download
[npm-downloads-image]: https://badgen.net/npm/dm/cookie
[npm-url]: https://npmjs.org/package/cookie
[npm-version-image]: https://badgen.net/npm/v/cookie
declare namespace debounceFn {
	interface Options {
		/**
		Time to wait until the `input` function is called.

		@default 0
		*/
		readonly wait?: number;

		/**
		Trigger the function on the leading edge of the `wait` interval.

		For example, this can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.

		@default false
		*/
		readonly before?: boolean;

		/**
		Trigger the function on the trailing edge of the `wait` interval.

		@default true
		*/
		readonly after?: boolean;
	}

	interface BeforeOptions extends Options {
		readonly before: true;
	}

	interface NoBeforeNoAfterOptions extends Options {
		readonly after: false;
		readonly before?: false;
	}

	interface DebouncedFunction<ArgumentsType extends unknown[], ReturnType> {
		(...arguments: ArgumentsType): ReturnType;
		cancel(): void;
	}
}

/**
[Debounce](https://davidwalsh.name/javascript-debounce-function) a function.

@param input - Function to debounce.
@returns A debounced function that delays calling the `input` function until after `wait` milliseconds have elapsed since the last time the debounced function was called.

It comes with a `.cancel()` method to cancel any scheduled `input` function calls.

@example
```
import debounceFn = require('debounce-fn');

window.onresize = debounceFn(() => {
	// Do something on window resize
}, {wait: 100});
```
*/
declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
	input: (...arguments: ArgumentsType) => ReturnType,
	options: debounceFn.BeforeOptions
): debounceFn.DebouncedFunction<ArgumentsType, ReturnType>;

declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
	input: (...arguments: ArgumentsType) => ReturnType,
	options: debounceFn.NoBeforeNoAfterOptions
): debounceFn.DebouncedFunction<ArgumentsType, undefined>;

declare function debounceFn<ArgumentsType extends unknown[], ReturnType>(
	input: (...arguments: ArgumentsType) => ReturnType,
	options?: debounceFn.Options
): debounceFn.DebouncedFunction<ArgumentsType, ReturnType | undefined>;

export = debounceFn;
'use strict';
const mimicFn = require('mimic-fn');

module.exports = (inputFunction, options = {}) => {
	if (typeof inputFunction !== 'function') {
		throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
	}

	const {
		wait = 0,
		before = false,
		after = true
	} = options;

	if (!before && !after) {
		throw new Error('Both `before` and `after` are false, function wouldn\'t be called.');
	}

	let timeout;
	let result;

	const debouncedFunction = function (...arguments_) {
		const context = this;

		const later = () => {
			timeout = undefined;

			if (after) {
				result = inputFunction.apply(context, arguments_);
			}
		};

		const shouldCallNow = before && !timeout;
		clearTimeout(timeout);
		timeout = setTimeout(later, wait);

		if (shouldCallNow) {
			result = inputFunction.apply(context, arguments_);
		}

		return result;
	};

	mimicFn(debouncedFunction, inputFunction);

	debouncedFunction.cancel = () => {
		if (timeout) {
			clearTimeout(timeout);
			timeout = undefined;
		}
	};

	return debouncedFunction;
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
declare namespace mimicFn {
	interface Options {
		/**
		Skip modifying [non-configurable properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description) instead of throwing an error.

		@default false
		*/
		readonly ignoreNonConfigurable?: boolean;
	}
}

/**
Modifies the `to` function to mimic the `from` function. Returns the `to` function.

`name`, `displayName`, and any other properties of `from` are copied. The `length` property is not copied. Prototype, class, and inherited properties are copied.

`to.toString()` will return the same as `from.toString()` but prepended with a `Wrapped with to()` comment.

@param to - Mimicking function.
@param from - Function to mimic.
@returns The modified `to` function.

@example
```
import mimicFn = require('mimic-fn');

function foo() {}
foo.unicorn = '🦄';

function wrapper() {
	return foo();
}

console.log(wrapper.name);
//=> 'wrapper'

mimicFn(wrapper, foo);

console.log(wrapper.name);
//=> 'foo'

console.log(wrapper.unicorn);
//=> '🦄'
```
*/
declare function mimicFn<
	ArgumentsType extends unknown[],
	ReturnType,
	FunctionType extends (...arguments: ArgumentsType) => ReturnType
>(
	to: (...arguments: ArgumentsType) => ReturnType,
	from: FunctionType,
	options?: mimicFn.Options,
): FunctionType;

export = mimicFn;
'use strict';

const copyProperty = (to, from, property, ignoreNonConfigurable) => {
	// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
	// `Function#prototype` is non-writable and non-configurable so can never be modified.
	if (property === 'length' || property === 'prototype') {
		return;
	}

	// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.
	if (property === 'arguments' || property === 'caller') {
		return;
	}

	const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
	const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);

	if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
		return;
	}

	Object.defineProperty(to, property, fromDescriptor);
};

// `Object.defineProperty()` throws if the property exists, is not configurable and either:
//  - one its descriptors is changed
//  - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
	return toDescriptor === undefined || toDescriptor.configurable || (
		toDescriptor.writable === fromDescriptor.writable &&
		toDescriptor.enumerable === fromDescriptor.enumerable &&
		toDescriptor.configurable === fromDescriptor.configurable &&
		(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)
	);
};

const changePrototype = (to, from) => {
	const fromPrototype = Object.getPrototypeOf(from);
	if (fromPrototype === Object.getPrototypeOf(to)) {
		return;
	}

	Object.setPrototypeOf(to, fromPrototype);
};

const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`;

const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');

// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.
// We use `bind()` instead of a closure for the same reason.
// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.
const changeToString = (to, from, name) => {
	const withName = name === '' ? '' : `with ${name.trim()}() `;
	const newToString = wrappedToString.bind(null, withName, from.toString());
	// Ensure `to.toString.toString` is non-enumerable and has the same `same`
	Object.defineProperty(newToString, 'name', toStringName);
	Object.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});
};

const mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {
	const {name} = to;

	for (const property of Reflect.ownKeys(from)) {
		copyProperty(to, from, property, ignoreNonConfigurable);
	}

	changePrototype(to, from);
	changeToString(to, from, name);

	return to;
};

module.exports = mimicFn;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "mimic-fn",
	"version": "3.1.0",
	"description": "Make a function mimic another one",
	"license": "MIT",
	"repository": "sindresorhus/mimic-fn",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=8"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"function",
		"mimic",
		"imitate",
		"rename",
		"copy",
		"inherit",
		"properties",
		"name",
		"func",
		"fn",
		"set",
		"infer",
		"change"
	],
	"devDependencies": {
		"ava": "^2.1.0",
		"tsd": "^0.7.1",
		"xo": "^0.24.0"
	}
}
<img src="media/logo.svg" alt="mimic-fn" width="400">
<br>

[![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)

> Make a function mimic another one

Useful when you wrap a function in another function and like to preserve the original name and other properties.


## Install

```
$ npm install mimic-fn
```


## Usage

```js
const mimicFn = require('mimic-fn');

function foo() {}
foo.unicorn = '🦄';

function wrapper() {
	return foo();
}

console.log(wrapper.name);
//=> 'wrapper'

mimicFn(wrapper, foo);

console.log(wrapper.name);
//=> 'foo'

console.log(wrapper.unicorn);
//=> '🦄'

console.log(String(wrapper));
//=> '/* Wrapped with wrapper() */\nfunction foo() {}'
```


## API

### mimicFn(to, from, options?)

Modifies the `to` function to mimic the `from` function. Returns the `to` function.

`name`, `displayName`, and any other properties of `from` are copied. The `length` property is not copied. Prototype, class, and inherited properties are copied.

`to.toString()` will return the same as `from.toString()` but prepended with a `Wrapped with to()` comment.

#### to

Type: `Function`

Mimicking function.

#### from

Type: `Function`

Function to mimic.

#### options

Type: `object`

##### ignoreNonConfigurable

Type: `boolean`<br>
Default: `false`

Skip modifying [non-configurable properties](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor#Description) instead of throwing an error.

## Related

- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name and other properties


---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-mimic-fn?utm_source=npm-mimic-fn&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
{
	"name": "debounce-fn",
	"version": "4.0.0",
	"description": "Debounce a function",
	"license": "MIT",
	"repository": "sindresorhus/debounce-fn",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"debounce",
		"function",
		"debouncer",
		"fn",
		"func",
		"throttle",
		"delay",
		"invoked"
	],
	"dependencies": {
		"mimic-fn": "^3.0.0"
	},
	"devDependencies": {
		"ava": "^1.4.1",
		"delay": "^4.2.0",
		"tsd": "^0.11.0",
		"xo": "^0.26.1"
	}
}
# debounce-fn [![Build Status](https://travis-ci.org/sindresorhus/debounce-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/debounce-fn)

> [Debounce](https://davidwalsh.name/javascript-debounce-function) a function

## Install

```
$ npm install debounce-fn
```

## Usage

```js
const debounceFn = require('debounce-fn');

window.onresize = debounceFn(() => {
	// Do something on window resize
}, {wait: 100});
```

## API

### debounceFn(input, options?)

Returns a debounced function that delays calling the `input` function until after `wait` milliseconds have elapsed since the last time the debounced function was called.

It comes with a `.cancel()` method to cancel any scheduled `input` function calls.

#### input

Type: `Function`

Function to debounce.

#### options

Type: `object`

##### wait

Type: `number`\
Default: `0`

Time to wait until the `input` function is called.

##### before

Type: `boolean`\
Default: `false`

Trigger the function on the leading edge of the `wait` interval.

For example, can be useful for preventing accidental double-clicks on a "submit" button from firing a second time.

##### after

Type: `boolean`\
Default: `true`

Trigger the function on the trailing edge of the `wait` interval.

## Related

- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

{
  "name": "debug",
  "version": "4.3.7",
  "repository": {
    "type": "git",
    "url": "git://github.com/debug-js/debug.git"
  },
  "description": "Lightweight debugging utility for Node.js and the browser",
  "keywords": [
    "debug",
    "log",
    "debugger"
  ],
  "files": [
    "src",
    "LICENSE",
    "README.md"
  ],
  "author": "Josh Junon (https://github.com/qix-)",
  "contributors": [
    "TJ Holowaychuk <tj@vision-media.ca>",
    "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
    "Andrew Rhyne <rhyneandrew@gmail.com>"
  ],
  "license": "MIT",
  "scripts": {
    "lint": "xo",
    "test": "npm run test:node && npm run test:browser && npm run lint",
    "test:node": "istanbul cover _mocha -- test.js test.node.js",
    "test:browser": "karma start --single-run",
    "test:coverage": "cat ./coverage/lcov.info | coveralls"
  },
  "dependencies": {
    "ms": "^2.1.3"
  },
  "devDependencies": {
    "brfs": "^2.0.1",
    "browserify": "^16.2.3",
    "coveralls": "^3.0.2",
    "istanbul": "^0.4.5",
    "karma": "^3.1.4",
    "karma-browserify": "^6.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-mocha": "^1.3.0",
    "mocha": "^5.2.0",
    "mocha-lcov-reporter": "^1.2.0",
    "sinon": "^14.0.0",
    "xo": "^0.23.0"
  },
  "peerDependenciesMeta": {
    "supports-color": {
      "optional": true
    }
  },
  "main": "./src/index.js",
  "browser": "./src/browser.js",
  "engines": {
    "node": ">=6.0"
  }
}
# debug
[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)

<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">

A tiny JavaScript debugging utility modelled after Node.js core's debugging
technique. Works in Node.js and web browsers.

## Installation

```bash
$ npm install debug
```

## Usage

`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.

Example [_app.js_](./examples/node/app.js):

```js
var debug = require('debug')('http')
  , http = require('http')
  , name = 'My App';

// fake app

debug('booting %o', name);

http.createServer(function(req, res){
  debug(req.method + ' ' + req.url);
  res.end('hello\n');
}).listen(3000, function(){
  debug('listening');
});

// fake worker of some kind

require('./worker');
```

Example [_worker.js_](./examples/node/worker.js):

```js
var a = require('debug')('worker:a')
  , b = require('debug')('worker:b');

function work() {
  a('doing lots of uninteresting work');
  setTimeout(work, Math.random() * 1000);
}

work();

function workb() {
  b('doing some work');
  setTimeout(workb, Math.random() * 2000);
}

workb();
```

The `DEBUG` environment variable is then used to enable these based on space or
comma-delimited names.

Here are some examples:

<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">

#### Windows command prompt notes

##### CMD

On Windows the environment variable is set using the `set` command.

```cmd
set DEBUG=*,-not_this
```

Example:

```cmd
set DEBUG=* & node app.js
```

##### PowerShell (VS Code default)

PowerShell uses different syntax to set environment variables.

```cmd
$env:DEBUG = "*,-not_this"
```

Example:

```cmd
$env:DEBUG='app';node app.js
```

Then, run the program to be debugged as usual.

npm script example:
```js
  "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
```

## Namespace Colors

Every debug instance has a color generated for it based on its namespace name.
This helps when visually parsing the debug output to identify which debug instance
a debug line belongs to.

#### Node.js

In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
otherwise debug will only use a small handful of basic colors.

<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">

#### Web Browser

Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
option. These are WebKit web inspectors, Firefox ([since version
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
and the Firebug plugin for Firefox (any version).

<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">


## Millisecond diff

When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.

<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">

When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:

<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">


## Conventions

If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".  If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.  You can then use it for normal output as well as debug output.

## Wildcards

The `*` character may be used as a wildcard. Suppose for example your library has
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
instead of listing all three with
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.

You can also exclude specific debuggers by prefixing them with a "-" character.
For example, `DEBUG=*,-connect:*` would include all debuggers except those
starting with "connect:".

## Environment Variables

When running through Node.js, you can set a few environment variables that will
change the behavior of the debug logging:

| Name      | Purpose                                         |
|-----------|-------------------------------------------------|
| `DEBUG`   | Enables/disables specific debugging namespaces. |
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY).  |
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
| `DEBUG_DEPTH` | Object inspection depth.                    |
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |


__Note:__ The environment variables beginning with `DEBUG_` end up being
converted into an Options object that gets used with `%o`/`%O` formatters.
See the Node.js documentation for
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
for the complete list.

## Formatters

Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
Below are the officially supported formatters:

| Formatter | Representation |
|-----------|----------------|
| `%O`      | Pretty-print an Object on multiple lines. |
| `%o`      | Pretty-print an Object all on a single line. |
| `%s`      | String. |
| `%d`      | Number (both integer and float). |
| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
| `%%`      | Single percent sign ('%'). This does not consume an argument. |


### Custom formatters

You can add custom formatters by extending the `debug.formatters` object.
For example, if you wanted to add support for rendering a Buffer as hex with
`%h`, you could do something like:

```js
const createDebug = require('debug')
createDebug.formatters.h = (v) => {
  return v.toString('hex')
}

// …elsewhere
const debug = createDebug('foo')
debug('this is hex: %h', new Buffer('hello world'))
//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
```


## Browser Support

You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
if you don't want to build it yourself.

Debug's enable state is currently persisted by `localStorage`.
Consider the situation shown below where you have `worker:a` and `worker:b`,
and wish to debug both. You can enable this using `localStorage.debug`:

```js
localStorage.debug = 'worker:*'
```

And then refresh the page.

```js
a = debug('worker:a');
b = debug('worker:b');

setInterval(function(){
  a('doing some work');
}, 1000);

setInterval(function(){
  b('doing some work');
}, 1200);
```

In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.

<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">

## Output streams

  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:

Example [_stdout.js_](./examples/node/stdout.js):

```js
var debug = require('debug');
var error = debug('app:error');

// by default stderr is used
error('goes to stderr!');

var log = debug('app:log');
// set this namespace to log via console.log
log.log = console.log.bind(console); // don't forget to bind to console!
log('goes to stdout');
error('still goes to stderr!');

// set all output to go via console.info
// overrides all per-namespace log settings
debug.log = console.info.bind(console);
error('now goes to stdout via console.info');
log('still goes to stdout, but via console.info now');
```

## Extend
You can simply extend debugger 
```js
const log = require('debug')('auth');

//creates new debug instance with extended namespace
const logSign = log.extend('sign');
const logLogin = log.extend('login');

log('hello'); // auth hello
logSign('hello'); //auth:sign hello
logLogin('hello'); //auth:login hello
```

## Set dynamically

You can also enable debug dynamically by calling the `enable()` method :

```js
let debug = require('debug');

console.log(1, debug.enabled('test'));

debug.enable('test');
console.log(2, debug.enabled('test'));

debug.disable();
console.log(3, debug.enabled('test'));

```

print :   
```
1 false
2 true
3 false
```

Usage :  
`enable(namespaces)`  
`namespaces` can include modes separated by a colon and wildcards.
   
Note that calling `enable()` completely overrides previously set DEBUG variable : 

```
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
=> false
```

`disable()`

Will disable all namespaces. The functions returns the namespaces currently
enabled (and skipped). This can be useful if you want to disable debugging
temporarily without knowing what was enabled to begin with.

For example:

```js
let debug = require('debug');
debug.enable('foo:*,-foo:bar');
let namespaces = debug.disable();
debug.enable(namespaces);
```

Note: There is no guarantee that the string will be identical to the initial
enable string, but semantically they will be identical.

## Checking whether a debug target is enabled

After you've created a debug instance, you can determine whether or not it is
enabled by checking the `enabled` property:

```javascript
const debug = require('debug')('http');

if (debug.enabled) {
  // do stuff...
}
```

You can also manually toggle this property to force the debug instance to be
enabled or disabled.

## Usage in child processes

Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.  
For example:

```javascript
worker = fork(WORKER_WRAP_PATH, [workerPath], {
  stdio: [
    /* stdin: */ 0,
    /* stdout: */ 'pipe',
    /* stderr: */ 'pipe',
    'ipc',
  ],
  env: Object.assign({}, process.env, {
    DEBUG_COLORS: 1 // without this settings, colors won't be shown
  }),
});

worker.stderr.pipe(process.stderr, { end: false });
```


## Authors

 - TJ Holowaychuk
 - Nathan Rajlich
 - Andrew Rhyne
 - Josh Junon

## Backers

Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]

<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>


## Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]

<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>

## License

(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* eslint-env browser */

/**
 * This is the web browser implementation of `debug()`.
 */

exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
exports.destroy = (() => {
	let warned = false;

	return () => {
		if (!warned) {
			warned = true;
			console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
		}
	};
})();

/**
 * Colors.
 */

exports.colors = [
	'#0000CC',
	'#0000FF',
	'#0033CC',
	'#0033FF',
	'#0066CC',
	'#0066FF',
	'#0099CC',
	'#0099FF',
	'#00CC00',
	'#00CC33',
	'#00CC66',
	'#00CC99',
	'#00CCCC',
	'#00CCFF',
	'#3300CC',
	'#3300FF',
	'#3333CC',
	'#3333FF',
	'#3366CC',
	'#3366FF',
	'#3399CC',
	'#3399FF',
	'#33CC00',
	'#33CC33',
	'#33CC66',
	'#33CC99',
	'#33CCCC',
	'#33CCFF',
	'#6600CC',
	'#6600FF',
	'#6633CC',
	'#6633FF',
	'#66CC00',
	'#66CC33',
	'#9900CC',
	'#9900FF',
	'#9933CC',
	'#9933FF',
	'#99CC00',
	'#99CC33',
	'#CC0000',
	'#CC0033',
	'#CC0066',
	'#CC0099',
	'#CC00CC',
	'#CC00FF',
	'#CC3300',
	'#CC3333',
	'#CC3366',
	'#CC3399',
	'#CC33CC',
	'#CC33FF',
	'#CC6600',
	'#CC6633',
	'#CC9900',
	'#CC9933',
	'#CCCC00',
	'#CCCC33',
	'#FF0000',
	'#FF0033',
	'#FF0066',
	'#FF0099',
	'#FF00CC',
	'#FF00FF',
	'#FF3300',
	'#FF3333',
	'#FF3366',
	'#FF3399',
	'#FF33CC',
	'#FF33FF',
	'#FF6600',
	'#FF6633',
	'#FF9900',
	'#FF9933',
	'#FFCC00',
	'#FFCC33'
];

/**
 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
 * and the Firebug extension (any Firefox version) are known
 * to support "%c" CSS customizations.
 *
 * TODO: add a `localStorage` variable to explicitly enable/disable colors
 */

// eslint-disable-next-line complexity
function useColors() {
	// NB: In an Electron preload script, document will be defined but not fully
	// initialized. Since we know we're in Chrome, we'll just detect this case
	// explicitly
	if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
		return true;
	}

	// Internet Explorer and Edge do not support colors.
	if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
		return false;
	}

	let m;

	// Is webkit? http://stackoverflow.com/a/16459606/376773
	// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
	return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
		// Is firebug? http://stackoverflow.com/a/398120/376773
		(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
		// Is firefox >= v31?
		// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
		(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
		// Double check webkit in userAgent just in case we are in a worker
		(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	args[0] = (this.useColors ? '%c' : '') +
		this.namespace +
		(this.useColors ? ' %c' : ' ') +
		args[0] +
		(this.useColors ? '%c ' : ' ') +
		'+' + module.exports.humanize(this.diff);

	if (!this.useColors) {
		return;
	}

	const c = 'color: ' + this.color;
	args.splice(1, 0, c, 'color: inherit');

	// The final "%c" is somewhat tricky, because there could be other
	// arguments passed either before or after the %c, so we need to
	// figure out the correct index to insert the CSS into
	let index = 0;
	let lastC = 0;
	args[0].replace(/%[a-zA-Z%]/g, match => {
		if (match === '%%') {
			return;
		}
		index++;
		if (match === '%c') {
			// We only are interested in the *last* %c
			// (the user may have provided their own)
			lastC = index;
		}
	});

	args.splice(lastC, 0, c);
}

/**
 * Invokes `console.debug()` when available.
 * No-op when `console.debug` is not a "function".
 * If `console.debug` is not available, falls back
 * to `console.log`.
 *
 * @api public
 */
exports.log = console.debug || console.log || (() => {});

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	try {
		if (namespaces) {
			exports.storage.setItem('debug', namespaces);
		} else {
			exports.storage.removeItem('debug');
		}
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */
function load() {
	let r;
	try {
		r = exports.storage.getItem('debug');
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}

	// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
	if (!r && typeof process !== 'undefined' && 'env' in process) {
		r = process.env.DEBUG;
	}

	return r;
}

/**
 * Localstorage attempts to return the localstorage.
 *
 * This is necessary because safari throws
 * when a user disables cookies/localstorage
 * and you attempt to access it.
 *
 * @return {LocalStorage}
 * @api private
 */

function localstorage() {
	try {
		// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
		// The Browser also has localStorage in the global context.
		return localStorage;
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
 */

formatters.j = function (v) {
	try {
		return JSON.stringify(v);
	} catch (error) {
		return '[UnexpectedJSONParseError]: ' + error.message;
	}
};

/**
 * This is the common logic for both the Node.js and web browser
 * implementations of `debug()`.
 */

function setup(env) {
	createDebug.debug = createDebug;
	createDebug.default = createDebug;
	createDebug.coerce = coerce;
	createDebug.disable = disable;
	createDebug.enable = enable;
	createDebug.enabled = enabled;
	createDebug.humanize = require('ms');
	createDebug.destroy = destroy;

	Object.keys(env).forEach(key => {
		createDebug[key] = env[key];
	});

	/**
	* The currently active debug mode names, and names to skip.
	*/

	createDebug.names = [];
	createDebug.skips = [];

	/**
	* Map of special "%n" handling functions, for the debug "format" argument.
	*
	* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
	*/
	createDebug.formatters = {};

	/**
	* Selects a color for a debug namespace
	* @param {String} namespace The namespace string for the debug instance to be colored
	* @return {Number|String} An ANSI color code for the given namespace
	* @api private
	*/
	function selectColor(namespace) {
		let hash = 0;

		for (let i = 0; i < namespace.length; i++) {
			hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
			hash |= 0; // Convert to 32bit integer
		}

		return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
	}
	createDebug.selectColor = selectColor;

	/**
	* Create a debugger with the given `namespace`.
	*
	* @param {String} namespace
	* @return {Function}
	* @api public
	*/
	function createDebug(namespace) {
		let prevTime;
		let enableOverride = null;
		let namespacesCache;
		let enabledCache;

		function debug(...args) {
			// Disabled?
			if (!debug.enabled) {
				return;
			}

			const self = debug;

			// Set `diff` timestamp
			const curr = Number(new Date());
			const ms = curr - (prevTime || curr);
			self.diff = ms;
			self.prev = prevTime;
			self.curr = curr;
			prevTime = curr;

			args[0] = createDebug.coerce(args[0]);

			if (typeof args[0] !== 'string') {
				// Anything else let's inspect with %O
				args.unshift('%O');
			}

			// Apply any `formatters` transformations
			let index = 0;
			args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
				// If we encounter an escaped % then don't increase the array index
				if (match === '%%') {
					return '%';
				}
				index++;
				const formatter = createDebug.formatters[format];
				if (typeof formatter === 'function') {
					const val = args[index];
					match = formatter.call(self, val);

					// Now we need to remove `args[index]` since it's inlined in the `format`
					args.splice(index, 1);
					index--;
				}
				return match;
			});

			// Apply env-specific formatting (colors, etc.)
			createDebug.formatArgs.call(self, args);

			const logFn = self.log || createDebug.log;
			logFn.apply(self, args);
		}

		debug.namespace = namespace;
		debug.useColors = createDebug.useColors();
		debug.color = createDebug.selectColor(namespace);
		debug.extend = extend;
		debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.

		Object.defineProperty(debug, 'enabled', {
			enumerable: true,
			configurable: false,
			get: () => {
				if (enableOverride !== null) {
					return enableOverride;
				}
				if (namespacesCache !== createDebug.namespaces) {
					namespacesCache = createDebug.namespaces;
					enabledCache = createDebug.enabled(namespace);
				}

				return enabledCache;
			},
			set: v => {
				enableOverride = v;
			}
		});

		// Env-specific initialization logic for debug instances
		if (typeof createDebug.init === 'function') {
			createDebug.init(debug);
		}

		return debug;
	}

	function extend(namespace, delimiter) {
		const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
		newDebug.log = this.log;
		return newDebug;
	}

	/**
	* Enables a debug mode by namespaces. This can include modes
	* separated by a colon and wildcards.
	*
	* @param {String} namespaces
	* @api public
	*/
	function enable(namespaces) {
		createDebug.save(namespaces);
		createDebug.namespaces = namespaces;

		createDebug.names = [];
		createDebug.skips = [];

		let i;
		const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
		const len = split.length;

		for (i = 0; i < len; i++) {
			if (!split[i]) {
				// ignore empty strings
				continue;
			}

			namespaces = split[i].replace(/\*/g, '.*?');

			if (namespaces[0] === '-') {
				createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
			} else {
				createDebug.names.push(new RegExp('^' + namespaces + '$'));
			}
		}
	}

	/**
	* Disable debug output.
	*
	* @return {String} namespaces
	* @api public
	*/
	function disable() {
		const namespaces = [
			...createDebug.names.map(toNamespace),
			...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
		].join(',');
		createDebug.enable('');
		return namespaces;
	}

	/**
	* Returns true if the given mode name is enabled, false otherwise.
	*
	* @param {String} name
	* @return {Boolean}
	* @api public
	*/
	function enabled(name) {
		if (name[name.length - 1] === '*') {
			return true;
		}

		let i;
		let len;

		for (i = 0, len = createDebug.skips.length; i < len; i++) {
			if (createDebug.skips[i].test(name)) {
				return false;
			}
		}

		for (i = 0, len = createDebug.names.length; i < len; i++) {
			if (createDebug.names[i].test(name)) {
				return true;
			}
		}

		return false;
	}

	/**
	* Convert regexp to namespace
	*
	* @param {RegExp} regxep
	* @return {String} namespace
	* @api private
	*/
	function toNamespace(regexp) {
		return regexp.toString()
			.substring(2, regexp.toString().length - 2)
			.replace(/\.\*\?$/, '*');
	}

	/**
	* Coerce `val`.
	*
	* @param {Mixed} val
	* @return {Mixed}
	* @api private
	*/
	function coerce(val) {
		if (val instanceof Error) {
			return val.stack || val.message;
		}
		return val;
	}

	/**
	* XXX DO NOT USE. This is a temporary stub function.
	* XXX It WILL be removed in the next major release.
	*/
	function destroy() {
		console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
	}

	createDebug.enable(createDebug.load());

	return createDebug;
}

module.exports = setup;
/**
 * Detect Electron renderer / nwjs process, which is node, but we should
 * treat as a browser.
 */

if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
	module.exports = require('./browser.js');
} else {
	module.exports = require('./node.js');
}
/**
 * Module dependencies.
 */

const tty = require('tty');
const util = require('util');

/**
 * This is the Node.js implementation of `debug()`.
 */

exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.destroy = util.deprecate(
	() => {},
	'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
);

/**
 * Colors.
 */

exports.colors = [6, 2, 3, 4, 5, 1];

try {
	// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
	// eslint-disable-next-line import/no-extraneous-dependencies
	const supportsColor = require('supports-color');

	if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
		exports.colors = [
			20,
			21,
			26,
			27,
			32,
			33,
			38,
			39,
			40,
			41,
			42,
			43,
			44,
			45,
			56,
			57,
			62,
			63,
			68,
			69,
			74,
			75,
			76,
			77,
			78,
			79,
			80,
			81,
			92,
			93,
			98,
			99,
			112,
			113,
			128,
			129,
			134,
			135,
			148,
			149,
			160,
			161,
			162,
			163,
			164,
			165,
			166,
			167,
			168,
			169,
			170,
			171,
			172,
			173,
			178,
			179,
			184,
			185,
			196,
			197,
			198,
			199,
			200,
			201,
			202,
			203,
			204,
			205,
			206,
			207,
			208,
			209,
			214,
			215,
			220,
			221
		];
	}
} catch (error) {
	// Swallow - we only care if `supports-color` is available; it doesn't have to be.
}

/**
 * Build up the default `inspectOpts` object from the environment variables.
 *
 *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
 */

exports.inspectOpts = Object.keys(process.env).filter(key => {
	return /^debug_/i.test(key);
}).reduce((obj, key) => {
	// Camel-case
	const prop = key
		.substring(6)
		.toLowerCase()
		.replace(/_([a-z])/g, (_, k) => {
			return k.toUpperCase();
		});

	// Coerce string value into JS value
	let val = process.env[key];
	if (/^(yes|on|true|enabled)$/i.test(val)) {
		val = true;
	} else if (/^(no|off|false|disabled)$/i.test(val)) {
		val = false;
	} else if (val === 'null') {
		val = null;
	} else {
		val = Number(val);
	}

	obj[prop] = val;
	return obj;
}, {});

/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
	return 'colors' in exports.inspectOpts ?
		Boolean(exports.inspectOpts.colors) :
		tty.isatty(process.stderr.fd);
}

/**
 * Adds ANSI color escape codes if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	const {namespace: name, useColors} = this;

	if (useColors) {
		const c = this.color;
		const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
		const prefix = `  ${colorCode};1m${name} \u001B[0m`;

		args[0] = prefix + args[0].split('\n').join('\n' + prefix);
		args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
	} else {
		args[0] = getDate() + name + ' ' + args[0];
	}
}

function getDate() {
	if (exports.inspectOpts.hideDate) {
		return '';
	}
	return new Date().toISOString() + ' ';
}

/**
 * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
 */

function log(...args) {
	return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
}

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	if (namespaces) {
		process.env.DEBUG = namespaces;
	} else {
		// If you set a process.env field to null or undefined, it gets cast to the
		// string 'null' or 'undefined'. Just delete instead.
		delete process.env.DEBUG;
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */

function load() {
	return process.env.DEBUG;
}

/**
 * Init logic for `debug` instances.
 *
 * Create a new `inspectOpts` object in case `useColors` is set
 * differently for a particular `debug` instance.
 */

function init(debug) {
	debug.inspectOpts = {};

	const keys = Object.keys(exports.inspectOpts);
	for (let i = 0; i < keys.length; i++) {
		debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %o to `util.inspect()`, all on a single line.
 */

formatters.o = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts)
		.split('\n')
		.map(str => str.trim())
		.join(' ');
};

/**
 * Map %O to `util.inspect()`, allowing multiple lines if needed.
 */

formatters.O = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts);
};
root = true

[*]
indent_style = tab
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
# [4.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.3.0)

- Avoid thrown errors if the target doesn't have `propertyIsEnumerable`.  [#252](https://github.com/TehShrike/deepmerge/pull/252)

# [4.2.2](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.2)

- `isMergeableObject` is now only called if there are two values that could be merged.  [a34dd4d2](https://github.com/TehShrike/deepmerge/commit/a34dd4d25bf5e250653540a2022bc832c7b00a19)

# [4.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.1)

- Fix: falsey values can now be merged.  [#170](https://github.com/TehShrike/deepmerge/issues/170)

# [4.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.0)

- Properties are now only overwritten if they exist on the target object and are enumerable.  [#164](https://github.com/TehShrike/deepmerge/pull/164)

Technically this could probably be a patch release since "which properties get overwritten" wasn't documented and accidentally overwriting a built-in function or some function up the property chain would almost certainly be undesirable, but it feels like a gray area, so here we are with a feature version bump.

# [4.1.2](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.2)

- Rolled back #167 since `Object.assign` breaks ES5 support.  [55067352](https://github.com/TehShrike/deepmerge/commit/55067352a92c65a6c44a5165f3387720aae1e192)

# [4.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.1)

- The `options` argument is no longer mutated [#167](https://github.com/TehShrike/deepmerge/pull/167)

# [4.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.1.0)

- `cloneUnlessOtherwiseSpecified` is now exposed to the `arrayMerge` function [#165](https://github.com/TehShrike/deepmerge/pull/165)

# [4.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v4.0.0)

- The `main` entry point in `package.json` is now a CommonJS module instead of a UMD module [#155](https://github.com/TehShrike/deepmerge/pull/155)

# [3.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.3.0)

- Enumerable Symbol properties are now copied [#151](https://github.com/TehShrike/deepmerge/pull/151)

# [3.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v3.2.1)

- bumping dev dependency versions to try to shut up bogus security warnings from Github/npm [#149](https://github.com/TehShrike/deepmerge/pull/149)

# [3.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.2.0)

- feature: added the [`customMerge`](https://github.com/TehShrike/deepmerge#custommerge) option [#133](https://github.com/TehShrike/deepmerge/pull/133)

# [3.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.1.0)

- typescript typing: make the `all` function generic [#129](https://github.com/TehShrike/deepmerge/pull/129)

# [3.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v3.0.0)

- drop ES module build [#123](https://github.com/TehShrike/deepmerge/issues/123)

# [2.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.2.1)

- bug: typescript export type was wrong [#121](https://github.com/TehShrike/deepmerge/pull/121)

# [2.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.2.0)

- feature: added TypeScript typings [#119](https://github.com/TehShrike/deepmerge/pull/119)

# [2.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.1.1)

- documentation: Rename "methods" to "api", note ESM syntax [#103](https://github.com/TehShrike/deepmerge/pull/103)
- documentation: Fix grammar [#107](https://github.com/TehShrike/deepmerge/pull/107)
- documentation: Restructure headers for clarity + some wording tweaks [108](https://github.com/TehShrike/deepmerge/pull/108) + [109](https://github.com/TehShrike/deepmerge/pull/109)


# [2.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.1.0)

- feature: Support a custom `isMergeableObject` function [#96](https://github.com/TehShrike/deepmerge/pull/96)
- documentation: note a Webpack bug that some users might need to work around [#100](https://github.com/TehShrike/deepmerge/pull/100)

# [2.0.1](https://github.com/TehShrike/deepmerge/releases/tag/v2.0.1)

- documentation: fix the old array merge algorithm in the readme.  [#84](https://github.com/TehShrike/deepmerge/pull/84)

# [2.0.0](https://github.com/TehShrike/deepmerge/releases/tag/v2.0.0)

- breaking: the array merge algorithm has changed from a complicated thing to `target.concat(source).map(element => cloneUnlessOtherwiseSpecified(element, optionsArgument))`
- breaking: The `clone` option now defaults to `true`
- feature: `merge.all` now accepts an array of any size, even 0 or 1 elements

See [pull request 77](https://github.com/TehShrike/deepmerge/pull/77).

# [1.5.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.2)

- fix: no longer attempts to merge React elements [#76](https://github.com/TehShrike/deepmerge/issues/76)

# [1.5.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.1)

- bower support: officially dropping bower support.  If you use bower, please depend on the [unpkg distribution](https://unpkg.com/deepmerge/dist/umd.js).  See [#63](https://github.com/TehShrike/deepmerge/issues/63)

# [1.5.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.5.0)

- bug fix: merging objects into arrays was allowed, and doesn't make any sense. [#65](https://github.com/TehShrike/deepmerge/issues/65) published as a feature release instead of a patch because it is a decent behavior change.

# [1.4.4](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.4)

- bower support: updated `main` in bower.json

# [1.4.3](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.3)

- bower support: inline is-mergeable-object in a new CommonJS build, so that people using both bower and CommonJS can bundle the library [0b34e6](https://github.com/TehShrike/deepmerge/commit/0b34e6e95f989f2fc8091d25f0d291c08f3d2d24)

# [1.4.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.2)

- performance: bump is-mergeable-object dependency version for a slight performance improvement [5906c7](https://github.com/TehShrike/deepmerge/commit/5906c765d691d48e83d76efbb0d4b9ca150dc12c)

# [1.4.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.1)

- documentation: fix unpkg link [acc45b](https://github.com/TehShrike/deepmerge/commit/acc45be85519c1df906a72ecb24764b622d18d47)

# [1.4.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.4.0)

- api: instead of only exporting a UMD module, expose a UMD module with `pkg.main`, a CJS module with `pkg.browser`, and an ES module with `pkg.module` [#62](https://github.com/TehShrike/deepmerge/pull/62)

# [1.3.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.2)

- documentation: note the minified/gzipped file sizes [56](https://github.com/TehShrike/deepmerge/pull/56)
- documentation: make data structures more readable in merge example: pull request [57](https://github.com/TehShrike/deepmerge/pull/57)

# [1.3.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.1)

- documentation: clarify and test some array merging documentation: pull request [51](https://github.com/TehShrike/deepmerge/pull/51)

# [1.3.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.3.0)

- feature: `merge.all`, a merge function that merges any number of objects: pull request [50](https://github.com/TehShrike/deepmerge/pull/50)

# [1.2.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.2.0)

- fix: an error that would be thrown when an array would be merged onto a truthy non-array value: pull request [46](https://github.com/TehShrike/deepmerge/pull/46)
- feature: the ability to clone: Issue [28](https://github.com/TehShrike/deepmerge/issues/28), pull requests [44](https://github.com/TehShrike/deepmerge/pull/44) and [48](https://github.com/TehShrike/deepmerge/pull/48)
- maintenance: added tests + travis to `.npmignore`: pull request [47](https://github.com/TehShrike/deepmerge/pull/47)

# [1.1.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.1.1)

- fix an issue where an error was thrown when merging an array onto a non-array: [Pull request 46](https://github.com/TehShrike/deepmerge/pull/46)

# [1.1.0](https://github.com/TehShrike/deepmerge/releases/tag/v1.1.0)

- allow consumers to specify their own array merging algorithm: [Pull request 37](https://github.com/TehShrike/deepmerge/pull/37)

# [1.0.3](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.3)

- adding bower.json back: [Issue 38](https://github.com/TehShrike/deepmerge/pull/38)
- updating keywords and Github links in package.json [bc3898e](https://github.com/TehShrike/deepmerge/commit/bc3898e587a56f74591328f40f656b0152c1d5eb)

# [1.0.2](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.2)

- Updating the readme: dropping bower, testing that the example works: [7102fc](https://github.com/TehShrike/deepmerge/commit/7102fcc4ddec11e2d33205866f9f18df14e5aeb5)

# [1.0.1](https://github.com/TehShrike/deepmerge/releases/tag/v1.0.1)

- `null`, dates, and regular expressions are now properly merged in arrays: [Issue 18](https://github.com/TehShrike/deepmerge/pull/18), plus commit: [ef1c6b](https://github.com/TehShrike/deepmerge/commit/ef1c6bac8350ba12a24966f0bc7da02560827586)

# 1.0.0

- Should only be a patch change, because this module is READY. [Issue 15](https://github.com/TehShrike/deepmerge/issues/15)
- Regular expressions are now treated like primitive values when merging: [Issue 30](https://github.com/TehShrike/deepmerge/pull/30)
- Dates are now treated like primitives when merging: [Issue 31](https://github.com/TehShrike/deepmerge/issues/31)
'use strict';

var isMergeableObject = function isMergeableObject(value) {
	return isNonNullObject(value)
		&& !isSpecial(value)
};

function isNonNullObject(value) {
	return !!value && typeof value === 'object'
}

function isSpecial(value) {
	var stringValue = Object.prototype.toString.call(value);

	return stringValue === '[object RegExp]'
		|| stringValue === '[object Date]'
		|| isReactElement(value)
}

// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;

function isReactElement(value) {
	return value.$$typeof === REACT_ELEMENT_TYPE
}

function emptyTarget(val) {
	return Array.isArray(val) ? [] : {}
}

function cloneUnlessOtherwiseSpecified(value, options) {
	return (options.clone !== false && options.isMergeableObject(value))
		? deepmerge(emptyTarget(value), value, options)
		: value
}

function defaultArrayMerge(target, source, options) {
	return target.concat(source).map(function(element) {
		return cloneUnlessOtherwiseSpecified(element, options)
	})
}

function getMergeFunction(key, options) {
	if (!options.customMerge) {
		return deepmerge
	}
	var customMerge = options.customMerge(key);
	return typeof customMerge === 'function' ? customMerge : deepmerge
}

function getEnumerableOwnPropertySymbols(target) {
	return Object.getOwnPropertySymbols
		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
			return Object.propertyIsEnumerable.call(target, symbol)
		})
		: []
}

function getKeys(target) {
	return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}

function propertyIsOnObject(object, property) {
	try {
		return property in object
	} catch(_) {
		return false
	}
}

// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
	return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
		&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
			&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}

function mergeObject(target, source, options) {
	var destination = {};
	if (options.isMergeableObject(target)) {
		getKeys(target).forEach(function(key) {
			destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
		});
	}
	getKeys(source).forEach(function(key) {
		if (propertyIsUnsafe(target, key)) {
			return
		}

		if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
			destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
		} else {
			destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
		}
	});
	return destination
}

function deepmerge(target, source, options) {
	options = options || {};
	options.arrayMerge = options.arrayMerge || defaultArrayMerge;
	options.isMergeableObject = options.isMergeableObject || isMergeableObject;
	// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
	// implementations can use it. The caller may not replace it.
	options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;

	var sourceIsArray = Array.isArray(source);
	var targetIsArray = Array.isArray(target);
	var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;

	if (!sourceAndTargetTypesMatch) {
		return cloneUnlessOtherwiseSpecified(source, options)
	} else if (sourceIsArray) {
		return options.arrayMerge(target, source, options)
	} else {
		return mergeObject(target, source, options)
	}
}

deepmerge.all = function deepmergeAll(array, options) {
	if (!Array.isArray(array)) {
		throw new Error('first argument should be an array')
	}

	return array.reduce(function(prev, next) {
		return deepmerge(prev, next, options)
	}, {})
};

var deepmerge_1 = deepmerge;

module.exports = deepmerge_1;
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
	typeof define === 'function' && define.amd ? define(factory) :
	(global = global || self, global.deepmerge = factory());
}(this, function () { 'use strict';

	var isMergeableObject = function isMergeableObject(value) {
		return isNonNullObject(value)
			&& !isSpecial(value)
	};

	function isNonNullObject(value) {
		return !!value && typeof value === 'object'
	}

	function isSpecial(value) {
		var stringValue = Object.prototype.toString.call(value);

		return stringValue === '[object RegExp]'
			|| stringValue === '[object Date]'
			|| isReactElement(value)
	}

	// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
	var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
	var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;

	function isReactElement(value) {
		return value.$$typeof === REACT_ELEMENT_TYPE
	}

	function emptyTarget(val) {
		return Array.isArray(val) ? [] : {}
	}

	function cloneUnlessOtherwiseSpecified(value, options) {
		return (options.clone !== false && options.isMergeableObject(value))
			? deepmerge(emptyTarget(value), value, options)
			: value
	}

	function defaultArrayMerge(target, source, options) {
		return target.concat(source).map(function(element) {
			return cloneUnlessOtherwiseSpecified(element, options)
		})
	}

	function getMergeFunction(key, options) {
		if (!options.customMerge) {
			return deepmerge
		}
		var customMerge = options.customMerge(key);
		return typeof customMerge === 'function' ? customMerge : deepmerge
	}

	function getEnumerableOwnPropertySymbols(target) {
		return Object.getOwnPropertySymbols
			? Object.getOwnPropertySymbols(target).filter(function(symbol) {
				return Object.propertyIsEnumerable.call(target, symbol)
			})
			: []
	}

	function getKeys(target) {
		return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
	}

	function propertyIsOnObject(object, property) {
		try {
			return property in object
		} catch(_) {
			return false
		}
	}

	// Protects from prototype poisoning and unexpected merging up the prototype chain.
	function propertyIsUnsafe(target, key) {
		return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
			&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
				&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
	}

	function mergeObject(target, source, options) {
		var destination = {};
		if (options.isMergeableObject(target)) {
			getKeys(target).forEach(function(key) {
				destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
			});
		}
		getKeys(source).forEach(function(key) {
			if (propertyIsUnsafe(target, key)) {
				return
			}

			if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
				destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
			} else {
				destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
			}
		});
		return destination
	}

	function deepmerge(target, source, options) {
		options = options || {};
		options.arrayMerge = options.arrayMerge || defaultArrayMerge;
		options.isMergeableObject = options.isMergeableObject || isMergeableObject;
		// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
		// implementations can use it. The caller may not replace it.
		options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;

		var sourceIsArray = Array.isArray(source);
		var targetIsArray = Array.isArray(target);
		var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;

		if (!sourceAndTargetTypesMatch) {
			return cloneUnlessOtherwiseSpecified(source, options)
		} else if (sourceIsArray) {
			return options.arrayMerge(target, source, options)
		} else {
			return mergeObject(target, source, options)
		}
	}

	deepmerge.all = function deepmergeAll(array, options) {
		if (!Array.isArray(array)) {
			throw new Error('first argument should be an array')
		}

		return array.reduce(function(prev, next) {
			return deepmerge(prev, next, options)
		}, {})
	};

	var deepmerge_1 = deepmerge;

	return deepmerge_1;

}));
declare function deepmerge<T>(x: Partial<T>, y: Partial<T>, options?: deepmerge.Options): T;
declare function deepmerge<T1, T2>(x: Partial<T1>, y: Partial<T2>, options?: deepmerge.Options): T1 & T2;

declare namespace deepmerge {
	export interface Options {
		arrayMerge?(target: any[], source: any[], options?: Options): any[];
		clone?: boolean;
		customMerge?: (key: string, options?: Options) => ((x: any, y: any) => any) | undefined;
		isMergeableObject?(value: object): boolean;
	}

	export function all (objects: object[], options?: Options): object;
	export function all<T> (objects: Partial<T>[], options?: Options): T;
}

export = deepmerge;
var defaultIsMergeableObject = require('is-mergeable-object')

function emptyTarget(val) {
	return Array.isArray(val) ? [] : {}
}

function cloneUnlessOtherwiseSpecified(value, options) {
	return (options.clone !== false && options.isMergeableObject(value))
		? deepmerge(emptyTarget(value), value, options)
		: value
}

function defaultArrayMerge(target, source, options) {
	return target.concat(source).map(function(element) {
		return cloneUnlessOtherwiseSpecified(element, options)
	})
}

function getMergeFunction(key, options) {
	if (!options.customMerge) {
		return deepmerge
	}
	var customMerge = options.customMerge(key)
	return typeof customMerge === 'function' ? customMerge : deepmerge
}

function getEnumerableOwnPropertySymbols(target) {
	return Object.getOwnPropertySymbols
		? Object.getOwnPropertySymbols(target).filter(function(symbol) {
			return Object.propertyIsEnumerable.call(target, symbol)
		})
		: []
}

function getKeys(target) {
	return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
}

function propertyIsOnObject(object, property) {
	try {
		return property in object
	} catch(_) {
		return false
	}
}

// Protects from prototype poisoning and unexpected merging up the prototype chain.
function propertyIsUnsafe(target, key) {
	return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
		&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
			&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
}

function mergeObject(target, source, options) {
	var destination = {}
	if (options.isMergeableObject(target)) {
		getKeys(target).forEach(function(key) {
			destination[key] = cloneUnlessOtherwiseSpecified(target[key], options)
		})
	}
	getKeys(source).forEach(function(key) {
		if (propertyIsUnsafe(target, key)) {
			return
		}

		if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
			destination[key] = getMergeFunction(key, options)(target[key], source[key], options)
		} else {
			destination[key] = cloneUnlessOtherwiseSpecified(source[key], options)
		}
	})
	return destination
}

function deepmerge(target, source, options) {
	options = options || {}
	options.arrayMerge = options.arrayMerge || defaultArrayMerge
	options.isMergeableObject = options.isMergeableObject || defaultIsMergeableObject
	// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
	// implementations can use it. The caller may not replace it.
	options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified

	var sourceIsArray = Array.isArray(source)
	var targetIsArray = Array.isArray(target)
	var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray

	if (!sourceAndTargetTypesMatch) {
		return cloneUnlessOtherwiseSpecified(source, options)
	} else if (sourceIsArray) {
		return options.arrayMerge(target, source, options)
	} else {
		return mergeObject(target, source, options)
	}
}

deepmerge.all = function deepmergeAll(array, options) {
	if (!Array.isArray(array)) {
		throw new Error('first argument should be an array')
	}

	return array.reduce(function(prev, next) {
		return deepmerge(prev, next, options)
	}, {})
}

module.exports = deepmerge
The MIT License (MIT)

Copyright (c) 2012 James Halliday, Josh Duff, and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
  "name": "deepmerge",
  "description": "A library for deep (recursive) merging of Javascript objects",
  "keywords": [
    "merge",
    "deep",
    "extend",
    "copy",
    "clone",
    "recursive"
  ],
  "version": "4.3.0",
  "homepage": "https://github.com/TehShrike/deepmerge",
  "repository": {
    "type": "git",
    "url": "git://github.com/TehShrike/deepmerge.git"
  },
  "main": "dist/cjs.js",
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "build": "rollup -c",
    "test": "npm run build && tape test/*.js && jsmd readme.md && npm run test:typescript",
    "test:typescript": "tsc --noEmit test/typescript.ts && ts-node test/typescript.ts",
    "size": "npm run build && uglifyjs --compress --mangle -- ./dist/umd.js | gzip -c | wc -c"
  },
  "devDependencies": {
    "@types/node": "^8.10.54",
    "is-mergeable-object": "1.1.0",
    "is-plain-object": "^2.0.4",
    "jsmd": "^1.0.2",
    "rollup": "^1.23.1",
    "rollup-plugin-commonjs": "^10.1.0",
    "rollup-plugin-node-resolve": "^5.2.0",
    "tape": "^4.11.0",
    "ts-node": "7.0.1",
    "typescript": "=2.2.2",
    "uglify-js": "^3.6.1"
  },
  "license": "MIT",
  "dependencies": {}
}
# deepmerge

Merges the enumerable properties of two or more objects deeply.

> UMD bundle is 723B minified+gzipped

## Getting Started

### Example Usage
<!--js
const merge = require('./')
-->

```js
const x = {
	foo: { bar: 3 },
	array: [{
		does: 'work',
		too: [ 1, 2, 3 ]
	}]
}

const y = {
	foo: { baz: 4 },
	quux: 5,
	array: [{
		does: 'work',
		too: [ 4, 5, 6 ]
	}, {
		really: 'yes'
	}]
}

const output = {
	foo: {
		bar: 3,
		baz: 4
	},
	array: [{
		does: 'work',
		too: [ 1, 2, 3 ]
	}, {
		does: 'work',
		too: [ 4, 5, 6 ]
	}, {
		really: 'yes'
	}],
	quux: 5
}

merge(x, y) // => output
```


### Installation

With [npm](http://npmjs.org) do:

```sh
npm install deepmerge
```

deepmerge can be used directly in the browser without the use of package managers/bundlers as well:  [UMD version from unpkg.com](https://unpkg.com/deepmerge/dist/umd.js).


### Include

deepmerge exposes a CommonJS entry point:

```
const merge = require('deepmerge')
```

The ESM entry point was dropped due to a [Webpack bug](https://github.com/webpack/webpack/issues/6584).

# API


## `merge(x, y, [options])`

Merge two objects `x` and `y` deeply, returning a new merged object with the
elements from both `x` and `y`.

If an element at the same key is present for both `x` and `y`, the value from
`y` will appear in the result.

Merging creates a new object, so that neither `x` or `y` is modified.

**Note:** By default, arrays are merged by concatenating them.

## `merge.all(arrayOfObjects, [options])`

Merges any number of objects into a single result object.

```js
const foobar = { foo: { bar: 3 } }
const foobaz = { foo: { baz: 4 } }
const bar = { bar: 'yay!' }

merge.all([ foobar, foobaz, bar ]) // => { foo: { bar: 3, baz: 4 }, bar: 'yay!' }
```


## Options

### `arrayMerge`

There are multiple ways to merge two arrays, below are a few examples but you can also create your own custom function.

Your `arrayMerge` function will be called with three arguments: a `target` array, the `source` array, and an `options` object with these properties:

- `isMergeableObject(value)`
- `cloneUnlessOtherwiseSpecified(value, options)`

#### `arrayMerge` example: overwrite target array

Overwrites the existing array values completely rather than concatenating them:

```js
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray

merge(
	[1, 2, 3],
	[3, 2, 1],
	{ arrayMerge: overwriteMerge }
) // => [3, 2, 1]
```

#### `arrayMerge` example: combine arrays

Combines objects at the same index in the two arrays.

This was the default array merging algorithm pre-version-2.0.0.

```js
const combineMerge = (target, source, options) => {
	const destination = target.slice()

	source.forEach((item, index) => {
		if (typeof destination[index] === 'undefined') {
			destination[index] = options.cloneUnlessOtherwiseSpecified(item, options)
		} else if (options.isMergeableObject(item)) {
			destination[index] = merge(target[index], item, options)
		} else if (target.indexOf(item) === -1) {
			destination.push(item)
		}
	})
	return destination
}

merge(
	[{ a: true }],
	[{ b: true }, 'ah yup'],
	{ arrayMerge: combineMerge }
) // => [{ a: true, b: true }, 'ah yup']
```

### `isMergeableObject`

By default, deepmerge clones every property from almost every kind of object.

You may not want this, if your objects are of special types, and you want to copy the whole object instead of just copying its properties.

You can accomplish this by passing in a function for the `isMergeableObject` option.

If you only want to clone properties of plain objects, and ignore all "special" kinds of instantiated objects, you probably want to drop in [`is-plain-object`](https://github.com/jonschlinkert/is-plain-object).

```js
const isPlainObject = require('is-plain-object')

function SuperSpecial() {
	this.special = 'oh yeah man totally'
}

const instantiatedSpecialObject = new SuperSpecial()

const target = {
	someProperty: {
		cool: 'oh for sure'
	}
}

const source = {
	someProperty: instantiatedSpecialObject
}

const defaultOutput = merge(target, source)

defaultOutput.someProperty.cool // => 'oh for sure'
defaultOutput.someProperty.special // => 'oh yeah man totally'
defaultOutput.someProperty instanceof SuperSpecial // => false

const customMergeOutput = merge(target, source, {
	isMergeableObject: isPlainObject
})

customMergeOutput.someProperty.cool // => undefined
customMergeOutput.someProperty.special // => 'oh yeah man totally'
customMergeOutput.someProperty instanceof SuperSpecial // => true
```

### `customMerge`

Specifies a function which can be used to override the default merge behavior for a property, based on the property name.

The `customMerge` function will be passed the key for each property, and should return the function which should be used to merge the values for that property.

It may also return undefined, in which case the default merge behaviour will be used.

```js
const alex = {
	name: {
		first: 'Alex',
		last: 'Alexson'
	},
	pets: ['Cat', 'Parrot']
}

const tony = {
	name: {
		first: 'Tony',
		last: 'Tonison'
	},
	pets: ['Dog']
}

const mergeNames = (nameA, nameB) => `${nameA.first} and ${nameB.first}`

const options = {
	customMerge: (key) => {
		if (key === 'name') {
			return mergeNames
		}
	}
}

const result = merge(alex, tony, options)

result.name // => 'Alex and Tony'
result.pets // => ['Cat', 'Parrot', 'Dog']
```


### `clone`

*Deprecated.*

Defaults to `true`.

If `clone` is `false` then child objects will be copied directly instead of being cloned.  This was the default behavior before version 2.x.


# Testing

With [npm](http://npmjs.org) do:

```sh
npm test
```


# License

MIT
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import pkg from './package.json'

export default {
	input: `index.js`,
	plugins: [
		commonjs(),
		resolve(),
	],
	output: [
		{
			file: pkg.main,
			format: `cjs`
		},
		{
			name: 'deepmerge',
			file: 'dist/umd.js',
			format: `umd`
		},
	],
}
declare const dotProp: {
	/**
	Get the value of the property at the given path.

	@param object - Object to get the `path` value.
	@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
	@param defaultValue - Default value.

	@example
	```
	import dotProp = require('dot-prop');

	dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');
	//=> 'unicorn'

	dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');
	//=> undefined

	dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
	//=> 'default value'

	dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
	//=> 'unicorn'
	```
	*/
	get<T>(
		object: {[key: string]: any} | undefined,
		path: string
	): T | undefined;
	get<T>(
		object: {[key: string]: any} | undefined,
		path: string,
		defaultValue: T
	): T;

	/**
	Set the property at the given path to the given value.

	@param object - Object to set the `path` value.
	@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
	@param value - Value to set at `path`.
	@returns The object.

	@example
	```
	import dotProp = require('dot-prop');

	const object = {foo: {bar: 'a'}};
	dotProp.set(object, 'foo.bar', 'b');
	console.log(object);
	//=> {foo: {bar: 'b'}}

	const foo = dotProp.set({}, 'foo.bar', 'c');
	console.log(foo);
	//=> {foo: {bar: 'c'}}

	dotProp.set(object, 'foo.baz', 'x');
	console.log(object);
	//=> {foo: {bar: 'b', baz: 'x'}}
	```
	*/
	set<T extends {[key: string]: any}>(
		object: T,
		path: string,
		value: unknown
	): T;

	/**
	Check whether the property at the given path exists.

	@param object - Object to test the `path` value.
	@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.

	@example
	```
	import dotProp = require('dot-prop');

	dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar');
	//=> true
	```
	*/
	has(object: {[key: string]: any} | undefined, path: string): boolean;

	/**
	Delete the property at the given path.

	@param object - Object to delete the `path` value.
	@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
	@returns A boolean of whether the property existed before being deleted.

	@example
	```
	import dotProp = require('dot-prop');

	const object = {foo: {bar: 'a'}};
	dotProp.delete(object, 'foo.bar');
	console.log(object);
	//=> {foo: {}}

	object.foo.bar = {x: 'y', y: 'x'};
	dotProp.delete(object, 'foo.bar.x');
	console.log(object);
	//=> {foo: {bar: {y: 'x'}}}
	```
	*/
	delete(object: {[key: string]: any}, path: string): boolean;
};

export = dotProp;
'use strict';
const isObj = require('is-obj');

const disallowedKeys = new Set([
	'__proto__',
	'prototype',
	'constructor'
]);

const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.has(segment));

function getPathSegments(path) {
	const pathArray = path.split('.');
	const parts = [];

	for (let i = 0; i < pathArray.length; i++) {
		let p = pathArray[i];

		while (p[p.length - 1] === '\\' && pathArray[i + 1] !== undefined) {
			p = p.slice(0, -1) + '.';
			p += pathArray[++i];
		}

		parts.push(p);
	}

	if (!isValidPath(parts)) {
		return [];
	}

	return parts;
}

module.exports = {
	get(object, path, value) {
		if (!isObj(object) || typeof path !== 'string') {
			return value === undefined ? object : value;
		}

		const pathArray = getPathSegments(path);
		if (pathArray.length === 0) {
			return;
		}

		for (let i = 0; i < pathArray.length; i++) {
			object = object[pathArray[i]];

			if (object === undefined || object === null) {
				// `object` is either `undefined` or `null` so we want to stop the loop, and
				// if this is not the last bit of the path, and
				// if it did't return `undefined`
				// it would return `null` if `object` is `null`
				// but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null`
				if (i !== pathArray.length - 1) {
					return value;
				}

				break;
			}
		}

		return object === undefined ? value : object;
	},

	set(object, path, value) {
		if (!isObj(object) || typeof path !== 'string') {
			return object;
		}

		const root = object;
		const pathArray = getPathSegments(path);

		for (let i = 0; i < pathArray.length; i++) {
			const p = pathArray[i];

			if (!isObj(object[p])) {
				object[p] = {};
			}

			if (i === pathArray.length - 1) {
				object[p] = value;
			}

			object = object[p];
		}

		return root;
	},

	delete(object, path) {
		if (!isObj(object) || typeof path !== 'string') {
			return false;
		}

		const pathArray = getPathSegments(path);

		for (let i = 0; i < pathArray.length; i++) {
			const p = pathArray[i];

			if (i === pathArray.length - 1) {
				delete object[p];
				return true;
			}

			object = object[p];

			if (!isObj(object)) {
				return false;
			}
		}
	},

	has(object, path) {
		if (!isObj(object) || typeof path !== 'string') {
			return false;
		}

		const pathArray = getPathSegments(path);
		if (pathArray.length === 0) {
			return false;
		}

		// eslint-disable-next-line unicorn/no-for-loop
		for (let i = 0; i < pathArray.length; i++) {
			if (isObj(object)) {
				if (!(pathArray[i] in object)) {
					return false;
				}

				object = object[pathArray[i]];
			} else {
				return false;
			}
		}

		return true;
	}
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "dot-prop",
	"version": "6.0.1",
	"description": "Get, set, or delete a property from a nested object using a dot path",
	"license": "MIT",
	"repository": "sindresorhus/dot-prop",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd",
		"bench": "node bench.js"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"object",
		"prop",
		"property",
		"dot",
		"path",
		"get",
		"set",
		"delete",
		"access",
		"notation",
		"dotty"
	],
	"dependencies": {
		"is-obj": "^2.0.0"
	},
	"devDependencies": {
		"ava": "^2.1.0",
		"benchmark": "^2.1.4",
		"tsd": "^0.13.1",
		"xo": "^0.33.1"
	},
	"xo": {
		"rules": {
			"@typescript-eslint/method-signature-style": "off"
		}
	}
}
# dot-prop [![Build Status](https://travis-ci.com/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.com/github/sindresorhus/dot-prop)

> Get, set, or delete a property from a nested object using a dot path

## Install

```
$ npm install dot-prop
```

## Usage

```js
const dotProp = require('dot-prop');

// Getter
dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');
//=> 'unicorn'

dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');
//=> undefined

dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
//=> 'default value'

dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
//=> 'unicorn'

// Setter
const object = {foo: {bar: 'a'}};
dotProp.set(object, 'foo.bar', 'b');
console.log(object);
//=> {foo: {bar: 'b'}}

const foo = dotProp.set({}, 'foo.bar', 'c');
console.log(foo);
//=> {foo: {bar: 'c'}}

dotProp.set(object, 'foo.baz', 'x');
console.log(object);
//=> {foo: {bar: 'b', baz: 'x'}}

// Has
dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar');
//=> true

// Deleter
const object = {foo: {bar: 'a'}};
dotProp.delete(object, 'foo.bar');
console.log(object);
//=> {foo: {}}

object.foo.bar = {x: 'y', y: 'x'};
dotProp.delete(object, 'foo.bar.x');
console.log(object);
//=> {foo: {bar: {y: 'x'}}}
```

## API

### get(object, path, defaultValue?)

Get the value of the property at the given path.

Returns the value if any.

### set(object, path, value)

Set the property at the given path to the given value.

Returns the object.

### has(object, path)

Check whether the property at the given path exists.

Returns a boolean.

### delete(object, path)

Delete the property at the given path.

Returns a boolean of whether the property existed before being deleted.

#### object

Type: `object`

Object to get, set, or delete the `path` value.

You are allowed to pass in `undefined` as the object to the `get` and `has` functions.

#### path

Type: `string`

Path of the property in the object, using `.` to separate each nested key.

Use `\\.` if you have a `.` in the key.

The following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`.

#### value

Type: `unknown`

Value to set at `path`.

#### defaultValue

Type: `unknown`

Default value.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-dot-prop?utm_source=npm-dot-prop&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
The MIT License (MIT)

Copyright (c) 2016 Alexey Prokhorov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.import { MainLogger } from './src';

declare const Logger: MainLogger & {
  default: MainLogger;
};
export = Logger;
'use strict';

const main = require('./src/main');

module.exports = main;
import { NodeLogger } from './src';

declare const Logger: NodeLogger & {
  default: NodeLogger;
};
export = Logger;
'use strict';

const node = require('./src/node');

module.exports = node;
{
  "name": "electron-log",
  "version": "5.1.4",
  "description": "Just a simple logging module for your Electron application",
  "main": "src/index.js",
  "browser": "src/renderer/index.js",
  "engines": {
    "node": ">= 14"
  },
  "scripts": {
    "lint": "eslint '**/*.{js,cjs}' --ignore-pattern '**/dist/*.js' && tsc --noEmit",
    "test": "humile 'src/**/*spec.js'",
    "test:full": "npm run test && npm run lint && npm run test:e2e",
    "test:e2e": "humile 'e2e/**/*.spec.{js,cjs}' -R list",
    "postversion": "git push && git push --tags",
    "prepack": "npm run test:full",
    "preversion": "npm run test:full"
  },
  "typings": "src/index.d.ts",
  "repository": "megahertz/electron-log",
  "files": [
    "!**/__specs__",
    "!**/.*",
    "src/*",
    "main.js",
    "main.d.ts",
    "node.js",
    "node.d.ts",
    "preload.js",
    "renderer.js",
    "renderer.d.ts"
  ],
  "keywords": [
    "electron",
    "atom",
    "log",
    "logger",
    "logging",
    "windows",
    "mac",
    "osx",
    "linux",
    "desktop"
  ],
  "author": "Alexey Prokhorov",
  "license": "MIT",
  "bugs": "https://github.com/megahertz/electron-log/issues",
  "homepage": "https://github.com/megahertz/electron-log#readme",
  "devDependencies": {
    "@types/node": "^20.10.6",
    "electron": "*",
    "eslint": "^8.56.0",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-plugin-import": "^2.29.1",
    "humile": "^0.5.3",
    "nw": "^0.83.0",
    "typescript": "^5.3.3",
    "vite": "^5.0.10",
    "vite-plugin-electron": "^0.15.5",
    "vite-plugin-electron-renderer": "^0.14.5",
    "webpack": "^5.89.0",
    "webpack-cli": "^5.1.4"
  }
}
'use strict';

const preload = require('./src/renderer/electron-log-preload');

module.exports = preload;
# electron-log
[![Tests](https://github.com/megahertz/electron-log/actions/workflows/tests.yml/badge.svg)](https://github.com/megahertz/electron-log/actions/workflows/tests.yml)
[![NPM version](https://badge.fury.io/js/electron-log.svg)](https://badge.fury.io/js/electron-log)
[![Downloads](https://img.shields.io/npm/dw/electron-log)](https://img.shields.io/npm/dw/electron-log)

Simple logging module Electron/Node.js/NW.js application.
No dependencies. No complicated configuration.

By default, it writes logs to the following locations:

 - **on Linux:** `~/.config/{app name}/logs/main.log`
 - **on macOS:** `~/Library/Logs/{app name}/main.log`
 - **on Windows:** `%USERPROFILE%\AppData\Roaming\{app name}\logs\main.log`

## Installation

Starts from v5, electron-log requires Electron 13+ or
Node.js 14+. Feel free to use electron-log v4 for older runtime. v4
supports Node.js 0.10+ and almost any Electron build.

Install with [npm](https://npmjs.org/package/electron-log):

    npm install electron-log
    
## Usage

### Main process

```js
import log from 'electron-log/main';

// Optional, initialize the logger for any renderer process
log.initialize();

log.info('Log from the main process');
```

### Renderer process

If a bundler is used, you can just import the module:

```typescript
import log from 'electron-log/renderer';
log.info('Log from the renderer process');
```

This function uses sessions to inject a preload script to make the logger
available in a renderer process.

Without a bundler, you can use a global variable `__electronLog`. It contains
only log functions like `info`, `warn` and so on.

There are a few other ways how a logger can be initialized for a renderer
process. [Read more](docs/initialize.md).

### Node.js and NW.js

```typescript
import log from 'electron-log/node';
log.info('Log from the nw.js or node.js');
```

### electron-log v2.x, v3.x, v4.x

If you would like to upgrade to the latest version, read
[the migration guide](docs/migration.md) and [the changelog](CHANGELOG.md).

### Log levels

electron-log supports the following log levels:

    error, warn, info, verbose, debug, silly

### Transport

Transport is a simple function which does some work with log message.
By default, two transports are active: console and file.

You can set transport options or use methods using:

`log.transports.console.format = '{h}:{i}:{s} {text}';`

`log.transports.file.getFile();`

Each transport has `level` and 
[`transforms`](docs/extend.md#transforms) options.

#### Console transport

Just prints a log message to application console (main process) or to
DevTools console (renderer process).

##### Options

 - **[format](docs/transports/format.md)**, default
   `'%c{h}:{i}:{s}.{ms}%c › {text}'` (main),
   `'{h}:{i}:{s}.{ms} › {text}'` (renderer)
 - **level**, default 'silly'
 - **useStyles**, force enable/disable styles

[Read more about console transport](docs/transports/console.md).

#### File transport

The file transport writes log messages to a file.

##### Options

 - **[format](docs/transports/format.md)**, default
   `'[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}] {text}'`
 - **level**, default 'silly'
 - **resolvePathFn** function sets the log path, for example
 
```js
log.transports.file.resolvePathFn = () => path.join(APP_DATA, 'logs/main.log');
```

[Read more about file transport](docs/transports/file.md).

#### IPC transport
It displays log messages from main process in the renderer's DevTools console.
By default, it's disabled for a production build. You can enable in the
production mode by setting the `level` property.


##### Options

 - **level**, default 'silly' in the dev mode, `false` in the production.

#### Remote transport

Sends a JSON POST request with `LogMessage` in the body to the specified url.

##### Options

 - **level**, default false
 - **url**, remote endpoint

[Read more about remote transport](docs/transports/remote.md).

#### Disable a transport

Just set level property to false, for example:

```js
log.transports.file.level = false;
log.transports.console.level = false;
```

#### [Override/add a custom transport](docs/extend.md#transport)

Transport is just a function `(msg: LogMessage) => void`, so you can
easily override/add your own transport.
[More info](docs/extend.md#transport).

#### Third-party transports

- [Datadog](https://github.com/theogravity/electron-log-transport-datadog)

### Overriding console.log

Sometimes it's helpful to use electron-log instead of default `console`. It's
pretty easy:

```js
console.log = log.log;
```

If you would like to override other functions like `error`, `warn` and so on:

```js
Object.assign(console, log.functions);
```

### Colors

Colors can be used for both main and DevTools console.

`log.info('%cRed text. %cGreen text', 'color: red', 'color: green')`

Available colors:
 - unset (reset to default color)
 - black
 - red
 - green
 - yellow
 - blue
 - magenta
 - cyan
 - white
 
For DevTools console you can use other CSS properties.

### [Catch errors](docs/errors.md)

electron-log can catch and log unhandled errors/rejected promises:

`log.errorHandler.startCatching(options?)`;

[More info](docs/errors.md).

#### Electron events logging

Sometimes it's helpful to save critical electron events to the log file.

`log.eventLogger.startLogging(options?)`;

By default, it save the following events:
 - `certificate-error`, `child-process-gone`, `render-process-gone` of `app`
 - `crashed`, `gpu-process-crashed` of `webContents`
 - `did-fail-load`, `did-fail-provisional-load`, `plugin-crashed`,
   `preload-error` of every WebContents. You can switch any event on/off.

[More info](docs/events.md).

### [Hooks](docs/extend.md#hooks)

In some situations, you may want to get more control over logging. Hook
is a function which is called on each transport call.

`(message: LogMessage, transport: Transport, transportName) => LogMessage`

[More info](docs/extend.md#hooks).

### Multiple logger instances

You can create multiple logger instances with different settings:

```js
import log from 'electron-log/main';

const anotherLogger = log.create({ logId: 'anotherInstance' });
```

Be aware that you need to configure each instance (e.g. log file path) 
separately.

### Logging scopes

```js
import log from 'electron-log/main';
const userLog = log.scope('user');

userLog.info('message with user scope');
// Prints 12:12:21.962 (user) › message with user scope
```

## Related

 - [electron-cfg](https://github.com/megahertz/electron-cfg) -
   Settings for your Electron application.
import { RendererLogger } from './src';

declare const Logger: RendererLogger & {
  default: RendererLogger;
};
export = Logger;
'use strict';

const renderer = require('./src/renderer');

module.exports = renderer;
import defaultLog from '../../main';
import { ConsoleTransport, warn } from '../index';

// Default module export
defaultLog.warn('test');

// Check whether default logger is MainLogger
defaultLog.create({ logId: 'test '}).transports.file.level = 'error';

// CommonJS export
warn('test');

// Check named export
const transport: ConsoleTransport = defaultLog.transports.console
transport({ data: [], date: new Date(), level: 'info' })
import defaultLog from '../../renderer';
import { warn } from '../index';

// Default module export
defaultLog.warn('test');

// CommonJS export
warn('test');

// Check global variable
__electronLog.info();
'use strict';

const fs = require('fs');
const path = require('path');

module.exports = {
  /**
   * For running tests using node older than 12.10
   * @param {string} dirPath
   */
  rmDir(dirPath) {
    if (!fs.existsSync(dirPath)) {
      return;
    }

    fs.readdirSync(dirPath).forEach((file) => {
      const curPath = path.join(dirPath, file);
      if (fs.lstatSync(curPath).isDirectory()) {
        module.exports.rmDir(curPath);
      } else {
        fs.unlinkSync(curPath);
      }
    });

    fs.rmdirSync(dirPath);
  },
};
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');

class TestLogReader {
  constructor(appName = null) {
    this.items = [];
    this.appName = appName;
  }

  static getDefaultLogDir(appName) {
    switch (process.platform) {
      case 'darwin': {
        return path.resolve(os.homedir(), 'Library/Logs', appName);
      }
      case 'win32': {
        return path.resolve(os.homedir(), 'AppData/Roaming', appName, 'logs');
      }
      default: {
        return path.resolve(os.homedir(), '.config', appName, 'logs');
      }
    }
  }

  static removeDefaultLogDir(appName) {
    let logDirPath = this.getDefaultLogDir(appName);

    if (process.platform !== 'darwin') {
      logDirPath = path.dirname(logDirPath);
    }

    if (fs.existsSync(logDirPath)) {
      fs.rmSync(logDirPath, { recursive: true });
    }
  }

  static fromApp(appName) {
    const reader = new this(appName);
    reader.loadFilesFromDefaultDir(appName);
    return reader;
  }

  static fromFile(logFilePath) {
    const reader = new this();
    reader.loadFile(logFilePath);
    return reader;
  }

  format(template = '{text}') {
    return this.items.map((item) => template
      .replace('{date}', item.date)
      .replace('{fileName}', item.fileName)
      .replace('{level}', item.level)
      .replace('{text}', item.text));
  }

  loadFile(filePath) {
    const fileName = path.basename(filePath);
    const content = fs.readFileSync(filePath, 'utf8');

    const items = content.split(os.EOL)
      .filter(Boolean)
      .reduce((result, line) => {
        const matches = line.match(/\[([\w.: -]+)] \[(\w+)]  ?([\s\S]*)/);
        if (matches) {
          return result.concat({
            date: matches[1],
            fileName,
            level: matches[2],
            text: matches[3],
          });
        }

        const lastItem = result[result.length - 1];
        if (lastItem) {
          lastItem.text += `\n${line}`;
        }

        return result;
      }, [])
      .filter(Boolean);

    this.items = this.items.concat(items);
  }

  loadFilesFromDefaultDir(appName = this.appName) {
    const defaultLogDir = this.constructor.getDefaultLogDir(appName);
    for (const logFileName of fs.readdirSync(defaultLogDir)) {
      this.loadFile(path.join(defaultLogDir, logFileName));
    }
  }

  removeLogDir() {
    if (this.appName) {
      this.constructor.removeDefaultLogDir(this.appName);
    }
  }
}

module.exports = TestLogReader;
'use strict';

const { expect } = require('humile');
const Logger = require('../Logger');

describe('Logger', () => {
  it('compareLevels', () => {
    const log = createLogger();
    expect(log.compareLevels('error', 'info')).toBe(false);
    expect(log.compareLevels('info', 'error')).toBe(true);
    expect(log.compareLevels('error', 'error')).toBe(true);
    expect(log.compareLevels('error', 'not_exists')).toBe(true);
  });

  describe('log', () => {
    it('should call a transport function', () => {
      const log = createLogger();
      log.info('test');
      expect(log.memory[0]).toMatchObject({ data: ['test'], level: 'info' });
    });

    it('should process undefined value', () => {
      const log = createLogger();
      log.info(undefined);
      expect(log.memory[0]).toMatchObject({ data: [undefined], level: 'info' });
    });

    it('should call hooks', () => {
      const log = createLogger();

      log.hooks.push((msg) => {
        msg.data[0] += ' hooked';
        return msg;
      });

      log.info('test');
      expect(log.memory[0].data).toEqual(['test hooked']);

      // Should prevent logging
      log.hooks.push(() => null);
      log.info('test');
      expect(log.memory.length).toBe(1);
    });

    it('should allow to add new levels', () => {
      const log = createLogger();
      log.addLevel('custom');
      // noinspection JSUnresolvedFunction
      log.custom('test');
      expect(log.memory[0]).toMatchObject({ data: ['test'], level: 'custom' });
    });
  });

  describe('processMessage', () => {
    it('should run transport when the level is correct', () => {
      const log = createLogger();
      log.processMessage({ data: ['test'], level: 'warn' });
      expect(log.memory.length).toBe(1);
    });

    it('should skip running when the transport is broken', () => {
      const log = createLogger({ transportFactories: {} });
      log.processMessage({ data: ['test'], level: 'info' });
      expect(log.memory.length).toBe(0);
    });
  });
});

function createLogger(options = {}) {
  const logger = new Logger({
    logId: 'logger-test',
    transportFactories: {
      memory: (log) => {
        return (message) => log.memory.push(message);
      },
    },
    ...options,
  });

  logger.memory = [];

  return logger;
}
'use strict';

const scopeFactory = require('../scope');

describe('scope', () => {
  it('should store maximum label length', () => {
    const logger = mockLogger();
    const scope = scopeFactory(logger);

    scope('test');
    expect(scope.maxLabelLength).toBe(4);

    scope('test2');
    expect(scope.maxLabelLength).toBe(5);
  });

  describe('labelLength', () => {
    it('when labelPadding is true', () => {
      const logger = mockLogger();
      const scope = scopeFactory(logger);
      scope.labelPadding = true;

      expect(scope.labelLength).toBe(0);

      scope('test');
      expect(scope.labelLength).toBe(4);
    });

    it('when labelPadding is false', () => {
      const logger = mockLogger();
      const scope = scopeFactory(logger);
      scope.labelPadding = false;

      expect(scope.labelLength).toBe(0);

      scope('test');
      expect(scope.labelLength).toBe(0);
    });

    it('when labelPadding is a number', () => {
      const logger = mockLogger();
      const scope = scopeFactory(logger);
      scope.labelPadding = 10;

      expect(scope.labelLength).toBe(10);

      scope('test');
      expect(scope.labelLength).toBe(10);
    });
  });
});

function mockLogger() {
  return {
    levels: ['error', 'warn', 'info', 'verbose', 'debug', 'silly'],
  };
}
'use strict';

const scopeFactory = require('./scope');

/**
 * @property {Function} error
 * @property {Function} warn
 * @property {Function} info
 * @property {Function} verbose
 * @property {Function} debug
 * @property {Function} silly
 */
class Logger {
  static instances = {};

  dependencies = {};
  errorHandler = null;
  eventLogger = null;
  functions = {};
  hooks = [];
  isDev = false;
  levels = null;
  logId = null;
  scope = null;
  transports = {};
  variables = {};

  constructor({
    allowUnknownLevel = false,
    dependencies = {},
    errorHandler,
    eventLogger,
    initializeFn,
    isDev = false,
    levels = ['error', 'warn', 'info', 'verbose', 'debug', 'silly'],
    logId,
    transportFactories = {},
    variables,
  } = {}) {
    this.addLevel = this.addLevel.bind(this);
    this.create = this.create.bind(this);
    this.initialize = this.initialize.bind(this);
    this.logData = this.logData.bind(this);
    this.processMessage = this.processMessage.bind(this);

    this.allowUnknownLevel = allowUnknownLevel;
    this.dependencies = dependencies;
    this.initializeFn = initializeFn;
    this.isDev = isDev;
    this.levels = levels;
    this.logId = logId;
    this.transportFactories = transportFactories;
    this.variables = variables || {};
    this.scope = scopeFactory(this);

    this.addLevel('log', false);
    for (const name of this.levels) {
      this.addLevel(name, false);
    }

    this.errorHandler = errorHandler;
    errorHandler?.setOptions({ ...dependencies, logFn: this.error });

    this.eventLogger = eventLogger;
    eventLogger?.setOptions({ ...dependencies, logger: this });

    for (const [name, factory] of Object.entries(transportFactories)) {
      this.transports[name] = factory(this, dependencies);
    }

    Logger.instances[logId] = this;
  }

  static getInstance({ logId }) {
    return this.instances[logId] || this.instances.default;
  }

  addLevel(level, index = this.levels.length) {
    if (index !== false) {
      this.levels.splice(index, 0, level);
    }

    this[level] = (...args) => this.logData(args, { level });
    this.functions[level] = this[level];
  }

  catchErrors(options) {
    this.processMessage(
      {
        data: ['log.catchErrors is deprecated. Use log.errorHandler instead'],
        level: 'warn',
      },
      { transports: ['console'] },
    );
    return this.errorHandler.startCatching(options);
  }

  create(options) {
    if (typeof options === 'string') {
      options = { logId: options };
    }

    return new Logger({
      dependencies: this.dependencies,
      errorHandler: this.errorHandler,
      initializeFn: this.initializeFn,
      isDev: this.isDev,
      transportFactories: this.transportFactories,
      variables: { ...this.variables },
      ...options,
    });
  }

  compareLevels(passLevel, checkLevel, levels = this.levels) {
    const pass = levels.indexOf(passLevel);
    const check = levels.indexOf(checkLevel);
    if (check === -1 || pass === -1) {
      return true;
    }

    return check <= pass;
  }

  initialize(options = {}) {
    this.initializeFn({ logger: this, ...this.dependencies, ...options });
  }

  logData(data, options = {}) {
    this.processMessage({ data, ...options });
  }

  processMessage(message, { transports = this.transports } = {}) {
    if (message.cmd === 'errorHandler') {
      this.errorHandler.handle(message.error, {
        errorName: message.errorName,
        processType: 'renderer',
        showDialog: Boolean(message.showDialog),
      });
      return;
    }

    let level = message.level;
    if (!this.allowUnknownLevel) {
      level = this.levels.includes(message.level) ? message.level : 'info';
    }

    const normalizedMessage = {
      date: new Date(),
      ...message,
      level,
      variables: {
        ...this.variables,
        ...message.variables,
      },
    };

    for (const [transName, transFn] of this.transportEntries(transports)) {
      if (typeof transFn !== 'function' || transFn.level === false) {
        continue;
      }

      if (!this.compareLevels(transFn.level, message.level)) {
        continue;
      }

      try {
        // eslint-disable-next-line arrow-body-style
        const transformedMsg = this.hooks.reduce((msg, hook) => {
          return msg ? hook(msg, transFn, transName) : msg;
        }, normalizedMessage);

        if (transformedMsg) {
          transFn({ ...transformedMsg, data: [...transformedMsg.data] });
        }
      } catch (e) {
        this.processInternalErrorFn(e);
      }
    }
  }

  processInternalErrorFn(_e) {
    // Do nothing by default
  }

  transportEntries(transports = this.transports) {
    const transportArray = Array.isArray(transports)
      ? transports
      : Object.entries(transports);

    return transportArray
      .map((item) => {
        switch (typeof item) {
          case 'string':
            return this.transports[item] ? [item, this.transports[item]] : null;
          case 'function':
            return [item.name, item];
          default:
            return Array.isArray(item) ? item : null;
        }
      })
      .filter(Boolean);
  }
}

module.exports = Logger;
'use strict';

module.exports = scopeFactory;

function scopeFactory(logger) {
  return Object.defineProperties(scope, {
    defaultLabel: { value: '', writable: true },
    labelPadding: { value: true, writable: true },
    maxLabelLength: { value: 0, writable: true },
    labelLength: {
      get() {
        switch (typeof scope.labelPadding) {
          case 'boolean': return scope.labelPadding ? scope.maxLabelLength : 0;
          case 'number': return scope.labelPadding;
          default: return 0;
        }
      },
    },
  });

  function scope(label) {
    scope.maxLabelLength = Math.max(scope.maxLabelLength, label.length);

    const newScope = {};
    for (const level of [...logger.levels, 'log']) {
      newScope[level] = (...d) => logger.logData(d, { level, scope: label });
    }
    return newScope;
  }
}
import { ClientRequest, RequestOptions } from 'http';
import { InspectOptions } from 'util';

declare namespace Logger {
  type LogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' |
    'silly';
  type LevelOption = LogLevel | false;

  type Format = (({ message: LogMessage }) => any[]) | string;

  type FOpenFlags = 'r' | 'r+' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' |
    'a' | 'ax' | 'a+' | 'ax+';

  type Hook = (
    message: LogMessage,
    transport?: Transport,
    transportName?: string,
  ) => LogMessage | false;

  interface Variables {
    processType: string;

    [name: string]: any;
  }

  type TransformFn = (options: {
    data: any[],
    message: LogMessage,
    transport: Transport,
    logger: Logger
  }) => any[];

  interface LogMessage {
    /**
     * Any arguments passed to a log function
     */
    data: any[];

    /**
     * When the log entry was created
     */
    date: Date;

    /**
     * From error to silly
     */
    level: LogLevel;

    /**
     * Id of Logger instance
     */
    logId?: string;

    /**
     * Message scope label
     */
    scope?: string;

    /**
     * Variables used by formatter
     */
    variables?: Variables;
  }

  interface Transport {
    (message: LogMessage): void;

    /**
     * Messages with level lower than will be dropped
     */
    level: LevelOption;

    transforms: TransformFn[];
  }

  interface ConsoleTransport extends Transport {
    /**
     * String template of function for message serialization
     */
    format: Format | string;

    /**
     * Use styles even if TTY isn't attached
     */
    useStyles: boolean;

    /**
     * Override message printing
     */
    writeFn(options: { message: LogMessage }): void;
  }

  interface PathVariables {
    /**
     * Per-user application data directory, which by default points to:
     * %APPDATA% on Windows
     * $XDG_CONFIG_HOME or ~/.config on Linux
     * ~/Library/Application Support on macOS
     */
    readonly appData: string;

    /**
     * Application name from productName or name of package.json
     */
    readonly appName: string;

    /**
     * Application version from package.json
     */
    readonly appVersion: string;

    /**
     * app.getPath('logs'). May be unavailable in old versions
     */
    readonly electronDefaultDir?: string;

    /**
     * Name of the log file without path
     */
    readonly fileName?: string;

    /**
     * User's home directory
     */
    readonly home: string;

    /**
     * userData + /logs/ + fileName on Linux and Windows
     * ~/Library/Logs/ + appName + / + fileName on macOS
     */
    readonly libraryDefaultDir: string;

    /**
     * Same as libraryDefaultDir, but contains '{appName}' template instead
     * of the real application name
     */
    readonly libraryTemplate: string;

    /**
     * OS temporary path
     */
    readonly tempDir: string;

    /**
     * The directory for storing your app's configuration files, which by
     * default it is the appData directory appended with your app's name.
     */
    readonly userData: string;
  }

  interface WriteOptions {
    /**
     * Default 'a'
     */
    flag?: FOpenFlags;

    /**
     * Default 0666
     */
    mode?: number;

    /**
     * Default 'utf8'
     */
    encoding?: string;
  }

  interface LogFile {
    /**
     * Full log file path
     */
    readonly path: string;

    /**
     * How many bytes were written since transport initialization
     */
    readonly bytesWritten: number;

    /**
     * Current file size
     */
    readonly size: number;

    /**
     * Clear the log file
     */
    clear(): boolean;

    /**
     * Emitted when there was some error while saving log file
     */
    on(event: 'error', listener: (error: Error, file: this) => void): this;
  }

  interface FileTransport extends Transport {
    /**
     * Deprecated alias of archiveLogFn
     * @deprecated
     */
    archiveLog: (oldLogFile: LogFile) => void;

    /**
     * Function which is called on log rotation. You can override it if you need
     * custom log rotation behavior. This function should remove old file
     * synchronously
     */
    archiveLogFn: (oldLogFile: LogFile) => void;

    /**
     * How deep to serialize complex objects
     * Deprecated in favor of inspectOptions
     * @deprecated
     */
    depth: number;

    /**
     * Filename without path, main.log (or renderer.log) by default
     */
    fileName: string;

    /**
     * String template of function for message serialization
     */
    format: Format | string;

    /**
     * Return the current log file instance
     * You only need to provide message argument if you define log path inside
     * resolvePath callback depending on a message.
     */
    getFile(message?: Partial<LogMessage>): LogFile;

    /**
     * Serialization options
     * @link https://nodejs.org/api/util.html#util_util_inspect_object_options
     */
    inspectOptions: InspectOptions;

    /**
     * Maximum size of log file in bytes, 1048576 (1mb) by default. When a log
     * file exceeds this limit, it will be moved to log.old.log file and the
     * current file will be cleared. You can set it to 0 to disable rotation
     */
    maxSize: number;

    /**
     * Reads content of all log files
     */
    readAllLogs(
      options?: { fileFilter?: (logPath: string) => boolean },
    ): Array<{ path: string, lines: string[] }>;

    /**
     * Alias for resolvePathFn
     * @deprecated
     */
    resolvePath: (variables: PathVariables, message?: LogMessage) => string;

    /**
     * Allow to change log file path dynamically
     */
    resolvePathFn: (variables: PathVariables, message?: LogMessage) => string;

    /**
     * Whether to write a log file synchronously. Default to true
     */
    sync: boolean;

    /**
     * Options used when writing a file
     */
    writeOptions?: WriteOptions;
  }

  interface RemoteTransport extends Transport {
    /**
     * Client information which will be sent in each request together with
     * a message body
     */
    client?: object;

    /**
     * How deep to serialize complex objects
     */
    depth?: number;

    /**
     * Additional options for the HTTP request
     */
    requestOptions?: RequestOptions;

    /**
     * Callback which is called on request error
     */
    processErrorFn: (error: Error) => void;

    /**
     * Callback which transforms request body to string
     */
    makeBodyFn: (
      options: { logger: Logger, message: LogMessage, transport: Transport },
    ) => any;

    /**
     * Callback which allows to customize request sending
     */
    sendRequestFn: (
      options: { serverUrl: string, requestOptions: RequestOptions, body: any }
    ) => ClientRequest;

    /**
     * Server URL
     */
    url: string;
  }

  interface MainTransports {
    /**
     * Writes logs to console
     */
    console: ConsoleTransport;

    /**
     * Writes logs to a file
     */
    file: FileTransport;

    /**
     * Display main process logs in the renderer dev tools console
     */
    ipc: Transport;

    /**
     * Sends a JSON POST request with LogMessage in the body to the specified url
     */
    remote: RemoteTransport;

    [key: string]: Transport | null;
  }

  interface RendererTransports {
    /**
     * Writes logs to console
     */
    console: ConsoleTransport;

    /**
     * Communicates with a main process logger
     */
    ipc: Transport;

    [key: string]: Transport | null;
  }

  interface Scope {
    (label: string): LogFunctions;

    /**
     * Label for log message without scope. If set to false and scope isn't
     * set, no padding is used
     */
    defaultLabel: string | false;

    /**
     * Pad scope label using spaces
     * false: disabled
     * true: automatically
     * number: set exact maximum label length. Helpful when a scope can
     * be created after some log messages were sent
     */
    labelPadding: boolean | number;
  }

  interface ReportData {
    body: string;
    title: string;

    assignee: string;
    labels: string;
    milestone: string;
    projects: string;
    template: string;
  }

  interface LogFunctions {
    /**
     * Log an error message
     */
    error(...params: any[]): void;

    /**
     * Log a warning message
     */
    warn(...params: any[]): void;

    /**
     * Log an informational message
     */
    info(...params: any[]): void;

    /**
     * Log a verbose message
     */
    verbose(...params: any[]): void;

    /**
     * Log a debug message
     */
    debug(...params: any[]): void;

    /**
     * Log a silly message
     */
    silly(...params: any[]): void;

    /**
     * Shortcut to info
     */
    log(...params: any[]): void;
  }

  interface ErrorHandlerOptions {
    /**
     * Default true for the main process. Set it to false to prevent showing a
     * default electron error dialog
     */
    showDialog?: boolean;

    /**
     * Attach a custom error handler. If the handler returns false, this error
     * will not be processed
     */
    onError?(options: {
      createIssue: (url: string, data: ReportData | any) => void,
      error: Error,
      errorName: 'Unhandled' | 'Unhandled rejection',
      processType: 'browser' | 'renderer',
      versions: { app: string; electron: string; os: string },
    }): void;
  }

  interface MainErrorHandlerOptions extends ErrorHandlerOptions {
    /**
     * Attach a custom error handler. If the handler returns false, this error
     * will not be processed
     */
    onError?(options: {
      createIssue: (url: string, data: ReportData | any) => void,
      error: Error,
      errorName: 'Unhandled' | 'Unhandled rejection',
      processType: 'browser' | 'renderer',
      versions: { app: string; electron: string; os: string },
    }): void;
  }

  interface RendererErrorHandlerOptions extends ErrorHandlerOptions {
    /**
     * Attach a custom error handler. If the handler returns false, this error
     * will not be processed
     */
    onError?(options: {
      error: Error,
      errorName: 'Unhandled' | 'Unhandled rejection',
      processType: 'browser' | 'renderer',
    }): void;

    /**
     * By default, error and unhandledrejection handlers call preventDefault to
     * prevent error duplicating in console. Set false to disable it
     */
    preventDefault?: boolean;
  }

  interface ErrorHandler<T = ErrorHandlerOptions> {
    /**
     * Process an error by the ErrorHandler
     */
    handle(error: Error, options?: T): void;

    /**
     * Change some options
     */
    setOptions(options: T): void;

    /**
     * Start catching unhandled errors and rejections
     */
    startCatching(options?: T): void;

    /**
     * Stop catching unhandled errors and rejections
     */
    stopCatching(): void;
  }

  type EventSource = 'app' | 'webContents';

  interface EventLoggerOptions {
    /**
     * String template or function which prepares event data for logging
     */
    format?:
      | string
      | ((
          args: {
            eventName: string;
            eventSource: EventSource;
            handlerArgs: unknown[];
          }
        ) => unknown[]);

    /**
     * Formatter callbacks for a specific event
     */
    formatters?: Record<
      EventSource,
      Record<
        string,
        (
          args: {
            args: unknown[];
            event: object;
            eventName: string;
            eventSource: string;
          }
        ) => unknown
      >
    >;

    /**
     * Allow to switch specific events on/off easily
     */
    events?: Record<EventSource, Record<string, boolean>>;

    /**
     * Which log level is used for logging. Default warn
     */
    level?: LogLevel;

    /**
     * Which log scope is used for logging. Default '' (none)
     */
    scope?: string;
  }

  interface EventLogger extends Required<EventLoggerOptions> {
    setOptions(options: EventLoggerOptions): void;
    startLogging(options?: EventLoggerOptions): void;
    stopLogging(): void;
  }

  interface Logger extends LogFunctions {
    /**
     * Error handling helper
     */
    errorHandler: ErrorHandler;

    /**
     * Object contained only log functions
     */
    functions: LogFunctions;

    /**
     * Array with all attached hooks
     */
    hooks: Hook[];

    /**
     * Array with all available levels
     */
    levels: string[];

    /**
     * ID of the current logger instance
     */
    logId: string;

    /**
     * Create a new scope
     */
    scope: Scope;

    /**
     * Transport instances
     */
    transports: { [key: string]: Transport | null; };

    /**
     * Variables used by formatters
     */
    variables: Variables;

    /**
     * Add a custom log level
     */
    addLevel(level: string, index?: number): void;

    /**
     * Catch and log unhandled errors/rejected promises
     * @deprecated
     */
    catchErrors(options?: ErrorHandlerOptions): ErrorHandler;

    /**
     * Create a new electron-log instance
     */
    create(options: { logId: string }): this;

    /**
     * Low level method which logs the message using specified transports
     */
    processMessage(
      message: LogMessage,
      options?: { transports?: Transport[] | string[] },
    ): void;
  }

  interface NodeLogger extends Logger {
    errorHandler: ErrorHandler<MainErrorHandlerOptions>;
    eventLogger: EventLogger;
    transports: MainTransports;
  }

  interface MainLogger extends NodeLogger {
    initialize(
      options?: {
        getSessions?: () => object[];
        includeFutureSessions?: boolean;
        preload?: string | boolean;
        spyRendererConsole?: boolean;
      },
    ): void;
  }

  interface RendererLogger extends Logger {
    errorHandler: ErrorHandler<RendererErrorHandlerOptions>;
    transports: RendererTransports;
  }
}

// Merge namespace with interface
declare const Logger: Logger.MainLogger & {
  default: Logger.MainLogger;
};
export = Logger;

declare global {
  const __electronLog: Logger.LogFunctions;
  interface Window {
    __electronLog: Logger.LogFunctions;
  }
}

'use strict';

/* eslint-disable global-require */

const isRenderer = typeof process === 'undefined'
  || (process.type === 'renderer' || process.type === 'worker');

const isMain = typeof process === 'object' && process.type === 'browser';

if (isRenderer) {
  // Makes sense when contextIsolation/sandbox disabled
  require('./renderer/electron-log-preload');
  module.exports = require('./renderer');
} else if (isMain) {
  module.exports = require('./main');
} else {
  module.exports = require('./node');
}
'use strict';

const humilePkg = require('humile/package.json');
const ElectronExternalApi = require('../ElectronExternalApi');

describe('ElectronExternalApi', () => {
  describe('getAppName', () => {
    it('gets the electron app name property', () => {
      const electron = {
        app: {
          name: 'test-prop',
          getName: () => 'test-func',
        },
      };

      expect(api({ electron }).getAppName()).toBe('test-prop');
    });

    it('calls the electron app name function when no name property', () => {
      const electron = {
        app: {
          name: undefined,
          getName: () => 'test-func',
        },
      };

      expect(api({ electron }).getAppName()).toBe('test-func');
    });

    it('fallsback to super function when no electron names', () => {
      const electron = {
        app: {
          name: undefined,
          getName: undefined,
        },
      };

      expect(api({ electron }).getAppName()).toBe(humilePkg.name);
    });

    it('fallsback to super function when no electron', () => {
      const electron = undefined;

      expect(api({ electron }).getAppName()).toBe(humilePkg.name);
    });
  });

  /**
   * @param {object} options
   * @param {NodeJS.Platform} options.platform
   * @param {typeof Electron} options.electron
   * @returns {ElectronExternalApi}
   */
  function api({ electron, platform = process.platform } = {}) {
    const externalApi = new ElectronExternalApi({ electron });
    externalApi.setPlatform(platform);
    return externalApi;
  }
});
'use strict';

const log = require('../index');

describe('main/index', () => {
  it('should contain all methods of Console API', () => {
    const levels = [
      'error',
      'warn',
      'info',
      'verbose',
      'debug',
      'silly',
      'log',
    ];
    levels.forEach((level) => {
      expect(typeof log[level]).toBe('function');
    });
  });

  it('should allow to add a new log level', () => {
    log.addLevel('notice', 2);
    expect(log.levels).toEqual(
      ['error', 'warn', 'notice', 'info', 'verbose', 'debug', 'silly'],
    );

    expect(typeof log.notice).toBe('function');
    expect(typeof log.functions.notice).toBe('function');
    expect(typeof log.scope('test').notice).toBe('function');
  });

  it('should create independent logger instance', () => {
    const defaultLogger = log;
    const customLogger = log.create('custom');

    customLogger.transports.file.fileName = 'custom.log';

    expect(defaultLogger.transports.file.fileName).toBe('main.log');
    expect(customLogger.transports.file.fileName).toBe('custom.log');
  });
});
'use strict';

const path = require('path');
const NodeExternalApi = require('../node/NodeExternalApi');

class ElectronExternalApi extends NodeExternalApi {
  /**
   * @type {typeof Electron}
   */
  electron = undefined;

  /**
   * @param {object} options
   * @param {typeof Electron} [options.electron]
   */
  constructor({ electron } = {}) {
    super();
    this.electron = electron;
  }

  getAppName() {
    let appName;
    try {
      appName = this.electron.app?.name || this.electron.app?.getName();
    } catch {
      // fallback to default value below
    }
    return appName || super.getAppName();
  }

  getAppUserDataPath(appName) {
    return this.getPath('userData') || super.getAppUserDataPath(appName);
  }

  getAppVersion() {
    let appVersion;
    try {
      appVersion = this.electron.app?.getVersion();
    } catch {
      // fallback to default value below
    }
    return appVersion || super.getAppVersion();
  }

  getElectronLogPath() {
    return this.getPath('logs') || super.getElectronLogPath();
  }

  /**
   * @private
   * @param {any} name
   * @returns {string|undefined}
   */
  getPath(name) {
    try {
      return this.electron.app?.getPath(name);
    } catch {
      return undefined;
    }
  }

  getVersions() {
    return {
      app: `${this.getAppName()} ${this.getAppVersion()}`,
      electron: `Electron ${process.versions.electron}`,
      os: this.getOsVersion(),
    };
  }

  getSystemPathAppData() {
    return this.getPath('appData') || super.getSystemPathAppData();
  }

  isDev() {
    if (this.electron.app?.isPackaged !== undefined) {
      return !this.electron.app.isPackaged;
    }

    if (typeof process.execPath === 'string') {
      const execFileName = path.basename(process.execPath).toLowerCase();
      return execFileName.startsWith('electron');
    }

    return super.isDev();
  }

  onAppEvent(eventName, handler) {
    this.electron.app?.on(eventName, handler);

    return () => {
      this.electron.app?.off(eventName, handler);
    };
  }

  onAppReady(handler) {
    if (this.electron.app?.isReady()) {
      handler();
    } else if (this.electron.app?.once) {
      this.electron.app?.once('ready', handler);
    } else {
      handler();
    }
  }

  onEveryWebContentsEvent(eventName, handler) {
    this.electron.webContents?.getAllWebContents()?.forEach((webContents) => {
      webContents.on(eventName, handler);
    });

    this.electron.app?.on('web-contents-created', onWebContentsCreated);

    return () => {
      this.electron.webContents?.getAllWebContents().forEach((webContents) => {
        webContents.off(eventName, handler);
      });

      this.electron.app?.off('web-contents-created', onWebContentsCreated);
    };

    function onWebContentsCreated(_, webContents) {
      webContents.on(eventName, handler);
    }
  }

  /**
   * Listen to async messages sent from opposite process
   * @param {string} channel
   * @param {function} listener
   */
  onIpc(channel, listener) {
    this.electron.ipcMain?.on(channel, listener);
  }

  onIpcInvoke(channel, listener) {
    this.electron.ipcMain?.handle?.(channel, listener);
  }

  /**
   * @param {string} url
   * @param {Function} [logFunction]
   */
  openUrl(url, logFunction = console.error) { // eslint-disable-line no-console
    this.electron.shell?.openExternal(url).catch(logFunction);
  }

  setPreloadFileForSessions({
    filePath,
    includeFutureSession = true,
    getSessions = () => [this.electron.session?.defaultSession],
  }) {
    for (const session of getSessions().filter(Boolean)) {
      setPreload(session);
    }

    if (includeFutureSession) {
      this.onAppEvent('session-created', (session) => {
        setPreload(session);
      });
    }

    /**
     * @param {Session} session
     */
    function setPreload(session) {
      session.setPreloads([...session.getPreloads(), filePath]);
    }
  }

  /**
   * Sent a message to opposite process
   * @param {string} channel
   * @param {any} message
   */
  sendIpc(channel, message) {
    this.electron.BrowserWindow?.getAllWindows()?.forEach((wnd) => {
      if (wnd.webContents?.isDestroyed() === false) {
        wnd.webContents.send(channel, message);
      }
    });
  }

  showErrorBox(title, message) {
    this.electron.dialog?.showErrorBox(title, message);
  }
}

module.exports = ElectronExternalApi;
'use strict';

const electron = require('electron');
const ElectronExternalApi = require('./ElectronExternalApi');
const { initialize } = require('./initialize');
const createDefaultLogger = require('../node/createDefaultLogger');

const externalApi = new ElectronExternalApi({ electron });
const defaultLogger = createDefaultLogger({
  dependencies: { externalApi },
  initializeFn: initialize,
});

module.exports = defaultLogger;

externalApi.onIpc('__ELECTRON_LOG__', (_, message) => {
  if (message.scope) {
    defaultLogger.Logger.getInstance(message).scope(message.scope);
  }

  const date = new Date(message.date);
  processMessage({
    ...message,
    date: date.getTime() ? date : new Date(),
  });
});

externalApi.onIpcInvoke('__ELECTRON_LOG__', (_, { cmd = '', logId }) => {
  switch (cmd) {
    case 'getOptions': {
      const logger = defaultLogger.Logger.getInstance({ logId });
      return {
        levels: logger.levels,
        logId,
      };
    }

    default: {
      processMessage({ data: [`Unknown cmd '${cmd}'`], level: 'error' });
      return {};
    }
  }
});

function processMessage(message) {
  defaultLogger.Logger.getInstance(message)?.processMessage(message);
}
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');
const preloadInitializeFn = require('../renderer/electron-log-preload');

module.exports = {
  initialize({
    externalApi,
    getSessions,
    includeFutureSession,
    logger,
    preload = true,
    spyRendererConsole = false,
  }) {
    externalApi.onAppReady(() => {
      try {
        if (preload) {
          initializePreload({
            externalApi,
            getSessions,
            includeFutureSession,
            preloadOption: preload,
          });
        }

        if (spyRendererConsole) {
          initializeSpyRendererConsole({ externalApi, logger });
        }
      } catch (err) {
        logger.warn(err);
      }
    });
  },
};

function initializePreload({
  externalApi,
  getSessions,
  includeFutureSession,
  preloadOption,
}) {
  let preloadPath = typeof preloadOption === 'string'
    ? preloadOption
    : undefined;

  try {
    preloadPath = path.resolve(
      __dirname,
      '../renderer/electron-log-preload.js',
    );
  } catch {
    // Ignore, the file is bundled to ESM
  }

  if (!preloadPath || !fs.existsSync(preloadPath)) {
    preloadPath = path.join(
      externalApi.getAppUserDataPath() || os.tmpdir(),
      'electron-log-preload.js',
    );
    const preloadCode = `
      try {
        (${preloadInitializeFn.toString()})(require('electron'));
      } catch(e) {
        console.error(e);
      }
    `;
    fs.writeFileSync(preloadPath, preloadCode, 'utf8');
  }

  externalApi.setPreloadFileForSessions({
    filePath: preloadPath,
    includeFutureSession,
    getSessions,
  });
}

function initializeSpyRendererConsole({ externalApi, logger }) {
  const levels = ['verbose', 'info', 'warning', 'error'];
  externalApi.onEveryWebContentsEvent(
    'console-message',
    (event, level, message) => {
      logger.processMessage({
        data: [message],
        level: levels[level],
        variables: { processType: 'renderer' },
      });
    },
  );
}
'use strict';

const ErrorHandler = require('../ErrorHandler');

describe('ErrorHandler', () => {
  beforeAll(function () {
    this.originalListeners = process.listeners('unhandledRejection');
    process.removeAllListeners('unhandledRejection');
  });

  afterAll(function () {
    this.originalListeners.forEach((listener) => {
      process.addListener('unhandledRejection', listener);
    });
  });

  afterEach(function () {
    this.errorHandler?.stopCatching();
  });

  it('should pass an error to options.log callback', function (done) {
    this.errorHandler = new ErrorHandler({ logFn: log });
    this.errorHandler.startCatching();

    Promise.reject(new Error('test-error'));

    function log(_, e) {
      expect(e.message).toBe('test-error');
      done();
    }
  }, 50);

  it('should pass an error to options.onError callback', function (done) {
    this.errorHandler = new ErrorHandler({ onError });
    this.errorHandler.startCatching();

    Promise.reject(new Error('test-error'));

    function onError({ error }) {
      expect(error.message).toBe('test-error');
      done();
      return false;
    }
  }, 50);
});
'use strict';

const log = require('../index');

describe('node/index', () => {
  it('should contain all methods of Console API', () => {
    const levels = [
      'error',
      'warn',
      'info',
      'verbose',
      'debug',
      'silly',
      'log',
    ];
    levels.forEach((level) => {
      expect(typeof log[level]).toBe('function');
    });
  });

  it('should allow to add a new log level', () => {
    log.addLevel('notice', 2);
    expect(log.levels).toEqual(
      ['error', 'warn', 'notice', 'info', 'verbose', 'debug', 'silly'],
    );

    expect(typeof log.notice).toBe('function');
    expect(typeof log.functions.notice).toBe('function');
    expect(typeof log.scope('test').notice).toBe('function');
  });

  it('should create independent logger instance', () => {
    const defaultLogger = log;
    const customLogger = log.create('custom');

    customLogger.transports.file.fileName = 'custom.log';

    expect(defaultLogger.transports.file.fileName).toBe('main.log');
    expect(customLogger.transports.file.fileName).toBe('custom.log');
  });
});
'use strict';

const humilePkg = require('humile/package.json');
const os = require('os');
const path = require('path');
const NodeExternalApi = require('../NodeExternalApi');

describe(NodeExternalApi.constructor.name, () => {
  describe(NodeExternalApi.prototype.getSystemPathAppData.name, () => {
    it('on Linux', () => {
      expect(api('linux').getSystemPathAppData()).toBe(
        path.join(os.homedir(), '.config'),
      );
    });

    it('on macOS', () => {
      expect(api('darwin').getSystemPathAppData()).toBe(
        path.join(os.homedir(), 'Library/Application Support'),
      );
    });

    it('on Windows', () => {
      expect(api('win32').getSystemPathAppData()).toBe(
        path.join(os.homedir(), 'AppData', 'Roaming'),
      );
    });
  });

  it(NodeExternalApi.prototype.getAppName.name, () => {
    expect(api().getAppName()).toBe('humile');
  });

  it(NodeExternalApi.prototype.getAppVersion.name, () => {
    expect(api().getAppVersion()).toBe(humilePkg.version);
  });

  describe(NodeExternalApi.prototype.getPathVariables.name, () => {
    it('on Linux', () => {
      const appData = path.join(os.homedir(), '.config');

      expect(api('linux').getPathVariables()).toEqual({
        appData,
        appName: 'humile',
        appVersion: humilePkg.version,
        electronDefaultDir: path.join(appData, 'humile/logs'),
        home: os.homedir(),
        libraryDefaultDir: path.join(appData, 'humile/logs'),
        libraryTemplate: path.join(appData, '{appName}/logs'),
        temp: os.tmpdir(),
        userData: path.join(appData, 'humile'),
      });
    });

    it('on macOS', () => {
      const appData = path.join(os.homedir(), 'Library/Application Support');

      expect(api('darwin').getPathVariables()).toEqual({
        appData,
        appName: 'humile',
        appVersion: humilePkg.version,
        electronDefaultDir: path.join(os.homedir(), 'Library/Logs/humile'),
        home: os.homedir(),
        libraryDefaultDir: path.join(os.homedir(), 'Library/Logs/humile'),
        libraryTemplate: path.join(os.homedir(), 'Library/Logs/{appName}'),
        temp: os.tmpdir(),
        userData: path.join(appData, 'humile'),
      });
    });

    it('on Windows', () => {
      const appData = path.join(os.homedir(), 'AppData', 'Roaming');

      expect(api('win32').getPathVariables()).toEqual({
        appData,
        appName: 'humile',
        appVersion: humilePkg.version,
        electronDefaultDir: path.join(appData, 'humile', 'logs'),
        home: os.homedir(),
        libraryDefaultDir: path.join(appData, 'humile', 'logs'),
        libraryTemplate: path.join(appData, '{appName}/logs'),
        temp: os.tmpdir(),
        userData: path.join(appData, 'humile'),
      });
    });
  });

  /**
   * @param {NodeJS.Platform} platform
   * @returns {NodeExternalApi}
   */
  function api(platform = process.platform) {
    const externalApi = new NodeExternalApi();
    externalApi.setPlatform(platform);
    return externalApi;
  }
});
'use strict';

const path = require('path');
const { tryReadJsonAt } = require('../packageJson');

describe('node/packageJson', () => {
  describe(tryReadJsonAt.name, () => {
    it('should resolve data when child path specified', () => {
      const json = tryReadJsonAt(__filename);

      expect(json.name).toBe('electron-log');
      expect(json.version).toMatch(/\d+\.\d+\.\d+/);
    });

    it('should resolve data when root specified', () => {
      const rootPath = path.join(__dirname, '../..');
      const json = tryReadJsonAt(rootPath);

      expect(json.name).toBe('electron-log');
      expect(json.version).toMatch(/\d+\.\d+\.\d+/);
    });

    it('should return null on fail', () => {
      const json = tryReadJsonAt('/');

      expect(json).toBe(undefined);
    });
  });
});
'use strict';

const Logger = require('../core/Logger');
const ErrorHandler = require('./ErrorHandler');
const EventLogger = require('./EventLogger');
const transportConsole = require('./transports/console');
const transportFile = require('./transports/file');
const transportIpc = require('./transports/ipc');
const transportRemote = require('./transports/remote');

module.exports = createDefaultLogger;

function createDefaultLogger({ dependencies, initializeFn }) {
  const defaultLogger = new Logger({
    dependencies,
    errorHandler: new ErrorHandler(),
    eventLogger: new EventLogger(),
    initializeFn,
    isDev: dependencies.externalApi?.isDev(),
    logId: 'default',
    transportFactories: {
      console: transportConsole,
      file: transportFile,
      ipc: transportIpc,
      remote: transportRemote,
    },
    variables: {
      processType: 'main',
    },
  });

  defaultLogger.default = defaultLogger;
  defaultLogger.Logger = Logger;

  defaultLogger.processInternalErrorFn = (e) => {
    defaultLogger.transports.console.writeFn({
      message: {
        data: ['Unhandled electron-log error', e],
        level: 'error',
      },
    });
  };

  return defaultLogger;
}
'use strict';

class ErrorHandler {
  externalApi = undefined;
  isActive = false;
  logFn = undefined;
  onError = undefined;
  showDialog = true;

  constructor({
    externalApi,
    logFn = undefined,
    onError = undefined,
    showDialog = undefined,
  } = {}) {
    this.createIssue = this.createIssue.bind(this);
    this.handleError = this.handleError.bind(this);
    this.handleRejection = this.handleRejection.bind(this);
    this.setOptions({ externalApi, logFn, onError, showDialog });
    this.startCatching = this.startCatching.bind(this);
    this.stopCatching = this.stopCatching.bind(this);
  }

  handle(error, {
    logFn = this.logFn,
    onError = this.onError,
    processType = 'browser',
    showDialog = this.showDialog,
    errorName = '',
  } = {}) {
    error = normalizeError(error);

    try {
      if (typeof onError === 'function') {
        const versions = this.externalApi?.getVersions() || {};
        const createIssue = this.createIssue;
        const result = onError({
          createIssue,
          error,
          errorName,
          processType,
          versions,
        });
        if (result === false) {
          return;
        }
      }

      errorName ? logFn(errorName, error) : logFn(error);

      if (showDialog && !errorName.includes('rejection') && this.externalApi) {
        this.externalApi.showErrorBox(
          `A JavaScript error occurred in the ${processType} process`,
          error.stack,
        );
      }
    } catch {
      console.error(error); // eslint-disable-line no-console
    }
  }

  setOptions({ externalApi, logFn, onError, showDialog }) {
    if (typeof externalApi === 'object') {
      this.externalApi = externalApi;
    }

    if (typeof logFn === 'function') {
      this.logFn = logFn;
    }

    if (typeof onError === 'function') {
      this.onError = onError;
    }

    if (typeof showDialog === 'boolean') {
      this.showDialog = showDialog;
    }
  }

  startCatching({ onError, showDialog } = {}) {
    if (this.isActive) {
      return;
    }

    this.isActive = true;
    this.setOptions({ onError, showDialog });
    process.on('uncaughtException', this.handleError);
    process.on('unhandledRejection', this.handleRejection);
  }

  stopCatching() {
    this.isActive = false;
    process.removeListener('uncaughtException', this.handleError);
    process.removeListener('unhandledRejection', this.handleRejection);
  }

  createIssue(pageUrl, queryParams) {
    this.externalApi?.openUrl(
      `${pageUrl}?${new URLSearchParams(queryParams).toString()}`,
    );
  }

  handleError(error) {
    this.handle(error, { errorName: 'Unhandled' });
  }

  handleRejection(reason) {
    const error = reason instanceof Error
      ? reason
      : new Error(JSON.stringify(reason));
    this.handle(error, { errorName: 'Unhandled rejection' });
  }
}

function normalizeError(e) {
  if (e instanceof Error) {
    return e;
  }

  if (e && typeof e === 'object') {
    if (e.message) {
      return Object.assign(new Error(e.message), e);
    }
    try {
      return new Error(JSON.stringify(e));
    } catch (serErr) {
      return new Error(`Couldn't normalize error ${String(e)}: ${serErr}`);
    }
  }

  return new Error(`Can't normalize error ${String(e)}`);
}

module.exports = ErrorHandler;
'use strict';

class EventLogger {
  disposers = [];
  format = '{eventSource}#{eventName}:';
  formatters = {
    app: {
      'certificate-error': ({ args }) => {
        return this.arrayToObject(args.slice(1, 4), [
          'url',
          'error',
          'certificate',
        ]);
      },
      'child-process-gone': ({ args }) => {
        return args.length === 1 ? args[0] : args;
      },
      'render-process-gone': ({ args: [webContents, details] }) => {
        return details && typeof details === 'object'
          ? { ...details, ...this.getWebContentsDetails(webContents) }
          : [];
      },
    },

    webContents: {
      'console-message': ({ args: [level, message, line, sourceId] }) => {
        // 0: debug, 1: info, 2: warning, 3: error
        if (level < 3) {
          return undefined;
        }

        return { message, source: `${sourceId}:${line}` };
      },
      'did-fail-load': ({ args }) => {
        return this.arrayToObject(args, [
          'errorCode',
          'errorDescription',
          'validatedURL',
          'isMainFrame',
          'frameProcessId',
          'frameRoutingId',
        ]);
      },
      'did-fail-provisional-load': ({ args }) => {
        return this.arrayToObject(args, [
          'errorCode',
          'errorDescription',
          'validatedURL',
          'isMainFrame',
          'frameProcessId',
          'frameRoutingId',
        ]);
      },
      'plugin-crashed': ({ args }) => {
        return this.arrayToObject(args, ['name', 'version']);
      },
      'preload-error': ({ args }) => {
        return this.arrayToObject(args, ['preloadPath', 'error']);
      },
    },
  };

  events = {
    app: {
      'certificate-error': true,
      'child-process-gone': true,
      'render-process-gone': true,
    },

    webContents: {
      // 'console-message': true,
      'did-fail-load': true,
      'did-fail-provisional-load': true,
      'plugin-crashed': true,
      'preload-error': true,
      'unresponsive': true,
    },
  };

  externalApi = undefined;
  level = 'error';
  scope = '';

  constructor(options = {}) {
    this.setOptions(options);
  }

  setOptions({
    events,
    externalApi,
    level,
    logger,
    format,
    formatters,
    scope,
  }) {
    if (typeof events === 'object') {
      this.events = events;
    }

    if (typeof externalApi === 'object') {
      this.externalApi = externalApi;
    }

    if (typeof level === 'string') {
      this.level = level;
    }

    if (typeof logger === 'object') {
      this.logger = logger;
    }

    if (typeof format === 'string' || typeof format === 'function') {
      this.format = format;
    }

    if (typeof formatters === 'object') {
      this.formatters = formatters;
    }

    if (typeof scope === 'string') {
      this.scope = scope;
    }
  }

  startLogging(options = {}) {
    this.setOptions(options);

    this.disposeListeners();

    for (const eventName of this.getEventNames(this.events.app)) {
      this.disposers.push(
        this.externalApi.onAppEvent(eventName, (...handlerArgs) => {
          this.handleEvent({ eventSource: 'app', eventName, handlerArgs });
        }),
      );
    }

    for (const eventName of this.getEventNames(this.events.webContents)) {
      this.disposers.push(
        this.externalApi.onEveryWebContentsEvent(
          eventName,
          (...handlerArgs) => {
            this.handleEvent(
              { eventSource: 'webContents', eventName, handlerArgs },
            );
          },
        ),
      );
    }
  }

  stopLogging() {
    this.disposeListeners();
  }

  arrayToObject(array, fieldNames) {
    const obj = {};

    fieldNames.forEach((fieldName, index) => {
      obj[fieldName] = array[index];
    });

    if (array.length > fieldNames.length) {
      obj.unknownArgs = array.slice(fieldNames.length);
    }

    return obj;
  }

  disposeListeners() {
    this.disposers.forEach((disposer) => disposer());
    this.disposers = [];
  }

  formatEventLog({ eventName, eventSource, handlerArgs }) {
    const [event, ...args] = handlerArgs;
    if (typeof this.format === 'function') {
      return this.format({ args, event, eventName, eventSource });
    }

    const formatter = this.formatters[eventSource]?.[eventName];
    let formattedArgs = args;
    if (typeof formatter === 'function') {
      formattedArgs = formatter({ args, event, eventName, eventSource });
    }

    if (!formattedArgs) {
      return undefined;
    }

    const eventData = {};

    if (Array.isArray(formattedArgs)) {
      eventData.args = formattedArgs;
    } else if (typeof formattedArgs === 'object') {
      Object.assign(eventData, formattedArgs);
    }

    if (eventSource === 'webContents') {
      Object.assign(eventData, this.getWebContentsDetails(event?.sender));
    }

    const title = this.format
      .replace('{eventSource}', eventSource === 'app' ? 'App' : 'WebContents')
      .replace('{eventName}', eventName);

    return [title, eventData];
  }

  getEventNames(eventMap) {
    if (!eventMap || typeof eventMap !== 'object') {
      return [];
    }

    return Object.entries(eventMap)
      .filter(([_, listen]) => listen)
      .map(([eventName]) => eventName);
  }

  getWebContentsDetails(webContents) {
    if (!webContents?.loadURL) {
      return {};
    }

    try {
      return {
        webContents: {
          id: webContents.id,
          url: webContents.getURL(),
        },
      };
    } catch {
      return {};
    }
  }

  handleEvent({ eventName, eventSource, handlerArgs }) {
    const log = this.formatEventLog({ eventName, eventSource, handlerArgs });
    if (log) {
      const logFns = this.scope ? this.logger.scope(this.scope) : this.logger;
      logFns?.[this.level]?.(...log);
    }
  }
}

module.exports = EventLogger;
'use strict';

const NodeExternalApi = require('./NodeExternalApi');
const createDefaultLogger = require('./createDefaultLogger');

const externalApi = new NodeExternalApi();

const defaultLogger = createDefaultLogger({
  dependencies: { externalApi },
});

module.exports = defaultLogger;
'use strict';

/* eslint-disable no-unused-vars */

const childProcess = require('child_process');
const os = require('os');
const path = require('path');
const packageJson = require('./packageJson');

class NodeExternalApi {
  appName = undefined;
  appPackageJson = undefined;
  platform = process.platform;

  getAppLogPath(appName = this.getAppName()) {
    if (this.platform === 'darwin') {
      return path.join(this.getSystemPathHome(), 'Library/Logs', appName);
    }

    return path.join(this.getAppUserDataPath(appName), 'logs');
  }

  getAppName() {
    return this.appName || this.getAppPackageJson()?.name;
  }

  /**
   * @private
   * @returns {undefined}
   */
  getAppPackageJson() {
    if (typeof this.appPackageJson !== 'object') {
      this.appPackageJson = packageJson.findAndReadPackageJson();
    }

    return this.appPackageJson;
  }

  getAppUserDataPath(appName = this.getAppName()) {
    return appName
      ? path.join(this.getSystemPathAppData(), appName)
      : undefined;
  }

  getAppVersion() {
    return this.getAppPackageJson()?.version;
  }

  getElectronLogPath() {
    return this.getAppLogPath();
  }

  getMacOsVersion() {
    const release = Number(os.release().split('.')[0]);
    if (release <= 19) {
      return `10.${release - 4}`;
    }

    return release - 9;
  }

  /**
   * @protected
   * @returns {string}
   */
  getOsVersion() {
    let osName = os.type().replace('_', ' ');
    let osVersion = os.release();

    if (osName === 'Darwin') {
      osName = 'macOS';
      osVersion = this.getMacOsVersion();
    }

    return `${osName} ${osVersion}`;
  }

  /**
   * @return {PathVariables}
   */
  getPathVariables() {
    const appName = this.getAppName();
    const appVersion = this.getAppVersion();

    const self = this;

    return {
      appData: this.getSystemPathAppData(),
      appName,
      appVersion,
      get electronDefaultDir() {
        return self.getElectronLogPath();
      },
      home: this.getSystemPathHome(),
      libraryDefaultDir: this.getAppLogPath(appName),
      libraryTemplate: this.getAppLogPath('{appName}'),
      temp: this.getSystemPathTemp(),
      userData: this.getAppUserDataPath(appName),
    };
  }

  getSystemPathAppData() {
    const home = this.getSystemPathHome();

    switch (this.platform) {
      case 'darwin': {
        return path.join(home, 'Library/Application Support');
      }

      case 'win32': {
        return process.env.APPDATA || path.join(home, 'AppData/Roaming');
      }

      default: {
        return process.env.XDG_CONFIG_HOME || path.join(home, '.config');
      }
    }
  }

  getSystemPathHome() {
    return os.homedir?.() || process.env.HOME;
  }

  getSystemPathTemp() {
    return os.tmpdir();
  }

  getVersions() {
    return {
      app: `${this.getAppName()} ${this.getAppVersion()}`,
      electron: undefined,
      os: this.getOsVersion(),
    };
  }

  isDev() {
    return process.env.NODE_ENV === 'development'
      || process.env.ELECTRON_IS_DEV === '1';
  }

  isElectron() {
    return Boolean(process.versions.electron);
  }

  onAppEvent(_eventName, _handler) {
    // Ignored in node.js
  }

  onAppReady(handler) {
    handler();
  }

  onEveryWebContentsEvent(eventName, handler) {
    // Ignored in node.js
  }

  /**
   * Listen to async messages sent from opposite process
   * @param {string} channel
   * @param {function} listener
   */
  onIpc(channel, listener) {
    // Ignored in node.js
  }

  onIpcInvoke(channel, listener) {
    // Ignored in node.js
  }

  /**
   * @param {string} url
   * @param {Function} [logFunction]
   */
  openUrl(url, logFunction = console.error) { // eslint-disable-line no-console
    const startMap = { darwin: 'open', win32: 'start', linux: 'xdg-open' };
    const start = startMap[process.platform] || 'xdg-open';
    childProcess.exec(`${start} ${url}`, {}, (err) => {
      if (err) {
        logFunction(err);
      }
    });
  }

  setPlatform(platform) {
    this.platform = platform;
  }

  setPreloadFileForSessions({
    filePath, // eslint-disable-line no-unused-vars
    includeFutureSession = true, // eslint-disable-line no-unused-vars
    getSessions = () => [], // eslint-disable-line no-unused-vars
  }) {
    // Ignored in node.js
  }

  /**
   * Sent a message to opposite process
   * @param {string} channel
   * @param {any} message
   */
  sendIpc(channel, message) {
    // Ignored in node.js
  }

  showErrorBox(title, message) {
    // Ignored in node.js
  }
}

module.exports = NodeExternalApi;
'use strict';

const fs = require('fs');
const path = require('path');

module.exports = {
  findAndReadPackageJson,
  tryReadJsonAt,
};

/**
 * @return {{ name?: string, version?: string}}
 */
function findAndReadPackageJson() {
  return tryReadJsonAt(getMainModulePath())
    || tryReadJsonAt(extractPathFromArgs())
    || tryReadJsonAt(process.resourcesPath, 'app.asar')
    || tryReadJsonAt(process.resourcesPath, 'app')
    || tryReadJsonAt(process.cwd())
    || { name: undefined, version: undefined };
}

/**
 * @param {...string} searchPaths
 * @return {{ name?: string, version?: string } | undefined}
 */
function tryReadJsonAt(...searchPaths) {
  if (!searchPaths[0]) {
    return undefined;
  }

  try {
    const searchPath = path.join(...searchPaths);
    const fileName = findUp('package.json', searchPath);
    if (!fileName) {
      return undefined;
    }

    const json = JSON.parse(fs.readFileSync(fileName, 'utf8'));
    const name = json?.productName || json?.name;
    if (!name || name.toLowerCase() === 'electron') {
      return undefined;
    }

    if (name) {
      return { name, version: json?.version };
    }

    return undefined;
  } catch (e) {
    return undefined;
  }
}

/**
 * @param {string} fileName
 * @param {string} [cwd]
 * @return {string | null}
 */
function findUp(fileName, cwd) {
  let currentPath = cwd;
  // eslint-disable-next-line no-constant-condition
  while (true) {
    const parsedPath = path.parse(currentPath);
    const root = parsedPath.root;
    const dir = parsedPath.dir;

    if (fs.existsSync(path.join(currentPath, fileName))) {
      return path.resolve(path.join(currentPath, fileName));
    }

    if (currentPath === root) {
      return null;
    }

    currentPath = dir;
  }
}

/**
 * Get app path from --user-data-dir cmd arg, passed to a renderer process
 * @return {string|null}
 */
function extractPathFromArgs() {
  const matchedArgs = process.argv.filter((arg) => {
    return arg.indexOf('--user-data-dir=') === 0;
  });

  if (matchedArgs.length === 0 || typeof matchedArgs[0] !== 'string') {
    return null;
  }

  const userDataDir = matchedArgs[0];
  return userDataDir.replace('--user-data-dir=', '');
}

function getMainModulePath() {
  try {
    // Requires isn't available in ESM
    return require.main?.filename;
  } catch {
    return undefined;
  }
}
'use strict';

const format = require('../format');

describe('transform/format', () => {
  const message = {
    level: 'info',
    logId: 'default',
    data: ['test'],
    date: new Date('2000-01-01T01:01:01.000'),
    scope: 'test',
    variables: { myVar: 'myVarValue' },
  };

  describe('format', () => {
    it('should transform with string template', () => {
      const data = format.format({
        transport: { format: '{h}:{i}:{s} › {text}' },
        message,
      });
      expect(data).toEqual(['01:01:01 ›', 'test']);
    });

    it('should transform with callback', () => {
      const data = format.format({
        transport: { format: (args) => args.data },
        message,
      });

      expect(data).toEqual(['test']);
    });
  });

  describe('concatFirstStringElements', () => {
    it('when has no printf-like template', () => {
      expect(format.concatFirstStringElements({ data: ['one', 'two'] }))
        .toEqual(['one two']);
    });

    it('when has printf-like template', () => {
      expect(format.concatFirstStringElements({ data: ['val: %d', 2] }))
        .toEqual(['val: %d', 2]);
    });
  });

  describe('formatScope', () => {
    it('should set scope with padding', () => {
      const data = format.formatScope({
        data: ['{scope}', 1],
        logger: { scope: { labelLength: 6 } },
        message,
      });

      expect(data).toEqual([' (test)  ', 1]);
    });

    it('should set empty scope if defaultLabel is false', () => {
      const data = format.formatScope({
        data: ['{scope}', 1],
        logger: {
          scope: { labelLength: 6, defaultLabel: false },
        },
        message: { ...message, scope: undefined },
      });

      expect(data).toEqual(['', 1]);
    });

    it('should add blank padding if defaultLabel is empty string', () => {
      const data = format.formatScope({
        data: ['{scope}', 1],
        logger: {
          scope: {
            labelLength: 6,
            defaultLabel: '',
          },
        },
        message: { ...message, scope: undefined },
      });

      expect(data).toEqual(['         ', 1]);
    });
  });

  describe('formatText', () => {
    it('should remove template if it`s the latest variable', () => {
      expect(format.formatText({ data: ['log: {text}', 1] }))
        .toEqual(['log:', 1]);
    });

    it('should stringify all if it`s not the latest variable', () => {
      expect(format.formatText({ data: ['{text} log', 1] }))
        .toEqual([1, ' log']);
    });
  });

  describe('formatVariables', () => {
    describe('date', () => {
      it('should replace {y}-{m}-{d} date', () => {
        const data = format.formatVariables({
          data: ['{y}-{m}-{d} {h}:{i}:{s}.{ms}'],
          message,
        });
        expect(data).toEqual(['2000-01-01 01:01:01.000']);
      });

      it('should replace date iso', () => {
        const data = format.formatVariables({ data: ['{iso}'], message });
        expect(data[0]).toMatch(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.000Z$/);
      });
    });

    describe('level', () => {
      it('should replace just a level template', () => {
        expect(format.formatVariables({ data: ['{level}'], message }))
          .toEqual(['info']);
      });

      it('should replace level with align', () => {
        expect(format.formatVariables({ data: ['[{level}]~'], message }))
          .toEqual(['[info] ~']);
      });
    });

    it('should replace logId', () => {
      expect(format.formatVariables({ data: ['{logId}'], message }))
        .toEqual(['default']);
    });

    it('should replace custom variables', () => {
      expect(format.formatVariables({ data: ['{myVar}s', 1], message }))
        .toEqual(['myVarValues', 1]);
    });
  });

  it('timeZoneFromOffset', () => {
    expect(format.timeZoneFromOffset(-60)).toBe('+01:00');
    expect(format.timeZoneFromOffset(60)).toBe('-01:00');
    expect(format.timeZoneFromOffset(-570)).toBe('+09:30');
  });
});
'use strict';

const { maxDepth, serialize, toJSON, toString } = require('../object');

describe('transform/object', () => {
  describe('maxDepth', () => {
    it('should remove objects nested deeper than depth', () => {
      const data = [{ a: { b: {} } }];
      expect(maxDepth({ data, depth: 3 })).toEqual([{ a: { b: '[object]' } }]);
    });

    it('should correctly process null values', () => {
      const data = [{ a: null, b: undefined, c: { c1: null } }, null];
      expect(maxDepth({ data }))
        .toEqual([{ a: null, b: undefined, c: { c1: null } }, null]);
    });
  });

  describe('serialize', () => {
    it('should serialize object', () => {
      expect(serialize('', { a: 1 })).toEqual({ a: 1 });
    });

    it('should serialize errors', () => {
      expect(serialize('', new Error('test'))).toMatch('Error: test\n');
    });

    it('should serialize functions', () => {
      expect(serialize('', () => 1)).toEqual('[function] () => 1');
    });

    it('should serialize Date', () => {
      expect(serialize('', new Date('2000-01-01T00:00:00.000Z')))
        .toEqual('2000-01-01T00:00:00.000Z');
    });

    it('should serialize set', () => {
      expect(serialize('', new Set([1]))).toEqual([1]);
    });

    it('should serialize map', () => {
      if (Object.fromEntries) {
        expect(serialize('', new Map([['a', 1]]))).toEqual({ a: 1 });
      }
    });
  });

  describe('toJson', () => {
    it('should prevent circular reference exception', () => {
      const data = { a: 1 };
      data.b = data;
      const safeObj = maxDepth({ data });

      expect(() => { toJSON({ data: safeObj }) }).not.toThrow();
    });
  });

  describe('toString', () => {
    it('should not throw when stringify undefined value', () => {
      const error = new Error();
      delete error.stack;

      expect(() => { toString({ data: [error] }) }).not.toThrow();
    });

    it('should convert a set to a string representation', () => {
      const set = new Set([1]);
      expect(toString({ data: [set] })).toEqual('[ 1 ]');
    });
  });
});
'use strict';

const style = require('../style');

describe('transform/style', () => {
  it('applyAnsiStyles', () => {
    const data = style.applyAnsiStyles({
      data: ['%c 1 %c 2', 'color:red', 'color:green'],
    });

    expect(data)
      .toEqual(['\x1b[31m 1 \x1b[32m 2\x1b[0m']);
  });

  it('removeStyles', () => {
    const data = style.removeStyles({
      data: ['%c 1 %c 2', 'color:red', 'color:green'],
    });

    expect(data)
      .toEqual([' 1  2']);
  });

  describe('transformStyles', () => {
    function onStyleFound(s) {
      return `${s}: `;
    }

    it('simple data', () => {
      expect(style.transformStyles(['%c1 %c2', 'a', 'b'], onStyleFound))
        .toEqual(['a: 1 b: 2']);
    });

    it('missed styles', () => {
      expect(style.transformStyles(['%c1 %c2'], onStyleFound))
        .toEqual(['%c1 %c2']);
    });

    it('complex data', () => {
      function onStyleApplied(str) {
        return `${str} end`;
      }

      const data = ['%c1 %c2', 'a', '%c3', '%c4', 'b'];

      expect(style.transformStyles(data, onStyleFound, onStyleApplied))
        .toEqual(['a: 1 %c3: 2 end', 'b: 4 end']);
    });
  });
});
'use strict';

const { transform } = require('../transform');

describe('transform/transform', () => {
  it('passes the data through each transform', () => {
    const transformed = transform({
      message: { data: ['test'] },
      transforms: [({ data }) => [...data, 1]],
    });

    expect(transformed).toEqual(['test', 1]);
  });
});
'use strict';

const { transform } = require('./transform');

module.exports = {
  concatFirstStringElements,
  formatScope,
  formatText,
  formatVariables,
  timeZoneFromOffset,

  format({ message, logger, transport, data = message?.data }) {
    switch (typeof transport.format) {
      case 'string': {
        return transform({
          message,
          logger,
          transforms: [formatVariables, formatScope, formatText],
          transport,
          initialData: [transport.format, ...data],
        });
      }

      case 'function': {
        return transport.format({
          data,
          level: message?.level || 'info',
          logger,
          message,
          transport,
        });
      }

      default: {
        return data;
      }
    }
  },
};

/**
 * The first argument of console.log may contain a template. In the library
 * the first element is a string related to transports.console.format. So
 * this function concatenates first two elements to make templates like %d
 * work
 * @param {*[]} data
 * @return {*[]}
 */
function concatFirstStringElements({ data }) {
  if (typeof data[0] !== 'string' || typeof data[1] !== 'string') {
    return data;
  }

  if (data[0].match(/%[1cdfiOos]/)) {
    return data;
  }

  return [`${data[0]} ${data[1]}`, ...data.slice(2)];
}

function timeZoneFromOffset(minutesOffset) {
  const minutesPositive = Math.abs(minutesOffset);
  const sign = minutesOffset >= 0 ? '-' : '+';
  const hours = Math.floor(minutesPositive / 60).toString().padStart(2, '0');
  const minutes = (minutesPositive % 60).toString().padStart(2, '0');
  return `${sign}${hours}:${minutes}`;
}

function formatScope({ data, logger, message }) {
  const { defaultLabel, labelLength } = logger?.scope || {};
  const template = data[0];
  let label = message.scope;

  if (!label) {
    label = defaultLabel;
  }

  let scopeText;
  if (label === '') {
    scopeText = labelLength > 0 ? ''.padEnd(labelLength + 3) : '';
  } else if (typeof label === 'string') {
    scopeText = ` (${label})`.padEnd(labelLength + 3);
  } else {
    scopeText = '';
  }

  data[0] = template.replace('{scope}', scopeText);
  return data;
}

function formatVariables({ data, message }) {
  let template = data[0];
  if (typeof template !== 'string') {
    return data;
  }

  // Add additional space to the end of {level}] template to align messages
  template = template.replace('{level}]', `${message.level}]`.padEnd(6, ' '));

  const date = message.date || new Date();
  data[0] = template
    .replace(/\{(\w+)}/g, (substring, name) => {
      switch (name) {
        case 'level': return message.level || 'info';
        case 'logId': return message.logId;

        case 'y': return date.getFullYear().toString(10);
        case 'm': return (date.getMonth() + 1).toString(10).padStart(2, '0');
        case 'd': return date.getDate().toString(10).padStart(2, '0');
        case 'h': return date.getHours().toString(10).padStart(2, '0');
        case 'i': return date.getMinutes().toString(10).padStart(2, '0');
        case 's': return date.getSeconds().toString(10).padStart(2, '0');
        case 'ms': return date.getMilliseconds().toString(10).padStart(3, '0');
        case 'z': return timeZoneFromOffset(date.getTimezoneOffset());
        case 'iso': return date.toISOString();

        default: {
          return message.variables?.[name] || substring;
        }
      }
    })
    .trim();

  return data;
}

function formatText({ data }) {
  const template = data[0];
  if (typeof template !== 'string') {
    return data;
  }

  const textTplPosition = template.lastIndexOf('{text}');
  if (textTplPosition === template.length - 6) {
    data[0] = template.replace(/\s?{text}/, '');
    if (data[0] === '') {
      data.shift();
    }

    return data;
  }

  const templatePieces = template.split('{text}');
  let result = [];

  if (templatePieces[0] !== '') {
    result.push(templatePieces[0]);
  }

  result = result.concat(data.slice(1));

  if (templatePieces[1] !== '') {
    result.push(templatePieces[1]);
  }

  return result;
}
'use strict';

const util = require('util');

module.exports = {
  serialize,

  maxDepth({ data, transport, depth = transport?.depth ?? 6 }) {
    if (!data) {
      return data;
    }

    if (depth < 1) {
      if (Array.isArray(data)) return '[array]';
      if (typeof data === 'object' && data) return '[object]';

      return data;
    }

    if (Array.isArray(data)) {
      return data.map((child) => module.exports.maxDepth({
        data: child,
        depth: depth - 1,
      }));
    }

    if (typeof data !== 'object') {
      return data;
    }

    if (data && typeof data.toISOString === 'function') {
      return data;
    }

    // noinspection PointlessBooleanExpressionJS
    if (data === null) {
      return null;
    }

    if (data instanceof Error) {
      return data;
    }

    const newJson = {};
    for (const i in data) {
      if (!Object.prototype.hasOwnProperty.call(data, i)) continue;
      newJson[i] = module.exports.maxDepth({
        data: data[i],
        depth: depth - 1,
      });
    }

    return newJson;
  },

  toJSON({ data }) {
    return JSON.parse(JSON.stringify(data, createSerializer()));
  },

  toString({ data, transport }) {
    const inspectOptions = transport?.inspectOptions || {};

    const simplifiedData = data.map((item) => {
      if (item === undefined) {
        return undefined;
      }

      try {
        const str = JSON.stringify(item, createSerializer(), '  ');
        return str === undefined ? undefined : JSON.parse(str);
      } catch (e) {
        // There are some rare cases when an item can't be simplified.
        // In that case, it's fine to pass it to util.format directly.
        return item;
      }
    });

    return util.formatWithOptions(inspectOptions, ...simplifiedData);
  },
};

/**
 * @param {object} options?
 * @param {boolean} options.serializeMapAndSet?
 * @return {function}
 */
function createSerializer(options = {}) {
  const seen = new WeakSet();

  return function (key, value) {
    if (typeof value === 'object' && value !== null) {
      if (seen.has(value)) {
        return undefined;
      }

      seen.add(value);
    }

    return serialize(key, value, options);
  };
}

/**
 * @param {string} key
 * @param {any} value
 * @param {object} options?
 * @return {any}
 */
function serialize(key, value, options = {}) {
  const serializeMapAndSet = options?.serializeMapAndSet !== false;

  if (value instanceof Error) {
    return value.stack;
  }

  if (!value) {
    return value;
  }

  if (typeof value === 'function') {
    return `[function] ${value.toString()}`;
  }

  if (value instanceof Date) {
    return value.toISOString();
  }

  if (serializeMapAndSet && value instanceof Map && Object.fromEntries) {
    return Object.fromEntries(value);
  }

  if (serializeMapAndSet && value instanceof Set && Array.from) {
    return Array.from(value);
  }

  return value;
}
'use strict';

module.exports = {
  transformStyles,

  applyAnsiStyles({ data }) {
    return transformStyles(data, styleToAnsi, resetAnsiStyle);
  },

  removeStyles({ data }) {
    return transformStyles(data, () => '');
  },
};

const ANSI_COLORS = {
  unset: '\x1b[0m',
  black: '\x1b[30m',
  red: '\x1b[31m',
  green: '\x1b[32m',
  yellow: '\x1b[33m',
  blue: '\x1b[34m',
  magenta: '\x1b[35m',
  cyan: '\x1b[36m',
  white: '\x1b[37m',
};

function styleToAnsi(style) {
  const color = style.replace(/color:\s*(\w+).*/, '$1').toLowerCase();
  return ANSI_COLORS[color] || '';
}

function resetAnsiStyle(string) {
  return string + ANSI_COLORS.unset;
}

function transformStyles(data, onStyleFound, onStyleApplied) {
  const foundStyles = {};

  return data.reduce((result, item, index, array) => {
    if (foundStyles[index]) {
      return result;
    }

    if (typeof item === 'string') {
      let valueIndex = index;
      let styleApplied = false;

      item = item.replace(/%[1cdfiOos]/g, (match) => {
        valueIndex += 1;

        if (match !== '%c') {
          return match;
        }

        const style = array[valueIndex];
        if (typeof style === 'string') {
          foundStyles[valueIndex] = true;
          styleApplied = true;
          return onStyleFound(style, item);
        }

        return match;
      });

      if (styleApplied && onStyleApplied) {
        item = onStyleApplied(item);
      }
    }

    result.push(item);
    return result;
  }, []);
}
'use strict';

module.exports = { transform };

function transform({
  logger,
  message,
  transport,

  initialData = message?.data || [],
  transforms = transport?.transforms,
}) {
  return transforms.reduce((data, trans) => {
    if (typeof trans === 'function') {
      return trans({ data, logger, message, transport });
    }

    return data;
  }, initialData);
}
'use strict';

const consoleTransportFactory = require('../console');
const Logger = require('../../../core/Logger');

describe('Console transport', () => {
  describe('with default template', () => {
    it('prints "test" with styles enabled', () => {
      const [text] = transformMessage(['test'], {
        format: consoleTransportFactory.DEFAULT_FORMAT,
        useStyles: true,
      });
      expect(text).toMatch(
        // eslint-disable-next-line no-control-regex
        /^\x1b\[36m\d\d:\d\d:\d\d.\d\d\d\x1b\[0m .\x1b\[0m test$/,
      );
    });
  });

  describe('when text in the end of format', () => {
    it('should transform string with color', () => {
      const data = transformMessage(['%c red text', 'color: red']);
      expect(data).toEqual([' red text']);
    });

    it('should transform string with placeholder', () => {
      const data = transformMessage(['a is %d', 1]);
      expect(data).toEqual(['a is %d', 1]);
    });

    it('should transform string with color and placeholder', () => {
      const data = transformMessage([
        'a is %d, %c b is red',
        1,
        'color: red',
      ]);
      expect(data).toEqual(['a is %d,  b is red', 1]);
    });
  });

  describe('when text in the end of format, colored', () => {
    it('should transform string with color', () => {
      const data = transformMessage(['%c red text', 'color: red'], {
        useStyles: true,
      });

      expect(data).toEqual(['\x1b[31m red text\x1b[0m']);
    });

    it('should transform string with placeholder', () => {
      const data = transformMessage(['a is %d', 1], { useStyles: true });
      expect(data).toEqual(['a is %d', 1]);
    });

    it('should transform string with color and placeholder', () => {
      const data = transformMessage(
        ['a is %d, %c b is red', 1, 'color: red'],
        { useStyles: true },
      );
      expect(data).toEqual(['a is %d, \x1b[31m b is red\x1b[0m', 1]);
    });
  });

  describe('when text in the beginning of format', () => {
    it('should transform string with color', () => {
      const data = transformMessage(
        ['%c red text', 'color: red'],
        { format: '{text}.' },
      );
      expect(data).toEqual([' red text .']);
    });

    it('should transform string with placeholder', () => {
      const data = transformMessage(['a is %d', 1], { format: '{text}.' });
      expect(data).toEqual(['a is %d', 1, '.']);
    });

    it('should transform string with color and placeholder', () => {
      const data = transformMessage(
        ['a is %d, %c b is red', 1, 'color: red'],
        { format: '{text}.' },
      );

      expect(data).toEqual(['a is %d,  b is red', 1, '.']);
    });
  });
});

function transformMessage(data, consoleOptions = {}) {
  const log = new Logger({
    transportFactories: {
      console: consoleTransportFactory,
    },
  });

  let transformed = [];

  Object.assign(log.transports.console, {
    format: '{text}',
    useStyles: false,
    ...consoleOptions,
    writeFn({ message }) {
      transformed = message.data;
    },
  });

  log.info(...data);

  return transformed;
}
'use strict';

/* eslint-disable no-console */

const { concatFirstStringElements, format } = require('../transforms/format');
const { maxDepth, toJSON } = require('../transforms/object');
const { applyAnsiStyles, removeStyles } = require('../transforms/style');
const { transform } = require('../transforms/transform');

const consoleMethods = {
  error: console.error,
  warn: console.warn,
  info: console.info,
  verbose: console.info,
  debug: console.debug,
  silly: console.debug,
  log: console.log,
};

module.exports = consoleTransportFactory;

const separator = process.platform === 'win32' ? '>' : '›';
const DEFAULT_FORMAT = `%c{h}:{i}:{s}.{ms}{scope}%c ${separator} {text}`;

Object.assign(consoleTransportFactory, {
  DEFAULT_FORMAT,
});

function consoleTransportFactory(logger) {
  return Object.assign(transport, {
    format: DEFAULT_FORMAT,
    level: 'silly',
    transforms: [
      addTemplateColors,
      format,
      formatStyles,
      concatFirstStringElements,
      maxDepth,
      toJSON,
    ],
    useStyles: process.env.FORCE_STYLES,

    writeFn({ message }) {
      const consoleLogFn = consoleMethods[message.level] || consoleMethods.info;
      consoleLogFn(...message.data);
    },
  });

  function transport(message) {
    const data = transform({ logger, message, transport });
    transport.writeFn({
      message: { ...message, data },
    });
  }
}

function addTemplateColors({ data, message, transport }) {
  if (transport.format !== DEFAULT_FORMAT) {
    return data;
  }

  return [`color:${levelToStyle(message.level)}`, 'color:unset', ...data];
}

function canUseStyles(useStyleValue, level) {
  if (typeof useStyleValue === 'boolean') {
    return useStyleValue;
  }

  const useStderr = level === 'error' || level === 'warn';
  const stream = useStderr ? process.stderr : process.stdout;
  return stream && stream.isTTY;
}

function formatStyles(args) {
  const { message, transport } = args;
  const useStyles = canUseStyles(transport.useStyles, message.level);
  const nextTransform = useStyles ? applyAnsiStyles : removeStyles;
  return nextTransform(args);
}

function levelToStyle(level) {
  const map = { error: 'red', warn: 'yellow', info: 'cyan', default: 'unset' };
  return map[level] || map.default;
}
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');
const File = require('../File');
const makeTmpDir = require('./makeTmpDir');

describe('File', () => {
  const LICENSE_PATH = path.join(__dirname, '../../../../../LICENSE');
  const LICENSE_FILE_SIZE = 1082;

  afterEach(() => {
    makeTmpDir(false).remove();
  });

  describe('getSize', () => {
    it('should return size of an existed file', () => {
      const testFile = new File({ path: LICENSE_PATH });

      expect(testFile.size).toBe(LICENSE_FILE_SIZE);
    });

    it('should return size of an existed file + written bytes', () => {
      const testFile = new File({ path: LICENSE_PATH });
      testFile.bytesWritten = 1;

      expect(testFile.size).toBe(LICENSE_FILE_SIZE + 1);
    });
  });

  it('reset', () => {
    const testFile = new File({ path: LICENSE_PATH });

    testFile.initialSize = 0;
    testFile.bytesWritten = 1;
    testFile.reset();

    expect(testFile.size).toBe(LICENSE_FILE_SIZE);
  });

  describe('clear', () => {
    it('should remove file when exists', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.writeLine('test');

      expect(testFile.clear()).toBe(true);

      expect(fs.statSync(testFile.path).size).toBe(0);
    });

    it('should create an empty file when no file exists', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      expect(testFile.clear()).toBe(true);

      expect(fs.statSync(testFile.path).size).toBe(0);
    });
  });

  describe('crop', () => {
    it('should crop when file contains more than bytesAfter', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.writeLine('1'.repeat(4096));
      testFile.crop(7 + os.EOL.length);

      expect(fs.readFileSync(testFile.path, 'utf8'))
        .toEqual(`[log cropped]${os.EOL}1111111${os.EOL}${os.EOL}`);
    });

    it('should crop when file contains less than bytesAfter', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.writeLine('1'.repeat(4));
      testFile.crop(8);

      expect(fs.readFileSync(testFile.path, 'utf8'))
        .toEqual(`[log cropped]${os.EOL}1111${os.EOL}${os.EOL}`);
    });
  });

  describe('writeLine', () => {
    it('should write text to the file', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.writeLine('test');

      expect(fs.readFileSync(testFile.path, 'utf8')).toBe(`test${os.EOL}`);
    });

    it('should increase bytesWritten', () => {
      const tmpDir = makeTmpDir();
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.writeLine('test');

      expect(testFile.bytesWritten).toBe(4 + os.EOL.length);
    });

    it('should emit error if dir not exists', (done) => {
      const tmpDir = makeTmpDir(false);
      const testFile = new File({ path: path.join(tmpDir.path, 'test.txt') });

      testFile.on('error', (error) => {
        expect(error.message).toMatch('Couldn\'t write to ');
        done();
      });

      testFile.writeLine('test');
    });
  });
});
'use strict';

const fs = require('fs');
const path = require('path');
const FileRegistry = require('../FileRegistry');
const makeTmpDir = require('./makeTmpDir');

describe('FileRegistry', () => {
  afterEach(() => {
    makeTmpDir(false).remove();
  });

  describe('provide', () => {
    it('should create a new file if the path is correct', () => {
      const tmpDir = makeTmpDir();
      const registry = new FileRegistry();
      const testFile = registry.provide({
        filePath: path.join(tmpDir.path, 'log.txt'),
      });

      expect(testFile.isNull()).toBe(false);
      expect(fs.existsSync(testFile.path)).toBe(true);
    });

    it('should return the same instance on second call', () => {
      const tmpDir = makeTmpDir();
      const registry = new FileRegistry();
      const filePath = path.join(tmpDir.path, 'log.txt');
      const testFile = registry.provide({ filePath });

      expect(testFile.isNull()).toBe(false);
      expect(testFile).toBe(registry.provide({ filePath }));
    });

    it('should return null file when cannot resolve path', (done) => {
      const registry = new FileRegistry();

      registry.on('error', (e) => {
        expect(e.message).toMatch('string');
        done();
      });

      const testFile = registry.provide({ filePath: null });

      expect(testFile.isNull()).toBe(true);
    });
  });
});
'use strict';

const os = require('os');
const path = require('path');
const TestLogReader = require('../../../../__specs__/utils/TestLogReader');
const FileRegistry = require('../FileRegistry');
const fileTransportFactory = require('../index');
const makeTmpDir = require('./makeTmpDir');
const Logger = require('../../../../core/Logger');
const NodeExternalApi = require('../../../NodeExternalApi');

describe('File transport', () => {
  const TEST_MESSAGE = createMessage('test');
  const TEST_MESSAGE_SIZE = 38 + os.EOL.length;

  afterEach(() => {
    TestLogReader.removeDefaultLogDir('humile');
  });

  it('should create a file on first write', () => {
    const transport = createTransport();

    transport(TEST_MESSAGE);

    expect(TestLogReader.fromApp('humile').format()).toEqual(['test']);
  });

  it('should archive an old log', () => {
    const transport = createTransport();
    transport.maxSize = 20;

    transport(TEST_MESSAGE);
    expect(TestLogReader.fromApp('humile').format()).toEqual(['test']);

    transport(createMessage('test2'));
    expect(TestLogReader.fromApp('humile').format('{fileName}: {text}').sort())
      .toEqual(['main.log: test2', 'main.old.log: test']);
  });

  it('should allow to change file location', () => {
    const tmpDir = makeTmpDir(false);
    const logFilePath = path.join(tmpDir.path, 'mylog.txt');

    try {
      const transport = createTransport({
        resolvePathFn() { return logFilePath },
      });

      transport(TEST_MESSAGE);

      expect(TestLogReader.fromFile(logFilePath).format('{fileName}: {text}'))
        .toEqual(['mylog.txt: test']);
    } finally {
      tmpDir.remove();
    }
  });

  it('should provide access to the current file', () => {
    const transport = createTransport();

    transport(TEST_MESSAGE);
    const file = transport.getFile();

    expect(file.bytesWritten).toEqual(TEST_MESSAGE_SIZE);
    expect(file.size).toEqual(TEST_MESSAGE_SIZE);
    expect(file.path).toMatch('main.log');
  });

  it('should create a file if the path is UNC', () => {
    if (process.platform !== 'win32') {
      return;
    }

    const transport = createTransport({
      resolvePathFn(vars) {
        return `\\\\?\\${path.join(vars.libraryDefaultDir, vars.fileName)}`;
      },
    });

    transport(TEST_MESSAGE);

    expect(TestLogReader.fromApp('humile').format()).toEqual(['test']);
  });
});

function createTransport(options = {}) {
  const logger = new Logger({
    transportFactories: {
      // eslint-disable-next-line no-console
      console: () => console.log,
    },
  });
  const transport = fileTransportFactory(logger, {
    registry: new FileRegistry(),
    externalApi: new NodeExternalApi(),
  });

  Object.assign(transport, options);

  return transport;
}

function createMessage(data, level) {
  return {
    data: Array.isArray(data) ? data : [data],
    date: new Date(),
    level: level || 'info',
    variables: {},
  };
}
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');
const { rmDir } = require('../../../../__specs__/utils/fsHelpers');

module.exports = makeTmpDir;

function makeTmpDir(createFolderOnInit) {
  createFolderOnInit = createFolderOnInit === undefined || createFolderOnInit;
  const dirPath = path.join(os.tmpdir(), 'electron-log-tests');

  if (createFolderOnInit) {
    fs.mkdirSync(dirPath, { recursive: true });
  }

  return {
    path: dirPath,
    remove() {
      rmDir(this.path);
    },
  };
}
'use strict';

const NullFile = require('../NullFile');

describe('NullFile', () => {
  it('should not perform file operations', () => {
    const nullFile = new NullFile({ path: '/not-exists/1.txt' });

    nullFile.writeLine('test');
    expect(nullFile.size).toBe(0);
  });
});
'use strict';

const EventEmitter = require('events');
const fs = require('fs');
const os = require('os');

class File extends EventEmitter {
  asyncWriteQueue = [];
  bytesWritten = 0;
  hasActiveAsyncWriting = false;
  path = null;
  initialSize = undefined;
  writeOptions = null;
  writeAsync = false;

  constructor({
    path,
    writeOptions = { encoding: 'utf8', flag: 'a', mode: 0o666 },
    writeAsync = false,
  }) {
    super();

    this.path = path;
    this.writeOptions = writeOptions;
    this.writeAsync = writeAsync;
  }

  get size() {
    return this.getSize();
  }

  clear() {
    try {
      fs.writeFileSync(this.path, '', {
        mode: this.writeOptions.mode,
        flag: 'w',
      });
      this.reset();
      return true;
    } catch (e) {
      if (e.code === 'ENOENT') {
        return true;
      }

      this.emit('error', e, this);
      return false;
    }
  }

  crop(bytesAfter) {
    try {
      const content = readFileSyncFromEnd(this.path, bytesAfter || 4096);
      this.clear();
      this.writeLine(`[log cropped]${os.EOL}${content}`);
    } catch (e) {
      this.emit(
        'error',
        new Error(`Couldn't crop file ${this.path}. ${e.message}`),
        this,
      );
    }
  }

  getSize() {
    if (this.initialSize === undefined) {
      try {
        const stats = fs.statSync(this.path);
        this.initialSize = stats.size;
      } catch (e) {
        this.initialSize = 0;
      }
    }

    return this.initialSize + this.bytesWritten;
  }

  increaseBytesWrittenCounter(text) {
    this.bytesWritten += Buffer.byteLength(text, this.writeOptions.encoding);
  }

  isNull() {
    return false;
  }

  nextAsyncWrite() {
    const file = this;

    if (this.hasActiveAsyncWriting || this.asyncWriteQueue.length === 0) {
      return;
    }

    const text = this.asyncWriteQueue.join('');
    this.asyncWriteQueue = [];
    this.hasActiveAsyncWriting = true;

    fs.writeFile(this.path, text, this.writeOptions, (e) => {
      file.hasActiveAsyncWriting = false;

      if (e) {
        file.emit(
          'error',
          new Error(`Couldn't write to ${file.path}. ${e.message}`),
          this,
        );
      } else {
        file.increaseBytesWrittenCounter(text);
      }

      file.nextAsyncWrite();
    });
  }

  reset() {
    this.initialSize = undefined;
    this.bytesWritten = 0;
  }

  toString() {
    return this.path;
  }

  writeLine(text) {
    text += os.EOL;

    if (this.writeAsync) {
      this.asyncWriteQueue.push(text);
      this.nextAsyncWrite();
      return;
    }

    try {
      fs.writeFileSync(this.path, text, this.writeOptions);
      this.increaseBytesWrittenCounter(text);
    } catch (e) {
      this.emit(
        'error',
        new Error(`Couldn't write to ${this.path}. ${e.message}`),
        this,
      );
    }
  }
}

module.exports = File;

function readFileSyncFromEnd(filePath, bytesCount) {
  const buffer = Buffer.alloc(bytesCount);
  const stats = fs.statSync(filePath);

  const readLength = Math.min(stats.size, bytesCount);
  const offset = Math.max(0, stats.size - bytesCount);

  const fd = fs.openSync(filePath, 'r');
  const totalBytes = fs.readSync(fd, buffer, 0, readLength, offset);
  fs.closeSync(fd);

  return buffer.toString('utf8', 0, totalBytes);
}
'use strict';

const EventEmitter = require('events');
const fs = require('fs');
const path = require('path');
const File = require('./File');
const NullFile = require('./NullFile');

class FileRegistry extends EventEmitter {
  store = {};

  constructor() {
    super();
    this.emitError = this.emitError.bind(this);
  }

  /**
   * Provide a File object corresponding to the filePath
   * @param {string} filePath
   * @param {WriteOptions} [writeOptions]
   * @param {boolean} [writeAsync]
   * @return {File}
   */
  provide({ filePath, writeOptions, writeAsync = false }) {
    let file;
    try {
      filePath = path.resolve(filePath);

      if (this.store[filePath]) {
        return this.store[filePath];
      }

      file = this.createFile({ filePath, writeOptions, writeAsync });
    } catch (e) {
      file = new NullFile({ path: filePath });
      this.emitError(e, file);
    }

    file.on('error', this.emitError);
    this.store[filePath] = file;
    return file;
  }

  /**
   * @param {string} filePath
   * @param {WriteOptions} writeOptions
   * @param {boolean} async
   * @return {File}
   * @private
   */
  createFile({ filePath, writeOptions, writeAsync }) {
    this.testFileWriting(filePath);
    return new File({ path: filePath, writeOptions, writeAsync });
  }

  /**
   * @param {Error} error
   * @param {File} file
   * @private
   */
  emitError(error, file) {
    this.emit('error', error, file);
  }

  /**
   * @param {string} filePath
   * @private
   */
  testFileWriting(filePath) {
    fs.mkdirSync(path.dirname(filePath), { recursive: true });
    fs.writeFileSync(filePath, '', { flag: 'a' });
  }
}

module.exports = FileRegistry;
'use strict';

const fs = require('fs');
const os = require('os');
const path = require('path');
const FileRegistry = require('./FileRegistry');
const { transform } = require('../../transforms/transform');
const { removeStyles } = require('../../transforms/style');
const { format } = require('../../transforms/format');
const { toString } = require('../../transforms/object');

module.exports = fileTransportFactory;

// Shared between multiple file transport instances
const globalRegistry = new FileRegistry();

function fileTransportFactory(
  logger,
  { registry = globalRegistry, externalApi } = {},
) {
  /** @type {PathVariables} */
  let pathVariables;

  if (registry.listenerCount('error') < 1) {
    registry.on('error', (e, file) => {
      logConsole(`Can't write to ${file}`, e);
    });
  }

  return Object.assign(transport, {
    fileName: getDefaultFileName(logger.variables.processType),
    format: '[{y}-{m}-{d} {h}:{i}:{s}.{ms}] [{level}]{scope} {text}',
    getFile,
    inspectOptions: { depth: 5 },
    level: 'silly',
    maxSize: 1024 ** 2,
    readAllLogs,
    sync: true,
    transforms: [removeStyles, format, toString],
    writeOptions: { flag: 'a', mode: 0o666, encoding: 'utf8' },

    archiveLogFn(file) {
      const oldPath = file.toString();
      const inf = path.parse(oldPath);
      try {
        fs.renameSync(oldPath, path.join(inf.dir, `${inf.name}.old${inf.ext}`));
      } catch (e) {
        logConsole('Could not rotate log', e);
        const quarterOfMaxSize = Math.round(transport.maxSize / 4);
        file.crop(Math.min(quarterOfMaxSize, 256 * 1024));
      }
    },

    resolvePathFn(vars) {
      return path.join(vars.libraryDefaultDir, vars.fileName);
    },
  });

  function transport(message) {
    const file = getFile(message);

    const needLogRotation = transport.maxSize > 0
      && file.size > transport.maxSize;

    if (needLogRotation) {
      transport.archiveLogFn(file);
      file.reset();
    }

    const content = transform({ logger, message, transport });
    file.writeLine(content);
  }

  function initializeOnFirstAccess() {
    if (pathVariables) {
      return;
    }

    // Make a shallow copy of pathVariables to keep getters intact
    pathVariables = Object.create(
      Object.prototype,
      {
        ...Object.getOwnPropertyDescriptors(
          externalApi.getPathVariables(),
        ),
        fileName: {
          get() {
            return transport.fileName;
          },
          enumerable: true,
        },
      },
    );

    if (typeof transport.archiveLog === 'function') {
      transport.archiveLogFn = transport.archiveLog;
      logConsole('archiveLog is deprecated. Use archiveLogFn instead');
    }

    if (typeof transport.resolvePath === 'function') {
      transport.resolvePathFn = transport.resolvePath;
      logConsole('resolvePath is deprecated. Use resolvePathFn instead');
    }
  }

  function logConsole(message, error = null, level = 'error') {
    const data = [`electron-log.transports.file: ${message}`];

    if (error) {
      data.push(error);
    }

    logger.transports.console({ data, date: new Date(), level });
  }

  function getFile(msg) {
    initializeOnFirstAccess();

    const filePath = transport.resolvePathFn(pathVariables, msg);
    return registry.provide({
      filePath,
      writeAsync: !transport.sync,
      writeOptions: transport.writeOptions,
    });
  }

  function readAllLogs({ fileFilter = (f) => f.endsWith('.log') } = {}) {
    initializeOnFirstAccess();
    const logsPath = path.dirname(transport.resolvePathFn(pathVariables));

    if (!fs.existsSync(logsPath)) {
      return [];
    }

    return fs.readdirSync(logsPath)
      .map((fileName) => path.join(logsPath, fileName))
      .filter(fileFilter)
      .map((logPath) => {
        try {
          return {
            path: logPath,
            lines: fs.readFileSync(logPath, 'utf8').split(os.EOL),
          };
        } catch {
          return null;
        }
      })
      .filter(Boolean);
  }
}

function getDefaultFileName(processType = process.type) {
  switch (processType) {
    case 'renderer': return 'renderer.log';
    case 'worker': return 'worker.log';
    default: return 'main.log';
  }
}
'use strict';

const File = require('./File');

class NullFile extends File {
  clear() {

  }

  crop() {

  }

  getSize() {
    return 0;
  }

  isNull() {
    return true;
  }

  writeLine() {

  }
}

module.exports = NullFile;
'use strict';

const { maxDepth, toJSON } = require('../transforms/object');
const { transform } = require('../transforms/transform');

module.exports = ipcTransportFactory;

/**
 * @param logger
 * @param {ElectronExternalApi} externalApi
 * @returns {transport|null}
 */
function ipcTransportFactory(logger, { externalApi }) {
  Object.assign(transport, {
    depth: 3,
    eventId: '__ELECTRON_LOG_IPC__',
    level: logger.isDev ? 'silly' : false,
    transforms: [toJSON, maxDepth],
  });

  return externalApi?.isElectron() ? transport : undefined;

  function transport(message) {
    if (message?.variables?.processType === 'renderer') {
      return;
    }

    externalApi?.sendIpc(transport.eventId, {
      ...message,
      data: transform({ logger, message, transport }),
    });
  }
}
'use strict';

const http = require('http');
const https = require('https');
const { transform } = require('../transforms/transform');
const { removeStyles } = require('../transforms/style');
const { toJSON, maxDepth } = require('../transforms/object');

module.exports = remoteTransportFactory;

function remoteTransportFactory(logger) {
  return Object.assign(transport, {
    client: { name: 'electron-application' },
    depth: 6,
    level: false,
    requestOptions: {},
    transforms: [removeStyles, toJSON, maxDepth],

    makeBodyFn({ message }) {
      return JSON.stringify({
        client: transport.client,
        data: message.data,
        date: message.date.getTime(),
        level: message.level,
        scope: message.scope,
        variables: message.variables,
      });
    },

    processErrorFn({ error }) {
      logger.processMessage(
        {
          data: [`electron-log: can't POST ${transport.url}`, error],
          level: 'warn',
        },
        { transports: ['console', 'file'] },
      );
    },

    sendRequestFn({ serverUrl, requestOptions, body }) {
      const httpTransport = serverUrl.startsWith('https:') ? https : http;

      const request = httpTransport.request(serverUrl, {
        method: 'POST',
        ...requestOptions,
        headers: {
          'Content-Type': 'application/json',
          'Content-Length': body.length,
          ...requestOptions.headers,
        },
      });

      request.write(body);
      request.end();

      return request;
    },
  });

  function transport(message) {
    if (!transport.url) {
      return;
    }

    const body = transport.makeBodyFn({
      logger,
      message: { ...message, data: transform({ logger, message, transport }) },
      transport,
    });

    const request = transport.sendRequestFn({
      serverUrl: transport.url,
      requestOptions: transport.requestOptions,
      body: Buffer.from(body, 'utf8'),
    });

    request.on('error', (error) => transport.processErrorFn({
      error,
      logger,
      message,
      request,
      transport,
    }));
  }
}
'use strict';

const log = require('..');

describe('index', () => {
  describe('serialize', () => {
    const serialize = log.transports.ipc.serializeFn;

    it('should stringify functions', () => {
      const obj = { fn: () => {} };
      expect(serialize(obj)).toEqual({
        fn: '() => {}',
      });
    });

    it('should skip Promises, WeakMaps, WeakSets', () => {
      const obj = {
        promise: Promise.resolve(),
        weakMap: new WeakMap(),
        weakSet: new WeakSet(),
      };

      expect(serialize(obj)).toEqual({
        promise: '[Promise]',
        weakMap: '[WeakMap]',
        weakSet: '[WeakSet]',
      });
    });

    it('should keep cycle references', () => {
      const obj = { prop: {} };
      obj.prop.self = obj;

      const serialized = serialize(obj);

      expect(serialized === serialized.prop.self);
    });

    it('should iterate objects', () => {
      expect(serialize({ object: { wm: new WeakMap() } })).toEqual({
        object: { wm: '[WeakMap]' },
      });
    });

    it('should iterate arrays', () => {
      expect(serialize({ array: [new WeakMap()] })).toEqual({
        array: ['[WeakMap]'],
      });
    });

    it('should iterate sets', () => {
      expect(serialize({ set: new Set([new WeakMap()]) })).toEqual({
        set: new Set(['[WeakMap]']),
      });
    });

    it('should iterate maps', () => {
      expect(serialize({ map: new Map([[new WeakMap(), new WeakSet()]]) }))
        .toEqual({ map: new Map([['[WeakMap]', '[WeakSet]']]) });
    });
  });

  describe('formatDataFn', () => {
    const formatDataFn = log.transports.console.formatDataFn;

    describe('when text in the end of format', () => {
      it('should keep unchanged string with color', () => {
        const data = formatDataFn({
          format: '{text}',
          data: ['%c red text', 'color: red'],
        });

        expect(data).toEqual(['%c red text', 'color: red']);
      });

      it('should keep placeholders', () => {
        const data = formatDataFn({
          format: '{text}',
          data: ['a is %d', 1],
        });

        expect(data).toEqual(['a is %d', 1]);
      });

      it('should keep colors and placeholder', () => {
        const data = formatDataFn({
          format: '{text}',
          data: ['a is %d, %c b is red', 1, 'color: red'],
        });

        expect(data).toEqual(['a is %d, %c b is red', 1, 'color: red']);
      });
    });

    it('should concatenate printf-like templates', () => {
      expect(formatDataFn({ data: ['%d', 1], format: '{text}' }))
        .toEqual(['%d', 1]);
      expect(formatDataFn({ data: ['d', 1], format: '{text}' }))
        .toEqual(['', 'd', 1]);
    });

    it('should support level', () => {
      expect(formatDataFn({ format: '{level}', level: 'info' }))
        .toEqual(['info']);
    });

    it('should support scope', () => {
      expect(formatDataFn({ format: '{scope}', scope: 'test' }))
        .toEqual(['(test)']);
    });

    describe('format time', () => {
      it('normal', () => {
        const data = formatDataFn({
          format: '{y}.{m}.{d} {h}:{i}:{s}.{ms}',
          date: new Date('2000-12-01T03:00:00.000'),
        });
        expect(data).toEqual(['2000.12.01 03:00:00.000']);
      });

      it('iso', () => {
        const data = formatDataFn({
          format: '{iso}',
          date: new Date('2000-12-01T03:00:00.000Z'),
        });
        expect(data).toEqual(['2000-12-01T03:00:00.000Z']);
      });
    });
  });
});
'use strict';

module.exports = {
  env: {
    browser: true,
  },

  globals: {
    __electronLog: true,
  },

  rules: {
    'no-underscore-dangle': ['error', {
      allow: ['__electronLog'],
    }],
  },
};
'use strict';

let electron = {};

try {
  // eslint-disable-next-line global-require,import/no-extraneous-dependencies
  electron = require('electron');
} catch (e) {
  // require isn't available, not from a preload script
}

if (electron.ipcRenderer) {
  initialize(electron);
}

if (typeof module === 'object') {
  module.exports = initialize;
}

/**
 * @param {Electron.ContextBridge} contextBridge
 * @param {Electron.IpcRenderer} ipcRenderer
 */
function initialize({ contextBridge, ipcRenderer }) {
  if (!ipcRenderer) {
    return;
  }

  ipcRenderer.on('__ELECTRON_LOG_IPC__', (_, message) => {
    window.postMessage({ cmd: 'message', ...message });
  });

  ipcRenderer
    .invoke('__ELECTRON_LOG__', { cmd: 'getOptions' })
    // eslint-disable-next-line no-console
    .catch((e) => console.error(new Error(
      'electron-log isn\'t initialized in the main process. '
      + `Please call log.initialize() before. ${e.message}`,
    )));

  const electronLog = {
    sendToMain(message) {
      try {
        ipcRenderer.send('__ELECTRON_LOG__', message);
      } catch (e) {
        // eslint-disable-next-line no-console
        console.error('electronLog.sendToMain ', e, 'data:', message);

        ipcRenderer.send('__ELECTRON_LOG__', {
          cmd: 'errorHandler',
          error: { message: e?.message, stack: e?.stack },
          errorName: 'sendToMain',
        });
      }
    },

    log(...data) {
      electronLog.sendToMain({ data, level: 'info' });
    },
  };

  for (const level of ['error', 'warn', 'info', 'verbose', 'debug', 'silly']) {
    electronLog[level] = (...data) => electronLog.sendToMain({
      data,
      level,
    });
  }

  if (contextBridge && process.contextIsolated) {
    try {
      contextBridge.exposeInMainWorld('__electronLog', electronLog);
    } catch {
      // Sometimes this files can be included twice
    }
  }

  if (typeof window === 'object') {
    window.__electronLog = electronLog;
  } else {
    // noinspection JSConstantReassignment
    __electronLog = electronLog;
  }
}
'use strict';

const Logger = require('../core/Logger');
const RendererErrorHandler = require('./lib/RendererErrorHandler');
const transportConsole = require('./lib/transports/console');
const transportIpc = require('./lib/transports/ipc');

module.exports = createLogger();
module.exports.Logger = Logger;
module.exports.default = module.exports;

function createLogger() {
  const logger = new Logger({
    allowUnknownLevel: true,
    errorHandler: new RendererErrorHandler(),
    initializeFn: () => {},
    logId: 'default',
    transportFactories: {
      console: transportConsole,
      ipc: transportIpc,
    },
    variables: {
      processType: 'renderer',
    },
  });

  logger.errorHandler.setOptions({
    logFn({ error, errorName, showDialog }) {
      logger.transports.console({
        data: [errorName, error].filter(Boolean),
        level: 'error',
      });
      logger.transports.ipc({
        cmd: 'errorHandler',
        error: {
          cause: error?.cause,
          code: error?.code,
          name: error?.name,
          message: error?.message,
          stack: error?.stack,
        },
        errorName,
        logId: logger.logId,
        showDialog,
      });
    },
  });

  if (typeof window === 'object') {
    window.addEventListener('message', (event) => {
      const { cmd, logId, ...message } = event.data || {};
      const instance = Logger.getInstance({ logId });

      if (cmd === 'message') {
        instance.processMessage(message, { transports: ['console'] });
      }
    });
  }

  // To support custom levels
  return new Proxy(logger, {
    get(target, prop) {
      if (typeof target[prop] !== 'undefined') {
        return target[prop];
      }

      return (...data) => logger.logData(data, { level: prop });
    },
  });
}
'use strict';

// eslint-disable-next-line no-console
const consoleError = console.error;

class RendererErrorHandler {
  logFn = null;
  onError = null;
  showDialog = false;
  preventDefault = true;

  constructor({ logFn = null } = {}) {
    this.handleError = this.handleError.bind(this);
    this.handleRejection = this.handleRejection.bind(this);
    this.startCatching = this.startCatching.bind(this);
    this.logFn = logFn;
  }

  handle(error, {
    logFn = this.logFn,
    errorName = '',
    onError = this.onError,
    showDialog = this.showDialog,
  } = {}) {
    try {
      if (onError?.({ error, errorName, processType: 'renderer' }) !== false) {
        logFn({ error, errorName, showDialog });
      }
    } catch {
      consoleError(error);
    }
  }

  setOptions({ logFn, onError, preventDefault, showDialog }) {
    if (typeof logFn === 'function') {
      this.logFn = logFn;
    }

    if (typeof onError === 'function') {
      this.onError = onError;
    }

    if (typeof preventDefault === 'boolean') {
      this.preventDefault = preventDefault;
    }

    if (typeof showDialog === 'boolean') {
      this.showDialog = showDialog;
    }
  }

  startCatching({ onError, showDialog } = {}) {
    if (this.isActive) {
      return;
    }

    this.isActive = true;
    this.setOptions({ onError, showDialog });

    window.addEventListener('error', (event) => {
      this.preventDefault && event.preventDefault?.();
      this.handleError(event.error || event);
    });
    window.addEventListener('unhandledrejection', (event) => {
      this.preventDefault && event.preventDefault?.();
      this.handleRejection(event.reason || event);
    });
  }

  handleError(error) {
    this.handle(error, { errorName: 'Unhandled' });
  }

  handleRejection(reason) {
    const error = reason instanceof Error
      ? reason
      : new Error(JSON.stringify(reason));
    this.handle(error, { errorName: 'Unhandled rejection' });
  }
}

module.exports = RendererErrorHandler;
'use strict';

/* eslint-disable no-console */

module.exports = consoleTransportRendererFactory;

const consoleMethods = {
  error: console.error,
  warn: console.warn,
  info: console.info,
  verbose: console.info,
  debug: console.debug,
  silly: console.debug,
  log: console.log,
};

function consoleTransportRendererFactory(logger) {
  return Object.assign(transport, {
    format: '{h}:{i}:{s}.{ms}{scope} › {text}',

    formatDataFn({
      data = [],
      date = new Date(),
      format = transport.format,
      logId = logger.logId,
      scope = logger.scopeName,
      ...message
    }) {
      if (typeof format === 'function') {
        return format({ ...message, data, date, logId, scope });
      }

      if (typeof format !== 'string') {
        return data;
      }

      data.unshift(format);

      // Concatenate first two data items to support printf-like templates
      if (typeof data[1] === 'string' && data[1].match(/%[1cdfiOos]/)) {
        data = [`${data[0]} ${data[1]}`, ...data.slice(2)];
      }

      data[0] = data[0]
        .replace(/\{(\w+)}/g, (substring, name) => {
          switch (name) {
            case 'level': return message.level;
            case 'logId': return logId;
            case 'scope': return scope ? ` (${scope})` : '';
            case 'text': return '';

            case 'y': return date.getFullYear().toString(10);
            case 'm': return (date.getMonth() + 1).toString(10)
              .padStart(2, '0');
            case 'd': return date.getDate().toString(10).padStart(2, '0');
            case 'h': return date.getHours().toString(10).padStart(2, '0');
            case 'i': return date.getMinutes().toString(10).padStart(2, '0');
            case 's': return date.getSeconds().toString(10).padStart(2, '0');
            case 'ms': return date.getMilliseconds().toString(10)
              .padStart(3, '0');
            case 'iso': return date.toISOString();

            default: {
              return message.variables?.[name] || substring;
            }
          }
        })
        .trim();

      return data;
    },

    writeFn({ message: { level, data } }) {
      const consoleLogFn = consoleMethods[level] || consoleMethods.info;

      // make an empty call stack
      setTimeout(() => consoleLogFn(...data));
    },

  });

  function transport(message) {
    transport.writeFn({
      message: { ...message, data: transport.formatDataFn(message) },
    });
  }
}
'use strict';

module.exports = ipcTransportRendererFactory;

const RESTRICTED_TYPES = new Set([Promise, WeakMap, WeakSet]);

function ipcTransportRendererFactory(logger) {
  return Object.assign(transport, {
    depth: 5,

    serializeFn(data, { depth = 5, seen = new WeakSet() } = {}) {
      if (seen.has(data)) {
        return '[Circular]';
      }

      if (depth < 1) {
        if (isPrimitive(data)) {
          return data;
        }

        if (Array.isArray(data)) {
          return '[Array]';
        }

        return `[${typeof data}]`;
      }

      if (['function', 'symbol'].includes(typeof data)) {
        return data.toString();
      }

      if (isPrimitive(data)) {
        return data;
      }

      // Object types

      if (RESTRICTED_TYPES.has(data.constructor)) {
        return `[${data.constructor.name}]`;
      }

      if (Array.isArray(data)) {
        return data.map((item) => transport.serializeFn(
          item,
          { depth: depth - 1, seen },
        ));
      }

      if (data instanceof Date) {
        return data.toISOString();
      }

      if (data instanceof Error) {
        return data.stack;
      }

      if (data instanceof Map) {
        return new Map(
          Array
            .from(data)
            .map(([key, value]) => [
              transport.serializeFn(key, { depth: depth - 1, seen }),
              transport.serializeFn(value, { depth: depth - 1, seen }),
            ]),
        );
      }

      if (data instanceof Set) {
        return new Set(
          Array.from(data).map(
            (val) => transport.serializeFn(val, { depth: depth - 1, seen }),
          ),
        );
      }

      seen.add(data);

      return Object.fromEntries(
        Object.entries(data).map(
          ([key, value]) => [
            key,
            transport.serializeFn(value, { depth: depth - 1, seen }),
          ],
        ),
      );
    },
  });

  function transport(message) {
    if (!window.__electronLog) {
      logger.processMessage(
        {
          data: ['electron-log: logger isn\'t initialized in the main process'],
          level: 'error',
        },
        { transports: ['console'] },
      );
      return;
    }

    try {
      __electronLog.sendToMain(transport.serializeFn(message, {
        depth: transport.depth,
      }));
    } catch (e) {
      logger.transports.console({
        data: ['electronLog.transports.ipc', e, 'data:', message.data],
        level: 'error',
      });
    }
  }
}

/**
 * Is type primitive, including null and undefined
 * @param {any} value
 * @returns {boolean}
 */
function isPrimitive(value) {
  return Object(value) !== value;
}
{
  "extends": "mongodb-js/node"
}
{
  "preset": "default",
  "plugins": [
        "esformatter-quotes",
        "esformatter-semicolons",
        "esformatter-braces"
    ],
    "quotes": {
        "type": "single",
        "avoidEscape": false
    },
    "indent": {
        "value": "  "
    },
    "whiteSpace" : {
    "value" : " ",
    "removeTrailing" : 1,

    "before" : {
      "ArrayExpressionOpening" : 0,
      "ArrayExpressionClosing" : 0,
      "ArrayExpressionComma" : 0,
      "ArgumentComma" : 0,
      "ArgumentList" : 0,
      "ArgumentListArrayExpression" : 0,
      "ArgumentListFunctionExpression" : 0,
      "ArgumentListObjectExpression" : 0,
      "AssignmentOperator" : 1,
      "BinaryExpression": 0,
      "BinaryExpressionOperator" : 1,
      "BlockComment" : 1,
      "CallExpression" : -1,
      "CatchParameterList" : 0,
      "CatchOpeningBrace" : 1,
      "CatchClosingBrace" : 1,
      "CatchKeyword" : 1,
      "CommaOperator" : 0,
      "ConditionalExpressionConsequent" : 1,
      "ConditionalExpressionAlternate" : 1,
      "DoWhileStatementOpeningBrace" : 1,
      "DoWhileStatementClosingBrace" : 1,
      "DoWhileStatementConditional" : 1,
      "EmptyStatement" : 0,
      "ExpressionClosingParentheses" : 0,
      "FinallyKeyword" : -1,
      "FinallyOpeningBrace" : 1,
      "FinallyClosingBrace" : 1,
      "ForInStatement" : 1,
      "ForInStatementExpressionOpening" : 1,
      "ForInStatementExpressionClosing" : 0,
      "ForInStatementOpeningBrace" : 1,
      "ForInStatementClosingBrace" : 1,
      "ForStatement" : 1,
      "ForStatementExpressionOpening" : 1,
      "ForStatementExpressionClosing" : 0,
      "ForStatementOpeningBrace" : 1,
      "ForStatementClosingBrace" : 1,
      "ForStatementSemicolon" : 0,
      "FunctionDeclarationOpeningBrace" : 1,
      "FunctionDeclarationClosingBrace" : 1,
      "FunctionExpressionOpeningBrace" : 1,
      "FunctionExpressionClosingBrace" : 1,
      "IfStatementConditionalOpening" : 1,
      "IfStatementConditionalClosing" : 0,
      "IfStatementOpeningBrace" : 1,
      "IfStatementClosingBrace" : 1,
      "ElseStatementOpeningBrace" : 1,
      "ElseStatementClosingBrace" : 1,
      "ElseIfStatementOpeningBrace" : 1,
      "ElseIfStatementClosingBrace" : 1,
      "MemberExpressionClosing" : 0,
      "LineComment" : 1,
      "LogicalExpressionOperator" : 1,
      "Property" : 1,
      "PropertyValue" : 1,
      "ParameterComma" : 0,
      "ParameterList" : 0,
      "SwitchDiscriminantOpening" : 1,
      "SwitchDiscriminantClosing" : 0,
      "ThrowKeyword": 1,
      "TryKeyword": -1,
      "TryOpeningBrace" : 1,
      "TryClosingBrace" : 1,
      "UnaryExpressionOperator": 0,
      "VariableName" : 1,
      "VariableValue" : 1,
      "WhileStatementConditionalOpening" : 1,
      "WhileStatementConditionalClosing" : 0,
      "WhileStatementOpeningBrace" : 1,
      "WhileStatementClosingBrace" : 1
    },

    "after" : {
      "ArrayExpressionOpening" : 0,
      "ArrayExpressionClosing" : 0,
      "ArrayExpressionComma" : 1,
      "ArgumentComma" : 1,
      "ArgumentList" : 0,
      "ArgumentListArrayExpression" : 0,
      "ArgumentListFunctionExpression" : 0,
      "ArgumentListObjectExpression" : 0,
      "AssignmentOperator" : 1,
      "BinaryExpression": 0,
      "BinaryExpressionOperator" : 1,
      "BlockComment" : 1,
      "CallExpression" : 0,
      "CatchParameterList" : 0,
      "CatchOpeningBrace" : 1,
      "CatchClosingBrace" : 1,
      "CatchKeyword" : 1,
      "CommaOperator" : 1,
      "ConditionalExpressionConsequent" : 1,
      "ConditionalExpressionTest" : 1,
      "DoWhileStatementOpeningBrace" : 1,
      "DoWhileStatementClosingBrace" : 1,
      "DoWhileStatementBody" : 1,
      "EmptyStatement" : 0,
      "ExpressionOpeningParentheses" : 0,
      "FinallyKeyword" : -1,
      "FinallyOpeningBrace" : 1,
      "FinallyClosingBrace" : 1,
      "ForInStatement" : 1,
      "ForInStatementExpressionOpening" : 0,
      "ForInStatementExpressionClosing" : 1,
      "ForInStatementOpeningBrace" : 1,
      "ForInStatementClosingBrace" : 1,
      "ForStatement" : 1,
      "ForStatementExpressionOpening" : 0,
      "ForStatementExpressionClosing" : 1,
      "ForStatementClosingBrace" : 1,
      "ForStatementOpeningBrace" : 1,
      "ForStatementSemicolon" : 1,
      "FunctionReservedWord": 0,
      "FunctionName" : 0,
      "FunctionExpressionOpeningBrace" : 1,
      "FunctionExpressionClosingBrace" : 0,
      "FunctionDeclarationOpeningBrace" : 0,
      "FunctionDeclarationClosingBrace" : 0,
      "IfStatementConditionalOpening" : 0,
      "IfStatementConditionalClosing" : 1,
      "IfStatementOpeningBrace" : 1,
      "IfStatementClosingBrace" : 1,
      "ElseStatementOpeningBrace" : 1,
      "ElseStatementClosingBrace" : 1,
      "ElseIfStatementOpeningBrace" : 1,
      "ElseIfStatementClosingBrace" : 1,
      "MemberExpressionOpening" : 0,
      "LogicalExpressionOperator" : 1,
      "ObjectExpressionClosingBrace": 0,
      "PropertyName" : 0,
      "PropertyValue" : 0,
      "ParameterComma" : 1,
      "ParameterList" : 0,
      "SwitchDiscriminantOpening" : 0,
      "SwitchDiscriminantClosing" : 1,
      "ThrowKeyword": 1,
      "TryKeyword": -1,
      "TryOpeningBrace" : 1,
      "TryClosingBrace" : 1,
      "UnaryExpressionOperator": 0,
      "VariableName" : 1,
      "WhileStatementConditionalOpening" : 0,
      "WhileStatementConditionalClosing" : 1,
      "WhileStatementOpeningBrace" : 1,
      "WhileStatementClosingBrace" : 1
    }
  }
}
node_modules/
*.log
.DS_Store
sudo: false
language: node_js
node_js:
  - 5
script: npm run ci
cache:
  directories:
  - node_modules
init:
  - git config --global core.autocrlf input

environment:
  matrix:
    - nodejs_version: 0.12

install:
  - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version)
  - npm install

build: off

test_script:
  - node --version
  - npm --version
  - ps: npm run ci
var path = require('path');
var spawn = require('child_process').spawn;
var debug = require('debug')('electron-squirrel-startup');
var app = require('electron').app;

var run = function(args, done) {
  var updateExe = path.resolve(path.dirname(process.execPath), '..', 'Update.exe');
  debug('Spawning `%s` with args `%s`', updateExe, args);
  spawn(updateExe, args, {
    detached: true
  }).on('close', done);
};

var check = function() {
  if (process.platform === 'win32') {
    var cmd = process.argv[1];
    debug('processing squirrel command `%s`', cmd);
    var target = path.basename(process.execPath);

    if (cmd === '--squirrel-install' || cmd === '--squirrel-updated') {
      run(['--createShortcut=' + target + ''], app.quit);
      return true;
    }
    if (cmd === '--squirrel-uninstall') {
      run(['--removeShortcut=' + target + ''], app.quit);
      return true;
    }
    if (cmd === '--squirrel-obsolete') {
      app.quit();
      return true;
    }
  }
  return false;
};

module.exports = check();
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!)  The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
{
  "env": {
    "browser": true,
    "node": true
  },
  "rules": {
    "no-console": 0,
    "no-empty": [1, { "allowEmptyCatch": true }]
  },
  "extends": "eslint:recommended"
}
support
test
examples
example
*.sock
dist
yarn.lock
coverage
bower.json

language: node_js
node_js:
  - "6"
  - "5"
  - "4"

install:
  - make node_modules

script:
  - make lint
  - make test
  - make coveralls

2.6.9 / 2017-09-22
==================

  * remove ReDoS regexp in %o formatter (#504)

2.6.8 / 2017-05-18
==================

  * Fix: Check for undefined on browser globals (#462, @marbemac)

2.6.7 / 2017-05-16
==================

  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
  * Fix: Inline extend function in node implementation (#452, @dougwilson)
  * Docs: Fix typo (#455, @msasad)

2.6.5 / 2017-04-27
==================
  
  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
  * Misc: clean up browser reference checks (#447, @thebigredgeek)
  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)


2.6.4 / 2017-04-20
==================

  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
  * Misc: update "ms" to v0.7.3 (@tootallnate)

2.6.3 / 2017-03-13
==================

  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
  * Docs: Changelog fix (@thebigredgeek)

2.6.2 / 2017-03-10
==================

  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
  * Docs: Add Slackin invite badge (@tootallnate)

2.6.1 / 2017-02-10
==================

  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
  * Fix: Namespaces would not disable once enabled (#409, @musikov)

2.6.0 / 2016-12-28
==================

  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)

2.5.2 / 2016-12-25
==================

  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
  * Docs: fixed README typo (#391, @lurch)
  * Docs: added notice about v3 api discussion (@thebigredgeek)

2.5.1 / 2016-12-20
==================

  * Fix: babel-core compatibility

2.5.0 / 2016-12-20
==================

  * Fix: wrong reference in bower file (@thebigredgeek)
  * Fix: webworker compatibility (@thebigredgeek)
  * Fix: output formatting issue (#388, @kribblo)
  * Fix: babel-loader compatibility (#383, @escwald)
  * Misc: removed built asset from repo and publications (@thebigredgeek)
  * Misc: moved source files to /src (#378, @yamikuronue)
  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
  * Test: coveralls integration (#378, @yamikuronue)
  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)

2.4.5 / 2016-12-17
==================

  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
  * Fix: custom log function (#379, @hsiliev)
  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)

2.4.4 / 2016-12-14
==================

  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)

2.4.3 / 2016-12-14
==================

  * Fix: navigation.userAgent error for react native (#364, @escwald)

2.4.2 / 2016-12-14
==================

  * Fix: browser colors (#367, @tootallnate)
  * Misc: travis ci integration (@thebigredgeek)
  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)

2.4.1 / 2016-12-13
==================

  * Fix: typo that broke the package (#356)

2.4.0 / 2016-12-13
==================

  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
  * Fix: revert "handle regex special characters" (@tootallnate)
  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
  * Improvement: allow colors in workers (#335, @botverse)
  * Improvement: use same color for same namespace. (#338, @lchenay)

2.3.3 / 2016-11-09
==================

  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)

2.3.2 / 2016-11-09
==================

  * Fix: be super-safe in index.js as well (@TooTallNate)
  * Fix: should check whether process exists (Tom Newby)

2.3.1 / 2016-11-09
==================

  * Fix: Added electron compatibility (#324, @paulcbetts)
  * Improvement: Added performance optimizations (@tootallnate)
  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
  * Misc: Removed yarn lock file from source control (#321, @fengmk2)

2.3.0 / 2016-11-07
==================

  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
  * Readme: fix USE_COLORS to DEBUG_COLORS
  * Readme: Doc fixes for format string sugar (#269, @mlucool)
  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
  * Readme: better docs for browser support (#224, @matthewmueller)
  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
  * Misc: Updated contributors (@thebigredgeek)

2.2.0 / 2015-05-09
==================

  * package: update "ms" to v0.7.1 (#202, @dougwilson)
  * README: add logging to file example (#193, @DanielOchoa)
  * README: fixed a typo (#191, @amir-s)
  * browser: expose `storage` (#190, @stephenmathieson)
  * Makefile: add a `distclean` target (#189, @stephenmathieson)

2.1.3 / 2015-03-13
==================

  * Updated stdout/stderr example (#186)
  * Updated example/stdout.js to match debug current behaviour
  * Renamed example/stderr.js to stdout.js
  * Update Readme.md (#184)
  * replace high intensity foreground color for bold (#182, #183)

2.1.2 / 2015-03-01
==================

  * dist: recompile
  * update "ms" to v0.7.0
  * package: update "browserify" to v9.0.3
  * component: fix "ms.js" repo location
  * changed bower package name
  * updated documentation about using debug in a browser
  * fix: security error on safari (#167, #168, @yields)

2.1.1 / 2014-12-29
==================

  * browser: use `typeof` to check for `console` existence
  * browser: check for `console.log` truthiness (fix IE 8/9)
  * browser: add support for Chrome apps
  * Readme: added Windows usage remarks
  * Add `bower.json` to properly support bower install

2.1.0 / 2014-10-15
==================

  * node: implement `DEBUG_FD` env variable support
  * package: update "browserify" to v6.1.0
  * package: add "license" field to package.json (#135, @panuhorsmalahti)

2.0.0 / 2014-09-01
==================

  * package: update "browserify" to v5.11.0
  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)

1.0.4 / 2014-07-15
==================

  * dist: recompile
  * example: remove `console.info()` log usage
  * example: add "Content-Type" UTF-8 header to browser example
  * browser: place %c marker after the space character
  * browser: reset the "content" color via `color: inherit`
  * browser: add colors support for Firefox >= v31
  * debug: prefer an instance `log()` function over the global one (#119)
  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)

1.0.3 / 2014-07-09
==================

  * Add support for multiple wildcards in namespaces (#122, @seegno)
  * browser: fix lint

1.0.2 / 2014-06-10
==================

  * browser: update color palette (#113, @gscottolson)
  * common: make console logging function configurable (#108, @timoxley)
  * node: fix %o colors on old node <= 0.8.x
  * Makefile: find node path using shell/which (#109, @timoxley)

1.0.1 / 2014-06-06
==================

  * browser: use `removeItem()` to clear localStorage
  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
  * package: add "contributors" section
  * node: fix comment typo
  * README: list authors

1.0.0 / 2014-06-04
==================

  * make ms diff be global, not be scope
  * debug: ignore empty strings in enable()
  * node: make DEBUG_COLORS able to disable coloring
  * *: export the `colors` array
  * npmignore: don't publish the `dist` dir
  * Makefile: refactor to use browserify
  * package: add "browserify" as a dev dependency
  * Readme: add Web Inspector Colors section
  * node: reset terminal color for the debug content
  * node: map "%o" to `util.inspect()`
  * browser: map "%j" to `JSON.stringify()`
  * debug: add custom "formatters"
  * debug: use "ms" module for humanizing the diff
  * Readme: add "bash" syntax highlighting
  * browser: add Firebug color support
  * browser: add colors for WebKit browsers
  * node: apply log to `console`
  * rewrite: abstract common logic for Node & browsers
  * add .jshintrc file

0.8.1 / 2014-04-14
==================

  * package: re-add the "component" section

0.8.0 / 2014-03-30
==================

  * add `enable()` method for nodejs. Closes #27
  * change from stderr to stdout
  * remove unnecessary index.js file

0.7.4 / 2013-11-13
==================

  * remove "browserify" key from package.json (fixes something in browserify)

0.7.3 / 2013-10-30
==================

  * fix: catch localStorage security error when cookies are blocked (Chrome)
  * add debug(err) support. Closes #46
  * add .browser prop to package.json. Closes #42

0.7.2 / 2013-02-06
==================

  * fix package.json
  * fix: Mobile Safari (private mode) is broken with debug
  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript

0.7.1 / 2013-02-05
==================

  * add repository URL to package.json
  * add DEBUG_COLORED to force colored output
  * add browserify support
  * fix component. Closes #24

0.7.0 / 2012-05-04
==================

  * Added .component to package.json
  * Added debug.component.js build

0.6.0 / 2012-03-16
==================

  * Added support for "-" prefix in DEBUG [Vinay Pulim]
  * Added `.enabled` flag to the node version [TooTallNate]

0.5.0 / 2012-02-02
==================

  * Added: humanize diffs. Closes #8
  * Added `debug.disable()` to the CS variant
  * Removed padding. Closes #10
  * Fixed: persist client-side variant again. Closes #9

0.4.0 / 2012-02-01
==================

  * Added browser variant support for older browsers [TooTallNate]
  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
  * Added padding to diff (moved it to the right)

0.3.0 / 2012-01-26
==================

  * Added millisecond diff when isatty, otherwise UTC string

0.2.0 / 2012-01-22
==================

  * Added wildcard support

0.1.0 / 2011-12-02
==================

  * Added: remove colors unless stderr isatty [TooTallNate]

0.0.1 / 2010-01-03
==================

  * Initial release
{
  "name": "debug",
  "repo": "visionmedia/debug",
  "description": "small debugging utility",
  "version": "2.6.9",
  "keywords": [
    "debug",
    "log",
    "debugger"
  ],
  "main": "src/browser.js",
  "scripts": [
    "src/browser.js",
    "src/debug.js"
  ],
  "dependencies": {
    "rauchg/ms.js": "0.7.1"
  }
}
// Karma configuration
// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['mocha', 'chai', 'sinon'],


    // list of files / patterns to load in the browser
    files: [
      'dist/debug.js',
      'test/*spec.js'
    ],


    // list of files to exclude
    exclude: [
      'src/node.js'
    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
    },

    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_INFO,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['PhantomJS'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false,

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity
  })
}
(The MIT License)

Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
and associated documentation files (the 'Software'), to deal in the Software without restriction, 
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial 
portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)

# BIN directory
BIN := $(THIS_DIR)/node_modules/.bin

# Path
PATH := node_modules/.bin:$(PATH)
SHELL := /bin/bash

# applications
NODE ?= $(shell which node)
YARN ?= $(shell which yarn)
PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
BROWSERIFY ?= $(NODE) $(BIN)/browserify

.FORCE:

install: node_modules

node_modules: package.json
	@NODE_ENV= $(PKG) install
	@touch node_modules

lint: .FORCE
	eslint browser.js debug.js index.js node.js

test-node: .FORCE
	istanbul cover node_modules/mocha/bin/_mocha -- test/**.js

test-browser: .FORCE
	mkdir -p dist

	@$(BROWSERIFY) \
		--standalone debug \
		. > dist/debug.js

	karma start --single-run
	rimraf dist

test: .FORCE
	concurrently \
		"make test-node" \
		"make test-browser"

coveralls:
	cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

.PHONY: all install clean distclean
module.exports = require('./src/node');
{
  "name": "debug",
  "version": "2.6.9",
  "repository": {
    "type": "git",
    "url": "git://github.com/visionmedia/debug.git"
  },
  "description": "small debugging utility",
  "keywords": [
    "debug",
    "log",
    "debugger"
  ],
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
  "contributors": [
    "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
    "Andrew Rhyne <rhyneandrew@gmail.com>"
  ],
  "license": "MIT",
  "dependencies": {
    "ms": "2.0.0"
  },
  "devDependencies": {
    "browserify": "9.0.3",
    "chai": "^3.5.0",
    "concurrently": "^3.1.0",
    "coveralls": "^2.11.15",
    "eslint": "^3.12.1",
    "istanbul": "^0.4.5",
    "karma": "^1.3.0",
    "karma-chai": "^0.1.0",
    "karma-mocha": "^1.3.0",
    "karma-phantomjs-launcher": "^1.0.2",
    "karma-sinon": "^1.0.5",
    "mocha": "^3.2.0",
    "mocha-lcov-reporter": "^1.2.0",
    "rimraf": "^2.5.4",
    "sinon": "^1.17.6",
    "sinon-chai": "^2.8.0"
  },
  "main": "./src/index.js",
  "browser": "./src/browser.js",
  "component": {
    "scripts": {
      "debug/index.js": "browser.js",
      "debug/debug.js": "debug.js"
    }
  }
}
# debug
[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)



A tiny node.js debugging utility modelled after node core's debugging technique.

**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**

## Installation

```bash
$ npm install debug
```

## Usage

`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.

Example _app.js_:

```js
var debug = require('debug')('http')
  , http = require('http')
  , name = 'My App';

// fake app

debug('booting %s', name);

http.createServer(function(req, res){
  debug(req.method + ' ' + req.url);
  res.end('hello\n');
}).listen(3000, function(){
  debug('listening');
});

// fake worker of some kind

require('./worker');
```

Example _worker.js_:

```js
var debug = require('debug')('worker');

setInterval(function(){
  debug('doing some work');
}, 1000);
```

 The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:

  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)

  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)

#### Windows note

 On Windows the environment variable is set using the `set` command.

 ```cmd
 set DEBUG=*,-not_this
 ```

 Note that PowerShell uses different syntax to set environment variables.

 ```cmd
 $env:DEBUG = "*,-not_this"
  ```

Then, run the program to be debugged as usual.

## Millisecond diff

  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.

  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)

  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:

  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)

## Conventions

  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".

## Wildcards

  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.

  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".

## Environment Variables

  When running through Node.js, you can set a few environment variables that will
  change the behavior of the debug logging:

| Name      | Purpose                                         |
|-----------|-------------------------------------------------|
| `DEBUG`   | Enables/disables specific debugging namespaces. |
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
| `DEBUG_DEPTH` | Object inspection depth. |
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |


  __Note:__ The environment variables beginning with `DEBUG_` end up being
  converted into an Options object that gets used with `%o`/`%O` formatters.
  See the Node.js documentation for
  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
  for the complete list.

## Formatters


  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:

| Formatter | Representation |
|-----------|----------------|
| `%O`      | Pretty-print an Object on multiple lines. |
| `%o`      | Pretty-print an Object all on a single line. |
| `%s`      | String. |
| `%d`      | Number (both integer and float). |
| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
| `%%`      | Single percent sign ('%'). This does not consume an argument. |

### Custom formatters

  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:

```js
const createDebug = require('debug')
createDebug.formatters.h = (v) => {
  return v.toString('hex')
}

// …elsewhere
const debug = createDebug('foo')
debug('this is hex: %h', new Buffer('hello world'))
//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
```

## Browser support
  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
  if you don't want to build it yourself.

  Debug's enable state is currently persisted by `localStorage`.
  Consider the situation shown below where you have `worker:a` and `worker:b`,
  and wish to debug both. You can enable this using `localStorage.debug`:

```js
localStorage.debug = 'worker:*'
```

And then refresh the page.

```js
a = debug('worker:a');
b = debug('worker:b');

setInterval(function(){
  a('doing some work');
}, 1000);

setInterval(function(){
  b('doing some work');
}, 1200);
```

#### Web Inspector Colors

  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
  option. These are WebKit web inspectors, Firefox ([since version
  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
  and the Firebug plugin for Firefox (any version).

  Colored output looks something like:

  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)


## Output streams

  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:

Example _stdout.js_:

```js
var debug = require('debug');
var error = debug('app:error');

// by default stderr is used
error('goes to stderr!');

var log = debug('app:log');
// set this namespace to log via console.log
log.log = console.log.bind(console); // don't forget to bind to console!
log('goes to stdout');
error('still goes to stderr!');

// set all output to go via console.info
// overrides all per-namespace log settings
debug.log = console.info.bind(console);
error('now goes to stdout via console.info');
log('still goes to stdout, but via console.info now');
```


## Authors

 - TJ Holowaychuk
 - Nathan Rajlich
 - Andrew Rhyne
 
## Backers

Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]

<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>


## Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]

<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>

## License

(The MIT License)

Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
 * This is the web browser implementation of `debug()`.
 *
 * Expose `debug()` as the module.
 */

exports = module.exports = require('./debug');
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = 'undefined' != typeof chrome
               && 'undefined' != typeof chrome.storage
                  ? chrome.storage.local
                  : localstorage();

/**
 * Colors.
 */

exports.colors = [
  'lightseagreen',
  'forestgreen',
  'goldenrod',
  'dodgerblue',
  'darkorchid',
  'crimson'
];

/**
 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
 * and the Firebug extension (any Firefox version) are known
 * to support "%c" CSS customizations.
 *
 * TODO: add a `localStorage` variable to explicitly enable/disable colors
 */

function useColors() {
  // NB: In an Electron preload script, document will be defined but not fully
  // initialized. Since we know we're in Chrome, we'll just detect this case
  // explicitly
  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
    return true;
  }

  // is webkit? http://stackoverflow.com/a/16459606/376773
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
    // is firebug? http://stackoverflow.com/a/398120/376773
    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
    // is firefox >= v31?
    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
    // double check webkit in userAgent just in case we are in a worker
    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
 */

exports.formatters.j = function(v) {
  try {
    return JSON.stringify(v);
  } catch (err) {
    return '[UnexpectedJSONParseError]: ' + err.message;
  }
};


/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */

function formatArgs(args) {
  var useColors = this.useColors;

  args[0] = (useColors ? '%c' : '')
    + this.namespace
    + (useColors ? ' %c' : ' ')
    + args[0]
    + (useColors ? '%c ' : ' ')
    + '+' + exports.humanize(this.diff);

  if (!useColors) return;

  var c = 'color: ' + this.color;
  args.splice(1, 0, c, 'color: inherit')

  // the final "%c" is somewhat tricky, because there could be other
  // arguments passed either before or after the %c, so we need to
  // figure out the correct index to insert the CSS into
  var index = 0;
  var lastC = 0;
  args[0].replace(/%[a-zA-Z%]/g, function(match) {
    if ('%%' === match) return;
    index++;
    if ('%c' === match) {
      // we only are interested in the *last* %c
      // (the user may have provided their own)
      lastC = index;
    }
  });

  args.splice(lastC, 0, c);
}

/**
 * Invokes `console.log()` when available.
 * No-op when `console.log` is not a "function".
 *
 * @api public
 */

function log() {
  // this hackery is required for IE8/9, where
  // the `console.log` function doesn't have 'apply'
  return 'object' === typeof console
    && console.log
    && Function.prototype.apply.call(console.log, console, arguments);
}

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */

function save(namespaces) {
  try {
    if (null == namespaces) {
      exports.storage.removeItem('debug');
    } else {
      exports.storage.debug = namespaces;
    }
  } catch(e) {}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */

function load() {
  var r;
  try {
    r = exports.storage.debug;
  } catch(e) {}

  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  if (!r && typeof process !== 'undefined' && 'env' in process) {
    r = process.env.DEBUG;
  }

  return r;
}

/**
 * Enable namespaces listed in `localStorage.debug` initially.
 */

exports.enable(load());

/**
 * Localstorage attempts to return the localstorage.
 *
 * This is necessary because safari throws
 * when a user disables cookies/localstorage
 * and you attempt to access it.
 *
 * @return {LocalStorage}
 * @api private
 */

function localstorage() {
  try {
    return window.localStorage;
  } catch (e) {}
}

/**
 * This is the common logic for both the Node.js and web browser
 * implementations of `debug()`.
 *
 * Expose `debug()` as the module.
 */

exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
exports.coerce = coerce;
exports.disable = disable;
exports.enable = enable;
exports.enabled = enabled;
exports.humanize = require('ms');

/**
 * The currently active debug mode names, and names to skip.
 */

exports.names = [];
exports.skips = [];

/**
 * Map of special "%n" handling functions, for the debug "format" argument.
 *
 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
 */

exports.formatters = {};

/**
 * Previous log timestamp.
 */

var prevTime;

/**
 * Select a color.
 * @param {String} namespace
 * @return {Number}
 * @api private
 */

function selectColor(namespace) {
  var hash = 0, i;

  for (i in namespace) {
    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
    hash |= 0; // Convert to 32bit integer
  }

  return exports.colors[Math.abs(hash) % exports.colors.length];
}

/**
 * Create a debugger with the given `namespace`.
 *
 * @param {String} namespace
 * @return {Function}
 * @api public
 */

function createDebug(namespace) {

  function debug() {
    // disabled?
    if (!debug.enabled) return;

    var self = debug;

    // set `diff` timestamp
    var curr = +new Date();
    var ms = curr - (prevTime || curr);
    self.diff = ms;
    self.prev = prevTime;
    self.curr = curr;
    prevTime = curr;

    // turn the `arguments` into a proper Array
    var args = new Array(arguments.length);
    for (var i = 0; i < args.length; i++) {
      args[i] = arguments[i];
    }

    args[0] = exports.coerce(args[0]);

    if ('string' !== typeof args[0]) {
      // anything else let's inspect with %O
      args.unshift('%O');
    }

    // apply any `formatters` transformations
    var index = 0;
    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
      // if we encounter an escaped % then don't increase the array index
      if (match === '%%') return match;
      index++;
      var formatter = exports.formatters[format];
      if ('function' === typeof formatter) {
        var val = args[index];
        match = formatter.call(self, val);

        // now we need to remove `args[index]` since it's inlined in the `format`
        args.splice(index, 1);
        index--;
      }
      return match;
    });

    // apply env-specific formatting (colors, etc.)
    exports.formatArgs.call(self, args);

    var logFn = debug.log || exports.log || console.log.bind(console);
    logFn.apply(self, args);
  }

  debug.namespace = namespace;
  debug.enabled = exports.enabled(namespace);
  debug.useColors = exports.useColors();
  debug.color = selectColor(namespace);

  // env-specific initialization logic for debug instances
  if ('function' === typeof exports.init) {
    exports.init(debug);
  }

  return debug;
}

/**
 * Enables a debug mode by namespaces. This can include modes
 * separated by a colon and wildcards.
 *
 * @param {String} namespaces
 * @api public
 */

function enable(namespaces) {
  exports.save(namespaces);

  exports.names = [];
  exports.skips = [];

  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  var len = split.length;

  for (var i = 0; i < len; i++) {
    if (!split[i]) continue; // ignore empty strings
    namespaces = split[i].replace(/\*/g, '.*?');
    if (namespaces[0] === '-') {
      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
    } else {
      exports.names.push(new RegExp('^' + namespaces + '$'));
    }
  }
}

/**
 * Disable debug output.
 *
 * @api public
 */

function disable() {
  exports.enable('');
}

/**
 * Returns true if the given mode name is enabled, false otherwise.
 *
 * @param {String} name
 * @return {Boolean}
 * @api public
 */

function enabled(name) {
  var i, len;
  for (i = 0, len = exports.skips.length; i < len; i++) {
    if (exports.skips[i].test(name)) {
      return false;
    }
  }
  for (i = 0, len = exports.names.length; i < len; i++) {
    if (exports.names[i].test(name)) {
      return true;
    }
  }
  return false;
}

/**
 * Coerce `val`.
 *
 * @param {Mixed} val
 * @return {Mixed}
 * @api private
 */

function coerce(val) {
  if (val instanceof Error) return val.stack || val.message;
  return val;
}
/**
 * Detect Electron renderer process, which is node, but we should
 * treat as a browser.
 */

if (typeof process !== 'undefined' && process.type === 'renderer') {
  module.exports = require('./browser.js');
} else {
  module.exports = require('./node.js');
}
module.exports = inspectorLog;

// black hole
const nullStream = new (require('stream').Writable)();
nullStream._write = () => {};

/**
 * Outputs a `console.log()` to the Node.js Inspector console *only*.
 */
function inspectorLog() {
  const stdout = console._stdout;
  console._stdout = nullStream;
  console.log.apply(console, arguments);
  console._stdout = stdout;
}
/**
 * Module dependencies.
 */

var tty = require('tty');
var util = require('util');

/**
 * This is the Node.js implementation of `debug()`.
 *
 * Expose `debug()` as the module.
 */

exports = module.exports = require('./debug');
exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;

/**
 * Colors.
 */

exports.colors = [6, 2, 3, 4, 5, 1];

/**
 * Build up the default `inspectOpts` object from the environment variables.
 *
 *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
 */

exports.inspectOpts = Object.keys(process.env).filter(function (key) {
  return /^debug_/i.test(key);
}).reduce(function (obj, key) {
  // camel-case
  var prop = key
    .substring(6)
    .toLowerCase()
    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });

  // coerce string value into JS value
  var val = process.env[key];
  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
  else if (val === 'null') val = null;
  else val = Number(val);

  obj[prop] = val;
  return obj;
}, {});

/**
 * The file descriptor to write the `debug()` calls to.
 * Set the `DEBUG_FD` env variable to override with another value. i.e.:
 *
 *   $ DEBUG_FD=3 node script.js 3>debug.log
 */

var fd = parseInt(process.env.DEBUG_FD, 10) || 2;

if (1 !== fd && 2 !== fd) {
  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
}

var stream = 1 === fd ? process.stdout :
             2 === fd ? process.stderr :
             createWritableStdioStream(fd);

/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
  return 'colors' in exports.inspectOpts
    ? Boolean(exports.inspectOpts.colors)
    : tty.isatty(fd);
}

/**
 * Map %o to `util.inspect()`, all on a single line.
 */

exports.formatters.o = function(v) {
  this.inspectOpts.colors = this.useColors;
  return util.inspect(v, this.inspectOpts)
    .split('\n').map(function(str) {
      return str.trim()
    }).join(' ');
};

/**
 * Map %o to `util.inspect()`, allowing multiple lines if needed.
 */

exports.formatters.O = function(v) {
  this.inspectOpts.colors = this.useColors;
  return util.inspect(v, this.inspectOpts);
};

/**
 * Adds ANSI color escape codes if enabled.
 *
 * @api public
 */

function formatArgs(args) {
  var name = this.namespace;
  var useColors = this.useColors;

  if (useColors) {
    var c = this.color;
    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';

    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
  } else {
    args[0] = new Date().toUTCString()
      + ' ' + name + ' ' + args[0];
  }
}

/**
 * Invokes `util.format()` with the specified arguments and writes to `stream`.
 */

function log() {
  return stream.write(util.format.apply(util, arguments) + '\n');
}

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */

function save(namespaces) {
  if (null == namespaces) {
    // If you set a process.env field to null or undefined, it gets cast to the
    // string 'null' or 'undefined'. Just delete instead.
    delete process.env.DEBUG;
  } else {
    process.env.DEBUG = namespaces;
  }
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */

function load() {
  return process.env.DEBUG;
}

/**
 * Copied from `node/src/node.js`.
 *
 * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
 * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
 */

function createWritableStdioStream (fd) {
  var stream;
  var tty_wrap = process.binding('tty_wrap');

  // Note stream._type is used for test-module-load-list.js

  switch (tty_wrap.guessHandleType(fd)) {
    case 'TTY':
      stream = new tty.WriteStream(fd);
      stream._type = 'tty';

      // Hack to have stream not keep the event loop alive.
      // See https://github.com/joyent/node/issues/1726
      if (stream._handle && stream._handle.unref) {
        stream._handle.unref();
      }
      break;

    case 'FILE':
      var fs = require('fs');
      stream = new fs.SyncWriteStream(fd, { autoClose: false });
      stream._type = 'fs';
      break;

    case 'PIPE':
    case 'TCP':
      var net = require('net');
      stream = new net.Socket({
        fd: fd,
        readable: false,
        writable: true
      });

      // FIXME Should probably have an option in net.Socket to create a
      // stream from an existing fd which is writable only. But for now
      // we'll just add this hack and set the `readable` member to false.
      // Test: ./node test/fixtures/echo.js < /etc/passwd
      stream.readable = false;
      stream.read = null;
      stream._type = 'pipe';

      // FIXME Hack to have stream not keep the event loop alive.
      // See https://github.com/joyent/node/issues/1726
      if (stream._handle && stream._handle.unref) {
        stream._handle.unref();
      }
      break;

    default:
      // Probably an error on in uv_guess_handle()
      throw new Error('Implement me. Unknown stream file type!');
  }

  // For supporting legacy API we put the FD here.
  stream.fd = fd;

  stream._isStdio = true;

  return stream;
}

/**
 * Init logic for `debug` instances.
 *
 * Create a new `inspectOpts` object in case `useColors` is set
 * differently for a particular `debug` instance.
 */

function init (debug) {
  debug.inspectOpts = {};

  var keys = Object.keys(exports.inspectOpts);
  for (var i = 0; i < keys.length; i++) {
    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
  }
}

/**
 * Enable namespaces listed in `process.env.DEBUG` initially.
 */

exports.enable(load());
/**
 * Helpers.
 */

var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var y = d * 365.25;

/**
 * Parse or format the given `val`.
 *
 * Options:
 *
 *  - `long` verbose formatting [false]
 *
 * @param {String|Number} val
 * @param {Object} [options]
 * @throws {Error} throw an error if val is not a non-empty string or a number
 * @return {String|Number}
 * @api public
 */

module.exports = function(val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse(val);
  } else if (type === 'number' && isNaN(val) === false) {
    return options.long ? fmtLong(val) : fmtShort(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
};

/**
 * Parse the given `str` and return milliseconds.
 *
 * @param {String} str
 * @return {Number}
 * @api private
 */

function parse(str) {
  str = String(str);
  if (str.length > 100) {
    return;
  }
  var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
    str
  );
  if (!match) {
    return;
  }
  var n = parseFloat(match[1]);
  var type = (match[2] || 'ms').toLowerCase();
  switch (type) {
    case 'years':
    case 'year':
    case 'yrs':
    case 'yr':
    case 'y':
      return n * y;
    case 'days':
    case 'day':
    case 'd':
      return n * d;
    case 'hours':
    case 'hour':
    case 'hrs':
    case 'hr':
    case 'h':
      return n * h;
    case 'minutes':
    case 'minute':
    case 'mins':
    case 'min':
    case 'm':
      return n * m;
    case 'seconds':
    case 'second':
    case 'secs':
    case 'sec':
    case 's':
      return n * s;
    case 'milliseconds':
    case 'millisecond':
    case 'msecs':
    case 'msec':
    case 'ms':
      return n;
    default:
      return undefined;
  }
}

/**
 * Short format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtShort(ms) {
  if (ms >= d) {
    return Math.round(ms / d) + 'd';
  }
  if (ms >= h) {
    return Math.round(ms / h) + 'h';
  }
  if (ms >= m) {
    return Math.round(ms / m) + 'm';
  }
  if (ms >= s) {
    return Math.round(ms / s) + 's';
  }
  return ms + 'ms';
}

/**
 * Long format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtLong(ms) {
  return plural(ms, d, 'day') ||
    plural(ms, h, 'hour') ||
    plural(ms, m, 'minute') ||
    plural(ms, s, 'second') ||
    ms + ' ms';
}

/**
 * Pluralization helper.
 */

function plural(ms, n, name) {
  if (ms < n) {
    return;
  }
  if (ms < n * 1.5) {
    return Math.floor(ms / n) + ' ' + name;
  }
  return Math.ceil(ms / n) + ' ' + name + 's';
}
The MIT License (MIT)

Copyright (c) 2016 Zeit, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "ms",
  "version": "2.0.0",
  "description": "Tiny milisecond conversion utility",
  "repository": "zeit/ms",
  "main": "./index",
  "files": [
    "index.js"
  ],
  "scripts": {
    "precommit": "lint-staged",
    "lint": "eslint lib/* bin/*",
    "test": "mocha tests.js"
  },
  "eslintConfig": {
    "extends": "eslint:recommended",
    "env": {
      "node": true,
      "es6": true
    }
  },
  "lint-staged": {
    "*.js": [
      "npm run lint",
      "prettier --single-quote --write",
      "git add"
    ]
  },
  "license": "MIT",
  "devDependencies": {
    "eslint": "3.19.0",
    "expect.js": "0.3.1",
    "husky": "0.13.3",
    "lint-staged": "3.4.1",
    "mocha": "3.4.1"
  }
}
# ms

[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/)

Use this package to easily convert various time formats to milliseconds.

## Examples

```js
ms('2 days')  // 172800000
ms('1d')      // 86400000
ms('10h')     // 36000000
ms('2.5 hrs') // 9000000
ms('2h')      // 7200000
ms('1m')      // 60000
ms('5s')      // 5000
ms('1y')      // 31557600000
ms('100')     // 100
```

### Convert from milliseconds

```js
ms(60000)             // "1m"
ms(2 * 60000)         // "2m"
ms(ms('10 hours'))    // "10h"
```

### Time format written-out

```js
ms(60000, { long: true })             // "1 minute"
ms(2 * 60000, { long: true })         // "2 minutes"
ms(ms('10 hours'), { long: true })    // "10 hours"
```

## Features

- Works both in [node](https://nodejs.org) and in the browser.
- If a number is supplied to `ms`, a string with a unit is returned.
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`).
- If you pass a string with a number and a valid unit, the number of equivalent ms is returned.

## Caught a bug?

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms!

As always, you can run the tests using: `npm test`
{
  "name": "electron-squirrel-startup",
  "version": "1.0.0",
  "description": "Default Squirrel.Windows event handler for your Electron apps.",
  "author": "Lucas Hrabovsky <lucas@mongodb.com> (http://imlucas.com)",
  "homepage": "http://github.com/mongodb-js/electron-squirrel-startup",
  "license": "Apache-2.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/mongodb-js/electron-squirrel-startup.git"
  },
  "scripts": {
    "ci": "mocha",
    "test": "mocha",
    "check": "mongodb-js-precommit"
  },
  "precommit": [
    "check"
  ],
  "dependencies": {
    "debug": "^2.2.0"
  },
  "devDependencies": {
    "eslint-config-mongodb-js": "^0.1.4",
    "mocha": "^2.2.5",
    "mongodb-js-precommit": "^0.1.2",
    "pre-commit": "^1.0.10"
  },
  "dependency-check": {
    "ignore": [
      "app"
    ]
  },
  "keywords": [
    "mongodb.js",
    "electron",
    "electron-installer",
    "squirrel.windows"
  ]
}
# electron-squirrel-startup

> Default [Squirrel.Windows][squirrel] event handler for your [Electron][electron] apps.

## Installation

```
npm i electron-squirrel-startup
```

## Usage

To handle the most common commands, such as managing desktop shortcuts, just
add the following to the top of your `main.js` and you're good to go:

```js
if(require('electron-squirrel-startup')) return;
```

## Read More

### [Handling Squirrel Events][squirrel-events]
### [Squirrel.Windows Commands][squirrel-commands]

## License

Apache 2.0

[squirrel]: https://github.com/Squirrel/Squirrel.Windows
[electron]: https://github.com/atom/electron
[squirrel-commands]: https://github.com/Squirrel/Squirrel.Windows/blob/master/src/Update/Program.cs#L98
[squirrel-events]: https://github.com/atom/grunt-electron-installer#handling-squirrel-events
var assert = require('assert');
var startup = require('../');
var proxyquire = require('proxyquire');

describe('electron-squirrel-startup', function() {
  it('should return false by default', function() {
    assert.equal(startup, false);
  });
});
import {Except} from 'type-fest';
import Conf, {Schema as ConfSchema, Options as ConfOptions} from 'conf';

declare namespace ElectronStore {
	type Schema<T> = ConfSchema<T>;

	type Options<T extends Record<string, any>> = Except<ConfOptions<T>, 'configName' | 'projectName' | 'projectVersion' | 'projectSuffix'> & {
		/**
		Name of the storage file (without extension).

		This is useful if you want multiple storage files for your app. Or if you're making a reusable Electron module that persists some data, in which case you should **not** use the name `config`.

		@default 'config'
		*/
		readonly name?: string;
	};
}

/**
Simple data persistence for your [Electron](https://electronjs.org) app or module - Save and load user preferences, app state, cache, etc.
*/
declare class ElectronStore<T extends Record<string, any> = Record<string, unknown>> extends Conf<T> {
	/**
	Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing store.

	@example
	```
	import Store = require('electron-store');

	type StoreType = {
		isRainbow: boolean,
		unicorn?: string
	}

	const store = new Store<StoreType>({
		defaults: {
			isRainbow: true
		}
	});

	store.get('isRainbow');
	//=> true

	store.set('unicorn', '🦄');
	console.log(store.get('unicorn'));
	//=> '🦄'

	store.delete('unicorn');
	console.log(store.get('unicorn'));
	//=> undefined
	```
	*/
	constructor(options?: ElectronStore.Options<T>);

	/**
	Initializer to set up the required `ipc` communication channels for the module when a `Store` instance is not created in the main process and you are creating a `Store` instance in the Electron renderer process only.
	*/
	static initRenderer(): void;

	/**
	Open the storage file in the user's editor.
	*/
	openInEditor(): void;
}

export = ElectronStore;
'use strict';
const path = require('path');
const {app, ipcMain, ipcRenderer, shell} = require('electron');
const Conf = require('conf');

let isInitialized = false;

// Set up the `ipcMain` handler for communication between renderer and main process.
const initDataListener = () => {
	if (!ipcMain || !app) {
		throw new Error('Electron Store: You need to call `.initRenderer()` from the main process.');
	}

	const appData = {
		defaultCwd: app.getPath('userData'),
		appVersion: app.getVersion()
	};

	if (isInitialized) {
		return appData;
	}

	ipcMain.on('electron-store-get-data', event => {
		event.returnValue = appData;
	});

	isInitialized = true;

	return appData;
};

class ElectronStore extends Conf {
	constructor(options) {
		let defaultCwd;
		let appVersion;

		// If we are in the renderer process, we communicate with the main process
		// to get the required data for the module otherwise, we pull from the main process.
		if (ipcRenderer) {
			const appData = ipcRenderer.sendSync('electron-store-get-data');

			if (!appData) {
				throw new Error('Electron Store: You need to call `.initRenderer()` from the main process.');
			}

			({defaultCwd, appVersion} = appData);
		} else if (ipcMain && app) {
			({defaultCwd, appVersion} = initDataListener());
		}

		options = {
			name: 'config',
			...options
		};

		if (!options.projectVersion) {
			options.projectVersion = appVersion;
		}

		if (options.cwd) {
			options.cwd = path.isAbsolute(options.cwd) ? options.cwd : path.join(defaultCwd, options.cwd);
		} else {
			options.cwd = defaultCwd;
		}

		options.configName = options.name;
		delete options.name;

		super(options);
	}

	static initRenderer() {
		initDataListener();
	}

	openInEditor() {
		shell.openPath(this.path);
	}
}

module.exports = ElectronStore;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "electron-store",
	"version": "8.1.0",
	"description": "Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc",
	"license": "MIT",
	"repository": "sindresorhus/electron-store",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"electron",
		"store",
		"app",
		"config",
		"storage",
		"conf",
		"configuration",
		"settings",
		"preferences",
		"json",
		"data",
		"persist",
		"persistent",
		"save"
	],
	"dependencies": {
		"conf": "^10.2.0",
		"type-fest": "^2.17.0"
	},
	"devDependencies": {
		"ava": "^2.4.0",
		"electron": "^12.0.4",
		"execa": "^5.0.0",
		"tsd": "^0.14.0",
		"xo": "^0.38.2"
	},
	"xo": {
		"envs": [
			"node",
			"browser"
		]
	}
}
# electron-store

> Simple data persistence for your [Electron](https://electronjs.org) app or module - Save and load user preferences, app state, cache, etc

Electron doesn't have a built-in way to persist user preferences and other data. This module handles that for you, so you can focus on building your app. The data is saved in a JSON file named config.json in [`app.getPath('userData')`](https://electronjs.org/docs/api/app#appgetpathname).

You can use this module directly in both the main and renderer process. For use in the renderer process only, you need to call `Store.initRenderer()` in the main process, or create a new Store instance (`new Store()`) in the main process.

<br>

---

<div align="center">
	<p>
		<p>
			<sup>
				<a href="https://github.com/sponsors/sindresorhus">My open source work is supported by the community</a>
			</sup>
		</p>
		<sup>Special thanks to:</sup>
		<br>
		<br>
		<a href="https://standardresume.co/tech">
			<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="200"/>
		</a>
	</p>
	<br>
	<a href="https://keygen.sh">
		<div>
			<img src="https://sindresorhus.com/assets/thanks/keygen-logo.svg" width="210" alt="Keygen">
		</div>
		<b>A dead-simple software licensing and distribution API built for developers</b>
	</a>
	<br>
</div>

---

<br>

## Install

```
$ npm install electron-store
```

*Requires Electron 11 or later.*

## Usage

```js
const Store = require('electron-store');

const store = new Store();

store.set('unicorn', '🦄');
console.log(store.get('unicorn'));
//=> '🦄'

// Use dot-notation to access nested properties
store.set('foo.bar', true);
console.log(store.get('foo'));
//=> {bar: true}

store.delete('unicorn');
console.log(store.get('unicorn'));
//=> undefined
```

## API

Changes are written to disk atomically, so if the process crashes during a write, it will not corrupt the existing config.

### Store(options?)

Returns a new instance.

### options

Type: `object`

#### defaults

Type: `object`

Default values for the store items.

**Note:** The values in `defaults` will overwrite the `default` key in the `schema` option.

#### schema

type: `object`

[JSON Schema](https://json-schema.org) to validate your config data.

Under the hood, the JSON Schema validator [ajv](https://github.com/epoberezkin/ajv) is used to validate your config. We use [JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) and support all [validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) and [formats](https://github.com/epoberezkin/ajv#formats).

You should define your schema as an object where each key is the name of your data's property and each value is a JSON schema used to validate that property. See more [here](https://json-schema.org/understanding-json-schema/reference/object.html#properties).

Example:

```js
const Store = require('electron-store');

const schema = {
	foo: {
		type: 'number',
		maximum: 100,
		minimum: 1,
		default: 50
	},
	bar: {
		type: 'string',
		format: 'url'
	}
};

const store = new Store({schema});

console.log(store.get('foo'));
//=> 50

store.set('foo', '1');
// [Error: Config schema violation: `foo` should be number]
```

**Note:** The `default` value will be overwritten by the `defaults` option if set.

#### migrations

Type: `object`

You can use migrations to perform operations to the store whenever a version is upgraded.

The `migrations` object should consist of a key-value pair of `'version': handler`. The `version` can also be a [semver range](https://github.com/npm/node-semver#ranges).

Example:

```js
const Store = require('electron-store');

const store = new Store({
	migrations: {
		'0.0.1': store => {
			store.set('debugPhase', true);
		},
		'1.0.0': store => {
			store.delete('debugPhase');
			store.set('phase', '1.0.0');
		},
		'1.0.2': store => {
			store.set('phase', '1.0.2');
		},
		'>=2.0.0': store => {
			store.set('phase', '>=2.0.0');
		}
	}
});
```

### beforeEachMigration

Type: `Function`\
Default: `undefined`

The given callback function will be called before each migration step.

The function receives the store as the first argument and a context object as the second argument with the following properties:

- `fromVersion` - The version the migration step is being migrated from.
- `toVersion` - The version the migration step is being migrated to.
- `finalVersion` - The final version after all the migrations are applied.
- `versions` - All the versions with a migration step.

This can be useful for logging purposes, preparing migration data, etc.

Example:

```js
const Store = require('electron-store');

console.log = someLogger.log;

const mainConfig = new Store({
	beforeEachMigration: (store, context) => {
		console.log(`[main-config] migrate from ${context.fromVersion} → ${context.toVersion}`);
	},
	migrations: {
		'0.4.0': store => {
			store.set('debugPhase', true);
		}
	}
});

const secondConfig = new Store({
	beforeEachMigration: (store, context) => {
		console.log(`[second-config] migrate from ${context.fromVersion} → ${context.toVersion}`);
	},
	migrations: {
		'1.0.1': store => {
			store.set('debugPhase', true);
		}
	}
});
```

#### name

Type: `string`\
Default: `'config'`

Name of the storage file (without extension).

This is useful if you want multiple storage files for your app. Or if you're making a reusable Electron module that persists some data, in which case you should **not** use the name `config`.

#### cwd

Type: `string`\
Default: [`app.getPath('userData')`](https://electronjs.org/docs/api/app#appgetpathname)

Storage file location. *Don't specify this unless absolutely necessary! By default, it will pick the optimal location by adhering to system conventions. You are very likely to get this wrong and annoy users.*

If a relative path, it's relative to the default cwd. For example, `{cwd: 'unicorn'}` would result in a storage file in `~/Library/Application Support/App Name/unicorn`.

#### encryptionKey

Type: `string | Buffer | TypedArray | DataView`\
Default: `undefined`

Note that this is **not intended for security purposes**, since the encryption key would be easily found inside a plain-text Node.js app.

Its main use is for obscurity. If a user looks through the config directory and finds the config file, since it's just a JSON file, they may be tempted to modify it. By providing an encryption key, the file will be obfuscated, which should hopefully deter any users from doing so.

When specified, the store will be encrypted using the [`aes-256-cbc`](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation) encryption algorithm.

#### fileExtension

Type: `string`\
Default: `'json'`

Extension of the config file.

You would usually not need this, but could be useful if you want to interact with a file with a custom file extension that can be associated with your app. These might be simple save/export/preference files that are intended to be shareable or saved outside of the app.

#### clearInvalidConfig

Type: `boolean`\
Default: `false`

The config is cleared if reading the config file causes a `SyntaxError`. This is a good behavior for unimportant data, as the config file is not intended to be hand-edited, so it usually means the config is corrupt and there's nothing the user can do about it anyway. However, if you let the user edit the config file directly, mistakes might happen and it could be more useful to throw an error when the config is invalid instead of clearing.

#### serialize

Type: `Function`\
Default: `value => JSON.stringify(value, null, '\t')`

Function to serialize the config object to a UTF-8 string when writing the config file.

You would usually not need this, but it could be useful if you want to use a format other than JSON.

#### deserialize

Type: `Function`\
Default: `JSON.parse`

Function to deserialize the config object from a UTF-8 string when reading the config file.

You would usually not need this, but it could be useful if you want to use a format other than JSON.

#### accessPropertiesByDotNotation

Type: `boolean`\
Default: `true`

Accessing nested properties by dot notation. For example:

```js
const Store = require('electron-store');

const store = new Store();

store.set({
	foo: {
		bar: {
			foobar: '🦄'
		}
	}
});

console.log(store.get('foo.bar.foobar'));
//=> '🦄'
```

Alternatively, you can set this option to `false` so the whole string would be treated as one key.

```js
const store = new Store({accessPropertiesByDotNotation: false});

store.set({
	`foo.bar.foobar`: '🦄'
});

console.log(store.get('foo.bar.foobar'));
//=> '🦄'
```

#### watch

Type: `boolean`\
Default: `false`

Watch for any changes in the config file and call the callback for `onDidChange` or `onDidAnyChange` if set. This is useful if there are multiple processes changing the same config file, for example, if you want changes done in the main process to be reflected in a renderer process.

### Instance

You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties.

The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop.

#### .set(key, value)

Set an item.

The `value` must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a TypeError.

#### .set(object)

Set multiple items at once.

#### .get(key, defaultValue?)

Get an item or `defaultValue` if the item does not exist.

#### .reset(...keys)

Reset items to their default values, as defined by the `defaults` or `schema` option.

Use `.clear()` to reset all items.

#### .has(key)

Check if an item exists.

#### .delete(key)

Delete an item.

#### .clear()

Delete all items.

This resets known items to their default values, if defined by the `defaults` or `schema` option.

#### .onDidChange(key, callback)

`callback`: `(newValue, oldValue) => {}`

Watches the given `key`, calling `callback` on any changes.

When a key is first set `oldValue` will be `undefined`, and when a key is deleted `newValue` will be `undefined`.

Returns a function which you can use to unsubscribe:

```js
const unsubscribe = store.onDidChange(key, callback);

unsubscribe();
```

#### .onDidAnyChange(callback)

`callback`: `(newValue, oldValue) => {}`

Watches the whole config object, calling `callback` on any changes.

`oldValue` and `newValue` will be the config object before and after the change, respectively. You must compare `oldValue` to `newValue` to find out what changed.

Returns a function which you can use to unsubscribe:

```js
const unsubscribe = store.onDidAnyChange(callback);

unsubscribe();
```

#### .size

Get the item count.

#### .store

Get all the data as an object or replace the current data with an object:

```js
const Store = require('electron-store');

const store = new Store();

store.store = {
	hello: 'world'
};
```

#### .path

Get the path to the storage file.

#### .openInEditor()

Open the storage file in the user's editor.

### initRenderer()

Initializer to set up the required `ipc` communication channels for the module when a `Store` instance is not created in the main process and you are creating a `Store` instance in the Electron renderer process only.

In the main process:

```js
const Store = require('electron-store');

Store.initRenderer();
```

And in the renderer process:

```js
const Store = require('electron-store');

const store = new Store();

store.set('unicorn', '🦄');
console.log(store.get('unicorn'));
//=> '🦄'
```

## FAQ

#### [Advantages over `window.localStorage`](https://github.com/sindresorhus/electron-store/issues/17)

#### Can I use YAML or another serialization format?

The `serialize` and `deserialize` options can be used to customize the format of the config file, as long as the representation is compatible with `utf8` encoding.

Example using YAML:

```js
const Store = require('electron-store');
const yaml = require('js-yaml');

const store = new Store({
	fileExtension: 'yaml',
	serialize: yaml.safeDump,
	deserialize: yaml.safeLoad
});
```

#### How do I get store values in the renderer process when my store was initialized in the main process?

The store is not a singleton, so you will need to either [initialize the store in a file that is imported in both the main and renderer process](https://github.com/sindresorhus/electron-store/issues/15), or you have to pass the values back and forth as messages. Electron provides a handy [`invoke/handle` API](https://www.electronjs.org/docs/api/ipc-main#ipcmainhandlechannel-listener) that works well for accessing these values.

```js
ipcMain.handle('getStoreValue', (event, key) => {
	return store.get(key);
});
```

```js
const foo = await ipcRenderer.invoke('getStoreValue', 'foo');
```

#### Can I use it for large amounts of data?

This package is not a database. It simply uses a JSON file that is read/written on every change. Prefer using it for smaller amounts of data like user settings, value caching, state, etc.

If you need to store large blobs of data, I recommend saving it to disk and to use this package to store the path to the file instead.

## Related

- [electron-util](https://github.com/sindresorhus/electron-util) - Useful utilities for developing Electron apps and modules
- [electron-debug](https://github.com/sindresorhus/electron-debug) - Adds useful debug features to your Electron app
- [electron-context-menu](https://github.com/sindresorhus/electron-context-menu) - Context menu for your Electron app
- [electron-dl](https://github.com/sindresorhus/electron-dl) - Simplified file downloads for your Electron app
- [electron-unhandled](https://github.com/sindresorhus/electron-unhandled) - Catch unhandled errors and promise rejections in your Electron app
- [electron-reloader](https://github.com/sindresorhus/electron-reloader) - Simple auto-reloading for Electron apps during development
- [electron-serve](https://github.com/sindresorhus/electron-serve) - Static file serving for Electron apps
- [conf](https://github.com/sindresorhus/conf) - Simple config handling for your app or module
- [More…](https://github.com/search?q=user%3Asindresorhus+electron)
declare namespace envPaths {
	export interface Options {
		/**
		__Don't use this option unless you really have to!__

		Suffix appended to the project name to avoid name conflicts with native apps. Pass an empty string to disable it.

		@default 'nodejs'
		*/
		readonly suffix?: string;
	}

	export interface Paths {
		/**
		Directory for data files.

		Example locations (with the default `nodejs` suffix):

		- macOS: `~/Library/Application Support/MyApp-nodejs`
		- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`)
		- Linux: `~/.local/share/MyApp-nodejs` (or `$XDG_DATA_HOME/MyApp-nodejs`)
		*/
		readonly data: string;

		/**
		Directory for data files.

		Example locations (with the default `nodejs` suffix):

		- macOS: `~/Library/Preferences/MyApp-nodejs`
		- Windows: `%APPDATA%\MyApp-nodejs\Config` (for example, `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`)
		- Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`)
		*/
		readonly config: string;

		/**
		Directory for non-essential data files.

		Example locations (with the default `nodejs` suffix):

		- macOS: `~/Library/Caches/MyApp-nodejs`
		- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Cache` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Cache`)
		- Linux: `~/.cache/MyApp-nodejs` (or `$XDG_CACHE_HOME/MyApp-nodejs`)
		*/
		readonly cache: string;

		/**
		Directory for log files.

		Example locations (with the default `nodejs` suffix):

		- macOS: `~/Library/Logs/MyApp-nodejs`
		- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Log` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Log`)
		- Linux: `~/.local/state/MyApp-nodejs` (or `$XDG_STATE_HOME/MyApp-nodejs`)
		*/
		readonly log: string;

		/**
		Directory for temporary files.

		Example locations (with the default `nodejs` suffix):

		- macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs`
		- Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (for example, `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`)
		- Linux: `/tmp/USERNAME/MyApp-nodejs`
		*/
		readonly temp: string;
	}
}

declare const envPaths: {
	/**
	Get paths for storing things like data, config, cache, etc.

	Note: It only generates the path strings. It doesn't create the directories for you. You could use [`make-dir`](https://github.com/sindresorhus/make-dir) to create the directories.

	@param name - Name of your project. Used to generate the paths.
	@returns The paths to use for your project on current OS.

	@example
	```
	import envPaths = require('env-paths');

	const paths = envPaths('MyApp');

	paths.data;
	//=> '/home/sindresorhus/.local/share/MyApp-nodejs'

	paths.config
	//=> '/home/sindresorhus/.config/MyApp-nodejs'
	```
	*/
	(name: string, options?: envPaths.Options): envPaths.Paths;

	// TODO: Remove this for the next major release, refactor the whole definition to:
	// declare function envPaths(name: string, options?: envPaths.Options): envPaths.Paths;
	// export = envPaths;
	default: typeof envPaths;
};

export = envPaths;
'use strict';
const path = require('path');
const os = require('os');

const homedir = os.homedir();
const tmpdir = os.tmpdir();
const {env} = process;

const macos = name => {
	const library = path.join(homedir, 'Library');

	return {
		data: path.join(library, 'Application Support', name),
		config: path.join(library, 'Preferences', name),
		cache: path.join(library, 'Caches', name),
		log: path.join(library, 'Logs', name),
		temp: path.join(tmpdir, name)
	};
};

const windows = name => {
	const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming');
	const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local');

	return {
		// Data/config/cache/log are invented by me as Windows isn't opinionated about this
		data: path.join(localAppData, name, 'Data'),
		config: path.join(appData, name, 'Config'),
		cache: path.join(localAppData, name, 'Cache'),
		log: path.join(localAppData, name, 'Log'),
		temp: path.join(tmpdir, name)
	};
};

// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
const linux = name => {
	const username = path.basename(homedir);

	return {
		data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name),
		config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name),
		cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name),
		// https://wiki.debian.org/XDGBaseDirectorySpecification#state
		log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name),
		temp: path.join(tmpdir, username, name)
	};
};

const envPaths = (name, options) => {
	if (typeof name !== 'string') {
		throw new TypeError(`Expected string, got ${typeof name}`);
	}

	options = Object.assign({suffix: 'nodejs'}, options);

	if (options.suffix) {
		// Add suffix to prevent possible conflict with native apps
		name += `-${options.suffix}`;
	}

	if (process.platform === 'darwin') {
		return macos(name);
	}

	if (process.platform === 'win32') {
		return windows(name);
	}

	return linux(name);
};

module.exports = envPaths;
// TODO: Remove this for the next major release
module.exports.default = envPaths;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "env-paths",
	"version": "2.2.1",
	"description": "Get paths for storing things like data, config, cache, etc",
	"license": "MIT",
	"repository": "sindresorhus/env-paths",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"common",
		"user",
		"paths",
		"env",
		"environment",
		"directory",
		"dir",
		"appdir",
		"path",
		"data",
		"config",
		"cache",
		"logs",
		"temp",
		"linux",
		"unix"
	],
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.1",
		"xo": "^0.24.0"
	}
}
# env-paths

> Get paths for storing things like data, config, cache, etc

Uses the correct OS-specific paths. Most developers get this wrong.


## Install

```
$ npm install env-paths
```


## Usage

```js
const envPaths = require('env-paths');

const paths = envPaths('MyApp');

paths.data;
//=> '/home/sindresorhus/.local/share/MyApp-nodejs'

paths.config
//=> '/home/sindresorhus/.config/MyApp-nodejs'
```


## API

### paths = envPaths(name, options?)

Note: It only generates the path strings. It doesn't create the directories for you. You could use [`make-dir`](https://github.com/sindresorhus/make-dir) to create the directories.

#### name

Type: `string`

Name of your project. Used to generate the paths.

#### options

Type: `object`

##### suffix

Type: `string`<br>
Default: `'nodejs'`

**Don't use this option unless you really have to!**<br>
Suffix appended to the project name to avoid name conflicts with native
apps. Pass an empty string to disable it.

### paths.data

Directory for data files.

Example locations (with the default `nodejs` [suffix](#suffix)):

- macOS: `~/Library/Application Support/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Data` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Data`)
- Linux: `~/.local/share/MyApp-nodejs` (or `$XDG_DATA_HOME/MyApp-nodejs`)

### paths.config

Directory for config files.

Example locations (with the default `nodejs` [suffix](#suffix)):

- macOS: `~/Library/Preferences/MyApp-nodejs`
- Windows: `%APPDATA%\MyApp-nodejs\Config` (for example, `C:\Users\USERNAME\AppData\Roaming\MyApp-nodejs\Config`)
- Linux: `~/.config/MyApp-nodejs` (or `$XDG_CONFIG_HOME/MyApp-nodejs`)

### paths.cache

Directory for non-essential data files.

Example locations (with the default `nodejs` [suffix](#suffix)):

- macOS: `~/Library/Caches/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Cache` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Cache`)
- Linux: `~/.cache/MyApp-nodejs` (or `$XDG_CACHE_HOME/MyApp-nodejs`)

### paths.log

Directory for log files.

Example locations (with the default `nodejs` [suffix](#suffix)):

- macOS: `~/Library/Logs/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\MyApp-nodejs\Log` (for example, `C:\Users\USERNAME\AppData\Local\MyApp-nodejs\Log`)
- Linux: `~/.local/state/MyApp-nodejs` (or `$XDG_STATE_HOME/MyApp-nodejs`)

### paths.temp

Directory for temporary files.

Example locations (with the default `nodejs` [suffix](#suffix)):

- macOS: `/var/folders/jf/f2twvvvs5jl_m49tf034ffpw0000gn/T/MyApp-nodejs`
- Windows: `%LOCALAPPDATA%\Temp\MyApp-nodejs` (for example, `C:\Users\USERNAME\AppData\Local\Temp\MyApp-nodejs`)
- Linux: `/tmp/USERNAME/MyApp-nodejs`

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-env-paths?utm_source=npm-env-paths&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
declare const equal: (a: any, b: any) => boolean;
export = equal;
'use strict';

// do not edit .js files directly - edit src/index.jst


  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';


module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }


    if ((a instanceof Map) && (b instanceof Map)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      for (i of a.entries())
        if (!equal(i[1], b.get(i[0]))) return false;
      return true;
    }

    if ((a instanceof Set) && (b instanceof Set)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      return true;
    }

    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (a[i] !== b[i]) return false;
      return true;
    }


    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
declare const equal: (a: any, b: any) => boolean;
export = equal;
'use strict';

// do not edit .js files directly - edit src/index.jst


  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';


module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }


    if ((a instanceof Map) && (b instanceof Map)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      for (i of a.entries())
        if (!equal(i[1], b.get(i[0]))) return false;
      return true;
    }

    if ((a instanceof Set) && (b instanceof Set)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      return true;
    }

    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (a[i] !== b[i]) return false;
      return true;
    }


    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (key === '_owner' && a.$$typeof) {
        // React-specific: avoid traversing React elements' _owner.
        //  _owner contains circular references
        // and is not needed when comparing the actual elements (and not their owners)
        continue;
      }

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
declare module 'fast-deep-equal' {
    const equal: (a: any, b: any) => boolean;
    export = equal;
}
'use strict';

// do not edit .js files directly - edit src/index.jst



module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }



    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
MIT License

Copyright (c) 2017 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "fast-deep-equal",
  "version": "3.1.3",
  "description": "Fast deep equal",
  "main": "index.js",
  "scripts": {
    "eslint": "eslint *.js benchmark/*.js spec/*.js",
    "build": "node build",
    "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./",
    "test-spec": "mocha spec/*.spec.js -R spec",
    "test-cov": "nyc npm run test-spec",
    "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts",
    "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov",
    "prepublish": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/epoberezkin/fast-deep-equal.git"
  },
  "keywords": [
    "fast",
    "equal",
    "deep-equal"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/epoberezkin/fast-deep-equal/issues"
  },
  "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme",
  "devDependencies": {
    "coveralls": "^3.1.0",
    "dot": "^1.1.2",
    "eslint": "^7.2.0",
    "mocha": "^7.2.0",
    "nyc": "^15.1.0",
    "pre-commit": "^1.2.2",
    "react": "^16.12.0",
    "react-test-renderer": "^16.12.0",
    "sinon": "^9.0.2",
    "typescript": "^3.9.5"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  },
  "files": [
    "index.js",
    "index.d.ts",
    "react.js",
    "react.d.ts",
    "es6/"
  ],
  "types": "index.d.ts"
}
declare const equal: (a: any, b: any) => boolean;
export = equal;
'use strict';

// do not edit .js files directly - edit src/index.jst



module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }



    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (key === '_owner' && a.$$typeof) {
        // React-specific: avoid traversing React elements' _owner.
        //  _owner contains circular references
        // and is not needed when comparing the actual elements (and not their owners)
        continue;
      }

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
# fast-deep-equal
The fastest deep equal with ES6 Map, Set and Typed arrays support.

[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal)
[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal)
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master)


## Install

```bash
npm install fast-deep-equal
```


## Features

- ES5 compatible
- works in node.js (8+) and browsers (IE9+)
- checks equality of Date and RegExp objects by value.

ES6 equal (`require('fast-deep-equal/es6')`) also supports:
- Maps
- Sets
- Typed arrays


## Usage

```javascript
var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true
```

To support ES6 Maps, Sets and Typed arrays equality use:

```javascript
var equal = require('fast-deep-equal/es6');
console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true
```

To use with React (avoiding the traversal of React elements' _owner
property that contains circular references and is not needed when
comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)):

```javascript
var equal = require('fast-deep-equal/react');
var equal = require('fast-deep-equal/es6/react');
```


## Performance benchmark

Node.js v12.6.0:

```
fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled)
fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled)
fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled)
nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled)
shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled)
underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled)
lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled)
deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled)
deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled)
ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled)
util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled)
assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled)

The fastest is fast-deep-equal
```

To run benchmark (requires node.js 6+):

```bash
npm run benchmark
```

__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application.


## Enterprise support

fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.


## Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.


## License

[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE)
# Set default behavior to automatically convert line endings
* text=auto eol=lf
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 15
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
  - "discussion"
  - "feature request"
  - "bug"
  - "help wanted"
  - "plugin suggestion"
  - "good first issue"
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
  This issue has been automatically marked as stale because it has not had
  recent activity. It will be closed if no further activity occurs. Thank you
  for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: falseversion: 2
updates:
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
      interval: "monthly"
    open-pull-requests-limit: 10

  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "weekly"
    open-pull-requests-limit: 10
comment: |
  Hello! Thank you for contributing!
  It appears that you have changed the code, but the tests that verify your change are missing. Could you please add them?
fileExtensions:
  - '.ts'
  - '.js'

testDir: 'test'name: CI

on:
  push:
    branches:
     - main
     - master
     - next
     - 'v*'
    paths-ignore:
      - 'docs/**'
      - '*.md'
  pull_request:
    paths-ignore:
      - 'docs/**'
      - '*.md'

jobs:
  test:
    uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5.0.0
    with:
      license-check: true
      node-versions: '["16", "18", "20", "22"]'
name: package-manager-ci

on:
  push:
    branches:
     - main
     - master
     - next
     - 'v*'
    paths-ignore:
      - 'docs/**'
      - '*.md'
  pull_request:
    paths-ignore:
      - 'docs/**'
      - '*.md'

jobs:
  test:
    uses: fastify/workflows/.github/workflows/plugins-ci-package-manager.yml@v5.0.0
'use strict'

const benchmark = require('benchmark')
const suite = new benchmark.Suite()
const fasturi = require('./')
const urijs = require('uri-js')

const base = 'uri://a/b/c/d;p?q'

const domain = 'https://example.com/foo#bar$fiz'
const ipv4 = '//10.10.10.10'
const ipv6 = '//[2001:db8::7]'
const urn = 'urn:foo:a123,456'
const urnuuid = 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'

// Initialization as there is a lot to parse at first
// eg: regexes
fasturi.parse(domain)
urijs.parse(domain)

suite.add('fast-uri: parse domain', function () {
  fasturi.parse(domain)
})
suite.add('urijs: parse domain', function () {
  urijs.parse(domain)
})
suite.add('WHATWG URL: parse domain', function () {
  // eslint-disable-next-line
  new URL(domain)
})
suite.add('fast-uri: parse IPv4', function () {
  fasturi.parse(ipv4)
})
suite.add('urijs: parse IPv4', function () {
  urijs.parse(ipv4)
})
suite.add('fast-uri: parse IPv6', function () {
  fasturi.parse(ipv6)
})
suite.add('urijs: parse IPv6', function () {
  urijs.parse(ipv6)
})
suite.add('fast-uri: parse URN', function () {
  fasturi.parse(urn)
})
suite.add('urijs: parse URN', function () {
  urijs.parse(urn)
})
suite.add('WHATWG URL: parse URN', function () {
  // eslint-disable-next-line
  new URL(urn)
})
suite.add('fast-uri: parse URN uuid', function () {
  fasturi.parse(urnuuid)
})
suite.add('urijs: parse URN uuid', function () {
  urijs.parse(urnuuid)
})
suite.add('fast-uri: serialize uri', function () {
  fasturi.serialize({
    scheme: 'uri',
    userinfo: 'foo:bar',
    host: 'example.com',
    port: 1,
    path: 'path',
    query: 'query',
    fragment: 'fragment'
  })
})
suite.add('urijs: serialize uri', function () {
  urijs.serialize({
    scheme: 'uri',
    userinfo: 'foo:bar',
    host: 'example.com',
    port: 1,
    path: 'path',
    query: 'query',
    fragment: 'fragment'
  })
})
suite.add('fast-uri: serialize IPv6', function () {
  fasturi.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
})
suite.add('urijs: serialize IPv6', function () {
  urijs.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' })
})
suite.add('fast-uri: serialize ws', function () {
  fasturi.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
})
suite.add('urijs: serialize ws', function () {
  urijs.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true })
})
suite.add('fast-uri: resolve', function () {
  fasturi.resolve(base, '../../../g')
})
suite.add('urijs: resolve', function () {
  urijs.resolve(base, '../../../g')
})
suite.on('cycle', cycle)

suite.run()

function cycle (e) {
  console.log(e.target.toString())
}
'use strict'

const { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require('./lib/utils')
const SCHEMES = require('./lib/schemes')

function normalize (uri, options) {
  if (typeof uri === 'string') {
    uri = serialize(parse(uri, options), options)
  } else if (typeof uri === 'object') {
    uri = parse(serialize(uri, options), options)
  }
  return uri
}

function resolve (baseURI, relativeURI, options) {
  const schemelessOptions = Object.assign({ scheme: 'null' }, options)
  const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true)
  return serialize(resolved, { ...schemelessOptions, skipEscape: true })
}

function resolveComponents (base, relative, options, skipNormalization) {
  const target = {}
  if (!skipNormalization) {
    base = parse(serialize(base, options), options) // normalize base components
    relative = parse(serialize(relative, options), options) // normalize relative components
  }
  options = options || {}

  if (!options.tolerant && relative.scheme) {
    target.scheme = relative.scheme
    // target.authority = relative.authority;
    target.userinfo = relative.userinfo
    target.host = relative.host
    target.port = relative.port
    target.path = removeDotSegments(relative.path || '')
    target.query = relative.query
  } else {
    if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
      // target.authority = relative.authority;
      target.userinfo = relative.userinfo
      target.host = relative.host
      target.port = relative.port
      target.path = removeDotSegments(relative.path || '')
      target.query = relative.query
    } else {
      if (!relative.path) {
        target.path = base.path
        if (relative.query !== undefined) {
          target.query = relative.query
        } else {
          target.query = base.query
        }
      } else {
        if (relative.path.charAt(0) === '/') {
          target.path = removeDotSegments(relative.path)
        } else {
          if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
            target.path = '/' + relative.path
          } else if (!base.path) {
            target.path = relative.path
          } else {
            target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path
          }
          target.path = removeDotSegments(target.path)
        }
        target.query = relative.query
      }
      // target.authority = base.authority;
      target.userinfo = base.userinfo
      target.host = base.host
      target.port = base.port
    }
    target.scheme = base.scheme
  }

  target.fragment = relative.fragment

  return target
}

function equal (uriA, uriB, options) {
  if (typeof uriA === 'string') {
    uriA = unescape(uriA)
    uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true })
  } else if (typeof uriA === 'object') {
    uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true })
  }

  if (typeof uriB === 'string') {
    uriB = unescape(uriB)
    uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true })
  } else if (typeof uriB === 'object') {
    uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true })
  }

  return uriA.toLowerCase() === uriB.toLowerCase()
}

function serialize (cmpts, opts) {
  const components = {
    host: cmpts.host,
    scheme: cmpts.scheme,
    userinfo: cmpts.userinfo,
    port: cmpts.port,
    path: cmpts.path,
    query: cmpts.query,
    nid: cmpts.nid,
    nss: cmpts.nss,
    uuid: cmpts.uuid,
    fragment: cmpts.fragment,
    reference: cmpts.reference,
    resourceName: cmpts.resourceName,
    secure: cmpts.secure,
    error: ''
  }
  const options = Object.assign({}, opts)
  const uriTokens = []

  // find scheme handler
  const schemeHandler = SCHEMES[(options.scheme || components.scheme || '').toLowerCase()]

  // perform scheme specific serialization
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options)

  if (components.path !== undefined) {
    if (!options.skipEscape) {
      components.path = escape(components.path)

      if (components.scheme !== undefined) {
        components.path = components.path.split('%3A').join(':')
      }
    } else {
      components.path = unescape(components.path)
    }
  }

  if (options.reference !== 'suffix' && components.scheme) {
    uriTokens.push(components.scheme, ':')
  }

  const authority = recomposeAuthority(components, options)
  if (authority !== undefined) {
    if (options.reference !== 'suffix') {
      uriTokens.push('//')
    }

    uriTokens.push(authority)

    if (components.path && components.path.charAt(0) !== '/') {
      uriTokens.push('/')
    }
  }
  if (components.path !== undefined) {
    let s = components.path

    if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
      s = removeDotSegments(s)
    }

    if (authority === undefined) {
      s = s.replace(/^\/\//u, '/%2F') // don't allow the path to start with "//"
    }

    uriTokens.push(s)
  }

  if (components.query !== undefined) {
    uriTokens.push('?', components.query)
  }

  if (components.fragment !== undefined) {
    uriTokens.push('#', components.fragment)
  }
  return uriTokens.join('')
}

const hexLookUp = Array.from({ length: 127 }, (v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)))

function nonSimpleDomain (value) {
  let code = 0
  for (let i = 0, len = value.length; i < len; ++i) {
    code = value.charCodeAt(i)
    if (code > 126 || hexLookUp[code]) {
      return true
    }
  }
  return false
}

const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u

function parse (uri, opts) {
  const options = Object.assign({}, opts)
  const parsed = {
    scheme: undefined,
    userinfo: undefined,
    host: '',
    port: undefined,
    path: '',
    query: undefined,
    fragment: undefined
  }
  const gotEncoding = uri.indexOf('%') !== -1
  let isIP = false
  if (options.reference === 'suffix') uri = (options.scheme ? options.scheme + ':' : '') + '//' + uri

  const matches = uri.match(URI_PARSE)

  if (matches) {
    // store each component
    parsed.scheme = matches[1]
    parsed.userinfo = matches[3]
    parsed.host = matches[4]
    parsed.port = parseInt(matches[5], 10)
    parsed.path = matches[6] || ''
    parsed.query = matches[7]
    parsed.fragment = matches[8]

    // fix port number
    if (isNaN(parsed.port)) {
      parsed.port = matches[5]
    }
    if (parsed.host) {
      const ipv4result = normalizeIPv4(parsed.host)
      if (ipv4result.isIPV4 === false) {
        const ipv6result = normalizeIPv6(ipv4result.host, { isIPV4: false })
        parsed.host = ipv6result.host.toLowerCase()
        isIP = ipv6result.isIPV6
      } else {
        parsed.host = ipv4result.host
        isIP = true
      }
    }
    if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && !parsed.path && parsed.query === undefined) {
      parsed.reference = 'same-document'
    } else if (parsed.scheme === undefined) {
      parsed.reference = 'relative'
    } else if (parsed.fragment === undefined) {
      parsed.reference = 'absolute'
    } else {
      parsed.reference = 'uri'
    }

    // check for reference errors
    if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {
      parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'
    }

    // find scheme handler
    const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || '').toLowerCase()]

    // check if scheme can't handle IRIs
    if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
      // if host component is a domain name
      if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
        // convert Unicode IDN -> ASCII IDN
        try {
          parsed.host = URL.domainToASCII(parsed.host.toLowerCase())
        } catch (e) {
          parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e
        }
      }
      // convert IRI -> URI
    }

    if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {
      if (gotEncoding && parsed.scheme !== undefined) {
        parsed.scheme = unescape(parsed.scheme)
      }
      if (gotEncoding && parsed.host !== undefined) {
        parsed.host = unescape(parsed.host)
      }
      if (parsed.path !== undefined && parsed.path.length) {
        parsed.path = escape(unescape(parsed.path))
      }
      if (parsed.fragment !== undefined && parsed.fragment.length) {
        parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
      }
    }

    // perform scheme specific parsing
    if (schemeHandler && schemeHandler.parse) {
      schemeHandler.parse(parsed, options)
    }
  } else {
    parsed.error = parsed.error || 'URI can not be parsed.'
  }
  return parsed
}

const fastUri = {
  SCHEMES,
  normalize,
  resolve,
  resolveComponents,
  equal,
  serialize,
  parse
}

module.exports = fastUri
module.exports.default = fastUri
module.exports.fastUri = fastUri
'use strict'

const UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu

function isSecure (wsComponents) {
  return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === 'wss'
}

function httpParse (components) {
  if (!components.host) {
    components.error = components.error || 'HTTP URIs must have a host.'
  }

  return components
}

function httpSerialize (components) {
  const secure = String(components.scheme).toLowerCase() === 'https'

  // normalize the default port
  if (components.port === (secure ? 443 : 80) || components.port === '') {
    components.port = undefined
  }

  // normalize the empty path
  if (!components.path) {
    components.path = '/'
  }

  // NOTE: We do not parse query strings for HTTP URIs
  // as WWW Form Url Encoded query strings are part of the HTML4+ spec,
  // and not the HTTP spec.

  return components
}

function wsParse (wsComponents) {
// indicate if the secure flag is set
  wsComponents.secure = isSecure(wsComponents)

  // construct resouce name
  wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '')
  wsComponents.path = undefined
  wsComponents.query = undefined

  return wsComponents
}

function wsSerialize (wsComponents) {
// normalize the default port
  if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === '') {
    wsComponents.port = undefined
  }

  // ensure scheme matches secure flag
  if (typeof wsComponents.secure === 'boolean') {
    wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws')
    wsComponents.secure = undefined
  }

  // reconstruct path from resource name
  if (wsComponents.resourceName) {
    const [path, query] = wsComponents.resourceName.split('?')
    wsComponents.path = (path && path !== '/' ? path : undefined)
    wsComponents.query = query
    wsComponents.resourceName = undefined
  }

  // forbid fragment component
  wsComponents.fragment = undefined

  return wsComponents
}

function urnParse (urnComponents, options) {
  if (!urnComponents.path) {
    urnComponents.error = 'URN can not be parsed'
    return urnComponents
  }
  const matches = urnComponents.path.match(URN_REG)
  if (matches) {
    const scheme = options.scheme || urnComponents.scheme || 'urn'
    urnComponents.nid = matches[1].toLowerCase()
    urnComponents.nss = matches[2]
    const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`
    const schemeHandler = SCHEMES[urnScheme]
    urnComponents.path = undefined

    if (schemeHandler) {
      urnComponents = schemeHandler.parse(urnComponents, options)
    }
  } else {
    urnComponents.error = urnComponents.error || 'URN can not be parsed.'
  }

  return urnComponents
}

function urnSerialize (urnComponents, options) {
  const scheme = options.scheme || urnComponents.scheme || 'urn'
  const nid = urnComponents.nid.toLowerCase()
  const urnScheme = `${scheme}:${options.nid || nid}`
  const schemeHandler = SCHEMES[urnScheme]

  if (schemeHandler) {
    urnComponents = schemeHandler.serialize(urnComponents, options)
  }

  const uriComponents = urnComponents
  const nss = urnComponents.nss
  uriComponents.path = `${nid || options.nid}:${nss}`

  options.skipEscape = true
  return uriComponents
}

function urnuuidParse (urnComponents, options) {
  const uuidComponents = urnComponents
  uuidComponents.uuid = uuidComponents.nss
  uuidComponents.nss = undefined

  if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
    uuidComponents.error = uuidComponents.error || 'UUID is not valid.'
  }

  return uuidComponents
}

function urnuuidSerialize (uuidComponents) {
  const urnComponents = uuidComponents
  // normalize UUID
  urnComponents.nss = (uuidComponents.uuid || '').toLowerCase()
  return urnComponents
}

const http = {
  scheme: 'http',
  domainHost: true,
  parse: httpParse,
  serialize: httpSerialize
}

const https = {
  scheme: 'https',
  domainHost: http.domainHost,
  parse: httpParse,
  serialize: httpSerialize
}

const ws = {
  scheme: 'ws',
  domainHost: true,
  parse: wsParse,
  serialize: wsSerialize
}

const wss = {
  scheme: 'wss',
  domainHost: ws.domainHost,
  parse: ws.parse,
  serialize: ws.serialize
}

const urn = {
  scheme: 'urn',
  parse: urnParse,
  serialize: urnSerialize,
  skipNormalize: true
}

const urnuuid = {
  scheme: 'urn:uuid',
  parse: urnuuidParse,
  serialize: urnuuidSerialize,
  skipNormalize: true
}

const SCHEMES = {
  http,
  https,
  ws,
  wss,
  urn,
  'urn:uuid': urnuuid
}

module.exports = SCHEMES
'use strict'

const HEX = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  a: 10,
  A: 10,
  b: 11,
  B: 11,
  c: 12,
  C: 12,
  d: 13,
  D: 13,
  e: 14,
  E: 14,
  f: 15,
  F: 15
}

module.exports = {
  HEX
}
'use strict'

const { HEX } = require('./scopedChars')

function normalizeIPv4 (host) {
  if (findToken(host, '.') < 3) { return { host, isIPV4: false } }
  const matches = host.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u) || []
  const [address] = matches
  if (address) {
    return { host: stripLeadingZeros(address, '.'), isIPV4: true }
  } else {
    return { host, isIPV4: false }
  }
}

/**
 * @param {string[]} input
 * @param {boolean} [keepZero=false]
 * @returns {string|undefined}
 */
function stringArrayToHexStripped (input, keepZero = false) {
  let acc = ''
  let strip = true
  for (const c of input) {
    if (HEX[c] === undefined) return undefined
    if (c !== '0' && strip === true) strip = false
    if (!strip) acc += c
  }
  if (keepZero && acc.length === 0) acc = '0'
  return acc
}

function getIPV6 (input) {
  let tokenCount = 0
  const output = { error: false, address: '', zone: '' }
  const address = []
  const buffer = []
  let isZone = false
  let endipv6Encountered = false
  let endIpv6 = false

  function consume () {
    if (buffer.length) {
      if (isZone === false) {
        const hex = stringArrayToHexStripped(buffer)
        if (hex !== undefined) {
          address.push(hex)
        } else {
          output.error = true
          return false
        }
      }
      buffer.length = 0
    }
    return true
  }

  for (let i = 0; i < input.length; i++) {
    const cursor = input[i]
    if (cursor === '[' || cursor === ']') { continue }
    if (cursor === ':') {
      if (endipv6Encountered === true) {
        endIpv6 = true
      }
      if (!consume()) { break }
      tokenCount++
      address.push(':')
      if (tokenCount > 7) {
        // not valid
        output.error = true
        break
      }
      if (i - 1 >= 0 && input[i - 1] === ':') {
        endipv6Encountered = true
      }
      continue
    } else if (cursor === '%') {
      if (!consume()) { break }
      // switch to zone detection
      isZone = true
    } else {
      buffer.push(cursor)
      continue
    }
  }
  if (buffer.length) {
    if (isZone) {
      output.zone = buffer.join('')
    } else if (endIpv6) {
      address.push(buffer.join(''))
    } else {
      address.push(stringArrayToHexStripped(buffer))
    }
  }
  output.address = address.join('')
  return output
}

function normalizeIPv6 (host, opts = {}) {
  if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
  const ipv6 = getIPV6(host)

  if (!ipv6.error) {
    let newHost = ipv6.address
    let escapedHost = ipv6.address
    if (ipv6.zone) {
      newHost += '%' + ipv6.zone
      escapedHost += '%25' + ipv6.zone
    }
    return { host: newHost, escapedHost, isIPV6: true }
  } else {
    return { host, isIPV6: false }
  }
}

function stripLeadingZeros (str, token) {
  let out = ''
  let skip = true
  const l = str.length
  for (let i = 0; i < l; i++) {
    const c = str[i]
    if (c === '0' && skip) {
      if ((i + 1 <= l && str[i + 1] === token) || i + 1 === l) {
        out += c
        skip = false
      }
    } else {
      if (c === token) {
        skip = true
      } else {
        skip = false
      }
      out += c
    }
  }
  return out
}

function findToken (str, token) {
  let ind = 0
  for (let i = 0; i < str.length; i++) {
    if (str[i] === token) ind++
  }
  return ind
}

const RDS1 = /^\.\.?\//u
const RDS2 = /^\/\.(?:\/|$)/u
const RDS3 = /^\/\.\.(?:\/|$)/u
const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u

function removeDotSegments (input) {
  const output = []

  while (input.length) {
    if (input.match(RDS1)) {
      input = input.replace(RDS1, '')
    } else if (input.match(RDS2)) {
      input = input.replace(RDS2, '/')
    } else if (input.match(RDS3)) {
      input = input.replace(RDS3, '/')
      output.pop()
    } else if (input === '.' || input === '..') {
      input = ''
    } else {
      const im = input.match(RDS5)
      if (im) {
        const s = im[0]
        input = input.slice(s.length)
        output.push(s)
      } else {
        throw new Error('Unexpected dot segment condition')
      }
    }
  }
  return output.join('')
}

function normalizeComponentEncoding (components, esc) {
  const func = esc !== true ? escape : unescape
  if (components.scheme !== undefined) {
    components.scheme = func(components.scheme)
  }
  if (components.userinfo !== undefined) {
    components.userinfo = func(components.userinfo)
  }
  if (components.host !== undefined) {
    components.host = func(components.host)
  }
  if (components.path !== undefined) {
    components.path = func(components.path)
  }
  if (components.query !== undefined) {
    components.query = func(components.query)
  }
  if (components.fragment !== undefined) {
    components.fragment = func(components.fragment)
  }
  return components
}

function recomposeAuthority (components, options) {
  const uriTokens = []

  if (components.userinfo !== undefined) {
    uriTokens.push(components.userinfo)
    uriTokens.push('@')
  }

  if (components.host !== undefined) {
    let host = unescape(components.host)
    const ipV4res = normalizeIPv4(host)

    if (ipV4res.isIPV4) {
      host = ipV4res.host
    } else {
      const ipV6res = normalizeIPv6(ipV4res.host, { isIPV4: false })
      if (ipV6res.isIPV6 === true) {
        host = `[${ipV6res.escapedHost}]`
      } else {
        host = components.host
      }
    }
    uriTokens.push(host)
  }

  if (typeof components.port === 'number' || typeof components.port === 'string') {
    uriTokens.push(':')
    uriTokens.push(String(components.port))
  }

  return uriTokens.length ? uriTokens.join('') : undefined
};

module.exports = {
  recomposeAuthority,
  normalizeComponentEncoding,
  removeDotSegments,
  normalizeIPv4,
  normalizeIPv6,
  stringArrayToHexStripped
}
Copyright (c) 2021 The Fastify Team
Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * The names of any contributors may not be used to endorse or promote
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

                                  *   *   *

The complete list of contributors can be found at:
- https://github.com/garycourt/uri-js/graphs/contributors{
  "name": "fast-uri",
  "description": "Dependency free RFC 3986 URI toolbox",
  "version": "3.0.3",
  "main": "index.js",
  "type": "commonjs",
  "types": "types/index.d.ts",
  "license": "BSD-3-Clause",
  "author": "Vincent Le Goff <vince.legoff@gmail.com> (https://github.com/zekth)",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/fastify/fast-uri.git"
  },
  "bugs": {
    "url": "https://github.com/fastify/fast-uri/issues"
  },
  "homepage": "https://github.com/fastify/fast-uri",
  "scripts": {
    "bench": "node benchmark.js",
    "lint": "standard | snazzy",
    "lint:fix": "standard --fix",
    "test": "npm run lint && npm run test:unit && npm run test:typescript",
    "test:ci": "npm run lint && npm run test:unit -- --coverage-report=lcovonly && npm run test:typescript",
    "test:unit": "npx tape test/**/*.js",
    "test:unit:dev": "npm run test:unit -- --coverage-report=html",
    "test:typescript": "tsd"
  },
  "devDependencies": {
    "@fastify/pre-commit": "^2.1.0",
    "ajv": "^8.16.0",
    "benchmark": "^2.1.4",
    "coveralls": "^3.1.1",
    "snazzy": "^9.0.0",
    "standard": "^17.1.0",
    "tape": "^5.8.1",
    "tsd": "^0.31.0",
    "uri-js": "^4.4.1"
  }
}
# fast-uri

<div align="center">

[![CI](https://github.com/fastify/fast-uri/actions/workflows/ci.yml/badge.svg)](https://github.com/fastify/fast-uri/actions/workflows/ci.yml)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)

</div>

Dependency free RFC 3986 URI toolbox.

## Usage

## Options

All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties:

*	`scheme` (string)
	Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior.

*	`reference` (string)
	If set to `"suffix"`, it indicates that the URI is in the suffix format and the parser will use the option's `scheme` property to determine the URI's scheme.

*	`tolerant` (boolean, false)
	If set to `true`, the parser will relax URI resolving rules.

*	`absolutePath` (boolean, false)
	If set to `true`, the serializer will not resolve a relative `path` component.

*	`unicodeSupport` (boolean, false)
	If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt).

*	`domainHost` (boolean, false)
	If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt).

### Parse

```js
const uri = require('fast-uri')
uri.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
// Output
{
  scheme : "uri",
  userinfo : "user:pass",
  host : "example.com",
  port : 123,
  path : "/one/two.three",
  query : "q1=a1&q2=a2",
  fragment : "body"
}
```

### Serialize

```js
const uri = require('fast-uri')
uri.serialize({scheme : "http", host : "example.com", fragment : "footer"})
// Output
"http://example.com/#footer"

```

### Resolve

```js
const uri = require('fast-uri')
uri.resolve("uri://a/b/c/d?q", "../../g") 
// Output
"uri://a/g"
```

### Equal

```js
const uri = require('fast-uri')
uri.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d")
// Output
true
```

## Scheme supports

fast-uri supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, fast-uri has built in support for the following schemes:

*	http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\]
*	https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\]
*	ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
*	wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
*	urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\]
*	urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\]


## Benchmarks

```
fast-uri: parse domain x 1,306,864 ops/sec ±0.31% (100 runs sampled)
urijs: parse domain x 483,001 ops/sec ±0.09% (99 runs sampled)
WHATWG URL: parse domain x 862,461 ops/sec ±0.18% (97 runs sampled)
fast-uri: parse IPv4 x 2,381,452 ops/sec ±0.26% (96 runs sampled)
urijs: parse IPv4 x 384,705 ops/sec ±0.34% (99 runs sampled)
WHATWG URL: parse IPv4 NOT SUPPORTED
fast-uri: parse IPv6 x 923,519 ops/sec ±0.09% (100 runs sampled)
urijs: parse IPv6 x 289,070 ops/sec ±0.07% (95 runs sampled)
WHATWG URL: parse IPv6 NOT SUPPORTED
fast-uri: parse URN x 2,596,395 ops/sec ±0.42% (98 runs sampled)
urijs: parse URN x 1,152,412 ops/sec ±0.09% (97 runs sampled)
WHATWG URL: parse URN x 1,183,307 ops/sec ±0.38% (100 runs sampled)
fast-uri: parse URN uuid x 1,666,861 ops/sec ±0.10% (98 runs sampled)
urijs: parse URN uuid x 852,724 ops/sec ±0.17% (95 runs sampled)
WHATWG URL: parse URN uuid NOT SUPPORTED
fast-uri: serialize uri x 1,741,499 ops/sec ±0.57% (95 runs sampled)
urijs: serialize uri x 389,014 ops/sec ±0.28% (93 runs sampled)
fast-uri: serialize IPv6 x 441,095 ops/sec ±0.37% (97 runs sampled)
urijs: serialize IPv6 x 255,443 ops/sec ±0.58% (94 runs sampled)
fast-uri: serialize ws x 1,448,667 ops/sec ±0.25% (97 runs sampled)
urijs: serialize ws x 352,884 ops/sec ±0.08% (96 runs sampled)
fast-uri: resolve x 340,084 ops/sec ±0.98% (98 runs sampled)
urijs: resolve x 225,759 ops/sec ±0.37% (95 runs sampled)
```

## TODO

- [ ] Support MailTo
- [ ] Be 100% iso compatible with uri-js
- [ ] Add browser test stack
const AJV = require('ajv')
const fastUri = require('../')
const ajv = new AJV({
  uriResolver: fastUri // comment this line to see it works with uri-js
})
const test = require('tape')

test('ajv', t => {
  t.plan(1)
  const schema = {
    $ref: '#/definitions/Record%3Cstring%2CPerson%3E',
    definitions: {
      Person: {
        type: 'object',
        properties: {
          firstName: {
            type: 'string'
          }
        }
      },
      'Record<string,Person>': {
        type: 'object',
        additionalProperties: {
          $ref: '#/definitions/Person'
        }
      }
    }
  }

  const data = {
    joe: {
      firstName: 'Joe'
    }

  }

  const validate = ajv.compile(schema)
  t.ok(validate(data))
})
'use strict'

const test = require('tape')
const fastifyURI = require('../')
const urijs = require('uri-js')

test('compatibility Parse', (t) => {
  const toParse = [
    '//www.g.com/error\n/bleh/bleh',
    'https://fastify.org',
    '/definitions/Record%3Cstring%2CPerson%3E',
    '//10.10.10.10',
    // '//10.10.000.10', <-- not a valid URI per URI spec: https://datatracker.ietf.org/doc/html/rfc5954#section-4.1
    '//[2001:db8::7%en0]',
    '//[2001:dbZ::1]:80',
    '//[2001:db8::1]:80',
    '//[2001:db8::001]:80',
    'uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body',
    'http://user:pass@example.com:123/one/space in.url?q1=a1&q2=a2#body',
    'http://User:Pass@example.com:123/one/space in.url?q1=a1&q2=a2#body',
    'http://A%3AB@example.com:123/one/space',
    '//[::ffff:129.144.52.38]',
    'uri://10.10.10.10.example.com/en/process',
    '//[2606:2800:220:1:248:1893:25c8:1946]/test',
    'ws://example.com/chat',
    'ws://example.com/foo?bar=baz',
    'wss://example.com/?bar=baz',
    'wss://example.com/chat',
    'wss://example.com/foo?bar=baz',
    'wss://example.com/?bar=baz',
    'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6',
    'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6',
    'urn:example:%D0%B0123,z456',
    '//[2606:2800:220:1:248:1893:25c8:1946:43209]',
    'http://foo.bar',
    'http://',
    '#/$defs/stringMap',
    '#/$defs/string%20Map',
    '#/$defs/string Map',
    '//?json=%7B%22foo%22%3A%22bar%22%7D'
    //  'mailto:chris@example.com'-203845,
    //  'mailto:infobot@example.com?subject=current-issue',
    //  'mailto:infobot@example.com?body=send%20current-issue',
    //  'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index',
    //  'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E',
    //  'mailto:majordomo@example.com?body=subscribe%20bamboo-l',
    //  'mailto:joe@example.com?cc=bob@example.com&body=hello',
    //  'mailto:gorby%25kremvax@example.com',
    //  'mailto:unlikely%3Faddress@example.com?blat=foop',
    //  'mailto:Mike%26family@example.org',
    //  'mailto:%22not%40me%22@example.org',
    //  'mailto:%22oh%5C%5Cno%22@example.org',
    //  'mailto:%22%5C%5C%5C%22it\'s%5C%20ugly%5C%5C%5C%22%22@example.org',
    //  'mailto:user@example.org?subject=caf%C3%A9',
    //  'mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D',
    //  'mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D',
    //  'mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9',
    //  'mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO'
  ]
  toParse.forEach((x) => {
    t.same(fastifyURI.parse(x), urijs.parse(x), 'Compatibility parse: ' + x)
  })
  t.end()
})

test('compatibility serialize', (t) => {
  const toSerialize = [
    { host: '10.10.10.10.example.com' },
    { host: '2001:db8::7' },
    { host: '::ffff:129.144.52.38' },
    { host: '2606:2800:220:1:248:1893:25c8:1946' },
    { host: '10.10.10.10.example.com' },
    { host: '10.10.10.10' },
    { path: '?query' },
    { path: 'foo:bar' },
    { path: '//path' },
    {
      scheme: 'uri',
      host: 'example.com',
      port: '9000'
    },
    {
      scheme: 'uri',
      userinfo: 'foo:bar',
      host: 'example.com',
      port: 1,
      path: 'path',
      query: 'query',
      fragment: 'fragment'
    },
    {
      scheme: '',
      userinfo: '',
      host: '',
      port: 0,
      path: '',
      query: '',
      fragment: ''
    },
    {
      scheme: undefined,
      userinfo: undefined,
      host: undefined,
      port: undefined,
      path: undefined,
      query: undefined,
      fragment: undefined
    },
    { host: 'fe80::a%en1' },
    { host: 'fe80::a%25en1' },
    {
      scheme: 'ws',
      host: 'example.com',
      resourceName: '/foo?bar',
      secure: true
    },
    {
      scheme: 'scheme',
      path: 'with:colon'
    }
  ]
  toSerialize.forEach((x) => {
    const r = JSON.stringify(x)
    t.same(
      fastifyURI.serialize(x),
      urijs.serialize(x),
      'Compatibility serialize: ' + JSON.stringify(r)
    )
  })
  t.end()
})
'use strict'

const test = require('tape')
const URI = require('../')

const fn = URI.equal
const runTest = (t, suite) => {
  suite.forEach(s => {
    const operator = s.result ? '==' : '!='
    t.equal(fn(s.pair[0], s.pair[1]), s.result, `${s.pair[0]} ${operator} ${s.pair[1]}`)
    t.equal(fn(s.pair[1], s.pair[0]), s.result, `${s.pair[1]} ${operator} ${s.pair[0]}`)
  })
}

test('URI Equals', (t) => {
  const suite = [
    { pair: ['example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'], result: true }, // test from RFC 3986
    { pair: ['http://example.org/~user', 'http://example.org/%7euser'], result: true } // test from RFC 3987
  ]
  runTest(t, suite)
  t.end()
})

//   test('IRI Equals', (t) => {
//     // example from RFC 3987
//     t.equal(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
//     t.end()
//   })

test('HTTP Equals', (t) => {
  const suite = [
    // test from RFC 2616
    { pair: ['http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'], result: true },
    { pair: [{ scheme: 'http', host: 'abc.com', port: 80, path: '/~smith/home.html' }, 'http://abc.com/~smith/home.html'], result: true },
    { pair: ['http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
    { pair: ['http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'], result: true },
    { pair: ['HTTP://ABC.COM', 'http://abc.com/'], result: true },
    // test from RFC 3986
    { pair: ['http://example.com:/', 'http://example.com:80/'], result: true }
  ]
  runTest(t, suite)
  t.end()
})

test('HTTPS Equals', (t) => {
  const suite = [
    { pair: ['https://example.com', 'https://example.com:443/'], result: true },
    { pair: ['https://example.com:/', 'https://example.com:443/'], result: true }
  ]
  runTest(t, suite)
  t.end()
})

test('URN Equals', (t) => {
  const suite = [
    // test from RFC 2141
    { pair: ['urn:foo:a123,456', 'urn:foo:a123,456'], result: true },
    { pair: ['urn:foo:a123,456', 'URN:foo:a123,456'], result: true },
    { pair: ['urn:foo:a123,456', 'urn:FOO:a123,456'], result: true }
  ]

  // Disabling for now as the whole equal logic might need
  // to be refactored
  // t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
  // t.equal(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)

  runTest(t, suite)
  t.end()
})

test('UUID Equals', (t) => {
  const suite = [
    { pair: ['URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'], result: true }
  ]

  runTest(t, suite)
  t.end()
})

// test('Mailto Equals', (t) => {
//   // tests from RFC 6068
//   t.equal(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
//   t.equal(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
//   t.end()
// })

test('WS Equal', (t) => {
  const suite = [
    { pair: ['WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'], result: true }
  ]

  runTest(t, suite)
  t.end()
})

test('WSS Equal', (t) => {
  const suite = [
    { pair: ['WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'], result: true }
  ]

  runTest(t, suite)
  t.end()
})
'use strict'

const test = require('tape')
const URI = require('../')

test('URI parse', (t) => {
  let components

  // scheme
  components = URI.parse('uri:')
  t.equal(components.error, undefined, 'scheme errors')
  t.equal(components.scheme, 'uri', 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // userinfo
  components = URI.parse('//@')
  t.equal(components.error, undefined, 'userinfo errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, "@", "authority");
  t.equal(components.userinfo, '', 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // host
  components = URI.parse('//')
  t.equal(components.error, undefined, 'host errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, "", "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // port
  components = URI.parse('//:')
  t.equal(components.error, undefined, 'port errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, ":", "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, '', 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // path
  components = URI.parse('')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // query
  components = URI.parse('?')
  t.equal(components.error, undefined, 'query errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, '', 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // fragment
  components = URI.parse('#')
  t.equal(components.error, undefined, 'fragment errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '', 'fragment')

  // fragment with character tabulation
  components = URI.parse('#\t')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%09', 'fragment')

  // fragment with line feed
  components = URI.parse('#\n')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0A', 'fragment')

  // fragment with line tabulation
  components = URI.parse('#\v')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0B', 'fragment')

  // fragment with form feed
  components = URI.parse('#\f')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0C', 'fragment')

  // fragment with carriage return
  components = URI.parse('#\r')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0D', 'fragment')

  // all
  components = URI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
  t.equal(components.error, undefined, 'all errors')
  t.equal(components.scheme, 'uri', 'scheme')
  // t.equal(components.authority, "user:pass@example.com:123", "authority");
  t.equal(components.userinfo, 'user:pass', 'userinfo')
  t.equal(components.host, 'example.com', 'host')
  t.equal(components.port, 123, 'port')
  t.equal(components.path, '/one/two.three', 'path')
  t.equal(components.query, 'q1=a1&q2=a2', 'query')
  t.equal(components.fragment, 'body', 'fragment')

  // IPv4address
  components = URI.parse('//10.10.10.10')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '10.10.10.10', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv4address with unformated 0 stay as-is
  components = URI.parse('//10.10.000.10') // not valid as per https://datatracker.ietf.org/doc/html/rfc5954#section-4.1
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '10.10.000.10', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')
  components = URI.parse('//01.01.01.01') // not valid in URIs: https://datatracker.ietf.org/doc/html/rfc3986#section-7.4
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '01.01.01.01', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address
  components = URI.parse('//[2001:db8::7]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::7', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // invalid IPv6
  components = URI.parse('//[2001:dbZ::7]')
  t.equal(components.host, '[2001:dbz::7]')

  // mixed IPv4address & IPv6address
  components = URI.parse('//[::ffff:129.144.52.38]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '::ffff:129.144.52.38', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
  components = URI.parse('uri://10.10.10.10.example.com/en/process')
  t.equal(components.error, undefined, 'mixed errors')
  t.equal(components.scheme, 'uri', 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '10.10.10.10.example.com', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '/en/process', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
  components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
  t.equal(components.error, undefined, 'IPv6address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '/test', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address, example from RFC 5952
  components = URI.parse('//[2001:db8::1]:80')
  t.equal(components.error, undefined, 'IPv6address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::1', 'host')
  t.equal(components.port, 80, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address with zone identifier, RFC 6874
  components = URI.parse('//[fe80::a%25en1]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, 'fe80::a%en1', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
  components = URI.parse('//[2001:db8::7%en0]')
  t.equal(components.error, undefined, 'IPv6address interface errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::7%en0', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // UUID V1
  components = URI.parse('urn:uuid:b571b0bc-4713-11ec-81d3-0242ac130003')
  t.equal(components.error, undefined, 'errors')
  t.equal(components.scheme, 'urn', 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, undefined, 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')
  t.equal(components.nid, 'uuid', 'nid')
  t.equal(components.nss, undefined, 'nss')
  t.equal(components.uuid, 'b571b0bc-4713-11ec-81d3-0242ac130003', 'uuid')

  // UUID v4
  components = URI.parse('urn:uuid:97a32222-89b7-420e-8507-4360723e2c2a')
  t.equal(components.uuid, '97a32222-89b7-420e-8507-4360723e2c2a', 'uuid')

  components = URI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
  t.notSame(components.error, undefined, 'errors')

  components = URI.parse('urn:foo:a123,456')
  t.equal(components.error, undefined, 'errors')
  t.equal(components.scheme, 'urn', 'scheme')
  // t.equal(components.authority, undefined, "authority");
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, undefined, 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')
  t.equal(components.nid, 'foo', 'nid')
  t.equal(components.nss, 'a123,456', 'nss')

  components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946:43209]')
  t.equal(components.host, '[2606:2800:220:1:248:1893:25c8:1946:43209]')

  components = URI.parse('urn:foo:|\\24fpl')
  t.equal(components.error, 'URN can not be parsed.')
  t.end()
})
'use strict'

const test = require('tape')
const URI = require('../')

test('URI Resolving', (t) => {
  // normal examples from RFC 3986
  const base = 'uri://a/b/c/d;p?q'
  t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
  t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
  t.equal(URI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
  t.equal(URI.resolve(base, './g'), 'uri://a/b/c/g', './g')
  t.equal(URI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
  t.equal(URI.resolve(base, '/g'), 'uri://a/g', '/g')
  t.equal(URI.resolve(base, '//g'), 'uri://g', '//g')
  t.equal(URI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
  t.equal(URI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
  t.equal(URI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
  t.equal(URI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
  t.equal(URI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
  t.equal(URI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
  t.equal(URI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
  t.equal(URI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
  t.equal(URI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
  t.equal(URI.resolve(base, '.'), 'uri://a/b/c/', '.')
  t.equal(URI.resolve(base, './'), 'uri://a/b/c/', './')
  t.equal(URI.resolve(base, '..'), 'uri://a/b/', '..')
  t.equal(URI.resolve(base, '../'), 'uri://a/b/', '../')
  t.equal(URI.resolve(base, '../g'), 'uri://a/b/g', '../g')
  t.equal(URI.resolve(base, '../..'), 'uri://a/', '../..')
  t.equal(URI.resolve(base, '../../'), 'uri://a/', '../../')
  t.equal(URI.resolve(base, '../../g'), 'uri://a/g', '../../g')

  // abnormal examples from RFC 3986
  t.equal(URI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
  t.equal(URI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')

  t.equal(URI.resolve(base, '/./g'), 'uri://a/g', '/./g')
  t.equal(URI.resolve(base, '/../g'), 'uri://a/g', '/../g')
  t.equal(URI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
  t.equal(URI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
  t.equal(URI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
  t.equal(URI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')

  t.equal(URI.resolve(base, './../g'), 'uri://a/b/g', './../g')
  t.equal(URI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
  t.equal(URI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
  t.equal(URI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
  t.equal(URI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
  t.equal(URI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')

  t.equal(URI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
  t.equal(URI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
  t.equal(URI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
  t.equal(URI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')

  t.equal(URI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
  t.equal(URI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')

  // examples by PAEz
  // example was provided to avoid infinite loop within regex
  // this is not the case anymore
  // t.equal(URI.resolve('//www.g.com/', '/adf\ngf'), '//www.g.com/adf%0Agf', '/adf\\ngf')
  // t.equal(URI.resolve('//www.g.com/error\n/bleh/bleh', '..'), '//www.g.com/error%0A/', '//www.g.com/error\\n/bleh/bleh')
  t.end()
})

test('URN Resolving', (t) => {
  // example from epoberezkin
  t.equal(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
  t.equal(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
  t.equal(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
  t.equal(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop', 'urn:some:ip:prop')
  t.end()
})
'use strict'

const test = require('tape')
const URI = require('../')

test('URI Serialize', (t) => {
  let components = {
    scheme: undefined,
    userinfo: undefined,
    host: undefined,
    port: undefined,
    path: undefined,
    query: undefined,
    fragment: undefined
  }
  t.equal(URI.serialize(components), '', 'Undefined Components')

  components = {
    scheme: '',
    userinfo: '',
    host: '',
    port: 0,
    path: '',
    query: '',
    fragment: ''
  }
  t.equal(URI.serialize(components), '//@:0?#', 'Empty Components')

  components = {
    scheme: 'uri',
    userinfo: 'foo:bar',
    host: 'example.com',
    port: 1,
    path: 'path',
    query: 'query',
    fragment: 'fragment'
  }
  t.equal(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')

  components = {
    scheme: 'uri',
    host: 'example.com',
    port: '9000'
  }
  t.equal(URI.serialize(components), 'uri://example.com:9000', 'String port')

  t.equal(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
  t.equal(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
  t.equal(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')

  t.equal(URI.serialize({ host: '10.10.10.10' }), '//10.10.10.10', 'IPv4address')

  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
  t.equal(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')

  // IPv6address
  t.equal(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
  t.equal(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
  t.equal(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')

  // IPv6address with zone identifier, RFC 6874
  t.equal(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
  t.equal(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')

  t.end()
})

test('WS serialize', (t) => {
  t.equal(URI.serialize({ scheme: 'ws' }), 'ws:')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
  t.equal(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
  t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
  t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
  t.equal(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
  t.equal(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
  t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
  t.end()
})

test('WSS serialize', (t) => {
  t.equal(URI.serialize({ scheme: 'wss' }), 'wss:')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
  t.equal(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
  t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
  t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
  t.equal(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
  t.equal(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
  t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')

  t.end()
})

test('URN serialize', (t) => {
// example from RFC 2141
  const components = {
    scheme: 'urn',
    nid: 'foo',
    nss: 'a123,456'
  }
  t.equal(URI.serialize(components), 'urn:foo:a123,456')
  // example from RFC 4122
  let uuidcomponents = {
    scheme: 'urn',
    nid: 'uuid',
    uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
  }
  t.equal(URI.serialize(uuidcomponents), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')

  uuidcomponents = {
    scheme: 'urn',
    nid: 'uuid',
    uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
  }
  t.equal(URI.serialize(uuidcomponents), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
  t.end()
})
test('URN NID Override', (t) => {
  let components = URI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
  t.equal(components.error, undefined, 'errors')
  t.equal(components.scheme, 'urn', 'scheme')
  t.equal(components.path, undefined, 'path')
  t.equal(components.nid, 'foo', 'nid')
  t.equal(components.nss, undefined, 'nss')
  t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')

  components = {
    scheme: 'urn',
    nid: 'foo',
    uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
  }
  t.equal(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
  t.end()
})
'use strict'

const test = require('tape')
const URI = require('../index')

/**
 * URI.js
 *
 * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/normalizing/resolving/serializing library for JavaScript.
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/uri-js
 */

/**
 * Copyright 2011 Gary Court. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of Gary Court.
 */

test('Acquire URI', (t) => {
  t.ok(URI)
  t.end()
})

test('URI Parsing', (t) => {
  let components

  // scheme
  components = URI.parse('uri:')
  t.equal(components.error, undefined, 'scheme errors')
  t.equal(components.scheme, 'uri', 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // userinfo
  components = URI.parse('//@')
  t.equal(components.error, undefined, 'userinfo errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, '', 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // host
  components = URI.parse('//')
  t.equal(components.error, undefined, 'host errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // port
  components = URI.parse('//:')
  t.equal(components.error, undefined, 'port errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '', 'host')
  t.equal(components.port, '', 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // path
  components = URI.parse('')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // query
  components = URI.parse('?')
  t.equal(components.error, undefined, 'query errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, '', 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // fragment
  components = URI.parse('#')
  t.equal(components.error, undefined, 'fragment errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '', 'fragment')

  // fragment with character tabulation
  components = URI.parse('#\t')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%09', 'fragment')

  // fragment with line feed
  components = URI.parse('#\n')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0A', 'fragment')

  // fragment with line tabulation
  components = URI.parse('#\v')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0B', 'fragment')

  // fragment with form feed
  components = URI.parse('#\f')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0C', 'fragment')

  // fragment with carriage return
  components = URI.parse('#\r')
  t.equal(components.error, undefined, 'path errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, undefined, 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, '%0D', 'fragment')

  // all
  components = URI.parse('uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body')
  t.equal(components.error, undefined, 'all errors')
  t.equal(components.scheme, 'uri', 'scheme')
  t.equal(components.userinfo, 'user:pass', 'userinfo')
  t.equal(components.host, 'example.com', 'host')
  t.equal(components.port, 123, 'port')
  t.equal(components.path, '/one/two.three', 'path')
  t.equal(components.query, 'q1=a1&q2=a2', 'query')
  t.equal(components.fragment, 'body', 'fragment')

  // IPv4address
  components = URI.parse('//10.10.10.10')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '10.10.10.10', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address
  components = URI.parse('//[2001:db8::7]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::7', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // mixed IPv4address & IPv6address
  components = URI.parse('//[::ffff:129.144.52.38]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '::ffff:129.144.52.38', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
  components = URI.parse('uri://10.10.10.10.example.com/en/process')
  t.equal(components.error, undefined, 'mixed errors')
  t.equal(components.scheme, 'uri', 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '10.10.10.10.example.com', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '/en/process', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address, example from bkw (https://github.com/garycourt/uri-js/pull/16)
  components = URI.parse('//[2606:2800:220:1:248:1893:25c8:1946]/test')
  t.equal(components.error, undefined, 'IPv6address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2606:2800:220:1:248:1893:25c8:1946', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '/test', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address, example from RFC 5952
  components = URI.parse('//[2001:db8::1]:80')
  t.equal(components.error, undefined, 'IPv6address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::1', 'host')
  t.equal(components.port, 80, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address with zone identifier, RFC 6874
  components = URI.parse('//[fe80::a%25en1]')
  t.equal(components.error, undefined, 'IPv4address errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, 'fe80::a%en1', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  // IPv6address with an unescaped interface specifier, example from pekkanikander (https://github.com/garycourt/uri-js/pull/22)
  components = URI.parse('//[2001:db8::7%en0]')
  t.equal(components.error, undefined, 'IPv6address interface errors')
  t.equal(components.scheme, undefined, 'scheme')
  t.equal(components.userinfo, undefined, 'userinfo')
  t.equal(components.host, '2001:db8::7%en0', 'host')
  t.equal(components.port, undefined, 'port')
  t.equal(components.path, '', 'path')
  t.equal(components.query, undefined, 'query')
  t.equal(components.fragment, undefined, 'fragment')

  t.end()
})

test('URI Serialization', (t) => {
  let components = {
    scheme: undefined,
    userinfo: undefined,
    host: undefined,
    port: undefined,
    path: undefined,
    query: undefined,
    fragment: undefined
  }
  t.equal(URI.serialize(components), '', 'Undefined Components')

  components = {
    scheme: '',
    userinfo: '',
    host: '',
    port: 0,
    path: '',
    query: '',
    fragment: ''
  }
  t.equal(URI.serialize(components), '//@:0?#', 'Empty Components')

  components = {
    scheme: 'uri',
    userinfo: 'foo:bar',
    host: 'example.com',
    port: 1,
    path: 'path',
    query: 'query',
    fragment: 'fragment'
  }
  t.equal(URI.serialize(components), 'uri://foo:bar@example.com:1/path?query#fragment', 'All Components')

  components = {
    scheme: 'uri',
    host: 'example.com',
    port: '9000'
  }
  t.equal(URI.serialize(components), 'uri://example.com:9000', 'String port')

  t.equal(URI.serialize({ path: '//path' }), '/%2Fpath', 'Double slash path')
  t.equal(URI.serialize({ path: 'foo:bar' }), 'foo%3Abar', 'Colon path')
  t.equal(URI.serialize({ path: '?query' }), '%3Fquery', 'Query path')

  // mixed IPv4address & reg-name, example from terion-name (https://github.com/garycourt/uri-js/issues/4)
  t.equal(URI.serialize({ host: '10.10.10.10.example.com' }), '//10.10.10.10.example.com', 'Mixed IPv4address & reg-name')

  // IPv6address
  t.equal(URI.serialize({ host: '2001:db8::7' }), '//[2001:db8::7]', 'IPv6 Host')
  t.equal(URI.serialize({ host: '::ffff:129.144.52.38' }), '//[::ffff:129.144.52.38]', 'IPv6 Mixed Host')
  t.equal(URI.serialize({ host: '2606:2800:220:1:248:1893:25c8:1946' }), '//[2606:2800:220:1:248:1893:25c8:1946]', 'IPv6 Full Host')

  // IPv6address with zone identifier, RFC 6874
  t.equal(URI.serialize({ host: 'fe80::a%en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Unescaped Host')
  t.equal(URI.serialize({ host: 'fe80::a%25en1' }), '//[fe80::a%25en1]', 'IPv6 Zone Escaped Host')

  t.end()
})

test('URI Resolving', { skip: true }, (t) => {
  // normal examples from RFC 3986
  const base = 'uri://a/b/c/d;p?q'
  t.equal(URI.resolve(base, 'g:h'), 'g:h', 'g:h')
  t.equal(URI.resolve(base, 'g'), 'uri://a/b/c/g', 'g')
  t.equal(URI.resolve(base, './g'), 'uri://a/b/c/g', './g')
  t.equal(URI.resolve(base, 'g/'), 'uri://a/b/c/g/', 'g/')
  t.equal(URI.resolve(base, '/g'), 'uri://a/g', '/g')
  t.equal(URI.resolve(base, '//g'), 'uri://g', '//g')
  t.equal(URI.resolve(base, '?y'), 'uri://a/b/c/d;p?y', '?y')
  t.equal(URI.resolve(base, 'g?y'), 'uri://a/b/c/g?y', 'g?y')
  t.equal(URI.resolve(base, '#s'), 'uri://a/b/c/d;p?q#s', '#s')
  t.equal(URI.resolve(base, 'g#s'), 'uri://a/b/c/g#s', 'g#s')
  t.equal(URI.resolve(base, 'g?y#s'), 'uri://a/b/c/g?y#s', 'g?y#s')
  t.equal(URI.resolve(base, ';x'), 'uri://a/b/c/;x', ';x')
  t.equal(URI.resolve(base, 'g;x'), 'uri://a/b/c/g;x', 'g;x')
  t.equal(URI.resolve(base, 'g;x?y#s'), 'uri://a/b/c/g;x?y#s', 'g;x?y#s')
  t.equal(URI.resolve(base, ''), 'uri://a/b/c/d;p?q', '')
  t.equal(URI.resolve(base, '.'), 'uri://a/b/c/', '.')
  t.equal(URI.resolve(base, './'), 'uri://a/b/c/', './')
  t.equal(URI.resolve(base, '..'), 'uri://a/b/', '..')
  t.equal(URI.resolve(base, '../'), 'uri://a/b/', '../')
  t.equal(URI.resolve(base, '../g'), 'uri://a/b/g', '../g')
  t.equal(URI.resolve(base, '../..'), 'uri://a/', '../..')
  t.equal(URI.resolve(base, '../../'), 'uri://a/', '../../')
  t.equal(URI.resolve(base, '../../g'), 'uri://a/g', '../../g')

  // abnormal examples from RFC 3986
  t.equal(URI.resolve(base, '../../../g'), 'uri://a/g', '../../../g')
  t.equal(URI.resolve(base, '../../../../g'), 'uri://a/g', '../../../../g')

  t.equal(URI.resolve(base, '/./g'), 'uri://a/g', '/./g')
  t.equal(URI.resolve(base, '/../g'), 'uri://a/g', '/../g')
  t.equal(URI.resolve(base, 'g.'), 'uri://a/b/c/g.', 'g.')
  t.equal(URI.resolve(base, '.g'), 'uri://a/b/c/.g', '.g')
  t.equal(URI.resolve(base, 'g..'), 'uri://a/b/c/g..', 'g..')
  t.equal(URI.resolve(base, '..g'), 'uri://a/b/c/..g', '..g')

  t.equal(URI.resolve(base, './../g'), 'uri://a/b/g', './../g')
  t.equal(URI.resolve(base, './g/.'), 'uri://a/b/c/g/', './g/.')
  t.equal(URI.resolve(base, 'g/./h'), 'uri://a/b/c/g/h', 'g/./h')
  t.equal(URI.resolve(base, 'g/../h'), 'uri://a/b/c/h', 'g/../h')
  t.equal(URI.resolve(base, 'g;x=1/./y'), 'uri://a/b/c/g;x=1/y', 'g;x=1/./y')
  t.equal(URI.resolve(base, 'g;x=1/../y'), 'uri://a/b/c/y', 'g;x=1/../y')

  t.equal(URI.resolve(base, 'g?y/./x'), 'uri://a/b/c/g?y/./x', 'g?y/./x')
  t.equal(URI.resolve(base, 'g?y/../x'), 'uri://a/b/c/g?y/../x', 'g?y/../x')
  t.equal(URI.resolve(base, 'g#s/./x'), 'uri://a/b/c/g#s/./x', 'g#s/./x')
  t.equal(URI.resolve(base, 'g#s/../x'), 'uri://a/b/c/g#s/../x', 'g#s/../x')

  t.equal(URI.resolve(base, 'uri:g'), 'uri:g', 'uri:g')
  t.equal(URI.resolve(base, 'uri:g', { tolerant: true }), 'uri://a/b/c/g', 'uri:g')

  // examples by PAEz
  t.equal(URI.resolve('//www.g.com/', '/adf\ngf'), '//www.g.com/adf%0Agf', '/adf\\ngf')
  t.equal(URI.resolve('//www.g.com/error\n/bleh/bleh', '..'), '//www.g.com/error%0A/', '//www.g.com/error\\n/bleh/bleh')

  t.end()
})

test('URI Normalizing', { skip: true }, (t) => {
  // test from RFC 3987
  t.equal(URI.normalize('uri://www.example.org/red%09ros\xE9#red'), 'uri://www.example.org/red%09ros%C3%A9#red')

  // IPv4address
  t.equal(URI.normalize('//192.068.001.000'), '//192.68.1.0')

  // IPv6address, example from RFC 3513
  t.equal(URI.normalize('http://[1080::8:800:200C:417A]/'), 'http://[1080::8:800:200c:417a]/')

  // IPv6address, examples from RFC 5952
  t.equal(URI.normalize('//[2001:0db8::0001]/'), '//[2001:db8::1]/')
  t.equal(URI.normalize('//[2001:db8::1:0000:1]/'), '//[2001:db8::1:0:1]/')
  t.equal(URI.normalize('//[2001:db8:0:0:0:0:2:1]/'), '//[2001:db8::2:1]/')
  t.equal(URI.normalize('//[2001:db8:0:1:1:1:1:1]/'), '//[2001:db8:0:1:1:1:1:1]/')
  t.equal(URI.normalize('//[2001:0:0:1:0:0:0:1]/'), '//[2001:0:0:1::1]/')
  t.equal(URI.normalize('//[2001:db8:0:0:1:0:0:1]/'), '//[2001:db8::1:0:0:1]/')
  t.equal(URI.normalize('//[2001:DB8::1]/'), '//[2001:db8::1]/')
  t.equal(URI.normalize('//[0:0:0:0:0:ffff:192.0.2.1]/'), '//[::ffff:192.0.2.1]/')

  // Mixed IPv4 and IPv6 address
  t.equal(URI.normalize('//[1:2:3:4:5:6:192.0.2.1]/'), '//[1:2:3:4:5:6:192.0.2.1]/')
  t.equal(URI.normalize('//[1:2:3:4:5:6:192.068.001.000]/'), '//[1:2:3:4:5:6:192.68.1.0]/')

  t.end()
})

test('URI Equals', (t) => {
  // test from RFC 3986
  t.equal(URI.equal('example://a/b/c/%7Bfoo%7D', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d'), true)

  // test from RFC 3987
  t.equal(URI.equal('http://example.org/~user', 'http://example.org/%7euser'), true)

  t.end()
})

test('Escape Component', { skip: true }, (t) => {
  let chr
  for (let d = 0; d <= 129; ++d) {
    chr = String.fromCharCode(d)
    if (!chr.match(/[$&+,;=]/)) {
      t.equal(URI.escapeComponent(chr), encodeURIComponent(chr))
    } else {
      t.equal(URI.escapeComponent(chr), chr)
    }
  }
  t.equal(URI.escapeComponent('\u00c0'), encodeURIComponent('\u00c0'))
  t.equal(URI.escapeComponent('\u07ff'), encodeURIComponent('\u07ff'))
  t.equal(URI.escapeComponent('\u0800'), encodeURIComponent('\u0800'))
  t.equal(URI.escapeComponent('\u30a2'), encodeURIComponent('\u30a2'))
  t.end()
})

test('Unescape Component', { skip: true }, (t) => {
  let chr
  for (let d = 0; d <= 129; ++d) {
    chr = String.fromCharCode(d)
    t.equal(URI.unescapeComponent(encodeURIComponent(chr)), chr)
  }
  t.equal(URI.unescapeComponent(encodeURIComponent('\u00c0')), '\u00c0')
  t.equal(URI.unescapeComponent(encodeURIComponent('\u07ff')), '\u07ff')
  t.equal(URI.unescapeComponent(encodeURIComponent('\u0800')), '\u0800')
  t.equal(URI.unescapeComponent(encodeURIComponent('\u30a2')), '\u30a2')
  t.end()
})

const IRI_OPTION = { iri: true, unicodeSupport: true }

test('IRI Parsing', { skip: true }, (t) => {
  const components = URI.parse('uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy', IRI_OPTION)
  t.equal(components.error, undefined, 'all errors')
  t.equal(components.scheme, 'uri', 'scheme')
  t.equal(components.userinfo, 'us\xA0er:pa\uD7FFss', 'userinfo')
  t.equal(components.host, 'example.com', 'host')
  t.equal(components.port, 123, 'port')
  t.equal(components.path, '/o\uF900ne/t\uFDCFwo.t\uFDF0hree', 'path')
  t.equal(components.query, 'q1=a1\uF8FF\uE000&q2=a2', 'query')
  t.equal(components.fragment, 'bo\uFFEFdy', 'fragment')
  t.end()
})

test('IRI Serialization', { skip: true }, (t) => {
  const components = {
    scheme: 'uri',
    userinfo: 'us\xA0er:pa\uD7FFss',
    host: 'example.com',
    port: 123,
    path: '/o\uF900ne/t\uFDCFwo.t\uFDF0hree',
    query: 'q1=a1\uF8FF\uE000&q2=a2',
    fragment: 'bo\uFFEFdy\uE001'
  }
  t.equal(URI.serialize(components, IRI_OPTION), 'uri://us\xA0er:pa\uD7FFss@example.com:123/o\uF900ne/t\uFDCFwo.t\uFDF0hree?q1=a1\uF8FF\uE000&q2=a2#bo\uFFEFdy%EE%80%81')
  t.end()
})

test('IRI Normalizing', { skip: true }, (t) => {
  t.equal(URI.normalize('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION), 'uri://www.example.org/red%09ros\xE9#red')
  t.end()
})

test('IRI Equals', { skip: true }, (t) => {
  // example from RFC 3987
  t.equal(URI.equal('example://a/b/c/%7Bfoo%7D/ros\xE9', 'eXAMPLE://a/./b/../b/%63/%7bfoo%7d/ros%C3%A9', IRI_OPTION), true)
  t.end()
})

test('Convert IRI to URI', { skip: true }, (t) => {
  // example from RFC 3987
  t.equal(URI.serialize(URI.parse('uri://www.example.org/red%09ros\xE9#red', IRI_OPTION)), 'uri://www.example.org/red%09ros%C3%A9#red')

  // Internationalized Domain Name conversion via punycode example from RFC 3987
  t.equal(URI.serialize(URI.parse('uri://r\xE9sum\xE9.example.org', { iri: true, domainHost: true }), { domainHost: true }), 'uri://xn--rsum-bpad.example.org')
  t.end()
})

test('Convert URI to IRI', { skip: true }, (t) => {
  // examples from RFC 3987
  t.equal(URI.serialize(URI.parse('uri://www.example.org/D%C3%BCrst'), IRI_OPTION), 'uri://www.example.org/D\xFCrst')
  t.equal(URI.serialize(URI.parse('uri://www.example.org/D%FCrst'), IRI_OPTION), 'uri://www.example.org/D%FCrst')
  t.equal(URI.serialize(URI.parse('uri://xn--99zt52a.example.org/%e2%80%ae'), IRI_OPTION), 'uri://xn--99zt52a.example.org/%E2%80%AE') // or uri://\u7D0D\u8C46.example.org/%E2%80%AE

  // Internationalized Domain Name conversion via punycode example from RFC 3987
  t.equal(URI.serialize(URI.parse('uri://xn--rsum-bpad.example.org', { domainHost: true }), { iri: true, domainHost: true }), 'uri://r\xE9sum\xE9.example.org')
  t.end()
})

if (URI.SCHEMES.http) {
  test('HTTP Equals', (t) => {
    // test from RFC 2616
    t.equal(URI.equal('http://abc.com:80/~smith/home.html', 'http://abc.com/~smith/home.html'), true)
    t.equal(URI.equal('http://ABC.com/%7Esmith/home.html', 'http://abc.com/~smith/home.html'), true)
    t.equal(URI.equal('http://ABC.com:/%7esmith/home.html', 'http://abc.com/~smith/home.html'), true)
    t.equal(URI.equal('HTTP://ABC.COM', 'http://abc.com/'), true)
    // test from RFC 3986
    t.equal(URI.equal('http://example.com:/', 'http://example.com:80/'), true)
    t.end()
  })
}

if (URI.SCHEMES.https) {
  test('HTTPS Equals', (t) => {
    t.equal(URI.equal('https://example.com', 'https://example.com:443/'), true)
    t.equal(URI.equal('https://example.com:/', 'https://example.com:443/'), true)
    t.end()
  })
}

if (URI.SCHEMES.urn) {
  test('URN Parsing', (t) => {
    // example from RFC 2141
    const components = URI.parse('urn:foo:a123,456')
    t.equal(components.error, undefined, 'errors')
    t.equal(components.scheme, 'urn', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, undefined, 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.nid, 'foo', 'nid')
    t.equal(components.nss, 'a123,456', 'nss')
    t.end()
  })

  test('URN Serialization', (t) => {
    // example from RFC 2141
    const components = {
      scheme: 'urn',
      nid: 'foo',
      nss: 'a123,456'
    }
    t.equal(URI.serialize(components), 'urn:foo:a123,456')
    t.end()
  })

  test('URN Equals', { skip: true }, (t) => {
    // test from RFC 2141
    t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:a123,456'), true)
    t.equal(URI.equal('urn:foo:a123,456', 'URN:foo:a123,456'), true)
    t.equal(URI.equal('urn:foo:a123,456', 'urn:FOO:a123,456'), true)
    t.equal(URI.equal('urn:foo:a123,456', 'urn:foo:A123,456'), false)
    t.equal(URI.equal('urn:foo:a123%2C456', 'URN:FOO:a123%2c456'), true)
    t.end()
  })

  test('URN Resolving', (t) => {
    // example from epoberezkin
    t.equal(URI.resolve('', 'urn:some:ip:prop'), 'urn:some:ip:prop')
    t.equal(URI.resolve('#', 'urn:some:ip:prop'), 'urn:some:ip:prop')
    t.equal(URI.resolve('urn:some:ip:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
    t.equal(URI.resolve('urn:some:other:prop', 'urn:some:ip:prop'), 'urn:some:ip:prop')
    t.end()
  })

  test('UUID Parsing', (t) => {
    // example from RFC 4122
    let components = URI.parse('urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
    t.equal(components.error, undefined, 'errors')
    t.equal(components.scheme, 'urn', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, undefined, 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.nid, 'uuid', 'nid')
    t.equal(components.nss, undefined, 'nss')
    t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')

    components = URI.parse('urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
    t.notEqual(components.error, undefined, 'errors')
    t.end()
  })

  test('UUID Serialization', (t) => {
    // example from RFC 4122
    let components = {
      scheme: 'urn',
      nid: 'uuid',
      uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
    }
    t.equal(URI.serialize(components), 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')

    components = {
      scheme: 'urn',
      nid: 'uuid',
      uuid: 'notauuid-7dec-11d0-a765-00a0c91e6bf6'
    }
    t.equal(URI.serialize(components), 'urn:uuid:notauuid-7dec-11d0-a765-00a0c91e6bf6')
    t.end()
  })

  test('UUID Equals', (t) => {
    t.equal(URI.equal('URN:UUID:F81D4FAE-7DEC-11D0-A765-00A0C91E6BF6', 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6'), true)
    t.end()
  })

  test('URN NID Override', (t) => {
    let components = URI.parse('urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', { nid: 'uuid' })
    t.equal(components.error, undefined, 'errors')
    t.equal(components.scheme, 'urn', 'scheme')
    t.equal(components.path, undefined, 'path')
    t.equal(components.nid, 'foo', 'nid')
    t.equal(components.nss, undefined, 'nss')
    t.equal(components.uuid, 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6', 'uuid')

    components = {
      scheme: 'urn',
      nid: 'foo',
      uuid: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'
    }
    t.equal(URI.serialize(components, { nid: 'uuid' }), 'urn:foo:f81d4fae-7dec-11d0-a765-00a0c91e6bf6')
    t.end()
  })
}

if (URI.SCHEMES.mailto) {
  test('Mailto Parse', (t) => {
    let components

    // tests from RFC 6068

    components = URI.parse('mailto:chris@example.com')
    t.equal(components.error, undefined, 'error')
    t.equal(components.scheme, 'mailto', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, undefined, 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.deepEqual(components.to, ['chris@example.com'], 'to')
    t.equal(components.subject, undefined, 'subject')
    t.equal(components.body, undefined, 'body')
    t.equal(components.headers, undefined, 'headers')

    components = URI.parse('mailto:infobot@example.com?subject=current-issue')
    t.deepEqual(components.to, ['infobot@example.com'], 'to')
    t.equal(components.subject, 'current-issue', 'subject')

    components = URI.parse('mailto:infobot@example.com?body=send%20current-issue')
    t.deepEqual(components.to, ['infobot@example.com'], 'to')
    t.equal(components.body, 'send current-issue', 'body')

    components = URI.parse('mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index')
    t.deepEqual(components.to, ['infobot@example.com'], 'to')
    t.equal(components.body, 'send current-issue\x0D\x0Asend index', 'body')

    components = URI.parse('mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E')
    t.deepEqual(components.to, ['list@example.org'], 'to')
    t.deepEqual(components.headers, { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' }, 'headers')

    components = URI.parse('mailto:majordomo@example.com?body=subscribe%20bamboo-l')
    t.deepEqual(components.to, ['majordomo@example.com'], 'to')
    t.equal(components.body, 'subscribe bamboo-l', 'body')

    components = URI.parse('mailto:joe@example.com?cc=bob@example.com&body=hello')
    t.deepEqual(components.to, ['joe@example.com'], 'to')
    t.equal(components.body, 'hello', 'body')
    t.deepEqual(components.headers, { cc: 'bob@example.com' }, 'headers')

    components = URI.parse('mailto:joe@example.com?cc=bob@example.com?body=hello')
    if (URI.VALIDATE_SUPPORT) t.ok(components.error, 'invalid header fields')

    components = URI.parse('mailto:gorby%25kremvax@example.com')
    t.deepEqual(components.to, ['gorby%kremvax@example.com'], 'to gorby%kremvax@example.com')

    components = URI.parse('mailto:unlikely%3Faddress@example.com?blat=foop')
    t.deepEqual(components.to, ['unlikely?address@example.com'], 'to unlikely?address@example.com')
    t.deepEqual(components.headers, { blat: 'foop' }, 'headers')

    components = URI.parse('mailto:Mike%26family@example.org')
    t.deepEqual(components.to, ['Mike&family@example.org'], 'to Mike&family@example.org')

    components = URI.parse('mailto:%22not%40me%22@example.org')
    t.deepEqual(components.to, ['"not@me"@example.org'], 'to ' + '"not@me"@example.org')

    components = URI.parse('mailto:%22oh%5C%5Cno%22@example.org')
    t.deepEqual(components.to, ['"oh\\\\no"@example.org'], 'to ' + '"oh\\\\no"@example.org')

    components = URI.parse("mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org")
    t.deepEqual(components.to, ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'], 'to ' + '"\\\\\\"it\'s\\ ugly\\\\\\""@example.org')

    components = URI.parse('mailto:user@example.org?subject=caf%C3%A9')
    t.deepEqual(components.to, ['user@example.org'], 'to')
    t.equal(components.subject, 'caf\xE9', 'subject')

    components = URI.parse('mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D')
    t.deepEqual(components.to, ['user@example.org'], 'to')
    t.equal(components.subject, '=?utf-8?Q?caf=C3=A9?=', 'subject') // TODO: Verify this

    components = URI.parse('mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D')
    t.deepEqual(components.to, ['user@example.org'], 'to')
    t.equal(components.subject, '=?iso-8859-1?Q?caf=E9?=', 'subject') // TODO: Verify this

    components = URI.parse('mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9')
    t.deepEqual(components.to, ['user@example.org'], 'to')
    t.equal(components.subject, 'caf\xE9', 'subject')
    t.equal(components.body, 'caf\xE9', 'body')

    if (URI.IRI_SUPPORT) {
      components = URI.parse('mailto:user@%E7%B4%8D%E8%B1%86.example.org?subject=Test&body=NATTO')
      t.deepEqual(components.to, ['user@xn--99zt52a.example.org'], 'to')
      t.equal(components.subject, 'Test', 'subject')
      t.equal(components.body, 'NATTO', 'body')
    }

    t.end()
  })

  test('Mailto Serialize', (t) => {
    // tests from RFC 6068
    t.equal(URI.serialize({ scheme: 'mailto', to: ['chris@example.com'] }), 'mailto:chris@example.com')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'current-issue' }), 'mailto:infobot@example.com?body=current-issue')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue' }), 'mailto:infobot@example.com?body=send%20current-issue')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['infobot@example.com'], body: 'send current-issue\x0D\x0Asend index' }), 'mailto:infobot@example.com?body=send%20current-issue%0D%0Asend%20index')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['list@example.org'], headers: { 'In-Reply-To': '<3469A91.D10AF4C@example.com>' } }), 'mailto:list@example.org?In-Reply-To=%3C3469A91.D10AF4C@example.com%3E')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['majordomo@example.com'], body: 'subscribe bamboo-l' }), 'mailto:majordomo@example.com?body=subscribe%20bamboo-l')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['joe@example.com'], headers: { cc: 'bob@example.com', body: 'hello' } }), 'mailto:joe@example.com?cc=bob@example.com&body=hello')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['gorby%25kremvax@example.com'] }), 'mailto:gorby%25kremvax@example.com')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['unlikely%3Faddress@example.com'], headers: { blat: 'foop' } }), 'mailto:unlikely%3Faddress@example.com?blat=foop')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['Mike&family@example.org'] }), 'mailto:Mike%26family@example.org')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['"not@me"@example.org'] }), 'mailto:%22not%40me%22@example.org')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['"oh\\\\no"@example.org'] }), 'mailto:%22oh%5C%5Cno%22@example.org')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['"\\\\\\"it\'s\\ ugly\\\\\\""@example.org'] }), "mailto:%22%5C%5C%5C%22it's%5C%20ugly%5C%5C%5C%22%22@example.org")
    t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?utf-8?Q?caf=C3=A9?=' }), 'mailto:user@example.org?subject=%3D%3Futf-8%3FQ%3Fcaf%3DC3%3DA9%3F%3D')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: '=?iso-8859-1?Q?caf=E9?=' }), 'mailto:user@example.org?subject=%3D%3Fiso-8859-1%3FQ%3Fcaf%3DE9%3F%3D')
    t.equal(URI.serialize({ scheme: 'mailto', to: ['user@example.org'], subject: 'caf\xE9', body: 'caf\xE9' }), 'mailto:user@example.org?subject=caf%C3%A9&body=caf%C3%A9')
    if (URI.IRI_SUPPORT) {
      t.equal(URI.serialize({ scheme: 'mailto', to: ['us\xE9r@\u7d0d\u8c46.example.org'], subject: 'Test', body: 'NATTO' }), 'mailto:us%C3%A9r@xn--99zt52a.example.org?subject=Test&body=NATTO')
    }
    t.end()
  })

  test('Mailto Equals', (t) => {
    // tests from RFC 6068
    t.equal(URI.equal('mailto:addr1@an.example,addr2@an.example', 'mailto:?to=addr1@an.example,addr2@an.example'), true)
    t.equal(URI.equal('mailto:?to=addr1@an.example,addr2@an.example', 'mailto:addr1@an.example?to=addr2@an.example'), true)
    t.end()
  })
}

if (URI.SCHEMES.ws) {
  test('WS Parse', (t) => {
    let components

    // example from RFC 6455, Sec 4.1
    components = URI.parse('ws://example.com/chat')
    t.equal(components.error, undefined, 'error')
    t.equal(components.scheme, 'ws', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, 'example.com', 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.resourceName, '/chat', 'resourceName')
    t.equal(components.secure, false, 'secure')

    components = URI.parse('ws://example.com/foo?bar=baz')
    t.equal(components.error, undefined, 'error')
    t.equal(components.scheme, 'ws', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, 'example.com', 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.resourceName, '/foo?bar=baz', 'resourceName')
    t.equal(components.secure, false, 'secure')

    components = URI.parse('ws://example.com/?bar=baz')
    t.equal(components.resourceName, '/?bar=baz', 'resourceName')

    t.end()
  })

  test('WS Serialize', (t) => {
    t.equal(URI.serialize({ scheme: 'ws' }), 'ws:')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com' }), 'ws://example.com')
    t.equal(URI.serialize({ scheme: 'ws', resourceName: '/' }), 'ws:')
    t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo' }), 'ws:/foo')
    t.equal(URI.serialize({ scheme: 'ws', resourceName: '/foo?bar' }), 'ws:/foo?bar')
    t.equal(URI.serialize({ scheme: 'ws', secure: false }), 'ws:')
    t.equal(URI.serialize({ scheme: 'ws', secure: true }), 'wss:')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo' }), 'ws://example.com/foo')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar' }), 'ws://example.com/foo?bar')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: false }), 'ws://example.com')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', secure: true }), 'wss://example.com')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
    t.equal(URI.serialize({ scheme: 'ws', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
    t.end()
  })

  test('WS Equal', (t) => {
    t.equal(URI.equal('WS://ABC.COM:80/chat#one', 'ws://abc.com/chat'), true)
    t.end()
  })

  test('WS Normalize', (t) => {
    t.equal(URI.normalize('ws://example.com:80/foo#hash'), 'ws://example.com/foo')
    t.end()
  })
}

if (URI.SCHEMES.wss) {
  test('WSS Parse', (t) => {
    let components

    // example from RFC 6455, Sec 4.1
    components = URI.parse('wss://example.com/chat')
    t.equal(components.error, undefined, 'error')
    t.equal(components.scheme, 'wss', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, 'example.com', 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.resourceName, '/chat', 'resourceName')
    t.equal(components.secure, true, 'secure')

    components = URI.parse('wss://example.com/foo?bar=baz')
    t.equal(components.error, undefined, 'error')
    t.equal(components.scheme, 'wss', 'scheme')
    t.equal(components.userinfo, undefined, 'userinfo')
    t.equal(components.host, 'example.com', 'host')
    t.equal(components.port, undefined, 'port')
    t.equal(components.path, undefined, 'path')
    t.equal(components.query, undefined, 'query')
    t.equal(components.fragment, undefined, 'fragment')
    t.equal(components.resourceName, '/foo?bar=baz', 'resourceName')
    t.equal(components.secure, true, 'secure')

    components = URI.parse('wss://example.com/?bar=baz')
    t.equal(components.resourceName, '/?bar=baz', 'resourceName')

    t.end()
  })

  test('WSS Serialize', (t) => {
    t.equal(URI.serialize({ scheme: 'wss' }), 'wss:')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com' }), 'wss://example.com')
    t.equal(URI.serialize({ scheme: 'wss', resourceName: '/' }), 'wss:')
    t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo' }), 'wss:/foo')
    t.equal(URI.serialize({ scheme: 'wss', resourceName: '/foo?bar' }), 'wss:/foo?bar')
    t.equal(URI.serialize({ scheme: 'wss', secure: false }), 'ws:')
    t.equal(URI.serialize({ scheme: 'wss', secure: true }), 'wss:')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo' }), 'wss://example.com/foo')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar' }), 'wss://example.com/foo?bar')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: false }), 'ws://example.com')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', secure: true }), 'wss://example.com')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: false }), 'ws://example.com/foo?bar')
    t.equal(URI.serialize({ scheme: 'wss', host: 'example.com', resourceName: '/foo?bar', secure: true }), 'wss://example.com/foo?bar')
    t.end()
  })

  test('WSS Equal', (t) => {
    t.equal(URI.equal('WSS://ABC.COM:443/chat#one', 'wss://abc.com/chat'), true)
    t.end()
  })

  test('WSS Normalize', (t) => {
    t.equal(URI.normalize('wss://example.com:443/foo#hash'), 'wss://example.com/foo')
    t.end()
  })
}
'use strict'

const test = require('tape')
const {
  stringArrayToHexStripped
} = require('../lib/utils')

test('stringArrayToHexStripped', (t) => {
  const testCases = [
    [[['0', '0', '0', '0']], ''],
    [[['0', '0', '0', '0'], false], ''],
    [[['0', '0', '0', '0'], true], '0'],
    [[['0', '1', '0', '0'], false], '100'],
    [[['1', '0', '0', '0'], false], '1000'],
    [[['1', '0', '0', '0'], true], '1000']
  ]

  t.plan(testCases.length)

  testCases.forEach(([input, expected]) => {
    t.same(stringArrayToHexStripped(input[0], input[1]), expected)
  })
})
type FastUri = typeof fastUri

declare namespace fastUri {
  export interface URIComponent {
    scheme?: string;
    userinfo?: string;
    host?: string;
    port?: number | string;
    path?: string;
    query?: string;
    fragment?: string;
    reference?: string;
    error?: string;
  }
  export interface Options {
    scheme?: string;
    reference?: string;
    unicodeSupport?: boolean;
    domainHost?: boolean;
    absolutePath?: boolean;
    tolerant?: boolean;
  }

  /**
   * @deprecated Use Options instead
   */
  export type options = Options
  /**
   * @deprecated Use URIComponent instead
   */
  export type URIComponents = URIComponent

  export function normalize(uri: string, opts?: Options): string;
  export function normalize(uri: URIComponent, opts?: Options): URIComponent;
  export function normalize(uri: any, opts?: Options): any;

  export function resolve(baseURI: string, relativeURI: string, options?: Options): string

  export function resolveComponent(base: URIComponent, relative: URIComponent, options?: Options, skipNormalization?: boolean): URIComponent

  export function parse(uri: string, opts?: Options): URIComponent;

  export function serialize(component: URIComponent, opts?: Options): string;

  export function equal(uriA: string, uriB: string): boolean;

  export function resolve(base: string, path: string): string;

  export const fastUri: FastUri
  export { fastUri as default }
}

export = fastUri
import uri, { URIComponents, URIComponent, Options, options } from "..";
import { expectDeprecated, expectType } from "tsd";

const parsed = uri.parse("foo");
expectType<URIComponents>(parsed);
const parsed2 = uri.parse("foo", {
    domainHost: true,
    scheme: 'https',
    unicodeSupport: false
})
expectType<URIComponents>(parsed2);

expectType<URIComponent>({} as URIComponents)
expectDeprecated({} as URIComponents)

expectType<Options>({} as options)
expectDeprecated({} as options)
/// <reference types="node" />
import net from 'net';
import { Agent, ClientRequest, RequestOptions } from 'agent-base';
import { HttpsProxyAgentOptions } from '.';
/**
 * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
 * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
 *
 * Outgoing HTTP requests are first tunneled through the proxy server using the
 * `CONNECT` HTTP request method to establish a connection to the proxy server,
 * and then the proxy server connects to the destination target and issues the
 * HTTP request from the proxy server.
 *
 * `https:` requests have their socket connection upgraded to TLS once
 * the connection to the proxy server has been established.
 *
 * @api public
 */
export default class HttpsProxyAgent extends Agent {
    private secureProxy;
    private proxy;
    constructor(_opts: string | HttpsProxyAgentOptions);
    /**
     * Called when the node-core HTTP client library is creating a
     * new HTTP request.
     *
     * @api protected
     */
    callback(req: ClientRequest, opts: RequestOptions): Promise<net.Socket>;
}
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const net_1 = __importDefault(require("net"));
const tls_1 = __importDefault(require("tls"));
const url_1 = __importDefault(require("url"));
const assert_1 = __importDefault(require("assert"));
const debug_1 = __importDefault(require("debug"));
const agent_base_1 = require("agent-base");
const parse_proxy_response_1 = __importDefault(require("./parse-proxy-response"));
const debug = debug_1.default('https-proxy-agent:agent');
/**
 * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
 * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
 *
 * Outgoing HTTP requests are first tunneled through the proxy server using the
 * `CONNECT` HTTP request method to establish a connection to the proxy server,
 * and then the proxy server connects to the destination target and issues the
 * HTTP request from the proxy server.
 *
 * `https:` requests have their socket connection upgraded to TLS once
 * the connection to the proxy server has been established.
 *
 * @api public
 */
class HttpsProxyAgent extends agent_base_1.Agent {
    constructor(_opts) {
        let opts;
        if (typeof _opts === 'string') {
            opts = url_1.default.parse(_opts);
        }
        else {
            opts = _opts;
        }
        if (!opts) {
            throw new Error('an HTTP(S) proxy server `host` and `port` must be specified!');
        }
        debug('creating new HttpsProxyAgent instance: %o', opts);
        super(opts);
        const proxy = Object.assign({}, opts);
        // If `true`, then connect to the proxy server over TLS.
        // Defaults to `false`.
        this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
        // Prefer `hostname` over `host`, and set the `port` if needed.
        proxy.host = proxy.hostname || proxy.host;
        if (typeof proxy.port === 'string') {
            proxy.port = parseInt(proxy.port, 10);
        }
        if (!proxy.port && proxy.host) {
            proxy.port = this.secureProxy ? 443 : 80;
        }
        // ALPN is supported by Node.js >= v5.
        // attempt to negotiate http/1.1 for proxy servers that support http/2
        if (this.secureProxy && !('ALPNProtocols' in proxy)) {
            proxy.ALPNProtocols = ['http 1.1'];
        }
        if (proxy.host && proxy.path) {
            // If both a `host` and `path` are specified then it's most likely
            // the result of a `url.parse()` call... we need to remove the
            // `path` portion so that `net.connect()` doesn't attempt to open
            // that as a Unix socket file.
            delete proxy.path;
            delete proxy.pathname;
        }
        this.proxy = proxy;
    }
    /**
     * Called when the node-core HTTP client library is creating a
     * new HTTP request.
     *
     * @api protected
     */
    callback(req, opts) {
        return __awaiter(this, void 0, void 0, function* () {
            const { proxy, secureProxy } = this;
            // Create a socket connection to the proxy server.
            let socket;
            if (secureProxy) {
                debug('Creating `tls.Socket`: %o', proxy);
                socket = tls_1.default.connect(proxy);
            }
            else {
                debug('Creating `net.Socket`: %o', proxy);
                socket = net_1.default.connect(proxy);
            }
            const headers = Object.assign({}, proxy.headers);
            const hostname = `${opts.host}:${opts.port}`;
            let payload = `CONNECT ${hostname} HTTP/1.1\r\n`;
            // Inject the `Proxy-Authorization` header if necessary.
            if (proxy.auth) {
                headers['Proxy-Authorization'] = `Basic ${Buffer.from(proxy.auth).toString('base64')}`;
            }
            // The `Host` header should only include the port
            // number when it is not the default port.
            let { host, port, secureEndpoint } = opts;
            if (!isDefaultPort(port, secureEndpoint)) {
                host += `:${port}`;
            }
            headers.Host = host;
            headers.Connection = 'close';
            for (const name of Object.keys(headers)) {
                payload += `${name}: ${headers[name]}\r\n`;
            }
            const proxyResponsePromise = parse_proxy_response_1.default(socket);
            socket.write(`${payload}\r\n`);
            const { statusCode, buffered } = yield proxyResponsePromise;
            if (statusCode === 200) {
                req.once('socket', resume);
                if (opts.secureEndpoint) {
                    // The proxy is connecting to a TLS server, so upgrade
                    // this socket connection to a TLS connection.
                    debug('Upgrading socket connection to TLS');
                    const servername = opts.servername || opts.host;
                    return tls_1.default.connect(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
                        servername }));
                }
                return socket;
            }
            // Some other status code that's not 200... need to re-play the HTTP
            // header "data" events onto the socket once the HTTP machinery is
            // attached so that the node core `http` can parse and handle the
            // error status code.
            // Close the original socket, and a new "fake" socket is returned
            // instead, so that the proxy doesn't get the HTTP request
            // written to it (which may contain `Authorization` headers or other
            // sensitive data).
            //
            // See: https://hackerone.com/reports/541502
            socket.destroy();
            const fakeSocket = new net_1.default.Socket({ writable: false });
            fakeSocket.readable = true;
            // Need to wait for the "socket" event to re-play the "data" events.
            req.once('socket', (s) => {
                debug('replaying proxy buffer for failed request');
                assert_1.default(s.listenerCount('data') > 0);
                // Replay the "buffered" Buffer onto the fake `socket`, since at
                // this point the HTTP module machinery has been hooked up for
                // the user.
                s.push(buffered);
                s.push(null);
            });
            return fakeSocket;
        });
    }
}
exports.default = HttpsProxyAgent;
function resume(socket) {
    socket.resume();
}
function isDefaultPort(port, secure) {
    return Boolean((!secure && port === 80) || (secure && port === 443));
}
function isHTTPS(protocol) {
    return typeof protocol === 'string' ? /^https:?$/i.test(protocol) : false;
}
function omit(obj, ...keys) {
    const ret = {};
    let key;
    for (key in obj) {
        if (!keys.includes(key)) {
            ret[key] = obj[key];
        }
    }
    return ret;
}
//# sourceMappingURL=agent.js.map{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,oDAA4B;AAC5B,kDAAgC;AAEhC,2CAAkE;AAElE,kFAAwD;AAExD,MAAM,KAAK,GAAG,eAAW,CAAC,yBAAyB,CAAC,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAqB,eAAgB,SAAQ,kBAAK;IAIjD,YAAY,KAAsC;QACjD,IAAI,IAA4B,CAAC;QACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9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d,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACnB,CAAC;KAAA;CACD;AA3JD,kCA2JC;AAED,SAAS,MAAM,CAAC,MAAkC;IACjD,MAAM,CAAC,MAAM,EAAE,CAAC;AACjB,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAe;IACnD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED,SAAS,IAAI,CACZ,GAAM,EACN,GAAG,IAAO;IAIV,MAAM,GAAG,GAAG,EAEX,CAAC;IACF,IAAI,GAAqB,CAAC;IAC1B,KAAK,GAAG,IAAI,GAAG,EAAE;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACxB,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}/// <reference types="node" />
import net from 'net';
import tls from 'tls';
import { Url } from 'url';
import { AgentOptions } from 'agent-base';
import { OutgoingHttpHeaders } from 'http';
import _HttpsProxyAgent from './agent';
declare function createHttpsProxyAgent(opts: string | createHttpsProxyAgent.HttpsProxyAgentOptions): _HttpsProxyAgent;
declare namespace createHttpsProxyAgent {
    interface BaseHttpsProxyAgentOptions {
        headers?: OutgoingHttpHeaders;
        secureProxy?: boolean;
        host?: string | null;
        path?: string | null;
        port?: string | number | null;
    }
    export interface HttpsProxyAgentOptions extends AgentOptions, BaseHttpsProxyAgentOptions, Partial<Omit<Url & net.NetConnectOpts & tls.ConnectionOptions, keyof BaseHttpsProxyAgentOptions>> {
    }
    export type HttpsProxyAgent = _HttpsProxyAgent;
    export const HttpsProxyAgent: typeof _HttpsProxyAgent;
    export {};
}
export = createHttpsProxyAgent;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
const agent_1 = __importDefault(require("./agent"));
function createHttpsProxyAgent(opts) {
    return new agent_1.default(opts);
}
(function (createHttpsProxyAgent) {
    createHttpsProxyAgent.HttpsProxyAgent = agent_1.default;
    createHttpsProxyAgent.prototype = agent_1.default.prototype;
})(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
module.exports = createHttpsProxyAgent;
//# sourceMappingURL=index.js.map{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAKA,oDAAuC;AAEvC,SAAS,qBAAqB,CAC7B,IAA2D;IAE3D,OAAO,IAAI,eAAgB,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,WAAU,qBAAqB;IAoBjB,qCAAe,GAAG,eAAgB,CAAC;IAEhD,qBAAqB,CAAC,SAAS,GAAG,eAAgB,CAAC,SAAS,CAAC;AAC9D,CAAC,EAvBS,qBAAqB,KAArB,qBAAqB,QAuB9B;AAED,iBAAS,qBAAqB,CAAC"}/// <reference types="node" />
import { Readable } from 'stream';
export interface ProxyResponse {
    statusCode: number;
    buffered: Buffer;
}
export default function parseProxyResponse(socket: Readable): Promise<ProxyResponse>;
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const debug_1 = __importDefault(require("debug"));
const debug = debug_1.default('https-proxy-agent:parse-proxy-response');
function parseProxyResponse(socket) {
    return new Promise((resolve, reject) => {
        // we need to buffer any HTTP traffic that happens with the proxy before we get
        // the CONNECT response, so that if the response is anything other than an "200"
        // response code, then we can re-play the "data" events on the socket once the
        // HTTP parser is hooked up...
        let buffersLength = 0;
        const buffers = [];
        function read() {
            const b = socket.read();
            if (b)
                ondata(b);
            else
                socket.once('readable', read);
        }
        function cleanup() {
            socket.removeListener('end', onend);
            socket.removeListener('error', onerror);
            socket.removeListener('close', onclose);
            socket.removeListener('readable', read);
        }
        function onclose(err) {
            debug('onclose had error %o', err);
        }
        function onend() {
            debug('onend');
        }
        function onerror(err) {
            cleanup();
            debug('onerror %o', err);
            reject(err);
        }
        function ondata(b) {
            buffers.push(b);
            buffersLength += b.length;
            const buffered = Buffer.concat(buffers, buffersLength);
            const endOfHeaders = buffered.indexOf('\r\n\r\n');
            if (endOfHeaders === -1) {
                // keep buffering
                debug('have not received end of HTTP headers yet...');
                read();
                return;
            }
            const firstLine = buffered.toString('ascii', 0, buffered.indexOf('\r\n'));
            const statusCode = +firstLine.split(' ')[1];
            debug('got proxy server response: %o', firstLine);
            resolve({
                statusCode,
                buffered
            });
        }
        socket.on('error', onerror);
        socket.on('close', onclose);
        socket.on('end', onend);
        read();
    });
}
exports.default = parseProxyResponse;
//# sourceMappingURL=parse-proxy-response.js.map{"version":3,"file":"parse-proxy-response.js","sourceRoot":"","sources":["../src/parse-proxy-response.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgC;AAGhC,MAAM,KAAK,GAAG,eAAW,CAAC,wCAAwC,CAAC,CAAC;AAOpE,SAAwB,kBAAkB,CACzC,MAAgB;IAEhB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,+EAA+E;QAC/E,gFAAgF;QAChF,8EAA8E;QAC9E,8BAA8B;QAC9B,IAAI,aAAa,GAAG,CAAC,CAAC;QACtB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,SAAS,IAAI;YACZ,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;;gBACZ,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI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,+BAA+B,EAAE,SAAS,CAAC,CAAC;YAClD,OAAO,CAAC;gBACP,UAAU;gBACV,QAAQ;aACR,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAExB,IAAI,EAAE,CAAC;IACR,CAAC,CAAC,CAAC;AACJ,CAAC;AAvED,qCAuEC"}{
  "name": "https-proxy-agent",
  "version": "5.0.1",
  "description": "An HTTP(s) proxy `http.Agent` implementation for HTTPS",
  "main": "dist/index",
  "types": "dist/index",
  "files": [
    "dist"
  ],
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "tsc",
    "test": "mocha --reporter spec",
    "test-lint": "eslint src --ext .js,.ts",
    "prepublishOnly": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/TooTallNate/node-https-proxy-agent.git"
  },
  "keywords": [
    "https",
    "proxy",
    "endpoint",
    "agent"
  ],
  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/TooTallNate/node-https-proxy-agent/issues"
  },
  "dependencies": {
    "agent-base": "6",
    "debug": "4"
  },
  "devDependencies": {
    "@types/debug": "4",
    "@types/node": "^12.12.11",
    "@typescript-eslint/eslint-plugin": "1.6.0",
    "@typescript-eslint/parser": "1.1.0",
    "eslint": "5.16.0",
    "eslint-config-airbnb": "17.1.0",
    "eslint-config-prettier": "4.1.0",
    "eslint-import-resolver-typescript": "1.1.1",
    "eslint-plugin-import": "2.16.0",
    "eslint-plugin-jsx-a11y": "6.2.1",
    "eslint-plugin-react": "7.12.4",
    "mocha": "^6.2.2",
    "proxy": "1",
    "rimraf": "^3.0.0",
    "typescript": "^3.5.3"
  },
  "engines": {
    "node": ">= 6"
  }
}
https-proxy-agent
================
### An HTTP(s) proxy `http.Agent` implementation for HTTPS
[![Build Status](https://github.com/TooTallNate/node-https-proxy-agent/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-https-proxy-agent/actions?workflow=Node+CI)

This module provides an `http.Agent` implementation that connects to a specified
HTTP or HTTPS proxy server, and can be used with the built-in `https` module.

Specifically, this `Agent` implementation connects to an intermediary "proxy"
server and issues the [CONNECT HTTP method][CONNECT], which tells the proxy to
open a direct TCP connection to the destination server.

Since this agent implements the CONNECT HTTP method, it also works with other
protocols that use this method when connecting over proxies (i.e. WebSockets).
See the "Examples" section below for more.


Installation
------------

Install with `npm`:

``` bash
$ npm install https-proxy-agent
```


Examples
--------

#### `https` module example

``` js
var url = require('url');
var https = require('https');
var HttpsProxyAgent = require('https-proxy-agent');

// HTTP/HTTPS proxy to connect to
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
console.log('using proxy server %j', proxy);

// HTTPS endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'https://graph.facebook.com/tootallnate';
console.log('attempting to GET %j', endpoint);
var options = url.parse(endpoint);

// create an instance of the `HttpsProxyAgent` class with the proxy server information
var agent = new HttpsProxyAgent(proxy);
options.agent = agent;

https.get(options, function (res) {
  console.log('"response" event!', res.headers);
  res.pipe(process.stdout);
});
```

#### `ws` WebSocket connection example

``` js
var url = require('url');
var WebSocket = require('ws');
var HttpsProxyAgent = require('https-proxy-agent');

// HTTP/HTTPS proxy to connect to
var proxy = process.env.http_proxy || 'http://168.63.76.32:3128';
console.log('using proxy server %j', proxy);

// WebSocket endpoint for the proxy to connect to
var endpoint = process.argv[2] || 'ws://echo.websocket.org';
var parsed = url.parse(endpoint);
console.log('attempting to connect to WebSocket %j', endpoint);

// create an instance of the `HttpsProxyAgent` class with the proxy server information
var options = url.parse(proxy);

var agent = new HttpsProxyAgent(options);

// finally, initiate the WebSocket connection
var socket = new WebSocket(endpoint, { agent: agent });

socket.on('open', function () {
  console.log('"open" event!');
  socket.send('hello world');
});

socket.on('message', function (data, flags) {
  console.log('"message" event! %j %j', data, flags);
  socket.close();
});
```

API
---

### new HttpsProxyAgent(Object options)

The `HttpsProxyAgent` class implements an `http.Agent` subclass that connects
to the specified "HTTP(s) proxy server" in order to proxy HTTPS and/or WebSocket
requests. This is achieved by using the [HTTP `CONNECT` method][CONNECT].

The `options` argument may either be a string URI of the proxy server to use, or an
"options" object with more specific properties:

  * `host` - String - Proxy host to connect to (may use `hostname` as well). Required.
  * `port` - Number - Proxy port to connect to. Required.
  * `protocol` - String - If `https:`, then use TLS to connect to the proxy.
  * `headers` - Object - Additional HTTP headers to be sent on the HTTP CONNECT method.
  * Any other options given are passed to the `net.connect()`/`tls.connect()` functions.


License
-------

(The MIT License)

Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[CONNECT]: http://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_Tunneling
/**
Check if a value is an object.

Keep in mind that array, function, regexp, etc, are objects in JavaScript.

@example
```
import isObject = require('is-obj');

isObject({foo: 'bar'});
//=> true

isObject([1, 2, 3]);
//=> true

isObject('foo');
//=> false
```
*/
declare function isObject(value: unknown): value is object;

export = isObject;
'use strict';

module.exports = value => {
	const type = typeof value;
	return value !== null && (type === 'object' || type === 'function');
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "is-obj",
	"version": "2.0.0",
	"description": "Check if a value is an object",
	"license": "MIT",
	"repository": "sindresorhus/is-obj",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=8"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"object",
		"is",
		"check",
		"test",
		"type"
	],
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.2",
		"xo": "^0.24.0"
	}
}
# is-obj [![Build Status](https://travis-ci.org/sindresorhus/is-obj.svg?branch=master)](https://travis-ci.org/sindresorhus/is-obj)

> Check if a value is an object

Keep in mind that array, function, regexp, etc, are objects in JavaScript.<br>
See [`is-plain-obj`](https://github.com/sindresorhus/is-plain-obj) if you want to check for plain objects.


## Install

```
$ npm install is-obj
```


## Usage

```js
const isObject = require('is-obj');

isObject({foo: 'bar'});
//=> true

isObject([1, 2, 3]);
//=> true

isObject('foo');
//=> false
```


## Related

- [is](https://github.com/sindresorhus/is) - Type check values


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
extends: eslint:recommended
env:
  node: true
  browser: true
rules:
  block-scoped-var: 2
  complexity: [2, 15]
  curly: [2, multi-or-nest, consistent]
  dot-location: [2, property]
  dot-notation: 2
  indent: [2, 2, SwitchCase: 1]
  linebreak-style: [2, unix]
  new-cap: 2
  no-console: [2, allow: [warn, error]]
  no-else-return: 2
  no-eq-null: 2
  no-fallthrough: 2
  no-invalid-this: 2
  no-return-assign: 2
  no-shadow: 1
  no-trailing-spaces: 2
  no-use-before-define: [2, nofunc]
  quotes: [2, single, avoid-escape]
  semi: [2, always]
  strict: [2, global]
  valid-jsdoc: [2, requireReturn: false]
  no-control-regex: 0
github: epoberezkin
tidelift: "npm/json-schema-traverse"
name: build

on:
  push:
    branches: [master]
  pull_request:
    branches: ["*"]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.x, 12.x, 14.x]

    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm test
      - name: Coveralls
        uses: coverallsapp/github-action@master
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
name: publish

on:
  release:
    types: [published]

jobs:
  publish-npm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14
          registry-url: https://registry.npmjs.org/
      - run: npm install
      - run: npm test
      - name: Publish beta version to npm
        if: "github.event.release.prerelease"
        run: npm publish --tag beta
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
      - name: Publish to npm
        if: "!github.event.release.prerelease"
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
declare function traverse(
  schema: traverse.SchemaObject,
  opts: traverse.Options,
  cb?: traverse.Callback
): void;

declare function traverse(
  schema: traverse.SchemaObject,
  cb: traverse.Callback
): void;

declare namespace traverse {
  interface SchemaObject {
    $id?: string;
    $schema?: string;
    [x: string]: any;
  }

  type Callback = (
    schema: SchemaObject,
    jsonPtr: string,
    rootSchema: SchemaObject,
    parentJsonPtr?: string,
    parentKeyword?: string,
    parentSchema?: SchemaObject,
    keyIndex?: string | number
  ) => void;

  interface Options {
    allKeys?: boolean;
    cb?:
      | Callback
      | {
          pre?: Callback;
          post?: Callback;
        };
  }
}

export = traverse;
'use strict';

var traverse = module.exports = function (schema, opts, cb) {
  // Legacy support for v0.3.1 and earlier.
  if (typeof opts == 'function') {
    cb = opts;
    opts = {};
  }

  cb = opts.cb || cb;
  var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
  var post = cb.post || function() {};

  _traverse(opts, pre, post, schema, '', schema);
};


traverse.keywords = {
  additionalItems: true,
  items: true,
  contains: true,
  additionalProperties: true,
  propertyNames: true,
  not: true,
  if: true,
  then: true,
  else: true
};

traverse.arrayKeywords = {
  items: true,
  allOf: true,
  anyOf: true,
  oneOf: true
};

traverse.propsKeywords = {
  $defs: true,
  definitions: true,
  properties: true,
  patternProperties: true,
  dependencies: true
};

traverse.skipKeywords = {
  default: true,
  enum: true,
  const: true,
  required: true,
  maximum: true,
  minimum: true,
  exclusiveMaximum: true,
  exclusiveMinimum: true,
  multipleOf: true,
  maxLength: true,
  minLength: true,
  pattern: true,
  format: true,
  maxItems: true,
  minItems: true,
  uniqueItems: true,
  maxProperties: true,
  minProperties: true
};


function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
  if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
    pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
    for (var key in schema) {
      var sch = schema[key];
      if (Array.isArray(sch)) {
        if (key in traverse.arrayKeywords) {
          for (var i=0; i<sch.length; i++)
            _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
        }
      } else if (key in traverse.propsKeywords) {
        if (sch && typeof sch == 'object') {
          for (var prop in sch)
            _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
        }
      } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
        _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
      }
    }
    post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
  }
}


function escapeJsonPtr(str) {
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
}
MIT License

Copyright (c) 2017 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "json-schema-traverse",
  "version": "1.0.0",
  "description": "Traverse JSON Schema passing each schema object to callback",
  "main": "index.js",
  "types": "index.d.ts",
  "scripts": {
    "eslint": "eslint index.js spec",
    "test-spec": "mocha spec -R spec",
    "test": "npm run eslint && nyc npm run test-spec"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/epoberezkin/json-schema-traverse.git"
  },
  "keywords": [
    "JSON-Schema",
    "traverse",
    "iterate"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/epoberezkin/json-schema-traverse/issues"
  },
  "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme",
  "devDependencies": {
    "eslint": "^7.3.1",
    "mocha": "^8.0.1",
    "nyc": "^15.0.0",
    "pre-commit": "^1.2.2"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  }
}
# json-schema-traverse
Traverse JSON Schema passing each schema object to callback

[![build](https://github.com/epoberezkin/json-schema-traverse/workflows/build/badge.svg)](https://github.com/epoberezkin/json-schema-traverse/actions?query=workflow%3Abuild)
[![npm](https://img.shields.io/npm/v/json-schema-traverse)](https://www.npmjs.com/package/json-schema-traverse)
[![coverage](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master)


## Install

```
npm install json-schema-traverse
```


## Usage

```javascript
const traverse = require('json-schema-traverse');
const schema = {
  properties: {
    foo: {type: 'string'},
    bar: {type: 'integer'}
  }
};

traverse(schema, {cb});
// cb is called 3 times with:
// 1. root schema
// 2. {type: 'string'}
// 3. {type: 'integer'}

// Or:

traverse(schema, {cb: {pre, post}});
// pre is called 3 times with:
// 1. root schema
// 2. {type: 'string'}
// 3. {type: 'integer'}
//
// post is called 3 times with:
// 1. {type: 'string'}
// 2. {type: 'integer'}
// 3. root schema

```

Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is.  Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed.

Callback is passed these parameters:

- _schema_: the current schema object
- _JSON pointer_: from the root schema to the current schema object
- _root schema_: the schema passed to `traverse` object
- _parent JSON pointer_: from the root schema to the parent schema object (see below)
- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.)
- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema
- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'`


## Traverse objects in all unknown keywords

```javascript
const traverse = require('json-schema-traverse');
const schema = {
  mySchema: {
    minimum: 1,
    maximum: 2
  }
};

traverse(schema, {allKeys: true, cb});
// cb is called 2 times with:
// 1. root schema
// 2. mySchema
```

Without option `allKeys: true` callback will be called only with root schema.


## Enterprise support

json-schema-traverse package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-json-schema-traverse?utm_source=npm-json-schema-traverse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.


## Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.


## License

[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE)
parserOptions:
  ecmaVersion: 6
globals:
  beforeEach: false
  describe: false
  it: false
'use strict';

var schema = {
  additionalItems: subschema('additionalItems'),
  items: subschema('items'),
  contains: subschema('contains'),
  additionalProperties: subschema('additionalProperties'),
  propertyNames: subschema('propertyNames'),
  not: subschema('not'),
  allOf: [
    subschema('allOf_0'),
    subschema('allOf_1'),
    {
      items: [
        subschema('items_0'),
        subschema('items_1'),
      ]
    }
  ],
  anyOf: [
    subschema('anyOf_0'),
    subschema('anyOf_1'),
  ],
  oneOf: [
    subschema('oneOf_0'),
    subschema('oneOf_1'),
  ],
  definitions: {
    foo: subschema('definitions_foo'),
    bar: subschema('definitions_bar'),
  },
  properties: {
    foo: subschema('properties_foo'),
    bar: subschema('properties_bar'),
  },
  patternProperties: {
    foo: subschema('patternProperties_foo'),
    bar: subschema('patternProperties_bar'),
  },
  dependencies: {
    foo: subschema('dependencies_foo'),
    bar: subschema('dependencies_bar'),
  },
  required: ['foo', 'bar']
};


function subschema(keyword) {
  var sch = {
    properties: {},
    additionalProperties: false,
    additionalItems: false,
    anyOf: [
      {format: 'email'},
      {format: 'hostname'}
    ]
  };
  sch.properties['foo_' + keyword] = {title: 'foo'};
  sch.properties['bar_' + keyword] = {title: 'bar'};
  return sch;
}


module.exports = {
  schema: schema,

  // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
  expectedCalls: [[schema, '', schema, undefined, undefined, undefined, undefined]]
    .concat(expectedCalls('additionalItems'))
    .concat(expectedCalls('items'))
    .concat(expectedCalls('contains'))
    .concat(expectedCalls('additionalProperties'))
    .concat(expectedCalls('propertyNames'))
    .concat(expectedCalls('not'))
    .concat(expectedCallsChild('allOf', 0))
    .concat(expectedCallsChild('allOf', 1))
    .concat([
      [schema.allOf[2], '/allOf/2', schema, '', 'allOf', schema, 2],
      [schema.allOf[2].items[0], '/allOf/2/items/0', schema, '/allOf/2', 'items', schema.allOf[2], 0],
      [schema.allOf[2].items[0].properties.foo_items_0, '/allOf/2/items/0/properties/foo_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'foo_items_0'],
      [schema.allOf[2].items[0].properties.bar_items_0, '/allOf/2/items/0/properties/bar_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'bar_items_0'],
      [schema.allOf[2].items[0].anyOf[0], '/allOf/2/items/0/anyOf/0', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 0],
      [schema.allOf[2].items[0].anyOf[1], '/allOf/2/items/0/anyOf/1', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 1],

      [schema.allOf[2].items[1], '/allOf/2/items/1', schema, '/allOf/2', 'items', schema.allOf[2], 1],
      [schema.allOf[2].items[1].properties.foo_items_1, '/allOf/2/items/1/properties/foo_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'foo_items_1'],
      [schema.allOf[2].items[1].properties.bar_items_1, '/allOf/2/items/1/properties/bar_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'bar_items_1'],
      [schema.allOf[2].items[1].anyOf[0], '/allOf/2/items/1/anyOf/0', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 0],
      [schema.allOf[2].items[1].anyOf[1], '/allOf/2/items/1/anyOf/1', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 1]
    ])
    .concat(expectedCallsChild('anyOf', 0))
    .concat(expectedCallsChild('anyOf', 1))
    .concat(expectedCallsChild('oneOf', 0))
    .concat(expectedCallsChild('oneOf', 1))
    .concat(expectedCallsChild('definitions', 'foo'))
    .concat(expectedCallsChild('definitions', 'bar'))
    .concat(expectedCallsChild('properties', 'foo'))
    .concat(expectedCallsChild('properties', 'bar'))
    .concat(expectedCallsChild('patternProperties', 'foo'))
    .concat(expectedCallsChild('patternProperties', 'bar'))
    .concat(expectedCallsChild('dependencies', 'foo'))
    .concat(expectedCallsChild('dependencies', 'bar'))
};


function expectedCalls(keyword) {
  return [
    [schema[keyword], `/${keyword}`, schema, '', keyword, schema, undefined],
    [schema[keyword].properties[`foo_${keyword}`], `/${keyword}/properties/foo_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `foo_${keyword}`],
    [schema[keyword].properties[`bar_${keyword}`], `/${keyword}/properties/bar_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `bar_${keyword}`],
    [schema[keyword].anyOf[0], `/${keyword}/anyOf/0`, schema, `/${keyword}`, 'anyOf', schema[keyword], 0],
    [schema[keyword].anyOf[1], `/${keyword}/anyOf/1`, schema, `/${keyword}`, 'anyOf', schema[keyword], 1]
  ];
}


function expectedCallsChild(keyword, i) {
  return [
    [schema[keyword][i], `/${keyword}/${i}`, schema, '', keyword, schema, i],
    [schema[keyword][i].properties[`foo_${keyword}_${i}`], `/${keyword}/${i}/properties/foo_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `foo_${keyword}_${i}`],
    [schema[keyword][i].properties[`bar_${keyword}_${i}`], `/${keyword}/${i}/properties/bar_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `bar_${keyword}_${i}`],
    [schema[keyword][i].anyOf[0], `/${keyword}/${i}/anyOf/0`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 0],
    [schema[keyword][i].anyOf[1], `/${keyword}/${i}/anyOf/1`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 1]
  ];
}
'use strict';

var traverse = require('../index');
var assert = require('assert');

describe('json-schema-traverse', function() {
  var calls;

  beforeEach(function() {
    calls = [];
  });

  it('should traverse all keywords containing schemas recursively', function() {
    var schema = require('./fixtures/schema').schema;
    var expectedCalls = require('./fixtures/schema').expectedCalls;

    traverse(schema, {cb: callback});
    assert.deepStrictEqual(calls, expectedCalls);
  });

  describe('Legacy v0.3.1 API', function() {
    it('should traverse all keywords containing schemas recursively', function() {
      var schema = require('./fixtures/schema').schema;
      var expectedCalls = require('./fixtures/schema').expectedCalls;

      traverse(schema, callback);
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should work when an options object is provided', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var schema = require('./fixtures/schema').schema;
      var expectedCalls = require('./fixtures/schema').expectedCalls;

      traverse(schema, {}, callback);
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });


  describe('allKeys option', function() {
    var schema = {
      someObject: {
        minimum: 1,
        maximum: 2
      }
    };

    it('should traverse objects with allKeys: true option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined],
        [schema.someObject, '/someObject', schema, '', 'someObject', schema, undefined]
      ];

      traverse(schema, {allKeys: true, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT traverse objects with allKeys: false option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined]
      ];

      traverse(schema, {allKeys: false, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT traverse objects without allKeys option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined]
      ];

      traverse(schema, {cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT travers objects in standard keywords which value is not a schema', function() {
      var schema2 = {
        const: {foo: 'bar'},
        enum: ['a', 'b'],
        required: ['foo'],
        another: {

        },
        patternProperties: {}, // will not traverse - no properties
        dependencies: true, // will not traverse - invalid
        properties: {
          smaller: {
            type: 'number'
          },
          larger: {
            type: 'number',
            minimum: {$data: '1/smaller'}
          }
        }
      };

      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema2, '', schema2, undefined, undefined, undefined, undefined],
        [schema2.another, '/another', schema2, '', 'another', schema2, undefined],
        [schema2.properties.smaller, '/properties/smaller', schema2, '', 'properties', schema2, 'smaller'],
        [schema2.properties.larger, '/properties/larger', schema2, '', 'properties', schema2, 'larger'],
      ];

      traverse(schema2, {allKeys: true, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });

  describe('pre and post', function() {
    var schema = {
      type: 'object',
      properties: {
        name: {type: 'string'},
        age: {type: 'number'}
      }
    };

    it('should traverse schema in pre-order', function() {
      traverse(schema, {cb: {pre}});
      var expectedCalls = [
        ['pre', schema, '', schema, undefined, undefined, undefined, undefined],
        ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should traverse schema in post-order', function() {
      traverse(schema, {cb: {post}});
      var expectedCalls = [
        ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema, '', schema, undefined, undefined, undefined, undefined],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should traverse schema in pre- and post-order at the same time', function() {
      traverse(schema, {cb: {pre, post}});
      var expectedCalls = [
        ['pre', schema, '', schema, undefined, undefined, undefined, undefined],
        ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema, '', schema, undefined, undefined, undefined, undefined],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });

  function callback() {
    calls.push(Array.prototype.slice.call(arguments));
  }

  function pre() {
    calls.push(['pre'].concat(Array.prototype.slice.call(arguments)));
  }

  function post() {
    calls.push(['post'].concat(Array.prototype.slice.call(arguments)));
  }
});
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

(function (JSONSchemaFormat) {
  JSONSchemaFormat["Date"] = "date";
  JSONSchemaFormat["DateTime"] = "date-time";
  JSONSchemaFormat["Email"] = "email";
  JSONSchemaFormat["Hostname"] = "hostname";
  JSONSchemaFormat["IDNEmail"] = "idn-email";
  JSONSchemaFormat["IDNHostname"] = "idn-hostname";
  JSONSchemaFormat["IPv4"] = "ipv4";
  JSONSchemaFormat["IPv6"] = "ipv6";
  JSONSchemaFormat["IRI"] = "iri";
  JSONSchemaFormat["IRIReference"] = "iri-reference";
  JSONSchemaFormat["JSONPointer"] = "json-pointer";
  JSONSchemaFormat["JSONPointerURIFragment"] = "json-pointer-uri-fragment";
  JSONSchemaFormat["RegEx"] = "regex";
  JSONSchemaFormat["RelativeJSONPointer"] = "relative-json-pointer";
  JSONSchemaFormat["Time"] = "time";
  JSONSchemaFormat["URI"] = "uri";
  JSONSchemaFormat["URIReference"] = "uri-reference";
  JSONSchemaFormat["URITemplate"] = "uri-template";
  JSONSchemaFormat["UUID"] = "uuid";
})(exports.JSONSchemaFormat || (exports.JSONSchemaFormat = {}));

(function (JSONSchemaType) {
  JSONSchemaType["Array"] = "array";
  JSONSchemaType["Boolean"] = "boolean";
  JSONSchemaType["Integer"] = "integer";
  JSONSchemaType["Null"] = "null";
  JSONSchemaType["Number"] = "number";
  JSONSchemaType["Object"] = "object";
  JSONSchemaType["String"] = "string";
})(exports.JSONSchemaType || (exports.JSONSchemaType = {}));

(function (JSONSchemaContentEncoding) {
  JSONSchemaContentEncoding["7bit"] = "7bit";
  JSONSchemaContentEncoding["8bit"] = "8bit";
  JSONSchemaContentEncoding["Binary"] = "binary";
  JSONSchemaContentEncoding["QuotedPrintable"] = "quoted-printable";
  JSONSchemaContentEncoding["Base64"] = "base64";
  JSONSchemaContentEncoding["IETFToken"] = "ietf-token";
  JSONSchemaContentEncoding["XToken"] = "x-token";
})(exports.JSONSchemaContentEncoding || (exports.JSONSchemaContentEncoding = {}));

const JSONSchemaKeys = ['$comment', '$id', '$ref', '$schema', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'contentEncoding', 'contentMediaType', 'default', 'definitions', 'dependencies', 'description', 'else', 'enum', 'examples', 'exclusiveMaximum', 'exclusiveMinimum', 'format', 'if', 'items', 'maximum', 'maxItems', 'maxLength', 'maxProperties', 'minimum', 'minItems', 'minLength', 'minProperties', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'propertyNames', 'readOnly', 'required', 'then', 'title', 'type', 'uniqueItems', 'writeOnly'];

exports.JSONSchemaKeys = JSONSchemaKeys;
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["\"use strict\";\n\nexport let JSONSchemaFormat;\n\n(function (JSONSchemaFormat) {\n  JSONSchemaFormat[\"Date\"] = \"date\";\n  JSONSchemaFormat[\"DateTime\"] = \"date-time\";\n  JSONSchemaFormat[\"Email\"] = \"email\";\n  JSONSchemaFormat[\"Hostname\"] = \"hostname\";\n  JSONSchemaFormat[\"IDNEmail\"] = \"idn-email\";\n  JSONSchemaFormat[\"IDNHostname\"] = \"idn-hostname\";\n  JSONSchemaFormat[\"IPv4\"] = \"ipv4\";\n  JSONSchemaFormat[\"IPv6\"] = \"ipv6\";\n  JSONSchemaFormat[\"IRI\"] = \"iri\";\n  JSONSchemaFormat[\"IRIReference\"] = \"iri-reference\";\n  JSONSchemaFormat[\"JSONPointer\"] = \"json-pointer\";\n  JSONSchemaFormat[\"JSONPointerURIFragment\"] = \"json-pointer-uri-fragment\";\n  JSONSchemaFormat[\"RegEx\"] = \"regex\";\n  JSONSchemaFormat[\"RelativeJSONPointer\"] = \"relative-json-pointer\";\n  JSONSchemaFormat[\"Time\"] = \"time\";\n  JSONSchemaFormat[\"URI\"] = \"uri\";\n  JSONSchemaFormat[\"URIReference\"] = \"uri-reference\";\n  JSONSchemaFormat[\"URITemplate\"] = \"uri-template\";\n  JSONSchemaFormat[\"UUID\"] = \"uuid\";\n})(JSONSchemaFormat || (JSONSchemaFormat = {}));\n\nexport let JSONSchemaType;\n\n(function (JSONSchemaType) {\n  JSONSchemaType[\"Array\"] = \"array\";\n  JSONSchemaType[\"Boolean\"] = \"boolean\";\n  JSONSchemaType[\"Integer\"] = \"integer\";\n  JSONSchemaType[\"Null\"] = \"null\";\n  JSONSchemaType[\"Number\"] = \"number\";\n  JSONSchemaType[\"Object\"] = \"object\";\n  JSONSchemaType[\"String\"] = \"string\";\n})(JSONSchemaType || (JSONSchemaType = {}));\n\nexport let JSONSchemaContentEncoding;\n\n(function (JSONSchemaContentEncoding) {\n  JSONSchemaContentEncoding[\"7bit\"] = \"7bit\";\n  JSONSchemaContentEncoding[\"8bit\"] = \"8bit\";\n  JSONSchemaContentEncoding[\"Binary\"] = \"binary\";\n  JSONSchemaContentEncoding[\"QuotedPrintable\"] = \"quoted-printable\";\n  JSONSchemaContentEncoding[\"Base64\"] = \"base64\";\n  JSONSchemaContentEncoding[\"IETFToken\"] = \"ietf-token\";\n  JSONSchemaContentEncoding[\"XToken\"] = \"x-token\";\n})(JSONSchemaContentEncoding || (JSONSchemaContentEncoding = {}));\n\nexport const JSONSchemaKeys = ['$comment', '$id', '$ref', '$schema', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'contentEncoding', 'contentMediaType', 'default', 'definitions', 'dependencies', 'description', 'else', 'enum', 'examples', 'exclusiveMaximum', 'exclusiveMinimum', 'format', 'if', 'items', 'maximum', 'maxItems', 'maxLength', 'maxProperties', 'minimum', 'minItems', 'minLength', 'minProperties', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'propertyNames', 'readOnly', 'required', 'then', 'title', 'type', 'uniqueItems', 'writeOnly'];"],"names":["JSONSchemaFormat","JSONSchemaType","JSONSchemaContentEncoding","JSONSchemaKeys"],"mappings":";;;;AAIA,CAAC,UAAUA,gBAAV,EAA4B;EAC3BA,gBAAgB,CAAC,MAAD,CAAhB,GAA2B,MAA3B;EACAA,gBAAgB,CAAC,UAAD,CAAhB,GAA+B,WAA/B;EACAA,gBAAgB,CAAC,OAAD,CAAhB,GAA4B,OAA5B;EACAA,gBAAgB,CAAC,UAAD,CAAhB,GAA+B,UAA/B;EACAA,gBAAgB,CAAC,UAAD,CAAhB,GAA+B,WAA/B;EACAA,gBAAgB,CAAC,aAAD,CAAhB,GAAkC,cAAlC;EACAA,gBAAgB,CAAC,MAAD,C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sC,QAAtC;EACAA,yBAAyB,CAAC,iBAAD,CAAzB,GAA+C,kBAA/C;EACAA,yBAAyB,CAAC,QAAD,CAAzB,GAAsC,QAAtC;EACAA,yBAAyB,CAAC,WAAD,CAAzB,GAAyC,YAAzC;EACAA,yBAAyB,CAAC,QAAD,CAAzB,GAAsC,SAAtC;CAPF,EAQGA,iCAAyB,KAAKA,iCAAyB,GAAG,EAAjC,CAR5B;;AAUA,MAAaC,cAAc,GAAG,CAAC,UAAD,EAAa,KAAb,EAAoB,MAApB,EAA4B,SAA5B,EAAuC,iBAAvC,EAA0D,sBAA1D,EAAkF,OAAlF,EAA2F,OAA3F,EAAoG,OAApG,EAA6G,UAA7G,EAAyH,iBAAzH,EAA4I,kBAA5I,EAAgK,SAAhK,EAA2K,aAA3K,EAA0L,cAA1L,EAA0M,aAA1M,EAAyN,MAAzN,EAAiO,MAAjO,EAAyO,UAAzO,EAAqP,kBAArP,EAAyQ,kBAAzQ,EAA6R,QAA7R,EAAuS,IAAvS,EAA6S,OAA7S,EAAsT,SAAtT,EAAiU,UAAjU,EAA6U,WAA7U,EAA0V,eAA1V,EAA2W,SAA3W,EAAsX,UAAtX,EAAkY,WAAlY,EAA+Y,eAA/Y,EAAga,YAAha,EAA8a,KAA9a,EAAqb,OAArb,EAA8b,SAA9b,EAAyc,mBAAzc,EAA8d,YAA9d,EAA4e,eAA5e,EAA6f,UAA7f,EAAygB,UAAzgB,EAAqhB,MAArhB,EAA6hB,OAA7hB,EAAsiB,MAAtiB,EAA8iB,aAA9iB,EAA6jB,WAA7jB,CAAvB;;;;"}"use strict";

export let JSONSchemaFormat;

(function (JSONSchemaFormat) {
  JSONSchemaFormat["Date"] = "date";
  JSONSchemaFormat["DateTime"] = "date-time";
  JSONSchemaFormat["Email"] = "email";
  JSONSchemaFormat["Hostname"] = "hostname";
  JSONSchemaFormat["IDNEmail"] = "idn-email";
  JSONSchemaFormat["IDNHostname"] = "idn-hostname";
  JSONSchemaFormat["IPv4"] = "ipv4";
  JSONSchemaFormat["IPv6"] = "ipv6";
  JSONSchemaFormat["IRI"] = "iri";
  JSONSchemaFormat["IRIReference"] = "iri-reference";
  JSONSchemaFormat["JSONPointer"] = "json-pointer";
  JSONSchemaFormat["JSONPointerURIFragment"] = "json-pointer-uri-fragment";
  JSONSchemaFormat["RegEx"] = "regex";
  JSONSchemaFormat["RelativeJSONPointer"] = "relative-json-pointer";
  JSONSchemaFormat["Time"] = "time";
  JSONSchemaFormat["URI"] = "uri";
  JSONSchemaFormat["URIReference"] = "uri-reference";
  JSONSchemaFormat["URITemplate"] = "uri-template";
  JSONSchemaFormat["UUID"] = "uuid";
})(JSONSchemaFormat || (JSONSchemaFormat = {}));

export let JSONSchemaType;

(function (JSONSchemaType) {
  JSONSchemaType["Array"] = "array";
  JSONSchemaType["Boolean"] = "boolean";
  JSONSchemaType["Integer"] = "integer";
  JSONSchemaType["Null"] = "null";
  JSONSchemaType["Number"] = "number";
  JSONSchemaType["Object"] = "object";
  JSONSchemaType["String"] = "string";
})(JSONSchemaType || (JSONSchemaType = {}));

export let JSONSchemaContentEncoding;

(function (JSONSchemaContentEncoding) {
  JSONSchemaContentEncoding["7bit"] = "7bit";
  JSONSchemaContentEncoding["8bit"] = "8bit";
  JSONSchemaContentEncoding["Binary"] = "binary";
  JSONSchemaContentEncoding["QuotedPrintable"] = "quoted-printable";
  JSONSchemaContentEncoding["Base64"] = "base64";
  JSONSchemaContentEncoding["IETFToken"] = "ietf-token";
  JSONSchemaContentEncoding["XToken"] = "x-token";
})(JSONSchemaContentEncoding || (JSONSchemaContentEncoding = {}));

export const JSONSchemaKeys = ['$comment', '$id', '$ref', '$schema', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'contentEncoding', 'contentMediaType', 'default', 'definitions', 'dependencies', 'description', 'else', 'enum', 'examples', 'exclusiveMaximum', 'exclusiveMinimum', 'format', 'if', 'items', 'maximum', 'maxItems', 'maxLength', 'maxProperties', 'minimum', 'minItems', 'minLength', 'minProperties', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'propertyNames', 'readOnly', 'required', 'then', 'title', 'type', 'uniqueItems', 'writeOnly'];export {};
/**
 * JSON Schema
 *
 * Documentation corresponds to the work-in-progress draft-07 of JSON Schema.
 *
 * The latest published drafts are:
 * - draft-handrews-json-schema-01
 * - draft-handrews-json-schema-validation-01
 *
 * For more information, visit: http://json-schema.org/.
 *
 * Draft date: March 19, 2018.
 *
 * @public
 */
export interface JSONSchema {
  /**
   * This keyword is reserved for comments from schema authors to readers or
   * maintainers of the schema. The value of this keyword MUST be a string.
   * Implementations MUST NOT present this string to end users. Tools for
   * editing schemas SHOULD support displaying and editing this keyword.
   *
   * The value of this keyword MAY be used in debug or error output which is
   * intended for developers making use of schemas. Schema vocabularies SHOULD
   * allow "$comment" within any object containing vocabulary keywords.
   *
   * Implementations MAY assume "$comment" is allowed unless the vocabulary
   * specifically forbids it. Vocabularies MUST NOT specify any effect of
   * "$comment" beyond what is described in this specification. Tools that
   * translate other media types or programming languages to and from
   * application/schema+json MAY choose to convert that media type or
   * programming language's native comments to or from "$comment" values.
   *
   * The behavior of such translation when both native comments and "$comment"
   * properties are present is implementation-dependent. Implementations SHOULD
   * treat "$comment" identically to an unknown extension keyword.
   *
   * They MAY strip "$comment" values at any point during processing. In
   * particular, this allows for shortening schemas when the size of deployed
   * schemas is a concern. Implementations MUST NOT take any other action based
   * on the presence, absence, or contents of "$comment" properties.
   */
  $comment?: string
  /**
   * The "$id" keyword defines a URI for the schema, and the base URI that other
   * URI references within the schema are resolved against. A subschema's "$id"
   * is resolved against the base URI of its parent schema. If no parent sets an
   * explicit base with "$id", the base URI is that of the entire document, as
   * determined per [RFC 3986 section 5][RFC3986].
   *
   * If present, the value for this keyword MUST be a string, and MUST represent
   * a valid [URI-reference][RFC3986]. This value SHOULD be normalized, and
   * SHOULD NOT be an empty fragment <#> or an empty string <>.
   *
   * [RFC3986]: http://json-schema.org/latest/json-schema-core.html#RFC3986
   */
  $id?: string
  /**
   * The "$ref" keyword is used to reference a schema, and provides the ability
   * to validate recursive structures through self-reference.
   *
   * An object schema with a "$ref" property MUST be interpreted as a "$ref"
   * reference. The value of the "$ref" property MUST be a URI Reference.
   * Resolved against the current URI base, it identifies the URI of a schema to
   * use. All other properties in a "$ref" object MUST be ignored.
   *
   * The URI is not a network locator, only an identifier. A schema need not be
   * downloadable from the address if it is a network-addressable URL, and
   * implementations SHOULD NOT assume they should perform a network operation
   * when they encounter a network-addressable URI.
   *
   * A schema MUST NOT be run into an infinite loop against a schema. For
   * example, if two schemas "#alice" and "#bob" both have an "allOf" property
   * that refers to the other, a naive validator might get stuck in an infinite
   * recursive loop trying to validate the instance. Schemas SHOULD NOT make use
   * of infinite recursive nesting like this; the behavior is undefined.
   */
  $ref?: string
  /**
   * The "$schema" keyword is both used as a JSON Schema version identifier and
   * the location of a resource which is itself a JSON Schema, which describes
   * any schema written for this particular version.
   *
   * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme)
   * and this URI MUST be normalized. The current schema MUST be valid against
   * the meta-schema identified by this URI.
   *
   * If this URI identifies a retrievable resource, that resource SHOULD be of
   * media type "application/schema+json".
   *
   * The "$schema" keyword SHOULD be used in a root schema. It MUST NOT appear
   * in subschemas.
   *
   * Values for this property are defined in other documents and by other
   * parties. JSON Schema implementations SHOULD implement support for current
   * and previous published drafts of JSON Schema vocabularies as deemed
   * reasonable.
   *
   * [RFC3986]: http://json-schema.org/latest/json-schema-core.html#RFC3986
   */
  $schema?: string
  /**
   * The value of "additionalItems" MUST be a valid JSON Schema.
   *
   * This keyword determines how child instances validate for arrays, and does
   * not directly validate the immediate instance itself.
   *
   * If "items" is an array of schemas, validation succeeds if every instance
   * element at a position greater than the size of "items" validates against
   * "additionalItems".
   *
   * Otherwise, "additionalItems" MUST be ignored, as the "items" schema
   * (possibly the default value of an empty schema) is applied to all elements.
   *
   * Omitting this keyword has the same behavior as an empty schema.
   */
  additionalItems?: JSONSchema | boolean
  /**
   * The value of "additionalProperties" MUST be a valid JSON Schema.
   *
   * This keyword determines how child instances validate for objects, and does
   * not directly validate the immediate instance itself.
   *
   * Validation with "additionalProperties" applies only to the child values of
   * instance names that do not match any names in "properties", and do not
   * match any regular expression in "patternProperties".
   *
   * For all such properties, validation succeeds if the child instance
   * validates against the "additionalProperties" schema.
   *
   * Omitting this keyword has the same behavior as an empty schema.
   */
  additionalProperties?: JSONSchema | boolean
  /**
   * This keyword's value MUST be a non-empty array. Each item of the array MUST
   * be a valid JSON Schema.
   *
   * An instance validates successfully against this keyword if it validates
   * successfully against all schemas defined by this keyword's value.
   */
  allOf?: (JSONSchema | boolean)[]
  /**
   * This keyword's value MUST be a non-empty array. Each item of the array MUST
   * be a valid JSON Schema.
   *
   * An instance validates successfully against this keyword if it validates
   * successfully against at least one schema defined by this keyword's value.
   */
  anyOf?: (JSONSchema | boolean)[]
  /**
   * The value of this keyword MAY be of any type, including null.
   *
   * An instance validates successfully against this keyword if its value is
   * equal to the value of the keyword.
   */
  const?: any
  /**
   * The value of this keyword MUST be a valid JSON Schema.
   *
   * An array instance is valid against "contains" if at least one of its
   * elements is valid against the given schema.
   */
  contains?: JSONSchema | boolean
  /**
   * If the instance value is a string, this property defines that the string
   * SHOULD be interpreted as binary data and decoded using the encoding named
   * by this property. [RFC 2045, Sec 6.1][RFC2045] lists the possible values for
   * this property.
   *
   * The value of this property SHOULD be ignored if the instance described is
   * not a string.
   *
   * [RFC2045]: https://tools.ietf.org/html/rfc2045#section-6.1
   */
  contentEncoding?: JSONSchemaContentEncodingName | JSONSchemaContentEncoding
  /**
   * The value of this property must be a media type, as defined by
   * [RFC 2046][RFC2046]. This property defines the media type of instances
   * which this schema defines.
   *
   * The value of this property SHOULD be ignored if the instance described is
   * not a string.
   *
   * If the "contentEncoding" property is not present, but the instance value is
   * a string, then the value of this property SHOULD specify a text document
   * type, and the character set SHOULD be the character set into which the
   * JSON string value was decoded (for which the default is Unicode).
   *
   * [RFC2046]: https://tools.ietf.org/html/rfc2046
   */
  contentMediaType?: string
  /**
   * There are no restrictions placed on the value of this keyword. When
   * multiple occurrences of this keyword are applicable to a single
   * sub-instance, implementations SHOULD remove duplicates.
   *
   * This keyword can be used to supply a default JSON value associated with a
   * particular schema. It is RECOMMENDED that a default value be valid against
   * the associated schema.
   */
  default?: any
  /**
   * The "definitions" keywords provides a standardized location for schema
   * authors to inline re-usable JSON Schemas into a more general schema. The
   * keyword does not directly affect the validation result.
   *
   * This keyword's value MUST be an object. Each member value of this object
   * MUST be a valid JSON Schema.
   */
  definitions?: {
    [key: string]: JSONSchema | boolean
  }
  /**
   * This keyword specifies rules that are evaluated if the instance is an
   * object and contains a certain property.
   *
   * This keyword's value MUST be an object. Each property specifies a
   * dependency. Each dependency value MUST be an array or a valid JSON Schema.
   *
   * If the dependency value is a subschema, and the dependency key is a
   * property in the instance, the entire instance must validate against the
   * dependency value.
   *
   * If the dependency value is an array, each element in the array, if any,
   * MUST be a string, and MUST be unique. If the dependency key is a property
   * in the instance, each of the items in the dependency value must be a
   * property that exists in the instance.
   *
   * Omitting this keyword has the same behavior as an empty object.
   */
  dependencies?:
    | {
        [key: string]: JSONSchema | boolean | string[]
      }
    | string[]
  /**
   * Can be used to decorate a user interface with explanation or information
   * about the data produced.
   */
  description?: string
  /**
   * This keyword's value MUST be a valid JSON Schema.
   *
   * When "if" is present, and the instance fails to validate against its
   * subschema, then validation succeeds against this keyword if the instance
   * successfully validates against this keyword's subschema.
   *
   * This keyword has no effect when "if" is absent, or when the instance
   * successfully validates against its subschema. Implementations MUST NOT
   * evaluate the instance against this keyword, for either validation or
   * annotation collection purposes, in such cases.
   */
  else?: JSONSchema | boolean
  /**
   * The value of this keyword MUST be an array. This array SHOULD have at least
   * one element. Elements in the array SHOULD be unique.
   *
   * An instance validates successfully against this keyword if its value is
   * equal to one of the elements in this keyword's array value.
   *
   * Elements in the array might be of any value, including null.
   */
  enum?: any[]
  /**
   * The value of this keyword MUST be an array. There are no restrictions
   * placed on the values within the array. When multiple occurrences of this
   * keyword are applicable to a single sub-instance, implementations MUST
   * provide a flat array of all values rather than an array of arrays.
   *
   * This keyword can be used to provide sample JSON values associated with a
   * particular schema, for the purpose of illustrating usage. It is RECOMMENDED
   * that these values be valid against the associated schema.
   *
   * Implementations MAY use the value(s) of "default", if present, as an
   * additional example. If "examples" is absent, "default" MAY still be used in
   * this manner.
   */
  examples?: any[]
  /**
   * The value of "exclusiveMaximum" MUST be number, representing an exclusive
   * upper limit for a numeric instance.
   *
   * If the instance is a number, then the instance is valid only if it has a
   * value strictly less than (not equal to) "exclusiveMaximum".
   */
  exclusiveMaximum?: number
  /**
   * The value of "exclusiveMinimum" MUST be number, representing an exclusive
   * lower limit for a numeric instance.
   *
   * If the instance is a number, then the instance is valid only if it has a
   * value strictly greater than (not equal to) "exclusiveMinimum".
   */
  exclusiveMinimum?: number
  /**
   * The "format" keyword functions as both an [annotation][annotation] and as
   * an [assertion][assertion]. While no special effort is required to implement
   * it as an annotation conveying semantic meaning, implementing validation is
   * non-trivial.
   *
   * Implementations MAY support the "format" keyword as a validation assertion.
   * Should they choose to do so:
   *
   *  - they SHOULD implement validation for attributes defined below;
   *  - they SHOULD offer an option to disable validation for this keyword.
   *
   * Implementations MAY add custom format attributes. Save for agreement
   * between parties, schema authors SHALL NOT expect a peer implementation to
   * support this keyword and/or custom format attributes.
   *
   * [annotation]: http://json-schema.org/latest/json-schema-validation.html#annotations
   * [assertion]: http://json-schema.org/latest/json-schema-validation.html#assertions
   */
  format?:
    | JSONSchemaFormat
    | 'date'
    | 'date-time'
    | 'email'
    | 'full-date'
    | 'full-time'
    | 'hostname'
    | 'idn-email'
    | 'idn-hostname'
    | 'ipv4'
    | 'ipv6'
    | 'iri'
    | 'iri-reference'
    | 'json-pointer'
    | 'json-pointer-uri-fragment'
    | 'regex'
    | 'relative-json-pointer'
    | 'time'
    | 'uri'
    | 'uri-reference'
    | 'uri-template'
    | 'uuid'
  /**
   * This keyword's value MUST be a valid JSON Schema.
   *
   * This validation outcome of this keyword's subschema has no direct effect on
   * the overall validation result. Rather, it controls which of the "then" or
   * "else" keywords are evaluated.
   *
   * Instances that successfully validate against this keyword's subschema MUST
   * also be valid against the subschema value of the "then" keyword, if
   * present.
   *
   * Instances that fail to validate against this keyword's subschema MUST also
   * be valid against the subschema value of the "else" keyword, if present.
   *
   * If [annotations][annotations] are being collected, they are collected from
   * this keyword's subschema in the usual way, including when the keyword is
   * present without either "then" or "else".
   *
   * [annotations]: http://json-schema.org/latest/json-schema-validation.html#annotations
   */
  if?: JSONSchema | boolean
  /**
   * The value of "items" MUST be either a valid JSON Schema or an array of
   * valid JSON Schemas.
   *
   * This keyword determines how child instances validate for arrays, and does
   * not directly validate the immediate instance itself.
   *
   * If "items" is a schema, validation succeeds if all elements in the array
   * successfully validate against that schema.
   *
   * If "items" is an array of schemas, validation succeeds if each element of
   * the instance validates against the schema at the same position, if any.
   *
   * Omitting this keyword has the same behavior as an empty schema.
   */
  items?: JSONSchema | boolean | (JSONSchema | boolean)[]
  /**
   * The value of "maximum" MUST be a number, representing an inclusive upper
   * limit for a numeric instance.
   *
   * If the instance is a number, then this keyword validates only if the
   * instance is less than or exactly equal to "maximum".
   */
  maximum?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * An array instance is valid against "maxItems" if its size is less than, or
   * equal to, the value of this keyword.
   */
  maxItems?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * A string instance is valid against this keyword if its length is less than,
   * or equal to, the value of this keyword.
   *
   * The length of a string instance is defined as the number of its characters
   * as defined by [RFC 7159][RFC7159].
   *
   * [RFC7159]: http://json-schema.org/latest/json-schema-validation.html#RFC7159
   */
  maxLength?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * An object instance is valid against "maxProperties" if its number of
   * properties is less than, or equal to, the value of this keyword.
   */
  maxProperties?: number
  /**
   * The value of "minimum" MUST be a number, representing an inclusive lower
   * limit for a numeric instance.
   *
   * If the instance is a number, then this keyword validates only if the
   * instance is greater than or exactly equal to "minimum".
   */
  minimum?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * A string instance is valid against this keyword if its length is greater
   * than, or equal to, the value of this keyword.
   *
   * The length of a string instance is defined as the number of its characters
   * as defined by [RFC 7159][RFC7159].
   *
   * Omitting this keyword has the same behavior as a value of 0.
   *
   * [RFC7159]: http://json-schema.org/latest/json-schema-validation.html#RFC7159
   */
  minLength?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * An array instance is valid against "minItems" if its size is greater than,
   * or equal to, the value of this keyword.
   *
   * Omitting this keyword has the same behavior as a value of 0.
   */
  minItems?: number
  /**
   * The value of this keyword MUST be a non-negative integer.
   *
   * An object instance is valid against "minProperties" if its number of
   * properties is greater than, or equal to, the value of this keyword.
   *
   * Omitting this keyword has the same behavior as a value of 0.
   */
  minProperties?: number
  /**
   * The value of "multipleOf" MUST be a number, strictly greater than 0.
   *
   * A numeric instance is valid only if division by this keyword's value
   * results in an integer.
   */
  multipleOf?: number
  /**
   * This keyword's value MUST be a valid JSON Schema.
   *
   * An instance is valid against this keyword if it fails to validate
   * successfully against the schema defined by this keyword.
   */
  not?: JSONSchema | boolean
  /**
   * This keyword's value MUST be a non-empty array. Each item of the array MUST
   * be a valid JSON Schema.
   *
   * An instance validates successfully against this keyword if it validates
   * successfully against exactly one schema defined by this keyword's value.
   */
  oneOf?: (JSONSchema | boolean)[]
  /**
   * The value of this keyword MUST be a string. This string SHOULD be a valid
   * regular expression, according to the ECMA 262 regular expression dialect.
   *
   * A string instance is considered valid if the regular expression matches the
   * instance successfully. Recall: regular expressions are not implicitly
   * anchored.
   */
  pattern?: string
  /**
   * The value of "patternProperties" MUST be an object. Each property name of
   * this object SHOULD be a valid regular expression, according to the ECMA 262
   * regular expression dialect. Each property value of this object MUST be a
   * valid JSON Schema.
   *
   * This keyword determines how child instances validate for objects, and does
   * not directly validate the immediate instance itself. Validation of the
   * primitive instance type against this keyword always succeeds.
   *
   * Validation succeeds if, for each instance name that matches any regular
   * expressions that appear as a property name in this keyword's value, the
   * child instance for that name successfully validates against each schema
   * that corresponds to a matching regular expression.
   *
   * Omitting this keyword has the same behavior as an empty object.
   */
  patternProperties?: {
    [key: string]: JSONSchema | boolean
  }
  /**
   * The value of "properties" MUST be an object. Each value of this object MUST
   * be a valid JSON Schema.
   *
   * This keyword determines how child instances validate for objects, and does
   * not directly validate the immediate instance itself.
   *
   * Validation succeeds if, for each name that appears in both the instance and
   * as a name within this keyword's value, the child instance for that name
   * successfully validates against the corresponding schema.
   *
   * Omitting this keyword has the same behavior as an empty object.
   */
  properties?: {
    [key: string]: JSONSchema | boolean
  }
  /**
   * The value of "propertyNames" MUST be a valid JSON Schema.
   *
   * If the instance is an object, this keyword validates if every property name
   * in the instance validates against the provided schema. Note the property
   * name that the schema is testing will always be a string.
   *
   * Omitting this keyword has the same behavior as an empty schema.
   */
  propertyNames?: JSONSchema | boolean
  /**
   * The value of this keywords MUST be a boolean. When multiple occurrences of
   * this keyword are applicable to a single sub-instance, the resulting value
   * MUST be true if any occurrence specifies a true value, and MUST be false
   * otherwise.
   *
   * If "readOnly" has a value of boolean true, it indicates that the value of
   * the instance is managed exclusively by the owning authority, and attempts
   * by an application to modify the value of this property are expected to be
   * ignored or rejected by that owning authority.
   *
   * An instance document that is marked as "readOnly for the entire document
   * MAY be ignored if sent to the owning authority, or MAY result in an error,
   * at the authority's discretion.
   *
   * For example, "readOnly" would be used to mark a database-generated serial
   * number as read-only.
   *
   * This keywords can be used to assist in user interface instance generation.
   *
   * @default false
   */
  readOnly?: boolean
  /**
   * The value of this keyword MUST be an array. Elements of this array, if any,
   * MUST be strings, and MUST be unique.
   *
   * An object instance is valid against this keyword if every item in the array
   * is the name of a property in the instance.
   *
   * Omitting this keyword has the same behavior as an empty array.
   *
   * @default []
   */
  required?: string[]
  /**
   * This keyword's value MUST be a valid JSON Schema.
   *
   * When "if" is present, and the instance successfully validates against its
   * subschema, then validation succeeds against this keyword if the instance
   * also successfully validates against this keyword's subschema.
   *
   * This keyword has no effect when "if" is absent, or when the instance fails
   * to validate against its subschema. Implementations MUST NOT evaluate the
   * instance against this keyword, for either validation or annotation
   * collection purposes, in such cases.
   */
  then?: JSONSchema | boolean
  /**
   * Can be used to decorate a user interface with a short label about the data
   * produced.
   */
  title?: string
  /**
   * The value of this keyword MUST be either a string or an array. If it is an
   * array, elements of the array MUST be strings and MUST be unique.
   *
   * String values MUST be one of the six primitive types ("null", "boolean",
   * "object", "array", "number", or "string"), or "integer" which matches any
   * number with a zero fractional part.
   *
   * An instance validates if and only if the instance is in any of the sets
   * listed for this keyword.
   */
  type?:
    | JSONSchemaType
    | JSONSchemaTypeName
    | (JSONSchemaType | JSONSchemaTypeName)[]
  /**
   * The value of this keyword MUST be a boolean.
   *
   * If this keyword has boolean value false, the instance validates
   * successfully. If it has boolean value true, the instance validates
   * successfully if all of its elements are unique.
   *
   * Omitting this keyword has the same behavior as a value of false.
   *
   * @default false
   */
  uniqueItems?: boolean
  /**
   * The value of this keyword MUST be a boolean. When multiple occurrences of
   * this keyword is applicable to a single sub-instance, the resulting value
   * MUST be true if any occurrence specifies a true value, and MUST be false
   * otherwise.
   *
   * If "writeOnly" has a value of boolean true, it indicates that the value is
   * never present when the instance is retrieved from the owning authority. It
   * can be present when sent to the owning authority to update or create the
   * document (or the resource it represents), but it will not be included in
   * any updated or newly created version of the instance.
   *
   * An instance document that is marked as "writeOnly" for the entire document
   * MAY be returned as a blank document of some sort, or MAY produce an error
   * upon retrieval, or have the retrieval request ignored, at the authority's
   * discretion.
   *
   * For example, "writeOnly" would be used to mark a password input field.
   *
   * These keywords can be used to assist in user interface instance generation.
   * In particular, an application MAY choose to use a widget that hides input
   * values as they are typed for write-only fields.
   *
   * @default false
   */
  writeOnly?: boolean
}
/**
 * String formats.
 *
 * @public
 */
export declare enum JSONSchemaFormat {
  /**
   * A string instance is valid against this attribute if it is a valid
   * representation according to the "full-date" production in
   * [RFC 3339][RFC3339].
   *
   * [RFC3339]: http://json-schema.org/latest/json-schema-validation.html#RFC3339
   */
  Date = 'date',
  /**
   * A string instance is valid against this attribute if it is a valid
   * representation according to the "date-time" production in
   * [RFC 3339][RFC3339].
   *
   * [RFC3339]: http://json-schema.org/latest/json-schema-validation.html#RFC3339
   */
  DateTime = 'date-time',
  /**
   * A string instance is valid against these attributes if it is a valid
   * Internet email address as defined by [RFC 5322, section 3.4.1][RFC5322].
   *
   * [RFC5322]: http://json-schema.org/latest/json-schema-validation.html#RFC5322
   */
  Email = 'email',
  /**
   * As defined by [RFC 1034, section 3.1][RFC1034], including host names
   * produced using the Punycode algorithm specified in
   * [RFC 5891, section 4.4][RFC5891].
   *
   * [RFC1034]: http://json-schema.org/latest/json-schema-validation.html#RFC1034
   * [RFC5891]: http://json-schema.org/latest/json-schema-validation.html#RFC5891
   */
  Hostname = 'hostname',
  /**
   * A string instance is valid against these attributes if it is a valid
   * Internet email address as defined by [RFC 6531][RFC6531].
   *
   * [RFC6531]: http://json-schema.org/latest/json-schema-validation.html#RFC6531
   */
  IDNEmail = 'idn-email',
  /**
   * As defined by either [RFC 1034, section 3.1][RFC1034] as for hostname, or
   * an internationalized hostname as defined by
   * [RFC 5890, section 2.3.2.3][RFC5890].
   *
   * [RFC1034]: http://json-schema.org/latest/json-schema-validation.html#RFC1034
   * [RFC5890]: http://json-schema.org/latest/json-schema-validation.html#RFC5890
   */
  IDNHostname = 'idn-hostname',
  /**
   * An IPv4 address according to the "dotted-quad" ABNF syntax as defined in
   * [RFC 2673, section 3.2][RFC2673].
   *
   * [RFC2673]: http://json-schema.org/latest/json-schema-validation.html#RFC2673
   */
  IPv4 = 'ipv4',
  /**
   * An IPv6 address as defined in [RFC 4291, section 2.2][RFC4291].
   *
   * [RFC4291]: http://json-schema.org/latest/json-schema-validation.html#RFC4291
   */
  IPv6 = 'ipv6',
  /**
   * A string instance is valid against this attribute if it is a valid IRI,
   * according to [RFC3987][RFC3987].
   *
   * [RFC3987]: http://json-schema.org/latest/json-schema-validation.html#RFC3987
   */
  IRI = 'iri',
  /**
   * A string instance is valid against this attribute if it is a valid IRI
   * Reference (either an IRI or a relative-reference), according to
   * [RFC3987][RFC3987].
   *
   * [RFC3987]: http://json-schema.org/latest/json-schema-validation.html#RFC3987
   */
  IRIReference = 'iri-reference',
  /**
   * A string instance is valid against this attribute if it is a valid JSON
   * string representation of a JSON Pointer, according to
   * [RFC 6901, section 5][RFC6901].
   *
   * [RFC6901]: http://json-schema.org/latest/json-schema-validation.html#RFC6901
   */
  JSONPointer = 'json-pointer',
  /**
   * A string instance is valid against this attribute if it is a valid JSON
   * string representation of a JSON Pointer fragment, according to
   * [RFC 6901, section 5][RFC6901].
   *
   * [RFC6901]: http://json-schema.org/latest/json-schema-validation.html#RFC6901
   */
  JSONPointerURIFragment = 'json-pointer-uri-fragment',
  /**
   * This attribute applies to string instances.
   *
   * A regular expression, which SHOULD be valid according to the
   * [ECMA 262][ecma262] regular expression dialect.
   *
   * Implementations that validate formats MUST accept at least the subset of
   * [ECMA 262][ecma262] defined in the [Regular Expressions][regexInterop]
   * section of this specification, and SHOULD accept all valid
   * [ECMA 262][ecma262] expressions.
   *
   * [ecma262]: http://json-schema.org/latest/json-schema-validation.html#ecma262
   * [regexInterop]: http://json-schema.org/latest/json-schema-validation.html#regexInterop
   */
  RegEx = 'regex',
  /**
   * A string instance is valid against this attribute if it is a valid
   * [Relative JSON Pointer][relative-json-pointer].
   *
   * [relative-json-pointer]: http://json-schema.org/latest/json-schema-validation.html#relative-json-pointer
   */
  RelativeJSONPointer = 'relative-json-pointer',
  /**
   * A string instance is valid against this attribute if it is a valid
   * representation according to the "time" production in [RFC 3339][RFC3339].
   *
   * [RFC3339]: http://json-schema.org/latest/json-schema-validation.html#RFC3339
   */
  Time = 'time',
  /**
   * A string instance is valid against this attribute if it is a valid URI,
   * according to [RFC3986][RFC3986].
   *
   * [RFC3986]: http://json-schema.org/latest/json-schema-validation.html#RFC3986
   */
  URI = 'uri',
  /**
   * A string instance is valid against this attribute if it is a valid URI
   * Reference (either a URI or a relative-reference), according to
   * [RFC3986][RFC3986].
   *
   * [RFC3986]: http://json-schema.org/latest/json-schema-validation.html#RFC3986
   */
  URIReference = 'uri-reference',
  /**
   * A string instance is valid against this attribute if it is a valid URI
   * Template (of any level), according to [RFC6570][RFC6570].
   *
   * Note that URI Templates may be used for IRIs; there is no separate IRI
   * Template specification.
   *
   * [RFC6570]: http://json-schema.org/latest/json-schema-validation.html#RFC6570
   */
  URITemplate = 'uri-template',
  /**
   * UUID
   */
  UUID = 'uuid'
}
/**
 * JSON Schema type.
 *
 * @public
 */
export declare type JSONSchemaTypeName =
  | 'array'
  | 'boolean'
  | 'integer'
  | 'null'
  | 'number'
  | 'object'
  | 'string'
/**
 * JSON Schema type.
 *
 * @public
 */
export declare enum JSONSchemaType {
  /**
   * Array
   */
  Array = 'array',
  /**
   * Boolean
   */
  Boolean = 'boolean',
  /**
   * Integer
   */
  Integer = 'integer',
  /**
   * Null
   */
  Null = 'null',
  /**
   * Number
   */
  Number = 'number',
  /**
   * Object
   */
  Object = 'object',
  /**
   * String
   */
  String = 'string'
}
/**
 * Acceptable values for the "type" property.
 *
 * @public
 */
export declare type JSONSchemaTypeValue =
  | JSONSchemaTypeName
  | JSONSchemaType
  | (JSONSchemaType | JSONSchemaTypeName)[]
/**
 * Content encoding name.
 *
 * @public
 */
export declare type JSONSchemaContentEncodingName =
  | '7bit'
  | '8bit'
  | 'binary'
  | 'quoted-printable'
  | 'base64'
  | 'ietf-token'
  | 'x-token'
/**
 * Content encoding strategy.
 *
 * @public
 * {@link https://tools.ietf.org/html/rfc2045#section-6.1}
 * {@link https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705}
 */
export declare enum JSONSchemaContentEncoding {
  /**
   * Only US-ASCII characters, which use the lower 7 bits for each character.
   *
   * Each line must be less than 1,000 characters.
   */
  '7bit' = '7bit',
  /**
   * Allow extended ASCII characters which can use the 8th (highest) bit to
   * indicate special characters not available in 7bit.
   *
   * Each line must be less than 1,000 characters.
   */
  '8bit' = '8bit',
  /**
   * Same character set as 8bit, with no line length restriction.
   */
  Binary = 'binary',
  /**
   * Lines are limited to 76 characters, and line breaks are represented using
   * special characters that are escaped.
   */
  QuotedPrintable = 'quoted-printable',
  /**
   * Useful for data that is mostly non-text.
   */
  Base64 = 'base64',
  /**
   * An extension token defined by a standards-track RFC and registered with
   * IANA.
   */
  IETFToken = 'ietf-token',
  /**
   * The two characters "X-" or "x-" followed, with no intervening white space,
   * by any token.
   */
  XToken = 'x-token'
}
/**
 * An array containing all the possible keys of a draft-07 JSONSchema.
 *
 * @public
 */
export declare const JSONSchemaKeys: (keyof JSONSchema)[]
let JSONSchemaFormat;

(function (JSONSchemaFormat) {
  JSONSchemaFormat["Date"] = "date";
  JSONSchemaFormat["DateTime"] = "date-time";
  JSONSchemaFormat["Email"] = "email";
  JSONSchemaFormat["Hostname"] = "hostname";
  JSONSchemaFormat["IDNEmail"] = "idn-email";
  JSONSchemaFormat["IDNHostname"] = "idn-hostname";
  JSONSchemaFormat["IPv4"] = "ipv4";
  JSONSchemaFormat["IPv6"] = "ipv6";
  JSONSchemaFormat["IRI"] = "iri";
  JSONSchemaFormat["IRIReference"] = "iri-reference";
  JSONSchemaFormat["JSONPointer"] = "json-pointer";
  JSONSchemaFormat["JSONPointerURIFragment"] = "json-pointer-uri-fragment";
  JSONSchemaFormat["RegEx"] = "regex";
  JSONSchemaFormat["RelativeJSONPointer"] = "relative-json-pointer";
  JSONSchemaFormat["Time"] = "time";
  JSONSchemaFormat["URI"] = "uri";
  JSONSchemaFormat["URIReference"] = "uri-reference";
  JSONSchemaFormat["URITemplate"] = "uri-template";
  JSONSchemaFormat["UUID"] = "uuid";
})(JSONSchemaFormat || (JSONSchemaFormat = {}));

let JSONSchemaType;

(function (JSONSchemaType) {
  JSONSchemaType["Array"] = "array";
  JSONSchemaType["Boolean"] = "boolean";
  JSONSchemaType["Integer"] = "integer";
  JSONSchemaType["Null"] = "null";
  JSONSchemaType["Number"] = "number";
  JSONSchemaType["Object"] = "object";
  JSONSchemaType["String"] = "string";
})(JSONSchemaType || (JSONSchemaType = {}));

let JSONSchemaContentEncoding;

(function (JSONSchemaContentEncoding) {
  JSONSchemaContentEncoding["7bit"] = "7bit";
  JSONSchemaContentEncoding["8bit"] = "8bit";
  JSONSchemaContentEncoding["Binary"] = "binary";
  JSONSchemaContentEncoding["QuotedPrintable"] = "quoted-printable";
  JSONSchemaContentEncoding["Base64"] = "base64";
  JSONSchemaContentEncoding["IETFToken"] = "ietf-token";
  JSONSchemaContentEncoding["XToken"] = "x-token";
})(JSONSchemaContentEncoding || (JSONSchemaContentEncoding = {}));

const JSONSchemaKeys = ['$comment', '$id', '$ref', '$schema', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'contentEncoding', 'contentMediaType', 'default', 'definitions', 'dependencies', 'description', 'else', 'enum', 'examples', 'exclusiveMaximum', 'exclusiveMinimum', 'format', 'if', 'items', 'maximum', 'maxItems', 'maxLength', 'maxProperties', 'minimum', 'minItems', 'minLength', 'minProperties', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'propertyNames', 'readOnly', 'required', 'then', 'title', 'type', 'uniqueItems', 'writeOnly'];

export { JSONSchemaContentEncoding, JSONSchemaFormat, JSONSchemaKeys, JSONSchemaType };
//# sourceMappingURL=index.js.map
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["\"use strict\";\n\nexport let JSONSchemaFormat;\n\n(function (JSONSchemaFormat) {\n  JSONSchemaFormat[\"Date\"] = \"date\";\n  JSONSchemaFormat[\"DateTime\"] = \"date-time\";\n  JSONSchemaFormat[\"Email\"] = \"email\";\n  JSONSchemaFormat[\"Hostname\"] = \"hostname\";\n  JSONSchemaFormat[\"IDNEmail\"] = \"idn-email\";\n  JSONSchemaFormat[\"IDNHostname\"] = \"idn-hostname\";\n  JSONSchemaFormat[\"IPv4\"] = \"ipv4\";\n  JSONSchemaFormat[\"IPv6\"] = \"ipv6\";\n  JSONSchemaFormat[\"IRI\"] = \"iri\";\n  JSONSchemaFormat[\"IRIReference\"] = \"iri-reference\";\n  JSONSchemaFormat[\"JSONPointer\"] = \"json-pointer\";\n  JSONSchemaFormat[\"JSONPointerURIFragment\"] = \"json-pointer-uri-fragment\";\n  JSONSchemaFormat[\"RegEx\"] = \"regex\";\n  JSONSchemaFormat[\"RelativeJSONPointer\"] = \"relative-json-pointer\";\n  JSONSchemaFormat[\"Time\"] = \"time\";\n  JSONSchemaFormat[\"URI\"] = \"uri\";\n  JSONSchemaFormat[\"URIReference\"] = \"uri-reference\";\n  JSONSchemaFormat[\"URITemplate\"] = \"uri-template\";\n  JSONSchemaFormat[\"UUID\"] = \"uuid\";\n})(JSONSchemaFormat || (JSONSchemaFormat = {}));\n\nexport let JSONSchemaType;\n\n(function (JSONSchemaType) {\n  JSONSchemaType[\"Array\"] = \"array\";\n  JSONSchemaType[\"Boolean\"] = \"boolean\";\n  JSONSchemaType[\"Integer\"] = \"integer\";\n  JSONSchemaType[\"Null\"] = \"null\";\n  JSONSchemaType[\"Number\"] = \"number\";\n  JSONSchemaType[\"Object\"] = \"object\";\n  JSONSchemaType[\"String\"] = \"string\";\n})(JSONSchemaType || (JSONSchemaType = {}));\n\nexport let JSONSchemaContentEncoding;\n\n(function (JSONSchemaContentEncoding) {\n  JSONSchemaContentEncoding[\"7bit\"] = \"7bit\";\n  JSONSchemaContentEncoding[\"8bit\"] = \"8bit\";\n  JSONSchemaContentEncoding[\"Binary\"] = \"binary\";\n  JSONSchemaContentEncoding[\"QuotedPrintable\"] = \"quoted-printable\";\n  JSONSchemaContentEncoding[\"Base64\"] = \"base64\";\n  JSONSchemaContentEncoding[\"IETFToken\"] = \"ietf-token\";\n  JSONSchemaContentEncoding[\"XToken\"] = \"x-token\";\n})(JSONSchemaContentEncoding || (JSONSchemaContentEncoding = {}));\n\nexport const JSONSchemaKeys = ['$comment', '$id', '$ref', '$schema', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'contentEncoding', 'contentMediaType', 'default', 'definitions', 'dependencies', 'description', 'else', 'enum', 'examples', 'exclusiveMaximum', 'exclusiveMinimum', 'format', 'if', 'items', 'maximum', 'maxItems', 'maxLength', 'maxProperties', 'minimum', 'minItems', 'minLength', 'minProperties', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'propertyNames', 'readOnly', 'required', 'then', 'title', 'type', 'uniqueItems', 'writeOnly'];"],"names":[],"mappings":"AAEU,IAAC,gBAAgB,CAAC;;AAE5B,CAAC,UAAU,gBAAgB,EAAE;EAC3B,gBAAgB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;EAClC,gBAAgB,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;EAC3C,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;EACpC,gBAAgB,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;EAC1C,gBAAgB,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;EAC3C,gBAAgB,CAAC,aAAa,CAAC,GAAG,cAAc,CAAC;EACjD,gBAAgB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;EAClC,gBAAgB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;EAClC,gBAAgB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;EAChC,gBAAgB,CAAC,cAAc,CAAC,GAAG,eAAe,CAAC;EACnD,gBAAgB,CAAC,aAAa,CAAC,GAAG,cAAc,CAAC;EACjD,gBAAgB,CAAC,wBAAwB,CAAC,GAAG,2BAA2B,CAAC;EACzE,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;EACpC,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,uBAAuB,CAAC;EAClE,gBAAgB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;EAClC,gBAAgB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;EAChC,gBAAg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EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC;;;;"}BSD-2-Clause License

Copyright (c) 2018 IETF Trust, Austin Wright, Henry Andrews, Geraint Luff,
and Cloudflare, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

{
  "name": "json-schema-typed",
  "description": "JSONSchema TypeScript definitions.",
  "version": "7.0.3",
  "license": "BSD-2-Clause",
  "files": [
    "dist-*/",
    "bin/"
  ],
  "pika": true,
  "sideEffects": false,
  "keywords": [
    "jsonschema",
    "typescript"
  ],
  "homepage": "https://github.com/typeslick/json-schema-typed",
  "contributors": [
    {
      "name": "Austin Wright",
      "email": "aaa@bzfx.net"
    },
    {
      "name": "Henry Andrews",
      "email": "henry@cloudflare.com"
    },
    {
      "name": "Geraint Luff",
      "email": "luffgd@gmail.com"
    },
    {
      "name": "Jay Rylan",
      "email": "jay@jayrylan.com"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/typeslick/json-schema-typed.git"
  },
  "dependencies": {},
  "devDependencies": {
    "@babel/cli": "7.6.4",
    "@babel/core": "7.6.4",
    "@babel/runtime-corejs2": "7.6.3",
    "@loomble/cspell-dictionary": "1.0.0",
    "@microsoft/api-extractor": "7.3.4",
    "@pika/pack": "0.5.0",
    "@pika/plugin-build-node": "0.7.1",
    "@pika/plugin-build-types": "0.7.1",
    "@pika/plugin-build-web": "0.7.1",
    "@pika/plugin-standard-pkg": "0.7.1",
    "@types/babel__core": "7.1.3",
    "@types/jest": "24.0.20",
    "@types/jest-diff": "20.0.1",
    "@types/node": "12.11.7",
    "babel-core": "6.26.3",
    "babel-jest": "24.9.0",
    "babel-preset-slick": "7.0.4",
    "core-js": "3.3.4",
    "cspell": "4.0.31",
    "deep-sort-object": "1.0.2",
    "jest": "24.9.0",
    "jest-serializer-path": "0.1.15",
    "prettier": "1.18.2",
    "tsconfig-slick": "3.0.2",
    "tslint": "5.20.0",
    "tslint-slick": "5.0.0",
    "typedoc": "0.15.0",
    "typedoc-plugin-markdown": "2.2.11",
    "typescript": "3.6.4",
    "typescript-tslint-plugin": "0.5.4"
  },
  "esnext": "dist-src/index.js",
  "main": "dist-node/index.js",
  "module": "dist-web/index.js",
  "types": "dist-types/index.d.ts"
}
# json-schema-typed

JSON Schema draft-07 TypeScript definitions with complete inline documentation
for each property.

[![code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![npm](https://img.shields.io/npm/v/json-schema-typed.svg?style=flat-square)](https://npmjs.org/package/json-schema-typed)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
[![License](https://img.shields.io/badge/license-BSD--2--Clause-blue.svg?style=flat-square)](https://github.com/typeschema/json-schema-typed/blob/master/LICENSE)

## Install

```sh
npm install json-schema-typed # NPM
yarn add json-schema-typed # or Yarn
```

## Usage

TypeScript:

```typescript
import { JSONSchema } from 'json-schema-typed'

const schema: JSONSchema = {
  // ...
}
```

## API

Additional exports:

| Name                        | Type       | Purpose                                                    |
| --------------------------- | ---------- | ---------------------------------------------------------- |
| `JSONSchemaFormat`          | Enum       | JSON Schema string formats.                                |
| `JSONSchemaType`            | Enum       | Standard values for the "type" field.                      |
| `JSONSchemaContentEncoding` | Enum       | JSON Schema content encoding strategies.                   |
| `JSONSchemaKeys`            | `string[]` | All the standard property keys available in a JSON schema. |

## Versioning

```
+----- Major version is synchronized with the major version of JSON Schema.
| +--- Minor version has BREAKING CHANGE and/or new features.
| | +- Patch version.
| | |
x.x.x
```

---

## Sponsors

- [Loomble](https://loomble.com/)

## Maintainers

- [Jay Rylan](https://jayrylan.com/)

## License

[BSD-2-Clause](https://github.com/typeschema/json-schema-typed/blob/master/LICENSE)
'use strict';
const path = require('path');
const pathExists = require('path-exists');
const pLocate = require('p-locate');

module.exports = (iterable, options) => {
	options = Object.assign({
		cwd: process.cwd()
	}, options);

	return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options);
};

module.exports.sync = (iterable, options) => {
	options = Object.assign({
		cwd: process.cwd()
	}, options);

	for (const el of iterable) {
		if (pathExists.sync(path.resolve(options.cwd, el))) {
			return el;
		}
	}
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
const fs = require('fs');

module.exports = fp => new Promise(resolve => {
	fs.access(fp, err => {
		resolve(!err);
	});
});

module.exports.sync = fp => {
	try {
		fs.accessSync(fp);
		return true;
	} catch (err) {
		return false;
	}
};
The MIT License (MIT)

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
  "name": "path-exists",
  "version": "3.0.0",
  "description": "Check if a path exists",
  "license": "MIT",
  "repository": "sindresorhus/path-exists",
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "sindresorhus.com"
  },
  "engines": {
    "node": ">=4"
  },
  "scripts": {
    "test": "xo && ava"
  },
  "files": [
    "index.js"
  ],
  "keywords": [
    "path",
    "exists",
    "exist",
    "file",
    "filepath",
    "fs",
    "filesystem",
    "file-system",
    "access",
    "stat"
  ],
  "devDependencies": {
    "ava": "*",
    "xo": "*"
  },
  "xo": {
    "esnext": true
  }
}
# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists)

> Check if a path exists

Because [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), but there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.

Never use this before handling a file though:

> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.


## Install

```
$ npm install --save path-exists
```


## Usage

```js
// foo.js
const pathExists = require('path-exists');

pathExists('foo.js').then(exists => {
	console.log(exists);
	//=> true
});
```


## API

### pathExists(path)

Returns a promise for a boolean of whether the path exists.

### pathExists.sync(path)

Returns a boolean of whether the path exists.


## Related

- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
{
	"name": "locate-path",
	"version": "3.0.0",
	"description": "Get the first path that exists on disk of multiple paths",
	"license": "MIT",
	"repository": "sindresorhus/locate-path",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava"
	},
	"files": [
		"index.js"
	],
	"keywords": [
		"locate",
		"path",
		"paths",
		"file",
		"files",
		"exists",
		"find",
		"finder",
		"search",
		"searcher",
		"array",
		"iterable",
		"iterator"
	],
	"dependencies": {
		"p-locate": "^3.0.0",
		"path-exists": "^3.0.0"
	},
	"devDependencies": {
		"ava": "*",
		"xo": "*"
	}
}
# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)

> Get the first path that exists on disk of multiple paths


## Install

```
$ npm install locate-path
```


## Usage

Here we find the first file that exists on disk, in array order.

```js
const locatePath = require('locate-path');

const files = [
	'unicorn.png',
	'rainbow.png', // Only this one actually exists on disk
	'pony.png'
];

(async () => {
	console(await locatePath(files));
	//=> 'rainbow'
})();
```


## API

### locatePath(input, [options])

Returns a `Promise` for the first path that exists or `undefined` if none exists.

#### input

Type: `Iterable<string>`

Paths to check.

#### options

Type: `Object`

##### concurrency

Type: `number`<br>
Default: `Infinity`<br>
Minimum: `1`

Number of concurrently pending promises.

##### preserveOrder

Type: `boolean`<br>
Default: `true`

Preserve `input` order when searching.

Disable this to improve performance if you don't care about the order.

##### cwd

Type: `string`<br>
Default: `process.cwd()`

Current working directory.

### locatePath.sync(input, [options])

Returns the first path that exists or `undefined` if none exists.

#### input

Type: `Iterable<string>`

Paths to check.

#### options

Type: `Object`

##### cwd

Same as above.


## Related

- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
.DS_Store
_local
tstest.js
*-test.js
node_modules
language: node_js
node_js:
  - node  # latest stable
  - 6
script: 
  - npm test
// This is a benchmark suite which will run with nodejs.
// $ node --expose-gc benchmark.js
var assert = require('assert'),
    util = require('util'),
    LRUMap = require('./lru').LRUMap;

// Create a cache with N entries
var N = 10000;

// Run each measurement Iterations times
var Iterations = 1000;


var has_gc_access = typeof gc === 'function';
var gc_collect = has_gc_access ? gc : function(){};

Number.prototype.toHuman = function(divisor) {
  var N = Math.round(divisor ? this/divisor : this);
  var n = N.toString().split('.');
  n[0] = n[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
  return n.join('.');
}
Number.prototype.toSignedHuman = function(divisor) {
  var n = this.toHuman(divisor);
  if (this > -1) n = '+'+n;
  return n;
}

function measure(block) {
  gc_collect();
  var elapsed = 0, start, usec, n;
  var sm = process.memoryUsage();
  if (Iterations && Iterations > 0) {
    start = new Date();
    for (n = 0; n < Iterations; n++) {
      block();
    }
    usec = ((new Date() - start) / Iterations) * 1000;
  } else {
    start = new Date();
    block();
    usec = (new Date() - start) * 1000;
  }

  var msg = '\n----------\n  ' + block.toString().replace(/\n/g, "\n  ") + '\n';

  if (has_gc_access) {
    gc_collect();
    var em = process.memoryUsage();
    var mrssd = em.rss - sm.rss;
    var mhtotd = em.heapTotal - sm.heapTotal;
    var mhusedd = em.heapUsed - sm.heapUsed;
    msg += '   rss:        ' + mrssd.toSignedHuman(1024) + ' kB -- (' +
           sm.rss.toHuman(1024) + ' kB -> ' + em.rss.toHuman(1024) + ' kB)\n';
    if (typeof sm.vsize === 'number') {
      var mvsized = em.vsize - sm.vsize;
      msg +=
           '   vsize:      ' + mvsized.toSignedHuman(1024) + ' kB -- (' +
           sm.vsize.toHuman(1024) + ' kB -> ' + em.vsize.toHuman(1024) + ' kB)\n';
    }
    msg += '   heap total: ' + mhtotd.toSignedHuman(1024) + ' kB -- (' +
           sm.heapTotal.toHuman(1024) + ' kB -> ' + em.heapTotal.toHuman(1024) + ' kB)\n' +
           '   heap used:  ' + mhusedd.toSignedHuman(1024) + ' kB -- (' +
           sm.heapUsed.toHuman(1024) + ' kB -> ' + em.heapUsed.toHuman(1024) + ' kB)\n\n';
  }

  var call_avg = usec;
  msg += '  -- ' + (call_avg / 1000) + ' ms avg per iteration --\n';

  process.stdout.write(msg);
}

var c = new LRUMap(N);

console.log('N = ' + N + ', Iterations = ' + Iterations);

// We should probably spin up the system in some way, or repeat the benchmarks a
// few times, since initial heap resizing takes considerable time.

measure(function(){
  // 1. put
  //    Simply append a new entry.
  //    There will be no reordering since we simply append to the tail.
  for (var i=N; --i;)
    c.set('key'+i, i);
});

measure(function(){
  // 2. get recent -> old
  //    Get entries starting with newest, effectively reversing the list.
  //
  // a. For each get, a find is first executed implemented as a native object with
  //    keys mapping to entries, so this should be reasonably fast as most native
  //    objects are implemented as hash maps.
  //
  // b. For each get, the aquired item will be moved to tail which includes a
  //    maximum of 7 assignment operations (minimum 3).
  for (var i=1,L=N+1; i<L; ++i)
    c.get('key'+i, i);
});


measure(function(){
  // 3. get old -> recent
  //    Get entries starting with oldest, effectively reversing the list.
  //
  //  - Same conditions apply as for test 2.
  for (var i=1,L=N+1; i<L; ++i)
    c.get('key'+i);
});

measure(function(){
  // 4. get missing
  //    Get try to get entries not in the cache.
  //  - Same conditions apply as for test 2, section a.
  for (var i=1,L=N+1; i<L; ++i)
    c.get('xkey'+i);
});

measure(function(){
  // 5. put overflow
  //    Overflow the cache with N more items than it can hold.
  // a. The complexity of put in this case should be:
  //    ( <get whith enough space> + <shift> )
  for (var i=N; --i;)
    c.set('key2_'+i, i);
});


measure(function(){
  // 6. shift head -> tail
  //    Remove all entries going from head to tail
  for (var i=1,L=N+1; i<L; ++i)
    c.shift();
});

measure(function(){
  // 7. put 
  //    Simply put N new items into an empty cache with exactly N space.
  for (var i=N; --i;)
    c.set('key'+i, i);
});

// pre-build random key array
var shuffledKeys = Array.from(c.keys());
shuffledKeys.sort(function (){return Math.random()-0.5; });

measure(function(){
  // 8. delete random
  // a. Most operations (which are not entries at head or tail) will cause closes
  //    siblings to be relinked.
  for (var i=shuffledKeys.length, key; key = shuffledKeys[--i]; ) {
    c.delete('key'+i, i);
  }
});
> lru_map@0.3.0 benchmark /src/js-lru
> node --expose-gc benchmark.js

N = 10000, Iterations = 1000

----------
  function (){
    // 1. put
    //    Simply append a new entry.
    //    There will be no reordering since we simply append to the tail.
    for (var i=N; --i;)
      c.set('key'+i, i);
  }
   rss:        +9,380 kB -- (19,564 kB -> 28,944 kB)
   heap total: +6,144 kB -- (11,260 kB -> 17,404 kB)
   heap used:  +1,640 kB -- (3,819 kB -> 5,459 kB)

  -- 1.192 ms avg per iteration --

----------
  function (){
    // 2. get recent -> old
    //    Get entries starting with newest, effectively reversing the list.
    //
    // a. For each get, a find is first executed implemented as a native object with
    //    keys mapping to entries, so this should be reasonably fast as most native
    //    objects are implemented as hash maps.
    //
    // b. For each get, the aquired item will be moved to tail which includes a
    //    maximum of 7 assignment operations (minimum 3).
    for (var i=1,L=N+1; i<L; ++i)
      c.get('key'+i, i);
  }
   rss:        +340 kB -- (29,112 kB -> 29,452 kB)
   heap total: +0 kB -- (18,428 kB -> 18,428 kB)
   heap used:  -255 kB -- (5,479 kB -> 5,224 kB)

  -- 1.197 ms avg per iteration --

----------
  function (){
    // 3. get old -> recent
    //    Get entries starting with oldest, effectively reversing the list.
    //
    //  - Same conditions apply as for test 2.
    for (var i=1,L=N+1; i<L; ++i)
      c.get('key'+i);
  }
   rss:        -344 kB -- (29,476 kB -> 29,132 kB)
   heap total: +0 kB -- (18,428 kB -> 18,428 kB)
   heap used:  +3 kB -- (5,211 kB -> 5,215 kB)

  -- 1.161 ms avg per iteration --

----------
  function (){
    // 4. get missing
    //    Get try to get entries not in the cache.
    //  - Same conditions apply as for test 2, section a.
    for (var i=1,L=N+1; i<L; ++i)
      c.get('xkey'+i);
  }
   rss:        +0 kB -- (29,132 kB -> 29,132 kB)
   heap total: +0 kB -- (18,428 kB -> 18,428 kB)
   heap used:  +5 kB -- (5,210 kB -> 5,215 kB)

  -- 1.035 ms avg per iteration --

----------
  function (){
    // 5. put overflow
    //    Overflow the cache with N more items than it can hold.
    // a. The complexity of put in this case should be:
    //    ( <get whith enough space> + <shift> )
    for (var i=N; --i;)
      c.set('key2_'+i, i);
  }
   rss:        +2,036 kB -- (29,132 kB -> 31,168 kB)
   heap total: +916 kB -- (18,428 kB -> 19,344 kB)
   heap used:  +542 kB -- (5,211 kB -> 5,752 kB)

  -- 1.185 ms avg per iteration --

----------
  function (){
    // 6. shift head -> tail
    //    Remove all entries going from head to tail
    for (var i=1,L=N+1; i<L; ++i)
      c.shift();
  }
   rss:        -1,528 kB -- (31,288 kB -> 29,760 kB)
   heap total: +108 kB -- (18,320 kB -> 18,428 kB)
   heap used:  -1,819 kB -- (5,748 kB -> 3,929 kB)

  -- 0.023 ms avg per iteration --

----------
  function (){
    // 7. put 
    //    Simply put N new items into an empty cache with exactly N space.
    for (var i=N; --i;)
      c.set('key'+i, i);
  }
   rss:        +8,064 kB -- (29,876 kB -> 37,940 kB)
   heap total: +8,192 kB -- (17,404 kB -> 25,596 kB)
   heap used:  +1,327 kB -- (3,904 kB -> 5,232 kB)

  -- 1.264 ms avg per iteration --

----------
  function (){
    // 8. delete random
    // a. Most operations (which are not entries at head or tail) will cause closes
    //    siblings to be relinked.
    for (var i=shuffledKeys.length, key; key = shuffledKeys[--i]; ) {
      c.delete('key'+i, i);
    }
  }
   rss:        +132 kB -- (38,088 kB -> 38,220 kB)
   heap total: +0 kB -- (25,596 kB -> 25,596 kB)
   heap used:  +410 kB -- (5,380 kB -> 5,789 kB)

  -- 1.914 ms avg per iteration --
<!DOCTYPE HTML>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lru</title>
    <style type="text/css">

body {
  font-family:
    -apple-system,BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  letter-spacing:0;
  font-weight:400;
  font-style:normal;
  text-rendering:optimizeLegibility;
  -moz-font-feature-settings:"liga" on;
  background: white;
  color:rgba(0,0,0,.8);
  font-size:13px;
  line-height:1.4;
  margin:2em;
}

a { text-decoration:inherit; color: inherit; }
a:hover { color:#30C2FF; }
b { font-weight: 500; }

ul { list-style:none; }
li { line-height:1.4; }

h2 { font-size: 16px; font-weight:600; }

.log {
  background: rgba(0,0,0,0.05);
  white-space: pre-line;
  display: inline-block;
}

#out {
}

    </style>
    <!-- <script src="https://unpkg.com/amdld/amdld.min.js"></script> -->
    <script src="lru.js"></script>
  </head>
  <body>

    <h2>Expected results:</h2>
    <div class="log">adam:29 &lt; john:26 &lt; angela:24
adam:29 &lt; angela:24 &lt; john:26
angela:24 &lt; john:26 &lt; zorro:141
</div>

    <h2>Actual results:</h2>
    <div class="log" id="out"></div>

    <script>
const out = document.querySelector('#out')
function log(s) { out.innerText += s + '\n' }

let c = new LRUMap(3)
c.set('adam',   29)
c.set('john',   26)
c.set('angela', 24)
log(c.toString())        // -> "adam:29 < john:26 < angela:24"
c.get('john')       // -> 26

// Now 'john' is the most recently used entry, since we just requested it
log(c.toString())        // -> "adam:29 < angela:24 < john:26"
c.set('zorro', 141) // -> {key:adam, value:29}

// Because we only have room for 3 entries, adding 'zorro' caused 'adam'
// to be removed in order to make room for the new entry
log(c.toString())        // -> "angela:24 < john:26 < zorro:141"


// With AMDLD:
// define(['lru'], function(lru) {
//   let c = new lru.LRUMap(3)
//   // ...
// })

    </script>
  </body>
</html>
// An entry holds the key and value, and pointers to any older and newer entries.
interface Entry<K,V> {
  key   :K;
  value :V;
}

export class LRUMap<K,V> {
  // Construct a new cache object which will hold up to limit entries.
  // When the size == limit, a `put` operation will evict the oldest entry.
  //
  // If `entries` is provided, all entries are added to the new map.
  // `entries` should be an Array or other iterable object whose elements are
  // key-value pairs (2-element Arrays). Each key-value pair is added to the new Map.
  // null is treated as undefined.
  constructor(limit :number, entries? :Iterable<[K,V]>);

  // Convenience constructor equivalent to `new LRUMap(count(entries), entries)`
  constructor(entries :Iterable<[K,V]>);

  // Current number of items
  size :number;

  // Maximum number of items this map can hold
  limit :number;

  // Least recently-used entry. Invalidated when map is modified.
  oldest :Entry<K,V>;

  // Most recently-used entry. Invalidated when map is modified.
  newest :Entry<K,V>;

  // Replace all values in this map with key-value pairs (2-element Arrays) from
  // provided iterable.
  assign(entries :Iterable<[K,V]>) : void;

  // Put <value> into the cache associated with <key>. Replaces any existing entry
  // with the same key. Returns `this`.
  set(key :K, value :V) : LRUMap<K,V>;

  // Purge the least recently used (oldest) entry from the cache.
  // Returns the removed entry or undefined if the cache was empty.
  shift() : [K,V] | undefined;

  // Get and register recent use of <key>.
  // Returns the value associated with <key> or undefined if not in cache.
  get(key :K) : V | undefined;

  // Check if there's a value for key in the cache without registering recent use.
  has(key :K) : boolean;

  // Access value for <key> without registering recent use. Useful if you do not
  // want to chage the state of the map, but only "peek" at it.
  // Returns the value associated with <key> if found, or undefined if not found.
  find(key :K) : V | undefined;

  // Remove entry <key> from cache and return its value.
  // Returns the removed value, or undefined if not found.
  delete(key :K) : V | undefined;

  // Removes all entries
  clear() : void;

  // Returns an iterator over all keys, starting with the oldest.
  keys() : Iterator<K>;

  // Returns an iterator over all values, starting with the oldest.
  values() : Iterator<V>;

  // Returns an iterator over all entries, starting with the oldest.
  entries() : Iterator<[K,V]>;

  // Returns an iterator over all entries, starting with the oldest.
  [Symbol.iterator]() : Iterator<[K,V]>;

  // Call `fun` for each entry, starting with the oldest entry.
  forEach(fun :(value :V, key :K, m :LRUMap<K,V>)=>void, thisArg? :any) : void;

  // Returns an object suitable for JSON encoding
  toJSON() : Array<{key :K, value :V}>;

  // Returns a human-readable text representation
  toString() : string;
}
/**
 * A doubly linked list-based Least Recently Used (LRU) cache. Will keep most
 * recently used items while discarding least recently used items when its limit
 * is reached.
 *
 * Licensed under MIT. Copyright (c) 2010 Rasmus Andersson <http://hunch.se/>
 * See README.md for details.
 *
 * Illustration of the design:
 *
 *       entry             entry             entry             entry
 *       ______            ______            ______            ______
 *      | head |.newer => |      |.newer => |      |.newer => | tail |
 *      |  A   |          |  B   |          |  C   |          |  D   |
 *      |______| <= older.|______| <= older.|______| <= older.|______|
 *
 *  removed  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  added
 */
(function(g,f){
  const e = typeof exports == 'object' ? exports : typeof g == 'object' ? g : {};
  f(e);
  if (typeof define == 'function' && define.amd) { define('lru', e); }
})(this, function(exports) {

const NEWER = Symbol('newer');
const OLDER = Symbol('older');

function LRUMap(limit, entries) {
  if (typeof limit !== 'number') {
    // called as (entries)
    entries = limit;
    limit = 0;
  }

  this.size = 0;
  this.limit = limit;
  this.oldest = this.newest = undefined;
  this._keymap = new Map();

  if (entries) {
    this.assign(entries);
    if (limit < 1) {
      this.limit = this.size;
    }
  }
}

exports.LRUMap = LRUMap;

function Entry(key, value) {
  this.key = key;
  this.value = value;
  this[NEWER] = undefined;
  this[OLDER] = undefined;
}


LRUMap.prototype._markEntryAsUsed = function(entry) {
  if (entry === this.newest) {
    // Already the most recenlty used entry, so no need to update the list
    return;
  }
  // HEAD--------------TAIL
  //   <.older   .newer>
  //  <--- add direction --
  //   A  B  C  <D>  E
  if (entry[NEWER]) {
    if (entry === this.oldest) {
      this.oldest = entry[NEWER];
    }
    entry[NEWER][OLDER] = entry[OLDER]; // C <-- E.
  }
  if (entry[OLDER]) {
    entry[OLDER][NEWER] = entry[NEWER]; // C. --> E
  }
  entry[NEWER] = undefined; // D --x
  entry[OLDER] = this.newest; // D. --> E
  if (this.newest) {
    this.newest[NEWER] = entry; // E. <-- D
  }
  this.newest = entry;
};

LRUMap.prototype.assign = function(entries) {
  let entry, limit = this.limit || Number.MAX_VALUE;
  this._keymap.clear();
  let it = entries[Symbol.iterator]();
  for (let itv = it.next(); !itv.done; itv = it.next()) {
    let e = new Entry(itv.value[0], itv.value[1]);
    this._keymap.set(e.key, e);
    if (!entry) {
      this.oldest = e;
    } else {
      entry[NEWER] = e;
      e[OLDER] = entry;
    }
    entry = e;
    if (limit-- == 0) {
      throw new Error('overflow');
    }
  }
  this.newest = entry;
  this.size = this._keymap.size;
};

LRUMap.prototype.get = function(key) {
  // First, find our cache entry
  var entry = this._keymap.get(key);
  if (!entry) return; // Not cached. Sorry.
  // As <key> was found in the cache, register it as being requested recently
  this._markEntryAsUsed(entry);
  return entry.value;
};

LRUMap.prototype.set = function(key, value) {
  var entry = this._keymap.get(key);

  if (entry) {
    // update existing
    entry.value = value;
    this._markEntryAsUsed(entry);
    return this;
  }

  // new entry
  this._keymap.set(key, (entry = new Entry(key, value)));

  if (this.newest) {
    // link previous tail to the new tail (entry)
    this.newest[NEWER] = entry;
    entry[OLDER] = this.newest;
  } else {
    // we're first in -- yay
    this.oldest = entry;
  }

  // add new entry to the end of the linked list -- it's now the freshest entry.
  this.newest = entry;
  ++this.size;
  if (this.size > this.limit) {
    // we hit the limit -- remove the head
    this.shift();
  }

  return this;
};

LRUMap.prototype.shift = function() {
  // todo: handle special case when limit == 1
  var entry = this.oldest;
  if (entry) {
    if (this.oldest[NEWER]) {
      // advance the list
      this.oldest = this.oldest[NEWER];
      this.oldest[OLDER] = undefined;
    } else {
      // the cache is exhausted
      this.oldest = undefined;
      this.newest = undefined;
    }
    // Remove last strong reference to <entry> and remove links from the purged
    // entry being returned:
    entry[NEWER] = entry[OLDER] = undefined;
    this._keymap.delete(entry.key);
    --this.size;
    return [entry.key, entry.value];
  }
};

// ----------------------------------------------------------------------------
// Following code is optional and can be removed without breaking the core
// functionality.

LRUMap.prototype.find = function(key) {
  let e = this._keymap.get(key);
  return e ? e.value : undefined;
};

LRUMap.prototype.has = function(key) {
  return this._keymap.has(key);
};

LRUMap.prototype['delete'] = function(key) {
  var entry = this._keymap.get(key);
  if (!entry) return;
  this._keymap.delete(entry.key);
  if (entry[NEWER] && entry[OLDER]) {
    // relink the older entry with the newer entry
    entry[OLDER][NEWER] = entry[NEWER];
    entry[NEWER][OLDER] = entry[OLDER];
  } else if (entry[NEWER]) {
    // remove the link to us
    entry[NEWER][OLDER] = undefined;
    // link the newer entry to head
    this.oldest = entry[NEWER];
  } else if (entry[OLDER]) {
    // remove the link to us
    entry[OLDER][NEWER] = undefined;
    // link the newer entry to head
    this.newest = entry[OLDER];
  } else {// if(entry[OLDER] === undefined && entry.newer === undefined) {
    this.oldest = this.newest = undefined;
  }

  this.size--;
  return entry.value;
};

LRUMap.prototype.clear = function() {
  // Not clearing links should be safe, as we don't expose live links to user
  this.oldest = this.newest = undefined;
  this.size = 0;
  this._keymap.clear();
};


function EntryIterator(oldestEntry) { this.entry = oldestEntry; }
EntryIterator.prototype[Symbol.iterator] = function() { return this; }
EntryIterator.prototype.next = function() {
  let ent = this.entry;
  if (ent) {
    this.entry = ent[NEWER];
    return { done: false, value: [ent.key, ent.value] };
  } else {
    return { done: true, value: undefined };
  }
};


function KeyIterator(oldestEntry) { this.entry = oldestEntry; }
KeyIterator.prototype[Symbol.iterator] = function() { return this; }
KeyIterator.prototype.next = function() {
  let ent = this.entry;
  if (ent) {
    this.entry = ent[NEWER];
    return { done: false, value: ent.key };
  } else {
    return { done: true, value: undefined };
  }
};

function ValueIterator(oldestEntry) { this.entry = oldestEntry; }
ValueIterator.prototype[Symbol.iterator] = function() { return this; }
ValueIterator.prototype.next = function() {
  let ent = this.entry;
  if (ent) {
    this.entry = ent[NEWER];
    return { done: false, value: ent.value };
  } else {
    return { done: true, value: undefined };
  }
};


LRUMap.prototype.keys = function() {
  return new KeyIterator(this.oldest);
};

LRUMap.prototype.values = function() {
  return new ValueIterator(this.oldest);
};

LRUMap.prototype.entries = function() {
  return this;
};

LRUMap.prototype[Symbol.iterator] = function() {
  return new EntryIterator(this.oldest);
};

LRUMap.prototype.forEach = function(fun, thisObj) {
  if (typeof thisObj !== 'object') {
    thisObj = this;
  }
  let entry = this.oldest;
  while (entry) {
    fun.call(thisObj, entry.value, entry.key, this);
    entry = entry[NEWER];
  }
};

/** Returns a JSON (array) representation */
LRUMap.prototype.toJSON = function() {
  var s = new Array(this.size), i = 0, entry = this.oldest;
  while (entry) {
    s[i++] = { key: entry.key, value: entry.value };
    entry = entry[NEWER];
  }
  return s;
};

/** Returns a String representation */
LRUMap.prototype.toString = function() {
  var s = '', entry = this.oldest;
  while (entry) {
    s += String(entry.key)+':'+entry.value;
    entry = entry[NEWER];
    if (entry) {
      s += ' < ';
    }
  }
  return s;
};

});
{
  "name": "lru_map",
  "version": "0.3.3",
  "description": "Finite key-value map using the Least Recently Used (LRU) algorithm where the most recently used objects are keept in the map while less recently used items are evicted to make room for new ones.",
  "main": "lru.js",
  "typings": "lru.d.ts",
  "scripts": {
    "test": "node test.js && echo 'Verifying TypeScript definition...' && tsc --noEmit",
    "prepublish": "npm test",
    "benchmark": "node --expose-gc benchmark.js"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/rsms/js-lru.git"
  },
  "keywords": [
    "cache",
    "lru",
    "buffer",
    "map"
  ],
  "author": "Rasmus Andersson <me@rsms.me>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/rsms/js-lru/issues"
  },
  "homepage": "https://github.com/rsms/js-lru#readme",
  "devDependencies": {
    "typescript": "^2.0.10"
  }
}
# Least Recently Used (LRU) cache algorithm

A finite key-value map using the [Least Recently Used (LRU)](http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used) algorithm, where the most recently-used items are "kept alive" while older, less-recently used items are evicted to make room for newer items.

Useful when you want to limit use of memory to only hold commonly-used things.

[![Build status](https://travis-ci.org/rsms/js-lru.svg?branch=master)](https://travis-ci.org/rsms/js-lru)

## Terminology & design

- Based on a doubly-linked list for low complexity random shuffling of entries.

- The cache object iself has a "head" (least recently used entry) and a
  "tail" (most recently used entry).

- The "oldest" and "newest" are list entries -- an entry might have a "newer" and
  an "older" entry (doubly-linked, "older" being close to "head" and "newer"
  being closer to "tail").

- Key lookup is done through a key-entry mapping native object, which on most 
  platforms mean `O(1)` complexity. This comes at a very low memory cost  (for 
  storing two extra pointers for each entry).

Fancy ASCII art illustration of the general design:

```txt
           entry             entry             entry             entry        
           ______            ______            ______            ______       
          | head |.newer => |      |.newer => |      |.newer => | tail |      
.oldest = |  A   |          |  B   |          |  C   |          |  D   | = .newest
          |______| <= older.|______| <= older.|______| <= older.|______|      
                                                                             
       removed  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  <--  added
```

## Example

```js
let c = new LRUMap(3)
c.set('adam',   29)
c.set('john',   26)
c.set('angela', 24)
c.toString()        // -> "adam:29 < john:26 < angela:24"
c.get('john')       // -> 26

// Now 'john' is the most recently used entry, since we just requested it
c.toString()        // -> "adam:29 < angela:24 < john:26"
c.set('zorro', 141) // -> {key:adam, value:29}

// Because we only have room for 3 entries, adding 'zorro' caused 'adam'
// to be removed in order to make room for the new entry
c.toString()        // -> "angela:24 < john:26 < zorro:141"
```

# Usage

**Recommended:** Copy the code in lru.js or copy the lru.js and lru.d.ts files into your source directory. For minimal functionality, you only need the lines up until the comment that says "Following code is optional".

**Using NPM:** [`yarn add lru_map`](https://www.npmjs.com/package/lru_map) (note that because NPM is one large flat namespace, you need to import the module as "lru_map" rather than simply "lru".)

**Using AMD:** An [AMD](https://github.com/amdjs/amdjs-api/blob/master/AMD.md#amd) module loader like [`amdld`](https://github.com/rsms/js-amdld) can be used to load this module as well. There should be nothing to configure.

**Testing**:

- Run tests with `npm test`
- Run benchmarks with `npm run benchmark`

**ES compatibility:** This implementation is compatible with modern JavaScript environments and depend on the following features not found in ES5:

- `const` and `let` keywords
- `Symbol` including `Symbol.iterator`
- `Map`

> Note: If you need ES5 compatibility e.g. to use with older browsers, [please use version 2](https://github.com/rsms/js-lru/tree/v2) which has a slightly less feature-full API but is well-tested and about as fast as this implementation.

**Using with TypeScript**

This module comes with complete typing coverage for use with TypeScript. If you copied the code or files rather than using a module loader, make sure to include `lru.d.ts` into the same location where you put `lru.js`.

```ts
import {LRUMap} from './lru'
// import {LRUMap} from 'lru'     // when using via AMD
// import {LRUMap} from 'lru_map' // when using from NPM
console.log('LRUMap:', LRUMap)
```

# API

The API imitates that of [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), which means that in most cases you can use `LRUMap` as a drop-in replacement for `Map`.

```ts
export class LRUMap<K,V> {
  // Construct a new cache object which will hold up to limit entries.
  // When the size == limit, a `put` operation will evict the oldest entry.
  //
  // If `entries` is provided, all entries are added to the new map.
  // `entries` should be an Array or other iterable object whose elements are
  // key-value pairs (2-element Arrays). Each key-value pair is added to the new Map.
  // null is treated as undefined.
  constructor(limit :number, entries? :Iterable<[K,V]>);

  // Convenience constructor equivalent to `new LRUMap(count(entries), entries)`
  constructor(entries :Iterable<[K,V]>);

  // Current number of items
  size :number;

  // Maximum number of items this map can hold
  limit :number;

  // Least recently-used entry. Invalidated when map is modified.
  oldest :Entry<K,V>;

  // Most recently-used entry. Invalidated when map is modified.
  newest :Entry<K,V>;

  // Replace all values in this map with key-value pairs (2-element Arrays) from
  // provided iterable.
  assign(entries :Iterable<[K,V]>) : void;

  // Put <value> into the cache associated with <key>. Replaces any existing entry
  // with the same key. Returns `this`.
  set(key :K, value :V) : LRUMap<K,V>;

  // Purge the least recently used (oldest) entry from the cache.
  // Returns the removed entry or undefined if the cache was empty.
  shift() : [K,V] | undefined;

  // Get and register recent use of <key>.
  // Returns the value associated with <key> or undefined if not in cache.
  get(key :K) : V | undefined;

  // Check if there's a value for key in the cache without registering recent use.
  has(key :K) : boolean;

  // Access value for <key> without registering recent use. Useful if you do not
  // want to chage the state of the map, but only "peek" at it.
  // Returns the value associated with <key> if found, or undefined if not found.
  find(key :K) : V | undefined;

  // Remove entry <key> from cache and return its value.
  // Returns the removed value, or undefined if not found.
  delete(key :K) : V | undefined;

  // Removes all entries
  clear() : void;

  // Returns an iterator over all keys, starting with the oldest.
  keys() : Iterator<K>;

  // Returns an iterator over all values, starting with the oldest.
  values() : Iterator<V>;

  // Returns an iterator over all entries, starting with the oldest.
  entries() : Iterator<[K,V]>;

  // Returns an iterator over all entries, starting with the oldest.
  [Symbol.iterator]() : Iterator<[K,V]>;

  // Call `fun` for each entry, starting with the oldest entry.
  forEach(fun :(value :V, key :K, m :LRUMap<K,V>)=>void, thisArg? :any) : void;

  // Returns an object suitable for JSON encoding
  toJSON() : Array<{key :K, value :V}>;

  // Returns a human-readable text representation
  toString() : string;
}

// An entry holds the key and value, and pointers to any older and newer entries.
// Entries might hold references to adjacent entries in the internal linked-list.
// Therefore you should never store or modify Entry objects. Instead, reference the
// key and value of an entry when needed.
interface Entry<K,V> {
  key   :K;
  value :V;
}
```

If you need to perform any form of finalization of items as they are evicted from the cache, wrapping the `shift` method is a good way to do it:

```js
let c = new LRUMap(123);
c.shift = function() {
  let entry = LRUMap.prototype.shift.call(this);
  doSomethingWith(entry);
  return entry;
}
```

The internals calls `shift` as entries need to be evicted, so this method is guaranteed to be called for any item that's removed from the cache. The returned entry must not include any strong references to other entries. See note in the documentation of `LRUMap.prototype.set()`.


# MIT license

Copyright (c) 2010-2016 Rasmus Andersson <https://rsms.me/>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
// Test which will run in nodejs
// $ node test.js
// (Might work with other CommonJS-compatible environments)
const assert = require('assert');
const LRUMap = require('./lru').LRUMap;
const asserteq = assert.equal;
const tests = {

['set and get']() {
  let c = new LRUMap(4);
  asserteq(c.size, 0);
  asserteq(c.limit, 4);
  asserteq(c.oldest, undefined);
  asserteq(c.newest, undefined);

  c.set('adam',   29)
   .set('john',   26)
   .set('angela', 24)
   .set('bob',    48);
  asserteq(c.toString(), 'adam:29 < john:26 < angela:24 < bob:48');
  asserteq(c.size, 4);

  asserteq(c.get('adam'), 29);
  asserteq(c.get('john'), 26);
  asserteq(c.get('angela'), 24);
  asserteq(c.get('bob'), 48);
  asserteq(c.toString(), 'adam:29 < john:26 < angela:24 < bob:48');

  asserteq(c.get('angela'), 24);
  asserteq(c.toString(), 'adam:29 < john:26 < bob:48 < angela:24');

  c.set('ygwie', 81);
  asserteq(c.toString(), 'john:26 < bob:48 < angela:24 < ygwie:81');
  asserteq(c.size, 4);
  asserteq(c.get('adam'), undefined);

  c.set('john', 11);
  asserteq(c.toString(), 'bob:48 < angela:24 < ygwie:81 < john:11');
  asserteq(c.get('john'), 11);

  let expectedKeys = ['bob', 'angela', 'ygwie', 'john'];
  c.forEach(function(v, k) {
    //sys.sets(k+': '+v);
    asserteq(k, expectedKeys.shift());
  })

  // removing one item decrements size by one
  let currentSize = c.size;
  assert(c.delete('john') !== undefined);
  asserteq(currentSize - 1, c.size);
},

['construct with iterator']() {
  let verifyEntries = function(c) {
    asserteq(c.size, 4);
    asserteq(c.limit, 4);
    asserteq(c.oldest.key, 'adam');
    asserteq(c.newest.key, 'bob');
    asserteq(c.get('adam'), 29);
    asserteq(c.get('john'), 26);
    asserteq(c.get('angela'), 24);
    asserteq(c.get('bob'), 48);
  };

  // with explicit limit
  verifyEntries(new LRUMap(4, [
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]));

  // with inferred limit
  verifyEntries(new LRUMap([
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]));
},

assign() {
  let c = new LRUMap([
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);

  let newEntries = [
    ['mimi',    1],
    ['patrick', 2],
    ['jane',    3],
    ['fred',    4],
  ];
  c.assign(newEntries);
  asserteq(c.size, 4);
  asserteq(c.limit, 4);
  asserteq(c.oldest.key, newEntries[0][0]);
  asserteq(c.newest.key, newEntries[newEntries.length-1][0]);
  let i = 0;
  c.forEach(function(v, k) {
    asserteq(k, newEntries[i][0]);
    asserteq(v, newEntries[i][1]);
    i++;
  });

  // assigning too many items should throw an exception
  assert.throws(() => {
    c.assign([
      ['adam',   29],
      ['john',   26],
      ['angela', 24],
      ['bob',    48],
      ['ken',    30],
    ]);
  }, /overflow/);

  // assigning less than limit should not affect limit but adjust size
  c.assign([
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
  ]);
  asserteq(c.size, 3);
  asserteq(c.limit, 4);
},

delete() {
  let c = new LRUMap([
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);
  c.delete('adam');
  asserteq(c.size, 3);
  c.delete('angela');
  asserteq(c.size, 2);
  c.delete('bob');
  asserteq(c.size, 1);
  c.delete('john');
  asserteq(c.size, 0);
  asserteq(c.oldest, undefined);
  asserteq(c.newest, undefined);
},

clear() {
  let c = new LRUMap(4);
  c.set('adam', 29);
  c.set('john', 26);
  asserteq(c.size, 2);
  c.clear();
  asserteq(c.size, 0);
  asserteq(c.oldest, undefined);
  asserteq(c.newest, undefined);
},

shift() {
  let c2 = new LRUMap(4);
  asserteq(c2.size, 0);
  c2.set('a', 1)
  c2.set('b', 2)
  c2.set('c', 3)
  asserteq(c2.size, 3);

  let e = c2.shift();
  asserteq(e[0], 'a');
  asserteq(e[1], 1);
  
  e = c2.shift();
  asserteq(e[0], 'b');
  asserteq(e[1], 2);
  
  e = c2.shift();
  asserteq(e[0], 'c');
  asserteq(e[1], 3);

  // c2 should be empty
  c2.forEach(function () { assert(false); });
  asserteq(c2.size, 0);
},

set() {
  // Note: v0.1 allows putting same key multiple times. v0.2 does not.
  c = new LRUMap(4);
  c.set('a', 1);
  c.set('a', 2);
  c.set('a', 3);
  c.set('a', 4);
  asserteq(c.size, 1);
  asserteq(c.newest, c.oldest);
  assert.deepEqual(c.newest, {key:'a', value:4 });

  c.set('a', 5);
  asserteq(c.size, 1);
  asserteq(c.newest, c.oldest);
  assert.deepEqual(c.newest, {key:'a', value:5 });

  c.set('b', 6);
  asserteq(c.size, 2);
  assert(c.newest !== c.oldest);

  assert.deepEqual(c.newest, { key:'b', value:6 });
  assert.deepEqual(c.oldest, { key:'a', value:5 });

  c.shift();
  asserteq(c.size, 1);
  c.shift();
  asserteq(c.size, 0);
  c.forEach(function(){ assert(false) });
},


['entry iterator']() {
  let c = new LRUMap(4, [
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);

  let verifyEntries = function(iterable) {
    asserteq(typeof iterable[Symbol.iterator], 'function');
    let it = iterable[Symbol.iterator]();
    assert.deepEqual(it.next().value, ['adam',   29]);
    assert.deepEqual(it.next().value, ['john',   26]);
    assert.deepEqual(it.next().value, ['angela', 24]);
    assert.deepEqual(it.next().value, ['bob',    48]);
    assert(it.next().done);
  };

  verifyEntries(c);
  verifyEntries(c.entries());
},


['key iterator']() {
  let c = new LRUMap(4, [
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);
  let kit = c.keys();
  asserteq(kit.next().value, 'adam');
  asserteq(kit.next().value, 'john');
  asserteq(kit.next().value, 'angela');
  asserteq(kit.next().value, 'bob');
  assert(kit.next().done);
},


['value iterator']() {
  let c = new LRUMap(4, [
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);
  let kit = c.values();
  asserteq(kit.next().value, 29);
  asserteq(kit.next().value, 26);
  asserteq(kit.next().value, 24);
  asserteq(kit.next().value, 48);
  assert(kit.next().done);
},


toJSON() {
  let c = new LRUMap(4, [
    ['adam',   29],
    ['john',   26],
    ['angela', 24],
    ['bob',    48],
  ]);
  let json = c.toJSON();
  assert(json.length == 4);
  assert.deepEqual(json, [
    {key:'adam', value:29},
    {key:'john', value:26},
    {key:'angela', value:24},
    {key:'bob', value:48},
  ]);
},


}; // tests


function fmttime(t) {
  return (Math.round((t)*10)/10)+'ms';
}

function die(err) {
  console.error('\n' + (err.stack || err));
  process.exit(1);
}

function runNextTest(tests, testNames, allDoneCallback) {
  let testName = testNames[0];
  if (!testName) {
    return allDoneCallback();
  }
  process.stdout.write(testName+' ... ');
  let t1 = Date.now();
  let next = function() {
    t1 = Date.now() - t1;
    if (t1 > 10) {
      process.stdout.write('ok ('+fmttime(t1)+')\n');
    } else {
      process.stdout.write('ok\n');
    }
    runNextTest(tests, testNames.slice(1), allDoneCallback);
  };
  try {
    let p = tests[testName]();
    if (p && p instanceof Promise) {
      p.then(next).catch(die);
    } else {
      next();
    }
  } catch (err) {
    die(err);
  }
}

let t = Date.now();
runNextTest(tests, Object.keys(tests), function() {
  t = Date.now() - t;
  let timestr = '';
  if (t > 10) {
    timestr = '(' + fmttime(t) + ')';
  }
  console.log(`${Object.keys(tests).length} tests passed ${timestr}`);
});
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "noImplicitAny": false,
    "sourceMap": false,
    "lib": [
      "es6",
      "dom"
    ],
    "pretty": true
  },
  "files": [
    "tstest.ts"
  ]
}import {LRUMap} from './lru'

let m = new LRUMap<string, number>(3);
let entit = m.entries();
let k : string = entit.next().value[0];
let v : number = entit.next().value[1];
declare const mimicFn: {
	/**
	Make a function mimic another one. It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.

	@param to - Mimicking function.
	@param from - Function to mimic.
	@returns The modified `to` function.

	@example
	```
	import mimicFn = require('mimic-fn');

	function foo() {}
	foo.unicorn = '🦄';

	function wrapper() {
		return foo();
	}

	console.log(wrapper.name);
	//=> 'wrapper'

	mimicFn(wrapper, foo);

	console.log(wrapper.name);
	//=> 'foo'

	console.log(wrapper.unicorn);
	//=> '🦄'
	```
	*/
	<
		ArgumentsType extends unknown[],
		ReturnType,
		FunctionType extends (...arguments: ArgumentsType) => ReturnType
	>(
		to: (...arguments: ArgumentsType) => ReturnType,
		from: FunctionType
	): FunctionType;

	// TODO: Remove this for the next major release, refactor the whole definition to:
	// declare function mimicFn<
	//	ArgumentsType extends unknown[],
	//	ReturnType,
	//	FunctionType extends (...arguments: ArgumentsType) => ReturnType
	// >(
	//	to: (...arguments: ArgumentsType) => ReturnType,
	//	from: FunctionType
	// ): FunctionType;
	// export = mimicFn;
	default: typeof mimicFn;
};

export = mimicFn;
'use strict';

const mimicFn = (to, from) => {
	for (const prop of Reflect.ownKeys(from)) {
		Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
	}

	return to;
};

module.exports = mimicFn;
// TODO: Remove this for the next major release
module.exports.default = mimicFn;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "mimic-fn",
	"version": "2.1.0",
	"description": "Make a function mimic another one",
	"license": "MIT",
	"repository": "sindresorhus/mimic-fn",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"function",
		"mimic",
		"imitate",
		"rename",
		"copy",
		"inherit",
		"properties",
		"name",
		"func",
		"fn",
		"set",
		"infer",
		"change"
	],
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.1",
		"xo": "^0.24.0"
	}
}
# mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)

> Make a function mimic another one

Useful when you wrap a function in another function and like to preserve the original name and other properties.


## Install

```
$ npm install mimic-fn
```


## Usage

```js
const mimicFn = require('mimic-fn');

function foo() {}
foo.unicorn = '🦄';

function wrapper() {
	return foo();
}

console.log(wrapper.name);
//=> 'wrapper'

mimicFn(wrapper, foo);

console.log(wrapper.name);
//=> 'foo'

console.log(wrapper.unicorn);
//=> '🦄'
```


## API

It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.

### mimicFn(to, from)

Modifies the `to` function and returns it.

#### to

Type: `Function`

Mimicking function.

#### from

Type: `Function`

Function to mimic.


## Related

- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
/**
 * Helpers.
 */

var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;

/**
 * Parse or format the given `val`.
 *
 * Options:
 *
 *  - `long` verbose formatting [false]
 *
 * @param {String|Number} val
 * @param {Object} [options]
 * @throws {Error} throw an error if val is not a non-empty string or a number
 * @return {String|Number}
 * @api public
 */

module.exports = function (val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse(val);
  } else if (type === 'number' && isFinite(val)) {
    return options.long ? fmtLong(val) : fmtShort(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
};

/**
 * Parse the given `str` and return milliseconds.
 *
 * @param {String} str
 * @return {Number}
 * @api private
 */

function parse(str) {
  str = String(str);
  if (str.length > 100) {
    return;
  }
  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
    str
  );
  if (!match) {
    return;
  }
  var n = parseFloat(match[1]);
  var type = (match[2] || 'ms').toLowerCase();
  switch (type) {
    case 'years':
    case 'year':
    case 'yrs':
    case 'yr':
    case 'y':
      return n * y;
    case 'weeks':
    case 'week':
    case 'w':
      return n * w;
    case 'days':
    case 'day':
    case 'd':
      return n * d;
    case 'hours':
    case 'hour':
    case 'hrs':
    case 'hr':
    case 'h':
      return n * h;
    case 'minutes':
    case 'minute':
    case 'mins':
    case 'min':
    case 'm':
      return n * m;
    case 'seconds':
    case 'second':
    case 'secs':
    case 'sec':
    case 's':
      return n * s;
    case 'milliseconds':
    case 'millisecond':
    case 'msecs':
    case 'msec':
    case 'ms':
      return n;
    default:
      return undefined;
  }
}

/**
 * Short format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtShort(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return Math.round(ms / d) + 'd';
  }
  if (msAbs >= h) {
    return Math.round(ms / h) + 'h';
  }
  if (msAbs >= m) {
    return Math.round(ms / m) + 'm';
  }
  if (msAbs >= s) {
    return Math.round(ms / s) + 's';
  }
  return ms + 'ms';
}

/**
 * Long format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtLong(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return plural(ms, msAbs, d, 'day');
  }
  if (msAbs >= h) {
    return plural(ms, msAbs, h, 'hour');
  }
  if (msAbs >= m) {
    return plural(ms, msAbs, m, 'minute');
  }
  if (msAbs >= s) {
    return plural(ms, msAbs, s, 'second');
  }
  return ms + ' ms';
}

/**
 * Pluralization helper.
 */

function plural(ms, msAbs, n, name) {
  var isPlural = msAbs >= n * 1.5;
  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}
The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
  "name": "ms",
  "version": "2.1.3",
  "description": "Tiny millisecond conversion utility",
  "repository": "vercel/ms",
  "main": "./index",
  "files": [
    "index.js"
  ],
  "scripts": {
    "precommit": "lint-staged",
    "lint": "eslint lib/* bin/*",
    "test": "mocha tests.js"
  },
  "eslintConfig": {
    "extends": "eslint:recommended",
    "env": {
      "node": true,
      "es6": true
    }
  },
  "lint-staged": {
    "*.js": [
      "npm run lint",
      "prettier --single-quote --write",
      "git add"
    ]
  },
  "license": "MIT",
  "devDependencies": {
    "eslint": "4.18.2",
    "expect.js": "0.3.1",
    "husky": "0.14.3",
    "lint-staged": "5.0.0",
    "mocha": "4.0.1",
    "prettier": "2.0.5"
  }
}
# ms

![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)

Use this package to easily convert various time formats to milliseconds.

## Examples

```js
ms('2 days')  // 172800000
ms('1d')      // 86400000
ms('10h')     // 36000000
ms('2.5 hrs') // 9000000
ms('2h')      // 7200000
ms('1m')      // 60000
ms('5s')      // 5000
ms('1y')      // 31557600000
ms('100')     // 100
ms('-3 days') // -259200000
ms('-1h')     // -3600000
ms('-200')    // -200
```

### Convert from Milliseconds

```js
ms(60000)             // "1m"
ms(2 * 60000)         // "2m"
ms(-3 * 60000)        // "-3m"
ms(ms('10 hours'))    // "10h"
```

### Time Format Written-Out

```js
ms(60000, { long: true })             // "1 minute"
ms(2 * 60000, { long: true })         // "2 minutes"
ms(-3 * 60000, { long: true })        // "-3 minutes"
ms(ms('10 hours'), { long: true })    // "10 hours"
```

## Features

- Works both in [Node.js](https://nodejs.org) and in the browser
- If a number is supplied to `ms`, a string with a unit is returned
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned

## Related Packages

- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.

## Caught a Bug?

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!

As always, you can run the tests using: `npm test`
declare namespace onetime {
	interface Options {
		/**
		Throw an error when called more than once.

		@default false
		*/
		throw?: boolean;
	}
}

declare const onetime: {
	/**
	Ensure a function is only called once. When called multiple times it will return the return value from the first call.

	@param fn - Function that should only be called once.
	@returns A function that only calls `fn` once.

	@example
	```
	import onetime = require('onetime');

	let i = 0;

	const foo = onetime(() => ++i);

	foo(); //=> 1
	foo(); //=> 1
	foo(); //=> 1

	onetime.callCount(foo); //=> 3
	```
	*/
	<ArgumentsType extends unknown[], ReturnType>(
		fn: (...arguments: ArgumentsType) => ReturnType,
		options?: onetime.Options
	): (...arguments: ArgumentsType) => ReturnType;

	/**
	Get the number of times `fn` has been called.

	@param fn - Function to get call count from.
	@returns A number representing how many times `fn` has been called.

	@example
	```
	import onetime = require('onetime');

	const foo = onetime(() => {});
	foo();
	foo();
	foo();

	console.log(onetime.callCount(foo));
	//=> 3
	```
	*/
	callCount(fn: (...arguments: any[]) => unknown): number;

	// TODO: Remove this for the next major release
	default: typeof onetime;
};

export = onetime;
'use strict';
const mimicFn = require('mimic-fn');

const calledFunctions = new WeakMap();

const onetime = (function_, options = {}) => {
	if (typeof function_ !== 'function') {
		throw new TypeError('Expected a function');
	}

	let returnValue;
	let callCount = 0;
	const functionName = function_.displayName || function_.name || '<anonymous>';

	const onetime = function (...arguments_) {
		calledFunctions.set(onetime, ++callCount);

		if (callCount === 1) {
			returnValue = function_.apply(this, arguments_);
			function_ = null;
		} else if (options.throw === true) {
			throw new Error(`Function \`${functionName}\` can only be called once`);
		}

		return returnValue;
	};

	mimicFn(onetime, function_);
	calledFunctions.set(onetime, callCount);

	return onetime;
};

module.exports = onetime;
// TODO: Remove this for the next major release
module.exports.default = onetime;

module.exports.callCount = function_ => {
	if (!calledFunctions.has(function_)) {
		throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
	}

	return calledFunctions.get(function_);
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "onetime",
	"version": "5.1.2",
	"description": "Ensure a function is only called once",
	"license": "MIT",
	"repository": "sindresorhus/onetime",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"once",
		"function",
		"one",
		"onetime",
		"func",
		"fn",
		"single",
		"call",
		"called",
		"prevent"
	],
	"dependencies": {
		"mimic-fn": "^2.1.0"
	},
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.1",
		"xo": "^0.24.0"
	}
}
# onetime [![Build Status](https://travis-ci.com/sindresorhus/onetime.svg?branch=master)](https://travis-ci.com/github/sindresorhus/onetime)

> Ensure a function is only called once

When called multiple times it will return the return value from the first call.

*Unlike the module [once](https://github.com/isaacs/once), this one isn't naughty and extending `Function.prototype`.*

## Install

```
$ npm install onetime
```

## Usage

```js
const onetime = require('onetime');

let i = 0;

const foo = onetime(() => ++i);

foo(); //=> 1
foo(); //=> 1
foo(); //=> 1

onetime.callCount(foo); //=> 3
```

```js
const onetime = require('onetime');

const foo = onetime(() => {}, {throw: true});

foo();

foo();
//=> Error: Function `foo` can only be called once
```

## API

### onetime(fn, options?)

Returns a function that only calls `fn` once.

#### fn

Type: `Function`

Function that should only be called once.

#### options

Type: `object`

##### throw

Type: `boolean`\
Default: `false`

Throw an error when called more than once.

### onetime.callCount(fn)

Returns a number representing how many times `fn` has been called.

Note: It throws an error if you pass in a function that is not wrapped by `onetime`.

```js
const onetime = require('onetime');

const foo = onetime(() => {});

foo();
foo();
foo();

console.log(onetime.callCount(foo));
//=> 3
```

#### fn

Type: `Function`

Function to get call count from.

## onetime for enterprise

Available as part of the Tidelift Subscription.

The maintainers of onetime and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-onetime?utm_source=npm-onetime&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
export interface Limit {
	/**
	@param fn - Promise-returning/async function.
	@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
	@returns The promise returned by calling `fn(...arguments)`.
	*/
	<Arguments extends unknown[], ReturnType>(
		fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
		...arguments: Arguments
	): Promise<ReturnType>;

	/**
	The number of promises that are currently running.
	*/
	readonly activeCount: number;

	/**
	The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
	*/
	readonly pendingCount: number;

	/**
	Discard pending promises that are waiting to run.

	This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.

	Note: This does not cancel promises that are already running.
	*/
	clearQueue(): void;
}

/**
Run multiple promise-returning & async functions with limited concurrency.

@param concurrency - Concurrency limit. Minimum: `1`.
@returns A `limit` function.
*/
export default function pLimit(concurrency: number): Limit;
'use strict';
const pTry = require('p-try');

const pLimit = concurrency => {
	if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
		return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up'));
	}

	const queue = [];
	let activeCount = 0;

	const next = () => {
		activeCount--;

		if (queue.length > 0) {
			queue.shift()();
		}
	};

	const run = (fn, resolve, ...args) => {
		activeCount++;

		const result = pTry(fn, ...args);

		resolve(result);

		result.then(next, next);
	};

	const enqueue = (fn, resolve, ...args) => {
		if (activeCount < concurrency) {
			run(fn, resolve, ...args);
		} else {
			queue.push(run.bind(null, fn, resolve, ...args));
		}
	};

	const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args));
	Object.defineProperties(generator, {
		activeCount: {
			get: () => activeCount
		},
		pendingCount: {
			get: () => queue.length
		},
		clearQueue: {
			value: () => {
				queue.length = 0;
			}
		}
	});

	return generator;
};

module.exports = pLimit;
module.exports.default = pLimit;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "p-limit",
	"version": "2.3.0",
	"description": "Run multiple promise-returning & async functions with limited concurrency",
	"license": "MIT",
	"repository": "sindresorhus/p-limit",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava && tsd-check"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"promise",
		"limit",
		"limited",
		"concurrency",
		"throttle",
		"throat",
		"rate",
		"batch",
		"ratelimit",
		"task",
		"queue",
		"async",
		"await",
		"promises",
		"bluebird"
	],
	"dependencies": {
		"p-try": "^2.0.0"
	},
	"devDependencies": {
		"ava": "^1.2.1",
		"delay": "^4.1.0",
		"in-range": "^1.0.0",
		"random-int": "^1.0.0",
		"time-span": "^2.0.0",
		"tsd-check": "^0.3.0",
		"xo": "^0.24.0"
	}
}
# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit)

> Run multiple promise-returning & async functions with limited concurrency

## Install

```
$ npm install p-limit
```

## Usage

```js
const pLimit = require('p-limit');

const limit = pLimit(1);

const input = [
	limit(() => fetchSomething('foo')),
	limit(() => fetchSomething('bar')),
	limit(() => doSomething())
];

(async () => {
	// Only one promise is run at once
	const result = await Promise.all(input);
	console.log(result);
})();
```

## API

### pLimit(concurrency)

Returns a `limit` function.

#### concurrency

Type: `number`\
Minimum: `1`\
Default: `Infinity`

Concurrency limit.

### limit(fn, ...args)

Returns the promise returned by calling `fn(...args)`.

#### fn

Type: `Function`

Promise-returning/async function.

#### args

Any arguments to pass through to `fn`.

Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.

### limit.activeCount

The number of promises that are currently running.

### limit.pendingCount

The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).

### limit.clearQueue()

Discard pending promises that are waiting to run.

This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.

Note: This does not cancel promises that are already running.

## FAQ

### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?

This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.

## Related

- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [More…](https://github.com/sindresorhus/promise-fun)

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
'use strict';
const pLimit = require('p-limit');

class EndError extends Error {
	constructor(value) {
		super();
		this.value = value;
	}
}

// The input can also be a promise, so we `Promise.resolve()` it
const testElement = (el, tester) => Promise.resolve(el).then(tester);

// The input can also be a promise, so we `Promise.all()` them both
const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0])));

module.exports = (iterable, tester, opts) => {
	opts = Object.assign({
		concurrency: Infinity,
		preserveOrder: true
	}, opts);

	const limit = pLimit(opts.concurrency);

	// Start all the promises concurrently with optional limit
	const items = [...iterable].map(el => [el, limit(testElement, el, tester)]);

	// Check the promises either serially or concurrently
	const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity);

	return Promise.all(items.map(el => checkLimit(finder, el)))
		.then(() => {})
		.catch(err => err instanceof EndError ? err.value : Promise.reject(err));
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "p-locate",
	"version": "3.0.0",
	"description": "Get the first fulfilled promise that satisfies the provided testing function",
	"license": "MIT",
	"repository": "sindresorhus/p-locate",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava"
	},
	"files": [
		"index.js"
	],
	"keywords": [
		"promise",
		"locate",
		"find",
		"finder",
		"search",
		"searcher",
		"test",
		"array",
		"collection",
		"iterable",
		"iterator",
		"race",
		"fulfilled",
		"fastest",
		"async",
		"await",
		"promises",
		"bluebird"
	],
	"dependencies": {
		"p-limit": "^2.0.0"
	},
	"devDependencies": {
		"ava": "*",
		"delay": "^3.0.0",
		"in-range": "^1.0.0",
		"time-span": "^2.0.0",
		"xo": "*"
	}
}
# p-locate [![Build Status](https://travis-ci.org/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.org/sindresorhus/p-locate)

> Get the first fulfilled promise that satisfies the provided testing function

Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).


## Install

```
$ npm install p-locate
```


## Usage

Here we find the first file that exists on disk, in array order.

```js
const pathExists = require('path-exists');
const pLocate = require('p-locate');

const files = [
	'unicorn.png',
	'rainbow.png', // Only this one actually exists on disk
	'pony.png'
];

(async () => {
	const foundPath = await pLocate(files, file => pathExists(file));

	console.log(foundPath);
	//=> 'rainbow'
})();
```

*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*


## API

### pLocate(input, tester, [options])

Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.

#### input

Type: `Iterable<Promise|any>`

#### tester(element)

Type: `Function`

Expected to return a `Promise<boolean>` or boolean.

#### options

Type: `Object`

##### concurrency

Type: `number`<br>
Default: `Infinity`<br>
Minimum: `1`

Number of concurrently pending promises returned by `tester`.

##### preserveOrder

Type: `boolean`<br>
Default: `true`

Preserve `input` order when searching.

Disable this to improve performance if you don't care about the order.


## Related

- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled
- [More…](https://github.com/sindresorhus/promise-fun)


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
declare const pTry: {
	/**
	Start a promise chain.

	@param fn - The function to run to start the promise chain.
	@param arguments - Arguments to pass to `fn`.
	@returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error.

	@example
	```
	import pTry = require('p-try');

	(async () => {
		try {
			const value = await pTry(() => {
				return synchronousFunctionThatMightThrow();
			});
			console.log(value);
		} catch (error) {
			console.error(error);
		}
	})();
	```
	*/
	<ValueType, ArgumentsType extends unknown[]>(
		fn: (...arguments: ArgumentsType) => PromiseLike<ValueType> | ValueType,
		...arguments: ArgumentsType
	): Promise<ValueType>;

	// TODO: remove this in the next major version, refactor the whole definition to:
	// declare function pTry<ValueType, ArgumentsType extends unknown[]>(
	//	fn: (...arguments: ArgumentsType) => PromiseLike<ValueType> | ValueType,
	//	...arguments: ArgumentsType
	// ): Promise<ValueType>;
	// export = pTry;
	default: typeof pTry;
};

export = pTry;
'use strict';

const pTry = (fn, ...arguments_) => new Promise(resolve => {
	resolve(fn(...arguments_));
});

module.exports = pTry;
// TODO: remove this in the next major version
module.exports.default = pTry;
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "p-try",
	"version": "2.2.0",
	"description": "`Start a promise chain",
	"license": "MIT",
	"repository": "sindresorhus/p-try",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"promise",
		"try",
		"resolve",
		"function",
		"catch",
		"async",
		"await",
		"promises",
		"settled",
		"ponyfill",
		"polyfill",
		"shim",
		"bluebird"
	],
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.1",
		"xo": "^0.24.0"
	}
}
# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try)

> Start a promise chain

[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/)


## Install

```
$ npm install p-try
```


## Usage

```js
const pTry = require('p-try');

(async () => {
	try {
		const value = await pTry(() => {
			return synchronousFunctionThatMightThrow();
		});
		console.log(value);
	} catch (error) {
		console.error(error);
	}
})();
```


## API

### pTry(fn, ...arguments)

Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error.

Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.

#### fn

The function to run to start the promise chain.

#### arguments

Arguments to pass to `fn`.


## Related

- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome
- [More…](https://github.com/sindresorhus/promise-fun)


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
declare namespace pkgUp {
	interface Options {
		/**
		Directory to start from.

		@default process.cwd()
		*/
		readonly cwd?: string;
	}
}

declare const pkgUp: {
	/**
	Find the closest `package.json` file.

	@returns The filepath, or `null` if it couldn't be found.

	@example
	```
	// /
	// └── Users
	//     └── sindresorhus
	//         └── foo
	//             ├── package.json
	//             └── bar
	//                 ├── baz
	//                 └── example.js

	// example.js
	import pkgUp = require('pkg-up');

	(async () => {
		console.log(await pkgUp());
		//=> '/Users/sindresorhus/foo/package.json'
	})();
	```
	*/
	(options?: pkgUp.Options): Promise<string | null>;

	/**
	Synchronously find the closest `package.json` file.

	@returns The filepath, or `null` if it couldn't be found.
	*/
	sync(options?: pkgUp.Options): string | null;
};

export = pkgUp;
'use strict';
const findUp = require('find-up');

module.exports = async ({cwd} = {}) => findUp('package.json', {cwd});
module.exports.sync = ({cwd} = {}) => findUp.sync('package.json', {cwd});
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
const path = require('path');
const locatePath = require('locate-path');

module.exports = (filename, opts = {}) => {
	const startDir = path.resolve(opts.cwd || '');
	const {root} = path.parse(startDir);

	const filenames = [].concat(filename);

	return new Promise(resolve => {
		(function find(dir) {
			locatePath(filenames, {cwd: dir}).then(file => {
				if (file) {
					resolve(path.join(dir, file));
				} else if (dir === root) {
					resolve(null);
				} else {
					find(path.dirname(dir));
				}
			});
		})(startDir);
	});
};

module.exports.sync = (filename, opts = {}) => {
	let dir = path.resolve(opts.cwd || '');
	const {root} = path.parse(dir);

	const filenames = [].concat(filename);

	// eslint-disable-next-line no-constant-condition
	while (true) {
		const file = locatePath.sync(filenames, {cwd: dir});

		if (file) {
			return path.join(dir, file);
		}

		if (dir === root) {
			return null;
		}

		dir = path.dirname(dir);
	}
};
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
{
	"name": "find-up",
	"version": "3.0.0",
	"description": "Find a file or directory by walking up parent directories",
	"license": "MIT",
	"repository": "sindresorhus/find-up",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=6"
	},
	"scripts": {
		"test": "xo && ava"
	},
	"files": [
		"index.js"
	],
	"keywords": [
		"find",
		"up",
		"find-up",
		"findup",
		"look-up",
		"look",
		"file",
		"search",
		"match",
		"package",
		"resolve",
		"parent",
		"parents",
		"folder",
		"directory",
		"dir",
		"walk",
		"walking",
		"path"
	],
	"dependencies": {
		"locate-path": "^3.0.0"
	},
	"devDependencies": {
		"ava": "*",
		"tempy": "^0.2.1",
		"xo": "*"
	}
}
# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master)

> Find a file or directory by walking up parent directories


## Install

```
$ npm install find-up
```


## Usage

```
/
└── Users
		└── sindresorhus
				├── unicorn.png
				└── foo
						└── bar
								├── baz
								└── example.js
```

`example.js`

```js
const findUp = require('find-up');

(async () => {
	console.log(await findUp('unicorn.png'));
	//=> '/Users/sindresorhus/unicorn.png'

	console.log(await findUp(['rainbow.png', 'unicorn.png']));
	//=> '/Users/sindresorhus/unicorn.png'
})();
```


## API

### findUp(filename, [options])

Returns a `Promise` for either the filepath or `null` if it couldn't be found.

### findUp([filenameA, filenameB], [options])

Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found.

### findUp.sync(filename, [options])

Returns a filepath or `null`.

### findUp.sync([filenameA, filenameB], [options])

Returns the first filepath found (by respecting the order) or `null`.

#### filename

Type: `string`

Filename of the file to find.

#### options

Type: `Object`

##### cwd

Type: `string`<br>
Default: `process.cwd()`

Directory to start from.


## Related

- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
{
	"name": "pkg-up",
	"version": "3.1.0",
	"description": "Find the closest package.json file",
	"license": "MIT",
	"repository": "sindresorhus/pkg-up",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=8"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"pkg",
		"package",
		"file",
		"find",
		"up",
		"find-up",
		"findup",
		"look-up",
		"look",
		"search",
		"match",
		"resolve",
		"parent",
		"parents",
		"folder",
		"directory",
		"dir",
		"walk",
		"walking",
		"path"
	],
	"dependencies": {
		"find-up": "^3.0.0"
	},
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.7.2",
		"xo": "^0.24.0"
	}
}
# pkg-up [![Build Status](https://travis-ci.org/sindresorhus/pkg-up.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-up)

> Find the closest package.json file


## Install

```
$ npm install pkg-up
```


## Usage

```
/
└── Users
    └── sindresorhus
        └── foo
            ├── package.json
            └── bar
                ├── baz
                └── example.js
```

```js
// example.js
const pkgUp = require('pkg-up');

(async () => {
	console.log(await pkgUp());
	//=> '/Users/sindresorhus/foo/package.json'
})();
```


## API

### pkgUp([options])

Returns a `Promise<string>` for the filepath, or `Promise<null>` if it couldn't be found.

### pkgUp.sync([options])

Returns the filepath, or `null` if it couldn't be found.

#### options

Type: `Object`

#### cwd

Type: `string`<br>
Default: `process.cwd()`

Directory to start from.


## Related

- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
'use strict';

var Module = require('module');
var path = require('path');

module.exports = function requireFromString(code, filename, opts) {
	if (typeof filename === 'object') {
		opts = filename;
		filename = undefined;
	}

	opts = opts || {};
	filename = filename || '';

	opts.appendPaths = opts.appendPaths || [];
	opts.prependPaths = opts.prependPaths || [];

	if (typeof code !== 'string') {
		throw new Error('code must be a string, not ' + typeof code);
	}

	var paths = Module._nodeModulePaths(path.dirname(filename));

	var parent = module.parent;
	var m = new Module(filename, parent);
	m.filename = filename;
	m.paths = [].concat(opts.prependPaths).concat(paths).concat(opts.appendPaths);
	m._compile(code, filename);

	var exports = m.exports;
	parent && parent.children && parent.children.splice(parent.children.indexOf(m), 1);

	return exports;
};
The MIT License (MIT)

Copyright (c) Vsevolod Strukchinsky <floatdrop@gmail.com> (github.com/floatdrop)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
{
  "name": "require-from-string",
  "version": "2.0.2",
  "description": "Require module from string",
  "license": "MIT",
  "repository": "floatdrop/require-from-string",
  "author": {
    "name": "Vsevolod Strukchinsky",
    "email": "floatdrop@gmail.com",
    "url": "github.com/floatdrop"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "mocha"
  },
  "files": [
    "index.js"
  ],
  "keywords": [
    ""
  ],
  "dependencies": {},
  "devDependencies": {
    "mocha": "*"
  }
}
# require-from-string [![Build Status](https://travis-ci.org/floatdrop/require-from-string.svg?branch=master)](https://travis-ci.org/floatdrop/require-from-string)

Load module from string in Node.

## Install

```
$ npm install --save require-from-string
```


## Usage

```js
var requireFromString = require('require-from-string');

requireFromString('module.exports = 1');
//=> 1
```


## API

### requireFromString(code, [filename], [options])

#### code

*Required*  
Type: `string`

Module code.

#### filename
Type: `string`  
Default: `''`

Optional filename.


#### options
Type: `object`

##### appendPaths
Type: `Array`

List of `paths`, that will be appended to module `paths`. Useful, when you want
to be able require modules from these paths.

##### prependPaths
Type: `Array`

Same as `appendPaths`, but paths will be prepended.

## License

MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)
#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.

const argv = process.argv.slice(2)

let versions = []

const range = []

let inc = null

const version = require('../package.json').version

let loose = false

let includePrerelease = false

let coerce = false

let rtl = false

let identifier

let identifierBase

const semver = require('../')
const parseOptions = require('../internal/parse-options')

let reverse = false

let options = {}

const main = () => {
  if (!argv.length) {
    return help()
  }
  while (argv.length) {
    let a = argv.shift()
    const indexOfEqualSign = a.indexOf('=')
    if (indexOfEqualSign !== -1) {
      const value = a.slice(indexOfEqualSign + 1)
      a = a.slice(0, indexOfEqualSign)
      argv.unshift(value)
    }
    switch (a) {
      case '-rv': case '-rev': case '--rev': case '--reverse':
        reverse = true
        break
      case '-l': case '--loose':
        loose = true
        break
      case '-p': case '--include-prerelease':
        includePrerelease = true
        break
      case '-v': case '--version':
        versions.push(argv.shift())
        break
      case '-i': case '--inc': case '--increment':
        switch (argv[0]) {
          case 'major': case 'minor': case 'patch': case 'prerelease':
          case 'premajor': case 'preminor': case 'prepatch':
            inc = argv.shift()
            break
          default:
            inc = 'patch'
            break
        }
        break
      case '--preid':
        identifier = argv.shift()
        break
      case '-r': case '--range':
        range.push(argv.shift())
        break
      case '-n':
        identifierBase = argv.shift()
        if (identifierBase === 'false') {
          identifierBase = false
        }
        break
      case '-c': case '--coerce':
        coerce = true
        break
      case '--rtl':
        rtl = true
        break
      case '--ltr':
        rtl = false
        break
      case '-h': case '--help': case '-?':
        return help()
      default:
        versions.push(a)
        break
    }
  }

  options = parseOptions({ loose, includePrerelease, rtl })

  versions = versions.map((v) => {
    return coerce ? (semver.coerce(v, options) || { version: v }).version : v
  }).filter((v) => {
    return semver.valid(v)
  })
  if (!versions.length) {
    return fail()
  }
  if (inc && (versions.length !== 1 || range.length)) {
    return failInc()
  }

  for (let i = 0, l = range.length; i < l; i++) {
    versions = versions.filter((v) => {
      return semver.satisfies(v, range[i], options)
    })
    if (!versions.length) {
      return fail()
    }
  }
  versions
    .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
    .map(v => semver.clean(v, options))
    .map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
    .forEach(v => console.log(v))
}

const failInc = () => {
  console.error('--inc can only be used on a single version with no range')
  fail()
}

const fail = () => process.exit(1)

const help = () => console.log(
`SemVer ${version}

A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter

Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence

Options:
-r --range <range>
        Print versions that match the specified range.

-i --increment [<level>]
        Increment a version by the specified level.  Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, or prerelease.  Default level is 'patch'.
        Only one version may be specified.

--preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-l --loose
        Interpret versions and ranges loosely

-p --include-prerelease
        Always include prerelease versions in range matching

-c --coerce
        Coerce a string into SemVer if possible
        (does not imply --loose)

--rtl
        Coerce version strings right to left

--ltr
        Coerce version strings left to right (default)

-n <base>
        Base number to be used for the prerelease identifier.
        Can be either 0 or 1, or false to omit the number altogether.
        Defaults to 0.

Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.

If no satisfying versions are found, then exits failure.

Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.`)

main()
const ANY = Symbol('SemVer ANY')
// hoisted class for cyclic dependency
class Comparator {
  static get ANY () {
    return ANY
  }

  constructor (comp, options) {
    options = parseOptions(options)

    if (comp instanceof Comparator) {
      if (comp.loose === !!options.loose) {
        return comp
      } else {
        comp = comp.value
      }
    }

    comp = comp.trim().split(/\s+/).join(' ')
    debug('comparator', comp, options)
    this.options = options
    this.loose = !!options.loose
    this.parse(comp)

    if (this.semver === ANY) {
      this.value = ''
    } else {
      this.value = this.operator + this.semver.version
    }

    debug('comp', this)
  }

  parse (comp) {
    const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
    const m = comp.match(r)

    if (!m) {
      throw new TypeError(`Invalid comparator: ${comp}`)
    }

    this.operator = m[1] !== undefined ? m[1] : ''
    if (this.operator === '=') {
      this.operator = ''
    }

    // if it literally is just '>' or '' then allow anything.
    if (!m[2]) {
      this.semver = ANY
    } else {
      this.semver = new SemVer(m[2], this.options.loose)
    }
  }

  toString () {
    return this.value
  }

  test (version) {
    debug('Comparator.test', version, this.options.loose)

    if (this.semver === ANY || version === ANY) {
      return true
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    return cmp(version, this.operator, this.semver, this.options)
  }

  intersects (comp, options) {
    if (!(comp instanceof Comparator)) {
      throw new TypeError('a Comparator is required')
    }

    if (this.operator === '') {
      if (this.value === '') {
        return true
      }
      return new Range(comp.value, options).test(this.value)
    } else if (comp.operator === '') {
      if (comp.value === '') {
        return true
      }
      return new Range(this.value, options).test(comp.semver)
    }

    options = parseOptions(options)

    // Special cases where nothing can possibly be lower
    if (options.includePrerelease &&
      (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
      return false
    }
    if (!options.includePrerelease &&
      (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
      return false
    }

    // Same direction increasing (> or >=)
    if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
      return true
    }
    // Same direction decreasing (< or <=)
    if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
      return true
    }
    // same SemVer and both sides are inclusive (<= or >=)
    if (
      (this.semver.version === comp.semver.version) &&
      this.operator.includes('=') && comp.operator.includes('=')) {
      return true
    }
    // opposite directions less than
    if (cmp(this.semver, '<', comp.semver, options) &&
      this.operator.startsWith('>') && comp.operator.startsWith('<')) {
      return true
    }
    // opposite directions greater than
    if (cmp(this.semver, '>', comp.semver, options) &&
      this.operator.startsWith('<') && comp.operator.startsWith('>')) {
      return true
    }
    return false
  }
}

module.exports = Comparator

const parseOptions = require('../internal/parse-options')
const { safeRe: re, t } = require('../internal/re')
const cmp = require('../functions/cmp')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const Range = require('./range')
module.exports = {
  SemVer: require('./semver.js'),
  Range: require('./range.js'),
  Comparator: require('./comparator.js'),
}
const SPACE_CHARACTERS = /\s+/g

// hoisted class for cyclic dependency
class Range {
  constructor (range, options) {
    options = parseOptions(options)

    if (range instanceof Range) {
      if (
        range.loose === !!options.loose &&
        range.includePrerelease === !!options.includePrerelease
      ) {
        return range
      } else {
        return new Range(range.raw, options)
      }
    }

    if (range instanceof Comparator) {
      // just put it in the set and return
      this.raw = range.value
      this.set = [[range]]
      this.formatted = undefined
      return this
    }

    this.options = options
    this.loose = !!options.loose
    this.includePrerelease = !!options.includePrerelease

    // First reduce all whitespace as much as possible so we do not have to rely
    // on potentially slow regexes like \s*. This is then stored and used for
    // future error messages as well.
    this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')

    // First, split on ||
    this.set = this.raw
      .split('||')
      // map the range to a 2d array of comparators
      .map(r => this.parseRange(r.trim()))
      // throw out any comparator lists that are empty
      // this generally means that it was not a valid range, which is allowed
      // in loose mode, but will still throw if the WHOLE range is invalid.
      .filter(c => c.length)

    if (!this.set.length) {
      throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
    }

    // if we have any that are not the null set, throw out null sets.
    if (this.set.length > 1) {
      // keep the first one, in case they're all null sets
      const first = this.set[0]
      this.set = this.set.filter(c => !isNullSet(c[0]))
      if (this.set.length === 0) {
        this.set = [first]
      } else if (this.set.length > 1) {
        // if we have any that are *, then the range is just *
        for (const c of this.set) {
          if (c.length === 1 && isAny(c[0])) {
            this.set = [c]
            break
          }
        }
      }
    }

    this.formatted = undefined
  }

  get range () {
    if (this.formatted === undefined) {
      this.formatted = ''
      for (let i = 0; i < this.set.length; i++) {
        if (i > 0) {
          this.formatted += '||'
        }
        const comps = this.set[i]
        for (let k = 0; k < comps.length; k++) {
          if (k > 0) {
            this.formatted += ' '
          }
          this.formatted += comps[k].toString().trim()
        }
      }
    }
    return this.formatted
  }

  format () {
    return this.range
  }

  toString () {
    return this.range
  }

  parseRange (range) {
    // memoize range parsing for performance.
    // this is a very hot path, and fully deterministic.
    const memoOpts =
      (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
      (this.options.loose && FLAG_LOOSE)
    const memoKey = memoOpts + ':' + range
    const cached = cache.get(memoKey)
    if (cached) {
      return cached
    }

    const loose = this.options.loose
    // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
    const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
    range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
    debug('hyphen replace', range)

    // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
    range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
    debug('comparator trim', range)

    // `~ 1.2.3` => `~1.2.3`
    range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
    debug('tilde trim', range)

    // `^ 1.2.3` => `^1.2.3`
    range = range.replace(re[t.CARETTRIM], caretTrimReplace)
    debug('caret trim', range)

    // At this point, the range is completely trimmed and
    // ready to be split into comparators.

    let rangeList = range
      .split(' ')
      .map(comp => parseComparator(comp, this.options))
      .join(' ')
      .split(/\s+/)
      // >=0.0.0 is equivalent to *
      .map(comp => replaceGTE0(comp, this.options))

    if (loose) {
      // in loose mode, throw out any that are not valid comparators
      rangeList = rangeList.filter(comp => {
        debug('loose invalid filter', comp, this.options)
        return !!comp.match(re[t.COMPARATORLOOSE])
      })
    }
    debug('range list', rangeList)

    // if any comparators are the null set, then replace with JUST null set
    // if more than one comparator, remove any * comparators
    // also, don't include the same comparator more than once
    const rangeMap = new Map()
    const comparators = rangeList.map(comp => new Comparator(comp, this.options))
    for (const comp of comparators) {
      if (isNullSet(comp)) {
        return [comp]
      }
      rangeMap.set(comp.value, comp)
    }
    if (rangeMap.size > 1 && rangeMap.has('')) {
      rangeMap.delete('')
    }

    const result = [...rangeMap.values()]
    cache.set(memoKey, result)
    return result
  }

  intersects (range, options) {
    if (!(range instanceof Range)) {
      throw new TypeError('a Range is required')
    }

    return this.set.some((thisComparators) => {
      return (
        isSatisfiable(thisComparators, options) &&
        range.set.some((rangeComparators) => {
          return (
            isSatisfiable(rangeComparators, options) &&
            thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options)
              })
            })
          )
        })
      )
    })
  }

  // if ANY of the sets match ALL of its comparators, then pass
  test (version) {
    if (!version) {
      return false
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    for (let i = 0; i < this.set.length; i++) {
      if (testSet(this.set[i], version, this.options)) {
        return true
      }
    }
    return false
  }
}

module.exports = Range

const LRU = require('../internal/lrucache')
const cache = new LRU()

const parseOptions = require('../internal/parse-options')
const Comparator = require('./comparator')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const {
  safeRe: re,
  t,
  comparatorTrimReplace,
  tildeTrimReplace,
  caretTrimReplace,
} = require('../internal/re')
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')

const isNullSet = c => c.value === '<0.0.0-0'
const isAny = c => c.value === ''

// take a set of comparators and determine whether there
// exists a version which can satisfy it
const isSatisfiable = (comparators, options) => {
  let result = true
  const remainingComparators = comparators.slice()
  let testComparator = remainingComparators.pop()

  while (result && remainingComparators.length) {
    result = remainingComparators.every((otherComparator) => {
      return testComparator.intersects(otherComparator, options)
    })

    testComparator = remainingComparators.pop()
  }

  return result
}

// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
  debug('comp', comp, options)
  comp = replaceCarets(comp, options)
  debug('caret', comp)
  comp = replaceTildes(comp, options)
  debug('tildes', comp)
  comp = replaceXRanges(comp, options)
  debug('xrange', comp)
  comp = replaceStars(comp, options)
  debug('stars', comp)
  return comp
}

const isX = id => !id || id.toLowerCase() === 'x' || id === '*'

// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
// ~0.0.1 --> >=0.0.1 <0.1.0-0
const replaceTildes = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceTilde(c, options))
    .join(' ')
}

const replaceTilde = (comp, options) => {
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('tilde', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      // ~1.2 == >=1.2.0 <1.3.0-0
      ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
    } else if (pr) {
      debug('replaceTilde pr', pr)
      ret = `>=${M}.${m}.${p}-${pr
      } <${M}.${+m + 1}.0-0`
    } else {
      // ~1.2.3 == >=1.2.3 <1.3.0-0
      ret = `>=${M}.${m}.${p
      } <${M}.${+m + 1}.0-0`
    }

    debug('tilde return', ret)
    return ret
  })
}

// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
// ^1.2.3 --> >=1.2.3 <2.0.0-0
// ^1.2.0 --> >=1.2.0 <2.0.0-0
// ^0.0.1 --> >=0.0.1 <0.0.2-0
// ^0.1.0 --> >=0.1.0 <0.2.0-0
const replaceCarets = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceCaret(c, options))
    .join(' ')
}

const replaceCaret = (comp, options) => {
  debug('caret', comp, options)
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  const z = options.includePrerelease ? '-0' : ''
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('caret', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      if (M === '0') {
        ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
      } else {
        ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
      }
    } else if (pr) {
      debug('replaceCaret pr', pr)
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p}-${pr
        } <${+M + 1}.0.0-0`
      }
    } else {
      debug('no pr')
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p
          }${z} <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p
          }${z} <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p
        } <${+M + 1}.0.0-0`
      }
    }

    debug('caret return', ret)
    return ret
  })
}

const replaceXRanges = (comp, options) => {
  debug('replaceXRanges', comp, options)
  return comp
    .split(/\s+/)
    .map((c) => replaceXRange(c, options))
    .join(' ')
}

const replaceXRange = (comp, options) => {
  comp = comp.trim()
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
    debug('xRange', comp, ret, gtlt, M, m, p, pr)
    const xM = isX(M)
    const xm = xM || isX(m)
    const xp = xm || isX(p)
    const anyX = xp

    if (gtlt === '=' && anyX) {
      gtlt = ''
    }

    // if we're including prereleases in the match, then we need
    // to fix this to -0, the lowest possible prerelease value
    pr = options.includePrerelease ? '-0' : ''

    if (xM) {
      if (gtlt === '>' || gtlt === '<') {
        // nothing is allowed
        ret = '<0.0.0-0'
      } else {
        // nothing is forbidden
        ret = '*'
      }
    } else if (gtlt && anyX) {
      // we know patch is an x, because we have any x at all.
      // replace X with 0
      if (xm) {
        m = 0
      }
      p = 0

      if (gtlt === '>') {
        // >1 => >=2.0.0
        // >1.2 => >=1.3.0
        gtlt = '>='
        if (xm) {
          M = +M + 1
          m = 0
          p = 0
        } else {
          m = +m + 1
          p = 0
        }
      } else if (gtlt === '<=') {
        // <=0.7.x is actually <0.8.0, since any 0.7.x should
        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
        gtlt = '<'
        if (xm) {
          M = +M + 1
        } else {
          m = +m + 1
        }
      }

      if (gtlt === '<') {
        pr = '-0'
      }

      ret = `${gtlt + M}.${m}.${p}${pr}`
    } else if (xm) {
      ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
    } else if (xp) {
      ret = `>=${M}.${m}.0${pr
      } <${M}.${+m + 1}.0-0`
    }

    debug('xRange return', ret)

    return ret
  })
}

// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
const replaceStars = (comp, options) => {
  debug('replaceStars', comp, options)
  // Looseness is ignored here.  star is always as loose as it gets!
  return comp
    .trim()
    .replace(re[t.STAR], '')
}

const replaceGTE0 = (comp, options) => {
  debug('replaceGTE0', comp, options)
  return comp
    .trim()
    .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
}

// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
// TODO build?
const hyphenReplace = incPr => ($0,
  from, fM, fm, fp, fpr, fb,
  to, tM, tm, tp, tpr) => {
  if (isX(fM)) {
    from = ''
  } else if (isX(fm)) {
    from = `>=${fM}.0.0${incPr ? '-0' : ''}`
  } else if (isX(fp)) {
    from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
  } else if (fpr) {
    from = `>=${from}`
  } else {
    from = `>=${from}${incPr ? '-0' : ''}`
  }

  if (isX(tM)) {
    to = ''
  } else if (isX(tm)) {
    to = `<${+tM + 1}.0.0-0`
  } else if (isX(tp)) {
    to = `<${tM}.${+tm + 1}.0-0`
  } else if (tpr) {
    to = `<=${tM}.${tm}.${tp}-${tpr}`
  } else if (incPr) {
    to = `<${tM}.${tm}.${+tp + 1}-0`
  } else {
    to = `<=${to}`
  }

  return `${from} ${to}`.trim()
}

const testSet = (set, version, options) => {
  for (let i = 0; i < set.length; i++) {
    if (!set[i].test(version)) {
      return false
    }
  }

  if (version.prerelease.length && !options.includePrerelease) {
    // Find the set of versions that are allowed to have prereleases
    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
    // That should allow `1.2.3-pr.2` to pass.
    // However, `1.2.4-alpha.notready` should NOT be allowed,
    // even though it's within the range set by the comparators.
    for (let i = 0; i < set.length; i++) {
      debug(set[i].semver)
      if (set[i].semver === Comparator.ANY) {
        continue
      }

      if (set[i].semver.prerelease.length > 0) {
        const allowed = set[i].semver
        if (allowed.major === version.major &&
            allowed.minor === version.minor &&
            allowed.patch === version.patch) {
          return true
        }
      }
    }

    // Version has a -pre, but it's not one of the ones we like.
    return false
  }

  return true
}
const debug = require('../internal/debug')
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
const { safeRe: re, t } = require('../internal/re')

const parseOptions = require('../internal/parse-options')
const { compareIdentifiers } = require('../internal/identifiers')
class SemVer {
  constructor (version, options) {
    options = parseOptions(options)

    if (version instanceof SemVer) {
      if (version.loose === !!options.loose &&
          version.includePrerelease === !!options.includePrerelease) {
        return version
      } else {
        version = version.version
      }
    } else if (typeof version !== 'string') {
      throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
    }

    if (version.length > MAX_LENGTH) {
      throw new TypeError(
        `version is longer than ${MAX_LENGTH} characters`
      )
    }

    debug('SemVer', version, options)
    this.options = options
    this.loose = !!options.loose
    // this isn't actually relevant for versions, but keep it so that we
    // don't run into trouble passing this.options around.
    this.includePrerelease = !!options.includePrerelease

    const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])

    if (!m) {
      throw new TypeError(`Invalid Version: ${version}`)
    }

    this.raw = version

    // these are actually numbers
    this.major = +m[1]
    this.minor = +m[2]
    this.patch = +m[3]

    if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
      throw new TypeError('Invalid major version')
    }

    if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
      throw new TypeError('Invalid minor version')
    }

    if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
      throw new TypeError('Invalid patch version')
    }

    // numberify any prerelease numeric ids
    if (!m[4]) {
      this.prerelease = []
    } else {
      this.prerelease = m[4].split('.').map((id) => {
        if (/^[0-9]+$/.test(id)) {
          const num = +id
          if (num >= 0 && num < MAX_SAFE_INTEGER) {
            return num
          }
        }
        return id
      })
    }

    this.build = m[5] ? m[5].split('.') : []
    this.format()
  }

  format () {
    this.version = `${this.major}.${this.minor}.${this.patch}`
    if (this.prerelease.length) {
      this.version += `-${this.prerelease.join('.')}`
    }
    return this.version
  }

  toString () {
    return this.version
  }

  compare (other) {
    debug('SemVer.compare', this.version, this.options, other)
    if (!(other instanceof SemVer)) {
      if (typeof other === 'string' && other === this.version) {
        return 0
      }
      other = new SemVer(other, this.options)
    }

    if (other.version === this.version) {
      return 0
    }

    return this.compareMain(other) || this.comparePre(other)
  }

  compareMain (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    return (
      compareIdentifiers(this.major, other.major) ||
      compareIdentifiers(this.minor, other.minor) ||
      compareIdentifiers(this.patch, other.patch)
    )
  }

  comparePre (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    // NOT having a prerelease is > having one
    if (this.prerelease.length && !other.prerelease.length) {
      return -1
    } else if (!this.prerelease.length && other.prerelease.length) {
      return 1
    } else if (!this.prerelease.length && !other.prerelease.length) {
      return 0
    }

    let i = 0
    do {
      const a = this.prerelease[i]
      const b = other.prerelease[i]
      debug('prerelease compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  compareBuild (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    let i = 0
    do {
      const a = this.build[i]
      const b = other.build[i]
      debug('build compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  // preminor will bump the version up to the next minor release, and immediately
  // down to pre-release. premajor and prepatch work the same way.
  inc (release, identifier, identifierBase) {
    switch (release) {
      case 'premajor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor = 0
        this.major++
        this.inc('pre', identifier, identifierBase)
        break
      case 'preminor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor++
        this.inc('pre', identifier, identifierBase)
        break
      case 'prepatch':
        // If this is already a prerelease, it will bump to the next version
        // drop any prereleases that might already exist, since they are not
        // relevant at this point.
        this.prerelease.length = 0
        this.inc('patch', identifier, identifierBase)
        this.inc('pre', identifier, identifierBase)
        break
      // If the input is a non-prerelease version, this acts the same as
      // prepatch.
      case 'prerelease':
        if (this.prerelease.length === 0) {
          this.inc('patch', identifier, identifierBase)
        }
        this.inc('pre', identifier, identifierBase)
        break

      case 'major':
        // If this is a pre-major version, bump up to the same major version.
        // Otherwise increment major.
        // 1.0.0-5 bumps to 1.0.0
        // 1.1.0 bumps to 2.0.0
        if (
          this.minor !== 0 ||
          this.patch !== 0 ||
          this.prerelease.length === 0
        ) {
          this.major++
        }
        this.minor = 0
        this.patch = 0
        this.prerelease = []
        break
      case 'minor':
        // If this is a pre-minor version, bump up to the same minor version.
        // Otherwise increment minor.
        // 1.2.0-5 bumps to 1.2.0
        // 1.2.1 bumps to 1.3.0
        if (this.patch !== 0 || this.prerelease.length === 0) {
          this.minor++
        }
        this.patch = 0
        this.prerelease = []
        break
      case 'patch':
        // If this is not a pre-release version, it will increment the patch.
        // If it is a pre-release it will bump up to the same patch version.
        // 1.2.0-5 patches to 1.2.0
        // 1.2.0 patches to 1.2.1
        if (this.prerelease.length === 0) {
          this.patch++
        }
        this.prerelease = []
        break
      // This probably shouldn't be used publicly.
      // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
      case 'pre': {
        const base = Number(identifierBase) ? 1 : 0

        if (!identifier && identifierBase === false) {
          throw new Error('invalid increment argument: identifier is empty')
        }

        if (this.prerelease.length === 0) {
          this.prerelease = [base]
        } else {
          let i = this.prerelease.length
          while (--i >= 0) {
            if (typeof this.prerelease[i] === 'number') {
              this.prerelease[i]++
              i = -2
            }
          }
          if (i === -1) {
            // didn't increment anything
            if (identifier === this.prerelease.join('.') && identifierBase === false) {
              throw new Error('invalid increment argument: identifier already exists')
            }
            this.prerelease.push(base)
          }
        }
        if (identifier) {
          // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
          // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
          let prerelease = [identifier, base]
          if (identifierBase === false) {
            prerelease = [identifier]
          }
          if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
            if (isNaN(this.prerelease[1])) {
              this.prerelease = prerelease
            }
          } else {
            this.prerelease = prerelease
          }
        }
        break
      }
      default:
        throw new Error(`invalid increment argument: ${release}`)
    }
    this.raw = this.format()
    if (this.build.length) {
      this.raw += `+${this.build.join('.')}`
    }
    return this
  }
}

module.exports = SemVer
const parse = require('./parse')
const clean = (version, options) => {
  const s = parse(version.trim().replace(/^[=v]+/, ''), options)
  return s ? s.version : null
}
module.exports = clean
const eq = require('./eq')
const neq = require('./neq')
const gt = require('./gt')
const gte = require('./gte')
const lt = require('./lt')
const lte = require('./lte')

const cmp = (a, op, b, loose) => {
  switch (op) {
    case '===':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a === b

    case '!==':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a !== b

    case '':
    case '=':
    case '==':
      return eq(a, b, loose)

    case '!=':
      return neq(a, b, loose)

    case '>':
      return gt(a, b, loose)

    case '>=':
      return gte(a, b, loose)

    case '<':
      return lt(a, b, loose)

    case '<=':
      return lte(a, b, loose)

    default:
      throw new TypeError(`Invalid operator: ${op}`)
  }
}
module.exports = cmp
const SemVer = require('../classes/semver')
const parse = require('./parse')
const { safeRe: re, t } = require('../internal/re')

const coerce = (version, options) => {
  if (version instanceof SemVer) {
    return version
  }

  if (typeof version === 'number') {
    version = String(version)
  }

  if (typeof version !== 'string') {
    return null
  }

  options = options || {}

  let match = null
  if (!options.rtl) {
    match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
  } else {
    // Find the right-most coercible string that does not share
    // a terminus with a more left-ward coercible string.
    // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
    // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
    //
    // Walk through the string checking with a /g regexp
    // Manually set the index so as to pick up overlapping matches.
    // Stop when we get a match that ends at the string end, since no
    // coercible string can be more right-ward without the same terminus.
    const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
    let next
    while ((next = coerceRtlRegex.exec(version)) &&
        (!match || match.index + match[0].length !== version.length)
    ) {
      if (!match ||
            next.index + next[0].length !== match.index + match[0].length) {
        match = next
      }
      coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
    }
    // leave it in a clean state
    coerceRtlRegex.lastIndex = -1
  }

  if (match === null) {
    return null
  }

  const major = match[2]
  const minor = match[3] || '0'
  const patch = match[4] || '0'
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''

  return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
}
module.exports = coerce
const SemVer = require('../classes/semver')
const compareBuild = (a, b, loose) => {
  const versionA = new SemVer(a, loose)
  const versionB = new SemVer(b, loose)
  return versionA.compare(versionB) || versionA.compareBuild(versionB)
}
module.exports = compareBuild
const compare = require('./compare')
const compareLoose = (a, b) => compare(a, b, true)
module.exports = compareLoose
const SemVer = require('../classes/semver')
const compare = (a, b, loose) =>
  new SemVer(a, loose).compare(new SemVer(b, loose))

module.exports = compare
const parse = require('./parse.js')

const diff = (version1, version2) => {
  const v1 = parse(version1, null, true)
  const v2 = parse(version2, null, true)
  const comparison = v1.compare(v2)

  if (comparison === 0) {
    return null
  }

  const v1Higher = comparison > 0
  const highVersion = v1Higher ? v1 : v2
  const lowVersion = v1Higher ? v2 : v1
  const highHasPre = !!highVersion.prerelease.length
  const lowHasPre = !!lowVersion.prerelease.length

  if (lowHasPre && !highHasPre) {
    // Going from prerelease -> no prerelease requires some special casing

    // If the low version has only a major, then it will always be a major
    // Some examples:
    // 1.0.0-1 -> 1.0.0
    // 1.0.0-1 -> 1.1.1
    // 1.0.0-1 -> 2.0.0
    if (!lowVersion.patch && !lowVersion.minor) {
      return 'major'
    }

    // Otherwise it can be determined by checking the high version

    if (highVersion.patch) {
      // anything higher than a patch bump would result in the wrong version
      return 'patch'
    }

    if (highVersion.minor) {
      // anything higher than a minor bump would result in the wrong version
      return 'minor'
    }

    // bumping major/minor/patch all have same result
    return 'major'
  }

  // add the `pre` prefix if we are going to a prerelease version
  const prefix = highHasPre ? 'pre' : ''

  if (v1.major !== v2.major) {
    return prefix + 'major'
  }

  if (v1.minor !== v2.minor) {
    return prefix + 'minor'
  }

  if (v1.patch !== v2.patch) {
    return prefix + 'patch'
  }

  // high and low are preleases
  return 'prerelease'
}

module.exports = diff
const compare = require('./compare')
const eq = (a, b, loose) => compare(a, b, loose) === 0
module.exports = eq
const compare = require('./compare')
const gt = (a, b, loose) => compare(a, b, loose) > 0
module.exports = gt
const compare = require('./compare')
const gte = (a, b, loose) => compare(a, b, loose) >= 0
module.exports = gte
const SemVer = require('../classes/semver')

const inc = (version, release, options, identifier, identifierBase) => {
  if (typeof (options) === 'string') {
    identifierBase = identifier
    identifier = options
    options = undefined
  }

  try {
    return new SemVer(
      version instanceof SemVer ? version.version : version,
      options
    ).inc(release, identifier, identifierBase).version
  } catch (er) {
    return null
  }
}
module.exports = inc
const compare = require('./compare')
const lt = (a, b, loose) => compare(a, b, loose) < 0
module.exports = lt
const compare = require('./compare')
const lte = (a, b, loose) => compare(a, b, loose) <= 0
module.exports = lte
const SemVer = require('../classes/semver')
const major = (a, loose) => new SemVer(a, loose).major
module.exports = major
const SemVer = require('../classes/semver')
const minor = (a, loose) => new SemVer(a, loose).minor
module.exports = minor
const compare = require('./compare')
const neq = (a, b, loose) => compare(a, b, loose) !== 0
module.exports = neq
const SemVer = require('../classes/semver')
const parse = (version, options, throwErrors = false) => {
  if (version instanceof SemVer) {
    return version
  }
  try {
    return new SemVer(version, options)
  } catch (er) {
    if (!throwErrors) {
      return null
    }
    throw er
  }
}

module.exports = parse
const SemVer = require('../classes/semver')
const patch = (a, loose) => new SemVer(a, loose).patch
module.exports = patch
const parse = require('./parse')
const prerelease = (version, options) => {
  const parsed = parse(version, options)
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
module.exports = prerelease
const compare = require('./compare')
const rcompare = (a, b, loose) => compare(b, a, loose)
module.exports = rcompare
const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort
const Range = require('../classes/range')
const satisfies = (version, range, options) => {
  try {
    range = new Range(range, options)
  } catch (er) {
    return false
  }
  return range.test(version)
}
module.exports = satisfies
const compareBuild = require('./compare-build')
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
module.exports = sort
const parse = require('./parse')
const valid = (version, options) => {
  const v = parse(version, options)
  return v ? v.version : null
}
module.exports = valid
// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
  parse,
  valid,
  clean,
  inc,
  diff,
  major,
  minor,
  patch,
  prerelease,
  compare,
  rcompare,
  compareLoose,
  compareBuild,
  sort,
  rsort,
  gt,
  lt,
  eq,
  neq,
  gte,
  lte,
  cmp,
  coerce,
  Comparator,
  Range,
  satisfies,
  toComparators,
  maxSatisfying,
  minSatisfying,
  minVersion,
  validRange,
  outside,
  gtr,
  ltr,
  intersects,
  simplifyRange,
  subset,
  SemVer,
  re: internalRe.re,
  src: internalRe.src,
  tokens: internalRe.t,
  SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
  RELEASE_TYPES: constants.RELEASE_TYPES,
  compareIdentifiers: identifiers.compareIdentifiers,
  rcompareIdentifiers: identifiers.rcompareIdentifiers,
}
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
const SEMVER_SPEC_VERSION = '2.0.0'

const MAX_LENGTH = 256
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991

// Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16

// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6

const RELEASE_TYPES = [
  'major',
  'premajor',
  'minor',
  'preminor',
  'patch',
  'prepatch',
  'prerelease',
]

module.exports = {
  MAX_LENGTH,
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_SAFE_INTEGER,
  RELEASE_TYPES,
  SEMVER_SPEC_VERSION,
  FLAG_INCLUDE_PRERELEASE: 0b001,
  FLAG_LOOSE: 0b010,
}
const debug = (
  typeof process === 'object' &&
  process.env &&
  process.env.NODE_DEBUG &&
  /\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
  : () => {}

module.exports = debug
const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
  const anum = numeric.test(a)
  const bnum = numeric.test(b)

  if (anum && bnum) {
    a = +a
    b = +b
  }

  return a === b ? 0
    : (anum && !bnum) ? -1
    : (bnum && !anum) ? 1
    : a < b ? -1
    : 1
}

const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)

module.exports = {
  compareIdentifiers,
  rcompareIdentifiers,
}
class LRUCache {
  constructor () {
    this.max = 1000
    this.map = new Map()
  }

  get (key) {
    const value = this.map.get(key)
    if (value === undefined) {
      return undefined
    } else {
      // Remove the key from the map and add it to the end
      this.map.delete(key)
      this.map.set(key, value)
      return value
    }
  }

  delete (key) {
    return this.map.delete(key)
  }

  set (key, value) {
    const deleted = this.delete(key)

    if (!deleted && value !== undefined) {
      // If cache is full, delete the least recently used item
      if (this.map.size >= this.max) {
        const firstKey = this.map.keys().next().value
        this.delete(firstKey)
      }

      this.map.set(key, value)
    }

    return this
  }
}

module.exports = LRUCache
// parse out just the options we care about
const looseOption = Object.freeze({ loose: true })
const emptyOpts = Object.freeze({ })
const parseOptions = options => {
  if (!options) {
    return emptyOpts
  }

  if (typeof options !== 'object') {
    return looseOption
  }

  return options
}
module.exports = parseOptions
const {
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_LENGTH,
} = require('./constants')
const debug = require('./debug')
exports = module.exports = {}

// The actual regexps go on exports.re
const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = []
const t = exports.t = {}
let R = 0

const LETTERDASHNUMBER = '[a-zA-Z0-9-]'

// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
  ['\\s', 1],
  ['\\d', MAX_LENGTH],
  [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]

const makeSafeRegex = (value) => {
  for (const [token, max] of safeRegexReplacements) {
    value = value
      .split(`${token}*`).join(`${token}{0,${max}}`)
      .split(`${token}+`).join(`${token}{1,${max}}`)
  }
  return value
}

const createToken = (name, value, isGlobal) => {
  const safe = makeSafeRegex(value)
  const index = R++
  debug(name, index, value)
  t[name] = index
  src[index] = value
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
  safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
}

// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.

// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.

createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')

// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.

createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)

// ## Main Version
// Three dot-separated numeric identifiers.

createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})`)

createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})`)

// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.

createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
}|${src[t.NONNUMERICIDENTIFIER]})`)

createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
}|${src[t.NONNUMERICIDENTIFIER]})`)

// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.

createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)

createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)

// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.

createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)

// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.

createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)

// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.

// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups.  The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.

createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
}${src[t.PRERELEASE]}?${
  src[t.BUILD]}?`)

createToken('FULL', `^${src[t.FULLPLAIN]}$`)

// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
}${src[t.PRERELEASELOOSE]}?${
  src[t.BUILD]}?`)

createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)

createToken('GTLT', '((?:<|>)?=?)')

// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)

createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:${src[t.PRERELEASE]})?${
                     src[t.BUILD]}?` +
                   `)?)?`)

createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:${src[t.PRERELEASELOOSE]})?${
                          src[t.BUILD]}?` +
                        `)?)?`)

createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)

// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
              '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
              `(?:${src[t.PRERELEASE]})?` +
              `(?:${src[t.BUILD]})?` +
              `(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)

// Tilde ranges.
// Meaning is "reasonably at or greater than"
createToken('LONETILDE', '(?:~>?)')

createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
exports.tildeTrimReplace = '$1~'

createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)

// Caret ranges.
// Meaning is "at least and backwards compatible with"
createToken('LONECARET', '(?:\\^)')

createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
exports.caretTrimReplace = '$1^'

createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)

// A simple gt/lt/eq thing, or just "" to indicate "any version"
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)

// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
exports.comparatorTrimReplace = '$1$2$3'

// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
                   `\\s+-\\s+` +
                   `(${src[t.XRANGEPLAIN]})` +
                   `\\s*$`)

createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s+-\\s+` +
                        `(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s*$`)

// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
// >=0.0.0 is like a star
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
{
  "name": "semver",
  "version": "7.6.3",
  "description": "The semantic version parser used by npm.",
  "main": "index.js",
  "scripts": {
    "test": "tap",
    "snap": "tap",
    "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
    "postlint": "template-oss-check",
    "lintfix": "npm run lint -- --fix",
    "posttest": "npm run lint",
    "template-oss-apply": "template-oss-apply --force"
  },
  "devDependencies": {
    "@npmcli/eslint-config": "^4.0.0",
    "@npmcli/template-oss": "4.22.0",
    "benchmark": "^2.1.4",
    "tap": "^16.0.0"
  },
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/npm/node-semver.git"
  },
  "bin": {
    "semver": "bin/semver.js"
  },
  "files": [
    "bin/",
    "lib/",
    "classes/",
    "functions/",
    "internal/",
    "ranges/",
    "index.js",
    "preload.js",
    "range.bnf"
  ],
  "tap": {
    "timeout": 30,
    "coverage-map": "map.js",
    "nyc-arg": [
      "--exclude",
      "tap-snapshots/**"
    ]
  },
  "engines": {
    "node": ">=10"
  },
  "author": "GitHub Inc.",
  "templateOSS": {
    "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    "version": "4.22.0",
    "engines": ">=10",
    "distPaths": [
      "classes/",
      "functions/",
      "internal/",
      "ranges/",
      "index.js",
      "preload.js",
      "range.bnf"
    ],
    "allowPaths": [
      "/classes/",
      "/functions/",
      "/internal/",
      "/ranges/",
      "/index.js",
      "/preload.js",
      "/range.bnf",
      "/benchmarks"
    ],
    "publish": "true"
  }
}
// XXX remove in v8 or beyond
module.exports = require('./index.js')
range-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range      ::= hyphen | simple ( ' ' simple ) * | ''
hyphen     ::= partial ' - ' partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr         ::= 'x' | 'X' | '*' | nr
nr         ::= '0' | [1-9] ( [0-9] ) *
tilde      ::= '~' partial
caret      ::= '^' partial
qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= parts
build      ::= parts
parts      ::= part ( '.' part ) *
part       ::= nr | [-0-9A-Za-z]+
// Determine if version is greater than all the versions possible in the range.
const outside = require('./outside')
const gtr = (version, range, options) => outside(version, range, '>', options)
module.exports = gtr
const Range = require('../classes/range')
const intersects = (r1, r2, options) => {
  r1 = new Range(r1, options)
  r2 = new Range(r2, options)
  return r1.intersects(r2, options)
}
module.exports = intersects
const outside = require('./outside')
// Determine if version is less than all the versions possible in the range
const ltr = (version, range, options) => outside(version, range, '<', options)
module.exports = ltr
const SemVer = require('../classes/semver')
const Range = require('../classes/range')

const maxSatisfying = (versions, range, options) => {
  let max = null
  let maxSV = null
  let rangeObj = null
  try {
    rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach((v) => {
    if (rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!max || maxSV.compare(v) === -1) {
        // compare(max, v, true)
        max = v
        maxSV = new SemVer(max, options)
      }
    }
  })
  return max
}
module.exports = maxSatisfying
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const minSatisfying = (versions, range, options) => {
  let min = null
  let minSV = null
  let rangeObj = null
  try {
    rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach((v) => {
    if (rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!min || minSV.compare(v) === 1) {
        // compare(min, v, true)
        min = v
        minSV = new SemVer(min, options)
      }
    }
  })
  return min
}
module.exports = minSatisfying
const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const gt = require('../functions/gt')

const minVersion = (range, loose) => {
  range = new Range(range, loose)

  let minver = new SemVer('0.0.0')
  if (range.test(minver)) {
    return minver
  }

  minver = new SemVer('0.0.0-0')
  if (range.test(minver)) {
    return minver
  }

  minver = null
  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let setMin = null
    comparators.forEach((comparator) => {
      // Clone to avoid manipulating the comparator's semver object.
      const compver = new SemVer(comparator.semver.version)
      switch (comparator.operator) {
        case '>':
          if (compver.prerelease.length === 0) {
            compver.patch++
          } else {
            compver.prerelease.push(0)
          }
          compver.raw = compver.format()
          /* fallthrough */
        case '':
        case '>=':
          if (!setMin || gt(compver, setMin)) {
            setMin = compver
          }
          break
        case '<':
        case '<=':
          /* Ignore maximum versions */
          break
        /* istanbul ignore next */
        default:
          throw new Error(`Unexpected operation: ${comparator.operator}`)
      }
    })
    if (setMin && (!minver || gt(minver, setMin))) {
      minver = setMin
    }
  }

  if (minver && range.test(minver)) {
    return minver
  }

  return null
}
module.exports = minVersion
const SemVer = require('../classes/semver')
const Comparator = require('../classes/comparator')
const { ANY } = Comparator
const Range = require('../classes/range')
const satisfies = require('../functions/satisfies')
const gt = require('../functions/gt')
const lt = require('../functions/lt')
const lte = require('../functions/lte')
const gte = require('../functions/gte')

const outside = (version, range, hilo, options) => {
  version = new SemVer(version, options)
  range = new Range(range, options)

  let gtfn, ltefn, ltfn, comp, ecomp
  switch (hilo) {
    case '>':
      gtfn = gt
      ltefn = lte
      ltfn = lt
      comp = '>'
      ecomp = '>='
      break
    case '<':
      gtfn = lt
      ltefn = gte
      ltfn = gt
      comp = '<'
      ecomp = '<='
      break
    default:
      throw new TypeError('Must provide a hilo val of "<" or ">"')
  }

  // If it satisfies the range it is not outside
  if (satisfies(version, range, options)) {
    return false
  }

  // From now on, variable terms are as if we're in "gtr" mode.
  // but note that everything is flipped for the "ltr" function.

  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let high = null
    let low = null

    comparators.forEach((comparator) => {
      if (comparator.semver === ANY) {
        comparator = new Comparator('>=0.0.0')
      }
      high = high || comparator
      low = low || comparator
      if (gtfn(comparator.semver, high.semver, options)) {
        high = comparator
      } else if (ltfn(comparator.semver, low.semver, options)) {
        low = comparator
      }
    })

    // If the edge version comparator has a operator then our version
    // isn't outside it
    if (high.operator === comp || high.operator === ecomp) {
      return false
    }

    // If the lowest version comparator has an operator and our version
    // is less than it then it isn't higher than the range
    if ((!low.operator || low.operator === comp) &&
        ltefn(version, low.semver)) {
      return false
    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
      return false
    }
  }
  return true
}

module.exports = outside
// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
  const set = []
  let first = null
  let prev = null
  const v = versions.sort((a, b) => compare(a, b, options))
  for (const version of v) {
    const included = satisfies(version, range, options)
    if (included) {
      prev = version
      if (!first) {
        first = version
      }
    } else {
      if (prev) {
        set.push([first, prev])
      }
      prev = null
      first = null
    }
  }
  if (first) {
    set.push([first, null])
  }

  const ranges = []
  for (const [min, max] of set) {
    if (min === max) {
      ranges.push(min)
    } else if (!max && min === v[0]) {
      ranges.push('*')
    } else if (!max) {
      ranges.push(`>=${min}`)
    } else if (min === v[0]) {
      ranges.push(`<=${max}`)
    } else {
      ranges.push(`${min} - ${max}`)
    }
  }
  const simplified = ranges.join(' || ')
  const original = typeof range.raw === 'string' ? range.raw : String(range)
  return simplified.length < original.length ? simplified : range
}
const Range = require('../classes/range.js')
const Comparator = require('../classes/comparator.js')
const { ANY } = Comparator
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')

// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
// - Every simple range `r1, r2, ...` is a null set, OR
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
//   some `R1, R2, ...`
//
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
// - If c is only the ANY comparator
//   - If C is only the ANY comparator, return true
//   - Else if in prerelease mode, return false
//   - else replace c with `[>=0.0.0]`
// - If C is only the ANY comparator
//   - if in prerelease mode, return true
//   - else replace C with `[>=0.0.0]`
// - Let EQ be the set of = comparators in c
// - If EQ is more than one, return true (null set)
// - Let GT be the highest > or >= comparator in c
// - Let LT be the lowest < or <= comparator in c
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
// - If any C is a = range, and GT or LT are set, return false
// - If EQ
//   - If GT, and EQ does not satisfy GT, return true (null set)
//   - If LT, and EQ does not satisfy LT, return true (null set)
//   - If EQ satisfies every C, return true
//   - Else return false
// - If GT
//   - If GT.semver is lower than any > or >= comp in C, return false
//   - If GT is >=, and GT.semver does not satisfy every C, return false
//   - If GT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the GT.semver tuple, return false
// - If LT
//   - If LT.semver is greater than any < or <= comp in C, return false
//   - If LT is <=, and LT.semver does not satisfy every C, return false
//   - If GT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the LT.semver tuple, return false
// - Else return true

const subset = (sub, dom, options = {}) => {
  if (sub === dom) {
    return true
  }

  sub = new Range(sub, options)
  dom = new Range(dom, options)
  let sawNonNull = false

  OUTER: for (const simpleSub of sub.set) {
    for (const simpleDom of dom.set) {
      const isSub = simpleSubset(simpleSub, simpleDom, options)
      sawNonNull = sawNonNull || isSub !== null
      if (isSub) {
        continue OUTER
      }
    }
    // the null set is a subset of everything, but null simple ranges in
    // a complex range should be ignored.  so if we saw a non-null range,
    // then we know this isn't a subset, but if EVERY simple range was null,
    // then it is a subset.
    if (sawNonNull) {
      return false
    }
  }
  return true
}

const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
const minimumVersion = [new Comparator('>=0.0.0')]

const simpleSubset = (sub, dom, options) => {
  if (sub === dom) {
    return true
  }

  if (sub.length === 1 && sub[0].semver === ANY) {
    if (dom.length === 1 && dom[0].semver === ANY) {
      return true
    } else if (options.includePrerelease) {
      sub = minimumVersionWithPreRelease
    } else {
      sub = minimumVersion
    }
  }

  if (dom.length === 1 && dom[0].semver === ANY) {
    if (options.includePrerelease) {
      return true
    } else {
      dom = minimumVersion
    }
  }

  const eqSet = new Set()
  let gt, lt
  for (const c of sub) {
    if (c.operator === '>' || c.operator === '>=') {
      gt = higherGT(gt, c, options)
    } else if (c.operator === '<' || c.operator === '<=') {
      lt = lowerLT(lt, c, options)
    } else {
      eqSet.add(c.semver)
    }
  }

  if (eqSet.size > 1) {
    return null
  }

  let gtltComp
  if (gt && lt) {
    gtltComp = compare(gt.semver, lt.semver, options)
    if (gtltComp > 0) {
      return null
    } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
      return null
    }
  }

  // will iterate one or zero times
  for (const eq of eqSet) {
    if (gt && !satisfies(eq, String(gt), options)) {
      return null
    }

    if (lt && !satisfies(eq, String(lt), options)) {
      return null
    }

    for (const c of dom) {
      if (!satisfies(eq, String(c), options)) {
        return false
      }
    }

    return true
  }

  let higher, lower
  let hasDomLT, hasDomGT
  // if the subset has a prerelease, we need a comparator in the superset
  // with the same tuple and a prerelease, or it's not a subset
  let needDomLTPre = lt &&
    !options.includePrerelease &&
    lt.semver.prerelease.length ? lt.semver : false
  let needDomGTPre = gt &&
    !options.includePrerelease &&
    gt.semver.prerelease.length ? gt.semver : false
  // exception: <1.2.3-0 is the same as <1.2.3
  if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
      lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
    needDomLTPre = false
  }

  for (const c of dom) {
    hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
    hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
    if (gt) {
      if (needDomGTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomGTPre.major &&
            c.semver.minor === needDomGTPre.minor &&
            c.semver.patch === needDomGTPre.patch) {
          needDomGTPre = false
        }
      }
      if (c.operator === '>' || c.operator === '>=') {
        higher = higherGT(gt, c, options)
        if (higher === c && higher !== gt) {
          return false
        }
      } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
        return false
      }
    }
    if (lt) {
      if (needDomLTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomLTPre.major &&
            c.semver.minor === needDomLTPre.minor &&
            c.semver.patch === needDomLTPre.patch) {
          needDomLTPre = false
        }
      }
      if (c.operator === '<' || c.operator === '<=') {
        lower = lowerLT(lt, c, options)
        if (lower === c && lower !== lt) {
          return false
        }
      } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
        return false
      }
    }
    if (!c.operator && (lt || gt) && gtltComp !== 0) {
      return false
    }
  }

  // if there was a < or >, and nothing in the dom, then must be false
  // UNLESS it was limited by another range in the other direction.
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
  if (gt && hasDomLT && !lt && gtltComp !== 0) {
    return false
  }

  if (lt && hasDomGT && !gt && gtltComp !== 0) {
    return false
  }

  // we needed a prerelease range in a specific tuple, but didn't get one
  // then this isn't a subset.  eg >=1.2.3-pre is not a subset of >=1.0.0,
  // because it includes prereleases in the 1.2.3 tuple
  if (needDomGTPre || needDomLTPre) {
    return false
  }

  return true
}

// >=1.2.3 is lower than >1.2.3
const higherGT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp > 0 ? a
    : comp < 0 ? b
    : b.operator === '>' && a.operator === '>=' ? b
    : a
}

// <=1.2.3 is higher than <1.2.3
const lowerLT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp < 0 ? a
    : comp > 0 ? b
    : b.operator === '<' && a.operator === '<=' ? b
    : a
}

module.exports = subset
const Range = require('../classes/range')

// Mostly just for testing and legacy API reasons
const toComparators = (range, options) =>
  new Range(range, options).set
    .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))

module.exports = toComparators
const Range = require('../classes/range')
const validRange = (range, options) => {
  try {
    // Return '*' instead of '' so that truthiness works.
    // This will throw if it's invalid anyway
    return new Range(range, options).range || '*'
  } catch (er) {
    return null
  }
}
module.exports = validRange
semver(1) -- The semantic versioner for npm
===========================================

## Install

```bash
npm install semver
````

## Usage

As a node module:

```js
const semver = require('semver')

semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean('  =v1.2.3   ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```

You can also just load the module for the function that you care about if
you'd like to minimize your footprint.

```js
// load the whole API at once in a single object
const semver = require('semver')

// or just load the bits you need
// all of them listed here, just pick and choose what you want

// classes
const SemVer = require('semver/classes/semver')
const Comparator = require('semver/classes/comparator')
const Range = require('semver/classes/range')

// functions for working with versions
const semverParse = require('semver/functions/parse')
const semverValid = require('semver/functions/valid')
const semverClean = require('semver/functions/clean')
const semverInc = require('semver/functions/inc')
const semverDiff = require('semver/functions/diff')
const semverMajor = require('semver/functions/major')
const semverMinor = require('semver/functions/minor')
const semverPatch = require('semver/functions/patch')
const semverPrerelease = require('semver/functions/prerelease')
const semverCompare = require('semver/functions/compare')
const semverRcompare = require('semver/functions/rcompare')
const semverCompareLoose = require('semver/functions/compare-loose')
const semverCompareBuild = require('semver/functions/compare-build')
const semverSort = require('semver/functions/sort')
const semverRsort = require('semver/functions/rsort')

// low-level comparators between versions
const semverGt = require('semver/functions/gt')
const semverLt = require('semver/functions/lt')
const semverEq = require('semver/functions/eq')
const semverNeq = require('semver/functions/neq')
const semverGte = require('semver/functions/gte')
const semverLte = require('semver/functions/lte')
const semverCmp = require('semver/functions/cmp')
const semverCoerce = require('semver/functions/coerce')

// working with ranges
const semverSatisfies = require('semver/functions/satisfies')
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
const semverMinSatisfying = require('semver/ranges/min-satisfying')
const semverToComparators = require('semver/ranges/to-comparators')
const semverMinVersion = require('semver/ranges/min-version')
const semverValidRange = require('semver/ranges/valid')
const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
const semverSimplifyRange = require('semver/ranges/simplify')
const semverRangeSubset = require('semver/ranges/subset')
```

As a command-line utility:

```
$ semver -h

A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter

Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence

Options:
-r --range <range>
        Print versions that match the specified range.

-i --increment [<level>]
        Increment a version by the specified level.  Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, or prerelease.  Default level is 'patch'.
        Only one version may be specified.

--preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-l --loose
        Interpret versions and ranges loosely

-n <0|1>
        This is the base to be used for the prerelease identifier.

-p --include-prerelease
        Always include prerelease versions in range matching

-c --coerce
        Coerce a string into SemVer if possible
        (does not imply --loose)

--rtl
        Coerce version strings right to left

--ltr
        Coerce version strings left to right (default)

Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.

If no satisfying versions are found, then exits failure.

Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```

## Versions

A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.

A leading `"="` or `"v"` character is stripped off and ignored.

## Ranges

A `version range` is a set of `comparators` that specify versions
that satisfy the range.

A `comparator` is composed of an `operator` and a `version`.  The set
of primitive `operators` is:

* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal.  If no operator is specified, then equality is assumed,
  so this operator is optional but MAY be included.

For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
would match the versions `2.0.0` and `3.1.0`, but not the versions
`1.0.1` or `1.1.0`.

Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.

A range is composed of one or more comparator sets, joined by `||`.  A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.

For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.

The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.

### Prerelease Tags

If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.

For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules.  The version
range only accepts prerelease tags on the `1.2.3` version.
Version `3.4.5` *would* satisfy the range because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.

The purpose of this behavior is twofold.  First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range-matching
semantics.

Second, a user who has opted into using a prerelease version has
indicated the intent to use *that specific* set of
alpha/beta/rc versions.  By including a prerelease tag in the range,
the user is indicating that they are aware of the risk.  However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.

Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for range-matching)
by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.

#### Prerelease Identifiers

The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:

```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```

command-line example:

```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```

Which then can be used to increment further:

```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```

#### Prerelease Identifier Base

The method `.inc` takes an optional parameter 'identifierBase' string
that will let you let your prerelease number as zero-based or one-based.
Set to `false` to omit the prerelease number altogether.
If you do not specify this parameter, it will default to zero-based.

```javascript
semver.inc('1.2.3', 'prerelease', 'beta', '1')
// '1.2.4-beta.1'
```

```javascript
semver.inc('1.2.3', 'prerelease', 'beta', false)
// '1.2.4-beta'
```

command-line example:

```bash
$ semver 1.2.3 -i prerelease --preid beta -n 1
1.2.4-beta.1
```

```bash
$ semver 1.2.3 -i prerelease --preid beta -n false
1.2.4-beta
```

### Advanced Range Syntax

Advanced range syntax desugars to primitive comparators in
deterministic ways.

Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.

#### Hyphen Ranges `X.Y.Z - A.B.C`

Specifies an inclusive set.

* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`

If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.

* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`

If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.

* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`

#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`

Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.

* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
  `includePrerelease` is specified, in which case any version at all
  satisfies)
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)

A partial version range is treated as an X-Range, so the special
character is in fact optional.

* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`

#### Tilde Ranges `~1.2.3` `~1.2` `~1`

Allows patch-level changes if a minor version is specified on the
comparator.  Allows minor-level changes if not.

* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
  the `1.2.3` version will be allowed, if they are greater than or
  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
  `1.2.4-beta.2` would not, because it is a prerelease of a
  different `[major, minor, patch]` tuple.

#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`

Allows changes that do not modify the left-most non-zero element in the
`[major, minor, patch]` tuple.  In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.

Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.

Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`.  It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.

* `^1.2.3` := `>=1.2.3 <2.0.0-0`
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
  the `1.2.3` version will be allowed, if they are greater than or
  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
  `1.2.4-beta.2` would not, because it is a prerelease of a
  different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0`  Note that prereleases in the
  `0.0.3` version *only* will be allowed, if they are greater than or
  equal to `beta`.  So, `0.0.3-pr.2` would be allowed.

When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.

* `^1.2.x` := `>=1.2.0 <2.0.0-0`
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
* `^0.0` := `>=0.0.0 <0.1.0-0`

A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.

* `^1.x` := `>=1.0.0 <2.0.0-0`
* `^0.x` := `>=0.0.0 <1.0.0-0`

### Range Grammar

Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:

```bnf
range-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range      ::= hyphen | simple ( ' ' simple ) * | ''
hyphen     ::= partial ' - ' partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr         ::= 'x' | 'X' | '*' | nr
nr         ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde      ::= '~' partial
caret      ::= '^' partial
qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= parts
build      ::= parts
parts      ::= part ( '.' part ) *
part       ::= nr | [-0-9A-Za-z]+
```

## Functions

All methods and classes take a final `options` object argument.  All
options in this object are `false` by default.  The options supported
are:

- `loose`: Be more forgiving about not-quite-valid semver strings.
  (Any resulting output will always be 100% strict compliant, of
  course.)  For backwards compatibility reasons, if the `options`
  argument is a boolean value instead of an object, it is interpreted
  to be the `loose` param.
- `includePrerelease`: Set to suppress the [default
  behavior](https://github.com/npm/node-semver#prerelease-tags) of
  excluding prerelease tagged versions from ranges unless they are
  explicitly opted into.

Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.

* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, release, options, identifier, identifierBase)`: 
  Return the version incremented by the release
  type (`major`, `premajor`, `minor`, `preminor`, `patch`,
  `prepatch`, or `prerelease`), or null if it's not valid
  * `premajor` in one call will bump the version up to the next major
    version and down to a prerelease of that major version.
    `preminor`, and `prepatch` work the same way.
  * If called from a non-prerelease version, `prerelease` will work the
    same as `prepatch`. It increments the patch version and then makes a
    prerelease. If the input version is already a prerelease it simply
    increments it.
  * `identifier` can be used to prefix `premajor`, `preminor`,
    `prepatch`, or `prerelease` version increments. `identifierBase`
    is the base to be used for the `prerelease` identifier.
* `prerelease(v)`: Returns an array of prerelease components, or null
  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
  or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
  a `SemVer` object or `null`.

### Comparison

* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
  even if they're not the same string.  You already know how to
  compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
  the corresponding function above.  `"==="` and `"!=="` do simple
  string comparison, but are included for completeness.  Throws if an
  invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
  `v2` is greater.  Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of `compare`.  Sorts an array of versions
  in descending order when passed to `Array.sort()`.
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
  are equal.  Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type
  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
  or null if the versions are the same.

### Sorting

* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` 
  function.
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
  the `compareBuild` function in descending order.

### Comparators

* `intersects(comparator)`: Return true if the comparators intersect

### Ranges

* `validRange(range)`: Return the valid range or null if it's not valid
* `satisfies(version, range)`: Return true if the version satisfies the
  range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
  that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
  that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can match
  the given range.
* `gtr(version, range)`: Return `true` if the version is greater than all the
  versions possible in the range.
* `ltr(version, range)`: Return `true` if the version is less than all the
  versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
  the bounds of the range in either the high or low direction.  The
  `hilo` argument must be either the string `'>'` or `'<'`.  (This is
  the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the range comparators intersect.
* `simplifyRange(versions, range)`: Return a "simplified" range that
  matches the same items in the `versions` list as the range specified.  Note
  that it does *not* guarantee that it would match the same versions in all
  cases, only for the set of versions provided.  This is useful when
  generating ranges by joining together multiple versions with `||`
  programmatically, to provide the user with something a bit more
  ergonomic.  If the provided range is shorter in string-length than the
  generated range, then that is returned.
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
  entirely contained by the `superRange` range.

Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range!  For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.

If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.

### Coercion

* `coerce(version, options)`: Coerces a string to semver if possible

This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters).  Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).  All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`).  Only text which lacks digits will fail coercion (`version one`
is not valid).  The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`).  The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).

If the `options.rtl` flag is set, then `coerce` will return the right-most
coercible tuple that does not share an ending index with a longer coercible
tuple.  For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
`4.0.0`.  `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
any other overlapping SemVer tuple.

If the `options.includePrerelease` flag is set, then the `coerce` result will contain
prerelease and build parts of a version.  For example, `1.2.3.4-rc.1+rev.2`
will preserve prerelease `rc.1` and build `rev.2` in the result.

### Clean

* `clean(version)`: Clean a string to be a valid semver if possible

This will return a cleaned and trimmed semver version. If the provided
version is not valid a null will be returned. This does not work for
ranges.

ex.
* `s.clean(' = v 2.1.5foo')`: `null`
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean(' = v 2.1.5-foo')`: `null`
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean('=v2.1.5')`: `'2.1.5'`
* `s.clean('  =v2.1.5')`: `'2.1.5'`
* `s.clean('      2.1.5   ')`: `'2.1.5'`
* `s.clean('~1.0.0')`: `null`

## Constants

As a convenience, helper constants are exported to provide information about what `node-semver` supports:

### `RELEASE_TYPES`

- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease

```
const semver = require('semver');

if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
  console.log('This is a valid release type!');
} else {
  console.warn('This is NOT a valid release type!');
}
```

### `SEMVER_SPEC_VERSION`

2.0.0

```
const semver = require('semver');

console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
```

## Exported Modules

<!--
TODO: Make sure that all of these items are documented (classes aren't,
eg), and then pull the module name into the documentation for that specific
thing.
-->

You may pull in just the part of this semver utility that you need if you
are sensitive to packing and tree-shaking concerns.  The main
`require('semver')` export uses getter functions to lazily load the parts
of the API that are used.

The following modules are available:

* `require('semver')`
* `require('semver/classes')`
* `require('semver/classes/comparator')`
* `require('semver/classes/range')`
* `require('semver/classes/semver')`
* `require('semver/functions/clean')`
* `require('semver/functions/cmp')`
* `require('semver/functions/coerce')`
* `require('semver/functions/compare')`
* `require('semver/functions/compare-build')`
* `require('semver/functions/compare-loose')`
* `require('semver/functions/diff')`
* `require('semver/functions/eq')`
* `require('semver/functions/gt')`
* `require('semver/functions/gte')`
* `require('semver/functions/inc')`
* `require('semver/functions/lt')`
* `require('semver/functions/lte')`
* `require('semver/functions/major')`
* `require('semver/functions/minor')`
* `require('semver/functions/neq')`
* `require('semver/functions/parse')`
* `require('semver/functions/patch')`
* `require('semver/functions/prerelease')`
* `require('semver/functions/rcompare')`
* `require('semver/functions/rsort')`
* `require('semver/functions/satisfies')`
* `require('semver/functions/sort')`
* `require('semver/functions/valid')`
* `require('semver/ranges/gtr')`
* `require('semver/ranges/intersects')`
* `require('semver/ranges/ltr')`
* `require('semver/ranges/max-satisfying')`
* `require('semver/ranges/min-satisfying')`
* `require('semver/ranges/min-version')`
* `require('semver/ranges/outside')`
* `require('semver/ranges/simplify')`
* `require('semver/ranges/subset')`
* `require('semver/ranges/to-comparators')`
* `require('semver/ranges/valid')`

/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.import tslib from '../tslib.js';
const {
    __extends,
    __assign,
    __rest,
    __decorate,
    __param,
    __metadata,
    __awaiter,
    __generator,
    __exportStar,
    __createBinding,
    __values,
    __read,
    __spread,
    __spreadArrays,
    __await,
    __asyncGenerator,
    __asyncDelegator,
    __asyncValues,
    __makeTemplateObject,
    __importStar,
    __importDefault,
    __classPrivateFieldGet,
    __classPrivateFieldSet,
} = tslib;
export {
    __extends,
    __assign,
    __rest,
    __decorate,
    __param,
    __metadata,
    __awaiter,
    __generator,
    __exportStar,
    __createBinding,
    __values,
    __read,
    __spread,
    __spreadArrays,
    __await,
    __asyncGenerator,
    __asyncDelegator,
    __asyncValues,
    __makeTemplateObject,
    __importStar,
    __importDefault,
    __classPrivateFieldGet,
    __classPrivateFieldSet,
};
{
    "type": "module"
}{
    "name": "tslib",
    "author": "Microsoft Corp.",
    "homepage": "https://www.typescriptlang.org/",
    "version": "1.14.1",
    "license": "0BSD",
    "description": "Runtime library for TypeScript helper functions",
    "keywords": [
        "TypeScript",
        "Microsoft",
        "compiler",
        "language",
        "javascript",
        "tslib",
        "runtime"
    ],
    "bugs": {
        "url": "https://github.com/Microsoft/TypeScript/issues"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/Microsoft/tslib.git"
    },
    "main": "tslib.js",
    "module": "tslib.es6.js",
    "jsnext:main": "tslib.es6.js",
    "typings": "tslib.d.ts",
    "sideEffects": false,
    "exports": {
        ".": {
            "module": "./tslib.es6.js",
            "import": "./modules/index.js",
            "default": "./tslib.js"
        },
        "./": "./"
    }
}
# tslib

This is a runtime library for [TypeScript](http://www.typescriptlang.org/) that contains all of the TypeScript helper functions.

This library is primarily used by the `--importHelpers` flag in TypeScript.
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:

```ts
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
exports.x = {};
exports.y = __assign({}, exports.x);

```

will instead be emitted as something like the following:

```ts
var tslib_1 = require("tslib");
exports.x = {};
exports.y = tslib_1.__assign({}, exports.x);
```

Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.

# Installing

For the latest stable version, run:

## npm

```sh
# TypeScript 2.3.3 or later
npm install tslib

# TypeScript 2.3.2 or earlier
npm install tslib@1.6.1
```

## yarn

```sh
# TypeScript 2.3.3 or later
yarn add tslib

# TypeScript 2.3.2 or earlier
yarn add tslib@1.6.1
```

## bower

```sh
# TypeScript 2.3.3 or later
bower install tslib

# TypeScript 2.3.2 or earlier
bower install tslib@1.6.1
```

## JSPM

```sh
# TypeScript 2.3.3 or later
jspm install tslib

# TypeScript 2.3.2 or earlier
jspm install tslib@1.6.1
```

# Usage

Set the `importHelpers` compiler option on the command line:

```
tsc --importHelpers file.ts
```

or in your tsconfig.json:

```json
{
    "compilerOptions": {
        "importHelpers": true
    }
}
```

#### For bower and JSPM users

You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:

```json
{
    "compilerOptions": {
        "module": "amd",
        "importHelpers": true,
        "baseUrl": "./",
        "paths": {
            "tslib" : ["bower_components/tslib/tslib.d.ts"]
        }
    }
}
```

For JSPM users:

```json
{
    "compilerOptions": {
        "module": "system",
        "importHelpers": true,
        "baseUrl": "./",
        "paths": {
            "tslib" : ["jspm_packages/npm/tslib@1.[version].0/tslib.d.ts"]
        }
    }
}
```


# Contribute

There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.

* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).

# Documentation

* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
* [Programming handbook](http://www.typescriptlang.org/Handbook)
* [Homepage](http://www.typescriptlang.org/)
// When on node 14, it validates that all of the commonjs exports
// are correctly re-exported for es modules importers.

const nodeMajor = Number(process.version.split(".")[0].slice(1))
if (nodeMajor < 14) {
  console.log("Skipping because node does not support module exports.")
  process.exit(0)
}

// ES Modules import via the ./modules folder
import * as esTSLib from "../../modules/index.js"

// Force a commonjs resolve
import { createRequire } from "module";
const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js");

for (const key in commonJSTSLib) {
  if (commonJSTSLib.hasOwnProperty(key)) {
    if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in  ./modules/index.js`)
  }
}

console.log("All exports in commonjs are available for es module consumers.")
{
  "type": "module",
  "scripts": {
    "test": "node index.js"
  }
}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
export declare function __extends(d: Function, b: Function): void;
export declare function __assign(t: any, ...sources: any[]): any;
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
export declare function __param(paramIndex: number, decorator: Function): Function;
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
export declare function __generator(thisArg: any, body: Function): any;
export declare function __exportStar(m: any, exports: any): void;
export declare function __values(o: any): any;
export declare function __read(o: any, n?: number): any[];
export declare function __spread(...args: any[][]): any[];
export declare function __spreadArrays(...args: any[][]): any[];
export declare function __await(v: any): any;
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
export declare function __asyncDelegator(o: any): any;
export declare function __asyncValues(o: any): any;
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
export declare function __importStar<T>(mod: T): T;
export declare function __importDefault<T>(mod: T): T | { default: T };
export declare function __classPrivateFieldGet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V;
export declare function __classPrivateFieldSet<T extends object, V>(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V;
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;<script src="tslib.es6.js"></script>/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

export function __extends(d, b) {
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

export var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    }
    return __assign.apply(this, arguments);
}

export function __rest(s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
}

export function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

export function __param(paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
}

export function __metadata(metadataKey, metadataValue) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}

export function __awaiter(thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
}

export function __generator(thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
}

export function __createBinding(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}

export function __exportStar(m, exports) {
    for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
}

export function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

export function __read(o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
}

export function __spread() {
    for (var ar = [], i = 0; i < arguments.length; i++)
        ar = ar.concat(__read(arguments[i]));
    return ar;
}

export function __spreadArrays() {
    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
    for (var r = Array(s), k = 0, i = 0; i < il; i++)
        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
            r[k] = a[j];
    return r;
};

export function __await(v) {
    return this instanceof __await ? (this.v = v, this) : new __await(v);
}

export function __asyncGenerator(thisArg, _arguments, generator) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var g = generator.apply(thisArg, _arguments || []), i, q = [];
    return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
    function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
    function fulfill(value) { resume("next", value); }
    function reject(value) { resume("throw", value); }
    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}

export function __asyncDelegator(o) {
    var i, p;
    return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}

export function __asyncValues(o) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var m = o[Symbol.asyncIterator], i;
    return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}

export function __makeTemplateObject(cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};

export function __importStar(mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result.default = mod;
    return result;
}

export function __importDefault(mod) {
    return (mod && mod.__esModule) ? mod : { default: mod };
}

export function __classPrivateFieldGet(receiver, privateMap) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to get private field on non-instance");
    }
    return privateMap.get(receiver);
}

export function __classPrivateFieldSet(receiver, privateMap, value) {
    if (!privateMap.has(receiver)) {
        throw new TypeError("attempted to set private field on non-instance");
    }
    privateMap.set(receiver, value);
    return value;
}
<script src="tslib.js"></script>/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

/* global global, define, System, Reflect, Promise */
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __spreadArrays;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
var __classPrivateFieldGet;
var __classPrivateFieldSet;
var __createBinding;
(function (factory) {
    var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
    if (typeof define === "function" && define.amd) {
        define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
    }
    else if (typeof module === "object" && typeof module.exports === "object") {
        factory(createExporter(root, createExporter(module.exports)));
    }
    else {
        factory(createExporter(root));
    }
    function createExporter(exports, previous) {
        if (exports !== root) {
            if (typeof Object.create === "function") {
                Object.defineProperty(exports, "__esModule", { value: true });
            }
            else {
                exports.__esModule = true;
            }
        }
        return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
    }
})
(function (exporter) {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };

    __extends = function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };

    __assign = Object.assign || function (t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    };

    __rest = function (s, e) {
        var t = {};
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
            t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    };

    __decorate = function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };

    __param = function (paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); }
    };

    __metadata = function (metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
    };

    __awaiter = function (thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
            function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    };

    __generator = function (thisArg, body) {
        var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f) throw new TypeError("Generator is already executing.");
            while (_) try {
                if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
                if (y = 0, t) op = [op[0] & 2, t.value];
                switch (op[0]) {
                    case 0: case 1: t = op; break;
                    case 4: _.label++; return { value: op[1], done: false };
                    case 5: _.label++; y = op[1]; op = [0]; continue;
                    case 7: op = _.ops.pop(); _.trys.pop(); continue;
                    default:
                        if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                        if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                        if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                        if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                        if (t[2]) _.ops.pop();
                        _.trys.pop(); continue;
                }
                op = body.call(thisArg, _);
            } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
            if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
        }
    };

    __createBinding = function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
    };

    __exportStar = function (m, exports) {
        for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
    };

    __values = function (o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m) return m.call(o);
        if (o && typeof o.length === "number") return {
            next: function () {
                if (o && i >= o.length) o = void 0;
                return { value: o && o[i++], done: !o };
            }
        };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    };

    __read = function (o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m) return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
        }
        catch (error) { e = { error: error }; }
        finally {
            try {
                if (r && !r.done && (m = i["return"])) m.call(i);
            }
            finally { if (e) throw e.error; }
        }
        return ar;
    };

    __spread = function () {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    };

    __spreadArrays = function () {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    };

    __await = function (v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    };

    __asyncGenerator = function (thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);  }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
    };

    __asyncDelegator = function (o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    };

    __asyncValues = function (o) {
        if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
    };

    __makeTemplateObject = function (cooked, raw) {
        if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
        return cooked;
    };

    __importStar = function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
        result["default"] = mod;
        return result;
    };

    __importDefault = function (mod) {
        return (mod && mod.__esModule) ? mod : { "default": mod };
    };

    __classPrivateFieldGet = function (receiver, privateMap) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to get private field on non-instance");
        }
        return privateMap.get(receiver);
    };

    __classPrivateFieldSet = function (receiver, privateMap, value) {
        if (!privateMap.has(receiver)) {
            throw new TypeError("attempted to set private field on non-instance");
        }
        privateMap.set(receiver, value);
        return value;
    };

    exporter("__extends", __extends);
    exporter("__assign", __assign);
    exporter("__rest", __rest);
    exporter("__decorate", __decorate);
    exporter("__param", __param);
    exporter("__metadata", __metadata);
    exporter("__awaiter", __awaiter);
    exporter("__generator", __generator);
    exporter("__exportStar", __exportStar);
    exporter("__createBinding", __createBinding);
    exporter("__values", __values);
    exporter("__read", __read);
    exporter("__spread", __spread);
    exporter("__spreadArrays", __spreadArrays);
    exporter("__await", __await);
    exporter("__asyncGenerator", __asyncGenerator);
    exporter("__asyncDelegator", __asyncDelegator);
    exporter("__asyncValues", __asyncValues);
    exporter("__makeTemplateObject", __makeTemplateObject);
    exporter("__importStar", __importStar);
    exporter("__importDefault", __importDefault);
    exporter("__classPrivateFieldGet", __classPrivateFieldGet);
    exporter("__classPrivateFieldSet", __classPrivateFieldSet);
});
// Basic
export * from './source/primitive';
export * from './source/typed-array';
export * from './source/basic';
export * from './source/observable-like';

// Utilities
export {Except} from './source/except';
export {Mutable} from './source/mutable';
export {Writable} from './source/writable';
export {Merge} from './source/merge';
export {MergeExclusive} from './source/merge-exclusive';
export {RequireAtLeastOne} from './source/require-at-least-one';
export {RequireExactlyOne} from './source/require-exactly-one';
export {RequireAllOrNone} from './source/require-all-or-none';
export {RemoveIndexSignature} from './source/remove-index-signature';
export {PartialDeep, PartialDeepOptions} from './source/partial-deep';
export {PartialOnUndefinedDeep, PartialOnUndefinedDeepOptions} from './source/partial-on-undefined-deep';
export {ReadonlyDeep} from './source/readonly-deep';
export {LiteralUnion} from './source/literal-union';
export {Promisable} from './source/promisable';
export {Opaque, UnwrapOpaque} from './source/opaque';
export {InvariantOf} from './source/invariant-of';
export {SetOptional} from './source/set-optional';
export {SetRequired} from './source/set-required';
export {SetNonNullable} from './source/set-non-nullable';
export {ValueOf} from './source/value-of';
export {PromiseValue} from './source/promise-value';
export {AsyncReturnType} from './source/async-return-type';
export {ConditionalExcept} from './source/conditional-except';
export {ConditionalKeys} from './source/conditional-keys';
export {ConditionalPick} from './source/conditional-pick';
export {UnionToIntersection} from './source/union-to-intersection';
export {Stringified} from './source/stringified';
export {FixedLengthArray} from './source/fixed-length-array';
export {MultidimensionalArray} from './source/multidimensional-array';
export {MultidimensionalReadonlyArray} from './source/multidimensional-readonly-array';
export {IterableElement} from './source/iterable-element';
export {Entry} from './source/entry';
export {Entries} from './source/entries';
export {SetReturnType} from './source/set-return-type';
export {Asyncify} from './source/asyncify';
export {Simplify, SimplifyOptions} from './source/simplify';
export {Jsonify} from './source/jsonify';
export {Schema} from './source/schema';
export {LiteralToPrimitive} from './source/literal-to-primitive';
export {
	PositiveInfinity,
	NegativeInfinity,
	Finite,
	Integer,
	Float,
	NegativeFloat,
	Negative,
	NonNegative,
	NegativeInteger,
	NonNegativeInteger,
} from './source/numeric';
export {StringKeyOf} from './source/string-key-of';
export {Exact} from './source/exact';
export {ReadonlyTuple} from './source/readonly-tuple';
export {OptionalKeysOf} from './source/optional-keys-of';
export {HasOptionalKeys} from './source/has-optional-keys';
export {RequiredKeysOf} from './source/required-keys-of';
export {HasRequiredKeys} from './source/has-required-keys';
export {Spread} from './source/spread';

// Template literal types
export {CamelCase} from './source/camel-case';
export {CamelCasedProperties} from './source/camel-cased-properties';
export {CamelCasedPropertiesDeep} from './source/camel-cased-properties-deep';
export {KebabCase} from './source/kebab-case';
export {KebabCasedProperties} from './source/kebab-cased-properties';
export {KebabCasedPropertiesDeep} from './source/kebab-cased-properties-deep';
export {PascalCase} from './source/pascal-case';
export {PascalCasedProperties} from './source/pascal-cased-properties';
export {PascalCasedPropertiesDeep} from './source/pascal-cased-properties-deep';
export {SnakeCase} from './source/snake-case';
export {SnakeCasedProperties} from './source/snake-cased-properties';
export {SnakeCasedPropertiesDeep} from './source/snake-cased-properties-deep';
export {ScreamingSnakeCase} from './source/screaming-snake-case';
export {DelimiterCase} from './source/delimiter-case';
export {DelimiterCasedProperties} from './source/delimiter-cased-properties';
export {DelimiterCasedPropertiesDeep} from './source/delimiter-cased-properties-deep';
export {Join} from './source/join';
export {Split} from './source/split';
export {Trim} from './source/trim';
export {Replace} from './source/replace';
export {Includes} from './source/includes';
export {Get} from './source/get';
export {LastArrayElement} from './source/last-array-element';

// Miscellaneous
export {PackageJson} from './source/package-json';
export {TsConfigJson} from './source/tsconfig-json';
{
	"name": "type-fest",
	"version": "2.19.0",
	"description": "A collection of essential TypeScript types",
	"license": "(MIT OR CC0-1.0)",
	"repository": "sindresorhus/type-fest",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=12.20"
	},
	"scripts": {
		"test": "xo && tsd && tsc && node script/test/source-files-extension.js"
	},
	"files": [
		"index.d.ts",
		"source"
	],
	"keywords": [
		"typescript",
		"ts",
		"types",
		"utility",
		"util",
		"utilities",
		"omit",
		"merge",
		"json"
	],
	"devDependencies": {
		"@sindresorhus/tsconfig": "~0.7.0",
		"expect-type": "^0.13.0",
		"tsd": "^0.20.0",
		"typescript": "^4.6.3",
		"xo": "^0.43.0"
	},
	"types": "./index.d.ts",
	"xo": {
		"rules": {
			"@typescript-eslint/ban-types": "off",
			"@typescript-eslint/indent": "off",
			"node/no-unsupported-features/es-builtins": "off",
			"import/extensions": "off",
			"@typescript-eslint/no-redeclare": "off",
			"@typescript-eslint/no-confusing-void-expression": "off"
		}
	}
}
<div align="center">
	<br>
	<br>
	<img src="media/logo.svg" alt="type-fest" height="300">
	<br>
	<br>
	<b>A collection of essential TypeScript types</b>
	<br>
	<br>
	<br>
	<br>
	<hr>
	<div align="center">
		<p>
			<p>
				<sup>
					<a href="https://github.com/sponsors/sindresorhus">Sindre Sorhus' open source work is supported by the community</a>
				</sup>
			</p>
			<sup>Special thanks to:</sup>
			<br>
			<br>
			<a href="https://standardresume.co/tech">
				<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="180"/>
			</a>
			<br>
			<br>
			<br>
			<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=type-fest&utm_source=github">
				<div>
					<img src="https://sindresorhus.com/assets/thanks/workos-logo-white-bg.svg" width="220" alt="WorkOS">
				</div>
				<b>Your app, enterprise-ready.</b>
				<div>
					<sub>Start selling to enterprise customers with just a few lines of code.</sub>
					<br>
					<sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
				</div>
			</a>
			<br>
			<br>
			<br>
			<a href="https://www.useanvil.com/?utm_source=sindresorhus#gh-light-mode-only">
				<div>
					<img src="https://sindresorhus.com/assets/thanks/anvil-logo-light.svg" width="200" alt="Anvil">
				</div>
				<br>
				<b>Paperwork that makes the data work.</b>
				<div>
					<sub>
					Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
					<br>
					The easiest way to build paperwork automation into your product.
					</sub>
				</div>
			</a>
			<a href="https://www.useanvil.com/?utm_source=sindresorhus#gh-dark-mode-only">
				<div>
					<img src="https://sindresorhus.com/assets/thanks/anvil-logo-dark.svg" width="200" alt="Anvil">
				</div>
				<br>
				<b>Paperwork that makes the data work.</b>
				<div>
					<sub>
					Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
					<br>
					The easiest way to build paperwork automation into your product.
					</sub>
				</div>
			</a>
		</p>
	</div>
	<br>
	<hr>
</div>
<br>
<br>

[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://giphy.com/gifs/illustration-rainbow-unicorn-26AHG5KGFxSkUWw1i)
[![npm dependents](https://badgen.net/npm/dependents/type-fest)](https://www.npmjs.com/package/type-fest?activeTab=dependents)
[![npm downloads](https://badgen.net/npm/dt/type-fest)](https://www.npmjs.com/package/type-fest)
[![Docs](https://paka.dev/badges/v0/cute.svg)](https://paka.dev/npm/type-fest)

Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/main/CONTRIBUTING.md).

Either add this package as a dependency or copy-paste the needed types. No credit required. 👌

PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first.

**Help wanted with reviewing [proposals](https://github.com/sindresorhus/type-fest/issues) and [pull requests](https://github.com/sindresorhus/type-fest/pulls).**

## Install

```sh
npm install type-fest
```

*Requires TypeScript >=4.2*

## Usage

```ts
import type {Except} from 'type-fest';

type Foo = {
	unicorn: string;
	rainbow: boolean;
};

type FooWithoutRainbow = Except<Foo, 'rainbow'>;
//=> {unicorn: string}
```

## API

Click the type names for complete docs.

### Basic

- [`Primitive`](source/primitive.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
- [`Class`](source/basic.d.ts) - Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
- [`Constructor`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
- [`TypedArray`](source/typed-array.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
- [`ObservableLike`](source/observable-like.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).

### Utilities

- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys).
- [`Writable`](source/writable.d.ts) - Create a type that strips `readonly` from all or some of an object's keys. The inverse of `Readonly<T>`. Formerly named `Mutable`.
- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type.
- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys.
- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys.
- [`RequireExactlyOne`](source/require-exactly-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more.
- [`RequireAllOrNone`](source/require-all-or-none.d.ts) - Create a type that requires all of the given keys or none of the given keys.
- [`RemoveIndexSignature`](source/remove-index-signature.d.ts) - Create a type that only has explicitly defined properties, absent of any index signatures.
- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) if you only need one level deep.
- [`PartialOnUndefinedDeep`](source/partial-on-undefined-deep.d.ts) - Create a deep version of another type where all keys accepting `undefined` type are set to optional.
- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype) if you only need one level deep.
- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729).
- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/).
- [`UnwrapOpaque`](source/opaque.d.ts) - Revert an [opaque type](https://codemix.com/opaque-types-in-javascript/) back to its original type.
- [`InvariantOf`](source/invariant-of.d.ts) - Create an [invariant type](https://basarat.gitbook.io/typescript/type-system/type-compatibility#footnote-invariance), which is a type that does not accept supertypes and subtypes.
- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional.
- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required.
- [`SetNonNullable`](source/set-non-nullable.d.ts) - Create a type that makes the given keys non-nullable.
- [`ValueOf`](source/value-of.d.ts) - Create a union of the given object's values, and optionally specify which keys to get the values from.
- [`ConditionalKeys`](source/conditional-keys.d.ts) - Extract keys from a shape where values extend the given `Condition` type.
- [`ConditionalPick`](source/conditional-pick.d.ts) - Like `Pick` except it selects properties from a shape where the values extend the given `Condition` type.
- [`ConditionalExcept`](source/conditional-except.d.ts) - Like `Omit` except it removes properties from a shape where the values extend the given `Condition` type.
- [`UnionToIntersection`](source/union-to-intersection.d.ts) - Convert a union type to an intersection type.
- [`LiteralToPrimitive`](source/literal-to-primitive.d.ts) - Convert a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types) to the [primitive type](source/primitive.d.ts) it belongs to.
- [`Stringified`](source/stringified.d.ts) - Create a type with the keys of the given type changed to `string` type.
- [`IterableElement`](source/iterable-element.d.ts) - Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.
- [`Entry`](source/entry.d.ts) - Create a type that represents the type of an entry of a collection.
- [`Entries`](source/entries.d.ts) - Create a type that represents the type of the entries of a collection.
- [`SetReturnType`](source/set-return-type.d.ts) - Create a function type with a return type of your choice and the same parameters as the given function type.
- [`Simplify`](source/simplify.d.ts) - Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
- [`Get`](source/get.d.ts) - Get a deeply-nested property from an object using a key path, like [Lodash's `.get()`](https://lodash.com/docs/latest#get) function.
- [`StringKeyOf`](source/string-key-of.d.ts) - Get keys of the given type as strings.
- [`Schema`](source/schema.d.ts) - Create a deep version of another object type where property values are recursively replaced into a given value type.
- [`Exact`](source/exact.d.ts) - Create a type that does not allow extra properties.
- [`OptionalKeysOf`](source/optional-keys-of.d.ts) - Extract all optional keys from the given type.
- [`HasOptionalKeys`](source/has-optional-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any optional fields.
- [`RequiredKeysOf`](source/required-keys-of.d.ts) - Extract all required keys from the given type.
- [`HasRequiredKeys`](source/has-required-keys.d.ts) - Create a `true`/`false` type depending on whether the given type has any required fields.
- [`Spread`](source/spread.d.ts) - Mimic the type inferred by TypeScript when merging two objects or two arrays/tuples using the spread syntax.

### JSON

- [`Jsonify`](source/jsonify.d.ts) - Transform a type to one that is assignable to the `JsonValue` type.
- [`JsonPrimitive`](source/basic.d.ts) - Matches a JSON primitive.
- [`JsonObject`](source/basic.d.ts) - Matches a JSON object.
- [`JsonArray`](source/basic.d.ts) - Matches a JSON array.
- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value.

### Async

- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`.
- [`AsyncReturnType`](source/async-return-type.d.ts) - Unwrap the return type of a function that returns a `Promise`.
- [`Asyncify`](source/asyncify.d.ts) - Create an async version of the given function type.

### String

- [`Trim`](source/trim.d.ts) - Remove leading and trailing spaces from a string.
- [`Split`](source/split.d.ts) - Represents an array of strings split using a given character or character set.
- [`Replace`](source/replace.d.ts) - Represents a string with some or all matches replaced by a replacement.

### Array

- [`Includes`](source/includes.d.ts) - Returns a boolean for whether the given array includes the given item.
- [`Join`](source/join.d.ts) - Join an array of strings and/or numbers using the given string as a delimiter.
- [`LastArrayElement`](source/last-array-element.d.ts) - Extracts the type of the last element of an array.
- [`FixedLengthArray`](source/fixed-length-array.d.ts) - Create a type that represents an array of the given type and length.
- [`MultidimensionalArray`](source/multidimensional-array.d.ts) - Create a type that represents a multidimensional array of the given type and dimensions.
- [`MultidimensionalReadonlyArray`](source/multidimensional-readonly-array.d.ts) - Create a type that represents a multidimensional readonly array of the given type and dimensions.
- [`ReadonlyTuple`](source/readonly-tuple.d.ts) - Create a type that represents a read-only tuple of the given type and length.

### Numeric

- [`PositiveInfinity`](source/numeric.d.ts) - Matches the hidden `Infinity` type.
- [`NegativeInfinity`](source/numeric.d.ts) - Matches the hidden `-Infinity` type.
- [`Finite`](source/numeric.d.ts) - A finite `number`.
- [`Integer`](source/numeric.d.ts) - A `number` that is an integer.
- [`Float`](source/numeric.d.ts) - A `number` that is not an integer.
- [`NegativeFloat`](source/numeric.d.ts) - A negative (`-∞ < x < 0`) `number` that is not an integer.
- [`Negative`](source/numeric.d.ts) - A negative `number`/`bigint` (`-∞ < x < 0`)
- [`NonNegative`](source/numeric.d.ts) - A non-negative `number`/`bigint` (`0 <= x < ∞`).
- [`NegativeInteger`](source/numeric.d.ts) - A negative (`-∞ < x < 0`) `number` that is an integer.
- [`NonNegativeInteger`](source/numeric.d.ts) - A non-negative (`0 <= x < ∞`) `number` that is an integer.

### Change case

- [`CamelCase`](source/camel-case.d.ts) - Convert a string literal to camel-case (`fooBar`).
- [`CamelCasedProperties`](source/camel-cased-properties.d.ts) - Convert object properties to camel-case (`fooBar`).
- [`CamelCasedPropertiesDeep`](source/camel-cased-properties-deep.d.ts) - Convert object properties to camel-case recursively (`fooBar`).
- [`KebabCase`](source/kebab-case.d.ts) - Convert a string literal to kebab-case (`foo-bar`).
- [`KebabCasedProperties`](source/kebab-cased-properties.d.ts) - Convert a object properties to kebab-case recursively (`foo-bar`).
- [`KebabCasedPropertiesDeep`](source/kebab-cased-properties-deep.d.ts) - Convert object properties to kebab-case (`foo-bar`).
- [`PascalCase`](source/pascal-case.d.ts) - Converts a string literal to pascal-case (`FooBar`)
- [`PascalCasedProperties`](source/pascal-cased-properties.d.ts) - Converts object properties to pascal-case (`FooBar`)
- [`PascalCasedPropertiesDeep`](source/pascal-cased-properties-deep.d.ts) - Converts object properties to pascal-case (`FooBar`)
- [`SnakeCase`](source/snake-case.d.ts) - Convert a string literal to snake-case (`foo_bar`).
- [`SnakeCasedProperties`](source/snake-cased-properties-deep.d.ts) - Convert object properties to snake-case (`foo_bar`).
- [`SnakeCasedPropertiesDeep`](source/snake-cased-properties-deep.d.ts) - Convert object properties to snake-case recursively (`foo_bar`).
- [`ScreamingSnakeCase`](source/screaming-snake-case.d.ts) - Convert a string literal to screaming-snake-case (`FOO_BAR`).
- [`DelimiterCase`](source/delimiter-case.d.ts) - Convert a string literal to a custom string delimiter casing.
- [`DelimiterCasedProperties`](source/delimiter-cased-properties.d.ts) - Convert object properties to a custom string delimiter casing.
- [`DelimiterCasedPropertiesDeep`](source/delimiter-cased-properties-deep.d.ts) - Convert object properties to a custom string delimiter casing recursively.

### Miscellaneous

- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). It also includes support for [TypeScript Declaration Files](https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) and [Yarn Workspaces](https://classic.yarnpkg.com/lang/en/docs/workspaces/).
- [`TsConfigJson`](source/tsconfig-json.d.ts) - Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 4.4).

## Declined types

*If we decline a type addition, we will make sure to document the better solution here.*

- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The pull request author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider.
- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary<number>` vs `Record<string, number>`) from [`Record`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now.
- [`ExtractProperties` and `ExtractMethods`](https://github.com/sindresorhus/type-fest/pull/4) - The types violate the single responsibility principle. Instead, refine your types into more granular type hierarchies.
- [`Url2Json`](https://github.com/sindresorhus/type-fest/pull/262) - Inferring search parameters from a URL string is a cute idea, but not very useful in practice, since search parameters are usually dynamic and defined separately.
- [`Nullish`](https://github.com/sindresorhus/type-fest/pull/318) - The type only saves a couple of characters, not everyone knows what "nullish" means, and I'm also trying to [get away from `null`](https://github.com/sindresorhus/meta/discussions/7).
- [`TitleCase`](https://github.com/sindresorhus/type-fest/pull/303) - It's not solving a common need and is a better fit for a separate package.
- [`ExtendOr` and `ExtendAnd`](https://github.com/sindresorhus/type-fest/pull/247) - The benefits don't outweigh having to learn what they mean.
- [`PackageJsonExtras`](https://github.com/sindresorhus/type-fest/issues/371) - There are too many possible configurations that can be put into `package.json`. If you would like to extend `PackageJson` to support an additional configuration in your project, please see the *Extending existing types* section below.

## Alternative type names

*If you know one of our types by a different name, add it here for discovery.*

- `PartialBy` - See [`SetOptional`](https://github.com/sindresorhus/type-fest/blob/main/source/set-optional.d.ts)
- `RecordDeep`- See [`Schema`](https://github.com/sindresorhus/type-fest/blob/main/source/schema.d.ts)

## Tips

### Extending existing types

- [`PackageJson`](source/package-json.d.ts) - There are a lot of tools that place extra configurations inside the `package.json` file. You can extend `PackageJson` to support these additional configurations.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBDAnmApnA3gBQIYGMDW2A5igFIDOEAdnNuXAEJ0o4HFmVUC+cAZlBBBwA5ElQBaXinIxhAbgCwAKFCRYCZGnQAZYFRgooPfoJHSANntmKlysWlaESFanAC8jZo-YuaAMgwLKwBhal5gIgB+AC44XX1DADpQqnCiLhsgA)

	```ts
	import type {PackageJson as BasePackageJson} from 'type-fest';
	import type {Linter} from 'eslint';

	type PackageJson = BasePackageJson & {eslintConfig?: Linter.Config};
	```
	</details>

### Related

- [typed-query-selector](https://github.com/g-plane/typed-query-selector) - Enhances `document.querySelector` and `document.querySelectorAll` with a template literal type that matches element types returned from an HTML element query selector.
- [`Linter.Config`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/eslint/index.d.ts) - Definitions for the [ESLint configuration schema](https://eslint.org/docs/user-guide/configuring/language-options).

### Built-in types

There are many advanced types most users don't know about.

- [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) - Make all properties in `T` optional.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://www.typescriptlang.org/play/#code/JYOwLgpgTgZghgYwgAgHIHsAmEDC6QzADmyA3gLABQyycADnanALYQBcyAzmFKEQNxUaddFDAcQAV2YAjaIMoBfKlQQAbOJ05osEAIIMAQpOBrsUMkOR1eANziRkCfISKSoD4Pg4ZseAsTIALyW1DS0DEysHADkvvoMMQA0VsKi4sgAzAAMuVaKClY2wPaOknSYDrguADwA0sgQAB6QIJjaANYQAJ7oMDp+LsQAfAAUXd0cdUnI9mo+uv6uANp1ALoAlKHhyGAAFsCcAHTOAW4eYF4gyxNrwbNwago0ypRWp66jH8QcAApwYmAjxq8SWIy2FDCNDA3ToKFBQyIdR69wmfQG1TOhShyBgomQX3w3GQE2Q6IA8jIAFYQBBgI4TTiEs5bTQYsFInrLTbbHZOIlgZDlSqQABqj0kKBC3yINx6a2xfOQwH6o2FVXFaklwSCIUkbQghBAEEwENSfNOlykEGefNe5uhB2O6sgS3GPRmLogmslG1tLxUOKgEDA7hAuydtteryAA)

	```ts
	interface NodeConfig {
			appName: string;
			port: number;
	}

	class NodeAppBuilder {
			private configuration: NodeConfig = {
					appName: 'NodeApp',
					port: 3000
			};

			private updateConfig<Key extends keyof NodeConfig>(key: Key, value: NodeConfig[Key]) {
					this.configuration[key] = value;
			}

			config(config: Partial<NodeConfig>) {
					type NodeConfigKey = keyof NodeConfig;

					for (const key of Object.keys(config) as NodeConfigKey[]) {
							const updateValue = config[key];

							if (updateValue === undefined) {
									continue;
							}

							this.updateConfig(key, updateValue);
					}

					return this;
			}
	}

	// `Partial<NodeConfig>`` allows us to provide only a part of the
	// NodeConfig interface.
	new NodeAppBuilder().config({appName: 'ToDoApp'});
	```
	</details>

- [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype) - Make all properties in `T` required.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA)

	```ts
	interface ContactForm {
			email?: string;
			message?: string;
	}

	function submitContactForm(formData: Required<ContactForm>) {
			// Send the form data to the server.
	}

	submitContactForm({
			email: 'ex@mple.com',
			message: 'Hi! Could you tell me more about…',
	});

	// TypeScript error: missing property 'message'
	submitContactForm({
			email: 'ex@mple.com',
	});
	```
	</details>

- [`Readonly<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#readonlytype) - Make all properties in `T` readonly.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA)

	```ts
	enum LogLevel {
			Off,
			Debug,
			Error,
			Fatal
	};

	interface LoggerConfig {
			name: string;
			level: LogLevel;
	}

	class Logger {
			config: Readonly<LoggerConfig>;

			constructor({name, level}: LoggerConfig) {
					this.config = {name, level};
					Object.freeze(this.config);
			}
	}

	const config: LoggerConfig = {
		name: 'MyApp',
		level: LogLevel.Debug
	};

	const logger = new Logger(config);

	// TypeScript Error: cannot assign to read-only property.
	logger.config.level = LogLevel.Error;

	// We are able to edit config variable as we please.
	config.level = LogLevel.Error;
	```
	</details>

- [`Pick<T, K>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys) - From `T`, pick a set of properties whose keys are in the union `K`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA)

	```ts
	interface Article {
			title: string;
			thumbnail: string;
			content: string;
	}

	// Creates new type out of the `Article` interface composed
	// from the Articles' two properties: `title` and `thumbnail`.
	// `ArticlePreview = {title: string; thumbnail: string}`
	type ArticlePreview = Pick<Article, 'title' | 'thumbnail'>;

	// Render a list of articles using only title and description.
	function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement {
			const articles = document.createElement('div');

			for (const preview of previews) {
					// Append preview to the articles.
			}

			return articles;
	}

	const articles = renderArticlePreviews([
			{
				title: 'TypeScript tutorial!',
				thumbnail: '/assets/ts.jpg'
			}
	]);
	```
	</details>

- [`Record<K, T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type) - Construct a type with a set of properties `K` of type `T`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA)

	```ts
	// Positions of employees in our company.
	type MemberPosition = 'intern' | 'developer' | 'tech-lead';

	// Interface describing properties of a single employee.
	interface Employee {
			firstName: string;
			lastName: string;
			yearsOfExperience: number;
	}

	// Create an object that has all possible `MemberPosition` values set as keys.
	// Those keys will store a collection of Employees of the same position.
	const team: Record<MemberPosition, Employee[]> = {
			intern: [],
			developer: [],
			'tech-lead': [],
	};

	// Our team has decided to help John with his dream of becoming Software Developer.
	team.intern.push({
		firstName: 'John',
		lastName: 'Doe',
		yearsOfExperience: 0
	});

	// `Record` forces you to initialize all of the property keys.
	// TypeScript Error: "tech-lead" property is missing
	const teamEmpty: Record<MemberPosition, null> = {
			intern: null,
			developer: null,
	};
	```
	</details>

- [`Exclude<T, U>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#excludetype-excludedunion) - Exclude from `T` those types that are assignable to `U`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA)

	```ts
	interface ServerConfig {
		port: null | string | number;
	}

	type RequestHandler = (request: Request, response: Response) => void;

	// Exclude `null` type from `null | string | number`.
	// In case the port is equal to `null`, we will use default value.
	function getPortValue(port: Exclude<ServerConfig['port'], null>): number {
		if (typeof port === 'string') {
			return parseInt(port, 10);
		}

		return port;
	}

	function startServer(handler: RequestHandler, config: ServerConfig): void {
		const server = require('http').createServer(handler);

		const port = config.port === null ? 3000 : getPortValue(config.port);
		server.listen(port);
	}
	```
	</details>

- [`Extract<T, U>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#extracttype-union) - Extract from `T` those types that are assignable to `U`.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA)

	```ts
	declare function uniqueId(): number;

	const ID = Symbol('ID');

	interface Person {
		[ID]: number;
		name: string;
		age: number;
	}

	// Allows changing the person data as long as the property key is of string type.
	function changePersonData<
		Obj extends Person,
		Key extends Extract<keyof Person, string>,
		Value extends Obj[Key]
	> (obj: Obj, key: Key, value: Value): void {
		obj[key] = value;
	}

	// Tiny Andrew was born.
	const andrew = {
		[ID]: uniqueId(),
		name: 'Andrew',
		age: 0,
	};

	// Cool, we're fine with that.
	changePersonData(andrew, 'name', 'Pony');

	// Goverment didn't like the fact that you wanted to change your identity.
	changePersonData(andrew, ID, uniqueId());
	```
	</details>

- [`NonNullable<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#nonnullabletype) - Exclude `null` and `undefined` from `T`.
	<details>
	<summary>
			Example
	</summary>
	Works with <a href="https://www.typescriptlang.org/tsconfig#strictNullChecks"><code>strictNullChecks</code></a> set to <code>true</code>.

	[Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA)

	```ts
	type PortNumber = string | number | null;

	/** Part of a class definition that is used to build a server */
	class ServerBuilder {
			portNumber!: NonNullable<PortNumber>;

			port(this: ServerBuilder, port: PortNumber): ServerBuilder {
					if (port == null) {
							this.portNumber = 8000;
					} else {
							this.portNumber = port;
					}

					return this;
			}
	}

	const serverBuilder = new ServerBuilder();

	serverBuilder
			.port('8000')   // portNumber = '8000'
			.port(null)     // portNumber =  8000
			.port(3000);    // portNumber =  3000

	// TypeScript error
	serverBuilder.portNumber = null;
	```
	</details>

- [`Parameters<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#parameterstype) - Obtain the parameters of a function type in a tuple.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA)

	```ts
	function shuffle(input: any[]): void {
		// Mutate array randomly changing its' elements indexes.
	}

	function callNTimes<Fn extends (...args: any[]) => any> (func: Fn, callCount: number) {
		// Type that represents the type of the received function parameters.
		type FunctionParameters = Parameters<Fn>;

		return function (...args: FunctionParameters) {
			for (let i = 0; i < callCount; i++) {
				func(...args);
			}
		}
	}

	const shuffleTwice = callNTimes(shuffle, 2);
	```
	</details>

- [`ConstructorParameters<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#constructorparameterstype) - Obtain the parameters of a constructor function type in a tuple.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA)

	```ts
	class ArticleModel {
		title: string;
		content?: string;

		constructor(title: string) {
			this.title = title;
		}
	}

	class InstanceCache<T extends (new (...args: any[]) => any)> {
		private ClassConstructor: T;
		private cache: Map<string, InstanceType<T>> = new Map();

		constructor (ctr: T) {
			this.ClassConstructor = ctr;
		}

		getInstance (...args: ConstructorParameters<T>): InstanceType<T> {
			const hash = this.calculateArgumentsHash(...args);

			const existingInstance = this.cache.get(hash);
			if (existingInstance !== undefined) {
				return existingInstance;
			}

			return new this.ClassConstructor(...args);
		}

		private calculateArgumentsHash(...args: any[]): string {
			// Calculate hash.
			return 'hash';
		}
	}

	const articleCache = new InstanceCache(ArticleModel);
	const amazonArticle = articleCache.getInstance('Amazon forests burining!');
	```
	</details>

- [`ReturnType<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#returntypetype) - Obtain the return type of a function type.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)

	```ts
	/** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */
	function mapIter<
			Elem,
			Func extends (elem: Elem) => any,
			Ret extends ReturnType<Func>
	>(iter: Iterable<Elem>, callback: Func): Ret[] {
			const mapped: Ret[] = [];

			for (const elem of iter) {
					mapped.push(callback(elem));
			}

			return mapped;
	}

	const setObject: Set<string> = new Set();
	const mapObject: Map<number, string> = new Map();

	mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[]

	mapIter(mapObject, ([key, value]: [number, string]) => {
			return key % 2 === 0 ? value : 'Odd';
	}); // string[]
	```
	</details>

- [`InstanceType<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#instancetypetype) - Obtain the instance type of a constructor function type.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA)

	```ts
	class IdleService {
			doNothing (): void {}
	}

	class News {
			title: string;
			content: string;

			constructor(title: string, content: string) {
					this.title = title;
					this.content = content;
			}
	}

	const instanceCounter: Map<Function, number> = new Map();

	interface Constructor {
			new(...args: any[]): any;
	}

	// Keep track how many instances of `Constr` constructor have been created.
	function getInstance<
			Constr extends Constructor,
			Args extends ConstructorParameters<Constr>
	>(constructor: Constr, ...args: Args): InstanceType<Constr> {
			let count = instanceCounter.get(constructor) || 0;

			const instance = new constructor(...args);

			instanceCounter.set(constructor, count + 1);

			console.log(`Created ${count + 1} instances of ${Constr.name} class`);

			return instance;
	}


	const idleService = getInstance(IdleService);
	// Will log: `Created 1 instances of IdleService class`
	const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...');
	// Will log: `Created 1 instances of News class`
	```
	</details>

- [`Omit<T, K>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#omittype-keys) - Constructs a type by picking all properties from T and then removing K.
	<details>
	<summary>
			Example
	</summary>

	[Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA)

	```ts
	interface Animal {
			imageUrl: string;
			species: string;
			images: string[];
			paragraphs: string[];
	}

	// Creates new type with all properties of the `Animal` interface
	// except 'images' and 'paragraphs' properties. We can use this
	// type to render small hover tooltip for a wiki entry list.
	type AnimalShortInfo = Omit<Animal, 'images' | 'paragraphs'>;

	function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement {
			const container = document.createElement('div');
			// Internal implementation.
			return container;
	}
	```
	</details>

- [`Uppercase<S extends string>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#uppercasestringtype) - Transforms every character in a string into uppercase.
	<details>
	<summary>
		Example
	</summary>

	```ts
	type T = Uppercase<'hello'>;  // 'HELLO'

	type T2 = Uppercase<'foo' | 'bar'>;  // 'FOO' | 'BAR'

	type T3<S extends string> = Uppercase<`aB${S}`>;
	type T4 = T3<'xYz'>;  // 'ABXYZ'

	type T5 = Uppercase<string>;  // string
	type T6 = Uppercase<any>;  // any
	type T7 = Uppercase<never>;  // never
	type T8 = Uppercase<42>;  // Error, type 'number' does not satisfy the constraint 'string'
	```
	</details>

- [`Lowercase<S extends string>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#lowercasestringtype) - Transforms every character in a string into lowercase.
	<details>
	<summary>
		Example
	</summary>

	```ts
	type T = Lowercase<'HELLO'>;  // 'hello'

	type T2 = Lowercase<'FOO' | 'BAR'>;  // 'foo' | 'bar'

	type T3<S extends string> = Lowercase<`aB${S}`>;
	type T4 = T3<'xYz'>;  // 'abxyz'

	type T5 = Lowercase<string>;  // string
	type T6 = Lowercase<any>;  // any
	type T7 = Lowercase<never>;  // never
	type T8 = Lowercase<42>;  // Error, type 'number' does not satisfy the constraint 'string'
	```
	</details>

- [`Capitalize<S extends string>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#capitalizestringtype) - Transforms the first character in a string into uppercase.
	<details>
	<summary>
		Example
	</summary>

	```ts
	type T = Capitalize<'hello'>;  // 'Hello'

	type T2 = Capitalize<'foo' | 'bar'>;  // 'Foo' | 'Bar'

	type T3<S extends string> = Capitalize<`aB${S}`>;
	type T4 = T3<'xYz'>;  // 'ABxYz'

	type T5 = Capitalize<string>;  // string
	type T6 = Capitalize<any>;  // any
	type T7 = Capitalize<never>;  // never
	type T8 = Capitalize<42>;  // Error, type 'number' does not satisfy the constraint 'string'
	```
	</details>

- [`Uncapitalize<S extends string>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#uncapitalizestringtype) - Transforms the first character in a string into lowercase.
	<details>
	<summary>
		Example
	</summary>

	```ts
	type T = Uncapitalize<'Hello'>;  // 'hello'

	type T2 = Uncapitalize<'Foo' | 'Bar'>;  // 'foo' | 'bar'

	type T3<S extends string> = Uncapitalize<`AB${S}`>;
	type T4 = T3<'xYz'>;  // 'aBxYz'

	type T5 = Uncapitalize<string>;  // string
	type T6 = Uncapitalize<any>;  // any
	type T7 = Uncapitalize<never>;  // never
	type T8 = Uncapitalize<42>;  // Error, type 'number' does not satisfy the constraint 'string'
	```
	</details>

You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/utility-types.html).

## Maintainers

- [Sindre Sorhus](https://github.com/sindresorhus)
- [Jarek Radosz](https://github.com/CvX)
- [Dimitri Benin](https://github.com/BendingBender)
- [Pelle Wessman](https://github.com/voxpelli)

## License

SPDX-License-Identifier: (MIT OR CC0-1.0)

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-type-fest?utm_source=npm-type-fest&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
import type {PromiseValue} from './promise-value';

type AsyncFunction = (...args: any[]) => Promise<unknown>;

/**
Unwrap the return type of a function that returns a `Promise`.

There has been [discussion](https://github.com/microsoft/TypeScript/pull/35998) about implementing this type in TypeScript.

@example
```ts
import type {AsyncReturnType} from 'type-fest';
import {asyncFunction} from 'api';

// This type resolves to the unwrapped return type of `asyncFunction`.
type Value = AsyncReturnType<typeof asyncFunction>;

async function doSomething(value: Value) {}

asyncFunction().then(value => doSomething(value));
```

@category Async
*/
export type AsyncReturnType<Target extends AsyncFunction> = PromiseValue<ReturnType<Target>>;
import type {PromiseValue} from './promise-value';
import type {SetReturnType} from './set-return-type';

/**
Create an async version of the given function type, by boxing the return type in `Promise` while keeping the same parameter types.

Use-case: You have two functions, one synchronous and one asynchronous that do the same thing. Instead of having to duplicate the type definition, you can use `Asyncify` to reuse the synchronous type.

@example
```
import type {Asyncify} from 'type-fest';

// Synchronous function.
function getFooSync(someArg: SomeType): Foo {
	// …
}

type AsyncifiedFooGetter = Asyncify<typeof getFooSync>;
//=> type AsyncifiedFooGetter = (someArg: SomeType) => Promise<Foo>;

// Same as `getFooSync` but asynchronous.
const getFooAsync: AsyncifiedFooGetter = (someArg) => {
	// TypeScript now knows that `someArg` is `SomeType` automatically.
	// It also knows that this function must return `Promise<Foo>`.
	// If you have `@typescript-eslint/promise-function-async` linter rule enabled, it will even report that "Functions that return promises must be async.".

	// …
}
```

@category Async
*/
export type Asyncify<Fn extends (...args: any[]) => any> = SetReturnType<Fn, Promise<PromiseValue<ReturnType<Fn>>>>;
/**
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).

@category Class
*/
export type Class<T, Arguments extends unknown[] = any[]> = Constructor<T, Arguments> & {prototype: T};

/**
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).

@category Class
*/
export type Constructor<T, Arguments extends unknown[] = any[]> = new(...arguments_: Arguments) => T;

/**
Matches a JSON object.

This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.

@category JSON
*/
export type JsonObject = {[Key in string]?: JsonValue};

/**
Matches a JSON array.

@category JSON
*/
export type JsonArray = JsonValue[];

/**
Matches any valid JSON primitive value.

@category JSON
*/
export type JsonPrimitive = string | number | boolean | null;

/**
Matches any valid JSON value.

@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.

@category JSON
*/
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
import type {WordSeparators} from '../source/internal';
import type {Split} from './split';

/**
Step by step takes the first item in an array literal, formats it and adds it to a string literal, and then recursively appends the remainder.

Only to be used by `CamelCaseStringArray<>`.

@see CamelCaseStringArray
*/
type InnerCamelCaseStringArray<Parts extends readonly any[], PreviousPart> =
	Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
		? FirstPart extends undefined
			? ''
			: FirstPart extends ''
					? InnerCamelCaseStringArray<RemainingParts, PreviousPart>
					: `${PreviousPart extends '' ? FirstPart : Capitalize<FirstPart>}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`
		: '';

/**
Starts fusing the output of `Split<>`, an array literal of strings, into a camel-cased string literal.

It's separate from `InnerCamelCaseStringArray<>` to keep a clean API outwards to the rest of the code.

@see Split
*/
type CamelCaseStringArray<Parts extends readonly string[]> =
	Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
		? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`>
		: never;

/**
Convert a string literal to camel-case.

This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.

@example
```
import type {CamelCase} from 'type-fest';

// Simple

const someVariable: CamelCase<'foo-bar'> = 'fooBar';

// Advanced

type CamelCasedProperties<T> = {
	[K in keyof T as CamelCase<K>]: T[K]
};

interface RawOptions {
	'dry-run': boolean;
	'full_family_name': string;
	foo: number;
	BAR: string;
	QUZ_QUX: number;
	'OTHER-FIELD': boolean;
}

const dbResult: CamelCasedProperties<RawOptions> = {
	dryRun: true,
	fullFamilyName: 'bar.js',
	foo: 123,
	bar: 'foo',
	quzQux: 6,
	otherField: false
};
```

@category Change case
@category Template literal
*/
export type CamelCase<K> = K extends string ? CamelCaseStringArray<Split<K extends Uppercase<K> ? Lowercase<K> : K, WordSeparators>> : K;
import type {CamelCase} from './camel-case';

/**
Convert object properties to camel case recursively.

This can be useful when, for example, converting some API types from a different style.

@see CamelCasedProperties
@see CamelCase

@example
```
import type {CamelCasedPropertiesDeep} from 'type-fest';

interface User {
	UserId: number;
	UserName: string;
}

interface UserWithFriends {
	UserInfo: User;
	UserFriends: User[];
}

const result: CamelCasedPropertiesDeep<UserWithFriends> = {
	userInfo: {
		userId: 1,
		userName: 'Tom',
	},
	userFriends: [
		{
			userId: 2,
			userName: 'Jerry',
		},
		{
			userId: 3,
			userName: 'Spike',
		},
	],
};
```

@category Change case
@category Template literal
@category Object
*/
export type CamelCasedPropertiesDeep<Value> = Value extends Function
	? Value
	: Value extends Array<infer U>
	? Array<CamelCasedPropertiesDeep<U>>
	: Value extends Set<infer U>
	? Set<CamelCasedPropertiesDeep<U>> : {
			[K in keyof Value as CamelCase<K>]: CamelCasedPropertiesDeep<Value[K]>;
	};
import type {CamelCase} from './camel-case';

/**
Convert object properties to camel case but not recursively.

This can be useful when, for example, converting some API types from a different style.

@see CamelCasedPropertiesDeep
@see CamelCase

@example
```
import type {CamelCasedProperties} from 'type-fest';

interface User {
	UserId: number;
	UserName: string;
}

const result: CamelCasedProperties<User> = {
	userId: 1,
	userName: 'Tom',
};
```

@category Change case
@category Template literal
@category Object
*/
export type CamelCasedProperties<Value> = Value extends Function
	? Value
	: Value extends Array<infer U>
	? Value
	: {
			[K in keyof Value as CamelCase<K>]: Value[K];
	};
import type {Except} from './except';
import type {ConditionalKeys} from './conditional-keys';

/**
Exclude keys from a shape that matches the given `Condition`.

This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.

@example
```
import type {Primitive, ConditionalExcept} from 'type-fest';

class Awesome {
	name: string;
	successes: number;
	failures: bigint;

	run() {}
}

type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
//=> {run: () => void}
```

@example
```
import type {ConditionalExcept} from 'type-fest';

interface Example {
	a: string;
	b: string | number;
	c: () => void;
	d: {};
}

type NonStringKeysOnly = ConditionalExcept<Example, string>;
//=> {b: string | number; c: () => void; d: {}}
```

@category Object
*/
export type ConditionalExcept<Base, Condition> = Except<
	Base,
	ConditionalKeys<Base, Condition>
>;
/**
Extract the keys from a type where the value type of the key extends the given `Condition`.

Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.

@example
```
import type {ConditionalKeys} from 'type-fest';

interface Example {
	a: string;
	b: string | number;
	c?: string;
	d: {};
}

type StringKeysOnly = ConditionalKeys<Example, string>;
//=> 'a'
```

To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.

@example
```
import type {ConditionalKeys} from 'type-fest';

type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
//=> 'a' | 'c'
```

@category Object
*/
export type ConditionalKeys<Base, Condition> = NonNullable<
	// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
	{
		// Map through all the keys of the given base type.
		[Key in keyof Base]:
			// Pick only keys with types extending the given `Condition` type.
			Base[Key] extends Condition
				// Retain this key since the condition passes.
				? Key
				// Discard this key since the condition fails.
				: never;

	// Convert the produced object into a union type of the keys which passed the conditional test.
	}[keyof Base]
>;
import type {ConditionalKeys} from './conditional-keys';

/**
Pick keys from the shape that matches the given `Condition`.

This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type.

@example
```
import type {Primitive, ConditionalPick} from 'type-fest';

class Awesome {
	name: string;
	successes: number;
	failures: bigint;

	run() {}
}

type PickPrimitivesFromAwesome = ConditionalPick<Awesome, Primitive>;
//=> {name: string; successes: number; failures: bigint}
```

@example
```
import type {ConditionalPick} from 'type-fest';

interface Example {
	a: string;
	b: string | number;
	c: () => void;
	d: {};
}

type StringKeysOnly = ConditionalPick<Example, string>;
//=> {a: string}
```

@category Object
*/
export type ConditionalPick<Base, Condition> = Pick<
	Base,
	ConditionalKeys<Base, Condition>
>;
import type {UpperCaseCharacters, WordSeparators} from '../source/internal';

/**
Unlike a simpler split, this one includes the delimiter splitted on in the resulting array literal. This is to enable splitting on, for example, upper-case characters.

@category Template literal
*/
export type SplitIncludingDelimiters<Source extends string, Delimiter extends string> =
	Source extends '' ? [] :
	Source extends `${infer FirstPart}${Delimiter}${infer SecondPart}` ?
	(
		Source extends `${FirstPart}${infer UsedDelimiter}${SecondPart}`
			? UsedDelimiter extends Delimiter
				? Source extends `${infer FirstPart}${UsedDelimiter}${infer SecondPart}`
					? [...SplitIncludingDelimiters<FirstPart, Delimiter>, UsedDelimiter, ...SplitIncludingDelimiters<SecondPart, Delimiter>]
					: never
				: never
			: never
	) :
	[Source];

/**
Format a specific part of the splitted string literal that `StringArrayToDelimiterCase<>` fuses together, ensuring desired casing.

@see StringArrayToDelimiterCase
*/
type StringPartToDelimiterCase<StringPart extends string, Start extends boolean, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
	StringPart extends UsedWordSeparators ? Delimiter :
	Start extends true ? Lowercase<StringPart> :
	StringPart extends UsedUpperCaseCharacters ? `${Delimiter}${Lowercase<StringPart>}` :
	StringPart;

/**
Takes the result of a splitted string literal and recursively concatenates it together into the desired casing.

It receives `UsedWordSeparators` and `UsedUpperCaseCharacters` as input to ensure it's fully encapsulated.

@see SplitIncludingDelimiters
*/
type StringArrayToDelimiterCase<Parts extends readonly any[], Start extends boolean, UsedWordSeparators extends string, UsedUpperCaseCharacters extends string, Delimiter extends string> =
	Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
		? `${StringPartToDelimiterCase<FirstPart, Start, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}${StringArrayToDelimiterCase<RemainingParts, false, UsedWordSeparators, UsedUpperCaseCharacters, Delimiter>}`
		: Parts extends [string]
		? string
		: '';

/**
Convert a string literal to a custom string delimiter casing.

This can be useful when, for example, converting a camel-cased object property to an oddly cased one.

@see KebabCase
@see SnakeCase

@example
```
import type {DelimiterCase} from 'type-fest';

// Simple

const someVariable: DelimiterCase<'fooBar', '#'> = 'foo#bar';

// Advanced

type OddlyCasedProperties<T> = {
	[K in keyof T as DelimiterCase<K, '#'>]: T[K]
};

interface SomeOptions {
	dryRun: boolean;
	includeFile: string;
	foo: number;
}

const rawCliOptions: OddlyCasedProperties<SomeOptions> = {
	'dry#run': true,
	'include#file': 'bar.js',
	foo: 123
};
```

@category Change case
@category Template literal
*/
export type DelimiterCase<Value, Delimiter extends string> = Value extends string
	? StringArrayToDelimiterCase<
		SplitIncludingDelimiters<Value, WordSeparators | UpperCaseCharacters>,
		true,
		WordSeparators,
		UpperCaseCharacters,
		Delimiter
	>
	: Value;
import type {DelimiterCase} from './delimiter-case';

/**
Convert object properties to delimiter case recursively.

This can be useful when, for example, converting some API types from a different style.

@see DelimiterCase
@see DelimiterCasedProperties

@example
```
import type {DelimiterCasedPropertiesDeep} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

interface UserWithFriends {
	userInfo: User;
	userFriends: User[];
}

const result: DelimiterCasedPropertiesDeep<UserWithFriends, '-'> = {
	'user-info': {
	'user-id': 1,
		'user-name': 'Tom',
	},
	'user-friends': [
		{
			'user-id': 2,
			'user-name': 'Jerry',
		},
		{
			'user-id': 3,
			'user-name': 'Spike',
		},
	],
};
```

@category Change case
@category Template literal
@category Object
*/
export type DelimiterCasedPropertiesDeep<
	Value,
	Delimiter extends string,
> = Value extends Function | Date | RegExp
	? Value
	: Value extends Array<infer U>
	? Array<DelimiterCasedPropertiesDeep<U, Delimiter>>
	: Value extends Set<infer U>
	? Set<DelimiterCasedPropertiesDeep<U, Delimiter>> : {
			[K in keyof Value as DelimiterCase<
				K,
				Delimiter
			>]: DelimiterCasedPropertiesDeep<Value[K], Delimiter>;
	};
import type {DelimiterCase} from './delimiter-case';

/**
Convert object properties to delimiter case but not recursively.

This can be useful when, for example, converting some API types from a different style.

@see DelimiterCase
@see DelimiterCasedPropertiesDeep

@example
```
import type {DelimiterCasedProperties} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

const result: DelimiterCasedProperties<User, '-'> = {
	'user-id': 1,
	'user-name': 'Tom',
};
```

@category Change case
@category Template literal
@category Object
*/
export type DelimiterCasedProperties<
	Value,
	Delimiter extends string,
> = Value extends Function
	? Value
	: Value extends Array<infer U>
	? Value
	: {[K in keyof Value as DelimiterCase<K, Delimiter>]: Value[K]};
import type {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry';

type ArrayEntries<BaseType extends readonly unknown[]> = Array<ArrayEntry<BaseType>>;
type MapEntries<BaseType> = Array<MapEntry<BaseType>>;
type ObjectEntries<BaseType> = Array<ObjectEntry<BaseType>>;
type SetEntries<BaseType extends Set<unknown>> = Array<SetEntry<BaseType>>;

/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries.

For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.

@see `Entry` if you want to just access the type of a single entry.

@example
```
import type {Entries} from 'type-fest';

interface Example {
	someKey: number;
}

const manipulatesEntries = (examples: Entries<Example>) => examples.map(example => [
	// Does some arbitrary processing on the key (with type information available)
	example[0].toUpperCase(),

	// Does some arbitrary processing on the value (with type information available)
	example[1].toFixed()
]);

const example: Example = {someKey: 1};
const entries = Object.entries(example) as Entries<Example>;
const output = manipulatesEntries(entries);

// Objects
const objectExample = {a: 1};
const objectEntries: Entries<typeof objectExample> = [['a', 1]];

// Arrays
const arrayExample = ['a', 1];
const arrayEntries: Entries<typeof arrayExample> = [[0, 'a'], [1, 1]];

// Maps
const mapExample = new Map([['a', 1]]);
const mapEntries: Entries<typeof map> = [['a', 1]];

// Sets
const setExample = new Set(['a', 1]);
const setEntries: Entries<typeof setExample> = [['a', 'a'], [1, 1]];
```

@category Object
@category Map
@category Set
@category Array
*/
export type Entries<BaseType> =
	BaseType extends Map<unknown, unknown> ? MapEntries<BaseType>
		: BaseType extends Set<unknown> ? SetEntries<BaseType>
		: BaseType extends readonly unknown[] ? ArrayEntries<BaseType>
		: BaseType extends object ? ObjectEntries<BaseType>
		: never;
type MapKey<BaseType> = BaseType extends Map<infer KeyType, unknown> ? KeyType : never;
type MapValue<BaseType> = BaseType extends Map<unknown, infer ValueType> ? ValueType : never;

export type ArrayEntry<BaseType extends readonly unknown[]> = [number, BaseType[number]];
export type MapEntry<BaseType> = [MapKey<BaseType>, MapValue<BaseType>];
export type ObjectEntry<BaseType> = [keyof BaseType, BaseType[keyof BaseType]];
export type SetEntry<BaseType> = BaseType extends Set<infer ItemType> ? [ItemType, ItemType] : never;

/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entry` type will return the type of that collection's entry.

For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.

@see `Entries` if you want to just access the type of the array of entries (which is the return of the `.entries()` method).

@example
```
import type {Entry} from 'type-fest';

interface Example {
	someKey: number;
}

const manipulatesEntry = (example: Entry<Example>) => [
	// Does some arbitrary processing on the key (with type information available)
	example[0].toUpperCase(),

	// Does some arbitrary processing on the value (with type information available)
	example[1].toFixed(),
];

const example: Example = {someKey: 1};
const entry = Object.entries(example)[0] as Entry<Example>;
const output = manipulatesEntry(entry);

// Objects
const objectExample = {a: 1};
const objectEntry: Entry<typeof objectExample> = ['a', 1];

// Arrays
const arrayExample = ['a', 1];
const arrayEntryString: Entry<typeof arrayExample> = [0, 'a'];
const arrayEntryNumber: Entry<typeof arrayExample> = [1, 1];

// Maps
const mapExample = new Map([['a', 1]]);
const mapEntry: Entry<typeof mapExample> = ['a', 1];

// Sets
const setExample = new Set(['a', 1]);
const setEntryString: Entry<typeof setExample> = ['a', 'a'];
const setEntryNumber: Entry<typeof setExample> = [1, 1];
```

@category Object
@category Map
@category Array
@category Set
*/
export type Entry<BaseType> =
	BaseType extends Map<unknown, unknown> ? MapEntry<BaseType>
		: BaseType extends Set<unknown> ? SetEntry<BaseType>
		: BaseType extends readonly unknown[] ? ArrayEntry<BaseType>
		: BaseType extends object ? ObjectEntry<BaseType>
		: never;
import type {KeysOfUnion} from './internal';

/**
Extract the element of an array that also works for array union.

Returns `never` if T is not an array.

It creates a type-safe way to access the element type of `unknown` type.
*/
type ArrayElement<T> = T extends readonly unknown[] ? T[0] : never;

/**
Extract the object field type if T is an object and K is a key of T, return `never` otherwise.

It creates a type-safe way to access the member type of `unknown` type.
*/
type ObjectValue<T, K> = K extends keyof T ? T[K] : never;

/**
Create a type from `ParameterType` and `InputType` and change keys exclusive to `InputType` to `never`.
- Generate a list of keys that exists in `InputType` but not in `ParameterType`.
- Mark these excess keys as `never`.
*/
type ExactObject<ParameterType, InputType> = {[Key in keyof ParameterType]: Exact<ParameterType[Key], ObjectValue<InputType, Key>>}
	& Record<Exclude<keyof InputType, KeysOfUnion<ParameterType>>, never>;

/**
Create a type that does not allow extra properties, meaning it only allows properties that are explicitly declared.

This is useful for function type-guarding to reject arguments with excess properties. Due to the nature of TypeScript, it does not complain if excess properties are provided unless the provided value is an object literal.

*Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/12936) if you want to have this type as a built-in in TypeScript.*

@example
```
type OnlyAcceptName = {name: string};

function onlyAcceptName(args: OnlyAcceptName) {}

// TypeScript complains about excess properties when an object literal is provided.
onlyAcceptName({name: 'name', id: 1});
//=> `id` is excess

// TypeScript does not complain about excess properties when the provided value is a variable (not an object literal).
const invalidInput = {name: 'name', id: 1};
onlyAcceptName(invalidInput); // No errors
```

Having `Exact` allows TypeScript to reject excess properties.

@example
```
import {Exact} from 'type-fest';

type OnlyAcceptName = {name: string};

function onlyAcceptNameImproved<T extends Exact<OnlyAcceptName, T>>(args: T) {}

const invalidInput = {name: 'name', id: 1};
onlyAcceptNameImproved(invalidInput); // Compilation error
```

[Read more](https://stackoverflow.com/questions/49580725/is-it-possible-to-restrict-typescript-object-to-contain-only-properties-defined)

@category Utilities
*/
export type Exact<ParameterType, InputType> =
	// Convert union of array to array of union: A[] & B[] => (A & B)[]
	ParameterType extends unknown[] ? Array<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>>
	// In TypeScript, Array is a subtype of ReadonlyArray, so always test Array before ReadonlyArray.
	: ParameterType extends readonly unknown[] ? ReadonlyArray<Exact<ArrayElement<ParameterType>, ArrayElement<InputType>>>
	: ParameterType extends object ? ExactObject<ParameterType, InputType>
	: ParameterType;
import type {IsEqual} from './internal';

/**
Filter out keys from an object.

Returns `never` if `Exclude` is strictly equal to `Key`.
Returns `never` if `Key` extends `Exclude`.
Returns `Key` otherwise.

@example
```
type Filtered = Filter<'foo', 'foo'>;
//=> never
```

@example
```
type Filtered = Filter<'bar', string>;
//=> never
```

@example
```
type Filtered = Filter<'bar', 'foo'>;
//=> 'bar'
```

@see {Except}
*/
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);

/**
Create a type from an object type without certain keys.

This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.

This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).

@example
```
import type {Except} from 'type-fest';

type Foo = {
	a: number;
	b: string;
	c: boolean;
};

type FooWithoutA = Except<Foo, 'a' | 'c'>;
//=> {b: string};
```

@category Object
*/
export type Except<ObjectType, KeysType extends keyof ObjectType> = {
	[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
};
/**
Methods to exclude.
*/
type ArrayLengthMutationKeys = 'splice' | 'push' | 'pop' | 'shift' | 'unshift';

/**
Create a type that represents an array of the given type and length. The array's length and the `Array` prototype methods that manipulate its length are excluded in the resulting type.

Please participate in [this issue](https://github.com/microsoft/TypeScript/issues/26223) if you want to have a similiar type built into TypeScript.

Use-cases:
- Declaring fixed-length tuples or arrays with a large number of items.
- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types.
- Creating an array of coordinates with a static length, for example, length of 3 for a 3D vector.

Note: This type does not prevent out-of-bounds access. Prefer `ReadonlyTuple` unless you need mutability.

@example
```
import type {FixedLengthArray} from 'type-fest';

type FencingTeam = FixedLengthArray<string, 3>;

const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert'];

const homeFencingTeam: FencingTeam = ['George', 'John'];
//=> error TS2322: Type string[] is not assignable to type 'FencingTeam'

guestFencingTeam.push('Sam');
//=> error TS2339: Property 'push' does not exist on type 'FencingTeam'
```

@category Array
@see ReadonlyTuple
*/
export type FixedLengthArray<Element, Length extends number, ArrayPrototype = [Element, ...Element[]]> = Pick<
	ArrayPrototype,
	Exclude<keyof ArrayPrototype, ArrayLengthMutationKeys>
> & {
	[index: number]: Element;
	[Symbol.iterator]: () => IterableIterator<Element>;
	readonly length: Length;
};
import type {StringDigit} from '../source/internal';
import type {Split} from './split';
import type {StringKeyOf} from './string-key-of';

type GetOptions = {
	strict?: boolean;
};

/**
Like the `Get` type but receives an array of strings as a path parameter.
*/
type GetWithPath<BaseType, Keys extends readonly string[], Options extends GetOptions = {}> =
	Keys extends []
	? BaseType
	: Keys extends readonly [infer Head, ...infer Tail]
	? GetWithPath<
		PropertyOf<BaseType, Extract<Head, string>, Options>,
		Extract<Tail, string[]>,
		Options
	>
	: never;

/**
Adds `undefined` to `Type` if `strict` is enabled.
*/
type Strictify<Type, Options extends GetOptions> =
	Options['strict'] extends true ? Type | undefined : Type;

/**
If `Options['strict']` is `true`, includes `undefined` in the returned type when accessing properties on `Record<string, any>`.

Known limitations:
- Does not include `undefined` in the type on object types with an index signature (for example, `{a: string; [key: string]: string}`).
*/
type StrictPropertyOf<BaseType, Key extends keyof BaseType, Options extends GetOptions> =
	Record<string, any> extends BaseType
	? string extends keyof BaseType
		? Strictify<BaseType[Key], Options> // Record<string, any>
		: BaseType[Key] // Record<'a' | 'b', any> (Records with a string union as keys have required properties)
	: BaseType[Key];

/**
Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation.

@example
```
ToPath<'foo.bar.baz'>
//=> ['foo', 'bar', 'baz']

ToPath<'foo[0].bar.baz'>
//=> ['foo', '0', 'bar', 'baz']
```
*/
type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, '.'>;

/**
Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`.
*/
type FixPathSquareBrackets<Path extends string> =
	Path extends `[${infer Head}]${infer Tail}`
	? Tail extends `[${string}`
		? `${Head}.${FixPathSquareBrackets<Tail>}`
		: `${Head}${FixPathSquareBrackets<Tail>}`
	: Path extends `${infer Head}[${infer Middle}]${infer Tail}`
	? `${Head}.${FixPathSquareBrackets<`[${Middle}]${Tail}`>}`
	: Path;

/**
Returns true if `LongString` is made up out of `Substring` repeated 0 or more times.

@example
```
ConsistsOnlyOf<'aaa', 'a'> //=> true
ConsistsOnlyOf<'ababab', 'ab'> //=> true
ConsistsOnlyOf<'aBa', 'a'> //=> false
ConsistsOnlyOf<'', 'a'> //=> true
```
*/
type ConsistsOnlyOf<LongString extends string, Substring extends string> =
	LongString extends ''
	? true
	: LongString extends `${Substring}${infer Tail}`
	? ConsistsOnlyOf<Tail, Substring>
	: false;

/**
Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types.

@example
```
type WithNumbers = {foo: string; 0: boolean};
type WithStrings = WithStringKeys<WithNumbers>;

type WithNumbersKeys = keyof WithNumbers;
//=> 'foo' | 0
type WithStringsKeys = keyof WithStrings;
//=> 'foo' | '0'
```
*/
type WithStringKeys<BaseType> = {
	[Key in StringKeyOf<BaseType>]: UncheckedIndex<BaseType, Key>
};

/**
Perform a `T[U]` operation if `T` supports indexing.
*/
type UncheckedIndex<T, U extends string | number> = [T] extends [Record<string | number, any>] ? T[U] : never;

/**
Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf<number[], '0'> = number`, and when indexing objects with number keys.

Note:
- Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime.
- Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc.
*/
type PropertyOf<BaseType, Key extends string, Options extends GetOptions = {}> =
	BaseType extends null | undefined
	? undefined
	: Key extends keyof BaseType
	? StrictPropertyOf<BaseType, Key, Options>
	: BaseType extends [] | [unknown, ...unknown[]]
	? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds.
	: BaseType extends {
		[n: number]: infer Item;
		length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`.
	}
	? (
		ConsistsOnlyOf<Key, StringDigit> extends true
		? Strictify<Item, Options>
		: unknown
	)
	: Key extends keyof WithStringKeys<BaseType>
	? StrictPropertyOf<WithStringKeys<BaseType>, Key, Options>
	: unknown;

// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys.
/**
Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function.

Use-case: Retrieve a property from deep inside an API response or some other complex object.

@example
```
import type {Get} from 'type-fest';
import * as lodash from 'lodash';

const get = <BaseType, Path extends string | readonly string[]>(object: BaseType, path: Path): Get<BaseType, Path> =>
	lodash.get(object, path);

interface ApiResponse {
	hits: {
		hits: Array<{
			_id: string
			_source: {
				name: Array<{
					given: string[]
					family: string
				}>
				birthDate: string
			}
		}>
	}
}

const getName = (apiResponse: ApiResponse) =>
	get(apiResponse, 'hits.hits[0]._source.name');
	//=> Array<{given: string[]; family: string}>

// Path also supports a readonly array of strings
const getNameWithPathArray = (apiResponse: ApiResponse) =>
	get(apiResponse, ['hits','hits', '0', '_source', 'name'] as const);
	//=> Array<{given: string[]; family: string}>

// Strict mode:
Get<string[], '3', {strict: true}> //=> string | undefined
Get<Record<string, string>, 'foo', {strict: true}> // => string | undefined
```

@category Object
@category Array
@category Template literal
*/
export type Get<BaseType, Path extends string | readonly string[], Options extends GetOptions = {}> =
	GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;
import {OptionalKeysOf} from './optional-keys-of';

/**
Creates a type that represents `true` or `false` depending on whether the given type has any optional fields.

This is useful when you want to create an API whose behavior depends on the presence or absence of optional fields.

@example
```
import type {HasOptionalKeys, OptionalKeysOf} from 'type-fest';

type UpdateService<Entity extends object> = {
	removeField: HasOptionalKeys<Entity> extends true
		? (field: OptionalKeysOf<Entity>) => Promise<void>
		: never
}
```

@category Utilities
*/
export type HasOptionalKeys<BaseType extends object> = OptionalKeysOf<BaseType> extends never ? false : true;
import {RequiredKeysOf} from './required-keys-of';

/**
Creates a type that represents `true` or `false` depending on whether the given type has any required fields.

This is useful when you want to create an API whose behavior depends on the presence or absence of required fields.

@example
```
import type {HasRequiredKeys} from 'type-fest';

type GeneratorOptions<Template extends object> = {
	prop1: number;
	prop2: string;
} & (HasRequiredKeys<Template> extends true
	? {template: Template}
	: {template?: Template});

interface Template1 {
	optionalSubParam?: string;
}

interface Template2 {
	requiredSubParam: string;
}

type Options1 = GeneratorOptions<Template1>;
type Options2 = GeneratorOptions<Template2>;

const optA: Options1 = {
	prop1: 0,
	prop2: 'hi'
};
const optB: Options1 = {
	prop1: 0,
	prop2: 'hi',
	template: {}
};
const optC: Options1 = {
	prop1: 0,
	prop2: 'hi',
	template: {
		optionalSubParam: 'optional value'
	}
};

const optD: Options2 = {
	prop1: 0,
	prop2: 'hi',
	template: {
		requiredSubParam: 'required value'
	}
};

```

@category Utilities
*/
export type HasRequiredKeys<BaseType extends object> = RequiredKeysOf<BaseType> extends never ? false : true;
import type {IsEqual} from './internal';

/**
Returns a boolean for whether the given array includes the given item.

This can be useful if another type wants to make a decision based on whether the array includes that item.

@example
```
import type {Includes} from 'type-fest';

type hasRed<array extends any[]> = Includes<array, 'red'>;
```

@category Array
*/
export type Includes<Value extends readonly any[], Item> =
	Value extends readonly [Value[0], ...infer rest]
		? IsEqual<Value[0], Item> extends true
			? true
			: Includes<rest, Item>
		: false;
import type {Primitive} from './primitive';

/**
Returns a boolean for whether the two given types are equal.

@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
*/
export type IsEqual<T, U> =
	(<G>() => G extends T ? 1 : 2) extends
	(<G>() => G extends U ? 1 : 2)
		? true
		: false;

/**
Infer the length of the given array `<T>`.

@link https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
*/
type TupleLength<T extends readonly unknown[]> = T extends {readonly length: infer L} ? L : never;

/**
Create a tuple type of the given length `<L>`.

@link https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
*/
type BuildTuple<L extends number, T extends readonly unknown[] = []> = T extends {readonly length: L}
	? T
	: BuildTuple<L, [...T, unknown]>;

/**
Create a tuple of length `A` and a tuple composed of two other tuples,
the inferred tuple `U` and a tuple of length `B`, then extracts the length of tuple `U`.

@link https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f
*/
export type Subtract<A extends number, B extends number> = BuildTuple<A> extends [...(infer U), ...BuildTuple<B>]
	? TupleLength<U>
	: never;

/**
Matches any primitive, `Date`, or `RegExp` value.
*/
export type BuiltIns = Primitive | Date | RegExp;

/**
Gets keys from a type. Similar to `keyof` but this one also works for union types.

The reason a simple `keyof Union` does not work is because `keyof` always returns the accessible keys of a type. In the case of a union, that will only be the common keys.

@link https://stackoverflow.com/a/49402091
*/
export type KeysOfUnion<T> = T extends T ? keyof T : never;

export type UpperCaseCharacters = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';

export type WordSeparators = '-' | '_' | ' ';

export type StringDigit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
import type {Opaque} from './opaque';

/**
Create an [invariant type](https://basarat.gitbook.io/typescript/type-system/type-compatibility#footnote-invariance), which is a type that does not accept supertypes and subtypes.

Use-case:
- Prevent runtime errors that may occur due to assigning subtypes to supertypes.
- Improve type signature of object methods like [`Object.keys()` or `Object.entries()`](https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208) by sealing the object type.

@example
```
import type {InvariantOf} from 'type-fest';

class Animal {
	constructor(public name: string){}
}

class Cat extends Animal {
	meow() {}
}

let animalArray: Animal[] = [animal];
let catArray: Cat[] = [cat];

animalArray = catArray; // Okay if covariant
animalArray.push(new Animal('another animal')); // Pushed an animal into catArray
catArray.forEach(c => c.meow()); // Allowed but, error at runtime

let invariantAnimalArray: InvariantOf<Animal>[] = [animal] as InvariantOf<Animal>[];
let invariantCatArray: InvariantOf<Cat>[] = [cat] as InvariantOf<Cat>[];

invariantAnimalArray = invariantCatArray; // Error: Type 'InvariantOf<Cat>[]' is not assignable to type 'InvariantOf<Animal>[]'.
```

@example
```
import type {InvariantOf} from 'type-fest';

// In covariance (default)

interface FooBar {
	foo: number;
	bar: string
}

interface FooBarBaz extends FooBar {
	baz: boolean
}

declare const fooBar: FooBar
declare const fooBarBaz: FooBarBaz

function keyOfFooBar(fooBar: FooBar) {
	return Object.keys(fooBar) as (keyof FooBar)[]
}

keyOfFooBar(fooBar) //=> (keyof FooBar)[]
keyOfFooBar(fooBarBaz) //=> (keyof FooBar)[] but, (keyof FooBarBaz)[] at runtime

// In invariance

export function invariantOf<Type>(value: Type): InvariantOf<Type> {
	return value as InvariantOf<Type>;
}

function keyOfInvariantFooBar(fooBar: InvariantOf<FooBar>) {
	return Object.keys(fooBar) as (keyof FooBar)[]
}

keyOfInvariantFooBar(invariantOf(fooBar)); // (keyof FooBar)[]
keyOfInvariantFooBar(invariantOf(fooBarBaz)); // Error: Argument of type 'InvariantOf<FooBarBaz>' is not assignable to parameter of type 'InvariantOf<FooBar>'.
```

@category Type
*/
export type InvariantOf<Type> = Opaque<Type, (argument: Type) => Type>;
/**
Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.

This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified.

This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators.

Here is an example of `IterableElement` in action with a generator function:

@example
```
import type {IterableElement} from 'type-fest';

function * iAmGenerator() {
	yield 1;
	yield 2;
}

type MeNumber = IterableElement<ReturnType<typeof iAmGenerator>>
```

And here is an example with an async generator:

@example
```
import type {IterableElement} from 'type-fest';

async function * iAmGeneratorAsync() {
	yield 'hi';
	yield true;
}

type MeStringOrBoolean = IterableElement<ReturnType<typeof iAmGeneratorAsync>>
```

Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc.

An example with an array of strings:

@example
```
import type {IterableElement} from 'type-fest';

type MeString = IterableElement<string[]>
```

@category Iterable
*/
export type IterableElement<TargetIterable> =
	TargetIterable extends Iterable<infer ElementType> ?
	ElementType :
	TargetIterable extends AsyncIterable<infer ElementType> ?
	ElementType :
	never;
/**
Join an array of strings and/or numbers using the given string as a delimiter.

Use-case: Defining key paths in a nested object. For example, for dot-notation fields in MongoDB queries.

@example
```
import type {Join} from 'type-fest';

// Mixed (strings & numbers) items; result is: 'foo.0.baz'
const path: Join<['foo', 0, 'baz'], '.'> = ['foo', 0, 'baz'].join('.');

// Only string items; result is: 'foo.bar.baz'
const path: Join<['foo', 'bar', 'baz'], '.'> = ['foo', 'bar', 'baz'].join('.');

// Only number items; result is: '1.2.3'
const path: Join<[1, 2, 3], '.'> = [1, 2, 3].join('.');
```

@category Array
@category Template literal
*/
export type Join<
	Strings extends Array<string | number>,
	Delimiter extends string,
> = Strings extends [] ? '' :
	Strings extends [string | number] ? `${Strings[0]}` :
	// @ts-expect-error `Rest` is inferred as `unknown` here: https://github.com/microsoft/TypeScript/issues/45281
	Strings extends [string | number, ...infer Rest] ? `${Strings[0]}${Delimiter}${Join<Rest, Delimiter>}` :
	string;
import type {JsonPrimitive, JsonValue} from './basic';
import {Finite, NegativeInfinity, PositiveInfinity} from './numeric';
import {TypedArray} from './typed-array';

// Note: The return value has to be `any` and not `unknown` so it can match `void`.
type NotJsonable = ((...args: any[]) => any) | undefined | symbol;

/**
Transform a type to one that is assignable to the `JsonValue` type.

This includes:
1. Transforming JSON `interface` to a `type` that is assignable to `JsonValue`.
2. Transforming non-JSON value that is *jsonable* to a type that is assignable to `JsonValue`, where *jsonable* means the non-JSON value implements the `.toJSON()` method that returns a value that is assignable to `JsonValue`.

@remarks

An interface cannot be structurally compared to `JsonValue` because an interface can be re-opened to add properties that may not be satisfy `JsonValue`.

@example
```
import type {Jsonify} from 'type-fest';

interface Geometry {
	type: 'Point' | 'Polygon';
	coordinates: [number, number];
}

const point: Geometry = {
	type: 'Point',
	coordinates: [1, 1]
};

const problemFn = (data: JsonValue) => {
	// Does something with data
};

problemFn(point); // Error: type Geometry is not assignable to parameter of type JsonValue because it is an interface

const fixedFn = <T>(data: Jsonify<T>) => {
	// Does something with data
};

fixedFn(point); // Good: point is assignable. Jsonify<T> transforms Geometry into value assignable to JsonValue
fixedFn(new Date()); // Error: As expected, Date is not assignable. Jsonify<T> cannot transforms Date into value assignable to JsonValue
```

Non-JSON values such as `Date` implement `.toJSON()`, so they can be transformed to a value assignable to `JsonValue`:

@example
```
import type {Jsonify} from 'type-fest';

const time = {
	timeValue: new Date()
};

// `Jsonify<typeof time>` is equivalent to `{timeValue: string}`
const timeJson = JSON.parse(JSON.stringify(time)) as Jsonify<typeof time>;
```

@link https://github.com/Microsoft/TypeScript/issues/1897#issuecomment-710744173

@category JSON
*/
type Jsonify<T> =
	// Check if there are any non-JSONable types represented in the union.
	// Note: The use of tuples in this first condition side-steps distributive conditional types
	// (see https://github.com/microsoft/TypeScript/issues/29368#issuecomment-453529532)
	[Extract<T, NotJsonable | bigint>] extends [never]
		? T extends PositiveInfinity | NegativeInfinity	? null
			: T extends JsonPrimitive ? T // Primitive is acceptable
			: T extends object
				// Any object with toJSON is special case
				? T extends {toJSON(): infer J} ? (() => J) extends (() => JsonValue) // Is J assignable to JsonValue?
					? J // Then T is Jsonable and its Jsonable value is J
					: never // Not Jsonable because its toJSON() method does not return JsonValue
				// Instanced primitives are objects
				: T extends Number ? number
				: T extends String ? string
				: T extends Boolean ? boolean
				: T extends Map<any, any> | Set<any> ? {}
				: T extends TypedArray ? Record<string, number>
				: T extends any[]
					? {[I in keyof T]: T[I] extends NotJsonable ? null : Jsonify<T[I]>}
				: {[P in keyof T as P extends symbol ? never
					: T[P] extends NotJsonable ? never
					: P
				]: Jsonify<Required<T>[P]>} // Recursive call for its children
			: never // Otherwise any other non-object is removed
		: never; // Otherwise non-JSONable type union was found not empty
import type {DelimiterCase} from './delimiter-case';

/**
Convert a string literal to kebab-case.

This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag.

@example
```
import type {KebabCase} from 'type-fest';

// Simple

const someVariable: KebabCase<'fooBar'> = 'foo-bar';

// Advanced

type KebabCasedProperties<T> = {
	[K in keyof T as KebabCase<K>]: T[K]
};

interface CliOptions {
	dryRun: boolean;
	includeFile: string;
	foo: number;
}

const rawCliOptions: KebabCasedProperties<CliOptions> = {
	'dry-run': true,
	'include-file': 'bar.js',
	foo: 123
};
```

@category Change case
@category Template literal
*/
export type KebabCase<Value> = DelimiterCase<Value, '-'>;
import type {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep';

/**
Convert object properties to kebab case recursively.

This can be useful when, for example, converting some API types from a different style.

@see KebabCase
@see KebabCasedProperties

@example
```
import type [KebabCasedPropertiesDeep] from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

interface UserWithFriends {
	userInfo: User;
	userFriends: User[];
}

const result: KebabCasedPropertiesDeep<UserWithFriends> = {
	'user-info': {
		'user-id': 1,
		'user-name': 'Tom',
	},
	'user-friends': [
		{
			'user-id': 2,
			'user-name': 'Jerry',
		},
		{
			'user-id': 3,
			'user-name': 'Spike',
		},
	],
};
```

@category Change case
@category Template literal
@category Object
*/
export type KebabCasedPropertiesDeep<Value> = DelimiterCasedPropertiesDeep<Value, '-'>;
import type {DelimiterCasedProperties} from './delimiter-cased-properties';

/**
Convert object properties to kebab case but not recursively.

This can be useful when, for example, converting some API types from a different style.

@see KebabCase
@see KebabCasedPropertiesDeep

@example
```
import type {KebabCasedProperties} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

const result: KebabCasedProperties<User> = {
	'user-id': 1,
	'user-name': 'Tom',
};
```

@category Change case
@category Template literal
@category Object
*/
export type KebabCasedProperties<Value> = DelimiterCasedProperties<Value, '-'>;
/**
Extracts the type of the last element of an array.

Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last).

@example
```
import type {LastArrayElement} from 'type-fest';

declare function lastOf<V extends readonly any[]>(array: V): LastArrayElement<V>;

const array = ['foo', 2];

typeof lastOf(array);
//=> number
```

@category Array
@category Template literal
*/
export type LastArrayElement<ValueType extends readonly unknown[]> =
	ValueType extends readonly [infer ElementType]
		? ElementType
		: ValueType extends readonly [infer _, ...infer Tail]
		? LastArrayElement<Tail>
		: ValueType extends ReadonlyArray<infer ElementType>
		? ElementType
		: never;
/**
Given a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types) return the {@link Primitive | primitive type} it belongs to, or `never` if it's not a primitive.

Use-case: Working with generic types that may be literal types.

@example
```
import type {LiteralToPrimitive} from 'type-fest';

// No overloads needed to get the correct return type
function plus<T extends number | bigint | string>(x: T, y: T): LiteralToPrimitive<T> {
	return x + (y as any);
}

plus('a', 'b'); // string
plus(1, 2); // number
plus(1n, 2n); // bigint
```

@category Type
*/
export type LiteralToPrimitive<T> = T extends number
	? number
	: T extends bigint
	? bigint
	: T extends string
	? string
	: T extends boolean
	? boolean
	: T extends symbol
	? symbol
	: T extends null
	? null
	: T extends undefined
	? undefined
	: never;
import type {Primitive} from './primitive';

/**
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.

Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.

This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.

@example
```
import type {LiteralUnion} from 'type-fest';

// Before

type Pet = 'dog' | 'cat' | string;

const pet: Pet = '';
// Start typing in your TypeScript-enabled IDE.
// You **will not** get auto-completion for `dog` and `cat` literals.

// After

type Pet2 = LiteralUnion<'dog' | 'cat', string>;

const pet: Pet2 = '';
// You **will** get auto-completion for `dog` and `cat` literals.
```

@category Type
*/
export type LiteralUnion<
	LiteralType,
	BaseType extends Primitive,
> = LiteralType | (BaseType & Record<never, never>);
// Helper type. Not useful on its own.
type Without<FirstType, SecondType> = {[KeyType in Exclude<keyof FirstType, keyof SecondType>]?: never};

/**
Create a type that has mutually exclusive keys.

This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604).

This type works with a helper type, called `Without`. `Without<FirstType, SecondType>` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`.

@example
```
import type {MergeExclusive} from 'type-fest';

interface ExclusiveVariation1 {
	exclusive1: boolean;
}

interface ExclusiveVariation2 {
	exclusive2: string;
}

type ExclusiveOptions = MergeExclusive<ExclusiveVariation1, ExclusiveVariation2>;

let exclusiveOptions: ExclusiveOptions;

exclusiveOptions = {exclusive1: true};
//=> Works
exclusiveOptions = {exclusive2: 'hi'};
//=> Works
exclusiveOptions = {exclusive1: true, exclusive2: 'hi'};
//=> Error
```

@category Object
*/
export type MergeExclusive<FirstType, SecondType> =
	(FirstType | SecondType) extends object ?
		(Without<FirstType, SecondType> & SecondType) | (Without<SecondType, FirstType> & FirstType) :
		FirstType | SecondType;

import type {Except} from './except';
import type {Simplify} from './simplify';

type Merge_<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;

/**
Merge two types into a new type. Keys of the second type overrides keys of the first type.

@example
```
import type {Merge} from 'type-fest';

type Foo = {
	a: number;
	b: string;
};

type Bar = {
	b: number;
};

const ab: Merge<Foo, Bar> = {a: 1, b: 2};
```

@category Object
*/
export type Merge<FirstType, SecondType> = Simplify<Merge_<FirstType, SecondType>>;
import type {IsEqual, Subtract} from './internal';

type Recursive<T> = Array<Recursive<T>>;

/**
Creates a type that represents a multidimensional array of the given type and dimension.

Use-cases:
- Return a n-dimensional array from functions.
- Declare a n-dimensional array by defining its dimensions rather than declaring `[]` repetitively.
- Infer the dimensions of a n-dimensional array automatically from function arguments.
- Avoid the need to know in advance the dimensions of a n-dimensional array allowing them to be dynamic.

@example
```
import type {MultidimensionalArray} from 'type-fest';

function emptyMatrix<T extends number>(dimensions: T): MultidimensionalArray<unknown, T> {
	const matrix: unknown[] = [];

	let subMatrix = matrix;
	for (let dimension = 1; dimension < dimensions; ++dimension) {
		console.log(`Initializing dimension #${dimension}`);

		subMatrix[0] = [];
		subMatrix = subMatrix[0] as unknown[];
	}

	return matrix as MultidimensionalArray<unknown, T>;
}

const matrix = emptyMatrix(3);

matrix[0][0][0] = 42;
```

@category Array
*/
export type MultidimensionalArray<Element, Dimensions extends number> = number extends Dimensions
	? Recursive<Element>
	: IsEqual<Dimensions, 0> extends true
		? Element
		: Array<MultidimensionalArray<Element, Subtract<Dimensions, 1>>>;
import type {IsEqual, Subtract} from './internal';

type Recursive<T> = ReadonlyArray<Recursive<T>>;

/**
Creates a type that represents a multidimensional readonly array that of the given type and dimension.

Use-cases:
- Return a n-dimensional array from functions.
- Declare a n-dimensional array by defining its dimensions rather than declaring `[]` repetitively.
- Infer the dimensions of a n-dimensional array automatically from function arguments.
- Avoid the need to know in advance the dimensions of a n-dimensional array allowing them to be dynamic.

@example
```
import type {MultidimensionalReadonlyArray} from 'type-fest';

function emptyMatrix<T extends number>(dimensions: T): MultidimensionalReadonlyArray<unknown, T> {
	const matrix: unknown[] = [];

	let subMatrix = matrix;
	for (let dimension = 1; dimension < dimensions; ++dimension) {
		console.log(`Initializing dimension #${dimension}`);

		subMatrix[0] = [];
		if (dimension < dimensions - 1) {
			subMatrix = subMatrix[0] as unknown[];
		} else {
			subMatrix[0] = 42;
		}
	}

	return matrix as MultidimensionalReadonlyArray<unknown, T>;
}

const matrix = emptyMatrix(3);

const answer = matrix[0][0][0]; // 42
```

@category Array
*/
export type MultidimensionalReadonlyArray<Element, Dimensions extends number> = number extends Dimensions
	? Recursive<Element>
	: IsEqual<Dimensions, 0> extends true
		? Element
		: ReadonlyArray<MultidimensionalReadonlyArray<Element, Subtract<Dimensions, 1>>>;
import type {Writable} from './writable';

/** @deprecated @see Writable */
export type Mutable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
	Writable<BaseType, Keys>;
type Numeric = number | bigint;

type Zero = 0 | 0n;

/**
Matches the hidden `Infinity` type.

Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.

@see NegativeInfinity

@category Numeric
*/
// See https://github.com/microsoft/TypeScript/issues/31752
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
export type PositiveInfinity = 1e999;

/**
Matches the hidden `-Infinity` type.

Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.

@see PositiveInfinity

@category Numeric
*/
// See https://github.com/microsoft/TypeScript/issues/31752
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
export type NegativeInfinity = -1e999;

/**
A finite `number`.
You can't pass a `bigint` as they are already guaranteed to be finite.

Use-case: Validating and documenting parameters.

Note: This can't detect `NaN`, please upvote [this issue](https://github.com/microsoft/TypeScript/issues/28682) if you want to have this type as a built-in in TypeScript.

@example
```
import type {Finite} from 'type-fest';

declare function setScore<T extends number>(length: Finite<T>): void;
```

@category Numeric
*/
export type Finite<T extends number> = T extends PositiveInfinity | NegativeInfinity ? never : T;

/**
A `number` that is an integer.
You can't pass a `bigint` as they are already guaranteed to be integers.

Use-case: Validating and documenting parameters.

@example
```
import type {Integer} from 'type-fest';

declare function setYear<T extends number>(length: Integer<T>): void;
```

@see NegativeInteger
@see NonNegativeInteger

@category Numeric
*/
// `${bigint}` is a type that matches a valid bigint literal without the `n` (ex. 1, 0b1, 0o1, 0x1)
// Because T is a number and not a string we can effectively use this to filter out any numbers containing decimal points
export type Integer<T extends number> = `${T}` extends `${bigint}` ? T : never;

/**
A `number` that is not an integer.
You can't pass a `bigint` as they are already guaranteed to be integers.

Use-case: Validating and documenting parameters.

@example
```
import type {Float} from 'type-fest';

declare function setPercentage<T extends number>(length: Float<T>): void;
```

@see Integer

@category Numeric
*/
export type Float<T extends number> = T extends Integer<T> ? never : T;

/**
A negative (`-∞ < x < 0`) `number` that is not an integer.
Equivalent to `Negative<Float<T>>`.

Use-case: Validating and documenting parameters.

@see Negative
@see Float

@category Numeric
*/
export type NegativeFloat<T extends number> = Negative<Float<T>>;

/**
A negative `number`/`bigint` (`-∞ < x < 0`)

Use-case: Validating and documenting parameters.

@see NegativeInteger
@see NonNegative

@category Numeric
*/
export type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never;

/**
A negative (`-∞ < x < 0`) `number` that is an integer.
Equivalent to `Negative<Integer<T>>`.

You can't pass a `bigint` as they are already guaranteed to be integers, instead use `Negative<T>`.

Use-case: Validating and documenting parameters.

@see Negative
@see Integer

@category Numeric
*/
export type NegativeInteger<T extends number> = Negative<Integer<T>>;

/**
A non-negative `number`/`bigint` (`0 <= x < ∞`).

Use-case: Validating and documenting parameters.

@see NonNegativeInteger
@see Negative

@example
```
import type {NonNegative} from 'type-fest';

declare function setLength<T extends number>(length: NonNegative<T>): void;
```

@category Numeric
*/
export type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : never;

/**
A non-negative (`0 <= x < ∞`) `number` that is an integer.
Equivalent to `NonNegative<Integer<T>>`.

You can't pass a `bigint` as they are already guaranteed to be integers, instead use `NonNegative<T>`.

Use-case: Validating and documenting parameters.

@see NonNegative
@see Integer

@example
```
import type {NonNegativeInteger} from 'type-fest';

declare function setLength<T extends number>(length: NonNegativeInteger<T>): void;
```

@category Numeric
*/
export type NonNegativeInteger<T extends number> = NonNegative<Integer<T>>;
declare global {
	interface SymbolConstructor {
		readonly observable: symbol;
	}
}

/**
@remarks
The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
As well, some guideance on making an `Observable` do not include `closed` propery.
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
@see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
@see https://github.com/benlesh/symbol-observable#making-an-object-observable

@category Observable
*/
export type Unsubscribable = {
	unsubscribe(): void;
};

/**
@category Observable
*/
type OnNext<ValueType> = (value: ValueType) => void;
/**
@category Observable
*/
type OnError = (error: unknown) => void;
/**
@category Observable
*/
type OnComplete = () => void;

/**
@category Observable
*/
export type Observer<ValueType> = {
	next: OnNext<ValueType>;
	error: OnError;
	complete: OnComplete;
};

/**
Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).

@remarks
The TC39 Observable proposal defines 2 forms of `subscribe()`:
1. Three callback arguments: `subscribe(observer: OnNext<ValueType>, onError?: OnError, onComplete?: OnComplete): Unsubscribable;`
2. A single `observer` argument: (as defined below)

But `Observable` implementations have evolved to preferring case 2 and some implementations choose not to implement case 1. Therefore, an `ObservableLike` cannot be trusted to implement the first case. (xstream and hand built observerables often do not implement case 1)

@see https://github.com/tc39/proposal-observable#observable
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L246-L259
@see https://benlesh.com/posts/learning-observable-by-building-observable/

@category Observable
*/
export interface ObservableLike<ValueType = unknown> {
	subscribe(observer?: Partial<Observer<ValueType>>): Unsubscribable;
	[Symbol.observable](): ObservableLike<ValueType>;
}
declare const tag: unique symbol;

declare type Tagged<Token> = {
	readonly [tag]: Token;
};

/**
Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly.

The generic type parameter can be anything. It doesn't have to be an object.

[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/)

There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward:
	- [Microsoft/TypeScript#202](https://github.com/microsoft/TypeScript/issues/202)
	- [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408)
	- [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807)

@example
```
import type {Opaque} from 'type-fest';

type AccountNumber = Opaque<number, 'AccountNumber'>;
type AccountBalance = Opaque<number, 'AccountBalance'>;

// The `Token` parameter allows the compiler to differentiate between types, whereas "unknown" will not. For example, consider the following structures:
type ThingOne = Opaque<string>;
type ThingTwo = Opaque<string>;

// To the compiler, these types are allowed to be cast to each other as they have the same underlying type. They are both `string & { __opaque__: unknown }`.
// To avoid this behaviour, you would instead pass the "Token" parameter, like so.
type NewThingOne = Opaque<string, 'ThingOne'>;
type NewThingTwo = Opaque<string, 'ThingTwo'>;

// Now they're completely separate types, so the following will fail to compile.
function createNewThingOne (): NewThingOne {
	// As you can see, casting from a string is still allowed. However, you may not cast NewThingOne to NewThingTwo, and vice versa.
	return 'new thing one' as NewThingOne;
}

// This will fail to compile, as they are fundamentally different types.
const thingTwo = createNewThingOne() as NewThingTwo;

// Here's another example of opaque typing.
function createAccountNumber(): AccountNumber {
	return 2 as AccountNumber;
}

function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance {
	return 4 as AccountBalance;
}

// This will compile successfully.
getMoneyForAccount(createAccountNumber());

// But this won't, because it has to be explicitly passed as an `AccountNumber` type.
getMoneyForAccount(2);

// You can use opaque values like they aren't opaque too.
const accountNumber = createAccountNumber();

// This will not compile successfully.
const newAccountNumber = accountNumber + 2;

// As a side note, you can (and should) use recursive types for your opaque types to make them stronger and hopefully easier to type.
type Person = {
	id: Opaque<number, Person>;
	name: string;
};
```

@category Type
*/
export type Opaque<Type, Token = unknown> = Type & Tagged<Token>;

/**
Revert an opaque type back to its original type by removing the readonly `[tag]`.

Why is this necessary?

1. Use an `Opaque` type as object keys
2. Prevent TS4058 error: "Return type of exported function has or is using name X from external module Y but cannot be named"

@example
```
import type {Opaque, UnwrapOpaque} from 'type-fest';

type AccountType = Opaque<'SAVINGS' | 'CHECKING', 'AccountType'>;

const moneyByAccountType: Record<UnwrapOpaque<AccountType>, number> = {
	SAVINGS: 99,
	CHECKING: 0.1
};

// Without UnwrapOpaque, the following expression would throw a type error.
const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist

// Attempting to pass an non-Opaque type to UnwrapOpaque will raise a type error.
type WontWork = UnwrapOpaque<string>;
```

@category Type
*/
export type UnwrapOpaque<OpaqueType extends Tagged<unknown>> =
	OpaqueType extends Opaque<infer Type, OpaqueType[typeof tag]>
		? Type
		: OpaqueType;
/**
Extract all optional keys from the given type.

This is useful when you want to create a new type that contains different type values for the optional keys only.

@example
```
import type {OptionalKeysOf, Except} from 'type-fest';

interface User {
	name: string;
	surname: string;

	luckyNumber?: number;
}

const REMOVE_FIELD = Symbol('remove field symbol');
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
	[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
};

const update1: UpdateOperation<User> = {
	name: 'Alice'
};

const update2: UpdateOperation<User> = {
	name: 'Bob',
	luckyNumber: REMOVE_FIELD
};
```

@category Utilities
*/
export type OptionalKeysOf<BaseType extends object> = Exclude<{
	[Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>
		? never
		: Key
}[keyof BaseType], undefined>;
import type {LiteralUnion} from './literal-union';

declare namespace PackageJson {
	/**
	A person who has been involved in creating or maintaining the package.
	*/
	export type Person =
		| string
		| {
			name: string;
			url?: string;
			email?: string;
		};

	export type BugsLocation =
		| string
		| {
			/**
			The URL to the package's issue tracker.
			*/
			url?: string;

			/**
			The email address to which issues should be reported.
			*/
			email?: string;
		};

	export interface DirectoryLocations {
		[directoryType: string]: unknown;

		/**
		Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder.
		*/
		bin?: string;

		/**
		Location for Markdown files.
		*/
		doc?: string;

		/**
		Location for example scripts.
		*/
		example?: string;

		/**
		Location for the bulk of the library.
		*/
		lib?: string;

		/**
		Location for man pages. Sugar to generate a `man` array by walking the folder.
		*/
		man?: string;

		/**
		Location for test files.
		*/
		test?: string;
	}

	export type Scripts = {
		/**
		Run **before** the package is published (Also run on local `npm install` without any arguments).
		*/
		prepublish?: string;

		/**
		Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`.
		*/
		prepare?: string;

		/**
		Run **before** the package is prepared and packed, **only** on `npm publish`.
		*/
		prepublishOnly?: string;

		/**
		Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies).
		*/
		prepack?: string;

		/**
		Run **after** the tarball has been generated and moved to its final destination.
		*/
		postpack?: string;

		/**
		Run **after** the package is published.
		*/
		publish?: string;

		/**
		Run **after** the package is published.
		*/
		postpublish?: string;

		/**
		Run **before** the package is installed.
		*/
		preinstall?: string;

		/**
		Run **after** the package is installed.
		*/
		install?: string;

		/**
		Run **after** the package is installed and after `install`.
		*/
		postinstall?: string;

		/**
		Run **before** the package is uninstalled and before `uninstall`.
		*/
		preuninstall?: string;

		/**
		Run **before** the package is uninstalled.
		*/
		uninstall?: string;

		/**
		Run **after** the package is uninstalled.
		*/
		postuninstall?: string;

		/**
		Run **before** bump the package version and before `version`.
		*/
		preversion?: string;

		/**
		Run **before** bump the package version.
		*/
		version?: string;

		/**
		Run **after** bump the package version.
		*/
		postversion?: string;

		/**
		Run with the `npm test` command, before `test`.
		*/
		pretest?: string;

		/**
		Run with the `npm test` command.
		*/
		test?: string;

		/**
		Run with the `npm test` command, after `test`.
		*/
		posttest?: string;

		/**
		Run with the `npm stop` command, before `stop`.
		*/
		prestop?: string;

		/**
		Run with the `npm stop` command.
		*/
		stop?: string;

		/**
		Run with the `npm stop` command, after `stop`.
		*/
		poststop?: string;

		/**
		Run with the `npm start` command, before `start`.
		*/
		prestart?: string;

		/**
		Run with the `npm start` command.
		*/
		start?: string;

		/**
		Run with the `npm start` command, after `start`.
		*/
		poststart?: string;

		/**
		Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
		*/
		prerestart?: string;

		/**
		Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
		*/
		restart?: string;

		/**
		Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided.
		*/
		postrestart?: string;
	} & Partial<Record<string, string>>;

	/**
	Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL.
	*/
	export type Dependency = Partial<Record<string, string>>;

	/**
	Conditions which provide a way to resolve a package entry point based on the environment.
	*/
	export type ExportCondition = LiteralUnion<
		| 'import'
		| 'require'
		| 'node'
		| 'node-addons'
		| 'deno'
		| 'browser'
		| 'electron'
		| 'react-native'
		| 'default',
		string
	>;

	type ExportConditions = {[condition in ExportCondition]: Exports};

	/**
	Entry points of a module, optionally with conditions and subpath exports.
	*/
	export type Exports =
	| null
	| string
	| Array<string | ExportConditions>
	| ExportConditions
	| {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style

	/**
	Import map entries of a module, optionally with conditions.
	*/
	export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style
		[key: string]: string | {[key in ExportCondition]: Exports};
	};

	export interface NonStandardEntryPoints {
		/**
		An ECMAScript module ID that is the primary entry point to the program.
		*/
		module?: string;

		/**
		A module ID with untranspiled code that is the primary entry point to the program.
		*/
		esnext?:
		| string
		| {
			[moduleName: string]: string | undefined;
			main?: string;
			browser?: string;
		};

		/**
		A hint to JavaScript bundlers or component tools when packaging modules for client side use.
		*/
		browser?:
		| string
		| Partial<Record<string, string | false>>;

		/**
		Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.

		[Read more.](https://webpack.js.org/guides/tree-shaking/)
		*/
		sideEffects?: boolean | string[];
	}

	export interface TypeScriptConfiguration {
		/**
		Location of the bundled TypeScript declaration file.
		*/
		types?: string;

		/**
		Version selection map of TypeScript.
		*/
		typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;

		/**
		Location of the bundled TypeScript declaration file. Alias of `types`.
		*/
		typings?: string;
	}

	/**
	An alternative configuration for Yarn workspaces.
	*/
	export interface WorkspaceConfig {
		/**
		An array of workspace pattern strings which contain the workspace packages.
		*/
		packages?: WorkspacePattern[];

		/**
		Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns.

		[Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/)
		*/
		nohoist?: WorkspacePattern[];
	}

	/**
	A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process.

	The patterns are handled with [minimatch](https://github.com/isaacs/minimatch).

	@example
	`docs` → Include the docs directory and install its dependencies.
	`packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`.
	*/
	type WorkspacePattern = string;

	export interface YarnConfiguration {
		/**
		Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).

		Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.

		Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
		*/
		workspaces?: WorkspacePattern[] | WorkspaceConfig;

		/**
		If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.

		Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
		*/
		flat?: boolean;

		/**
		Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
		*/
		resolutions?: Dependency;
	}

	export interface JSPMConfiguration {
		/**
		JSPM configuration.
		*/
		jspm?: PackageJson;
	}

	/**
	Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.
	*/
	export interface PackageJsonStandard {
		/**
		The name of the package.
		*/
		name?: string;

		/**
		Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
		*/
		version?: string;

		/**
		Package description, listed in `npm search`.
		*/
		description?: string;

		/**
		Keywords associated with package, listed in `npm search`.
		*/
		keywords?: string[];

		/**
		The URL to the package's homepage.
		*/
		homepage?: LiteralUnion<'.', string>;

		/**
		The URL to the package's issue tracker and/or the email address to which issues should be reported.
		*/
		bugs?: BugsLocation;

		/**
		The license for the package.
		*/
		license?: string;

		/**
		The licenses for the package.
		*/
		licenses?: Array<{
			type?: string;
			url?: string;
		}>;

		author?: Person;

		/**
		A list of people who contributed to the package.
		*/
		contributors?: Person[];

		/**
		A list of people who maintain the package.
		*/
		maintainers?: Person[];

		/**
		The files included in the package.
		*/
		files?: string[];

		/**
		Resolution algorithm for importing ".js" files from the package's scope.

		[Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
		*/
		type?: 'module' | 'commonjs';

		/**
		The module ID that is the primary entry point to the program.
		*/
		main?: string;

		/**
		Subpath exports to define entry points of the package.

		[Read more.](https://nodejs.org/api/packages.html#subpath-exports)
		*/
		exports?: Exports;

		/**
		Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.

		[Read more.](https://nodejs.org/api/packages.html#subpath-imports)
		*/
		imports?: Imports;

		/**
		The executable files that should be installed into the `PATH`.
		*/
		bin?:
		| string
		| Partial<Record<string, string>>;

		/**
		Filenames to put in place for the `man` program to find.
		*/
		man?: string | string[];

		/**
		Indicates the structure of the package.
		*/
		directories?: DirectoryLocations;

		/**
		Location for the code repository.
		*/
		repository?:
		| string
		| {
			type: string;
			url: string;

			/**
			Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo).

			[Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md)
			*/
			directory?: string;
		};

		/**
		Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
		*/
		scripts?: Scripts;

		/**
		Is used to set configuration parameters used in package scripts that persist across upgrades.
		*/
		config?: Record<string, unknown>;

		/**
		The dependencies of the package.
		*/
		dependencies?: Dependency;

		/**
		Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
		*/
		devDependencies?: Dependency;

		/**
		Dependencies that are skipped if they fail to install.
		*/
		optionalDependencies?: Dependency;

		/**
		Dependencies that will usually be required by the package user directly or via another dependency.
		*/
		peerDependencies?: Dependency;

		/**
		Indicate peer dependencies that are optional.
		*/
		peerDependenciesMeta?: Partial<Record<string, {optional: true}>>;

		/**
		Package names that are bundled when the package is published.
		*/
		bundledDependencies?: string[];

		/**
		Alias of `bundledDependencies`.
		*/
		bundleDependencies?: string[];

		/**
		Engines that this package runs on.
		*/
		engines?: {
			[EngineName in 'npm' | 'node' | string]?: string;
		};

		/**
		@deprecated
		*/
		engineStrict?: boolean;

		/**
		Operating systems the module runs on.
		*/
		os?: Array<LiteralUnion<
		| 'aix'
		| 'darwin'
		| 'freebsd'
		| 'linux'
		| 'openbsd'
		| 'sunos'
		| 'win32'
		| '!aix'
		| '!darwin'
		| '!freebsd'
		| '!linux'
		| '!openbsd'
		| '!sunos'
		| '!win32',
		string
		>>;

		/**
		CPU architectures the module runs on.
		*/
		cpu?: Array<LiteralUnion<
		| 'arm'
		| 'arm64'
		| 'ia32'
		| 'mips'
		| 'mipsel'
		| 'ppc'
		| 'ppc64'
		| 's390'
		| 's390x'
		| 'x32'
		| 'x64'
		| '!arm'
		| '!arm64'
		| '!ia32'
		| '!mips'
		| '!mipsel'
		| '!ppc'
		| '!ppc64'
		| '!s390'
		| '!s390x'
		| '!x32'
		| '!x64',
		string
		>>;

		/**
		If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.

		@deprecated
		*/
		preferGlobal?: boolean;

		/**
		If set to `true`, then npm will refuse to publish it.
		*/
		private?: boolean;

		/**
		A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
		*/
		publishConfig?: PublishConfig;

		/**
		Describes and notifies consumers of a package's monetary support information.

		[Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
		*/
		funding?: string | {
			/**
			The type of funding.
			*/
			type?: LiteralUnion<
			| 'github'
			| 'opencollective'
			| 'patreon'
			| 'individual'
			| 'foundation'
			| 'corporation',
			string
			>;

			/**
			The URL to the funding page.
			*/
			url: string;
		};
	}

	export interface PublishConfig {
		/**
		Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig).
		*/
		[additionalProperties: string]: unknown;

		/**
		When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public.
		*/
		access?: 'public' | 'restricted';

		/**
		The base URL of the npm registry.

		Default: `'https://registry.npmjs.org/'`
		*/
		registry?: string;

		/**
		The tag to publish the package under.

		Default: `'latest'`
		*/
		tag?: string;
	}
}

/**
Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn.

@category File
*/
export type PackageJson =
PackageJson.PackageJsonStandard &
PackageJson.NonStandardEntryPoints &
PackageJson.TypeScriptConfiguration &
PackageJson.YarnConfiguration &
PackageJson.JSPMConfiguration;
import type {BuiltIns} from './internal';

/**
@see PartialDeep
*/
export interface PartialDeepOptions {
	/**
	Whether to affect the individual elements of arrays and tuples.

	@default true
	*/
	readonly recurseIntoArrays?: boolean;
}

/**
Create a type from another type with all keys and nested keys set to optional.

Use-cases:
- Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.

@example
```
import type {PartialDeep} from 'type-fest';

const settings: Settings = {
	textEditor: {
		fontSize: 14;
		fontColor: '#000000';
		fontWeight: 400;
	}
	autocomplete: false;
	autosave: true;
};

const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
	return {...settings, ...savedSettings};
}

settings = applySavedSettings({textEditor: {fontWeight: 500}});
```

By default, this also affects array and tuple types:

```
import type {PartialDeep} from 'type-fest';

interface Settings {
	languages: string[];
}

const partialSettings: PartialDeep<Settings> = {
	languages: [undefined]
};
```

If this is undesirable, you can pass `{recurseIntoArrays: false}` as the second type argument.

@category Object
@category Array
@category Set
@category Map
*/
export type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIns
	? T
	: T extends Map<infer KeyType, infer ValueType>
	? PartialMapDeep<KeyType, ValueType, Options>
	: T extends Set<infer ItemType>
	? PartialSetDeep<ItemType, Options>
	: T extends ReadonlyMap<infer KeyType, infer ValueType>
	? PartialReadonlyMapDeep<KeyType, ValueType, Options>
	: T extends ReadonlySet<infer ItemType>
	? PartialReadonlySetDeep<ItemType, Options>
	: T extends ((...arguments: any[]) => unknown)
	? T | undefined
	: T extends object
	? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
		? Options['recurseIntoArrays'] extends false // If they opt out of array testing, just use the original type
			? T
			: ItemType[] extends T // Test for arrays (non-tuples) specifically
			? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
				? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>
				: Array<PartialDeep<ItemType | undefined, Options>>
			: PartialObjectDeep<T, Options> // Tuples behave properly
		: PartialObjectDeep<T, Options>
	: unknown;

/**
Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
*/
interface PartialMapDeep<KeyType, ValueType, Options extends PartialDeepOptions> extends Map<PartialDeep<KeyType, Options>, PartialDeep<ValueType, Options>> {}

/**
Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
*/
interface PartialSetDeep<T, Options extends PartialDeepOptions> extends Set<PartialDeep<T, Options>> {}

/**
Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
*/
interface PartialReadonlyMapDeep<KeyType, ValueType, Options extends PartialDeepOptions> extends ReadonlyMap<PartialDeep<KeyType, Options>, PartialDeep<ValueType, Options>> {}

/**
Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
*/
interface PartialReadonlySetDeep<T, Options extends PartialDeepOptions> extends ReadonlySet<PartialDeep<T, Options>> {}

/**
Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
*/
type PartialObjectDeep<ObjectType extends object, Options extends PartialDeepOptions> = {
	[KeyType in keyof ObjectType]?: PartialDeep<ObjectType[KeyType], Options>
};
import type {BuiltIns} from './internal';
import type {Merge} from './merge';

/**
@see PartialOnUndefinedDeep
*/
export interface PartialOnUndefinedDeepOptions {
	/**
	Whether to affect the individual elements of arrays and tuples.

	@default false
	*/
	readonly recurseIntoArrays?: boolean;
}

/**
Create a deep version of another type where all keys accepting `undefined` type are set to optional.

This utility type is recursive, transforming at any level deep. By default, it does not affect arrays and tuples items unless you explicitly pass `{recurseIntoArrays: true}` as the second type argument.

Use-cases:
- Make all properties of a type that can be undefined optional to not have to specify keys with undefined value.

@example
```
import type {PartialOnUndefinedDeep} from 'type-fest';

interface Settings {
	optionA: string;
	optionB: number | undefined;
	subOption: {
		subOptionA: boolean;
		subOptionB: boolean | undefined;
	}
};

const testSettings: PartialOnUndefinedDeep<Settings> = {
	optionA: 'foo',
	// 👉 optionB is now optional and can be omitted
	subOption: {
		subOptionA: true,
		// 👉 subOptionB is now optional as well and can be omitted
	},
};
```

@category Object
*/
export type PartialOnUndefinedDeep<T, Options extends PartialOnUndefinedDeepOptions = {}> = T extends Record<any, any> | undefined
	? {[KeyType in keyof T as undefined extends T[KeyType] ? KeyType : never]?: PartialOnUndefinedDeepValue<T[KeyType], Options>} extends infer U // Make a partial type with all value types accepting undefined (and set them optional)
		? Merge<{[KeyType in keyof T as KeyType extends keyof U ? never : KeyType]: PartialOnUndefinedDeepValue<T[KeyType], Options>}, U> // Join all remaining keys not treated in U
		: never // Should not happen
	: T;

/**
Utility type to get the value type by key and recursively call `PartialOnUndefinedDeep` to transform sub-objects.
*/
type PartialOnUndefinedDeepValue<T, Options extends PartialOnUndefinedDeepOptions> = T extends BuiltIns | ((...arguments: any[]) => unknown)
	? T
	: T extends ReadonlyArray<infer U> // Test if type is array or tuple
	? Options['recurseIntoArrays'] extends true // Check if option is activated
		? U[] extends T // Check if array not tuple
		? readonly U[] extends T
			? ReadonlyArray<PartialOnUndefinedDeep<U, Options>> // Readonly array treatment
			: Array<PartialOnUndefinedDeep<U, Options>> // Mutable array treatment
		: PartialOnUndefinedDeep<{[Key in keyof T]: PartialOnUndefinedDeep<T[Key], Options>}, Options> // Tuple treatment
		: T
	: T extends Record<any, any> | undefined
	? PartialOnUndefinedDeep<T, Options>
	: unknown;
import type {CamelCase} from './camel-case';

/**
Converts a string literal to pascal-case.

@example
```
import type {PascalCase} from 'type-fest';

// Simple

const someVariable: PascalCase<'foo-bar'> = 'FooBar';

// Advanced

type PascalCaseProps<T> = {
	[K in keyof T as PascalCase<K>]: T[K]
};

interface RawOptions {
	'dry-run': boolean;
	'full_family_name': string;
	foo: number;
}

const dbResult: CamelCasedProperties<ModelProps> = {
	DryRun: true,
	FullFamilyName: 'bar.js',
	Foo: 123
};
```

@category Change case
@category Template literal
*/
export type PascalCase<Value> = CamelCase<Value> extends string
	? Capitalize<CamelCase<Value>>
	: CamelCase<Value>;
import type {PascalCase} from './pascal-case';

/**
Convert object properties to pascal case recursively.

This can be useful when, for example, converting some API types from a different style.

@see PascalCase
@see PascalCasedProperties

@example
```
import type {PascalCasedPropertiesDeep} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

interface UserWithFriends {
	userInfo: User;
	userFriends: User[];
}

const result: PascalCasedPropertiesDeep<UserWithFriends> = {
	UserInfo: {
		UserId: 1,
		UserName: 'Tom',
	},
	UserFriends: [
		{
			UserId: 2,
			UserName: 'Jerry',
		},
		{
			UserId: 3,
			UserName: 'Spike',
		},
	],
};
```

@category Change case
@category Template literal
@category Object
*/
export type PascalCasedPropertiesDeep<Value> = Value extends Function | Date | RegExp
	? Value
	: Value extends Array<infer U>
	? Array<PascalCasedPropertiesDeep<U>>
	: Value extends Set<infer U>
	? Set<PascalCasedPropertiesDeep<U>> : {
			[K in keyof Value as PascalCase<K>]: PascalCasedPropertiesDeep<Value[K]>;
	};
import type {PascalCase} from './pascal-case';

/**
Convert object properties to pascal case but not recursively.

This can be useful when, for example, converting some API types from a different style.

@see PascalCase
@see PascalCasedPropertiesDeep

@example
```
import type {PascalCasedProperties} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

const result: PascalCasedProperties<User> = {
	UserId: 1,
	UserName: 'Tom',
};
```

@category Change case
@category Template literal
@category Object
*/
export type PascalCasedProperties<Value> = Value extends Function
	? Value
	: Value extends Array<infer U>
	? Value
	: {[K in keyof Value as PascalCase<K>]: Value[K]};
/**
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).

@category Type
*/
export type Primitive =
	| null
	| undefined
	| string
	| number
	| boolean
	| symbol
	| bigint;
/**
Create a type that represents either the value or the value wrapped in `PromiseLike`.

Use-cases:
- A function accepts a callback that may either return a value synchronously or may return a promised value.
- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks.

Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript.

@example
```
import type {Promisable} from 'type-fest';

async function logger(getLogEntry: () => Promisable<string>): Promise<void> {
	const entry = await getLogEntry();
	console.log(entry);
}

logger(() => 'foo');
logger(() => Promise.resolve('bar'));
```

@category Async
*/
export type Promisable<T> = T | PromiseLike<T>;
/**
@deprecated Use the built-in [`Awaited` type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#the-awaited-type-and-promise-improvements) instead.

Returns the type that is wrapped inside a `Promise` type.
If the type is a nested Promise, it is unwrapped recursively until a non-Promise type is obtained.
If the type is not a `Promise`, the type itself is returned.

@example
```
import type {PromiseValue} from 'type-fest';

type AsyncData = Promise<string>;
let asyncData: AsyncData = Promise.resolve('ABC');

type Data = PromiseValue<AsyncData>;
let data: Data = await asyncData;

// Here's an example that shows how this type reacts to non-Promise types.
type SyncData = PromiseValue<string>;
let syncData: SyncData = getSyncData();

// Here's an example that shows how this type reacts to recursive Promise types.
type RecursiveAsyncData = Promise<Promise<string>>;
let recursiveAsyncData: PromiseValue<RecursiveAsyncData> = await Promise.resolve(Promise.resolve('ABC'));
```

@category Async
*/
export type PromiseValue<PromiseType> = PromiseType extends PromiseLike<infer Value> ? PromiseValue<Value> : PromiseType;
import type {BuiltIns} from './internal';

/**
Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively.

This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around.

Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript.

@example
```
// data.json
{
	"foo": ["bar"]
}

// main.ts
import type {ReadonlyDeep} from 'type-fest';
import dataJson = require('./data.json');

const data: ReadonlyDeep<typeof dataJson> = dataJson;

export default data;

// test.ts
import data from './main';

data.foo.push('bar');
//=> error TS2339: Property 'push' does not exist on type 'readonly string[]'
```

@category Object
@category Array
@category Set
@category Map
*/
export type ReadonlyDeep<T> = T extends BuiltIns
	? T
	: T extends (...arguments: any[]) => unknown
	? {} extends ReadonlyObjectDeep<T>
		? T
		: HasMultipleCallSignatures<T> extends true
		? T
		: ((...arguments: Parameters<T>) => ReturnType<T>) & ReadonlyObjectDeep<T>
	: T extends Readonly<ReadonlyMap<infer KeyType, infer ValueType>>
	? ReadonlyMapDeep<KeyType, ValueType>
	: T extends Readonly<ReadonlySet<infer ItemType>>
	? ReadonlySetDeep<ItemType>
	: T extends object
	? ReadonlyObjectDeep<T>
	: unknown;

/**
Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`.
*/
interface ReadonlyMapDeep<KeyType, ValueType>
	extends Readonly<ReadonlyMap<ReadonlyDeep<KeyType>, ReadonlyDeep<ValueType>>> {}

/**
Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`.
*/
interface ReadonlySetDeep<ItemType>
	extends Readonly<ReadonlySet<ReadonlyDeep<ItemType>>> {}

/**
Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`.
*/
type ReadonlyObjectDeep<ObjectType extends object> = {
	readonly [KeyType in keyof ObjectType]: ReadonlyDeep<ObjectType[KeyType]>
};

/**
Test if the given function has multiple call signatures.

Needed to handle the case of a single call signature with properties.

Multiple call signatures cannot currently be supported due to a TypeScript limitation.
@see https://github.com/microsoft/TypeScript/issues/29732
*/
type HasMultipleCallSignatures<T extends (...arguments: any[]) => unknown> =
	T extends {(...arguments: infer A): unknown; (...arguments: any[]): unknown}
		? unknown[] extends A
			? false
			: true
		: false;
/**
Creates a read-only tuple of type `Element` and with the length of `Length`.

@private
@see `ReadonlyTuple` which is safer because it tests if `Length` is a specific finite number.
*/
type BuildTupleHelper<Element, Length extends number, Rest extends Element[]> =
	Rest['length'] extends Length ?
		readonly [...Rest] : // Terminate with readonly array (aka tuple)
		BuildTupleHelper<Element, Length, [Element, ...Rest]>;

/**
Create a type that represents a read-only tuple of the given type and length.

Use-cases:
- Declaring fixed-length tuples with a large number of items.
- Creating a range union (for example, `0 | 1 | 2 | 3 | 4` from the keys of such a type) without having to resort to recursive types.
- Creating a tuple of coordinates with a static length, for example, length of 3 for a 3D vector.

@example
```
import {ReadonlyTuple} from 'type-fest';

type FencingTeam = ReadonlyTuple<string, 3>;

const guestFencingTeam: FencingTeam = ['Josh', 'Michael', 'Robert'];

const homeFencingTeam: FencingTeam = ['George', 'John'];
//=> error TS2322: Type string[] is not assignable to type 'FencingTeam'

guestFencingTeam.push('Sam');
//=> error TS2339: Property 'push' does not exist on type 'FencingTeam'
```

@category Utilities
*/
export type ReadonlyTuple<Element, Length extends number> =
	number extends Length
		// Because `Length extends number` and `number extends Length`, then `Length` is not a specific finite number.
		? readonly Element[] // It's not fixed length.
		: BuildTupleHelper<Element, Length, []>; // Otherwise it is a fixed length tuple.
/**
Remove any index signatures from the given object type, so that only explicitly defined properties remain.

Use-cases:
- Remove overly permissive signatures from third-party types.

This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).

It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.

(The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)

```
const indexed: Record<string, unknown> = {}; // Allowed

const keyed: Record<'foo', unknown> = {}; // Error
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
```

Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:

```
type Indexed = {} extends Record<string, unknown>
	? '✅ `{}` is assignable to `Record<string, unknown>`'
	: '❌ `{}` is NOT assignable to `Record<string, unknown>`';
// => '✅ `{}` is assignable to `Record<string, unknown>`'

type Keyed = {} extends Record<'foo' | 'bar', unknown>
	? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
	: "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
```

Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...

```
import type {RemoveIndexSignature} from 'type-fest';

type RemoveIndexSignature<ObjectType> = {
	[KeyType in keyof ObjectType // Map each key of `ObjectType`...
	]: ObjectType[KeyType]; // ...to its original value, i.e. `RemoveIndexSignature<Foo> == Foo`.
};
```

...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...

```
import type {RemoveIndexSignature} from 'type-fest';

type RemoveIndexSignature<ObjectType> = {
	[KeyType in keyof ObjectType
		// Is `{}` assignable to `Record<KeyType, unknown>`?
		as {} extends Record<KeyType, unknown>
			? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
			: ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
	]: ObjectType[KeyType];
};
```

If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.

```
import type {RemoveIndexSignature} from 'type-fest';

type RemoveIndexSignature<ObjectType> = {
	[KeyType in keyof ObjectType
		as {} extends Record<KeyType, unknown>
			? never // => Remove this `KeyType`.
			: KeyType // => Keep this `KeyType` as it is.
	]: ObjectType[KeyType];
};
```

@example
```
import type {RemoveIndexSignature} from 'type-fest';

interface Example {
	// These index signatures will be removed.
	[x: string]: any
	[x: number]: any
	[x: symbol]: any
	[x: `head-${string}`]: string
	[x: `${string}-tail`]: string
	[x: `head-${string}-tail`]: string
	[x: `${bigint}`]: string
	[x: `embedded-${number}`]: string

	// These explicitly defined keys will remain.
	foo: 'bar';
	qux?: 'baz';
}

type ExampleWithoutIndexSignatures = RemoveIndexSignature<Example>;
// => { foo: 'bar'; qux?: 'baz' | undefined; }
```

@category Object
*/
export type RemoveIndexSignature<ObjectType> = {
	[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
		? never
		: KeyType]: ObjectType[KeyType];
};
type ReplaceOptions = {
	all?: boolean;
};

/**
Represents a string with some or all matches replaced by a replacement.

Use-case:
- `snake-case-path` to `dotted.path.notation`
- Changing date/time format: `01-08-2042` → `01/08/2042`
- Manipulation of type properties, for example, removal of prefixes

@example
```
import {Replace} from 'type-fest';

declare function replace<
	Input extends string,
	Search extends string,
	Replacement extends string
>(
	input: Input,
	search: Search,
	replacement: Replacement
): Replace<Input, Search, Replacement>;

declare function replaceAll<
	Input extends string,
	Search extends string,
	Replacement extends string
>(
	input: Input,
	search: Search,
	replacement: Replacement
): Replace<Input, Search, Replacement, {all: true}>;

// The return type is the exact string literal, not just `string`.

replace('hello ?', '?', '🦄');
//=> 'hello 🦄'

replace('hello ??', '?', '❓');
//=> 'hello ❓?'

replaceAll('10:42:00', ':', '-');
//=> '10-42-00'

replaceAll('__userName__', '__', '');
//=> 'userName'

replaceAll('My Cool Title', ' ', '');
//=> 'MyCoolTitle'
```

@category String
@category Template literal
*/
export type Replace<
	Input extends string,
	Search extends string,
	Replacement extends string,
	Options extends ReplaceOptions = {},
> = Input extends `${infer Head}${Search}${infer Tail}`
	? Options['all'] extends true
		? `${Head}${Replacement}${Replace<Tail, Search, Replacement, Options>}`
		: `${Head}${Replacement}${Tail}`
	: Input;
/**
Create a type that requires all of the given keys or none of the given keys. The remaining keys are kept as is.

Use-cases:
- Creating interfaces for components with mutually-inclusive keys.

The caveat with `RequireAllOrNone` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireAllOrNone` can't do anything to prevent extra keys it doesn't know about.

@example
```
import type {RequireAllOrNone} from 'type-fest';

type Responder = {
	text?: () => string;
	json?: () => string;
	secure: boolean;
};

const responder1: RequireAllOrNone<Responder, 'text' | 'json'> = {
	secure: true
};

const responder2: RequireAllOrNone<Responder, 'text' | 'json'> = {
	text: () => '{"message": "hi"}',
	json: () => '{"message": "ok"}',
	secure: true
};
```

@category Object
*/
export type RequireAllOrNone<ObjectType, KeysType extends keyof ObjectType = never> = (
	| Required<Pick<ObjectType, KeysType>> // Require all of the given keys.
	| Partial<Record<KeysType, never>> // Require none of the given keys.
) &
	Omit<ObjectType, KeysType>; // The rest of the keys.
import type {Except} from './except';

/**
Create a type that requires at least one of the given keys. The remaining keys are kept as is.

@example
```
import type {RequireAtLeastOne} from 'type-fest';

type Responder = {
	text?: () => string;
	json?: () => string;

	secure?: boolean;
};

const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
	json: () => '{"message": "ok"}',
	secure: true
};
```

@category Object
*/
export type RequireAtLeastOne<
	ObjectType,
	KeysType extends keyof ObjectType = keyof ObjectType,
> = {
	// For each `Key` in `KeysType` make a mapped type:
	[Key in KeysType]-?: Required<Pick<ObjectType, Key>> & // 1. Make `Key`'s type required
		// 2. Make all other keys in `KeysType` optional
		Partial<Pick<ObjectType, Exclude<KeysType, Key>>>;
}[KeysType] &
	// 3. Add the remaining keys not in `KeysType`
	Except<ObjectType, KeysType>;
/**
Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is.

Use-cases:
- Creating interfaces for components that only need one of the keys to display properly.
- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`.

The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about.

@example
```
import type {RequireExactlyOne} from 'type-fest';

type Responder = {
	text: () => string;
	json: () => string;
	secure: boolean;
};

const responder: RequireExactlyOne<Responder, 'text' | 'json'> = {
	// Adding a `text` key here would cause a compile error.

	json: () => '{"message": "ok"}',
	secure: true
};
```

@category Object
*/
export type RequireExactlyOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> =
	{[Key in KeysType]: (
		Required<Pick<ObjectType, Key>> &
		Partial<Record<Exclude<KeysType, Key>, never>>
	)}[KeysType] & Omit<ObjectType, KeysType>;
/**
Extract all required keys from the given type.

This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...

@example
```
import type {RequiredKeysOf} from 'type-fest';

declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;

interface User {
	name: string;
	surname: string;

	luckyNumber?: number;
}

const validator1 = createValidation<User>('name', value => value.length < 25);
const validator2 = createValidation<User>('surname', value => value.length < 25);
```

@category Utilities
*/
export type RequiredKeysOf<BaseType extends object> = Exclude<{
	[Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>
		? Key
		: never
}[keyof BaseType], undefined>;
/**
Create a deep version of another object type where property values are recursively replaced into a given value type.

Use-cases:
- Form validation: Define how each field should be validated.
- Form settings: Define configuration for input fields.
- Parsing: Define types that specify special behavior for specific fields.

@example
```
import type {Schema} from 'type-fest';

interface User {
	id: string;
	name: {
		firstname: string;
		lastname: string;
	};
	created: Date;
	active: boolean;
	passwordHash: string;
}

type UserMask = Schema<User, 'mask' | 'hide' | 'show'>;

const userMaskSettings: UserMask = {
	id: 'show',
	name: {
		firstname: 'show',
		lastname: 'mask',
	},
	phoneNumbers: 'mask',
	created: 'show',
	active: 'show',
	passwordHash: 'hide',
}
```

@category Object
*/
export type Schema<ObjectType, ValueType> = ObjectType extends string
	? ValueType
	: ObjectType extends Map<unknown, unknown>
	? ValueType
	: ObjectType extends Set<unknown>
	? ValueType
	: ObjectType extends ReadonlyMap<unknown, unknown>
	? ValueType
	: ObjectType extends ReadonlySet<unknown>
	? ValueType
	: ObjectType extends readonly unknown[]
	? ValueType
	: ObjectType extends unknown[]
	? ValueType
	: ObjectType extends (...arguments: unknown[]) => unknown
	? ValueType
	: ObjectType extends Date
	? ValueType
	: ObjectType extends Function
	? ValueType
	: ObjectType extends RegExp
	? ValueType
	: ObjectType extends object
	? SchemaObject<ObjectType, ValueType>
	: ValueType;

/**
Same as `Schema`, but accepts only `object`s as inputs. Internal helper for `Schema`.
*/
type SchemaObject<ObjectType extends object, K> = {
	[KeyType in keyof ObjectType]: Schema<ObjectType[KeyType], K> | K;
};
import type {SplitIncludingDelimiters} from './delimiter-case';
import type {SnakeCase} from './snake-case';
import type {Includes} from './includes';

/**
Returns a boolean for whether the string is screaming snake case.
*/
type IsScreamingSnakeCase<Value extends string> = Value extends Uppercase<Value>
	? Includes<SplitIncludingDelimiters<Lowercase<Value>, '_'>, '_'> extends true
		? true
		: false
	: false;

/**
Convert a string literal to screaming-snake-case.

This can be useful when, for example, converting a camel-cased object property to a screaming-snake-cased SQL column name.

@example
```
import type {ScreamingSnakeCase} from 'type-fest';

const someVariable: ScreamingSnakeCase<'fooBar'> = 'FOO_BAR';
```

@category Change case
@category Template literal
*/
export type ScreamingSnakeCase<Value> = Value extends string
	? IsScreamingSnakeCase<Value> extends true
		? Value
		: Uppercase<SnakeCase<Value>>
	: Value;
import type {Except} from './except';
import type {Simplify} from './simplify';

/**
Create a type that makes the given keys non-nullable. The remaining keys are kept as is.

Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are non-nullable.

@example
```
import type {SetNonNullable} from 'type-fest';

type Foo = {
	a: number;
	b: string | undefined;
	c?: boolean | null;
}

type SomeNonNullable = SetNonNullable<Foo, 'b' | 'c'>;
// type SomeNonNullable = {
// 	a: number;
// 	b: string; // Can no longer be undefined.
// 	c?: boolean; // Can no longer be null, but is still optional.
// }
```

@category Object
*/
export type SetNonNullable<BaseType, Keys extends keyof BaseType> =
	Simplify<
		// Pick just the keys that are readonly from the base type.
		Except<BaseType, Keys> &
		// Pick the keys that should be non-nullable from the base type and make them non-nullable.
		{[Key in Keys]: NonNullable<BaseType[Key]>}
	>;
import type {Except} from './except';
import type {Simplify} from './simplify';

/**
Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.

Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.

@example
```
import type {SetOptional} from 'type-fest';

type Foo = {
	a: number;
	b?: string;
	c: boolean;
}

type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
// type SomeOptional = {
// 	a: number;
// 	b?: string; // Was already optional and still is.
// 	c?: boolean; // Is now optional.
// }
```

@category Object
*/
export type SetOptional<BaseType, Keys extends keyof BaseType> =
	Simplify<
		// Pick just the keys that are readonly from the base type.
		Except<BaseType, Keys> &
		// Pick the keys that should be mutable from the base type and make them mutable.
		Partial<Pick<BaseType, Keys>>
	>;
import type {Except} from './except';
import type {Simplify} from './simplify';

/**
Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.

Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.

@example
```
import type {SetRequired} from 'type-fest';

type Foo = {
	a?: number;
	b: string;
	c?: boolean;
}

type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
// type SomeRequired = {
// 	a?: number;
// 	b: string; // Was already required and still is.
// 	c: boolean; // Is now required.
// }
```

@category Object
*/
export type SetRequired<BaseType, Keys extends keyof BaseType> =
	Simplify<
		// Pick just the keys that are optional from the base type.
		Except<BaseType, Keys> &
		// Pick the keys that should be required from the base type and make them required.
		Required<Pick<BaseType, Keys>>
	>;
type IsAny<T> = 0 extends (1 & T) ? true : false; // https://stackoverflow.com/a/49928360/3406963
type IsNever<T> = [T] extends [never] ? true : false;
type IsUnknown<T> = IsNever<T> extends false ? T extends unknown ? unknown extends T ? IsAny<T> extends false ? true : false : false : false : false;

/**
Create a function type with a return type of your choice and the same parameters as the given function type.

Use-case: You want to define a wrapped function that returns something different while receiving the same parameters. For example, you might want to wrap a function that can throw an error into one that will return `undefined` instead.

@example
```
import type {SetReturnType} from 'type-fest';

type MyFunctionThatCanThrow = (foo: SomeType, bar: unknown) => SomeOtherType;

type MyWrappedFunction = SetReturnType<MyFunctionThatCanThrow, SomeOtherType | undefined>;
//=> type MyWrappedFunction = (foo: SomeType, bar: unknown) => SomeOtherType | undefined;
```

@category Function
*/
export type SetReturnType<Fn extends (...args: any[]) => any, TypeToReturn> =
	// Just using `Parameters<Fn>` isn't ideal because it doesn't handle the `this` fake parameter.
	Fn extends (this: infer ThisArg, ...args: infer Arguments) => any ? (
		// If a function did not specify the `this` fake parameter, it will be inferred to `unknown`.
		// We want to detect this situation just to display a friendlier type upon hovering on an IntelliSense-powered IDE.
		IsUnknown<ThisArg> extends true ? (...args: Arguments) => TypeToReturn : (this: ThisArg, ...args: Arguments) => TypeToReturn
	) : (
		// This part should be unreachable, but we make it meaningful just in case…
		(...args: Parameters<Fn>) => TypeToReturn
	);
/**
@see Simplify
*/
export interface SimplifyOptions {
	/**
	Do the simplification recursively.

	@default false
	*/
	deep?: boolean;
}

// Flatten a type without worrying about the result.
type Flatten<
	AnyType,
	Options extends SimplifyOptions = {},
> = Options['deep'] extends true
	? {[KeyType in keyof AnyType]: Simplify<AnyType[KeyType], Options>}
	: {[KeyType in keyof AnyType]: AnyType[KeyType]};

/**
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.

@example
```
import type {Simplify} from 'type-fest';

type PositionProps = {
	top: number;
	left: number;
};

type SizeProps = {
	width: number;
	height: number;
};

// In your editor, hovering over `Props` will show a flattened object with all the properties.
type Props = Simplify<PositionProps & SizeProps>;
```

Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable.  But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.

If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument.  Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.

@example
```
import type {Simplify} from 'type-fest';

interface SomeInterface {
	foo: number;
	bar?: string;
	baz: number | undefined;
}

type SomeType = {
	foo: number;
	bar?: string;
	baz: number | undefined;
};

const literal = {foo: 123, bar: 'hello', baz: 456};
const someType: SomeType = literal;
const someInterface: SomeInterface = literal;

function fn(object: Record<string, unknown>): void {}

fn(literal); // Good: literal object type is sealed
fn(someType); // Good: type is sealed
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
```

@link https://github.com/microsoft/TypeScript/issues/15300

@category Object
*/
export type Simplify<
	AnyType,
	Options extends SimplifyOptions = {},
> = Flatten<AnyType> extends AnyType
	? Flatten<AnyType, Options>
	: AnyType;
import type {DelimiterCase} from './delimiter-case';

/**
Convert a string literal to snake-case.

This can be useful when, for example, converting a camel-cased object property to a snake-cased SQL column name.

@example
```
import type {SnakeCase} from 'type-fest';

// Simple

const someVariable: SnakeCase<'fooBar'> = 'foo_bar';

// Advanced

type SnakeCasedProperties<T> = {
	[K in keyof T as SnakeCase<K>]: T[K]
};

interface ModelProps {
	isHappy: boolean;
	fullFamilyName: string;
	foo: number;
}

const dbResult: SnakeCasedProperties<ModelProps> = {
	'is_happy': true,
	'full_family_name': 'Carla Smith',
	foo: 123
};
```

@category Change case
@category Template literal
*/
export type SnakeCase<Value> = DelimiterCase<Value, '_'>;
import type {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep';

/**
Convert object properties to snake case recursively.

This can be useful when, for example, converting some API types from a different style.

@see SnakeCase
@see SnakeCasedProperties

@example
```
import type {SnakeCasedPropertiesDeep} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

interface UserWithFriends {
	userInfo: User;
	userFriends: User[];
}

const result: SnakeCasedPropertiesDeep<UserWithFriends> = {
	user_info: {
		user_id: 1,
		user_name: 'Tom',
	},
	user_friends: [
		{
			user_id: 2,
			user_name: 'Jerry',
		},
		{
			user_id: 3,
			user_name: 'Spike',
		},
	],
};
```

@category Change case
@category Template literal
@category Object
*/
export type SnakeCasedPropertiesDeep<Value> = DelimiterCasedPropertiesDeep<Value, '_'>;
import type {DelimiterCasedProperties} from './delimiter-cased-properties';

/**
Convert object properties to snake case but not recursively.

This can be useful when, for example, converting some API types from a different style.

@see SnakeCase
@see SnakeCasedPropertiesDeep

@example
```
import type {SnakeCasedProperties} from 'type-fest';

interface User {
	userId: number;
	userName: string;
}

const result: SnakeCasedProperties<User> = {
	user_id: 1,
	user_name: 'Tom',
};
```

@category Change case
@category Template literal
@category Object
*/
export type SnakeCasedProperties<Value> = DelimiterCasedProperties<Value, '_'>;
/**
Represents an array of strings split using a given character or character set.

Use-case: Defining the return type of a method like `String.prototype.split`.

@example
```
import type {Split} from 'type-fest';

declare function split<S extends string, D extends string>(string: S, separator: D): Split<S, D>;

type Item = 'foo' | 'bar' | 'baz' | 'waldo';
const items = 'foo,bar,baz,waldo';
let array: Item[];

array = split(items, ',');
```

@category String
@category Template literal
*/
export type Split<
	S extends string,
	Delimiter extends string,
> = S extends `${infer Head}${Delimiter}${infer Tail}`
	? [Head, ...Split<Tail, Delimiter>]
	: S extends Delimiter
	? []
	: [S];
import type {Except} from './except';
import type {RequiredKeysOf} from './required-keys-of';
import type {Simplify} from './simplify';

type SpreadObject<FirstType extends object, SecondType extends object> = {
	[Key in keyof FirstType]: Key extends keyof SecondType
		? FirstType[Key] | Required<SecondType>[Key]
		: FirstType[Key];
} & Pick<
	SecondType,
	RequiredKeysOf<SecondType> | Exclude<keyof SecondType, keyof FirstType>
>;

type TupleOrArray = readonly [...unknown[]];

type SpreadTupleOrArray<
	FirstType extends TupleOrArray,
	SecondType extends TupleOrArray,
> = Array<FirstType[number] | SecondType[number]>;

type Spreadable = object | TupleOrArray;

/**
Mimic the type inferred by TypeScript when merging two objects or two arrays/tuples using the spread syntax.

@example
```
import type {Spread} from 'type-fest';

type Foo = {
	a: number;
	b?: string;
};

type Bar = {
	b?: number;
	c: boolean;
};

const foo = {a: 1, b: '2'};
const bar = {c: false};
const fooBar = {...foo, ...bar};

type FooBar = Spread<Foo, Bar>;
// type FooBar = {
// 	a: number;
// 	b?: string | number | undefined;
// 	c: boolean;
// }

const baz = (argument: FooBar) => {
	// Do something
}

baz(fooBar);
```

@example
```
import type {Spread} from 'type-fest';

const foo = [1, 2, 3];
const bar = ['4', '5', '6'];

const fooBar = [...foo, ...bar];
type FooBar = Spread<typeof foo, typeof bar>;
// FooBar = (string | number)[]

const baz = (argument: FooBar) => {
	// Do something
};

baz(fooBar);
```

@category Object
*/
export type Spread<
    FirstType extends Spreadable,
    SecondType extends Spreadable,
> = FirstType extends TupleOrArray
	? SecondType extends TupleOrArray
		? SpreadTupleOrArray<FirstType, SecondType>
		: Simplify<SpreadObject<FirstType, SecondType>>
	: Simplify<SpreadObject<FirstType, SecondType>>;
/**
Get keys of the given type as strings.

Number keys are converted to strings.

Use-cases:
- Get string keys from a type which may have number keys.
- Makes it possible to index using strings retrieved from template types.

@example
```
import type {StringKeyOf} from 'type-fest';

type Foo = {
	1: number,
	stringKey: string,
};

type StringKeysOfFoo = StringKeyOf<Foo>;
//=> '1' | 'stringKey'
```

@category Object
*/
export type StringKeyOf<BaseType> = `${Extract<keyof BaseType, string | number>}`;
/**
Create a type with the keys of the given type changed to `string` type.

Use-case: Changing interface values to strings in order to use them in a form model.

@example
```
import type {Stringified} from 'type-fest';

type Car {
	model: string;
	speed: number;
}

const carForm: Stringified<Car> = {
	model: 'Foo',
	speed: '101'
};
```

@category Object
*/
export type Stringified<ObjectType> = {[KeyType in keyof ObjectType]: string};
/**
Remove spaces from the left side.
*/
type TrimLeft<V extends string> = V extends ` ${infer R}` ? TrimLeft<R> : V;

/**
Remove spaces from the right side.
*/
type TrimRight<V extends string> = V extends `${infer R} ` ? TrimRight<R> : V;

/**
Remove leading and trailing spaces from a string.

@example
```
import type {Trim} from 'type-fest';

Trim<' foo '>
//=> 'foo'
```

@category String
@category Template literal
*/
export type Trim<V extends string> = TrimLeft<TrimRight<V>>;
declare namespace TsConfigJson {
	namespace CompilerOptions {
		export type JSX =
			| 'preserve'
			| 'react'
			| 'react-jsx'
			| 'react-jsxdev'
			| 'react-native';

		export type Module =
			| 'CommonJS'
			| 'AMD'
			| 'System'
			| 'UMD'
			| 'ES6'
			| 'ES2015'
			| 'ES2020'
			| 'ES2022'
			| 'ESNext'
			| 'None'
			// Lowercase alternatives
			| 'commonjs'
			| 'amd'
			| 'system'
			| 'umd'
			| 'es6'
			| 'es2015'
			| 'es2020'
			| 'es2022'
			| 'esnext'
			| 'none';

		export type NewLine =
			| 'CRLF'
			| 'LF'
			// Lowercase alternatives
			| 'crlf'
			| 'lf';

		export type Target =
			| 'ES3'
			| 'ES5'
			| 'ES6'
			| 'ES2015'
			| 'ES2016'
			| 'ES2017'
			| 'ES2018'
			| 'ES2019'
			| 'ES2020'
			| 'ES2021'
			| 'ESNext'
			// Lowercase alternatives
			| 'es3'
			| 'es5'
			| 'es6'
			| 'es2015'
			| 'es2016'
			| 'es2017'
			| 'es2018'
			| 'es2019'
			| 'es2020'
			| 'es2021'
			| 'esnext';

		export type Lib =
			| 'ES5'
			| 'ES6'
			| 'ES7'
			| 'ES2015'
			| 'ES2015.Collection'
			| 'ES2015.Core'
			| 'ES2015.Generator'
			| 'ES2015.Iterable'
			| 'ES2015.Promise'
			| 'ES2015.Proxy'
			| 'ES2015.Reflect'
			| 'ES2015.Symbol.WellKnown'
			| 'ES2015.Symbol'
			| 'ES2016'
			| 'ES2016.Array.Include'
			| 'ES2017'
			| 'ES2017.Intl'
			| 'ES2017.Object'
			| 'ES2017.SharedMemory'
			| 'ES2017.String'
			| 'ES2017.TypedArrays'
			| 'ES2018'
			| 'ES2018.AsyncGenerator'
			| 'ES2018.AsyncIterable'
			| 'ES2018.Intl'
			| 'ES2018.Promise'
			| 'ES2018.Regexp'
			| 'ES2019'
			| 'ES2019.Array'
			| 'ES2019.Object'
			| 'ES2019.String'
			| 'ES2019.Symbol'
			| 'ES2020'
			| 'ES2020.BigInt'
			| 'ES2020.Promise'
			| 'ES2020.String'
			| 'ES2020.Symbol.WellKnown'
			| 'ES2020.SharedMemory'
			| 'ES2020.Intl'
			| 'ES2021'
			| 'ES2021.Promise'
			| 'ES2021.String'
			| 'ES2021.WeakRef'
			| 'ESNext'
			| 'ESNext.Array'
			| 'ESNext.AsyncIterable'
			| 'ESNext.BigInt'
			| 'ESNext.Intl'
			| 'ESNext.Promise'
			| 'ESNext.String'
			| 'ESNext.Symbol'
			| 'ESNext.WeakRef'
			| 'DOM'
			| 'DOM.Iterable'
			| 'ScriptHost'
			| 'WebWorker'
			| 'WebWorker.ImportScripts'
			| 'WebWorker.Iterable'
			// Lowercase alternatives
			| 'es5'
			| 'es6'
			| 'es7'
			| 'es2015'
			| 'es2015.collection'
			| 'es2015.core'
			| 'es2015.generator'
			| 'es2015.iterable'
			| 'es2015.promise'
			| 'es2015.proxy'
			| 'es2015.reflect'
			| 'es2015.symbol.wellknown'
			| 'es2015.symbol'
			| 'es2016'
			| 'es2016.array.include'
			| 'es2017'
			| 'es2017.intl'
			| 'es2017.object'
			| 'es2017.sharedmemory'
			| 'es2017.string'
			| 'es2017.typedarrays'
			| 'es2018'
			| 'es2018.asyncgenerator'
			| 'es2018.asynciterable'
			| 'es2018.intl'
			| 'es2018.promise'
			| 'es2018.regexp'
			| 'es2019'
			| 'es2019.array'
			| 'es2019.object'
			| 'es2019.string'
			| 'es2019.symbol'
			| 'es2020'
			| 'es2020.bigint'
			| 'es2020.promise'
			| 'es2020.string'
			| 'es2020.symbol.wellknown'
			| 'es2020.sharedmemory'
			| 'es2020.intl'
			| 'es2021'
			| 'es2021.promise'
			| 'es2021.string'
			| 'es2021.weakref'
			| 'esnext'
			| 'esnext.array'
			| 'esnext.asynciterable'
			| 'esnext.bigint'
			| 'esnext.intl'
			| 'esnext.promise'
			| 'esnext.string'
			| 'esnext.symbol'
			| 'esnext.weakref'
			| 'dom'
			| 'dom.iterable'
			| 'scripthost'
			| 'webworker'
			| 'webworker.importscripts'
			| 'webworker.iterable';

		export interface Plugin {
			[key: string]: unknown;
			/**
			Plugin name.
			*/
			name?: string;
		}

		export type ImportsNotUsedAsValues =
			| 'remove'
			| 'preserve'
			| 'error';

		export type FallbackPolling =
			| 'fixedPollingInterval'
			| 'priorityPollingInterval'
			| 'dynamicPriorityPolling'
			| 'fixedInterval'
			| 'priorityInterval'
			| 'dynamicPriority'
			| 'fixedChunkSize';

		export type WatchDirectory =
			| 'useFsEvents'
			| 'fixedPollingInterval'
			| 'dynamicPriorityPolling'
			| 'fixedChunkSizePolling';

		export type WatchFile =
			| 'fixedPollingInterval'
			| 'priorityPollingInterval'
			| 'dynamicPriorityPolling'
			| 'useFsEvents'
			| 'useFsEventsOnParentDirectory'
			| 'fixedChunkSizePolling';

	}

	export interface CompilerOptions {
		/**
		The character set of the input files.

		@default 'utf8'
		*/
		charset?: string;

		/**
		Enables building for project references.

		@default true
		*/
		composite?: boolean;

		/**
		Generates corresponding d.ts files.

		@default false
		*/
		declaration?: boolean;

		/**
		Specify output directory for generated declaration files.

		Requires TypeScript version 2.0 or later.
		*/
		declarationDir?: string;

		/**
		Show diagnostic information.

		@default false
		*/
		diagnostics?: boolean;

		/**
		Reduce the number of projects loaded automatically by TypeScript.

		Requires TypeScript version 4.0 or later.

		@default false
		*/
		disableReferencedProjectLoad?: boolean;

		/**
		Enforces using indexed accessors for keys declared using an indexed type.

		Requires TypeScript version 4.2 or later.

		@default false
		*/
		noPropertyAccessFromIndexSignature?: boolean;

		/**
		Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.

		@default false
		*/
		emitBOM?: boolean;

		/**
		Only emit `.d.ts` declaration files.

		@default false
		*/
		emitDeclarationOnly?: boolean;

		/**
		Differentiate between undefined and not present when type checking.

		Requires TypeScript version 4.4 or later.

		@default false
		*/
		exactOptionalPropertyTypes?: boolean;

		/**
		Enable incremental compilation.

		@default `composite`
		*/
		incremental?: boolean;

		/**
		Specify file to store incremental compilation information.

		@default '.tsbuildinfo'
		*/
		tsBuildInfoFile?: string;

		/**
		Emit a single file with source maps instead of having a separate file.

		@default false
		*/
		inlineSourceMap?: boolean;

		/**
		Emit the source alongside the sourcemaps within a single file.

		Requires `--inlineSourceMap` to be set.

		@default false
		*/
		inlineSources?: boolean;

		/**
		Specify what JSX code is generated.

		@default 'preserve'
		*/
		jsx?: CompilerOptions.JSX;

		/**
		Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit.

		@default 'React'
		*/
		reactNamespace?: string;

		/**
		Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`.

		Requires TypeScript version 2.1 or later.

		@default 'React.createElement'
		*/
		jsxFactory?: string;

		/**
		Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.

		Requires TypeScript version 4.0 or later.

		@default 'React.Fragment'
		*/
		jsxFragmentFactory?: string;

		/**
		Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.

		Requires TypeScript version 4.1 or later.

		@default 'react'
		*/
		jsxImportSource?: string;

		/**
		Print names of files part of the compilation.

		@default false
		*/
		listFiles?: boolean;

		/**
		Specifies the location where debugger should locate map files instead of generated locations.
		*/
		mapRoot?: string;

		/**
		Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower.

		@default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6'
		*/
		module?: CompilerOptions.Module;

		/**
		Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6).

		@default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
		*/
		moduleResolution?: 'classic' | 'node';

		/**
		Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).

		Default: Platform specific
		*/
		newLine?: CompilerOptions.NewLine;

		/**
		Do not emit output.

		@default false
		*/
		noEmit?: boolean;

		/**
		Do not generate custom helper functions like `__extends` in compiled output.

		@default false
		*/
		noEmitHelpers?: boolean;

		/**
		Do not emit outputs if any type checking errors were reported.

		@default false
		*/
		noEmitOnError?: boolean;

		/**
		Warn on expressions and declarations with an implied 'any' type.

		@default false
		*/
		noImplicitAny?: boolean;

		/**
		Raise error on 'this' expressions with an implied any type.

		@default false
		*/
		noImplicitThis?: boolean;

		/**
		Report errors on unused locals.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		noUnusedLocals?: boolean;

		/**
		Report errors on unused parameters.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		noUnusedParameters?: boolean;

		/**
		Do not include the default library file (lib.d.ts).

		@default false
		*/
		noLib?: boolean;

		/**
		Do not add triple-slash references or module import targets to the list of compiled files.

		@default false
		*/
		noResolve?: boolean;

		/**
		Disable strict checking of generic signatures in function types.

		@default false
		*/
		noStrictGenericChecks?: boolean;

		/**
		@deprecated use `skipLibCheck` instead.
		*/
		skipDefaultLibCheck?: boolean;

		/**
		Skip type checking of declaration files.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		skipLibCheck?: boolean;

		/**
		Concatenate and emit output to single file.
		*/
		outFile?: string;

		/**
		Redirect output structure to the directory.
		*/
		outDir?: string;

		/**
		Do not erase const enum declarations in generated code.

		@default false
		*/
		preserveConstEnums?: boolean;

		/**
		Do not resolve symlinks to their real path; treat a symlinked file like a real one.

		@default false
		*/
		preserveSymlinks?: boolean;

		/**
		Keep outdated console output in watch mode instead of clearing the screen.

		@default false
		*/
		preserveWatchOutput?: boolean;

		/**
		Stylize errors and messages using color and context (experimental).

		@default true // Unless piping to another program or redirecting output to a file.
		*/
		pretty?: boolean;

		/**
		Do not emit comments to output.

		@default false
		*/
		removeComments?: boolean;

		/**
		Specifies the root directory of input files.

		Use to control the output directory structure with `--outDir`.
		*/
		rootDir?: string;

		/**
		Unconditionally emit imports for unresolved files.

		@default false
		*/
		isolatedModules?: boolean;

		/**
		Generates corresponding '.map' file.

		@default false
		*/
		sourceMap?: boolean;

		/**
		Specifies the location where debugger should locate TypeScript files instead of source locations.
		*/
		sourceRoot?: string;

		/**
		Suppress excess property checks for object literals.

		@default false
		*/
		suppressExcessPropertyErrors?: boolean;

		/**
		Suppress noImplicitAny errors for indexing objects lacking index signatures.

		@default false
		*/
		suppressImplicitAnyIndexErrors?: boolean;

		/**
		Do not emit declarations for code that has an `@internal` annotation.
		*/
		stripInternal?: boolean;

		/**
		Specify ECMAScript target version.

		@default 'es3'
		*/
		target?: CompilerOptions.Target;

		/**
		Default catch clause variables as `unknown` instead of `any`.

		Requires TypeScript version 4.4 or later.

		@default false
		*/
		useUnknownInCatchVariables?: boolean;

		/**
		Watch input files.

		@default false
		@deprecated Use watchOptions instead.
		*/
		watch?: boolean;

		/**
		Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.

		Requires TypeScript version 3.8 or later.

		@deprecated Use watchOptions.fallbackPolling instead.
		*/
		fallbackPolling?: CompilerOptions.FallbackPolling;

		/**
		Specify the strategy for watching directories under systems that lack recursive file-watching functionality.

		Requires TypeScript version 3.8 or later.

		@default 'useFsEvents'
		@deprecated Use watchOptions.watchDirectory instead.
		*/
		watchDirectory?: CompilerOptions.WatchDirectory;

		/**
		Specify the strategy for watching individual files.

		Requires TypeScript version 3.8 or later.

		@default 'useFsEvents'
		@deprecated Use watchOptions.watchFile instead.
		*/
		watchFile?: CompilerOptions.WatchFile;

		/**
		Enables experimental support for ES7 decorators.

		@default false
		*/
		experimentalDecorators?: boolean;

		/**
		Emit design-type metadata for decorated declarations in source.

		@default false
		*/
		emitDecoratorMetadata?: boolean;

		/**
		Do not report errors on unused labels.

		@default false
		*/
		allowUnusedLabels?: boolean;

		/**
		Report error when not all code paths in function return a value.

		@default false
		*/
		noImplicitReturns?: boolean;

		/**
		Add `undefined` to a type when accessed using an index.

		Requires TypeScript version 4.1 or later.

		@default false
		*/
		noUncheckedIndexedAccess?: boolean;

		/**
		Report errors for fallthrough cases in switch statement.

		@default false
		*/
		noFallthroughCasesInSwitch?: boolean;

		/**
		Ensure overriding members in derived classes are marked with an override modifier.

		@default false
		*/
		noImplicitOverride?: boolean;

		/**
		Do not report errors on unreachable code.

		@default false
		*/
		allowUnreachableCode?: boolean;

		/**
		Disallow inconsistently-cased references to the same file.

		@default false
		*/
		forceConsistentCasingInFileNames?: boolean;

		/**
		Emit a v8 CPU profile of the compiler run for debugging.

		Requires TypeScript version 3.7 or later.

		@default 'profile.cpuprofile'
		*/
		generateCpuProfile?: string;

		/**
		Base directory to resolve non-relative module names.
		*/
		baseUrl?: string;

		/**
		Specify path mapping to be computed relative to baseUrl option.
		*/
		paths?: Record<string, string[]>;

		/**
		List of TypeScript language server plugins to load.

		Requires TypeScript version 2.3 or later.
		*/
		plugins?: CompilerOptions.Plugin[];

		/**
		Specify list of root directories to be used when resolving modules.
		*/
		rootDirs?: string[];

		/**
		Specify list of directories for type definition files to be included.

		Requires TypeScript version 2.0 or later.
		*/
		typeRoots?: string[];

		/**
		Type declaration files to be included in compilation.

		Requires TypeScript version 2.0 or later.
		*/
		types?: string[];

		/**
		Enable tracing of the name resolution process.

		@default false
		*/
		traceResolution?: boolean;

		/**
		Allow javascript files to be compiled.

		@default false
		*/
		allowJs?: boolean;

		/**
		Do not truncate error messages.

		@default false
		*/
		noErrorTruncation?: boolean;

		/**
		Allow default imports from modules with no default export. This does not affect code emit, just typechecking.

		@default module === 'system' || esModuleInterop
		*/
		allowSyntheticDefaultImports?: boolean;

		/**
		Do not emit `'use strict'` directives in module output.

		@default false
		*/
		noImplicitUseStrict?: boolean;

		/**
		Enable to list all emitted files.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		listEmittedFiles?: boolean;

		/**
		Disable size limit for JavaScript project.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		disableSizeLimit?: boolean;

		/**
		List of library files to be included in the compilation.

		Requires TypeScript version 2.0 or later.
		*/
		lib?: CompilerOptions.Lib[];

		/**
		Enable strict null checks.

		Requires TypeScript version 2.0 or later.

		@default false
		*/
		strictNullChecks?: boolean;

		/**
		The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`.

		@default 0
		*/
		maxNodeModuleJsDepth?: number;

		/**
		Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib.

		Requires TypeScript version 2.1 or later.

		@default false
		*/
		importHelpers?: boolean;

		/**
		Specify emit/checking behavior for imports that are only used for types.

		@default 'remove'
		*/
		importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues;

		/**
		Parse in strict mode and emit `'use strict'` for each source file.

		Requires TypeScript version 2.1 or later.

		@default false
		*/
		alwaysStrict?: boolean;

		/**
		Enable all strict type checking options.

		Requires TypeScript version 2.3 or later.

		@default false
		*/
		strict?: boolean;

		/**
		Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.

		@default false
		*/
		strictBindCallApply?: boolean;

		/**
		Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`.

		Requires TypeScript version 2.3 or later.

		@default false
		*/
		downlevelIteration?: boolean;

		/**
		Report errors in `.js` files.

		Requires TypeScript version 2.3 or later.

		@default false
		*/
		checkJs?: boolean;

		/**
		Disable bivariant parameter checking for function types.

		Requires TypeScript version 2.6 or later.

		@default false
		*/
		strictFunctionTypes?: boolean;

		/**
		Ensure non-undefined class properties are initialized in the constructor.

		Requires TypeScript version 2.7 or later.

		@default false
		*/
		strictPropertyInitialization?: boolean;

		/**
		Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility.

		Requires TypeScript version 2.7 or later.

		@default false
		*/
		esModuleInterop?: boolean;

		/**
		Allow accessing UMD globals from modules.

		@default false
		*/
		allowUmdGlobalAccess?: boolean;

		/**
		Resolve `keyof` to string valued property names only (no numbers or symbols).

		Requires TypeScript version 2.9 or later.

		@default false
		*/
		keyofStringsOnly?: boolean;

		/**
		Emit ECMAScript standard class fields.

		Requires TypeScript version 3.7 or later.

		@default false
		*/
		useDefineForClassFields?: boolean;

		/**
		Generates a sourcemap for each corresponding `.d.ts` file.

		Requires TypeScript version 2.9 or later.

		@default false
		*/
		declarationMap?: boolean;

		/**
		Include modules imported with `.json` extension.

		Requires TypeScript version 2.9 or later.

		@default false
		*/
		resolveJsonModule?: boolean;

		/**
		Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.

		Requires TypeScript version 3.8 or later.

		@default false
		*/
		assumeChangesOnlyAffectDirectDependencies?: boolean;

		/**
		Output more detailed compiler performance information after building.

		@default false
		*/
		extendedDiagnostics?: boolean;

		/**
		Print names of files that are part of the compilation and then stop processing.

		@default false
		*/
		listFilesOnly?: boolean;

		/**
		Disable preferring source files instead of declaration files when referencing composite projects.

		@default true if composite, false otherwise
		*/
		disableSourceOfProjectReferenceRedirect?: boolean;

		/**
		Opt a project out of multi-project reference checking when editing.

		Requires TypeScript version 3.8 or later.

		@default false
		*/
		disableSolutionSearching?: boolean;

		/**
		Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.

		Requires TypeScript version 4.2 or later.

		@default false
		*/
		explainFiles?: boolean;
	}

	namespace WatchOptions {
		export type WatchFileKind =
			| 'FixedPollingInterval'
			| 'PriorityPollingInterval'
			| 'DynamicPriorityPolling'
			| 'FixedChunkSizePolling'
			| 'UseFsEvents'
			| 'UseFsEventsOnParentDirectory';

		export type WatchDirectoryKind =
			| 'UseFsEvents'
			| 'FixedPollingInterval'
			| 'DynamicPriorityPolling'
			| 'FixedChunkSizePolling';

		export type PollingWatchKind =
			| 'FixedInterval'
			| 'PriorityInterval'
			| 'DynamicPriority'
			| 'FixedChunkSize';
	}

	export interface WatchOptions {

		/**
		Specify the strategy for watching individual files.

		Requires TypeScript version 3.8 or later.

		@default 'UseFsEvents'
		*/
		watchFile?: WatchOptions.WatchFileKind | Lowercase<WatchOptions.WatchFileKind>;

		/**
		Specify the strategy for watching directories under systems that lack recursive file-watching functionality.

		Requires TypeScript version 3.8 or later.

		@default 'UseFsEvents'
		*/
		watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase<WatchOptions.WatchDirectoryKind>;

		/**
		Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.

		Requires TypeScript version 3.8 or later.
		*/
		fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>;

		/**
		Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively.
		*/
		synchronousWatchDirectory?: boolean;

		/**
		Specifies a list of directories to exclude from watch
		*/
		excludeDirectories?: string[];

		/**
		Specifies a list of files to exclude from watch
		*/
		excludeFiles?: string[];
	}

	/**
	Auto type (.d.ts) acquisition options for this project.

	Requires TypeScript version 2.1 or later.
	*/
	export interface TypeAcquisition {
		/**
		Enable auto type acquisition.
		*/
		enable?: boolean;

		/**
		Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`.
		*/
		include?: string[];

		/**
		Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
		*/
		exclude?: string[];
	}

	export interface References {
		/**
		A normalized path on disk.
		*/
		path: string;

		/**
		The path as the user originally wrote it.
		*/
		originalPath?: string;

		/**
		True if the output of this reference should be prepended to the output of this project.

		Only valid for `--outFile` compilations.
		*/
		prepend?: boolean;

		/**
		True if it is intended that this reference form a circularity.
		*/
		circular?: boolean;
	}
}

/**
Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).

@category File
*/
export interface TsConfigJson {
	/**
	Instructs the TypeScript compiler how to compile `.ts` files.
	*/
	compilerOptions?: TsConfigJson.CompilerOptions;

	/**
	Instructs the TypeScript compiler how to watch files.
	*/
	watchOptions?: TsConfigJson.WatchOptions;

	/**
	Auto type (.d.ts) acquisition options for this project.

	Requires TypeScript version 2.1 or later.
	*/
	typeAcquisition?: TsConfigJson.TypeAcquisition;

	/**
	Enable Compile-on-Save for this project.
	*/
	compileOnSave?: boolean;

	/**
	Path to base configuration file to inherit from.

	Requires TypeScript version 2.1 or later.
	*/
	extends?: string;

	/**
	If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
	*/
	files?: string[];

	/**
	Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.

	Glob patterns require TypeScript version 2.0 or later.
	*/
	exclude?: string[];

	/**
	Specifies a list of glob patterns that match files to be included in compilation.

	If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.

	Requires TypeScript version 2.0 or later.
	*/
	include?: string[];

	/**
	Referenced projects.

	Requires TypeScript version 3.0 or later.
	*/
	references?: TsConfigJson.References[];
}
/**
Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.

@category Array
*/
export type TypedArray =
	| Int8Array
	| Uint8Array
	| Uint8ClampedArray
	| Int16Array
	| Uint16Array
	| Int32Array
	| Uint32Array
	| Float32Array
	| Float64Array
	| BigInt64Array
	| BigUint64Array;
/**
Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).

Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).

@example
```
import type {UnionToIntersection} from 'type-fest';

type Union = {the(): void} | {great(arg: string): void} | {escape: boolean};

type Intersection = UnionToIntersection<Union>;
//=> {the(): void; great(arg: string): void; escape: boolean};
```

A more applicable example which could make its way into your library code follows.

@example
```
import type {UnionToIntersection} from 'type-fest';

class CommandOne {
	commands: {
		a1: () => undefined,
		b1: () => undefined,
	}
}

class CommandTwo {
	commands: {
		a2: (argA: string) => undefined,
		b2: (argB: string) => undefined,
	}
}

const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
type Union = typeof union;
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}

type Intersection = UnionToIntersection<Union>;
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
```

@category Type
*/
export type UnionToIntersection<Union> = (
	// `extends unknown` is always going to be the case and is used to convert the
	// `Union` into a [distributive conditional
	// type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
	Union extends unknown
		// The union type is used as the only argument to a function since the union
		// of function arguments is an intersection.
		? (distributedUnion: Union) => void
		// This won't happen.
		: never
		// Infer the `Intersection` type since TypeScript represents the positional
		// arguments of unions of functions as an intersection of the union.
	) extends ((mergedIntersection: infer Intersection) => void)
		? Intersection
		: never;
/**
Create a union of the given object's values, and optionally specify which keys to get the values from.

Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31438) if you want to have this type as a built-in in TypeScript.

@example
```
// data.json
{
	'foo': 1,
	'bar': 2,
	'biz': 3
}

// main.ts
import type {ValueOf} from 'type-fest';
import data = require('./data.json');

export function getData(name: string): ValueOf<typeof data> {
	return data[name];
}

export function onlyBar(name: string): ValueOf<typeof data, 'bar'> {
	return data[name];
}

// file.ts
import {getData, onlyBar} from './main';

getData('foo');
//=> 1

onlyBar('foo');
//=> TypeError ...

onlyBar('bar');
//=> 2
```

@category Object
*/
export type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
import type {Except} from './except';
import type {Simplify} from './simplify';

/**
Create a type that strips `readonly` from all or some of an object's keys. Inverse of `Readonly<T>`.

This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509), or to define a single model where the only thing that changes is whether or not some of the keys are writable.

@example
```
import type {Writable} from 'type-fest';

type Foo = {
	readonly a: number;
	readonly b: readonly string[]; // To show that only the mutability status of the properties, not their values, are affected.
	readonly c: boolean;
};

const writableFoo: Writable<Foo> = {a: 1, b: ['2'], c: true};
writableFoo.a = 3;
writableFoo.b[0] = 'new value'; // Will still fail as the value of property "b" is still a readonly type.
writableFoo.b = ['something']; // Will work as the "b" property itself is no longer readonly.

type SomeWritable = Writable<Foo, 'b' | 'c'>;
// type SomeWritable = {
// 	readonly a: number;
// 	b: readonly string[]; // It's now writable. The type of the property remains unaffected.
// 	c: boolean; // It's now writable.
// }
```

@category Object
*/
export type Writable<BaseType, Keys extends keyof BaseType = keyof BaseType> =
	Simplify<
		// Pick just the keys that are not writable from the base type.
		Except<BaseType, Keys> &
		// Pick the keys that should be writable from the base type and make them writable by removing the `readonly` modifier from the key.
		{-readonly [KeyType in keyof Pick<BaseType, Keys>]: Pick<BaseType, Keys>[KeyType]}
	>;
{
  "name": "replit",
  "private": true,
  "version": "1.0.14",
  "description": "Replit Desktop App",
  "productName": "Replit",
  "scripts": {
    "build": "rimraf dist && esbuild src/main.ts src/preload.ts --target=es2015 --platform=node --format=cjs --packages=external --minify --bundle --outdir=dist",
    "ts:check": "tsc --noEmit",
    "ts:watch": "tsc --noEmit -w",
    "lint": "eslint -c .eslintrc.js --ext .ts ./src",
    "ci": "npm-run-all --parallel build ts:check lint",
    "start": "pnpm build && electron-forge start",
    "start:local": "pnpm build && cross-env REPLIT_URL=http://localhost:3000 electron-forge start",
    "start:staging": "pnpm build && cross-env REPLIT_URL=https://staging.replit.com electron-forge start",
    "package": "pnpm build && electron-forge package",
    "publish": "pnpm build && electron-forge publish",
    "release": "./scripts/release.sh",
    "make": "pnpm build && electron-forge make"
  },
  "author": "Replit",
  "main": "./dist/main.js",
  "engines": {
    "pnpm": ">=8.5.1",
    "node": "^20.10.0"
  },
  "prettier": {
    "trailingComma": "all",
    "singleQuote": true
  },
  "devDependencies": {
    "@electron-forge/cli": "^7.4.0",
    "@electron-forge/maker-deb": "^7.4.0",
    "@electron-forge/maker-dmg": "^7.4.0",
    "@electron-forge/maker-squirrel": "^7.4.0",
    "@electron-forge/maker-zip": "^7.4.0",
    "@electron-forge/publisher-github": "^7.4.0",
    "@types/eslint": "^8.44.2",
    "@types/node": "^20.10.0",
    "@typescript-eslint/eslint-plugin": "^6.4.1",
    "@typescript-eslint/parser": "^4.33.0",
    "cpy": "^9.0.1",
    "cross-env": "^7.0.3",
    "electron": "^30.0.3",
    "electron-winstaller": "^5.3.1",
    "esbuild": "^0.18.6",
    "eslint": "^8.47.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.0",
    "npm-run-all": "^4.1.5",
    "prettier": "^3.0.2",
    "rimraf": "^5.0.1",
    "typescript": "^4.9.5"
  },
  "dependencies": {
    "@sentry/electron": "^4.5.0",
    "electron-log": "5.1.4",
    "electron-squirrel-startup": "^1.0.0",
    "electron-store": "^8.1.0"
  }
}
